update method name
This commit is contained in:
@@ -77,8 +77,8 @@ describe('UmbSelectionManager', () => {
|
||||
expect(manager).to.have.property('clearSelection').that.is.a('function');
|
||||
});
|
||||
|
||||
it('has a setAllow method', () => {
|
||||
expect(manager).to.have.property('setAllow').that.is.a('function');
|
||||
it('has a setAllowLimitation method', () => {
|
||||
expect(manager).to.have.property('setAllowLimitation').that.is.a('function');
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -156,7 +156,7 @@ describe('UmbSelectionManager', () => {
|
||||
});
|
||||
|
||||
it('can not select an item if it does not pass the allow function', () => {
|
||||
manager.setAllow((item) => item !== '2');
|
||||
manager.setAllowLimitation((item) => item !== '2');
|
||||
expect(() => manager.select('2')).to.throw();
|
||||
expect(manager.getSelection()).to.deep.equal([]);
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ export class UmbSelectionManager<ValueType extends string | null = string | null
|
||||
* @param compareFn A function that determines if an item is selectable or not.
|
||||
* @memberof UmbSelectionManager
|
||||
*/
|
||||
public setAllow(compareFn: (unique: ValueType) => boolean): void {
|
||||
public setAllowLimitation(compareFn: (unique: ValueType) => boolean): void {
|
||||
this.#allow = compareFn;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ export class UmbDocumentScheduleModalElement extends UmbModalBaseElement<
|
||||
const pickableFilter = this.data?.pickableFilter;
|
||||
|
||||
if (pickableFilter) {
|
||||
this.#selectionManager.setAllow((unique) => {
|
||||
this.#selectionManager.setAllowLimitation((unique) => {
|
||||
const option = this.data?.options.find((o) => o.unique === unique);
|
||||
return option ? pickableFilter(option) : true;
|
||||
});
|
||||
|
||||
@@ -50,7 +50,7 @@ export class UmbDocumentVariantLanguagePickerElement extends UmbLitElement {
|
||||
super.updated(_changedProperties);
|
||||
|
||||
if (this.selectionManager && this.pickableFilter) {
|
||||
this.#selectionManager.setAllow((unique) => {
|
||||
this.#selectionManager.setAllowLimitation((unique) => {
|
||||
const option = this.variantLanguageOptions.find((o) => o.unique === unique);
|
||||
return option ? this.pickableFilter!(option) : true;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user