@yeepay/yee-boss-ui 0.1.16 → 0.1.18

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 (61) hide show
  1. package/README.md +124 -59
  2. package/dist/PlatformConfigProvider-BwqlDDcK.js +34 -0
  3. package/dist/YeeDescriptions-BZ33odSs.js +128 -0
  4. package/dist/YeeEllipsisText-CR94Jym2.js +100 -0
  5. package/dist/YeeFileUpload-DvRN1D-j.js +196 -0
  6. package/dist/YeePage-Dbvn1TNi.js +99 -0
  7. package/dist/YeeTabs-BPzlkZy6.js +891 -0
  8. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  9. package/dist/app-shell.d.ts +2 -0
  10. package/dist/app-shell.js +20 -0
  11. package/dist/components/app-shell/YeeAppShell.vue.d.ts +28 -0
  12. package/dist/components/app-shell/YeeHeader.vue.d.ts +40 -0
  13. package/dist/components/app-shell/YeeMenu.vue.d.ts +32 -0
  14. package/dist/components/app-shell/YeeSidebar.vue.d.ts +35 -0
  15. package/dist/components/app-shell/YeeTabs.vue.d.ts +69 -0
  16. package/dist/components/app-shell/index.d.ts +6 -0
  17. package/dist/components/app-shell/types.d.ts +258 -0
  18. package/dist/components/app-shell/use-tabs-drag.d.ts +7 -0
  19. package/dist/components/app-shell/use-tabs-scroll.d.ts +15 -0
  20. package/dist/components/grid/types.d.ts +1 -4
  21. package/dist/components/grid/vxe-init.d.ts +1 -1
  22. package/dist/components/modal/YeeModal.vue.d.ts +3 -3
  23. package/dist/context-C5gszWl6.js +4 -0
  24. package/dist/context-DJQ4f46a.js +12 -0
  25. package/dist/core.d.ts +8 -0
  26. package/dist/core.js +14 -0
  27. package/dist/descriptions.d.ts +1 -0
  28. package/dist/descriptions.js +4 -0
  29. package/dist/ellipsis-text.d.ts +1 -0
  30. package/dist/ellipsis-text.js +4 -0
  31. package/dist/file-upload.d.ts +1 -0
  32. package/dist/file-upload.js +4 -0
  33. package/dist/form-api-DbIL_dvg.js +201 -0
  34. package/dist/form.d.ts +1 -0
  35. package/dist/form.js +5 -0
  36. package/dist/grid.d.ts +1 -0
  37. package/dist/grid.js +5 -0
  38. package/dist/index-DZP16zRG.js +261 -0
  39. package/dist/index-kF3hvw2Z.js +132 -0
  40. package/dist/index.d.ts +2 -4
  41. package/dist/index.js +36 -2206
  42. package/dist/modal.d.ts +1 -0
  43. package/dist/modal.js +4 -0
  44. package/dist/page.d.ts +1 -0
  45. package/dist/page.js +4 -0
  46. package/dist/platform-message-BgD7E-34.js +22 -0
  47. package/dist/select.d.ts +1 -0
  48. package/dist/select.js +4 -0
  49. package/dist/style.css +1 -1
  50. package/dist/use-yee-grid-rYoenViE.js +464 -0
  51. package/package.json +68 -24
  52. package/dist/components/file-preview/YeeFilePreview.vue.d.ts +0 -23
  53. package/dist/components/file-preview/index.d.ts +0 -2
  54. package/dist/components/file-preview/source.d.ts +0 -8
  55. package/dist/components/file-preview/types.d.ts +0 -70
  56. package/dist/components/file-preview/useFilePreview.d.ts +0 -31
  57. package/dist/docx-preview.min-lCFRKxYn.js +0 -4852
  58. package/dist/marked.esm-DaHdfxOj.js +0 -1563
  59. package/dist/postal-mime-CPJ2QXsD.js +0 -3219
  60. package/dist/purify.es-HJ4qIUVZ.js +0 -869
  61. package/dist/xlsx-CF422ARu.js +0 -24728
