uni-app-fe 0.1.39 → 0.2.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.
@@ -0,0 +1,135 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, input, Directive, NgModule, DestroyRef, effect } from '@angular/core';
3
+ import { DxDataGridModule } from 'devextreme-angular/ui/data-grid';
4
+ import { DxiColumnComponent } from 'devextreme-angular/ui/nested';
5
+ import { UniLocaleManager } from 'uni-manager/locale';
6
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
7
+ import { DxSelectBoxComponent, DxSelectBoxModule } from 'devextreme-angular/ui/select-box';
8
+
9
+ class UniDxiColumnDirective {
10
+ constructor() {
11
+ /* Service */
12
+ this.column = inject(DxiColumnComponent);
13
+ /* Props */
14
+ this.uniConfig = input.required(...(ngDevMode ? [{ debugName: "uniConfig" }] : /* istanbul ignore next */ []));
15
+ }
16
+ ngOnInit() {
17
+ const config = this.uniConfig();
18
+ this.column.name = config.name ?? config.dataField;
19
+ this.column.dataField = config.dataField;
20
+ this.column.dataType = config.dataType;
21
+ this.column.format = config.format;
22
+ this.column.caption = UniLocaleManager.translate(config.caption ?? config.dataField ?? '');
23
+ if (config.width) {
24
+ this.column.width = `${config.width}%`;
25
+ }
26
+ this.column.minWidth = config.minWidth ?? 100;
27
+ this.column.alignment = config.alignment;
28
+ this.column.cssClass = config.cssClass;
29
+ if (config.sort) {
30
+ this.column.sortIndex = config.sort.index;
31
+ this.column.sortOrder = config.sort.order;
32
+ }
33
+ }
34
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniDxiColumnDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
35
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.12", type: UniDxiColumnDirective, isStandalone: true, selector: "dxi-column[uniConfig]", inputs: { uniConfig: { classPropertyName: "uniConfig", publicName: "uniConfig", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
36
+ }
37
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniDxiColumnDirective, decorators: [{
38
+ type: Directive,
39
+ args: [{
40
+ selector: 'dxi-column[uniConfig]',
41
+ standalone: true,
42
+ }]
43
+ }], propDecorators: { uniConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "uniConfig", required: true }] }] } });
44
+ class UniDxDataGridModule {
45
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniDxDataGridModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
46
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.12", ngImport: i0, type: UniDxDataGridModule, imports: [DxDataGridModule, UniDxiColumnDirective], exports: [DxDataGridModule, UniDxiColumnDirective] }); }
47
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniDxDataGridModule, imports: [DxDataGridModule, DxDataGridModule] }); }
48
+ }
49
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniDxDataGridModule, decorators: [{
50
+ type: NgModule,
51
+ args: [{
52
+ imports: [DxDataGridModule, UniDxiColumnDirective],
53
+ exports: [DxDataGridModule, UniDxiColumnDirective],
54
+ }]
55
+ }] });
56
+
57
+ /* eslint-disable @typescript-eslint/no-explicit-any */
58
+ class UniDxSelectBoxDirective {
59
+ constructor() {
60
+ /* Service */
61
+ this.dxSelect = inject(DxSelectBoxComponent);
62
+ this.destroyRef = inject(DestroyRef);
63
+ /* Props */
64
+ this.uniConfig = input.required(...(ngDevMode ? [{ debugName: "uniConfig" }] : /* istanbul ignore next */ []));
65
+ // Default DevExtreme
66
+ this.dxSelect.valueExpr = 'id';
67
+ this.dxSelect.displayExpr = 'description';
68
+ this.dxSelect.stylingMode = 'filled';
69
+ // UI valore (1)
70
+ effect(() => {
71
+ const uniControl = this.uniConfig();
72
+ if (this.dxSelect.value !== uniControl.value()) {
73
+ this.dxSelect.value = uniControl.value();
74
+ }
75
+ });
76
+ // UI validità
77
+ effect(() => {
78
+ const uniControl = this.uniConfig();
79
+ this.dxSelect.isValid = !uniControl.touched() || !uniControl.invalid();
80
+ });
81
+ // UI errori
82
+ effect(() => {
83
+ const errors = this.uniConfig().errors();
84
+ this.dxSelect.validationErrors =
85
+ errors.length > 0
86
+ ? errors.map((error) => ({
87
+ message: UniLocaleManager.translate(error.kind, 'lbl', {
88
+ value: error.kind,
89
+ }),
90
+ }))
91
+ : [];
92
+ });
93
+ }
94
+ ngOnInit() {
95
+ const uniControl = this.uniConfig();
96
+ // Cambio valore (2)
97
+ this.dxSelect.onValueChanged.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((event) => {
98
+ if (event.value !== uniControl.value()) {
99
+ uniControl.controlValue.set(event.value);
100
+ }
101
+ });
102
+ // Blur
103
+ this.dxSelect.onFocusOut.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
104
+ uniControl.markAsTouched();
105
+ });
106
+ }
107
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniDxSelectBoxDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
108
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.12", type: UniDxSelectBoxDirective, isStandalone: true, selector: "dx-select-box[uniConfig]", inputs: { uniConfig: { classPropertyName: "uniConfig", publicName: "uniConfig", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
109
+ }
110
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniDxSelectBoxDirective, decorators: [{
111
+ type: Directive,
112
+ args: [{
113
+ selector: 'dx-select-box[uniConfig]',
114
+ standalone: true,
115
+ }]
116
+ }], ctorParameters: () => [], propDecorators: { uniConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "uniConfig", required: true }] }] } });
117
+ class UniDxSelectBoxModule {
118
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniDxSelectBoxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
119
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.12", ngImport: i0, type: UniDxSelectBoxModule, imports: [DxSelectBoxModule, UniDxSelectBoxDirective], exports: [DxSelectBoxModule, UniDxSelectBoxDirective] }); }
120
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniDxSelectBoxModule, imports: [DxSelectBoxModule, DxSelectBoxModule] }); }
121
+ }
122
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniDxSelectBoxModule, decorators: [{
123
+ type: NgModule,
124
+ args: [{
125
+ imports: [DxSelectBoxModule, UniDxSelectBoxDirective],
126
+ exports: [DxSelectBoxModule, UniDxSelectBoxDirective],
127
+ }]
128
+ }] });
129
+
130
+ /**
131
+ * Generated bundle index. Do not edit.
132
+ */
133
+
134
+ export { UniDxDataGridModule, UniDxSelectBoxDirective, UniDxSelectBoxModule, UniDxiColumnDirective };
135
+ //# sourceMappingURL=uni-app-fe-module.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uni-app-fe-module.mjs","sources":["../../../projects/uni-app-fe/module/uni-dx-data-grid.module.ts","../../../projects/uni-app-fe/module/uni-dx-select-box.module.ts","../../../projects/uni-app-fe/module/uni-app-fe-module.ts"],"sourcesContent":["import { Directive, inject, input, NgModule, OnInit } from '@angular/core';\r\nimport { DxDataGridModule } from 'devextreme-angular/ui/data-grid';\r\nimport { DxiColumnComponent } from 'devextreme-angular/ui/nested';\r\nimport { Format } from 'devextreme/localization';\r\nimport { DataType, HorizontalAlignment, SortOrder } from 'devextreme/ui/data_grid';\r\nimport { UniLocaleManager } from 'uni-manager/locale';\r\nimport type { Column } from 'uni-model-type/type';\r\n\r\n@Directive({\r\n selector: 'dxi-column[uniConfig]',\r\n standalone: true,\r\n})\r\nexport class UniDxiColumnDirective implements OnInit {\r\n /* Service */\r\n private column = inject(DxiColumnComponent);\r\n\r\n /* Props */\r\n uniConfig = input.required<Column>();\r\n\r\n ngOnInit(): void {\r\n const config = this.uniConfig();\r\n\r\n this.column.name = config.name ?? config.dataField;\r\n this.column.dataField = config.dataField;\r\n this.column.dataType = config.dataType as DataType;\r\n this.column.format = config.format as Format;\r\n this.column.caption = UniLocaleManager.translate(config.caption ?? config.dataField ?? '');\r\n\r\n if (config.width) {\r\n this.column.width = `${config.width}%`;\r\n }\r\n\r\n this.column.minWidth = config.minWidth ?? 100;\r\n this.column.alignment = config.alignment as HorizontalAlignment;\r\n this.column.cssClass = config.cssClass;\r\n\r\n if (config.sort) {\r\n this.column.sortIndex = config.sort.index;\r\n this.column.sortOrder = config.sort.order as SortOrder;\r\n }\r\n }\r\n}\r\n\r\n@NgModule({\r\n imports: [DxDataGridModule, UniDxiColumnDirective],\r\n exports: [DxDataGridModule, UniDxiColumnDirective],\r\n})\r\nexport class UniDxDataGridModule {}\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport { DestroyRef, Directive, effect, inject, input, NgModule, OnInit } from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { FieldState } from '@angular/forms/signals';\r\nimport { DxSelectBoxComponent, DxSelectBoxModule } from 'devextreme-angular/ui/select-box';\r\nimport { UniLocaleManager } from 'uni-manager/locale';\r\n\r\n@Directive({\r\n selector: 'dx-select-box[uniConfig]',\r\n standalone: true,\r\n})\r\nexport class UniDxSelectBoxDirective implements OnInit {\r\n /* Service */\r\n private readonly dxSelect = inject(DxSelectBoxComponent);\r\n private readonly destroyRef = inject(DestroyRef);\r\n\r\n /* Props */\r\n uniConfig = input.required<FieldState<any | null, string>>();\r\n\r\n constructor() {\r\n // Default DevExtreme\r\n this.dxSelect.valueExpr = 'id';\r\n this.dxSelect.displayExpr = 'description';\r\n this.dxSelect.stylingMode = 'filled';\r\n\r\n // UI valore (1)\r\n effect(() => {\r\n const uniControl = this.uniConfig();\r\n\r\n if (this.dxSelect.value !== uniControl.value()) {\r\n this.dxSelect.value = uniControl.value();\r\n }\r\n });\r\n\r\n // UI validità\r\n effect(() => {\r\n const uniControl = this.uniConfig();\r\n this.dxSelect.isValid = !uniControl.touched() || !uniControl.invalid();\r\n });\r\n\r\n // UI errori\r\n effect(() => {\r\n const errors = this.uniConfig().errors();\r\n this.dxSelect.validationErrors =\r\n errors.length > 0\r\n ? errors.map((error) => ({\r\n message: UniLocaleManager.translate(error.kind, 'lbl', {\r\n value: error.kind,\r\n }),\r\n }))\r\n : [];\r\n });\r\n }\r\n\r\n ngOnInit(): void {\r\n const uniControl = this.uniConfig();\r\n\r\n // Cambio valore (2)\r\n this.dxSelect.onValueChanged.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((event) => {\r\n if (event.value !== uniControl.value()) {\r\n uniControl.controlValue.set(event.value);\r\n }\r\n });\r\n\r\n // Blur\r\n this.dxSelect.onFocusOut.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {\r\n uniControl.markAsTouched();\r\n });\r\n }\r\n}\r\n\r\n@NgModule({\r\n imports: [DxSelectBoxModule, UniDxSelectBoxDirective],\r\n exports: [DxSelectBoxModule, UniDxSelectBoxDirective],\r\n})\r\nexport class UniDxSelectBoxModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAYa,qBAAqB,CAAA;AAJlC,IAAA,WAAA,GAAA;;AAMU,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,kBAAkB,CAAC;;AAG3C,QAAA,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AA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,YAHrB,iBAAiB,EA7DhB,uBAAuB,CAAA,EAAA,OAAA,EAAA,CA8DxB,iBAAiB,EA9DhB,uBAAuB,CAAA,EAAA,CAAA,CAAA;gHAgEvB,oBAAoB,EAAA,OAAA,EAAA,CAHrB,iBAAiB,EACjB,iBAAiB,CAAA,EAAA,CAAA,CAAA;;4FAEhB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,iBAAiB,EAAE,uBAAuB,CAAC;AACrD,oBAAA,OAAO,EAAE,CAAC,iBAAiB,EAAE,uBAAuB,CAAC;AACtD,iBAAA;;;AC1ED;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uni-app-fe",
3
- "version": "0.1.39",
3
+ "version": "0.2.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=21.2.0",
6
6
  "@angular/core": ">=21.2.0",
