@piying-lib/angular-daisyui 1.0.19 → 1.0.21

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.
Files changed (83) hide show
  1. package/extension/index.d.ts +59 -61
  2. package/fesm2022/piying-lib-angular-daisyui-extension.mjs +125 -69
  3. package/fesm2022/piying-lib-angular-daisyui-extension.mjs.map +1 -1
  4. package/fesm2022/piying-lib-angular-daisyui-field-group.mjs +3 -3
  5. package/fesm2022/piying-lib-angular-daisyui-field-group.mjs.map +1 -1
  6. package/fesm2022/piying-lib-angular-daisyui-non-field-control.mjs +37 -1
  7. package/fesm2022/piying-lib-angular-daisyui-non-field-control.mjs.map +1 -1
  8. package/fesm2022/piying-lib-angular-daisyui-service.mjs +1 -47
  9. package/fesm2022/piying-lib-angular-daisyui-service.mjs.map +1 -1
  10. package/field-group/index.d.ts +13 -13
  11. package/non-field-control/index.d.ts +20 -1
  12. package/package.json +2 -2
  13. package/preset-css/css/style.css +1 -1
  14. package/preset-css/css/style.split.css +8 -4
  15. package/preset-css/json/manifest.json +851 -738
  16. package/preset-css/ts/accordion.ts +9 -9
  17. package/preset-css/ts/alert.ts +12 -12
  18. package/preset-css/ts/avatar.ts +7 -7
  19. package/preset-css/ts/badge.ts +20 -20
  20. package/preset-css/ts/breadcrumbs.ts +3 -1
  21. package/preset-css/ts/browser-mockup.ts +4 -1
  22. package/preset-css/ts/button.ts +27 -27
  23. package/preset-css/ts/calendar.ts +5 -1
  24. package/preset-css/ts/card.ts +15 -15
  25. package/preset-css/ts/carousel.ts +9 -9
  26. package/preset-css/ts/chat-bubble.ts +17 -17
  27. package/preset-css/ts/checkbox.ts +16 -16
  28. package/preset-css/ts/code-mockup.ts +3 -1
  29. package/preset-css/ts/collapse.ts +9 -9
  30. package/preset-css/ts/countdown.ts +3 -1
  31. package/preset-css/ts/diff.ts +6 -1
  32. package/preset-css/ts/divider.ts +15 -15
  33. package/preset-css/ts/dock.ts +10 -10
  34. package/preset-css/ts/drawer-sidebar.ts +11 -11
  35. package/preset-css/ts/dropdown.ts +14 -13
  36. package/preset-css/ts/fab-speed-dial.ts +6 -1
  37. package/preset-css/ts/fieldset.ts +5 -1
  38. package/preset-css/ts/file-input.ts +17 -17
  39. package/preset-css/ts/filter.ts +4 -1
  40. package/preset-css/ts/footer.ts +7 -7
  41. package/preset-css/ts/hero.ts +5 -1
  42. package/preset-css/ts/hover-3-d-card.ts +3 -0
  43. package/preset-css/ts/hover-gallery.ts +3 -1
  44. package/preset-css/ts/index.ts +4 -2
  45. package/preset-css/ts/indicator.ts +10 -10
  46. package/preset-css/ts/join-group-items.ts +6 -0
  47. package/preset-css/ts/kbd.ts +8 -1
  48. package/preset-css/ts/label.ts +4 -1
  49. package/preset-css/ts/link.ts +12 -12
  50. package/preset-css/ts/list.ts +6 -1
  51. package/preset-css/ts/loading.ts +14 -14
  52. package/preset-css/ts/mask.ts +20 -20
  53. package/preset-css/ts/menu.ts +17 -17
  54. package/preset-css/ts/modal.ts +13 -13
  55. package/preset-css/ts/navbar.ts +6 -1
  56. package/preset-css/ts/pagination.ts +6 -1
  57. package/preset-css/ts/phone-mockup.ts +5 -5
  58. package/preset-css/ts/progress.ts +11 -11
  59. package/preset-css/ts/radial-progress.ts +3 -1
  60. package/preset-css/ts/radio.ts +16 -16
  61. package/preset-css/ts/range-slider.ts +16 -16
  62. package/preset-css/ts/rating.ts +10 -10
  63. package/preset-css/ts/select.ts +17 -17
  64. package/preset-css/ts/skeleton.ts +4 -1
  65. package/preset-css/ts/stack.ts +7 -1
  66. package/preset-css/ts/stat.ts +11 -11
  67. package/preset-css/ts/status.ts +16 -16
  68. package/preset-css/ts/steps.ts +15 -15
  69. package/preset-css/ts/swap.ts +9 -9
  70. package/preset-css/ts/table.ts +11 -11
  71. package/preset-css/ts/tabs.ts +17 -17
  72. package/preset-css/ts/text-input.ts +17 -17
  73. package/preset-css/ts/text-rotate.ts +3 -0
  74. package/preset-css/ts/textarea.ts +17 -17
  75. package/preset-css/ts/theme-controller.ts +3 -1
  76. package/preset-css/ts/timeline.ts +11 -11
  77. package/preset-css/ts/toast.ts +9 -9
  78. package/preset-css/ts/toggle.ts +16 -16
  79. package/preset-css/ts/tooltip.ts +17 -17
  80. package/preset-css/ts/validator.ts +4 -1
  81. package/preset-css/ts/window-mockup.ts +3 -1
  82. package/service/index.d.ts +1 -19
  83. package/wrapper/index.d.ts +4 -4
