@recursyve/nice-selectable-list 19.0.0-beta.0 → 19.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -144,20 +144,39 @@ class NiceSelectableListStore {
144
144
  }
145
145
 
146
146
  const NICE_SELECTABLE_LISTS = new InjectionToken("_selectable_list_providers");
147
- function provideNiceSelectableList(name, config) {
147
+ const NICE_SELECTABLE_LIST = new InjectionToken("_selectable_list_provider");
148
+ function provideNiceSelectableList(...args) {
149
+ const name = typeof args[0] === "string" ? args[0] : null;
150
+ const config = (typeof args[0] === "string" ? args[1] : args[0]);
151
+ if (!name) {
152
+ return {
153
+ provide: NICE_SELECTABLE_LIST,
154
+ useFactory: () => new NiceSelectableListStore({
155
+ idProperty: config?.idProperty ?? "id",
156
+ idType: config?.idType ?? "number"
157
+ })
158
+ };
159
+ }
148
160
  return {
149
161
  provide: NICE_SELECTABLE_LISTS,
150
- useValue: {
162
+ useFactory: () => ({
151
163
  name,
152
164
  store: new NiceSelectableListStore({
153
165
  idProperty: config?.idProperty ?? "id",
154
166
  idType: config?.idType ?? "number"
155
167
  })
156
- },
168
+ }),
157
169
  multi: true
158
170
  };
159
171
  }
160
- function resolveNiceSelectableList(name, options) {
172
+ function resolveNiceSelectableList(...args) {
173
+ const name = typeof args[0] === "string" ? args[0] : null;
174
+ const options = (typeof args[0] === "string" ? args[1] : args[0]);
175
+ if (!name) {
176
+ return (options?.injector
177
+ ? options.injector.get(NICE_SELECTABLE_LIST)
178
+ : inject(NICE_SELECTABLE_LIST));
179
+ }
161
180
  const selectableLists = options?.injector
162
181
  ? options.injector.get(NICE_SELECTABLE_LISTS)
163
182
  : inject(NICE_SELECTABLE_LISTS);
@@ -168,9 +187,9 @@ function resolveNiceSelectableList(name, options) {
168
187
  return provider.store;
169
188
  }
170
189
 
171
- const NICE_SELECTABLE_LIST = new InjectionToken("_selectable_list");
190
+ const NICE_SELECTABLE_LIST_DIRECTIVE = new InjectionToken("_selectable_list_directive");
172
191
  class SelectableListDirective {
173
- name = input.required({ alias: "niceSelectableList" });
192
+ name = input(null, { alias: "niceSelectableList" });
174
193
  enableQueryParams = input(false);
175
194
  checkboxes = contentChildren(NiceSelectableListEntityCheckboxDirective, { descendants: true });
176
195
  _initialized = signal(false);
@@ -181,10 +200,13 @@ class SelectableListDirective {
181
200
  selectableLists;
182
201
  constructor() {
183
202
  effect(() => {
184
- this.selectableLists = resolveNiceSelectableList(this.name(), { injector: this.injector });
203
+ const name = this.name();
204
+ this.selectableLists = name
205
+ ? resolveNiceSelectableList(name, { injector: this.injector })
206
+ : resolveNiceSelectableList({ injector: this.injector });
185
207
  });
186
208
  effect(() => {
187
- if (!this._initialized()) {
209
+ if (!this._initialized() || !this.name()) {
188
210
  return;
189
211
  }
190
212
  if (!this.enableQueryParams()) {
@@ -202,7 +224,7 @@ class SelectableListDirective {
202
224
  if (!this._initialized()) {
203
225
  return;
204
226
  }
205
- const shouldWrite = untracked(() => this.enableQueryParams());
227
+ const shouldWrite = untracked(() => this.enableQueryParams() && this.name());
206
228
  if (!shouldWrite) {
207
229
  return;
208
230
  }
@@ -245,8 +267,8 @@ class SelectableListDirective {
245
267
  }
246
268
  }
247
269
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SelectableListDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
248
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.2.14", type: SelectableListDirective, isStandalone: true, selector: "[niceSelectableList]", inputs: { name: { classPropertyName: "name", publicName: "niceSelectableList", isSignal: true, isRequired: true, transformFunction: null }, enableQueryParams: { classPropertyName: "enableQueryParams", publicName: "enableQueryParams", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
249
- { provide: NICE_SELECTABLE_LIST, useExisting: forwardRef(() => SelectableListDirective) }
270
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.2.14", type: SelectableListDirective, isStandalone: true, selector: "[niceSelectableList]", inputs: { name: { classPropertyName: "name", publicName: "niceSelectableList", isSignal: true, isRequired: false, transformFunction: null }, enableQueryParams: { classPropertyName: "enableQueryParams", publicName: "enableQueryParams", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
271
+ { provide: NICE_SELECTABLE_LIST_DIRECTIVE, useExisting: forwardRef(() => SelectableListDirective) }
250
272
  ], queries: [{ propertyName: "checkboxes", predicate: NiceSelectableListEntityCheckboxDirective, descendants: true, isSignal: true }], ngImport: i0 });
251
273
  }
252
274
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SelectableListDirective, decorators: [{
@@ -254,22 +276,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
254
276
  args: [{
255
277
  selector: "[niceSelectableList]",
256
278
  providers: [
257
- { provide: NICE_SELECTABLE_LIST, useExisting: forwardRef(() => SelectableListDirective) }
279
+ { provide: NICE_SELECTABLE_LIST_DIRECTIVE, useExisting: forwardRef(() => SelectableListDirective) }
258
280
  ]
259
281
  }]
260
282
  }], ctorParameters: () => [] });
261
283
 
262
284
  function injectNiceSelectableListDirective() {
263
- return inject(NICE_SELECTABLE_LIST);
285
+ return inject(NICE_SELECTABLE_LIST_DIRECTIVE, { optional: true });
264
286
  }
265
287
  function injectNiceSelectableList(name) {
266
- if (!name) {
267
- name = injectNiceSelectableListDirective().name();
288
+ const storeName = name ?? injectNiceSelectableListDirective()?.name();
289
+ if (!storeName) {
290
+ return inject(NICE_SELECTABLE_LIST);
268
291
  }
269
292
  const selectableLists = inject(NICE_SELECTABLE_LISTS);
270
- const provider = selectableLists.find((_provider) => _provider.name === name);
293
+ const provider = selectableLists.find((_provider) => _provider.name === storeName);
271
294
  if (!provider) {
272
- throw new Error(`No selectable list provider found for name: ${name}`);
295
+ throw new Error(`No selectable list provider found for name: ${storeName}`);
273
296
  }
274
297
  return provider.store;
275
298
  }
@@ -356,5 +379,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
356
379
  * Generated bundle index. Do not edit.
357
380
  */
358
381
 
359
- export { NICE_SELECTABLE_LIST, NICE_SELECTABLE_LISTS, NiceSelectableListEntityCheckboxDirective, NiceSelectableListHeaderCheckboxDirective, NiceSelectableListStore, SelectableListDirective, injectNiceSelectableList, injectNiceSelectableListDirective, provideNiceSelectableList, resolveNiceSelectableList };
382
+ export { NICE_SELECTABLE_LIST, NICE_SELECTABLE_LISTS, NICE_SELECTABLE_LIST_DIRECTIVE, NiceSelectableListEntityCheckboxDirective, NiceSelectableListHeaderCheckboxDirective, NiceSelectableListStore, SelectableListDirective, injectNiceSelectableList, injectNiceSelectableListDirective, provideNiceSelectableList, resolveNiceSelectableList };
360
383
  //# sourceMappingURL=recursyve-nice-selectable-list.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"recursyve-nice-selectable-list.mjs","sources":["../../../src/nice-selectable-list/selectable-list/store.ts","../../../src/nice-selectable-list/selectable-list/provider.ts","../../../src/nice-selectable-list/selectable-list/selectable-list.ts","../../../src/nice-selectable-list/selectable-list/injector.ts","../../../src/nice-selectable-list/selectable-list/entity-checkbox.directive.ts","../../../src/nice-selectable-list/selectable-list/header-checkbox.directive.ts","../../../src/nice-selectable-list/recursyve-nice-selectable-list.ts"],"sourcesContent":["import { computed, Signal, signal } from \"@angular/core\";\nimport { NiceSelectableListEntityCheckboxDirective } from \"./entity-checkbox.directive\";\n\nexport type NiceSelectableListConfig<T> = {\n idProperty: keyof T;\n idType?: \"string\" | \"number\";\n}\n\nexport type NiceSelectableListEntity<T> = {\n id: string | number;\n entity: T | null;\n};\n\nexport class NiceSelectableListStore<T> {\n private readonly _entities = signal<NiceSelectableListEntity<T>[]>([]);\n private readonly _activeEntity = signal<NiceSelectableListEntity<T> | null>(null);\n private readonly _checkboxes = signal<NiceSelectableListEntityCheckboxDirective<T>[]>([]);\n\n public readonly entities = this._entities.asReadonly();\n public readonly activeEntity = this._activeEntity.asReadonly();\n\n public readonly total = computed(() => this._entities().length);\n public readonly entitiesIds = computed(() => this._entities().map((entity) => entity.id));\n public readonly activeEntityId = computed(() => this._activeEntity()?.id ?? null);\n\n constructor(private readonly _config: NiceSelectableListConfig<T>) {}\n\n public registerCheckbox(checkbox: NiceSelectableListEntityCheckboxDirective<T>): void {\n this._checkboxes.update((checkboxes) => [...checkboxes, checkbox]);\n\n const id = this._resolveEntityId(checkbox.selectableEntity());\n const entity = this._entities().find((_entity) => _entity.id === id);\n if (entity && entity.entity === null) {\n this._entities.update(\n (_entities) => _entities.map((_entity) =>\n _entity.id === id ? { id, entity: checkbox.selectableEntity() } : _entity\n )\n );\n entity.entity = checkbox.selectableEntity();\n }\n }\n\n public unregisterCheckbox(checkbox: NiceSelectableListEntityCheckboxDirective<T>): void {\n this._checkboxes.update((checkboxes) => checkboxes.filter((_checkbox) => _checkbox !== checkbox));\n }\n\n public isEntitySelected(entity: T): Signal<boolean> {\n return computed(() => this._isEntitySelected(entity));\n }\n\n public setEntitiesFromSelections(selections: string[]): void {\n const ids: (string | number)[] = this._config.idType === \"string\" ? selections : selections.map((id) => +id);\n\n const registeredEntities = this._checkboxes().map((checkbox) => ({\n id: this._resolveEntityId(checkbox.selectableEntity()), entity: checkbox.selectableEntity()\n }));\n const entities = ids.map((id) => ({\n id,\n entity: registeredEntities.find(_entity => _entity.id === id)?.entity ?? null\n }));\n this._entities.set(entities);\n }\n\n public selectEntity(entity: T): void {\n const isSelected = this._isEntitySelected(entity);\n if (isSelected) {\n return;\n }\n\n const id = this._resolveEntityId(entity);\n this._entities.update((entities) => [...entities, { id, entity }]);\n }\n\n public deselectEntity(entity: T): void {\n const isSelected = this._isEntitySelected(entity);\n if (!isSelected) {\n return;\n }\n\n const id = this._resolveEntityId(entity);\n this._entities.update((entities) => entities.filter((_entity) => _entity.id !== id));\n }\n\n public clear(): void {\n this._entities.set([]);\n this._activeEntity.set(null);\n }\n\n public setActiveFromSelected(selected: string): void {\n const id = this._config.idType === \"string\" ? selected : +selected;\n const entity = this._entities().find((_entity) => _entity.id === id);\n if (!entity) {\n return;\n }\n\n this._activeEntity.set(entity);\n }\n\n public setActiveEntity(entity: T | null): void {\n if (!entity) {\n this._activeEntity.set(null);\n return;\n }\n\n const id = this._resolveEntityId(entity);\n this._activeEntity.set({ id, entity });\n }\n\n public selectFirstEntity(): void {\n const entity = this._entities()[0];\n if (!entity) {\n return;\n }\n\n this._activeEntity.set(entity);\n }\n\n public selectNextEntity(): void {\n const entities = this._entities();\n const activeEntity = this._activeEntity();\n if (!activeEntity) {\n this.selectFirstEntity();\n return;\n }\n\n const index = entities.findIndex((_entity) => activeEntity.id === _entity.id);\n const nextEntity = entities[index + 1];\n if (!nextEntity) {\n return;\n }\n\n this._activeEntity.set(nextEntity);\n }\n\n public selectPreviousEntity(): void {\n const entities = this._entities();\n const activeEntity = this._activeEntity();\n if (!activeEntity) {\n this.selectFirstEntity();\n return;\n }\n\n const index = entities.findIndex((_entity) => activeEntity.id === _entity.id);\n if (index === 0) {\n return;\n }\n\n const previousEntity = entities[index - 1];\n if (!previousEntity) {\n return;\n }\n\n this._activeEntity.set(previousEntity);\n }\n\n public selectLastEntity(): void {\n const entities = this._entities();\n if (entities.length === 0) {\n return;\n }\n\n const lastEntity = entities[entities.length - 1];\n if (!lastEntity) {\n return;\n }\n\n this._activeEntity.set(lastEntity);\n }\n\n private _isEntitySelected(entity: T): boolean {\n const id = this._resolveEntityId(entity);\n return this._entities().findIndex((_entity) => _entity.id === id) >= 0;\n }\n\n private _resolveEntityId(entity: T): string | number {\n const idProperty = this._config.idProperty;\n const id = entity[idProperty];\n if (typeof id !== \"string\" && typeof id !== \"number\") {\n throw new Error(`The id property must be a string or a number, but got ${typeof id}`);\n }\n\n return id;\n }\n}\n","import { inject, InjectionToken, Injector, Provider } from \"@angular/core\";\nimport { NiceSelectableListConfig, NiceSelectableListStore } from \"./store\";\n\nexport const NICE_SELECTABLE_LISTS\n = new InjectionToken<NiceSelectableListProvider<unknown>[]>(\"_selectable_list_providers\");\n\nexport type NiceSelectableListProvider<T> = {\n name: string;\n store: NiceSelectableListStore<T>;\n};\n\nexport function provideNiceSelectableList<T>(name: string, config?: NiceSelectableListConfig<T>): Provider {\n return {\n provide: NICE_SELECTABLE_LISTS,\n useValue: {\n name,\n store: new NiceSelectableListStore({\n idProperty: config?.idProperty ?? \"id\" as keyof T,\n idType: config?.idType ?? \"number\" as \"string\" | \"number\"\n })\n },\n multi: true\n };\n}\n\nexport function resolveNiceSelectableList<T>(name: string, options?: {\n injector: Injector\n}): NiceSelectableListStore<T> {\n const selectableLists = options?.injector\n ? options.injector.get(NICE_SELECTABLE_LISTS)\n : inject(NICE_SELECTABLE_LISTS);\n\n const provider = selectableLists.find((_provider) => _provider.name === name);\n if (!provider) {\n throw new Error(`No selectable list provider found for name: ${name}`);\n }\n\n return provider.store as NiceSelectableListStore<T>;\n}\n","import {\n contentChildren,\n Directive,\n effect,\n forwardRef,\n inject,\n InjectionToken,\n Injector,\n input,\n OnInit,\n signal,\n Signal,\n untracked\n} from \"@angular/core\";\nimport { ActivatedRoute, NavigationEnd, Router } from \"@angular/router\";\nimport { filter, take } from \"rxjs\";\nimport { NiceSelectableListEntityCheckboxDirective } from \"./entity-checkbox.directive\";\nimport { resolveNiceSelectableList } from \"./provider\";\nimport { NiceSelectableListStore } from \"./store\";\n\nexport const NICE_SELECTABLE_LIST = new InjectionToken<NiceSelectableList<unknown>>(\"_selectable_list\");\nexport type NiceSelectableList<T> = {\n name: Signal<string>;\n checkboxes: Signal<readonly NiceSelectableListEntityCheckboxDirective<T>[]>;\n};\n\n@Directive({\n selector: \"[niceSelectableList]\",\n providers: [\n { provide: NICE_SELECTABLE_LIST, useExisting: forwardRef(() => SelectableListDirective) }\n ]\n})\nexport class SelectableListDirective<T> implements NiceSelectableList<T>, OnInit {\n public readonly name = input.required<string>({ alias: \"niceSelectableList\" });\n public readonly enableQueryParams = input<boolean>(false);\n\n public readonly checkboxes = contentChildren<NiceSelectableListEntityCheckboxDirective<T>>(\n NiceSelectableListEntityCheckboxDirective,\n { descendants: true }\n );\n\n private readonly _initialized = signal(false);\n public readonly initialized = this._initialized.asReadonly();\n\n protected readonly route = inject(ActivatedRoute);\n protected readonly router = inject(Router);\n protected readonly injector = inject(Injector);\n\n protected selectableLists!: NiceSelectableListStore<T>;\n\n constructor() {\n effect(() => {\n this.selectableLists = resolveNiceSelectableList(this.name(), { injector: this.injector });\n });\n\n effect(() => {\n if (!this._initialized()) {\n return;\n }\n\n if (!this.enableQueryParams()) {\n this.router.navigate([], {\n relativeTo: this.route,\n queryParams: {\n selections: null,\n selected: null\n }\n });\n return;\n }\n });\n\n effect(() => {\n if (!this._initialized()) {\n return;\n }\n\n const shouldWrite = untracked(() => this.enableQueryParams());\n if (!shouldWrite) {\n return;\n }\n\n const entities = this.selectableLists.entitiesIds();\n const activeEntity = this.selectableLists.activeEntityId();\n this.router.navigate([], {\n relativeTo: this.route,\n queryParams: {\n selections: entities,\n selected: activeEntity\n }\n });\n });\n }\n\n public ngOnInit(): void {\n this.loadQueryParams();\n }\n\n private loadQueryParams(): void {\n if (this.router.navigated) {\n this.parseQueryParams(this.route.snapshot.queryParams);\n this._initialized.set(true);\n return;\n }\n\n this.router.events\n .pipe(\n filter((event) => event instanceof NavigationEnd),\n take(1)\n )\n .subscribe(() => {\n this.parseQueryParams(this.route.snapshot.queryParams);\n this._initialized.set(true);\n });\n }\n\n private parseQueryParams(params: {\n selections?: string | string[];\n selected?: string;\n }): void {\n if (params.selections) {\n const selections = Array.isArray(params.selections)\n ? params.selections\n : [params.selections]\n this.selectableLists.setEntitiesFromSelections(selections);\n }\n\n if (params.selected) {\n this.selectableLists.setActiveFromSelected(params.selected);\n }\n }\n}\n","import { inject } from \"@angular/core\";\nimport { NICE_SELECTABLE_LISTS } from \"./provider\";\nimport { NICE_SELECTABLE_LIST, NiceSelectableList } from \"./selectable-list\";\nimport { NiceSelectableListStore } from \"./store\";\n\nexport function injectNiceSelectableListDirective<T>(): NiceSelectableList<T> {\n return inject(NICE_SELECTABLE_LIST) as NiceSelectableList<T>;\n}\n\nexport function injectNiceSelectableList<T>(name?: string): NiceSelectableListStore<T> {\n if (!name) {\n name = injectNiceSelectableListDirective().name();\n }\n\n const selectableLists = inject(NICE_SELECTABLE_LISTS);\n const provider = selectableLists.find((_provider) => _provider.name === name);\n if (!provider) {\n throw new Error(`No selectable list provider found for name: ${name}`);\n }\n\n return provider.store as NiceSelectableListStore<T>;\n}\n","import { computed, DestroyRef, Directive, effect, inject, input, OnDestroy, OnInit } from \"@angular/core\";\nimport { takeUntilDestroyed } from \"@angular/core/rxjs-interop\";\nimport { MatCheckbox } from \"@angular/material/checkbox\";\nimport { injectNiceSelectableList } from \"./injector\";\n\n@Directive({\n selector: \"mat-checkbox[niceSelectableListEntityCheckbox]\"\n})\nexport class NiceSelectableListEntityCheckboxDirective<T> implements OnInit, OnDestroy {\n protected readonly matCheckbox = inject(MatCheckbox);\n protected readonly destroyRef = inject(DestroyRef);\n protected readonly niceSelectableList = injectNiceSelectableList<T>();\n\n public readonly selectableEntity = input.required<T>();\n public readonly isSelected = computed(() => this.niceSelectableList.isEntitySelected(this.selectableEntity())());\n\n constructor() {\n effect(() => {\n this.matCheckbox.checked = this.niceSelectableList.isEntitySelected(this.selectableEntity())();\n });\n }\n\n public ngOnInit(): void {\n this.niceSelectableList.registerCheckbox(this);\n\n this.matCheckbox.change.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(({ checked }) => {\n if (checked) {\n this.niceSelectableList.selectEntity(this.selectableEntity());\n } else {\n this.niceSelectableList.deselectEntity(this.selectableEntity());\n }\n });\n }\n\n public ngOnDestroy(): void {\n this.niceSelectableList.unregisterCheckbox(this);\n }\n\n public selectEntity(): void {\n this.matCheckbox.checked = true;\n this.matCheckbox.change.emit({ checked: true, source: this.matCheckbox });\n }\n\n public deselectEntity(): void {\n this.matCheckbox.checked = false;\n this.matCheckbox.change.emit({ checked: false, source: this.matCheckbox });\n }\n}\n","import { afterRenderEffect, DestroyRef, Directive, inject, OnInit } from \"@angular/core\";\nimport { takeUntilDestroyed } from \"@angular/core/rxjs-interop\";\nimport { MatCheckbox } from \"@angular/material/checkbox\";\nimport { injectNiceSelectableListDirective } from \"./injector\";\n\n@Directive({\n selector: \"mat-checkbox[niceSelectableListHeaderCheckbox]\"\n})\nexport class NiceSelectableListHeaderCheckboxDirective<T> implements OnInit {\n private readonly niceSelectableListDirective = injectNiceSelectableListDirective<T>();\n private readonly matCheckbox = inject(MatCheckbox);\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n afterRenderEffect({\n read: () => {\n const checkboxes = this.niceSelectableListDirective.checkboxes();\n const empty = checkboxes.length === 0;\n\n this.matCheckbox.checked = !empty && checkboxes.every((checkbox) => checkbox.isSelected());\n this.matCheckbox.indeterminate = !this.matCheckbox.checked\n && checkboxes.some((checkbox) => checkbox.isSelected());\n }\n });\n }\n\n public ngOnInit(): void {\n this.matCheckbox.change.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(({ checked }) => {\n if (checked) {\n this.niceSelectableListDirective.checkboxes().forEach((checkbox) => checkbox.selectEntity());\n } else {\n this.niceSelectableListDirective.checkboxes().forEach((checkbox) => checkbox.deselectEntity());\n }\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAaa,uBAAuB,CAAA;AAYH,IAAA,OAAA;AAXZ,IAAA,SAAS,GAAG,MAAM,CAAgC,EAAE,CAAC;AACrD,IAAA,aAAa,GAAG,MAAM,CAAqC,IAAI,CAAC;AAChE,IAAA,WAAW,GAAG,MAAM,CAAiD,EAAE,CAAC;AAEzE,IAAA,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE;AACtC,IAAA,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE;AAE9C,IAAA,KAAK,GA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U,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,KAAI;YACxF,IAAI,OAAO,EAAE;AACT,gBAAA,IAAI,CAAC,2BAA2B,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,YAAY,EAAE,CAAC;;iBACzF;AACH,gBAAA,IAAI,CAAC,2BAA2B,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,cAAc,EAAE,CAAC;;AAEtG,SAAC,CAAC;;wGAzBG,yCAAyC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAzC,yCAAyC,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gDAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAAzC,yCAAyC,EAAA,UAAA,EAAA,CAAA;kBAHrD,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE;AACb,iBAAA;;;ACPD;;AAEG;;;;"}
1
+ {"version":3,"file":"recursyve-nice-selectable-list.mjs","sources":["../../../src/nice-selectable-list/selectable-list/store.ts","../../../src/nice-selectable-list/selectable-list/provider.ts","../../../src/nice-selectable-list/selectable-list/selectable-list.ts","../../../src/nice-selectable-list/selectable-list/injector.ts","../../../src/nice-selectable-list/selectable-list/entity-checkbox.directive.ts","../../../src/nice-selectable-list/selectable-list/header-checkbox.directive.ts","../../../src/nice-selectable-list/recursyve-nice-selectable-list.ts"],"sourcesContent":["import { computed, Signal, signal } from \"@angular/core\";\nimport { NiceSelectableListEntityCheckboxDirective } from \"./entity-checkbox.directive\";\n\nexport type NiceSelectableListConfig<T> = {\n idProperty: keyof T;\n idType?: \"string\" | \"number\";\n}\n\nexport type NiceSelectableListEntity<T> = {\n id: string | number;\n entity: T | null;\n};\n\nexport class NiceSelectableListStore<T> {\n private readonly _entities = signal<NiceSelectableListEntity<T>[]>([]);\n private readonly _activeEntity = signal<NiceSelectableListEntity<T> | null>(null);\n private readonly _checkboxes = signal<NiceSelectableListEntityCheckboxDirective<T>[]>([]);\n\n public readonly entities = this._entities.asReadonly();\n public readonly activeEntity = this._activeEntity.asReadonly();\n\n public readonly total = computed(() => this._entities().length);\n public readonly entitiesIds = computed(() => this._entities().map((entity) => entity.id));\n public readonly activeEntityId = computed(() => this._activeEntity()?.id ?? null);\n\n constructor(private readonly _config: NiceSelectableListConfig<T>) {}\n\n public registerCheckbox(checkbox: NiceSelectableListEntityCheckboxDirective<T>): void {\n this._checkboxes.update((checkboxes) => [...checkboxes, checkbox]);\n\n const id = this._resolveEntityId(checkbox.selectableEntity());\n const entity = this._entities().find((_entity) => _entity.id === id);\n if (entity && entity.entity === null) {\n this._entities.update(\n (_entities) => _entities.map((_entity) =>\n _entity.id === id ? { id, entity: checkbox.selectableEntity() } : _entity\n )\n );\n entity.entity = checkbox.selectableEntity();\n }\n }\n\n public unregisterCheckbox(checkbox: NiceSelectableListEntityCheckboxDirective<T>): void {\n this._checkboxes.update((checkboxes) => checkboxes.filter((_checkbox) => _checkbox !== checkbox));\n }\n\n public isEntitySelected(entity: T): Signal<boolean> {\n return computed(() => this._isEntitySelected(entity));\n }\n\n public setEntitiesFromSelections(selections: string[]): void {\n const ids: (string | number)[] = this._config.idType === \"string\" ? selections : selections.map((id) => +id);\n\n const registeredEntities = this._checkboxes().map((checkbox) => ({\n id: this._resolveEntityId(checkbox.selectableEntity()), entity: checkbox.selectableEntity()\n }));\n const entities = ids.map((id) => ({\n id,\n entity: registeredEntities.find(_entity => _entity.id === id)?.entity ?? null\n }));\n this._entities.set(entities);\n }\n\n public selectEntity(entity: T): void {\n const isSelected = this._isEntitySelected(entity);\n if (isSelected) {\n return;\n }\n\n const id = this._resolveEntityId(entity);\n this._entities.update((entities) => [...entities, { id, entity }]);\n }\n\n public deselectEntity(entity: T): void {\n const isSelected = this._isEntitySelected(entity);\n if (!isSelected) {\n return;\n }\n\n const id = this._resolveEntityId(entity);\n this._entities.update((entities) => entities.filter((_entity) => _entity.id !== id));\n }\n\n public clear(): void {\n this._entities.set([]);\n this._activeEntity.set(null);\n }\n\n public setActiveFromSelected(selected: string): void {\n const id = this._config.idType === \"string\" ? selected : +selected;\n const entity = this._entities().find((_entity) => _entity.id === id);\n if (!entity) {\n return;\n }\n\n this._activeEntity.set(entity);\n }\n\n public setActiveEntity(entity: T | null): void {\n if (!entity) {\n this._activeEntity.set(null);\n return;\n }\n\n const id = this._resolveEntityId(entity);\n this._activeEntity.set({ id, entity });\n }\n\n public selectFirstEntity(): void {\n const entity = this._entities()[0];\n if (!entity) {\n return;\n }\n\n this._activeEntity.set(entity);\n }\n\n public selectNextEntity(): void {\n const entities = this._entities();\n const activeEntity = this._activeEntity();\n if (!activeEntity) {\n this.selectFirstEntity();\n return;\n }\n\n const index = entities.findIndex((_entity) => activeEntity.id === _entity.id);\n const nextEntity = entities[index + 1];\n if (!nextEntity) {\n return;\n }\n\n this._activeEntity.set(nextEntity);\n }\n\n public selectPreviousEntity(): void {\n const entities = this._entities();\n const activeEntity = this._activeEntity();\n if (!activeEntity) {\n this.selectFirstEntity();\n return;\n }\n\n const index = entities.findIndex((_entity) => activeEntity.id === _entity.id);\n if (index === 0) {\n return;\n }\n\n const previousEntity = entities[index - 1];\n if (!previousEntity) {\n return;\n }\n\n this._activeEntity.set(previousEntity);\n }\n\n public selectLastEntity(): void {\n const entities = this._entities();\n if (entities.length === 0) {\n return;\n }\n\n const lastEntity = entities[entities.length - 1];\n if (!lastEntity) {\n return;\n }\n\n this._activeEntity.set(lastEntity);\n }\n\n private _isEntitySelected(entity: T): boolean {\n const id = this._resolveEntityId(entity);\n return this._entities().findIndex((_entity) => _entity.id === id) >= 0;\n }\n\n private _resolveEntityId(entity: T): string | number {\n const idProperty = this._config.idProperty;\n const id = entity[idProperty];\n if (typeof id !== \"string\" && typeof id !== \"number\") {\n throw new Error(`The id property must be a string or a number, but got ${typeof id}`);\n }\n\n return id;\n }\n}\n","import { FactoryProvider, inject, InjectionToken, Injector } from \"@angular/core\";\nimport { NiceSelectableListConfig, NiceSelectableListStore } from \"./store\";\n\nexport const NICE_SELECTABLE_LISTS\n = new InjectionToken<NiceSelectableListProvider<unknown>[]>(\"_selectable_list_providers\");\n\nexport const NICE_SELECTABLE_LIST\n = new InjectionToken<NiceSelectableListStore<unknown>>(\"_selectable_list_provider\");\n\nexport type NiceSelectableListProvider<T> = {\n name: string;\n store: NiceSelectableListStore<T>;\n};\n\nexport function provideNiceSelectableList<T>(config?: NiceSelectableListConfig<T>): FactoryProvider;\nexport function provideNiceSelectableList<T>(name: string, config?: NiceSelectableListConfig<T>): FactoryProvider;\nexport function provideNiceSelectableList<T>(...args: unknown[]): FactoryProvider {\n const name: string | null = typeof args[0] === \"string\" ? args[0] : null;\n const config = (typeof args[0] === \"string\" ? args[1] : args[0]) as NiceSelectableListConfig<T> | undefined;\n\n if (!name) {\n return {\n provide: NICE_SELECTABLE_LIST,\n useFactory: () => new NiceSelectableListStore({\n idProperty: config?.idProperty ?? \"id\" as keyof T,\n idType: config?.idType ?? \"number\" as \"string\" | \"number\"\n })\n };\n }\n\n return {\n provide: NICE_SELECTABLE_LISTS,\n useFactory: () => ({\n name,\n store: new NiceSelectableListStore({\n idProperty: config?.idProperty ?? \"id\" as keyof T,\n idType: config?.idType ?? \"number\" as \"string\" | \"number\"\n })\n }),\n multi: true\n };\n}\n\nexport type ResolveNiceSelectableListOptions = { injector: Injector };\n\nexport function resolveNiceSelectableList<T>(\n name: string,\n options?: ResolveNiceSelectableListOptions\n): NiceSelectableListStore<T>;\nexport function resolveNiceSelectableList<T>(options?: ResolveNiceSelectableListOptions): NiceSelectableListStore<T>;\nexport function resolveNiceSelectableList<T>(...args: unknown[]): NiceSelectableListStore<T> {\n const name: string | null = typeof args[0] === \"string\" ? args[0] : null;\n const options = (typeof args[0] === \"string\" ? args[1] : args[0]) as ResolveNiceSelectableListOptions | undefined;\n\n if (!name) {\n return (options?.injector\n ? options.injector.get(NICE_SELECTABLE_LIST)\n : inject(NICE_SELECTABLE_LIST)) as NiceSelectableListStore<T>;\n }\n\n const selectableLists = options?.injector\n ? options.injector.get(NICE_SELECTABLE_LISTS)\n : inject(NICE_SELECTABLE_LISTS);\n\n const provider = selectableLists.find((_provider) => _provider.name === name);\n if (!provider) {\n throw new Error(`No selectable list provider found for name: ${name}`);\n }\n\n return provider.store as NiceSelectableListStore<T>;\n}\n","import {\n contentChildren,\n Directive,\n effect,\n forwardRef,\n inject,\n InjectionToken,\n Injector,\n input,\n OnInit,\n signal,\n Signal,\n untracked\n} from \"@angular/core\";\nimport { ActivatedRoute, NavigationEnd, Router } from \"@angular/router\";\nimport { filter, take } from \"rxjs\";\nimport { NiceSelectableListEntityCheckboxDirective } from \"./entity-checkbox.directive\";\nimport { resolveNiceSelectableList } from \"./provider\";\nimport { NiceSelectableListStore } from \"./store\";\n\nexport const NICE_SELECTABLE_LIST_DIRECTIVE\n = new InjectionToken<NiceSelectableList<unknown>>(\"_selectable_list_directive\");\n\nexport type NiceSelectableList<T> = {\n name: Signal<string | null>;\n checkboxes: Signal<readonly NiceSelectableListEntityCheckboxDirective<T>[]>;\n};\n\n@Directive({\n selector: \"[niceSelectableList]\",\n providers: [\n { provide: NICE_SELECTABLE_LIST_DIRECTIVE, useExisting: forwardRef(() => SelectableListDirective) }\n ]\n})\nexport class SelectableListDirective<T> implements NiceSelectableList<T>, OnInit {\n public readonly name = input<string | null>(null, { alias: \"niceSelectableList\" });\n public readonly enableQueryParams = input<boolean>(false);\n\n public readonly checkboxes = contentChildren<NiceSelectableListEntityCheckboxDirective<T>>(\n NiceSelectableListEntityCheckboxDirective,\n { descendants: true }\n );\n\n private readonly _initialized = signal(false);\n public readonly initialized = this._initialized.asReadonly();\n\n protected readonly route = inject(ActivatedRoute);\n protected readonly router = inject(Router);\n protected readonly injector = inject(Injector);\n\n protected selectableLists!: NiceSelectableListStore<T>;\n\n constructor() {\n effect(() => {\n const name = this.name();\n this.selectableLists = name\n ? resolveNiceSelectableList(name, { injector: this.injector })\n : resolveNiceSelectableList({ injector: this.injector });\n });\n\n effect(() => {\n if (!this._initialized() || !this.name()) {\n return;\n }\n\n if (!this.enableQueryParams()) {\n this.router.navigate([], {\n relativeTo: this.route,\n queryParams: {\n selections: null,\n selected: null\n }\n });\n return;\n }\n });\n\n effect(() => {\n if (!this._initialized()) {\n return;\n }\n\n const shouldWrite = untracked(() => this.enableQueryParams() && this.name());\n if (!shouldWrite) {\n return;\n }\n\n const entities = this.selectableLists.entitiesIds();\n const activeEntity = this.selectableLists.activeEntityId();\n this.router.navigate([], {\n relativeTo: this.route,\n queryParams: {\n selections: entities,\n selected: activeEntity\n }\n });\n });\n }\n\n public ngOnInit(): void {\n this.loadQueryParams();\n }\n\n private loadQueryParams(): void {\n if (this.router.navigated) {\n this.parseQueryParams(this.route.snapshot.queryParams);\n this._initialized.set(true);\n return;\n }\n\n this.router.events\n .pipe(\n filter((event) => event instanceof NavigationEnd),\n take(1)\n )\n .subscribe(() => {\n this.parseQueryParams(this.route.snapshot.queryParams);\n this._initialized.set(true);\n });\n }\n\n private parseQueryParams(params: {\n selections?: string | string[];\n selected?: string;\n }): void {\n if (params.selections) {\n const selections = Array.isArray(params.selections)\n ? params.selections\n : [params.selections]\n this.selectableLists.setEntitiesFromSelections(selections);\n }\n\n if (params.selected) {\n this.selectableLists.setActiveFromSelected(params.selected);\n }\n }\n}\n","import { inject } from \"@angular/core\";\nimport { NICE_SELECTABLE_LIST, NICE_SELECTABLE_LISTS } from \"./provider\";\nimport { NICE_SELECTABLE_LIST_DIRECTIVE, NiceSelectableList } from \"./selectable-list\";\nimport { NiceSelectableListStore } from \"./store\";\n\nexport function injectNiceSelectableListDirective<T>(): NiceSelectableList<T> {\n return inject(NICE_SELECTABLE_LIST_DIRECTIVE, { optional: true }) as NiceSelectableList<T>;\n}\n\nexport function injectNiceSelectableList<T>(name?: string): NiceSelectableListStore<T> {\n const storeName = name ?? injectNiceSelectableListDirective()?.name();\n if (!storeName) {\n return inject(NICE_SELECTABLE_LIST) as NiceSelectableListStore<T>;\n }\n\n const selectableLists = inject(NICE_SELECTABLE_LISTS);\n const provider = selectableLists.find((_provider) => _provider.name === storeName);\n if (!provider) {\n throw new Error(`No selectable list provider found for name: ${storeName}`);\n }\n\n return provider.store as NiceSelectableListStore<T>;\n}\n","import { computed, DestroyRef, Directive, effect, inject, input, OnDestroy, OnInit } from \"@angular/core\";\nimport { takeUntilDestroyed } from \"@angular/core/rxjs-interop\";\nimport { MatCheckbox } from \"@angular/material/checkbox\";\nimport { injectNiceSelectableList } from \"./injector\";\n\n@Directive({\n selector: \"mat-checkbox[niceSelectableListEntityCheckbox]\"\n})\nexport class NiceSelectableListEntityCheckboxDirective<T> implements OnInit, OnDestroy {\n protected readonly matCheckbox = inject(MatCheckbox);\n protected readonly destroyRef = inject(DestroyRef);\n protected readonly niceSelectableList = injectNiceSelectableList<T>();\n\n public readonly selectableEntity = input.required<T>();\n public readonly isSelected = computed(() => this.niceSelectableList.isEntitySelected(this.selectableEntity())());\n\n constructor() {\n effect(() => {\n this.matCheckbox.checked = this.niceSelectableList.isEntitySelected(this.selectableEntity())();\n });\n }\n\n public ngOnInit(): void {\n this.niceSelectableList.registerCheckbox(this);\n\n this.matCheckbox.change.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(({ checked }) => {\n if (checked) {\n this.niceSelectableList.selectEntity(this.selectableEntity());\n } else {\n this.niceSelectableList.deselectEntity(this.selectableEntity());\n }\n });\n }\n\n public ngOnDestroy(): void {\n this.niceSelectableList.unregisterCheckbox(this);\n }\n\n public selectEntity(): void {\n this.matCheckbox.checked = true;\n this.matCheckbox.change.emit({ checked: true, source: this.matCheckbox });\n }\n\n public deselectEntity(): void {\n this.matCheckbox.checked = false;\n this.matCheckbox.change.emit({ checked: false, source: this.matCheckbox });\n }\n}\n","import { afterRenderEffect, DestroyRef, Directive, inject, OnInit } from \"@angular/core\";\nimport { takeUntilDestroyed } from \"@angular/core/rxjs-interop\";\nimport { MatCheckbox } from \"@angular/material/checkbox\";\nimport { injectNiceSelectableListDirective } from \"./injector\";\n\n@Directive({\n selector: \"mat-checkbox[niceSelectableListHeaderCheckbox]\"\n})\nexport class NiceSelectableListHeaderCheckboxDirective<T> implements OnInit {\n private readonly niceSelectableListDirective = injectNiceSelectableListDirective<T>();\n private readonly matCheckbox = inject(MatCheckbox);\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n afterRenderEffect({\n read: () => {\n const checkboxes = this.niceSelectableListDirective.checkboxes();\n const empty = checkboxes.length === 0;\n\n this.matCheckbox.checked = !empty && checkboxes.every((checkbox) => checkbox.isSelected());\n this.matCheckbox.indeterminate = !this.matCheckbox.checked\n && checkboxes.some((checkbox) => checkbox.isSelected());\n }\n });\n }\n\n public ngOnInit(): void {\n this.matCheckbox.change.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(({ checked }) => {\n if (checked) {\n this.niceSelectableListDirective.checkboxes().forEach((checkbox) => checkbox.selectEntity());\n } else {\n this.niceSelectableListDirective.checkboxes().forEach((checkbox) => checkbox.deselectEntity());\n }\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAaa,uBAAuB,CAAA;AAYH,IAAA,OAAA;AAXZ,IAAA,SAAS,GAAG,MAAM,CAAgC,EAAE,CAAC;AACrD,IAAA,aAAa,GAAG,MAAM,CAAqC,IAAI,CAAC;AAChE,IAAA,WAAW,GAAG,MAAM,CAAiD,EAAE,CAAC;AAEzE,IAAA,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE;AACtC,IAAA,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE;AAE9C,IAAA,KAAK,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC;IAC/C,WAAW,GAAG,QAAQ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,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,YAAY,EAAE,CAAC;;iBACzF;AACH,gBAAA,IAAI,CAAC,2BAA2B,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,cAAc,EAAE,CAAC;;AAEtG,SAAC,CAAC;;wGAzBG,yCAAyC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAzC,yCAAyC,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gDAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAAzC,yCAAyC,EAAA,UAAA,EAAA,CAAA;kBAHrD,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE;AACb,iBAAA;;;ACPD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@recursyve/nice-selectable-list",
3
- "version": "19.0.0-beta.0",
3
+ "version": "19.0.0-beta.2",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.2.0",
6
6
  "@angular/cdk": "^19.2.0",
@@ -1,11 +1,15 @@
1
- import { InjectionToken, Injector, Provider } from "@angular/core";
1
+ import { FactoryProvider, InjectionToken, Injector } from "@angular/core";
2
2
  import { NiceSelectableListConfig, NiceSelectableListStore } from "./store";
3
3
  export declare const NICE_SELECTABLE_LISTS: InjectionToken<NiceSelectableListProvider<unknown>[]>;
4
+ export declare const NICE_SELECTABLE_LIST: InjectionToken<NiceSelectableListStore<unknown>>;
4
5
  export type NiceSelectableListProvider<T> = {
5
6
  name: string;
6
7
  store: NiceSelectableListStore<T>;
7
8
  };
8
- export declare function provideNiceSelectableList<T>(name: string, config?: NiceSelectableListConfig<T>): Provider;
9
- export declare function resolveNiceSelectableList<T>(name: string, options?: {
9
+ export declare function provideNiceSelectableList<T>(config?: NiceSelectableListConfig<T>): FactoryProvider;
10
+ export declare function provideNiceSelectableList<T>(name: string, config?: NiceSelectableListConfig<T>): FactoryProvider;
11
+ export type ResolveNiceSelectableListOptions = {
10
12
  injector: Injector;
11
- }): NiceSelectableListStore<T>;
13
+ };
14
+ export declare function resolveNiceSelectableList<T>(name: string, options?: ResolveNiceSelectableListOptions): NiceSelectableListStore<T>;
15
+ export declare function resolveNiceSelectableList<T>(options?: ResolveNiceSelectableListOptions): NiceSelectableListStore<T>;
@@ -3,13 +3,13 @@ import { ActivatedRoute, Router } from "@angular/router";
3
3
  import { NiceSelectableListEntityCheckboxDirective } from "./entity-checkbox.directive";
4
4
  import { NiceSelectableListStore } from "./store";
5
5
  import * as i0 from "@angular/core";
6
- export declare const NICE_SELECTABLE_LIST: InjectionToken<NiceSelectableList<unknown>>;
6
+ export declare const NICE_SELECTABLE_LIST_DIRECTIVE: InjectionToken<NiceSelectableList<unknown>>;
7
7
  export type NiceSelectableList<T> = {
8
- name: Signal<string>;
8
+ name: Signal<string | null>;
9
9
  checkboxes: Signal<readonly NiceSelectableListEntityCheckboxDirective<T>[]>;
10
10
  };
11
11
  export declare class SelectableListDirective<T> implements NiceSelectableList<T>, OnInit {
12
- readonly name: import("@angular/core").InputSignal<string>;
12
+ readonly name: import("@angular/core").InputSignal<string | null>;
13
13
  readonly enableQueryParams: import("@angular/core").InputSignal<boolean>;
14
14
  readonly checkboxes: Signal<readonly NiceSelectableListEntityCheckboxDirective<T>[]>;
15
15
  private readonly _initialized;
@@ -23,5 +23,5 @@ export declare class SelectableListDirective<T> implements NiceSelectableList<T>
23
23
  private loadQueryParams;
24
24
  private parseQueryParams;
25
25
  static ɵfac: i0.ɵɵFactoryDeclaration<SelectableListDirective<any>, never>;
26
- static ɵdir: i0.ɵɵDirectiveDeclaration<SelectableListDirective<any>, "[niceSelectableList]", never, { "name": { "alias": "niceSelectableList"; "required": true; "isSignal": true; }; "enableQueryParams": { "alias": "enableQueryParams"; "required": false; "isSignal": true; }; }, {}, ["checkboxes"], never, true, never>;
26
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SelectableListDirective<any>, "[niceSelectableList]", never, { "name": { "alias": "niceSelectableList"; "required": false; "isSignal": true; }; "enableQueryParams": { "alias": "enableQueryParams"; "required": false; "isSignal": true; }; }, {}, ["checkboxes"], never, true, never>;
27
27
  }