@aplus-frontend/ui 7.12.6 → 7.13.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/src/ag-grid/components/loading/index.vue.d.ts +3 -0
- package/es/src/ag-grid/components/loading/index.vue.mjs +4 -0
- package/es/src/ag-grid/components/loading/index.vue2.mjs +18 -0
- package/es/src/ag-grid/context.mjs +1 -1
- package/es/src/ag-grid/editable/form-item.vue.mjs +33 -31
- package/es/src/ag-grid/editable/index.vue.mjs +1 -0
- package/es/src/ag-grid/hooks/use-pinned-row.mjs +2 -2
- package/es/src/ag-grid/index.vue.mjs +209 -202
- package/es/src/ag-grid/interface.d.ts +4 -0
- package/es/src/ag-grid/style/index.mjs +8 -5
- package/es/src/ap-drawer/interface.d.ts +13 -2
- package/es/src/ap-drawer/utils/createDrawer.mjs +37 -32
- package/es/src/ap-field/select/index.vue.d.ts +1 -2
- package/es/src/ap-field/select/index.vue.mjs +126 -88
- package/es/src/ap-field/style/index.mjs +8 -6
- package/es/src/ap-field/style/select.d.ts +2 -0
- package/es/src/ap-field/style/select.mjs +43 -0
- package/es/src/ap-form/context.mjs +1 -1
- package/es/src/ap-form/item-group/helper.mjs +2 -2
- package/es/src/ap-form/items/select/index.vue.d.ts +4 -8
- package/es/src/ap-form/provider/context.mjs +1 -1
- package/es/src/ap-grid/utils/table.mjs +2 -2
- package/es/src/ap-pro-card/components/card/index.vue2.mjs +2 -2
- package/es/src/ap-table/ap-table.vue2.mjs +15 -16
- package/es/src/ap-table/components/setting/context.d.ts +17 -0
- package/es/src/ap-table/components/setting/context.mjs +18 -0
- package/es/src/ap-table/components/setting/modal/index.vue.d.ts +1 -1
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +220 -88
- package/es/src/ap-table/components/setting/sorter/context.mjs +1 -1
- package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +49 -51
- package/es/src/ap-table/components/setting/template/edit-form.vue.d.ts +844 -0
- package/es/src/ap-table/components/setting/template/edit-form.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/template/edit-form.vue2.mjs +74 -0
- package/es/src/ap-table/components/setting/template/index.vue.d.ts +11 -0
- package/es/src/ap-table/components/setting/template/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/template/index.vue2.mjs +51 -0
- package/es/src/ap-table/components/setting/template/item.vue.d.ts +13 -0
- package/es/src/ap-table/components/setting/template/item.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/template/item.vue2.mjs +78 -0
- package/es/src/ap-table/components/setting/tree-select/index.vue.d.ts +1 -1
- package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +26 -29
- package/es/src/ap-table/components/setting/utils.d.ts +1 -0
- package/es/src/ap-table/components/setting/utils.mjs +22 -15
- package/es/src/ap-table/constants.d.ts +2 -4
- package/es/src/ap-table/context.mjs +1 -1
- package/es/src/ap-table/hooks/use-table-column-state.d.ts +4 -23
- package/es/src/ap-table/hooks/use-table-column-state.mjs +32 -120
- package/es/src/ap-table/hooks/use-table-template-storage.d.ts +49 -0
- package/es/src/ap-table/hooks/use-table-template-storage.mjs +150 -0
- package/es/src/ap-table/interface.d.ts +26 -3
- package/es/src/ap-table/style/index.d.ts +1 -0
- package/es/src/ap-table/style/index.mjs +2 -1
- package/es/src/ap-table/style/setting.d.ts +2 -0
- package/es/src/ap-table/style/setting.mjs +114 -19
- package/es/src/ap-table/utils.mjs +1 -1
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +1 -1
- package/es/src/business/ag-grid-modal/style/index.mjs +7 -7
- package/es/src/business/ap-attachment/ApAttachment.mjs +96 -89
- package/es/src/business/ap-attachment/style/index.mjs +33 -16
- package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +24 -22
- package/es/src/business/ap-batch-action-group/MenuItemGroup.vue.d.ts +1 -1
- package/es/src/business/ap-batch-action-group/MenuItemGroup.vue2.mjs +35 -31
- package/es/src/business/ap-batch-action-group/index.d.ts +3 -3
- package/es/src/business/ap-batch-action-group/interface.d.ts +1 -1
- package/es/src/business/ap-download/hooks/index.mjs +1 -1
- package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue2.mjs +1 -3
- package/es/src/business/ap-keep-alive/hook.mjs +1 -1
- package/es/src/business/ap-keep-alive/utils.mjs +1 -1
- package/es/src/business/ap-upload/components/MultipleFile.vue2.mjs +19 -19
- package/es/src/business/ap-upload/components/Picture.vue2.mjs +34 -34
- package/es/src/business/ap-value-select-card/style/index.mjs +3 -2
- package/es/src/business/ap-view/components/menu-list-content.vue2.mjs +21 -21
- package/es/src/business/ap-view/hooks/use-view-provide.mjs +1 -1
- package/es/src/business/ap-view/style/index.mjs +2 -2
- package/es/src/check-card/context.mjs +1 -1
- package/es/src/config-provider/constants.mjs +1 -1
- package/es/src/config-provider/hooks/use-locale.mjs +1 -1
- package/es/src/config-provider/hooks/use-namespace.mjs +1 -1
- package/es/src/config-provider/hooks/use-token.mjs +1 -1
- package/es/src/design-token/index.mjs +5 -5
- package/es/src/editable-table/utils.mjs +1 -1
- package/es/src/locale/lang/en.mjs +15 -4
- package/es/src/locale/lang/zh-cn.mjs +18 -7
- package/es/src/text/context.mjs +1 -1
- package/es/src/time-ago/useTimeAgo.mjs +26 -27
- package/es/src/utils/data-range-persets.d.ts +13 -1
- package/es/src/utils/data-range-persets.mjs +80 -60
- package/es/src/utils/index.d.ts +1 -0
- package/es/src/utils/index.mjs +56 -48
- package/es/src/utils/retry.d.ts +12 -0
- package/es/src/utils/retry.mjs +27 -0
- package/es/src/utils/slot.mjs +1 -1
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/components/loading/index.vue.d.ts +3 -0
- package/lib/src/ag-grid/components/loading/index.vue.js +1 -0
- package/lib/src/ag-grid/components/loading/index.vue2.js +1 -0
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ag-grid/editable/index.vue.js +1 -1
- package/lib/src/ag-grid/hooks/use-pinned-row.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +4 -0
- package/lib/src/ag-grid/style/index.js +1 -1
- package/lib/src/ap-drawer/interface.d.ts +13 -2
- package/lib/src/ap-drawer/utils/createDrawer.js +1 -1
- package/lib/src/ap-field/select/index.vue.d.ts +1 -2
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-field/style/index.js +1 -1
- package/lib/src/ap-field/style/select.d.ts +2 -0
- package/lib/src/ap-field/style/select.js +1 -0
- package/lib/src/ap-form/items/select/index.vue.d.ts +4 -8
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/context.d.ts +17 -0
- package/lib/src/ap-table/components/setting/context.js +1 -0
- package/lib/src/ap-table/components/setting/modal/index.vue.d.ts +1 -1
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/sorter/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/template/edit-form.vue.d.ts +844 -0
- package/lib/src/ap-table/components/setting/template/edit-form.vue.js +1 -0
- package/lib/src/ap-table/components/setting/template/edit-form.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/template/index.vue.d.ts +11 -0
- package/lib/src/ap-table/components/setting/template/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/template/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/template/item.vue.d.ts +13 -0
- package/lib/src/ap-table/components/setting/template/item.vue.js +1 -0
- package/lib/src/ap-table/components/setting/template/item.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/tree-select/index.vue.d.ts +1 -1
- package/lib/src/ap-table/components/setting/tree-select/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/utils.d.ts +1 -0
- package/lib/src/ap-table/components/setting/utils.js +1 -1
- package/lib/src/ap-table/constants.d.ts +2 -4
- package/lib/src/ap-table/hooks/use-table-column-state.d.ts +4 -23
- package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
- package/lib/src/ap-table/hooks/use-table-template-storage.d.ts +49 -0
- package/lib/src/ap-table/hooks/use-table-template-storage.js +1 -0
- package/lib/src/ap-table/interface.d.ts +26 -3
- package/lib/src/ap-table/style/index.d.ts +1 -0
- package/lib/src/ap-table/style/index.js +1 -1
- package/lib/src/ap-table/style/setting.d.ts +2 -0
- package/lib/src/ap-table/style/setting.js +1 -1
- package/lib/src/business/ag-grid-modal/style/index.js +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
- package/lib/src/business/ap-attachment/style/index.js +1 -1
- package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.js +1 -1
- package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue.d.ts +1 -1
- package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue2.js +1 -1
- package/lib/src/business/ap-batch-action-group/index.d.ts +3 -3
- package/lib/src/business/ap-batch-action-group/interface.d.ts +1 -1
- package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue2.js +1 -1
- package/lib/src/business/ap-upload/components/MultipleFile.vue2.js +1 -1
- package/lib/src/business/ap-upload/components/Picture.vue2.js +1 -1
- package/lib/src/business/ap-value-select-card/style/index.js +1 -1
- package/lib/src/business/ap-view/components/menu-list-content.vue2.js +1 -1
- package/lib/src/business/ap-view/style/index.js +1 -1
- package/lib/src/design-token/index.js +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/time-ago/useTimeAgo.js +1 -1
- package/lib/src/utils/data-range-persets.d.ts +13 -1
- package/lib/src/utils/data-range-persets.js +1 -1
- package/lib/src/utils/index.d.ts +1 -0
- package/lib/src/utils/index.js +1 -1
- package/lib/src/utils/retry.d.ts +12 -0
- package/lib/src/utils/retry.js +1 -0
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +2 -2
|
@@ -14,20 +14,24 @@ const a = {
|
|
|
14
14
|
redo: "刷新",
|
|
15
15
|
back: "返回",
|
|
16
16
|
more: "更多",
|
|
17
|
-
all: "全部"
|
|
17
|
+
all: "全部",
|
|
18
|
+
save: "保存"
|
|
18
19
|
},
|
|
19
20
|
field: {
|
|
20
21
|
startDateText: "开始日期",
|
|
21
22
|
endDateText: "结束日期",
|
|
22
|
-
today: "
|
|
23
|
-
yesterday: "
|
|
23
|
+
today: "今日",
|
|
24
|
+
yesterday: "昨日",
|
|
24
25
|
thisWeek: "本周",
|
|
25
26
|
lastWeek: "上周",
|
|
26
27
|
thisMonth: "本月",
|
|
27
28
|
lastMonth: "上月",
|
|
29
|
+
thisQuarter: "本季度",
|
|
30
|
+
lastQuarter: "上季度",
|
|
28
31
|
thisYear: "今年",
|
|
29
32
|
lastYear: "去年",
|
|
30
|
-
lastXDays: "近{day}天"
|
|
33
|
+
lastXDays: "近{day}天",
|
|
34
|
+
chooseOnly: "仅选此项"
|
|
31
35
|
},
|
|
32
36
|
modal: {
|
|
33
37
|
restore: "还原",
|
|
@@ -64,11 +68,17 @@ const a = {
|
|
|
64
68
|
sizeSmall: "紧凑",
|
|
65
69
|
sizeNormal: "正常",
|
|
66
70
|
selectCount: "已选字段({count})",
|
|
67
|
-
reset: "
|
|
71
|
+
reset: "恢复默认",
|
|
68
72
|
fixToLeft: "固定在左侧",
|
|
69
73
|
fixToRight: "固定在右侧",
|
|
70
74
|
unFixed: "不固定",
|
|
71
|
-
delete: "删除"
|
|
75
|
+
delete: "删除",
|
|
76
|
+
saveAsTemplate: "保存为新模板",
|
|
77
|
+
saveAndApply: "保存并应用",
|
|
78
|
+
modifyNotification: "当前模板存在变更,可保存为新模板",
|
|
79
|
+
templateSetting: "列配置模板",
|
|
80
|
+
templateName: "新模板名称",
|
|
81
|
+
templateNamePlaceholder: "请输入模板名称"
|
|
72
82
|
},
|
|
73
83
|
paragraphEllipsis: {
|
|
74
84
|
copy: "复制",
|
|
@@ -139,7 +149,8 @@ const a = {
|
|
|
139
149
|
},
|
|
140
150
|
apAttachment: {
|
|
141
151
|
downloadall: "下载全部",
|
|
142
|
-
more: "更多"
|
|
152
|
+
more: "更多",
|
|
153
|
+
all: "全部"
|
|
143
154
|
},
|
|
144
155
|
apSizeInput: {
|
|
145
156
|
length: "长",
|
package/es/src/text/context.mjs
CHANGED
|
@@ -1,57 +1,56 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ref as
|
|
1
|
+
import m from "dayjs";
|
|
2
|
+
import { ref as v, watch as M, onBeforeUnmount as h } from "vue";
|
|
3
3
|
function s(n, u) {
|
|
4
4
|
const t = Math.abs(n - u), e = {
|
|
5
5
|
diffMs: t,
|
|
6
6
|
type: n < u ? "ago" : "late"
|
|
7
7
|
};
|
|
8
|
-
return t < 60 * 1e3 ? (e.unit = "s", e.count = Math.round(t / 1e3)) : t <
|
|
8
|
+
return t < 60 * 1e3 ? (e.unit = "s", e.count = Math.round(t / 1e3)) : t < 3600 * 1e3 ? (e.unit = "m", e.count = Math.round(t / (60 * 1e3))) : t < 1440 * 60 * 1e3 ? (e.unit = "h", e.count = Math.round(t / (3600 * 1e3))) : t < 720 * 60 * 60 * 1e3 ? (e.unit = "d", e.count = Math.round(t / (1440 * 60 * 1e3))) : t < 365 * 24 * 60 * 60 * 1e3 ? (e.unit = "M", e.count = Math.round(t / (720 * 60 * 60 * 1e3))) : (e.unit = "y", e.count = Math.round(t / 365 / (1440 * 60 * 1e3))), e;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
return
|
|
10
|
+
function i(n) {
|
|
11
|
+
return m(n).valueOf();
|
|
12
12
|
}
|
|
13
|
-
let
|
|
14
|
-
function
|
|
15
|
-
return
|
|
13
|
+
let p = 1;
|
|
14
|
+
function g() {
|
|
15
|
+
return p++;
|
|
16
16
|
}
|
|
17
|
-
const
|
|
17
|
+
const o = /* @__PURE__ */ new Map();
|
|
18
18
|
let r, l;
|
|
19
19
|
function w(n, u) {
|
|
20
|
-
|
|
20
|
+
o.set(n, u), o.size && !l && (clearInterval(r), r = setInterval(() => {
|
|
21
21
|
l = !0;
|
|
22
22
|
const t = Date.now();
|
|
23
|
-
|
|
23
|
+
o.forEach((e) => {
|
|
24
24
|
e.interval && Math.abs(t - e.updated - e.interval) < 50 && (e.timeAgo.value = s(e.ts, t), e.updated = t);
|
|
25
25
|
});
|
|
26
26
|
}, 5e3));
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
|
|
28
|
+
function b(n) {
|
|
29
|
+
o.delete(n), o.size || (clearInterval(r), l = !1);
|
|
30
30
|
}
|
|
31
|
-
const
|
|
32
|
-
const e =
|
|
33
|
-
s(
|
|
31
|
+
const y = (n, u, t) => {
|
|
32
|
+
const e = g(), a = v(
|
|
33
|
+
s(i(n.value), i(u))
|
|
34
34
|
), f = {
|
|
35
|
-
ts:
|
|
35
|
+
ts: i(n.value),
|
|
36
36
|
timeAgo: a,
|
|
37
37
|
interval: t.value,
|
|
38
38
|
updated: Date.now()
|
|
39
39
|
};
|
|
40
|
-
return
|
|
40
|
+
return M(
|
|
41
41
|
() => n.value,
|
|
42
|
-
(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
f.ts = d, a.value = s(d, o(u));
|
|
42
|
+
(d) => {
|
|
43
|
+
const c = i(d);
|
|
44
|
+
f.ts = c, a.value = s(c, i(u));
|
|
46
45
|
}
|
|
47
|
-
), w(e, f),
|
|
48
|
-
|
|
46
|
+
), w(e, f), h(() => {
|
|
47
|
+
b(e);
|
|
49
48
|
}), a;
|
|
50
49
|
};
|
|
51
50
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
y as default,
|
|
52
|
+
g as getId,
|
|
54
53
|
s as getTimeAgo,
|
|
55
54
|
w as subscribe,
|
|
56
|
-
|
|
55
|
+
b as unsubscribe
|
|
57
56
|
};
|
|
@@ -45,7 +45,19 @@ export declare const presetsGetThisMonth: (timezone?: Timezone, currentDate?: nu
|
|
|
45
45
|
*/
|
|
46
46
|
export declare const presetsGetLastMonth: (timezone?: Timezone, currentDate?: number) => dayjs.Dayjs[];
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* 根据时区获取本季度
|
|
49
|
+
* @param {Timezone} [timezone] - 时区
|
|
50
|
+
* @param {number} [currentDate] - 当前时间
|
|
51
|
+
*/
|
|
52
|
+
export declare const presetsGetThisQuarter: (timezone?: Timezone, currentDate?: number) => dayjs.Dayjs[];
|
|
53
|
+
/**
|
|
54
|
+
* 根据时区获取上季度
|
|
55
|
+
* @param {Timezone} [timezone] - 时区
|
|
56
|
+
* @param {number} [currentDate] - 当前时间
|
|
57
|
+
*/
|
|
58
|
+
export declare const presetsGetLastQuarter: (timezone?: Timezone, currentDate?: number) => dayjs.Dayjs[];
|
|
59
|
+
/**
|
|
60
|
+
* 根据时区获取本年
|
|
49
61
|
* @param {Timezone} [timezone] - 时区
|
|
50
62
|
* @param {number} [currentDate] - 当前时间
|
|
51
63
|
*/
|
|
@@ -1,100 +1,120 @@
|
|
|
1
|
-
import { getTimeFormatToZone as
|
|
2
|
-
import
|
|
3
|
-
const s = (
|
|
4
|
-
const
|
|
5
|
-
return [
|
|
6
|
-
},
|
|
7
|
-
const
|
|
1
|
+
import { getTimeFormatToZone as m, userTimezone as u } from "@aplus-frontend/utils";
|
|
2
|
+
import l from "dayjs";
|
|
3
|
+
const s = (a, e = l().valueOf()) => l(m(e, a ?? u)), M = (a, e) => {
|
|
4
|
+
const t = s(a, e);
|
|
5
|
+
return [t.startOf("day"), t.endOf("day")];
|
|
6
|
+
}, w = (a, e) => {
|
|
7
|
+
const t = s(a, e);
|
|
8
8
|
return [
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
t.startOf("day").subtract(1, "day").startOf("day"),
|
|
10
|
+
t.endOf("day").subtract(1, "day").endOf("day")
|
|
11
11
|
];
|
|
12
|
-
}, O = (
|
|
13
|
-
const
|
|
12
|
+
}, O = (a, e) => {
|
|
13
|
+
const t = s(a, e);
|
|
14
14
|
return [
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
t.startOf("week").startOf("day"),
|
|
16
|
+
t.endOf("week").endOf("day")
|
|
17
17
|
];
|
|
18
|
-
},
|
|
19
|
-
const
|
|
18
|
+
}, c = (a, e) => {
|
|
19
|
+
const t = s(a, e);
|
|
20
20
|
return [
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
t.subtract(1, "week").startOf("week").startOf("day"),
|
|
22
|
+
t.subtract(1, "week").endOf("week").endOf("day")
|
|
23
23
|
];
|
|
24
|
-
},
|
|
25
|
-
const
|
|
24
|
+
}, h = (a, e) => {
|
|
25
|
+
const t = s(a, e);
|
|
26
26
|
return [
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
t.startOf("month").startOf("day"),
|
|
28
|
+
t.endOf("month").endOf("day")
|
|
29
29
|
];
|
|
30
|
-
},
|
|
31
|
-
const
|
|
30
|
+
}, i = (a, e) => {
|
|
31
|
+
const t = s(a, e);
|
|
32
32
|
return [
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
t.subtract(1, "month").startOf("month").startOf("day"),
|
|
34
|
+
t.subtract(1, "month").endOf("month").endOf("day")
|
|
35
35
|
];
|
|
36
|
-
},
|
|
37
|
-
const
|
|
36
|
+
}, p = (a, e) => {
|
|
37
|
+
const t = s(a, e), r = t.month(), o = Math.floor(r / 3), n = t.month(o * 3).date(1).startOf("day"), d = n.add(2, "month").endOf("month").endOf("day");
|
|
38
|
+
return [n, d];
|
|
39
|
+
}, T = (a, e) => {
|
|
40
|
+
const r = s(a, e).subtract(3, "month"), o = r.month(), n = Math.floor(o / 3), d = r.clone().month(n * 3).date(1).startOf("day"), y = d.clone().add(2, "month").endOf("month").endOf("day");
|
|
41
|
+
return [d, y];
|
|
42
|
+
}, b = (a, e) => {
|
|
43
|
+
const t = s(a, e);
|
|
38
44
|
return [
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
t.startOf("year").startOf("day"),
|
|
46
|
+
t.endOf("year").endOf("day")
|
|
41
47
|
];
|
|
42
|
-
},
|
|
43
|
-
const
|
|
48
|
+
}, v = (a, e) => {
|
|
49
|
+
const t = s(a, e);
|
|
44
50
|
return [
|
|
45
|
-
|
|
46
|
-
|
|
51
|
+
t.subtract(1, "year").startOf("year").startOf("day"),
|
|
52
|
+
t.subtract(1, "year").endOf("year").endOf("day")
|
|
47
53
|
];
|
|
48
|
-
}, f = (
|
|
49
|
-
const r = s(
|
|
54
|
+
}, f = (a, e, t) => {
|
|
55
|
+
const r = s(e, t);
|
|
50
56
|
return [
|
|
51
|
-
r.subtract(
|
|
57
|
+
r.subtract(a - 1, "day").startOf("day"),
|
|
52
58
|
r.endOf("day")
|
|
53
59
|
];
|
|
54
|
-
},
|
|
60
|
+
}, Q = (a, e, t) => [
|
|
55
61
|
{
|
|
56
|
-
label:
|
|
57
|
-
value:
|
|
62
|
+
label: t ? t("ap.field.thisWeek") : "本周",
|
|
63
|
+
value: O(a, e)
|
|
58
64
|
},
|
|
59
65
|
{
|
|
60
|
-
label:
|
|
61
|
-
value:
|
|
66
|
+
label: t ? t("ap.field.lastWeek") : "上周",
|
|
67
|
+
value: c(a, e)
|
|
62
68
|
},
|
|
63
69
|
{
|
|
64
|
-
label:
|
|
65
|
-
value:
|
|
70
|
+
label: t ? t("ap.field.lastXDays", { day: 7 }) : "近7天",
|
|
71
|
+
value: f(7, a, e)
|
|
66
72
|
},
|
|
67
73
|
{
|
|
68
|
-
label:
|
|
69
|
-
value:
|
|
74
|
+
label: t ? t("ap.field.lastXDays", { day: 30 }) : "近30天",
|
|
75
|
+
value: f(30, a, e)
|
|
70
76
|
},
|
|
71
77
|
{
|
|
72
|
-
label:
|
|
73
|
-
value:
|
|
78
|
+
label: t ? t("ap.field.lastXDays", { day: 90 }) : "近90天",
|
|
79
|
+
value: f(90, a, e)
|
|
74
80
|
},
|
|
75
81
|
{
|
|
76
|
-
label:
|
|
77
|
-
value:
|
|
82
|
+
label: t ? t("ap.field.thisMonth") : "本月",
|
|
83
|
+
value: h(a, e)
|
|
78
84
|
},
|
|
79
85
|
{
|
|
80
|
-
label:
|
|
81
|
-
value:
|
|
86
|
+
label: t ? t("ap.field.lastMonth") : "上月",
|
|
87
|
+
value: i(a, e)
|
|
82
88
|
},
|
|
83
89
|
{
|
|
84
|
-
label:
|
|
85
|
-
value:
|
|
90
|
+
label: t ? t("ap.field.thisQuarter") : "本季度",
|
|
91
|
+
value: p(a, e)
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
label: t ? t("ap.field.lastQuarter") : "上季度",
|
|
95
|
+
value: T(a, e)
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
label: t ? t("ap.field.thisYear") : "本年",
|
|
99
|
+
value: b(a, e)
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
label: t ? t("ap.field.lastYear") : "去年",
|
|
103
|
+
value: v(a, e)
|
|
86
104
|
}
|
|
87
105
|
];
|
|
88
106
|
export {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
107
|
+
Q as presetsDefault,
|
|
108
|
+
i as presetsGetLastMonth,
|
|
109
|
+
T as presetsGetLastQuarter,
|
|
110
|
+
c as presetsGetLastWeek,
|
|
92
111
|
f as presetsGetLastXDays,
|
|
93
|
-
|
|
94
|
-
|
|
112
|
+
v as presetsGetLastYear,
|
|
113
|
+
h as presetsGetThisMonth,
|
|
114
|
+
p as presetsGetThisQuarter,
|
|
95
115
|
O as presetsGetThisWeek,
|
|
96
116
|
b as presetsGetThisYear,
|
|
97
117
|
s as presetsGetTimezoneFormat,
|
|
98
|
-
|
|
99
|
-
|
|
118
|
+
M as presetsGetToday,
|
|
119
|
+
w as presetsGetYesterday
|
|
100
120
|
};
|
package/es/src/utils/index.d.ts
CHANGED
|
@@ -42,3 +42,4 @@ export declare function runFunction<T extends any[]>(func: any, ...restParams: T
|
|
|
42
42
|
export declare function getRouteType(): "history" | "hash";
|
|
43
43
|
export declare function getScrollbarSize(): number;
|
|
44
44
|
export declare function getTopWindow(): Window;
|
|
45
|
+
export declare function randomStr(size?: number, dict?: string): string;
|
package/es/src/utils/index.mjs
CHANGED
|
@@ -1,72 +1,80 @@
|
|
|
1
1
|
import { isClient as s } from "@vueuse/core";
|
|
2
|
-
import { isUndefined as
|
|
3
|
-
import { unref as
|
|
4
|
-
import { isDef as
|
|
5
|
-
function w(
|
|
6
|
-
return
|
|
2
|
+
import { isUndefined as l } from "lodash-unified";
|
|
3
|
+
import { unref as f, markRaw as d } from "vue";
|
|
4
|
+
import { isDef as H } from "./is.mjs";
|
|
5
|
+
function w(t) {
|
|
6
|
+
return t?.parentNode ?? document.body;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
const
|
|
10
|
-
return Object.keys(
|
|
11
|
-
|
|
12
|
-
}),
|
|
8
|
+
function h(t) {
|
|
9
|
+
const e = {};
|
|
10
|
+
return Object.keys(t).map((n) => {
|
|
11
|
+
e[n] = f(t[n]);
|
|
12
|
+
}), e;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
const o = Object.assign({},
|
|
16
|
-
for (let
|
|
17
|
-
const
|
|
18
|
-
(
|
|
14
|
+
function g(t, e = [], n) {
|
|
15
|
+
const o = Object.assign({}, t), r = Object.keys(o);
|
|
16
|
+
for (let c = 0; c < r.length; c += 1) {
|
|
17
|
+
const i = r[c];
|
|
18
|
+
(e.includes(i) || n?.(i, o[i])) && delete o[i];
|
|
19
19
|
}
|
|
20
20
|
return o;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
return /^[A-Z][A-Za-z]*$/.test(
|
|
22
|
+
function b(t) {
|
|
23
|
+
return /^[A-Z][A-Za-z]*$/.test(t);
|
|
24
24
|
}
|
|
25
|
-
function u(
|
|
26
|
-
if (Array.isArray(
|
|
27
|
-
return
|
|
28
|
-
if (typeof
|
|
29
|
-
const
|
|
30
|
-
for (const n in
|
|
31
|
-
|
|
32
|
-
return
|
|
25
|
+
function u(t) {
|
|
26
|
+
if (Array.isArray(t))
|
|
27
|
+
return t.map((e) => u(e));
|
|
28
|
+
if (typeof t == "object" && t !== null) {
|
|
29
|
+
const e = {};
|
|
30
|
+
for (const n in t)
|
|
31
|
+
e[n] = u(t[n]);
|
|
32
|
+
return d(e);
|
|
33
33
|
}
|
|
34
|
-
return e;
|
|
35
|
-
}
|
|
36
|
-
function v(e) {
|
|
37
|
-
const t = { ...e };
|
|
38
|
-
for (const n of Object.keys(t))
|
|
39
|
-
f(t[n]) && delete t[n];
|
|
40
34
|
return t;
|
|
41
35
|
}
|
|
42
|
-
function
|
|
43
|
-
|
|
36
|
+
function v(t) {
|
|
37
|
+
const e = { ...t };
|
|
38
|
+
for (const n of Object.keys(e))
|
|
39
|
+
l(e[n]) && delete e[n];
|
|
40
|
+
return e;
|
|
44
41
|
}
|
|
45
|
-
function
|
|
46
|
-
|
|
47
|
-
return typeof window > "u" ? e : window.location.href.includes("#/") ? "hash" : e;
|
|
42
|
+
function x(t, ...e) {
|
|
43
|
+
return typeof t == "function" ? t(...e) : t;
|
|
48
44
|
}
|
|
49
45
|
function k() {
|
|
46
|
+
const t = "history";
|
|
47
|
+
return typeof window > "u" ? t : window.location.href.includes("#/") ? "hash" : t;
|
|
48
|
+
}
|
|
49
|
+
function C() {
|
|
50
50
|
if (!s)
|
|
51
51
|
return 15;
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
return document.body.removeChild(
|
|
52
|
+
const t = document.createElement("div");
|
|
53
|
+
t.style.width = "100px", t.style.height = "100px", t.style.overflow = "scroll", t.style.position = "absolute", t.style.top = "-9999px", document.body.appendChild(t);
|
|
54
|
+
const e = t.offsetHeight - t.clientHeight;
|
|
55
|
+
return document.body.removeChild(t), e;
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function R() {
|
|
58
58
|
return (window.top !== window ? window.top : window) ?? window;
|
|
59
59
|
}
|
|
60
|
+
const a = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
61
|
+
function A(t = 16, e = a) {
|
|
62
|
+
let n = "", o = t;
|
|
63
|
+
const r = e.length;
|
|
64
|
+
for (; o--; ) n += e[Math.random() * r | 0];
|
|
65
|
+
return n;
|
|
66
|
+
}
|
|
60
67
|
export {
|
|
61
68
|
u as convertReactiveToRaw,
|
|
62
|
-
|
|
69
|
+
h as getDynamicProps,
|
|
63
70
|
w as getPopupContainer,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
k as getRouteType,
|
|
72
|
+
C as getScrollbarSize,
|
|
73
|
+
R as getTopWindow,
|
|
74
|
+
H as isDef,
|
|
75
|
+
b as isPascalCase,
|
|
69
76
|
v as omitUndefined,
|
|
70
|
-
|
|
77
|
+
g as omitWhen,
|
|
78
|
+
A as randomStr,
|
|
71
79
|
x as runFunction
|
|
72
80
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface RetryOptions<T> {
|
|
2
|
+
/** 判断是否就绪,默认 !!value */
|
|
3
|
+
check?: (value: T) => boolean;
|
|
4
|
+
/** 重试间隔(ms),默认 100 */
|
|
5
|
+
interval?: number;
|
|
6
|
+
/** 最大重试次数,默认 Infinity */
|
|
7
|
+
maxRetry?: number;
|
|
8
|
+
/** 失败回调 */
|
|
9
|
+
onTimeout?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function retryUntil<T>(getter: () => T, onReady: (value: T) => void, options?: RetryOptions<T>): () => void;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
function T(r, o, i = {}) {
|
|
2
|
+
const {
|
|
3
|
+
check: u = (e) => !!e,
|
|
4
|
+
interval: c = 100,
|
|
5
|
+
maxRetry: l = 1 / 0,
|
|
6
|
+
onTimeout: a
|
|
7
|
+
} = i;
|
|
8
|
+
let m = 0, t = null;
|
|
9
|
+
const n = () => {
|
|
10
|
+
const e = r();
|
|
11
|
+
if (u(e)) {
|
|
12
|
+
o(e), t && clearTimeout(t);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (++m >= l) {
|
|
16
|
+
t && clearTimeout(t), a?.();
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
t = window.setTimeout(n, c);
|
|
20
|
+
};
|
|
21
|
+
return n(), () => {
|
|
22
|
+
t && clearTimeout(t);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
T as retryUntil
|
|
27
|
+
};
|
package/es/src/utils/slot.mjs
CHANGED
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.
|
|
1
|
+
declare const _default: "7.13.1";
|
|
2
2
|
export default _default;
|
package/es/src/version.mjs
CHANGED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index.vue2.js");exports.default=e.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("@aplus-frontend/antdv");require("../../../config-provider/index.js");const t=require("../../../config-provider/hooks/use-namespace.js"),a=e.defineComponent({__name:"index",setup(s){const{e:r}=t.useNamespace("ag-grid");return(o,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(r)("table-loading-wrapper"))},[e.createVNode(e.unref(n.Spin),{delay:300})],2))}});exports.default=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),r=require("lodash-unified"),h=require("../../ap-form/index.js"),k=require("../../ap-form/context.js"),A=require("../../ap-form/hooks/use-watch.js"),H=require("../../ap-form/utils/get.js"),K=require("../../ap-form/utils/transform.js");require("../../config-provider/index.js");const P=require("../hooks/use-editable-columns.js"),z=require("../hooks/use-editable-form-item-api.js");require("../index.vue2.js");const G=require("../style/editable.js"),L=require("../utils.js"),m=require("./utils.js"),W=require("../../config-provider/hooks/use-namespace.js"),U=require("../../config-provider/hooks/use-global-config.js"),$=require("../index.vue.js"),J=o.defineComponent({name:"EditableGrid",__name:"form-item",props:{dropdownPrefixCls:{},bordered:{type:Boolean},locale:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{},showSorterTooltip:{type:[Boolean,Object]},prefixCls:{},rowKey:{type:[String,Function],default:"key"},tableLayout:{},title:{},id:{},showHeader:{type:Boolean},components:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean]},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean},indentSize:{},expandIconColumnIndex:{},showExpandColumn:{type:Boolean},expandedRowClassName:{},childrenColumnName:{},rowExpandable:{},transformCellText:{},rowHoverable:{type:Boolean},rowSelection:{type:[Boolean,Object]},onLoadingChange:{},onShownColumnsChange:{},pagination:{type:[Boolean,Object],default:!1},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},tableStyle:{},adaptive:{type:Boolean},columnResizable:{type:Boolean,default:!1},loading:{type:Boolean,default:void 0},summary:{},rowHeight:{default:66},getRowHeight:{},advanceRenderer:{type:Boolean},browserTooltips:{type:Boolean},virtual:{type:[Boolean,Object],default:void 0},onRowClicked:{},onScrollEnd:{},rowClassName:{},rowClassRules:{},autoHeight:{type:Boolean},onUpdate:{},customRow:{},theme:{},emptyComponent:{},columns:{},defaultValue:{},onChange:{},maxLength:{},onFieldChange:{},label:{},name:{},formItem:{}},setup(w,{expose:y}){const b=o.useSlots(),t=w,{b:C}=W.useNamespace("editable-aggrid"),R=G.default("editable-aggrid"),s=o.ref(),{internalInstance:u}=k.useInjectForm();function v(e){const n=m.getColumnTransformOptions(t.columns||[]);if(!Object.keys(n).length||!e?.length)return e;let a=[];for(const d of e)a.push(K.transformValues(d,n));return a}const i=L.getShadowName(t.name);let p=[];o.onMounted(()=>{const e=t.formItem?.initialValue??H.getModelValue(u?.getInitialValues()??{},t.name);e&&(u?.updateInitialModel(i,m.arrayToObject(r.cloneDeep(e),t.rowKey)),p=r.cloneDeep(e),l.value||S(r.cloneDeep(e),"suffix",!0))});const l=o.ref([]),x=A.useWatch(t.name);o.watch(()=>x.value,e=>{r.isEqual(e,l.value)||f(e??r.cloneDeep(p))},{deep:!0,flush:"post",immediate:!0});const B=U.useGlobalConfig("valueTypeMap"),q=P.useGetEditableColumns(t,B,i),{add:_,addMultiple:I,__addMultiple:S,remove:T,removeByKey:E,getRowData:F,getRowsData:N,setRowData:V,clear:j,refreshRowIds:c}=z.useEditableFormItemApi(t,u,l,i);function D(){const e=s.value?._internalGridApi;if(!c.value?.length||!e)return;const n=c.value.map(a=>e.getRowNode(a)).filter(a=>!!a);e.refreshCells({rowNodes:n,force:!0}),c.value=[]}function f(e){l.value=[...e];const n=m.arrayToObject(e,t.rowKey);u?.setFieldValue(t.name,[...e]),u?.setFieldValue(i,n)}function g(e,n){const a=e==="end"?l.value.length-1:e;s.value?.scrollToRow(a,n)}function O(e,n){s.value?.scrollToColumn(e,n)}return y({add:_,addMultiple:I,remove:T,removeByKey:E,getRowData:F,getRowsData:N,setRowData:V,clear:j,setTableData:f,scrollTo:g,scrollToRow:g,scrollToColumn:O,table:s}),(e,n)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(o.unref(h.ApForm).FormItem,{hidden:"",name:e.name,"initial-value":e.formItem?.initialValue,transform:v},null,8,["name","initial-value"]),o.createVNode(o.unref(h.ApForm).FormItem,{label:e.label},{default:o.withCtx(()=>[o.createVNode($.default,o.mergeProps(o.unref(r.omit)(t,["name","maxLength","onChange","defaultValue","formItem"]),{ref_key:"tableRef",ref:s,class:[o.unref(C)(),o.unref(R)],size:"mini",columns:o.unref(q),"data-source":l.value,"search-form":!1,onUpdate:D}),o.createSlots({_:2},[o.renderList(b,(a,d)=>({name:d,fn:o.withCtx(M=>[o.renderSlot(e.$slots,d,o.normalizeProps(o.guardReactiveProps(M||{})))])}))]),1040,["class","columns","data-source"])]),_:3},8,["label"])],64))}});exports.default=J;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),i=require("lodash-unified"),m=require("../../ap-form/index.js");require("../../config-provider/index.js");require("../../hooks/index.js");const G=require("../hooks/use-editable-api.js"),L=require("../hooks/use-editable-columns.js");require("../index.vue2.js");const M=require("../style/editable.js"),d=require("./utils.js"),U=require("../../config-provider/hooks/use-namespace.js"),W=require("../../hooks/useControllableValue.js"),$=require("../../config-provider/hooks/use-global-config.js"),J=require("../index.vue.js"),Q=a.defineComponent({name:"EditableGrid",__name:"index",props:{dropdownPrefixCls:{},bordered:{type:Boolean},locale:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{},showSorterTooltip:{type:[Boolean,Object]},prefixCls:{},rowKey:{type:[String,Function],default:"key"},tableLayout:{},title:{},id:{},showHeader:{type:Boolean},components:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean]},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean},indentSize:{},expandIconColumnIndex:{},showExpandColumn:{type:Boolean},expandedRowClassName:{},childrenColumnName:{},rowExpandable:{},transformCellText:{},rowHoverable:{type:Boolean},rowSelection:{type:[Boolean,Object]},onLoadingChange:{},onShownColumnsChange:{},pagination:{type:[Boolean,Object],default:!1},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},tableStyle:{},adaptive:{type:Boolean},columnResizable:{type:Boolean,default:!1},loading:{type:Boolean,default:void 0},summary:{},rowHeight:{default:66},getRowHeight:{},advanceRenderer:{type:Boolean},browserTooltips:{type:Boolean},virtual:{type:[Boolean,Object],default:void 0},onRowClicked:{},onScrollEnd:{},rowClassName:{},rowClassRules:{},autoHeight:{type:Boolean},onUpdate:{},customRow:{},theme:{},columns:{},value:{},defaultValue:{},"onUpdate:value":{},onChange:{},maxLength:{},name:{default:"ap-editable-table-inner-name"},onFieldChange:{}},emits:["update:value"],setup(v,{expose:h,emit:C}){const R=a.useSlots(),t=v,{b:x}=U.useNamespace("editable-aggrid"),B=M.default("editable-aggrid"),_=C,u=a.ref(),{value:s,updateValue:y}=W.useControllableValue(t,_),l=a.ref(),T=m.ApForm.useWatch(t.name,l);a.watch(s,e=>{const o=d.arrayToObject(e,t.rowKey);i.isEqual(o,a.unref(T))||l.value?.setFieldValue(t.name,o)},{deep:!0});const S=$.useGlobalConfig("valueTypeMap"),F=L.useGetEditableColumns(t,S),{add:q,addMultiple:A,remove:E,removeByKey:j,getRowData:N,getRowsData:K,setRowData:V,clear:k,refreshRowIds:c}=G.useEditableApi(t,l,s,y);function O(){const e=u.value?._internalGridApi;if(!c.value?.length||!e)return;const o=c.value.map(n=>e.getRowNode(n)).filter(n=>!!n);e.refreshCells({rowNodes:o,force:!0}),c.value=[]}function I(){l.value?.resetFields()}function w(e){return e?(i.isArray(e)?e:[e]).map(n=>i.isArray(n)?[t.name,...n]:[t.name,n]):void 0}function b(e){try{const o=Object.keys(e),n=s.value.map(r=>d.getRowKey(r,void 0,t.rowKey));return o.sort((r,p)=>n.findIndex(f=>String(f)===r)-n.findIndex(f=>String(f)===p)),o.map(r=>e[r])}catch{return e}}async function D(e,o){const r=(await l.value?.validateFields(w(e),o))?.[t.name];return b(r)}async function H(e,o){const r=(await l.value?.validateFieldsReturnTransformed(w(e),o))?.[t.name];return b(r)}function P(e){y(e);const o=d.arrayToObject(e,t.rowKey);l.value?.setFieldValue(t.name,o)}function g(e,o){const n=e==="end"?s.value.length-1:e;u.value?.scrollToRow(n,o)}function z(e,o){u.value?.scrollToColumn(e,o)}return h({resetFields:I,validateFields:D,validateFieldsReturnTransformed:H,add:q,addMultiple:A,remove:E,removeByKey:j,getRowData:N,getRowsData:K,setRowData:V,clear:k,setTableData:P,scrollTo:g,scrollToRow:g,scrollToColumn:z,table:u}),(e,o)=>(a.openBlock(),a.createBlock(a.unref(m.ApForm),{ref_key:"formRef",ref:l,"initial-values":{[t.name]:a.unref(d.arrayToObject)(a.unref(s),t.rowKey)},style:{height:"100%"}},{default:a.withCtx(()=>[a.createVNode(a.unref(m.ApForm).FormItem,{name:e.name,"no-style":""},{default:a.withCtx(()=>[a.createVNode(J.default,a.mergeProps(a.unref(i.omit)(t,["name","value","onUpdate:value","maxLength","onChange","defaultValue"]),{ref_key:"tableRef",ref:u,class:[a.unref(x)(),a.unref(B)],size:"mini",columns:a.unref(F),"data-source":a.unref(s),"search-form":!1,onUpdate:O}),a.createSlots({_:2},[a.renderList(R,(n,r)=>({name:r,fn:a.withCtx(p=>[a.renderSlot(e.$slots,r,a.normalizeProps(a.guardReactiveProps(p||{})))])}))]),1040,["class","columns","data-source"])]),_:3},8,["name"])]),_:3},8,["initial-values"]))}});exports.default=Q;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),i=require("lodash-unified"),m=require("../../ap-form/index.js");require("../../config-provider/index.js");require("../../hooks/index.js");const G=require("../hooks/use-editable-api.js"),L=require("../hooks/use-editable-columns.js");require("../index.vue2.js");const M=require("../style/editable.js"),d=require("./utils.js"),U=require("../../config-provider/hooks/use-namespace.js"),W=require("../../hooks/useControllableValue.js"),$=require("../../config-provider/hooks/use-global-config.js"),J=require("../index.vue.js"),Q=a.defineComponent({name:"EditableGrid",__name:"index",props:{dropdownPrefixCls:{},bordered:{type:Boolean},locale:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{},showSorterTooltip:{type:[Boolean,Object]},prefixCls:{},rowKey:{type:[String,Function],default:"key"},tableLayout:{},title:{},id:{},showHeader:{type:Boolean},components:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean]},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean},indentSize:{},expandIconColumnIndex:{},showExpandColumn:{type:Boolean},expandedRowClassName:{},childrenColumnName:{},rowExpandable:{},transformCellText:{},rowHoverable:{type:Boolean},rowSelection:{type:[Boolean,Object]},onLoadingChange:{},onShownColumnsChange:{},pagination:{type:[Boolean,Object],default:!1},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},tableStyle:{},adaptive:{type:Boolean},columnResizable:{type:Boolean,default:!1},loading:{type:Boolean,default:void 0},summary:{},rowHeight:{default:66},getRowHeight:{},advanceRenderer:{type:Boolean},browserTooltips:{type:Boolean},virtual:{type:[Boolean,Object],default:void 0},onRowClicked:{},onScrollEnd:{},rowClassName:{},rowClassRules:{},autoHeight:{type:Boolean},onUpdate:{},customRow:{},theme:{},emptyComponent:{},columns:{},value:{},defaultValue:{},"onUpdate:value":{},onChange:{},maxLength:{},name:{default:"ap-editable-table-inner-name"},onFieldChange:{}},emits:["update:value"],setup(v,{expose:h,emit:C}){const R=a.useSlots(),t=v,{b:x}=U.useNamespace("editable-aggrid"),B=M.default("editable-aggrid"),_=C,u=a.ref(),{value:s,updateValue:y}=W.useControllableValue(t,_),l=a.ref(),T=m.ApForm.useWatch(t.name,l);a.watch(s,e=>{const o=d.arrayToObject(e,t.rowKey);i.isEqual(o,a.unref(T))||l.value?.setFieldValue(t.name,o)},{deep:!0});const S=$.useGlobalConfig("valueTypeMap"),F=L.useGetEditableColumns(t,S),{add:q,addMultiple:A,remove:E,removeByKey:j,getRowData:N,getRowsData:K,setRowData:V,clear:k,refreshRowIds:c}=G.useEditableApi(t,l,s,y);function O(){const e=u.value?._internalGridApi;if(!c.value?.length||!e)return;const o=c.value.map(n=>e.getRowNode(n)).filter(n=>!!n);e.refreshCells({rowNodes:o,force:!0}),c.value=[]}function I(){l.value?.resetFields()}function w(e){return e?(i.isArray(e)?e:[e]).map(n=>i.isArray(n)?[t.name,...n]:[t.name,n]):void 0}function b(e){try{const o=Object.keys(e),n=s.value.map(r=>d.getRowKey(r,void 0,t.rowKey));return o.sort((r,p)=>n.findIndex(f=>String(f)===r)-n.findIndex(f=>String(f)===p)),o.map(r=>e[r])}catch{return e}}async function D(e,o){const r=(await l.value?.validateFields(w(e),o))?.[t.name];return b(r)}async function H(e,o){const r=(await l.value?.validateFieldsReturnTransformed(w(e),o))?.[t.name];return b(r)}function P(e){y(e);const o=d.arrayToObject(e,t.rowKey);l.value?.setFieldValue(t.name,o)}function g(e,o){const n=e==="end"?s.value.length-1:e;u.value?.scrollToRow(n,o)}function z(e,o){u.value?.scrollToColumn(e,o)}return h({resetFields:I,validateFields:D,validateFieldsReturnTransformed:H,add:q,addMultiple:A,remove:E,removeByKey:j,getRowData:N,getRowsData:K,setRowData:V,clear:k,setTableData:P,scrollTo:g,scrollToRow:g,scrollToColumn:z,table:u}),(e,o)=>(a.openBlock(),a.createBlock(a.unref(m.ApForm),{ref_key:"formRef",ref:l,"initial-values":{[t.name]:a.unref(d.arrayToObject)(a.unref(s),t.rowKey)},style:{height:"100%"}},{default:a.withCtx(()=>[a.createVNode(a.unref(m.ApForm).FormItem,{name:e.name,"no-style":""},{default:a.withCtx(()=>[a.createVNode(J.default,a.mergeProps(a.unref(i.omit)(t,["name","value","onUpdate:value","maxLength","onChange","defaultValue"]),{ref_key:"tableRef",ref:u,class:[a.unref(x)(),a.unref(B)],size:"mini",columns:a.unref(F),"data-source":a.unref(s),"search-form":!1,onUpdate:O}),a.createSlots({_:2},[a.renderList(R,(n,r)=>({name:r,fn:a.withCtx(p=>[a.renderSlot(e.$slots,r,a.normalizeProps(a.guardReactiveProps(p||{})))])}))]),1040,["class","columns","data-source"])]),_:3},8,["name"])]),_:3},8,["initial-values"]))}});exports.default=Q;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("lodash-unified"),c=require("vue"),w=i=>{const u=c.computed(()=>{const o=i.value;if(!o)return{};const{rowClassName:e,top:t,bottom:n}=o;return{pinnedTopRowData:t,pinnedBottomRowData:n,getRowClass({node:r,data:d,rowIndex:s}){if(!(!r.rowPinned||!e))return l.isFunction(e)?e(d,s,r.rowPinned):e}}});return{getRowPinnedCellClass:o=>e=>{let t;const{cellClassName:n}=i.value||{};return!e.node.rowPinned||!n?t=[o(e)]:t=[o(e),l.isFunction(n)?n(e.data,e.colDef,e.node.rowPinned,e.rowIndex):n],t.flat().filter(Boolean)},rowPinnedGridConfig:u}};exports.usePinnedRow=w;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("lodash-unified"),c=require("vue"),w=i=>{const u=c.computed(()=>{const o=i.value;if(!o)return{};const{rowClassName:e,top:t,bottom:n}=o;return{pinnedTopRowData:t,pinnedBottomRowData:n,getRowClass({node:r,data:d,rowIndex:s}){if(!(!r.rowPinned||!e))return l.isFunction(e)?e(d,s,r.rowPinned):e}}});return{getRowPinnedCellClass:o=>(e=>{let t;const{cellClassName:n}=i.value||{};return!e.node.rowPinned||!n?t=[o(e)]:t=[o(e),l.isFunction(n)?n(e.data,e.colDef,e.node.rowPinned,e.rowIndex):n],t.flat().filter(Boolean)}),rowPinnedGridConfig:u}};exports.usePinnedRow=w;
|