@@ -10,6 +10,7 @@ import { PiyingViewGroupBase, BaseControl, PiyingView } from '@piying/view-angul
10
10
  import { SelectorlessOutlet } from '@cyia/ngx-common/directive';
11
11
  import { OverlayConfig } from '@angular/cdk/overlay';
12
12
  import * as rxjs from 'rxjs';
13
+ import { Subject } from 'rxjs';
13
14
  import { SelectionModel } from '@angular/cdk/collections';
14
15
 
15
16
  declare const ExactMatchOptions: IsActiveMatchOptions;
@@ -169,7 +170,7 @@ declare class TableResourceWC {
169
170
  #private;
170
171
  static __version: number;
171
172
  templateRef: _angular_core.Signal<unknown>;
172
- field$$: _angular_core.Signal<_piying_view_angular.PiResolvedViewFieldConfig>;
173
+ field$$: _angular_core.Signal<_piying_view_angular_core._PiResolvedCommonViewFieldConfig>;
173
174
  props$$: _angular_core.Signal<Record<string, any>>;
174
175
  rawData$$: _angular_core.Signal<any>;
175
176
  queryParams$$: _angular_core.Signal<any>;
@@ -185,7 +186,7 @@ declare class SortHeaderWC {
185
186
  #private;
186
187
  static __version: number;
187
188
  templateRef: _angular_core.Signal<unknown>;
188
- field$$: _angular_core.Signal<_piying_view_angular.PiResolvedViewFieldConfig>;
189
+ field$$: _angular_core.Signal<_piying_view_angular_core._PiResolvedCommonViewFieldConfig>;
189
190
  props$$: _angular_core.Signal<Record<string, any>>;
190
191
  key$$: _angular_core.Signal<any>;
191
192
  index$: _angular_core.WritableSignal<any>;
@@ -210,62 +211,20 @@ declare class SortTablehWC {
210
211
  #private;
211
212
  static __version: number;
212
213
  templateRef: _angular_core.Signal<unknown>;
213
- field$$: _angular_core.Signal<_piying_view_angular.PiResolvedViewFieldConfig>;
214
+ field$$: _angular_core.Signal<_piying_view_angular_core._PiResolvedCommonViewFieldConfig>;
214
215
  props$$: _angular_core.Signal<Record<string, any>>;
215
216
  constructor();
216
217
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SortTablehWC, never>;
217
218
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<SortTablehWC, "app-sort-table", never, {}, {}, never, never, true, never>;
218
219
  }
219
220
 
220
- declare class ExpandRowDirective {
221
- #private;
222
- a(event: PointerEvent): void;
223
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<ExpandRowDirective, never>;
224
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ExpandRowDirective, "app-expand", never, {}, {}, never, never, true, never>;
225
- }
226
-
227
- declare class TableStatusWC {
228
- #private;
229
- static __version: number;
230
- templateRef: _angular_core.Signal<unknown>;
231
- field$$: _angular_core.Signal<_piying_view_angular.PiResolvedViewFieldConfig>;
232
- constructor();
233
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<TableStatusWC, never>;
234
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<TableStatusWC, "app-table-status", never, {}, {}, never, never, true, never>;
235
- }
236
-
237
- declare class TableStatusService {
238
- #private;
239
- updateIndex$: _angular_core.WritableSignal<number>;
240
- toggleExpand(value: any): void;
241
- selectExpand(value: any): void;
242
- deselectExpand(value: any): void;
243
- clearExpand(): void;
244
- needUpdate(): void;
245
- setSelectionModel(input?: any): void;
246
- selectionModel$$: rxjs.Observable<SelectionModel<unknown>>;
247
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<TableStatusService, never>;
248
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<TableStatusService>;
249
- }
250
-
251
- declare class CheckboxTableWC {
252
- #private;
253
- static __version: number;
254
- templateRef: _angular_core.Signal<unknown>;
255
- field$$: _angular_core.Signal<_piying_view_angular.PiResolvedViewFieldConfig>;
256
- props$$: _angular_core.Signal<Record<string, any>>;
257
- constructor();
258
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<CheckboxTableWC, never>;
259
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<CheckboxTableWC, "app-checkbox-table", never, {}, {}, never, never, true, never>;
260
- }
261
-
262
221
  declare class TableCheckboxAllWC {
263
222
  #private;
264
- field$$: _angular_core.Signal<_piying_view_angular.PiResolvedViewFieldConfig>;
223
+ field$$: _angular_core.Signal<_piying_view_angular_core._PiResolvedCommonViewFieldConfig>;
265
224
  props$$: _angular_core.Signal<Record<string, any>>;
266
225
  static __version: number;
267
226
  templateRef: _angular_core.Signal<unknown>;
268
- toggle(): void;
227
+ constructor();
269
228
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<TableCheckboxAllWC, never>;
270
229
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<TableCheckboxAllWC, "app-table-checkbox-all", never, {}, {}, never, never, true, never>;
271
230
  }
@@ -274,7 +233,7 @@ declare class TableCheckboxOneWC {
274
233
  #private;
275
234
  static __version: number;
276
235
  templateRef: _angular_core.Signal<unknown>;
277
- field$$: _angular_core.Signal<_piying_view_angular.PiResolvedViewFieldConfig>;
236
+ field$$: _angular_core.Signal<_piying_view_angular_core._PiResolvedCommonViewFieldConfig>;
278
237
  props$$: _angular_core.Signal<Record<string, any>>;
279
238
  constructor();
280
239
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<TableCheckboxOneWC, never>;
@@ -291,25 +250,68 @@ type wrapper_index_d$1_TableCheckboxOneWC = TableCheckboxOneWC;
291
250
  declare const wrapper_index_d$1_TableCheckboxOneWC: typeof TableCheckboxOneWC;
292
251
  type wrapper_index_d$1_TableResourceWC = TableResourceWC;
293
252
  declare const wrapper_index_d$1_TableResourceWC: typeof TableResourceWC;
294
- type wrapper_index_d$1_TableStatusWC = TableStatusWC;
295
- declare const wrapper_index_d$1_TableStatusWC: typeof TableStatusWC;
296
253
  declare namespace wrapper_index_d$1 {
297
254
  export {
298
- CheckboxTableWC as CheckboxTablehWC,
299
255
  wrapper_index_d$1_SortHeaderWC as SortHeaderWC,
300
256
  wrapper_index_d$1_SortTablehWC as SortTablehWC,
301
257
  wrapper_index_d$1_TableCheckboxAllWC as TableCheckboxAllWC,
302
258
  wrapper_index_d$1_TableCheckboxOneWC as TableCheckboxOneWC,
303
259
  wrapper_index_d$1_TableResourceWC as TableResourceWC,
304
- wrapper_index_d$1_TableStatusWC as TableStatusWC,
305
260
  };
306
261
  }
307
262
 
263
+ declare class ExpandRowDirective {
264
+ #private;
265
+ a(event: PointerEvent): void;
266
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ExpandRowDirective, never>;
267
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ExpandRowDirective, "app-expand", never, {}, {}, never, never, true, never>;
268
+ }
269
+
270
+ declare class TableStatusService {
271
+ #private;
272
+ updateIndex$: _angular_core.WritableSignal<number>;
273
+ constructor();
274
+ toggleExpand(value: any): void;
275
+ selectExpand(value: any): void;
276
+ deselectExpand(value: any): void;
277
+ clearExpand(): void;
278
+ needUpdate(): void;
279
+ setSelectionModel(input?: any): void;
280
+ selectionModel$$: rxjs.Observable<SelectionModel<unknown>>;
281
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TableStatusService, never>;
282
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<TableStatusService>;
283
+ }
284
+
285
+ type CheckBoxConfig<D> = {
286
+ config: {
287
+ key: string;
288
+ selected?: D[];
289
+ multiple: boolean;
290
+ compareWith?: (o1: D, o2: D) => boolean;
291
+ }[];
292
+ autoDataBind?: boolean;
293
+ dataChangeClear?: boolean;
294
+ };
295
+ declare class CheckboxService<D = any> {
296
+ #private;
297
+ init(define?: CheckBoxConfig<D>): void;
298
+ toggle(key: string | undefined, value: any): void;
299
+ set(key: string | undefined, value: any, selected: boolean): void;
300
+ /** 用来设置一个获得所有列表数据的方法 */
301
+ setAllList(fn: () => D[]): void;
302
+ selectAll(checked: boolean, key?: string): void;
303
+ listenAllSelect(key?: string): Subject<boolean>;
304
+ getSelected(key?: string): D[];
305
+ clear(): void;
306
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CheckboxService<any>, never>;
307
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<CheckboxService<any>>;
308
+ }
309
+
308
310
  declare class TableExpandOneTableCell {
309
311
  #private;
310
312
  static __version: number;
311
313
  templateRef: _angular_core.Signal<unknown>;
312
- field$$: _angular_core.Signal<_piying_view_angular.PiResolvedViewFieldConfig>;
314
+ field$$: _angular_core.Signal<_piying_view_angular_core._PiResolvedCommonViewFieldConfig>;
313
315
  isExpand$$: _angular_core.Signal<boolean>;
314
316
  toggle(): void;
315
317
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<TableExpandOneTableCell, never>;
@@ -384,7 +386,7 @@ declare class ListTemplateNFCC {
384
386
  }, "handle" | "builder">, "fieldGlobalConfig"> & {
385
387
  fieldGlobalConfig?: _piying_view_angular.PiViewConfig;
386
388
  }> | null;
387
- field: _angular_core.Signal<_piying_view_angular.PiResolvedViewFieldConfig>;
389
+ field: _angular_core.Signal<_piying_view_angular_core._PiResolvedCommonViewFieldConfig>;
388
390
  templateInput$$: (data: any) => {
389
391
  schema: _angular_core.InputSignal<any>;
390
392
  options: _angular_core.Signal<{
@@ -438,7 +440,7 @@ declare class OptionListLocalFilterWC {
438
440
  fileterOption: {
439
441
  type: string;
440
442
  };
441
- field$$: _angular_core.Signal<_piying_view_angular.PiResolvedViewFieldConfig>;
443
+ field$$: _angular_core.Signal<_piying_view_angular_core._PiResolvedCommonViewFieldConfig>;
442
444
  props$$: _angular_core.Signal<Record<string, any>>;
443
445
  constructor();
444
446
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<OptionListLocalFilterWC, never>;
@@ -457,20 +459,16 @@ type wrapper_index_d_TableCheckboxOneWC = TableCheckboxOneWC;
457
459
  declare const wrapper_index_d_TableCheckboxOneWC: typeof TableCheckboxOneWC;
458
460
  type wrapper_index_d_TableResourceWC = TableResourceWC;
459
461
  declare const wrapper_index_d_TableResourceWC: typeof TableResourceWC;
460
- type wrapper_index_d_TableStatusWC = TableStatusWC;
461
- declare const wrapper_index_d_TableStatusWC: typeof TableStatusWC;
462
462
  declare namespace wrapper_index_d {
463
463
  export {
464
- CheckboxTableWC as CheckboxTablehWC,
465
464
  wrapper_index_d_OptionListLocalFilterWC as OptionListLocalFilterWC,
466
465
  wrapper_index_d_SortHeaderWC as SortHeaderWC,
467
466
  wrapper_index_d_SortTablehWC as SortTablehWC,
468
467
  wrapper_index_d_TableCheckboxAllWC as TableCheckboxAllWC,
469
468
  wrapper_index_d_TableCheckboxOneWC as TableCheckboxOneWC,
470
469
  wrapper_index_d_TableResourceWC as TableResourceWC,
471
- wrapper_index_d_TableStatusWC as TableStatusWC,
472
470
  };
473
471
  }
474
472
 
475
- export { CheckboxTableWC, ExactMatchOptions, ExpandRowDirective, component_index_d as ExtComponentGroup, wrapper_index_d as ExtWrapperGroup, ListTemplateNFCC, MenuTreeNFCC, OptionListFCC, OptionListLocalFilterWC, PaginationNFCC, PickerRefFCC, SortHeaderWC, SortTablehWC, SubsetMatchOptions, TableCheckboxAllWC, TableCheckboxOneWC, TableExpandOneTableCell, TableNFCC, TableResourceWC, TableRowFGC, TableStatusService, TableStatusWC, wrapper_index_d$1 as WrapperGroup, createDefaultColDefine, createDefaultColDefineFn, createRowDefine, inputSortDirective };
476
- export type { DataResolved, ItemCell, ItemCellBase, NavigationItem, NavigationMode, NavigationPosition, TableItemDefine2 };
473
+ export { CheckboxService, ExactMatchOptions, ExpandRowDirective, component_index_d as ExtComponentGroup, wrapper_index_d as ExtWrapperGroup, ListTemplateNFCC, MenuTreeNFCC, OptionListFCC, OptionListLocalFilterWC, PaginationNFCC, PickerRefFCC, SortHeaderWC, SortTablehWC, SubsetMatchOptions, TableCheckboxAllWC, TableCheckboxOneWC, TableExpandOneTableCell, TableNFCC, TableResourceWC, TableRowFGC, TableStatusService, wrapper_index_d$1 as WrapperGroup, createDefaultColDefine, createDefaultColDefineFn, createRowDefine, inputSortDirective };
474
+ export type { CheckBoxConfig, DataResolved, ItemCell, ItemCellBase, NavigationItem, NavigationMode, NavigationPosition, TableItemDefine2 };
@@ -1,9 +1,9 @@
1
1
  import { NgTemplateOutlet } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { viewChild, input, inject, computed, Component, model, InjectionToken, Injector, untracked, signal, Injectable, HostListener, Directive, effect, resource, ElementRef, linkedSignal, NgZone, EventEmitter, TemplateRef, ViewContainerRef, Output, forwardRef, ChangeDetectionStrategy } from '@angular/core';
3
+ import { viewChild, input, inject, computed, Component, model, InjectionToken, Injector, untracked, signal, effect, Injectable, HostListener, Directive, resource, ElementRef, linkedSignal, NgZone, EventEmitter, TemplateRef, ViewContainerRef, Output, forwardRef, ChangeDetectionStrategy } from '@angular/core';
4
4
  import { StrOrTemplateComponent, isSchema, computedWithPrev, DefaultOptionConvert, transformOption } from '@piying-lib/angular-core';
5
5
  import { CssPrefixPipe, MergeClassPipe, TwPrefixPipe } from '@piying-lib/angular-daisyui/pipe';
6
- import { ThemeService, CheckboxService } from '@piying-lib/angular-daisyui/service';
6
+ import { ThemeService } from '@piying-lib/angular-daisyui/service';
7
7
  import { AttributesDirective, PI_VIEW_FIELD_TOKEN, PiyingViewGroupBase, InsertFieldDirective, BaseControl, PiyingView, PI_INPUT_OPTIONS_TOKEN } from '@piying/view-angular';
8
8
  import { RouterLink, RouterLinkActive } from '@angular/router';
9
9
  import * as i1 from '@angular/material/icon';
@@ -166,11 +166,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
166
166
 
167
167
  class TableRowFGC extends PiyingViewGroupBase {
168
168
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: TableRowFGC, deps: null, target: i0.ɵɵFactoryTarget.Component });
169
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: TableRowFGC, isStandalone: true, selector: "tr", providers: [], usesInheritance: true, ngImport: i0, template: "@for (field of children$$(); track $index) {\n <ng-container\n *ngTemplateOutlet=\"fieldTemplateRef(); context: { $implicit: field }\"\n ></ng-container>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }] });
169
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: TableRowFGC, isStandalone: true, selector: "tr", providers: [], usesInheritance: true, ngImport: i0, template: "@for (field of children$$(); track $index) {\n <ng-container\n *ngTemplateOutlet=\"fieldTemplateRef(); context: { $implicit: field, injector }\"\n ></ng-container>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }] });
170
170
  }
171
171
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: TableRowFGC, decorators: [{
172
172
  type: Component,
173
- args: [{ selector: 'tr', imports: [NgTemplateOutlet, FormsModule], providers: [], template: "@for (field of children$$(); track $index) {\n <ng-container\n *ngTemplateOutlet=\"fieldTemplateRef(); context: { $implicit: field }\"\n ></ng-container>\n}\n" }]
173
+ args: [{ selector: 'tr', imports: [NgTemplateOutlet, FormsModule], providers: [], template: "@for (field of children$$(); track $index) {\n <ng-container\n *ngTemplateOutlet=\"fieldTemplateRef(); context: { $implicit: field, injector }\"\n ></ng-container>\n}\n" }]
174
174
  }] });
175
175
 
176
176
  const TABLE_STATUS_TOKEN = new InjectionToken('TABLE_STATUS');
@@ -368,6 +368,15 @@ function localData(data, options) {
368
368
  class TableStatusService {
369
369
  #sm = new BehaviorSubject(undefined);
370
370
  updateIndex$ = signal(0, ...(ngDevMode ? [{ debugName: "updateIndex$" }] : []));
371
+ #field$$ = inject(PI_VIEW_FIELD_TOKEN);
372
+ #expand$$ = computed(() => {
373
+ return this.#field$$().props()['expandSelectModel'];
374
+ }, ...(ngDevMode ? [{ debugName: "#expand$$" }] : []));
375
+ constructor() {
376
+ effect(() => {
377
+ this.setSelectionModel(this.#expand$$());
378
+ });
379
+ }
371
380
  toggleExpand(value) {
372
381
  this.#sm.value.toggle(value);
373
382
  }
@@ -394,7 +403,7 @@ class TableStatusService {
394
403
  }
395
404
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: TableStatusService, decorators: [{
396
405
  type: Injectable
397
- }] });
406
+ }], ctorParameters: () => [] });
398
407
 
