yc-pro-components 0.0.16 → 0.0.17
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/es/components/check-card/index.d.ts +38 -38
- package/es/components/check-card/src/index.vue.d.ts +2 -2
- package/es/components/check-card-group/index.d.ts +19 -19
- package/es/components/check-card-group/src/index.vue.d.ts +1 -1
- package/es/components/display-item/index.d.ts +41 -41
- package/es/components/display-item/src/index.vue.d.ts +22 -22
- package/es/components/form/index.d.ts +5 -0
- package/es/components/form/src/form-content.vue.d.ts +20 -20
- package/es/components/form-item/index.d.ts +32 -32
- package/es/components/form-item/src/index.vue.d.ts +12 -12
- package/es/components/header/index.d.ts +19 -19
- package/es/components/header/src/index.vue.d.ts +1 -1
- package/es/components/input-tag/index.d.ts +9 -9
- package/es/components/input-tag/src/index.vue.d.ts +1 -1
- package/es/components/radio/index.d.ts +25 -25
- package/es/components/radio/src/index.vue.d.ts +25 -25
- package/es/components/render/index.d.ts +6 -6
- package/es/components/render/src/index.vue.d.ts +2 -2
- package/es/components/table/index.d.ts +54 -54
- package/es/components/table/src/index.vue.d.ts +18 -18
- package/es/components/table/src/table-column-drag-sort.vue.d.ts +18 -18
- package/es/components/table/src/table-column.vue.d.ts +37 -37
- package/es/components/yc-count-to/index.d.ts +1 -1
- package/es/components/yc-count-to/src/normal/index.d.ts +1 -1
- package/es/components/yc-dialog/index.d.ts +24 -24
- package/es/components/yc-more-actions/index.d.ts +46 -46
- package/es/components/yc-more-actions/src/index.vue.d.ts +3 -3
- package/es/components/yc-select-v2/src/index.vue.d.ts +2 -2
- package/es/components/yc-status-dialog/src/index.vue.d.ts +1 -1
- package/es/components/yc-svg-icon/src/index.vue.d.ts +1 -1
- package/es/components/yc-text/src/index.vue.d.ts +2 -2
- package/es/hooks/usePlusFormReset.d.ts +97 -0
- package/index.js +12 -14
- package/index.min.js +7 -7
- package/index.min.mjs +7 -7
- package/index.mjs +12 -14
- package/lib/components/check-card/index.d.ts +38 -38
- package/lib/components/check-card/src/index.vue.d.ts +2 -2
- package/lib/components/check-card-group/index.d.ts +19 -19
- package/lib/components/check-card-group/src/index.vue.d.ts +1 -1
- package/lib/components/display-item/index.d.ts +41 -41
- package/lib/components/display-item/src/index.vue.d.ts +22 -22
- package/lib/components/form/index.d.ts +5 -0
- package/lib/components/form/src/form-content.vue.d.ts +20 -20
- package/lib/components/form-item/index.d.ts +32 -32
- package/lib/components/form-item/src/index.vue.d.ts +12 -12
- package/lib/components/header/index.d.ts +19 -19
- package/lib/components/header/src/index.vue.d.ts +1 -1
- package/lib/components/input-tag/index.d.ts +9 -9
- package/lib/components/input-tag/src/index.vue.d.ts +1 -1
- package/lib/components/radio/index.d.ts +25 -25
- package/lib/components/radio/src/index.vue.d.ts +25 -25
- package/lib/components/render/index.d.ts +6 -6
- package/lib/components/render/src/index.vue.d.ts +2 -2
- package/lib/components/table/index.d.ts +54 -54
- package/lib/components/table/src/index.vue.d.ts +18 -18
- package/lib/components/table/src/table-column-drag-sort.vue.d.ts +18 -18
- package/lib/components/table/src/table-column.vue.d.ts +37 -37
- package/lib/components/yc-count-to/index.d.ts +1 -1
- package/lib/components/yc-count-to/src/normal/index.d.ts +1 -1
- package/lib/components/yc-dialog/index.d.ts +24 -24
- package/lib/components/yc-more-actions/index.d.ts +46 -46
- package/lib/components/yc-more-actions/src/index.vue.d.ts +3 -3
- package/lib/components/yc-select-v2/src/index.vue.d.ts +2 -2
- package/lib/components/yc-status-dialog/src/index.vue.d.ts +1 -1
- package/lib/components/yc-svg-icon/src/index.vue.d.ts +1 -1
- package/lib/components/yc-text/src/index.vue.d.ts +2 -2
- package/lib/hooks/usePlusFormReset.d.ts +97 -0
- package/locale/en.js +1 -1
- package/locale/en.min.js +1 -1
- package/locale/en.min.mjs +1 -1
- package/locale/en.mjs +1 -1
- package/locale/ja.js +1 -1
- package/locale/ja.min.js +1 -1
- package/locale/ja.min.mjs +1 -1
- package/locale/ja.mjs +1 -1
- package/locale/ko.js +1 -1
- package/locale/ko.min.js +1 -1
- package/locale/ko.min.mjs +1 -1
- package/locale/ko.mjs +1 -1
- package/locale/zh-cn.js +1 -1
- package/locale/zh-cn.min.js +1 -1
- package/locale/zh-cn.min.mjs +1 -1
- package/locale/zh-cn.mjs +1 -1
- package/locale/zh-tw.js +1 -1
- package/locale/zh-tw.min.js +1 -1
- package/locale/zh-tw.min.mjs +1 -1
- package/locale/zh-tw.mjs +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { PlusDialogForm, PlusDrawerForm } from 'yc-components';
|
|
2
|
+
import { Ref } from 'vue';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 表单重置选项
|
|
6
|
+
*/
|
|
7
|
+
export interface FormResetOptions {
|
|
8
|
+
/**
|
|
9
|
+
* 是否在打开时清除验证状态
|
|
10
|
+
* @default true
|
|
11
|
+
*/
|
|
12
|
+
clearValidateOnOpen?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* 是否在关闭时重置表单数据
|
|
15
|
+
* @default true
|
|
16
|
+
*/
|
|
17
|
+
resetFieldsOnClose?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* 是否在打开时重置表单数据
|
|
20
|
+
* @default false - 编辑模式下通常不需要重置
|
|
21
|
+
*/
|
|
22
|
+
resetFieldsOnOpen?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* 自定义重置回调函数(在关闭时调用)
|
|
25
|
+
*/
|
|
26
|
+
onReset?: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* 自定义清除验证回调函数(在打开时调用)
|
|
29
|
+
*/
|
|
30
|
+
onClearValidate?: () => void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Plus Pro Form 重置 Composable
|
|
34
|
+
*
|
|
35
|
+
* @description
|
|
36
|
+
* 用于 PlusDialogForm 和 PlusDrawerForm 组件的表单状态重置管理。
|
|
37
|
+
*
|
|
38
|
+
* 功能:
|
|
39
|
+
* 1. 监听对话框/抽屉的打开/关闭状态
|
|
40
|
+
* 2. 打开时自动清除验证状态(可选)
|
|
41
|
+
* 3. 关闭时自动重置表单数据(可选)
|
|
42
|
+
* 4. 支持自定义重置逻辑
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* // 在组件中使用
|
|
47
|
+
* const visible = ref(false);
|
|
48
|
+
* const plusFormRef = ref();
|
|
49
|
+
*
|
|
50
|
+
* const { formRef } = usePlusFormReset(visible, {
|
|
51
|
+
* clearValidateOnOpen: true,
|
|
52
|
+
* resetFieldsOnClose: true,
|
|
53
|
+
* onReset: () => {
|
|
54
|
+
* // 自定义重置逻辑
|
|
55
|
+
* formData.value = { ...defaultFormData };
|
|
56
|
+
* }
|
|
57
|
+
* });
|
|
58
|
+
*
|
|
59
|
+
* // 在模板中绑定 ref
|
|
60
|
+
* <PlusDialogForm ref="formRef" v-model:visible="visible" ... />
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @param visible - 对话框/抽屉的可见性状态(响应式引用)
|
|
64
|
+
* @param options - 重置选项配置
|
|
65
|
+
* @returns 包含 formRef 的对象
|
|
66
|
+
*/
|
|
67
|
+
export declare function usePlusFormReset(visible: Ref<boolean>, options?: FormResetOptions): {
|
|
68
|
+
formRef: Ref<InstanceType<typeof PlusDialogForm | typeof PlusDrawerForm> | undefined>;
|
|
69
|
+
clearValidate: () => Promise<void>;
|
|
70
|
+
resetFields: () => Promise<void>;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* 简化版本:仅清除验证状态(适用于编辑模式)
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* const visible = ref(false);
|
|
78
|
+
* const { formRef } = usePlusFormClearValidate(visible);
|
|
79
|
+
*
|
|
80
|
+
* <PlusDialogForm ref="formRef" v-model:visible="visible" ... />
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
export declare function usePlusFormClearValidate(visible: Ref<boolean>): ReturnType<typeof usePlusFormReset>;
|
|
84
|
+
/**
|
|
85
|
+
* 完整版本:清除验证 + 重置表单(适用于新增模式)
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```ts
|
|
89
|
+
* const visible = ref(false);
|
|
90
|
+
* const { formRef } = usePlusFormFullReset(visible, () => {
|
|
91
|
+
* formData.value = { ...defaultFormData };
|
|
92
|
+
* });
|
|
93
|
+
*
|
|
94
|
+
* <PlusDialogForm ref="formRef" v-model:visible="visible" ... />
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
export declare function usePlusFormFullReset(visible: Ref<boolean>, onReset?: () => void): ReturnType<typeof usePlusFormReset>;
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! yc-pro-components v0.0.
|
|
1
|
+
/*! yc-pro-components v0.0.17 */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('element-plus')) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports', 'vue', 'element-plus'], factory) :
|
|
@@ -23,10 +23,8 @@
|
|
|
23
23
|
/** Used as a reference to the global object. */
|
|
24
24
|
var root = freeGlobal || freeSelf || Function('return this')();
|
|
25
25
|
|
|
26
|
-
var root$1 = root;
|
|
27
|
-
|
|
28
26
|
/** Built-in value references. */
|
|
29
|
-
var Symbol$1 = root
|
|
27
|
+
var Symbol$1 = root.Symbol;
|
|
30
28
|
|
|
31
29
|
/** Used for built-in method references. */
|
|
32
30
|
var objectProto$f = Object.prototype;
|
|
@@ -421,7 +419,7 @@
|
|
|
421
419
|
}
|
|
422
420
|
|
|
423
421
|
/** Used to detect overreaching core-js shims. */
|
|
424
|
-
var coreJsData = root
|
|
422
|
+
var coreJsData = root['__core-js_shared__'];
|
|
425
423
|
|
|
426
424
|
/** Used to detect methods masquerading as native. */
|
|
427
425
|
var maskSrcKey = (function() {
|
|
@@ -532,7 +530,7 @@
|
|
|
532
530
|
}
|
|
533
531
|
|
|
534
532
|
/* Built-in method references that are verified to be native. */
|
|
535
|
-
var WeakMap$1 = getNative(root
|
|
533
|
+
var WeakMap$1 = getNative(root, 'WeakMap');
|
|
536
534
|
|
|
537
535
|
/** Built-in value references. */
|
|
538
536
|
var objectCreate = Object.create;
|
|
@@ -1133,7 +1131,7 @@
|
|
|
1133
1131
|
var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
|
|
1134
1132
|
|
|
1135
1133
|
/** Built-in value references. */
|
|
1136
|
-
var Buffer$1 = moduleExports$2 ? root
|
|
1134
|
+
var Buffer$1 = moduleExports$2 ? root.Buffer : undefined;
|
|
1137
1135
|
|
|
1138
1136
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
1139
1137
|
var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : undefined;
|
|
@@ -1752,7 +1750,7 @@
|
|
|
1752
1750
|
ListCache.prototype.set = listCacheSet;
|
|
1753
1751
|
|
|
1754
1752
|
/* Built-in method references that are verified to be native. */
|
|
1755
|
-
var Map$1 = getNative(root
|
|
1753
|
+
var Map$1 = getNative(root, 'Map');
|
|
1756
1754
|
|
|
1757
1755
|
/**
|
|
1758
1756
|
* Removes all key-value entries from the map.
|
|
@@ -2327,7 +2325,7 @@
|
|
|
2327
2325
|
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
2328
2326
|
|
|
2329
2327
|
/** Built-in value references. */
|
|
2330
|
-
var Buffer = moduleExports ? root
|
|
2328
|
+
var Buffer = moduleExports ? root.Buffer : undefined,
|
|
2331
2329
|
allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
|
|
2332
2330
|
|
|
2333
2331
|
/**
|
|
@@ -2504,13 +2502,13 @@
|
|
|
2504
2502
|
}
|
|
2505
2503
|
|
|
2506
2504
|
/* Built-in method references that are verified to be native. */
|
|
2507
|
-
var DataView$1 = getNative(root
|
|
2505
|
+
var DataView$1 = getNative(root, 'DataView');
|
|
2508
2506
|
|
|
2509
2507
|
/* Built-in method references that are verified to be native. */
|
|
2510
|
-
var Promise$1 = getNative(root
|
|
2508
|
+
var Promise$1 = getNative(root, 'Promise');
|
|
2511
2509
|
|
|
2512
2510
|
/* Built-in method references that are verified to be native. */
|
|
2513
|
-
var Set$1 = getNative(root
|
|
2511
|
+
var Set$1 = getNative(root, 'Set');
|
|
2514
2512
|
|
|
2515
2513
|
/** `Object#toString` result references. */
|
|
2516
2514
|
var mapTag$4 = '[object Map]',
|
|
@@ -2589,7 +2587,7 @@
|
|
|
2589
2587
|
}
|
|
2590
2588
|
|
|
2591
2589
|
/** Built-in value references. */
|
|
2592
|
-
var Uint8Array$1 = root
|
|
2590
|
+
var Uint8Array$1 = root.Uint8Array;
|
|
2593
2591
|
|
|
2594
2592
|
/**
|
|
2595
2593
|
* Creates a clone of `arrayBuffer`.
|
|
@@ -3876,7 +3874,7 @@
|
|
|
3876
3874
|
* // => Logs the number of milliseconds it took for the deferred invocation.
|
|
3877
3875
|
*/
|
|
3878
3876
|
var now = function() {
|
|
3879
|
-
return root
|
|
3877
|
+
return root.Date.now();
|
|
3880
3878
|
};
|
|
3881
3879
|
|
|
3882
3880
|
/** Error message constants. */
|