@aplus-frontend/ui 0.1.15 → 0.1.17

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 (117) hide show
  1. package/es/index.mjs +99 -95
  2. package/es/src/ap-form/ap-form-item-group/index.vue.mjs +26 -24
  3. package/es/src/ap-modal/index.d.ts +2 -2
  4. package/es/src/ap-modal/index.mjs +1 -1
  5. package/es/src/ap-modal/{type.d.ts → interface.d.ts} +3 -3
  6. package/es/src/ap-modal/utils/createModal.d.ts +1 -1
  7. package/es/src/ap-table/ap-table.vue.mjs +132 -129
  8. package/es/src/ap-table/interface.d.ts +19 -13
  9. package/es/src/ap-table/utils.d.ts +8340 -1
  10. package/es/src/ap-table/utils.mjs +134 -78
  11. package/es/src/business/ap-batch-action/index.css +2 -0
  12. package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue.d.ts +13 -0
  13. package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue.mjs +4 -0
  14. package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +110 -0
  15. package/es/src/business/ap-batch-action-group/MenuItemGroup.vue.d.ts +17 -0
  16. package/es/src/business/ap-batch-action-group/MenuItemGroup.vue.mjs +4 -0
  17. package/es/src/business/ap-batch-action-group/MenuItemGroup.vue2.mjs +50 -0
  18. package/es/src/business/ap-batch-action-group/interface.d.ts +41 -0
  19. package/es/src/business/ap-batch-action-group/interface.mjs +1 -0
  20. package/es/src/business/ap-image/ApImage.vue.d.ts +65 -0
  21. package/es/src/business/ap-image/ApImage.vue.mjs +4 -0
  22. package/es/src/business/ap-image/ApImage.vue2.mjs +56 -0
  23. package/es/src/business/ap-image/hooks/useOss.d.ts +11 -0
  24. package/es/src/business/ap-image/hooks/useOss.mjs +37 -0
  25. package/es/src/business/ap-image/imgs/admin-fallback.jpg.mjs +4 -0
  26. package/es/src/business/ap-image/imgs/aplus-fallback.jpg.mjs +4 -0
  27. package/es/src/business/index.d.ts +662 -1
  28. package/es/src/business/index.mjs +25 -16
  29. package/es/src/config-provider/config-provider-props.d.ts +5 -1
  30. package/es/src/config-provider/config-provider-props.mjs +4 -0
  31. package/es/src/config-provider/config-provider.d.ts +10 -1
  32. package/es/src/config-provider/config-provider.mjs +18 -17
  33. package/es/src/config-provider/constants.d.ts +6 -2
  34. package/es/src/config-provider/hooks/use-global-config.d.ts +5 -1
  35. package/es/src/config-provider/index.d.ts +20 -1
  36. package/es/src/editable-table/form-item.vue.mjs +85 -71
  37. package/es/src/editable-table/hooks/use-get-columns.d.ts +3 -2
  38. package/es/src/editable-table/hooks/use-get-columns.mjs +32 -32
  39. package/es/src/editable-table/index.vue.mjs +106 -92
  40. package/es/src/editable-table/interface.d.ts +7 -13
  41. package/es/src/editable-table/utils.d.ts +14 -2
  42. package/es/src/editable-table/utils.mjs +67 -57
  43. package/es/src/index.mjs +211 -207
  44. package/es/src/locale/lang/en.mjs +10 -7
  45. package/es/src/locale/lang/zh-cn.mjs +3 -0
  46. package/es/src/pro-form/hooks/use-label-width.d.ts +1 -1
  47. package/es/src/theme/antd-global-overwrite/admin/form.css +10 -5
  48. package/es/src/theme/antd-global-overwrite/admin/index.css +117 -38
  49. package/es/src/theme/antd-global-overwrite/admin/pagination.css +54 -16
  50. package/es/src/theme/antd-global-overwrite/admin/table.css +53 -17
  51. package/es/src/theme/antd-global-overwrite/aplus/form.css +28 -14
  52. package/es/src/theme/antd-global-overwrite/aplus/index.css +159 -67
  53. package/es/src/theme/antd-global-overwrite/aplus/pagination.css +66 -20
  54. package/es/src/theme/antd-global-overwrite/aplus/table.css +65 -33
  55. package/es/src/theme/ap-batch-action/ap-batch-action.css +2 -0
  56. package/es/src/utils/ap-trans-data/index.d.ts +9 -10
  57. package/es/src/utils/ap-trans-data/index.mjs +20 -0
  58. package/lib/index.js +1 -1
  59. package/lib/src/ap-form/ap-form-item-group/index.vue.js +1 -1
  60. package/lib/src/ap-modal/index.d.ts +2 -2
  61. package/lib/src/ap-modal/index.js +1 -1
  62. package/lib/src/ap-modal/{type.d.ts → interface.d.ts} +3 -3
  63. package/lib/src/ap-modal/utils/createModal.d.ts +1 -1
  64. package/lib/src/ap-table/ap-table.vue.js +1 -1
  65. package/lib/src/ap-table/interface.d.ts +19 -13
  66. package/lib/src/ap-table/utils.d.ts +8340 -1
  67. package/lib/src/ap-table/utils.js +1 -1
  68. package/lib/src/business/ap-batch-action/index.css +2 -0
  69. package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue.d.ts +13 -0
  70. package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue.js +1 -0
  71. package/lib/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.js +1 -0
  72. package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue.d.ts +17 -0
  73. package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue.js +1 -0
  74. package/lib/src/business/ap-batch-action-group/MenuItemGroup.vue2.js +1 -0
  75. package/lib/src/business/ap-batch-action-group/interface.d.ts +41 -0
  76. package/lib/src/business/ap-batch-action-group/interface.js +1 -0
  77. package/lib/src/business/ap-image/ApImage.vue.d.ts +65 -0
  78. package/lib/src/business/ap-image/ApImage.vue.js +1 -0
  79. package/lib/src/business/ap-image/ApImage.vue2.js +1 -0
  80. package/lib/src/business/ap-image/hooks/useOss.d.ts +11 -0
  81. package/lib/src/business/ap-image/hooks/useOss.js +1 -0
  82. package/lib/src/business/ap-image/imgs/admin-fallback.jpg.js +1 -0
  83. package/lib/src/business/ap-image/imgs/aplus-fallback.jpg.js +1 -0
  84. package/lib/src/business/index.d.ts +662 -1
  85. package/lib/src/business/index.js +1 -1
  86. package/lib/src/config-provider/config-provider-props.d.ts +5 -1
  87. package/lib/src/config-provider/config-provider-props.js +1 -1
  88. package/lib/src/config-provider/config-provider.d.ts +10 -1
  89. package/lib/src/config-provider/config-provider.js +1 -1
  90. package/lib/src/config-provider/constants.d.ts +6 -2
  91. package/lib/src/config-provider/hooks/use-global-config.d.ts +5 -1
  92. package/lib/src/config-provider/index.d.ts +20 -1
  93. package/lib/src/editable-table/form-item.vue.js +1 -1
  94. package/lib/src/editable-table/hooks/use-get-columns.d.ts +3 -2
  95. package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
  96. package/lib/src/editable-table/index.vue.js +1 -1
  97. package/lib/src/editable-table/interface.d.ts +7 -13
  98. package/lib/src/editable-table/utils.d.ts +14 -2
  99. package/lib/src/editable-table/utils.js +1 -1
  100. package/lib/src/index.js +1 -1
  101. package/lib/src/locale/lang/en.js +1 -1
  102. package/lib/src/locale/lang/zh-cn.js +1 -1
  103. package/lib/src/pro-form/hooks/use-label-width.d.ts +1 -1
  104. package/lib/src/theme/antd-global-overwrite/admin/form.css +10 -5
  105. package/lib/src/theme/antd-global-overwrite/admin/index.css +117 -38
  106. package/lib/src/theme/antd-global-overwrite/admin/pagination.css +54 -16
  107. package/lib/src/theme/antd-global-overwrite/admin/table.css +53 -17
  108. package/lib/src/theme/antd-global-overwrite/aplus/form.css +28 -14
  109. package/lib/src/theme/antd-global-overwrite/aplus/index.css +159 -67
  110. package/lib/src/theme/antd-global-overwrite/aplus/pagination.css +66 -20
  111. package/lib/src/theme/antd-global-overwrite/aplus/table.css +65 -33
  112. package/lib/src/theme/ap-batch-action/ap-batch-action.css +2 -0
  113. package/lib/src/utils/ap-trans-data/index.d.ts +9 -10
  114. package/lib/src/utils/ap-trans-data/index.js +1 -0
  115. package/package.json +2 -2
  116. /package/es/src/ap-modal/{type.mjs → interface.mjs} +0 -0
  117. /package/lib/src/ap-modal/{type.js → interface.js} +0 -0