@@ -28,14 +28,14 @@
28
28
  "types": "./types/uni-app-fe-component.d.ts",
29
29
  "default": "./fesm2022/uni-app-fe-component.mjs"
30
30
  },
31
- "./directive": {
32
- "types": "./types/uni-app-fe-directive.d.ts",
33
- "default": "./fesm2022/uni-app-fe-directive.mjs"
34
- },
35
31
  "./manager": {
36
32
  "types": "./types/uni-app-fe-manager.d.ts",
37
33
  "default": "./fesm2022/uni-app-fe-manager.mjs"
38
34
  },
35
+ "./module": {
36
+ "types": "./types/uni-app-fe-module.d.ts",
37
+ "default": "./fesm2022/uni-app-fe-module.mjs"
38
+ },
39
39
  "./pipe": {
40
40
  "types": "./types/uni-app-fe-pipe.d.ts",
41
41
  "default": "./fesm2022/uni-app-fe-pipe.mjs"
@@ -0,0 +1,36 @@
1
+ import * as i0 from '@angular/core';
2
+ import { OnInit } from '@angular/core';
3
+ import { Column } from 'uni-model-type/type';
4
+ import * as i1 from 'devextreme-angular/ui/data-grid';
5
+ import { FieldState } from '@angular/forms/signals';
6
+ import * as i1$1 from 'devextreme-angular/ui/select-box';
7
+
8
+ declare class UniDxiColumnDirective implements OnInit {
9
+ private column;
10
+ uniConfig: i0.InputSignal<Column>;
11
+ ngOnInit(): void;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<UniDxiColumnDirective, never>;
13
+ static ɵdir: i0.ɵɵDirectiveDeclaration<UniDxiColumnDirective, "dxi-column[uniConfig]", never, { "uniConfig": { "alias": "uniConfig"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
14
+ }
15
+ declare class UniDxDataGridModule {
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<UniDxDataGridModule, never>;
17
+ static ɵmod: i0.ɵɵNgModuleDeclaration<UniDxDataGridModule, never, [typeof i1.DxDataGridModule, typeof UniDxiColumnDirective], [typeof i1.DxDataGridModule, typeof UniDxiColumnDirective]>;
18
+ static ɵinj: i0.ɵɵInjectorDeclaration<UniDxDataGridModule>;
19
+ }
20
+
21
+ declare class UniDxSelectBoxDirective implements OnInit {
22
+ private readonly dxSelect;
23
+ private readonly destroyRef;
24
+ uniConfig: i0.InputSignal<FieldState<any, string>>;
25
+ constructor();
26
+ ngOnInit(): void;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<UniDxSelectBoxDirective, never>;
28
+ static ɵdir: i0.ɵɵDirectiveDeclaration<UniDxSelectBoxDirective, "dx-select-box[uniConfig]", never, { "uniConfig": { "alias": "uniConfig"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
29
+ }
30
+ declare class UniDxSelectBoxModule {
31
+ static ɵfac: i0.ɵɵFactoryDeclaration<UniDxSelectBoxModule, never>;
32
+ static ɵmod: i0.ɵɵNgModuleDeclaration<UniDxSelectBoxModule, never, [typeof i1$1.DxSelectBoxModule, typeof UniDxSelectBoxDirective], [typeof i1$1.DxSelectBoxModule, typeof UniDxSelectBoxDirective]>;
33
+ static ɵinj: i0.ɵɵInjectorDeclaration<UniDxSelectBoxModule>;
34
+ }
35
+
36
+ export { UniDxDataGridModule, UniDxSelectBoxDirective, UniDxSelectBoxModule, UniDxiColumnDirective };
@@ -1,47 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, input, Directive } from '@angular/core';
3
- import { DxiColumnComponent } from 'devextreme-angular/ui/nested';
4
- import { UniLocaleManager } from 'uni-manager/locale';
5
-
6
- class UniColumnDirective {
7
- constructor() {
8
- /* Service */
9
- this.column = inject(DxiColumnComponent);
10
- /* Props */
11
- this.config = input.required(...(ngDevMode ? [{ debugName: "config" }] : /* istanbul ignore next */ []));
12
- }
13
- ngOnInit() {
14
- const config = this.config();
15
- this.column.name = config.name ?? config.dataField;
16
- this.column.dataField = config.dataField;
17
- this.column.dataType = config.dataType;
18
- this.column.format = config.format;
19
- this.column.caption = UniLocaleManager.translate(config.caption ?? config.dataField ?? '');
20
- if (config.width) {
21
- this.column.width = `${config.width}%`;
22
- }
23
- this.column.minWidth = config.minWidth ?? 100;
24
- this.column.alignment = config.alignment;
25
- this.column.cssClass = config.cssClass;
26
- if (config.sort) {
27
- this.column.sortIndex = config.sort.index;
28
- this.column.sortOrder = config.sort.order;
29
- }
30
- }
31
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniColumnDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
32
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.12", type: UniColumnDirective, isStandalone: true, selector: "dxi-column[config]", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
33
- }
34
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: UniColumnDirective, decorators: [{
35
- type: Directive,
36
- args: [{
37
- selector: 'dxi-column[config]',
38
- standalone: true,
39
- }]
40
- }], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }] } });
41
-
42
- /**
43
- * Generated bundle index. Do not edit.
44
- */
45
-
46
- export { UniColumnDirective };
47
- //# sourceMappingURL=uni-app-fe-directive.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"uni-app-fe-directive.mjs","sources":["../../../projects/uni-app-fe/directive/uni-column.directive.ts","../../../projects/uni-app-fe/directive/uni-app-fe-directive.ts"],"sourcesContent":["import { Directive, inject, input, OnInit } from '@angular/core';\r\nimport { DxiColumnComponent } from 'devextreme-angular/ui/nested';\r\nimport { Format } from 'devextreme/localization';\r\nimport { DataType, HorizontalAlignment, SortOrder } from 'devextreme/ui/data_grid';\r\nimport { UniLocaleManager } from 'uni-manager/locale';\r\nimport type { Column } from 'uni-model-type/type';\r\n\r\n@Directive({\r\n selector: 'dxi-column[config]',\r\n standalone: true,\r\n})\r\nexport class UniColumnDirective implements OnInit {\r\n /* Service */\r\n private column = inject(DxiColumnComponent);\r\n\r\n /* Props */\r\n config = input.required<Column>();\r\n\r\n ngOnInit(): void {\r\n const config = this.config();\r\n\r\n this.column.name = config.name ?? config.dataField;\r\n this.column.dataField = config.dataField;\r\n this.column.dataType = config.dataType as DataType;\r\n this.column.format = config.format as Format;\r\n this.column.caption = UniLocaleManager.translate(config.caption ?? config.dataField ?? '');\r\n\r\n if (config.width) {\r\n this.column.width = `${config.width}%`;\r\n }\r\n\r\n this.column.minWidth = config.minWidth ?? 100;\r\n this.column.alignment = config.alignment as HorizontalAlignment;\r\n this.column.cssClass = config.cssClass;\r\n\r\n if (config.sort) {\r\n this.column.sortIndex = config.sort.index;\r\n this.column.sortOrder = config.sort.order as SortOrder;\r\n }\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAWa,kBAAkB,CAAA;AAJ/B,IA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AA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAlB,kBAAkB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,QAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACVD;;AAEG;;;;"}
@@ -1,13 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { OnInit } from '@angular/core';
3
- import { Column } from 'uni-model-type/type';
4
-
5
- declare class UniColumnDirective implements OnInit {
6
- private column;
7
- config: i0.InputSignal<Column>;
8
- ngOnInit(): void;
9
- static ɵfac: i0.ɵɵFactoryDeclaration<UniColumnDirective, never>;
10
- static ɵdir: i0.ɵɵDirectiveDeclaration<UniColumnDirective, "dxi-column[config]", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
11
- }
12
-
13
- export { UniColumnDirective };