399
408
  class ExpandRowDirective {
400
409
  #field = inject(PI_VIEW_FIELD_TOKEN);
@@ -418,28 +427,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
418
427
  args: ['click', ['$event']]
419
428
  }] } });
420
429
 
421
- // 切换状态演示,继承TABLE_STATUS_TOKEN自定义
422
- class TableStatusWC {
423
- static __version = 2;
424
- templateRef = viewChild.required('templateRef');
425
- #service = inject(TableStatusService);
426
- field$$ = inject(PI_VIEW_FIELD_TOKEN);
427
- #expand$$ = computed(() => {
428
- return this.field$$().props()['expandSelectModel'];
429
- }, ...(ngDevMode ? [{ debugName: "#expand$$" }] : []));
430
- constructor() {
431
- effect(() => {
432
- this.#service.setSelectionModel(this.#expand$$());
433
- });
434
- }
435
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: TableStatusWC, deps: [], target: i0.ɵɵFactoryTarget.Component });
436
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.14", type: TableStatusWC, isStandalone: true, selector: "app-table-status", providers: [TableStatusService, { provide: TABLE_STATUS_TOKEN, useExisting: TableStatusService }], viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #templateRef let-attr=\"attributes\">\n <ng-container insertField></ng-container>\n</ng-template>\n", dependencies: [{ kind: "directive", type: InsertFieldDirective, selector: "[insertField]", exportAs: ["insertField"] }] });
437
- }
438
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: TableStatusWC, decorators: [{
439
- type: Component,
440
- args: [{ selector: 'app-table-status', providers: [TableStatusService, { provide: TABLE_STATUS_TOKEN, useExisting: TableStatusService }], imports: [InsertFieldDirective], template: "<ng-template #templateRef let-attr=\"attributes\">\n <ng-container insertField></ng-container>\n</ng-template>\n" }]
441
- }], ctorParameters: () => [], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }] } });
442
-
443
430
  class TableResourceWC {
444
431
  static __version = 2;
445
432
  templateRef = viewChild.required('templateRef');
@@ -642,7 +629,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
642
629
  AttributesDirective,
643
630
  inputSortDirective,
644
631
  InsertFieldDirective,
645
- TwPrefixPipe
632
+ TwPrefixPipe,
646
633
  ], template: "<ng-template #templateRef let-attr=\"attributes\">\n <div class=\"flex items-center\">\n <ng-container insertField></ng-container>\n\n <label\n [class]=\"'swap swap-rotate' | mergeClass: attr()?.class | cssPrefix\"\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n >\n <input type=\"checkbox\" [(inputSort)]=\"index$\" [key]=\"key$$()\" />\n\n <div [class]=\"'swap-indeterminate' | cssPrefix\"></div>\n <div [class]=\"'swap-on' | mergeClass: 'flex' | twPrefix\">\n <mat-icon>arrow_upward</mat-icon>\n </div>\n <div [class]=\"'swap-off' | cssPrefix | mergeClass: 'flex' | twPrefix\">\n <mat-icon>arrow_downward</mat-icon>\n </div>\n </label>\n </div>\n</ng-template>\n" }]
