@das-fed/upf-ui 6.4.0-dev.140 → 6.4.0-dev.141

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.
@@ -1,22 +1,22 @@
1
1
  import '@das-fed/upf-ui/packages/components/radio/style.css';
2
- import { defineComponent as Z, reactive as x, toRefs as _, ref as L, computed as f, watchEffect as ee, watch as ae, useSlots as le, onMounted as ie, createElementBlock as s, openBlock as u, normalizeStyle as E, createBlock as b, createCommentVNode as t, unref as i, mergeProps as q, isRef as $, withCtx as m, renderSlot as S, normalizeClass as r, createVNode as F, Fragment as y, renderList as g, createTextVNode as V, toDisplayString as v, withDirectives as oe } from "vue";
3
- import { withInstall as ue } from "@das-fed/upf-utils/with-install/index";
4
- import { Radio as O, RadioGroup as U, RadioButton as se } from "ant-design-vue";
2
+ import { defineComponent as _, reactive as ee, toRefs as ae, ref as j, computed as f, watchEffect as le, watch as ie, useSlots as oe, onMounted as ue, createElementBlock as s, openBlock as o, normalizeStyle as b, createBlock as m, createCommentVNode as t, unref as i, mergeProps as V, isRef as I, withCtx as y, renderSlot as C, normalizeClass as r, createVNode as N, Fragment as g, renderList as h, withDirectives as R, createTextVNode as B, toDisplayString as p } from "vue";
3
+ import { withInstall as se } from "@das-fed/upf-utils/with-install/index";
4
+ import { Radio as M, RadioGroup as G, RadioButton as de } from "ant-design-vue";
5
5
  import "ant-design-vue/es/radio/style/css";
6
- import { useModelValue as z } from "@das-fed/upf-utils/vue";
7
- import { vDasTooltip as de } from "@das-fed/upf-ui/packages/components/text-tooltip/index";
8
- import { DasAutoRegisterIcon as te, DasIcon as W } from "@das-fed/upf-ui/packages/components/icon/index";
6
+ import { useModelValue as P } from "@das-fed/upf-utils/vue";
7
+ import { vDasTooltip as D } from "@das-fed/upf-ui/packages/components/text-tooltip/index";
8
+ import { DasAutoRegisterIcon as te, DasIcon as A } from "@das-fed/upf-ui/packages/components/icon/index";
9
9
  import { setThemeRule as re } from "@das-fed/upf-web/packages/theme/index";
