Block list amount valivation message

This commit is contained in:
Lan Nguyen Thuy
2025-01-08 17:13:59 +07:00
parent b7f424756c
commit bfd2d35e13

View File

@@ -244,14 +244,26 @@ export class UmbPropertyEditorUIBlockListElement
this.addValidator(
'rangeUnderflow',
() => '#validation_entriesShort',
() => {
return this.localize.term(
'validation_entriesShort',
this._limitMin,
(this._limitMin?? 0) - this.#entriesContext.getLength()
);
},
() => !!this._limitMin && this.#entriesContext.getLength() < this._limitMin,
);
this.addValidator(
'rangeOverflow',
() => '#validation_entriesExceed',
() => !!this._limitMax && this.#entriesContext.getLength() > this._limitMax,
'rangeOverflow',
() => {
return this.localize.term(
'validation_entriesExceed',
this._limitMax,
this.#entriesContext.getLength()
);
},
() => !!this._limitMax && this.#entriesContext.getLength() > this._limitMax,
);
this.observe(this.#entriesContext.layoutEntries, (layouts) => {