647
634
  }], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }] } });
648
635
 
@@ -679,31 +666,98 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
679
666
  }]
680
667
  }], ctorParameters: () => [], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }] } });
681
668
 
682
- class CheckboxTableWC {
683
- static __version = 2;
684
- templateRef = viewChild.required('templateRef');
685
- #checkbox = inject(CheckboxService);
686
- field$$ = inject(PI_VIEW_FIELD_TOKEN);
687
- props$$ = computed(() => this.field$$().props(), ...(ngDevMode ? [{ debugName: "props$$" }] : []));
688
- constructor() {
689
- this.#checkbox.setAllList(() => {
690
- // todo 去掉数量
691
- const data = this.field$$().inputs()['data'];
692
- return Array.isArray(data) ? data[1] : data.value();
669
+ const defaultKey = 'default';
670
+ class CheckboxService {
671
+ #selectModelMap = new Map();
672
+ #field$$ = inject(PI_VIEW_FIELD_TOKEN);
673
+ #data$$ = computed(() => {
674
+ return this.#field$$().inputs()['data'];
675
+ }, ...(ngDevMode ? [{ debugName: "#data$$" }] : []));
676
+ #injector = inject(Injector);
677
+ #defaultDataBind(dataChangeClear = false) {
678
+ effect(() => {
679
+ const data1 = this.#data$$();
680
+ let data2 = Array.isArray(data1) ? data1 : data1?.();
681
+ untracked(() => {
682
+ this.setAllList(() => {
683
+ return data2;
684
+ });
685
+ if (dataChangeClear) {
686
+ this.clear();
687
+ }
688
+ });
689
+ }, { injector: this.#injector });
690
+ }
691
+ init(define) {
692
+ this.#selectModelMap.clear();
693
+ if (!define) {
694
+ this.#selectModelMap.set(defaultKey, new SelectionModel(true));
695
+ this.#allEvent.set(defaultKey, new Subject());
696
+ this.#defaultDataBind(true);
697
+ }
698
+ else {
699
+ define.config.forEach((item) => {
700
+ this.#selectModelMap.set(item.key, new SelectionModel(item.multiple, item.selected, false, item.compareWith));
701
+ this.#allEvent.set(item.key, new Subject());
702
+ });
703
+ if (define.autoDataBind) {
704
+ this.#defaultDataBind(define.dataChangeClear);
705
+ }
706
+ }
707
+ }
708
+ toggle(key = defaultKey, value) {
709
+ const result = this.#selectModelMap.get(key);
710
+ result.toggle(value);
711
+ }
712
+ set(key = defaultKey, value, selected) {
713
+ const result = this.#selectModelMap.get(key);
714
+ if (selected) {
715
+ result.select(value);
716
+ }
717
+ else {
718
+ result.deselect(value);
719
+ }
720
+ }
721
+ #fn;
722
+ /** 用来设置一个获得所有列表数据的方法 */
723
+ setAllList(fn) {
724
+ this.#fn = fn;
725
+ }
726
+ #allEvent = new Map();
727
+ selectAll(checked, key = defaultKey) {
728
+ const list = this.#fn();
729
+ const result = this.#selectModelMap.get(key);
730
+ let event$ = this.#allEvent.get(key);
731
+ if (checked) {
732
+ list.forEach((item) => {
733
+ result.select(item);
734
+ });
735
+ }
736
+ else {
737
+ result.clear();
738
+ }
739
+ event$.next(checked);
740
+ }
741
+ listenAllSelect(key = defaultKey) {
742
+ return this.#allEvent.get(key);
743
+ }
744
+ getSelected(key = defaultKey) {
745
+ return this.#selectModelMap.get(key).selected;
746
+ }
747
+ clear() {
748
+ this.#selectModelMap.forEach((item) => {
749
+ item.clear();
750
+ });
751
+ this.#allEvent.forEach((item) => {
752
+ item.next(false);
693
753
  });
