uni-app-fe 0.1.24 → 0.1.25
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,47 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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 { 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,IAAA,WAAA,GAAA;;AAMU,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,kBAAkB,CAAC;;AAG3C,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,4EAAU;AAwBlC,IAAA;IAtBC,QAAQ,GAAA;AACN,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE;AAE5B,QAAA,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,SAAS;QAClD,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS;QACxC,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAoB;QAClD,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAgB;AAC5C,QAAA,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,gBAAgB,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC;AAE1F,QAAA,IAAI,MAAM,CAAC,KAAK,EAAE;YAChB,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,GAAG,MAAM,CAAC,KAAK,CAAA,CAAA,CAAG;QACxC;QAEA,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,GAAG;QAC7C,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,SAAgC;QAC/D,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ;AAEtC,QAAA,IAAI,MAAM,CAAC,IAAI,EAAE;YACf,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK;YACzC,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,KAAkB;QACxD;IACF;+GA5BW,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,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;;;;"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uni-app-fe",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.25",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": ">=21.2.0",
|
|
6
6
|
"@angular/core": ">=21.2.0",
|
|
7
7
|
"devextreme": ">=25.2.0",
|
|
8
8
|
"devextreme-angular": ">=25.2.0",
|
|
9
|
-
"uni-model-type": ">=0.1.
|
|
9
|
+
"uni-model-type": ">=0.1.19",
|
|
10
10
|
"uni-error": ">=0.1.22",
|
|
11
11
|
"uni-manager": ">=0.1.44"
|
|
12
12
|
},
|
|
@@ -28,6 +28,10 @@
|
|
|
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
|
+
},
|
|
31
35
|
"./manager": {
|
|
32
36
|
"types": "./types/uni-app-fe-manager.d.ts",
|
|
33
37
|
"default": "./fesm2022/uni-app-fe-manager.mjs"
|
|
@@ -0,0 +1,13 @@
|
|
|
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 };
|