@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.
Files changed (168) hide show
  1. package/es/src/ag-grid/components/loading/index.vue.d.ts +3 -0
  2. package/es/src/ag-grid/components/loading/index.vue.mjs +4 -0
  3. package/es/src/ag-grid/components/loading/index.vue2.mjs +18 -0
  4. package/es/src/ag-grid/context.mjs +1 -1
  5. package/es/src/ag-grid/editable/form-item.vue.mjs +33 -31
  6. package/es/src/ag-grid/editable/index.vue.mjs +1 -0
  7. package/es/src/ag-grid/hooks/use-pinned-row.mjs +2 -2
  8. package/es/src/ag-grid/index.vue.mjs +209 -202
  9. package/es/src/ag-grid/interface.d.ts +4 -0
  10. package/es/src/ag-grid/style/index.mjs +8 -5
  11. package/es/src/ap-drawer/interface.d.ts +13 -2
  12. package/es/src/ap-drawer/utils/createDrawer.mjs +37 -32
  13. package/es/src/ap-field/select/index.vue.d.ts +1 -2
  14. package/es/src/ap-field/select/index.vue.mjs +126 -88
  15. package/es/src/ap-field/style/index.mjs +8 -6
  16. package/es/src/ap-field/style/select.d.ts +2 -0
  17. package/es/src/ap-field/style/select.mjs +43 -0
  18. package/es/src/ap-form/context.mjs +1 -1
  19. package/es/src/ap-form/item-group/helper.mjs +2 -2
  20. package/es/src/ap-form/items/select/index.vue.d.ts +4 -8
  21. package/es/src/ap-form/provider/context.mjs +1 -1
  22. package/es/src/ap-grid/utils/table.mjs +2 -2
  23. package/es/src/ap-pro-card/components/card/index.vue2.mjs +2 -2
  24. package/es/src/ap-table/ap-table.vue2.mjs +15 -16
  25. package/es/src/ap-table/components/setting/context.d.ts +17 -0
  26. package/es/src/ap-table/components/setting/context.mjs +18 -0
  27. package/es/src/ap-table/components/setting/modal/index.vue.d.ts +1 -1
  28. package/es/src/ap-table/components/setting/modal/index.vue2.mjs +220 -88
  29. package/es/src/ap-table/components/setting/sorter/context.mjs +1 -1
  30. package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +49 -51
  31. package/es/src/ap-table/components/setting/template/edit-form.vue.d.ts +844 -0
  32. package/es/src/ap-table/components/setting/template/edit-form.vue.mjs +4 -0
  33. package/es/src/ap-table/components/setting/template/edit-form.vue2.mjs +74 -0
  34. package/es/src/ap-table/components/setting/template/index.vue.d.ts +11 -0
  35. package/es/src/ap-table/components/setting/template/index.vue.mjs +4 -0
  36. package/es/src/ap-table/components/setting/template/index.vue2.mjs +51 -0
  37. package/es/src/ap-table/components/setting/template/item.vue.d.ts +13 -0
  38. package/es/src/ap-table/components/setting/template/item.vue.mjs +4 -0
  39. package/es/src/ap-table/components/setting/template/item.vue2.mjs +78 -0
  40. package/es/src/ap-table/components/setting/tree-select/index.vue.d.ts +1 -1
  41. package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +26 -29
  42. package/es/src/ap-table/components/setting/utils.d.ts +1 -0
  43. package/es/src/ap-table/components/setting/utils.mjs +22 -15
  44. package/es/src/ap-table/constants.d.ts +2 -4
  45. package/es/src/ap-table/context.mjs +1 -1
  46. package/es/src/ap-table/hooks/use-table-column-state.d.ts +4 -23
  47. package/es/src/ap-table/hooks/use-table-column-state.mjs +32 -120
  48. package/es/src/ap-table/hooks/use-table-template-storage.d.ts +49 -0
  49. package/es/src/ap-table/hooks/use-table-template-storage.mjs +150 -0
  50. package/es/src/ap-table/interface.d.ts +26 -3
  51. package/es/src/ap-table/style/index.d.ts +1 -0
  52. package/es/src/ap-table/style/index.mjs +2 -1
  53. package/es/src/ap-table/style/setting.d.ts +2 -0
  54. package/es/src/ap-table/style/setting.mjs +114 -19
  55. package/es/src/ap-table/utils.mjs +1 -1
  56. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +1 -1
  57. package/es/src/business/ag-grid-modal/style/index.mjs +7 -7
  58. package/es/src/business/ap-attachment/ApAttachment.mjs +96 -89
  59. package/es/src/business/ap-attachment/style/index.mjs +33 -16
  60. package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +24 -22
  61. package/es/src/business/ap-batch-action-group/MenuItemGroup.vue.d.ts +1 -1
  62. package/es/src/business/ap-batch-action-group/MenuItemGroup.vue2.mjs +35 -31
  63. package/es/src/business/ap-batch-action-group/index.d.ts +3 -3
  64. package/es/src/business/ap-batch-action-group/interface.d.ts +1 -1
  65. package/es/src/business/ap-download/hooks/index.mjs +1 -1
  66. package/es/src/business/ap-draggable-grid/ApDraggableGrid.vue2.mjs +1 -3
  67. package/es/src/business/ap-keep-alive/hook.mjs +1 -1
  68. package/es/src/business/ap-keep-alive/utils.mjs +1 -1
  69. package/es/src/business/ap-upload/components/MultipleFile.vue2.mjs +19 -19
  70. package/es/src/business/ap-upload/components/Picture.vue2.mjs +34 -34
  71. package/es/src/business/ap-value-select-card/style/index.mjs +3 -2
  72. package/es/src/business/ap-view/components/menu-list-content.vue2.mjs +21 -21
  73. package/es/src/business/ap-view/hooks/use-view-provide.mjs +1 -1
  74. package/es/src/business/ap-view/style/index.mjs +2 -2
  75. package/es/src/check-card/context.mjs +1 -1
  76. package/es/src/config-provider/constants.mjs +1 -1
  77. package/es/src/config-provider/hooks/use-locale.mjs +1 -1
  78. package/es/src/config-provider/hooks/use-namespace.mjs +1 -1
  79. package/es/src/config-provider/hooks/use-token.mjs +1 -1
  80. package/es/src/design-token/index.mjs +5 -5
  81. package/es/src/editable-table/utils.mjs +1 -1
  82. package/es/src/locale/lang/en.mjs +15 -4
  83. package/es/src/locale/lang/zh-cn.mjs +18 -7
  84. package/es/src/text/context.mjs +1 -1
  85. package/es/src/time-ago/useTimeAgo.mjs +26 -27
  86. package/es/src/utils/data-range-persets.d.ts +13 -1
  87. package/es/src/utils/data-range-persets.mjs +80 -60
  88. package/es/src/utils/index.d.ts +1 -0
  89. package/es/src/utils/index.mjs +56 -48
  90. package/es/src/utils/retry.d.ts +12 -0
  91. package/es/src/utils/retry.mjs +27 -0
  92. package/es/src/utils/slot.mjs +1 -1
  93. package/es/src/version.d.ts +1 -1
  94. package/es/src/version.mjs +1 -1
  95. package/lib/src/ag-grid/components/loading/index.vue.d.ts +3 -0
  96. package/lib/src/ag-grid/components/loading/index.vue.js +1 -0
  97. package/lib/src/ag-grid/components/loading/index.vue2.js +1 -0
  98. package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
  99. package/lib/src/ag-grid/editable/index.vue.js +1 -1
  100. package/lib/src/ag-grid/hooks/use-pinned-row.js +1 -1
  101. package/lib/src/ag-grid/index.vue.js +1 -1
  102. package/lib/src/ag-grid/interface.d.ts +4 -0
  103. package/lib/src/ag-grid/style/index.js +1 -1
  104. package/lib/src/ap-drawer/interface.d.ts +13 -2
  105. package/lib/src/ap-drawer/utils/createDrawer.js +1 -1
  106. package/lib/src/ap-field/select/index.vue.d.ts +1 -2
  107. package/lib/src/ap-field/select/index.vue.js +1 -1
  108. package/lib/src/ap-field/style/index.js +1 -1
  109. package/lib/src/ap-field/style/select.d.ts +2 -0
  110. package/lib/src/ap-field/style/select.js +1 -0
  111. package/lib/src/ap-form/items/select/index.vue.d.ts +4 -8
  112. package/lib/src/ap-grid/utils/table.js +1 -1
  113. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  114. package/lib/src/ap-table/components/setting/context.d.ts +17 -0
  115. package/lib/src/ap-table/components/setting/context.js +1 -0
  116. package/lib/src/ap-table/components/setting/modal/index.vue.d.ts +1 -1
  117. package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
  118. package/lib/src/ap-table/components/setting/sorter/index.vue2.js +1 -1
  119. package/lib/src/ap-table/components/setting/template/edit-form.vue.d.ts +844 -0
  120. package/lib/src/ap-table/components/setting/template/edit-form.vue.js +1 -0
  121. package/lib/src/ap-table/components/setting/template/edit-form.vue2.js +1 -0
  122. package/lib/src/ap-table/components/setting/template/index.vue.d.ts +11 -0
  123. package/lib/src/ap-table/components/setting/template/index.vue.js +1 -0
  124. package/lib/src/ap-table/components/setting/template/index.vue2.js +1 -0
  125. package/lib/src/ap-table/components/setting/template/item.vue.d.ts +13 -0
  126. package/lib/src/ap-table/components/setting/template/item.vue.js +1 -0
  127. package/lib/src/ap-table/components/setting/template/item.vue2.js +1 -0
  128. package/lib/src/ap-table/components/setting/tree-select/index.vue.d.ts +1 -1
  129. package/lib/src/ap-table/components/setting/tree-select/index.vue2.js +1 -1
  130. package/lib/src/ap-table/components/setting/utils.d.ts +1 -0
  131. package/lib/src/ap-table/components/setting/utils.js +1 -1
  132. package/lib/src/ap-table/constants.d.ts +2 -4
  133. package/lib/src/ap-table/hooks/use-table-column-state.d.ts +4 -23
  134. package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
  135. package/lib/src/ap-table/hooks/use-table-template-storage.d.ts +49 -0
  136. package/lib/src/ap-table/hooks/use-table-template-storage.js +1 -0
  137. package/lib/src/ap-table/interface.d.ts +26 -3
  138. package/lib/src/ap-table/style/index.d.ts +1 -0
  139. package/lib/src/ap-table/style/index.js +1 -1
  140. package/lib/src/ap-table/style/setting.d.ts +2 -0
  141. package/lib/src/ap-table/style/setting.js +1 -1
  142. package/lib/src/business/ag-grid-modal/style/index.js +1 -1
  143. package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
  144. package/lib/src/business/ap-attachment/style/index.js +1 -1
  145. package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.js +1 -1
  146. package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue.d.ts +1 -1
  147. package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue2.js +1 -1
  148. package/lib/src/business/ap-batch-action-group/index.d.ts +3 -3
  149. package/lib/src/business/ap-batch-action-group/interface.d.ts +1 -1
  150. package/lib/src/business/ap-draggable-grid/ApDraggableGrid.vue2.js +1 -1
  151. package/lib/src/business/ap-upload/components/MultipleFile.vue2.js +1 -1
  152. package/lib/src/business/ap-upload/components/Picture.vue2.js +1 -1
  153. package/lib/src/business/ap-value-select-card/style/index.js +1 -1
  154. package/lib/src/business/ap-view/components/menu-list-content.vue2.js +1 -1
  155. package/lib/src/business/ap-view/style/index.js +1 -1
  156. package/lib/src/design-token/index.js +1 -1
  157. package/lib/src/locale/lang/en.js +1 -1
  158. package/lib/src/locale/lang/zh-cn.js +1 -1
  159. package/lib/src/time-ago/useTimeAgo.js +1 -1
  160. package/lib/src/utils/data-range-persets.d.ts +13 -1
  161. package/lib/src/utils/data-range-persets.js +1 -1
  162. package/lib/src/utils/index.d.ts +1 -0
  163. package/lib/src/utils/index.js +1 -1
  164. package/lib/src/utils/retry.d.ts +12 -0
  165. package/lib/src/utils/retry.js +1 -0
  166. package/lib/src/version.d.ts +1 -1
  167. package/lib/src/version.js +1 -1
  168. 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: "长",