694
754
  }
695
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: CheckboxTableWC, deps: [], target: i0.ɵɵFactoryTarget.Component });
696
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.14", type: CheckboxTableWC, isStandalone: true, selector: "app-checkbox-table", providers: [CheckboxService], viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }], ngImport: i0, template: `<ng-template #templateRef> <ng-container insertField></ng-container></ng-template>`, isInline: true, dependencies: [{ kind: "directive", type: InsertFieldDirective, selector: "[insertField]", exportAs: ["insertField"] }] });
755
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: CheckboxService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
756
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: CheckboxService });
697
757
  }
698
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: CheckboxTableWC, decorators: [{
699
- type: Component,
700
- args: [{
701
- selector: 'app-checkbox-table',
702
- template: `<ng-template #templateRef> <ng-container insertField></ng-container></ng-template>`,
703
- providers: [CheckboxService],
704
- imports: [InsertFieldDirective],
705
- }]
706
- }], ctorParameters: () => [], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }] } });
758
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: CheckboxService, decorators: [{
759
+ type: Injectable
760
+ }] });
707
761
 
708
762
  class TableCheckboxAllWC {
709
763
  field$$ = inject(PI_VIEW_FIELD_TOKEN);
@@ -714,16 +768,23 @@ class TableCheckboxAllWC {
714
768
  #key$$ = computed(() => {
715
769
  return this.props$$()['key'];
716
770
  }, ...(ngDevMode ? [{ debugName: "#key$$" }] : []));
