@airpower/web 0.2.13 → 0.2.15

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.
@@ -3,11 +3,12 @@ import { DecoratorTarget } from '@airpower/transformer';
3
3
  import { RootModel } from '../../../base';
4
4
  import { WebEnumConstructor } from '../../../util';
5
5
  import { IFieldConfig } from './IFieldConfig';
6
+ import { FieldConfigOptionalKey } from './type';
6
7
  /**
7
8
  * ### 为属性标记配置
8
9
  * @param config 配置项
9
10
  */
10
- export declare function Field<K extends EnumKey = EnumKey>(config?: IFieldConfig<K>): (target: DecoratorTarget, key: string) => void;
11
+ export declare function Field<K extends EnumKey = EnumKey>(config?: FieldConfigOptionalKey<IFieldConfig<K>>): (target: DecoratorTarget, key: string) => void;
11
12
  /**
12
13
  * ### 获取属性的配置
13
14
  * @returns 配置对象
@@ -1,2 +1,3 @@
1
1
  export * from './Field';
2
2
  export * from './IFieldConfig';
3
+ export * from './type';
@@ -0,0 +1,10 @@
1
+ import { IFieldConfig } from './IFieldConfig';
2
+ /**
3
+ * # 字段配置 `Key` 变为可选
4
+ */
5
+ export type FieldConfigOptionalKey<T extends IFieldConfig> = Omit<T, 'key'> & {
6
+ /**
7
+ * ### 这个属性名你不用传入,你传了我也不认
8
+ */
9
+ key?: string;
10
+ };
@@ -1,11 +1,12 @@
1
1
  import { DecoratorTarget } from '@airpower/transformer';
2
2
  import { RootModel } from '../../../base';
3
+ import { FieldConfigOptionalKey } from '../@Field';
3
4
  import { IFormField } from './IFormField';
4
5
  /**
5
6
  * ### 标记该字段可用于表单配置
6
7
  * @param config 配置项
7
8
  */
8
- export declare function Form(config?: IFormField): (target: DecoratorTarget, key: string) => void;
9
+ export declare function Form(config?: FieldConfigOptionalKey<IFormField>): (target: DecoratorTarget, key: string) => void;
9
10
  /**
10
11
  * ### 获取对象某个字段标记的表单配置项
11
12
  * @param target 目标类或对象
@@ -1,11 +1,12 @@
1
1
  import { DecoratorTarget } from '@airpower/transformer';
2
2
  import { RootModel } from '../../../base';
3
+ import { FieldConfigOptionalKey } from '../@Field';
3
4
  import { ISearchField } from './ISearchField';
4
5
  /**
5
6
  * ### 标记该字段可用于表单配置
6
7
  * @param config 配置项
7
8
  */
8
- export declare function Search(config?: ISearchField): (target: DecoratorTarget, key: string) => void;
9
+ export declare function Search(config?: FieldConfigOptionalKey<ISearchField>): (target: DecoratorTarget, key: string) => void;
9
10
  /**
10
11
  * ### 获取对象某个字段标记的搜索配置项
11
12
  * @param target 目标类或对象
@@ -1,11 +1,12 @@
1
1
  import { DecoratorTarget } from '@airpower/transformer';
2
2
  import { RootModel } from '../../../base';
3
+ import { FieldConfigOptionalKey } from '../@Field';
3
4
  import { ITableColumn } from './ITableColumn';
4
5
  /**
5
6
  * ### 为属性标记是表格字段
6
7
  * @param config 表格列的配置
7
8
  */
8
- export declare function Table(config?: ITableColumn): (target: DecoratorTarget, key: string) => void;
9
+ export declare function Table(config?: FieldConfigOptionalKey<ITableColumn>): (target: DecoratorTarget, key: string) => void;
9
10
  /**
10
11
  * ### 获取对象的属性表格的配置
11
12
  * @param target 目标对象
@@ -5,8 +5,7 @@
5
5
  */
6
6
  export interface IBaseField {
7
7
  /**
8
- * ### 字段标题
9
- * 此字段无需传入, 将自动从被标记类的属性上读取
8
+ * ### 字段名称
10
9
  */
11
- key?: string;
10
+ key: string;
12
11
  }
