@aplus-frontend/ui 7.3.3 → 7.4.1
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 +176 -174
- package/es/src/ag-grid/editable/form-item.vue.d.ts +2 -4
- package/es/src/ag-grid/editable/index.vue.d.ts +2 -4
- package/es/src/ag-grid/index.vue.d.ts +2 -4
- package/es/src/ap-field/date/index.vue.mjs +68 -63
- package/es/src/ap-field/select/use-select-options.d.ts +2 -2
- package/es/src/ap-field/tree-select/use-request.d.ts +4 -4
- package/es/src/ap-form/ap-form.vue.d.ts +1 -2
- package/es/src/ap-form/drawer-form/index.vue.d.ts +3 -4
- package/es/src/ap-form/item/index.vue.mjs +95 -86
- package/es/src/ap-form/items/number/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/select/index.vue.d.ts +8 -8
- package/es/src/ap-form/items/text/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/text/password.vue.d.ts +2 -2
- package/es/src/ap-form/items/tree-select/index.vue.d.ts +2 -2
- package/es/src/ap-form/modal-form/index.vue.d.ts +3 -4
- package/es/src/ap-form/search-form/components/popover-filter.vue.d.ts +1 -1
- package/es/src/ap-form/search-form/index.vue.d.ts +3 -4
- package/es/src/ap-grid/editable/form-item.vue.d.ts +2 -4
- package/es/src/ap-grid/editable/index.vue.d.ts +2 -4
- package/es/src/ap-grid/index.vue.d.ts +2 -4
- package/es/src/ap-grid/utils/table.mjs +2 -2
- package/es/src/ap-list/index.vue.d.ts +2 -4
- package/es/src/ap-modal/interface.d.ts +4 -0
- package/es/src/ap-modal/style/index.d.ts +3 -0
- package/es/src/ap-modal/style/index.mjs +20 -0
- package/es/src/ap-modal/utils/confirm.d.ts +1 -1
- package/es/src/ap-modal/utils/createModal.mjs +58 -56
- package/es/src/ap-table/ap-table.vue.d.ts +2 -4
- package/es/src/ap-table/constants.d.ts +10 -10
- package/es/src/ap-table/hooks/use-table-column-state.d.ts +4 -4
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +24 -22
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +26 -24
- package/es/src/business/ag-grid-modal/interface.d.ts +2 -1
- package/es/src/business/ag-grid-modal/wrapper/index.vue.d.ts +3 -1
- package/es/src/business/ag-grid-modal/wrapper/index.vue2.mjs +16 -15
- package/es/src/business/ap-batch-action-group/index.d.ts +3 -3
- package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue.d.ts +1 -1
- package/es/src/business/ap-draggable-grid/index.d.ts +1 -1
- package/es/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +2 -4
- package/es/src/business/ap-expand-alert/index.d.ts +4 -6
- package/es/src/business/ap-select-layout/index.d.ts +2 -4
- package/es/src/business/ap-select-layout/select-layout.vue.d.ts +2 -4
- package/es/src/business/ap-select-layout/select-layout.vue2.mjs +2 -2
- package/es/src/business/ap-table-modal/index.d.ts +17 -5
- package/es/src/business/ap-upload/components/MultipleFile.vue.d.ts +1 -1
- package/es/src/business/ap-upload/components/Picture.vue.d.ts +2 -7
- package/es/src/business/ap-value-select-card/index.vue.d.ts +2 -4
- package/es/src/business/ap-view/components/main-button-content.vue.d.ts +2 -3
- package/es/src/business/ap-view/components/menu-list-content.vue.d.ts +2 -3
- package/es/src/business/batch-input-group/index.vue.d.ts +1 -1
- package/es/src/config-provider/hooks/use-namespace.d.ts +5 -1
- package/es/src/design-token/interface.d.ts +2 -0
- package/es/src/editable-table/form-item.vue.d.ts +2 -4
- package/es/src/editable-table/index.vue.d.ts +2 -4
- package/es/src/index.d.ts +1 -0
- package/es/src/index.mjs +280 -278
- package/es/src/loading-bar/global.d.ts +13 -0
- package/es/src/loading-bar/global.mjs +35 -0
- package/es/src/loading-bar/index.d.ts +9 -0
- package/es/src/loading-bar/index.mjs +9 -0
- package/es/src/loading-bar/index.vue.d.ts +14 -0
- package/es/src/loading-bar/index.vue.mjs +4 -0
- package/es/src/loading-bar/index.vue2.mjs +112 -0
- package/es/src/loading-bar/interface.d.ts +48 -0
- package/es/src/loading-bar/interface.mjs +1 -0
- package/es/src/loading-bar/style/index.d.ts +12 -0
- package/es/src/loading-bar/style/index.mjs +85 -0
- package/es/src/scroll-view/index.vue.d.ts +5 -5
- package/es/src/tests/wrapper.d.ts +4 -4
- package/es/src/utils/cssinjs/TokenUtil.mjs +1 -1
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/index.js +1 -1
- package/lib/src/ag-grid/editable/form-item.vue.d.ts +2 -4
- package/lib/src/ag-grid/editable/index.vue.d.ts +2 -4
- package/lib/src/ag-grid/index.vue.d.ts +2 -4
- package/lib/src/ap-field/date/index.vue.js +1 -1
- package/lib/src/ap-field/select/use-select-options.d.ts +2 -2
- package/lib/src/ap-field/tree-select/use-request.d.ts +4 -4
- package/lib/src/ap-form/ap-form.vue.d.ts +1 -2
- package/lib/src/ap-form/drawer-form/index.vue.d.ts +3 -4
- package/lib/src/ap-form/item/index.vue.js +1 -1
- package/lib/src/ap-form/items/number/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/select/index.vue.d.ts +8 -8
- package/lib/src/ap-form/items/text/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/text/password.vue.d.ts +2 -2
- package/lib/src/ap-form/items/tree-select/index.vue.d.ts +2 -2
- package/lib/src/ap-form/modal-form/index.vue.d.ts +3 -4
- package/lib/src/ap-form/search-form/components/popover-filter.vue.d.ts +1 -1
- package/lib/src/ap-form/search-form/index.vue.d.ts +3 -4
- package/lib/src/ap-grid/editable/form-item.vue.d.ts +2 -4
- package/lib/src/ap-grid/editable/index.vue.d.ts +2 -4
- package/lib/src/ap-grid/index.vue.d.ts +2 -4
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-list/index.vue.d.ts +2 -4
- package/lib/src/ap-modal/interface.d.ts +4 -0
- package/lib/src/ap-modal/style/index.d.ts +3 -0
- package/lib/src/ap-modal/style/index.js +1 -0
- package/lib/src/ap-modal/utils/confirm.d.ts +1 -1
- package/lib/src/ap-modal/utils/createModal.js +1 -1
- package/lib/src/ap-table/ap-table.vue.d.ts +2 -4
- package/lib/src/ap-table/constants.d.ts +10 -10
- package/lib/src/ap-table/hooks/use-table-column-state.d.ts +4 -4
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.js +1 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.js +1 -1
- package/lib/src/business/ag-grid-modal/interface.d.ts +2 -1
- package/lib/src/business/ag-grid-modal/wrapper/index.vue.d.ts +3 -1
- package/lib/src/business/ag-grid-modal/wrapper/index.vue2.js +1 -1
- package/lib/src/business/ap-batch-action-group/index.d.ts +3 -3
- package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue.d.ts +1 -1
- package/lib/src/business/ap-draggable-grid/index.d.ts +1 -1
- package/lib/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +2 -4
- package/lib/src/business/ap-expand-alert/index.d.ts +4 -6
- package/lib/src/business/ap-select-layout/index.d.ts +2 -4
- package/lib/src/business/ap-select-layout/select-layout.vue.d.ts +2 -4
- package/lib/src/business/ap-select-layout/select-layout.vue2.js +1 -1
- package/lib/src/business/ap-table-modal/index.d.ts +17 -5
- package/lib/src/business/ap-upload/components/MultipleFile.vue.d.ts +1 -1
- package/lib/src/business/ap-upload/components/Picture.vue.d.ts +2 -7
- package/lib/src/business/ap-value-select-card/index.vue.d.ts +2 -4
- package/lib/src/business/ap-view/components/main-button-content.vue.d.ts +2 -3
- package/lib/src/business/ap-view/components/menu-list-content.vue.d.ts +2 -3
- package/lib/src/business/batch-input-group/index.vue.d.ts +1 -1
- package/lib/src/config-provider/hooks/use-namespace.d.ts +5 -1
- package/lib/src/design-token/interface.d.ts +2 -0
- package/lib/src/editable-table/form-item.vue.d.ts +2 -4
- package/lib/src/editable-table/index.vue.d.ts +2 -4
- package/lib/src/index.d.ts +1 -0
- package/lib/src/index.js +1 -1
- package/lib/src/loading-bar/global.d.ts +13 -0
- package/lib/src/loading-bar/global.js +1 -0
- package/lib/src/loading-bar/index.d.ts +9 -0
- package/lib/src/loading-bar/index.js +1 -0
- package/lib/src/loading-bar/index.vue.d.ts +14 -0
- package/lib/src/loading-bar/index.vue.js +1 -0
- package/lib/src/loading-bar/index.vue2.js +1 -0
- package/lib/src/loading-bar/interface.d.ts +48 -0
- package/lib/src/loading-bar/interface.js +1 -0
- package/lib/src/loading-bar/style/index.d.ts +12 -0
- package/lib/src/loading-bar/style/index.js +17 -0
- package/lib/src/scroll-view/index.vue.d.ts +5 -5
- package/lib/src/tests/wrapper.d.ts +4 -4
- package/lib/src/utils/cssinjs/TokenUtil.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +5 -5
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as E, computed as r, unref as t, createElementBlock as B, createBlock as y, openBlock as i, Fragment as g, createTextVNode as k, toDisplayString as w, normalizeStyle as N, withCtx as s, createVNode as P, createCommentVNode as I, isRef as j, renderList as b, mergeProps as U, createSlots as H, renderSlot as K, normalizeProps as W, guardReactiveProps as $ } from "vue";
|
|
2
2
|
import u from "dayjs";
|
|
3
|
-
import { InputGroup as G,
|
|
4
|
-
import { ApFieldDatePresetFormats as
|
|
3
|
+
import { InputGroup as G, FormItemRest as L, Select as Y, SelectOption as Z, DatePicker as q } from "@aplus-frontend/antdv";
|
|
4
|
+
import { ApFieldDatePresetFormats as J, PRESET_FORMAT_MAP as C, PRESET_FORMAT_PICK_MAP as Q, PRESET_FORMAT_TIME_MAP as X } from "./constant.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
|
-
import { isNil as
|
|
7
|
-
import { formatDayWithTimezone as
|
|
8
|
-
import { getTimeFormatToZone as
|
|
9
|
-
import { useDefaultPlaceholder as
|
|
10
|
-
import { useDateTimezone as
|
|
11
|
-
import { useControllableValue as
|
|
12
|
-
const
|
|
6
|
+
import { isNil as S, omit as ee } from "lodash-unified";
|
|
7
|
+
import { formatDayWithTimezone as oe } from "./helper.mjs";
|
|
8
|
+
import { getTimeFormatToZone as te } from "@aplus-frontend/utils";
|
|
9
|
+
import { useDefaultPlaceholder as ae } from "../hooks/use-default-placeholder.mjs";
|
|
10
|
+
import { useDateTimezone as ne } from "../hooks/use-date-timezone.mjs";
|
|
11
|
+
import { useControllableValue as le } from "../../hooks/useControllableValue.mjs";
|
|
12
|
+
const he = /* @__PURE__ */ E({
|
|
13
13
|
name: "ApFieldDate",
|
|
14
14
|
__name: "index",
|
|
15
15
|
props: {
|
|
@@ -91,23 +91,23 @@ const ye = /* @__PURE__ */ z({
|
|
|
91
91
|
timezone: {}
|
|
92
92
|
},
|
|
93
93
|
emits: ["update:value"],
|
|
94
|
-
setup(
|
|
95
|
-
const e =
|
|
94
|
+
setup(T, { emit: F }) {
|
|
95
|
+
const e = T, O = F, { value: f, updateValue: h } = le(
|
|
96
96
|
e,
|
|
97
97
|
O
|
|
98
|
-
),
|
|
99
|
-
() =>
|
|
100
|
-
), A = r(() => e.shownFormat ? e.shownFormat : l.value ?
|
|
101
|
-
() => l.value ?
|
|
98
|
+
), _ = ae("Date", e), { currentTimezone: d } = ne(e), l = r(
|
|
99
|
+
() => J.indexOf(e.format) > -1
|
|
100
|
+
), A = r(() => e.shownFormat ? e.shownFormat : l.value ? C[e.format] : e.format), m = r(
|
|
101
|
+
() => l.value ? C[e.format] : e.format
|
|
102
102
|
), c = r(() => {
|
|
103
|
-
if (
|
|
103
|
+
if (S(t(f)))
|
|
104
104
|
return;
|
|
105
105
|
let o = u(t(f));
|
|
106
|
-
return e.timezone && (o = u(
|
|
107
|
-
}),
|
|
108
|
-
const o = t(l) ?
|
|
106
|
+
return e.timezone && (o = u(te(t(f), d.value))), o;
|
|
107
|
+
}), R = r(() => t(l) ? e.picker ?? Q[e.format] : e.picker), M = r(() => {
|
|
108
|
+
const o = t(l) ? X[e.format] : {};
|
|
109
109
|
return {
|
|
110
|
-
...
|
|
110
|
+
...ee(e, [
|
|
111
111
|
"value",
|
|
112
112
|
"defaultValue",
|
|
113
113
|
"onChange",
|
|
@@ -116,12 +116,12 @@ const ye = /* @__PURE__ */ z({
|
|
|
116
116
|
"onUpdate:value",
|
|
117
117
|
"mode"
|
|
118
118
|
]),
|
|
119
|
-
placeholder: t(
|
|
119
|
+
placeholder: t(_),
|
|
120
120
|
...o
|
|
121
121
|
};
|
|
122
|
-
}), v = (o, n, a = !0) =>
|
|
123
|
-
function
|
|
124
|
-
if (
|
|
122
|
+
}), v = (o, n, a = !0) => oe(d.value)(o, n, a);
|
|
123
|
+
function D(o) {
|
|
124
|
+
if (S(o)) {
|
|
125
125
|
h(null);
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
@@ -129,71 +129,76 @@ const ye = /* @__PURE__ */ z({
|
|
|
129
129
|
h(
|
|
130
130
|
v(
|
|
131
131
|
n,
|
|
132
|
-
t(l) ? t(
|
|
132
|
+
t(l) ? t(m) : void 0,
|
|
133
133
|
e.formatBegins
|
|
134
134
|
)
|
|
135
135
|
);
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
const a = u(o),
|
|
137
|
+
function V(o, n) {
|
|
138
|
+
const a = u(o), p = o ? v(
|
|
139
139
|
a,
|
|
140
|
-
t(l) ? t(
|
|
140
|
+
t(l) ? t(m) : void 0,
|
|
141
141
|
e.formatBegins
|
|
142
142
|
) : null;
|
|
143
|
-
e.onChange?.(
|
|
143
|
+
e.onChange?.(p, n);
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function x(o) {
|
|
146
146
|
const n = u(o), a = o ? v(
|
|
147
147
|
n,
|
|
148
|
-
t(l) ? t(
|
|
148
|
+
t(l) ? t(m) : void 0,
|
|
149
149
|
e.formatBegins
|
|
150
150
|
) : null;
|
|
151
151
|
e.onOk?.(a);
|
|
152
152
|
}
|
|
153
153
|
return (o, n) => o.mode === "read" ? (i(), B(g, { key: 0 }, [
|
|
154
|
-
k(w(c.value ? t(u)(c.value).format(
|
|
154
|
+
k(w(c.value ? t(u)(c.value).format(m.value) : o.emptyText), 1)
|
|
155
155
|
], 64)) : (i(), y(t(G), {
|
|
156
156
|
key: 1,
|
|
157
157
|
compact: "",
|
|
158
|
-
style:
|
|
158
|
+
style: N({
|
|
159
159
|
display: Array.isArray(e.timezone) && e.timezone.length ? "flex" : "block"
|
|
160
160
|
})
|
|
161
161
|
}, {
|
|
162
|
-
default:
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
(i(!0), B(g, null, P(e.timezone, (a) => (i(), y(t(Y), {
|
|
174
|
-
key: a?.value,
|
|
175
|
-
value: a?.value
|
|
162
|
+
default: s(() => [
|
|
163
|
+
P(t(L), null, {
|
|
164
|
+
default: s(() => [
|
|
165
|
+
Array.isArray(e.timezone) && e.timezone.length ? (i(), y(t(Y), {
|
|
166
|
+
key: 0,
|
|
167
|
+
value: t(d),
|
|
168
|
+
"onUpdate:value": n[0] || (n[0] = (a) => j(d) ? d.value = a : null),
|
|
169
|
+
"default-active-first-option": "",
|
|
170
|
+
"dropdown-match-select-width": !1,
|
|
171
|
+
style: { "max-width": "50%" },
|
|
172
|
+
disabled: o.disabled
|
|
176
173
|
}, {
|
|
177
|
-
default:
|
|
178
|
-
|
|
174
|
+
default: s(() => [
|
|
175
|
+
(i(!0), B(g, null, b(e.timezone, (a) => (i(), y(t(Z), {
|
|
176
|
+
key: a?.value,
|
|
177
|
+
value: a?.value
|
|
178
|
+
}, {
|
|
179
|
+
default: s(() => [
|
|
180
|
+
k(w(a?.label ?? a?.value), 1)
|
|
181
|
+
]),
|
|
182
|
+
_: 2
|
|
183
|
+
}, 1032, ["value"]))), 128))
|
|
179
184
|
]),
|
|
180
|
-
_:
|
|
181
|
-
},
|
|
185
|
+
_: 1
|
|
186
|
+
}, 8, ["value", "disabled"])) : I("", !0)
|
|
182
187
|
]),
|
|
183
188
|
_: 1
|
|
184
|
-
}
|
|
185
|
-
|
|
189
|
+
}),
|
|
190
|
+
P(t(q), U(M.value, {
|
|
186
191
|
value: c.value,
|
|
187
192
|
format: A.value,
|
|
188
|
-
picker:
|
|
189
|
-
"onUpdate:value":
|
|
190
|
-
onChange:
|
|
191
|
-
onOk:
|
|
193
|
+
picker: R.value,
|
|
194
|
+
"onUpdate:value": D,
|
|
195
|
+
onChange: V,
|
|
196
|
+
onOk: x
|
|
192
197
|
}), H({ _: 2 }, [
|
|
193
|
-
|
|
194
|
-
name:
|
|
195
|
-
fn:
|
|
196
|
-
K(o.$slots,
|
|
198
|
+
b(o.$slots, (a, p) => ({
|
|
199
|
+
name: p,
|
|
200
|
+
fn: s((z) => [
|
|
201
|
+
K(o.$slots, p, W($(z || {})))
|
|
197
202
|
])
|
|
198
203
|
}))
|
|
199
204
|
]), 1040, ["value", "format", "picker"])
|
|
@@ -203,5 +208,5 @@ const ye = /* @__PURE__ */ z({
|
|
|
203
208
|
}
|
|
204
209
|
});
|
|
205
210
|
export {
|
|
206
|
-
|
|
211
|
+
he as default
|
|
207
212
|
};
|
|
@@ -6,13 +6,13 @@ export declare const useSelectOptions: (props: ApFieldSelectProps) => {
|
|
|
6
6
|
options: Ref<{
|
|
7
7
|
[x: string]: any;
|
|
8
8
|
label?: any;
|
|
9
|
-
value?:
|
|
9
|
+
value?: string | number | null | undefined;
|
|
10
10
|
children?: Omit<DefaultOptionType, "children">[] | undefined;
|
|
11
11
|
disabled?: boolean | undefined;
|
|
12
12
|
}[], DefaultOptionType[] | {
|
|
13
13
|
[x: string]: any;
|
|
14
14
|
label?: any;
|
|
15
|
-
value?:
|
|
15
|
+
value?: string | number | null | undefined;
|
|
16
16
|
children?: Omit<DefaultOptionType, "children">[] | undefined;
|
|
17
17
|
disabled?: boolean | undefined;
|
|
18
18
|
}[]>;
|
|
@@ -8,14 +8,14 @@ export declare const useRequest: (props: ApFieldTreeSelectProps) => {
|
|
|
8
8
|
disabled?: boolean | undefined;
|
|
9
9
|
checkable?: boolean | undefined;
|
|
10
10
|
disableCheckbox?: boolean | undefined;
|
|
11
|
-
children?: any[] | undefined;
|
|
11
|
+
children?: /*elided*/ any[] | undefined;
|
|
12
12
|
} | {
|
|
13
13
|
[x: string]: any;
|
|
14
14
|
value?: RawValueType | undefined;
|
|
15
15
|
title?: any;
|
|
16
16
|
label?: any;
|
|
17
17
|
key?: Key | undefined;
|
|
18
|
-
children?: any[] | undefined;
|
|
18
|
+
children?: /*elided*/ any[] | undefined;
|
|
19
19
|
disabled?: boolean | undefined;
|
|
20
20
|
checkable?: boolean | undefined;
|
|
21
21
|
disableCheckbox?: boolean | undefined;
|
|
@@ -24,14 +24,14 @@ export declare const useRequest: (props: ApFieldTreeSelectProps) => {
|
|
|
24
24
|
disabled?: boolean | undefined;
|
|
25
25
|
checkable?: boolean | undefined;
|
|
26
26
|
disableCheckbox?: boolean | undefined;
|
|
27
|
-
children?: any[] | undefined;
|
|
27
|
+
children?: /*elided*/ any[] | undefined;
|
|
28
28
|
} | {
|
|
29
29
|
[x: string]: any;
|
|
30
30
|
value?: RawValueType | undefined;
|
|
31
31
|
title?: any;
|
|
32
32
|
label?: any;
|
|
33
33
|
key?: Key | undefined;
|
|
34
|
-
children?: any[] | undefined;
|
|
34
|
+
children?: /*elided*/ any[] | undefined;
|
|
35
35
|
disabled?: boolean | undefined;
|
|
36
36
|
checkable?: boolean | undefined;
|
|
37
37
|
disableCheckbox?: boolean | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApFormProps, UpdateModelOptimizeFn, WatchFunc, ApFormInternalInstance } from './interface';
|
|
2
|
-
import { InternalNamePath, NamePath, ValidateOptions, FormLabelAlign,
|
|
2
|
+
import { InternalNamePath, NamePath, ValidateOptions, FormLabelAlign, ValidateMessages, FieldData, ValidateErrorEntity } from '@aplus-frontend/antdv/es/form/interface';
|
|
3
3
|
import { Recordable } from '../type';
|
|
4
4
|
import { CreateComponentPublicInstanceWithMixins, ExtractPropTypes, PropType, HTMLAttributes, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, DefineComponent } from 'vue';
|
|
5
5
|
import { VueTypeDef, VueTypeValidableDef } from '../../node_modules/vue-types';
|
|
@@ -7,7 +7,6 @@ import { ColSize } from '@aplus-frontend/antdv/es/grid';
|
|
|
7
7
|
import { RequiredMark } from '@aplus-frontend/antdv/es/form/Form';
|
|
8
8
|
import { RuleObject } from '@aplus-frontend/antdv/es/form';
|
|
9
9
|
import { Options } from '../../node_modules/scroll-into-view-if-needed';
|
|
10
|
-
import { SizeType } from '@aplus-frontend/antdv/es/config-provider';
|
|
11
10
|
import { SizeType } from '@aplus-frontend/antdv/es/button';
|
|
12
11
|
import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
|
|
13
12
|
declare function __VLS_template(): {
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { ApFormDrawerFormProps, CustomizeResizeType } from '../interface';
|
|
2
2
|
import { VNode, ComponentInternalInstance, ExtractPropTypes, PropType, HTMLAttributes, VNodeProps, AllowedComponentProps, ComponentCustomProps, CreateComponentPublicInstanceWithMixins, ComponentOptionsMixin, PublicProps, GlobalComponents, GlobalDirectives, ComponentProvideOptions, Slot, ComponentPublicInstance, ComponentOptionsBase, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties, DefineComponent, CSSProperties } from 'vue';
|
|
3
|
-
import { InternalNamePath, NamePath, ValidateOptions, FormLabelAlign, ValidateMessages, FieldData, ValidateErrorEntity
|
|
3
|
+
import { InternalNamePath, NamePath, ValidateOptions, FormLabelAlign, ValidateMessages, FieldData, ValidateErrorEntity } from '@aplus-frontend/antdv/es/form/interface';
|
|
4
4
|
import { ColSize } from '@aplus-frontend/antdv/es/grid';
|
|
5
5
|
import { RequiredMark } from '@aplus-frontend/antdv/es/form/Form';
|
|
6
6
|
import { RuleObject } from '@aplus-frontend/antdv/es/form';
|
|
7
7
|
import { Options } from '../../../node_modules/scroll-into-view-if-needed';
|
|
8
8
|
import { Recordable } from '../../type';
|
|
9
9
|
import { VueTypeDef, VueTypeValidableDef } from '../../../node_modules/vue-types';
|
|
10
|
-
import { SizeType } from '@aplus-frontend/antdv/es/config-provider';
|
|
11
10
|
import { SizeType } from '@aplus-frontend/antdv/es/button';
|
|
12
11
|
import { VueNode } from '@aplus-frontend/antdv/es/_util/type';
|
|
13
12
|
import { ApFormProps, UpdateModelOptimizeFn, ApFormInternalInstance, WatchFunc, ApFormSubmitterConfig } from '..';
|
|
@@ -119,7 +118,7 @@ declare function __VLS_template(): {
|
|
|
119
118
|
readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
120
119
|
readonly initialValues?: Recordable | undefined;
|
|
121
120
|
readonly onValuesChange?: ((changedValues: Recordable, allValues: Recordable, fieldName: NamePath) => void) | undefined;
|
|
122
|
-
readonly syncToUrl?:
|
|
121
|
+
readonly syncToUrl?: boolean | ((values: Recordable, type: "get" | "set") => Recordable) | undefined;
|
|
123
122
|
readonly syncToUrlPriority?: boolean | undefined;
|
|
124
123
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
125
124
|
$attrs: {
|
|
@@ -1082,7 +1081,7 @@ declare const __VLS_component: DefineComponent<ApFormDrawerFormProps, {
|
|
|
1082
1081
|
readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
1083
1082
|
readonly initialValues?: Recordable | undefined;
|
|
1084
1083
|
readonly onValuesChange?: ((changedValues: Recordable, allValues: Recordable, fieldName: NamePath) => void) | undefined;
|
|
1085
|
-
readonly syncToUrl?:
|
|
1084
|
+
readonly syncToUrl?: boolean | ((values: Recordable, type: "get" | "set") => Recordable) | undefined;
|
|
1086
1085
|
readonly syncToUrlPriority?: boolean | undefined;
|
|
1087
1086
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
1088
1087
|
$attrs: {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Form as
|
|
3
|
-
import { useToken as
|
|
4
|
-
import { isFunction as
|
|
1
|
+
import { defineComponent as _, useSlots as j, ref as y, onMounted as E, computed as M, unref as r, cloneVNode as O, createBlock as b, openBlock as v, mergeProps as $, createSlots as q, withCtx as i, resolveDynamicComponent as K, renderList as Q, createElementVNode as U, normalizeClass as Y, createVNode as f, normalizeStyle as G, renderSlot as H, normalizeProps as J, guardReactiveProps as W } from "vue";
|
|
2
|
+
import { Form as X, Tooltip as Z, TypographyText as ee } from "@aplus-frontend/antdv";
|
|
3
|
+
import { useToken as oe } from "@aplus-frontend/antdv/es/theme/internal";
|
|
4
|
+
import { isFunction as F, cloneDeep as te, isArray as re, omit as V } from "lodash-unified";
|
|
5
5
|
import { apFormItemColPropKeys as le } from "../constant.mjs";
|
|
6
|
-
import { QuestionCircleOutlined as
|
|
6
|
+
import { QuestionCircleOutlined as ne } from "@ant-design/icons-vue";
|
|
7
7
|
import "../../config-provider/index.mjs";
|
|
8
8
|
import { useInjectForm as ae } from "../context.mjs";
|
|
9
|
-
import { isPromise as
|
|
10
|
-
import { getValidVNodeList as
|
|
11
|
-
import
|
|
12
|
-
import { useNamespace as
|
|
13
|
-
const
|
|
9
|
+
import { isPromise as ie } from "@fruits-chain/utils";
|
|
10
|
+
import { getValidVNodeList as se } from "../../utils/slot.mjs";
|
|
11
|
+
import ue from "../style/item.mjs";
|
|
12
|
+
import { useNamespace as de } from "../../config-provider/hooks/use-namespace.mjs";
|
|
13
|
+
const Ce = /* @__PURE__ */ _({
|
|
14
14
|
name: "ApFormItem",
|
|
15
15
|
__name: "index",
|
|
16
16
|
props: {
|
|
@@ -57,100 +57,109 @@ const Be = /* @__PURE__ */ L({
|
|
|
57
57
|
customFilled: {},
|
|
58
58
|
disabled: { type: Boolean }
|
|
59
59
|
},
|
|
60
|
-
setup(
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
let
|
|
64
|
-
|
|
65
|
-
name:
|
|
66
|
-
initialValue:
|
|
67
|
-
transform:
|
|
60
|
+
setup(g, { expose: h }) {
|
|
61
|
+
const o = g, m = j(), { model: p, updateModel: B, internalInstance: C } = ae(), { m: u, b: k } = de("ap-form-item"), P = ue("ap-form-item"), d = y(!1), a = y(), [, x] = oe();
|
|
62
|
+
E(async () => {
|
|
63
|
+
let e = F(o.initialValue) ? o.initialValue() : o.initialValue;
|
|
64
|
+
ie(e) && (e = await e), C?.registerField({
|
|
65
|
+
name: o.name,
|
|
66
|
+
initialValue: te(e),
|
|
67
|
+
transform: o.transform
|
|
68
68
|
});
|
|
69
69
|
});
|
|
70
|
-
const
|
|
71
|
-
function
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return l ? j(l, {
|
|
77
|
-
[e.valuePropName]: t(f),
|
|
78
|
-
[`onUpdate:${e.valuePropName}`]: N,
|
|
79
|
-
variant: e.bordered ? "borderless" : l?.props?.variant,
|
|
80
|
-
bordered: e.bordered ? !1 : l?.props?.bordered,
|
|
81
|
-
onFocus: P,
|
|
82
|
-
onBlur: S
|
|
83
|
-
}) : null;
|
|
84
|
-
}
|
|
85
|
-
function N(o) {
|
|
86
|
-
h?.(e.name, o);
|
|
70
|
+
const c = M(() => o.name ? re(o.name) ? o.name.reduce((e, t) => e?.[t], r(p)) : p?.value[o.name] : null);
|
|
71
|
+
function N(e, t) {
|
|
72
|
+
const l = Object.keys(t), n = { ...t };
|
|
73
|
+
return l.forEach((s) => {
|
|
74
|
+
s in e || delete n[s];
|
|
75
|
+
}), n;
|
|
87
76
|
}
|
|
88
|
-
function
|
|
89
|
-
|
|
77
|
+
function I() {
|
|
78
|
+
const e = m.default?.() || [];
|
|
79
|
+
if (!o.name)
|
|
80
|
+
return e[0];
|
|
81
|
+
const t = se(e)[0];
|
|
82
|
+
if (!t)
|
|
83
|
+
return null;
|
|
84
|
+
const l = t?.type?.props ?? {}, n = {
|
|
85
|
+
[o.valuePropName]: r(c),
|
|
86
|
+
[`onUpdate:${o.valuePropName}`]: S,
|
|
87
|
+
variant: o.bordered ? "borderless" : t?.props?.variant,
|
|
88
|
+
bordered: o.bordered ? !1 : t?.props?.bordered,
|
|
89
|
+
onFocus: T,
|
|
90
|
+
onBlur: w
|
|
91
|
+
};
|
|
92
|
+
return O(t, N(l, n));
|
|
90
93
|
}
|
|
91
|
-
function S() {
|
|
92
|
-
|
|
94
|
+
function S(e) {
|
|
95
|
+
B?.(o.name, e);
|
|
93
96
|
}
|
|
94
97
|
function T() {
|
|
95
|
-
|
|
98
|
+
d.value = !0;
|
|
96
99
|
}
|
|
97
100
|
function w() {
|
|
98
|
-
|
|
101
|
+
d.value = !1;
|
|
99
102
|
}
|
|
100
103
|
function z() {
|
|
101
|
-
|
|
104
|
+
a.value?.onFieldBlur();
|
|
102
105
|
}
|
|
103
106
|
function R() {
|
|
104
|
-
|
|
107
|
+
a.value?.onFieldChange();
|
|
108
|
+
}
|
|
109
|
+
function A() {
|
|
110
|
+
a.value?.clearValidate();
|
|
111
|
+
}
|
|
112
|
+
function D() {
|
|
113
|
+
a.value?.resetField();
|
|
105
114
|
}
|
|
106
|
-
function
|
|
107
|
-
const
|
|
108
|
-
if (!
|
|
109
|
-
return
|
|
110
|
-
const
|
|
111
|
-
return
|
|
115
|
+
function L(e = !1) {
|
|
116
|
+
const t = r(c);
|
|
117
|
+
if (!e || !o.transform)
|
|
118
|
+
return t;
|
|
119
|
+
const l = F(o.transform) ? o.transform : o.transform.transformer;
|
|
120
|
+
return o.transform ? l(t) : t;
|
|
112
121
|
}
|
|
113
|
-
return
|
|
114
|
-
onFieldBlur:
|
|
115
|
-
onFieldChange:
|
|
116
|
-
clearValidate:
|
|
117
|
-
resetField:
|
|
118
|
-
getFieldValue:
|
|
119
|
-
}), (
|
|
122
|
+
return h({
|
|
123
|
+
onFieldBlur: z,
|
|
124
|
+
onFieldChange: R,
|
|
125
|
+
clearValidate: A,
|
|
126
|
+
resetField: D,
|
|
127
|
+
getFieldValue: L
|
|
128
|
+
}), (e, t) => (v(), b(r(X).Item, $(
|
|
120
129
|
{
|
|
121
130
|
ref_key: "formItemRef",
|
|
122
|
-
ref:
|
|
131
|
+
ref: a
|
|
123
132
|
},
|
|
124
|
-
|
|
133
|
+
r(V)(o, [...r(le), "tooltip", "label", "description"]),
|
|
125
134
|
{
|
|
126
135
|
class: {
|
|
127
|
-
[
|
|
128
|
-
[
|
|
129
|
-
[
|
|
130
|
-
[
|
|
131
|
-
[
|
|
136
|
+
[r(u)("bordered")]: e.bordered,
|
|
137
|
+
[r(u)("focused")]: e.bordered && d.value,
|
|
138
|
+
[r(u)("disabled")]: e.bordered && e.disabled,
|
|
139
|
+
[r(k)()]: !0,
|
|
140
|
+
[r(P)]: !0
|
|
132
141
|
},
|
|
133
|
-
colon:
|
|
142
|
+
colon: e.bordered ? !1 : o.colon
|
|
134
143
|
}
|
|
135
|
-
),
|
|
136
|
-
default:
|
|
144
|
+
), q({
|
|
145
|
+
default: i(() => [
|
|
137
146
|
(v(), b(K(I())))
|
|
138
147
|
]),
|
|
139
148
|
_: 2
|
|
140
149
|
}, [
|
|
141
|
-
|
|
150
|
+
o.tooltip ? {
|
|
142
151
|
name: "tooltip",
|
|
143
|
-
fn:
|
|
144
|
-
|
|
145
|
-
class:
|
|
152
|
+
fn: i(({ class: l }) => [
|
|
153
|
+
U("span", {
|
|
154
|
+
class: Y(l)
|
|
146
155
|
}, [
|
|
147
|
-
|
|
148
|
-
title:
|
|
156
|
+
f(r(Z), {
|
|
157
|
+
title: o.tooltip
|
|
149
158
|
}, {
|
|
150
|
-
default:
|
|
151
|
-
|
|
152
|
-
style:
|
|
153
|
-
color:
|
|
159
|
+
default: i(() => [
|
|
160
|
+
f(r(ne), {
|
|
161
|
+
style: G({
|
|
162
|
+
color: r(x).colorTextTertiary,
|
|
154
163
|
fontSize: "14px",
|
|
155
164
|
transform: "translateY(1px)"
|
|
156
165
|
})
|
|
@@ -162,26 +171,26 @@ const Be = /* @__PURE__ */ L({
|
|
|
162
171
|
]),
|
|
163
172
|
key: "0"
|
|
164
173
|
} : void 0,
|
|
165
|
-
|
|
174
|
+
e.label ? {
|
|
166
175
|
name: "label",
|
|
167
|
-
fn:
|
|
168
|
-
|
|
169
|
-
content:
|
|
170
|
-
ellipsis: { tooltip:
|
|
176
|
+
fn: i(() => [
|
|
177
|
+
f(r(ee), {
|
|
178
|
+
content: e.label,
|
|
179
|
+
ellipsis: { tooltip: e.label },
|
|
171
180
|
style: { "min-width": "0px", flex: "1" }
|
|
172
181
|
}, null, 8, ["content", "ellipsis"])
|
|
173
182
|
]),
|
|
174
183
|
key: "1"
|
|
175
184
|
} : void 0,
|
|
176
|
-
|
|
177
|
-
name:
|
|
178
|
-
fn:
|
|
179
|
-
|
|
185
|
+
Q(r(V)(m, "default"), (l, n) => ({
|
|
186
|
+
name: n,
|
|
187
|
+
fn: i((s) => [
|
|
188
|
+
H(e.$slots, n, J(W(s || {})))
|
|
180
189
|
])
|
|
181
190
|
}))
|
|
182
191
|
]), 1040, ["class", "colon"]));
|
|
183
192
|
}
|
|
184
193
|
});
|
|
185
194
|
export {
|
|
186
|
-
|
|
195
|
+
Ce as default
|
|
187
196
|
};
|
|
@@ -66,9 +66,9 @@ declare function __VLS_template(): {
|
|
|
66
66
|
type: "up" | "down";
|
|
67
67
|
}) => void) | undefined;
|
|
68
68
|
readonly type?: string | undefined;
|
|
69
|
-
readonly placeholder?: string | undefined;
|
|
70
69
|
readonly name?: string | undefined;
|
|
71
70
|
readonly id?: string | undefined;
|
|
71
|
+
readonly placeholder?: string | undefined;
|
|
72
72
|
readonly valueModifiers?: Record<string, any> | undefined;
|
|
73
73
|
readonly addonBefore?: any;
|
|
74
74
|
readonly addonAfter?: any;
|
|
@@ -561,9 +561,9 @@ declare const __VLS_component: DefineComponent<ApFormItemNumberProps, {
|
|
|
561
561
|
type: "up" | "down";
|
|
562
562
|
}) => void) | undefined;
|
|
563
563
|
readonly type?: string | undefined;
|
|
564
|
-
readonly placeholder?: string | undefined;
|
|
565
564
|
readonly name?: string | undefined;
|
|
566
565
|
readonly id?: string | undefined;
|
|
566
|
+
readonly placeholder?: string | undefined;
|
|
567
567
|
readonly valueModifiers?: Record<string, any> | undefined;
|
|
568
568
|
readonly addonBefore?: any;
|
|
569
569
|
readonly addonAfter?: any;
|
|
@@ -66,7 +66,6 @@ declare function __VLS_template(): {
|
|
|
66
66
|
readonly direction?: "ltr" | "rtl" | undefined;
|
|
67
67
|
readonly animation?: string | undefined;
|
|
68
68
|
readonly children?: VueNode[] | undefined;
|
|
69
|
-
readonly placeholder?: any;
|
|
70
69
|
readonly prefixCls?: string | undefined;
|
|
71
70
|
readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
72
71
|
readonly loading?: boolean | undefined;
|
|
@@ -77,6 +76,7 @@ declare function __VLS_template(): {
|
|
|
77
76
|
readonly getPopupContainer?: RenderDOMFunc | undefined;
|
|
78
77
|
readonly virtual?: boolean | undefined;
|
|
79
78
|
readonly dropdownMatchSelectWidth?: number | boolean | undefined;
|
|
79
|
+
readonly placeholder?: any;
|
|
80
80
|
readonly status?: "" | "error" | "warning" | undefined;
|
|
81
81
|
readonly defaultValue?: (string | number) | LabeledValue | (string | number)[] | LabeledValue[] | undefined;
|
|
82
82
|
readonly prefix?: any;
|
|
@@ -127,12 +127,12 @@ declare function __VLS_template(): {
|
|
|
127
127
|
readonly emptyText?: string | undefined;
|
|
128
128
|
readonly request?: ((value?: string, extraParams?: Recordable) => Promise< SelectProps["options"]>) | undefined;
|
|
129
129
|
readonly multiple?: boolean | undefined;
|
|
130
|
-
readonly value?:
|
|
130
|
+
readonly value?: (string | number) | LabeledValue | (string | number)[] | LabeledValue[] | undefined;
|
|
131
131
|
readonly 'onUpdate:value'?: (((val: SelectValue) => void) & ((...args: any[]) => any)) | undefined;
|
|
132
|
-
readonly searchMode?:
|
|
132
|
+
readonly searchMode?: "filter" | "request" | undefined;
|
|
133
133
|
readonly refetchOnFocus?: boolean | undefined;
|
|
134
134
|
readonly lazy?: boolean | undefined;
|
|
135
|
-
readonly addAll?:
|
|
135
|
+
readonly addAll?: boolean | number | undefined;
|
|
136
136
|
readonly params?: Recordable | undefined;
|
|
137
137
|
readonly searchDelay?: number | undefined;
|
|
138
138
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
@@ -715,7 +715,6 @@ declare const __VLS_component: DefineComponent<ApFormItemSelectProps, {
|
|
|
715
715
|
readonly direction?: "ltr" | "rtl" | undefined;
|
|
716
716
|
readonly animation?: string | undefined;
|
|
717
717
|
readonly children?: VueNode[] | undefined;
|
|
718
|
-
readonly placeholder?: any;
|
|
719
718
|
readonly prefixCls?: string | undefined;
|
|
720
719
|
readonly variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
721
720
|
readonly loading?: boolean | undefined;
|
|
@@ -726,6 +725,7 @@ declare const __VLS_component: DefineComponent<ApFormItemSelectProps, {
|
|
|
726
725
|
readonly getPopupContainer?: RenderDOMFunc | undefined;
|
|
727
726
|
readonly virtual?: boolean | undefined;
|
|
728
727
|
readonly dropdownMatchSelectWidth?: number | boolean | undefined;
|
|
728
|
+
readonly placeholder?: any;
|
|
729
729
|
readonly status?: "" | "error" | "warning" | undefined;
|
|
730
730
|
readonly defaultValue?: (string | number) | LabeledValue | (string | number)[] | LabeledValue[] | undefined;
|
|
731
731
|
readonly prefix?: any;
|
|
@@ -776,12 +776,12 @@ declare const __VLS_component: DefineComponent<ApFormItemSelectProps, {
|
|
|
776
776
|
readonly emptyText?: string | undefined;
|
|
777
777
|
readonly request?: ((value?: string, extraParams?: Recordable) => Promise< SelectProps["options"]>) | undefined;
|
|
778
778
|
readonly multiple?: boolean | undefined;
|
|
779
|
-
readonly value?:
|
|
779
|
+
readonly value?: (string | number) | LabeledValue | (string | number)[] | LabeledValue[] | undefined;
|
|
780
780
|
readonly 'onUpdate:value'?: (((val: SelectValue) => void) & ((...args: any[]) => any)) | undefined;
|
|
781
|
-
readonly searchMode?:
|
|
781
|
+
readonly searchMode?: "filter" | "request" | undefined;
|
|
782
782
|
readonly refetchOnFocus?: boolean | undefined;
|
|
783
783
|
readonly lazy?: boolean | undefined;
|
|
784
|
-
readonly addAll?:
|
|
784
|
+
readonly addAll?: boolean | number | undefined;
|
|
785
785
|
readonly params?: Recordable | undefined;
|
|
786
786
|
readonly searchDelay?: number | undefined;
|
|
787
787
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|