@aplus-frontend/ui 0.5.23 → 0.5.25
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-action/group/index.vue.mjs +3 -3
- package/es/src/ap-action/item/index.vue2.mjs +5 -5
- package/es/src/ap-action/item-dropdown/index.vue.mjs +7 -7
- package/es/src/ap-action/item-modal/index.vue.mjs +2 -2
- package/es/src/ap-action/item-popconfirm/index.vue.mjs +2 -2
- package/es/src/ap-button/ap-action-button.vue.mjs +2 -2
- package/es/src/ap-button/ap-button.vue.mjs +2 -2
- package/es/src/ap-button/ap-confirm-button.vue.mjs +2 -2
- package/es/src/ap-descriptions/ap-descriptions.vue.mjs +4 -4
- package/es/src/ap-descriptions/help-message/index.vue2.mjs +4 -4
- package/es/src/ap-download/ap-download.vue.mjs +1 -1
- package/es/src/ap-field/checkbox/index.vue.mjs +1 -1
- package/es/src/ap-field/date/index.vue.mjs +4 -4
- package/es/src/ap-field/date-range/index.vue.mjs +8 -8
- package/es/src/ap-field/index.mjs +36 -36
- package/es/src/ap-field/number/index.vue.mjs +8 -8
- package/es/src/ap-field/radio/index.vue.mjs +1 -1
- package/es/src/ap-field/rate/index.vue.mjs +2 -2
- package/es/src/ap-field/segmented/index.vue.mjs +1 -1
- package/es/src/ap-field/select/index.vue.mjs +2 -2
- package/es/src/ap-field/select/use-select-options.d.ts +2 -2
- package/es/src/ap-field/slider/index.vue.mjs +4 -4
- package/es/src/ap-field/switch/index.vue.mjs +3 -3
- package/es/src/ap-field/text/index.vue2.mjs +2 -2
- package/es/src/ap-field/text/password.vue.mjs +2 -2
- package/es/src/ap-field/text-area/index.vue.mjs +3 -3
- package/es/src/ap-field/tree-select/index.vue.mjs +3 -3
- package/es/src/ap-field/tree-select/use-request.d.ts +4 -4
- package/es/src/ap-form/ap-form.vue.d.ts +4 -3
- package/es/src/ap-form/ap-form.vue2.mjs +124 -124
- package/es/src/ap-form/drawer-form/index.vue.d.ts +9 -8
- package/es/src/ap-form/drawer-form/index.vue.mjs +9 -9
- package/es/src/ap-form/interface.d.ts +3 -2
- package/es/src/ap-form/item/index.vue.mjs +7 -7
- package/es/src/ap-form/item-group/index.vue.mjs +3 -3
- package/es/src/ap-form/items/checkbox/index.vue.mjs +2 -2
- package/es/src/ap-form/items/date/index.vue.mjs +2 -2
- package/es/src/ap-form/items/date-range/index.vue.mjs +2 -2
- package/es/src/ap-form/items/number/index.vue.mjs +2 -2
- package/es/src/ap-form/items/radio/index.vue.mjs +2 -2
- package/es/src/ap-form/items/select/index.vue.d.ts +6 -6
- package/es/src/ap-form/items/select/index.vue.mjs +2 -2
- package/es/src/ap-form/items/switch/index.vue.mjs +2 -2
- package/es/src/ap-form/items/text/group.vue2.mjs +2 -2
- package/es/src/ap-form/items/text/index.vue2.mjs +2 -2
- package/es/src/ap-form/items/text/password.vue.mjs +2 -2
- package/es/src/ap-form/items/text-area/index.vue.mjs +2 -2
- package/es/src/ap-form/items/tree-select/index.vue.mjs +2 -2
- package/es/src/ap-form/modal-form/index.vue.d.ts +9 -8
- package/es/src/ap-form/modal-form/index.vue.mjs +7 -7
- package/es/src/ap-form/render/item.vue.mjs +2 -2
- package/es/src/ap-form/search-form/index.vue.d.ts +9 -8
- package/es/src/ap-form/search-form/index.vue.mjs +1 -1
- package/es/src/ap-form/set/index.vue.mjs +1 -1
- package/es/src/ap-grid/editable/form-item.vue.d.ts +4 -2
- package/es/src/ap-grid/editable/form-item.vue.mjs +65 -61
- package/es/src/ap-grid/editable/index.vue.d.ts +4 -2
- package/es/src/ap-grid/editable/index.vue.mjs +86 -81
- package/es/src/ap-grid/hooks/use-inner-params.mjs +3 -3
- package/es/src/ap-grid/index.vue.d.ts +4 -2
- package/es/src/ap-grid/index.vue.mjs +25 -25
- package/es/src/ap-grid/interface.d.ts +4 -0
- package/es/src/ap-grid/utils/table.d.ts +1 -1
- package/es/src/ap-grid/utils/table.mjs +42 -41
- package/es/src/ap-info-layout/ApInfoLayout.vue.mjs +2 -2
- package/es/src/ap-info-layout/ap-info-layout-admin/ApInfoLayoutAdmin.vue2.mjs +2 -2
- package/es/src/ap-info-layout/ap-info-layout-aplus/ap-info-layout.vue2.mjs +1 -1
- package/es/src/ap-list/index.vue.d.ts +4 -2
- package/es/src/ap-list/index.vue.mjs +4 -4
- package/es/src/ap-modal/utils/confirm.d.ts +1 -1
- package/es/src/ap-table/ap-table.vue.d.ts +4 -2
- package/es/src/ap-table/ap-table.vue2.mjs +13 -13
- package/es/src/ap-table/components/dynamic-component/index.vue2.mjs +2 -2
- package/es/src/ap-table/components/index/index.vue2.mjs +2 -2
- package/es/src/ap-table/components/paragraph-ellipsis/index.vue2.mjs +3 -3
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +3 -3
- package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +1 -1
- package/es/src/ap-table/components/setting/sortable/index.vue2.mjs +1 -1
- package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +1 -1
- package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +11 -11
- package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +1 -1
- package/es/src/ap-table/components/status/index.vue2.mjs +2 -2
- package/es/src/ap-table/constants.d.ts +5 -5
- package/es/src/ap-table/constants.mjs +45 -45
- package/es/src/ap-table/hooks/use-table-column-state.d.ts +4 -4
- package/es/src/ap-table/hooks/use-table-column-state.mjs +3 -3
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +108 -102
- package/es/src/ap-table/utils.d.ts +5 -5
- package/es/src/ap-tag/ap-tag-group.vue.mjs +8 -8
- package/es/src/ap-tag/ap-tag.vue.mjs +2 -2
- package/es/src/ap-upload/apUpload.vue.mjs +5 -5
- package/es/src/ap-upload/components/MultipleFile.vue.d.ts +1 -1
- package/es/src/ap-upload/components/MultipleFile.vue2.mjs +3 -3
- package/es/src/ap-upload/components/Picture.vue.d.ts +7 -2
- package/es/src/ap-upload/components/Picture.vue2.mjs +6 -6
- package/es/src/ap-upload/components/SingleFile.vue2.mjs +7 -7
- package/es/src/business/ap-appendix/ap-appendix.vue2.mjs +1 -1
- package/es/src/business/ap-appendix/icons/file-icon.vue.mjs +2 -2
- package/es/src/business/ap-batch-action/ApBatchAction.vue2.mjs +2 -2
- package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +10 -10
- package/es/src/business/ap-batch-action-group/MenuItemGroup.vue2.mjs +1 -1
- package/es/src/business/ap-batch-action-group/index.d.ts +3 -3
- package/es/src/business/ap-button-group/ApButtonGroup.vue2.mjs +1 -1
- package/es/src/business/ap-card/ApCard.vue2.mjs +7 -7
- package/es/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +4 -2
- package/es/src/business/ap-expand-alert/ApExpandAlert.vue2.mjs +11 -11
- package/es/src/business/ap-expand-alert/index.d.ts +6 -4
- package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +9 -9
- package/es/src/business/ap-group-search/ap-group-search.vue2.mjs +5 -5
- package/es/src/business/ap-group-search/extension-select/index.vue2.mjs +4 -4
- package/es/src/business/ap-group-search/images/icon-down.vue.mjs +2 -2
- package/es/src/business/ap-group-search/images/icon-line-select.vue.mjs +2 -2
- package/es/src/business/ap-group-search/popover-select/index.vue2.mjs +2 -2
- package/es/src/business/ap-image/ApImage.vue2.mjs +1 -1
- package/es/src/business/ap-input-radio/ApInputRadio.vue2.mjs +2 -2
- package/es/src/business/ap-ladder/ApLadder.vue.d.ts +1 -83
- package/es/src/business/ap-ladder/ApLadder.vue2.mjs +34 -59
- package/es/src/business/ap-ladder/components/SimpleMode.vue.d.ts +3 -65
- package/es/src/business/ap-ladder/components/SimpleMode.vue2.mjs +34 -99
- package/es/src/business/ap-ladder/components/ValueGroupMode.vue.d.ts +3 -75
- package/es/src/business/ap-ladder/components/ValueGroupMode.vue2.mjs +68 -195
- package/es/src/business/ap-ladder/index.d.ts +1 -235
- package/es/src/business/ap-ladder/interface.d.ts +4 -114
- package/es/src/business/ap-ladder/utils.d.ts +5 -0
- package/es/src/business/ap-ladder/utils.mjs +38 -3
- package/es/src/business/ap-product-info/ApProductInfo.d.ts +46 -0
- package/es/src/business/ap-product-info/constans.d.ts +23 -0
- package/es/src/business/ap-product-info/index.d.ts +1 -0
- package/es/src/business/ap-product-info/interface.d.ts +11 -0
- package/es/src/business/ap-select-layout/index.d.ts +4 -2
- package/es/src/business/ap-select-layout/select-layout.vue.d.ts +4 -2
- package/es/src/business/ap-select-layout/select-layout.vue2.mjs +4 -4
- package/es/src/business/ap-status/ApStatus.vue2.mjs +8 -8
- package/es/src/business/ap-status/group/ApStatusGroup.vue2.mjs +4 -4
- package/es/src/business/ap-summary/ap-summary.vue2.mjs +1 -1
- package/es/src/business/ap-table-modal/modal-title.vue2.mjs +2 -2
- package/es/src/business/ap-table-modal/table-layout/index.vue2.mjs +14 -14
- package/es/src/business/ap-table-modal/table-modal.vue2.mjs +3 -3
- package/es/src/business/ap-title/ApTitle.vue2.mjs +7 -7
- package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs +1 -1
- package/es/src/business/ap-upload-file/icon/delete-icon.vue.mjs +2 -2
- package/es/src/business/ap-upload-file/icon/file-icon.vue.mjs +2 -2
- package/es/src/business/batch-input-group/form-item.vue.mjs +2 -2
- package/es/src/business/batch-input-group/index.vue.mjs +1 -1
- package/es/src/business/batch-input-group/popover-input/index.vue2.mjs +2 -2
- package/es/src/check-card/index.vue2.mjs +3 -3
- package/es/src/config-provider/hooks/use-namespace.d.ts +1 -5
- package/es/src/editable-table/form-item.vue.d.ts +4 -2
- package/es/src/editable-table/form-item.vue.mjs +2 -2
- package/es/src/editable-table/index.vue.d.ts +4 -2
- package/es/src/editable-table/index.vue.mjs +2 -2
- package/es/src/full-screen/index.vue.mjs +3 -3
- package/es/src/hooks/useFullScreen.mjs +5 -5
- package/es/src/mask/index.vue.mjs +10 -10
- package/es/src/portal/index.vue.mjs +2 -2
- package/es/src/scroll-bar/index.vue.mjs +3 -3
- package/es/src/scroll-bar/internal.vue.mjs +2 -2
- package/es/src/scroll-view/index.vue.d.ts +5 -5
- package/es/src/scroll-view/index.vue.mjs +9 -9
- package/es/src/tests/wrapper.d.ts +4 -4
- package/es/src/text/group.vue.mjs +2 -2
- package/es/src/text/index.vue.mjs +4 -4
- package/es/src/work-order-modal/help-message.vue2.mjs +2 -2
- package/es/src/work-order-modal/work-order-modal.vue.d.ts +6 -5
- package/es/src/work-order-modal/work-order-modal.vue.mjs +2 -2
- package/lib/src/ap-action/item-dropdown/index.vue.js +1 -1
- package/lib/src/ap-field/index.js +1 -1
- package/lib/src/ap-field/select/use-select-options.d.ts +2 -2
- package/lib/src/ap-field/tree-select/use-request.d.ts +4 -4
- package/lib/src/ap-form/ap-form.vue.d.ts +4 -3
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/drawer-form/index.vue.d.ts +9 -8
- package/lib/src/ap-form/interface.d.ts +3 -2
- package/lib/src/ap-form/items/select/index.vue.d.ts +6 -6
- package/lib/src/ap-form/modal-form/index.vue.d.ts +9 -8
- package/lib/src/ap-form/search-form/index.vue.d.ts +9 -8
- package/lib/src/ap-grid/editable/form-item.vue.d.ts +4 -2
- package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ap-grid/editable/index.vue.d.ts +4 -2
- package/lib/src/ap-grid/editable/index.vue.js +1 -1
- package/lib/src/ap-grid/index.vue.d.ts +4 -2
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/interface.d.ts +4 -0
- package/lib/src/ap-grid/utils/table.d.ts +1 -1
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-list/index.vue.d.ts +4 -2
- package/lib/src/ap-modal/utils/confirm.d.ts +1 -1
- package/lib/src/ap-table/ap-table.vue.d.ts +4 -2
- package/lib/src/ap-table/constants.d.ts +5 -5
- package/lib/src/ap-table/constants.js +1 -1
- package/lib/src/ap-table/hooks/use-table-column-state.d.ts +4 -4
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/ap-table/utils.d.ts +5 -5
- package/lib/src/ap-upload/apUpload.vue.js +1 -1
- package/lib/src/ap-upload/components/MultipleFile.vue.d.ts +1 -1
- package/lib/src/ap-upload/components/Picture.vue.d.ts +7 -2
- package/lib/src/business/ap-batch-action-group/index.d.ts +3 -3
- package/lib/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +4 -2
- package/lib/src/business/ap-expand-alert/index.d.ts +6 -4
- package/lib/src/business/ap-ladder/ApLadder.vue.d.ts +1 -83
- package/lib/src/business/ap-ladder/ApLadder.vue2.js +1 -1
- package/lib/src/business/ap-ladder/components/SimpleMode.vue.d.ts +3 -65
- package/lib/src/business/ap-ladder/components/SimpleMode.vue2.js +1 -1
- package/lib/src/business/ap-ladder/components/ValueGroupMode.vue.d.ts +3 -75
- package/lib/src/business/ap-ladder/components/ValueGroupMode.vue2.js +1 -1
- package/lib/src/business/ap-ladder/index.d.ts +1 -235
- package/lib/src/business/ap-ladder/interface.d.ts +4 -114
- package/lib/src/business/ap-ladder/utils.d.ts +5 -0
- package/lib/src/business/ap-ladder/utils.js +1 -1
- package/lib/src/business/ap-product-info/ApProductInfo.d.ts +46 -0
- package/lib/src/business/ap-product-info/constans.d.ts +23 -0
- package/lib/src/business/ap-product-info/index.d.ts +1 -0
- package/lib/src/business/ap-product-info/interface.d.ts +11 -0
- package/lib/src/business/ap-select-layout/index.d.ts +4 -2
- package/lib/src/business/ap-select-layout/select-layout.vue.d.ts +4 -2
- package/lib/src/config-provider/hooks/use-namespace.d.ts +1 -5
- package/lib/src/editable-table/form-item.vue.d.ts +4 -2
- package/lib/src/editable-table/index.vue.d.ts +4 -2
- package/lib/src/scroll-view/index.vue.d.ts +5 -5
- package/lib/src/tests/wrapper.d.ts +4 -4
- package/lib/src/work-order-modal/work-order-modal.vue.d.ts +6 -5
- package/package.json +3 -3
- package/theme/ap-grid/index.css +3 -0
- package/theme/ap-grid/index.less +3 -0
- package/theme/ap-ladder/ap-ladder.css +14 -5
- package/theme/ap-ladder/ap-ladder.less +16 -7
- package/theme/index.css +17 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isVNode as E, defineComponent as F, useSlots as K, ref as U, computed as z, unref as o, createVNode as d, Fragment as S,
|
|
1
|
+
import { isVNode as E, defineComponent as F, useSlots as K, ref as U, computed as z, unref as o, createVNode as d, Fragment as S, openBlock as w, createBlock as C, resolveDynamicComponent as M, mergeProps as j, createSlots as q, renderList as O, withCtx as x, renderSlot as $, normalizeProps as H, guardReactiveProps as W } from "vue";
|
|
2
2
|
import { Space as G, Tag as J, TreeSelect as Q, Spin as X } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../../hooks/index.mjs";
|
|
4
4
|
import { isArray as Y, omit as Z } from "lodash-unified";
|
|
@@ -220,9 +220,9 @@ const ie = /* @__PURE__ */ F({
|
|
|
220
220
|
request: h,
|
|
221
221
|
focus: P,
|
|
222
222
|
blur: L
|
|
223
|
-
}), (e, t) => e.mode === "read" ? (
|
|
223
|
+
}), (e, t) => e.mode === "read" ? (w(), C(M(I.value), {
|
|
224
224
|
key: 0
|
|
225
|
-
})) : (
|
|
225
|
+
})) : (w(), C(o(Q), j({
|
|
226
226
|
key: 1
|
|
227
227
|
}, o(Z)(a, ["onUpdate:value", "value", "treeData", "loadData"]), {
|
|
228
228
|
ref_key: "treeSelectRef",
|
|
@@ -8,14 +8,14 @@ export declare const useRequest: (props: ApFieldTreeSelectProps) => {
|
|
|
8
8
|
disabled?: boolean | undefined;
|
|
9
9
|
checkable?: boolean | undefined;
|
|
10
10
|
disableCheckbox?: boolean | undefined;
|
|
11
|
-
children?:
|
|
11
|
+
children?: any[] | undefined;
|
|
12
12
|
} | {
|
|
13
13
|
[x: string]: any;
|
|
14
14
|
value?: RawValueType | undefined;
|
|
15
15
|
title?: any;
|
|
16
16
|
label?: any;
|
|
17
17
|
key?: Key | undefined;
|
|
18
|
-
children?:
|
|
18
|
+
children?: any[] | undefined;
|
|
19
19
|
disabled?: boolean | undefined;
|
|
20
20
|
checkable?: boolean | undefined;
|
|
21
21
|
disableCheckbox?: boolean | undefined;
|
|
@@ -24,14 +24,14 @@ export declare const useRequest: (props: ApFieldTreeSelectProps) => {
|
|
|
24
24
|
disabled?: boolean | undefined;
|
|
25
25
|
checkable?: boolean | undefined;
|
|
26
26
|
disableCheckbox?: boolean | undefined;
|
|
27
|
-
children?:
|
|
27
|
+
children?: any[] | undefined;
|
|
28
28
|
} | {
|
|
29
29
|
[x: string]: any;
|
|
30
30
|
value?: RawValueType | undefined;
|
|
31
31
|
title?: any;
|
|
32
32
|
label?: any;
|
|
33
33
|
key?: Key | undefined;
|
|
34
|
-
children?:
|
|
34
|
+
children?: any[] | undefined;
|
|
35
35
|
disabled?: boolean | undefined;
|
|
36
36
|
checkable?: boolean | undefined;
|
|
37
37
|
disableCheckbox?: boolean | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ApFormProps, WatchFunc, ApFormInternalInstance } from './interface';
|
|
2
|
-
import { InternalNamePath, NamePath, ValidateOptions, FormLabelAlign, ValidateMessages, FieldData, ValidateErrorEntity } from '@aplus-frontend/antdv/es/form/interface';
|
|
1
|
+
import { ApFormProps, UpdateModelOptimizeFn, WatchFunc, ApFormInternalInstance } from './interface';
|
|
2
|
+
import { InternalNamePath, NamePath, ValidateOptions, FormLabelAlign, RuleObject, ValidateMessages, FieldData, ValidateErrorEntity } from '@aplus-frontend/antdv/es/form/interface';
|
|
3
3
|
import { Recordable } from '../type';
|
|
4
4
|
import { CreateComponentPublicInstanceWithMixins, ExtractPropTypes, PropType, HTMLAttributes, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, DefineComponent } from 'vue';
|
|
5
5
|
import { VueTypeDef, VueTypeValidableDef } from '../../node_modules/vue-types';
|
|
@@ -7,6 +7,7 @@ import { ColSize } from '@aplus-frontend/antdv/es/grid';
|
|
|
7
7
|
import { RequiredMark } from '@aplus-frontend/antdv/es/form/Form';
|
|
8
8
|
import { RuleObject } from '@aplus-frontend/antdv/es/form';
|
|
9
9
|
import { Options } from '../../node_modules/scroll-into-view-if-needed';
|
|
10
|
+
import { SizeType } from '@aplus-frontend/antdv/es/config-provider';
|
|
10
11
|
import { SizeType } from '@aplus-frontend/antdv/es/button';
|
|
11
12
|
import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
|
|
12
13
|
declare function __VLS_template(): {
|
|
@@ -655,7 +656,7 @@ declare function __VLS_template(): {
|
|
|
655
656
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
656
657
|
declare const __VLS_component: DefineComponent<ApFormProps, {
|
|
657
658
|
setFieldsValue: (fields: Partial<any>) => void;
|
|
658
|
-
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
|
|
659
|
+
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean, optimizeFn?: UpdateModelOptimizeFn) => void;
|
|
659
660
|
resetFields: () => Promise<void>;
|
|
660
661
|
clearValidate: (name?: NamePath) => void;
|
|
661
662
|
validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Form as
|
|
3
|
-
import { useProvideForm as
|
|
4
|
-
import { isArray as f, cloneDeep as ae, isFunction as
|
|
1
|
+
import { defineComponent as Q, ref as j, reactive as X, unref as p, nextTick as Y, toRaw as x, watch as Z, onWatcherCleanup as z, computed as ee, openBlock as te, createBlock as re, mergeProps as le, withCtx as oe, renderSlot as se } from "vue";
|
|
2
|
+
import { Form as ie } from "@aplus-frontend/antdv";
|
|
3
|
+
import { useProvideForm as ne } from "./context.mjs";
|
|
4
|
+
import { isArray as f, cloneDeep as ae, isFunction as _, isPlainObject as B, omit as ue } from "lodash-unified";
|
|
5
5
|
import { useUrlSearchParams as ce } from "@vueuse/core";
|
|
6
6
|
import { INTERNAL_FORM_INSTANCE_MARK as fe } from "./constant.mjs";
|
|
7
|
-
import { getRouteType as de, isDef as
|
|
8
|
-
import
|
|
9
|
-
import { genParams as
|
|
10
|
-
import { useInjectFormProvider as
|
|
11
|
-
const Re = /* @__PURE__ */
|
|
7
|
+
import { getRouteType as de, isDef as V } from "../utils/index.mjs";
|
|
8
|
+
import ge from "./utils/set.mjs";
|
|
9
|
+
import { genParams as M, setToParams as E } from "./utils/params.mjs";
|
|
10
|
+
import { useInjectFormProvider as Fe } from "./provider/context.mjs";
|
|
11
|
+
const Re = /* @__PURE__ */ Q({
|
|
12
12
|
__name: "ap-form",
|
|
13
13
|
props: {
|
|
14
14
|
layout: { default: "horizontal" },
|
|
@@ -38,197 +38,197 @@ const Re = /* @__PURE__ */ J({
|
|
|
38
38
|
syncToUrl: { type: [Boolean, Function], default: !1 },
|
|
39
39
|
syncToUrlPriority: { type: Boolean }
|
|
40
40
|
},
|
|
41
|
-
setup(
|
|
42
|
-
function
|
|
43
|
-
return f(t) ? t.reduce((r,
|
|
41
|
+
setup(A, { expose: C }) {
|
|
42
|
+
function N(e, t) {
|
|
43
|
+
return f(t) ? t.reduce((r, o) => r == null ? void 0 : r[o], e) : e == null ? void 0 : e[t];
|
|
44
44
|
}
|
|
45
|
-
const
|
|
46
|
-
function
|
|
47
|
-
var
|
|
45
|
+
const l = A;
|
|
46
|
+
function v(e, t, r = !0, o) {
|
|
47
|
+
var s;
|
|
48
48
|
if (f(e)) {
|
|
49
|
-
let
|
|
50
|
-
for (let
|
|
51
|
-
e[
|
|
52
|
-
|
|
49
|
+
let a = n;
|
|
50
|
+
for (let d = 0; d < e.length - 1; d++)
|
|
51
|
+
e[d] in a || (a[e[d]] = {}), a = a[e[d]];
|
|
52
|
+
o ? o(a, e[e.length - 1]) : a[e[e.length - 1]] = t;
|
|
53
53
|
} else
|
|
54
|
-
|
|
54
|
+
o ? o(n, e) : n[e] = t;
|
|
55
55
|
let i = f(e) ? e[0] : e;
|
|
56
56
|
if (r) {
|
|
57
|
-
const
|
|
58
|
-
|
|
57
|
+
const a = { [i]: n[i] };
|
|
58
|
+
y.triggerFormChange(l.name, a), (s = l.onValuesChange) == null || s.call(l, a, n, e);
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
T();
|
|
61
61
|
}
|
|
62
|
-
const
|
|
63
|
-
|
|
62
|
+
const u = j(), I = ce(de()), y = Fe(), P = j(
|
|
63
|
+
l.syncToUrl ? M(l.syncToUrl, I, "get") : {}
|
|
64
64
|
);
|
|
65
|
-
let m = ae(
|
|
66
|
-
const
|
|
65
|
+
let m = ae(b()), g = {};
|
|
66
|
+
const n = X(b());
|
|
67
67
|
let F = [];
|
|
68
|
-
function
|
|
69
|
-
const e =
|
|
70
|
-
return
|
|
68
|
+
function b() {
|
|
69
|
+
const e = l.initialValues || {};
|
|
70
|
+
return l.syncToUrlPriority ? {
|
|
71
71
|
...e,
|
|
72
|
-
...
|
|
72
|
+
...p(P)
|
|
73
73
|
} : {
|
|
74
|
-
...
|
|
74
|
+
...p(P),
|
|
75
75
|
...e
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function S(e) {
|
|
79
79
|
var r;
|
|
80
|
-
const t =
|
|
81
|
-
|
|
80
|
+
const t = h(e, g);
|
|
81
|
+
y.triggerFormFinish(l.name, e), l.syncToUrl && E(I, M(l.syncToUrl, t, "set")), (r = l.onFinish) == null || r.call(l, t);
|
|
82
82
|
}
|
|
83
|
-
const
|
|
83
|
+
const W = async () => {
|
|
84
84
|
var e;
|
|
85
|
-
(e =
|
|
86
|
-
Object.keys(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
(e = u.value) == null || e.resetFields(), await Y(() => {
|
|
86
|
+
Object.keys(n).forEach((t) => delete n[t]), Object.assign(n, m), T(), l.syncToUrl && E(
|
|
87
|
+
I,
|
|
88
|
+
M(
|
|
89
|
+
l.syncToUrl,
|
|
90
|
+
h(m, g),
|
|
91
91
|
"set"
|
|
92
92
|
)
|
|
93
93
|
);
|
|
94
94
|
});
|
|
95
|
-
},
|
|
95
|
+
}, q = (e) => {
|
|
96
96
|
var t;
|
|
97
|
-
(t =
|
|
98
|
-
},
|
|
97
|
+
(t = u.value) == null || t.clearValidate(e);
|
|
98
|
+
}, D = (e, t) => {
|
|
99
99
|
var r;
|
|
100
|
-
return (r =
|
|
101
|
-
},
|
|
102
|
-
var
|
|
103
|
-
const r = await ((
|
|
100
|
+
return (r = u.value) == null ? void 0 : r.validateFields(e, t);
|
|
101
|
+
}, L = async (e, t) => {
|
|
102
|
+
var o;
|
|
103
|
+
const r = await ((o = u.value) == null ? void 0 : o.validateFields(
|
|
104
104
|
e,
|
|
105
105
|
t
|
|
106
106
|
));
|
|
107
|
-
return
|
|
108
|
-
},
|
|
107
|
+
return h(r, g);
|
|
108
|
+
}, k = (e) => {
|
|
109
109
|
var t;
|
|
110
|
-
return (t =
|
|
111
|
-
},
|
|
110
|
+
return (t = u.value) == null ? void 0 : t.getFieldsValue(e);
|
|
111
|
+
}, K = (e) => {
|
|
112
112
|
var r;
|
|
113
|
-
const t = (r =
|
|
114
|
-
return
|
|
115
|
-
},
|
|
113
|
+
const t = (r = u.value) == null ? void 0 : r.getFieldsValue(e);
|
|
114
|
+
return h(t, g);
|
|
115
|
+
}, $ = (e, t) => {
|
|
116
116
|
var r;
|
|
117
|
-
return (r =
|
|
118
|
-
},
|
|
117
|
+
return (r = u.value) == null ? void 0 : r.validate(e, t);
|
|
118
|
+
}, G = (e, t = {}) => {
|
|
119
119
|
var r;
|
|
120
|
-
(r =
|
|
121
|
-
},
|
|
122
|
-
Object.assign(
|
|
123
|
-
},
|
|
124
|
-
|
|
120
|
+
(r = u.value) == null || r.scrollToField(e, t);
|
|
121
|
+
}, H = (e) => {
|
|
122
|
+
Object.assign(n, e), T();
|
|
123
|
+
}, U = (e, t, r = !0, o) => {
|
|
124
|
+
v(e, t, r, o), T();
|
|
125
125
|
};
|
|
126
|
-
function
|
|
127
|
-
return t || e(
|
|
126
|
+
function R(e, t) {
|
|
127
|
+
return t || e(x(n)), F.push(e), () => {
|
|
128
128
|
F = F.filter((r) => r !== e);
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
if (
|
|
133
|
-
const
|
|
134
|
-
if (!
|
|
135
|
-
if (
|
|
136
|
-
let
|
|
137
|
-
for (let
|
|
138
|
-
|
|
139
|
-
|
|
131
|
+
function w({ initialValue: e, name: t, transform: r }) {
|
|
132
|
+
if (V(e) && V(t)) {
|
|
133
|
+
const o = N(p(P), t);
|
|
134
|
+
if (!V(o) || !l.syncToUrlPriority)
|
|
135
|
+
if (v(t, e, !1), f(t)) {
|
|
136
|
+
let i = m;
|
|
137
|
+
for (let s = 0; s < t.length - 1; s++)
|
|
138
|
+
V(i[t[s]]) || (i[t[s]] = {}), i = i[t[s]];
|
|
139
|
+
i[t[t.length - 1]] = e;
|
|
140
140
|
} else
|
|
141
141
|
m[t] = e;
|
|
142
142
|
}
|
|
143
|
-
r && (
|
|
144
|
-
|
|
143
|
+
r && (g = ge(
|
|
144
|
+
g,
|
|
145
145
|
[t].flat(1),
|
|
146
146
|
r,
|
|
147
147
|
!0
|
|
148
148
|
));
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function J(e) {
|
|
151
151
|
if (e !== fe) {
|
|
152
152
|
console.warn("getInternalInstance should only used at internal");
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
155
|
return {
|
|
156
|
-
registerField:
|
|
157
|
-
registerWatch:
|
|
158
|
-
setFieldValue:
|
|
156
|
+
registerField: w,
|
|
157
|
+
registerWatch: R,
|
|
158
|
+
setFieldValue: U
|
|
159
159
|
};
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function T() {
|
|
162
162
|
if (F.length) {
|
|
163
|
-
const e =
|
|
163
|
+
const e = x(n);
|
|
164
164
|
F.forEach((t) => {
|
|
165
165
|
t(e);
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function h(e, t) {
|
|
170
170
|
if (e == null)
|
|
171
171
|
return;
|
|
172
172
|
let r = f(e) ? [] : {};
|
|
173
|
-
return Object.keys(e).forEach((
|
|
174
|
-
const
|
|
175
|
-
if (
|
|
176
|
-
const c =
|
|
177
|
-
|
|
173
|
+
return Object.keys(e).forEach((o) => {
|
|
174
|
+
const i = e[o], s = t == null ? void 0 : t[o], a = _(s) ? s : s == null ? void 0 : s.transformer, d = _(s) ? !0 : s == null ? void 0 : s.flat;
|
|
175
|
+
if (_(a)) {
|
|
176
|
+
const c = a(i);
|
|
177
|
+
d ? f(c) && f(r) ? r = [...r, ...c] : B(c) && B(r) ? r = {
|
|
178
178
|
...r,
|
|
179
179
|
...c
|
|
180
|
-
} : r[
|
|
181
|
-
} else if (
|
|
182
|
-
const c =
|
|
183
|
-
|
|
184
|
-
|
|
180
|
+
} : r[o] = c : r[o] = c;
|
|
181
|
+
} else if (B(i) || f(i)) {
|
|
182
|
+
const c = h(
|
|
183
|
+
i,
|
|
184
|
+
s
|
|
185
185
|
);
|
|
186
|
-
r[
|
|
186
|
+
r[o] = c;
|
|
187
187
|
} else
|
|
188
|
-
r[
|
|
188
|
+
r[o] = i;
|
|
189
189
|
}), r;
|
|
190
190
|
}
|
|
191
|
-
const
|
|
192
|
-
resetFields:
|
|
193
|
-
clearValidate:
|
|
194
|
-
validateFields:
|
|
195
|
-
getFieldsValue:
|
|
196
|
-
validate:
|
|
197
|
-
scrollToField:
|
|
198
|
-
setFieldsValue:
|
|
199
|
-
setFieldValue:
|
|
200
|
-
registerWatch:
|
|
201
|
-
validateFieldsReturnTransformed:
|
|
202
|
-
getFieldsValueTransformed:
|
|
203
|
-
getInternalInstance:
|
|
191
|
+
const O = {
|
|
192
|
+
resetFields: W,
|
|
193
|
+
clearValidate: q,
|
|
194
|
+
validateFields: D,
|
|
195
|
+
getFieldsValue: k,
|
|
196
|
+
validate: $,
|
|
197
|
+
scrollToField: G,
|
|
198
|
+
setFieldsValue: H,
|
|
199
|
+
setFieldValue: U,
|
|
200
|
+
registerWatch: R,
|
|
201
|
+
validateFieldsReturnTransformed: L,
|
|
202
|
+
getFieldsValueTransformed: K,
|
|
203
|
+
getInternalInstance: J
|
|
204
204
|
};
|
|
205
|
-
return
|
|
206
|
-
() =>
|
|
205
|
+
return Z(
|
|
206
|
+
() => l.name,
|
|
207
207
|
(e) => {
|
|
208
|
-
e && (
|
|
209
|
-
|
|
208
|
+
e && (y.registerForm(e, O), z(() => {
|
|
209
|
+
y.unregisterForm(l.name);
|
|
210
210
|
}));
|
|
211
211
|
},
|
|
212
212
|
{
|
|
213
213
|
immediate: !0
|
|
214
214
|
}
|
|
215
|
-
),
|
|
216
|
-
model: ee(() =>
|
|
217
|
-
updateModel:
|
|
215
|
+
), ne({
|
|
216
|
+
model: ee(() => n),
|
|
217
|
+
updateModel: v,
|
|
218
218
|
internalInstance: {
|
|
219
|
-
registerWatch:
|
|
220
|
-
registerField:
|
|
221
|
-
setFieldValue:
|
|
219
|
+
registerWatch: R,
|
|
220
|
+
registerField: w,
|
|
221
|
+
setFieldValue: U
|
|
222
222
|
}
|
|
223
|
-
}),
|
|
223
|
+
}), C(O), (e, t) => (te(), re(p(ie), le({
|
|
224
224
|
ref_key: "formRef",
|
|
225
|
-
ref:
|
|
226
|
-
},
|
|
227
|
-
model:
|
|
228
|
-
onFinish:
|
|
225
|
+
ref: u
|
|
226
|
+
}, p(ue)(l, ["initialValues", "onValuesChange", "onFinish"]), {
|
|
227
|
+
model: n,
|
|
228
|
+
onFinish: S
|
|
229
229
|
}), {
|
|
230
230
|
default: oe(() => [
|
|
231
|
-
|
|
231
|
+
se(e.$slots, "default")
|
|
232
232
|
]),
|
|
233
233
|
_: 3
|
|
234
234
|
}, 16, ["model"]));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApFormDrawerFormProps, CustomizeResizeType } from '../interface';
|
|
2
2
|
import { VNode, ComponentInternalInstance, ExtractPropTypes, PropType, HTMLAttributes, VNodeProps, AllowedComponentProps, ComponentCustomProps, CreateComponentPublicInstanceWithMixins, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, Slot, ComponentPublicInstance, ComponentOptionsBase, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties, DefineComponent, CSSProperties } from 'vue';
|
|
3
|
-
import { InternalNamePath, NamePath, ValidateOptions, ValidateMessages, FormLabelAlign, FieldData, ValidateErrorEntity } from '@aplus-frontend/antdv/es/form/interface';
|
|
3
|
+
import { InternalNamePath, NamePath, ValidateOptions, ValidateMessages, FormLabelAlign, FieldData, ValidateErrorEntity, RuleObject } from '@aplus-frontend/antdv/es/form/interface';
|
|
4
4
|
import { ButtonSize, SizeType } from '@aplus-frontend/antdv/es/button';
|
|
5
5
|
import { RequiredMark } from '@aplus-frontend/antdv/es/form/Form';
|
|
6
6
|
import { ColSize } from '@aplus-frontend/antdv/es/grid';
|
|
@@ -8,8 +8,9 @@ import { RuleObject } from '@aplus-frontend/antdv/es/form';
|
|
|
8
8
|
import { Options } from '../../../node_modules/scroll-into-view-if-needed';
|
|
9
9
|
import { Recordable } from '../../type';
|
|
10
10
|
import { VueTypeDef, VueTypeValidableDef } from '../../../node_modules/vue-types';
|
|
11
|
+
import { SizeType } from '@aplus-frontend/antdv/es/config-provider';
|
|
11
12
|
import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
|
|
12
|
-
import { ApFormProps, ApFormInternalInstance, WatchFunc, ApFormSubmitterConfig } from '..';
|
|
13
|
+
import { ApFormProps, UpdateModelOptimizeFn, ApFormInternalInstance, WatchFunc, ApFormSubmitterConfig } from '..';
|
|
13
14
|
import { OnCleanup } from '@vue/reactivity';
|
|
14
15
|
import { PushState } from '@aplus-frontend/antdv/es/drawer';
|
|
15
16
|
import { MouseEventHandler, KeyboardEventHandler } from '@aplus-frontend/antdv/es/_util/EventInterface';
|
|
@@ -117,7 +118,7 @@ declare function __VLS_template(): {
|
|
|
117
118
|
readonly onValidate?: ((name: string | number | string[] | number[], status: boolean, errors: string[]) => void) | undefined;
|
|
118
119
|
readonly initialValues?: Recordable | undefined;
|
|
119
120
|
readonly onValuesChange?: ((changedValues: Recordable, allValues: Recordable, fieldName: NamePath) => void) | undefined;
|
|
120
|
-
readonly syncToUrl?: boolean | ((values: Recordable, type: "get" | "set") => Recordable) | undefined;
|
|
121
|
+
readonly syncToUrl?: (boolean | ((values: Recordable, type: "get" | "set") => Recordable)) | undefined;
|
|
121
122
|
readonly syncToUrlPriority?: boolean | undefined;
|
|
122
123
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
123
124
|
$attrs: {
|
|
@@ -771,7 +772,7 @@ declare function __VLS_template(): {
|
|
|
771
772
|
$el: any;
|
|
772
773
|
$options: ComponentOptionsBase<Readonly< ApFormProps> & Readonly<{}>, {
|
|
773
774
|
setFieldsValue: (fields: Partial<any>) => void;
|
|
774
|
-
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
|
|
775
|
+
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean, optimizeFn?: UpdateModelOptimizeFn) => void;
|
|
775
776
|
resetFields: () => Promise<void>;
|
|
776
777
|
clearValidate: (name?: NamePath) => void;
|
|
777
778
|
validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
|
|
@@ -820,7 +821,7 @@ declare function __VLS_template(): {
|
|
|
820
821
|
syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
|
|
821
822
|
}> & Omit<Readonly< ApFormProps> & Readonly<{}>, "validate" | "resetFields" | "clearValidate" | "validateFields" | "getFieldsValue" | "scrollToField" | "registerWatch" | "setFieldValue" | ("layout" | "colon" | "labelAlign" | "validateTrigger" | "hideRequiredMark" | "validateOnRuleChange" | "syncToUrl") | "setFieldsValue" | "getInternalInstance" | "validateFieldsReturnTransformed" | "getFieldsValueTransformed"> & ShallowUnwrapRef<{
|
|
822
823
|
setFieldsValue: (fields: Partial<any>) => void;
|
|
823
|
-
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
|
|
824
|
+
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean, optimizeFn?: UpdateModelOptimizeFn) => void;
|
|
824
825
|
resetFields: () => Promise<void>;
|
|
825
826
|
clearValidate: (name?: NamePath) => void;
|
|
826
827
|
validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
|
|
@@ -1059,7 +1060,7 @@ declare const __VLS_component: DefineComponent<ApFormDrawerFormProps, {
|
|
|
1059
1060
|
readonly onValidate?: ((name: string | number | string[] | number[], status: boolean, errors: string[]) => void) | undefined;
|
|
1060
1061
|
readonly initialValues?: Recordable | undefined;
|
|
1061
1062
|
readonly onValuesChange?: ((changedValues: Recordable, allValues: Recordable, fieldName: NamePath) => void) | undefined;
|
|
1062
|
-
readonly syncToUrl?: boolean | ((values: Recordable, type: "get" | "set") => Recordable) | undefined;
|
|
1063
|
+
readonly syncToUrl?: (boolean | ((values: Recordable, type: "get" | "set") => Recordable)) | undefined;
|
|
1063
1064
|
readonly syncToUrlPriority?: boolean | undefined;
|
|
1064
1065
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
1065
1066
|
$attrs: {
|
|
@@ -1713,7 +1714,7 @@ declare const __VLS_component: DefineComponent<ApFormDrawerFormProps, {
|
|
|
1713
1714
|
$el: any;
|
|
1714
1715
|
$options: ComponentOptionsBase<Readonly< ApFormProps> & Readonly<{}>, {
|
|
1715
1716
|
setFieldsValue: (fields: Partial<any>) => void;
|
|
1716
|
-
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
|
|
1717
|
+
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean, optimizeFn?: UpdateModelOptimizeFn) => void;
|
|
1717
1718
|
resetFields: () => Promise<void>;
|
|
1718
1719
|
clearValidate: (name?: NamePath) => void;
|
|
1719
1720
|
validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
|
|
@@ -1762,7 +1763,7 @@ declare const __VLS_component: DefineComponent<ApFormDrawerFormProps, {
|
|
|
1762
1763
|
syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
|
|
1763
1764
|
}> & Omit<Readonly< ApFormProps> & Readonly<{}>, "validate" | "resetFields" | "clearValidate" | "validateFields" | "getFieldsValue" | "scrollToField" | "registerWatch" | "setFieldValue" | ("layout" | "colon" | "labelAlign" | "validateTrigger" | "hideRequiredMark" | "validateOnRuleChange" | "syncToUrl") | "setFieldsValue" | "getInternalInstance" | "validateFieldsReturnTransformed" | "getFieldsValueTransformed"> & ShallowUnwrapRef<{
|
|
1764
1765
|
setFieldsValue: (fields: Partial<any>) => void;
|
|
1765
|
-
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
|
|
1766
|
+
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean, optimizeFn?: UpdateModelOptimizeFn) => void;
|
|
1766
1767
|
resetFields: () => Promise<void>;
|
|
1767
1768
|
clearValidate: (name?: NamePath) => void;
|
|
1768
1769
|
validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<any>> | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isVNode as K, defineComponent as Q, useSlots as Y, ref as v, computed as w, unref as l, watch as P, cloneVNode as Z, createVNode as d, mergeProps as b,
|
|
1
|
+
import { isVNode as K, defineComponent as Q, useSlots as Y, ref as v, computed as w, unref as l, watch as P, cloneVNode as Z, createVNode as d, mergeProps as b, openBlock as y, createElementBlock as N, Fragment as ee, withCtx as g, renderSlot as M, createTextVNode as te, toDisplayString as ie, createBlock as S, resolveDynamicComponent as _, normalizeClass as ne, withModifiers as oe, createCommentVNode as L } from "vue";
|
|
2
2
|
import { Button as V, Flex as le, Space as ae, Drawer as se } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../ap-form.vue.mjs";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
@@ -274,23 +274,23 @@ const je = /* @__PURE__ */ Q({
|
|
|
274
274
|
"onUpdate:open": H,
|
|
275
275
|
onCancel: R
|
|
276
276
|
}), {
|
|
277
|
-
title: g(() => [
|
|
278
|
-
footer: g(() => [(y(),
|
|
277
|
+
title: g(() => [M(e.$slots, "title", {}, () => [te(ie(n.title), 1)])]),
|
|
278
|
+
footer: g(() => [(y(), S(_(I.value)))]),
|
|
279
279
|
default: g(() => [d(ve, b({
|
|
280
280
|
ref_key: "formRef",
|
|
281
281
|
ref: a
|
|
282
282
|
}, l(ce)(n, ["drawerProps", "open", "onUpdate:open", "title", "width", "onFinish", "submitter"])), {
|
|
283
|
-
default: g(() => [
|
|
283
|
+
default: g(() => [M(e.$slots, "default")]),
|
|
284
284
|
_: 3
|
|
285
285
|
}, 16), e.resize ? (y(), N("div", {
|
|
286
286
|
key: 0,
|
|
287
|
-
class:
|
|
288
|
-
onMousedown:
|
|
289
|
-
}, null, 34)) :
|
|
287
|
+
class: ne(q.value),
|
|
288
|
+
onMousedown: oe(A, ["stop", "prevent"])
|
|
289
|
+
}, null, 34)) : L("", !0)]),
|
|
290
290
|
_: 3
|
|
291
|
-
}, 16, ["open", "width"]), l(x) ? (y(),
|
|
291
|
+
}, 16, ["open", "width"]), l(x) ? (y(), S(_(l(x)), {
|
|
292
292
|
key: 0
|
|
293
|
-
})) :
|
|
293
|
+
})) : L("", !0)], 64));
|
|
294
294
|
}
|
|
295
295
|
});
|
|
296
296
|
export {
|
|
@@ -58,9 +58,10 @@ export type ApFormProps = Omit<FormProps, 'model' | 'onValuesChange'> & {
|
|
|
58
58
|
syncToUrlPriority?: boolean;
|
|
59
59
|
};
|
|
60
60
|
export type WatchFunc = (values?: Recordable) => void;
|
|
61
|
+
export type UpdateModelOptimizeFn = (currentModelValue: any, name: string | number) => void;
|
|
61
62
|
export type ApFormExpose<ModelType = any> = {
|
|
62
63
|
setFieldsValue: (fields: Partial<ModelType>) => void;
|
|
63
|
-
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
|
|
64
|
+
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean, optimizeFn?: UpdateModelOptimizeFn) => void;
|
|
64
65
|
resetFields: () => Promise<void>;
|
|
65
66
|
clearValidate: (name?: NamePath) => void;
|
|
66
67
|
validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<ModelType>> | undefined;
|
|
@@ -117,7 +118,7 @@ export type ApFormInternalInstance = {
|
|
|
117
118
|
* @param triggerChange
|
|
118
119
|
* @returns
|
|
119
120
|
*/
|
|
120
|
-
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean) => void;
|
|
121
|
+
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean, optimizeFn?: UpdateModelOptimizeFn) => void;
|
|
121
122
|
};
|
|
122
123
|
export type ApFormItemExpose = FormItemExpose & {
|
|
123
124
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as D, useSlots as $, ref as d, onMounted as j, computed as F, unref as l, watch as q, cloneVNode as E,
|
|
1
|
+
import { defineComponent as D, useSlots as $, ref as d, onMounted as j, computed as F, unref as l, watch as q, cloneVNode as E, openBlock as g, createBlock as h, mergeProps as K, createSlots as O, withCtx as i, resolveDynamicComponent as Q, createCommentVNode as U, createElementVNode as G, normalizeClass as H, createVNode as p, normalizeStyle as J, renderList as M, renderSlot as W, normalizeProps as X, guardReactiveProps as Y } from "vue";
|
|
2
2
|
import { Form as Z, Tooltip as ee, TypographyText as oe } from "@aplus-frontend/antdv";
|
|
3
3
|
import { useToken as le } from "@aplus-frontend/antdv/es/theme/internal";
|
|
4
4
|
import { isFunction as B, cloneDeep as te, isArray as ae, omit as C } from "lodash-unified";
|
|
@@ -124,7 +124,7 @@ const Ce = /* @__PURE__ */ D({
|
|
|
124
124
|
clearValidate: A,
|
|
125
125
|
resetField: L,
|
|
126
126
|
getFieldValue: R
|
|
127
|
-
}), (e, t) => (
|
|
127
|
+
}), (e, t) => (g(), h(l(Z).Item, K({
|
|
128
128
|
ref_key: "formItemRef",
|
|
129
129
|
ref: n
|
|
130
130
|
}, l(C)(o, [...l(re), "tooltip", "label"]), {
|
|
@@ -136,22 +136,22 @@ const Ce = /* @__PURE__ */ D({
|
|
|
136
136
|
colon: e.bordered ? !1 : o.colon
|
|
137
137
|
}), O({
|
|
138
138
|
default: i(() => [
|
|
139
|
-
V.value ? (
|
|
139
|
+
V.value ? (g(), h(Q(V.value), { key: 0 })) : U("", !0)
|
|
140
140
|
]),
|
|
141
141
|
_: 2
|
|
142
142
|
}, [
|
|
143
143
|
o.tooltip ? {
|
|
144
144
|
name: "tooltip",
|
|
145
145
|
fn: i(({ class: a }) => [
|
|
146
|
-
|
|
147
|
-
class:
|
|
146
|
+
G("span", {
|
|
147
|
+
class: H(a)
|
|
148
148
|
}, [
|
|
149
149
|
p(l(ee), {
|
|
150
150
|
title: o.tooltip
|
|
151
151
|
}, {
|
|
152
152
|
default: i(() => [
|
|
153
153
|
p(l(ne), {
|
|
154
|
-
style:
|
|
154
|
+
style: J({ color: l(x).colorPrimary })
|
|
155
155
|
}, null, 8, ["style"])
|
|
156
156
|
]),
|
|
157
157
|
_: 1
|
|
@@ -171,7 +171,7 @@ const Ce = /* @__PURE__ */ D({
|
|
|
171
171
|
]),
|
|
172
172
|
key: "1"
|
|
173
173
|
} : void 0,
|
|
174
|
-
|
|
174
|
+
M(l(C)(r, "default"), (a, b) => ({
|
|
175
175
|
name: b,
|
|
176
176
|
fn: i((_) => [
|
|
177
177
|
W(e.$slots, b, X(Y(_ || {})))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isVNode as C, defineComponent as h, useSlots as w, onBeforeUpdate as k,
|
|
1
|
+
import { isVNode as C, defineComponent as h, useSlots as w, onBeforeUpdate as k, watch as _, shallowRef as B, computed as P, unref as r, createVNode as R, mergeProps as u, openBlock as s, createBlock as d, withCtx as S, createElementBlock as b, Fragment as x, renderList as N, resolveDynamicComponent as j } from "vue";
|
|
2
2
|
import { Col as v, Row as F } from "@aplus-frontend/antdv";
|
|
3
3
|
import { pick as D, isBoolean as I, omit as O } from "lodash-unified";
|
|
4
4
|
import { apFormItemColPropKeys as V } from "../constant.mjs";
|
|
@@ -33,10 +33,10 @@ const T = /* @__PURE__ */ h({
|
|
|
33
33
|
} = G("ap-form-item-group"), i = t, a = w();
|
|
34
34
|
k(() => {
|
|
35
35
|
p.value = l(a.default());
|
|
36
|
-
}),
|
|
36
|
+
}), _(() => a.default(), (o) => {
|
|
37
37
|
p.value = l(o);
|
|
38
38
|
});
|
|
39
|
-
const p =
|
|
39
|
+
const p = B(l(a.default())), f = P(() => r(p).map((o, m) => {
|
|
40
40
|
const e = o.props, n = D(e, V), g = n != null && n.span ? {} : $(i.countPerRow), y = I(e.hidden) ? !!e.hidden : E(e.hidden);
|
|
41
41
|
return {
|
|
42
42
|
key: `${m}-${A(e.name)}`,
|