package/dist/main.js CHANGED
@@ -1147,6 +1147,7 @@ class AbstractCurdService extends AbstractService {
1147
1147
  const KEY$4 = `${DecoratorUtil.DecoratorKeyPrefix}[Field]`;
1148
1148
  function Field(config = {}) {
1149
1149
  return (target, key) => {
1150
+ config.key = key;
1150
1151
  DecoratorUtil.setFieldConfig(target, key, KEY$4, config);
1151
1152
  };
1152
1153
  }
@@ -1166,13 +1167,13 @@ const LIST_KEY$2 = `${DecoratorUtil.DecoratorKeyPrefix}[FormList]`;
1166
1167
  function Form(config = {}) {
1167
1168
  return (target, key) => {
1168
1169
  config.key = key;
1169
- return DecoratorUtil.setFieldConfig(target, key, KEY$3, config, LIST_KEY$2);
1170
+ DecoratorUtil.setFieldConfig(target, key, KEY$3, config);
1170
1171
  };
1171
1172
  }
1172
1173
  function getFormConfig(target, key) {
1173
1174
  const formConfig = DecoratorUtil.getFieldConfig(target, key, KEY$3, true);
1174
1175
  if (!formConfig) {
1175
- return {};
1176
+ return { key };
1176
1177
  }
1177
1178
  if (!formConfig.dictionary) {
1178
1179
  const props = getFieldConfig(target, key);
@@ -1213,13 +1214,13 @@ const LIST_KEY$1 = `${DecoratorUtil.DecoratorKeyPrefix}[SearchList]`;
1213
1214
  function Search(config = {}) {
1214
1215
  return (target, key) => {
1215
1216
  config.key = key;
1216
- return DecoratorUtil.setFieldConfig(target, key, KEY$1, config, LIST_KEY$1);
1217
+ DecoratorUtil.setFieldConfig(target, key, KEY$1, config);
1217
1218
  };
1218
1219
  }
1219
1220
  function getSearchConfig(target, key) {
1220
1221
  const formConfig = DecoratorUtil.getFieldConfig(target, key, KEY$1, true);
1221
1222
  if (!formConfig) {
1222
- return {};
1223
+ return { key };
1223
1224
  }
1224
1225
  return formConfig;
1225
1226
  }
@@ -1238,13 +1239,13 @@ const LIST_KEY = `${DecoratorUtil.DecoratorKeyPrefix}[TableList]`;
1238
1239
  function Table(config = {}) {
1239
1240
  return (target, key) => {
1240
1241
  config.key = key;
1241
- return DecoratorUtil.setFieldConfig(target, key, KEY, config, LIST_KEY);
1242
+ DecoratorUtil.setFieldConfig(target, key, KEY, config);
1242
1243
  };
1243
1244
  }
1244
1245
  function getTableConfig(target, key) {
1245
1246
  const tableConfig = DecoratorUtil.getFieldConfig(target, key, KEY, true);
1246
1247
  if (!tableConfig) {
1247
- return {};
1248
+ return { key };
1248
1249
  }
1249
1250
  return tableConfig;
1250
1251
  }
@@ -9452,7 +9453,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
9452
9453
  };
9453
9454
  }
9454
9455
  });
9455
- const ColumnSelector = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-cd8bfac9"]]);
9456
+ const ColumnSelector = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-07993f1c"]]);
9456
9457
  const _sfc_main$4 = /* @__PURE__ */ defineComponent({
9457
9458
  __name: "CopyColumn",
9458
9459
  props: {
package/dist/web.css CHANGED
@@ -1233,10 +1233,10 @@ textarea {
1233
1233
  height: 0;
1234
1234
  overflow: hidden;
1235
1235
  overflow-y: auto;
1236
- }.a-field-selector[data-v-cd8bfac9] {
1236
+ }.a-field-selector[data-v-07993f1c] {
1237
1237
  position: relative;
1238
1238
  }
1239
- .el-check-tag[data-v-cd8bfac9] {
1239
+ .el-check-tag[data-v-07993f1c] {
1240
1240
  font-weight: normal !important;
1241
1241
  user-select: none;
1242
1242
  font-size: 13px;
@@ -1244,7 +1244,7 @@ textarea {
1244
1244
  margin-bottom: 5px;
1245
1245
  padding: 4px 10px;
1246
1246
  }
1247
- .a-field-selector-bg[data-v-cd8bfac9] {
1247
+ .a-field-selector-bg[data-v-07993f1c] {
1248
1248
  position: fixed;
1249
1249
  left: 0;
1250
1250
  right: 0;
@@ -1253,7 +1253,7 @@ textarea {
1253
1253
  background-color: rgba(0, 0, 0, 0.1);
1254
1254
  z-index: 9999999;
1255
1255
  }
1256
- .a-field-selector-dialog[data-v-cd8bfac9] {
1256
+ .a-field-selector-dialog[data-v-07993f1c] {
1257
1257
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
1258
1258
  position: absolute;
1259
1259
  right: 0;
@@ -1266,13 +1266,13 @@ textarea {
1266
1266
  overflow: hidden;
1267
1267
  z-index: 99999991;
1268
1268
  }
1269
- .a-field-selector-dialog .a-field-selector-title[data-v-cd8bfac9] {
1269
+ .a-field-selector-dialog .a-field-selector-title[data-v-07993f1c] {
1270
1270
  margin-bottom: 10px;
1271
1271
  border-bottom: 1px solid var(--el-color-primary-light-9);
1272
1272
  padding: 8px 16px;
1273
1273
  font-size: 15px;
1274
1274
  }
1275
- .a-field-selector-dialog .a-field-selector-list[data-v-cd8bfac9] {
1275
+ .a-field-selector-dialog .a-field-selector-list[data-v-07993f1c] {
1276
1276
  padding: 5px 15px 10px 15px;
1277
1277
  display: flex;
1278
1278
  flex-wrap: wrap;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@airpower/web",
3
3
  "type": "module",
4
- "version": "0.2.13",
4
+ "version": "0.2.15",
5
5
  "description": "AirPower-Web",
6
6
  "author": {
7
7
  "name": "Hamm",