@qynpm/ui 1.0.23 → 1.0.24

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 (130) hide show
  1. package/README.md +222 -48
  2. package/dist/index.cjs +15 -5
  3. package/dist/index.mjs +50 -33
  4. package/dist/qy-action-bar/index.cjs +1 -1
  5. package/dist/qy-action-bar/index.mjs +1 -1
  6. package/dist/qy-button/index.cjs +1 -1
  7. package/dist/qy-button/index.mjs +1 -1
  8. package/dist/qy-checkbox/index.cjs +1 -1
  9. package/dist/qy-checkbox/index.mjs +4 -3
  10. package/dist/qy-checkbox-group/index.cjs +1 -0
  11. package/dist/qy-checkbox-group/index.mjs +7 -0
  12. package/dist/qy-date-picker/index.cjs +1 -1
  13. package/dist/qy-date-picker/index.mjs +4 -3
  14. package/dist/qy-dialog/index.cjs +1 -1
  15. package/dist/qy-dialog/index.mjs +2 -2
  16. package/dist/qy-dropdown/index.cjs +1 -1
  17. package/dist/qy-dropdown/index.mjs +1 -1
  18. package/dist/qy-file-picker/index.cjs +1 -0
  19. package/dist/qy-file-picker/index.mjs +7 -0
  20. package/dist/qy-form-section/index.cjs +1 -1
  21. package/dist/qy-form-section/index.mjs +1 -1
  22. package/dist/qy-image/index.cjs +1 -1
  23. package/dist/qy-image/index.mjs +1 -1
  24. package/dist/qy-image-upload/index.cjs +1 -1
  25. package/dist/qy-image-upload/index.mjs +1 -1
  26. package/dist/qy-input/index.cjs +2 -2
  27. package/dist/qy-input/index.mjs +6 -3
  28. package/dist/qy-input-number/index.cjs +1 -1
  29. package/dist/qy-input-number/index.mjs +4 -3
  30. package/dist/qy-legacy-selection-dialog/index.cjs +1 -1
  31. package/dist/qy-legacy-selection-dialog/index.mjs +2 -2
  32. package/dist/qy-menu-actions/index.cjs +1 -1
  33. package/dist/qy-menu-actions/index.mjs +1 -1
  34. package/dist/qy-money-input/index.cjs +1 -1
  35. package/dist/qy-money-input/index.mjs +2 -2
  36. package/dist/qy-popover/index.cjs +2 -0
  37. package/dist/qy-popover/index.mjs +8 -0
  38. package/dist/qy-radio/index.cjs +1 -0
  39. package/dist/qy-radio/index.mjs +7 -0
  40. package/dist/qy-radio-group/index.cjs +1 -1
  41. package/dist/qy-radio-group/index.mjs +5 -2
  42. package/dist/qy-record-quote-search/index.cjs +1 -1
  43. package/dist/qy-record-quote-search/index.mjs +1 -1
  44. package/dist/qy-remark-image/index.cjs +1 -1
  45. package/dist/qy-remark-image/index.mjs +2 -2
  46. package/dist/qy-remote-select/index.cjs +1 -1
  47. package/dist/qy-remote-select/index.mjs +1 -1
  48. package/dist/qy-search-input/index.cjs +1 -1
  49. package/dist/qy-search-input/index.mjs +2 -2
  50. package/dist/qy-select/index.cjs +1 -1
  51. package/dist/qy-select/index.mjs +4 -3
  52. package/dist/qy-selection-dialog/index.cjs +1 -1
  53. package/dist/qy-selection-dialog/index.mjs +1 -1
  54. package/dist/qy-switch/index.cjs +1 -0
  55. package/dist/qy-switch/index.mjs +7 -0
  56. package/dist/qy-table-column-settings/index.cjs +1 -1
  57. package/dist/qy-table-column-settings/index.mjs +1 -1
  58. package/dist/qy-tag/index.cjs +1 -0
  59. package/dist/qy-tag/index.mjs +7 -0
  60. package/dist/qy-tooltip/index.cjs +2 -0
  61. package/dist/qy-tooltip/index.mjs +8 -0
  62. package/dist/qy-upload/index.cjs +1 -1
  63. package/dist/qy-upload/index.mjs +1 -1
  64. package/dist/shared/index-8u4DJZwd.mjs +90 -0
  65. package/dist/shared/index-9WJeVamR.cjs +1 -0
  66. package/dist/shared/index-BDFscU3G.mjs +72 -0
  67. package/dist/shared/index-BYme5QGm.cjs +1 -0
  68. package/dist/shared/index-B_mI-37S.cjs +1 -0
  69. package/dist/shared/index-BrV6CR4H.mjs +54 -0
  70. package/dist/shared/index-C8CA7nkO.cjs +1 -0
  71. package/dist/shared/index-CTtAQ1LD.cjs +1 -0
  72. package/dist/shared/index-CczrP1H7.mjs +149 -0
  73. package/dist/shared/index-ClmefDi6.cjs +1 -0
  74. package/dist/shared/{index-D7lMppIb.mjs → index-DJnmpqCc.mjs} +63 -63
  75. package/dist/shared/index-DYohs_aV.mjs +225 -0
  76. package/dist/shared/index-DixSXWJj.mjs +68 -0
  77. package/dist/shared/index-aiJ7R6G-.cjs +1 -0
  78. package/dist/shared/{index-ZLoAI88M.mjs → index-c7lnX4vT.mjs} +1327 -1389
  79. package/dist/shared/index-dEWJKTS-.cjs +1 -0
  80. package/dist/shared/index-fBuu4V3A.mjs +129 -0
  81. package/dist/shared/index-wIXCDvwC.cjs +1 -0
  82. package/dist/shared/index.vue_vue_type_script_setup_true_lang-BF82tses.cjs +1 -0
  83. package/dist/shared/index.vue_vue_type_script_setup_true_lang-BNjoxcAR.mjs +61 -0
  84. package/dist/shared/index.vue_vue_type_script_setup_true_lang-DmmW8UUK.mjs +106 -0
  85. package/dist/shared/index.vue_vue_type_script_setup_true_lang-tyM4_aoa.cjs +1 -0
  86. package/dist/shared/index.vue_vue_type_style_index_0_lang-1cTut9Ql.cjs +1 -0
  87. package/dist/shared/index.vue_vue_type_style_index_0_lang-BZQLyvw8.cjs +1 -0
  88. package/dist/shared/index.vue_vue_type_style_index_0_lang-BtbAft4t.cjs +1 -0
  89. package/dist/shared/index.vue_vue_type_style_index_0_lang-CJhIFeBC.mjs +166 -0
  90. package/dist/shared/index.vue_vue_type_style_index_0_lang-DSur831A.mjs +68 -0
  91. package/dist/shared/index.vue_vue_type_style_index_0_lang-DVqGYfD9.mjs +132 -0
  92. package/dist/shared/index.vue_vue_type_style_index_0_lang-Dm1r1WBK.cjs +1 -0
  93. package/dist/shared/index.vue_vue_type_style_index_0_lang-Q2gFF0PP.cjs +1 -0
  94. package/dist/shared/index.vue_vue_type_style_index_0_lang-aqtfjdVm.mjs +140 -0
  95. package/dist/shared/index.vue_vue_type_style_index_0_lang-ztD-It-2.mjs +121 -0
  96. package/index.d.ts +155 -17
  97. package/package.json +43 -1
  98. package/qy-checkbox/index.d.ts +42 -2
  99. package/qy-checkbox-group/index.d.ts +48 -0
  100. package/qy-date-picker/index.d.ts +140 -5
  101. package/qy-file-picker/index.d.ts +49 -0
  102. package/qy-input/index.d.ts +50 -5
  103. package/qy-input-number/index.d.ts +45 -5
  104. package/qy-popover/index.d.ts +63 -0
  105. package/qy-radio/index.d.ts +44 -0
  106. package/qy-radio-group/index.d.ts +60 -12
  107. package/qy-select/index.d.ts +67 -5
  108. package/qy-switch/index.d.ts +46 -0
  109. package/qy-tag/index.d.ts +44 -0
  110. package/qy-tooltip/index.d.ts +54 -0
  111. package/dist/shared/index-B3U7dqMt.cjs +0 -1
  112. package/dist/shared/index-BbpD7hM0.cjs +0 -1
  113. package/dist/shared/index-D3l7tLgw.cjs +0 -1
  114. package/dist/shared/index-NCpeoBUZ.mjs +0 -153
  115. package/dist/shared/index.vue_vue_type_script_setup_true_lang-BJakDlgd.mjs +0 -70
  116. package/dist/shared/index.vue_vue_type_script_setup_true_lang-CelW13DE.cjs +0 -1
  117. package/dist/shared/index.vue_vue_type_script_setup_true_lang-DA1Nh7U1.mjs +0 -130
  118. package/dist/shared/index.vue_vue_type_script_setup_true_lang-DEpXmMj5.mjs +0 -162
  119. package/dist/shared/index.vue_vue_type_script_setup_true_lang-DNEVwqm7.cjs +0 -1
  120. package/dist/shared/index.vue_vue_type_script_setup_true_lang-DfKTEci_.cjs +0 -1
  121. package/dist/shared/index.vue_vue_type_script_setup_true_lang-gTkP1LWg.mjs +0 -61
  122. package/dist/shared/index.vue_vue_type_script_setup_true_lang-svvSFv2K.cjs +0 -1
  123. package/dist/shared/index.vue_vue_type_style_index_0_lang-B_A4Nq6v.cjs +0 -1
  124. package/dist/shared/index.vue_vue_type_style_index_0_lang-DKFiK2fQ.mjs +0 -152
  125. /package/dist/shared/{index-CagHZ25z.mjs → index-BYLXkIxS.mjs} +0 -0
  126. /package/dist/shared/{index-CRZsiNVW.cjs → index-C1p86ezL.cjs} +0 -0
  127. /package/dist/shared/{index-BO5aWk3f.cjs → index-ClUqUsAv.cjs} +0 -0
  128. /package/dist/shared/{index-CSxCewXP.mjs → index-Cy_Glkc-.mjs} +0 -0
  129. /package/dist/shared/{index-BXlQSIWX.mjs → index-DMGXEAyl.mjs} +0 -0
  130. /package/dist/shared/{index-DyK6vf5h.cjs → index-M4vEHYZ_.cjs} +0 -0