717
- toggle() {
718
- this.#checkboxService.selectAll(this.#key$$());
771
+ constructor() {
772
+ this.field$$()
773
+ .form.control.valueChanges.pipe(filter((a) => a !== undefined))
774
+ .subscribe((a) => {
775
+ this.#checkboxService.selectAll(a, this.#key$$());
776
+ });
777
+ this.#checkboxService.listenAllSelect(this.#key$$()).subscribe((value) => {
778
+ this.field$$().form.control.updateValue(value);
779
+ });
719
780
  }
720
781
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: TableCheckboxAllWC, deps: [], target: i0.ɵɵFactoryTarget.Component });
721
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.14", type: TableCheckboxAllWC, isStandalone: true, selector: "app-table-checkbox-all", viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #templateRef let-attr=\"attributes\">\n <div (click)=\"toggle()\">\n <ng-container insertField></ng-container>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: InsertFieldDirective, selector: "[insertField]", exportAs: ["insertField"] }] });
782
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.14", type: TableCheckboxAllWC, isStandalone: true, selector: "app-table-checkbox-all", viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #templateRef let-attr=\"attributes\">\n <ng-container insertField></ng-container>\n</ng-template>\n", dependencies: [{ kind: "directive", type: InsertFieldDirective, selector: "[insertField]", exportAs: ["insertField"] }] });
722
783
  }