@@ -1,110 +1,166 @@
1
- import { isObject as s, isArray as c, isUndefined as f, isFunction as l, omit as d, isBoolean as p } from "lodash-unified";
2
- const m = (e, t, n) => {
3
- let o = {};
4
- return s(e) ? Object.keys(e).forEach((u) => {
5
- s(e[u]) ? o[u] = m(e[u], t[u], n) : o[u] = n(e[u], t);
6
- }) : o = n(e, t), o;
7
- }, h = (e, t) => {
8
- switch (e) {
1
+ import { isVNode as m, createVNode as i, mergeProps as l, cloneVNode as p } from "vue";
2
+ import { isObject as c, isArray as f, isUndefined as d, isFunction as b, omit as T, isBoolean as y } from "lodash-unified";
3
+ import { apTableRenderItemMap as j, apTableFormItemMap as h } from "./constants.mjs";
4
+ import { isType as g } from "@fruits-chain/utils";
5
+ import "../ap-form/index.mjs";
6
+ import E from "../ap-form/ap-form-item.vue.mjs";
7
+ function F(t) {
8
+ return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !m(t);
9
+ }
10
+ const O = (t, e, n) => {
11
+ let r = {};
12
+ return c(t) ? Object.keys(t).forEach((o) => {
13
+ c(t[o]) ? r[o] = O(t[o], e[o], n) : r[o] = n(t[o], e);
14
+ }) : r = n(t, e), r;
15
+ }, _ = (t, e) => {
16
+ switch (t) {
9
17
  case "dayjs":
10
- return t.valueOf();
18
+ return e.valueOf();
11
19
  case "dayjsRange":
12
- return t.map((n) => n.valueOf());
20
+ return e.map((n) => n.valueOf());
13
21
  case "dayjsDayRange": {
14
- const [n, o] = t;
15
- return [n.startOf("day").valueOf(), o.endOf("day").valueOf()];
22
+ const [n, r] = e;
23
+ return [n.startOf("day").valueOf(), r.endOf("day").valueOf()];
16
24
  }
17
25
  case "multiple":
18
26
  case "multipleNumber":
19
- return c(t) ? t : [t];
27
+ return f(e) ? e : [e];
20
28
  case "boolean":
21
- return t;
29
+ return e;
22
30
  case "object":
23
- return t;
31
+ return e;
24
32
  default:
25
- return t;
33
+ return e;
26
34
  }
27
35
  };
28
- function y(e) {
29
- return c(e) ? e.join(".") : e;
36
+ function C(t) {
37
+ return f(t) ? t.join(".") : t;
30
38
  }
31
- function x(e) {
32
- const t = Object.prototype.toString.call(e).match(/^\[object (.*)\]$/)[1].toLowerCase();
33
- return t === "string" && typeof e == "object" ? "object" : e === null ? "null" : e === void 0 ? "undefined" : t;
39
+ function N(t) {
40
+ const e = Object.prototype.toString.call(t).match(/^\[object (.*)\]$/)[1].toLowerCase();
41
+ return e === "string" && typeof t == "object" ? "object" : t === null ? "null" : t === void 0 ? "undefined" : e;
34
42
  }
35
- const T = (e) => x(e) === "map" ? e : new Map(Object.entries(e || {})), a = (e) => {
36
- const t = [], n = T(e);
37
- return n.forEach((o, u) => {
38
- const r = n.get(u) || n.get(`${u}`);
39
- if (r) {
40
- if (typeof r == "object" && (r != null && r.text)) {
41
- t.push({
42
- text: r == null ? void 0 : r.text,
43
- value: u,
44
- label: r == null ? void 0 : r.text,
45
- disabled: r.disabled
43
+ const S = (t) => N(t) === "map" ? t : new Map(Object.entries(t || {})), a = (t) => {
44
+ const e = [], n = S(t);
45
+ return n.forEach((r, o) => {
46
+ const u = n.get(o) || n.get(`${o}`);
47
+ if (u) {
48
+ if (typeof u == "object" && (u != null && u.text)) {
49
+ e.push({
50
+ text: u == null ? void 0 : u.text,
51
+ value: o,
52
+ label: u == null ? void 0 : u.text,
53
+ disabled: u.disabled
46
54
  });
47
55
  return;
48
56
  }
49
- t.push({
50
- text: r,
51
- label: r,
52
- value: u
57
+ e.push({
58
+ text: u,
59
+ label: u,
60
+ value: o
53
61
  });
54
62
  }
55
- }), t;
56
- }, E = (e) => f(e) || e < 0 ? 0 : e, j = (e, t, n) => {
63
+ }), e;
64
+ }, R = (t) => d(t) || t < 0 ? 0 : t, $ = (t, e, n) => {
57
65
  if (n)
58
66
  return n;
59
- const o = ["select", "date"], u = [
60
- "text",
61
- "textArea",
62
- "number"
63
- ];
64
- if (t === "dateRange")
65
- return [e("ap.common.chooseText"), e("ap.common.chooseText")];
66
- if (o.includes(t))
67
- return e("ap.common.chooseText");
68
- if (u.includes(t))
69
- return e("ap.common.inputText");
67
+ const r = ["select", "date"], o = ["text", "textArea", "number"];
68
+ if (e === "dateRange")
69
+ return [t("ap.common.chooseText"), t("ap.common.chooseText")];
70
+ if (r.includes(e))
71
+ return t("ap.common.chooseText");
72
+ if (o.includes(e))
73
+ return t("ap.common.inputText");
70
74
  };
71
- function b(e, t) {
72
- return !e || !l(e) ? e : e(t);
75
+ function x(t, e) {
76
+ return !t || !b(t) ? t : t(e);
77
+ }
78
+ function q(t) {
79
+ let e = t.valueType || "text";
80
+ return t.valueEnum && (e = "status"), e;
73
81
  }
74
- function O(e) {
75
- let t = e.valueType || "text";
76
- return e.valueEnum && (t = "status"), t;
82
+ function B(t, e, n, r) {
83
+ var s;
84
+ const o = j[t];
85
+ if (o)
86
+ return i(o, l(e, {
87
+ mode: "read"
88
+ }), null);
89
+ const u = r == null ? void 0 : r[t];
90
+ return ((s = u == null ? void 0 : u.render) == null ? void 0 : s.call(u, e.value, n, e)) || e.value;
77
91
  }
78
- function F(e, t) {
79
- const n = b(e.fieldProps, t), o = (n == null ? void 0 : n.field) || n || {}, u = e.valueType === "switch", r = e.valueType === "index", i = u ? { checked: t.value } : { value: r ? t.index + 1 : t.value };
80
- return e.valueEnum && (o.valueEnum = e.valueEnum), {
81
- ...d(o, ["request"]),
82
- ...i
92
+ function D(t, e) {
93
+ if (t.customRenderFormItem)
94
+ return () => {
95
+ const o = t.customRenderFormItem(t);
96
+ return p(o, {
97
+ ...t.fieldProps,
98
+ span: t.span,
99
+ ...o.props || {}
100
+ });
101
+ };
102
+ const n = h[t.valueType];
103
+ if (n)
104
+ return n;
105
+ const r = e == null ? void 0 : e[t.valueType];
106
+ return () => {
107
+ var u;
108
+ const o = (u = r == null ? void 0 : r.renderFormItem) == null ? void 0 : u.call(r, t.fieldProps.field);
109
+ return o ? i(E, l(t.fieldProps, {
110
+ span: t.span
111
+ }), F(o) ? o : {
112
+ default: () => [o]
113
+ }) : null;
83
114
  };
84
115
  }
85
- function v(e) {
86
- const t = { ...e };
87
- return p(e.filters) && e.filters && e.valueEnum && (t.filters = a(e.valueEnum)), t;
116
+ function J(t, e) {
117
+ const n = x(t.fieldProps, e), r = (n == null ? void 0 : n.field) || n || {}, o = t.valueType === "switch", u = t.valueType === "index", s = o ? {
118
+ checked: e.value
119
+ } : {
120
+ value: u ? e.index + 1 : e.value
121
+ };
122
+ return t.valueEnum && (r.valueEnum = t.valueEnum), {
123
+ ...T(r, ["request"]),
124
+ ...s
125
+ };
126
+ }
127
+ function L(t) {
128
+ const e = {
129
+ ...t
130
+ };
131
+ return y(t.filters) && t.filters && t.valueEnum && (e.filters = a(t.valueEnum)), e;
88
132
  }
89
- function w(e, t) {
90
- var o;
91
- const n = t || {};
92
- return e.valueEnum && !((o = n.field) != null && o.options) && (n.field = {
133
+ function U(t, e) {
134
+ var r;
135
+ const n = e || {};
136
+ return t.valueEnum && !((r = n.field) != null && r.options) && (n.field = {
93
137
  ...n.field,
94
- options: a(e.valueEnum)
138
+ options: a(t.valueEnum)
95
139
  }), n;
96
140
  }
141
+ function z(t) {
142
+ if (!g("Object")(t))
143
+ return t;
144
+ try {
145
+ return JSON.stringify(t);
146
+ } catch {
147
+ return t;
148
+ }
149
+ }
97
150
  export {
98
- v as apColumnToColumn,
99
- y as dataIndexToStr,
100
- m as formatParamsValueType,
101
- E as getColumnOrder,
102
- b as getFieldProps,
103
- j as getPlaceholder,
104
- F as getTableRenderProps,
105
- O as getTableRenderType,
106
- T as objectToMap,
107
- h as parseFieldValue,
108
- w as updateFormProps,
151
+ L as apColumnToColumn,
152
+ C as dataIndexToStr,
153
+ O as formatParamsValueType,
154
+ R as getColumnOrder,
155
+ x as getFieldProps,
156
+ $ as getPlaceholder,
157
+ D as getSearchFormItemRenderNode,
158
+ B as getTableCellRenderNode,
159
+ J as getTableRenderProps,
160
+ q as getTableRenderType,
161
+ S as objectToMap,
162
+ z as objectToString,
163
+ _ as parseFieldValue,
164
+ U as updateFormProps,
109
165
  a as valueEnumToArray
110
166
  };
@@ -15,6 +15,8 @@
15
15
  .aplus-ap-batch-action .selected-desc-conut span {
16
16
  color: var(--ap-batch-action-color-active, #0070ff);
17
17
  font-weight: bold;
18
+ min-width: 10px;
19
+ display: inline-block;
18
20
  }
19
21
  .aplus-ap-batch-action .selected-desc-clean {
20
22
  margin-left: 8px;
@@ -0,0 +1,13 @@
1
+ import { ApBatchActionGroupProps } from './interface';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
3
+ declare const _default: DefineComponent<__VLS_TypePropsToOption<ApBatchActionGroupProps>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToOption<ApBatchActionGroupProps>>>, {}, {}>;
4
+ export default _default;
5
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
6
+ type __VLS_TypePropsToOption<T> = {
7
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
8
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
9
+ } : {
10
+ type: PropType<T[K]>;
11
+ required: true;
12
+ };
13
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ApBatchActionGroup.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,110 @@
1
+ import { defineComponent as A, computed as n, openBlock as y, createBlock as h, unref as a, mergeProps as s, withCtx as u, createVNode as c, createElementVNode as C, normalizeStyle as D, toDisplayString as w, normalizeClass as N, createTextVNode as T, createCommentVNode as x } from "vue";
2
+ import { DropdownButton as R, Dropdown as V, Button as G } from "ant-design-vue";
3
+ import "./MenuItemGroup.vue.mjs";
4
+ import "../../config-provider/index.mjs";
5
+ import { DownOutlined as M } from "@ant-design/icons-vue";
6
+ import { usePermission as S } from "@aplus-frontend/hooks";
7
+ import { useNamespace as z } from "../../config-provider/hooks/use-namespace.mjs";
8
+ import { useLocale as F } from "../../config-provider/hooks/use-locale.mjs";
9
+ import { useGlobalConfig as O } from "../../config-provider/hooks/use-global-config.mjs";
10
+ import L from "./MenuItemGroup.vue2.mjs";
11
+ const W = /* @__PURE__ */ A({
12
+ __name: "ApBatchActionGroup",
13
+ props: {
14
+ selectedRows: {},
15
+ buttonProps: {},
16
+ menuList: {}
17
+ },
18
+ setup(P) {
19
+ const { b: i } = z("ap-batch-action-group"), { t: _ } = F(), e = P, B = O("uiMode"), { hasPermission: g } = S(), f = n(
20
+ () => {
21
+ var t;
22
+ return ((t = e == null ? void 0 : e.buttonProps) == null ? void 0 : t.dropdownType) || "default";
23
+ }
24
+ ), d = n(
25
+ () => {
26
+ var t;
27
+ return ((t = e == null ? void 0 : e.buttonProps) == null ? void 0 : t.type) || "borderLink";
28
+ }
29
+ ), p = n(
30
+ () => {
31
+ var t;
32
+ return ((t = e == null ? void 0 : e.buttonProps) == null ? void 0 : t.content) || _("ap.apApBatchActionGroup.batchOperation");
33
+ }
34
+ ), k = n(() => (e == null ? void 0 : e.selectedRows) || []), m = n(
35
+ () => {
36
+ var t;
37
+ return ((t = e == null ? void 0 : e.buttonProps) == null ? void 0 : t.disabled) ?? (Array.isArray(e.selectedRows) ? k.value.length === 0 : !1);
38
+ }
39
+ ), b = n(() => {
40
+ const t = {
41
+ aplus: "#0070FF",
42
+ admin: "#34b77c"
43
+ };
44
+ return d.value === "borderLink" ? m.value ? void 0 : t[B.value] || t.aplus : void 0;
45
+ }), r = n(() => {
46
+ var t;
47
+ return ((t = e == null ? void 0 : e.menuList) == null ? void 0 : t.filter((o) => {
48
+ let l = o == null ? void 0 : o.ifShow;
49
+ return !(o != null && o.ifShow) && (o != null && o.auth) && (l = () => g(o.auth)), (l == null ? void 0 : l()) ?? !0;
50
+ })) || [];
51
+ });
52
+ function v() {
53
+ return e != null && e.buttonProps ? {
54
+ ...e.buttonProps,
55
+ type: d.value === "borderLink" ? "default" : d.value
56
+ } : {};
57
+ }
58
+ return (t, o) => r.value.length && f.value === "dropdown" ? (y(), h(a(R), s({
59
+ key: 0,
60
+ class: [a(i)()]
61
+ }, {
62
+ ...v(),
63
+ disabled: m.value
64
+ }), {
65
+ overlay: u(() => [
66
+ c(L, s({
67
+ ...e
68
+ }, { menuList: r.value }), null, 16, ["menuList"])
69
+ ]),
70
+ default: u(() => [
71
+ C("span", {
72
+ style: D({
73
+ color: b.value
74
+ })
75
+ }, w(p.value), 5)
76
+ ]),
77
+ _: 1
78
+ }, 16, ["class"])) : r.value.length && f.value === "default" ? (y(), h(a(V), {
79
+ key: 1,
80
+ class: N([a(i)()]),
81
+ disabled: m.value
82
+ }, {
83
+ overlay: u(() => [
84
+ c(L, s({
85
+ ...e
86
+ }, { menuList: r.value }), null, 16, ["menuList"])
87
+ ]),
88
+ default: u(() => [
89
+ c(a(G), s({
90
+ ...t.$attrs,
91
+ ...v()
92
+ }, {
93
+ style: {
94
+ color: b.value
95
+ }
96
+ }), {
97
+ default: u(() => [
98
+ T(w(p.value) + " ", 1),
99
+ c(a(M))
100
+ ]),
101
+ _: 1
102
+ }, 16, ["style"])
103
+ ]),
104
+ _: 1
105
+ }, 8, ["class", "disabled"])) : x("", !0);
106
+ }
107
+ });
108
+ export {
109
+ W as default
110
+ };
@@ -0,0 +1,17 @@
1
+ import { ApBatchActionGroupMenuProps, ApBatchActionGroupProps } from './interface';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
3
+ declare const _default: DefineComponent<__VLS_TypePropsToOption<ApBatchActionGroupProps & {
4
+ menuList: ApBatchActionGroupMenuProps[];
5
+ }>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToOption<ApBatchActionGroupProps & {
6
+ menuList: ApBatchActionGroupMenuProps[];
7
+ }>>>, {}, {}>;
8
+ export default _default;
9
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
10
+ type __VLS_TypePropsToOption<T> = {
11
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
12
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
13
+ } : {
14
+ type: PropType<T[K]>;
15
+ required: true;
16
+ };
17
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./MenuItemGroup.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,50 @@
1
+ import { defineComponent as _, ref as h, openBlock as s, createBlock as a, unref as u, withCtx as d, createElementBlock as v, Fragment as t, renderList as y, mergeProps as k, createElementVNode as w, withDirectives as g, createVNode as C, vShow as b, resolveDynamicComponent as L, h as M } from "vue";
2
+ import { LoadingOutlined as B } from "@ant-design/icons-vue";
3
+ import { Menu as R, MenuItem as x } from "ant-design-vue";
4
+ const D = { style: { display: "flex", "align-items": "center" } }, P = /* @__PURE__ */ _({
5
+ __name: "MenuItemGroup",
6
+ props: {
7
+ selectedRows: {},
8
+ buttonProps: {},
9
+ menuList: {}
10
+ },
11
+ setup(f) {
12
+ const o = f, r = h({});
13
+ async function p(e, c) {
14
+ var l;
15
+ const n = (e == null ? void 0 : e.id) || c;
16
+ r.value[n] = !0;
17
+ try {
18
+ await ((l = e == null ? void 0 : e.onClick) == null ? void 0 : l.call(e, { selectedRows: o == null ? void 0 : o.selectedRows }));
19
+ } finally {
20
+ r.value[n] = !1;
21
+ }
22
+ }
23
+ return (e, c) => (s(), a(u(R), null, {
24
+ default: d(() => [
25
+ (s(!0), v(t, null, y(o.menuList, (n, l) => (s(), a(u(x), k({
26
+ key: (n == null ? void 0 : n.id) || l,
27
+ ref_for: !0
28
+ }, {
29
+ ...n,
30
+ onClick: () => p(n, l),
31
+ disabled: r.value[(n == null ? void 0 : n.id) || l] ?? (n == null ? void 0 : n.disabled) ?? !1
32
+ }), {
33
+ default: d(() => [
34
+ w("div", D, [
35
+ g(C(u(B), { style: { "margin-right": "10px" } }, null, 512), [
36
+ [b, r.value[(n == null ? void 0 : n.id) || l]]
37
+ ]),
38
+ (s(), a(L(M(t, [n == null ? void 0 : n.content]))))
39
+ ])
40
+ ]),
41
+ _: 2
42
+ }, 1040))), 128))
43
+ ]),
44
+ _: 1
45
+ }));
46
+ }
47
+ });
48
+ export {
49
+ P as default
50
+ };
@@ -0,0 +1,41 @@
1
+ import { ButtonProps, MenuItemProps } from 'ant-design-vue';
2
+ import { DropdownButtonProps } from 'ant-design-vue/lib/dropdown';
3
+ import { VNodeChild } from 'vue';
4
+ type ApBatchActionGroupButtonType = ButtonProps['type'] | 'borderLink';
5
+ type MixinButton<T> = Omit<T, 'type'> & {
6
+ type?: ApBatchActionGroupButtonType;
7
+ content?: string;
8
+ };
9
+ interface ApBatchActionGroupTypeProps {
10
+ default: MixinButton<ButtonProps>;
11
+ dropdown: MixinButton<DropdownButtonProps>;
12
+ }
13
+ export type ApBatchActionGroupPropsKeys = keyof ApBatchActionGroupTypeProps;
14
+ export type ApBatchActionGroupButtonProps<T extends ApBatchActionGroupPropsKeys = ApBatchActionGroupPropsKeys> = T extends ApBatchActionGroupPropsKeys ? {
15
+ dropdownType?: T;
16
+ } & ApBatchActionGroupTypeProps[T] : never;
17
+ export type ApBatchActionGroupMenuProps<RecordType = any> = Omit<MenuItemProps, 'title' | 'icon' | 'role' | 'originItemValue' | 'onClick'> & {
18
+ content?: VNodeChild;
19
+ onClick?: (item?: {
20
+ selectedRows?: RecordType[];
21
+ }) => Promise<any> | any;
22
+ auth?: string;
23
+ ifShow?: (item?: {
24
+ selectedRows?: RecordType[];
25
+ }) => boolean;
26
+ };
27
+ export type ApBatchActionGroupProps<RecordType = any> = {
28
+ /**
29
+ * 选中行的列表
30
+ */
31
+ selectedRows?: RecordType[];
32
+ /**
33
+ * 按钮配置
34
+ */
35
+ buttonProps?: ApBatchActionGroupButtonProps;
36
+ /**
37
+ * 下拉列表配置
38
+ */
39
+ menuList?: ApBatchActionGroupMenuProps<RecordType>[];
40
+ };
41
+ export {};
@@ -0,0 +1,65 @@
1
+ import { accessCreate } from '@aplus-frontend/oss';
2
+ import { PropType, DefineComponent, CSSProperties, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
3
+ import { MouseEventHandler } from 'ant-design-vue/lib/_util/EventInterface';
4
+ import { VueTypeValidableDef } from '../../../node_modules/vue-types';
5
+ import { ImagePreviewType } from 'ant-design-vue/lib/vc-image';
6
+ declare const _default: DefineComponent<{
7
+ path: StringConstructor;
8
+ getOssAccess: PropType<() => Promise<accessCreate>>;
9
+ onClick: {
10
+ type: PropType< MouseEventHandler>;
11
+ };
12
+ onError: {
13
+ type: PropType<OnErrorEventHandlerNonNull>;
14
+ };
15
+ prefixCls: StringConstructor;
16
+ placeholder: VueTypeValidableDef<any>;
17
+ preview: {
18
+ type: PropType<boolean | ImagePreviewType>;
19
+ default: boolean | ImagePreviewType;
20
+ };
21
+ rootClassName: StringConstructor;
22
+ wrapperClassName: StringConstructor;
23
+ fallback: StringConstructor;
24
+ previewPrefixCls: StringConstructor;
25
+ wrapperStyle: {
26
+ type: PropType< CSSProperties>;
27
+ default: CSSProperties;
28
+ };
29
+ previewMask: {
30
+ type: PropType<false | (() => any)>;
31
+ default: any;
32
+ };
33
+ }, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
34
+ path: StringConstructor;
35
+ getOssAccess: PropType<() => Promise<accessCreate>>;
36
+ onClick: {
37
+ type: PropType< MouseEventHandler>;
38
+ };
39
+ onError: {
40
+ type: PropType<OnErrorEventHandlerNonNull>;
41
+ };
42
+ prefixCls: StringConstructor;
43
+ placeholder: VueTypeValidableDef<any>;
44
+ preview: {
45
+ type: PropType<boolean | ImagePreviewType>;
46
+ default: boolean | ImagePreviewType;
47
+ };
48
+ rootClassName: StringConstructor;
49
+ wrapperClassName: StringConstructor;
50
+ fallback: StringConstructor;
51
+ previewPrefixCls: StringConstructor;
52
+ wrapperStyle: {
53
+ type: PropType< CSSProperties>;
54
+ default: CSSProperties;
55
+ };
56
+ previewMask: {
57
+ type: PropType<false | (() => any)>;
58
+ default: any;
59
+ };
60
+ }>>, {
61
+ preview: boolean | ImagePreviewType;
62
+ wrapperStyle: CSSProperties;
63
+ previewMask: false | (() => any);
64
+ }, {}>;
65
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import f from "./ApImage.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,56 @@
1
+ import { defineComponent as b, computed as s, ref as h, watchEffect as O, openBlock as _, createBlock as P, unref as w, normalizeProps as C, guardReactiveProps as F } from "vue";
2
+ import { Image as I } from "ant-design-vue";
3
+ import { injectLocaleToOss as M, getOssInstance as S, getSignatureUrl as U } from "./hooks/useOss.mjs";
4
+ import "../../config-provider/index.mjs";
5
+ import { imageProps as x } from "ant-design-vue/lib/image";
6
+ import { omit as y } from "lodash-unified";
7
+ import B from "./imgs/admin-fallback.jpg.mjs";
8
+ import L from "./imgs/aplus-fallback.jpg.mjs";
9
+ import { useGlobalConfig as p } from "../../config-provider/hooks/use-global-config.mjs";
10
+ import { useLocale as j } from "../../config-provider/hooks/use-locale.mjs";
11
+ const K = /* @__PURE__ */ b({
12
+ __name: "ApImage",
13
+ props: {
14
+ ...y(x(), ["src"]),
15
+ path: String,
16
+ getOssAccess: Function
17
+ },
18
+ setup(u) {
19
+ const e = u, c = {
20
+ aplus: L,
21
+ admin: B
22
+ }, i = p("uiMode"), m = p("apUpload"), { t: f, lang: g } = j(), r = s(() => e.path), v = s(
23
+ () => {
24
+ var a;
25
+ return e.getOssAccess || ((a = m.value) == null ? void 0 : a.getOssAccess);
26
+ }
27
+ ), l = s(
28
+ () => c[i.value] || c.aplus
29
+ ), n = s(() => (e == null ? void 0 : e.fallback) || l.value), o = h(l.value);
30
+ M(f, g);
31
+ function d(a) {
32
+ const { path: t, getOssAccess: k, ...A } = a;
33
+ return A;
34
+ }
35
+ return O(async () => {
36
+ try {
37
+ if (r.value) {
38
+ const a = await S(v.value), t = await U({
39
+ oss: a,
40
+ fileName: r.value
41
+ });
42
+ t && (o.value = t);
43
+ }
44
+ } catch {
45
+ o.value = n.value;
46
+ }
47
+ }), (a, t) => (_(), P(w(I), C(F({
48
+ ...d(e),
49
+ fallback: n.value,
50
+ src: o.value
51
+ })), null, 16));
52
+ }
53
+ });
54
+ export {
55
+ K as default
56
+ };
@@ -0,0 +1,11 @@
1
+ import { accessCreate, Oss } from '@aplus-frontend/oss';
2
+ import { Translator } from '../../../config-provider';
3
+ import { Ref } from 'vue';
4
+ type GetOssAccess = () => Promise<accessCreate>;
5
+ export declare function injectLocaleToOss(tValue: Translator, langValue: Ref<string>): void;
6
+ export declare function getOssInstance(getOssAccess?: GetOssAccess): Promise<Oss>;
7
+ export declare function getSignatureUrl({ oss, fileName }: {
8
+ oss: Oss;
9
+ fileName: string;
10
+ }): Promise<string | undefined>;
11
+ export {};