@dazhicheng/ui 1.6.46 → 1.6.47

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.
@@ -14,10 +14,12 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
14
14
  getValue: () => PanelSelectModelValue;
15
15
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
16
16
  change: (val: unknown, options: PanelSelectOption[], currentOption: PanelSelectOption | PanelSelectOption[] | undefined) => any;
17
+ focus: (ev: FocusEvent) => any;
17
18
  "update:modelValue": (value: PanelSelectModelValue) => any;
18
19
  "visible-change": (val: boolean) => any;
19
20
  }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
20
21
  onChange?: ((val: unknown, options: PanelSelectOption[], currentOption: PanelSelectOption | PanelSelectOption[] | undefined) => any) | undefined;
22
+ onFocus?: ((ev: FocusEvent) => any) | undefined;
21
23
  "onUpdate:modelValue"?: ((value: PanelSelectModelValue) => any) | undefined;
22
24
  "onVisible-change"?: ((val: boolean) => any) | undefined;
23
25
  }>, {
@@ -1,8 +1,8 @@
1
- import { defineComponent as ze, mergeModels as I, useModel as je, computed as u, watch as O, ref as v, useTemplateRef as M, unref as r, onMounted as qe, createElementBlock as z, openBlock as A, normalizeClass as j, createVNode as q, mergeProps as He, withCtx as Je, withDirectives as Qe, normalizeStyle as Xe, createBlock as H, createCommentVNode as J, nextTick as E } from "vue";
1
+ import { defineComponent as je, mergeModels as I, useModel as qe, computed as u, watch as M, ref as v, useTemplateRef as E, unref as r, onMounted as He, createElementBlock as z, openBlock as A, normalizeClass as j, createVNode as q, mergeProps as Je, withCtx as Qe, withDirectives as Xe, normalizeStyle as Ye, createBlock as H, createCommentVNode as J, nextTick as F } from "vue";
2
2
  import "../../../node_modules/.pnpm/vue-types@5.1.3_vue@3.5.34_typescript@5.9.3_/node_modules/vue-types/shim/index.modern.js";
3
- import { useDesign as Ye } from "../../../packages/hooks/src/useDesign.js";
3
+ import { useDesign as Ze } from "../../../packages/hooks/src/useDesign.js";
4
4
  import "axios";
5
- import { ElSelect as Ze, vLoading as el } from "element-plus";
5
+ import { ElSelect as el, vLoading as ll } from "element-plus";
6
6
  import "dayjs";
7
7
  import "numeral";
8
8
  import "xe-utils";
@@ -15,16 +15,16 @@ import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-
15
15
  import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
16
16
  import "lodash-es";
17
17
  import "vue-router";
18
- import { useResizeObserver as ll } from "@vueuse/core";
19
- import { useSelectCollapseOptions as tl } from "../../tt-form/src/hooks/useSelectCollapse.js";
20
- import { ALL as al, DEFAULT_PANEL_SELECT_SEPARATORS as ol } from "./common.js";
21
- import nl from "./components/PanelLeft.vue.js";
22
- import il from "./components/PanelMiddle.vue.js";
23
- import rl from "./components/PanelRight.vue.js";
24
- import { usePanelSelectData as ul } from "./hooks/usePanelData.js";
25
- import { usePanelSelectSelection as sl } from "./hooks/usePanelSelection.js";
18
+ import { useResizeObserver as tl } from "@vueuse/core";
19
+ import { useSelectCollapseOptions as al } from "../../tt-form/src/hooks/useSelectCollapse.js";
20
+ import { ALL as ol, DEFAULT_PANEL_SELECT_SEPARATORS as nl } from "./common.js";
21
+ import il from "./components/PanelLeft.vue.js";
22
+ import rl from "./components/PanelMiddle.vue.js";
23
+ import ul from "./components/PanelRight.vue.js";
24
+ import { usePanelSelectData as sl } from "./hooks/usePanelData.js";
25
+ import { usePanelSelectSelection as cl } from "./hooks/usePanelSelection.js";
26
26
  /* empty css */
27
- const m = 4, Tl = /* @__PURE__ */ ze({
27
+ const m = 4, Gl = /* @__PURE__ */ je({
28
28
  name: "TtPanelSelect",
29
29
  __name: "index",
30
30
  props: /* @__PURE__ */ I({
@@ -47,11 +47,11 @@ const m = 4, Tl = /* @__PURE__ */ ze({
47
47
  immediate: { type: Boolean, default: !0 },
48
48
  beforeFetch: { type: Function, default: void 0 },
49
49
  afterFetch: { type: Function, default: void 0 },
50
- separator: { default: () => [...ol] },
50
+ separator: { default: () => [...nl] },
51
51
  pasteSearch: { type: Boolean, default: !0 },
52
52
  alwaysLoad: { type: Boolean, default: !1 },
53
53
  showAll: { type: Boolean, default: !0 },
54
- showAllField: { default: al },
54
+ showAllField: { default: ol },
55
55
  showPinyinMode: { type: Boolean, default: !1 },
56
56
  showOriginMode: { type: Boolean, default: !0 },
57
57
  leftPlaceholder: { default: "支持模糊搜索" },
@@ -61,9 +61,9 @@ const m = 4, Tl = /* @__PURE__ */ ze({
61
61
  modelValue: {},
62
62
  modelModifiers: {}
63
63
  }),
64
- emits: /* @__PURE__ */ I(["visible-change", "change"], ["update:modelValue"]),
64
+ emits: /* @__PURE__ */ I(["visible-change", "change", "focus"], ["update:modelValue"]),
65
65
  setup(s, { expose: Q, emit: X }) {
66
- const Y = el, Z = Ze, t = s, F = X, { prefixCls: p } = Ye("panel-select"), {
66
+ const Y = ll, Z = el, t = s, C = X, { prefixCls: p } = Ze("panel-select"), {
67
67
  loading: ee,
68
68
  fetchApi: f,
69
69
  treeOptions: le,
@@ -72,13 +72,13 @@ const m = 4, Tl = /* @__PURE__ */ ze({
72
72
  leafNodes: h,
73
73
  isFirstLoaded: ae,
74
74
  buildOptionGroups: oe
75
- } = ul(t), n = je(s, "modelValue");
75
+ } = sl(t), n = qe(s, "modelValue");
76
76
  let L;
77
77
  const P = u(() => t.disabled), ne = u(() => {
78
78
  const e = /* @__PURE__ */ new Map();
79
79
  return h.value.forEach((l) => e.set(l.value, l.label)), e;
80
80
  });
81
- function C(e) {
81
+ function x(e) {
82
82
  return e === t.showAllField ? { label: "全部", value: t.showAllField } : { label: ne.value.get(e) ?? String(e), value: e };
83
83
  }
84
84
  function $(e) {
@@ -93,19 +93,19 @@ const m = 4, Tl = /* @__PURE__ */ ze({
93
93
  n.value = t.multiple ? [...e] : e.at(-1);
94
94
  }
95
95
  });
96
- O([() => t.multiple, () => n.value], ([e, l]) => {
96
+ M([() => t.multiple, () => n.value], ([e, l]) => {
97
97
  if (e) {
98
98
  Array.isArray(l) || (n.value = l === void 0 ? [] : [l]);
99
99
  return;
100
100
  }
101
101
  Array.isArray(l) && (n.value = l.at(-1));
102
102
  });
103
- const x = v(), y = v(""), w = v(""), b = v(), S = M("middleRef"), g = M("selectWrapRef"), N = M("selectRef"), V = v(0);
103
+ const b = v(), y = v(""), w = v(""), S = v(), V = E("middleRef"), g = E("selectWrapRef"), N = E("selectRef"), O = v(0);
104
104
  function B() {
105
105
  const e = g.value;
106
- e && (V.value = e.offsetWidth);
106
+ e && (O.value = e.offsetWidth);
107
107
  }
108
- ll(g, () => B());
108
+ tl(g, () => B());
109
109
  const re = u(() => ({
110
110
  componentProps: {
111
111
  multiple: t.multiple,
@@ -116,7 +116,7 @@ const m = 4, Tl = /* @__PURE__ */ ze({
116
116
  component: "TtPanelSelect",
117
117
  selectWrapRef: g,
118
118
  selectRef: N
119
- })), { selectComponentProps: ue } = tl(re), T = u(() => {
119
+ })), { selectComponentProps: ue } = al(re), T = u(() => {
120
120
  const e = y.value.trim().toLowerCase();
121
121
  if (!e) return R.value;
122
122
  const l = (a) => {
@@ -172,7 +172,7 @@ const m = 4, Tl = /* @__PURE__ */ ze({
172
172
  clearSelected: Ce,
173
173
  removeSelected: xe,
174
174
  withLockedSelectedValues: be
175
- } = sl({
175
+ } = cl({
176
176
  multiple: u(() => t.multiple),
177
177
  modelValue: n,
178
178
  selectedValues: ie,
@@ -181,12 +181,12 @@ const m = 4, Tl = /* @__PURE__ */ ze({
181
181
  }), W = u({
182
182
  get() {
183
183
  if (t.multiple)
184
- return (Array.isArray(n.value) ? n.value : n.value === void 0 ? [] : [n.value]).map((l) => C(l));
184
+ return (Array.isArray(n.value) ? n.value : n.value === void 0 ? [] : [n.value]).map((l) => x(l));
185
185
  if (Array.isArray(n.value)) {
186
186
  const e = n.value.at(-1);
187
- return e === void 0 ? void 0 : C(e);
187
+ return e === void 0 ? void 0 : x(e);
188
188
  }
189
- return n.value === void 0 ? void 0 : C(n.value);
189
+ return n.value === void 0 ? void 0 : x(n.value);
190
190
  },
191
191
  set(e) {
192
192
  const l = r(n);
@@ -222,11 +222,11 @@ const m = 4, Tl = /* @__PURE__ */ ze({
222
222
  return (a = l == null ? void 0 : l.path.at(-2)) == null ? void 0 : a.value;
223
223
  }
224
224
  function Fe(e) {
225
- x.value = e.value;
225
+ b.value = e.value;
226
226
  const l = Ee(e);
227
- b.value = void 0, E(() => {
227
+ S.value = void 0, F(() => {
228
228
  var a;
229
- b.value = l, l !== void 0 && ((a = S.value) == null || a.scrollToGroup(l));
229
+ S.value = l, l !== void 0 && ((a = V.value) == null || a.scrollToGroup(l));
230
230
  });
231
231
  }
232
232
  function Re(e) {
@@ -241,19 +241,19 @@ const m = 4, Tl = /* @__PURE__ */ ze({
241
241
  }
242
242
  async function $e(e) {
243
243
  var l;
244
- F("visible-change", e), e && (w.value = "", y.value = "", await E(), (l = S.value) == null || l.inputFocus(), B(), t.alwaysLoad ? await f() : !t.immediate && !r(ae) && await f());
244
+ C("visible-change", e), e && (w.value = "", y.value = "", await F(), (l = V.value) == null || l.inputFocus(), B(), t.alwaysLoad ? await f() : !t.immediate && !r(ae) && await f());
245
245
  }
246
246
  function Ne() {
247
247
  U(L);
248
248
  }
249
249
  function Be(e) {
250
- F("change", e, [...r(K)], Me(e));
250
+ C("change", e, [...r(K)], Me(e));
251
251
  }
252
252
  function Te(e, l) {
253
253
  return Array.isArray(e) && Array.isArray(l) ? e.length === l.length && e.every((a, o) => a === l[o]) : e === l;
254
254
  }
255
255
  function U(e) {
256
- E(() => {
256
+ F(() => {
257
257
  const l = r(n);
258
258
  Te(l, e) || Be(l);
259
259
  });
@@ -297,20 +297,23 @@ const m = 4, Tl = /* @__PURE__ */ ze({
297
297
  Ce();
298
298
  });
299
299
  }
300
- return O(
300
+ function ze(e) {
301
+ C("focus", e);
302
+ }
303
+ return M(
301
304
  () => t.params,
302
305
  () => {
303
306
  f();
304
307
  },
305
308
  { deep: !0 }
306
- ), O(
309
+ ), M(
307
310
  te,
308
311
  (e) => {
309
312
  var l;
310
- x.value !== void 0 || !e.length || (x.value = (l = e[0]) == null ? void 0 : l.value);
313
+ b.value !== void 0 || !e.length || (b.value = (l = e[0]) == null ? void 0 : l.value);
311
314
  },
312
315
  { immediate: !0 }
313
- ), qe(() => {
316
+ ), He(() => {
314
317
  t.immediate && f();
315
318
  }), Q({
316
319
  /** 重新加载数据源*/
@@ -324,7 +327,7 @@ const m = 4, Tl = /* @__PURE__ */ ze({
324
327
  ref: g,
325
328
  class: j(r(p))
326
329
  }, [
327
- q(r(Z), He({
330
+ q(r(Z), Je({
328
331
  ref_key: "selectRef",
329
332
  ref: N,
330
333
  modelValue: W.value,
@@ -338,19 +341,20 @@ const m = 4, Tl = /* @__PURE__ */ ze({
338
341
  disabled: s.disabled,
339
342
  "popper-class": `${r(p)}__popper vxe-table--ignore-clear`,
340
343
  onVisibleChange: $e,
341
- onChange: Ne
344
+ onChange: Ne,
345
+ onFocus: ze
342
346
  }), {
343
- empty: Je(() => [
344
- Qe((A(), z("div", {
347
+ empty: Qe(() => [
348
+ Xe((A(), z("div", {
345
349
  "element-loading-text": "加载中",
346
350
  class: j(`${r(p)}__panel`),
347
- style: Xe({
351
+ style: Ye({
348
352
  "--columns": ce.value,
349
353
  "--panel-min-width": de.value,
350
- "--panel-width": V.value ? `${V.value}px` : "100%"
354
+ "--panel-width": O.value ? `${O.value}px` : "100%"
351
355
  })
352
356
  }, [
353
- t.showNav ? (A(), H(nl, {
357
+ t.showNav ? (A(), H(il, {
354
358
  key: 0,
355
359
  "prefix-cls": r(p),
356
360
  keyword: y.value,
@@ -360,9 +364,9 @@ const m = 4, Tl = /* @__PURE__ */ ze({
360
364
  "onUpdate:keyword": Re,
361
365
  onSelect: Fe
362
366
  }, null, 8, ["prefix-cls", "keyword", "tree-data", "expanded-keys", "left-placeholder"])) : J("", !0),
363
- q(il, {
367
+ q(rl, {
364
368
  ref_key: "middleRef",
365
- ref: S,
369
+ ref: V,
366
370
  "prefix-cls": r(p),
367
371
  multiple: s.multiple,
368
372
  keyword: w.value,
@@ -375,7 +379,7 @@ const m = 4, Tl = /* @__PURE__ */ ze({
375
379
  "is-all-checked": r(fe),
376
380
  "is-indeterminate": r(he),
377
381
  "all-checked": Oe.value,
378
- "scroll-to-group-value": b.value,
382
+ "scroll-to-group-value": S.value,
379
383
  "group-checked-map": Se.value,
380
384
  "group-indeterminate-map": Ve.value,
381
385
  "paste-search": s.pasteSearch,
@@ -388,7 +392,7 @@ const m = 4, Tl = /* @__PURE__ */ ze({
388
392
  onOptionCheck: Ke,
389
393
  onOptionsCheck: Ue
390
394
  }, null, 8, ["prefix-cls", "multiple", "keyword", "rows", "disabled", "show-all", "selected-value-set", "is-all-checked", "is-indeterminate", "all-checked", "scroll-to-group-value", "group-checked-map", "group-indeterminate-map", "paste-search", "separator", "middle-placeholder"]),
391
- t.multiple ? (A(), H(rl, {
395
+ t.multiple ? (A(), H(ul, {
392
396
  key: 1,
393
397
  "prefix-cls": r(p),
394
398
  multiple: s.multiple,
@@ -407,5 +411,5 @@ const m = 4, Tl = /* @__PURE__ */ ze({
407
411
  }
408
412
  });
409
413
  export {
410
- Tl as default
414
+ Gl as default
411
415
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dazhicheng/ui",
3
- "version": "1.6.46",
3
+ "version": "1.6.47",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",