@aplus-frontend/ui 0.5.23 → 0.5.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/src/ap-action/group/index.vue.mjs +3 -3
- package/es/src/ap-action/item/index.vue2.mjs +5 -5
- package/es/src/ap-action/item-dropdown/index.vue.mjs +7 -7
- package/es/src/ap-action/item-modal/index.vue.mjs +2 -2
- package/es/src/ap-action/item-popconfirm/index.vue.mjs +2 -2
- package/es/src/ap-button/ap-action-button.vue.mjs +2 -2
- package/es/src/ap-button/ap-button.vue.mjs +2 -2
- package/es/src/ap-button/ap-confirm-button.vue.mjs +2 -2
- package/es/src/ap-descriptions/ap-descriptions.vue.mjs +4 -4
- package/es/src/ap-descriptions/help-message/index.vue2.mjs +4 -4
- package/es/src/ap-download/ap-download.vue.mjs +1 -1
- package/es/src/ap-field/checkbox/index.vue.mjs +1 -1
- package/es/src/ap-field/date/index.vue.mjs +4 -4
- package/es/src/ap-field/date-range/index.vue.mjs +8 -8
- package/es/src/ap-field/index.mjs +36 -36
- package/es/src/ap-field/number/index.vue.mjs +8 -8
- package/es/src/ap-field/radio/index.vue.mjs +1 -1
- package/es/src/ap-field/rate/index.vue.mjs +2 -2
- package/es/src/ap-field/segmented/index.vue.mjs +1 -1
- package/es/src/ap-field/select/index.vue.mjs +2 -2
- package/es/src/ap-field/select/use-select-options.d.ts +2 -2
- package/es/src/ap-field/slider/index.vue.mjs +4 -4
- package/es/src/ap-field/switch/index.vue.mjs +3 -3
- package/es/src/ap-field/text/index.vue2.mjs +2 -2
- package/es/src/ap-field/text/password.vue.mjs +2 -2
- package/es/src/ap-field/text-area/index.vue.mjs +3 -3
- package/es/src/ap-field/tree-select/index.vue.mjs +3 -3
- package/es/src/ap-field/tree-select/use-request.d.ts +4 -4
- package/es/src/ap-form/ap-form.vue.d.ts +4 -3
- package/es/src/ap-form/ap-form.vue2.mjs +124 -124
- package/es/src/ap-form/drawer-form/index.vue.d.ts +9 -8
- package/es/src/ap-form/drawer-form/index.vue.mjs +9 -9
- package/es/src/ap-form/interface.d.ts +3 -2
- package/es/src/ap-form/item/index.vue.mjs +7 -7
- package/es/src/ap-form/item-group/index.vue.mjs +3 -3
- package/es/src/ap-form/items/checkbox/index.vue.mjs +2 -2
- package/es/src/ap-form/items/date/index.vue.mjs +2 -2
- package/es/src/ap-form/items/date-range/index.vue.mjs +2 -2
- package/es/src/ap-form/items/number/index.vue.mjs +2 -2
- package/es/src/ap-form/items/radio/index.vue.mjs +2 -2
- package/es/src/ap-form/items/select/index.vue.d.ts +6 -6
- package/es/src/ap-form/items/select/index.vue.mjs +2 -2
- package/es/src/ap-form/items/switch/index.vue.mjs +2 -2
- package/es/src/ap-form/items/text/group.vue2.mjs +2 -2
- package/es/src/ap-form/items/text/index.vue2.mjs +2 -2
- package/es/src/ap-form/items/text/password.vue.mjs +2 -2
- package/es/src/ap-form/items/text-area/index.vue.mjs +2 -2
- package/es/src/ap-form/items/tree-select/index.vue.mjs +2 -2
- package/es/src/ap-form/modal-form/index.vue.d.ts +9 -8
- package/es/src/ap-form/modal-form/index.vue.mjs +7 -7
- package/es/src/ap-form/render/item.vue.mjs +2 -2
- package/es/src/ap-form/search-form/index.vue.d.ts +9 -8
- package/es/src/ap-form/search-form/index.vue.mjs +1 -1
- package/es/src/ap-form/set/index.vue.mjs +1 -1
- package/es/src/ap-grid/editable/form-item.vue.d.ts +4 -2
- package/es/src/ap-grid/editable/form-item.vue.mjs +65 -61
- package/es/src/ap-grid/editable/index.vue.d.ts +4 -2
- package/es/src/ap-grid/editable/index.vue.mjs +86 -81
- package/es/src/ap-grid/hooks/use-inner-params.mjs +3 -3
- package/es/src/ap-grid/index.vue.d.ts +4 -2
- package/es/src/ap-grid/index.vue.mjs +25 -25
- package/es/src/ap-grid/interface.d.ts +4 -0
- package/es/src/ap-grid/utils/table.d.ts +1 -1
- package/es/src/ap-grid/utils/table.mjs +42 -41
- package/es/src/ap-info-layout/ApInfoLayout.vue.mjs +2 -2
- package/es/src/ap-info-layout/ap-info-layout-admin/ApInfoLayoutAdmin.vue2.mjs +2 -2
- package/es/src/ap-info-layout/ap-info-layout-aplus/ap-info-layout.vue2.mjs +1 -1
- package/es/src/ap-list/index.vue.d.ts +4 -2
- package/es/src/ap-list/index.vue.mjs +4 -4
- package/es/src/ap-modal/utils/confirm.d.ts +1 -1
- package/es/src/ap-table/ap-table.vue.d.ts +4 -2
- package/es/src/ap-table/ap-table.vue2.mjs +13 -13
- package/es/src/ap-table/components/dynamic-component/index.vue2.mjs +2 -2
- package/es/src/ap-table/components/index/index.vue2.mjs +2 -2
- package/es/src/ap-table/components/paragraph-ellipsis/index.vue2.mjs +3 -3
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +3 -3
- package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +1 -1
- package/es/src/ap-table/components/setting/sortable/index.vue2.mjs +1 -1
- package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +1 -1
- package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +11 -11
- package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +1 -1
- package/es/src/ap-table/components/status/index.vue2.mjs +2 -2
- package/es/src/ap-table/constants.d.ts +5 -5
- package/es/src/ap-table/constants.mjs +45 -45
- package/es/src/ap-table/hooks/use-table-column-state.d.ts +4 -4
- package/es/src/ap-table/hooks/use-table-column-state.mjs +3 -3
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +108 -102
- package/es/src/ap-table/utils.d.ts +5 -5
- package/es/src/ap-tag/ap-tag-group.vue.mjs +8 -8
- package/es/src/ap-tag/ap-tag.vue.mjs +2 -2
- package/es/src/ap-upload/apUpload.vue.mjs +5 -5
- package/es/src/ap-upload/components/MultipleFile.vue.d.ts +1 -1
- package/es/src/ap-upload/components/MultipleFile.vue2.mjs +3 -3
- package/es/src/ap-upload/components/Picture.vue.d.ts +7 -2
- package/es/src/ap-upload/components/Picture.vue2.mjs +6 -6
- package/es/src/ap-upload/components/SingleFile.vue2.mjs +7 -7
- package/es/src/business/ap-appendix/ap-appendix.vue2.mjs +1 -1
- package/es/src/business/ap-appendix/icons/file-icon.vue.mjs +2 -2
- package/es/src/business/ap-batch-action/ApBatchAction.vue2.mjs +2 -2
- package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +10 -10
- package/es/src/business/ap-batch-action-group/MenuItemGroup.vue2.mjs +1 -1
- package/es/src/business/ap-batch-action-group/index.d.ts +3 -3
- package/es/src/business/ap-button-group/ApButtonGroup.vue2.mjs +1 -1
- package/es/src/business/ap-card/ApCard.vue2.mjs +7 -7
- package/es/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +4 -2
- package/es/src/business/ap-expand-alert/ApExpandAlert.vue2.mjs +11 -11
- package/es/src/business/ap-expand-alert/index.d.ts +6 -4
- package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +9 -9
- package/es/src/business/ap-group-search/ap-group-search.vue2.mjs +5 -5
- package/es/src/business/ap-group-search/extension-select/index.vue2.mjs +4 -4
- package/es/src/business/ap-group-search/images/icon-down.vue.mjs +2 -2
- package/es/src/business/ap-group-search/images/icon-line-select.vue.mjs +2 -2
- package/es/src/business/ap-group-search/popover-select/index.vue2.mjs +2 -2
- package/es/src/business/ap-image/ApImage.vue2.mjs +1 -1
- package/es/src/business/ap-input-radio/ApInputRadio.vue2.mjs +2 -2
- package/es/src/business/ap-ladder/ApLadder.vue.d.ts +1 -83
- package/es/src/business/ap-ladder/ApLadder.vue2.mjs +34 -59
- package/es/src/business/ap-ladder/components/SimpleMode.vue.d.ts +3 -65
- package/es/src/business/ap-ladder/components/SimpleMode.vue2.mjs +34 -99
- package/es/src/business/ap-ladder/components/ValueGroupMode.vue.d.ts +3 -75
- package/es/src/business/ap-ladder/components/ValueGroupMode.vue2.mjs +68 -195
- package/es/src/business/ap-ladder/index.d.ts +1 -235
- package/es/src/business/ap-ladder/interface.d.ts +4 -114
- package/es/src/business/ap-ladder/utils.d.ts +5 -0
- package/es/src/business/ap-ladder/utils.mjs +38 -3
- package/es/src/business/ap-product-info/ApProductInfo.d.ts +46 -0
- package/es/src/business/ap-product-info/constans.d.ts +23 -0
- package/es/src/business/ap-product-info/index.d.ts +1 -0
- package/es/src/business/ap-product-info/interface.d.ts +11 -0
- package/es/src/business/ap-select-layout/index.d.ts +4 -2
- package/es/src/business/ap-select-layout/select-layout.vue.d.ts +4 -2
- package/es/src/business/ap-select-layout/select-layout.vue2.mjs +4 -4
- package/es/src/business/ap-status/ApStatus.vue2.mjs +8 -8
- package/es/src/business/ap-status/group/ApStatusGroup.vue2.mjs +4 -4
- package/es/src/business/ap-summary/ap-summary.vue2.mjs +1 -1
- package/es/src/business/ap-table-modal/modal-title.vue2.mjs +2 -2
- package/es/src/business/ap-table-modal/table-layout/index.vue2.mjs +14 -14
- package/es/src/business/ap-table-modal/table-modal.vue2.mjs +3 -3
- package/es/src/business/ap-title/ApTitle.vue2.mjs +7 -7
- package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs +1 -1
- package/es/src/business/ap-upload-file/icon/delete-icon.vue.mjs +2 -2
- package/es/src/business/ap-upload-file/icon/file-icon.vue.mjs +2 -2
- package/es/src/business/batch-input-group/form-item.vue.mjs +2 -2
- package/es/src/business/batch-input-group/index.vue.mjs +1 -1
- package/es/src/business/batch-input-group/popover-input/index.vue2.mjs +2 -2
- package/es/src/check-card/index.vue2.mjs +3 -3
- package/es/src/config-provider/hooks/use-namespace.d.ts +1 -5
- package/es/src/editable-table/form-item.vue.d.ts +4 -2
- package/es/src/editable-table/form-item.vue.mjs +2 -2
- package/es/src/editable-table/index.vue.d.ts +4 -2
- package/es/src/editable-table/index.vue.mjs +2 -2
- package/es/src/full-screen/index.vue.mjs +3 -3
- package/es/src/hooks/useFullScreen.mjs +5 -5
- package/es/src/mask/index.vue.mjs +10 -10
- package/es/src/portal/index.vue.mjs +2 -2
- package/es/src/scroll-bar/index.vue.mjs +3 -3
- package/es/src/scroll-bar/internal.vue.mjs +2 -2
- package/es/src/scroll-view/index.vue.d.ts +5 -5
- package/es/src/scroll-view/index.vue.mjs +9 -9
- package/es/src/tests/wrapper.d.ts +4 -4
- package/es/src/text/group.vue.mjs +2 -2
- package/es/src/text/index.vue.mjs +4 -4
- package/es/src/work-order-modal/help-message.vue2.mjs +2 -2
- package/es/src/work-order-modal/work-order-modal.vue.d.ts +6 -5
- package/es/src/work-order-modal/work-order-modal.vue.mjs +2 -2
- package/lib/src/ap-action/item-dropdown/index.vue.js +1 -1
- package/lib/src/ap-field/index.js +1 -1
- package/lib/src/ap-field/select/use-select-options.d.ts +2 -2
- package/lib/src/ap-field/tree-select/use-request.d.ts +4 -4
- package/lib/src/ap-form/ap-form.vue.d.ts +4 -3
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/drawer-form/index.vue.d.ts +9 -8
- package/lib/src/ap-form/interface.d.ts +3 -2
- package/lib/src/ap-form/items/select/index.vue.d.ts +6 -6
- package/lib/src/ap-form/modal-form/index.vue.d.ts +9 -8
- package/lib/src/ap-form/search-form/index.vue.d.ts +9 -8
- package/lib/src/ap-grid/editable/form-item.vue.d.ts +4 -2
- package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ap-grid/editable/index.vue.d.ts +4 -2
- package/lib/src/ap-grid/editable/index.vue.js +1 -1
- package/lib/src/ap-grid/index.vue.d.ts +4 -2
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/interface.d.ts +4 -0
- package/lib/src/ap-grid/utils/table.d.ts +1 -1
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-list/index.vue.d.ts +4 -2
- package/lib/src/ap-modal/utils/confirm.d.ts +1 -1
- package/lib/src/ap-table/ap-table.vue.d.ts +4 -2
- package/lib/src/ap-table/constants.d.ts +5 -5
- package/lib/src/ap-table/constants.js +1 -1
- package/lib/src/ap-table/hooks/use-table-column-state.d.ts +4 -4
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/ap-table/utils.d.ts +5 -5
- package/lib/src/ap-upload/apUpload.vue.js +1 -1
- package/lib/src/ap-upload/components/MultipleFile.vue.d.ts +1 -1
- package/lib/src/ap-upload/components/Picture.vue.d.ts +7 -2
- package/lib/src/business/ap-batch-action-group/index.d.ts +3 -3
- package/lib/src/business/ap-expand-alert/ApExpandAlert.vue.d.ts +4 -2
- package/lib/src/business/ap-expand-alert/index.d.ts +6 -4
- package/lib/src/business/ap-ladder/ApLadder.vue.d.ts +1 -83
- package/lib/src/business/ap-ladder/ApLadder.vue2.js +1 -1
- package/lib/src/business/ap-ladder/components/SimpleMode.vue.d.ts +3 -65
- package/lib/src/business/ap-ladder/components/SimpleMode.vue2.js +1 -1
- package/lib/src/business/ap-ladder/components/ValueGroupMode.vue.d.ts +3 -75
- package/lib/src/business/ap-ladder/components/ValueGroupMode.vue2.js +1 -1
- package/lib/src/business/ap-ladder/index.d.ts +1 -235
- package/lib/src/business/ap-ladder/interface.d.ts +4 -114
- package/lib/src/business/ap-ladder/utils.d.ts +5 -0
- package/lib/src/business/ap-ladder/utils.js +1 -1
- package/lib/src/business/ap-product-info/ApProductInfo.d.ts +46 -0
- package/lib/src/business/ap-product-info/constans.d.ts +23 -0
- package/lib/src/business/ap-product-info/index.d.ts +1 -0
- package/lib/src/business/ap-product-info/interface.d.ts +11 -0
- package/lib/src/business/ap-select-layout/index.d.ts +4 -2
- package/lib/src/business/ap-select-layout/select-layout.vue.d.ts +4 -2
- package/lib/src/config-provider/hooks/use-namespace.d.ts +1 -5
- package/lib/src/editable-table/form-item.vue.d.ts +4 -2
- package/lib/src/editable-table/index.vue.d.ts +4 -2
- package/lib/src/scroll-view/index.vue.d.ts +5 -5
- package/lib/src/tests/wrapper.d.ts +4 -4
- package/lib/src/work-order-modal/work-order-modal.vue.d.ts +6 -5
- package/package.json +3 -3
- package/theme/ap-grid/index.css +3 -0
- package/theme/ap-grid/index.less +3 -0
- package/theme/ap-ladder/ap-ladder.css +14 -5
- package/theme/ap-ladder/ap-ladder.less +16 -7
- package/theme/index.css +17 -5
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ApForm as
|
|
3
|
-
import { isArray as
|
|
1
|
+
import { defineComponent as P, useSlots as A, toRef as H, ref as h, unref as f, watch as W, nextTick as G, openBlock as K, createBlock as U, mergeProps as g, withCtx as y, createVNode as $, createSlots as q, renderList as J, renderSlot as Q, normalizeProps as X, guardReactiveProps as Y } from "vue";
|
|
2
|
+
import { ApForm as C } from "../../ap-form/index.mjs";
|
|
3
|
+
import { isArray as Z, isUndefined as I, isNumber as m, cloneDeep as M, omit as ee } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
|
-
import { isDef as
|
|
6
|
-
import { useGetEditableColumns as
|
|
5
|
+
import { isDef as w } from "../../utils/index.mjs";
|
|
6
|
+
import { useGetEditableColumns as oe } from "../hooks/use-editable-columns.mjs";
|
|
7
7
|
import "../index.vue2.mjs";
|
|
8
|
-
import { useInjectForm as
|
|
9
|
-
import { useNamespace as
|
|
10
|
-
import { useGlobalConfig as
|
|
11
|
-
import
|
|
12
|
-
const
|
|
8
|
+
import { useInjectForm as ae } from "../../ap-form/context.mjs";
|
|
9
|
+
import { useNamespace as te } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
|
+
import { useGlobalConfig as le } from "../../config-provider/hooks/use-global-config.mjs";
|
|
11
|
+
import ne from "../index.vue.mjs";
|
|
12
|
+
const ye = /* @__PURE__ */ P({
|
|
13
13
|
name: "EditableGrid",
|
|
14
14
|
__name: "form-item",
|
|
15
15
|
props: {
|
|
@@ -154,105 +154,109 @@ const he = /* @__PURE__ */ O({
|
|
|
154
154
|
setup(x, {
|
|
155
155
|
expose: b
|
|
156
156
|
}) {
|
|
157
|
-
const R =
|
|
157
|
+
const R = A(), l = x, {
|
|
158
158
|
b: B
|
|
159
|
-
} =
|
|
159
|
+
} = te("editable-grid");
|
|
160
160
|
function S(e, o) {
|
|
161
|
-
return
|
|
161
|
+
return Z(o) ? o.reduce((n, t) => n == null ? void 0 : n[t], e) : e == null ? void 0 : e[o];
|
|
162
162
|
}
|
|
163
163
|
const {
|
|
164
164
|
internalInstance: a,
|
|
165
165
|
model: F
|
|
166
|
-
} =
|
|
166
|
+
} = ae(), p = H(l.name), d = h(S(f(F), p.value) || []), N = C.useWatch(p);
|
|
167
167
|
W(() => N.value, async (e) => {
|
|
168
168
|
var o;
|
|
169
|
-
await G(),
|
|
169
|
+
await G(), d.value = e, (o = l.onChange) == null || o.call(l, e);
|
|
170
170
|
}, {
|
|
171
171
|
deep: !0
|
|
172
172
|
});
|
|
173
|
-
const
|
|
173
|
+
const c = h(), v = le("valueTypeMap"), D = oe(l, v);
|
|
174
174
|
function L(e, o) {
|
|
175
175
|
var s;
|
|
176
|
-
const n = ((s =
|
|
177
|
-
if (
|
|
176
|
+
const n = ((s = f(d)) == null ? void 0 : s.length) || 0;
|
|
177
|
+
if (w(l.maxLength) && n >= l.maxLength)
|
|
178
178
|
return;
|
|
179
|
-
const
|
|
180
|
-
m(o) ? l.splice(o, 0, {
|
|
179
|
+
const t = {
|
|
181
180
|
...e || {}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
|
|
181
|
+
};
|
|
182
|
+
a == null || a.setFieldValue(l.name, t, !0, (u, r) => {
|
|
183
|
+
console.log("run add", u[r]), u[r] || (u[r] = [t]), I(o) ? u[r].push(t) : u[r].splice(o, 0, t);
|
|
184
|
+
});
|
|
185
185
|
}
|
|
186
186
|
function V(e, o = "suffix") {
|
|
187
|
-
var
|
|
188
|
-
const n = ((
|
|
189
|
-
if (
|
|
187
|
+
var u;
|
|
188
|
+
const n = ((u = f(d)) == null ? void 0 : u.length) || 0, t = m(e) ? e : e.length;
|
|
189
|
+
if (w(l.maxLength) && n + t > l.maxLength)
|
|
190
190
|
return;
|
|
191
|
-
const s =
|
|
192
|
-
|
|
191
|
+
const s = m(e) ? new Array(e).fill(0).map(() => ({})) : M(e);
|
|
192
|
+
a == null || a.setFieldValue(l.name, s, !0, (r, i) => {
|
|
193
|
+
r[i] || (r[i] = [...s]), o === "suffix" ? r[i].push(...s) : r[i].unshift(...s);
|
|
194
|
+
});
|
|
193
195
|
}
|
|
194
|
-
function
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
function T(e) {
|
|
197
|
+
const o = new Set(m(e) ? [e] : e);
|
|
198
|
+
a == null || a.setFieldValue(l.name, void 0, !0, (n, t) => {
|
|
199
|
+
n[t] = n[t].filter((s, u) => !o.has(u));
|
|
200
|
+
});
|
|
198
201
|
}
|
|
199
|
-
function
|
|
200
|
-
return
|
|
202
|
+
function _() {
|
|
203
|
+
return f(d);
|
|
201
204
|
}
|
|
202
|
-
function
|
|
205
|
+
function E(e) {
|
|
203
206
|
var o;
|
|
204
|
-
return (o =
|
|
207
|
+
return (o = f(d)) == null ? void 0 : o[e];
|
|
205
208
|
}
|
|
206
209
|
function k(e, o, n = !0) {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
a == null || a.setFieldValue(l.name, null, !0, (t, s) => {
|
|
211
|
+
!t[s] || !t[s][e] || (t[s][e] = {
|
|
212
|
+
...n ? t[s][e] : {},
|
|
213
|
+
...o
|
|
214
|
+
});
|
|
215
|
+
});
|
|
212
216
|
}
|
|
213
217
|
function j(e) {
|
|
214
|
-
a == null || a.setFieldValue(
|
|
218
|
+
a == null || a.setFieldValue(l.name, e);
|
|
215
219
|
}
|
|
216
220
|
function z(e) {
|
|
217
221
|
var n;
|
|
218
|
-
const o = e === "end" ?
|
|
219
|
-
(n =
|
|
222
|
+
const o = e === "end" ? d.value.length - 1 : e;
|
|
223
|
+
(n = c.value) == null || n.scrollToRow(o);
|
|
220
224
|
}
|
|
221
|
-
function
|
|
225
|
+
function O() {
|
|
222
226
|
var e;
|
|
223
|
-
(e = a == null ? void 0 : a.setFieldValue) == null || e.call(a,
|
|
227
|
+
(e = a == null ? void 0 : a.setFieldValue) == null || e.call(a, l.name, []);
|
|
224
228
|
}
|
|
225
229
|
return b({
|
|
226
230
|
add: L,
|
|
227
|
-
remove:
|
|
228
|
-
getRowData:
|
|
229
|
-
getRowsData:
|
|
231
|
+
remove: T,
|
|
232
|
+
getRowData: E,
|
|
233
|
+
getRowsData: _,
|
|
230
234
|
setRowData: k,
|
|
231
235
|
addMultiple: V,
|
|
232
236
|
scrollTo: z,
|
|
233
237
|
setTableData: j,
|
|
234
|
-
clear:
|
|
235
|
-
}), (e, o) => (
|
|
238
|
+
clear: O
|
|
239
|
+
}), (e, o) => (K(), U(f(C).FormItem, g(e.formItem, {
|
|
236
240
|
name: e.name,
|
|
237
241
|
label: e.label
|
|
238
242
|
}), {
|
|
239
|
-
default:
|
|
243
|
+
default: y(() => [$(ne, g(f(ee)(l, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue", "formItem"]), {
|
|
240
244
|
ref_key: "tableRef",
|
|
241
|
-
ref:
|
|
242
|
-
class:
|
|
243
|
-
columns:
|
|
244
|
-
"data-source":
|
|
245
|
+
ref: c,
|
|
246
|
+
class: f(B)(),
|
|
247
|
+
columns: f(D),
|
|
248
|
+
"data-source": d.value,
|
|
245
249
|
"search-form": !1
|
|
246
|
-
}),
|
|
250
|
+
}), q({
|
|
247
251
|
_: 2
|
|
248
|
-
}, [
|
|
249
|
-
name:
|
|
250
|
-
fn:
|
|
252
|
+
}, [J(R, (n, t) => ({
|
|
253
|
+
name: t,
|
|
254
|
+
fn: y((s) => [Q(e.$slots, t, X(Y(s || {})))])
|
|
251
255
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
252
256
|
_: 3
|
|
253
257
|
}, 16, ["name", "label"]));
|
|
254
258
|
}
|
|
255
259
|
});
|
|
256
260
|
export {
|
|
257
|
-
|
|
261
|
+
ye as default
|
|
258
262
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EditableGridExpose, EditableGridProps } from './interface';
|
|
2
2
|
import { Recordable } from '../../type';
|
|
3
|
-
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
|
|
3
|
+
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode, RendererNode, RendererElement } from 'vue';
|
|
4
4
|
declare const _default: <RecordType extends Recordable = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
5
5
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
6
6
|
readonly "onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -9,7 +9,9 @@ declare const _default: <RecordType extends Recordable = any>(__VLS_props: NonNu
|
|
|
9
9
|
attrs: any;
|
|
10
10
|
slots: Readonly<Record<string, any>> & Record<string, any>;
|
|
11
11
|
emit: (event: "update:value", ...args: any[]) => void;
|
|
12
|
-
}>) => VNode
|
|
12
|
+
}>) => VNode<RendererNode, RendererElement, {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}> & {
|
|
13
15
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
14
16
|
};
|
|
15
17
|
export default _default;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ApForm as
|
|
3
|
-
import { isEqual as ae, isArray as
|
|
1
|
+
import { defineComponent as U, useSlots as $, ref as w, watch as x, unref as u, openBlock as q, createBlock as J, withCtx as h, createVNode as v, mergeProps as Q, createSlots as X, renderList as Y, renderSlot as Z, normalizeProps as M, guardReactiveProps as ee } from "vue";
|
|
2
|
+
import { ApForm as g } from "../../ap-form/index.mjs";
|
|
3
|
+
import { isEqual as ae, isArray as R, isUndefined as te, isNumber as y, cloneDeep as le, omit as oe } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
|
-
import { isDef as
|
|
7
|
-
import { useGetEditableColumns as
|
|
6
|
+
import { isDef as b } from "../../utils/index.mjs";
|
|
7
|
+
import { useGetEditableColumns as ne } from "../hooks/use-editable-columns.mjs";
|
|
8
8
|
import "../index.vue2.mjs";
|
|
9
|
-
import { useNamespace as
|
|
10
|
-
import { useControllableValue as
|
|
11
|
-
import { useGlobalConfig as
|
|
12
|
-
import
|
|
13
|
-
const
|
|
9
|
+
import { useNamespace as se } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
|
+
import { useControllableValue as re } from "../../hooks/useControllableValue.mjs";
|
|
11
|
+
import { useGlobalConfig as ue } from "../../config-provider/hooks/use-global-config.mjs";
|
|
12
|
+
import ie from "../index.vue.mjs";
|
|
13
|
+
const Re = /* @__PURE__ */ U({
|
|
14
14
|
name: "EditableGrid",
|
|
15
15
|
__name: "index",
|
|
16
16
|
props: {
|
|
@@ -155,128 +155,133 @@ const we = /* @__PURE__ */ M({
|
|
|
155
155
|
expose: F,
|
|
156
156
|
emit: S
|
|
157
157
|
}) {
|
|
158
|
-
const N =
|
|
158
|
+
const N = $(), t = B, {
|
|
159
159
|
b: V
|
|
160
|
-
} =
|
|
161
|
-
value:
|
|
160
|
+
} = se("editable-grid"), _ = S, C = w(), {
|
|
161
|
+
value: m,
|
|
162
162
|
updateValue: L
|
|
163
|
-
} =
|
|
164
|
-
|
|
163
|
+
} = re(t, _), i = w(), E = ue("valueTypeMap"), c = g.useWatch(t.name, i);
|
|
164
|
+
x(() => c.value, (e) => {
|
|
165
165
|
var a;
|
|
166
166
|
L(e), (a = t.onChange) == null || a.call(t, e);
|
|
167
167
|
}, {
|
|
168
|
-
deep: !0
|
|
169
|
-
|
|
168
|
+
deep: !0,
|
|
169
|
+
flush: "post"
|
|
170
|
+
}), x(m, (e) => {
|
|
170
171
|
var a;
|
|
171
|
-
e !==
|
|
172
|
+
e !== u(c) && (ae(e, u(c)) || (a = i.value) == null || a.setFieldValue(t.name, e));
|
|
172
173
|
}, {
|
|
173
174
|
deep: !0
|
|
174
175
|
});
|
|
175
|
-
const
|
|
176
|
-
function
|
|
176
|
+
const D = ne(t, E);
|
|
177
|
+
function T() {
|
|
177
178
|
var e;
|
|
178
|
-
(e =
|
|
179
|
+
(e = i.value) == null || e.resetFields();
|
|
179
180
|
}
|
|
180
|
-
function
|
|
181
|
-
return e ? (
|
|
181
|
+
function k(e) {
|
|
182
|
+
return e ? (R(e) ? e : [e]).map((l) => R(l) ? [t.name, ...l] : [t.name, l]) : void 0;
|
|
182
183
|
}
|
|
183
|
-
async function
|
|
184
|
-
var
|
|
185
|
-
const
|
|
186
|
-
return
|
|
184
|
+
async function A(e, a) {
|
|
185
|
+
var o;
|
|
186
|
+
const l = await ((o = i.value) == null ? void 0 : o.validateFields(k(e), a));
|
|
187
|
+
return l == null ? void 0 : l[t.name];
|
|
187
188
|
}
|
|
188
189
|
function j(e, a) {
|
|
189
|
-
var
|
|
190
|
-
const
|
|
191
|
-
if (
|
|
190
|
+
var n, s, r;
|
|
191
|
+
const l = ((n = u(m)) == null ? void 0 : n.length) || 0;
|
|
192
|
+
if (b(t.maxLength) && l >= t.maxLength)
|
|
192
193
|
return;
|
|
193
|
-
const
|
|
194
|
-
g(a) ? l.splice(a, 0, {
|
|
194
|
+
const o = {
|
|
195
195
|
...e || {}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
|
|
196
|
+
};
|
|
197
|
+
(r = (s = i.value) == null ? void 0 : s.setFieldValue) == null || r.call(s, t.name, o, !0, (d, f) => {
|
|
198
|
+
console.log("run add", d[f]), d[f] || (d[f] = [o]), te(a) ? d[f].push(o) : d[f].splice(a, 0, o);
|
|
199
|
+
});
|
|
199
200
|
}
|
|
200
201
|
function z(e, a = "suffix") {
|
|
201
|
-
var
|
|
202
|
-
const
|
|
203
|
-
if (
|
|
202
|
+
var s, r, d;
|
|
203
|
+
const l = ((s = u(m)) == null ? void 0 : s.length) || 0, o = y(e) ? e : e.length;
|
|
204
|
+
if (b(t.maxLength) && l + o > t.maxLength)
|
|
204
205
|
return;
|
|
205
|
-
const
|
|
206
|
-
|
|
206
|
+
const n = y(e) ? new Array(e).fill(0).map(() => ({})) : le(e);
|
|
207
|
+
(d = (r = i.value) == null ? void 0 : r.setFieldValue) == null || d.call(r, t.name, n, !0, (f, p) => {
|
|
208
|
+
f[p] || (f[p] = [...n]), a === "suffix" ? f[p].push(...n) : f[p].unshift(...n);
|
|
209
|
+
});
|
|
207
210
|
}
|
|
208
|
-
function
|
|
209
|
-
var l,
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
211
|
+
function I(e) {
|
|
212
|
+
var l, o;
|
|
213
|
+
const a = new Set(y(e) ? [e] : e);
|
|
214
|
+
(o = (l = i.value) == null ? void 0 : l.setFieldValue) == null || o.call(l, t.name, void 0, !0, (n, s) => {
|
|
215
|
+
n[s] = n[s].filter((r, d) => !a.has(d));
|
|
216
|
+
});
|
|
213
217
|
}
|
|
214
|
-
function
|
|
215
|
-
return
|
|
218
|
+
function O() {
|
|
219
|
+
return u(m);
|
|
216
220
|
}
|
|
217
|
-
function
|
|
221
|
+
function P(e) {
|
|
218
222
|
var a;
|
|
219
|
-
(a =
|
|
223
|
+
(a = i.value) == null || a.setFieldValue(t.name, e);
|
|
220
224
|
}
|
|
221
|
-
function
|
|
225
|
+
function H(e) {
|
|
222
226
|
var a;
|
|
223
|
-
return (a =
|
|
227
|
+
return (a = u(m)) == null ? void 0 : a[e];
|
|
224
228
|
}
|
|
225
|
-
function W(e, a,
|
|
226
|
-
var
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
229
|
+
function W(e, a, l = !0) {
|
|
230
|
+
var o, n;
|
|
231
|
+
(n = (o = i.value) == null ? void 0 : o.setFieldValue) == null || n.call(o, t.name, null, !0, (s, r) => {
|
|
232
|
+
!s[r] || !s[r][e] || (s[r][e] = {
|
|
233
|
+
...l ? s[r][e] : {},
|
|
234
|
+
...a
|
|
235
|
+
});
|
|
236
|
+
});
|
|
232
237
|
}
|
|
233
238
|
function G(e) {
|
|
234
|
-
var
|
|
235
|
-
const a = e === "end" ?
|
|
236
|
-
(
|
|
239
|
+
var l;
|
|
240
|
+
const a = e === "end" ? m.value.length - 1 : e;
|
|
241
|
+
(l = C.value) == null || l.scrollToRow(a);
|
|
237
242
|
}
|
|
238
243
|
function K() {
|
|
239
244
|
var e, a;
|
|
240
|
-
(a = (e =
|
|
245
|
+
(a = (e = i.value) == null ? void 0 : e.setFieldValue) == null || a.call(e, t.name, []);
|
|
241
246
|
}
|
|
242
247
|
return F({
|
|
243
|
-
resetFields:
|
|
244
|
-
validateFields:
|
|
248
|
+
resetFields: T,
|
|
249
|
+
validateFields: A,
|
|
245
250
|
add: j,
|
|
246
|
-
remove:
|
|
247
|
-
getRowData:
|
|
248
|
-
getRowsData:
|
|
251
|
+
remove: I,
|
|
252
|
+
getRowData: H,
|
|
253
|
+
getRowsData: O,
|
|
249
254
|
setRowData: W,
|
|
250
255
|
addMultiple: z,
|
|
251
256
|
scrollTo: G,
|
|
252
257
|
clear: K,
|
|
253
|
-
setTableData:
|
|
254
|
-
}), (e, a) => (q(),
|
|
258
|
+
setTableData: P
|
|
259
|
+
}), (e, a) => (q(), J(u(g), {
|
|
255
260
|
ref_key: "formRef",
|
|
256
|
-
ref:
|
|
261
|
+
ref: i,
|
|
257
262
|
"initial-values": {
|
|
258
|
-
[t.name]:
|
|
263
|
+
[t.name]: u(m)
|
|
259
264
|
},
|
|
260
265
|
style: {
|
|
261
266
|
height: "100%"
|
|
262
267
|
}
|
|
263
268
|
}, {
|
|
264
|
-
default:
|
|
269
|
+
default: h(() => [v(u(g).FormItem, {
|
|
265
270
|
name: e.name,
|
|
266
271
|
"no-style": ""
|
|
267
272
|
}, {
|
|
268
|
-
default:
|
|
273
|
+
default: h(() => [v(ie, Q(u(oe)(t, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue"]), {
|
|
269
274
|
ref_key: "tableRef",
|
|
270
275
|
ref: C,
|
|
271
|
-
class:
|
|
272
|
-
columns:
|
|
273
|
-
"data-source":
|
|
276
|
+
class: u(V)(),
|
|
277
|
+
columns: u(D),
|
|
278
|
+
"data-source": u(m),
|
|
274
279
|
"search-form": !1
|
|
275
|
-
}),
|
|
280
|
+
}), X({
|
|
276
281
|
_: 2
|
|
277
|
-
}, [
|
|
278
|
-
name:
|
|
279
|
-
fn:
|
|
282
|
+
}, [Y(N, (l, o) => ({
|
|
283
|
+
name: o,
|
|
284
|
+
fn: h((n) => [Z(e.$slots, o, M(ee(n || {})))])
|
|
280
285
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
281
286
|
_: 3
|
|
282
287
|
}, 8, ["name"])]),
|
|
@@ -285,5 +290,5 @@ const we = /* @__PURE__ */ M({
|
|
|
285
290
|
}
|
|
286
291
|
});
|
|
287
292
|
export {
|
|
288
|
-
|
|
293
|
+
Re as default
|
|
289
294
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DEFAULT_CURRENT as g, DEFAULT_PAGE_SIZE as E } from "../../ap-table/hooks/use-table-paging-ng.mjs";
|
|
2
2
|
const a = {
|
|
3
3
|
asc: "ascend",
|
|
4
4
|
desc: "descend"
|
|
@@ -6,8 +6,8 @@ const a = {
|
|
|
6
6
|
const t = {};
|
|
7
7
|
let c = {};
|
|
8
8
|
const s = {
|
|
9
|
-
current:
|
|
10
|
-
pageSize:
|
|
9
|
+
current: g,
|
|
10
|
+
pageSize: E
|
|
11
11
|
};
|
|
12
12
|
function i(n) {
|
|
13
13
|
o == null || o(s, c, t, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VxeTableSlots } from 'vxe-table';
|
|
2
2
|
import { ApGridColumnType, ApGridExpose, ApGridProps } from './interface';
|
|
3
|
-
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
|
|
3
|
+
import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode, RendererNode, RendererElement } from 'vue';
|
|
4
4
|
declare const _default: <RecordType>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
5
5
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & ApGridProps<RecordType> & Partial<{}>> & PublicProps;
|
|
6
6
|
expose(exposed: ShallowUnwrapRef<ApGridExpose>): void;
|
|
@@ -35,7 +35,9 @@ declare const _default: <RecordType>(__VLS_props: NonNullable<Awaited<typeof __V
|
|
|
35
35
|
}) => any;
|
|
36
36
|
};
|
|
37
37
|
emit: {};
|
|
38
|
-
}>) => VNode
|
|
38
|
+
}>) => VNode<RendererNode, RendererElement, {
|
|
39
|
+
[key: string]: any;
|
|
40
|
+
}> & {
|
|
39
41
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
40
42
|
};
|
|
41
43
|
export default _default;
|