@aplus-frontend/ui 0.6.0-beta.16 → 0.6.0-beta.18
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/index.mjs +118 -109
- package/es/src/ap-field/date-range/index.vue.mjs +8 -7
- package/es/src/ap-field/number/index.vue.d.ts +2 -4
- package/es/src/ap-field/radio/index.vue.d.ts +2 -4
- package/es/src/ap-field/rate/index.vue.d.ts +2 -4
- package/es/src/ap-field/select/index.vue.d.ts +3 -6
- package/es/src/ap-field/slider/index.vue.d.ts +2 -4
- package/es/src/ap-field/text/index.vue2.mjs +42 -44
- package/es/src/ap-field/text/password.vue.mjs +15 -17
- package/es/src/ap-field/text-area/index.vue.d.ts +2 -2
- package/es/src/ap-field/tree-select/index.vue.mjs +31 -30
- package/es/src/ap-form/ap-form.vue2.mjs +18 -17
- package/es/src/ap-form/dependency/index.vue.mjs +24 -23
- package/es/src/ap-form/drawer-form/index.vue.d.ts +9 -7
- package/es/src/ap-form/drawer-form/index.vue.mjs +58 -49
- package/es/src/ap-form/interface.d.ts +2 -2
- package/es/src/ap-form/item/index.vue.d.ts +5 -10
- package/es/src/ap-form/items/select/index.vue.mjs +12 -14
- package/es/src/ap-form/items/text/password.vue.mjs +9 -9
- package/es/src/ap-form/items/text-area/index.vue.d.ts +5 -5
- package/es/src/ap-form/items/tree-select/index.vue.mjs +12 -14
- package/es/src/ap-form/modal-form/index.vue.d.ts +9 -7
- package/es/src/ap-form/modal-form/index.vue.mjs +64 -55
- package/es/src/ap-form/provider/index.vue.mjs +6 -5
- package/es/src/ap-form/search-form/index.vue.d.ts +4 -8
- package/es/src/ap-form/search-form/index.vue.mjs +50 -50
- package/es/src/ap-form/set/index.vue.mjs +7 -6
- package/es/src/ap-grid/editable/form-item.vue.mjs +1 -1
- package/es/src/ap-grid/hooks/use-editable-columns.mjs +17 -17
- package/es/src/ap-grid/index.vue.mjs +79 -75
- package/es/src/ap-grid/interface.d.ts +13 -0
- package/es/src/ap-list/index.vue.d.ts +2 -9
- package/es/src/ap-list/index.vue.mjs +116 -106
- package/es/src/ap-list/interface.d.ts +20 -0
- package/es/src/ap-table/ap-table.vue.d.ts +10 -2
- package/es/src/ap-table/ap-table.vue2.mjs +87 -83
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +12 -11
- package/es/src/ap-table/constants.d.ts +4 -4
- package/es/src/ap-table/hooks/use-table-paging-ng.d.ts +9 -2
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +113 -105
- package/es/src/ap-table/interface.d.ts +14 -1
- package/es/src/ap-table/utils.d.ts +3 -3
- package/es/src/business/ap-card/ApCard.vue2.mjs +1 -1
- package/es/src/business/ap-keep-alive/cacher/cacher.d.ts +10 -0
- package/es/src/business/ap-keep-alive/cacher/lru-cacher.d.ts +16 -0
- package/es/src/business/ap-keep-alive/cacher/lru-cacher.mjs +43 -0
- package/es/src/business/ap-keep-alive/hook.d.ts +10 -0
- package/es/src/business/ap-keep-alive/hook.mjs +31 -0
- package/es/src/business/ap-keep-alive/index.d.ts +101 -0
- package/es/src/business/ap-keep-alive/index.mjs +13 -0
- package/es/src/business/ap-keep-alive/interface.d.ts +35 -0
- package/es/src/business/ap-keep-alive/interface.mjs +54 -0
- package/es/src/business/ap-keep-alive/keep-alive.d.ts +51 -0
- package/es/src/business/ap-keep-alive/keep-alive.mjs +154 -0
- package/es/src/business/ap-keep-alive/keeper/ap-form-keeper.d.ts +7 -0
- package/es/src/business/ap-keep-alive/keeper/ap-form-keeper.mjs +21 -0
- package/es/src/business/ap-keep-alive/keeper/ap-grid-keeper.d.ts +14 -0
- package/es/src/business/ap-keep-alive/keeper/ap-grid-keeper.mjs +27 -0
- package/es/src/business/ap-keep-alive/keeper/ap-list-keeper.d.ts +13 -0
- package/es/src/business/ap-keep-alive/keeper/ap-list-keeper.mjs +18 -0
- package/es/src/business/ap-keep-alive/keeper/ap-radio-group-keeper.d.ts +6 -0
- package/es/src/business/ap-keep-alive/keeper/ap-radio-group-keeper.mjs +17 -0
- package/es/src/business/ap-keep-alive/keeper/ap-search-form-keeper.d.ts +7 -0
- package/es/src/business/ap-keep-alive/keeper/ap-search-form-keeper.mjs +18 -0
- package/es/src/business/ap-keep-alive/keeper/ap-table-keeper.d.ts +13 -0
- package/es/src/business/ap-keep-alive/keeper/ap-table-keeper.mjs +18 -0
- package/es/src/business/ap-keep-alive/keeper/ap-view-keeper.d.ts +6 -0
- package/es/src/business/ap-keep-alive/keeper/ap-view-keeper.mjs +12 -0
- package/es/src/business/ap-keep-alive/keeper/edit-grid-keeper.d.ts +6 -0
- package/es/src/business/ap-keep-alive/keeper/edit-grid-keeper.mjs +18 -0
- package/es/src/business/ap-keep-alive/keeper/edit-table-keeper.d.ts +6 -0
- package/es/src/business/ap-keep-alive/keeper/edit-table-keeper.mjs +18 -0
- package/es/src/business/ap-keep-alive/keeper/index.d.ts +3 -0
- package/es/src/business/ap-keep-alive/keeper/index.mjs +27 -0
- package/es/src/business/ap-keep-alive/keeper/step-keeper.d.ts +6 -0
- package/es/src/business/ap-keep-alive/keeper/step-keeper.mjs +17 -0
- package/es/src/business/ap-keep-alive/keeper/tab-keeper.d.ts +6 -0
- package/es/src/business/ap-keep-alive/keeper/tab-keeper.mjs +17 -0
- package/es/src/business/ap-keep-alive/utils.d.ts +22 -0
- package/es/src/business/ap-keep-alive/utils.mjs +41 -0
- package/es/src/business/ap-radio-group/ap-radio-group.vue2.mjs +23 -23
- package/es/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +4 -1
- package/es/src/business/ap-table-modal/hooks/use-table-modal.d.ts +4 -1
- package/es/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +4 -1
- package/es/src/business/ap-table-modal/index.d.ts +32 -5
- package/es/src/business/ap-table-modal/table-modal.vue.d.ts +14 -3
- package/es/src/business/ap-view/components/main-button-content.vue.d.ts +1 -1
- package/es/src/business/ap-view/components/menu-list-content.vue.d.ts +1 -1
- package/es/src/business/batch-input-group/form-item.vue.mjs +14 -13
- package/es/src/business/batch-input-group/index.vue.mjs +10 -9
- package/es/src/business/hooks/usePageListApTable.d.ts +4 -1
- package/es/src/business/index.d.ts +1 -0
- package/es/src/business/index.mjs +18 -16
- package/es/src/editable-table/form-item.vue.mjs +23 -23
- package/es/src/full-screen/interface.d.ts +5 -6
- package/es/src/index.mjs +199 -190
- package/es/src/mask/index.vue.mjs +21 -20
- package/es/src/resize-observer/interface.d.ts +2 -3
- package/es/src/scroll-bar/interface.d.ts +7 -7
- package/es/src/scroll-view/interface.d.ts +2 -3
- package/es/src/splitter/SplitBar.vue2.mjs +1 -0
- package/es/src/splitter/Splitter.vue2.mjs +1 -0
- package/es/src/text/group.vue.mjs +7 -6
- package/es/src/text/index.vue.mjs +20 -19
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/es/src/work-order-modal/work-order-modal.vue.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/number/index.vue.d.ts +2 -4
- package/lib/src/ap-field/radio/index.vue.d.ts +2 -4
- package/lib/src/ap-field/rate/index.vue.d.ts +2 -4
- package/lib/src/ap-field/select/index.vue.d.ts +3 -6
- package/lib/src/ap-field/slider/index.vue.d.ts +2 -4
- package/lib/src/ap-field/text/index.vue2.js +1 -1
- package/lib/src/ap-field/text/password.vue.js +1 -1
- package/lib/src/ap-field/text-area/index.vue.d.ts +2 -2
- package/lib/src/ap-field/tree-select/index.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/dependency/index.vue.js +1 -1
- package/lib/src/ap-form/drawer-form/index.vue.d.ts +9 -7
- package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
- package/lib/src/ap-form/interface.d.ts +2 -2
- package/lib/src/ap-form/item/index.vue.d.ts +5 -10
- package/lib/src/ap-form/items/select/index.vue.js +1 -1
- package/lib/src/ap-form/items/text/password.vue.js +1 -1
- package/lib/src/ap-form/items/text-area/index.vue.d.ts +5 -5
- package/lib/src/ap-form/items/tree-select/index.vue.js +1 -1
- package/lib/src/ap-form/modal-form/index.vue.d.ts +9 -7
- package/lib/src/ap-form/modal-form/index.vue.js +1 -1
- package/lib/src/ap-form/provider/index.vue.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.d.ts +4 -8
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-form/set/index.vue.js +1 -1
- package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ap-grid/hooks/use-editable-columns.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/interface.d.ts +13 -0
- package/lib/src/ap-list/index.vue.d.ts +2 -9
- package/lib/src/ap-list/index.vue.js +1 -1
- package/lib/src/ap-list/interface.d.ts +20 -0
- package/lib/src/ap-table/ap-table.vue.d.ts +10 -2
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
- package/lib/src/ap-table/constants.d.ts +4 -4
- package/lib/src/ap-table/hooks/use-table-paging-ng.d.ts +9 -2
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/ap-table/interface.d.ts +14 -1
- package/lib/src/ap-table/utils.d.ts +3 -3
- package/lib/src/business/ap-card/ApCard.vue2.js +1 -1
- package/lib/src/business/ap-keep-alive/cacher/cacher.d.ts +10 -0
- package/lib/src/business/ap-keep-alive/cacher/lru-cacher.d.ts +16 -0
- package/lib/src/business/ap-keep-alive/cacher/lru-cacher.js +1 -0
- package/lib/src/business/ap-keep-alive/hook.d.ts +10 -0
- package/lib/src/business/ap-keep-alive/hook.js +1 -0
- package/lib/src/business/ap-keep-alive/index.d.ts +101 -0
- package/lib/src/business/ap-keep-alive/index.js +1 -0
- package/lib/src/business/ap-keep-alive/interface.d.ts +35 -0
- package/lib/src/business/ap-keep-alive/interface.js +1 -0
- package/lib/src/business/ap-keep-alive/keep-alive.d.ts +51 -0
- package/lib/src/business/ap-keep-alive/keep-alive.js +1 -0
- package/lib/src/business/ap-keep-alive/keeper/ap-form-keeper.d.ts +7 -0
- package/lib/src/business/ap-keep-alive/keeper/ap-form-keeper.js +1 -0
- package/lib/src/business/ap-keep-alive/keeper/ap-grid-keeper.d.ts +14 -0
- package/lib/src/business/ap-keep-alive/keeper/ap-grid-keeper.js +1 -0
- package/lib/src/business/ap-keep-alive/keeper/ap-list-keeper.d.ts +13 -0
- package/lib/src/business/ap-keep-alive/keeper/ap-list-keeper.js +1 -0
- package/lib/src/business/ap-keep-alive/keeper/ap-radio-group-keeper.d.ts +6 -0
- package/lib/src/business/ap-keep-alive/keeper/ap-radio-group-keeper.js +1 -0
- package/lib/src/business/ap-keep-alive/keeper/ap-search-form-keeper.d.ts +7 -0
- package/lib/src/business/ap-keep-alive/keeper/ap-search-form-keeper.js +1 -0
- package/lib/src/business/ap-keep-alive/keeper/ap-table-keeper.d.ts +13 -0
- package/lib/src/business/ap-keep-alive/keeper/ap-table-keeper.js +1 -0
- package/lib/src/business/ap-keep-alive/keeper/ap-view-keeper.d.ts +6 -0
- package/lib/src/business/ap-keep-alive/keeper/ap-view-keeper.js +1 -0
- package/lib/src/business/ap-keep-alive/keeper/edit-grid-keeper.d.ts +6 -0
- package/lib/src/business/ap-keep-alive/keeper/edit-grid-keeper.js +1 -0
- package/lib/src/business/ap-keep-alive/keeper/edit-table-keeper.d.ts +6 -0
- package/lib/src/business/ap-keep-alive/keeper/edit-table-keeper.js +1 -0
- package/lib/src/business/ap-keep-alive/keeper/index.d.ts +3 -0
- package/lib/src/business/ap-keep-alive/keeper/index.js +1 -0
- package/lib/src/business/ap-keep-alive/keeper/step-keeper.d.ts +6 -0
- package/lib/src/business/ap-keep-alive/keeper/step-keeper.js +1 -0
- package/lib/src/business/ap-keep-alive/keeper/tab-keeper.d.ts +6 -0
- package/lib/src/business/ap-keep-alive/keeper/tab-keeper.js +1 -0
- package/lib/src/business/ap-keep-alive/utils.d.ts +22 -0
- package/lib/src/business/ap-keep-alive/utils.js +1 -0
- package/lib/src/business/ap-radio-group/ap-radio-group.vue2.js +1 -1
- package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +4 -1
- package/lib/src/business/ap-table-modal/hooks/use-table-modal.d.ts +4 -1
- package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +4 -1
- package/lib/src/business/ap-table-modal/index.d.ts +32 -5
- package/lib/src/business/ap-table-modal/table-modal.vue.d.ts +14 -3
- package/lib/src/business/ap-view/components/main-button-content.vue.d.ts +1 -1
- package/lib/src/business/ap-view/components/menu-list-content.vue.d.ts +1 -1
- package/lib/src/business/batch-input-group/form-item.vue.js +1 -1
- package/lib/src/business/batch-input-group/index.vue.js +2 -2
- package/lib/src/business/hooks/usePageListApTable.d.ts +4 -1
- package/lib/src/business/index.d.ts +1 -0
- package/lib/src/business/index.js +1 -1
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/full-screen/interface.d.ts +5 -6
- package/lib/src/index.js +1 -1
- package/lib/src/mask/index.vue.js +1 -1
- package/lib/src/resize-observer/interface.d.ts +2 -3
- package/lib/src/scroll-bar/interface.d.ts +7 -7
- package/lib/src/scroll-view/interface.d.ts +2 -3
- package/lib/src/splitter/SplitBar.vue2.js +1 -1
- package/lib/src/splitter/Splitter.vue2.js +1 -1
- package/lib/src/text/group.vue.js +1 -1
- package/lib/src/text/index.vue.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/lib/src/work-order-modal/work-order-modal.vue.d.ts +1 -1
- package/package.json +7 -6
- package/theme/antd-global-overwrite/admin/field.css +12 -0
- package/theme/antd-global-overwrite/admin/field.less +16 -0
- package/theme/antd-global-overwrite/admin/index.css +12 -0
- package/theme/antd-global-overwrite/aplus/field.css +12 -0
- package/theme/antd-global-overwrite/aplus/field.less +16 -0
- package/theme/antd-global-overwrite/aplus/index.css +12 -0
- package/theme/ap-action/item.css +1 -1
- package/theme/ap-action/item.less +1 -1
- package/theme/ap-card/ap-card.css +1 -1
- package/theme/ap-card/ap-card.less +1 -1
- package/theme/ap-grid/index.css +6 -1
- package/theme/ap-grid/index.less +5 -0
- package/theme/ap-table/ap-table.css +6 -1
- package/theme/ap-table/ap-table.less +5 -0
- package/theme/ap-table-modal/index.css +6 -1
- package/theme/editable-table/index.css +1 -1
- package/theme/index.css +14 -2
- package/theme/ui-mode.css +2 -0
- package/theme/ui-mode.less +4 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { isVNode as
|
|
2
|
-
import { Button as V, Flex as te, Space as le, Modal as
|
|
1
|
+
import { isVNode as A, defineComponent as D, useSlots as L, ref as p, watch as G, cloneVNode as I, computed as K, createVNode as u, mergeProps as b, unref as s, createElementBlock as W, openBlock as g, Fragment as H, createBlock as P, createCommentVNode as J, withCtx as h, createElementVNode as Q, normalizeClass as X, normalizeStyle as Y, renderSlot as w, resolveDynamicComponent as N, createTextVNode as Z, toDisplayString as ee } from "vue";
|
|
2
|
+
import { Button as V, Flex as te, Space as le, Modal as ae } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../ap-form.vue.mjs";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
5
|
-
import { getSingleVNode as
|
|
5
|
+
import { getSingleVNode as oe } from "../../utils/slot.mjs";
|
|
6
6
|
import "../../config-provider/index.mjs";
|
|
7
7
|
import { omit as se } from "lodash-unified";
|
|
8
8
|
import { useControllableValue as ne } from "../../hooks/useControllableValue.mjs";
|
|
@@ -10,10 +10,11 @@ import { useLocale as ie } from "../../config-provider/hooks/use-locale.mjs";
|
|
|
10
10
|
import { useGlobalConfig as re } from "../../config-provider/hooks/use-global-config.mjs";
|
|
11
11
|
import { useNamespace as ue } from "../../config-provider/hooks/use-namespace.mjs";
|
|
12
12
|
import de from "../ap-form.vue2.mjs";
|
|
13
|
-
function S(
|
|
14
|
-
return typeof
|
|
13
|
+
function S(m) {
|
|
14
|
+
return typeof m == "function" || Object.prototype.toString.call(m) === "[object Object]" && !A(m);
|
|
15
15
|
}
|
|
16
|
-
const
|
|
16
|
+
const Re = /* @__PURE__ */ D({
|
|
17
|
+
name: "ApFormModalForm",
|
|
17
18
|
__name: "index",
|
|
18
19
|
props: {
|
|
19
20
|
layout: {
|
|
@@ -90,48 +91,48 @@ const Me = /* @__PURE__ */ L({
|
|
|
90
91
|
submitTimeout: {}
|
|
91
92
|
},
|
|
92
93
|
emits: ["update:open"],
|
|
93
|
-
setup(
|
|
94
|
+
setup(m, {
|
|
94
95
|
expose: x,
|
|
95
|
-
emit:
|
|
96
|
+
emit: M
|
|
96
97
|
}) {
|
|
97
|
-
const
|
|
98
|
-
value:
|
|
98
|
+
const a = m, v = L(), R = M, o = p(), T = p(0), c = p(), i = p(!1), {
|
|
99
|
+
value: _,
|
|
99
100
|
updateValue: f
|
|
100
|
-
} = ne(
|
|
101
|
+
} = ne(a, R, {
|
|
101
102
|
valuePropName: "open",
|
|
102
103
|
defaultValue: !1,
|
|
103
104
|
beforeUpdateValue(e) {
|
|
104
|
-
return e && (
|
|
105
|
+
return e && (T.value += 1), !0;
|
|
105
106
|
}
|
|
106
107
|
}), {
|
|
107
|
-
t:
|
|
108
|
+
t: y
|
|
108
109
|
} = ie(), U = re("uiMode", "aplus"), {
|
|
109
110
|
b: j,
|
|
110
|
-
e:
|
|
111
|
+
e: F
|
|
111
112
|
} = ue("ap-form-modal-form");
|
|
112
|
-
G(() =>
|
|
113
|
+
G(() => o.value, (e) => {
|
|
113
114
|
var t;
|
|
114
|
-
e &&
|
|
115
|
+
e && c.value && ((t = e.setFieldsValue) == null || t.call(e, c.value), c.value = void 0);
|
|
115
116
|
});
|
|
116
|
-
const
|
|
117
|
+
const C = oe(v.trigger), B = C ? I(C, {
|
|
117
118
|
onClick: () => {
|
|
118
119
|
f(!0);
|
|
119
120
|
}
|
|
120
121
|
}) : null, O = K(() => {
|
|
121
122
|
var t, l, r, d;
|
|
122
123
|
const e = [];
|
|
123
|
-
if (
|
|
124
|
+
if (a.submitter === !1)
|
|
124
125
|
return null;
|
|
125
|
-
if (
|
|
126
|
+
if (a.showCancel) {
|
|
126
127
|
let n;
|
|
127
128
|
e.push(u(V, {
|
|
128
129
|
onClick: k,
|
|
129
130
|
disabled: i.value
|
|
130
|
-
}, S(n =
|
|
131
|
+
}, S(n = y("ap.common.cancelText")) ? n : {
|
|
131
132
|
default: () => [n]
|
|
132
133
|
}));
|
|
133
134
|
}
|
|
134
|
-
return ((t =
|
|
135
|
+
return ((t = a.submitter) == null ? void 0 : t.resetButtonProps) !== !1 && e.push(u(V, b(((l = a.submitter) == null ? void 0 : l.resetButtonProps) || {}, {
|
|
135
136
|
key: "reset",
|
|
136
137
|
disabled: i.value,
|
|
137
138
|
onClick: z,
|
|
@@ -139,41 +140,41 @@ const Me = /* @__PURE__ */ L({
|
|
|
139
140
|
}), {
|
|
140
141
|
default: () => {
|
|
141
142
|
var n;
|
|
142
|
-
return [((n =
|
|
143
|
+
return [((n = a.submitter) == null ? void 0 : n.resetText) || y("ap.common.resetText")];
|
|
143
144
|
}
|
|
144
|
-
})), ((r =
|
|
145
|
+
})), ((r = a.submitter) == null ? void 0 : r.submitButtonProps) !== !1 && e.push(u(V, b({
|
|
145
146
|
type: "primary",
|
|
146
147
|
key: "submit",
|
|
147
148
|
htmlType: "submit"
|
|
148
|
-
}, ((d =
|
|
149
|
+
}, ((d = a.submitter) == null ? void 0 : d.submitButtonProps) || {}, {
|
|
149
150
|
loading: i.value
|
|
150
151
|
}), {
|
|
151
152
|
default: () => {
|
|
152
153
|
var n;
|
|
153
|
-
return [((n =
|
|
154
|
+
return [((n = a.submitter) == null ? void 0 : n.submitText) || y("ap.common.okText")];
|
|
154
155
|
}
|
|
155
156
|
})), u(te, {
|
|
156
157
|
justify: "flex-end",
|
|
157
|
-
key: s(
|
|
158
|
-
class: [
|
|
158
|
+
key: s(T),
|
|
159
|
+
class: [F("footer"), s(U) === "admin" ? F("footer-admin") : null]
|
|
159
160
|
}, {
|
|
160
|
-
default: () => [
|
|
161
|
+
default: () => [v.submitter ? v.submitter(e) : u(le, null, S(e) ? e : {
|
|
161
162
|
default: () => [e]
|
|
162
163
|
})]
|
|
163
164
|
});
|
|
164
165
|
});
|
|
165
166
|
function z() {
|
|
166
167
|
var e, t, l;
|
|
167
|
-
|
|
168
|
+
a.submitter !== !1 && ((e = o.value) == null || e.resetFields(), (l = (t = a.submitter) == null ? void 0 : t.onReset) == null || l.call(t));
|
|
168
169
|
}
|
|
169
170
|
async function E(e) {
|
|
170
171
|
var t, l, r;
|
|
171
|
-
if (
|
|
172
|
+
if (a.submitter !== !1)
|
|
172
173
|
try {
|
|
173
|
-
(l = (t =
|
|
174
|
-
const d = (r =
|
|
175
|
-
if (
|
|
176
|
-
const q = setTimeout(() => i.value = !1,
|
|
174
|
+
(l = (t = a.submitter) == null ? void 0 : t.onSubmit) == null || l.call(t), i.value = !0;
|
|
175
|
+
const d = (r = a.onFinish) == null ? void 0 : r.call(a, e);
|
|
176
|
+
if (a.submitTimeout && d instanceof Promise) {
|
|
177
|
+
const q = setTimeout(() => i.value = !1, a.submitTimeout);
|
|
177
178
|
d.finally(() => {
|
|
178
179
|
clearTimeout(q), i.value = !1;
|
|
179
180
|
});
|
|
@@ -190,48 +191,56 @@ const Me = /* @__PURE__ */ L({
|
|
|
190
191
|
!e && s(i) || f(e);
|
|
191
192
|
}
|
|
192
193
|
return x({
|
|
193
|
-
resetFields: () => {
|
|
194
|
+
resetFields: async () => {
|
|
194
195
|
var e;
|
|
195
|
-
(e =
|
|
196
|
+
(e = o.value) == null || e.resetFields();
|
|
196
197
|
},
|
|
197
198
|
clearValidate: (e) => {
|
|
198
199
|
var t;
|
|
199
|
-
(t =
|
|
200
|
+
(t = o.value) == null || t.clearValidate(e);
|
|
200
201
|
},
|
|
201
202
|
validateFields: (e, t) => {
|
|
202
203
|
var l;
|
|
203
|
-
return (l =
|
|
204
|
+
return (l = o.value) == null ? void 0 : l.validateFields(e, t);
|
|
204
205
|
},
|
|
205
206
|
getFieldsValue: (e) => {
|
|
206
207
|
var t;
|
|
207
|
-
return (t =
|
|
208
|
+
return (t = o.value) == null ? void 0 : t.getFieldsValue(e);
|
|
208
209
|
},
|
|
209
210
|
validate: (e, t) => {
|
|
210
211
|
var l;
|
|
211
|
-
return (l =
|
|
212
|
+
return (l = o.value) == null ? void 0 : l.validate(e, t);
|
|
212
213
|
},
|
|
213
214
|
scrollToField: (e, t = {}) => {
|
|
214
215
|
var l;
|
|
215
|
-
(l =
|
|
216
|
+
(l = o.value) == null || l.scrollToField(e, t);
|
|
216
217
|
},
|
|
217
218
|
setFieldValue: (e, t) => {
|
|
218
219
|
var l, r;
|
|
219
|
-
(r = (l =
|
|
220
|
+
(r = (l = o.value) == null ? void 0 : l.setFieldValue) == null || r.call(l, e, t);
|
|
220
221
|
},
|
|
221
222
|
setFieldsValue: (e) => {
|
|
222
223
|
var t, l;
|
|
223
|
-
if (!
|
|
224
|
-
|
|
224
|
+
if (!o.value) {
|
|
225
|
+
c.value = e;
|
|
225
226
|
return;
|
|
226
227
|
}
|
|
227
|
-
(l = (t =
|
|
228
|
+
(l = (t = o.value) == null ? void 0 : t.setFieldsValue) == null || l.call(t, e);
|
|
228
229
|
},
|
|
229
230
|
getInternalInstance: (e) => {
|
|
230
231
|
var t;
|
|
231
|
-
return (t =
|
|
232
|
+
return (t = o.value) == null ? void 0 : t.getInternalInstance(e);
|
|
233
|
+
},
|
|
234
|
+
getFieldsValueTransformed(e) {
|
|
235
|
+
var t;
|
|
236
|
+
return (t = o.value) == null ? void 0 : t.getFieldsValueTransformed(e);
|
|
237
|
+
},
|
|
238
|
+
validateFieldsReturnTransformed(e, t) {
|
|
239
|
+
var l;
|
|
240
|
+
return (l = o.value) == null ? void 0 : l.validateFieldsReturnTransformed(e, t);
|
|
232
241
|
}
|
|
233
|
-
}), (e, t) => (g(), W(H, null, [u(s(
|
|
234
|
-
open: s(
|
|
242
|
+
}), (e, t) => (g(), W(H, null, [u(s(ae), b(e.modalProps, {
|
|
243
|
+
open: s(_),
|
|
235
244
|
footer: null,
|
|
236
245
|
width: e.width,
|
|
237
246
|
class: s(j)(),
|
|
@@ -241,18 +250,18 @@ const Me = /* @__PURE__ */ L({
|
|
|
241
250
|
"onUpdate:open": $,
|
|
242
251
|
onCancel: k
|
|
243
252
|
}), {
|
|
244
|
-
title:
|
|
245
|
-
default:
|
|
253
|
+
title: h(() => [w(e.$slots, "title", {}, () => [Z(ee(a.title), 1)])]),
|
|
254
|
+
default: h(() => [u(de, b({
|
|
246
255
|
ref_key: "formRef",
|
|
247
|
-
ref:
|
|
248
|
-
}, s(se)(
|
|
256
|
+
ref: o
|
|
257
|
+
}, s(se)(a, ["modalProps", "open", "onUpdate:open", "title", "width", "onFinish", "submitter"]), {
|
|
249
258
|
onFinish: E
|
|
250
259
|
}), {
|
|
251
|
-
default:
|
|
260
|
+
default: h(() => {
|
|
252
261
|
var l;
|
|
253
262
|
return [Q("div", {
|
|
254
263
|
style: Y((l = e.modalProps) == null ? void 0 : l.bodyStyle),
|
|
255
|
-
class: X(s(
|
|
264
|
+
class: X(s(F)("content"))
|
|
256
265
|
}, [w(e.$slots, "default")], 6), (g(), P(N(O.value)))];
|
|
257
266
|
}),
|
|
258
267
|
_: 3
|
|
@@ -264,5 +273,5 @@ const Me = /* @__PURE__ */ L({
|
|
|
264
273
|
}
|
|
265
274
|
});
|
|
266
275
|
export {
|
|
267
|
-
|
|
276
|
+
Re as default
|
|
268
277
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { defineComponent as s, ref as g, renderSlot as
|
|
2
|
-
import { useInjectFormProvider as
|
|
1
|
+
import { defineComponent as s, ref as g, renderSlot as m } from "vue";
|
|
2
|
+
import { useInjectFormProvider as t, useProvideFormProvider as u } from "./context.mjs";
|
|
3
3
|
const h = /* @__PURE__ */ s({
|
|
4
|
+
name: "ApFormProvider",
|
|
4
5
|
__name: "index",
|
|
5
6
|
props: {
|
|
6
7
|
onFormChange: { type: Function },
|
|
7
8
|
onFormFinish: { type: Function }
|
|
8
9
|
},
|
|
9
10
|
setup(F) {
|
|
10
|
-
const o = F, n = g({}), e =
|
|
11
|
-
return
|
|
11
|
+
const o = F, n = g({}), e = t();
|
|
12
|
+
return u({
|
|
12
13
|
triggerFormChange(r, i) {
|
|
13
14
|
o != null && o.onFormChange && o.onFormChange(r, {
|
|
14
15
|
changedFields: i,
|
|
@@ -31,7 +32,7 @@ const h = /* @__PURE__ */ s({
|
|
|
31
32
|
const i = { ...n.value };
|
|
32
33
|
delete i[r], n.value = i, e == null || e.unregisterForm(r);
|
|
33
34
|
}
|
|
34
|
-
}), (r, i) =>
|
|
35
|
+
}), (r, i) => m(r.$slots, "default");
|
|
35
36
|
}
|
|
36
37
|
});
|
|
37
38
|
export {
|
|
@@ -383,9 +383,7 @@ declare function __VLS_template(): {
|
|
|
383
383
|
default: string | number | ColSize;
|
|
384
384
|
};
|
|
385
385
|
xxl: {
|
|
386
|
-
type: PropType<string | number |
|
|
387
|
-
* extra区域展开占据的span数(占据剩余所有空间)
|
|
388
|
-
*/).ColSize>;
|
|
386
|
+
type: PropType<string | number | ColSize>;
|
|
389
387
|
default: string | number | ColSize;
|
|
390
388
|
};
|
|
391
389
|
prefixCls: StringConstructor;
|
|
@@ -818,7 +816,7 @@ declare function __VLS_template(): {
|
|
|
818
816
|
hideRequiredMark: boolean;
|
|
819
817
|
validateOnRuleChange: boolean;
|
|
820
818
|
syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
|
|
821
|
-
}> & Omit<Readonly< ApFormProps> & Readonly<{}>, "validate" | "
|
|
819
|
+
}> & Omit<Readonly< ApFormProps> & Readonly<{}>, "validate" | "registerWatch" | "setFieldsValue" | "setFieldValue" | "resetFields" | "clearValidate" | "validateFields" | "getFieldsValue" | "scrollToField" | "getInternalInstance" | "validateFieldsReturnTransformed" | "getFieldsValueTransformed" | ("layout" | "colon" | "labelAlign" | "validateTrigger" | "hideRequiredMark" | "validateOnRuleChange" | "syncToUrl")> & ShallowUnwrapRef<{
|
|
822
820
|
setFieldsValue: (fields: Partial<any>) => void;
|
|
823
821
|
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean, optimizeFn?: UpdateModelOptimizeFn) => void;
|
|
824
822
|
resetFields: () => Promise<void>;
|
|
@@ -1220,9 +1218,7 @@ declare const __VLS_component: DefineComponent<ApFormSearchFormProps, {
|
|
|
1220
1218
|
default: string | number | ColSize;
|
|
1221
1219
|
};
|
|
1222
1220
|
xxl: {
|
|
1223
|
-
type: PropType<string | number |
|
|
1224
|
-
* extra区域展开占据的span数(占据剩余所有空间)
|
|
1225
|
-
*/).ColSize>;
|
|
1221
|
+
type: PropType<string | number | ColSize>;
|
|
1226
1222
|
default: string | number | ColSize;
|
|
1227
1223
|
};
|
|
1228
1224
|
prefixCls: StringConstructor;
|
|
@@ -1655,7 +1651,7 @@ declare const __VLS_component: DefineComponent<ApFormSearchFormProps, {
|
|
|
1655
1651
|
hideRequiredMark: boolean;
|
|
1656
1652
|
validateOnRuleChange: boolean;
|
|
1657
1653
|
syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
|
|
1658
|
-
}> & Omit<Readonly< ApFormProps> & Readonly<{}>, "validate" | "
|
|
1654
|
+
}> & Omit<Readonly< ApFormProps> & Readonly<{}>, "validate" | "registerWatch" | "setFieldsValue" | "setFieldValue" | "resetFields" | "clearValidate" | "validateFields" | "getFieldsValue" | "scrollToField" | "getInternalInstance" | "validateFieldsReturnTransformed" | "getFieldsValueTransformed" | ("layout" | "colon" | "labelAlign" | "validateTrigger" | "hideRequiredMark" | "validateOnRuleChange" | "syncToUrl")> & ShallowUnwrapRef<{
|
|
1659
1655
|
setFieldsValue: (fields: Partial<any>) => void;
|
|
1660
1656
|
setFieldValue: (name: NamePath, value: any, triggerChange?: boolean, optimizeFn?: UpdateModelOptimizeFn) => void;
|
|
1661
1657
|
resetFields: () => Promise<void>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { isVNode as oe, defineComponent as ae, useSlots as ne, ref as L, shallowRef as U, computed as _, unref as
|
|
2
|
-
import { Col as R, Flex as N, Button as
|
|
1
|
+
import { isVNode as oe, defineComponent as ae, useSlots as ne, ref as L, shallowRef as U, computed as _, unref as a, watch as V, createVNode as t, Fragment as w, createBlock as y, openBlock as f, mergeProps as le, withCtx as A, resolveDynamicComponent as B, createElementBlock as re, renderList as se } from "vue";
|
|
2
|
+
import { Col as R, Flex as N, Button as W, Row as ie } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../ap-form.vue.mjs";
|
|
4
4
|
import "../item/index.vue2.mjs";
|
|
5
|
-
import { genRealChildren as
|
|
5
|
+
import { genRealChildren as M } from "../item-group/helper.mjs";
|
|
6
6
|
import "../../config-provider/index.mjs";
|
|
7
7
|
import { isArray as ue, isBoolean as ce, omit as pe } from "lodash-unified";
|
|
8
8
|
import { isDef as z } from "../../utils/index.mjs";
|
|
@@ -16,8 +16,8 @@ import q from "../item/index.vue.mjs";
|
|
|
16
16
|
import xe from "./components/popover-filter.vue2.mjs";
|
|
17
17
|
import ye from "./components/popover-sorter/index.vue2.mjs";
|
|
18
18
|
import ge from "../ap-form.vue2.mjs";
|
|
19
|
-
function ve(
|
|
20
|
-
return typeof
|
|
19
|
+
function ve(m) {
|
|
20
|
+
return typeof m == "function" || Object.prototype.toString.call(m) === "[object Object]" && !oe(m);
|
|
21
21
|
}
|
|
22
22
|
const s = 24, Ue = /* @__PURE__ */ ae({
|
|
23
23
|
name: "ApFormSearchForm",
|
|
@@ -111,57 +111,57 @@ const s = 24, Ue = /* @__PURE__ */ ae({
|
|
|
111
111
|
},
|
|
112
112
|
resizeTarget: {}
|
|
113
113
|
},
|
|
114
|
-
setup(
|
|
114
|
+
setup(m, {
|
|
115
115
|
expose: H
|
|
116
116
|
}) {
|
|
117
117
|
var P;
|
|
118
|
-
const i = ne(), o =
|
|
119
|
-
b:
|
|
118
|
+
const i = ne(), o = m, {
|
|
119
|
+
b: h
|
|
120
120
|
} = me("ap-form-search-form"), {
|
|
121
121
|
t: k
|
|
122
|
-
} = he(), G = fe(o),
|
|
122
|
+
} = he(), G = fe(o), g = L();
|
|
123
123
|
function T() {
|
|
124
|
-
var
|
|
125
|
-
const e = (
|
|
124
|
+
var n;
|
|
125
|
+
const e = (n = g.value) == null ? void 0 : n.getFieldsValueTransformed(!0);
|
|
126
126
|
D(o.onSubmit, e);
|
|
127
127
|
}
|
|
128
128
|
function J() {
|
|
129
|
-
var e,
|
|
130
|
-
o.customReset || (
|
|
129
|
+
var e, n;
|
|
130
|
+
o.customReset || (n = (e = g.value) == null ? void 0 : e.resetFields) == null || n.call(e), D(o.onReset);
|
|
131
131
|
}
|
|
132
132
|
const K = (e) => z(e) ? (ue(e) ? e : [e]).join("") : Date.now();
|
|
133
133
|
let I = [];
|
|
134
|
-
const u = U(
|
|
134
|
+
const u = U(M(i.default())), b = L(!1), p = U((P = i.extra) == null ? void 0 : P.call(i)), E = _(() => Math.floor(s / a(G)));
|
|
135
135
|
V(() => i.default(), (e) => {
|
|
136
|
-
I = u.value, u.value = de(I,
|
|
136
|
+
I = u.value, u.value = de(I, M(e)), b.value = !1;
|
|
137
137
|
}), V(() => {
|
|
138
138
|
var e;
|
|
139
139
|
return (e = i.extra) == null ? void 0 : e.call(i);
|
|
140
140
|
}, (e) => {
|
|
141
|
-
|
|
141
|
+
p.value = e;
|
|
142
142
|
});
|
|
143
143
|
const l = _(() => {
|
|
144
|
-
const e = u.value,
|
|
144
|
+
const e = u.value, n = [], r = [], x = [], c = a(E);
|
|
145
145
|
let v = 0, S = 0;
|
|
146
|
-
const Y = s * o.maxRows -
|
|
146
|
+
const Y = s * o.maxRows - c * (a(p) && !o.extraInAction ? 2 : 1);
|
|
147
147
|
e.forEach((F, te) => {
|
|
148
|
-
const
|
|
149
|
-
if (ce(
|
|
150
|
-
|
|
148
|
+
const d = F.props;
|
|
149
|
+
if (ce(d.hidden) ? !!d.hidden : z(d.hidden))
|
|
150
|
+
n.push(F);
|
|
151
151
|
else {
|
|
152
|
-
let C =
|
|
152
|
+
let C = d.span || c;
|
|
153
153
|
const $ = {
|
|
154
154
|
node: F,
|
|
155
155
|
span: C,
|
|
156
|
-
key: `ApFormSearchFormItem-${te}-${K(
|
|
156
|
+
key: `ApFormSearchFormItem-${te}-${K(d.name)}-${d._signal}`
|
|
157
157
|
}, j = s - v % s;
|
|
158
|
-
j < C && (C += j), v += C, v > Y ? r.push($) : (S = v,
|
|
158
|
+
j < C && (C += j), v += C, v > Y ? r.push($) : (S = v, x.push($));
|
|
159
159
|
}
|
|
160
160
|
});
|
|
161
|
-
const O = s - (S +
|
|
161
|
+
const O = s - (S + c) % s, Z = S % s < c, ee = O < c ? s : O;
|
|
162
162
|
return {
|
|
163
|
-
hideNode: t(w, null, [
|
|
164
|
-
nodes:
|
|
163
|
+
hideNode: t(w, null, [n]),
|
|
164
|
+
nodes: x,
|
|
165
165
|
collapseNodes: r,
|
|
166
166
|
extraSpan: ee,
|
|
167
167
|
lastRowOnlyIncludeActionAndExtra: Z
|
|
@@ -172,21 +172,21 @@ const s = 24, Ue = /* @__PURE__ */ ae({
|
|
|
172
172
|
}
|
|
173
173
|
const X = _(() => {
|
|
174
174
|
let e;
|
|
175
|
-
const
|
|
176
|
-
span:
|
|
175
|
+
const n = l.value.collapseNodes.length || o.sortable && u.value.length, r = t(R, {
|
|
176
|
+
span: a(E),
|
|
177
177
|
key: "actionWrapper"
|
|
178
178
|
}, {
|
|
179
179
|
default: () => [t(q, null, {
|
|
180
180
|
default: () => [t(N, {
|
|
181
181
|
wrap: "wrap",
|
|
182
|
-
justify: l.value.lastRowOnlyIncludeActionAndExtra && !(
|
|
182
|
+
justify: l.value.lastRowOnlyIncludeActionAndExtra && !(a(p) && o.extraInAction) ? "flex-end" : "space-between"
|
|
183
183
|
}, {
|
|
184
184
|
default: () => [t(N, {
|
|
185
185
|
gap: 8,
|
|
186
186
|
wrap: "wrap"
|
|
187
187
|
}, {
|
|
188
|
-
default: () => [t("div", {
|
|
189
|
-
class:
|
|
188
|
+
default: () => [n ? t("div", {
|
|
189
|
+
class: h("column-setting-trigger-wrapper")
|
|
190
190
|
}, [l.value.collapseNodes.length ? t(xe, {
|
|
191
191
|
onSubmit: T,
|
|
192
192
|
config: l.value.collapseNodes,
|
|
@@ -195,57 +195,57 @@ const s = 24, Ue = /* @__PURE__ */ ae({
|
|
|
195
195
|
children: u.value,
|
|
196
196
|
onClickConfirm: Q,
|
|
197
197
|
sorted: b.value
|
|
198
|
-
}, null) : null]), t(
|
|
198
|
+
}, null) : null]) : null, t(W, {
|
|
199
199
|
type: "primary",
|
|
200
200
|
onClick: T,
|
|
201
201
|
loading: o.submitLoading,
|
|
202
202
|
htmlType: "submit",
|
|
203
|
-
class:
|
|
203
|
+
class: h("action-btn")
|
|
204
204
|
}, {
|
|
205
205
|
default: () => [o.searchText || k("ap.apForm.search.search")]
|
|
206
|
-
}), t(
|
|
206
|
+
}), t(W, {
|
|
207
207
|
onClick: J,
|
|
208
208
|
type: "text",
|
|
209
|
-
class: [
|
|
209
|
+
class: [h("action-btn"), h("action-btn-reset")]
|
|
210
210
|
}, {
|
|
211
211
|
default: () => [o.resetText || k("ap.apForm.search.reset")]
|
|
212
212
|
})]
|
|
213
|
-
}), o.extraInAction ?
|
|
213
|
+
}), o.extraInAction ? a(p) : null]
|
|
214
214
|
})]
|
|
215
215
|
})]
|
|
216
|
-
}),
|
|
216
|
+
}), x = !o.extraInAction && a(p) ? t(R, {
|
|
217
217
|
span: l.value.extraSpan,
|
|
218
218
|
key: "extraNode"
|
|
219
219
|
}, {
|
|
220
220
|
default: () => [t(q, null, {
|
|
221
221
|
default: () => [t(N, {
|
|
222
222
|
justify: l.value.extraSpan === s || l.value.lastRowOnlyIncludeActionAndExtra ? "start" : "flex-end"
|
|
223
|
-
}, ve(e =
|
|
223
|
+
}, ve(e = a(p)) ? e : {
|
|
224
224
|
default: () => [e]
|
|
225
225
|
})]
|
|
226
226
|
})]
|
|
227
|
-
}) : null,
|
|
227
|
+
}) : null, c = t(R, {
|
|
228
228
|
span: l.value.extraSpan
|
|
229
229
|
}, null);
|
|
230
|
-
return l.value.lastRowOnlyIncludeActionAndExtra ? t(w, null, [
|
|
230
|
+
return l.value.lastRowOnlyIncludeActionAndExtra ? t(w, null, [x || c, r]) : t(w, null, [r, x]);
|
|
231
231
|
});
|
|
232
232
|
return H({
|
|
233
|
-
apForm: _(() =>
|
|
234
|
-
}), (e,
|
|
233
|
+
apForm: _(() => a(g))
|
|
234
|
+
}), (e, n) => (f(), y(ge, le({
|
|
235
235
|
ref_key: "apForm",
|
|
236
|
-
ref:
|
|
237
|
-
class:
|
|
238
|
-
},
|
|
239
|
-
default: A(() => [(
|
|
236
|
+
ref: g,
|
|
237
|
+
class: a(h)()
|
|
238
|
+
}, a(pe)(o, ["collapse", "defaultCollapse", "onUpdate:collapse", "searchText", "resetText", "onSubmit", "onReset", "extraInAction", "forceExpand", "countPerRow"])), {
|
|
239
|
+
default: A(() => [(f(), y(B(l.value.hideNode))), t(a(ie), {
|
|
240
240
|
gutter: 8
|
|
241
241
|
}, {
|
|
242
|
-
default: A(() => [(
|
|
242
|
+
default: A(() => [(f(!0), re(w, null, se(l.value.nodes, (r) => (f(), y(a(R), {
|
|
243
243
|
key: r.key,
|
|
244
244
|
span: r.span
|
|
245
245
|
}, {
|
|
246
|
-
default: A(() => [(
|
|
246
|
+
default: A(() => [(f(), y(B(r.node)))]),
|
|
247
247
|
_: 2
|
|
248
|
-
}, 1032, ["span"]))), 128)), (
|
|
248
|
+
}, 1032, ["span"]))), 128)), (f(), y(B(X.value)))]),
|
|
249
249
|
_: 1
|
|
250
250
|
})]),
|
|
251
251
|
_: 1
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent as c, useSlots as u, ref as f, watchEffect as p, cloneVNode as d, onMounted as V, createElementBlock as _, openBlock as
|
|
1
|
+
import { defineComponent as c, useSlots as u, ref as f, watchEffect as p, cloneVNode as d, onMounted as V, createElementBlock as _, openBlock as l, Fragment as y, renderList as F, createBlock as k, resolveDynamicComponent as h } from "vue";
|
|
2
2
|
import { useInjectForm as v } from "../context.mjs";
|
|
3
3
|
import { isFunction as w, cloneDeep as x } from "lodash-unified";
|
|
4
4
|
import { isPromise as B } from "@fruits-chain/utils";
|
|
5
|
-
const
|
|
5
|
+
const S = /* @__PURE__ */ c({
|
|
6
|
+
name: "ApFormSet",
|
|
6
7
|
__name: "index",
|
|
7
8
|
props: {
|
|
8
9
|
name: {},
|
|
@@ -11,11 +12,11 @@ const j = /* @__PURE__ */ c({
|
|
|
11
12
|
transform: {}
|
|
12
13
|
},
|
|
13
14
|
setup(s) {
|
|
14
|
-
const { internalInstance: t } = v(), a = u(), e = s,
|
|
15
|
+
const { internalInstance: t } = v(), a = u(), e = s, m = f([]);
|
|
15
16
|
return p(() => {
|
|
16
17
|
if (a != null && a.default) {
|
|
17
18
|
const n = a.default();
|
|
18
|
-
|
|
19
|
+
m.value = n.map((r, o) => {
|
|
19
20
|
const i = e.as === "array" ? [e.name, o] : [e.name, r.props.name];
|
|
20
21
|
return d(r, { name: i });
|
|
21
22
|
});
|
|
@@ -27,9 +28,9 @@ const j = /* @__PURE__ */ c({
|
|
|
27
28
|
initialValue: x(n),
|
|
28
29
|
transform: e.transform
|
|
29
30
|
});
|
|
30
|
-
}), (n, r) => (
|
|
31
|
+
}), (n, r) => (l(!0), _(y, null, F(m.value, (o, i) => (l(), k(h(o), { key: i }))), 128));
|
|
31
32
|
}
|
|
32
33
|
});
|
|
33
34
|
export {
|
|
34
|
-
|
|
35
|
+
S as default
|
|
35
36
|
};
|
|
@@ -10,7 +10,7 @@ import { useNamespace as le } from "../../config-provider/hooks/use-namespace.mj
|
|
|
10
10
|
import { useGlobalConfig as ne } from "../../config-provider/hooks/use-global-config.mjs";
|
|
11
11
|
import fe from "../index.vue.mjs";
|
|
12
12
|
const Ce = /* @__PURE__ */ P({
|
|
13
|
-
name: "
|
|
13
|
+
name: "EditableGridFormItem",
|
|
14
14
|
__name: "form-item",
|
|
15
15
|
props: {
|
|
16
16
|
dropdownPrefixCls: {},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useSlots as
|
|
2
|
-
import { isFunction as
|
|
1
|
+
import { useSlots as y, computed as E, unref as m } from "vue";
|
|
2
|
+
import { isFunction as R, isArray as s } from "lodash-unified";
|
|
3
3
|
import { getEditableTableTitle as k, mergeClass as A } from "../../editable-table/utils.mjs";
|
|
4
4
|
import { updateFormProps as q, getFieldProps as v } from "../../ap-table/utils.mjs";
|
|
5
5
|
import "../../config-provider/index.mjs";
|
|
@@ -10,8 +10,8 @@ const M = (n, f) => {
|
|
|
10
10
|
const {
|
|
11
11
|
em: b,
|
|
12
12
|
be: x
|
|
13
|
-
} = S("editable-grid"), g =
|
|
14
|
-
return
|
|
13
|
+
} = S("editable-grid"), g = y(), [, h] = w();
|
|
14
|
+
return E(() => {
|
|
15
15
|
const l = n.columns;
|
|
16
16
|
if (!l)
|
|
17
17
|
return [];
|
|
@@ -19,40 +19,40 @@ const M = (n, f) => {
|
|
|
19
19
|
return C.map((e) => ({
|
|
20
20
|
...e,
|
|
21
21
|
children: o(e.children || []),
|
|
22
|
-
title: k(e, x("table-header", "title"), b("header-cell", "required"), g.headerCell, m(h).
|
|
22
|
+
title: k(e, x("table-header", "title"), b("header-cell", "required"), g.headerCell, m(h).colorTextTertiary),
|
|
23
23
|
// tips: 已经处理了title,传递tooltip为undefined不会再内部处理
|
|
24
24
|
tooltip: void 0,
|
|
25
25
|
customRender({
|
|
26
26
|
value: r,
|
|
27
27
|
originalNode: F,
|
|
28
|
-
...
|
|
28
|
+
...t
|
|
29
29
|
}) {
|
|
30
|
-
const i =
|
|
30
|
+
const i = R(e.editable) ? e.editable(t.text, t.record, t.index) : !!e.editable;
|
|
31
31
|
let d = F;
|
|
32
32
|
if (i) {
|
|
33
|
-
const
|
|
33
|
+
const a = q(e, v(e.fieldProps, {
|
|
34
34
|
value: r,
|
|
35
|
-
...
|
|
35
|
+
...t
|
|
36
36
|
})), c = {};
|
|
37
|
-
n.onFieldChange && (c[`onUpdate:${
|
|
37
|
+
n.onFieldChange && (c[`onUpdate:${a.valuePropName || "value"}`] = (T) => {
|
|
38
38
|
var u;
|
|
39
|
-
return (u = n.onFieldChange) == null ? void 0 : u.call(n,
|
|
39
|
+
return (u = n.onFieldChange) == null ? void 0 : u.call(n, t.index, e.dataIndex, T);
|
|
40
40
|
});
|
|
41
41
|
const N = s(e.dataIndex) ? e.dataIndex : [e.dataIndex], I = {
|
|
42
|
-
name: [...s(n.name) ? n.name : [n.name],
|
|
43
|
-
...
|
|
42
|
+
name: [...s(n.name) ? n.name : [n.name], t.index, ...N],
|
|
43
|
+
...a || {},
|
|
44
44
|
field: {
|
|
45
45
|
style: "width: 100%",
|
|
46
|
-
...(
|
|
46
|
+
...(a == null ? void 0 : a.field) || {},
|
|
47
47
|
...c,
|
|
48
|
-
class: A("is-editable",
|
|
48
|
+
class: A("is-editable", a.class)
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
-
d = G(e, I,
|
|
51
|
+
d = G(e, I, t.record, m(f));
|
|
52
52
|
}
|
|
53
53
|
return e.customRender ? e.customRender({
|
|
54
54
|
value: r,
|
|
55
|
-
...
|
|
55
|
+
...t,
|
|
56
56
|
editable: i,
|
|
57
57
|
originalNode: d
|
|
58
58
|
}) : d;
|