vft 0.0.507 → 0.0.509

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 (160) hide show
  1. package/dist/index.css +1 -1
  2. package/es/components/carousel/use-carousel.js +1 -1
  3. package/es/components/cascader/cascader.vue2.js +203 -202
  4. package/es/components/cascader-panel/menu.vue2.js +50 -49
  5. package/es/components/clamp-toggle/clamp-toggle.vue2.js +21 -17
  6. package/es/components/color-picker/color-picker.vue2.js +134 -133
  7. package/es/components/config-provider/config-provider.vue.d.ts +2 -0
  8. package/es/components/config-provider/config-provider.vue2.js +5 -4
  9. package/es/components/config-provider/constants.d.ts +1 -0
  10. package/es/components/config-provider/constants.js +3 -2
  11. package/es/components/config-provider/hooks/use-global-config.js +33 -30
  12. package/es/components/config-provider/index.d.ts +9 -0
  13. package/es/components/config-provider/index.js +6 -5
  14. package/es/components/date-picker/composables/use-basic-date-table.d.ts +1 -1
  15. package/es/components/date-picker/composables/use-basic-date-table.js +124 -123
  16. package/es/components/date-picker/composables/use-month-range-header.js +15 -14
  17. package/es/components/date-picker/composables/use-panel-date-range.js +24 -23
  18. package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +39 -38
  19. package/es/components/date-picker/date-picker-com/basic-year-table.vue2.js +39 -38
  20. package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +179 -178
  21. package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +225 -224
  22. package/es/components/date-time-select/date-time-select.vue2.js +39 -36
  23. package/es/components/dropdown/dropdown.vue2.js +68 -67
  24. package/es/components/empty/empty.vue2.js +39 -38
  25. package/es/components/full-screen/full-screen.vue2.js +18 -17
  26. package/es/components/image/image.vue2.js +60 -59
  27. package/es/components/image-viewer/image-viewer.vue2.js +45 -44
  28. package/es/components/index.js +161 -160
  29. package/es/components/input/input.vue2.js +4 -4
  30. package/es/components/input-tag/composables/use-input-tag.js +1 -1
  31. package/es/components/md-container/md-container.vue2.js +75 -74
  32. package/es/components/md-container/toc.js +37 -36
  33. package/es/components/modal/modal-footer-action.vue2.js +25 -24
  34. package/es/components/multiple-tabs/multiple-tabs.vue2.js +16 -15
  35. package/es/components/multiple-tabs/use/use-tab-dropdown.js +54 -53
  36. package/es/components/pagination/components/jumper.vue2.js +29 -28
  37. package/es/components/pagination/components/sizes.vue2.js +21 -20
  38. package/es/components/pagination/components/total.vue2.js +11 -10
  39. package/es/components/popconfirm/popconfirm.vue2.js +40 -39
  40. package/es/components/search/search.vue2.js +79 -77
  41. package/es/components/select/useSelect.js +232 -231
  42. package/es/components/super-form/super-form-action.vue2.js +41 -40
  43. package/es/components/super-form/super-form-item.vue2.js +206 -203
  44. package/es/components/super-form/use/helper.d.ts +1 -1
  45. package/es/components/super-form/use/helper.js +62 -62
  46. package/es/components/table/field.js +130 -110
  47. package/es/components/table/table.vue2.js +152 -150
  48. package/es/components/table/use/use-columns.js +29 -26
  49. package/es/components/table/use/use-data-source.js +87 -86
  50. package/es/components/time-picker/time-picker-com/panel-time-pick.vue2.js +66 -65
  51. package/es/components/time-picker/time-picker-com/panel-time-range.vue2.js +134 -133
  52. package/es/components/transfer/transfer-panel.vue2.js +57 -56
  53. package/es/components/transfer/transfer.vue2.js +70 -69
  54. package/es/components/tree/tree.vue2.js +60 -59
  55. package/es/components/upload/index.d.ts +3 -3
  56. package/es/components/upload/upload-content.vue.d.ts +2 -2
  57. package/es/components/upload/upload-content.vue2.js +78 -75
  58. package/es/components/upload/upload-list.vue2.js +46 -45
  59. package/es/components/upload/upload.vue.d.ts +2 -2
  60. package/es/components/upload/upload.vue2.js +87 -85
  61. package/es/components/upload/utils.js +29 -29
  62. package/es/constants/date.d.ts +1 -1
  63. package/es/constants/date.js +9 -1
  64. package/es/hooks/use-z-index/index.js +3 -3
  65. package/es/index.d.ts +1 -0
  66. package/es/index.js +5 -1
  67. package/es/locale/index.d.js +1 -0
  68. package/es/locale/index.d.ts +26 -0
  69. package/es/locale/index.js +10 -0
  70. package/es/locale/lang/en.d.ts +183 -0
  71. package/es/locale/lang/en.js +241 -0
  72. package/es/locale/lang/zh-cn.d.ts +183 -0
  73. package/es/locale/lang/zh-cn.js +241 -0
  74. package/es/locale/lang/zh-tw.d.ts +183 -0
  75. package/es/locale/lang/zh-tw.js +241 -0
  76. package/es/locale/use-locale.d.ts +17 -0
  77. package/es/locale/use-locale.js +56 -0
  78. package/es/package.json.d.ts +1 -1
  79. package/es/package.json.js +1 -1
  80. package/es/utils/vue/vnode.js +1 -1
  81. package/lib/components/cascader/cascader.vue2.cjs +1 -1
  82. package/lib/components/cascader-panel/menu.vue2.cjs +4 -4
  83. package/lib/components/clamp-toggle/clamp-toggle.vue2.cjs +1 -1
  84. package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
  85. package/lib/components/config-provider/config-provider.vue.d.ts +2 -0
  86. package/lib/components/config-provider/config-provider.vue2.cjs +1 -1
  87. package/lib/components/config-provider/constants.cjs +1 -1
  88. package/lib/components/config-provider/constants.d.ts +1 -0
  89. package/lib/components/config-provider/hooks/use-global-config.cjs +1 -1
  90. package/lib/components/config-provider/index.cjs +1 -1
  91. package/lib/components/config-provider/index.d.ts +9 -0
  92. package/lib/components/date-picker/composables/use-basic-date-table.cjs +1 -1
  93. package/lib/components/date-picker/composables/use-basic-date-table.d.ts +1 -1
  94. package/lib/components/date-picker/composables/use-month-range-header.cjs +1 -1
  95. package/lib/components/date-picker/composables/use-panel-date-range.cjs +1 -1
  96. package/lib/components/date-picker/date-picker-com/basic-month-table.vue2.cjs +1 -1
  97. package/lib/components/date-picker/date-picker-com/basic-year-table.vue2.cjs +1 -1
  98. package/lib/components/date-picker/date-picker-com/panel-date-pick.vue2.cjs +1 -1
  99. package/lib/components/date-picker/date-picker-com/panel-date-range.vue2.cjs +1 -1
  100. package/lib/components/date-time-select/date-time-select.vue2.cjs +1 -1
  101. package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
  102. package/lib/components/empty/empty.vue2.cjs +1 -1
  103. package/lib/components/full-screen/full-screen.vue2.cjs +1 -1
  104. package/lib/components/image/image.vue2.cjs +1 -1
  105. package/lib/components/image-viewer/image-viewer.vue2.cjs +1 -1
  106. package/lib/components/index.cjs +1 -1
  107. package/lib/components/input/input.vue2.cjs +1 -1
  108. package/lib/components/md-container/md-container.vue2.cjs +1 -1
  109. package/lib/components/md-container/toc.cjs +1 -1
  110. package/lib/components/modal/modal-footer-action.vue2.cjs +1 -1
  111. package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
  112. package/lib/components/multiple-tabs/use/use-tab-dropdown.cjs +1 -1
  113. package/lib/components/pagination/components/jumper.vue2.cjs +1 -1
  114. package/lib/components/pagination/components/sizes.vue2.cjs +1 -1
  115. package/lib/components/pagination/components/total.vue2.cjs +1 -1
  116. package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
  117. package/lib/components/search/search.vue2.cjs +1 -1
  118. package/lib/components/select/useSelect.cjs +1 -1
  119. package/lib/components/super-form/super-form-action.vue2.cjs +1 -1
  120. package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
  121. package/lib/components/super-form/use/helper.cjs +1 -1
  122. package/lib/components/super-form/use/helper.d.ts +1 -1
  123. package/lib/components/table/field.cjs +1 -1
  124. package/lib/components/table/table.vue2.cjs +1 -1
  125. package/lib/components/table/use/use-columns.cjs +1 -1
  126. package/lib/components/table/use/use-data-source.cjs +1 -1
  127. package/lib/components/time-picker/time-picker-com/panel-time-pick.vue2.cjs +1 -1
  128. package/lib/components/time-picker/time-picker-com/panel-time-range.vue2.cjs +1 -1
  129. package/lib/components/transfer/transfer-panel.vue2.cjs +1 -1
  130. package/lib/components/transfer/transfer.vue2.cjs +1 -1
  131. package/lib/components/tree/tree.vue2.cjs +1 -1
  132. package/lib/components/upload/index.d.ts +3 -3
  133. package/lib/components/upload/upload-content.vue.d.ts +2 -2
  134. package/lib/components/upload/upload-content.vue2.cjs +1 -1
  135. package/lib/components/upload/upload-list.vue2.cjs +1 -1
  136. package/lib/components/upload/upload.vue.d.ts +2 -2
  137. package/lib/components/upload/upload.vue2.cjs +1 -1
  138. package/lib/components/upload/utils.cjs +1 -1
  139. package/lib/constants/date.cjs +1 -1
  140. package/lib/constants/date.d.ts +1 -1
  141. package/lib/index.cjs +1 -1
  142. package/lib/index.d.ts +1 -0
  143. package/lib/locale/index.cjs +1 -0
  144. package/lib/locale/index.d.cjs +1 -0
  145. package/lib/locale/index.d.ts +26 -0
  146. package/lib/locale/lang/en.cjs +1 -0
  147. package/lib/locale/lang/en.d.ts +183 -0
  148. package/lib/locale/lang/zh-cn.cjs +1 -0
  149. package/lib/locale/lang/zh-cn.d.ts +183 -0
  150. package/lib/locale/lang/zh-tw.cjs +1 -0
  151. package/lib/locale/lang/zh-tw.d.ts +183 -0
  152. package/lib/locale/use-locale.cjs +1 -0
  153. package/lib/locale/use-locale.d.ts +17 -0
  154. package/lib/package.json.cjs +1 -1
  155. package/lib/package.json.d.ts +1 -1
  156. package/package.json +3 -3
  157. package/theme-style/index.css +1 -1
  158. package/theme-style/src/super-form.scss +0 -1
  159. package/theme-style/vft-super-form.css +1 -1
  160. package/web-types.json +1 -1