723
784
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: TableCheckboxAllWC, decorators: [{
724
785
  type: Component,
725
- args: [{ selector: 'app-table-checkbox-all', imports: [InsertFieldDirective], template: "<ng-template #templateRef let-attr=\"attributes\">\n <div (click)=\"toggle()\">\n <ng-container insertField></ng-container>\n </div>\n</ng-template>\n" }]
726
- }], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }] } });
786
+ args: [{ selector: 'app-table-checkbox-all', imports: [InsertFieldDirective], template: "<ng-template #templateRef let-attr=\"attributes\">\n <ng-container insertField></ng-container>\n</ng-template>\n" }]
787
+ }], ctorParameters: () => [], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }] } });
727
788
 
728
789
  class TableCheckboxOneWC {
729
790
  static __version = 2;
@@ -738,7 +799,10 @@ class TableCheckboxOneWC {
738
799
  this.field$$()
739
800
  .form.control.valueChanges.pipe(filter((a) => a !== undefined))
740
801
  .subscribe((a) => {
741
- this.#checkboxService.toggle(this.#key$$(), this.field$$().context['item$']());
802
+ this.#checkboxService.set(this.#key$$(), this.field$$().context['item$'](), a);
803
+ });
804
+ this.#checkboxService.listenAllSelect(this.#key$$()).subscribe((value) => {
805
+ this.field$$().form.control.updateValue(value);
742
806
  });
