small refactor
This commit is contained in:
@@ -21,6 +21,9 @@ export class UmbDocumentScheduleModalElement extends UmbModalBaseElement<
|
||||
@state()
|
||||
_selection: UmbDocumentScheduleModalValue['selection'] = [];
|
||||
|
||||
@state()
|
||||
_isAllSelected?: boolean;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.observe(
|
||||
@@ -29,6 +32,7 @@ export class UmbDocumentScheduleModalElement extends UmbModalBaseElement<
|
||||
this._selection = selection.map((unique) => {
|
||||
return { unique, schedule: {} };
|
||||
});
|
||||
this._isAllSelected = this.#isAllSelected();
|
||||
},
|
||||
'_selection',
|
||||
);
|
||||
@@ -132,7 +136,7 @@ export class UmbDocumentScheduleModalElement extends UmbModalBaseElement<
|
||||
<uui-checkbox
|
||||
@change=${this.#onSelectAllChange}
|
||||
label=${this.localize.term('general_selectAll')}
|
||||
.checked=${this.#isAllSelected()}></uui-checkbox>
|
||||
.checked=${this._isAllSelected}></uui-checkbox>
|
||||
|
||||
${repeat(
|
||||
this._options,
|
||||
|
||||
@@ -28,6 +28,7 @@ export class UmbDocumentVariantLanguagePickerElement extends UmbLitElement {
|
||||
this.selectionManager.selection,
|
||||
(selection) => {
|
||||
this._selection = selection;
|
||||
this._isAllSelected = this.#isAllSelected();
|
||||
},
|
||||
'_selectionManager',
|
||||
);
|
||||
@@ -39,6 +40,9 @@ export class UmbDocumentVariantLanguagePickerElement extends UmbLitElement {
|
||||
@state()
|
||||
_selection: Array<string> = [];
|
||||
|
||||
@state()
|
||||
_isAllSelected?: boolean;
|
||||
|
||||
/**
|
||||
* A filter function that determines if an item is pickableFilter or not.
|
||||
* @memberof UmbDocumentVariantLanguagePickerElement
|
||||
@@ -96,7 +100,7 @@ export class UmbDocumentVariantLanguagePickerElement extends UmbLitElement {
|
||||
<uui-checkbox
|
||||
@change=${this.#onSelectAllChange}
|
||||
label=${this.localize.term('general_selectAll')}
|
||||
.checked=${this.#isAllSelected()}></uui-checkbox>
|
||||
.checked=${this._isAllSelected}></uui-checkbox>
|
||||
${repeat(
|
||||
this.variantLanguageOptions,
|
||||
(option) => option.unique,
|
||||
|
||||
Reference in New Issue
Block a user