@aplus-frontend/ui 6.11.0 → 6.13.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/es/src/ap-descriptions/interface.d.ts +1 -1
- package/es/src/ap-form/ap-form.vue2.mjs +118 -108
- package/es/src/ap-form/items/number/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/select/index.vue.d.ts +4 -4
- package/es/src/ap-form/items/text/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/text/password.vue.d.ts +2 -2
- package/es/src/ap-form/items/tree-select/index.vue.d.ts +4 -4
- package/es/src/ap-form/search-form/hooks/use-collapse-input-count.d.ts +8 -1
- package/es/src/ap-form/search-form/hooks/use-collapse-input-count.mjs +27 -19
- package/es/src/ap-form/search-form/hooks/use-sorter.mjs +31 -30
- package/es/src/ap-form/search-form/index.vue.d.ts +6 -2
- package/es/src/ap-form/search-form/index.vue.mjs +35 -35
- package/es/src/ap-grid/index.vue.mjs +221 -225
- package/es/src/ap-modal/interface.d.ts +8 -0
- package/es/src/ap-modal/utils/createModalStream.mjs +69 -66
- package/es/src/ap-table/ap-table.vue2.mjs +107 -111
- package/es/src/ap-table/constants.d.ts +7 -7
- package/es/src/ap-table/context.d.ts +1 -0
- package/es/src/ap-table/context.mjs +6 -5
- package/es/src/ap-table/utils.d.ts +5 -3247
- package/es/src/ap-table/utils.mjs +107 -121
- package/es/src/business/ap-card/ApCard.vue2.mjs +17 -17
- package/es/src/business/ap-summary/interface.d.ts +1 -1
- package/es/src/business/ap-view/ap-view.vue2.mjs +76 -74
- package/es/src/business/ap-view/interface.d.ts +1 -0
- package/es/src/business/batch-input-group/index.vue.d.ts +2 -1
- package/es/src/business/batch-input-group/index.vue.mjs +56 -52
- package/es/src/business/batch-input-group/interface.d.ts +5 -0
- package/es/src/business/batch-input-group/popover-input/index.vue2.mjs +36 -32
- package/es/src/business/batch-input-group/utils.d.ts +8 -0
- package/es/src/business/batch-input-group/utils.mjs +10 -0
- package/es/src/config-provider/config-provider-props.d.ts +5 -1
- package/es/src/config-provider/config-provider-props.mjs +4 -0
- package/es/src/config-provider/config-provider.d.ts +14 -5
- package/es/src/config-provider/config-provider.mjs +19 -18
- package/es/src/config-provider/constants.d.ts +3 -0
- package/es/src/config-provider/hooks/use-global-config.d.ts +5 -1
- package/es/src/config-provider/index.d.ts +28 -13
- package/es/src/utils/config-provider-preset.d.ts +6 -6
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ap-descriptions/interface.d.ts +1 -1
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/items/number/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/select/index.vue.d.ts +4 -4
- package/lib/src/ap-form/items/text/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/text/password.vue.d.ts +2 -2
- package/lib/src/ap-form/items/tree-select/index.vue.d.ts +4 -4
- package/lib/src/ap-form/search-form/hooks/use-collapse-input-count.d.ts +8 -1
- package/lib/src/ap-form/search-form/hooks/use-collapse-input-count.js +1 -1
- package/lib/src/ap-form/search-form/hooks/use-sorter.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.d.ts +6 -2
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-modal/interface.d.ts +8 -0
- package/lib/src/ap-modal/utils/createModalStream.js +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/constants.d.ts +7 -7
- package/lib/src/ap-table/context.d.ts +1 -0
- package/lib/src/ap-table/context.js +1 -1
- package/lib/src/ap-table/utils.d.ts +5 -3247
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/business/ap-card/ApCard.vue2.js +1 -1
- package/lib/src/business/ap-summary/interface.d.ts +1 -1
- package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
- package/lib/src/business/ap-view/interface.d.ts +1 -0
- package/lib/src/business/batch-input-group/index.vue.d.ts +2 -1
- package/lib/src/business/batch-input-group/index.vue.js +2 -2
- package/lib/src/business/batch-input-group/interface.d.ts +5 -0
- package/lib/src/business/batch-input-group/popover-input/index.vue2.js +3 -2
- package/lib/src/business/batch-input-group/utils.d.ts +8 -0
- package/lib/src/business/batch-input-group/utils.js +1 -0
- package/lib/src/config-provider/config-provider-props.d.ts +5 -1
- package/lib/src/config-provider/config-provider-props.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +14 -5
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/config-provider/constants.d.ts +3 -0
- package/lib/src/config-provider/hooks/use-global-config.d.ts +5 -1
- package/lib/src/config-provider/index.d.ts +28 -13
- package/lib/src/utils/config-provider-preset.d.ts +6 -6
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
- package/theme/ap-grid/index.css +3 -0
- package/theme/ap-grid/index.less +3 -4
- package/theme/index.css +3 -0
- package/es/src/ap-table/components/dynamic-component/index.vue.d.ts +0 -4
- package/es/src/ap-table/components/dynamic-component/index.vue.mjs +0 -4
- package/es/src/ap-table/components/dynamic-component/index.vue2.mjs +0 -15
- package/lib/src/ap-table/components/dynamic-component/index.vue.d.ts +0 -4
- package/lib/src/ap-table/components/dynamic-component/index.vue.js +0 -1
- package/lib/src/ap-table/components/dynamic-component/index.vue2.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import { LocaleType } from '../locale/interface';
|
|
3
|
-
import { ApiType, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig, downloadCenterTriggerConfig, ExportField } from './constants';
|
|
3
|
+
import { ApiType, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig, downloadCenterTriggerConfig, ExportField, SearchFormGlobalConfig } from './constants';
|
|
4
4
|
import { ViewCacheOption } from '../business';
|
|
5
5
|
import { default as __DTS_DEFAULT_0__ } from '@aplus-frontend/antdv/es/config-provider/renderEmpty';
|
|
6
6
|
import { TransformCellTextProps } from '@aplus-frontend/antdv/es/table/interface';
|
|
@@ -166,5 +166,9 @@ export declare const configProviderProps: () => {
|
|
|
166
166
|
type: PropType<ViewCacheOption>;
|
|
167
167
|
default: () => {};
|
|
168
168
|
};
|
|
169
|
+
searchForm: {
|
|
170
|
+
type: PropType<SearchFormGlobalConfig>;
|
|
171
|
+
default: () => {};
|
|
172
|
+
};
|
|
169
173
|
};
|
|
170
174
|
export type ConfigProviderProps = Partial<ExtractPropTypes<ReturnType<typeof configProviderProps>>>;
|
|
@@ -9,7 +9,7 @@ import { ValidateMessages } from '@aplus-frontend/antdv/es/form/interface';
|
|
|
9
9
|
import { RequiredMark } from '@aplus-frontend/antdv/es/form/Form';
|
|
10
10
|
import { ThemeConfig } from '@aplus-frontend/antdv/es/config-provider/context';
|
|
11
11
|
import { LocaleType } from '../locale';
|
|
12
|
-
import { ApiType, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig, downloadCenterTriggerConfig, ExportField } from './constants';
|
|
12
|
+
import { ApiType, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig, downloadCenterTriggerConfig, ExportField, SearchFormGlobalConfig } from './constants';
|
|
13
13
|
import { ViewCacheOption } from '..';
|
|
14
14
|
export declare const globalConfigCached: Ref<ConfigProviderProps>;
|
|
15
15
|
export declare const ConfigProvider: DefineComponent<ExtractPropTypes<{
|
|
@@ -165,6 +165,10 @@ export declare const ConfigProvider: DefineComponent<ExtractPropTypes<{
|
|
|
165
165
|
type: PropType<ViewCacheOption>;
|
|
166
166
|
default: () => {};
|
|
167
167
|
};
|
|
168
|
+
searchForm: {
|
|
169
|
+
type: PropType<SearchFormGlobalConfig>;
|
|
170
|
+
default: () => {};
|
|
171
|
+
};
|
|
168
172
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
169
173
|
iconPrefixCls: StringConstructor;
|
|
170
174
|
getTargetContainer: {
|
|
@@ -318,6 +322,10 @@ export declare const ConfigProvider: DefineComponent<ExtractPropTypes<{
|
|
|
318
322
|
type: PropType<ViewCacheOption>;
|
|
319
323
|
default: () => {};
|
|
320
324
|
};
|
|
325
|
+
searchForm: {
|
|
326
|
+
type: PropType<SearchFormGlobalConfig>;
|
|
327
|
+
default: () => {};
|
|
328
|
+
};
|
|
321
329
|
}>> & Readonly<{}>, {
|
|
322
330
|
input: {
|
|
323
331
|
autocomplete?: string;
|
|
@@ -334,10 +342,7 @@ export declare const ConfigProvider: DefineComponent<ExtractPropTypes<{
|
|
|
334
342
|
size?: ButtonSize | number;
|
|
335
343
|
};
|
|
336
344
|
direction: "ltr" | "rtl";
|
|
337
|
-
|
|
338
|
-
showSizeChanger?: boolean;
|
|
339
|
-
};
|
|
340
|
-
apUpload: ApUploadConfig;
|
|
345
|
+
searchForm: SearchFormGlobalConfig;
|
|
341
346
|
csp: CSPConfig;
|
|
342
347
|
autoInsertSpaceInButton: boolean;
|
|
343
348
|
locale: Locale;
|
|
@@ -347,11 +352,15 @@ export declare const ConfigProvider: DefineComponent<ExtractPropTypes<{
|
|
|
347
352
|
componentDisabled: boolean;
|
|
348
353
|
virtual: boolean;
|
|
349
354
|
dropdownMatchSelectWidth: number | boolean;
|
|
355
|
+
pagination: {
|
|
356
|
+
showSizeChanger?: boolean;
|
|
357
|
+
};
|
|
350
358
|
theme: ThemeConfig;
|
|
351
359
|
wave: {
|
|
352
360
|
disabled?: boolean;
|
|
353
361
|
};
|
|
354
362
|
api: ApiType;
|
|
363
|
+
apUpload: ApUploadConfig;
|
|
355
364
|
apDescriptions: ApDescriptionsConfig;
|
|
356
365
|
valueTypeMap: Record<string, ValueTypeRenderConfig>;
|
|
357
366
|
downloadCenterTriggerConfig: downloadCenterTriggerConfig;
|
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
import { isVNode as p, ref as
|
|
1
|
+
import { isVNode as p, ref as s, defineComponent as C, computed as i, unref as t, watch as u, createVNode as v, renderSlot as M } from "vue";
|
|
2
2
|
import { ConfigProvider as P } from "@aplus-frontend/antdv";
|
|
3
|
-
import { useGlobalConfig as l, provideGlobalConfig as
|
|
4
|
-
import { configProviderProps as
|
|
5
|
-
import { mergeAntdProviderConfigWithCache as
|
|
6
|
-
import { DEFAULT_NAMESPACE as
|
|
7
|
-
function
|
|
3
|
+
import { useGlobalConfig as l, provideGlobalConfig as h } from "./hooks/use-global-config.mjs";
|
|
4
|
+
import { configProviderProps as U } from "./config-provider-props.mjs";
|
|
5
|
+
import { mergeAntdProviderConfigWithCache as w, mergeAntdProvideConfig as A } from "../utils/config-provider-preset.mjs";
|
|
6
|
+
import { DEFAULT_NAMESPACE as D, DEFAULT_UIMODE as N } from "./constants.mjs";
|
|
7
|
+
function b(e) {
|
|
8
8
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !p(e);
|
|
9
9
|
}
|
|
10
|
-
const n =
|
|
10
|
+
const n = s({}), S = /* @__PURE__ */ C({
|
|
11
11
|
name: "AplusConfigProvider",
|
|
12
|
-
props:
|
|
12
|
+
props: U(),
|
|
13
13
|
setup(e, {
|
|
14
|
-
slots:
|
|
14
|
+
slots: m
|
|
15
15
|
}) {
|
|
16
|
-
const a = l("namespace"), d = l("uiMode"),
|
|
17
|
-
namespace: t(
|
|
16
|
+
const a = l("namespace"), d = l("uiMode"), f = i(() => e.namespace ? e.namespace : t(a) ? t(a) : D), c = i(() => e.uiMode ? e.uiMode : t(d) ? t(d) : N), g = i(() => ({
|
|
17
|
+
namespace: t(f),
|
|
18
18
|
aplusLocale: e.aplusLocale,
|
|
19
19
|
api: e.api,
|
|
20
|
-
uiMode: t(
|
|
20
|
+
uiMode: t(c),
|
|
21
21
|
apUpload: e.apUpload,
|
|
22
22
|
apDescriptions: e.apDescriptions,
|
|
23
23
|
valueTypeMap: e.valueTypeMap,
|
|
24
24
|
downloadCenterTriggerConfig: e.downloadCenterTriggerConfig,
|
|
25
25
|
exportField: e.exportField,
|
|
26
26
|
scrollYDomName: e.scrollYDomName,
|
|
27
|
-
viewCacheOption: e.viewCacheOption
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
viewCacheOption: e.viewCacheOption,
|
|
28
|
+
searchForm: e.searchForm
|
|
29
|
+
})), r = h(g);
|
|
30
|
+
return u(() => e, (o) => {
|
|
31
|
+
n.value = w(A(o), n.value);
|
|
31
32
|
}, {
|
|
32
33
|
deep: !0,
|
|
33
34
|
immediate: !0
|
|
34
|
-
}), typeof window < "u" &&
|
|
35
|
+
}), typeof window < "u" && u(() => t(c), (o) => {
|
|
35
36
|
document.documentElement.dataset.aplusUiMode = o;
|
|
36
37
|
}, {
|
|
37
38
|
immediate: !0
|
|
38
39
|
}), () => {
|
|
39
40
|
let o;
|
|
40
|
-
return v(P, n.value,
|
|
41
|
+
return v(P, n.value, b(o = M(m, "default", {
|
|
41
42
|
config: r == null ? void 0 : r.value
|
|
42
43
|
})) ? o : {
|
|
43
44
|
default: () => [o]
|
|
@@ -41,6 +41,9 @@ export type downloadCenterTriggerConfigParams = {
|
|
|
41
41
|
export type downloadCenterTriggerConfig = {
|
|
42
42
|
trigger: (fileList: downloadCenterTriggerConfigParams[]) => Promise<any>;
|
|
43
43
|
};
|
|
44
|
+
export type SearchFormGlobalConfig = {
|
|
45
|
+
customFilled?: (node: VNode, value: any) => boolean;
|
|
46
|
+
};
|
|
44
47
|
export type ExportField = boolean | {
|
|
45
48
|
key?: string;
|
|
46
49
|
convertField?: {
|
|
@@ -10,7 +10,7 @@ import { ValidateMessages } from '@aplus-frontend/antdv/es/form/interface';
|
|
|
10
10
|
import { RequiredMark } from '@aplus-frontend/antdv/es/form/Form';
|
|
11
11
|
import { ThemeConfig } from '@aplus-frontend/antdv/es/config-provider/context';
|
|
12
12
|
import { LocaleType } from '../../locale';
|
|
13
|
-
import { ApiType, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig, downloadCenterTriggerConfig, ExportField } from '..';
|
|
13
|
+
import { ApiType, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig, downloadCenterTriggerConfig, ExportField, SearchFormGlobalConfig } from '..';
|
|
14
14
|
import { ViewCacheOption } from '../..';
|
|
15
15
|
export declare const keysOf: <T extends Record<string, any>>(arr: T) => Array<keyof T>;
|
|
16
16
|
export declare function useGlobalConfig<K extends keyof ConfigProviderContext, D extends ConfigProviderContext[K]>(key: K, defaultValue?: D): Ref<Exclude<ConfigProviderContext[K], undefined> | D>;
|
|
@@ -168,4 +168,8 @@ export declare const provideGlobalConfig: (config: MaybeRef<ConfigProviderContex
|
|
|
168
168
|
type: PropType<ViewCacheOption>;
|
|
169
169
|
default: () => {};
|
|
170
170
|
};
|
|
171
|
+
searchForm: {
|
|
172
|
+
type: PropType<SearchFormGlobalConfig>;
|
|
173
|
+
default: () => {};
|
|
174
|
+
};
|
|
171
175
|
}>>>> | undefined;
|
|
@@ -8,7 +8,7 @@ import { ValidateMessages } from '@aplus-frontend/antdv/es/form/interface';
|
|
|
8
8
|
import { RequiredMark } from '@aplus-frontend/antdv/es/form/Form';
|
|
9
9
|
import { ThemeConfig } from '@aplus-frontend/antdv/es/config-provider/context';
|
|
10
10
|
import { LocaleType } from '../locale';
|
|
11
|
-
import { ApiType, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig, downloadCenterTriggerConfig, ExportField } from './constants';
|
|
11
|
+
import { ApiType, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig, downloadCenterTriggerConfig, ExportField, SearchFormGlobalConfig } from './constants';
|
|
12
12
|
import { ViewCacheOption } from '..';
|
|
13
13
|
export * from './config-provider-props';
|
|
14
14
|
export * from './constants';
|
|
@@ -170,6 +170,10 @@ export declare const APConfigProvider: {
|
|
|
170
170
|
type: PropType<ViewCacheOption>;
|
|
171
171
|
default: () => {};
|
|
172
172
|
};
|
|
173
|
+
searchForm: {
|
|
174
|
+
type: PropType<SearchFormGlobalConfig>;
|
|
175
|
+
default: () => {};
|
|
176
|
+
};
|
|
173
177
|
}>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
|
|
174
178
|
input: {
|
|
175
179
|
autocomplete?: string;
|
|
@@ -186,10 +190,7 @@ export declare const APConfigProvider: {
|
|
|
186
190
|
size?: ButtonSize | number;
|
|
187
191
|
};
|
|
188
192
|
direction: "ltr" | "rtl";
|
|
189
|
-
|
|
190
|
-
showSizeChanger?: boolean;
|
|
191
|
-
};
|
|
192
|
-
apUpload: ApUploadConfig;
|
|
193
|
+
searchForm: SearchFormGlobalConfig;
|
|
193
194
|
csp: CSPConfig;
|
|
194
195
|
autoInsertSpaceInButton: boolean;
|
|
195
196
|
locale: Locale;
|
|
@@ -199,11 +200,15 @@ export declare const APConfigProvider: {
|
|
|
199
200
|
componentDisabled: boolean;
|
|
200
201
|
virtual: boolean;
|
|
201
202
|
dropdownMatchSelectWidth: number | boolean;
|
|
203
|
+
pagination: {
|
|
204
|
+
showSizeChanger?: boolean;
|
|
205
|
+
};
|
|
202
206
|
theme: ThemeConfig;
|
|
203
207
|
wave: {
|
|
204
208
|
disabled?: boolean;
|
|
205
209
|
};
|
|
206
210
|
api: ApiType;
|
|
211
|
+
apUpload: ApUploadConfig;
|
|
207
212
|
apDescriptions: ApDescriptionsConfig;
|
|
208
213
|
valueTypeMap: Record<string, ValueTypeRenderConfig>;
|
|
209
214
|
downloadCenterTriggerConfig: downloadCenterTriggerConfig;
|
|
@@ -369,6 +374,10 @@ export declare const APConfigProvider: {
|
|
|
369
374
|
type: PropType<ViewCacheOption>;
|
|
370
375
|
default: () => {};
|
|
371
376
|
};
|
|
377
|
+
searchForm: {
|
|
378
|
+
type: PropType<SearchFormGlobalConfig>;
|
|
379
|
+
default: () => {};
|
|
380
|
+
};
|
|
372
381
|
}>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
|
|
373
382
|
input: {
|
|
374
383
|
autocomplete?: string;
|
|
@@ -385,10 +394,7 @@ export declare const APConfigProvider: {
|
|
|
385
394
|
size?: ButtonSize | number;
|
|
386
395
|
};
|
|
387
396
|
direction: "ltr" | "rtl";
|
|
388
|
-
|
|
389
|
-
showSizeChanger?: boolean;
|
|
390
|
-
};
|
|
391
|
-
apUpload: ApUploadConfig;
|
|
397
|
+
searchForm: SearchFormGlobalConfig;
|
|
392
398
|
csp: CSPConfig;
|
|
393
399
|
autoInsertSpaceInButton: boolean;
|
|
394
400
|
locale: Locale;
|
|
@@ -398,11 +404,15 @@ export declare const APConfigProvider: {
|
|
|
398
404
|
componentDisabled: boolean;
|
|
399
405
|
virtual: boolean;
|
|
400
406
|
dropdownMatchSelectWidth: number | boolean;
|
|
407
|
+
pagination: {
|
|
408
|
+
showSizeChanger?: boolean;
|
|
409
|
+
};
|
|
401
410
|
theme: ThemeConfig;
|
|
402
411
|
wave: {
|
|
403
412
|
disabled?: boolean;
|
|
404
413
|
};
|
|
405
414
|
api: ApiType;
|
|
415
|
+
apUpload: ApUploadConfig;
|
|
406
416
|
apDescriptions: ApDescriptionsConfig;
|
|
407
417
|
valueTypeMap: Record<string, ValueTypeRenderConfig>;
|
|
408
418
|
downloadCenterTriggerConfig: downloadCenterTriggerConfig;
|
|
@@ -565,6 +575,10 @@ export declare const APConfigProvider: {
|
|
|
565
575
|
type: PropType<ViewCacheOption>;
|
|
566
576
|
default: () => {};
|
|
567
577
|
};
|
|
578
|
+
searchForm: {
|
|
579
|
+
type: PropType<SearchFormGlobalConfig>;
|
|
580
|
+
default: () => {};
|
|
581
|
+
};
|
|
568
582
|
}>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
|
|
569
583
|
input: {
|
|
570
584
|
autocomplete?: string;
|
|
@@ -581,10 +595,7 @@ export declare const APConfigProvider: {
|
|
|
581
595
|
size?: ButtonSize | number;
|
|
582
596
|
};
|
|
583
597
|
direction: "ltr" | "rtl";
|
|
584
|
-
|
|
585
|
-
showSizeChanger?: boolean;
|
|
586
|
-
};
|
|
587
|
-
apUpload: ApUploadConfig;
|
|
598
|
+
searchForm: SearchFormGlobalConfig;
|
|
588
599
|
csp: CSPConfig;
|
|
589
600
|
autoInsertSpaceInButton: boolean;
|
|
590
601
|
locale: Locale;
|
|
@@ -594,11 +605,15 @@ export declare const APConfigProvider: {
|
|
|
594
605
|
componentDisabled: boolean;
|
|
595
606
|
virtual: boolean;
|
|
596
607
|
dropdownMatchSelectWidth: number | boolean;
|
|
608
|
+
pagination: {
|
|
609
|
+
showSizeChanger?: boolean;
|
|
610
|
+
};
|
|
597
611
|
theme: ThemeConfig;
|
|
598
612
|
wave: {
|
|
599
613
|
disabled?: boolean;
|
|
600
614
|
};
|
|
601
615
|
api: ApiType;
|
|
616
|
+
apUpload: ApUploadConfig;
|
|
602
617
|
apDescriptions: ApDescriptionsConfig;
|
|
603
618
|
valueTypeMap: Record<string, ValueTypeRenderConfig>;
|
|
604
619
|
downloadCenterTriggerConfig: downloadCenterTriggerConfig;
|
|
@@ -51,15 +51,15 @@ export declare function mergeAntdProvideConfig(config: ConfigProviderProps): {
|
|
|
51
51
|
size?: ButtonSize | number;
|
|
52
52
|
} | undefined;
|
|
53
53
|
direction?: "ltr" | "rtl" | undefined;
|
|
54
|
-
pagination?: {
|
|
55
|
-
showSizeChanger?: boolean;
|
|
56
|
-
} | undefined;
|
|
57
54
|
csp?: CSPConfig | undefined;
|
|
58
55
|
locale?: Locale | undefined;
|
|
59
56
|
pageHeader?: {
|
|
60
57
|
ghost?: boolean;
|
|
61
58
|
} | undefined;
|
|
62
59
|
dropdownMatchSelectWidth?: number | boolean | undefined;
|
|
60
|
+
pagination?: {
|
|
61
|
+
showSizeChanger?: boolean;
|
|
62
|
+
} | undefined;
|
|
63
63
|
theme?: ThemeConfig | undefined;
|
|
64
64
|
wave?: {
|
|
65
65
|
disabled?: boolean;
|
|
@@ -92,15 +92,15 @@ export declare function mergeAntdProviderConfigWithCache(newConfig: ConfigProvid
|
|
|
92
92
|
size?: ButtonSize | number;
|
|
93
93
|
} | undefined;
|
|
94
94
|
direction?: "ltr" | "rtl" | undefined;
|
|
95
|
-
pagination?: {
|
|
96
|
-
showSizeChanger?: boolean;
|
|
97
|
-
} | undefined;
|
|
98
95
|
csp?: CSPConfig | undefined;
|
|
99
96
|
locale?: Locale | undefined;
|
|
100
97
|
pageHeader?: {
|
|
101
98
|
ghost?: boolean;
|
|
102
99
|
} | undefined;
|
|
103
100
|
dropdownMatchSelectWidth?: number | boolean | undefined;
|
|
101
|
+
pagination?: {
|
|
102
|
+
showSizeChanger?: boolean;
|
|
103
|
+
} | undefined;
|
|
104
104
|
theme?: ThemeConfig | undefined;
|
|
105
105
|
wave?: {
|
|
106
106
|
disabled?: boolean;
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "6.
|
|
1
|
+
declare const _default: "6.13.0";
|
|
2
2
|
export default _default;
|
package/es/src/version.mjs
CHANGED
|
@@ -21,7 +21,7 @@ type AllKeys<T, P extends string = '', Level extends unknown[] = []> = Level['le
|
|
|
21
21
|
/** 基本描述类型 */
|
|
22
22
|
export interface ItemSchema<T extends Recordable = Recordable> {
|
|
23
23
|
label: VNodeChild | VNode;
|
|
24
|
-
field: Extract<AllKeys<T>, string> | string[];
|
|
24
|
+
field: Extract<AllKeys<T>, string> | (string & {}) | string[];
|
|
25
25
|
span?: number;
|
|
26
26
|
prefix?: VNodeChild | VNode;
|
|
27
27
|
suffix?: VNodeChild | VNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("vue"),H=require("@aplus-frontend/antdv"),J=require("./context.js"),l=require("lodash-unified"),Q=require("@vueuse/core"),X=require("./constant.js"),V=require("../utils/index.js"),Y=require("./utils/set.js"),p=require("./utils/params.js"),Z=require("./provider/context.js"),z=i.defineComponent({name:"ApForm",__name:"ap-form",props:{layout:{default:"horizontal"},labelCol:{},wrapperCol:{},colon:{type:Boolean,default:!0},labelAlign:{default:"right"},labelWrap:{type:Boolean},prefixCls:{},requiredMark:{},hideRequiredMark:{type:Boolean,default:!1},rules:{},validateMessages:{},validateOnRuleChange:{type:Boolean,default:!0},scrollToFirstError:{},onSubmit:{},name:{},validateTrigger:{default:"change"},size:{},disabled:{type:Boolean},onFieldsChange:{},onFinish:{},onFinishFailed:{},onValidate:{},initialValues:{},onValuesChange:{},syncToUrl:{type:[Boolean,Function],default:!1},syncToUrlPriority:{type:Boolean}},setup(j,{expose:w}){function b(e,t){return l.isArray(t)?t.reduce((r,n)=>r==null?void 0:r[n],e):e==null?void 0:e[t]}const s=j;function m(e,t,r=!0,n){var a;if(l.isArray(e)){let u=o;for(let g=0;g<e.length-1;g++)e[g]in u||(u[e[g]]={}),u=u[e[g]];n?n(u,e[e.length-1]):u[e[e.length-1]]=t}else n?n(o,e):o[e]=t;let f=l.isArray(e)?e[0]:e;if(r){const u={[f]:o[f]};P.triggerFormChange(s.name,u),(a=s.onValuesChange)==null||a.call(s,u,o,e)}v()}const c=i.ref(),I=Q.useUrlSearchParams(V.getRouteType()),P=Z.useInjectFormProvider(),U=i.ref(s.syncToUrl?p.genParams(s.syncToUrl,I,"get"):{});let h=l.cloneDeep(M()),F={};const o=i.reactive(M());let y=[];function M(){const e=s.initialValues||{};return s.syncToUrlPriority?{...e,...i.unref(U)}:{...i.unref(U),...e}}function B(e){var r;const t=T(e,F);P.triggerFormFinish(s.name,e),s.syncToUrl&&p.setToParams(I,p.genParams(s.syncToUrl,t,"set")),(r=s.onFinish)==null||r.call(s,t)}const x=async()=>{var e;(e=c.value)==null||e.resetFields(),await i.nextTick(()=>{Object.keys(o).forEach(t=>delete o[t]),Object.assign(o,h),v(),s.syncToUrl&&p.setToParams(I,p.genParams(s.syncToUrl,T(h,F),"set"))})},E=e=>{var t;(t=c.value)==null||t.clearValidate(e)},S=(e,t)=>{var r;return(r=c.value)==null?void 0:r.validateFields(e,t)},C=async(e,t)=>{var n;const r=await((n=c.value)==null?void 0:n.validateFields(e,t));return T(r,F)},R=e=>{var t;return e===!0?i.toRaw(o):(t=c.value)==null?void 0:t.getFieldsValue(e)},D=e=>{const t=R(e);return T(t,F)},N=(e,t)=>{var r;return(r=c.value)==null?void 0:r.validate(e,t)},W=(e,t={})=>{var r;(r=c.value)==null||r.scrollToField(e,t)},$=e=>{Object.assign(o,e),v()},q=(e,t,r=!0,n)=>{m(e,t,r,n),v()};function A(e,t){return t||e(i.toRaw(o)),y.push(e),()=>{y=y.filter(r=>r!==e)}}function k(e,t){if(l.isArray(e)){let r=h;for(let n=0;n<e.length-1;n++)V.isDef(r[e[n]])||(r[e[n]]={}),r=r[e[n]];r[e[e.length-1]]=t}else h[e]=t}function K(e,t){if(!V.isDef(e)||!V.isDef(t))return;const r=b(h,t);if(l.isEqual(r,e))return;const n=b(i.unref(U),t);V.isDef(n)&&s.syncToUrlPriority||(m(t,e,!1),k(t,e))}function L(e,t){t&&(F=Y.default(F,[e].flat(1),t,!0))}function _({initialValue:e,name:t,transform:r}){K(e,t),L(t,r)}function G(e){if(e!==X.INTERNAL_FORM_INSTANCE_MARK){console.warn("getInternalInstance should only used at internal");return}return{registerField:_,registerWatch:A,setFieldValue:q}}function v(){if(y.length){const e=i.toRaw(o);y.forEach(t=>{t(e)})}}function T(e,t){if(e==null)return;let r=l.isArray(e)?[]:{};return Object.keys(e).forEach(n=>{const f=e[n],a=t==null?void 0:t[n],u=l.isFunction(a)?a:a==null?void 0:a.transformer,g=l.isFunction(a)?!0:a==null?void 0:a.flat;if(l.isFunction(u)){const d=u(f);g?l.isArray(d)&&l.isArray(r)?r=[...r,...d]:l.isPlainObject(d)&&l.isPlainObject(r)?r={...r,...d}:r[n]=d:r[n]=d}else if(l.isPlainObject(f)||l.isArray(f)){const d=T(f,a);r[n]=d}else r[n]=f}),r}const O={resetFields:x,clearValidate:E,validateFields:S,getFieldsValue:R,validate:N,scrollToField:W,setFieldsValue:$,setFieldValue:q,registerWatch:A,validateFieldsReturnTransformed:C,getFieldsValueTransformed:D,getInternalInstance:G};return i.watch(()=>s.name,e=>{e&&(P.registerForm(e,O),i.onWatcherCleanup(()=>{P.unregisterForm(s.name)}))},{immediate:!0}),J.useProvideForm({model:i.computed(()=>o),updateModel:m,internalInstance:{registerWatch:A,registerField:_,setFieldValue:q}}),w(O),(e,t)=>(i.openBlock(),i.createBlock(i.unref(H.Form),i.mergeProps({ref_key:"formRef",ref:c},i.unref(l.omit)(s,["initialValues","onValuesChange","onFinish","syncToUrl","syncToUrlPriority"]),{model:o,"data-form-name":e.name,onFinish:B}),{default:i.withCtx(()=>[i.renderSlot(e.$slots,"default")]),_:3},16,["model","data-form-name"]))}});exports.default=z;
|
|
@@ -66,8 +66,8 @@ declare function __VLS_template(): {
|
|
|
66
66
|
readonly type?: string | undefined;
|
|
67
67
|
readonly name?: string | undefined;
|
|
68
68
|
readonly suffix?: any;
|
|
69
|
-
readonly placeholder?: string | undefined;
|
|
70
69
|
readonly id?: string | undefined;
|
|
70
|
+
readonly placeholder?: string | undefined;
|
|
71
71
|
readonly valueModifiers?: Record<string, any> | undefined;
|
|
72
72
|
readonly addonBefore?: any;
|
|
73
73
|
readonly addonAfter?: any;
|
|
@@ -539,8 +539,8 @@ declare const __VLS_component: DefineComponent<ApFormItemNumberProps, {
|
|
|
539
539
|
readonly type?: string | undefined;
|
|
540
540
|
readonly name?: string | undefined;
|
|
541
541
|
readonly suffix?: any;
|
|
542
|
-
readonly placeholder?: string | undefined;
|
|
543
542
|
readonly id?: string | undefined;
|
|
543
|
+
readonly placeholder?: string | undefined;
|
|
544
544
|
readonly valueModifiers?: Record<string, any> | undefined;
|
|
545
545
|
readonly addonBefore?: any;
|
|
546
546
|
readonly addonAfter?: any;
|
|
@@ -72,11 +72,11 @@ declare function __VLS_template(): {
|
|
|
72
72
|
readonly autofocus?: boolean | undefined;
|
|
73
73
|
readonly bordered?: boolean | undefined;
|
|
74
74
|
readonly getPopupContainer?: RenderDOMFunc | undefined;
|
|
75
|
-
readonly placeholder?: any;
|
|
76
|
-
readonly defaultValue?: SelectValue;
|
|
77
75
|
readonly virtual?: boolean | undefined;
|
|
78
76
|
readonly dropdownMatchSelectWidth?: number | boolean | undefined;
|
|
77
|
+
readonly defaultValue?: SelectValue;
|
|
79
78
|
readonly id?: string | undefined;
|
|
79
|
+
readonly placeholder?: any;
|
|
80
80
|
readonly status?: "" | "error" | "warning" | undefined;
|
|
81
81
|
readonly clearIcon?: any;
|
|
82
82
|
readonly allowClear?: boolean | undefined;
|
|
@@ -703,11 +703,11 @@ declare const __VLS_component: DefineComponent<ApFormItemSelectProps, {
|
|
|
703
703
|
readonly autofocus?: boolean | undefined;
|
|
704
704
|
readonly bordered?: boolean | undefined;
|
|
705
705
|
readonly getPopupContainer?: RenderDOMFunc | undefined;
|
|
706
|
-
readonly placeholder?: any;
|
|
707
|
-
readonly defaultValue?: SelectValue;
|
|
708
706
|
readonly virtual?: boolean | undefined;
|
|
709
707
|
readonly dropdownMatchSelectWidth?: number | boolean | undefined;
|
|
708
|
+
readonly defaultValue?: SelectValue;
|
|
710
709
|
readonly id?: string | undefined;
|
|
710
|
+
readonly placeholder?: any;
|
|
711
711
|
readonly status?: "" | "error" | "warning" | undefined;
|
|
712
712
|
readonly clearIcon?: any;
|
|
713
713
|
readonly allowClear?: boolean | undefined;
|
|
@@ -54,9 +54,9 @@ declare function __VLS_template(): {
|
|
|
54
54
|
readonly suffix?: any;
|
|
55
55
|
readonly focused?: boolean | undefined;
|
|
56
56
|
readonly handleReset?: MouseEventHandler | undefined;
|
|
57
|
-
readonly placeholder?: string | number | undefined;
|
|
58
57
|
readonly defaultValue?: string | number | undefined;
|
|
59
58
|
readonly id?: string | undefined;
|
|
59
|
+
readonly placeholder?: string | number | undefined;
|
|
60
60
|
readonly autocomplete?: string | undefined;
|
|
61
61
|
readonly maxlength?: number | undefined;
|
|
62
62
|
readonly showCount?: boolean | ShowCountProps | undefined;
|
|
@@ -210,9 +210,9 @@ declare const __VLS_component: DefineComponent<ApFormItemTextProps, {
|
|
|
210
210
|
readonly suffix?: any;
|
|
211
211
|
readonly focused?: boolean | undefined;
|
|
212
212
|
readonly handleReset?: MouseEventHandler | undefined;
|
|
213
|
-
readonly placeholder?: string | number | undefined;
|
|
214
213
|
readonly defaultValue?: string | number | undefined;
|
|
215
214
|
readonly id?: string | undefined;
|
|
215
|
+
readonly placeholder?: string | number | undefined;
|
|
216
216
|
readonly autocomplete?: string | undefined;
|
|
217
217
|
readonly maxlength?: number | undefined;
|
|
218
218
|
readonly showCount?: boolean | ShowCountProps | undefined;
|
|
@@ -55,9 +55,9 @@ declare function __VLS_template(): {
|
|
|
55
55
|
readonly suffix?: any;
|
|
56
56
|
readonly focused?: boolean | undefined;
|
|
57
57
|
readonly handleReset?: MouseEventHandler | undefined;
|
|
58
|
-
readonly placeholder?: string | number | undefined;
|
|
59
58
|
readonly defaultValue?: string | number | undefined;
|
|
60
59
|
readonly id?: string | undefined;
|
|
60
|
+
readonly placeholder?: string | number | undefined;
|
|
61
61
|
readonly autocomplete?: string | undefined;
|
|
62
62
|
readonly maxlength?: number | undefined;
|
|
63
63
|
readonly showCount?: boolean | ShowCountProps | undefined;
|
|
@@ -217,9 +217,9 @@ declare const __VLS_component: DefineComponent<ApFormItemTextPasswordProps, {
|
|
|
217
217
|
readonly suffix?: any;
|
|
218
218
|
readonly focused?: boolean | undefined;
|
|
219
219
|
readonly handleReset?: MouseEventHandler | undefined;
|
|
220
|
-
readonly placeholder?: string | number | undefined;
|
|
221
220
|
readonly defaultValue?: string | number | undefined;
|
|
222
221
|
readonly id?: string | undefined;
|
|
222
|
+
readonly placeholder?: string | number | undefined;
|
|
223
223
|
readonly autocomplete?: string | undefined;
|
|
224
224
|
readonly maxlength?: number | undefined;
|
|
225
225
|
readonly showCount?: boolean | ShowCountProps | undefined;
|
|
@@ -77,11 +77,11 @@ declare function __VLS_template(): {
|
|
|
77
77
|
readonly 'onUpdate:value'?: (((value: any) => void) & ((...args: any[]) => any)) | undefined;
|
|
78
78
|
readonly bordered?: boolean | undefined;
|
|
79
79
|
readonly getPopupContainer?: RenderDOMFunc | undefined;
|
|
80
|
-
readonly placeholder?: any;
|
|
81
|
-
readonly defaultValue?: unknown;
|
|
82
80
|
readonly virtual?: boolean | undefined;
|
|
83
81
|
readonly dropdownMatchSelectWidth?: number | boolean | undefined;
|
|
82
|
+
readonly defaultValue?: unknown;
|
|
84
83
|
readonly id?: string | undefined;
|
|
84
|
+
readonly placeholder?: any;
|
|
85
85
|
readonly status?: "" | "error" | "warning" | undefined;
|
|
86
86
|
readonly clearIcon?: any;
|
|
87
87
|
readonly allowClear?: boolean | undefined;
|
|
@@ -851,11 +851,11 @@ declare const __VLS_component: DefineComponent<ApFormItemTreeSelectProps, {
|
|
|
851
851
|
readonly 'onUpdate:value'?: (((value: any) => void) & ((...args: any[]) => any)) | undefined;
|
|
852
852
|
readonly bordered?: boolean | undefined;
|
|
853
853
|
readonly getPopupContainer?: RenderDOMFunc | undefined;
|
|
854
|
-
readonly placeholder?: any;
|
|
855
|
-
readonly defaultValue?: unknown;
|
|
856
854
|
readonly virtual?: boolean | undefined;
|
|
857
855
|
readonly dropdownMatchSelectWidth?: number | boolean | undefined;
|
|
856
|
+
readonly defaultValue?: unknown;
|
|
858
857
|
readonly id?: string | undefined;
|
|
858
|
+
readonly placeholder?: any;
|
|
859
859
|
readonly status?: "" | "error" | "warning" | undefined;
|
|
860
860
|
readonly clearIcon?: any;
|
|
861
861
|
readonly allowClear?: boolean | undefined;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import { Ref, ComputedRef } from 'vue';
|
|
1
|
+
import { Ref, VNode, ComputedRef } from 'vue';
|
|
2
2
|
import { SearchFormRenderNodeConfig } from '../../interface';
|
|
3
|
+
/**
|
|
4
|
+
* 默认用于判断当前值是否是空值的判断函数
|
|
5
|
+
* @param value
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare function defaultFilled(value: any): boolean;
|
|
9
|
+
export declare function getTargetNode(node: VNode): any;
|
|
3
10
|
export declare const useCollapseInputCount: (config: Ref<SearchFormRenderNodeConfig[]>) => {
|
|
4
11
|
count: ComputedRef<number>;
|
|
5
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("vue"),y=require("../../context.js"),i=require("lodash-unified");require("../../../config-provider/index.js");const h=require("../../../config-provider/hooks/use-global-config.js");function C(t,e){return i.isArray(e)?e.reduce((n,u)=>n==null?void 0:n[u],t):t==null?void 0:t[e]}function s(t){if(t==null)return!1;if(typeof t=="string")return t.trim()!=="";if(i.isArray(t))return t.some(n=>s(n));if(i.isObject(t)){const e=Object.keys(t);if(e.length===0)return!1;for(const n of e)if(s(t[n]))return!0;return!1}return!0}function d(t){return i.isFunction(t.type)?t.type():t}const b=t=>{const{model:e}=y.useInjectForm(),n=h.useGlobalConfig("searchForm");return{count:p.computed(()=>{let c=0;return t.value.forEach(F=>{var a;const r=d(F.node),g=[r.props.name].flat(1),l=C(e==null?void 0:e.value,g),f=r.props.customFilled||r.props["custom-filled"],o=(a=n.value)==null?void 0:a.customFilled;!f&&o?o!=null&&o(r,l)&&(c+=1):(f||s)(l)&&(c+=1)}),c})}};exports.defaultFilled=s;exports.getTargetNode=d;exports.useCollapseInputCount=b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("lodash-unified"),d=require("vue"),c=require("../../item-group/helper.js"),f=require("../../../utils/index.js"),l=require("./use-collapse-input-count.js");function g(o,s){var u;const i=new Set(o.map(e=>e.name)),a=new Map;for(const e of s){const n=String(c.getStringName((u=l.getTargetNode(e).props)==null?void 0:u.name));n&&i.has(n)&&a.set(n,e)}const r=new Set,t=[];for(const e of o){const n=a.get(e.name);n&&(t.push(n),r.add(n))}for(const e of s)r.has(e)||t.push(e);return t}const m=o=>{const s=d.ref(!1),i=d.computed(()=>(o.value||[]).map(t=>{const e=l.getTargetNode(t).props;return{label:e.description||e.label||e.placeholder,name:c.getStringName(e.name),isHidden:p.isBoolean(e.hidden)?!!e.hidden:f.isDef(e.hidden)}}));function a(r){const t=g(r||[],o.value||[]);s.value=!0,o.value=t}return{items:i,handleClickConfirm:a,sorted:s}};exports.useSorter=m;
|
|
@@ -398,7 +398,9 @@ declare function __VLS_template(): {
|
|
|
398
398
|
push: (StringConstructor | NumberConstructor)[];
|
|
399
399
|
pull: (StringConstructor | NumberConstructor)[];
|
|
400
400
|
xs: {
|
|
401
|
-
type: PropType<string | number |
|
|
401
|
+
type: PropType<string | number | **
|
|
402
|
+
* extra区域展开占据的span数(占据剩余所有空间)
|
|
403
|
+
*/).ColSize>;
|
|
402
404
|
default: string | number | ColSize;
|
|
403
405
|
};
|
|
404
406
|
sm: {
|
|
@@ -1237,7 +1239,9 @@ declare const __VLS_component: DefineComponent<ApFormSearchFormProps, {
|
|
|
1237
1239
|
push: (StringConstructor | NumberConstructor)[];
|
|
1238
1240
|
pull: (StringConstructor | NumberConstructor)[];
|
|
1239
1241
|
xs: {
|
|
1240
|
-
type: PropType<string | number |
|
|
1242
|
+
type: PropType<string | number | **
|
|
1243
|
+
* extra区域展开占据的span数(占据剩余所有空间)
|
|
1244
|
+
*/).ColSize>;
|
|
1241
1245
|
default: string | number | ColSize;
|
|
1242
1246
|
};
|
|
1243
1247
|
sm: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("@aplus-frontend/antdv");require("../ap-form.vue.js");require("../item/index.vue2.js");const T=require("../item-group/helper.js");require("../../config-provider/index.js");const w=require("lodash-unified"),P=require("../../utils/index.js"),S=require("./utils.js");require("./components/popover-filter.vue.js");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("@aplus-frontend/antdv");require("../ap-form.vue.js");require("../item/index.vue2.js");const T=require("../item-group/helper.js");require("../../config-provider/index.js");const w=require("lodash-unified"),P=require("../../utils/index.js"),S=require("./utils.js");require("./components/popover-filter.vue.js");const G=require("./hooks/use-count-per-row.js");require("./components/popover-sorter/index.vue.js");const J=require("./hooks/use-sorter.js"),K=require("../../config-provider/hooks/use-namespace.js"),Q=require("../../config-provider/hooks/use-locale.js"),E=require("../item/index.vue.js"),X=require("./components/popover-filter.vue2.js"),Y=require("./components/popover-sorter/index.vue2.js"),Z=require("../ap-form.vue2.js");function ee(p){return typeof p=="function"||Object.prototype.toString.call(p)==="[object Object]"&&!e.isVNode(p)}const s=24,te=e.defineComponent({name:"ApFormSearchForm",__name:"index",props:{layout:{default:"horizontal"},labelCol:{},wrapperCol:{},colon:{type:Boolean,default:!0},labelAlign:{default:"right"},labelWrap:{type:Boolean},prefixCls:{},requiredMark:{},hideRequiredMark:{type:Boolean,default:!1},rules:{},validateMessages:{},validateOnRuleChange:{type:Boolean,default:!0},scrollToFirstError:{},onSubmit:{},name:{},validateTrigger:{default:"change"},size:{},disabled:{type:Boolean},onFieldsChange:{},onFinish:{},onFinishFailed:{},onValidate:{},initialValues:{},onValuesChange:{},syncToUrl:{type:[Boolean,Function]},syncToUrlPriority:{type:Boolean},collapse:{type:Boolean,default:void 0},defaultCollapse:{type:Boolean,default:!0},"onUpdate:collapse":{},searchText:{},resetText:{},onReset:{},customReset:{type:Boolean,default:!1},extraInAction:{type:Boolean,default:!1},forceExpand:{type:Boolean,default:!1},countPerRow:{default:4},submitLoading:{type:Boolean},maxRows:{default:2},sortable:{type:Boolean,default:!0},resizeTarget:{},loadingDelay:{default:300}},setup(p,{expose:O}){var V;const u=e.useSlots(),o=p,{b:f}=K.useNamespace("ap-form-search-form"),{t:B}=Q.useLocale(),D=G.useCountPerRow(o),g=e.ref(),L=e.ref();function F(){var a;const t=(a=g.value)==null?void 0:a.getFieldsValueTransformed(!0);S.execFunc(o.onSubmit,t)}function j(){var t,a;o.customReset||(a=(t=g.value)==null?void 0:t.resetFields)==null||a.call(t),S.execFunc(o.onReset)}const M=t=>P.isDef(t)?(w.isArray(t)?t:[t]).join(""):Date.now();let R=[];const m=e.shallowRef(T.genRealChildren(u.default())),i=e.shallowRef((V=u.extra)==null?void 0:V.call(u)),b=e.computed(()=>Math.floor(s/e.unref(D))),{items:y,sorted:k,handleClickConfirm:v}=J.useSorter(m);e.watch(()=>u.default(),t=>{R=m.value,m.value=S.diffFormItem(R,T.genRealChildren(t)),k.value=!1}),e.watch(()=>{var t;return(t=u.extra)==null?void 0:t.call(u)},t=>{i.value=t});const n=e.computed(()=>{const t=m.value,a=[],l=[],h=[],c=e.unref(b);let x=0,C=0;const z=s*o.maxRows-c*(e.unref(i)&&!o.extraInAction?2:1);t.forEach(N=>{const d=N.props;if(w.isBoolean(d.hidden)?!!d.hidden:P.isDef(d.hidden))a.push(N);else{let _=d.span||c;const A={node:N,span:_,key:`ApFormSearchFormItem-${M(d.name)}-${d._signal}`},I=s-x%s;I<_&&(_+=I),x+=_,x>z?l.push(A):(C=x,h.push(A))}});const q=s-(C+c)%s,$=C%s<c,H=q<c?s:q;return{hideNode:e.createVNode(e.Fragment,null,[a]),nodes:h,collapseNodes:l,extraSpan:H,lastRowOnlyIncludeActionAndExtra:$}}),U=e.computed(()=>{let t;const a=n.value.collapseNodes.length||o.sortable&&m.value.length,l=e.createVNode(r.Col,{span:e.unref(b),key:"actionWrapper"},{default:()=>[e.createVNode(E.default,null,{default:()=>[e.createVNode(r.Flex,{wrap:"wrap",justify:n.value.lastRowOnlyIncludeActionAndExtra&&!(e.unref(i)&&o.extraInAction)?"flex-end":"space-between"},{default:()=>[e.createVNode(r.Flex,{gap:8,wrap:"wrap"},{default:()=>[a?e.createVNode("div",{class:f("column-setting-trigger-wrapper")},[n.value.collapseNodes.length?e.createVNode(X.default,{onSubmit:F,config:n.value.collapseNodes,submitLoading:o.submitLoading},null):null,o.sortable&&y.value.length?e.createVNode(Y.default,{ref:"sorterIns",items:y.value,onClickConfirm:v,sorted:k.value},null):null]):null,e.createVNode(r.Button,{type:"primary",onClick:F,loading:o.submitLoading?{delay:o.loadingDelay}:!1,htmlType:"submit",class:f("action-btn")},{default:()=>[o.searchText||B("ap.apForm.search.search")]}),e.createVNode(r.Button,{onClick:j,type:"text",class:[f("action-btn"),f("action-btn-reset")]},{default:()=>[o.resetText||B("ap.apForm.search.reset")]})]}),o.extraInAction?e.unref(i):null]})]})]}),h=!o.extraInAction&&e.unref(i)?e.createVNode(r.Col,{span:n.value.extraSpan,key:"extraNode"},{default:()=>[e.createVNode(E.default,null,{default:()=>[e.createVNode(r.Flex,{justify:n.value.extraSpan===s||n.value.lastRowOnlyIncludeActionAndExtra?"start":"flex-end"},ee(t=e.unref(i))?t:{default:()=>[t]})]})]}):null,c=e.createVNode(r.Col,{span:n.value.extraSpan},null);return n.value.lastRowOnlyIncludeActionAndExtra?e.createVNode(e.Fragment,null,[h||c,l]):e.createVNode(e.Fragment,null,[l,h])});function W(){var a;const t=(a=L.value)==null?void 0:a.getCachedList();v(t)}return O({apForm:e.computed(()=>e.unref(g)),getSorterItems:()=>y.value,setSorterItems:v,resetSorterItems:W}),(t,a)=>(e.openBlock(),e.createBlock(Z.default,e.mergeProps({ref_key:"apForm",ref:g,class:e.unref(f)()},e.unref(w.omit)(o,["collapse","defaultCollapse","onUpdate:collapse","searchText","resetText","onSubmit","onReset","extraInAction","forceExpand","countPerRow"])),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.value.hideNode))),e.createVNode(e.unref(r.Row),{gutter:8},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value.nodes,l=>(e.openBlock(),e.createBlock(e.unref(r.Col),{key:l.key,span:l.span},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.node)))]),_:2},1032,["span"]))),128)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(U.value)))]),_:1})]),_:1},16,["class"]))}});exports.default=te;
|