@@ -1,5 +1,5 @@
1
1
  import { provide as t, inject as r } from "vue";
2
- const o = Symbol("apTextGroupContextKey");
2
+ const o = /* @__PURE__ */ Symbol("apTextGroupContextKey");
3
3
  function p(e) {
4
4
  t(o, e);
5
5
  }
@@ -1,57 +1,56 @@
1
- import v from "dayjs";
2
- import { ref as M, watch as h, onBeforeUnmount as p } from "vue";
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 < 60 * 60 * 1e3 ? (e.unit = "m", e.count = Math.round(t / (60 * 1e3))) : t < 24 * 60 * 60 * 1e3 ? (e.unit = "h", e.count = Math.round(t / (60 * 60 * 1e3))) : t < 30 * 24 * 60 * 60 * 1e3 ? (e.unit = "d", e.count = Math.round(t / (24 * 60 * 60 * 1e3))) : t < 365 * 24 * 60 * 60 * 1e3 ? (e.unit = "M", e.count = Math.round(t / (30 * 24 * 60 * 60 * 1e3))) : (e.unit = "y", e.count = Math.round(t / 365 / (24 * 60 * 60 * 1e3))), e;
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 o(n) {
11
- return v(n).valueOf();
10
+ function i(n) {
11
+ return m(n).valueOf();
12
12
  }
13
- let g = 1;
14
- function b() {
15
- return g++;
13
+ let p = 1;
14
+ function g() {
15
+ return p++;
16
16
  }
17
- const i = /* @__PURE__ */ new Map();
17
+ const o = /* @__PURE__ */ new Map();
18
18
  let r, l;
19
19
  function w(n, u) {
20
- i.set(n, u), i.size && !l && (clearInterval(r), r = setInterval(() => {
20
+ o.set(n, u), o.size && !l && (clearInterval(r), r = setInterval(() => {
21
21
  l = !0;
22
22
  const t = Date.now();
23
- i.forEach((e) => {
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 I(n) {
29
- i.delete(n), i.size || (clearInterval(r), l = !1);
28
+ function b(n) {
29
+ o.delete(n), o.size || (clearInterval(r), l = !1);
30
30
  }
31
- const T = (n, u, t) => {
32
- const e = b(), a = M(
33
- s(o(n.value), o(u))
31
+ const y = (n, u, t) => {
32
+ const e = g(), a = v(
33
+ s(i(n.value), i(u))
34
34
  ), f = {
35
- ts: o(n.value),
35
+ ts: i(n.value),
36
36
  timeAgo: a,
37
37
  interval: t.value,
38
38
  updated: Date.now()
39
39
  };
40
- return h(
40
+ return M(
41
41
  () => n.value,
42
- (c, m) => {
43
- console.log("run target", c, m);
44
- const d = o(c);
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), p(() => {
48
- I(e);
46
+ ), w(e, f), h(() => {
47
+ b(e);
49
48
  }), a;
50
49
  };
51
50
  export {
52
- T as default,
53
- b as getId,
51
+ y as default,
52
+ g as getId,
54
53
  s as getTimeAgo,
55
54
  w as subscribe,
56
- I as unsubscribe
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 n, userTimezone as o } from "@aplus-frontend/utils";
2
- import d from "dayjs";
3
- const s = (t, a = d().valueOf()) => d(n(a, t ?? o)), y = (t, a) => {
4
- const e = s(t, a);
5
- return [e.startOf("day"), e.endOf("day")];
6
- }, l = (t, a) => {
7
- const e = s(t, a);
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
- e.startOf("day").subtract(1, "day").startOf("day"),
10
- e.endOf("day").subtract(1, "day").endOf("day")
9
+ t.startOf("day").subtract(1, "day").startOf("day"),
10
+ t.endOf("day").subtract(1, "day").endOf("day")
11
11
  ];
12
- }, O = (t, a) => {
13
- const e = s(t, a);
12
+ }, O = (a, e) => {
13
+ const t = s(a, e);
14
14
  return [
15
- e.startOf("week").startOf("day"),
16
- e.endOf("week").endOf("day")
15
+ t.startOf("week").startOf("day"),
16
+ t.endOf("week").endOf("day")
17
17
  ];
18
- }, m = (t, a) => {
19
- const e = s(t, a);
18
+ }, c = (a, e) => {
19
+ const t = s(a, e);
20
20
  return [
21
- e.subtract(1, "week").startOf("week").startOf("day"),
22
- e.subtract(1, "week").endOf("week").endOf("day")
21
+ t.subtract(1, "week").startOf("week").startOf("day"),
22
+ t.subtract(1, "week").endOf("week").endOf("day")
23
23
  ];
24
- }, u = (t, a) => {
25
- const e = s(t, a);
24
+ }, h = (a, e) => {
25
+ const t = s(a, e);
26
26
  return [
27
- e.startOf("month").startOf("day"),
28
- e.endOf("month").endOf("day")
27
+ t.startOf("month").startOf("day"),
28
+ t.endOf("month").endOf("day")
29
29
  ];
30
- }, c = (t, a) => {
31
- const e = s(t, a);
30
+ }, i = (a, e) => {
31
+ const t = s(a, e);
32
32
  return [
33
- e.subtract(1, "month").startOf("month").startOf("day"),
34
- e.subtract(1, "month").endOf("month").endOf("day")
33
+ t.subtract(1, "month").startOf("month").startOf("day"),
34
+ t.subtract(1, "month").endOf("month").endOf("day")
35
35
  ];
36
- }, b = (t, a) => {
37
- const e = s(t, a);
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
- e.startOf("year").startOf("day"),
40
- e.endOf("year").endOf("day")
45
+ t.startOf("year").startOf("day"),
46
+ t.endOf("year").endOf("day")
41
47
  ];
42
- }, T = (t, a) => {
43
- const e = s(t, a);
48
+ }, v = (a, e) => {
49
+ const t = s(a, e);
44
50
  return [
45
- e.subtract(1, "year").startOf("year").startOf("day"),
46
- e.subtract(1, "year").endOf("year").endOf("day")
51
+ t.subtract(1, "year").startOf("year").startOf("day"),
52
+ t.subtract(1, "year").endOf("year").endOf("day")
47
53
  ];
48
- }, f = (t, a, e) => {
49
- const r = s(a, e);
54
+ }, f = (a, e, t) => {
55
+ const r = s(e, t);
50
56
  return [
51
- r.subtract(t - 1, "day").startOf("day"),
57
+ r.subtract(a - 1, "day").startOf("day"),
52
58
  r.endOf("day")
53
59
  ];
54
- }, h = (t, a, e) => [
60
+ }, Q = (a, e, t) => [
55
61
  {
56
- label: e ? e("ap.field.today") : "今天",
57
- value: y(t, a)
62
+ label: t ? t("ap.field.thisWeek") : "本周",
63
+ value: O(a, e)
58
64
  },
59
65
  {
60
- label: e ? e("ap.field.yesterday") : "昨天",
61
- value: l(t, a)
66
+ label: t ? t("ap.field.lastWeek") : "上周",
67
+ value: c(a, e)
62
68
  },
63
69
  {
64
- label: e ? e("ap.field.thisWeek") : "本周",
65
- value: O(t, a)
70
+ label: t ? t("ap.field.lastXDays", { day: 7 }) : "近7天",
71
+ value: f(7, a, e)
66
72
  },
67
73
  {
68
- label: e ? e("ap.field.lastWeek") : "上周",
69
- value: m(t, a)
74
+ label: t ? t("ap.field.lastXDays", { day: 30 }) : "近30天",
75
+ value: f(30, a, e)
70
76
  },
71
77
  {
72
- label: e ? e("ap.field.thisMonth") : "本月",
73
- value: u(t, a)
78
+ label: t ? t("ap.field.lastXDays", { day: 90 }) : "近90天",
79
+ value: f(90, a, e)
74
80
  },
75
81
  {
76
- label: e ? e("ap.field.lastMonth") : "上月",
77
- value: c(t, a)
82
+ label: t ? t("ap.field.thisMonth") : "本月",
83
+ value: h(a, e)
78
84
  },
79
85
  {
80
- label: e ? e("ap.field.lastXDays", { day: 7 }) : "近7天",
81
- value: f(7, t, a)
86
+ label: t ? t("ap.field.lastMonth") : "上月",
87
+ value: i(a, e)
82
88
  },
83
89
  {
84
- label: e ? e("ap.field.lastXDays", { day: 30 }) : "近30天",
85
- value: f(30, t, a)
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
- h as presetsDefault,
90
- c as presetsGetLastMonth,
91
- m as presetsGetLastWeek,
107
+ Q as presetsDefault,
108
+ i as presetsGetLastMonth,
109
+ T as presetsGetLastQuarter,
110
+ c as presetsGetLastWeek,
92
111
  f as presetsGetLastXDays,
93
- T as presetsGetLastYear,
94
- u as presetsGetThisMonth,
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
- y as presetsGetToday,
99
- l as presetsGetYesterday
118
+ M as presetsGetToday,
119
+ w as presetsGetYesterday
100
120
  };
@@ -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;
@@ -1,72 +1,80 @@
1
1
  import { isClient as s } from "@vueuse/core";
2
- import { isUndefined as f } from "lodash-unified";
3
- import { unref as d, markRaw as l } from "vue";
4
- import { isDef as A } from "./is.mjs";
5
- function w(e) {
6
- return e?.parentNode ?? document.body;
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 m(e) {
9
- const t = {};
10
- return Object.keys(e).map((n) => {
11
- t[n] = d(e[n]);
12
- }), t;
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 h(e, t = [], n) {
15
- const o = Object.assign({}, e), c = Object.keys(o);
16
- for (let i = 0; i < c.length; i += 1) {
17
- const r = c[i];
18
- (t.includes(r) || n?.(r, o[r])) && delete o[r];
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 g(e) {
23
- return /^[A-Z][A-Za-z]*$/.test(e);
22
+ function b(t) {
23
+ return /^[A-Z][A-Za-z]*$/.test(t);
24
24
  }
25
- function u(e) {
26
- if (Array.isArray(e))
27
- return e.map((t) => u(t));
28
- if (typeof e == "object" && e !== null) {
29
- const t = {};
30
- for (const n in e)
31
- t[n] = u(e[n]);
32
- return l(t);
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 x(e, ...t) {
43
- return typeof e == "function" ? e(...t) : e;
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 b() {
46
- const e = "history";
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 e = document.createElement("div");
53
- e.style.width = "100px", e.style.height = "100px", e.style.overflow = "scroll", e.style.position = "absolute", e.style.top = "-9999px", document.body.appendChild(e);
54
- const t = e.offsetHeight - e.clientHeight;
55
- return document.body.removeChild(e), t;
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 C() {
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
- m as getDynamicProps,
69
+ h as getDynamicProps,
63
70
  w as getPopupContainer,
64
- b as getRouteType,
65
- k as getScrollbarSize,
66
- C as getTopWindow,
67
- A as isDef,
68
- g as isPascalCase,
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
- h as omitWhen,
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
+ };
@@ -6,7 +6,7 @@ function u(r) {
6
6
  return i(t) ? n(t)[0] : t;
7
7
  }
8
8
  function n(r) {
9
- return (r || []).filter((t) => t.type !== Symbol.for("v-cmt"));
9
+ return (r || []).filter((t) => t.type !== /* @__PURE__ */ Symbol.for("v-cmt"));
10
10
  }
11
11
  export {
12
12
  u as getSingleVNode,
@@ -1,2 +1,2 @@
1
- declare const _default: "7.12.6";
1
+ declare const _default: "7.13.1";
2
2
  export default _default;
@@ -1,4 +1,4 @@
1
- const e = "7.12.6";
1
+ const e = "7.13.1";
2
2
  export {
3
3
  e as default
4
4
  };
@@ -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"),l=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"),p=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:{},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"),r=o.ref(),{internalInstance:s}=k.useInjectForm();function v(e){const n=p.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 m=[];o.onMounted(()=>{const e=t.formItem?.initialValue??H.getModelValue(s?.getInitialValues()??{},t.name);e&&(s?.updateInitialModel(i,p.arrayToObject(l.cloneDeep(e),t.rowKey)),m=l.cloneDeep(e),S(l.cloneDeep(e),"suffix",!0))});const u=o.ref([]),x=A.useWatch(t.name);o.watch(()=>x.value,e=>{l.isEqual(e,u.value)||f(e??l.cloneDeep(m))},{deep:!0,flush:"post"});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,s,u,i);function D(){const e=r.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){u.value=[...e];const n=p.arrayToObject(e,t.rowKey);s?.setFieldValue(t.name,[...e]),s?.setFieldValue(i,n)}function g(e,n){const a=e==="end"?u.value.length-1:e;r.value?.scrollToRow(a,n)}function O(e,n){r.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:r}),(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(l.omit)(t,["name","maxLength","onChange","defaultValue","formItem"]),{ref_key:"tableRef",ref:r,class:[o.unref(C)(),o.unref(R)],size:"mini",columns:o.unref(q),"data-source":u.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
+ "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;