@@ -1,16 +1,17 @@
1
- import { ElDialog as G, ElTable as H, ElTableColumn as J, ElInput as M, ElSwitch as O, ElButton as P } from "element-plus/es";
2
- import { defineComponent as X, ref as S, watch as Y, computed as $, openBlock as C, createBlock as B, withCtx as i, createElementVNode as l, createVNode as o, normalizeClass as Z, toDisplayString as E, createElementBlock as T, createCommentVNode as I, createTextVNode as D } from "vue";
3
- import { _ as ee } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
4
- const te = { class: "qy-table-column-settings" }, le = { class: "qy-table-column-settings__table-wrap" }, ne = ["data-testid", "onClick"], se = {
1
+ import { ElDialog as A, ElTable as G, ElTableColumn as H, ElInput as J, ElButton as M } from "element-plus/es";
2
+ import { defineComponent as O, ref as S, watch as P, computed as $, openBlock as C, createBlock as B, withCtx as i, createElementVNode as l, createVNode as o, normalizeClass as X, toDisplayString as T, createElementBlock as E, createCommentVNode as Y, createTextVNode as D } from "vue";
3
+ import { S as Z } from "./index-DixSXWJj.mjs";
4
+ import { _ as I } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
5
+ const ee = { class: "qy-table-column-settings" }, te = { class: "qy-table-column-settings__table-wrap" }, le = ["data-testid", "onClick"], ne = {
5
6
  class: "qy-table-column-settings__side",
6
7
  "data-testid": "settings-side-actions"
7
- }, ae = { class: "qy-table-column-settings__side-main" }, ie = {
8
+ }, ae = { class: "qy-table-column-settings__side-main" }, se = {
8
9
  key: 0,
9
10
  class: "qy-table-column-settings__selected is-empty"
10
- }, oe = {
11
+ }, ie = {
11
12
  key: 1,
12
13
  class: "qy-table-column-settings__selected"
13
- }, ue = { class: "qy-table-column-settings__side-footer" }, de = /* @__PURE__ */ X({
14
+ }, oe = { class: "qy-table-column-settings__side-footer" }, ue = /* @__PURE__ */ O({
14
15
  name: "QyTableColumnSettings",
15
16
  __name: "index",
16
17
  props: {
@@ -23,12 +24,12 @@ const te = { class: "qy-table-column-settings" }, le = { class: "qy-table-column
23
24
  unconfigurableTypes: { default: () => ["index", "selection", "expand", "setup"] }
24
25
  },
25
26
  emits: ["update:modelValue", "confirm", "reset", "cancel", "delete-cache", "change"],
26
- setup(b, { emit: U }) {
27
- const m = b, r = U, a = S([]), p = S(""), f = (t) => t.map((e) => ({ ...e })), N = () => {
27
+ setup(f, { emit: U }) {
28
+ const m = f, r = U, s = S([]), p = S(""), b = (t) => t.map((e) => ({ ...e })), N = () => {
28
29
  var t;
29
- a.value = f(m.settings), p.value = ((t = a.value[0]) == null ? void 0 : t.key) || "";
30
+ s.value = b(m.settings), p.value = ((t = s.value[0]) == null ? void 0 : t.key) || "";
30
31
  };
31
- Y(
32
+ P(
32
33
  () => m.modelValue,
33
34
  (t) => {
34
35
  t && N();
@@ -38,41 +39,41 @@ const te = { class: "qy-table-column-settings" }, le = { class: "qy-table-column
38
39
  }
39
40
  );
40
41
  const v = () => {
41
- r("change", f(a.value));
42
- }, _ = (t) => a.value.find((e) => e.key === t), u = $(() => _(p.value)), c = $(
43
- () => a.value.findIndex((t) => t.key === p.value)
42
+ r("change", b(s.value));
43
+ }, y = (t) => s.value.find((e) => e.key === t), u = $(() => y(p.value)), c = $(
44
+ () => s.value.findIndex((t) => t.key === p.value)
44
45
  ), w = (t) => !!(t.type && m.unconfigurableTypes.includes(t.type)), z = (t) => t === "left" ? "left" : t === "right" ? "right" : "none", h = (t) => t.type === "index" ? "序号" : t.type === "selection" ? "多选" : t.type === "expand" ? "展开" : t.type === "setup" ? "设置" : t.label || t.prop || t.key, q = (t) => {
45
46
  t && (p.value = t.key);
46
47
  }, x = (t) => {
47
48
  u.value && F(u.value.key, t);
48
49
  }, F = (t, e) => {
49
- const n = _(t);
50
+ const n = y(t);
50
51
  n && (n.fixed = e, v());
51
52
  }, K = (t, e) => {
52
- const n = _(t);
53
+ const n = y(t);
53
54
  !n || w(n) || (n.visible = e, v());
54
55
  }, L = (t, e) => {
55
- const n = _(t);
56
+ const n = y(t);
56
57
  n && (n.width = e, v());
57
- }, y = (t, e) => {
58
- if (t === e || t < 0 || t >= a.value.length || e < 0 || e >= a.value.length) return;
59
- const n = [...a.value], [g] = n.splice(t, 1);
60
- n.splice(e, 0, g), a.value = n, p.value = g.key, v();
58
+ }, _ = (t, e) => {
59
+ if (t === e || t < 0 || t >= s.value.length || e < 0 || e >= s.value.length) return;
60
+ const n = [...s.value], [g] = n.splice(t, 1);
61
+ n.splice(e, 0, g), s.value = n, p.value = g.key, v();
61
62
  }, Q = () => {
62
63
  var e, n;
63
64
  const t = (e = m.defaultSettings) != null && e.length ? m.defaultSettings : m.settings;
64
- a.value = f(t), p.value = ((n = a.value[0]) == null ? void 0 : n.key) || "", r("reset", f(a.value)), v();
65
+ s.value = b(t), p.value = ((n = s.value[0]) == null ? void 0 : n.key) || "", r("reset", b(s.value)), v();
65
66
  }, V = () => {
66
67
  r("cancel"), r("update:modelValue", !1);
67
68
  }, R = () => {
68
- r("confirm", f(a.value)), r("update:modelValue", !1);
69
+ r("confirm", b(s.value)), r("update:modelValue", !1);
69
70
  };
70
71
  return (t, e) => {
71
- const n = J, g = M, W = O, j = H, d = P, A = G;
72
- return C(), B(A, {
73
- "model-value": b.modelValue,
74
- title: b.title,
75
- width: b.width,
72
+ const n = H, g = J, W = G, d = M, j = A;
73
+ return C(), B(j, {
74
+ "model-value": f.modelValue,
75
+ title: f.title,
76
+ width: f.width,
76
77
  "append-to-body": "",
77
78
  onClose: V
78
79
  }, {
@@ -98,10 +99,10 @@ const te = { class: "qy-table-column-settings" }, le = { class: "qy-table-column
98
99
  })
99
100
  ]),
100
101
  default: i(() => [
101
- l("div", te, [
102
- l("div", le, [
103
- o(j, {
104
- data: a.value,
102
+ l("div", ee, [
103
+ l("div", te, [
104
+ o(W, {
105
+ data: s.value,
105
106
  "row-key": "key",
106
107
  height: "400px",
107
108
  border: "",
@@ -116,18 +117,18 @@ const te = { class: "qy-table-column-settings" }, le = { class: "qy-table-column
116
117
  prop: "label",
117
118
  "show-overflow-tooltip": ""
118
119
  }, {
119
- default: i(({ row: s }) => [
120
+ default: i(({ row: a }) => [
120
121
  l("div", {
121
122
  class: "qy-table-column-settings__name",
122
- "data-testid": `table-row-${s.key}`,
123
- onClick: (k) => q(s)
123
+ "data-testid": `table-row-${a.key}`,
124
+ onClick: (k) => q(a)
124
125
  }, [
125
126
  l("span", {
126
- class: Z(["qy-table-column-settings__fixed-mark", `is-${z(s.fixed)}`]),
127
+ class: X(["qy-table-column-settings__fixed-mark", `is-${z(a.fixed)}`]),
127
128
  "aria-hidden": "true"
128
129
  }, null, 2),
129
- l("span", null, E(h(s)), 1)
130
- ], 8, ne)
130
+ l("span", null, T(h(a)), 1)
131
+ ], 8, le)
131
132
  ]),
132
133
  _: 1
133
134
  }),
@@ -136,13 +137,13 @@ const te = { class: "qy-table-column-settings" }, le = { class: "qy-table-column
136
137
  prop: "width",
137
138
  width: "150"
138
139
  }, {
139
- default: i(({ row: s }) => [
140
+ default: i(({ row: a }) => [
140
141
  o(g, {
141
- "model-value": s.width,
142
+ "model-value": a.width,
142
143
  size: "small",
143
144
  placeholder: "留空自动设置宽度",
144
145
  "data-testid": "width",
145
- "onUpdate:modelValue": (k) => L(s.key, k)
146
+ "onUpdate:modelValue": (k) => L(a.key, k)
146
147
  }, null, 8, ["model-value", "onUpdate:modelValue"])
147
148
  ]),
148
149
  _: 1
@@ -152,13 +153,12 @@ const te = { class: "qy-table-column-settings" }, le = { class: "qy-table-column
152
153
  prop: "visible",
153
154
  width: "100"
154
155
  }, {
155
- default: i(({ row: s }) => [
156
- o(W, {
157
- "model-value": s.visible,
158
- disabled: w(s),
159
- style: { "--el-switch-on-color": "rgb(99 102 241)" },
156
+ default: i(({ row: a }) => [
157
+ o(Z, {
158
+ "model-value": a.visible,
159
+ disabled: w(a),
160
160
  "data-testid": "visible-switch",
161
- "onUpdate:modelValue": (k) => K(s.key, !!k)
161
+ "onUpdate:modelValue": (k) => K(a.key, !!k)
162
162
  }, null, 8, ["model-value", "disabled", "onUpdate:modelValue"])
163
163
  ]),
164
164
  _: 1
@@ -167,14 +167,14 @@ const te = { class: "qy-table-column-settings" }, le = { class: "qy-table-column
167
167
  _: 1
168
168
  }, 8, ["data"])
169
169
  ]),
170
- l("div", se, [
170
+ l("div", ne, [
171
171
  l("div", ae, [
172
- u.value ? (C(), T("div", oe, E(h(u.value)), 1)) : (C(), T("div", ie, " 请选择列 ")),
172
+ u.value ? (C(), E("div", ie, T(h(u.value)), 1)) : (C(), E("div", se, " 请选择列 ")),
173
173
  o(d, {
174
174
  class: "qy-table-column-settings__side-button",
175
175
  disabled: !u.value || c.value === 0,
176
176
  "data-action": "top",
177
- onClick: e[0] || (e[0] = (s) => y(c.value, 0))
177
+ onClick: e[0] || (e[0] = (a) => _(c.value, 0))
178
178
  }, {
179
179
  default: i(() => [...e[8] || (e[8] = [
180
180
  l("span", { class: "qy-table-column-settings__action-icon is-top" }, null, -1),
@@ -186,7 +186,7 @@ const te = { class: "qy-table-column-settings" }, le = { class: "qy-table-column
186
186
  class: "qy-table-column-settings__side-button",
187
187
  disabled: !u.value || c.value === 0,
188
188
  "data-action": "up",
189
- onClick: e[1] || (e[1] = (s) => y(c.value, c.value - 1))
189
+ onClick: e[1] || (e[1] = (a) => _(c.value, c.value - 1))
190
190
  }, {
191
191
  default: i(() => [...e[9] || (e[9] = [
192
192
  l("span", { class: "qy-table-column-settings__action-icon is-up" }, null, -1),
@@ -196,9 +196,9 @@ const te = { class: "qy-table-column-settings" }, le = { class: "qy-table-column
196
196
  }, 8, ["disabled"]),
197
197
  o(d, {
198
198
  class: "qy-table-column-settings__side-button",
199
- disabled: !u.value || c.value === a.value.length - 1,
199
+ disabled: !u.value || c.value === s.value.length - 1,
200
200
  "data-action": "down",
201
- onClick: e[2] || (e[2] = (s) => y(c.value, c.value + 1))
201
+ onClick: e[2] || (e[2] = (a) => _(c.value, c.value + 1))
202
202
  }, {
203
203
  default: i(() => [...e[10] || (e[10] = [
204
204
  l("span", { class: "qy-table-column-settings__action-icon is-down" }, null, -1),
@@ -208,9 +208,9 @@ const te = { class: "qy-table-column-settings" }, le = { class: "qy-table-column
208
208
  }, 8, ["disabled"]),
209
209
  o(d, {
210
210
  class: "qy-table-column-settings__side-button",
211
- disabled: !u.value || c.value === a.value.length - 1,
211
+ disabled: !u.value || c.value === s.value.length - 1,
212
212
  "data-action": "bottom",
213
- onClick: e[3] || (e[3] = (s) => y(c.value, a.value.length - 1))
213
+ onClick: e[3] || (e[3] = (a) => _(c.value, s.value.length - 1))
214
214
  }, {
215
215
  default: i(() => [...e[11] || (e[11] = [
216
216
  l("span", { class: "qy-table-column-settings__action-icon is-bottom" }, null, -1),
@@ -222,7 +222,7 @@ const te = { class: "qy-table-column-settings" }, le = { class: "qy-table-column
222
222
  class: "qy-table-column-settings__side-button",
223
223
  disabled: !u.value,
224
224
  "data-action": "fixed-left",
225
- onClick: e[4] || (e[4] = (s) => x("left"))
225
+ onClick: e[4] || (e[4] = (a) => x("left"))
226
226
  }, {
227
227
  default: i(() => [...e[12] || (e[12] = [
228
228
  l("span", { class: "qy-table-column-settings__action-icon is-fixed-left" }, null, -1),
@@ -234,7 +234,7 @@ const te = { class: "qy-table-column-settings" }, le = { class: "qy-table-column
234
234
  class: "qy-table-column-settings__side-button",
235
235
  disabled: !u.value,
236
236
  "data-action": "fixed-right",
237
- onClick: e[5] || (e[5] = (s) => x("right"))
237
+ onClick: e[5] || (e[5] = (a) => x("right"))
238
238
  }, {
239
239
  default: i(() => [...e[13] || (e[13] = [
240
240
  l("span", { class: "qy-table-column-settings__action-icon is-fixed-right" }, null, -1),
@@ -246,7 +246,7 @@ const te = { class: "qy-table-column-settings" }, le = { class: "qy-table-column
246
246
  class: "qy-table-column-settings__side-button",
247
247
  disabled: !u.value,
248
248
  "data-action": "clear-fixed",
249
- onClick: e[6] || (e[6] = (s) => x(!1))
249
+ onClick: e[6] || (e[6] = (a) => x(!1))
250
250
  }, {
251
251
  default: i(() => [...e[14] || (e[14] = [
252
252
  l("span", { class: "qy-table-column-settings__action-icon is-clear-fixed" }, null, -1),
@@ -255,7 +255,7 @@ const te = { class: "qy-table-column-settings" }, le = { class: "qy-table-column
255
255
  _: 1
256
256
  }, 8, ["disabled"])
257
257
  ]),
258
- l("div", ue, [
258
+ l("div", oe, [
259
259
  o(d, {
260
260
  "data-action": "reset",
261
261
  onClick: Q
@@ -266,19 +266,19 @@ const te = { class: "qy-table-column-settings" }, le = { class: "qy-table-column
266
266
  ])]),
267
267
  _: 1
268
268
  }),
269
- b.showDeleteCache ? (C(), B(d, {
269
+ f.showDeleteCache ? (C(), B(d, {
270
270
  key: 0,
271
271
  type: "danger",
272
272
  plain: "",
273
273
  "data-action": "delete-cache",
274
- onClick: e[7] || (e[7] = (s) => r("delete-cache"))
274
+ onClick: e[7] || (e[7] = (a) => r("delete-cache"))
275
275
  }, {
276
276
  default: i(() => [...e[16] || (e[16] = [
277
277
  l("span", { class: "qy-table-column-settings__action-icon is-reset" }, null, -1),
278
278
  l("span", null, "删除缓存", -1)
279
279
  ])]),
280
280
  _: 1
281
- })) : I("", !0)
281
+ })) : Y("", !0)
282
282
  ])
283
283
  ])
284
284
  ])
@@ -287,7 +287,7 @@ const te = { class: "qy-table-column-settings" }, le = { class: "qy-table-column
287
287
  }, 8, ["model-value", "title", "width"]);
288
288
  };
289
289
  }
290
- }), pe = /* @__PURE__ */ ee(de, [["__scopeId", "data-v-56d579b9"]]);
290
+ }), pe = /* @__PURE__ */ I(ue, [["__scopeId", "data-v-2f2e5e90"]]);
291
291
  export {
292
292
  pe as T
293
293
  };
@@ -0,0 +1,225 @@
1
+ import { defineComponent as D, useAttrs as Q, useSlots as G, ref as J, computed as s, Comment as X, Text as Y, Fragment as A, isVNode as Z, watch as k, onMounted as _, onUpdated as ee, openBlock as h, createBlock as B, unref as K, mergeProps as te, createSlots as le, withCtx as c, renderSlot as p, createElementBlock as ae, renderList as ne, normalizeProps as oe, guardReactiveProps as re } from "vue";
2
+ import { ElSelect as ie, ElOption as ue } from "element-plus";
3
+ import { _ as se } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
4
+ const de = /* @__PURE__ */ D({
5
+ name: "QySelect",
6
+ inheritAttrs: !1,
7
+ __name: "index",
8
+ props: {
9
+ modelValue: { type: [String, Number, Boolean, Object, Array, null], default: void 0 },
10
+ options: { default: () => [] },
11
+ labelKey: { default: "label" },
12
+ valueKey: { default: "value" },
13
+ objectIdentityKey: { default: void 0 },
14
+ disabledKey: { default: "disabled" },
15
+ placeholder: { default: "请选择" },
16
+ disabled: { type: Boolean, default: !1 },
17
+ clearable: { type: Boolean, default: !0 },
18
+ filterable: { type: Boolean, default: !1 },
19
+ loading: { type: Boolean, default: !1 },
20
+ multiple: { type: Boolean, default: !1 },
21
+ collapseTags: { type: Boolean, default: !1 },
22
+ collapseTagsTooltip: { type: Boolean, default: !1 },
23
+ autoSelectSingle: { type: Boolean, default: !1 },
24
+ size: { default: void 0 },
25
+ teleported: { type: Boolean, default: !0 },
26
+ appendTo: { default: "body" },
27
+ fitInputWidth: { type: Boolean, default: !0 },
28
+ popperClass: { default: "" }
29
+ },
30
+ emits: ["update:modelValue", "change", "clear", "visible-change", "focus", "blur"],
31
+ setup(n, { expose: j, emit: C }) {
32
+ const r = Symbol("invalid-select-value"), l = n, o = C, I = Q(), O = G(), m = J(null), $ = s(
33
+ () => Object.fromEntries(
34
+ Object.entries(I).filter(
35
+ ([e]) => e === "class" || e === "style" || e === "id" || e === "name" || e === "role" || e === "title" || e === "tabindex" || e === "remote" || e === "remoteMethod" || e === "remote-method" || e === "remoteShowSuffix" || e === "remote-show-suffix" || e.startsWith("data-") || e.startsWith("aria-")
36
+ )
37
+ )
38
+ ), T = s(
39
+ () => ["qy-select__popper", l.popperClass].filter(Boolean).join(" ")
40
+ ), S = s(() => {
41
+ const e = g(l.modelValue);
42
+ return e === r ? void 0 : e;
43
+ }), d = s(
44
+ () => l.options.map((e) => ({
45
+ raw: e,
46
+ label: x(e),
47
+ value: z(e),
48
+ disabled: !!e[l.disabledKey]
49
+ }))
50
+ ), y = s(() => {
51
+ const e = O.default;
52
+ return e ? e().some(V) : !1;
53
+ }), w = s(() => {
54
+ if (!l.objectIdentityKey) return;
55
+ const e = S.value, t = Array.isArray(e) ? e.some(f) : f(e), a = !y.value && d.value.some((u) => f(u.value));
56
+ return t || a ? l.objectIdentityKey : void 0;
57
+ });
58
+ function V(e) {
59
+ return e.type === X ? !1 : e.type === Y ? typeof e.children == "string" && e.children.trim() !== "" : e.type !== A || !Array.isArray(e.children) ? !0 : e.children.some((t) => Z(t) ? V(t) : typeof t == "string" ? t.trim() !== "" : t != null);
60
+ }
61
+ function f(e) {
62
+ return typeof e == "object" && e !== null && !Array.isArray(e);
63
+ }
64
+ function b(e) {
65
+ return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || f(e) ? e : r;
66
+ }
67
+ function g(e) {
68
+ if (e == null) return e;
69
+ if (Array.isArray(e)) {
70
+ const t = e;
71
+ return t.every((a) => b(a) !== r) ? t : r;
72
+ }
73
+ return b(e);
74
+ }
75
+ function x(e) {
76
+ const t = e[l.labelKey] ?? e.label ?? e.value ?? "";
77
+ return typeof t == "string" || typeof t == "number" ? t : typeof t == "boolean" ? String(t) : "";
78
+ }
79
+ function z(e) {
80
+ const t = e[l.valueKey] ?? e.value ?? e.label, a = b(t);
81
+ return a === r ? void 0 : a;
82
+ }
83
+ function E(e) {
84
+ return Array.isArray(e) ? e.length === 0 : e === "" || e === null || e === void 0;
85
+ }
86
+ let i = null;
87
+ k(
88
+ [
89
+ d,
90
+ () => l.modelValue,
91
+ () => l.autoSelectSingle,
92
+ () => l.disabled,
93
+ () => l.multiple
94
+ ],
95
+ ([e]) => v(e),
96
+ { flush: "post" }
97
+ ), _(() => v(d.value)), ee(() => v(d.value));
98
+ function v(e) {
99
+ if (!E(l.modelValue)) {
100
+ i = null;
101
+ return;
102
+ }
103
+ if (!l.autoSelectSingle || l.disabled || y.value || e.length !== 1) return;
104
+ const [t] = e;
105
+ if (t.disabled || t.value === void 0) return;
106
+ const a = M(t.value);
107
+ if (i && i.identityKey === l.objectIdentityKey && i.multiple === l.multiple && Object.is(i.candidate, a))
108
+ return;
109
+ i = {
110
+ candidate: a,
111
+ identityKey: l.objectIdentityKey,
112
+ multiple: l.multiple
113
+ };
114
+ const u = l.multiple ? [t.value] : t.value;
115
+ o("update:modelValue", u), o("change", u);
116
+ }
117
+ function M(e) {
118
+ return !f(e) || !l.objectIdentityKey ? e : e[l.objectIdentityKey] ?? e;
119
+ }
120
+ function L(e, t) {
121
+ return `${String(e.value ?? e.label ?? "")}-${t}`;
122
+ }
123
+ function P(e) {
124
+ const t = g(e);
125
+ t !== r && o("update:modelValue", t);
126
+ }
127
+ function U(e) {
128
+ const t = g(e);
129
+ t !== r && o("change", t);
130
+ }
131
+ function W() {
132
+ o("clear");
133
+ }
134
+ function F(e) {
135
+ o("visible-change", e);
136
+ }
137
+ function H(e) {
138
+ o("focus", e);
139
+ }
140
+ function N(e) {
141
+ o("blur", e);
142
+ }
143
+ function R() {
144
+ var e, t;
145
+ (t = (e = m.value) == null ? void 0 : e.focus) == null || t.call(e);
146
+ }
147
+ function q() {
148
+ var e, t;
149
+ (t = (e = m.value) == null ? void 0 : e.blur) == null || t.call(e);
150
+ }
151
+ return j({
152
+ // 仅暴露业务常用焦点方法,复杂下拉行为仍交给 Element Plus 自身处理。
153
+ focus: R,
154
+ blur: q
155
+ }), (e, t) => (h(), B(K(ie), te({
156
+ ref_key: "selectRef",
157
+ ref: m,
158
+ class: "qy-select"
159
+ }, $.value, {
160
+ "model-value": S.value,
161
+ placeholder: n.placeholder,
162
+ disabled: n.disabled,
163
+ clearable: n.clearable,
164
+ filterable: n.filterable,
165
+ loading: n.loading,
166
+ multiple: n.multiple,
167
+ "collapse-tags": n.collapseTags,
168
+ "collapse-tags-tooltip": n.collapseTagsTooltip,
169
+ size: n.size,
170
+ teleported: n.teleported,
171
+ "fit-input-width": n.fitInputWidth,
172
+ "popper-class": T.value,
173
+ "append-to": n.appendTo,
174
+ "value-key": w.value,
175
+ "onUpdate:modelValue": P,
176
+ onChange: U,
177
+ onClear: W,
178
+ onVisibleChange: F,
179
+ onFocus: H,
180
+ onBlur: N
181
+ }), le({
182
+ default: c(() => [
183
+ y.value ? p(e.$slots, "default", {}, void 0, !0, 0) : (h(!0), ae(A, { key: 1 }, ne(d.value, (a, u) => (h(), B(K(ue), {
184
+ key: L(a, u),
185
+ label: a.label,
186
+ value: a.value,
187
+ disabled: a.disabled
188
+ }, null, 8, ["label", "value", "disabled"]))), 128))
189
+ ]),
190
+ _: 2
191
+ }, [
192
+ e.$slots.prefix ? {
193
+ name: "prefix",
194
+ fn: c(() => [
195
+ p(e.$slots, "prefix", {}, void 0, !0)
196
+ ]),
197
+ key: "0"
198
+ } : void 0,
199
+ e.$slots.empty ? {
200
+ name: "empty",
201
+ fn: c(() => [
202
+ p(e.$slots, "empty", {}, void 0, !0)
203
+ ]),
204
+ key: "1"
205
+ } : void 0,
206
+ e.$slots.loading ? {
207
+ name: "loading",
208
+ fn: c(() => [
209
+ p(e.$slots, "loading", {}, void 0, !0)
210
+ ]),
211
+ key: "2"
212
+ } : void 0,
213
+ e.$slots.tag ? {
214
+ name: "tag",
215
+ fn: c((a) => [
216
+ p(e.$slots, "tag", oe(re(a)), void 0, !0)
217
+ ]),
218
+ key: "3"
219
+ } : void 0
220
+ ]), 1040, ["model-value", "placeholder", "disabled", "clearable", "filterable", "loading", "multiple", "collapse-tags", "collapse-tags-tooltip", "size", "teleported", "fit-input-width", "popper-class", "append-to", "value-key"]));
221
+ }
222
+ }), me = /* @__PURE__ */ se(de, [["__scopeId", "data-v-f5464318"]]);
223
+ export {
224
+ me as S
225
+ };
@@ -0,0 +1,68 @@
1
+ import { defineComponent as s, useAttrs as r, computed as m, openBlock as f, createBlock as v, unref as b, mergeProps as h } from "vue";
2
+ import { ElSwitch as x } from "element-plus";
3
+ import { _ as g } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
4
+ const V = /* @__PURE__ */ s({
5
+ name: "QySwitch",
6
+ inheritAttrs: !1,
7
+ __name: "index",
8
+ props: {
9
+ modelValue: { type: [Boolean, String, Number], default: !1 },
10
+ activeValue: { type: [Boolean, String, Number], default: !0 },
11
+ inactiveValue: { type: [Boolean, String, Number], default: !1 },
12
+ disabled: { type: Boolean, default: !1 },
13
+ loading: { type: Boolean, default: !1 },
14
+ size: {},
15
+ activeText: { default: "" },
16
+ inactiveText: { default: "" },
17
+ inlinePrompt: { type: Boolean, default: !1 },
18
+ name: { default: "" },
19
+ id: {},
20
+ tabindex: {},
21
+ ariaLabel: {}
22
+ },
23
+ emits: ["update:modelValue", "change", "focus", "blur"],
24
+ setup(e, { emit: i }) {
25
+ const t = i, l = r(), n = m(
26
+ () => Object.fromEntries(
27
+ Object.entries(l).filter(
28
+ ([a]) => a === "class" || a === "style" || a === "role" || a === "title" || a.startsWith("data-") || a.startsWith("aria-")
29
+ )
30
+ )
31
+ );
32
+ function d(a) {
33
+ t("focus", a);
34
+ }
35
+ function u(a) {
36
+ t("blur", a);
37
+ }
38
+ function c(a) {
39
+ e.disabled || e.loading || t("update:modelValue", a);
40
+ }
41
+ function o(a) {
42
+ e.disabled || e.loading || t("change", a);
43
+ }
44
+ return (a, B) => (f(), v(b(x), h(n.value, {
45
+ class: "qy-switch",
46
+ "model-value": e.modelValue,
47
+ "active-value": e.activeValue,
48
+ "inactive-value": e.inactiveValue,
49
+ disabled: e.disabled,
50
+ loading: e.loading,
51
+ size: e.size,
52
+ "active-text": e.activeText,
53
+ "inactive-text": e.inactiveText,
54
+ "inline-prompt": e.inlinePrompt,
55
+ name: e.name,
56
+ id: e.id,
57
+ tabindex: e.tabindex,
58
+ "aria-label": e.ariaLabel,
59
+ "onUpdate:modelValue": c,
60
+ onChange: o,
61
+ onFocusin: d,
62
+ onFocusout: u
63
+ }), null, 16, ["model-value", "active-value", "inactive-value", "disabled", "loading", "size", "active-text", "inactive-text", "inline-prompt", "name", "id", "tabindex", "aria-label"]));
64
+ }
65
+ }), z = /* @__PURE__ */ g(V, [["__scopeId", "data-v-5ec5d1c7"]]);
66
+ export {
67
+ z as S
68
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),x=require("./index.vue_vue_type_style_index_0_lang-BZQLyvw8.cjs"),B=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),w={class:"qy-menu-actions__panel"},T=["disabled","data-action-key","onClick"],C={key:0,class:"qy-menu-actions__loading"},b={key:0,class:"qy-menu-actions__empty"},E={key:1,class:"qy-menu-actions__inline"},V=["disabled","data-action-key","onClick"],z={key:0,class:"qy-menu-actions__loading"},A={key:0,class:"qy-menu-actions__empty"},M=e.defineComponent({name:"QyMenuActions",__name:"index",props:{actions:{default:()=>[]},row:{},rowIndex:{},context:{},mode:{default:"inline"},emptyText:{default:"无数据"},popoverWidth:{default:150},confirmMethod:{}},emits:["action","confirm-required"],setup(r,{emit:f}){const l=r,y=f,p=e.computed(()=>{var n,o;return{...l.context,row:l.row??((n=l.context)==null?void 0:n.row),rowIndex:l.rowIndex??((o=l.context)==null?void 0:o.rowIndex)}}),d=e.ref(!1),i=e.ref(new Set),v=(n,o)=>({...p.value,target:o.currentTarget,hide:h,setLoading:t=>q(n,t)}),u=n=>typeof n=="function"?n(p.value):!!n,s=e.computed(()=>l.actions.filter(n=>!u(n.hidden))),g=e.computed(()=>s.value.some(n=>a(n))),m=n=>u(n.disabled)||a(n),a=n=>i.value.has(n.key)||u(n.loading),k=(n,o)=>{const t=n.type||o;return{default:"var(--el-text-color-primary)",primary:"var(--el-color-primary)",success:"var(--el-color-success)",warning:"var(--el-color-warning)",danger:"var(--el-color-danger)"}[t]},_=async(n,o)=>{if(o.stopPropagation(),m(n))return;const t=v(n,o);if(n.confirm){if(!l.confirmMethod){y("confirm-required",n,t);return}if(!await l.confirmMethod(n,t))return}y("action",n,t)};function h(){d.value=!1}function q(n,o){const t=new Set(i.value);o?t.add(n.key):t.delete(n.key),i.value=t}return e.onBeforeUnmount(()=>{i.value=new Set}),(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["qy-menu-actions",`is-${r.mode}`])},[r.mode==="popover"?(e.openBlock(),e.createBlock(x._sfc_main,{key:0,open:d.value,"onUpdate:open":o[0]||(o[0]=t=>d.value=t),trigger:"hover",placement:"left",width:r.popoverWidth,"hide-delay":g.value?999999:100,"show-arrow":!1},{reference:e.withCtx(()=>[...o[1]||(o[1]=[e.createElementVNode("button",{class:"qy-menu-actions__trigger",type:"button","aria-label":"行操作"},[e.createElementVNode("svg",{class:"qy-menu-actions__trigger-icon",viewBox:"0 0 24 24","aria-hidden":"true"},[e.createElementVNode("path",{fill:"currentColor",d:"M8 17q.425 0 .713-.288T9 16q0-.425-.288-.712T8 15q-.425 0-.712.288T7 16q0 .425.288.713T8 17m0-4q.425 0 .713-.288T9 12q0-.425-.288-.712T8 11q-.425 0-.712.288T7 12q0 .425.288.713T8 13m0-4q.425 0 .713-.288T9 8q0-.425-.288-.712T8 7q-.425 0-.712.288T7 8q0 .425.288.713T8 9m3 8h6v-2h-6zm0-4h6v-2h-6zm0-4h6V7h-6zM5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5z"})])],-1)])]),default:e.withCtx(()=>[e.createElementVNode("div",w,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,t=>(e.openBlock(),e.createElementBlock("button",{key:t.key,class:e.normalizeClass(["qy-menu-actions__item",[`is-${t.type||"default"}`,{"is-loading":a(t)}]]),disabled:m(t),"data-action-key":t.key,style:e.normalizeStyle({color:k(t,"default")}),type:"button",onClick:c=>_(t,c)},[a(t)?(e.openBlock(),e.createElementBlock("span",C)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.label),1)],14,T))),128)),s.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",b,e.toDisplayString(r.emptyText),1))])]),_:1},8,["open","width","hide-delay"])):(e.openBlock(),e.createElementBlock("div",E,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,t=>(e.openBlock(),e.createElementBlock("button",{key:t.key,class:e.normalizeClass(["qy-menu-actions__item",[`is-${t.type||"primary"}`,{"is-loading":a(t)}]]),disabled:m(t),"data-action-key":t.key,style:e.normalizeStyle({color:k(t,"primary")}),type:"button",onClick:c=>_(t,c)},[a(t)?(e.openBlock(),e.createElementBlock("span",z)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.label),1)],14,V))),128)),s.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",A,e.toDisplayString(r.emptyText),1))]))],2))}}),N=B._export_sfc(M,[["__scopeId","data-v-18227456"]]);exports.MenuActions=N;