10
10
  const ne = {
11
11
  key: 0,
12
12
  class: "square-select-icon"
13
- }, fe = ["onClick", "onBlur", "tabindex"], pe = {
13
+ }, fe = ["onClick", "onBlur", "tabindex"], ve = {
14
14
  key: 0,
15
15
  class: "square-select-icon"
16
- }, ve = {
16
+ }, pe = {
17
17
  key: 1,
18
18
  class: "empty-text"
19
- }, ce = ["onClick", "tabindex"], be = /* @__PURE__ */ Z({
19
+ }, ce = ["onClick", "tabindex"], be = /* @__PURE__ */ _({
20
20
  __name: "Index",
21
21
  props: {
22
22
  modelValue: { default: null },
@@ -38,103 +38,103 @@ const ne = {
38
38
  formSize: {}
39
39
  },
40
40
  emits: ["change", "update:modelValue"],
41
- setup(M, { emit: G }) {
41
+ setup(H, { emit: J }) {
42
42
  te({
43
43
  select: import("@das-fed/upf-ui/packages/icons/select")
44
44
  });
45
- const d = M, j = x({
45
+ const d = H, K = ee({
46
46
  radioValue: null,
47
47
  isFocus: !1
48
48
  });
49
- let { radioValue: l, isFocus: C } = _(j);
50
- const h = d.layout, c = G, I = L(null), H = f(() => d.noSetDefaultVal ? "" : "-");
51
- ee(() => {
49
+ let { radioValue: l, isFocus: $ } = ae(K);
50
+ const k = d.layout, c = J, E = j(null), Q = f(() => d.noSetDefaultVal ? "" : "-");
51
+ le(() => {
52
52
  l.value = d.modelValue;
53
- }), ae([l], ([e]) => {
53
+ }), ie([l], ([e]) => {
54
54
  c("update:modelValue", e);
55
55
  });
56
- const p = z(d, "defaultProps"), k = z(d, "options"), J = z(d, "isSetTimeout"), T = f(() => k.value.length ? k.value.map((e) => ({
57
- value: e[p.value.value],
58
- label: e[p.value.label],
56
+ const v = P(d, "defaultProps"), T = P(d, "options"), X = P(d, "isSetTimeout"), w = f(() => T.value.length ? T.value.map((e) => ({
57
+ value: e[v.value.value],
58
+ label: e[v.value.label],
59
59
  disabled: e.disabled,
60
60
  isFocus: !1
61
- })) : []), R = () => {
62
- J.value ? setTimeout(() => {
61
+ })) : []), F = () => {
62
+ X.value ? setTimeout(() => {
63
63
  c("change", l.value);
64
64
  }, 0) : c("change", l.value);
65
- }, B = f(() => {
65
+ }, z = f(() => {
66
66
  if (!d.isView) return [];
67
- if ((!k.value.length || l.value == "undefined") && d.radioType == "group") return [];
67
+ if ((!T.value.length || l.value == "undefined") && d.radioType == "group") return [];
68
68
  if (d.radioType == "group")
69
- return k.value.filter((e) => l.value == e[p.value.value]);
69
+ return T.value.filter((e) => l.value == e[v.value.value]);
70
70
  {
71
71
  if (l.value == "undefined") return [];
72
- const e = le();
73
- let o = null;
74
- return e && e.default && (o = e.default()[0].children), [
72
+ const e = oe();
73
+ let u = null;
74
+ return e && e.default && (u = e.default()[0].children), [
75
75
  {
76
76
  value: l.value,
77
- label: o
77
+ label: u
78
78
  }
79
79
  ];
80
80
  }
81
- }), K = d.disabled, D = (e, o) => {
82
- if (!K)
81
+ }), Y = d.disabled, W = (e, u) => {
82
+ if (!Y)
83
83
  if (e == "group") {
84
- if (o.disabled) return;
85
- l.value = o.value, o.isFocus = !0, c("change", l.value);
84
+ if (u.disabled) return;
85
+ l.value = u.value, u.isFocus = !0, c("change", l.value);
86
86
  } else
87
- l.value = !0, C.value = !0, c("change", l.value);
88
- }, N = (e, o) => {
89
- e == "group" ? o.isFocus = !1 : C.value = !1;
90
- }, P = f(() => d.maxWidth ? d.maxWidth : d.width), Q = f(() => {
87
+ l.value = !0, $.value = !0, c("change", l.value);
88
+ }, O = (e, u) => {
89
+ e == "group" ? u.isFocus = !1 : $.value = !1;
90
+ }, U = f(() => d.maxWidth ? d.maxWidth : d.width), q = f(() => {
91
91
  if (d.maxWidth)
92
- return `max-width:${Number(String(P.value).split("px")[0])}px`;
92
+ return `max-width:${Number(String(U.value).split("px")[0])}px`;
93
93
  if (d.width)
94
- return `width:${Number(String(P.value).split("px")[0])}px`;
95
- }), X = () => {
94
+ return `width:${Number(String(U.value).split("px")[0])}px`;
95
+ }), Z = () => {
96
96
  setTimeout(() => {
97
- var o;
98
- const e = (o = I.value) == null ? void 0 : o.querySelectorAll("input");
97
+ var u;
98
+ const e = (u = E.value) == null ? void 0 : u.querySelectorAll("input");
99
99
  e && e.length && e.forEach((a) => a.setAttribute("tabindex", "-1"));
100
100
  }, 1e3);
101
- }, w = f(() => d.formSize), Y = f(() => ({
102
- "--radio-height": w.value && {
101
+ }, S = f(() => d.formSize || "default"), x = f(() => ({
102
+ "--radio-height": S.value && {
103
103
  small: "24px",
104
104
  default: "32px",
105
105
  large: "40px"
106
- }[w.value],
107
- "--radio-font-size": w.value && {
106
+ }[S.value],
107
+ "--radio-font-size": S.value && {
108
108
  small: "12px",
109
109
  default: "14px",
110
110
  large: "14px"
111
- }[w.value]
111
+ }[S.value]
112
112
  }));
113
- return ie(X), (e, o) => (u(), s(
113
+ return ue(Z), (e, u) => (o(), s(
114
114
  "div",
115
115
  {
116
116
  class: "das-ui-radio",
117
117
  ref_key: "radioRef",
118
- ref: I,
119
- style: E(Y.value)
118
+ ref: E,
119
+ style: b(x.value)
120
120
  },
121
121
  [
122
- e.radioType == "default" && e.optionType == "default" && !e.isView ? (u(), b(i(O), q({
122
+ e.radioType == "default" && e.optionType == "default" && !e.isView ? (o(), m(i(M), V({
123
123
  key: 0,
124
124
  disabled: e.disabled,
125
125
  checked: i(l),
126
- "onUpdate:checked": o[0] || (o[0] = (a) => $(l) ? l.value = a : l = a)
126
+ "onUpdate:checked": u[0] || (u[0] = (a) => I(l) ? l.value = a : l = a)
127
127
  }, e.$attrs, {
128
128
  optionType: e.optionType,
129
- onChange: R
129
+ onChange: F
130
130
  }), {
131
- default: m(() => [
132
- S(e.$slots, "default")
131
+ default: y(() => [
132
+ C(e.$slots, "default")
133
133
  ]),
134
134
  _: 3
135
135
  /* FORWARDED */
136
136
  }, 16, ["disabled", "checked", "optionType"])) : t("v-if", !0),
137
- e.radioType == "default" && e.optionType == "square" && !e.isView ? (u(), s(
137
+ e.radioType == "default" && e.optionType == "square" && !e.isView ? (o(), s(
138
138
  "div",
139
139
  {
140
140
  key: 1,
@@ -143,53 +143,65 @@ const ne = {
143
143
  {
144
144
  "das-ui-radio-square--disabled": e.disabled,
145
145
  "das-ui-radio-square--checked": !!i(l),
146
- "das-ui-radio-square--focus": i(C)
146
+ "das-ui-radio-square--focus": i($)
147
147
  }
148
148
  ]),
149
- onClick: o[1] || (o[1] = (a) => D("default", "")),
150
- onBlur: o[2] || (o[2] = (a) => N("default", "")),
149
+ onClick: u[1] || (u[1] = (a) => W("default", "")),
150
+ onBlur: u[2] || (u[2] = (a) => O("default", "")),
151
151
  tabindex: "0"
152
152
  },
153
153
  [
154
- i(l) ? (u(), s("span", ne, [
155
- F(i(W), {
154
+ i(l) ? (o(), s("span", ne, [
155
+ N(i(A), {
156
156
  size: "mini",
157
157
  icon: "select",
158
158
  iconColor: "#fff",
159
159
  class: "view-icon"
160
160
  })
161
161
  ])) : t("v-if", !0),
162
- S(e.$slots, "default")
162
+ C(e.$slots, "default")
163
163
  ],
164
164
  34
165
165
  /* CLASS, NEED_HYDRATION */
166
166
  )) : t("v-if", !0),
167
- e.radioType == "group" && e.optionType == "default" && !e.isView ? (u(), b(i(U), q({
167
+ e.radioType == "group" && e.optionType == "default" && !e.isView ? (o(), m(i(G), V({
168
168
  key: 2,
169
- class: { "das-ui-radio-vertical": i(h) == "vertical" },
169
+ class: { "das-ui-radio-vertical": i(k) == "vertical" },
170
170
  name: e.name,
171
171
  value: i(l),
172
- "onUpdate:value": o[3] || (o[3] = (a) => $(l) ? l.value = a : l = a)
172
+ "onUpdate:value": u[3] || (u[3] = (a) => I(l) ? l.value = a : l = a)
173
173
  }, e.$attrs, {
174
- onChange: R,
174
+ onChange: F,
175
175
  disabled: e.disabled
176
176
  }), {
177
- default: m(() => [
178
- (u(!0), s(
179
- y,
177
+ default: y(() => [
178
+ (o(!0), s(
179
+ g,
180
180
  null,
181
- g(T.value, (a) => (u(), b(i(O), {
181
+ h(w.value, (a) => (o(), m(i(M), {
182
182
  value: a.value,
183
183
  disabled: a.disabled,
184
184
  key: a.value
185
185
  }, {
186
- default: m(() => [
187
- S(e.$slots, "default", { item: a }, () => [
188
- V(
189
- v(a.label),
190
- 1
191
- /* TEXT */
192
- )
186
+ default: y(() => [
187
+ C(e.$slots, "default", { item: a }, () => [
188
+ R((o(), s(
189
+ "div",
190
+ {
191
+ style: b(q.value)
192
+ },
193
+ [
194
+ B(
195
+ p(a.label),
196
+ 1
197
+ /* TEXT */
198
+ )
199
+ ],
200
+ 4
201
+ /* STYLE */
202
+ )), [
203
+ [i(D)]
204
+ ])
193
205
  ])
194
206
  ]),
195
207
  _: 2
@@ -202,33 +214,45 @@ const ne = {
202
214
  _: 3
203
215
  /* FORWARDED */
204
216
  }, 16, ["class", "name", "value", "disabled"])) : t("v-if", !0),
205
- e.radioType == "group" && e.optionType == "button" ? (u(), b(i(U), q({
217
+ e.radioType == "group" && e.optionType == "button" ? (o(), m(i(G), V({
206
218
  key: 3,
207
- class: { "das-ui-radio-vertical": i(h) == "vertical" },
219
+ class: { "das-ui-radio-vertical": i(k) == "vertical" },
208
220
  name: e.name,
209
221
  disabled: e.disabled,
210
222
  value: i(l),
211
- "onUpdate:value": o[4] || (o[4] = (a) => $(l) ? l.value = a : l = a)
223
+ "onUpdate:value": u[4] || (u[4] = (a) => I(l) ? l.value = a : l = a)
212
224
  }, e.$attrs, {
213
225
  buttonStyle: "solid",
214
- onChange: R
226
+ onChange: F
215
227
  }), {
216
- default: m(() => [
217
- (u(!0), s(
218
- y,
228
+ default: y(() => [
229
+ (o(!0), s(
230
+ g,
219
231
  null,
220
- g(T.value, (a) => (u(), b(i(se), q({ ref_for: !0 }, e.$attrs, {
232
+ h(w.value, (a) => (o(), m(i(de), V({ ref_for: !0 }, e.$attrs, {
221
233
  value: a.value,
222
234
  disabled: a.disabled,
223
235
  key: a.value
224
236
  }), {
225
- default: m(() => [
226
- S(e.$slots, "default", { item: a }, () => [
227
- V(
228
- v(a.label),
229
- 1
230
- /* TEXT */
231
- )
237
+ default: y(() => [
238
+ C(e.$slots, "default", { item: a }, () => [
239
+ R((o(), s(
240
+ "div",
241
+ {
242
+ style: b(q.value)
243
+ },
244
+ [
245
+ B(
246
+ p(a.label),
247
+ 1
248
+ /* TEXT */
249
+ )
250
+ ],
251
+ 4
252
+ /* STYLE */
253
+ )), [
254
+ [i(D)]
255
+ ])
232
256
  ])
233
257
  ]),
234
258
  _: 2
@@ -241,17 +265,17 @@ const ne = {
241
265
  _: 3
242
266
  /* FORWARDED */
243
267
  }, 16, ["class", "name", "disabled", "value"])) : t("v-if", !0),
244
- e.radioType == "group" && e.optionType == "square" && !e.isView ? (u(), s(
268
+ e.radioType == "group" && e.optionType == "square" && !e.isView ? (o(), s(
245
269
  "div",
246
270
  {
247
271
  key: 4,
248
- class: r(["das-ui-radio-square-group", { "das-ui-radio-vertical": i(h) == "vertical" }])
272
+ class: r(["das-ui-radio-square-group", { "das-ui-radio-vertical": i(k) == "vertical" }])
249
273
  },
250
274
  [
251
- (u(!0), s(
252
- y,
275
+ (o(!0), s(
276
+ g,
253
277
  null,
254
- g(T.value, (a, n) => (u(), s("div", {
278
+ h(w.value, (a, n) => (o(), s("div", {
255
279
  class: r([
256
280
  "das-ui-radio-square",
257
281
  {
@@ -260,24 +284,36 @@ const ne = {
260
284
  "das-ui-radio-square--focus": a.isFocus
261
285
  }
262
286
  ]),
263
- onClick: (A) => D("group", a),
264
- onBlur: (A) => N("group", a),
287
+ onClick: (L) => W("group", a),
288
+ onBlur: (L) => O("group", a),
265
289
  tabindex: n,
266
290
  key: n
267
291
  }, [
268
- i(l) ? (u(), s("span", pe, [
269
- F(i(W), {
292
+ i(l) ? (o(), s("span", ve, [
293
+ N(i(A), {
270
294
  size: "mini",
271
295
  icon: "select",
272
296
  iconColor: "#fff",
273
297
  class: "view-icon"
274
298
  })
275
299
  ])) : t("v-if", !0),
276
- V(
277
- " " + v(a.label),
278
- 1
279
- /* TEXT */
280
- )
300
+ R((o(), s(
301
+ "div",
302
+ {
303
+ style: b(q.value)
304
+ },
305
+ [
306
+ B(
307
+ p(a.label),
308
+ 1
309
+ /* TEXT */
310
+ )
311
+ ],
312
+ 4
313
+ /* STYLE */
314
+ )), [
315
+ [i(D)]
316
+ ])
281
317
  ], 42, fe))),
282
318
  128
283
319
  /* KEYED_FRAGMENT */
@@ -287,38 +323,38 @@ const ne = {
287
323
  /* CLASS */
288
324
  )) : t("v-if", !0),
289
325
  t("多选 查看状态 "),
290
- e.isView ? (u(), s(
326
+ e.isView ? (o(), s(
291
327
  "div",
292
328
  {
293
329
  key: 5,
294
- class: r(["das-ui-radio-view-group", { "flex-view": B.value.length > 1 }])
330
+ class: r(["das-ui-radio-view-group", { "flex-view": z.value.length > 1 }])
295
331
  },
296
332
  [
297
- B.value.length ? (u(!0), s(
298
- y,
333
+ z.value.length ? (o(!0), s(
334
+ g,
299
335
  { key: 0 },
300
- g(B.value, (a, n) => (u(), s(
336
+ h(z.value, (a, n) => (o(), s(
301
337
  "div",
302
338
  {
303
- class: r(["das-radio-item-view", a[i(p).label] && "nonelabel-item-view"]),
339
+ class: r(["das-radio-item-view", a[i(v).label] && "nonelabel-item-view"]),
304
340
  key: n
305
341
  },
306
342
  [
307
- F(i(W), {
343
+ N(i(A), {
308
344
  size: "mini",
309
345
  icon: "select",
310
346
  iconColor: "#666",
311
347
  class: "view-icon"
312
348
  }),
313
- oe((u(), s(
349
+ R((o(), s(
314
350
  "div",
315
351
  {
316
- class: r(["label", a[i(p).label] && "label-min-width"]),
317
- style: E([Q.value, { color: "#666" }])
352
+ class: r(["label", a[i(v).label] && "label-min-width"]),
353
+ style: b([q.value, { color: "#666" }])
318
354
  },
319
355
  [
320
- V(
321
- v(a[i(p).label]),
356
+ B(
357
+ p(a[i(v).label]),
322
358
  1
323
359
  /* TEXT */
324
360
  )
@@ -326,7 +362,7 @@ const ne = {
326
362
  6
327
363
  /* CLASS, STYLE */
328
364
  )), [
329
- [i(de)]
365
+ [i(D)]
330
366
  ])
331
367
  ],
332
368
  2
@@ -334,10 +370,10 @@ const ne = {
334
370
  ))),
335
371
  128
336
372
  /* KEYED_FRAGMENT */
337
- )) : (u(), s(
373
+ )) : (o(), s(
338
374
  "span",
339
- ve,
340
- v(H.value),
375
+ pe,
376
+ p(Q.value),
341
377
  1
342
378
  /* TEXT */
343
379
  ))
@@ -346,17 +382,17 @@ const ne = {
346
382
  /* CLASS */
347
383
  )) : t("v-if", !0),
348
384
  t(" 用于过滤条件单选 "),
349
- e.radioType == "group" && e.optionType == "filterSquare" ? (u(), s(
385
+ e.radioType == "group" && e.optionType == "filterSquare" ? (o(), s(
350
386
  "div",
351
387
  {
352
388
  key: 6,
353
- class: r(["das-ui-radio-square-group das-ui-radio-filter-square-group", { "das-ui-radio-vertical": i(h) == "vertical" }])
389
+ class: r(["das-ui-radio-square-group das-ui-radio-filter-square-group", { "das-ui-radio-vertical": i(k) == "vertical" }])
354
390
  },
355
391
  [
356
- (u(!0), s(
357
- y,
392
+ (o(!0), s(
393
+ g,
358
394
  null,
359
- g(T.value, (a, n) => (u(), s("div", {
395
+ h(w.value, (a, n) => (o(), s("div", {
360
396
  class: r([
361
397
  "das-ui-radio-square",
362
398
  {
@@ -364,10 +400,10 @@ const ne = {
364
400
  "das-ui-radio-square--checked": i(l) == a.value
365
401
  }
366
402
  ]),
367
- onClick: (A) => D("group", a),
403
+ onClick: (L) => W("group", a),
368
404
  tabindex: n,
369
405
  key: n
370
- }, v(a.label), 11, ce))),
406
+ }, p(a.label), 11, ce))),
371
407
  128
372
408
  /* KEYED_FRAGMENT */
373
409
  ))
@@ -395,7 +431,7 @@ const ne = {
395
431
  "--das-ui-radio-filter-bgcolor": "#fff"
396
432
  };
397
433
  re(me);
398
- const Ve = () => L(null), Ce = ue(be);
434
+ const Ve = () => j(null), Ce = se(be);
399
435
  export {
400
436
  Ce as DasRadio,
401
437
  Ve as DasRadioRef,
@@ -14,8 +14,8 @@ declare const changeRadioSquare: (type: string, row: any) => void;
14
14
  declare const blurRadioSquare: (type: string, row: any) => void;
15
15
  declare const textWidth: import("vue").ComputedRef<string | undefined>;
16
16
  declare const computedStyle: import("vue").ComputedRef<{
17
- '--radio-height': string | undefined;
18
- '--radio-font-size': string | undefined;
17
+ '--radio-height': string;
18
+ '--radio-font-size': string;
19
19
  }>;
20
20
  declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
21
21
  declare var __VLS_9: {}, __VLS_15: {}, __VLS_29: {