@aplus-frontend/ui 0.6.0-beta.8 → 0.6.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/src/ap-form/interface.d.ts +4 -0
- package/es/src/ap-form/search-form/components/popover-filter.vue.d.ts +131 -2
- package/es/src/ap-form/search-form/components/popover-filter.vue2.mjs +40 -36
- package/es/src/ap-form/search-form/components/popover-sorter/index.vue2.mjs +79 -71
- package/es/src/ap-form/search-form/index.vue.d.ts +6 -2
- package/es/src/ap-form/search-form/index.vue.mjs +76 -75
- package/es/src/ap-table/hooks/use-table-paging-ng.d.ts +1 -1
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +1 -1
- package/es/src/ap-tag/ap-tag-group.vue.mjs +32 -28
- package/es/src/business/ap-expand-alert/ApExpandAlert.vue2.mjs +89 -70
- package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +18 -17
- package/es/src/business/ap-input-radio/ApInputRadio.vue2.mjs +27 -25
- package/es/src/business/ap-label/constans.mjs +1 -1
- package/es/src/business/ap-view/components/main-button-content.vue2.mjs +55 -51
- package/es/src/business/hooks/usePageListApGrid.mjs +1 -1
- package/lib/src/ap-form/interface.d.ts +4 -0
- package/lib/src/ap-form/search-form/components/popover-filter.vue.d.ts +131 -2
- package/lib/src/ap-form/search-form/components/popover-filter.vue2.js +1 -1
- package/lib/src/ap-form/search-form/components/popover-sorter/index.vue2.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.d.ts +6 -2
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging-ng.d.ts +1 -1
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/ap-tag/ap-tag-group.vue.js +1 -1
- package/lib/src/business/ap-expand-alert/ApExpandAlert.vue2.js +1 -1
- package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
- package/lib/src/business/ap-input-radio/ApInputRadio.vue2.js +1 -1
- package/lib/src/business/ap-label/constans.js +1 -1
- package/lib/src/business/ap-view/components/main-button-content.vue2.js +1 -1
- package/lib/src/business/hooks/usePageListApGrid.js +1 -1
- package/package.json +1 -1
- package/theme/ap-action/item-dropdown.css +1 -1
- package/theme/ap-action/item.css +2 -2
- package/theme/ap-appendix/ap-appendix.css +3 -3
- package/theme/ap-appendix/ap-appendix.less +2 -2
- package/theme/ap-attachment/ap-attachment.css +3 -2
- package/theme/ap-attachment/ap-attachment.less +2 -2
- package/theme/ap-batch-action/ap-batch-action.css +1 -1
- package/theme/ap-button/ap-button.css +1 -1
- package/theme/ap-card/ap-card.css +1 -1
- package/theme/ap-descriptions/ap-descriptions.css +1 -1
- package/theme/ap-download/ap-download.css +1 -1
- package/theme/ap-expand-alert/ap-expand-alert.css +2 -2
- package/theme/ap-expand-alert/ap-expand-alert.less +2 -1
- package/theme/ap-field/checkbox.css +1 -1
- package/theme/ap-field/index.css +1 -1
- package/theme/ap-field/number.css +1 -1
- package/theme/ap-field/radio.css +1 -1
- package/theme/ap-field/text-area.css +1 -1
- package/theme/ap-form/ap-form-item-group.css +1 -1
- package/theme/ap-form/ap-form-item.css +1 -1
- package/theme/ap-form/drawer-form.css +1 -1
- package/theme/ap-form/index.css +14 -5
- package/theme/ap-form/item-text-group.css +1 -1
- package/theme/ap-form/item-text.css +1 -1
- package/theme/ap-form/modal-form.css +1 -1
- package/theme/ap-form/search-form-sorter.css +6 -5
- package/theme/ap-form/search-form-sorter.less +1 -0
- package/theme/ap-form/search-form.css +14 -5
- package/theme/ap-form/search-form.less +8 -0
- package/theme/ap-grid/editable.css +1 -1
- package/theme/ap-grid/index.css +15 -7
- package/theme/ap-grid/index.less +0 -1
- package/theme/ap-group-search/ap-extension-select.css +1 -1
- package/theme/ap-group-search/ap-group-search.css +1 -1
- package/theme/ap-group-search/ap-popover-select.css +1 -1
- package/theme/ap-image/ap-image.css +1 -1
- package/theme/ap-input-radio/ap-input-radio.css +1 -1
- package/theme/ap-label/ap-label.css +1 -1
- package/theme/ap-ladder/ap-ladder.css +2 -1
- package/theme/ap-ladder/ap-ladder.less +1 -0
- package/theme/ap-layout/ap-info-layout.css +1 -1
- package/theme/ap-list/index.css +1 -1
- package/theme/ap-product-info/ap-product-info.css +1 -1
- package/theme/ap-select-layout/ap-select-layout.css +1 -1
- package/theme/ap-size-input/ap-size-input.css +1 -1
- package/theme/ap-status/ap-status.css +2 -2
- package/theme/ap-status/ap-status.less +1 -1
- package/theme/ap-summary/index.css +1 -1
- package/theme/ap-table/ap-table-index.css +1 -1
- package/theme/ap-table/ap-table-paragraph-ellipsis.css +1 -1
- package/theme/ap-table/ap-table.css +16 -8
- package/theme/ap-table/setting/index.css +2 -3
- package/theme/ap-table/setting/modal.css +2 -2
- package/theme/ap-table/setting/select-group.css +1 -1
- package/theme/ap-table/setting/sortable-item-meta.css +1 -1
- package/theme/ap-table/setting/sortable-item.css +1 -1
- package/theme/ap-table/setting/sorter.css +1 -2
- package/theme/ap-table-modal/index.css +16 -8
- package/theme/ap-tag/ap-tag-group.css +3 -3
- package/theme/ap-tag/ap-tag-group.less +2 -3
- package/theme/ap-tag/ap-tag.css +4 -4
- package/theme/ap-tag/ap-tag.less +3 -3
- package/theme/ap-title/ap-title.css +6 -4
- package/theme/ap-title/ap-title.less +5 -3
- package/theme/ap-upload/index.css +6 -6
- package/theme/ap-upload/multiple-file.css +2 -2
- package/theme/ap-upload/multiple-file.less +1 -1
- package/theme/ap-upload/picture.css +3 -3
- package/theme/ap-upload/picture.less +2 -2
- package/theme/ap-upload/single-file.css +3 -3
- package/theme/ap-upload/single-file.less +2 -2
- package/theme/ap-upload/upload.css +1 -1
- package/theme/ap-upload-single/index.css +1 -1
- package/theme/ap-view/ap-view.css +1 -1
- package/theme/batch-input-group/index.css +2 -1
- package/theme/batch-input-group/popover-input.css +2 -1
- package/theme/batch-input-group/popover-input.less +1 -0
- package/theme/check-card/index.css +4 -4
- package/theme/editable-table/index.css +15 -6
- package/theme/full-screen/index.css +1 -1
- package/theme/index.css +45 -33
- package/theme/mask/index.css +1 -1
- package/theme/mixins/config.less +1 -1
- package/theme/mixins/mixins.css +1 -1
- package/theme/scroll-bar/index.css +1 -1
- package/theme/scroll-view/index.css +1 -1
- package/theme/splitter/index.css +3 -3
- package/theme/text/group.css +1 -1
- package/theme/text/index.css +2 -2
- package/theme/work-order-modal/index.css +1 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { isVNode as
|
|
2
|
-
import { Col as R, Flex as
|
|
1
|
+
import { isVNode as oe, defineComponent as ae, useSlots as ne, ref as L, shallowRef as U, computed as _, unref as n, watch as V, createVNode as t, Fragment as w, createBlock as x, openBlock as d, mergeProps as le, withCtx as A, resolveDynamicComponent as B, createElementBlock as re, renderList as se } from "vue";
|
|
2
|
+
import { Col as R, Flex as N, Button as M, Row as ie } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../ap-form.vue.mjs";
|
|
4
4
|
import "../item/index.vue2.mjs";
|
|
5
|
-
import { genRealChildren as
|
|
5
|
+
import { genRealChildren as W } from "../item-group/helper.mjs";
|
|
6
6
|
import "../../config-provider/index.mjs";
|
|
7
|
-
import { isArray as
|
|
8
|
-
import { isDef as
|
|
9
|
-
import { execFunc as
|
|
7
|
+
import { isArray as ue, isBoolean as ce, omit as pe } from "lodash-unified";
|
|
8
|
+
import { isDef as D } from "../../utils/index.mjs";
|
|
9
|
+
import { execFunc as q, diffFormItem as de } from "./utils.mjs";
|
|
10
10
|
import "./components/popover-filter.vue.mjs";
|
|
11
|
-
import { useCountPerRow as
|
|
11
|
+
import { useCountPerRow as fe } from "./hooks/use-count-per-row.mjs";
|
|
12
12
|
import "./components/popover-sorter/index.vue.mjs";
|
|
13
|
-
import { useNamespace as
|
|
14
|
-
import { useLocale as
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
function
|
|
20
|
-
return typeof f == "function" || Object.prototype.toString.call(f) === "[object Object]" && !
|
|
13
|
+
import { useNamespace as me } from "../../config-provider/hooks/use-namespace.mjs";
|
|
14
|
+
import { useLocale as he } from "../../config-provider/hooks/use-locale.mjs";
|
|
15
|
+
import z from "../item/index.vue.mjs";
|
|
16
|
+
import xe from "./components/popover-filter.vue2.mjs";
|
|
17
|
+
import ye from "./components/popover-sorter/index.vue2.mjs";
|
|
18
|
+
import ge from "../ap-form.vue2.mjs";
|
|
19
|
+
function ve(f) {
|
|
20
|
+
return typeof f == "function" || Object.prototype.toString.call(f) === "[object Object]" && !oe(f);
|
|
21
21
|
}
|
|
22
|
-
const s = 24,
|
|
22
|
+
const s = 24, Ue = /* @__PURE__ */ ae({
|
|
23
23
|
name: "ApFormSearchForm",
|
|
24
24
|
__name: "index",
|
|
25
25
|
props: {
|
|
@@ -111,102 +111,103 @@ const s = 24, Le = /* @__PURE__ */ te({
|
|
|
111
111
|
}
|
|
112
112
|
},
|
|
113
113
|
setup(f, {
|
|
114
|
-
expose:
|
|
114
|
+
expose: H
|
|
115
115
|
}) {
|
|
116
|
-
var
|
|
117
|
-
const i =
|
|
116
|
+
var P;
|
|
117
|
+
const i = ne(), o = f, {
|
|
118
118
|
b: m
|
|
119
|
-
} =
|
|
120
|
-
t:
|
|
121
|
-
} =
|
|
122
|
-
function
|
|
119
|
+
} = me("ap-form-search-form"), {
|
|
120
|
+
t: k
|
|
121
|
+
} = he(), G = fe(o), y = L();
|
|
122
|
+
function I() {
|
|
123
123
|
var a;
|
|
124
124
|
const e = (a = y.value) == null ? void 0 : a.getFieldsValueTransformed(!0);
|
|
125
|
-
|
|
125
|
+
q(o.onSubmit, e);
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function J() {
|
|
128
128
|
var e, a;
|
|
129
|
-
o.customReset || (a = (e = y.value) == null ? void 0 : e.resetFields) == null || a.call(e),
|
|
129
|
+
o.customReset || (a = (e = y.value) == null ? void 0 : e.resetFields) == null || a.call(e), q(o.onReset);
|
|
130
130
|
}
|
|
131
|
-
const
|
|
132
|
-
let
|
|
133
|
-
const u =
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}),
|
|
131
|
+
const K = (e) => D(e) ? (ue(e) ? e : [e]).join("") : Date.now();
|
|
132
|
+
let T = [];
|
|
133
|
+
const u = U(W(i.default())), b = L(!1), c = U((P = i.extra) == null ? void 0 : P.call(i)), E = _(() => Math.floor(s / n(G)));
|
|
134
|
+
V(() => i.default(), (e) => {
|
|
135
|
+
T = u.value, u.value = de(T, W(e)), b.value = !1;
|
|
136
|
+
}), V(() => {
|
|
137
137
|
var e;
|
|
138
138
|
return (e = i.extra) == null ? void 0 : e.call(i);
|
|
139
139
|
}, (e) => {
|
|
140
140
|
c.value = e;
|
|
141
141
|
});
|
|
142
142
|
const l = _(() => {
|
|
143
|
-
const e = u.value, a = [], r = [], g = [], h = n(
|
|
144
|
-
let v = 0,
|
|
145
|
-
const
|
|
146
|
-
e.forEach((
|
|
147
|
-
const p =
|
|
148
|
-
if (
|
|
149
|
-
a.push(
|
|
143
|
+
const e = u.value, a = [], r = [], g = [], h = n(E);
|
|
144
|
+
let v = 0, S = 0;
|
|
145
|
+
const Y = s * o.maxRows - h * (n(c) && !o.extraInAction ? 2 : 1);
|
|
146
|
+
e.forEach((F, te) => {
|
|
147
|
+
const p = F.props;
|
|
148
|
+
if (ce(p.hidden) ? !!p.hidden : D(p.hidden))
|
|
149
|
+
a.push(F);
|
|
150
150
|
else {
|
|
151
151
|
let C = p.span || h;
|
|
152
|
-
const
|
|
153
|
-
node:
|
|
152
|
+
const $ = {
|
|
153
|
+
node: F,
|
|
154
154
|
span: C,
|
|
155
|
-
key: `ApFormSearchFormItem-${
|
|
156
|
-
},
|
|
157
|
-
|
|
155
|
+
key: `ApFormSearchFormItem-${te}-${K(p.name)}-${p._signal}`
|
|
156
|
+
}, j = s - v % s;
|
|
157
|
+
j < C && (C += j), v += C, v > Y ? r.push($) : (S = v, g.push($));
|
|
158
158
|
}
|
|
159
159
|
});
|
|
160
|
-
const
|
|
160
|
+
const O = s - (S + h) % s, Z = S % s < h, ee = O < h ? s : O;
|
|
161
161
|
return {
|
|
162
162
|
hideNode: t(w, null, [a]),
|
|
163
163
|
nodes: g,
|
|
164
164
|
collapseNodes: r,
|
|
165
|
-
extraSpan:
|
|
166
|
-
lastRowOnlyIncludeActionAndExtra:
|
|
165
|
+
extraSpan: ee,
|
|
166
|
+
lastRowOnlyIncludeActionAndExtra: Z
|
|
167
167
|
};
|
|
168
168
|
});
|
|
169
|
-
function
|
|
170
|
-
u.value = [...e];
|
|
169
|
+
function Q(e) {
|
|
170
|
+
u.value = [...e], b.value = !0;
|
|
171
171
|
}
|
|
172
|
-
const
|
|
172
|
+
const X = _(() => {
|
|
173
173
|
let e;
|
|
174
174
|
const a = t(R, {
|
|
175
|
-
span: n(
|
|
175
|
+
span: n(E),
|
|
176
176
|
key: "actionWrapper"
|
|
177
177
|
}, {
|
|
178
|
-
default: () => [t(
|
|
179
|
-
default: () => [t(
|
|
178
|
+
default: () => [t(z, null, {
|
|
179
|
+
default: () => [t(N, {
|
|
180
180
|
wrap: "wrap",
|
|
181
181
|
justify: l.value.lastRowOnlyIncludeActionAndExtra && !(n(c) && o.extraInAction) ? "flex-end" : "space-between"
|
|
182
182
|
}, {
|
|
183
|
-
default: () => [t(
|
|
183
|
+
default: () => [t(N, {
|
|
184
184
|
gap: 8,
|
|
185
185
|
wrap: "wrap"
|
|
186
186
|
}, {
|
|
187
187
|
default: () => [t("div", {
|
|
188
188
|
class: m("column-setting-trigger-wrapper")
|
|
189
|
-
}, [l.value.collapseNodes.length ? t(
|
|
190
|
-
onSubmit:
|
|
189
|
+
}, [l.value.collapseNodes.length ? t(xe, {
|
|
190
|
+
onSubmit: I,
|
|
191
191
|
config: l.value.collapseNodes,
|
|
192
192
|
submitLoading: o.submitLoading
|
|
193
|
-
}, null) : null, o.sortable && u.value.length ? t(
|
|
193
|
+
}, null) : null, o.sortable && u.value.length ? t(ye, {
|
|
194
194
|
children: u.value,
|
|
195
|
-
onClickConfirm:
|
|
196
|
-
|
|
195
|
+
onClickConfirm: Q,
|
|
196
|
+
sorted: b.value
|
|
197
|
+
}, null) : null]), t(M, {
|
|
197
198
|
type: "primary",
|
|
198
|
-
onClick:
|
|
199
|
+
onClick: I,
|
|
199
200
|
loading: o.submitLoading,
|
|
200
201
|
htmlType: "submit",
|
|
201
202
|
class: m("action-btn")
|
|
202
203
|
}, {
|
|
203
|
-
default: () => [o.searchText ||
|
|
204
|
-
}), t(
|
|
205
|
-
onClick:
|
|
204
|
+
default: () => [o.searchText || k("ap.apForm.search.search")]
|
|
205
|
+
}), t(M, {
|
|
206
|
+
onClick: J,
|
|
206
207
|
type: "text",
|
|
207
208
|
class: [m("action-btn"), m("action-btn-reset")]
|
|
208
209
|
}, {
|
|
209
|
-
default: () => [o.resetText ||
|
|
210
|
+
default: () => [o.resetText || k("ap.apForm.search.reset")]
|
|
210
211
|
})]
|
|
211
212
|
}), o.extraInAction ? n(c) : null]
|
|
212
213
|
})]
|
|
@@ -215,10 +216,10 @@ const s = 24, Le = /* @__PURE__ */ te({
|
|
|
215
216
|
span: l.value.extraSpan,
|
|
216
217
|
key: "extraNode"
|
|
217
218
|
}, {
|
|
218
|
-
default: () => [t(
|
|
219
|
-
default: () => [t(
|
|
219
|
+
default: () => [t(z, null, {
|
|
220
|
+
default: () => [t(N, {
|
|
220
221
|
justify: l.value.extraSpan === s || l.value.lastRowOnlyIncludeActionAndExtra ? "start" : "flex-end"
|
|
221
|
-
},
|
|
222
|
+
}, ve(e = n(c)) ? e : {
|
|
222
223
|
default: () => [e]
|
|
223
224
|
})]
|
|
224
225
|
})]
|
|
@@ -227,23 +228,23 @@ const s = 24, Le = /* @__PURE__ */ te({
|
|
|
227
228
|
}, null);
|
|
228
229
|
return l.value.lastRowOnlyIncludeActionAndExtra ? t(w, null, [r || g, a]) : t(w, null, [a, r]);
|
|
229
230
|
});
|
|
230
|
-
return
|
|
231
|
+
return H({
|
|
231
232
|
apForm: _(() => n(y))
|
|
232
|
-
}), (e, a) => (d(), x(
|
|
233
|
+
}), (e, a) => (d(), x(ge, le({
|
|
233
234
|
ref_key: "apForm",
|
|
234
235
|
ref: y,
|
|
235
236
|
class: n(m)()
|
|
236
|
-
}, n(
|
|
237
|
-
default:
|
|
237
|
+
}, n(pe)(o, ["collapse", "defaultCollapse", "onUpdate:collapse", "searchText", "resetText", "onSubmit", "onReset", "extraInAction", "forceExpand", "countPerRow"])), {
|
|
238
|
+
default: A(() => [(d(), x(B(l.value.hideNode))), t(n(ie), {
|
|
238
239
|
gutter: 8
|
|
239
240
|
}, {
|
|
240
|
-
default:
|
|
241
|
+
default: A(() => [(d(!0), re(w, null, se(l.value.nodes, (r) => (d(), x(n(R), {
|
|
241
242
|
key: r.key,
|
|
242
243
|
span: r.span
|
|
243
244
|
}, {
|
|
244
|
-
default:
|
|
245
|
+
default: A(() => [(d(), x(B(r.node)))]),
|
|
245
246
|
_: 2
|
|
246
|
-
}, 1032, ["span"]))), 128)), (d(), x(
|
|
247
|
+
}, 1032, ["span"]))), 128)), (d(), x(B(X.value)))]),
|
|
247
248
|
_: 1
|
|
248
249
|
})]),
|
|
249
250
|
_: 1
|
|
@@ -251,5 +252,5 @@ const s = 24, Le = /* @__PURE__ */ te({
|
|
|
251
252
|
}
|
|
252
253
|
});
|
|
253
254
|
export {
|
|
254
|
-
|
|
255
|
+
Ue as default
|
|
255
256
|
};
|
|
@@ -60,7 +60,7 @@ type InternalDataType<DataType = Recordable> = {
|
|
|
60
60
|
loading: boolean;
|
|
61
61
|
};
|
|
62
62
|
export declare const DEFAULT_CURRENT = 1;
|
|
63
|
-
export declare const DEFAULT_PAGE_SIZE =
|
|
63
|
+
export declare const DEFAULT_PAGE_SIZE = 20;
|
|
64
64
|
export declare const useTablePaging: <DataType = any, ParamsType = Record<string, any>>({ manual, request, defaultParams, defaultData, formatParams, paramsValueTypeMap, resetFieldsIgnores, filterFields, sortFields, namespace, pagination }: UseTablePagingParams<DataType, ParamsType>) => {
|
|
65
65
|
formRef: Ref<ApFormSearchFormExpose | undefined, ApFormSearchFormExpose | undefined>;
|
|
66
66
|
submit: () => void;
|
|
@@ -6,7 +6,7 @@ import { isArray as q, isEqualWith as de, isUndefined as pe } from "lodash-unifi
|
|
|
6
6
|
import { isDef as N } from "../../utils/index.mjs";
|
|
7
7
|
import { useLocale as me } from "../../config-provider/hooks/use-locale.mjs";
|
|
8
8
|
import { useNamespace as he } from "../../config-provider/hooks/use-namespace.mjs";
|
|
9
|
-
const h = 1, D =
|
|
9
|
+
const h = 1, D = 20, B = {
|
|
10
10
|
defaultCurrent: h,
|
|
11
11
|
defaultPageSize: D,
|
|
12
12
|
showLessItems: !1,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as D, ref as
|
|
1
|
+
import { defineComponent as D, ref as b, computed as n, unref as f, watch as N, nextTick as S, onMounted as j, onUnmounted as G, createBlock as d, openBlock as u, mergeProps as k, withCtx as g, createElementVNode as o, normalizeStyle as W, normalizeClass as _, createElementBlock as T, createCommentVNode as R, Fragment as A, renderList as F, toDisplayString as E, renderSlot as I, createTextVNode as U } from "vue";
|
|
2
2
|
import { Tooltip as q } from "@aplus-frontend/antdv";
|
|
3
3
|
import H from "@ant-design/icons-vue";
|
|
4
4
|
import "./ap-tag.vue2.mjs";
|
|
@@ -8,7 +8,7 @@ import { useLocale as K } from "../config-provider/hooks/use-locale.mjs";
|
|
|
8
8
|
import { useGlobalConfig as O } from "../config-provider/hooks/use-global-config.mjs";
|
|
9
9
|
import { useNamespace as Q } from "../config-provider/hooks/use-namespace.mjs";
|
|
10
10
|
import X from "./ap-tag.vue.mjs";
|
|
11
|
-
const
|
|
11
|
+
const ce = /* @__PURE__ */ D({
|
|
12
12
|
__name: "ap-tag-group",
|
|
13
13
|
props: {
|
|
14
14
|
list: { default: () => [] },
|
|
@@ -16,15 +16,15 @@ const ue = /* @__PURE__ */ D({
|
|
|
16
16
|
ellipsisColor: {},
|
|
17
17
|
ellipsis: { default: () => ({}) }
|
|
18
18
|
},
|
|
19
|
-
setup(
|
|
20
|
-
const { t:
|
|
19
|
+
setup(z) {
|
|
20
|
+
const { t: V } = K(), i = z, v = O("uiMode"), { b: $, bm: h } = Q("tag-group"), c = b(), r = n(() => ({
|
|
21
21
|
...{
|
|
22
|
-
iconColor: "#
|
|
22
|
+
iconColor: v.value === "aplus" ? "#182948" : "#333",
|
|
23
23
|
symbol: "icon",
|
|
24
|
-
text:
|
|
24
|
+
text: V("ap.common.more")
|
|
25
25
|
},
|
|
26
26
|
...i.ellipsis
|
|
27
|
-
})),
|
|
27
|
+
})), B = n(() => r.value.tooltip && typeof r.value.tooltip == "object" ? J(r.value.tooltip, ["trigger", "title"]) : {}), p = n(() => f(m) < i.list.length), m = b(0), L = n(() => i.list.map((e) => e.text).join("、")), M = n(() => [$()].filter(Boolean)), P = n(() => v.value === "aplus" ? [h("ellipsis-text", "aplus")] : [h("ellipsis-text", "admin")]), y = (e, t) => {
|
|
28
28
|
let s = document.createElement("canvas");
|
|
29
29
|
const l = s.getContext("2d");
|
|
30
30
|
l.font = `${e}px system-ui`;
|
|
@@ -34,21 +34,21 @@ const ue = /* @__PURE__ */ D({
|
|
|
34
34
|
}, 0), a.width;
|
|
35
35
|
}, x = () => {
|
|
36
36
|
let e = 0, t = 0;
|
|
37
|
-
if (!
|
|
38
|
-
const s =
|
|
37
|
+
if (!c.value) return;
|
|
38
|
+
const s = c.value.offsetWidth;
|
|
39
39
|
for (let l of i.list) {
|
|
40
|
-
const a = l.size === "large" ? 16 : 12,
|
|
40
|
+
const a = l.size === "large" ? 16 : 12, C = y(
|
|
41
41
|
l.size === "large" ? 14 : 12,
|
|
42
42
|
l.text
|
|
43
43
|
) + a + 2 + i.space;
|
|
44
|
-
if (e +=
|
|
45
|
-
e -=
|
|
44
|
+
if (e += C, e > s) {
|
|
45
|
+
e -= C;
|
|
46
46
|
break;
|
|
47
47
|
}
|
|
48
48
|
t++;
|
|
49
49
|
}
|
|
50
50
|
if (t < i.list.length) {
|
|
51
|
-
const a =
|
|
51
|
+
const a = y(12, r.value.text);
|
|
52
52
|
i.ellipsis.symbol === "icon" ? e += 16 : e += a, e > s && t--;
|
|
53
53
|
}
|
|
54
54
|
m.value = t;
|
|
@@ -64,7 +64,7 @@ const ue = /* @__PURE__ */ D({
|
|
|
64
64
|
immediate: !0
|
|
65
65
|
}
|
|
66
66
|
);
|
|
67
|
-
const
|
|
67
|
+
const w = () => {
|
|
68
68
|
x();
|
|
69
69
|
};
|
|
70
70
|
return j(() => {
|
|
@@ -74,35 +74,38 @@ const ue = /* @__PURE__ */ D({
|
|
|
74
74
|
`[ApTagGroup]: \`${e}\` is deprecated, please use \`${t}\` instead.`
|
|
75
75
|
);
|
|
76
76
|
}
|
|
77
|
-
), window.addEventListener("resize",
|
|
77
|
+
), window.addEventListener("resize", w);
|
|
78
78
|
}), G(() => {
|
|
79
|
-
window.removeEventListener("resize",
|
|
80
|
-
}), (e, t) => (
|
|
79
|
+
window.removeEventListener("resize", w);
|
|
80
|
+
}), (e, t) => (u(), d(f(q), k({ trigger: "hover" }, B.value), {
|
|
81
81
|
title: g(() => [
|
|
82
82
|
I(e.$slots, "tooltip", { tags: e.list }, () => [
|
|
83
|
-
U(
|
|
83
|
+
U(E(L.value), 1)
|
|
84
84
|
])
|
|
85
85
|
]),
|
|
86
86
|
default: g(() => [
|
|
87
87
|
o("div", {
|
|
88
88
|
ref_key: "container",
|
|
89
|
-
ref:
|
|
90
|
-
class:
|
|
91
|
-
style:
|
|
89
|
+
ref: c,
|
|
90
|
+
class: _(M.value),
|
|
91
|
+
style: W({
|
|
92
92
|
pointerEvents: p.value ? "auto" : "none"
|
|
93
93
|
// opacity: isUpdating ? '0' : '1'
|
|
94
94
|
})
|
|
95
95
|
}, [
|
|
96
|
-
(
|
|
96
|
+
(u(!0), T(A, null, F(e.list, (s, l) => (u(), d(X, k({ ref_for: !0 }, s, {
|
|
97
97
|
key: l,
|
|
98
98
|
style: {
|
|
99
99
|
display: l >= m.value ? "none" : "inline-block",
|
|
100
100
|
marginRight: `${e.space}px`
|
|
101
101
|
}
|
|
102
102
|
}), null, 16, ["style"]))), 128)),
|
|
103
|
-
p.value && r.value.symbol === "icon" ? (
|
|
103
|
+
p.value && r.value.symbol === "icon" ? (u(), d(f(H), {
|
|
104
104
|
key: 0,
|
|
105
|
-
style:
|
|
105
|
+
style: W({
|
|
106
|
+
color: e.ellipsisColor || r.value.iconColor,
|
|
107
|
+
cursor: "pointer"
|
|
108
|
+
})
|
|
106
109
|
}, {
|
|
107
110
|
component: g(() => t[0] || (t[0] = [
|
|
108
111
|
o("svg", {
|
|
@@ -160,10 +163,11 @@ const ue = /* @__PURE__ */ D({
|
|
|
160
163
|
], -1)
|
|
161
164
|
])),
|
|
162
165
|
_: 1
|
|
163
|
-
}, 8, ["style"])) : p.value && r.value.symbol === "text" ? (
|
|
166
|
+
}, 8, ["style"])) : p.value && r.value.symbol === "text" ? (u(), T("span", {
|
|
164
167
|
key: 1,
|
|
165
|
-
class:
|
|
166
|
-
|
|
168
|
+
class: _(P.value),
|
|
169
|
+
style: { cursor: "pointer" }
|
|
170
|
+
}, E(r.value.text), 3)) : R("", !0)
|
|
167
171
|
], 6)
|
|
168
172
|
]),
|
|
169
173
|
_: 3
|
|
@@ -171,5 +175,5 @@ const ue = /* @__PURE__ */ D({
|
|
|
171
175
|
}
|
|
172
176
|
});
|
|
173
177
|
export {
|
|
174
|
-
|
|
178
|
+
ce as default
|
|
175
179
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as K, computed as c, ref as w, watch as x, nextTick as f, createElementBlock as i, openBlock as a, normalizeClass as n, unref as t, createVNode as b, withCtx as m, createElementVNode as S, normalizeStyle as y, renderSlot as H, createBlock as $, toDisplayString as u, resolveDynamicComponent as I, Fragment as C, renderList as W, createCommentVNode as L, createTextVNode as j } from "vue";
|
|
2
2
|
import { DownOutlined as J } from "@ant-design/icons-vue";
|
|
3
|
-
import { Alert as
|
|
4
|
-
import { ApActionItem as
|
|
3
|
+
import { Alert as P, Tooltip as Q } from "@aplus-frontend/antdv";
|
|
4
|
+
import { ApActionItem as U } from "../../ap-action/index.mjs";
|
|
5
5
|
import "../../config-provider/index.mjs";
|
|
6
|
-
import { isString as E } from "lodash-unified";
|
|
7
|
-
import { useLocale as
|
|
8
|
-
import { useNamespace as
|
|
9
|
-
import { useGlobalConfig as
|
|
10
|
-
const
|
|
6
|
+
import { isNil as X, isString as E } from "lodash-unified";
|
|
7
|
+
import { useLocale as Y } from "../../config-provider/hooks/use-locale.mjs";
|
|
8
|
+
import { useNamespace as Z } from "../../config-provider/hooks/use-namespace.mjs";
|
|
9
|
+
import { useGlobalConfig as _ } from "../../config-provider/hooks/use-global-config.mjs";
|
|
10
|
+
const ee = ["onClick"], de = /* @__PURE__ */ K({
|
|
11
11
|
__name: "ApExpandAlert",
|
|
12
12
|
props: {
|
|
13
13
|
type: { default: "warning" },
|
|
@@ -24,124 +24,143 @@ const Z = ["onClick"], ie = /* @__PURE__ */ W({
|
|
|
24
24
|
showIcon: { type: Boolean, default: !0 }
|
|
25
25
|
},
|
|
26
26
|
emits: ["choose", "expand"],
|
|
27
|
-
setup(
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
return
|
|
31
|
-
}), l =
|
|
27
|
+
setup(z, { expose: D, emit: V }) {
|
|
28
|
+
const A = V, p = z, { t: B } = Y(), M = c(() => {
|
|
29
|
+
if (p.type != "card")
|
|
30
|
+
return p.type;
|
|
31
|
+
}), l = w(""), d = w(null), R = c(() => ({
|
|
32
32
|
fontWeight: "400",
|
|
33
33
|
wordBreak: "break-all",
|
|
34
34
|
overflow: "hidden",
|
|
35
35
|
display: "-webkit-box",
|
|
36
36
|
webkitLineClamp: l.value,
|
|
37
|
-
webkitBoxOrient: "vertical"
|
|
37
|
+
webkitBoxOrient: "vertical",
|
|
38
|
+
lineHeight: "18px"
|
|
38
39
|
}));
|
|
39
|
-
function
|
|
40
|
-
l.value === "1" ? (l.value = "",
|
|
40
|
+
function q() {
|
|
41
|
+
l.value === "1" ? (l.value = "", A("expand", "expand")) : (l.value = "1", A("expand", "collapse"));
|
|
41
42
|
}
|
|
42
|
-
const
|
|
43
|
+
const F = c(() => l.value === "1" ? B("ap.apExpandAlert.expand") : B("ap.apExpandAlert.collapse")), h = w(!0), N = c(() => l.value !== "1");
|
|
43
44
|
function v(e) {
|
|
44
45
|
e ? l.value = "" : l.value = "1";
|
|
45
46
|
}
|
|
46
|
-
|
|
47
|
-
() =>
|
|
47
|
+
x(
|
|
48
|
+
() => p.data,
|
|
48
49
|
() => {
|
|
49
|
-
l.value = "",
|
|
50
|
-
if (
|
|
51
|
-
const e = Number(
|
|
52
|
-
parseInt(
|
|
50
|
+
l.value = "", f(() => {
|
|
51
|
+
if (d.value) {
|
|
52
|
+
const e = Number(d.value.clientHeight), s = Number(
|
|
53
|
+
parseInt(d.value.style.lineHeight)
|
|
53
54
|
);
|
|
54
|
-
e <
|
|
55
|
+
e < s * Number(p.rows) && N.value ? h.value = !1 : h.value = !0;
|
|
55
56
|
}
|
|
56
57
|
});
|
|
57
58
|
},
|
|
58
59
|
{
|
|
59
60
|
immediate: !0
|
|
60
61
|
}
|
|
61
|
-
),
|
|
62
|
-
() =>
|
|
62
|
+
), x(
|
|
63
|
+
() => p.defaultExpand,
|
|
63
64
|
(e) => {
|
|
64
|
-
e ?
|
|
65
|
+
e ? f(() => {
|
|
65
66
|
v(e);
|
|
66
|
-
}) :
|
|
67
|
+
}) : f(() => {
|
|
67
68
|
v(e);
|
|
68
69
|
});
|
|
69
70
|
},
|
|
70
71
|
{ immediate: !0 }
|
|
72
|
+
), x(
|
|
73
|
+
() => p.contentStyle,
|
|
74
|
+
(e) => {
|
|
75
|
+
X(e.lineHeight) || f(() => {
|
|
76
|
+
const s = document.querySelector(
|
|
77
|
+
`#${k} .ant-alert-action`
|
|
78
|
+
), r = document.querySelector(
|
|
79
|
+
`#${k} .ant-alert-icon`
|
|
80
|
+
);
|
|
81
|
+
console.log(s), s && s.setAttribute("style", `line-height: ${e.lineHeight}`), r && r.setAttribute("style", `line-height: ${e.lineHeight}`);
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
deep: !0,
|
|
86
|
+
immediate: !0,
|
|
87
|
+
flush: "post"
|
|
88
|
+
}
|
|
71
89
|
);
|
|
72
|
-
const { b:
|
|
73
|
-
return
|
|
90
|
+
const { b: T, e: o, m: O } = Z("ap-expand-alert"), k = `${T()}-key-${Date.now()}-${(Math.random() * 1e6).toFixed(0)}`, G = _("uiMode", "aplus");
|
|
91
|
+
return D({
|
|
74
92
|
setExpand: v
|
|
75
|
-
}), (e,
|
|
76
|
-
|
|
93
|
+
}), (e, s) => (a(), i("div", {
|
|
94
|
+
id: k,
|
|
95
|
+
class: n([t(T)(), `${t(O)(t(G))}`])
|
|
77
96
|
}, [
|
|
78
|
-
|
|
79
|
-
type:
|
|
97
|
+
b(t(P), {
|
|
98
|
+
type: M.value,
|
|
80
99
|
"show-icon": e.showIcon,
|
|
81
|
-
class:
|
|
100
|
+
class: n([t(o)("antAlert"), e.type == "card" ? "card-alert" : ""])
|
|
82
101
|
}, {
|
|
83
102
|
action: m(() => [
|
|
84
|
-
|
|
103
|
+
h.value ? (a(), $(t(U), {
|
|
85
104
|
key: 0,
|
|
86
105
|
size: "small",
|
|
87
106
|
style: { "font-size": "12px", "padding-left": "16px" },
|
|
88
|
-
onClick:
|
|
107
|
+
onClick: s[0] || (s[0] = (r) => q())
|
|
89
108
|
}, {
|
|
90
109
|
default: m(() => [
|
|
91
|
-
|
|
92
|
-
class:
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
class:
|
|
110
|
+
S("span", {
|
|
111
|
+
class: n(t(o)("expandText"))
|
|
112
|
+
}, u(F.value), 3),
|
|
113
|
+
b(t(J), {
|
|
114
|
+
class: n(N.value ? t(o)("expandIcon") : t(o)("collapseIcon"))
|
|
96
115
|
}, null, 8, ["class"])
|
|
97
116
|
]),
|
|
98
117
|
_: 1
|
|
99
118
|
})) : L("", !0)
|
|
100
119
|
]),
|
|
101
120
|
message: m(() => [
|
|
102
|
-
|
|
121
|
+
S("div", {
|
|
103
122
|
ref_key: "ellipsisBoxRef",
|
|
104
|
-
ref:
|
|
105
|
-
style:
|
|
106
|
-
class:
|
|
123
|
+
ref: d,
|
|
124
|
+
style: y({ ...R.value, ...e.contentStyle }),
|
|
125
|
+
class: n(t(o)("alertContent"))
|
|
107
126
|
}, [
|
|
108
|
-
|
|
109
|
-
t(E)(e.prefix) ? (a(),
|
|
127
|
+
H(e.$slots, "default", {}, () => [
|
|
128
|
+
t(E)(e.prefix) ? (a(), i("span", {
|
|
110
129
|
key: 0,
|
|
111
|
-
class:
|
|
112
|
-
style:
|
|
113
|
-
},
|
|
130
|
+
class: n(t(o)("prefix")),
|
|
131
|
+
style: y(e.prefixStyle)
|
|
132
|
+
}, u(e.prefix), 7)) : (a(), $(I(e.prefix), {
|
|
114
133
|
key: 1,
|
|
115
|
-
style:
|
|
134
|
+
style: y(e.prefixStyle)
|
|
116
135
|
}, null, 8, ["style"])),
|
|
117
|
-
t(E)(e.data) ? (a(),
|
|
136
|
+
t(E)(e.data) ? (a(), i("span", {
|
|
118
137
|
key: 2,
|
|
119
|
-
class:
|
|
120
|
-
},
|
|
121
|
-
|
|
138
|
+
class: n(t(o)("text"))
|
|
139
|
+
}, u(e.data), 3)) : (a(!0), i(C, { key: 3 }, W(e.data, (r, g) => (a(), i(C, { key: g }, [
|
|
140
|
+
b(t(Q), {
|
|
122
141
|
title: e.tipTitle ? e.tipTitle : null
|
|
123
142
|
}, {
|
|
124
143
|
default: m(() => [
|
|
125
|
-
|
|
126
|
-
record:
|
|
127
|
-
index:
|
|
144
|
+
H(e.$slots, "item", {
|
|
145
|
+
record: r,
|
|
146
|
+
index: g
|
|
128
147
|
}, () => [
|
|
129
|
-
|
|
130
|
-
class:
|
|
131
|
-
onClick: (
|
|
132
|
-
},
|
|
148
|
+
S("span", {
|
|
149
|
+
class: n(t(o)("showItem")),
|
|
150
|
+
onClick: (te) => e.$emit("choose", r)
|
|
151
|
+
}, u(e.mapLabel ? r[e.mapLabel] : r), 11, ee)
|
|
133
152
|
])
|
|
134
153
|
]),
|
|
135
154
|
_: 2
|
|
136
155
|
}, 1032, ["title"]),
|
|
137
|
-
|
|
156
|
+
g !== e.data.length - 1 ? (a(), i("span", {
|
|
138
157
|
key: 0,
|
|
139
|
-
class:
|
|
140
|
-
style:
|
|
158
|
+
class: n(t(o)("spliter")),
|
|
159
|
+
style: y(e.separatorStyle)
|
|
141
160
|
}, [
|
|
142
|
-
t(E)(e.separator) ? (a(),
|
|
143
|
-
|
|
144
|
-
], 64)) : (a(),
|
|
161
|
+
t(E)(e.separator) ? (a(), i(C, { key: 0 }, [
|
|
162
|
+
j(u(e.separator), 1)
|
|
163
|
+
], 64)) : (a(), $(I(e.separator), { key: 1 }))
|
|
145
164
|
], 6)) : L("", !0)
|
|
146
165
|
], 64))), 128))
|
|
147
166
|
])
|
|
@@ -153,5 +172,5 @@ const Z = ["onClick"], ie = /* @__PURE__ */ W({
|
|
|
153
172
|
}
|
|
154
173
|
});
|
|
155
174
|
export {
|
|
156
|
-
|
|
175
|
+
de as default
|
|
157
176
|
};
|