pro-design-vue 1.0.0-rc.8 → 1.0.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/dist/index.css +1 -1
- package/dist/index.full.js +503 -232
- package/dist/index.full.min.js +8 -8
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +8 -8
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +503 -232
- package/es/components/drawer/src/drawer.vue2.mjs +1 -1
- package/es/components/drawer/src/drawer.vue2.mjs.map +1 -1
- package/es/components/form/src/Form.d.ts +1 -1
- package/es/components/form/src/base/BaseForm.d.ts +1 -1
- package/es/components/form/src/base/BaseForm.mjs +23 -15
- package/es/components/form/src/base/BaseForm.mjs.map +1 -1
- package/es/components/form/src/base/StepForm.d.ts +1 -1
- package/es/components/form/src/components/FormColWrapper.d.ts +9 -0
- package/es/components/form/src/components/FormColWrapper.mjs +9 -1
- package/es/components/form/src/components/FormColWrapper.mjs.map +1 -1
- package/es/components/form/src/components/FormGroup.d.ts +6 -4
- package/es/components/form/src/components/FormGroup.mjs +1 -1
- package/es/components/form/src/components/FormGroup.mjs.map +1 -1
- package/es/components/form/src/components/FormItem.d.ts +9 -0
- package/es/components/form/src/components/FormItem.mjs +32 -24
- package/es/components/form/src/components/FormItem.mjs.map +1 -1
- package/es/components/form/src/components/FormItems.mjs +2 -1
- package/es/components/form/src/components/FormItems.mjs.map +1 -1
- package/es/components/form/src/components/FormList.d.ts +6 -4
- package/es/components/form/src/components/FormList.mjs +1 -1
- package/es/components/form/src/components/FormList.mjs.map +1 -1
- package/es/components/form/src/components/FormListContainer.d.ts +6 -4
- package/es/components/form/src/components/FormListContainer.mjs +1 -1
- package/es/components/form/src/components/FormListContainer.mjs.map +1 -1
- package/es/components/form/src/components/FormSet.d.ts +6 -4
- package/es/components/form/src/components/FormSet.mjs +1 -1
- package/es/components/form/src/components/FormSet.mjs.map +1 -1
- package/es/components/form/src/components/FormSubmitter.d.ts +2 -2
- package/es/components/form/src/components/FormSubmitter.mjs +25 -7
- package/es/components/form/src/components/FormSubmitter.mjs.map +1 -1
- package/es/components/form/src/components/FormTitle.d.ts +6 -4
- package/es/components/form/src/components/FormTitle.mjs +11 -6
- package/es/components/form/src/components/FormTitle.mjs.map +1 -1
- package/es/components/form/src/hooks/useAction.d.ts +5 -2
- package/es/components/form/src/hooks/useAction.mjs +137 -12
- package/es/components/form/src/hooks/useAction.mjs.map +1 -1
- package/es/components/form/src/hooks/useFieldValue.d.ts +1 -1
- package/es/components/form/src/hooks/useFieldValue.mjs +11 -15
- package/es/components/form/src/hooks/useFieldValue.mjs.map +1 -1
- package/es/components/form/src/layouts/DrawerForm.d.ts +1 -1
- package/es/components/form/src/layouts/DrawerForm.mjs +8 -12
- package/es/components/form/src/layouts/DrawerForm.mjs.map +1 -1
- package/es/components/form/src/layouts/ModalForm.d.ts +1 -1
- package/es/components/form/src/layouts/ModalForm.mjs +8 -12
- package/es/components/form/src/layouts/ModalForm.mjs.map +1 -1
- package/es/components/form/src/layouts/QueryFilter.d.ts +1 -1
- package/es/components/form/src/layouts/QueryFilter.mjs +14 -4
- package/es/components/form/src/layouts/QueryFilter.mjs.map +1 -1
- package/es/components/form/src/layouts/StepsForm.d.ts +1 -1
- package/es/components/form/src/layouts/StepsForm.mjs +8 -8
- package/es/components/form/src/layouts/StepsForm.mjs.map +1 -1
- package/es/components/form/src/type.d.ts +29 -16
- package/es/components/form/src/utils/transformer.d.ts +3 -0
- package/es/components/form/src/utils/transformer.mjs +24 -0
- package/es/components/form/src/utils/transformer.mjs.map +1 -0
- package/es/components/modal/src/modal.vue2.mjs +1 -1
- package/es/components/modal/src/modal.vue2.mjs.map +1 -1
- package/es/components/table/src/components/Body/Body.vue.mjs.map +1 -1
- package/es/components/table/src/components/Body/Body.vue2.mjs +1 -2
- package/es/components/table/src/components/Body/Body.vue2.mjs.map +1 -1
- package/es/components/table/src/components/Body/BodyCell.mjs +2 -2
- package/es/components/table/src/components/Body/BodyCell.mjs.map +1 -1
- package/es/components/table/src/components/Body/BodyRow.vue.mjs.map +1 -1
- package/es/components/table/src/components/Body/BodyRow.vue2.mjs +3 -3
- package/es/components/table/src/components/Body/BodyRow.vue2.mjs.map +1 -1
- package/es/components/table/src/components/Drag/RowHandler.vue.mjs.map +1 -1
- package/es/components/table/src/components/Drag/RowHandler.vue2.mjs +17 -16
- package/es/components/table/src/components/Drag/RowHandler.vue2.mjs.map +1 -1
- package/es/components/table/src/components/Header/HeaderCellTitle.vue.mjs +19 -7
- package/es/components/table/src/components/Header/HeaderCellTitle.vue.mjs.map +1 -1
- package/es/components/table/src/components/Header/HeaderCellTitle.vue2.mjs +1 -0
- package/es/components/table/src/components/Header/HeaderCellTitle.vue2.mjs.map +1 -1
- package/es/components/table/src/components/Header/HeaderExtraCell.vue.mjs.map +1 -1
- package/es/components/table/src/components/Header/HeaderExtraCell.vue2.mjs +1 -0
- package/es/components/table/src/components/Header/HeaderExtraCell.vue2.mjs.map +1 -1
- package/es/components/table/src/components/InteralTable.vue.d.ts +21 -0
- package/es/components/table/src/components/InteralTable.vue.mjs.map +1 -1
- package/es/components/table/src/components/InteralTable.vue2.mjs +11 -5
- package/es/components/table/src/components/InteralTable.vue2.mjs.map +1 -1
- package/es/components/table/src/components/Table.d.ts +25 -4
- package/es/components/table/src/components/Table.mjs +48 -14
- package/es/components/table/src/components/Table.mjs.map +1 -1
- package/es/components/table/src/components/ToolBar/ToolBar.vue.mjs +25 -6
- package/es/components/table/src/components/ToolBar/ToolBar.vue.mjs.map +1 -1
- package/es/components/table/src/components/ToolBar/ToolBar.vue2.mjs.map +1 -1
- package/es/components/table/src/components/interface.d.ts +33 -5
- package/es/components/table/src/components/interface.mjs +10 -1
- package/es/components/table/src/components/interface.mjs.map +1 -1
- package/es/components/table/src/hooks/useCellProps.mjs +3 -1
- package/es/components/table/src/hooks/useCellProps.mjs.map +1 -1
- package/es/components/table/src/hooks/useContainer.mjs +1 -1
- package/es/components/table/src/hooks/useContainer.mjs.map +1 -1
- package/es/components/table/src/hooks/useFetchData.mjs +13 -18
- package/es/components/table/src/hooks/useFetchData.mjs.map +1 -1
- package/es/components/table/src/hooks/useHover.d.ts +3 -0
- package/es/components/table/src/hooks/useHover.mjs +3 -1
- package/es/components/table/src/hooks/useHover.mjs.map +1 -1
- package/es/components/table/src/hooks/usePagination.d.ts +1 -0
- package/es/components/table/src/hooks/usePagination.mjs +7 -2
- package/es/components/table/src/hooks/usePagination.mjs.map +1 -1
- package/es/components/table/src/utils/genProColumnToColumn.mjs +5 -4
- package/es/components/table/src/utils/genProColumnToColumn.mjs.map +1 -1
- package/es/components/table/src/utils/util.d.ts +1 -1
- package/es/components/table/src/utils/util.mjs +1 -1
- package/es/components/table/src/utils/util.mjs.map +1 -1
- package/es/index.d.ts +70 -26
- package/es/utils/validate.d.ts +1 -1
- package/es/utils/validate.mjs +1 -1
- package/es/utils/validate.mjs.map +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/drawer/src/drawer.vue2.js +1 -1
- package/lib/components/drawer/src/drawer.vue2.js.map +1 -1
- package/lib/components/form/src/Form.d.ts +1 -1
- package/lib/components/form/src/base/BaseForm.d.ts +1 -1
- package/lib/components/form/src/base/BaseForm.js +21 -13
- package/lib/components/form/src/base/BaseForm.js.map +1 -1
- package/lib/components/form/src/base/StepForm.d.ts +1 -1
- package/lib/components/form/src/components/FormColWrapper.d.ts +9 -0
- package/lib/components/form/src/components/FormColWrapper.js +9 -1
- package/lib/components/form/src/components/FormColWrapper.js.map +1 -1
- package/lib/components/form/src/components/FormGroup.d.ts +6 -4
- package/lib/components/form/src/components/FormGroup.js +1 -1
- package/lib/components/form/src/components/FormGroup.js.map +1 -1
- package/lib/components/form/src/components/FormItem.d.ts +9 -0
- package/lib/components/form/src/components/FormItem.js +32 -24
- package/lib/components/form/src/components/FormItem.js.map +1 -1
- package/lib/components/form/src/components/FormItems.js +2 -1
- package/lib/components/form/src/components/FormItems.js.map +1 -1
- package/lib/components/form/src/components/FormList.d.ts +6 -4
- package/lib/components/form/src/components/FormList.js +1 -1
- package/lib/components/form/src/components/FormList.js.map +1 -1
- package/lib/components/form/src/components/FormListContainer.d.ts +6 -4
- package/lib/components/form/src/components/FormListContainer.js +1 -1
- package/lib/components/form/src/components/FormListContainer.js.map +1 -1
- package/lib/components/form/src/components/FormSet.d.ts +6 -4
- package/lib/components/form/src/components/FormSet.js +1 -1
- package/lib/components/form/src/components/FormSet.js.map +1 -1
- package/lib/components/form/src/components/FormSubmitter.d.ts +2 -2
- package/lib/components/form/src/components/FormSubmitter.js +25 -7
- package/lib/components/form/src/components/FormSubmitter.js.map +1 -1
- package/lib/components/form/src/components/FormTitle.d.ts +6 -4
- package/lib/components/form/src/components/FormTitle.js +11 -6
- package/lib/components/form/src/components/FormTitle.js.map +1 -1
- package/lib/components/form/src/hooks/useAction.d.ts +5 -2
- package/lib/components/form/src/hooks/useAction.js +137 -10
- package/lib/components/form/src/hooks/useAction.js.map +1 -1
- package/lib/components/form/src/hooks/useFieldValue.d.ts +1 -1
- package/lib/components/form/src/hooks/useFieldValue.js +11 -15
- package/lib/components/form/src/hooks/useFieldValue.js.map +1 -1
- package/lib/components/form/src/layouts/DrawerForm.d.ts +1 -1
- package/lib/components/form/src/layouts/DrawerForm.js +8 -12
- package/lib/components/form/src/layouts/DrawerForm.js.map +1 -1
- package/lib/components/form/src/layouts/ModalForm.d.ts +1 -1
- package/lib/components/form/src/layouts/ModalForm.js +8 -12
- package/lib/components/form/src/layouts/ModalForm.js.map +1 -1
- package/lib/components/form/src/layouts/QueryFilter.d.ts +1 -1
- package/lib/components/form/src/layouts/QueryFilter.js +14 -4
- package/lib/components/form/src/layouts/QueryFilter.js.map +1 -1
- package/lib/components/form/src/layouts/StepsForm.d.ts +1 -1
- package/lib/components/form/src/layouts/StepsForm.js +8 -8
- package/lib/components/form/src/layouts/StepsForm.js.map +1 -1
- package/lib/components/form/src/type.d.ts +29 -16
- package/lib/components/form/src/utils/transformer.d.ts +3 -0
- package/lib/components/form/src/utils/transformer.js +28 -0
- package/lib/components/form/src/utils/transformer.js.map +1 -0
- package/lib/components/modal/src/modal.vue2.js +1 -1
- package/lib/components/modal/src/modal.vue2.js.map +1 -1
- package/lib/components/table/src/components/Body/Body.vue.js.map +1 -1
- package/lib/components/table/src/components/Body/Body.vue2.js +1 -2
- package/lib/components/table/src/components/Body/Body.vue2.js.map +1 -1
- package/lib/components/table/src/components/Body/BodyCell.js +2 -2
- package/lib/components/table/src/components/Body/BodyCell.js.map +1 -1
- package/lib/components/table/src/components/Body/BodyRow.vue.js.map +1 -1
- package/lib/components/table/src/components/Body/BodyRow.vue2.js +3 -3
- package/lib/components/table/src/components/Body/BodyRow.vue2.js.map +1 -1
- package/lib/components/table/src/components/Drag/RowHandler.vue.js.map +1 -1
- package/lib/components/table/src/components/Drag/RowHandler.vue2.js +17 -16
- package/lib/components/table/src/components/Drag/RowHandler.vue2.js.map +1 -1
- package/lib/components/table/src/components/Header/HeaderCellTitle.vue.js +18 -6
- package/lib/components/table/src/components/Header/HeaderCellTitle.vue.js.map +1 -1
- package/lib/components/table/src/components/Header/HeaderCellTitle.vue2.js +1 -0
- package/lib/components/table/src/components/Header/HeaderCellTitle.vue2.js.map +1 -1
- package/lib/components/table/src/components/Header/HeaderExtraCell.vue.js.map +1 -1
- package/lib/components/table/src/components/Header/HeaderExtraCell.vue2.js +1 -0
- package/lib/components/table/src/components/Header/HeaderExtraCell.vue2.js.map +1 -1
- package/lib/components/table/src/components/InteralTable.vue.d.ts +21 -0
- package/lib/components/table/src/components/InteralTable.vue.js.map +1 -1
- package/lib/components/table/src/components/InteralTable.vue2.js +12 -6
- package/lib/components/table/src/components/InteralTable.vue2.js.map +1 -1
- package/lib/components/table/src/components/Table.d.ts +25 -4
- package/lib/components/table/src/components/Table.js +47 -13
- package/lib/components/table/src/components/Table.js.map +1 -1
- package/lib/components/table/src/components/ToolBar/ToolBar.vue.js +24 -5
- package/lib/components/table/src/components/ToolBar/ToolBar.vue.js.map +1 -1
- package/lib/components/table/src/components/ToolBar/ToolBar.vue2.js.map +1 -1
- package/lib/components/table/src/components/interface.d.ts +33 -5
- package/lib/components/table/src/components/interface.js +10 -1
- package/lib/components/table/src/components/interface.js.map +1 -1
- package/lib/components/table/src/hooks/useCellProps.js +3 -1
- package/lib/components/table/src/hooks/useCellProps.js.map +1 -1
- package/lib/components/table/src/hooks/useContainer.js +1 -1
- package/lib/components/table/src/hooks/useContainer.js.map +1 -1
- package/lib/components/table/src/hooks/useFetchData.js +13 -18
- package/lib/components/table/src/hooks/useFetchData.js.map +1 -1
- package/lib/components/table/src/hooks/useHover.d.ts +3 -0
- package/lib/components/table/src/hooks/useHover.js +2 -0
- package/lib/components/table/src/hooks/useHover.js.map +1 -1
- package/lib/components/table/src/hooks/usePagination.d.ts +1 -0
- package/lib/components/table/src/hooks/usePagination.js +7 -1
- package/lib/components/table/src/hooks/usePagination.js.map +1 -1
- package/lib/components/table/src/utils/genProColumnToColumn.js +5 -4
- package/lib/components/table/src/utils/genProColumnToColumn.js.map +1 -1
- package/lib/components/table/src/utils/util.d.ts +1 -1
- package/lib/components/table/src/utils/util.js +1 -1
- package/lib/components/table/src/utils/util.js.map +1 -1
- package/lib/index.d.ts +70 -26
- package/lib/utils/validate.d.ts +1 -1
- package/lib/utils/validate.js +1 -1
- package/lib/utils/validate.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +1 -1
- package/theme-chalk/css-var.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/pro-form.css +1 -1
- package/theme-chalk/src/css-var.less +154 -677
- package/theme-chalk/src/form.less +5 -0
- package/theme-chalk/src/table/alert.less +1 -0
- package/theme-chalk/src/table/table.less +3 -3
- package/theme-chalk/src/common/css-var.less +0 -914
package/dist/index.full.mjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! Pro Design Vue v1.0.0
|
1
|
+
/*! Pro Design Vue v1.0.0 */
|
2
2
|
|
3
3
|
import { Modal, ConfigProvider, App, Button as Button$1, Tooltip, Popconfirm, Dropdown, Menu, Slider, Drawer, Input, InputNumber, Form as Form$1, Space, Textarea, Select, TreeSelect, Checkbox as Checkbox$1, CheckboxGroup, RadioGroup, Radio as Radio$1, Cascader, Switch, Rate, DatePicker, RangePicker, TimePicker, TimeRangePicker, Upload, theme as theme$1, FormItemRest, Spin, message, Row as Row$1, Col, FormItem as FormItem$3, Steps, Popover, MenuItem, SubMenu, Empty, Badge, Tag, Pagination, InputSearch, Tree, Card, Tabs, TabPane } from 'ant-design-vue';
|
4
4
|
import { inject, ref, getCurrentInstance, nextTick, h, reactive, defineComponent, createVNode, isVNode, Fragment, cloneVNode, provide, computed, renderSlot, createPropsRestProxy, createBlock, openBlock, unref, normalizeProps, guardReactiveProps, withCtx, shallowRef, shallowReadonly, toValue, getCurrentScope, onScopeDispose, watch, onMounted, hasInjectionContext, isRef, toRefs as toRefs$1, customRef, toRef as toRef$1, readonly, watchEffect, toRaw, createElementBlock, createCommentVNode, resolveDynamicComponent, mergeProps, createElementVNode, normalizeStyle, toDisplayString, normalizeClass, createSlots, useAttrs, useTemplateRef, defineAsyncComponent, Teleport, onUnmounted, Comment as Comment$1, useSlots, useModel, withModifiers, mergeModels, renderList, camelize, isReactive, onActivated, onDeactivated, onBeforeUnmount, triggerRef, resolveDirective, withDirectives, vShow, render as render$1, resolveComponent, createTextVNode, vModelText } from 'vue';
|
@@ -13,7 +13,7 @@ const ELEMENT_ID_MAIN_CONTENT = `__pro_main_content`;
|
|
13
13
|
const SCROLL_FIXED_CLASS = `_scroll__fixed_`;
|
14
14
|
const DEFAULT_NAMESPACE = "pro";
|
15
15
|
|
16
|
-
const version$1 = "1.0.0
|
16
|
+
const version$1 = "1.0.0";
|
17
17
|
|
18
18
|
const makeInstaller = (components = []) => {
|
19
19
|
const install = (app) => {
|
@@ -2203,13 +2203,13 @@ const isNil = (value) => value === null || value === void 0;
|
|
2203
2203
|
function isNumber$2(val) {
|
2204
2204
|
return is$1(val, "Number");
|
2205
2205
|
}
|
2206
|
-
function isPromise
|
2207
|
-
return is$1(val, "Promise") &&
|
2206
|
+
function isPromise(val) {
|
2207
|
+
return is$1(val, "Promise") && isFunction$2(val.then) && isFunction$2(val.catch);
|
2208
2208
|
}
|
2209
2209
|
function isString$1(val) {
|
2210
2210
|
return is$1(val, "String");
|
2211
2211
|
}
|
2212
|
-
function isFunction$
|
2212
|
+
function isFunction$2(val) {
|
2213
2213
|
return typeof val === "function";
|
2214
2214
|
}
|
2215
2215
|
function isArray$2(val) {
|
@@ -2253,7 +2253,7 @@ const confirm = (props) => {
|
|
2253
2253
|
...okButtonProps
|
2254
2254
|
},
|
2255
2255
|
async onOk(...args) {
|
2256
|
-
if (isPromise
|
2256
|
+
if (isPromise(onOk)) {
|
2257
2257
|
return await new Promise(() => {
|
2258
2258
|
onOk == null ? void 0 : onOk(args);
|
2259
2259
|
});
|
@@ -2504,7 +2504,7 @@ var asyncTag = "[object AsyncFunction]";
|
|
2504
2504
|
var funcTag$2 = "[object Function]";
|
2505
2505
|
var genTag$1 = "[object GeneratorFunction]";
|
2506
2506
|
var proxyTag = "[object Proxy]";
|
2507
|
-
function isFunction$
|
2507
|
+
function isFunction$1(value) {
|
2508
2508
|
if (!isObject$3(value)) {
|
2509
2509
|
return false;
|
2510
2510
|
}
|
@@ -2551,7 +2551,7 @@ function baseIsNative(value) {
|
|
2551
2551
|
if (!isObject$3(value) || isMasked(value)) {
|
2552
2552
|
return false;
|
2553
2553
|
}
|
2554
|
-
var pattern = isFunction$
|
2554
|
+
var pattern = isFunction$1(value) ? reIsNative : reIsHostCtor;
|
2555
2555
|
return pattern.test(toSource(value));
|
2556
2556
|
}
|
2557
2557
|
|
@@ -2753,7 +2753,7 @@ function isLength(value) {
|
|
2753
2753
|
}
|
2754
2754
|
|
2755
2755
|
function isArrayLike(value) {
|
2756
|
-
return value != null && isLength(value.length) && !isFunction$
|
2756
|
+
return value != null && isLength(value.length) && !isFunction$1(value);
|
2757
2757
|
}
|
2758
2758
|
|
2759
2759
|
function isIterateeCall(value, index, object) {
|
@@ -4426,7 +4426,7 @@ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, sta
|
|
4426
4426
|
newValue = objValue;
|
4427
4427
|
if (isArguments(objValue)) {
|
4428
4428
|
newValue = toPlainObject(objValue);
|
4429
|
-
} else if (!isObject$3(objValue) || isFunction$
|
4429
|
+
} else if (!isObject$3(objValue) || isFunction$1(objValue)) {
|
4430
4430
|
newValue = initCloneObject(srcValue);
|
4431
4431
|
}
|
4432
4432
|
} else {
|
@@ -8477,7 +8477,7 @@ var _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
8477
8477
|
});
|
8478
8478
|
const isComponent = computed(() => {
|
8479
8479
|
const { icon } = props;
|
8480
|
-
return !isString$1(icon) && (isObject$4(icon) || isFunction$
|
8480
|
+
return !isString$1(icon) && (isObject$4(icon) || isFunction$2(icon));
|
8481
8481
|
});
|
8482
8482
|
return (_ctx, _cache) => {
|
8483
8483
|
return isComponent.value ? (openBlock(), createBlock(
|
@@ -9141,7 +9141,7 @@ function isPlainObject(value) {
|
|
9141
9141
|
return false;
|
9142
9142
|
}
|
9143
9143
|
}
|
9144
|
-
function isFunction
|
9144
|
+
function isFunction(value) {
|
9145
9145
|
return typeof value === "function";
|
9146
9146
|
}
|
9147
9147
|
var slice = Array.prototype.slice;
|
@@ -9149,7 +9149,7 @@ function toArray$1(value) {
|
|
9149
9149
|
return Array.from ? Array.from(value) : slice.call(value);
|
9150
9150
|
}
|
9151
9151
|
function forEach(data, callback) {
|
9152
|
-
if (data && isFunction
|
9152
|
+
if (data && isFunction(callback)) {
|
9153
9153
|
if (Array.isArray(data) || isNumber(data.length)) {
|
9154
9154
|
toArray$1(data).forEach(function(value, key) {
|
9155
9155
|
callback.call(data, value, key, data);
|
@@ -9363,7 +9363,7 @@ function addListener(element, type, listener) {
|
|
9363
9363
|
}
|
9364
9364
|
function dispatchEvent(element, type, data) {
|
9365
9365
|
var event;
|
9366
|
-
if (isFunction
|
9366
|
+
if (isFunction(Event) && isFunction(CustomEvent)) {
|
9367
9367
|
event = new CustomEvent(type, {
|
9368
9368
|
detail: data,
|
9369
9369
|
bubbles: true,
|
@@ -10102,19 +10102,19 @@ var preview = {
|
|
10102
10102
|
var events$1 = {
|
10103
10103
|
bind: function bind() {
|
10104
10104
|
var element = this.element, options = this.options, cropper = this.cropper;
|
10105
|
-
if (isFunction
|
10105
|
+
if (isFunction(options.cropstart)) {
|
10106
10106
|
addListener(element, EVENT_CROP_START, options.cropstart);
|
10107
10107
|
}
|
10108
|
-
if (isFunction
|
10108
|
+
if (isFunction(options.cropmove)) {
|
10109
10109
|
addListener(element, EVENT_CROP_MOVE, options.cropmove);
|
10110
10110
|
}
|
10111
|
-
if (isFunction
|
10111
|
+
if (isFunction(options.cropend)) {
|
10112
10112
|
addListener(element, EVENT_CROP_END, options.cropend);
|
10113
10113
|
}
|
10114
|
-
if (isFunction
|
10114
|
+
if (isFunction(options.crop)) {
|
10115
10115
|
addListener(element, EVENT_CROP, options.crop);
|
10116
10116
|
}
|
10117
|
-
if (isFunction
|
10117
|
+
if (isFunction(options.zoom)) {
|
10118
10118
|
addListener(element, EVENT_ZOOM, options.zoom);
|
10119
10119
|
}
|
10120
10120
|
addListener(cropper, EVENT_POINTER_DOWN, this.onCropStart = this.cropStart.bind(this));
|
@@ -10135,19 +10135,19 @@ var events$1 = {
|
|
10135
10135
|
},
|
10136
10136
|
unbind: function unbind() {
|
10137
10137
|
var element = this.element, options = this.options, cropper = this.cropper;
|
10138
|
-
if (isFunction
|
10138
|
+
if (isFunction(options.cropstart)) {
|
10139
10139
|
removeListener(element, EVENT_CROP_START, options.cropstart);
|
10140
10140
|
}
|
10141
|
-
if (isFunction
|
10141
|
+
if (isFunction(options.cropmove)) {
|
10142
10142
|
removeListener(element, EVENT_CROP_MOVE, options.cropmove);
|
10143
10143
|
}
|
10144
|
-
if (isFunction
|
10144
|
+
if (isFunction(options.cropend)) {
|
10145
10145
|
removeListener(element, EVENT_CROP_END, options.cropend);
|
10146
10146
|
}
|
10147
|
-
if (isFunction
|
10147
|
+
if (isFunction(options.crop)) {
|
10148
10148
|
removeListener(element, EVENT_CROP, options.crop);
|
10149
10149
|
}
|
10150
|
-
if (isFunction
|
10150
|
+
if (isFunction(options.zoom)) {
|
10151
10151
|
removeListener(element, EVENT_ZOOM, options.zoom);
|
10152
10152
|
}
|
10153
10153
|
removeListener(cropper, EVENT_POINTER_DOWN, this.onCropStart);
|
@@ -11552,7 +11552,7 @@ var Cropper = /* @__PURE__ */ (function() {
|
|
11552
11552
|
this.crop();
|
11553
11553
|
}
|
11554
11554
|
this.setData(options.data);
|
11555
|
-
if (isFunction
|
11555
|
+
if (isFunction(options.ready)) {
|
11556
11556
|
addListener(element, EVENT_READY, options.ready, {
|
11557
11557
|
once: true
|
11558
11558
|
});
|
@@ -11748,7 +11748,7 @@ var _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
11748
11748
|
__name: "drawer",
|
11749
11749
|
props: {
|
11750
11750
|
description: { type: String, required: false },
|
11751
|
-
showFullscreen: { type: Boolean, required: false, default:
|
11751
|
+
showFullscreen: { type: Boolean, required: false, default: false },
|
11752
11752
|
defaultFullscreen: { type: Boolean, required: false },
|
11753
11753
|
autofocus: { type: Boolean, required: false, default: false },
|
11754
11754
|
closable: { type: Boolean, required: false, default: true },
|
@@ -14763,7 +14763,7 @@ var FieldUploadButton = /* @__PURE__ */ defineComponent({
|
|
14763
14763
|
});
|
14764
14764
|
const icon = computed(() => {
|
14765
14765
|
const render = getSlot(props.iconRender, formSlotsContext);
|
14766
|
-
if (isFunction$
|
14766
|
+
if (isFunction$2(render)) {
|
14767
14767
|
return createVNode(RenderVNode$1, {
|
14768
14768
|
"vnode": render
|
14769
14769
|
}, null);
|
@@ -14772,7 +14772,7 @@ var FieldUploadButton = /* @__PURE__ */ defineComponent({
|
|
14772
14772
|
});
|
14773
14773
|
const title = computed(() => {
|
14774
14774
|
const render = getSlot(props.title, formSlotsContext);
|
14775
|
-
if (isFunction$
|
14775
|
+
if (isFunction$2(render)) {
|
14776
14776
|
return createVNode(RenderVNode$1, {
|
14777
14777
|
"vnode": render
|
14778
14778
|
}, null);
|
@@ -14886,7 +14886,7 @@ var FieldUploadDragger = /* @__PURE__ */ defineComponent({
|
|
14886
14886
|
});
|
14887
14887
|
const icon = computed(() => {
|
14888
14888
|
const render = getSlot(props.iconRender, formSlotsContext);
|
14889
|
-
if (isFunction$
|
14889
|
+
if (isFunction$2(render)) {
|
14890
14890
|
return createVNode(RenderVNode$1, {
|
14891
14891
|
"vnode": render
|
14892
14892
|
}, null);
|
@@ -14895,7 +14895,7 @@ var FieldUploadDragger = /* @__PURE__ */ defineComponent({
|
|
14895
14895
|
});
|
14896
14896
|
const title = computed(() => {
|
14897
14897
|
const render = getSlot(props.title, formSlotsContext);
|
14898
|
-
if (isFunction$
|
14898
|
+
if (isFunction$2(render)) {
|
14899
14899
|
return createVNode(RenderVNode$1, {
|
14900
14900
|
"vnode": render
|
14901
14901
|
}, null);
|
@@ -14904,7 +14904,7 @@ var FieldUploadDragger = /* @__PURE__ */ defineComponent({
|
|
14904
14904
|
});
|
14905
14905
|
const description = computed(() => {
|
14906
14906
|
const render = getSlot(props.description, formSlotsContext);
|
14907
|
-
if (isFunction$
|
14907
|
+
if (isFunction$2(render)) {
|
14908
14908
|
return createVNode(RenderVNode$1, {
|
14909
14909
|
"vnode": render
|
14910
14910
|
}, null);
|
@@ -14948,7 +14948,7 @@ var _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
14948
14948
|
__name: "modal",
|
14949
14949
|
props: {
|
14950
14950
|
description: { type: String, required: false },
|
14951
|
-
showFullscreen: { type: Boolean, required: false, default:
|
14951
|
+
showFullscreen: { type: Boolean, required: false, default: false },
|
14952
14952
|
defaultFullscreen: { type: Boolean, required: false },
|
14953
14953
|
draggable: { type: Boolean, required: false, default: false },
|
14954
14954
|
top: { type: Number, required: false, default: 100 },
|
@@ -15751,10 +15751,133 @@ const covertFormName = (namePath) => {
|
|
15751
15751
|
return isString$1(namePath) ? namePath.indexOf(".") > -1 ? namePath.split(".") : [namePath] : namePath;
|
15752
15752
|
};
|
15753
15753
|
|
15754
|
-
|
15755
|
-
|
15756
|
-
|
15757
|
-
return
|
15754
|
+
function isPlainObj(itemValue) {
|
15755
|
+
if (typeof itemValue !== "object") return false;
|
15756
|
+
if (itemValue === null) return true;
|
15757
|
+
if (isValidElement$1(itemValue)) return false;
|
15758
|
+
if (itemValue.constructor === RegExp) return false;
|
15759
|
+
if (itemValue instanceof Map) return false;
|
15760
|
+
if (itemValue instanceof Set) return false;
|
15761
|
+
if (itemValue instanceof HTMLElement) return false;
|
15762
|
+
if (itemValue instanceof Blob) return false;
|
15763
|
+
if (itemValue instanceof File) return false;
|
15764
|
+
if (Array.isArray(itemValue)) return false;
|
15765
|
+
return true;
|
15766
|
+
}
|
15767
|
+
const transformKeySubmitValue = (values, transformerMap, paramsOmitNil) => {
|
15768
|
+
if (Object.keys(values).length < 1) {
|
15769
|
+
return values;
|
15770
|
+
}
|
15771
|
+
if (typeof window === "undefined") return values;
|
15772
|
+
if (typeof values !== "object" || isNil(values) || values instanceof Blob) {
|
15773
|
+
return values;
|
15774
|
+
}
|
15775
|
+
let finalValues = Array.isArray(values) ? [] : {};
|
15776
|
+
const gen = (tempValues, parentsKey) => {
|
15777
|
+
const isArrayValues = Array.isArray(tempValues);
|
15778
|
+
let result = isArrayValues ? [] : {};
|
15779
|
+
if (tempValues == null || tempValues === void 0) {
|
15780
|
+
return result;
|
15781
|
+
}
|
15782
|
+
Object.keys(tempValues).forEach((entityKey) => {
|
15783
|
+
var _a;
|
15784
|
+
const transformForArray = (transformList, subItemValue) => {
|
15785
|
+
if (!Array.isArray(transformList)) return entityKey;
|
15786
|
+
transformList.forEach((transform2, idx) => {
|
15787
|
+
if (!transform2) return;
|
15788
|
+
const subTransformItem = subItemValue == null ? void 0 : subItemValue[idx];
|
15789
|
+
if (typeof transform2 === "function") {
|
15790
|
+
subItemValue[idx] = transform2(subItemValue, entityKey, tempValues);
|
15791
|
+
}
|
15792
|
+
if (typeof transform2 === "object" && !Array.isArray(transform2)) {
|
15793
|
+
Object.keys(transform2).forEach((transformArrayItem) => {
|
15794
|
+
const subTransformItemValue = subTransformItem == null ? void 0 : subTransformItem[transformArrayItem];
|
15795
|
+
if (typeof transform2[transformArrayItem] === "function" && subTransformItemValue) {
|
15796
|
+
const res = transform2[transformArrayItem](
|
15797
|
+
subTransformItem[transformArrayItem],
|
15798
|
+
entityKey,
|
15799
|
+
tempValues
|
15800
|
+
);
|
15801
|
+
subTransformItem[transformArrayItem] = typeof res === "object" ? res[transformArrayItem] : res;
|
15802
|
+
} else if (typeof transform2[transformArrayItem] === "object" && Array.isArray(transform2[transformArrayItem]) && subTransformItemValue) {
|
15803
|
+
transformForArray(transform2[transformArrayItem], subTransformItemValue);
|
15804
|
+
}
|
15805
|
+
});
|
15806
|
+
}
|
15807
|
+
if (typeof transform2 === "object" && Array.isArray(transform2) && subTransformItem) {
|
15808
|
+
transformForArray(transform2, subTransformItem);
|
15809
|
+
}
|
15810
|
+
});
|
15811
|
+
return entityKey;
|
15812
|
+
};
|
15813
|
+
const itemValue = tempValues[entityKey];
|
15814
|
+
const transformFunction = (_a = transformerMap.get(entityKey)) == null ? void 0 : _a.transform;
|
15815
|
+
const transform = () => {
|
15816
|
+
let tempKey, transformedResult, isTransformedResultPrimitive = false;
|
15817
|
+
if (typeof transformFunction === "function") {
|
15818
|
+
transformedResult = transformFunction == null ? void 0 : transformFunction(itemValue, entityKey, tempValues);
|
15819
|
+
const typeOfResult = typeof transformedResult;
|
15820
|
+
if (typeOfResult !== "object" && typeOfResult !== "undefined") {
|
15821
|
+
tempKey = entityKey;
|
15822
|
+
isTransformedResultPrimitive = true;
|
15823
|
+
} else {
|
15824
|
+
tempKey = transformedResult;
|
15825
|
+
}
|
15826
|
+
} else {
|
15827
|
+
tempKey = transformForArray(transformFunction, itemValue);
|
15828
|
+
}
|
15829
|
+
if (Array.isArray(tempKey)) {
|
15830
|
+
result = set(result, tempKey, itemValue);
|
15831
|
+
return;
|
15832
|
+
}
|
15833
|
+
if (typeof tempKey === "object" && !Array.isArray(finalValues)) {
|
15834
|
+
finalValues = merge(finalValues, tempKey);
|
15835
|
+
} else if (typeof tempKey === "object" && Array.isArray(finalValues)) {
|
15836
|
+
result = { ...result, ...tempKey };
|
15837
|
+
} else if (tempKey !== null || tempKey !== void 0) {
|
15838
|
+
result = set(
|
15839
|
+
result,
|
15840
|
+
[tempKey],
|
15841
|
+
isTransformedResultPrimitive ? transformedResult : itemValue
|
15842
|
+
);
|
15843
|
+
}
|
15844
|
+
};
|
15845
|
+
if (transformFunction && typeof transformFunction === "function") {
|
15846
|
+
transform();
|
15847
|
+
}
|
15848
|
+
if (typeof window === "undefined") return;
|
15849
|
+
if (isPlainObj(itemValue)) {
|
15850
|
+
const genValues = gen(itemValue);
|
15851
|
+
if (Object.keys(genValues).length < 1) {
|
15852
|
+
return;
|
15853
|
+
}
|
15854
|
+
result = set(result, [entityKey], genValues);
|
15855
|
+
return;
|
15856
|
+
}
|
15857
|
+
transform();
|
15858
|
+
});
|
15859
|
+
return paramsOmitNil ? result : tempValues;
|
15860
|
+
};
|
15861
|
+
finalValues = Array.isArray(values) && Array.isArray(finalValues) ? [...gen(values)] : merge({}, gen(values), finalValues);
|
15862
|
+
return finalValues;
|
15863
|
+
};
|
15864
|
+
const convertKeyInitialValue = (values, transformerMap) => {
|
15865
|
+
if (Object.keys(values).length < 1) {
|
15866
|
+
return values;
|
15867
|
+
}
|
15868
|
+
const finalValues = {};
|
15869
|
+
Object.keys(values).forEach((entityKey) => {
|
15870
|
+
var _a;
|
15871
|
+
const itemValue = values[entityKey];
|
15872
|
+
const convertValueFunction = (_a = transformerMap.get(entityKey)) == null ? void 0 : _a.convertValue;
|
15873
|
+
if (typeof convertValueFunction === "function") {
|
15874
|
+
const convertResult = convertValueFunction == null ? void 0 : convertValueFunction(itemValue, entityKey);
|
15875
|
+
finalValues[entityKey] = convertResult;
|
15876
|
+
} else {
|
15877
|
+
finalValues[entityKey] = itemValue;
|
15878
|
+
}
|
15879
|
+
});
|
15880
|
+
return finalValues;
|
15758
15881
|
};
|
15759
15882
|
function useAction({
|
15760
15883
|
props,
|
@@ -15762,6 +15885,7 @@ function useAction({
|
|
15762
15885
|
formData,
|
15763
15886
|
initialValues,
|
15764
15887
|
hasInitial,
|
15888
|
+
transformerMap,
|
15765
15889
|
onFinish,
|
15766
15890
|
onReset,
|
15767
15891
|
onFinishFailed
|
@@ -15790,20 +15914,20 @@ function useAction({
|
|
15790
15914
|
if (!namePath) throw new Error("name is require");
|
15791
15915
|
const value = get(formData.value, namePath);
|
15792
15916
|
const obj = set({}, namePath, value);
|
15793
|
-
return get(
|
15917
|
+
return get(transformKeySubmitValue(obj, transformerMap.value, props.omitNil), namePath);
|
15794
15918
|
};
|
15795
15919
|
const getFieldFormatValueObject = (name) => {
|
15796
15920
|
const namePath = covertFormName(name);
|
15797
15921
|
if (!namePath) throw new Error("name is require");
|
15798
15922
|
const value = get(formData.value, namePath);
|
15799
15923
|
const obj = set({}, namePath, value);
|
15800
|
-
return
|
15924
|
+
return transformKeySubmitValue(obj, transformerMap.value, props.omitNil);
|
15801
15925
|
};
|
15802
15926
|
const validateFieldsReturnFormatValue = async (nameList) => {
|
15803
15927
|
var _a;
|
15804
15928
|
if (!Array.isArray(nameList) && nameList) throw new Error("nameList must be array");
|
15805
15929
|
const values = await ((_a = formRef.value) == null ? void 0 : _a.validateFields(nameList));
|
15806
|
-
const transformedKey =
|
15930
|
+
const transformedKey = transformKeySubmitValue(values, transformerMap.value, props.omitNil);
|
15807
15931
|
return transformedKey != null ? transformedKey : {};
|
15808
15932
|
};
|
15809
15933
|
const setFieldValue = (name, value) => {
|
@@ -15829,10 +15953,10 @@ function useAction({
|
|
15829
15953
|
var _a;
|
15830
15954
|
hasInitial.value = true;
|
15831
15955
|
(_a = formRef.value) == null ? void 0 : _a.clearValidate();
|
15832
|
-
formData.value = cloneDeep(initialValues.value);
|
15956
|
+
formData.value = cloneDeep(convertKeyInitialValue(initialValues.value, transformerMap.value));
|
15833
15957
|
Promise.resolve().then(() => {
|
15834
15958
|
hasInitial.value = false;
|
15835
|
-
onReset == null ? void 0 : onReset(formData.value);
|
15959
|
+
onReset == null ? void 0 : onReset(transformKeySubmitValue(formData.value, transformerMap.value, props.omitNil));
|
15836
15960
|
});
|
15837
15961
|
};
|
15838
15962
|
const resetField = (name) => {
|
@@ -16042,7 +16166,8 @@ var FormItems = /* @__PURE__ */ defineComponent({
|
|
16042
16166
|
}
|
16043
16167
|
return createVNode(FormItem$2, {
|
16044
16168
|
"key": item.key,
|
16045
|
-
"item": item
|
16169
|
+
"item": item,
|
16170
|
+
"grid": mergeGrid.value
|
16046
16171
|
}, null);
|
16047
16172
|
});
|
16048
16173
|
});
|
@@ -16106,15 +16231,33 @@ var FormSubmitter = /* @__PURE__ */ defineComponent({
|
|
16106
16231
|
action
|
16107
16232
|
} = useInjectForm();
|
16108
16233
|
const formSlotsContext = useInjectSlots$1();
|
16109
|
-
const submit = () => {
|
16234
|
+
const submit = async () => {
|
16110
16235
|
var _a;
|
16111
|
-
|
16112
|
-
|
16236
|
+
if (!props.onSubmit) {
|
16237
|
+
action.submit();
|
16238
|
+
return;
|
16239
|
+
}
|
16240
|
+
const values = action.getFieldsValue();
|
16241
|
+
const response = (_a = props.onSubmit) == null ? void 0 : _a.call(props, values, action);
|
16242
|
+
const result = await response;
|
16243
|
+
if (result) {
|
16244
|
+
action.submit();
|
16245
|
+
}
|
16246
|
+
return result;
|
16113
16247
|
};
|
16114
|
-
const reset = () => {
|
16115
|
-
var _a
|
16116
|
-
(
|
16117
|
-
|
16248
|
+
const reset = async () => {
|
16249
|
+
var _a;
|
16250
|
+
if (!props.onReset) {
|
16251
|
+
action.reset();
|
16252
|
+
return;
|
16253
|
+
}
|
16254
|
+
const values = action.getFieldsValue();
|
16255
|
+
const response = (_a = props.onReset) == null ? void 0 : _a.call(props, values, action);
|
16256
|
+
const result = await response;
|
16257
|
+
if (result) {
|
16258
|
+
action.reset();
|
16259
|
+
}
|
16260
|
+
return result;
|
16118
16261
|
};
|
16119
16262
|
const resetButton = computed(() => {
|
16120
16263
|
const {
|
@@ -16196,6 +16339,26 @@ var FormSubmitter = /* @__PURE__ */ defineComponent({
|
|
16196
16339
|
}
|
16197
16340
|
});
|
16198
16341
|
|
16342
|
+
function transformer(items) {
|
16343
|
+
const transformerMap = /* @__PURE__ */ new Map();
|
16344
|
+
const handler = (items2) => {
|
16345
|
+
items2.forEach((item) => {
|
16346
|
+
var _a;
|
16347
|
+
if (item.name && (item.transform || item.convertValue)) {
|
16348
|
+
transformerMap.set(item.name, {
|
16349
|
+
transform: item.transform,
|
16350
|
+
convertValue: item.convertValue
|
16351
|
+
});
|
16352
|
+
} else if (item.children) {
|
16353
|
+
const children = (_a = runFunction(item.children)) != null ? _a : [];
|
16354
|
+
handler(children);
|
16355
|
+
}
|
16356
|
+
});
|
16357
|
+
};
|
16358
|
+
handler(items);
|
16359
|
+
return transformerMap;
|
16360
|
+
}
|
16361
|
+
|
16199
16362
|
function _isSlot$5(s) {
|
16200
16363
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
16201
16364
|
}
|
@@ -16212,6 +16375,7 @@ var BaseForm = /* @__PURE__ */ defineComponent({
|
|
16212
16375
|
attrs
|
16213
16376
|
}) {
|
16214
16377
|
const mountedRef = ref(false);
|
16378
|
+
const transformerMap = shallowRef(/* @__PURE__ */ new Map());
|
16215
16379
|
const formRef = ref();
|
16216
16380
|
const prefixCls = usePrefixCls("form");
|
16217
16381
|
const formData = ref({});
|
@@ -16220,7 +16384,7 @@ var BaseForm = /* @__PURE__ */ defineComponent({
|
|
16220
16384
|
var _a;
|
16221
16385
|
return (_a = props.formKey) != null ? _a : requestFormCacheId.toString();
|
16222
16386
|
});
|
16223
|
-
const [loading,
|
16387
|
+
const [loading, setLoading] = useMergedState$1(false, {
|
16224
16388
|
value: computed(() => props.loading),
|
16225
16389
|
onChange: (val) => {
|
16226
16390
|
var _a;
|
@@ -16265,8 +16429,9 @@ var BaseForm = /* @__PURE__ */ defineComponent({
|
|
16265
16429
|
});
|
16266
16430
|
};
|
16267
16431
|
watch(() => props.items, () => {
|
16268
|
-
var _a;
|
16269
|
-
|
16432
|
+
var _a, _b;
|
16433
|
+
transformerMap.value = transformer((_a = props.items) != null ? _a : []);
|
16434
|
+
formItems.value = formatItems((_b = props.items) != null ? _b : []);
|
16270
16435
|
}, {
|
16271
16436
|
immediate: true
|
16272
16437
|
});
|
@@ -16277,7 +16442,7 @@ var BaseForm = /* @__PURE__ */ defineComponent({
|
|
16277
16442
|
} = useInitialValues(props);
|
16278
16443
|
watch(initialValues, (newValues, oldValues) => {
|
16279
16444
|
if (!isEqual(newValues, oldValues)) {
|
16280
|
-
formData.value = cloneDeep(newValues);
|
16445
|
+
formData.value = cloneDeep(convertKeyInitialValue(newValues, transformerMap.value));
|
16281
16446
|
if (!props.request || props.requestAbort) {
|
16282
16447
|
Promise.resolve().then(() => {
|
16283
16448
|
hasInitial.value = false;
|
@@ -16289,22 +16454,22 @@ var BaseForm = /* @__PURE__ */ defineComponent({
|
|
16289
16454
|
});
|
16290
16455
|
const onValuesChange = debounce(() => {
|
16291
16456
|
var _a;
|
16292
|
-
(_a = props.onValuesChange) == null ? void 0 : _a.call(props, cloneDeep(formData.value));
|
16457
|
+
(_a = props.onValuesChange) == null ? void 0 : _a.call(props, transformKeySubmitValue(cloneDeep(formData.value), transformerMap.value, props.omitNil));
|
16293
16458
|
}, 200);
|
16294
16459
|
const onFinish = async () => {
|
16295
16460
|
if (!props.onFinish) return;
|
16296
|
-
if (props.
|
16461
|
+
if (props.submitOnLoading) {
|
16297
16462
|
if (loading.value) return;
|
16298
|
-
|
16463
|
+
setLoading(true);
|
16299
16464
|
}
|
16300
16465
|
try {
|
16301
|
-
const finalValues = cloneDeep(formData.value);
|
16466
|
+
const finalValues = transformKeySubmitValue(cloneDeep(formData.value), transformerMap.value, props.omitNil);
|
16302
16467
|
await props.onFinish(finalValues);
|
16303
16468
|
} catch (error) {
|
16304
16469
|
console.log("\u{1F680} ~ onFinish ~ error:", error);
|
16305
16470
|
} finally {
|
16306
|
-
if (props.
|
16307
|
-
|
16471
|
+
if (props.submitOnLoading) {
|
16472
|
+
setLoading(false);
|
16308
16473
|
}
|
16309
16474
|
}
|
16310
16475
|
};
|
@@ -16322,6 +16487,7 @@ var BaseForm = /* @__PURE__ */ defineComponent({
|
|
16322
16487
|
formData,
|
16323
16488
|
initialValues,
|
16324
16489
|
hasInitial,
|
16490
|
+
transformerMap,
|
16325
16491
|
onFinish,
|
16326
16492
|
onReset: props.onReset,
|
16327
16493
|
onFinishFailed: props.onFinishFailed
|
@@ -16358,6 +16524,7 @@ var BaseForm = /* @__PURE__ */ defineComponent({
|
|
16358
16524
|
}), null);
|
16359
16525
|
if (submitterProps.value.teleport) {
|
16360
16526
|
return createVNode(Teleport, {
|
16527
|
+
"defer": true,
|
16361
16528
|
"to": submitterProps.value.teleport
|
16362
16529
|
}, _isSlot$5(dom) ? dom : {
|
16363
16530
|
default: () => [dom]
|
@@ -16369,8 +16536,11 @@ var BaseForm = /* @__PURE__ */ defineComponent({
|
|
16369
16536
|
var _a, _b, _c;
|
16370
16537
|
mountedRef.value = true;
|
16371
16538
|
requestFormCacheId += 1;
|
16372
|
-
const finalValues = (_b = (_a = formRef.value) == null ? void 0 : _a.getFieldsValue) == null ? void 0 : _b.call(_a, true);
|
16373
|
-
(
|
16539
|
+
const finalValues = (_c = (_b = (_a = formRef.value) == null ? void 0 : _a.getFieldsValue) == null ? void 0 : _b.call(_a, true)) != null ? _c : {};
|
16540
|
+
Promise.resolve().then(() => {
|
16541
|
+
var _a2;
|
16542
|
+
(_a2 = props.onInit) == null ? void 0 : _a2.call(props, transformKeySubmitValue(finalValues, transformerMap.value, props.omitNil), action);
|
16543
|
+
});
|
16374
16544
|
});
|
16375
16545
|
useProvideForm({
|
16376
16546
|
...linkage,
|
@@ -16417,7 +16587,7 @@ var BaseForm = /* @__PURE__ */ defineComponent({
|
|
16417
16587
|
"style": attrs.style
|
16418
16588
|
}), {
|
16419
16589
|
default: () => [createVNode(Spin, {
|
16420
|
-
"spinning": requestLoading.value ||
|
16590
|
+
"spinning": props.showLoading && (requestLoading.value || loading.value)
|
16421
16591
|
}, {
|
16422
16592
|
default: () => [createVNode(FormRowWrapper, null, {
|
16423
16593
|
default: () => [createVNode(FormItems, {
|
@@ -16451,8 +16621,7 @@ var DrawerForm = /* @__PURE__ */ defineComponent({
|
|
16451
16621
|
emits: ["update:open"],
|
16452
16622
|
setup(props, {
|
16453
16623
|
slots,
|
16454
|
-
emit
|
16455
|
-
expose
|
16624
|
+
emit
|
16456
16625
|
}) {
|
16457
16626
|
const _open = ref(false);
|
16458
16627
|
const loading = ref(false);
|
@@ -16460,7 +16629,6 @@ var DrawerForm = /* @__PURE__ */ defineComponent({
|
|
16460
16629
|
const intl = useIntl();
|
16461
16630
|
const formRef = ref();
|
16462
16631
|
const footerRef = ref(null);
|
16463
|
-
const formExpose = useFormExpose(formRef);
|
16464
16632
|
const open = computed({
|
16465
16633
|
get: () => {
|
16466
16634
|
var _a;
|
@@ -16480,7 +16648,7 @@ var DrawerForm = /* @__PURE__ */ defineComponent({
|
|
16480
16648
|
});
|
16481
16649
|
const formProps = computed(() => {
|
16482
16650
|
return {
|
16483
|
-
...omitUndefined(omit(props, ["onOpenChange", "closeOnFinish", "drawerProps", "title", "width", "confirmOnValuesChange", "submitTimeout", "onFinish", "submitter"])),
|
16651
|
+
...omitUndefined(omit(props, ["onOpenChange", "closeOnFinish", "drawerProps", "title", "width", "onInit", "confirmOnValuesChange", "submitTimeout", "onFinish", "submitter"])),
|
16484
16652
|
layout: "vertical"
|
16485
16653
|
};
|
16486
16654
|
});
|
@@ -16586,10 +16754,6 @@ var DrawerForm = /* @__PURE__ */ defineComponent({
|
|
16586
16754
|
}
|
16587
16755
|
return result;
|
16588
16756
|
};
|
16589
|
-
expose({
|
16590
|
-
formRef,
|
16591
|
-
...formExpose
|
16592
|
-
});
|
16593
16757
|
return () => createVNode(Fragment, null, [createVNode(ProDrawer, mergeProps(drawerProps.value, {
|
16594
16758
|
"open": open.value,
|
16595
16759
|
"onAfterOpenChange": (e) => {
|
@@ -16603,9 +16767,7 @@ var DrawerForm = /* @__PURE__ */ defineComponent({
|
|
16603
16767
|
closeConfirm(e);
|
16604
16768
|
}
|
16605
16769
|
}), {
|
16606
|
-
default: () => [createVNode(BaseForm, mergeProps({
|
16607
|
-
"ref": formRef
|
16608
|
-
}, formProps.value, {
|
16770
|
+
default: () => [createVNode(BaseForm, mergeProps(formProps.value, {
|
16609
16771
|
"submitter": submitterConfig.value,
|
16610
16772
|
"onFinish": async (values) => {
|
16611
16773
|
const result = await onFinishHandle(values);
|
@@ -16624,6 +16786,11 @@ var DrawerForm = /* @__PURE__ */ defineComponent({
|
|
16624
16786
|
valuesChanged.value = false;
|
16625
16787
|
}
|
16626
16788
|
(_a = props.onReset) == null ? void 0 : _a.call(props);
|
16789
|
+
},
|
16790
|
+
"onInit": (values, action) => {
|
16791
|
+
var _a;
|
16792
|
+
formRef.value = action;
|
16793
|
+
(_a = props.onInit) == null ? void 0 : _a.call(props, values, action);
|
16627
16794
|
}
|
16628
16795
|
}), formSlots.value)],
|
16629
16796
|
...drawerSlots.value,
|
@@ -16648,8 +16815,7 @@ var ModalForm = /* @__PURE__ */ defineComponent({
|
|
16648
16815
|
emits: ["update:open"],
|
16649
16816
|
setup(props, {
|
16650
16817
|
slots,
|
16651
|
-
emit
|
16652
|
-
expose
|
16818
|
+
emit
|
16653
16819
|
}) {
|
16654
16820
|
const _open = ref(false);
|
16655
16821
|
const loading = ref(false);
|
@@ -16657,7 +16823,6 @@ var ModalForm = /* @__PURE__ */ defineComponent({
|
|
16657
16823
|
const intl = useIntl();
|
16658
16824
|
const formRef = ref();
|
16659
16825
|
const footerRef = ref(null);
|
16660
|
-
const formExpose = useFormExpose(formRef);
|
16661
16826
|
const open = computed({
|
16662
16827
|
get: () => {
|
16663
16828
|
var _a;
|
@@ -16678,7 +16843,7 @@ var ModalForm = /* @__PURE__ */ defineComponent({
|
|
16678
16843
|
const formProps = computed(() => {
|
16679
16844
|
var _a;
|
16680
16845
|
return {
|
16681
|
-
...omitUndefined(omit(props, ["onOpenChange", "closeOnFinish", "modalProps", "title", "width", "confirmOnValuesChange", "submitTimeout", "onFinish", "submitter"])),
|
16846
|
+
...omitUndefined(omit(props, ["onInit", "onOpenChange", "closeOnFinish", "modalProps", "title", "width", "confirmOnValuesChange", "submitTimeout", "onFinish", "submitter"])),
|
16682
16847
|
layout: (_a = props.layout) != null ? _a : "vertical"
|
16683
16848
|
};
|
16684
16849
|
});
|
@@ -16785,10 +16950,6 @@ var ModalForm = /* @__PURE__ */ defineComponent({
|
|
16785
16950
|
}
|
16786
16951
|
return result;
|
16787
16952
|
};
|
16788
|
-
expose({
|
16789
|
-
formRef,
|
16790
|
-
...formExpose
|
16791
|
-
});
|
16792
16953
|
return () => createVNode(Fragment, null, [createVNode(ProModal, mergeProps(modalProps.value, {
|
16793
16954
|
"open": open.value,
|
16794
16955
|
"afterClose": () => {
|
@@ -16802,9 +16963,7 @@ var ModalForm = /* @__PURE__ */ defineComponent({
|
|
16802
16963
|
closeConfirm(e);
|
16803
16964
|
}
|
16804
16965
|
}), {
|
16805
|
-
default: () => [createVNode(BaseForm, mergeProps({
|
16806
|
-
"ref": formRef
|
16807
|
-
}, formProps.value, {
|
16966
|
+
default: () => [createVNode(BaseForm, mergeProps(formProps.value, {
|
16808
16967
|
"submitter": submitterConfig.value,
|
16809
16968
|
"onFinish": async (values) => {
|
16810
16969
|
const result = await onFinishHandle(values);
|
@@ -16823,6 +16982,11 @@ var ModalForm = /* @__PURE__ */ defineComponent({
|
|
16823
16982
|
valuesChanged.value = false;
|
16824
16983
|
}
|
16825
16984
|
(_a = props.onReset) == null ? void 0 : _a.call(props);
|
16985
|
+
},
|
16986
|
+
"onInit": (values, action) => {
|
16987
|
+
var _a;
|
16988
|
+
formRef.value = action;
|
16989
|
+
(_a = props.onInit) == null ? void 0 : _a.call(props, values, action);
|
16826
16990
|
}
|
16827
16991
|
}), formSlots.value)],
|
16828
16992
|
...modalSlots.value,
|
@@ -16972,7 +17136,7 @@ var QueryFilter = /* @__PURE__ */ defineComponent({
|
|
16972
17136
|
}
|
16973
17137
|
return void 0;
|
16974
17138
|
});
|
16975
|
-
const [collapsed, setCollapsed] = useMergedState$1(() => props.defaultCollapsed, {
|
17139
|
+
const [collapsed, setCollapsed] = useMergedState$1(() => props.defaultCollapsed && props.submitter !== false, {
|
16976
17140
|
value: computed(() => props.collapsed),
|
16977
17141
|
onChange: (val) => {
|
16978
17142
|
emit("collapse", val);
|
@@ -17071,7 +17235,10 @@ var QueryFilter = /* @__PURE__ */ defineComponent({
|
|
17071
17235
|
return {
|
17072
17236
|
...item,
|
17073
17237
|
hidden,
|
17074
|
-
formItemProps:
|
17238
|
+
formItemProps: {
|
17239
|
+
...item.title ? formItemFixStyle.value : {},
|
17240
|
+
...item.formItemProps
|
17241
|
+
},
|
17075
17242
|
colProps: {
|
17076
17243
|
span: colSpan
|
17077
17244
|
}
|
@@ -17101,7 +17268,7 @@ var QueryFilter = /* @__PURE__ */ defineComponent({
|
|
17101
17268
|
justify: "start",
|
17102
17269
|
class: `${prefixCls}-row`
|
17103
17270
|
},
|
17104
|
-
"
|
17271
|
+
"showLoading": false,
|
17105
17272
|
"submitter": submitterConfig.value,
|
17106
17273
|
"items": processedList.value,
|
17107
17274
|
"layout": spanSize.value.layout,
|
@@ -17115,9 +17282,16 @@ var QueryFilter = /* @__PURE__ */ defineComponent({
|
|
17115
17282
|
}), {
|
17116
17283
|
...slots,
|
17117
17284
|
submitter: ({
|
17285
|
+
props: props2,
|
17286
|
+
action,
|
17118
17287
|
defaultDoms
|
17119
17288
|
}) => {
|
17120
|
-
|
17289
|
+
var _a2;
|
17290
|
+
return createVNode(Fragment, null, [slots.submitter ? (_a2 = slots.submitter) == null ? void 0 : _a2.call(slots, {
|
17291
|
+
props: props2,
|
17292
|
+
action,
|
17293
|
+
defaultDoms
|
17294
|
+
}) : defaultDoms, needCollapse.value !== false && createVNode("a", {
|
17121
17295
|
"class": `${prefixCls}-collapse-button`,
|
17122
17296
|
"onClick": () => setCollapsed(!collapsed.value)
|
17123
17297
|
}, [collapsed.value ? intl.getMessage("form.collapsed", "\u5C55\u5F00") : intl.getMessage("form.expand", "\u6536\u8D77"), !!hiddenNum.value && `(${hiddenNum.value})`, createVNode(DownOutlined, {
|
@@ -17278,7 +17452,8 @@ var StepsForm = /* @__PURE__ */ defineComponent({
|
|
17278
17452
|
},
|
17279
17453
|
emits: [],
|
17280
17454
|
setup(props, {
|
17281
|
-
slots
|
17455
|
+
slots,
|
17456
|
+
expose
|
17282
17457
|
}) {
|
17283
17458
|
const intl = useIntl();
|
17284
17459
|
const prefixCls = usePrefixCls("steps-form");
|
@@ -17295,7 +17470,7 @@ var StepsForm = /* @__PURE__ */ defineComponent({
|
|
17295
17470
|
onChange: props.onCurrentChange
|
17296
17471
|
});
|
17297
17472
|
const regForm = (formRef, index) => {
|
17298
|
-
formArrayRef.value[index] = formRef;
|
17473
|
+
formArrayRef.value[index] = formRef.value;
|
17299
17474
|
};
|
17300
17475
|
const lastStep = computed(() => step.value === props.steps.length - 1);
|
17301
17476
|
const onFormFinish = async (name, formData) => {
|
@@ -17309,10 +17484,7 @@ var StepsForm = /* @__PURE__ */ defineComponent({
|
|
17309
17484
|
const success = await props.onFinish(values);
|
17310
17485
|
if (success) {
|
17311
17486
|
setStep(0);
|
17312
|
-
formArrayRef.value.forEach((form) =>
|
17313
|
-
var _a;
|
17314
|
-
return (_a = form.value) == null ? void 0 : _a.reset();
|
17315
|
-
});
|
17487
|
+
formArrayRef.value.forEach((form) => form == null ? void 0 : form.reset());
|
17316
17488
|
}
|
17317
17489
|
} catch (error) {
|
17318
17490
|
console.log(error);
|
@@ -17321,10 +17493,9 @@ var StepsForm = /* @__PURE__ */ defineComponent({
|
|
17321
17493
|
}
|
17322
17494
|
};
|
17323
17495
|
const onSubmit = () => {
|
17324
|
-
var _a;
|
17325
17496
|
const from = formArrayRef.value[step.value];
|
17326
17497
|
if (from) {
|
17327
|
-
|
17498
|
+
from == null ? void 0 : from.submit();
|
17328
17499
|
}
|
17329
17500
|
};
|
17330
17501
|
const prePage = () => {
|
@@ -17444,6 +17615,9 @@ var StepsForm = /* @__PURE__ */ defineComponent({
|
|
17444
17615
|
regForm,
|
17445
17616
|
onFormFinish
|
17446
17617
|
});
|
17618
|
+
expose({
|
17619
|
+
formArrayRef
|
17620
|
+
});
|
17447
17621
|
return () => createVNode("div", {
|
17448
17622
|
"class": prefixCls
|
17449
17623
|
}, [stepsFormDom.value]);
|
@@ -19575,6 +19749,7 @@ const useProvideHover = (props) => {
|
|
19575
19749
|
}, props.rowHoverDelay.value + 50);
|
19576
19750
|
};
|
19577
19751
|
const hoverContext = {
|
19752
|
+
rowHover: props.rowHover,
|
19578
19753
|
hoverColumnKey,
|
19579
19754
|
hoverRowKey,
|
19580
19755
|
handleCellHover,
|
@@ -19585,6 +19760,7 @@ const useProvideHover = (props) => {
|
|
19585
19760
|
};
|
19586
19761
|
const useInjectHover = () => {
|
19587
19762
|
return inject(HoverContextKey, {
|
19763
|
+
rowHover: computed(() => void 0),
|
19588
19764
|
hoverRowKey: ref(),
|
19589
19765
|
hoverColumnKey: ref(),
|
19590
19766
|
handleCellHover: () => {
|
@@ -19606,9 +19782,6 @@ const useProvideLevel = () => {
|
|
19606
19782
|
function is(val, type) {
|
19607
19783
|
return toString.call(val) === `[object ${type}]`;
|
19608
19784
|
}
|
19609
|
-
function isFunction(val) {
|
19610
|
-
return typeof val === "function";
|
19611
|
-
}
|
19612
19785
|
function isArray(val) {
|
19613
19786
|
return val && Array.isArray(val);
|
19614
19787
|
}
|
@@ -19802,9 +19975,6 @@ function deleteNestItemData(data, indexs, childrenColumnName) {
|
|
19802
19975
|
currentData.splice(indexs[indexsLen - 1], 1);
|
19803
19976
|
return currentData;
|
19804
19977
|
}
|
19805
|
-
function isPromise(val) {
|
19806
|
-
return is(val, "Promise") && isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
19807
|
-
}
|
19808
19978
|
function ensureValidVNode(vnodes) {
|
19809
19979
|
return vnodes.some(
|
19810
19980
|
(vnode) => !isVNode(vnode) || vnode.type !== Comment$1 && !(vnode.type === Fragment && !ensureValidVNode(vnode.children))
|
@@ -19887,7 +20057,8 @@ const baseTableProps = () => ({
|
|
19887
20057
|
type: [Number, String]
|
19888
20058
|
},
|
19889
20059
|
size: {
|
19890
|
-
type: String
|
20060
|
+
type: String,
|
20061
|
+
default: "middle"
|
19891
20062
|
},
|
19892
20063
|
bordered: {
|
19893
20064
|
type: Boolean,
|
@@ -19983,6 +20154,10 @@ const baseTableProps = () => ({
|
|
19983
20154
|
type: Number,
|
19984
20155
|
default: 59
|
19985
20156
|
},
|
20157
|
+
rowHover: {
|
20158
|
+
type: Boolean,
|
20159
|
+
default: void 0
|
20160
|
+
},
|
19986
20161
|
rowKey: {
|
19987
20162
|
type: [Function, String]
|
19988
20163
|
},
|
@@ -20097,6 +20272,9 @@ const baseTableProps = () => ({
|
|
20097
20272
|
"onUpdate:dataSource": {
|
20098
20273
|
type: Function
|
20099
20274
|
},
|
20275
|
+
"onUpdate:columns": {
|
20276
|
+
type: Function
|
20277
|
+
},
|
20100
20278
|
columnEmptyText: {
|
20101
20279
|
type: [String, Boolean],
|
20102
20280
|
default: "-"
|
@@ -20109,6 +20287,7 @@ const baseTableProps = () => ({
|
|
20109
20287
|
params: Object,
|
20110
20288
|
defaultData: Array,
|
20111
20289
|
manual: Boolean,
|
20290
|
+
manualRequest: Boolean,
|
20112
20291
|
polling: [Number, Function],
|
20113
20292
|
debounceTime: Number,
|
20114
20293
|
onLoad: {
|
@@ -20180,8 +20359,9 @@ const tableProps = () => ({
|
|
20180
20359
|
|
20181
20360
|
const mergePropsAndPagination = ({ pagination }, intl) => {
|
20182
20361
|
if (pagination) {
|
20183
|
-
const { current, pageSize, total, showTotal, showSizeChanger } = pagination;
|
20362
|
+
const { current, pageSize, total, showTotal, showSizeChanger, ...rest } = pagination;
|
20184
20363
|
return {
|
20364
|
+
...rest,
|
20185
20365
|
current: current || 1,
|
20186
20366
|
total: total || 0,
|
20187
20367
|
pageSize: pageSize || 10,
|
@@ -20225,19 +20405,16 @@ const formatSorters = (sorter) => {
|
|
20225
20405
|
}
|
20226
20406
|
);
|
20227
20407
|
}
|
20228
|
-
return result.map((item) => {
|
20229
|
-
|
20230
|
-
|
20231
|
-
|
20232
|
-
order: (_a = item.order) == null ? void 0 : _a.toUpperCase()
|
20233
|
-
};
|
20234
|
-
});
|
20408
|
+
return result.map((item) => ({
|
20409
|
+
field: item.field,
|
20410
|
+
order: item.order
|
20411
|
+
}));
|
20235
20412
|
};
|
20236
20413
|
const useFetchData = (getData, props) => {
|
20237
20414
|
var _a;
|
20238
20415
|
const umountRef = ref(false);
|
20239
20416
|
const abortRef = ref(null);
|
20240
|
-
const manualRequestRef = ref(!!props.manual);
|
20417
|
+
const manualRequestRef = ref(!!(props.manual || props.manualRequest));
|
20241
20418
|
const pollingSetTimeRef = ref();
|
20242
20419
|
const pollingLoading = ref(false);
|
20243
20420
|
const keyword = ref("");
|
@@ -20398,16 +20575,13 @@ const useFetchData = (getData, props) => {
|
|
20398
20575
|
}
|
20399
20576
|
}
|
20400
20577
|
);
|
20401
|
-
watch(
|
20402
|
-
()
|
20403
|
-
()
|
20404
|
-
|
20405
|
-
|
20406
|
-
if (!props.manual) {
|
20407
|
-
manualRequestRef.value = false;
|
20408
|
-
}
|
20578
|
+
watch([() => props.manual, () => props.manualRequest], () => {
|
20579
|
+
abortFetch();
|
20580
|
+
fetchListDebounce(false);
|
20581
|
+
if (!props.manual || !props.manualRequest) {
|
20582
|
+
manualRequestRef.value = false;
|
20409
20583
|
}
|
20410
|
-
);
|
20584
|
+
});
|
20411
20585
|
watch(
|
20412
20586
|
() => pagination.value.current,
|
20413
20587
|
() => {
|
@@ -20675,7 +20849,7 @@ const useContainer = (props) => {
|
|
20675
20849
|
var _a2;
|
20676
20850
|
return (_a2 = props.columnsState) == null ? void 0 : _a2.persistenceKey;
|
20677
20851
|
},
|
20678
|
-
columnsMap,
|
20852
|
+
() => columnsMap.value,
|
20679
20853
|
() => {
|
20680
20854
|
var _a2;
|
20681
20855
|
return (_a2 = props.columnsState) == null ? void 0 : _a2.persistenceType;
|
@@ -20736,8 +20910,8 @@ function genProColumnToColumn(params, parents) {
|
|
20736
20910
|
var _a;
|
20737
20911
|
const { columns, counter } = params;
|
20738
20912
|
return (_a = columns == null ? void 0 : columns.map((columnProps, columnsIndex) => {
|
20739
|
-
var _a2, _b;
|
20740
|
-
const { key, dataIndex, disable, valueEnum } = columnProps;
|
20913
|
+
var _a2, _b, _c;
|
20914
|
+
const { key, dataIndex, disable, valueEnum, width } = columnProps;
|
20741
20915
|
const columnKey = genColumnKey(
|
20742
20916
|
// key || (dataIndex ? `${dataIndex.toString()}-${columnsIndex}` : ''),
|
20743
20917
|
key || (dataIndex == null ? void 0 : dataIndex.toString()),
|
@@ -20752,12 +20926,13 @@ function genProColumnToColumn(params, parents) {
|
|
20752
20926
|
...columnProps,
|
20753
20927
|
valueEnum,
|
20754
20928
|
fixed: config.fixed,
|
20755
|
-
|
20929
|
+
width: (_a2 = config.width) != null ? _a2 : width,
|
20930
|
+
disable: (_b = config.disable) != null ? _b : disable,
|
20756
20931
|
// width: columnProps.width || (columnProps.fixed ? 200 : undefined),
|
20757
20932
|
children: columnProps.children ? genProColumnToColumn(
|
20758
20933
|
{
|
20759
20934
|
...params,
|
20760
|
-
columns: (
|
20935
|
+
columns: (_c = columnProps == null ? void 0 : columnProps.children) != null ? _c : []
|
20761
20936
|
},
|
20762
20937
|
{ ...columnProps, key: columnKey }
|
20763
20938
|
) : void 0
|
@@ -24292,6 +24467,7 @@ function useFlattenRecords(pageDataRef, childrenColumnNameRef, expandedKeysRef,
|
|
24292
24467
|
}
|
24293
24468
|
|
24294
24469
|
const DEFAULT_PAGE_SIZE = 10;
|
24470
|
+
const PAGE_SIZE_OPTIONS = ["5", "10", "20", "50"];
|
24295
24471
|
function getPaginationParam(pagination, mergedPagination) {
|
24296
24472
|
const param = {
|
24297
24473
|
current: mergedPagination.current,
|
@@ -24321,7 +24497,11 @@ function extendsObject(...list) {
|
|
24321
24497
|
return result;
|
24322
24498
|
}
|
24323
24499
|
function usePagination(total, props, mergedData, onChange) {
|
24324
|
-
const innerPagination = reactive({
|
24500
|
+
const innerPagination = reactive({
|
24501
|
+
current: 1,
|
24502
|
+
pageSize: DEFAULT_PAGE_SIZE,
|
24503
|
+
pageSizeOptions: PAGE_SIZE_OPTIONS
|
24504
|
+
});
|
24325
24505
|
const size = computed(() => props.size);
|
24326
24506
|
const mergedPagination = computed(() => {
|
24327
24507
|
const { pagination } = props;
|
@@ -24551,7 +24731,9 @@ const useCellProps = ({
|
|
24551
24731
|
if (copyCustomCellProps.rowSpan > 1) {
|
24552
24732
|
mergeCellStyles.height = `${getRowHeight(rowIndex, copyCustomCellProps.rowSpan) - 1}px`;
|
24553
24733
|
}
|
24554
|
-
cellProps.props = Object.assign({}, copyCustomCellProps, {
|
24734
|
+
cellProps.props = Object.assign({}, copyCustomCellProps, {
|
24735
|
+
style: { ...copyCustomCellProps.style, ...mergeCellStyles }
|
24736
|
+
});
|
24555
24737
|
return cellProps;
|
24556
24738
|
};
|
24557
24739
|
watchEffect(() => {
|
@@ -25576,6 +25758,7 @@ var _sfc_main$A = defineComponent({
|
|
25576
25758
|
var _a, _b;
|
25577
25759
|
return [
|
25578
25760
|
typeof props.column.title == "function" ? props.column.title({
|
25761
|
+
column: props.column.originColumn,
|
25579
25762
|
sortColumns: sortColumns.value,
|
25580
25763
|
sortColumn: (_a = sortColumns.value[0]) == null ? void 0 : _a.column,
|
25581
25764
|
sortOrder: (_b = sortColumns.value[0]) == null ? void 0 : _b.order
|
@@ -25630,7 +25813,7 @@ function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) {
|
|
25630
25813
|
[`${_ctx.prefixCls}-header-cell-title-inner`]: true
|
25631
25814
|
}),
|
25632
25815
|
title: _ctx.altTitle,
|
25633
|
-
style: normalizeStyle(`
|
25816
|
+
style: normalizeStyle(`justify-content: ${_ctx.column.align}`)
|
25634
25817
|
}, [
|
25635
25818
|
createElementVNode(
|
25636
25819
|
"span",
|
@@ -25676,16 +25859,28 @@ function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) {
|
|
25676
25859
|
1040
|
25677
25860
|
/* FULL_PROPS, DYNAMIC_SLOTS */
|
25678
25861
|
)) : createCommentVNode("v-if", true),
|
25679
|
-
_ctx.column.headerTooltip ? (openBlock(), createBlock(_component_Tooltip, {
|
25680
|
-
|
25681
|
-
|
25682
|
-
|
25862
|
+
_ctx.column.headerTooltip ? (openBlock(), createBlock(_component_Tooltip, { key: 1 }, {
|
25863
|
+
title: withCtx(() => [
|
25864
|
+
_ctx.column.headerTooltip === true ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.title), { key: 0 })) : (openBlock(), createElementBlock(
|
25865
|
+
Fragment,
|
25866
|
+
{ key: 1 },
|
25867
|
+
[
|
25868
|
+
createTextVNode(
|
25869
|
+
toDisplayString(_ctx.column.headerTooltip),
|
25870
|
+
1
|
25871
|
+
/* TEXT */
|
25872
|
+
)
|
25873
|
+
],
|
25874
|
+
64
|
25875
|
+
/* STABLE_FRAGMENT */
|
25876
|
+
))
|
25877
|
+
]),
|
25683
25878
|
default: withCtx(() => [
|
25684
25879
|
createVNode(_component_InfoCircleOutlined, { style: { "margin-inline-start": "3px", "font-size": "12px" } })
|
25685
25880
|
]),
|
25686
25881
|
_: 1
|
25687
25882
|
/* STABLE */
|
25688
|
-
}
|
25883
|
+
})) : createCommentVNode("v-if", true)
|
25689
25884
|
], 14, _hoisted_1$d);
|
25690
25885
|
}
|
25691
25886
|
var HeaderCellTitle = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["render", _sfc_render$w]]);
|
@@ -26870,6 +27065,7 @@ var _sfc_main$u = defineComponent({
|
|
26870
27065
|
var _a, _b;
|
26871
27066
|
return h(Fragment, [
|
26872
27067
|
typeof props.column.title == "function" ? props.column.title({
|
27068
|
+
column: props.column.originColumn,
|
26873
27069
|
sortColumns: sortColumns.value,
|
26874
27070
|
sortColumn: (_a = sortColumns.value[0]) == null ? void 0 : _a.column,
|
26875
27071
|
sortOrder: (_b = sortColumns.value[0]) == null ? void 0 : _b.order
|
@@ -28299,28 +28495,29 @@ var _sfc_main$n = defineComponent({
|
|
28299
28495
|
event: rowDragEvent.value
|
28300
28496
|
});
|
28301
28497
|
}
|
28498
|
+
} else {
|
28499
|
+
return [
|
28500
|
+
createVNode(
|
28501
|
+
"span",
|
28502
|
+
{ class: `${prefixCls.value}-drag-ghost-image-icon`, innerHTML: dragIcon2 },
|
28503
|
+
null
|
28504
|
+
),
|
28505
|
+
createVNode(
|
28506
|
+
"span",
|
28507
|
+
{
|
28508
|
+
class: `${prefixCls.value}-drag-ghost-image-label`,
|
28509
|
+
style: { maxWidth: `${parentOffsetWidth}px` }
|
28510
|
+
},
|
28511
|
+
[(_a = slots.label) == null ? void 0 : _a.call(slots)]
|
28512
|
+
)
|
28513
|
+
];
|
28302
28514
|
}
|
28303
|
-
return [
|
28304
|
-
createVNode(
|
28305
|
-
"span",
|
28306
|
-
{ class: `${prefixCls.value}-drag-ghost-image-icon`, innerHTML: dragIcon2 },
|
28307
|
-
null
|
28308
|
-
),
|
28309
|
-
createVNode(
|
28310
|
-
"span",
|
28311
|
-
{
|
28312
|
-
class: `${prefixCls.value}-drag-ghost-image-label`,
|
28313
|
-
style: { maxWidth: `${parentOffsetWidth}px` }
|
28314
|
-
},
|
28315
|
-
[(_a = slots.label) == null ? void 0 : _a.call(slots)]
|
28316
|
-
)
|
28317
|
-
];
|
28318
28515
|
};
|
28319
28516
|
const renderDragGhost = () => {
|
28320
28517
|
if (!dragGhostImage) {
|
28321
28518
|
dragGhostImage = createVNode(renderDragGhostImage);
|
28519
|
+
render$1(dragGhostImage, dragGhostDom);
|
28322
28520
|
}
|
28323
|
-
render$1(dragGhostImage, dragGhostDom);
|
28324
28521
|
};
|
28325
28522
|
watch(
|
28326
28523
|
[prefixCls],
|
@@ -28726,7 +28923,7 @@ var _sfc_main$m = defineComponent({
|
|
28726
28923
|
newValue: modelValue.value,
|
28727
28924
|
oldValue
|
28728
28925
|
});
|
28729
|
-
if (isPromise
|
28926
|
+
if (isPromise(result)) {
|
28730
28927
|
result.then((res) => {
|
28731
28928
|
res && emit("closeEditor", [props.cellKey]);
|
28732
28929
|
}).catch(() => {
|
@@ -28946,7 +29143,7 @@ const BodyCell = (props, { slots, emit }) => {
|
|
28946
29143
|
recordIndexs
|
28947
29144
|
})) != null ? _c2 : value;
|
28948
29145
|
const beforeOpen = (_e2 = (_d2 = tableContext.props) == null ? void 0 : _d2.onBeforeOpenEditor) == null ? void 0 : _e2.call(_d2, cellRenderArgs);
|
28949
|
-
if (isPromise
|
29146
|
+
if (isPromise(beforeOpen)) {
|
28950
29147
|
beforeOpen.then((res) => {
|
28951
29148
|
var _a3, _b3;
|
28952
29149
|
if (res) {
|
@@ -28967,7 +29164,7 @@ const BodyCell = (props, { slots, emit }) => {
|
|
28967
29164
|
...cellRenderArgs,
|
28968
29165
|
oldValue: oldValuesMap.value[key]
|
28969
29166
|
});
|
28970
|
-
if (isPromise
|
29167
|
+
if (isPromise(beforeClose)) {
|
28971
29168
|
beforeClose.then((res) => {
|
28972
29169
|
var _a3, _b3;
|
28973
29170
|
if (res) {
|
@@ -29021,7 +29218,7 @@ const BodyCell = (props, { slots, emit }) => {
|
|
29021
29218
|
color: option.color,
|
29022
29219
|
bordered: false
|
29023
29220
|
},
|
29024
|
-
option.text
|
29221
|
+
() => option.text
|
29025
29222
|
);
|
29026
29223
|
} else {
|
29027
29224
|
cellValue = option.text || emptyText;
|
@@ -29094,7 +29291,7 @@ const BodyCell = (props, { slots, emit }) => {
|
|
29094
29291
|
// }),
|
29095
29292
|
shouldOpen: (isEllipsis) => {
|
29096
29293
|
var _a2;
|
29097
|
-
return (tooltipProps == null ? void 0 : tooltipProps.shouldOpen) ? (_a2 = tooltipProps == null ? void 0 : tooltipProps.shouldOpen) == null ? void 0 : _a2.call(tooltipProps, isEllipsis, cellRenderArgs) :
|
29294
|
+
return (tooltipProps == null ? void 0 : tooltipProps.shouldOpen) ? (_a2 = tooltipProps == null ? void 0 : tooltipProps.shouldOpen) == null ? void 0 : _a2.call(tooltipProps, isEllipsis, cellRenderArgs) : true;
|
29098
29295
|
},
|
29099
29296
|
onCellLeave: () => {
|
29100
29297
|
emit("cellLeave");
|
@@ -29726,7 +29923,7 @@ var _sfc_main$i = defineComponent({
|
|
29726
29923
|
() => (props.type === "center" ? tableContext.centerRowColumnsMap.value.get(props.rowKey) : columns.value).filter((item) => !!item)
|
29727
29924
|
);
|
29728
29925
|
const { tooltipOpen, leftPopupContainer, centerPopupContainer, rightPopupContainer } = useInjectBody();
|
29729
|
-
const { handleCellBlur, handleCellHover, hoverRowKey, hoverColumnKey } = useInjectHover();
|
29926
|
+
const { handleCellBlur, handleCellHover, hoverRowKey, hoverColumnKey, rowHover } = useInjectHover();
|
29730
29927
|
const popupContainer = computed(
|
29731
29928
|
() => props.type === "left" ? leftPopupContainer.value : props.type === "center" ? centerPopupContainer.value : props.type === "right" ? rightPopupContainer.value : null
|
29732
29929
|
);
|
@@ -29735,7 +29932,7 @@ var _sfc_main$i = defineComponent({
|
|
29735
29932
|
watch(
|
29736
29933
|
[isRowHover, bodyRow],
|
29737
29934
|
() => {
|
29738
|
-
bodyRow.value && (isRowHover.value ? addClass(bodyRow.value, `${props.prefixCls}-row-hover`) : removeClass(bodyRow.value, `${props.prefixCls}-row-hover`));
|
29935
|
+
bodyRow.value && rowHover.value && (isRowHover.value ? addClass(bodyRow.value, `${props.prefixCls}-row-hover`) : removeClass(bodyRow.value, `${props.prefixCls}-row-hover`));
|
29739
29936
|
},
|
29740
29937
|
{ immediate: true, flush: "post" }
|
29741
29938
|
);
|
@@ -29802,7 +29999,7 @@ var _sfc_main$i = defineComponent({
|
|
29802
29999
|
{
|
29803
30000
|
[`${prefixCls}-row`]: true,
|
29804
30001
|
[`${prefixCls}-row-level-${indent}`]: true,
|
29805
|
-
[`${prefixCls}-row-hover`]: isRowHover.value,
|
30002
|
+
[`${prefixCls}-row-hover`]: isRowHover.value && rowHover.value,
|
29806
30003
|
[`${prefixCls}-row-dragging`]: isDragging.value,
|
29807
30004
|
[`${prefixCls}-row-dragging-insert-target`]: tableContext.insertToRowKey.value === props.rowKey,
|
29808
30005
|
[`${prefixCls}-row-odd`]: !isEven,
|
@@ -30479,8 +30676,7 @@ var _sfc_main$g = defineComponent({
|
|
30479
30676
|
};
|
30480
30677
|
});
|
30481
30678
|
const bodyViewportStyle = computed(() => ({
|
30482
|
-
width: `calc(100% + ${tableContext.showVerticalScrollbar.value ? tableContext.scrollBarSize.value
|
30483
|
-
// width: `calc(100% + 0px)`,
|
30679
|
+
width: `calc(100% + ${tableContext.showVerticalScrollbar.value ? tableContext.scrollBarSize.value : 0}px)`,
|
30484
30680
|
overflowX: "hidden",
|
30485
30681
|
overflowY: "auto",
|
30486
30682
|
height: "100%"
|
@@ -31766,9 +31962,14 @@ var _sfc_main$f = defineComponent({
|
|
31766
31962
|
var _a;
|
31767
31963
|
const width = col.width;
|
31768
31964
|
const result = (_a = props.onResizeColumn) == null ? void 0 : _a.call(props, w, col, action);
|
31769
|
-
if (result !== false
|
31770
|
-
|
31771
|
-
|
31965
|
+
if (result !== false) {
|
31966
|
+
if (!(width === w && col.width === w)) {
|
31967
|
+
col.width = width !== col.width ? col.width : w;
|
31968
|
+
triggerRef(rawColumns);
|
31969
|
+
}
|
31970
|
+
if (action === "end") {
|
31971
|
+
emit("update:columns", rawColumns.value, "resize");
|
31972
|
+
}
|
31772
31973
|
}
|
31773
31974
|
},
|
31774
31975
|
onRowDragEnd: (opt) => {
|
@@ -31942,7 +32143,7 @@ var _sfc_main$f = defineComponent({
|
|
31942
32143
|
rawColumns.value.splice(index, 1);
|
31943
32144
|
}
|
31944
32145
|
triggerRef(rawColumns);
|
31945
|
-
emit("update:columns", rawColumns.value);
|
32146
|
+
emit("update:columns", rawColumns.value, "drag");
|
31946
32147
|
};
|
31947
32148
|
if (isPromise(dragEnd)) {
|
31948
32149
|
dragEnd.then(() => {
|
@@ -33183,10 +33384,18 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
33183
33384
|
class: normalizeClass(`${_ctx.prefixCls}-toolbar-options`)
|
33184
33385
|
}, {
|
33185
33386
|
default: withCtx(() => [
|
33186
|
-
_ctx.mergeOptions.search !== false && !(!!_ctx.title || !!_ctx.$slots.title) ? (openBlock(),
|
33187
|
-
|
33188
|
-
|
33189
|
-
|
33387
|
+
_ctx.mergeOptions.search !== false && !(!!_ctx.title || !!_ctx.$slots.title) ? (openBlock(), createElementBlock(
|
33388
|
+
Fragment,
|
33389
|
+
{ key: 0 },
|
33390
|
+
[
|
33391
|
+
createVNode(_component_ProSearch, mergeProps(_ctx.searchConfig, { onSearch: _ctx.onSearch }), null, 16, ["onSearch"]),
|
33392
|
+
renderSlot(_ctx.$slots, "searchExtra", {
|
33393
|
+
setParams: _ctx.actionsRef.setParams
|
33394
|
+
})
|
33395
|
+
],
|
33396
|
+
64
|
33397
|
+
/* STABLE_FRAGMENT */
|
33398
|
+
)) : createCommentVNode("v-if", true)
|
33190
33399
|
]),
|
33191
33400
|
_: 3
|
33192
33401
|
/* FORWARDED */
|
@@ -33205,7 +33414,18 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
33205
33414
|
class: normalizeClass(`${_ctx.prefixCls}-toolbar-actions`)
|
33206
33415
|
}, {
|
33207
33416
|
default: withCtx(() => [
|
33208
|
-
_ctx.mergeOptions.search !== false && (!!_ctx.title || !!_ctx.$slots.title) ? (openBlock(),
|
33417
|
+
_ctx.mergeOptions.search !== false && (!!_ctx.title || !!_ctx.$slots.title) ? (openBlock(), createElementBlock(
|
33418
|
+
Fragment,
|
33419
|
+
{ key: 0 },
|
33420
|
+
[
|
33421
|
+
createVNode(_component_ProSearch, mergeProps(_ctx.searchConfig, { onSearch: _ctx.onSearch }), null, 16, ["onSearch"]),
|
33422
|
+
renderSlot(_ctx.$slots, "searchExtra", {
|
33423
|
+
setParams: _ctx.actionsRef.setParams
|
33424
|
+
})
|
33425
|
+
],
|
33426
|
+
64
|
33427
|
+
/* STABLE_FRAGMENT */
|
33428
|
+
)) : createCommentVNode("v-if", true),
|
33209
33429
|
renderSlot(_ctx.$slots, "actions", {
|
33210
33430
|
setParams: _ctx.actionsRef.setParams
|
33211
33431
|
}),
|
@@ -33524,7 +33744,8 @@ var Table = /* @__PURE__ */ defineComponent({
|
|
33524
33744
|
const {
|
33525
33745
|
hoverRowKey
|
33526
33746
|
} = useProvideHover({
|
33527
|
-
rowHoverDelay: computed(() => props.rowHoverDelay)
|
33747
|
+
rowHoverDelay: computed(() => props.rowHoverDelay),
|
33748
|
+
rowHover: computed(() => props.rowHover)
|
33528
33749
|
});
|
33529
33750
|
const mergedPrefixCls = computed(() => {
|
33530
33751
|
var _a2;
|
@@ -33568,10 +33789,7 @@ var Table = /* @__PURE__ */ defineComponent({
|
|
33568
33789
|
if (props.pagination === false) {
|
33569
33790
|
return false;
|
33570
33791
|
}
|
33571
|
-
|
33572
|
-
return Object.assign({}, pagination.value, props.pagination);
|
33573
|
-
}
|
33574
|
-
return Object.assign({}, props.pagination, pagination.value);
|
33792
|
+
return pagination.value;
|
33575
33793
|
});
|
33576
33794
|
const formSubmitLoading = computed(() => {
|
33577
33795
|
if (typeof loading.value === "boolean") {
|
@@ -33633,9 +33851,44 @@ var Table = /* @__PURE__ */ defineComponent({
|
|
33633
33851
|
};
|
33634
33852
|
return loopFilter(tableColumn.value);
|
33635
33853
|
});
|
33854
|
+
const onColumnsChange = (rawColumns, action) => {
|
33855
|
+
var _a2;
|
33856
|
+
const newMap = {
|
33857
|
+
...counter.columnsMap.value
|
33858
|
+
};
|
33859
|
+
const newColumns = rawColumns.map((item) => genColumnKey(item.key, item.index));
|
33860
|
+
if (action === "resize") {
|
33861
|
+
const loopSetWidth = (rawColumns2) => {
|
33862
|
+
rawColumns2.forEach((item) => {
|
33863
|
+
var _a3;
|
33864
|
+
const key = genColumnKey(item.key, item.index);
|
33865
|
+
const newSetting = {
|
33866
|
+
...newMap[key]
|
33867
|
+
};
|
33868
|
+
if ((_a3 = item.children) == null ? void 0 : _a3.length) {
|
33869
|
+
loopSetWidth(item.children);
|
33870
|
+
} else {
|
33871
|
+
newSetting.width = item.width;
|
33872
|
+
newMap[key] = newSetting;
|
33873
|
+
}
|
33874
|
+
});
|
33875
|
+
};
|
33876
|
+
loopSetWidth(rawColumns);
|
33877
|
+
} else {
|
33878
|
+
newColumns.forEach((key, order) => {
|
33879
|
+
newMap[key] = {
|
33880
|
+
...newMap[key] || {},
|
33881
|
+
order
|
33882
|
+
};
|
33883
|
+
});
|
33884
|
+
}
|
33885
|
+
counter.setColumnsMap(newMap);
|
33886
|
+
counter.setSortKeyColumns(newColumns);
|
33887
|
+
(_a2 = props["onUpdate:columns"]) == null ? void 0 : _a2.call(props, rawColumns, action);
|
33888
|
+
};
|
33636
33889
|
const formItems = computed(() => {
|
33637
33890
|
var _a2, _b, _c;
|
33638
|
-
if (
|
33891
|
+
if (props.search === false) {
|
33639
33892
|
return [];
|
33640
33893
|
}
|
33641
33894
|
if ((_b = (_a2 = props.search) == null ? void 0 : _a2.items) == null ? void 0 : _b.length) {
|
@@ -33647,12 +33900,12 @@ var Table = /* @__PURE__ */ defineComponent({
|
|
33647
33900
|
}
|
33648
33901
|
return true;
|
33649
33902
|
}).map((item) => {
|
33650
|
-
return {
|
33903
|
+
return omitKeysAndUndefined({
|
33651
33904
|
...item,
|
33652
33905
|
width: void 0,
|
33653
33906
|
tooltip: item.headerTooltip,
|
33654
33907
|
name: item.dataIndex
|
33655
|
-
};
|
33908
|
+
}, ["dataIndex", "width"]);
|
33656
33909
|
});
|
33657
33910
|
});
|
33658
33911
|
const preserveRecordsRef = ref(/* @__PURE__ */ new Map());
|
@@ -33669,8 +33922,8 @@ var Table = /* @__PURE__ */ defineComponent({
|
|
33669
33922
|
}
|
33670
33923
|
onCleanSelected();
|
33671
33924
|
});
|
33672
|
-
const [selectedRowKeys, setSelectedRowKeys] = useMergedState(props.rowSelection ? ((_a = props.rowSelection) == null ? void 0 : _a.defaultSelectedRowKeys) || [] : void 0, {
|
33673
|
-
value: computed(() => props.rowSelection ? props.rowSelection.selectedRowKeys : void 0)
|
33925
|
+
const [selectedRowKeys, setSelectedRowKeys] = useMergedState(props.selectedRowKeys || (props.rowSelection ? ((_a = props.rowSelection) == null ? void 0 : _a.defaultSelectedRowKeys) || [] : void 0), {
|
33926
|
+
value: computed(() => props.selectedRowKeys || (props.rowSelection ? props.rowSelection.selectedRowKeys : void 0))
|
33674
33927
|
});
|
33675
33928
|
const rowSelection = computed(() => ({
|
33676
33929
|
selectedRowKeys: selectedRowKeys.value,
|
@@ -33807,7 +34060,7 @@ var Table = /* @__PURE__ */ defineComponent({
|
|
33807
34060
|
actions: slots.alertActions
|
33808
34061
|
}), createVNode(InteralTable, mergeProps({
|
33809
34062
|
"ref": table
|
33810
|
-
}, omit(props, ["onChange", "onUpdate:pagination", "onUpdate:selectedRowKeys"]), {
|
34063
|
+
}, omit(props, ["onChange", "onUpdate:pagination", "onUpdate:selectedRowKeys", "onUpdate:columns"]), {
|
33811
34064
|
"prefixCls": mergedPrefixCls.value,
|
33812
34065
|
"columns": mergeColumns || [],
|
33813
34066
|
"size": counter.tableSize.value,
|
@@ -33818,7 +34071,8 @@ var Table = /* @__PURE__ */ defineComponent({
|
|
33818
34071
|
"expandIcon": expandIcon,
|
33819
34072
|
"expandedRowRender": expandedRowRender,
|
33820
34073
|
"hasContextmenuPopup": !!slots.contextmenuPopup,
|
33821
|
-
"onChange": onTableChange
|
34074
|
+
"onChange": onTableChange,
|
34075
|
+
"onUpdate:columns": onColumnsChange
|
33822
34076
|
}), {
|
33823
34077
|
...slots,
|
33824
34078
|
footer: props.footer || slots.footer
|
@@ -33847,7 +34101,7 @@ var Table = /* @__PURE__ */ defineComponent({
|
|
33847
34101
|
"tableShowCard": props.cardProps !== false,
|
33848
34102
|
"loading": formSubmitLoading.value,
|
33849
34103
|
"beforeSearchSubmit": props.beforeSearchSubmit,
|
33850
|
-
"manual": props.manual,
|
34104
|
+
"manual": props.manual || props.manualRequest,
|
33851
34105
|
"onReset": props.onReset,
|
33852
34106
|
"onSubmit": props.onSubmit,
|
33853
34107
|
"onFormSearchSubmit": onFormSearchSubmit,
|
@@ -34688,6 +34942,10 @@ var FormColWrapper = /* @__PURE__ */ defineComponent({
|
|
34688
34942
|
colProps: {
|
34689
34943
|
type: Object,
|
34690
34944
|
default: void 0
|
34945
|
+
},
|
34946
|
+
grid: {
|
34947
|
+
type: Boolean,
|
34948
|
+
default: void 0
|
34691
34949
|
}
|
34692
34950
|
},
|
34693
34951
|
setup(props, {
|
@@ -34701,9 +34959,13 @@ var FormColWrapper = /* @__PURE__ */ defineComponent({
|
|
34701
34959
|
var _a;
|
34702
34960
|
return (_a = props.colProps) != null ? _a : colProps == null ? void 0 : colProps.value;
|
34703
34961
|
});
|
34962
|
+
const mergeGrid = computed(() => {
|
34963
|
+
var _a;
|
34964
|
+
return (_a = props.grid) != null ? _a : grid == null ? void 0 : grid.value;
|
34965
|
+
});
|
34704
34966
|
return () => {
|
34705
34967
|
var _a;
|
34706
|
-
if (
|
34968
|
+
if (mergeGrid.value) {
|
34707
34969
|
return createVNode(Col, mergeColProps.value, {
|
34708
34970
|
default: () => {
|
34709
34971
|
var _a2;
|
@@ -34725,7 +34987,7 @@ var FormTitle = /* @__PURE__ */ defineComponent({
|
|
34725
34987
|
default: void 0
|
34726
34988
|
},
|
34727
34989
|
tooltip: {
|
34728
|
-
type: String,
|
34990
|
+
type: [String, Boolean],
|
34729
34991
|
default: ""
|
34730
34992
|
}
|
34731
34993
|
},
|
@@ -34743,12 +35005,17 @@ var FormTitle = /* @__PURE__ */ defineComponent({
|
|
34743
35005
|
"props": {
|
34744
35006
|
formData: formData.value
|
34745
35007
|
}
|
34746
|
-
}, null)]), props.tooltip && createVNode(Tooltip, {
|
34747
|
-
"title": props.tooltip
|
34748
|
-
}, {
|
35008
|
+
}, null)]), props.tooltip && createVNode(Tooltip, null, {
|
34749
35009
|
default: () => [createVNode(QuestionCircleOutlined, {
|
34750
|
-
"class": `${prefixCls}-item-tooltip
|
34751
|
-
|
35010
|
+
"class": `${prefixCls}-item-tooltip`,
|
35011
|
+
"style": "margin-right: 3px"
|
35012
|
+
}, null)],
|
35013
|
+
title: () => props.tooltip === true ? createVNode(RenderVNode$1, {
|
35014
|
+
"vnode": title.value,
|
35015
|
+
"props": {
|
35016
|
+
formData: formData.value
|
35017
|
+
}
|
35018
|
+
}, null) : props.tooltip
|
34752
35019
|
})]);
|
34753
35020
|
}
|
34754
35021
|
});
|
@@ -34765,7 +35032,7 @@ var FormGroup = /* @__PURE__ */ defineComponent({
|
|
34765
35032
|
default: void 0
|
34766
35033
|
},
|
34767
35034
|
tooltip: {
|
34768
|
-
type: String,
|
35035
|
+
type: [String, Boolean],
|
34769
35036
|
default: void 0
|
34770
35037
|
},
|
34771
35038
|
colProps: {
|
@@ -34869,25 +35136,18 @@ var FormGroup$1 = /*#__PURE__*/Object.freeze({
|
|
34869
35136
|
function useFieldValue({
|
34870
35137
|
namePath,
|
34871
35138
|
initialValue,
|
34872
|
-
convertValue
|
34873
|
-
transform
|
35139
|
+
convertValue
|
34874
35140
|
}) {
|
34875
35141
|
const fieldValue = shallowRef();
|
34876
|
-
const { formData, initialValues
|
35142
|
+
const { formData, initialValues } = useInjectForm();
|
34877
35143
|
const modelValue = computed(() => get(formData.value, namePath.value));
|
34878
35144
|
const onValueChange = (value) => {
|
34879
|
-
set(
|
34880
|
-
formData.value,
|
34881
|
-
namePath.value,
|
34882
|
-
transform ? transform(value, namePath.value, formData.value) : value
|
34883
|
-
);
|
35145
|
+
set(formData.value, namePath.value, value);
|
34884
35146
|
};
|
34885
35147
|
watch(
|
34886
35148
|
modelValue,
|
34887
35149
|
(newValue) => {
|
34888
|
-
fieldValue.value = cloneDeep(
|
34889
|
-
convertValue ? convertValue(newValue, namePath.value) : newValue
|
34890
|
-
);
|
35150
|
+
fieldValue.value = cloneDeep(newValue);
|
34891
35151
|
},
|
34892
35152
|
{
|
34893
35153
|
immediate: true,
|
@@ -34896,11 +35156,14 @@ function useFieldValue({
|
|
34896
35156
|
);
|
34897
35157
|
const initFieldInitialValue = () => {
|
34898
35158
|
var _a;
|
34899
|
-
if (
|
34900
|
-
|
35159
|
+
if (
|
35160
|
+
// !mountedRef.value &&
|
35161
|
+
typeof modelValue.value === "undefined" && typeof initialValue !== "undefined"
|
35162
|
+
) {
|
35163
|
+
const value = convertValue ? convertValue(initialValue, namePath.value) : initialValue;
|
34901
35164
|
set(formData.value, namePath.value, cloneDeep(value));
|
34902
|
-
set((_a = initialValues == null ? void 0 : initialValues.value) != null ? _a : {}, namePath.value, cloneDeep(
|
34903
|
-
fieldValue.value =
|
35165
|
+
set((_a = initialValues == null ? void 0 : initialValues.value) != null ? _a : {}, namePath.value, cloneDeep(initialValue));
|
35166
|
+
fieldValue.value = value;
|
34904
35167
|
}
|
34905
35168
|
};
|
34906
35169
|
initFieldInitialValue();
|
@@ -34929,7 +35192,7 @@ var FormSet = /* @__PURE__ */ defineComponent({
|
|
34929
35192
|
default: void 0
|
34930
35193
|
},
|
34931
35194
|
tooltip: {
|
34932
|
-
type: String,
|
35195
|
+
type: [String, Boolean],
|
34933
35196
|
default: void 0
|
34934
35197
|
},
|
34935
35198
|
colProps: {
|
@@ -35343,7 +35606,7 @@ var FormListContainer = /* @__PURE__ */ defineComponent({
|
|
35343
35606
|
default: void 0
|
35344
35607
|
},
|
35345
35608
|
tooltip: {
|
35346
|
-
type: String,
|
35609
|
+
type: [String, Boolean],
|
35347
35610
|
default: void 0
|
35348
35611
|
},
|
35349
35612
|
readonly: {
|
@@ -35610,7 +35873,7 @@ var FormList = /* @__PURE__ */ defineComponent({
|
|
35610
35873
|
default: void 0
|
35611
35874
|
},
|
35612
35875
|
tooltip: {
|
35613
|
-
type: String,
|
35876
|
+
type: [String, Boolean],
|
35614
35877
|
default: void 0
|
35615
35878
|
},
|
35616
35879
|
colProps: {
|
@@ -36440,6 +36703,10 @@ var FormItem = /* @__PURE__ */ defineComponent({
|
|
36440
36703
|
item: {
|
36441
36704
|
type: Object,
|
36442
36705
|
default: () => ({})
|
36706
|
+
},
|
36707
|
+
grid: {
|
36708
|
+
type: Boolean,
|
36709
|
+
default: void 0
|
36443
36710
|
}
|
36444
36711
|
},
|
36445
36712
|
setup(props) {
|
@@ -36474,6 +36741,10 @@ var FormItem = /* @__PURE__ */ defineComponent({
|
|
36474
36741
|
transform: props.item.transform
|
36475
36742
|
});
|
36476
36743
|
const fieldRef = ref();
|
36744
|
+
const mergeGrid = computed(() => {
|
36745
|
+
var _a;
|
36746
|
+
return (_a = props.grid) != null ? _a : grid == null ? void 0 : grid.value;
|
36747
|
+
});
|
36477
36748
|
const fieldType = computed(() => {
|
36478
36749
|
var _a;
|
36479
36750
|
return (_a = props.item.fieldType) != null ? _a : "text";
|
@@ -36530,7 +36801,7 @@ var FormItem = /* @__PURE__ */ defineComponent({
|
|
36530
36801
|
disabled: ((_e = runFunction((_d = props.item.disabled) != null ? _d : baseProps == null ? void 0 : baseProps.disabled, formData.value, rowData == null ? void 0 : rowData.value)) != null ? _e : allDisabledKeys.value.includes(props.item.key)) ? true : void 0,
|
36531
36802
|
placeholder: (_f = props.item.placeholder) != null ? _f : baseProps == null ? void 0 : baseProps.placeholder,
|
36532
36803
|
options: (_h = (_g = props.item.options) != null ? _g : baseProps == null ? void 0 : baseProps.options) != null ? _h : baseProps == null ? void 0 : baseProps.treeData,
|
36533
|
-
allowClear: (_j = (_i = props.item.allowClear) != null ? _i : baseProps == null ? void 0 : baseProps.allowClear) != null ? _j :
|
36804
|
+
allowClear: (_j = (_i = props.item.allowClear) != null ? _i : baseProps == null ? void 0 : baseProps.allowClear) != null ? _j : true
|
36534
36805
|
};
|
36535
36806
|
return omitUndefined({
|
36536
36807
|
valueEnum: props.item.valueEnum,
|
@@ -36556,7 +36827,7 @@ var FormItem = /* @__PURE__ */ defineComponent({
|
|
36556
36827
|
};
|
36557
36828
|
if (props.item.width && !fieldWidthSizeMap[props.item.width]) {
|
36558
36829
|
newStyle.width = isNumber$2(props.item.width) ? props.item.width + "px" : props.item.width;
|
36559
|
-
} else if (
|
36830
|
+
} else if (mergeGrid == null ? void 0 : mergeGrid.value) {
|
36560
36831
|
newStyle.maxWidth = "100%";
|
36561
36832
|
newStyle.width = "100%";
|
36562
36833
|
}
|
@@ -36596,12 +36867,14 @@ var FormItem = /* @__PURE__ */ defineComponent({
|
|
36596
36867
|
}, [createVNode(FormTitle, {
|
36597
36868
|
"title": props.item.title,
|
36598
36869
|
"tooltip": props.item.tooltip
|
36599
|
-
}, null)]), createVNode(
|
36870
|
+
}, null)]), createVNode("div", {
|
36871
|
+
"class": `${prefixCls}-item-title-extra`
|
36872
|
+
}, [createVNode(RenderVNode$1, {
|
36600
36873
|
"vnode": extraRender,
|
36601
36874
|
"props": {
|
36602
36875
|
formData: formData.value
|
36603
36876
|
}
|
36604
|
-
}, null)]);
|
36877
|
+
}, null)])]);
|
36605
36878
|
}
|
36606
36879
|
return temp;
|
36607
36880
|
});
|
@@ -36648,19 +36921,6 @@ var FormItem = /* @__PURE__ */ defineComponent({
|
|
36648
36921
|
});
|
36649
36922
|
return () => {
|
36650
36923
|
var _a, _b;
|
36651
|
-
const render = getSlot(props.item.render, formSlotsContext);
|
36652
|
-
if (render) {
|
36653
|
-
return createVNode(FormColWrapper, {
|
36654
|
-
"colProps": props.item.colProps
|
36655
|
-
}, {
|
36656
|
-
default: () => [createVNode(RenderVNode$1, {
|
36657
|
-
"vnode": render,
|
36658
|
-
"props": {
|
36659
|
-
formData: formData.value
|
36660
|
-
}
|
36661
|
-
}, null)]
|
36662
|
-
});
|
36663
|
-
}
|
36664
36924
|
const renderFormItem = getSlot(props.item.renderFormItem, formSlotsContext);
|
36665
36925
|
const extraRender = getSlot((_a = props.item.extra) == null ? void 0 : _a.item, formSlotsContext);
|
36666
36926
|
const FieldComponent = (_b = fieldComponentMap[fieldType.value]) != null ? _b : fieldComponentMap["text"];
|
@@ -36688,22 +36948,33 @@ var FormItem = /* @__PURE__ */ defineComponent({
|
|
36688
36948
|
if (extraRender) {
|
36689
36949
|
defaultDom = createVNode("div", {
|
36690
36950
|
"style": "display: flex; flex-direction: row; justify-content: flex-start; align-items: center;"
|
36691
|
-
}, [defaultDom, createVNode(
|
36951
|
+
}, [defaultDom, createVNode("div", {
|
36952
|
+
"style": "margin-inline-start: 5px; flex-shrink: 0;"
|
36953
|
+
}, [createVNode(RenderVNode$1, {
|
36692
36954
|
"vnode": extraRender,
|
36693
36955
|
"props": {
|
36694
36956
|
formData: formData.value,
|
36695
36957
|
listName: listName == null ? void 0 : listName.value,
|
36696
36958
|
name: props.item.name
|
36697
36959
|
}
|
36698
|
-
}, null)]);
|
36960
|
+
}, null)])]);
|
36699
36961
|
}
|
36962
|
+
const formItemDom = createVNode(Form$1.Item, restItemProps.value, {
|
36963
|
+
default: () => [defaultDom],
|
36964
|
+
...slotsGetter.value
|
36965
|
+
});
|
36966
|
+
const render = getSlot(props.item.render, formSlotsContext);
|
36700
36967
|
return createVNode(FormColWrapper, {
|
36701
|
-
"colProps": props.item.colProps
|
36968
|
+
"colProps": props.item.colProps,
|
36969
|
+
"grid": mergeGrid.value
|
36702
36970
|
}, {
|
36703
|
-
default: () => [createVNode(
|
36704
|
-
|
36705
|
-
|
36706
|
-
|
36971
|
+
default: () => [render ? createVNode(RenderVNode$1, {
|
36972
|
+
"vnode": render,
|
36973
|
+
"props": {
|
36974
|
+
formData: formData.value,
|
36975
|
+
defaultDom: formItemDom
|
36976
|
+
}
|
36977
|
+
}, null) : formItemDom]
|
36707
36978
|
});
|
36708
36979
|
};
|
36709
36980
|
}
|