@airpower/web 0.2.17 → 0.2.18

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.
@@ -15,16 +15,16 @@ export declare function Field<K extends EnumKey = EnumKey>(config?: FieldConfigO
15
15
  * @param TargetClass 目标类
16
16
  * @param key 属性名
17
17
  */
18
- export declare function getFieldConfig<M extends RootModel, K extends EnumKey = EnumKey>(TargetClass: ITransformerConstructor<M>, key: string): IFieldConfig<K>;
18
+ export declare function getFieldConfig<M extends RootModel, K extends EnumKey = EnumKey>(TargetClass: ITransformerConstructor<M>, key: keyof M): IFieldConfig<K>;
19
19
  /**
20
20
  * ### 获取属性的枚举字典
21
21
  * @param TargetClass 目标类
22
22
  * @param key 属性名
23
23
  */
24
- export declare function getDictionary<M extends RootModel, K extends EnumKey = EnumKey>(TargetClass: ITransformerConstructor<M>, key: string): WebEnumConstructor<K> | undefined;
24
+ export declare function getDictionary<M extends RootModel, K extends EnumKey = EnumKey>(TargetClass: ITransformerConstructor<M>, key: keyof M): WebEnumConstructor<K> | undefined;
25
25
  /**
26
26
  * ### 获取属性的标题
27
27
  * @param TargetClass 目标类
28
28
  * @param key string 属性名
29
29
  */
30
- export declare function getFieldLabel<M extends RootModel>(TargetClass: ITransformerConstructor<M>, key: string): string;
30
+ export declare function getFieldLabel<M extends RootModel>(TargetClass: ITransformerConstructor<M>, key: keyof M): string;
@@ -12,15 +12,15 @@ export declare function Form(config?: FieldConfigOptionalKey<IFormField>): (targ
12
12
  * @param TargetClass 目标类
13
13
  * @param key 属性名
14
14
  */
15
- export declare function getFormConfig<M extends RootModel>(TargetClass: ITransformerConstructor<M>, key: string): IFormField;
15
+ export declare function getFormConfig<M extends RootModel>(TargetClass: ITransformerConstructor<M>, key: keyof M): IFormField;
16
16
  /**
17
17
  * ### 获取标记了表单配置的字段列表
18
18
  * @param TargetClass 目标类
19
19
  */
20
- export declare function getFormFieldList<M extends RootModel>(TargetClass: ITransformerConstructor<M>): string[];
20
+ export declare function getFormFieldList<M extends RootModel>(TargetClass: ITransformerConstructor<M>): Array<keyof M>;
21
21
  /**
22
22
  * ### 获取指定类的表单字段配置项列表
23
23
  * @param TargetClass 目标类
24
24
  * @param keyList 选择字段列表
25
25
  */
26
- export declare function getFormConfigList<M extends RootModel>(TargetClass: ITransformerConstructor<M>, keyList?: string[]): IFormField[];
26
+ export declare function getFormConfigList<M extends RootModel>(TargetClass: ITransformerConstructor<M>, keyList?: Array<keyof M>): IFormField[];
@@ -12,15 +12,15 @@ export declare function Search(config?: FieldConfigOptionalKey<ISearchField>): (
12
12
  * @param TargetClass 目标类
13
13
  * @param key 属性名
14
14
  */
15
- export declare function getSearchConfig<M extends RootModel>(TargetClass: ITransformerConstructor<M>, key: string): ISearchField;
15
+ export declare function getSearchConfig<M extends RootModel>(TargetClass: ITransformerConstructor<M>, key: keyof M): ISearchField;
16
16
  /**
17
17
  * ### 获取标记了搜索配置的字段列表
18
18
  * @param TargetClass 目标类
19
19
  */
20
- export declare function getSearchFieldList<M extends RootModel>(TargetClass: ITransformerConstructor<M>): string[];
20
+ export declare function getSearchFieldList<M extends RootModel>(TargetClass: ITransformerConstructor<M>): Array<keyof M>;
21
21
  /**
22
22
  * ### 获取指定类的搜索字段配置项列表
23
23
  * @param TargetClass 目标类
24
24
  * @param keyList 选择字段列表
25
25
  */
26
- export declare function getSearchConfigList<M extends RootModel>(TargetClass: ITransformerConstructor<M>, keyList?: string[]): ISearchField[];
26
+ export declare function getSearchConfigList<M extends RootModel>(TargetClass: ITransformerConstructor<M>, keyList?: Array<keyof M>): ISearchField[];
@@ -12,15 +12,15 @@ export declare function Table(config?: FieldConfigOptionalKey<ITableColumn>): (t
12
12
  * @param TargetClass 目标类
13
13
  * @param key 属性名
14
14
  */
15
- export declare function getTableConfig<M extends RootModel>(TargetClass: ITransformerConstructor<M>, key: string): ITableColumn;
15
+ export declare function getTableConfig<M extends RootModel>(TargetClass: ITransformerConstructor<M>, key: keyof M): ITableColumn;
16
16
  /**
17
17
  * ### 获取标记了表格配置的字段列表
18
18
  * @param TargetClass 目标类
19
19
  */
20
- export declare function getTableFieldList<M extends RootModel>(TargetClass: ITransformerConstructor<M>): string[];
20
+ export declare function getTableFieldList<M extends RootModel>(TargetClass: ITransformerConstructor<M>): Array<keyof M>;
21
21
  /**
22
22
  * ### 获取字段标记的表格字段配置列表
23
23
  * @param TargetClass 目标类
24
24
  * @param keyList 字段列表
25
25
  */
26
- export declare function getTableConfigList<M extends RootModel>(TargetClass: ITransformerConstructor<M>, keyList?: string[]): Array<ITableColumn>;
26
+ export declare function getTableConfigList<M extends RootModel>(TargetClass: ITransformerConstructor<M>, keyList?: Array<keyof M>): Array<ITableColumn>;
package/dist/main.js CHANGED
@@ -1152,7 +1152,7 @@ function Field(config = {}) {
1152
1152
  };
1153
1153
  }
1154
1154
  function getFieldConfig(TargetClass, key) {
1155
- return DecoratorUtil.getFieldConfig(TargetClass, key, KEY$4, true) || {};
1155
+ return DecoratorUtil.getFieldConfig(TargetClass, key.toString(), KEY$4, true) || {};
1156
1156
  }
1157
1157
  function getDictionary(TargetClass, key) {
1158
1158
  var _a;
@@ -1160,7 +1160,7 @@ function getDictionary(TargetClass, key) {
1160
1160
  }
1161
1161
  function getFieldLabel(TargetClass, key) {
1162
1162
  var _a;
1163
- return ((_a = getFieldConfig(TargetClass, key)) == null ? void 0 : _a.label) || key;
1163
+ return ((_a = getFieldConfig(TargetClass, key)) == null ? void 0 : _a.label) || key.toString();
1164
1164
  }
1165
1165
  const KEY$3 = `${DecoratorUtil.DecoratorKeyPrefix}[Form]`;
1166
1166
  const LIST_KEY$2 = `${DecoratorUtil.DecoratorKeyPrefix}[FormList]`;
@@ -1171,9 +1171,9 @@ function Form(config = {}) {
1171
1171
  };
1172
1172
  }
1173
1173
  function getFormConfig(TargetClass, key) {
1174
- const formConfig = DecoratorUtil.getFieldConfig(TargetClass, key, KEY$3, true);
1174
+ const formConfig = DecoratorUtil.getFieldConfig(TargetClass, key.toString(), KEY$3, true);
1175
1175
  if (!formConfig) {
1176
- return { key };
1176
+ return { key: key.toString() };
1177
1177
  }
1178
1178
  if (!formConfig.dictionary) {
1179
1179
  const props = getFieldConfig(TargetClass, key);
@@ -1219,9 +1219,9 @@ function Search(config = {}) {
1219
1219
  }
1220
1220
  function getSearchConfig(TargetClass, key) {
1221
1221
  const instance = new TargetClass();
1222
- const formConfig = DecoratorUtil.getFieldConfig(instance, key, KEY$1, true);
1222
+ const formConfig = DecoratorUtil.getFieldConfig(instance, key.toString(), KEY$1, true);
1223
1223
  if (!formConfig) {
1224
- return { key };
1224
+ return { key: key.toString() };
1225
1225
  }
1226
1226
  return formConfig;
1227
1227
  }
@@ -1245,9 +1245,9 @@ function Table(config = {}) {
1245
1245
  }
1246
1246
  function getTableConfig(TargetClass, key) {
1247
1247
  const instance = new TargetClass();
1248
- const tableConfig = DecoratorUtil.getFieldConfig(instance, key, KEY, true);
1248
+ const tableConfig = DecoratorUtil.getFieldConfig(instance, key.toString(), KEY, true);
1249
1249
  if (!tableConfig) {
1250
- return { key };
1250
+ return { key: key.toString() };
1251
1251
  }
1252
1252
  return tableConfig;
1253
1253
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@airpower/web",
3
3
  "type": "module",
4
- "version": "0.2.17",
4
+ "version": "0.2.18",
5
5
  "description": "AirPower-Web",
6
6
  "author": {
7
7
  "name": "Hamm",