@acorex/cdk 19.5.0 → 19.6.0
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.
|
@@ -40,13 +40,13 @@ class AXSelectionGroupDirective {
|
|
|
40
40
|
constructor() {
|
|
41
41
|
this.content = contentChildren(AXSelectionItemDirective);
|
|
42
42
|
this.activeIndex = signal(null);
|
|
43
|
-
this.
|
|
44
|
-
this.
|
|
43
|
+
this.multipel = input(false);
|
|
44
|
+
this.selectedKey = input();
|
|
45
45
|
this.#init = afterNextRender(() => {
|
|
46
46
|
this.content().forEach((element) => {
|
|
47
47
|
element.onActiveState.subscribe((e) => {
|
|
48
48
|
this.activeIndex.set(e.component.key());
|
|
49
|
-
if (this.
|
|
49
|
+
if (this.multipel()) {
|
|
50
50
|
element.toggle();
|
|
51
51
|
}
|
|
52
52
|
else {
|
|
@@ -55,23 +55,23 @@ class AXSelectionGroupDirective {
|
|
|
55
55
|
element.unselect();
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
|
-
element.
|
|
58
|
+
element.select();
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
61
|
});
|
|
62
62
|
});
|
|
63
|
-
this.#
|
|
64
|
-
if (!this.
|
|
63
|
+
this.#effect = effect(() => {
|
|
64
|
+
if (!this.selectedKey())
|
|
65
65
|
return;
|
|
66
|
-
if (typeof this.
|
|
66
|
+
if (typeof this.selectedKey() === 'string') {
|
|
67
67
|
this.content().forEach((element) => {
|
|
68
|
-
if (this.
|
|
68
|
+
if (this.selectedKey() === element.key()) {
|
|
69
69
|
element.isActive.set(true);
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
else if (this.
|
|
74
|
-
this.
|
|
73
|
+
else if (this.selectedKey() instanceof Array) {
|
|
74
|
+
this.selectedKey().forEach((index) => {
|
|
75
75
|
this.content().forEach((element) => {
|
|
76
76
|
if (index === element.key()) {
|
|
77
77
|
element.isActive.set(true);
|
|
@@ -80,17 +80,24 @@ class AXSelectionGroupDirective {
|
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
|
+
this.#effect2 = effect(() => {
|
|
84
|
+
if (!this.selectedKey()) {
|
|
85
|
+
this.content()[0].isActive.set(true);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
83
88
|
}
|
|
84
89
|
#init;
|
|
85
|
-
#
|
|
90
|
+
#effect;
|
|
91
|
+
#effect2;
|
|
86
92
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXSelectionGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
87
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.0.3", type: AXSelectionGroupDirective, isStandalone: false, selector: "[axSelectionGroup]", inputs: {
|
|
93
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.0.3", type: AXSelectionGroupDirective, isStandalone: false, selector: "[axSelectionGroup]", inputs: { multipel: { classPropertyName: "multipel", publicName: "multipel", isSignal: true, isRequired: false, transformFunction: null }, selectedKey: { classPropertyName: "selectedKey", publicName: "selectedKey", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "content", predicate: AXSelectionItemDirective, isSignal: true }], exportAs: ["axSelectionGroup"], ngImport: i0 }); }
|
|
88
94
|
}
|
|
89
95
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXSelectionGroupDirective, decorators: [{
|
|
90
96
|
type: Directive,
|
|
91
97
|
args: [{
|
|
92
98
|
selector: '[axSelectionGroup]',
|
|
93
99
|
standalone: false,
|
|
100
|
+
exportAs: 'axSelectionGroup',
|
|
94
101
|
}]
|
|
95
102
|
}] });
|
|
96
103
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-cdk-selection.mjs","sources":["../../../../libs/cdk/selection/src/lib/selection-item.directive.ts","../../../../libs/cdk/selection/src/lib/selection-group.directive.ts","../../../../libs/cdk/selection/src/lib/selection.module.ts","../../../../libs/cdk/selection/src/acorex-cdk-selection.ts"],"sourcesContent":["import { afterNextRender, Directive, ElementRef, inject, input, output, signal } from '@angular/core';\n\n@Directive({\n selector: '[axSelectionItem]',\n exportAs: 'axSelectionItem',\n standalone: false,\n})\nexport class AXSelectionItemDirective {\n private elm = inject(ElementRef);\n isActive = signal(false);\n onActiveState = output<{ component: AXSelectionItemDirective }>();\n key = input.required<string>();\n\n #init2 = afterNextRender(() => {\n (this.elm.nativeElement as HTMLElement).onclick = () => {\n this.onActiveState.emit({ component: this });\n };\n });\n\n public toggle() {\n this.isActive.update((prev) => !prev);\n }\n public select() {\n this.isActive.set(true);\n }\n public unselect() {\n this.isActive.set(false);\n }\n}\n","import { afterNextRender, contentChildren, Directive, effect, input, signal } from '@angular/core';\nimport { AXSelectionItemDirective } from './selection-item.directive';\n\n@Directive({\n selector: '[axSelectionGroup]',\n standalone: false,\n})\nexport class AXSelectionGroupDirective {\n private content = contentChildren(AXSelectionItemDirective);\n private activeIndex = signal(null);\n
|
|
1
|
+
{"version":3,"file":"acorex-cdk-selection.mjs","sources":["../../../../libs/cdk/selection/src/lib/selection-item.directive.ts","../../../../libs/cdk/selection/src/lib/selection-group.directive.ts","../../../../libs/cdk/selection/src/lib/selection.module.ts","../../../../libs/cdk/selection/src/acorex-cdk-selection.ts"],"sourcesContent":["import { afterNextRender, Directive, ElementRef, inject, input, output, signal } from '@angular/core';\n\n@Directive({\n selector: '[axSelectionItem]',\n exportAs: 'axSelectionItem',\n standalone: false,\n})\nexport class AXSelectionItemDirective {\n private elm = inject(ElementRef);\n isActive = signal(false);\n onActiveState = output<{ component: AXSelectionItemDirective }>();\n key = input.required<string>();\n\n #init2 = afterNextRender(() => {\n (this.elm.nativeElement as HTMLElement).onclick = () => {\n this.onActiveState.emit({ component: this });\n };\n });\n\n public toggle() {\n this.isActive.update((prev) => !prev);\n }\n public select() {\n this.isActive.set(true);\n }\n public unselect() {\n this.isActive.set(false);\n }\n}\n","import { afterNextRender, contentChildren, Directive, effect, input, signal } from '@angular/core';\nimport { AXSelectionItemDirective } from './selection-item.directive';\n\n@Directive({\n selector: '[axSelectionGroup]',\n standalone: false,\n exportAs: 'axSelectionGroup',\n})\nexport class AXSelectionGroupDirective {\n private content = contentChildren(AXSelectionItemDirective);\n private activeIndex = signal(null);\n multipel = input(false);\n selectedKey = input<string | string[]>();\n\n #init = afterNextRender(() => {\n this.content().forEach((element) => {\n element.onActiveState.subscribe((e) => {\n this.activeIndex.set(e.component.key());\n if (this.multipel()) {\n element.toggle();\n } else {\n this.content().forEach((element) => {\n if (element.key() !== this.activeIndex()) {\n element.unselect();\n }\n });\n element.select();\n }\n });\n });\n });\n\n #effect = effect(() => {\n if (!this.selectedKey()) return;\n if (typeof this.selectedKey() === 'string') {\n this.content().forEach((element) => {\n if (this.selectedKey() === element.key()) {\n element.isActive.set(true);\n }\n });\n } else if (this.selectedKey() instanceof Array) {\n (this.selectedKey() as Array<string>).forEach((index) => {\n this.content().forEach((element) => {\n if (index === element.key()) {\n element.isActive.set(true);\n }\n });\n });\n }\n });\n\n #effect2 = effect(() => {\n if (!this.selectedKey()) {\n this.content()[0].isActive.set(true);\n }\n });\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXSelectionGroupDirective } from './selection-group.directive';\nimport { AXSelectionItemDirective } from './selection-item.directive';\n\nconst COMPONENT = [AXSelectionGroupDirective, AXSelectionItemDirective];\nconst MODULES = [CommonModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXSelectionModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAOa,wBAAwB,CAAA;AALrC,IAAA,WAAA,GAAA;AAMU,QAAA,IAAA,CAAA,GAAG,GAAG,MA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;
|
|
5
5
|
private activeIndex;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
multipel: import("@angular/core").InputSignal<boolean>;
|
|
7
|
+
selectedKey: import("@angular/core").InputSignal<string | string[]>;
|
|
8
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXSelectionGroupDirective, never>;
|
|
9
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<AXSelectionGroupDirective, "[axSelectionGroup]",
|
|
9
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AXSelectionGroupDirective, "[axSelectionGroup]", ["axSelectionGroup"], { "multipel": { "alias": "multipel"; "required": false; "isSignal": true; }; "selectedKey": { "alias": "selectedKey"; "required": false; "isSignal": true; }; }, {}, ["content"], never, false, never>;
|
|
10
10
|
}
|