@@ -1,38 +1,39 @@
1
1
  import "../../pagination/index.js";
2
- import { isFunction as B, isBoolean as ee, delObjAttrNotExist as te, isString as ae, isEmptyObject as re, isNullOrUndefined as M, isObject as k, isNumber as q, isPlainObject as ne } from "@vft/utils";
3
- import { merge as ie, get as H } from "lodash-es";
4
- import { ref as O, watchEffect as oe, unref as i, watch as L, computed as se, onMounted as le, nextTick as U } from "vue";
5
- import { PageSize as ce } from "../constants.js";
6
- function he(m, {
2
+ import { useLocale as et } from "../../../locale/use-locale.js";
3
+ import { isFunction as E, isBoolean as at, delObjAttrNotExist as rt, isString as nt, isEmptyObject as it, isNullOrUndefined as M, isObject as k, isNumber as q, isPlainObject as ot } from "@vft/utils";
4
+ import { merge as st, get as H } from "lodash-es";
5
+ import { ref as B, watchEffect as lt, unref as i, watch as L, computed as ct, onMounted as ut, nextTick as U } from "vue";
6
+ import { PageSize as ft } from "../constants.js";
7
+ function pt(m, {
7
8
  tableData: V,
8
- setLoading: P,
9
+ setLoading: O,
9
10
  getPaginationInfo: D,
10
11
  setPagination: h,
11
12
  getGridRef: C
12
- }, x) {
13
- const f = O([]), z = O({});
14
- oe(() => {
13
+ }, P) {
14
+ const { t: W } = et(), f = B([]), x = B({});
15
+ lt(() => {
15
16
  V.value = i(f);
16
17
  }), L(
17
18
  () => i(m).data,
18
19
  () => {
19
- const { data: e, api: t } = i(m);
20
- !t && e && (f.value = e);
20
+ const { data: t, api: e } = i(m);
21
+ !e && t && (f.value = t);
21
22
  },
22
23
  {
23
24
  immediate: !0
24
25
  }
25
26
  );
26
- function W(e) {
27
- h(e), T({});
27
+ function X(t) {
28
+ h(t), T({});
28
29
  }
29
- const E = se(() => {
30
- const e = i(f);
31
- return !e || e.length === 0 ? i(f) : i(f);
30
+ const z = ct(() => {
31
+ const t = i(f);
32
+ return !t || t.length === 0 ? i(f) : i(f);
32
33
  });
33
- async function T(e) {
34
+ async function T(t) {
34
35
  const {
35
- api: t,
36
+ api: e,
36
37
  fetchSetting: r = {},
37
38
  beforeFetch: a,
38
39
  afterFetch: o,
@@ -41,9 +42,9 @@ function he(m, {
41
42
  transformParams: w,
42
43
  extraParams: u
43
44
  } = i(m);
44
- if (!(!t || !B(t)))
45
+ if (!(!e || !E(e)))
45
46
  try {
46
- P(!0);
47
+ O(!0);
47
48
  const { pageField: n, sizeField: d, listField: I, totalField: y } = Object.assign(
48
49
  {},
49
50
  {
@@ -54,28 +55,28 @@ function he(m, {
54
55
  },
55
56
  r
56
57
  );
57
- let g = {}, l = e;
58
- const { currentPage: j = 1, pageSize: _ = ce } = i(
58
+ let g = {}, l = t;
59
+ const { currentPage: j = 1, pageSize: _ = ft } = i(
59
60
  D
60
61
  );
61
62
  if (w) {
62
- if (ee(s) && !s)
63
+ if (at(s) && !s)
63
64
  g = {};
64
65
  else {
65
- const p = e && e.page || j;
66
+ const p = t && t.page || j;
66
67
  g[n] = s?.pageIsZero ? p - 1 : p, g[d] = _;
67
68
  }
68
- if (l = ie(e, g), a && B(a)) {
69
+ if (l = st(t, g), a && E(a)) {
69
70
  const p = await a(l);
70
71
  l = { ...l, ...p };
71
72
  }
72
- c && te(
73
+ c && rt(
73
74
  l,
74
- ae(c) ? c === "strict" : !1
75
+ nt(c) ? c === "strict" : !1
75
76
  );
76
77
  }
77
- l && !re(l) && !M(u) ? k(l) && k(u) && (l = Object.assign({}, l, u)) : M(u) || (l = u);
78
- const F = await t(l), N = Array.isArray(F);
78
+ l && !it(l) && !M(u) ? k(l) && k(u) && (l = Object.assign({}, l, u)) : M(u) || (l = u);
79
+ const F = await e(l), N = Array.isArray(F);
79
80
  let b = N ? F : H(F, I);
80
81
  const S = N ? F.length : H(F, y);
81
82
  if (Number(S)) {
@@ -83,57 +84,57 @@ function he(m, {
83
84
  if (j > p)
84
85
  return h({
85
86
  currentPage: p
86
- }), await T(e);
87
+ }), await T(t);
87
88
  }
88
- return o && B(o) && (b = await o(b) || b), f.value = b, z.value = b, h({
89
+ return o && E(o) && (b = await o(b) || b), f.value = b, x.value = b, h({
89
90
  total: S || 0
90
- }), e && e.page && h({
91
- currentPage: e.page || 1
92
- }), x("fetch-success", {
91
+ }), t && t.page && h({
92
+ currentPage: t.page || 1
93
+ }), P("fetch-success", {
93
94
  items: i(b),
94
95
  total: S
95
96
  }), b;
96
97
  } catch (n) {
97
- console.log(n), x("fetch-error", n), f.value = [], h({
98
+ console.log(n), P("fetch-error", n), f.value = [], h({
98
99
  total: 0
99
100
  });
100
101
  } finally {
101
102
  U(() => {
102
- P(!1);
103
+ O(!1);
103
104
  });
104
105
  }
105
106
  }
106
107
  function v() {
107
- return z.value;
108
+ return x.value;
108
109
  }
109
- async function X(e) {
110
+ async function Z(t) {
110
111
  return h({
111
- currentPage: e?.page || 1
112
- }), await T(e);
112
+ currentPage: t?.page || 1
113
+ }), await T(t);
113
114
  }
114
- async function Z(e, t, r) {
115
- return f.value[e] && (f.value[e][t] = r), f.value[e];
115
+ async function J(t, e, r) {
116
+ return f.value[t] && (f.value[t][e] = r), f.value[t];
116
117
  }
117
- function J(e, t) {
118
- const r = C(), a = r.getRowById(e);
118
+ function Q(t, e) {
119
+ const r = C(), a = r.getRowById(t);
119
120
  if (!a) return;
120
121
  const s = i(m).treeConfig;
121
122
  if (!!s && s?.parentField) {
122
- const w = s.parentField, u = a[w], n = t[w], d = (g) => g == null || g === "" ? null : g, I = d(u), y = d(n);
123
+ const w = s.parentField, u = a[w], n = e[w], d = (g) => g == null || g === "" ? null : g, I = d(u), y = d(n);
123
124
  if (I !== y) {
124
125
  if (r.remove(a), y !== null) {
125
126
  const l = r.getRowById(y);
126
- l ? r.insertChild(t, l) : r.insert(t);
127
+ l ? r.insertChild(e, l) : r.insert(e);
127
128
  } else
128
- r.insert(t);
129
+ r.insert(e);
129
130
  const g = s.rowField || "id";
130
- return r.getRowById(t[g]);
131
+ return r.getRowById(e[g]);
131
132
  }
132
133
  }
133
- return r.setRow(a, t), a;
134
+ return r.setRow(a, e), a;
134
135
  }
135
- async function Q(e, t = 0, r) {
136
- const a = ne(e) ? [e] : e, o = a.length, s = i(m), c = C();
136
+ async function Y(t, e = 0, r) {
137
+ const a = ot(t) ? [t] : t, o = a.length, s = i(m), c = C();
137
138
  if (!!s.treeConfig)
138
139
  if (r != null && r !== "") {
139
140
  const n = c.getRowById(r);
@@ -146,7 +147,7 @@ function he(m, {
146
147
  } else
147
148
  for (const n of a)
148
149
  await c.insert(n);
149
- else if (t === -1)
150
+ else if (e === -1)
150
151
  for (const n of a)
151
152
  await c.insertAt(n, -1);
152
153
  else
@@ -160,55 +161,55 @@ function he(m, {
160
161
  }
161
162
  return i(f);
162
163
  }
163
- function Y(e, t) {
164
- const r = C(), a = e != null ? Array.isArray(e) ? e : [e] : t != null ? Array.isArray(t) ? t.map((s) => r.getRowById(s)).filter(Boolean) : r.getRowById(t) ? [r.getRowById(t)] : [] : [];
164
+ function $(t, e) {
165
+ const r = C(), a = t != null ? Array.isArray(t) ? t : [t] : e != null ? Array.isArray(e) ? e.map((s) => r.getRowById(s)).filter(Boolean) : r.getRowById(e) ? [r.getRowById(e)] : [] : [];
165
166
  if (!a.length) return;
166
167
  r.remove(a);
167
168
  const { total: o } = i(D);
168
169
  q(o) && h({ total: Math.max(0, o - a.length) });
169
170
  }
170
- function A(e) {
171
- f.value = e;
171
+ function A(t) {
172
+ f.value = t;
172
173
  }
173
- function $() {
174
- return E.value;
174
+ function G() {
175
+ return z.value;
175
176
  }
176
- function G(e) {
177
- const t = String(e).trim().toLowerCase();
178
- if (t) {
177
+ function K(t) {
178
+ const e = String(t).trim().toLowerCase();
179
+ if (e) {
179
180
  const r = v?.()?.filter((a) => {
180
181
  for (const o in a)
181
- if (String(a[o]).trim().toLowerCase()?.includes(t))
182
+ if (String(a[o]).trim().toLowerCase()?.includes(e))
182
183
  return !0;
183
184
  });
184
185
  A(r);
185
186
  } else
186
187
  A(v());
187
188
  }
188
- function K(e) {
189
- const t = C();
190
- !t || !i(m).treeConfig || U(() => {
191
- if (e === void 0 || e === -1) {
192
- t.setAllTreeExpand(!0);
189
+ function tt(t) {
190
+ const e = C();
191
+ !e || !i(m).treeConfig || U(() => {
192
+ if (t === void 0 || t === -1) {
193
+ e.setAllTreeExpand(!0);
193
194
  return;
194
195
  }
195
- const o = t.getTableData().tableData;
196
+ const o = e.getTableData().tableData;
196
197
  if (!o || o.length === 0) {
197
- console.warn("expandTreeLevel: 没有数据可展开");
198
+ console.warn(W("vft.tableError.noDataToExpand"));
198
199
  return;
199
200
  }
200
201
  const s = [], c = (w, u) => {
201
- u > e || w.forEach((n) => {
202
- u <= e && s.push(n);
202
+ u > t || w.forEach((n) => {
203
+ u <= t && s.push(n);
203
204
  const d = n._X_ROW_CHILD;
204
- d && d.length > 0 && u < e && c(d, u + 1);
205
+ d && d.length > 0 && u < t && c(d, u + 1);
205
206
  });
206
207
  };
207
- c(o, 1), s.length > 0 && t.setTreeExpand(s, !0);
208
+ c(o, 1), s.length > 0 && e.setTreeExpand(s, !0);
208
209
  });
209
210
  }
210
- const R = O(!0);
211
- return le(() => {
211
+ const R = B(!0);
212
+ return ut(() => {
212
213
  i(m).immediate && T(), R.value = !1;
213
214
  }), L(
214
215
  () => i(m).api,
@@ -217,19 +218,19 @@ function he(m, {
217
218
  }
218
219
  ), {
219
220
  setTableData: A,
220
- updateTableData: Z,
221
- updateTableDataRecord: J,
222
- insertTableDataRecord: Q,
223
- deleteTableDataRecord: Y,
224
- reload: X,
225
- handleTableChange: W,
226
- getDataSourceRef: E,
227
- getDataSource: $,
221
+ updateTableData: J,
222
+ updateTableDataRecord: Q,
223
+ insertTableDataRecord: Y,
224
+ deleteTableDataRecord: $,
225
+ reload: Z,
226
+ handleTableChange: X,
227
+ getDataSourceRef: z,
228
+ getDataSource: G,
228
229
  getRawDataSource: v,
229
- tableSearch: G,
230
- expandTreeLevel: K
230
+ tableSearch: K,
231
+ expandTreeLevel: tt
231
232
  };
232
233
  }
233
234
  export {
234
- he as useDataSource
235
+ pt as useDataSource
235
236
  };
@@ -1,109 +1,110 @@
1
- import { defineComponent as F, inject as L, ref as C, computed as d, createBlock as Q, openBlock as w, Transition as W, withCtx as X, createElementBlock as Z, createCommentVNode as ee, normalizeClass as r, unref as s, createElementVNode as p, createVNode as te } from "vue";
1
+ import { defineComponent as Q, inject as W, ref as w, computed as d, createBlock as X, openBlock as T, Transition as Z, withCtx as ee, createElementBlock as te, createCommentVNode as ne, normalizeClass as r, unref as n, createElementVNode as p, createVNode as oe, toDisplayString as A } from "vue";
2
2
  import f from "dayjs";
3
- import { EVENT_CODE as ne } from "../../../constants/aria.js";
3
+ import { EVENT_CODE as se } from "../../../constants/aria.js";
4
4
  import "@vueuse/core";
5
- import { isUndefined as oe } from "@vft/utils";
5
+ import { isUndefined as ae } from "@vft/utils";
6
6
  import "../../config-provider/hooks/use-global-config.js";
7
7
  import "lodash-es";
8
8
  import "../../form/index.js";
9
- import { useNamespace as se } from "../../../hooks/use-namespace/index.js";
9
+ import { useNamespace as ie } from "../../../hooks/use-namespace/index.js";
10
10
  import "../../../hooks/use-model-toggle/index.js";
11
11
  import "@popperjs/core";
12
12
  import "../../../hooks/use-z-index/index.js";
13
- import { PICKER_BASE_INJECTION_KEY as ae } from "../constants.js";
14
- import { panelTimePickerProps as ie } from "../props/panel-time-picker.js";
15
- import { useTimePanel as re } from "../composables/use-time-panel.js";
16
- import { useOldValue as le, buildAvailableTimeSlotGetter as ce } from "../composables/use-time-picker.js";
17
- import pe from "./basic-time-spinner.vue2.js";
18
- const _e = /* @__PURE__ */ F({
13
+ import { useLocale as re } from "../../../locale/use-locale.js";
14
+ import { PICKER_BASE_INJECTION_KEY as le } from "../constants.js";
15
+ import { panelTimePickerProps as ce } from "../props/panel-time-picker.js";
16
+ import { useTimePanel as pe } from "../composables/use-time-panel.js";
17
+ import { useOldValue as me, buildAvailableTimeSlotGetter as ue } from "../composables/use-time-picker.js";
18
+ import de from "./basic-time-spinner.vue2.js";
19
+ const Pe = /* @__PURE__ */ Q({
19
20
  __name: "panel-time-pick",
20
- props: ie,
21
+ props: ce,
21
22
  emits: ["pick", "select-range", "set-picker-option"],
22
- setup(T, { emit: A }) {
23
- const n = T, o = A, R = L(ae), {
24
- arrowControl: E,
23
+ setup(R, { emit: E }) {
24
+ const o = R, s = E, _ = W(le), {
25
+ arrowControl: D,
25
26
  disabledHours: b,
26
27
  disabledMinutes: g,
27
28
  disabledSeconds: v,
28
- defaultValue: _
29
- } = R.props, { getAvailableHours: N, getAvailableMinutes: O, getAvailableSeconds: D } = ce(b, g, v), i = se("time"), u = C("zh-cn"), k = C([0, 2]), y = le(n), I = d(() => oe(n.actualVisible) ? `${i.namespace.value}-zoom-in-top` : ""), l = d(() => n.format.includes("ss")), P = d(() => n.format.includes("A") ? "A" : n.format.includes("a") ? "a" : ""), B = (e) => {
30
- const t = f(e).locale(u.value), a = m(t);
29
+ defaultValue: N
30
+ } = _.props, { getAvailableHours: O, getAvailableMinutes: P, getAvailableSeconds: y } = ue(b, g, v), i = ie("time"), { t: k } = re(), m = w("zh-cn"), h = w([0, 2]), I = me(o), B = d(() => ae(o.actualVisible) ? `${i.namespace.value}-zoom-in-top` : ""), l = d(() => o.format.includes("ss")), K = d(() => o.format.includes("A") ? "A" : o.format.includes("a") ? "a" : ""), x = (e) => {
31
+ const t = f(e).locale(m.value), a = u(t);
31
32
  return t.isSame(a);
32
- }, K = () => {
33
- o("pick", y.value, !1);
34
- }, x = (e = !1, t = !1) => {
35
- t || o("pick", n.parsedValue, e);
36
- }, z = (e) => {
37
- if (!n.visible)
38
- return;
39
- const t = m(e).millisecond(0);
40
- o("pick", t, !0);
41
- }, M = (e, t) => {
42
- o("select-range", e, t), k.value = [e, t];
33
+ }, z = () => {
34
+ s("pick", I.value, !1);
35
+ }, M = (e = !1, t = !1) => {
36
+ t || s("pick", o.parsedValue, e);
43
37
  }, U = (e) => {
38
+ if (!o.visible)
39
+ return;
40
+ const t = u(e).millisecond(0);
41
+ s("pick", t, !0);
42
+ }, $ = (e, t) => {
43
+ s("select-range", e, t), h.value = [e, t];
44
+ }, j = (e) => {
44
45
  const t = [0, 3].concat(l.value ? [6] : []), a = ["hours", "minutes"].concat(
45
46
  l.value ? ["seconds"] : []
46
- ), c = (t.indexOf(k.value[0]) + e + t.length) % t.length;
47
- h.start_emitSelectRange(a[c]);
48
- }, $ = (e) => {
49
- const t = e.code, { left: a, right: V, up: c, down: q } = ne;
50
- if ([a, V].includes(t)) {
51
- U(t === a ? -1 : 1), e.preventDefault();
47
+ ), c = (t.indexOf(h.value[0]) + e + t.length) % t.length;
48
+ V.start_emitSelectRange(a[c]);
49
+ }, H = (e) => {
50
+ const t = e.code, { left: a, right: S, up: c, down: F } = se;
51
+ if ([a, S].includes(t)) {
52
+ j(t === a ? -1 : 1), e.preventDefault();
52
53
  return;
53
54
  }
54
- if ([c, q].includes(t)) {
55
- const S = t === c ? -1 : 1;
56
- h.start_scrollDown(S), e.preventDefault();
55
+ if ([c, F].includes(t)) {
56
+ const C = t === c ? -1 : 1;
57
+ V.start_scrollDown(C), e.preventDefault();
57
58
  }
58
- }, { timePickerOptions: h, onSetOption: j, getAvailableTime: H } = re({
59
- getAvailableHours: N,
60
- getAvailableMinutes: O,
61
- getAvailableSeconds: D
62
- }), m = (e) => H(e, n.datetimeRole || "", !0), G = (e) => e ? f(e, n.format).locale(u.value) : null, J = (e) => e ? e.format(n.format) : null, Y = () => f(_).locale(u.value);
63
- return o("set-picker-option", ["isValidValue", B]), o("set-picker-option", ["formatToString", J]), o("set-picker-option", ["parseUserInput", G]), o("set-picker-option", ["handleKeydownInput", $]), o("set-picker-option", ["getRangeAvailableTime", m]), o("set-picker-option", ["getDefaultValue", Y]), (e, t) => (w(), Q(W, { name: I.value }, {
64
- default: X(() => [
65
- e.actualVisible || e.visible ? (w(), Z("div", {
59
+ }, { timePickerOptions: V, onSetOption: G, getAvailableTime: J } = pe({
60
+ getAvailableHours: O,
61
+ getAvailableMinutes: P,
62
+ getAvailableSeconds: y
63
+ }), u = (e) => J(e, o.datetimeRole || "", !0), L = (e) => e ? f(e, o.format).locale(m.value) : null, Y = (e) => e ? e.format(o.format) : null, q = () => f(N).locale(m.value);
64
+ return s("set-picker-option", ["isValidValue", x]), s("set-picker-option", ["formatToString", Y]), s("set-picker-option", ["parseUserInput", L]), s("set-picker-option", ["handleKeydownInput", H]), s("set-picker-option", ["getRangeAvailableTime", u]), s("set-picker-option", ["getDefaultValue", q]), (e, t) => (T(), X(Z, { name: B.value }, {
65
+ default: ee(() => [
66
+ e.actualVisible || e.visible ? (T(), te("div", {
66
67
  key: 0,
67
- class: r(s(i).b("panel"))
68
+ class: r(n(i).b("panel"))
68
69
  }, [
69
70
  p("div", {
70
- class: r([s(i).be("panel", "content"), { "has-seconds": l.value }])
71
+ class: r([n(i).be("panel", "content"), { "has-seconds": l.value }])
71
72
  }, [
72
- te(pe, {
73
+ oe(de, {
73
74
  ref: "spinner",
74
75
  role: e.datetimeRole || "start",
75
- "arrow-control": s(E),
76
+ "arrow-control": n(D),
76
77
  "show-seconds": l.value,
77
- "am-pm-mode": P.value,
78
+ "am-pm-mode": K.value,
78
79
  "spinner-date": e.parsedValue,
79
- "disabled-hours": s(b),
80
- "disabled-minutes": s(g),
81
- "disabled-seconds": s(v),
82
- onChange: z,
83
- onSetOption: s(j),
84
- onSelectRange: M
80
+ "disabled-hours": n(b),
81
+ "disabled-minutes": n(g),
82
+ "disabled-seconds": n(v),
83
+ onChange: U,
84
+ onSetOption: n(G),
85
+ onSelectRange: $
85
86
  }, null, 8, ["role", "arrow-control", "show-seconds", "am-pm-mode", "spinner-date", "disabled-hours", "disabled-minutes", "disabled-seconds", "onSetOption"])
86
87
  ], 2),
87
88
  p("div", {
88
- class: r(s(i).be("panel", "footer"))
89
+ class: r(n(i).be("panel", "footer"))
89
90
  }, [
90
91
  p("button", {
91
92
  type: "button",
92
- class: r(["cancel", [s(i).be("panel", "btn")]]),
93
- onClick: K
94
- }, " 取消 ", 2),
93
+ class: r(["cancel", [n(i).be("panel", "btn")]]),
94
+ onClick: z
95
+ }, A(n(k)("vft.timePicker.cancel")), 3),
95
96
  p("button", {
96
97
  type: "button",
97
- class: r(["confirm", [s(i).be("panel", "btn")]]),
98
- onClick: t[0] || (t[0] = (a) => x())
99
- }, " 确认 ", 2)
98
+ class: r(["confirm", [n(i).be("panel", "btn")]]),
99
+ onClick: t[0] || (t[0] = (a) => M())
100
+ }, A(n(k)("vft.timePicker.confirm")), 3)
100
101
  ], 2)
101
- ], 2)) : ee("", !0)
102
+ ], 2)) : ne("", !0)
102
103
  ]),
103
104
  _: 1
104
105
  }, 8, ["name"]));
105
106
  }
106
107
  });
107
108
  export {
108
- _e as default
109
+ Pe as default
109
110
  };