@@ -0,0 +1,201 @@
1
+ import { defineComponent as I, shallowRef as r, computed as d, onMounted as U, nextTick as D, onBeforeUnmount as j, openBlock as i, createElementBlock as f, withModifiers as z, createElementVNode as h, Fragment as L, renderList as A, toDisplayString as w, renderSlot as G, createBlock as S, resolveDynamicComponent as K, mergeProps as $, createCommentVNode as R, createVNode as N, unref as v, withCtx as y, createTextVNode as g, reactive as q } from "vue";
2
+ import { TreeSelect as H, TimeRangePicker as J, TimePicker as Q, Textarea as W, Switch as X, Slider as Z, Select as ee, Segmented as te, Rate as oe, RangePicker as ne, RadioGroup as ae, Radio as se, Mentions as ie, InputPassword as le, InputNumber as ue, Input as re, DatePicker as ce, CheckboxGroup as me, Checkbox as pe, Cascader as de, AutoComplete as fe, Button as C } from "ant-design-vue";
3
+ import { Y as he } from "./YeeFileUpload-DvRN1D-j.js";
4
+ import { _ as ve } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
+ const ye = {
6
+ AutoComplete: fe,
7
+ Cascader: de,
8
+ Checkbox: pe,
9
+ CheckboxGroup: me,
10
+ DatePicker: ce,
11
+ Input: re,
12
+ InputNumber: ue,
13
+ InputPassword: le,
14
+ Mentions: ie,
15
+ Radio: se,
16
+ RadioGroup: ae,
17
+ RangePicker: ne,
18
+ Rate: oe,
19
+ Segmented: te,
20
+ Select: ee,
21
+ Slider: Z,
22
+ Switch: X,
23
+ Textarea: W,
24
+ TimePicker: Q,
25
+ TimeRangePicker: J,
26
+ TreeSelect: H,
27
+ Upload: he
28
+ }, ge = {
29
+ Checkbox: "checked",
30
+ Radio: "checked",
31
+ Switch: "checked",
32
+ Upload: "fileList"
33
+ }, Ce = { class: "yee-ui-form__label" }, be = { class: "yee-ui-form__actions" }, ke = /* @__PURE__ */ I({
34
+ name: "YeeForm",
35
+ __name: "YeeForm",
36
+ props: {
37
+ api: {},
38
+ onReset: { type: Function },
39
+ onSubmit: { type: Function },
40
+ options: {}
41
+ },
42
+ setup(l) {
43
+ const e = l, a = r(e.options.collapsed ?? !0), s = r(3), u = r(null);
44
+ let c;
45
+ e.api.configure(e.options);
46
+ const b = d(() => e.api.schema.value.filter((t) => !t.hide)), x = d(() => Math.max(1, e.options.collapsedRows ?? 1) * s.value), B = d(() => !e.options.showCollapseButton || !a.value ? b.value : b.value.slice(0, x.value));
47
+ function k() {
48
+ const t = u.value;
49
+ if (!t) return;
50
+ const n = getComputedStyle(t).gridTemplateColumns.split(" ").map((o) => o.trim()).filter(Boolean);
51
+ n.length > 0 && (s.value = n.length);
52
+ }
53
+ U(async () => {
54
+ await D(), k(), typeof ResizeObserver < "u" && u.value && (c = new ResizeObserver(k), c.observe(u.value));
55
+ }), j(() => {
56
+ c?.disconnect();
57
+ });
58
+ function V(t) {
59
+ return e.api.getFieldValue(t.fieldName);
60
+ }
61
+ function _(t) {
62
+ return t !== "Custom";
63
+ }
64
+ function M(t) {
65
+ return _(t.component) ? ye[t.component] : void 0;
66
+ }
67
+ function P(t) {
68
+ return _(t.component) ? ge[t.component] ?? "value" : "value";
69
+ }
70
+ function O(t) {
71
+ const n = V(t), o = P(t);
72
+ return {
73
+ ...t.componentProps,
74
+ ...n === void 0 ? {} : { [o]: n },
75
+ [`onUpdate:${o}`]: (p) => F(t, p)
76
+ };
77
+ }
78
+ function F(t, n) {
79
+ e.api.setFieldValue(
80
+ t.fieldName,
81
+ n
82
+ ), e.options.submitOnChange && m();
83
+ }
84
+ async function T() {
85
+ e.api.resetForm(), await e.onReset?.();
86
+ }
87
+ async function m() {
88
+ await e.onSubmit?.(e.api.getValues());
89
+ }
90
+ function Y(t) {
91
+ t.key === "Enter" && e.options.submitOnEnter && (t.preventDefault(), m());
92
+ }
93
+ function E() {
94
+ a.value = !a.value, e.options.handleCollapsedChange?.(a.value);
95
+ }
96
+ return (t, n) => (i(), f("form", {
97
+ class: "yee-ui-form",
98
+ onKeydown: Y,
99
+ onSubmit: z(m, ["prevent"])
100
+ }, [
101
+ h("div", {
102
+ ref_key: "fieldsElement",
103
+ ref: u,
104
+ class: "yee-ui-form__fields"
105
+ }, [
106
+ (i(!0), f(L, null, A(B.value, (o) => (i(), f("label", {
107
+ key: o.fieldName,
108
+ class: "yee-ui-form__field"
109
+ }, [
110
+ h("span", Ce, w(o.label), 1),
111
+ G(t.$slots, o.fieldName, {
112
+ field: o,
113
+ setValue: (p) => F(o, p),
114
+ value: V(o),
115
+ values: l.api.getValues()
116
+ }, () => [
117
+ o.component !== "Custom" ? (i(), S(K(M(o)), $({
118
+ key: 0,
119
+ ref_for: !0
120
+ }, O(o)), null, 16)) : R("", !0)
121
+ ], !0)
122
+ ]))), 128))
123
+ ], 512),
124
+ h("div", be, [
125
+ N(v(C), {
126
+ "html-type": "button",
127
+ onClick: T
128
+ }, {
129
+ default: y(() => [...n[0] || (n[0] = [
130
+ g(" 重置 ", -1)
131
+ ])]),
132
+ _: 1
133
+ }),
134
+ N(v(C), {
135
+ type: "primary",
136
+ "html-type": "submit"
137
+ }, {
138
+ default: y(() => [...n[1] || (n[1] = [
139
+ g(" 查询 ", -1)
140
+ ])]),
141
+ _: 1
142
+ }),
143
+ l.options.showCollapseButton ? (i(), S(v(C), {
144
+ key: 0,
145
+ type: "link",
146
+ "html-type": "button",
147
+ onClick: E
148
+ }, {
149
+ default: y(() => [
150
+ g(w(a.value ? "展开" : "收起"), 1)
151
+ ]),
152
+ _: 1
153
+ })) : R("", !0)
154
+ ])
155
+ ], 32));
156
+ }
157
+ }), Se = /* @__PURE__ */ ve(ke, [["__scopeId", "data-v-13cadc25"]]);
158
+ class Re {
159
+ /** 当前表单 Schema,由组件初始化,可通过 updateSchema 动态更新。 */
160
+ schema = r([]);
161
+ initialValues = {};
162
+ values = q({});
163
+ /** @internal 使用配置初始化 Schema 和字段值。 */
164
+ configure(e) {
165
+ this.schema.value = e.schema.map((a) => ({ ...a })), this.initialValues = { ...e.initialValues }, this.resetForm();
166
+ }
167
+ /** 获取指定字段值,并保留 TValues 中声明的字段类型。 */
168
+ getFieldValue(e) {
169
+ return this.values[e];
170
+ }
171
+ /** 获取当前全部字段值的浅拷贝。 */
172
+ getValues() {
173
+ return { ...this.values };
174
+ }
175
+ /** 将字段值恢复为 initialValues。 */
176
+ resetForm() {
177
+ for (const e of Object.keys(this.values))
178
+ delete this.values[e];
179
+ Object.assign(this.values, this.initialValues);
180
+ }
181
+ /** 设置指定字段值,字段名和值必须与 TValues 保持一致。 */
182
+ setFieldValue(e, a) {
183
+ this.values[e] = a;
184
+ }
185
+ /** 批量更新已声明字段的值。 */
186
+ setValues(e) {
187
+ Object.assign(this.values, e);
188
+ }
189
+ /** 按字段名动态更新 Schema。 */
190
+ updateSchema(e) {
191
+ const a = new Map(e.map((s) => [s.fieldName, s]));
192
+ this.schema.value = this.schema.value.map((s) => ({
193
+ ...s,
194
+ ...a.get(s.fieldName)
195
+ }));
196
+ }
197
+ }
198
+ export {
199
+ Se as Y,
200
+ Re as a
201
+ };
package/dist/form.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './components/form';
package/dist/form.js ADDED
@@ -0,0 +1,5 @@
1
+ import { Y as r, a } from "./form-api-DbIL_dvg.js";
2
+ export {
3
+ r as YeeForm,
4
+ a as YeeFormApi
5
+ };
package/dist/grid.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './components/grid';
package/dist/grid.js ADDED
@@ -0,0 +1,5 @@
1
+ import { Y as i, u as s } from "./use-yee-grid-rYoenViE.js";
2
+ export {
3
+ i as YeeGridApi,
4
+ s as useYeeGrid
5
+ };
@@ -0,0 +1,261 @@
1
+ import { defineComponent as q, useModel as I, useAttrs as G, useSlots as J, useId as K, computed as d, openBlock as a, createBlock as s, unref as t, mergeProps as $, createSlots as D, withCtx as o, createElementVNode as n, renderSlot as f, createTextVNode as h, toDisplayString as y, createCommentVNode as r, createElementBlock as C, createVNode as v, mergeModels as F, h as Q } from "vue";
2
+ import { FullscreenExitOutlined as R, FullscreenOutlined as U, CloseOutlined as X } from "@ant-design/icons-vue";
3
+ import { Drawer as Z, Button as u, Modal as ee, Tooltip as te } from "ant-design-vue";
4
+ import { _ as oe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
+ const le = { class: "yee-ui-modal__header" }, ae = ["id"], se = { class: "yee-ui-modal__title" }, ne = {
6
+ key: 1,
7
+ class: "yee-ui-modal__header-actions"
8
+ }, re = { class: "yee-ui-modal__body" }, de = { class: "yee-ui-modal__footer" }, ie = { class: "yee-ui-modal__header" }, ue = ["id"], ce = { class: "yee-ui-modal__title" }, fe = { class: "yee-ui-modal__header-actions" }, ye = { class: "yee-ui-modal__body" }, pe = { class: "yee-ui-modal__footer" }, me = /* @__PURE__ */ q({
9
+ inheritAttrs: !1,
10
+ name: "YeeModal",
11
+ __name: "YeeModal",
12
+ props: /* @__PURE__ */ F({
13
+ cancelButtonText: { default: "取消" },
14
+ centered: { type: Boolean, default: !1 },
15
+ closable: { type: Boolean, default: !0 },
16
+ confirmButtonLoading: { type: Boolean, default: !1 },
17
+ confirmButtonText: { default: "确认" },
18
+ destroyOnClose: { type: Boolean, default: !0 },
19
+ fullscreen: { type: Boolean, default: !1 },
20
+ fullscreenButton: { type: Boolean, default: !0 },
21
+ keyboard: { type: Boolean, default: !1 },
22
+ maskClosable: { type: Boolean, default: !1 },
23
+ open: { type: Boolean },
24
+ showCancelButton: { type: Boolean, default: !0 },
25
+ showConfirmButton: { type: Boolean, default: !0 },
26
+ style: { type: [Boolean, null, String, Object, Array] },
27
+ title: { default: "" },
28
+ type: { default: "modal" },
29
+ width: { default: 520 },
30
+ wrapProps: {}
31
+ }, {
32
+ open: { type: Boolean, default: !1 },
33
+ openModifiers: {}
34
+ }),
35
+ emits: /* @__PURE__ */ F(["cancel", "close", "confirm", "update:fullscreen"], ["update:open"]),
36
+ setup(g, { emit: L }) {
37
+ const e = g, k = L, B = I(g, "open"), b = I(e, "fullscreen"), m = G(), M = J(), w = K(), x = d(() => e.type === "drawer"), i = d(() => !x.value && b.value), p = d(() => !!(e.title || M.header)), Y = d(() => p.value || e.closable), E = d(() => p.value || e.fullscreenButton || e.closable), O = d(() => i.value ? "退出全屏" : "进入全屏"), H = d(() => {
38
+ const l = Object.prototype.hasOwnProperty.call(e.wrapProps ?? {}, "aria-labelledby");
39
+ return {
40
+ ...e.wrapProps,
41
+ "aria-labelledby": l ? e.wrapProps?.["aria-labelledby"] : p.value ? w : void 0
42
+ };
43
+ }), N = d(() => {
44
+ if (i.value)
45
+ return {
46
+ height: "100%",
47
+ margin: 0,
48
+ maxWidth: "100vw",
49
+ paddingBottom: 0,
50
+ top: 0,
51
+ width: "100vw"
52
+ };
53
+ });
54
+ function T() {
55
+ const { style: l, ..._ } = m;
56
+ return _;
57
+ }
58
+ function V() {
59
+ return [m.style, e.style].filter(Boolean);
60
+ }
61
+ function z() {
62
+ return [m.style, e.style, N.value].filter(Boolean);
63
+ }
64
+ const A = () => M.closeIcon?.() ?? m.closeIcon ?? Q(X);
65
+ function c(l) {
66
+ k("cancel", l), B.value = !1;
67
+ }
68
+ function S(l) {
69
+ k("confirm", l);
70
+ }
71
+ function P() {
72
+ k("close");
73
+ }
74
+ function j() {
75
+ b.value = !b.value;
76
+ }
77
+ return (l, _) => x.value ? (a(), s(t(Z), $({ key: 0 }, T(), {
78
+ class: "yee-ui-modal-drawer",
79
+ closable: !1,
80
+ "destroy-on-close": e.destroyOnClose,
81
+ keyboard: e.keyboard,
82
+ "mask-closable": e.maskClosable,
83
+ open: B.value,
84
+ style: V(),
85
+ width: e.width,
86
+ onAfterOpenChange: _[0] || (_[0] = (W) => !W && P()),
87
+ onClose: c
88
+ }), D({
89
+ footer: o(() => [
90
+ n("div", de, [
91
+ f(l.$slots, "footer", {}, () => [
92
+ e.showCancelButton ? (a(), s(t(u), {
93
+ key: 0,
94
+ onClick: c
95
+ }, {
96
+ default: o(() => [
97
+ h(y(e.cancelButtonText), 1)
98
+ ]),
99
+ _: 1
100
+ })) : r("", !0),
101
+ e.showConfirmButton ? (a(), s(t(u), {
102
+ key: 1,
103
+ loading: e.confirmButtonLoading,
104
+ type: "primary",
105
+ onClick: S
106
+ }, {
107
+ default: o(() => [
108
+ h(y(e.confirmButtonText), 1)
109
+ ]),
110
+ _: 1
111
+ }, 8, ["loading"])) : r("", !0)
112
+ ], !0)
113
+ ])
114
+ ]),
115
+ default: o(() => [
116
+ n("div", re, [
117
+ f(l.$slots, "default", {}, void 0, !0)
118
+ ])
119
+ ]),
120
+ _: 2
121
+ }, [
122
+ Y.value ? {
123
+ name: "title",
124
+ fn: o(() => [
125
+ n("div", le, [
126
+ p.value ? (a(), C("div", {
127
+ key: 0,
128
+ id: t(w),
129
+ class: "yee-ui-modal__heading"
130
+ }, [
131
+ f(l.$slots, "header", {}, () => [
132
+ n("span", se, y(e.title), 1)
133
+ ], !0)
134
+ ], 8, ae)) : r("", !0),
135
+ e.closable ? (a(), C("div", ne, [
136
+ v(t(u), {
137
+ "aria-label": "关闭",
138
+ class: "yee-ui-modal__header-action",
139
+ size: "small",
140
+ type: "text",
141
+ onClick: c
142
+ }, {
143
+ default: o(() => [
144
+ v(A)
145
+ ]),
146
+ _: 1
147
+ })
148
+ ])) : r("", !0)
149
+ ])
150
+ ]),
151
+ key: "0"
152
+ } : void 0
153
+ ]), 1040, ["destroy-on-close", "keyboard", "mask-closable", "open", "style", "width"])) : (a(), s(t(ee), $({ key: 1 }, T(), {
154
+ centered: i.value ? !1 : e.centered,
155
+ class: {
156
+ "yee-ui-modal": !0,
157
+ "yee-ui-modal--fullscreen": i.value
158
+ },
159
+ closable: !1,
160
+ "destroy-on-close": e.destroyOnClose,
161
+ keyboard: e.keyboard,
162
+ "mask-closable": e.maskClosable,
163
+ open: B.value,
164
+ style: z(),
165
+ width: i.value ? "100vw" : e.width,
166
+ "wrap-props": H.value,
167
+ onAfterClose: P,
168
+ onCancel: c
169
+ }), D({
170
+ footer: o(() => [
171
+ n("div", pe, [
172
+ f(l.$slots, "footer", {}, () => [
173
+ e.showCancelButton ? (a(), s(t(u), {
174
+ key: 0,
175
+ onClick: c
176
+ }, {
177
+ default: o(() => [
178
+ h(y(e.cancelButtonText), 1)
179
+ ]),
180
+ _: 1
181
+ })) : r("", !0),
182
+ e.showConfirmButton ? (a(), s(t(u), {
183
+ key: 1,
184
+ loading: e.confirmButtonLoading,
185
+ type: "primary",
186
+ onClick: S
187
+ }, {
188
+ default: o(() => [
189
+ h(y(e.confirmButtonText), 1)
190
+ ]),
191
+ _: 1
192
+ }, 8, ["loading"])) : r("", !0)
193
+ ], !0)
194
+ ])
195
+ ]),
196
+ default: o(() => [
197
+ n("div", ye, [
198
+ f(l.$slots, "default", {}, void 0, !0)
199
+ ])
200
+ ]),
201
+ _: 2
202
+ }, [
203
+ E.value ? {
204
+ name: "title",
205
+ fn: o(() => [
206
+ n("div", ie, [
207
+ p.value ? (a(), C("div", {
208
+ key: 0,
209
+ id: t(w),
210
+ class: "yee-ui-modal__heading"
211
+ }, [
212
+ f(l.$slots, "header", {}, () => [
213
+ n("span", ce, y(e.title), 1)
214
+ ], !0)
215
+ ], 8, ue)) : r("", !0),
216
+ n("div", fe, [
217
+ e.fullscreenButton ? (a(), s(t(te), {
218
+ key: 0,
219
+ title: O.value
220
+ }, {
221
+ default: o(() => [
222
+ v(t(u), {
223
+ "aria-label": O.value,
224
+ "aria-pressed": i.value,
225
+ class: "yee-ui-modal__header-action",
226
+ size: "small",
227
+ type: "text",
228
+ onClick: j
229
+ }, {
230
+ default: o(() => [
231
+ i.value ? (a(), s(t(R), { key: 0 })) : (a(), s(t(U), { key: 1 }))
232
+ ]),
233
+ _: 1
234
+ }, 8, ["aria-label", "aria-pressed"])
235
+ ]),
236
+ _: 1
237
+ }, 8, ["title"])) : r("", !0),
238
+ e.closable ? (a(), s(t(u), {
239
+ key: 1,
240
+ "aria-label": "关闭",
241
+ class: "yee-ui-modal__header-action",
242
+ size: "small",
243
+ type: "text",
244
+ onClick: c
245
+ }, {
246
+ default: o(() => [
247
+ v(A)
248
+ ]),
249
+ _: 1
250
+ })) : r("", !0)
251
+ ])
252
+ ])
253
+ ]),
254
+ key: "0"
255
+ } : void 0
256
+ ]), 1040, ["centered", "class", "destroy-on-close", "keyboard", "mask-closable", "open", "style", "width", "wrap-props"]));
257
+ }
258
+ }), _e = /* @__PURE__ */ oe(me, [["__scopeId", "data-v-7424b0ee"]]), be = _e;
259
+ export {
260
+ be as Y
261
+ };
@@ -0,0 +1,132 @@
1
+ import { defineComponent as F, useModel as G, useSlots as H, useAttrs as J, useTemplateRef as K, shallowRef as Q, computed as n, openBlock as y, createBlock as S, unref as d, mergeProps as g, withCtx as u, createElementVNode as N, normalizeStyle as W, normalizeClass as X, createSlots as O, createVNode as Z, toDisplayString as ee, renderList as A, renderSlot as R, normalizeProps as Y, guardReactiveProps as x, mergeModels as te } from "vue";
2
+ import { Tooltip as j, Select as oe } from "ant-design-vue";
3
+ import { _ as ne } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ const le = { class: "yee-ui-select__option-label" }, se = /* @__PURE__ */ F({
5
+ inheritAttrs: !1,
6
+ name: "YeeSelect",
7
+ __name: "YeeSelect",
8
+ props: /* @__PURE__ */ te({
9
+ fieldNames: {},
10
+ options: {}
11
+ }, {
12
+ value: {},
13
+ valueModifiers: {}
14
+ }),
15
+ emits: ["update:value"],
16
+ setup(c, { expose: z }) {
17
+ const h = oe, s = c, i = G(c, "value"), p = H(), f = J(), v = K("select"), C = Q(!1), l = n(() => ({
18
+ label: s.fieldNames?.label ?? "label",
19
+ options: s.fieldNames?.options ?? "options",
20
+ value: s.fieldNames?.value ?? "value"
21
+ })), B = n(() => f.class), M = n(() => f.style), w = n(() => {
22
+ const e = {};
23
+ for (const [t, o] of Object.entries(f))
24
+ t !== "class" && t !== "style" && t !== "onDropdownVisibleChange" && (e[t] = o);
25
+ return e;
26
+ }), P = n(() => !p.default && !p.option), V = n(() => Object.keys(p)), $ = n(() => V.value.filter(
27
+ (e) => e !== "default" && e !== "option"
28
+ ));
29
+ function E(e) {
30
+ const t = f.onDropdownVisibleChange;
31
+ if (typeof t == "function") {
32
+ t(e);
33
+ return;
34
+ }
35
+ t?.forEach((o) => o?.(e));
36
+ }
37
+ function D(e) {
38
+ C.value = e, E(e);
39
+ }
40
+ function a(e) {
41
+ return typeof e == "number" || typeof e == "string" ? String(e) : "";
42
+ }
43
+ function m(e, t) {
44
+ if (e)
45
+ for (const o of e) {
46
+ const r = o[l.value.options], _ = m(r, t);
47
+ if (_) return _;
48
+ const k = o[l.value.value];
49
+ if (k === t || String(k) === String(t)) return o;
50
+ }
51
+ }
52
+ function b(e) {
53
+ return e ? a(e[l.value.label]) || a(e.title) || a(e[l.value.value]) : "";
54
+ }
55
+ const L = n(() => {
56
+ const e = i.value;
57
+ if (!(e == null || e === ""))
58
+ return Array.isArray(e) ? e.map((t) => b(m(s.options, t)) || a(t)).filter(Boolean).join("、") || void 0 : b(m(s.options, e)) || a(e) || void 0;
59
+ });
60
+ function T(e) {
61
+ return b(e);
62
+ }
63
+ function U() {
64
+ v.value?.blur();
65
+ }
66
+ function I() {
67
+ v.value?.focus();
68
+ }
69
+ function q(...e) {
70
+ v.value?.scrollTo(...e);
71
+ }
72
+ return z({ blur: U, focus: I, scrollTo: q }), (e, t) => (y(), S(d(j), g(C.value ? { open: !1 } : {}, { title: L.value }), {
73
+ default: u(() => [
74
+ N("div", {
75
+ class: X(["yee-ui-select", B.value]),
76
+ style: W(M.value)
77
+ }, [
78
+ P.value ? (y(), S(d(h), g({
79
+ key: 0,
80
+ ref: "select",
81
+ value: i.value,
82
+ "onUpdate:value": t[0] || (t[0] = (o) => i.value = o)
83
+ }, w.value, {
84
+ "field-names": l.value,
85
+ options: c.options,
86
+ onDropdownVisibleChange: D
87
+ }), O({
88
+ option: u((o) => [
89
+ Z(d(j), {
90
+ title: T(o),
91
+ placement: "left"
92
+ }, {
93
+ default: u(() => [
94
+ N("span", le, ee(T(o)), 1)
95
+ ]),
96
+ _: 2
97
+ }, 1032, ["title"])
98
+ ]),
99
+ _: 2
100
+ }, [
101
+ A($.value, (o) => ({
102
+ name: o,
103
+ fn: u((r) => [
104
+ R(e.$slots, o, Y(x(r)), void 0, !0)
105
+ ])
106
+ }))
107
+ ]), 1040, ["value", "field-names", "options"])) : (y(), S(d(h), g({
108
+ key: 1,
109
+ ref: "select",
110
+ value: i.value,
111
+ "onUpdate:value": t[1] || (t[1] = (o) => i.value = o)
112
+ }, w.value, {
113
+ "field-names": l.value,
114
+ options: c.options,
115
+ onDropdownVisibleChange: D
116
+ }), O({ _: 2 }, [
117
+ A(V.value, (o) => ({
118
+ name: o,
119
+ fn: u((r) => [
120
+ R(e.$slots, o, Y(x(r)), void 0, !0)
121
+ ])
122
+ }))
123
+ ]), 1040, ["value", "field-names", "options"]))
124
+ ], 6)
125
+ ]),
126
+ _: 3
127
+ }, 16, ["title"]));
128
+ }
129
+ }), ie = /* @__PURE__ */ ne(se, [["__scopeId", "data-v-8acc9d8f"]]), ce = ie;
130
+ export {
131
+ ce as Y
132
+ };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,8 @@
1
- export * from './constants';
2
- export { default as PlatformConfigProvider } from './components/PlatformConfigProvider.vue';
3
- export type { PlatformConfigProviderProps, PlatformConfigProviderSlots, } from './components/platform-config-provider/types';
1
+ export * from './core';
4
2
  export * from './components/descriptions';
5
3
  export * from './components/ellipsis-text';
4
+ export * from './components/app-shell';
6
5
  export * from './components/file-upload';
7
- export * from './components/file-preview';
8
6
  export * from './components/form';
9
7
  export * from './components/grid';
10
8
  export * from './components/modal';