@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/dist/tmagic-form.mjs +9 -4
- package/dist/tmagic-form.mjs.map +1 -1
- package/dist/tmagic-form.umd.js +9 -4
- package/dist/tmagic-form.umd.js.map +1 -1
- package/package.json +3 -3
- package/src/containers/Table.vue +5 -2
- package/src/fields/Date.vue +1 -1
- package/src/fields/Time.vue +2 -0
- package/src/schema.ts +3 -0
- package/types/schema.d.ts +3 -0
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.2.0-beta.
|
|
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.
|
|
39
|
-
"@tmagic/utils": "1.2.0-beta.
|
|
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"
|
package/src/containers/Table.vue
CHANGED
|
@@ -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
|
};
|
package/src/fields/Date.vue
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
:placeholder="config.placeholder"
|
|
7
7
|
:disabled="disabled"
|
|
8
8
|
:format="config.format"
|
|
9
|
-
:value-format="config.
|
|
9
|
+
:value-format="config.valueFormat || 'YYYY-MM-DD HH:mm:ss'"
|
|
10
10
|
@change="changeHandler"
|
|
11
11
|
></TMagicDatePicker>
|
|
12
12
|
</template>
|
package/src/fields/Time.vue
CHANGED
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
|
* 单个多选框
|