743
807
  }
744
808
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: TableCheckboxOneWC, deps: [], target: i0.ɵɵFactoryTarget.Component });
@@ -751,13 +815,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
751
815
 
752
816
  var wrapper_index$1 = /*#__PURE__*/Object.freeze({
753
817
  __proto__: null,
754
- CheckboxTablehWC: CheckboxTableWC,
755
818
  SortHeaderWC: SortHeaderWC,
756
819
  SortTablehWC: SortTablehWC,
757
820
  TableCheckboxAllWC: TableCheckboxAllWC,
758
821
  TableCheckboxOneWC: TableCheckboxOneWC,
759
- TableResourceWC: TableResourceWC,
760
- TableStatusWC: TableStatusWC
822
+ TableResourceWC: TableResourceWC
761
823
  });
762
824
 
763
825
  class TableExpandOneTableCell {
@@ -765,10 +827,10 @@ class TableExpandOneTableCell {
765
827
  templateRef = viewChild.required('templateRef');
766
828
  field$$ = inject(PI_VIEW_FIELD_TOKEN);
767
829
  // props$$ = computed(() => this.field$$().props());
768
- #service = this.field$$().context['status'];
830
+ #service = inject(TableStatusService);
769
831
  #expand$$ = toSignal(this.#service.selectionModel$$);
770
832
  isExpand$$ = computed(() => {
771
- let sm = this.#expand$$();
833
+ const sm = this.#expand$$();
772
834
  if (!sm) {
773
835
  return false;
774
836
  }
@@ -1140,10 +1202,6 @@ class PickerRefFCC extends BaseControl {
1140
1202
  context: {
1141
1203
  ...this.parentPyOptions().context,
1142
1204
  pickerValue: this.value$,
1143
- parent: this.#field$$(),
1144
- parentCtx: this.parentPyOptions().context,
1145
- root: this.parentPyOptions().context?.['root'] ?? this.#field$$(),
1146
- rootCtx: this.parentPyOptions().context?.['rootCtx'] ?? this.parentPyOptions().context,
1147
1205
  },
1148
1206
  })),
1149
1207
  selectorless: true,
@@ -1369,19 +1427,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
1369
1427
 
1370
1428
  var wrapper_index = /*#__PURE__*/Object.freeze({
1371
1429
  __proto__: null,
1372
- CheckboxTablehWC: CheckboxTableWC,
1373
1430
  OptionListLocalFilterWC: OptionListLocalFilterWC,
1374
1431
  SortHeaderWC: SortHeaderWC,
1375
1432
  SortTablehWC: SortTablehWC,
1376
1433
  TableCheckboxAllWC: TableCheckboxAllWC,
1377
1434
  TableCheckboxOneWC: TableCheckboxOneWC,
1378
- TableResourceWC: TableResourceWC,
1379
- TableStatusWC: TableStatusWC
1435
+ TableResourceWC: TableResourceWC
1380
1436
  });
1381
1437
 
1382
1438
  /**
1383
1439
  * Generated bundle index. Do not edit.
1384
1440
  */
1385
1441
 
1386
- export { CheckboxTableWC, ExactMatchOptions, ExpandRowDirective, component_index as ExtComponentGroup, wrapper_index as ExtWrapperGroup, ListTemplateNFCC, MenuTreeNFCC, OptionListFCC, OptionListLocalFilterWC, PaginationNFCC, PickerRefFCC, SortHeaderWC, SortTablehWC, SubsetMatchOptions, TableCheckboxAllWC, TableCheckboxOneWC, TableExpandOneTableCell, TableNFCC, TableResourceWC, TableRowFGC, TableStatusService, TableStatusWC, wrapper_index$1 as WrapperGroup, createDefaultColDefine, createDefaultColDefineFn, createRowDefine, inputSortDirective };
1442
+ export { CheckboxService, ExactMatchOptions, ExpandRowDirective, component_index as ExtComponentGroup, wrapper_index as ExtWrapperGroup, ListTemplateNFCC, MenuTreeNFCC, OptionListFCC, OptionListLocalFilterWC, PaginationNFCC, PickerRefFCC, SortHeaderWC, SortTablehWC, SubsetMatchOptions, TableCheckboxAllWC, TableCheckboxOneWC, TableExpandOneTableCell, TableNFCC, TableResourceWC, TableRowFGC, TableStatusService, wrapper_index$1 as WrapperGroup, createDefaultColDefine, createDefaultColDefineFn, createRowDefine, inputSortDirective };
1387
1443
  //# sourceMappingURL=piying-lib-angular-daisyui-extension.mjs.map