@robot-admin/naive-ui-components 0.29.2 → 0.30.0
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/CHANGELOG.md +16 -0
- package/README.md +3 -1
- package/README_EN.md +3 -1
- package/dist/C_ActionBar.css +52 -49
- package/dist/C_ActionBar2.cjs +1 -1
- package/dist/C_ActionBar2.js +1 -1
- package/dist/C_DataPicker.cjs +1 -1
- package/dist/C_DataPicker.css +29 -28
- package/dist/C_DataPicker.d.cts +2 -2
- package/dist/C_DataPicker.d.ts +3 -2
- package/dist/C_DataPicker.js +1 -1
- package/dist/C_Density.d.cts +1 -1
- package/dist/C_Density.d.ts +1 -1
- package/dist/C_Editor.d.cts +1 -1
- package/dist/C_Editor.d.ts +1 -1
- package/dist/C_ErrorSummary.d.cts +1 -1
- package/dist/C_ErrorSummary.d.ts +1 -1
- package/dist/C_FilePreview2.js +1 -1
- package/dist/C_Form.d.cts +2 -1
- package/dist/C_Form.d.ts +2 -1
- package/dist/C_FormModal.css +52 -49
- package/dist/C_FormModal.d.cts +1 -1
- package/dist/C_FormModal.d.ts +2 -1
- package/dist/C_FormSearch.css +66 -66
- package/dist/C_Guide.d.cts +1 -1
- package/dist/C_Guide.d.ts +1 -1
- package/dist/C_Icon.d.cts +1 -1
- package/dist/C_Icon.d.ts +1 -1
- package/dist/C_Language.d.cts +1 -1
- package/dist/C_Language.d.ts +1 -1
- package/dist/C_Loading.d.cts +1 -1
- package/dist/C_Loading.d.ts +1 -1
- package/dist/C_Login.d.cts +1 -1
- package/dist/C_Login.d.ts +1 -1
- package/dist/C_Markdown.d.cts +1 -1
- package/dist/C_Markdown.d.ts +1 -1
- package/dist/C_Menu.d.ts +1 -1
- package/dist/C_OrgChart.d.cts +1 -1
- package/dist/C_OrgChart.d.ts +1 -1
- package/dist/C_Progress.d.cts +1 -1
- package/dist/C_Progress.d.ts +1 -1
- package/dist/C_SectionNav.d.cts +1 -1
- package/dist/C_SectionNav.d.ts +1 -1
- package/dist/C_Skeleton.d.cts +1 -1
- package/dist/C_Skeleton.d.ts +1 -1
- package/dist/C_Steps.d.cts +1 -1
- package/dist/C_Steps.d.ts +1 -1
- package/dist/C_Table.base.css +161 -158
- package/dist/C_Table.cjs +1 -1
- package/dist/C_Table.css +161 -158
- package/dist/C_Table.d.cts +2 -2
- package/dist/C_Table.d.ts +7 -6
- package/dist/C_Table.js +1 -1
- package/dist/C_Table2.cjs +3 -3
- package/dist/C_Table2.js +3 -3
- package/dist/C_TagsView.d.cts +1 -1
- package/dist/C_TagsView.d.ts +1 -1
- package/dist/C_Theme.d.cts +1 -1
- package/dist/C_Theme.d.ts +1 -1
- package/dist/C_Timeline.d.cts +1 -1
- package/dist/C_Timeline.d.ts +1 -1
- package/dist/C_Transfer.d.cts +1 -1
- package/dist/C_Transfer.d.ts +1 -1
- package/dist/C_Tree.d.ts +6 -5
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants3.d.cts +1 -1
- package/dist/constants3.d.ts +1 -1
- package/dist/constants4.d.cts +4 -4
- package/dist/constants4.d.ts +4 -4
- package/dist/data2.d.cts +9 -9
- package/dist/data2.d.ts +9 -9
- package/dist/dateRange.d.cts +10 -2
- package/dist/dateRange.d.ts +10 -2
- package/dist/formField.cjs +1 -0
- package/dist/formField.d.cts +1179 -0
- package/dist/formField.d.ts +1179 -0
- package/dist/formField.js +1 -0
- package/dist/helpers2.cjs +1 -0
- package/dist/helpers2.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +23 -22
- package/dist/index.d.ts +24 -23
- package/dist/index.js +1 -1
- package/dist/index.vue.d.cts +5 -5
- package/dist/index.vue.d.ts +5 -5
- package/dist/index10.vue.d.cts +3 -3
- package/dist/index10.vue.d.ts +3 -3
- package/dist/index11.vue.d.cts +3 -3
- package/dist/index11.vue.d.ts +13 -1157
- package/dist/index12.vue.d.cts +13 -1157
- package/dist/index12.vue.d.ts +59 -16
- package/dist/index13.vue.d.cts +59 -16
- package/dist/index13.vue.d.ts +17 -57
- package/dist/index14.vue.d.cts +17 -57
- package/dist/index14.vue.d.ts +55 -18
- package/dist/index15.vue.d.cts +55 -18
- package/dist/index15.vue.d.ts +124 -53
- package/dist/index16.vue.d.cts +124 -53
- package/dist/index16.vue.d.ts +51 -123
- package/dist/index17.vue.d.cts +51 -123
- package/dist/index17.vue.d.ts +25 -52
- package/dist/index18.vue.d.cts +25 -52
- package/dist/index18.vue.d.ts +12 -25
- package/dist/index19.vue.d.cts +12 -25
- package/dist/index19.vue.d.ts +129 -13
- package/dist/index2.vue.d.cts +2 -2
- package/dist/index2.vue.d.ts +2 -2
- package/dist/index20.vue.d.cts +129 -13
- package/dist/index20.vue.d.ts +76 -129
- package/dist/index21.vue.d.cts +76 -129
- package/dist/index21.vue.d.ts +72 -78
- package/dist/index22.vue.d.cts +97 -75
- package/dist/index22.vue.d.ts +96 -68
- package/dist/index23.vue.d.cts +40 -91
- package/dist/index23.vue.d.ts +40 -91
- package/dist/index24.vue.d.cts +23 -49
- package/dist/index24.vue.d.ts +23 -49
- package/dist/index25.vue.d.cts +96 -21
- package/dist/index25.vue.d.ts +96 -21
- package/dist/index26.vue.d.cts +37 -95
- package/dist/index26.vue.d.ts +37 -95
- package/dist/index27.vue.d.cts +8 -34
- package/dist/index27.vue.d.ts +8 -34
- package/dist/index28.vue.d.cts +86 -9
- package/dist/index28.vue.d.ts +86 -9
- package/dist/index29.vue.d.cts +99 -85
- package/dist/index29.vue.d.ts +99 -85
- package/dist/index3.vue.d.cts +6 -6
- package/dist/index3.vue.d.ts +6 -6
- package/dist/index30.vue.d.cts +59 -94
- package/dist/index30.vue.d.ts +59 -94
- package/dist/index9.vue.d.ts +3 -3
- package/dist/mapUtils.d.cts +2 -2
- package/dist/mapUtils.d.ts +2 -2
- package/dist/presets.d.cts +4 -1
- package/dist/presets.d.ts +4 -1
- package/dist/rolldown-runtime.js +1 -0
- package/dist/serializeSearch.cjs +1 -1
- package/dist/serializeSearch.js +1 -1
- package/dist/style.css +256 -252
- package/dist/useCalendarEvents.d.cts +1 -1
- package/dist/useCalendarEvents.d.ts +1 -1
- package/dist/useCollapsePanel.d.cts +3 -3
- package/dist/useCollapsePanel.d.ts +3 -3
- package/dist/useCropperCore.d.cts +4 -4
- package/dist/useCropperCore.d.ts +4 -4
- package/dist/useDynamicFormState.d.cts +5 -67
- package/dist/useDynamicFormState.d.ts +5 -67
- package/dist/useEdgeInteraction.d.cts +2 -2
- package/dist/useEdgeInteraction.d.ts +2 -2
- package/dist/useFormRenderer.d.cts +69 -0
- package/dist/useFormRenderer.d.ts +69 -0
- package/dist/useFullscreen.d.cts +3 -3
- package/dist/useFullscreen.d.ts +3 -3
- package/dist/useGlobalSearch.d.cts +1 -1
- package/dist/useGlobalSearch.d.ts +1 -1
- package/dist/useInfiniteScroll.d.cts +2 -2
- package/dist/useInfiniteScroll.d.ts +2 -2
- package/dist/useQRCode.d.cts +3 -3
- package/dist/useQRCode.d.ts +3 -3
- package/dist/useSignatureHistory.d.cts +4 -4
- package/dist/useSignatureHistory.d.ts +4 -4
- package/dist/useSplitResize.d.cts +9 -9
- package/dist/useSplitResize.d.ts +9 -9
- package/dist/useTableQuery.d.cts +9 -9
- package/dist/useTableQuery.d.ts +9 -9
- package/dist/useWorkflowValidation.d.cts +36 -36
- package/dist/useWorkflowValidation.d.ts +36 -36
- package/dist/verification.d.cts +4 -4
- package/dist/verification.d.ts +4 -4
- package/dist/{xlsx.js → xlsx2.js} +1 -1
- package/docs/guides/data-picker.md +30 -11
- package/docs/guides/data-workflows.md +22 -1
- package/docs/guides/search-workflows.md +3 -1
- package/docs/guides/usage.en.md +15 -15
- package/docs/guides/usage.md +15 -15
- package/package.json +1 -1
- package/dist/C_DataPicker2.cjs +0 -1
- package/dist/C_DataPicker2.js +0 -1
- package/dist/index31.vue.d.cts +0 -75
- package/dist/index31.vue.d.ts +0 -75
package/dist/constants4.d.cts
CHANGED
|
@@ -199,28 +199,28 @@ declare const __VLS_base: vue.DefineComponent<UploadProps, UploadExpose, {}, {},
|
|
|
199
199
|
change: (fileList: UploadFileItem[]) => any;
|
|
200
200
|
error: (file: UploadFileItem, error: Error) => any;
|
|
201
201
|
success: (file: UploadFileItem, response: unknown) => any;
|
|
202
|
-
remove: (file: UploadFileItem) => any;
|
|
203
202
|
progress: (file: UploadFileItem, percent: number) => any;
|
|
203
|
+
remove: (file: UploadFileItem) => any;
|
|
204
204
|
finish: (fileList: UploadFileItem[]) => any;
|
|
205
205
|
exceed: (files: File[], fileList: UploadFileItem[]) => any;
|
|
206
206
|
}, string, vue.PublicProps, Readonly<UploadProps> & Readonly<{
|
|
207
207
|
onChange?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
208
208
|
onError?: ((file: UploadFileItem, error: Error) => any) | undefined;
|
|
209
209
|
onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
|
|
210
|
-
onRemove?: ((file: UploadFileItem) => any) | undefined;
|
|
211
210
|
onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
|
|
211
|
+
onRemove?: ((file: UploadFileItem) => any) | undefined;
|
|
212
212
|
onFinish?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
213
213
|
onExceed?: ((files: File[], fileList: UploadFileItem[]) => any) | undefined;
|
|
214
214
|
}>, {
|
|
215
215
|
data: Record<string, unknown>;
|
|
216
216
|
disabled: boolean;
|
|
217
|
-
multiple: boolean;
|
|
218
217
|
draggable: boolean;
|
|
219
218
|
action: string;
|
|
220
|
-
|
|
219
|
+
multiple: boolean;
|
|
221
220
|
headers: Record<string, string>;
|
|
222
221
|
directory: boolean;
|
|
223
222
|
accept: string;
|
|
223
|
+
maxSize: number;
|
|
224
224
|
maxCount: number;
|
|
225
225
|
pasteable: boolean;
|
|
226
226
|
chunked: boolean;
|
package/dist/constants4.d.ts
CHANGED
|
@@ -199,28 +199,28 @@ declare const __VLS_base: vue.DefineComponent<UploadProps, UploadExpose, {}, {},
|
|
|
199
199
|
change: (fileList: UploadFileItem[]) => any;
|
|
200
200
|
error: (file: UploadFileItem, error: Error) => any;
|
|
201
201
|
success: (file: UploadFileItem, response: unknown) => any;
|
|
202
|
-
remove: (file: UploadFileItem) => any;
|
|
203
202
|
progress: (file: UploadFileItem, percent: number) => any;
|
|
203
|
+
remove: (file: UploadFileItem) => any;
|
|
204
204
|
finish: (fileList: UploadFileItem[]) => any;
|
|
205
205
|
exceed: (files: File[], fileList: UploadFileItem[]) => any;
|
|
206
206
|
}, string, vue.PublicProps, Readonly<UploadProps> & Readonly<{
|
|
207
207
|
onChange?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
208
208
|
onError?: ((file: UploadFileItem, error: Error) => any) | undefined;
|
|
209
209
|
onSuccess?: ((file: UploadFileItem, response: unknown) => any) | undefined;
|
|
210
|
-
onRemove?: ((file: UploadFileItem) => any) | undefined;
|
|
211
210
|
onProgress?: ((file: UploadFileItem, percent: number) => any) | undefined;
|
|
211
|
+
onRemove?: ((file: UploadFileItem) => any) | undefined;
|
|
212
212
|
onFinish?: ((fileList: UploadFileItem[]) => any) | undefined;
|
|
213
213
|
onExceed?: ((files: File[], fileList: UploadFileItem[]) => any) | undefined;
|
|
214
214
|
}>, {
|
|
215
215
|
data: Record<string, unknown>;
|
|
216
216
|
disabled: boolean;
|
|
217
|
-
multiple: boolean;
|
|
218
217
|
draggable: boolean;
|
|
219
218
|
action: string;
|
|
220
|
-
|
|
219
|
+
multiple: boolean;
|
|
221
220
|
headers: Record<string, string>;
|
|
222
221
|
directory: boolean;
|
|
223
222
|
accept: string;
|
|
223
|
+
maxSize: number;
|
|
224
224
|
maxCount: number;
|
|
225
225
|
pasteable: boolean;
|
|
226
226
|
chunked: boolean;
|
package/dist/data2.d.cts
CHANGED
|
@@ -66,27 +66,27 @@ declare const __VLS_base: vue.DefineComponent<CTabsProps, {
|
|
|
66
66
|
activeValue: vue.WritableComputedRef<TabsValue | null, TabsValue | null>;
|
|
67
67
|
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
68
68
|
"update:modelValue": (value: TabsValue) => any;
|
|
69
|
-
close: (value: TabsValue) => any;
|
|
70
|
-
add: () => any;
|
|
71
69
|
change: (value: TabsValue, item: TabsItem | undefined) => any;
|
|
70
|
+
add: () => any;
|
|
71
|
+
close: (value: TabsValue) => any;
|
|
72
72
|
}, string, vue.PublicProps, Readonly<CTabsProps> & Readonly<{
|
|
73
73
|
"onUpdate:modelValue"?: ((value: TabsValue) => any) | undefined;
|
|
74
|
-
onClose?: ((value: TabsValue) => any) | undefined;
|
|
75
|
-
onAdd?: (() => any) | undefined;
|
|
76
74
|
onChange?: ((value: TabsValue, item: TabsItem | undefined) => any) | undefined;
|
|
75
|
+
onAdd?: (() => any) | undefined;
|
|
76
|
+
onClose?: ((value: TabsValue) => any) | undefined;
|
|
77
77
|
}>, {
|
|
78
|
+
modelValue: TabsValue | null;
|
|
78
79
|
type: TabsType;
|
|
79
|
-
|
|
80
|
+
animated: boolean;
|
|
80
81
|
size: TabsSize;
|
|
81
|
-
|
|
82
|
+
closable: boolean;
|
|
83
|
+
displayDirective: TabsDisplayDirective;
|
|
82
84
|
defaultValue: TabsValue | null;
|
|
85
|
+
items: readonly TabsItem[];
|
|
83
86
|
placement: TabsPlacement;
|
|
84
87
|
justifyContent: TabsJustifyContent;
|
|
85
|
-
animated: boolean;
|
|
86
|
-
closable: boolean;
|
|
87
88
|
addable: boolean;
|
|
88
89
|
tabsOnly: boolean;
|
|
89
|
-
displayDirective: TabsDisplayDirective;
|
|
90
90
|
paneClass: string;
|
|
91
91
|
paneStyle: string | vue.CSSProperties;
|
|
92
92
|
beforeChange: (target: TabsValue, current: TabsValue | null) => boolean | Promise<boolean>;
|
package/dist/data2.d.ts
CHANGED
|
@@ -66,27 +66,27 @@ declare const __VLS_base: vue.DefineComponent<CTabsProps, {
|
|
|
66
66
|
activeValue: vue.WritableComputedRef<TabsValue | null, TabsValue | null>;
|
|
67
67
|
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
68
68
|
"update:modelValue": (value: TabsValue) => any;
|
|
69
|
-
close: (value: TabsValue) => any;
|
|
70
|
-
add: () => any;
|
|
71
69
|
change: (value: TabsValue, item: TabsItem | undefined) => any;
|
|
70
|
+
add: () => any;
|
|
71
|
+
close: (value: TabsValue) => any;
|
|
72
72
|
}, string, vue.PublicProps, Readonly<CTabsProps> & Readonly<{
|
|
73
73
|
"onUpdate:modelValue"?: ((value: TabsValue) => any) | undefined;
|
|
74
|
-
onClose?: ((value: TabsValue) => any) | undefined;
|
|
75
|
-
onAdd?: (() => any) | undefined;
|
|
76
74
|
onChange?: ((value: TabsValue, item: TabsItem | undefined) => any) | undefined;
|
|
75
|
+
onAdd?: (() => any) | undefined;
|
|
76
|
+
onClose?: ((value: TabsValue) => any) | undefined;
|
|
77
77
|
}>, {
|
|
78
|
+
modelValue: TabsValue | null;
|
|
78
79
|
type: TabsType;
|
|
79
|
-
|
|
80
|
+
animated: boolean;
|
|
80
81
|
size: TabsSize;
|
|
81
|
-
|
|
82
|
+
closable: boolean;
|
|
83
|
+
displayDirective: TabsDisplayDirective;
|
|
82
84
|
defaultValue: TabsValue | null;
|
|
85
|
+
items: readonly TabsItem[];
|
|
83
86
|
placement: TabsPlacement;
|
|
84
87
|
justifyContent: TabsJustifyContent;
|
|
85
|
-
animated: boolean;
|
|
86
|
-
closable: boolean;
|
|
87
88
|
addable: boolean;
|
|
88
89
|
tabsOnly: boolean;
|
|
89
|
-
displayDirective: TabsDisplayDirective;
|
|
90
90
|
paneClass: string;
|
|
91
91
|
paneStyle: string | vue.CSSProperties;
|
|
92
92
|
beforeChange: (target: TabsValue, current: TabsValue | null) => boolean | Promise<boolean>;
|
package/dist/dateRange.d.cts
CHANGED
|
@@ -24,7 +24,12 @@ interface SearchFieldContext<T extends object = SearchFormParams> {
|
|
|
24
24
|
disabled: boolean;
|
|
25
25
|
readonly: boolean;
|
|
26
26
|
size: 'small' | 'medium' | 'large';
|
|
27
|
-
updateValue
|
|
27
|
+
updateValue(value: unknown): void;
|
|
28
|
+
}
|
|
29
|
+
interface SearchRenderContext<T extends object, P extends Extract<keyof T, string>> extends SearchFieldContext<T> {
|
|
30
|
+
value: T[P];
|
|
31
|
+
prop: P;
|
|
32
|
+
updateValue: (value: T[P]) => void;
|
|
28
33
|
}
|
|
29
34
|
type SearchOptionValue = string | number | boolean;
|
|
30
35
|
interface SearchOptionItem<V extends SearchOptionValue = SearchOptionValue> {
|
|
@@ -142,7 +147,7 @@ type SearchFormItem<T extends object = SearchFormParams> = {
|
|
|
142
147
|
} & (string extends keyof T ? SearchFormItemBase : { [P in Extract<keyof T, string>]: Omit<SearchFormItemBase, 'type' | 'prop' | 'defaultValue' | 'list' | 'render'> & {
|
|
143
148
|
prop: P;
|
|
144
149
|
defaultValue?: T[P];
|
|
145
|
-
render?: (context:
|
|
150
|
+
render?: (context: SearchRenderContext<T, P>) => VNodeChild;
|
|
146
151
|
} & TypedSearchControl<T[P]> }[Extract<keyof T, string>]);
|
|
147
152
|
interface SearchFormParams {
|
|
148
153
|
pageNum?: number;
|
|
@@ -161,6 +166,8 @@ interface SearchConfig<T extends object = SearchFormParams> {
|
|
|
161
166
|
foldThreshold?: number;
|
|
162
167
|
historyMaxItems?: number;
|
|
163
168
|
requireValue?: boolean;
|
|
169
|
+
/** 重置草稿后执行查询。允许空条件,仍执行字段校验。默认只重置草稿。 */
|
|
170
|
+
searchOnReset?: boolean;
|
|
164
171
|
/** 切换业务查询范围时重置已执行快照,并忽略旧范围的迟到结果。 */
|
|
165
172
|
queryScope?: string | number;
|
|
166
173
|
feedback?: ComponentFeedback;
|
|
@@ -262,6 +269,7 @@ declare function useSearchState<T extends object = SearchFormParams>(emits: {
|
|
|
262
269
|
hiddenActiveCount: vue.ComputedRef<number>;
|
|
263
270
|
expanded: Ref<boolean, boolean>;
|
|
264
271
|
searching: vue.ComputedRef<boolean>;
|
|
272
|
+
resetBlocked: vue.ComputedRef<boolean | undefined>;
|
|
265
273
|
visibleFields: vue.ComputedRef<SearchFormItem<T>[]>;
|
|
266
274
|
availableFields: vue.ComputedRef<SearchFormItem<T>[]>;
|
|
267
275
|
foldThreshold: vue.ComputedRef<number>;
|
package/dist/dateRange.d.ts
CHANGED
|
@@ -24,7 +24,12 @@ interface SearchFieldContext<T extends object = SearchFormParams> {
|
|
|
24
24
|
disabled: boolean;
|
|
25
25
|
readonly: boolean;
|
|
26
26
|
size: 'small' | 'medium' | 'large';
|
|
27
|
-
updateValue
|
|
27
|
+
updateValue(value: unknown): void;
|
|
28
|
+
}
|
|
29
|
+
interface SearchRenderContext<T extends object, P extends Extract<keyof T, string>> extends SearchFieldContext<T> {
|
|
30
|
+
value: T[P];
|
|
31
|
+
prop: P;
|
|
32
|
+
updateValue: (value: T[P]) => void;
|
|
28
33
|
}
|
|
29
34
|
type SearchOptionValue = string | number | boolean;
|
|
30
35
|
interface SearchOptionItem<V extends SearchOptionValue = SearchOptionValue> {
|
|
@@ -142,7 +147,7 @@ type SearchFormItem<T extends object = SearchFormParams> = {
|
|
|
142
147
|
} & (string extends keyof T ? SearchFormItemBase : { [P in Extract<keyof T, string>]: Omit<SearchFormItemBase, 'type' | 'prop' | 'defaultValue' | 'list' | 'render'> & {
|
|
143
148
|
prop: P;
|
|
144
149
|
defaultValue?: T[P];
|
|
145
|
-
render?: (context:
|
|
150
|
+
render?: (context: SearchRenderContext<T, P>) => VNodeChild;
|
|
146
151
|
} & TypedSearchControl<T[P]> }[Extract<keyof T, string>]);
|
|
147
152
|
interface SearchFormParams {
|
|
148
153
|
pageNum?: number;
|
|
@@ -161,6 +166,8 @@ interface SearchConfig<T extends object = SearchFormParams> {
|
|
|
161
166
|
foldThreshold?: number;
|
|
162
167
|
historyMaxItems?: number;
|
|
163
168
|
requireValue?: boolean;
|
|
169
|
+
/** 重置草稿后执行查询。允许空条件,仍执行字段校验。默认只重置草稿。 */
|
|
170
|
+
searchOnReset?: boolean;
|
|
164
171
|
/** 切换业务查询范围时重置已执行快照,并忽略旧范围的迟到结果。 */
|
|
165
172
|
queryScope?: string | number;
|
|
166
173
|
feedback?: ComponentFeedback;
|
|
@@ -262,6 +269,7 @@ declare function useSearchState<T extends object = SearchFormParams>(emits: {
|
|
|
262
269
|
hiddenActiveCount: vue.ComputedRef<number>;
|
|
263
270
|
expanded: Ref<boolean, boolean>;
|
|
264
271
|
searching: vue.ComputedRef<boolean>;
|
|
272
|
+
resetBlocked: vue.ComputedRef<boolean | undefined>;
|
|
265
273
|
visibleFields: vue.ComputedRef<SearchFormItem<T>[]>;
|
|
266
274
|
availableFields: vue.ComputedRef<SearchFormItem<T>[]>;
|
|
267
275
|
foldThreshold: vue.ComputedRef<number>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./density.cjs`),t=require(`./useDataResource.cjs`),n=require(`./data2.cjs`),r=require(`./useComponentLocale.cjs`),i=require(`./export-helper.cjs`),a=require(`./useFormConfig.cjs`),o=require(`./helpers2.cjs`);let s=require(`vue`),c=require(`naive-ui`);function l(e){return e==null?[]:[...new Set(Array.isArray(e)?e:[e])]}function u(e){return typeof e==`string`||typeof e==`number`&&Number.isFinite(e)}function d(e,t){let n=typeof e.rowKey==`function`?e.rowKey(t):t[e.rowKey];if(!u(n))throw TypeError(`[C_DataPicker] rowKey 必须为字符串或有限数值`);return n}function f(e,t){return e.value===void 0?d(e,t):e.value(t)}function p(e,t){if(e.value===void 0)return;let n=new Set;for(let r of t){let t=e.value(r);if(!u(t)||n.has(t))throw TypeError(`[C_DataPicker] 业务值必须为唯一的字符串或有限数值`);n.add(t)}}function m(e,t,n){if(!Array.isArray(t.rows)||!Number.isSafeInteger(t.total)||t.total<0)throw TypeError(`[C_DataPicker] request 必须返回 rows 数组和非负安全整数 total`);if(t.rows.length>n||t.rows.length>t.total)throw TypeError(`[C_DataPicker] rows 超过请求的分页或 total 范围`);if(o.s(t.rows,t=>d(e,t)).length)throw TypeError(`[C_DataPicker] rowKey 不得缺失或重复`);p(e,t.rows)}function h(e,r,i,a){let o=(0,s.shallowRef)(!1),c=(0,s.shallowRef)({page:1,search:``,revision:0}),u=(0,s.computed)({get:()=>c.value.page,set:e=>{c.value={...c.value,page:e}}}),p=(0,s.shallowRef)(``),h=(0,s.computed)(()=>c.value.search),g=(0,s.shallowRef)(0),_=(0,s.shallowRef)(0),v=(0,s.shallowRef)(new Map),y=(0,s.shallowRef)(new Map),b=(0,s.computed)(()=>{let t=l(e.modelValue);return e.multiple?t:t.slice(0,1)}),x=(0,s.computed)(()=>Number.isFinite(e.pageSize)&&e.pageSize>0?Math.max(1,Math.trunc(e.pageSize)):20),S=(0,s.computed)(()=>e.disabled||e.readonly),C=n.t(e.initialValues),w=!1,T,E=t=>f(e.source,t);(0,s.watch)(()=>[e.source,e.source.request,e.source.resolve,e.source.rowKey,e.source.value],()=>{z(),y.value=new Map,g.value++},{flush:`sync`}),(0,s.watch)(()=>e.initialValues,e=>{n.a(C,e)||(C=n.t(e),z())},{deep:!0,flush:`sync`});let D=t.t({key:()=>o.value?JSON.stringify([g.value,_.value,u.value,x.value,c.value.revision]):null,load:async({signal:t})=>{let{source:r}=e,{filters:i}=c.value,a={page:u.value,pageSize:x.value,search:h.value,signal:t,...i===void 0?{}:{filters:n.t(i)}},o=await r.request(a);return m(r,o,a.pageSize),{rows:[...o.rows],total:o.total}},isEmpty:e=>e.rows.length===0}),O=t.t({key:()=>e.source.resolve&&b.value.length?JSON.stringify([g.value,b.value]):null,load:async({signal:t})=>{let{source:n}=e,r=[...b.value],i=await n.resolve(r,t);if(!Array.isArray(i))throw TypeError(`[C_DataPicker] resolve 必须返回行数组`);let a=new Set(r),o=new Map;for(let e of i){let t=f(n,e);a.has(t)&&o.set(t,e)}return o},isEmpty:e=>e.size===0}),k=[],A=(0,s.computed)(()=>D.data.value?.rows??k),j=(0,s.shallowRef)(null);(0,s.watch)(D.data,e=>{if(!o.value||!e)return;j.value=e.total;let t=Math.max(1,Math.ceil(e.total/x.value));u.value>t&&(u.value=t)});let M=(0,s.computed)(()=>{let e=new Map(y.value);for(let[t,n]of O.data.value??[])e.set(t,n);return e}),N=(0,s.computed)(()=>b.value.map(t=>{let n=M.value.get(t);return n?e.source.label(n):String(t)}).join(`、`)),P=(0,s.computed)(()=>v.value.size),F=(0,s.computed)(()=>!S.value&&(!e.requireSelection||P.value>0)),I=(0,s.computed)(()=>{let t=[];for(let n of v.value.keys()){let r=V(n);if(t.push({value:n,label:r?e.source.label(r):String(n)}),t.length===30)break}return t}),L=(0,s.computed)(()=>[{type:`selection`,multiple:e.multiple},...e.columns.filter(e=>e.type!==`selection`)]),R=(0,s.computed)(()=>({density:a(),locale:e.locale,toolbar:{show:!1},pagination:!1,selection:{enabled:!0,maxSelection:e.multiple?void 0:1},virtualScroll:{enabled:!0,maxHeight:360}}));function z(){o.value=!1,j.value=null,v.value=new Map,T=void 0}(0,s.onDeactivated)(z);function B(){S.value||o.value||(v.value=new Map(b.value.map(e=>[e,void 0])),c.value={page:1,search:``,filters:n.t(C),revision:0},p.value=``,_.value++,o.value=!0)}function V(e){return v.value.get(e)??M.value.get(e)}function H(){if(!F.value||!o.value)return;let t=[...v.value.keys()],n=new Map;for(let e of t){let t=V(e);t&&n.set(e,t)}y.value=n,z(),r(`update:modelValue`,e.multiple?t:t[0]??null),r(`select`,[...n.values()])}function U(){S.value||!e.clearable||(r(`update:modelValue`,e.multiple?[]:null),r(`select`,[]))}function W(){if(T?.rows===A.value&&T.table===i.value)return T.table}function G(t,n){if(w||!o.value||!W())return;let r=new Map;if(e.multiple){let e=new Set(A.value.map(E));for(let[t,n]of v.value)e.has(t)||r.set(t,n)}let i=e.multiple?n:n.slice(-1);for(let e of i)r.set(E(e),e);v.value=r}function K(t){let n=new Map(v.value);if(!n.delete(t))return;v.value=n;let r=W();if(!r)return;let i=A.value.find(e=>E(e)===t);if(i){w=!0;try{r.unselectRow(d(e.source,i))}finally{w=!1}}}function q(){let t=i.value;if(!(!o.value||!t)){w=!0;try{T={table:t,rows:A.value};let n;t.clearSelection();for(let r of A.value){let i=E(r);v.value.has(i)&&(v.value.get(i)!==r&&(n??=new Map(v.value)).set(i,r),t.selectRow(e.source.value===void 0?i:d(e.source,r)))}n&&(v.value=n)}finally{w=!1}}}function J(){X(p.value,c.value.filters)}function Y(e){X(``,e)}function X(e,t){if(!o.value||S.value)return;let r=c.value,i=r.search===e&&n.a(r.filters,t);if(r.page===1&&i){D.reload();return}i||(j.value=null),c.value={page:1,search:e,filters:n.t(t),revision:r.revision+1}}return(0,s.watch)([A,i],()=>{(0,s.nextTick)(q)},{flush:`post`}),(0,s.watch)(()=>[e.modelValue,e.multiple,e.disabled,e.readonly],z,{deep:!0,flush:`sync`}),{opened:o,open:B,close:z,confirm:H,clear:U,page:u,pageSize:x,searchDraft:p,query:J,submitFilters:Y,list:D,labels:O,rows:A,total:j,display:N,selected:I,selectedCount:P,canConfirm:F,columns:L,tableConfig:R,selectPage:G,remove:K}}const g={class:`c-data-picker`},_={class:`c-data-picker__trigger`},v={key:0,class:`c-data-picker__label-error`,role:`status`},y=[`tabindex`],b={key:1,class:`c-data-picker__error`,role:`alert`},x={class:`c-data-picker__result-bar`},S={class:`c-data-picker__selection`,"aria-live":`polite`},C={key:0},w={key:1},T=[`aria-label`],E={class:`c-data-picker__actions`},D=(0,s.defineComponent)({name:`C_DataPicker`,__name:`index`,props:{source:{},columns:{},modelValue:{},multiple:{type:Boolean},disabled:{type:Boolean},readonly:{type:Boolean},clearable:{type:Boolean},title:{},placeholder:{},density:{},locale:{},pageSize:{default:20},requireSelection:{type:Boolean},presentation:{},initialValues:{}},emits:[`update:modelValue`,`select`],setup(t,{expose:n,emit:i}){let o=t,l=i,u=(0,s.shallowRef)(null),d=(0,s.shallowRef)(null),f=(0,s.useId)(),p=(0,s.computed)(()=>o.presentation===`inline`),m=null,D=a.o(),O=(0,s.computed)(()=>o.density??D.density??`compact`),k=(0,s.computed)(()=>e.t(O.value)),{t:A}=r.t(()=>o.locale),j=(0,s.defineAsyncComponent)({loader:()=>Promise.resolve().then(()=>require(`./C_Table2.cjs`)).then(e=>e.n),loadingComponent:()=>(0,s.h)(`div`,{role:`status`},A(`table.loading`)),errorComponent:()=>(0,s.h)(`div`,{role:`alert`},A(`picker.loadFailed`))}),M=(0,s.computed)(()=>o.title??A(`picker.title`)),N=(0,s.computed)(()=>o.placeholder??A(`picker.placeholder`)),{opened:P,open:F,close:I,confirm:L,clear:R,page:z,pageSize:B,searchDraft:V,query:H,submitFilters:U,list:W,labels:G,rows:K,total:q,display:J,selected:Y,selectedCount:X,canConfirm:ee,columns:te,tableConfig:ne,selectPage:re,remove:ie}=h(o,l,u,()=>O.value);function Z(e){P.value||o.disabled||o.readonly||(p.value&&(m=e?.currentTarget??document.activeElement),F(),p.value&&(0,s.nextTick)(()=>{let e=d.value;(e?.querySelector(`input:not([type="hidden"])`)??e)?.focus()}))}function Q(){let e=m;m=null,e?.isConnected&&e.focus()}function $(){I(),Q()}function ae(e){p.value&&P.value?$():Z(e)}function oe(){L(),P.value||Q()}function se(e){!p.value||e.isComposing||(e.preventDefault(),e.stopPropagation(),H())}function ce(e){e.key!==`Escape`||e.defaultPrevented||(e.preventDefault(),e.stopPropagation(),$())}let le=(0,s.computed)(()=>p.value?{id:f,class:`c-data-picker__inline`,role:`region`,"aria-label":M.value,title:M.value,size:`small`,onKeydown:ce}:{show:P.value,preset:`card`,class:`c-data-picker__modal`,title:M.value,"aria-label":M.value,style:{width:`min(960px, calc(100vw - 24px))`},"onUpdate:show":e=>{e||I()}});return n({open:Z,close:I}),(e,n)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,g,[(0,s.renderSlot)(e.$slots,`trigger`,{open:Z,disabled:t.disabled||t.readonly,opened:(0,s.unref)(P),display:(0,s.unref)(J)},()=>[(0,s.createElementVNode)(`div`,_,[(0,s.createVNode)((0,s.unref)(c.NButton),{class:`c-data-picker__open`,size:k.value.size,disabled:t.disabled,"aria-readonly":t.readonly,"aria-expanded":p.value?(0,s.unref)(P):void 0,"aria-controls":p.value&&(0,s.unref)(P)?(0,s.unref)(f):void 0,title:(0,s.unref)(J),onClick:ae},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`span`,{class:(0,s.normalizeClass)({"c-data-picker__placeholder":!(0,s.unref)(J)})},(0,s.toDisplayString)((0,s.unref)(J)||N.value),3),n[3]||=(0,s.createElementVNode)(`span`,{class:`i-mdi:magnify w-4 h-4 shrink-0`,"aria-hidden":`true`},null,-1)]),_:1},8,[`size`,`disabled`,`aria-readonly`,`aria-expanded`,`aria-controls`,`title`]),t.clearable&&t.modelValue!=null&&(!Array.isArray(t.modelValue)||t.modelValue.length)?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(c.NButton),{key:0,class:`c-data-picker__clear`,size:k.value.size,disabled:t.disabled||t.readonly,"aria-label":(0,s.unref)(A)(`picker.clear`),onClick:(0,s.unref)(R)},{icon:(0,s.withCtx)(()=>[...n[4]||=[(0,s.createElementVNode)(`span`,{class:`i-mdi:close w-4 h-4`,"aria-hidden":`true`},null,-1)]]),_:1},8,[`size`,`disabled`,`aria-label`,`onClick`])):(0,s.createCommentVNode)(`v-if`,!0)])],!0),(0,s.unref)(G).status.value===`error`?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,v,[(0,s.createTextVNode)((0,s.toDisplayString)((0,s.unref)(A)(`picker.labelFailed`))+` `,1),(0,s.createVNode)((0,s.unref)(c.NButton),{text:``,size:`tiny`,onClick:(0,s.unref)(G).reload},{icon:(0,s.withCtx)(()=>[...n[5]||=[(0,s.createElementVNode)(`span`,{class:`i-mdi:refresh w-4 h-4`,"aria-hidden":`true`},null,-1)]]),default:(0,s.withCtx)(()=>[(0,s.createTextVNode)(` `+(0,s.toDisplayString)((0,s.unref)(A)(`common.retry`)),1)]),_:1},8,[`onClick`])])):(0,s.createCommentVNode)(`v-if`,!0),!p.value||(0,s.unref)(P)?((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)(p.value?(0,s.unref)(c.NCard):(0,s.unref)(c.NModal)),(0,s.normalizeProps)((0,s.mergeProps)({key:1},le.value)),{action:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`div`,E,[(0,s.createVNode)((0,s.unref)(c.NButton),{size:k.value.size,onClick:$},{icon:(0,s.withCtx)(()=>[...n[8]||=[(0,s.createElementVNode)(`span`,{class:`i-mdi:close w-4 h-4`,"aria-hidden":`true`},null,-1)]]),default:(0,s.withCtx)(()=>[(0,s.createTextVNode)(` `+(0,s.toDisplayString)((0,s.unref)(A)(`common.cancel`)),1)]),_:1},8,[`size`]),(0,s.createVNode)((0,s.unref)(c.NButton),{type:`primary`,size:k.value.size,disabled:!(0,s.unref)(ee),onClick:oe},{icon:(0,s.withCtx)(()=>[...n[9]||=[(0,s.createElementVNode)(`span`,{class:`i-mdi:check w-4 h-4`,"aria-hidden":`true`},null,-1)]]),default:(0,s.withCtx)(()=>[(0,s.createTextVNode)(` `+(0,s.toDisplayString)((0,s.unref)(A)(`common.confirm`)),1)]),_:1},8,[`size`,`disabled`])])]),default:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`div`,{ref_key:`panelContent`,ref:d,class:`c-data-picker__content`,tabindex:p.value?-1:void 0},[(0,s.unref)(P)?(0,s.renderSlot)(e.$slots,`query`,{initialValues:t.initialValues,submit:(0,s.unref)(U),loading:(0,s.unref)(W).loading.value},()=>[((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)(p.value?`div`:`form`),{class:`c-data-picker__search`,onSubmit:(0,s.withModifiers)((0,s.unref)(H),[`stop`,`prevent`])},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.NInput),{value:(0,s.unref)(V),"onUpdate:value":n[0]||=e=>(0,s.isRef)(V)?V.value=e:null,size:k.value.size,placeholder:(0,s.unref)(A)(`picker.searchPlaceholder`),"input-props":{"aria-label":(0,s.unref)(A)(`picker.searchLabel`)},onKeydown:(0,s.withKeys)(se,[`enter`]),clearable:``},null,8,[`value`,`size`,`placeholder`,`input-props`]),(0,s.createVNode)((0,s.unref)(c.NButton),{"attr-type":p.value?`button`:`submit`,size:k.value.size,loading:(0,s.unref)(W).loading.value,type:`primary`,onClick:n[1]||=e=>p.value&&(0,s.unref)(H)()},{icon:(0,s.withCtx)(()=>[...n[6]||=[(0,s.createElementVNode)(`span`,{class:`i-mdi:magnify w-4 h-4`,"aria-hidden":`true`},null,-1)]]),default:(0,s.withCtx)(()=>[(0,s.createTextVNode)(` `+(0,s.toDisplayString)((0,s.unref)(A)(`picker.search`)),1)]),_:1},8,[`attr-type`,`size`,`loading`])]),_:1},40,[`onSubmit`]))],!0,0):(0,s.createCommentVNode)(`v-if`,!0),(0,s.unref)(W).status.value===`error`?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,b,[(0,s.createTextVNode)((0,s.toDisplayString)((0,s.unref)(A)(`picker.loadFailed`))+` `,1),(0,s.createVNode)((0,s.unref)(c.NButton),{size:k.value.size,onClick:(0,s.unref)(W).reload},{icon:(0,s.withCtx)(()=>[...n[7]||=[(0,s.createElementVNode)(`span`,{class:`i-mdi:refresh w-4 h-4`,"aria-hidden":`true`},null,-1)]]),default:(0,s.withCtx)(()=>[(0,s.createTextVNode)(` `+(0,s.toDisplayString)((0,s.unref)(A)(`common.retry`)),1)]),_:1},8,[`size`,`onClick`])])):(0,s.unref)(P)?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(j),{key:2,ref_key:`tableRef`,ref:u,data:(0,s.unref)(K),columns:(0,s.unref)(te),"row-key":t.source.rowKey,loading:(0,s.unref)(W).loading.value,config:(0,s.unref)(ne),onSelectionChange:(0,s.unref)(re)},null,8,[`data`,`columns`,`row-key`,`loading`,`config`,`onSelectionChange`])):(0,s.createCommentVNode)(`v-if`,!0),(0,s.createElementVNode)(`div`,x,[(0,s.createElementVNode)(`div`,S,[(0,s.unref)(q)===null?(0,s.createCommentVNode)(`v-if`,!0):((0,s.openBlock)(),(0,s.createElementBlock)(`span`,C,(0,s.toDisplayString)((0,s.unref)(A)(`picker.total`,{count:(0,s.unref)(q)})),1)),(0,s.createElementVNode)(`span`,null,(0,s.toDisplayString)((0,s.unref)(A)(`picker.selected`,{count:(0,s.unref)(X)})),1),((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)((0,s.unref)(Y),e=>((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(c.NTag),{key:`${typeof e.value}:${e.value}`,size:`small`,closable:``,title:e.label,onClose:t=>(0,s.unref)(ie)(e.value)},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(e.label),1)]),_:2},1032,[`title`,`onClose`]))),128)),(0,s.unref)(X)>30?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,w,(0,s.toDisplayString)((0,s.unref)(A)(`picker.moreSelected`,{count:(0,s.unref)(X)-30})),1)):(0,s.createCommentVNode)(`v-if`,!0)]),(0,s.unref)(q)!==null&&(0,s.unref)(q)>(0,s.unref)(B)?((0,s.openBlock)(),(0,s.createElementBlock)(`nav`,{key:0,class:`c-data-picker__pagination`,"aria-label":(0,s.unref)(A)(`picker.pagination`)},[(0,s.createVNode)((0,s.unref)(c.NPagination),{page:(0,s.unref)(z),"onUpdate:page":n[2]||=e=>(0,s.isRef)(z)?z.value=e:null,"page-size":(0,s.unref)(B),"item-count":(0,s.unref)(q),"page-slot":5,size:k.value.size},null,8,[`page`,`page-size`,`item-count`,`size`])],8,T)):(0,s.createCommentVNode)(`v-if`,!0)])],8,y)]),_:3},16)):(0,s.createCommentVNode)(`v-if`,!0)]))}});var O=i.t(D,[[`__scopeId`,`data-v-53b96a9d`]]);function k(e){return t=>{let{value:n,disabled:r,readonly:i,presentation:a}=t,o=u(n)||Array.isArray(n)&&n.every(u)?n:null,c=t[`onUpdate:value`];return(0,s.createVNode)(O,{...e,modelValue:o,disabled:r===!0,readonly:i===!0,presentation:a===`inline`||a===`modal`?a:e.presentation,"onUpdate:modelValue":e=>{Array.isArray(c)?c.forEach(t=>t(e)):c?.(e)}})}}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return k}});
|