@tmagic/form 1.2.0-beta.11 → 1.2.0-beta.13

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.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.2.0-beta.11",
2
+ "version": "1.2.0-beta.13",
3
3
  "name": "@tmagic/form",
4
4
  "sideEffects": [
5
5
  "dist/*",
@@ -35,8 +35,8 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@element-plus/icons-vue": "^2.0.9",
38
- "@tmagic/design": "1.2.0-beta.11",
39
- "@tmagic/utils": "1.2.0-beta.11",
38
+ "@tmagic/design": "1.2.0-beta.13",
39
+ "@tmagic/utils": "1.2.0-beta.13",
40
40
  "lodash-es": "^4.17.21",
41
41
  "sortablejs": "^1.14.0",
42
42
  "vue": "^3.2.37"
@@ -101,7 +101,7 @@
101
101
  labelWidth="0"
102
102
  :prop="getProp(scope.$index)"
103
103
  :rules="column.rules"
104
- :config="makeConfig(column)"
104
+ :config="makeConfig(column, scope.row)"
105
105
  :model="scope.row"
106
106
  :size="size"
107
107
  @change="$emit('change', model[modelName])"
@@ -432,8 +432,11 @@ const toggleRowSelection = (row: any, selected: boolean) => {
432
432
  tMagicTable.value?.toggleRowSelection.call(tMagicTable.value, row, selected);
433
433
  };
434
434
 
435
- const makeConfig = (config: ColumnConfig) => {
435
+ const makeConfig = (config: ColumnConfig, row: any) => {
436
436
  const newConfig = cloneDeep(config);
437
+ if (typeof config.itemsFunction === 'function') {
438
+ newConfig.items = config.itemsFunction(row);
439
+ }
437
440
  delete newConfig.display;
438
441
  return newConfig;
439
442
  };
@@ -6,7 +6,7 @@
6
6
  :placeholder="config.placeholder"
7
7
  :disabled="disabled"
8
8
  :format="config.format"
9
- :value-format="config.format || 'YYYY-MM-DD HH:mm:ss'"
9
+ :value-format="config.valueFormat || 'YYYY-MM-DD HH:mm:ss'"
10
10
  @change="changeHandler"
11
11
  ></TMagicDatePicker>
12
12
  </template>
@@ -1,6 +1,8 @@
1
1
  <template>
2
2
  <TMagicTimePicker
3
3
  v-model="model[name]"
4
+ :value-format="config.valueFormat || 'HH:mm:ss'"
5
+ :format="config.format || 'HH:mm:ss'"
4
6
  :size="size"
5
7
  :placeholder="config.placeholder"
6
8
  :disabled="disabled"
package/src/schema.ts CHANGED
@@ -348,6 +348,7 @@ export interface HiddenConfig extends FormItem {
348
348
  export interface DateConfig extends FormItem, Input {
349
349
  type: 'date';
350
350
  format?: 'YYYY-MM-dd HH:mm:ss' | string;
351
+ valueFormat?: 'YYYY-MM-dd HH:mm:ss' | string;
351
352
  }
352
353
 
353
354
  /**
@@ -365,6 +366,8 @@ export interface DateTimeConfig extends FormItem, Input {
365
366
  */
366
367
  export interface TimeConfig extends FormItem, Input {
367
368
  type: 'time';
369
+ format?: 'HH:mm:ss' | string;
370
+ valueFormat?: 'HH:mm:ss' | string;
368
371
  }
369
372
 
370
373
  /**
package/types/schema.d.ts CHANGED
@@ -270,6 +270,7 @@ export interface HiddenConfig extends FormItem {
270
270
  export interface DateConfig extends FormItem, Input {
271
271
  type: 'date';
272
272
  format?: 'YYYY-MM-dd HH:mm:ss' | string;
273
+ valueFormat?: 'YYYY-MM-dd HH:mm:ss' | string;
273
274
  }
274
275
  /**
275
276
  * 日期时间选择器
@@ -285,6 +286,8 @@ export interface DateTimeConfig extends FormItem, Input {
285
286
  */
286
287
  export interface TimeConfig extends FormItem, Input {
287
288
  type: 'time';
289
+ format?: 'HH:mm:ss' | string;
290
+ valueFormat?: 'HH:mm:ss' | string;
288
291
  }
289
292
  /**
290
293
  * 单个多选框