@1337exp/taoui 1.13.1 → 2.1.0
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.
- package/README.md +83 -14
- package/README.ru.md +631 -561
- package/dist/index.cjs +1208 -614
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +765 -380
- package/dist/index.mjs +1209 -615
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -4785
- package/package.json +66 -61
- package/src/styles/index.css +3 -1
- package/src/styles/primitives.css +42 -5
- package/src/styles/size.css +57 -0
- package/src/styles/surface.css +102 -0
package/dist/index.mjs
CHANGED
|
@@ -1,20 +1,34 @@
|
|
|
1
|
-
import { defineComponent, openBlock, createElementBlock, normalizeClass, createCommentVNode, toDisplayString, createElementVNode, renderSlot, computed, normalizeStyle, inject, useId, ref,
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, createCommentVNode, toDisplayString, createElementVNode, renderSlot, computed, normalizeStyle, getCurrentInstance, camelize, inject, useId, ref, shallowRef, watch, createTextVNode, useSlots, onBeforeUnmount, createBlock, Teleport, createVNode, Transition, withCtx, nextTick, Fragment, renderList, onMounted, provide, resolveDynamicComponent, withModifiers, useCssVars, reactive, onBeforeMount, withDirectives, vModelText, mergeProps, TransitionGroup, onUpdated, createApp } from "vue";
|
|
2
|
+
const sizes = ["small", "medium", "large"];
|
|
3
|
+
function sizeClass(size) {
|
|
4
|
+
return size ? `tao-size-${size}` : void 0;
|
|
5
|
+
}
|
|
6
|
+
function resolveSize(el, size) {
|
|
7
|
+
if (size) {
|
|
8
|
+
return size;
|
|
9
|
+
}
|
|
10
|
+
if (!el || typeof getComputedStyle === "undefined") {
|
|
11
|
+
return "medium";
|
|
12
|
+
}
|
|
13
|
+
const value = getComputedStyle(el).getPropertyValue("--tao-size").trim();
|
|
14
|
+
return sizes.includes(value) ? value : "medium";
|
|
15
|
+
}
|
|
2
16
|
const _hoisted_1$P = ["type", "disabled"];
|
|
3
17
|
const _hoisted_2$I = {
|
|
4
18
|
key: 0,
|
|
5
19
|
class: "tao-button__loader"
|
|
6
20
|
};
|
|
7
|
-
const _hoisted_3$
|
|
21
|
+
const _hoisted_3$z = {
|
|
8
22
|
key: 1,
|
|
9
23
|
class: "tao-button__icon"
|
|
10
24
|
};
|
|
11
|
-
const _hoisted_4$
|
|
25
|
+
const _hoisted_4$u = { class: "tao-button__content" };
|
|
12
26
|
const _sfc_main$Z = /* @__PURE__ */ defineComponent({
|
|
13
27
|
...{ name: "TaoButton" },
|
|
14
28
|
__name: "TaoButton",
|
|
15
29
|
props: {
|
|
16
30
|
type: { default: "button" },
|
|
17
|
-
size: {
|
|
31
|
+
size: {},
|
|
18
32
|
variant: { default: "primary" },
|
|
19
33
|
tone: { default: "" },
|
|
20
34
|
disabled: { type: Boolean, default: false },
|
|
@@ -34,7 +48,7 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
|
|
|
34
48
|
return (_ctx, _cache) => {
|
|
35
49
|
return openBlock(), createElementBlock("button", {
|
|
36
50
|
class: normalizeClass(["tao-button", [
|
|
37
|
-
|
|
51
|
+
unref(sizeClass)(__props.size),
|
|
38
52
|
`tao-button--${__props.variant}`,
|
|
39
53
|
{
|
|
40
54
|
"tao-button--disabled": __props.disabled,
|
|
@@ -49,8 +63,8 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
|
|
|
49
63
|
onClick: handleClick
|
|
50
64
|
}, [
|
|
51
65
|
__props.loading ? (openBlock(), createElementBlock("span", _hoisted_2$I)) : createCommentVNode("", true),
|
|
52
|
-
__props.icon ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
53
|
-
createElementVNode("span", _hoisted_4$
|
|
66
|
+
__props.icon ? (openBlock(), createElementBlock("span", _hoisted_3$z, toDisplayString(__props.icon), 1)) : createCommentVNode("", true),
|
|
67
|
+
createElementVNode("span", _hoisted_4$u, [
|
|
54
68
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
55
69
|
])
|
|
56
70
|
], 10, _hoisted_1$P);
|
|
@@ -64,7 +78,19 @@ const _export_sfc = (sfc, props) => {
|
|
|
64
78
|
}
|
|
65
79
|
return target;
|
|
66
80
|
};
|
|
67
|
-
const TaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["__scopeId", "data-v-
|
|
81
|
+
const TaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["__scopeId", "data-v-eb25f649"]]);
|
|
82
|
+
function toCssLength(value) {
|
|
83
|
+
if (value === void 0 || value === null || value === "") {
|
|
84
|
+
return void 0;
|
|
85
|
+
}
|
|
86
|
+
return typeof value === "number" ? `${value}px` : value;
|
|
87
|
+
}
|
|
88
|
+
function toCssBox(value) {
|
|
89
|
+
return Array.isArray(value) ? value.map((part) => toCssLength(part) ?? "0").join(" ") : toCssLength(value);
|
|
90
|
+
}
|
|
91
|
+
function surfaceClass(surface) {
|
|
92
|
+
return surface && surface !== "flat" ? `tao-surface-${surface}` : void 0;
|
|
93
|
+
}
|
|
68
94
|
const _sfc_main$Y = /* @__PURE__ */ defineComponent({
|
|
69
95
|
...{ name: "TaoBlock" },
|
|
70
96
|
__name: "TaoBlock",
|
|
@@ -72,24 +98,16 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
|
|
|
72
98
|
padding: { default: 16 },
|
|
73
99
|
radius: { default: 8 },
|
|
74
100
|
shadow: { type: Boolean, default: true },
|
|
75
|
-
hover: { type: Boolean, default: false }
|
|
101
|
+
hover: { type: Boolean, default: false },
|
|
102
|
+
surface: { default: "flat" }
|
|
76
103
|
},
|
|
77
104
|
setup(__props) {
|
|
78
105
|
const props = __props;
|
|
79
|
-
const paddingStyle = computed(() => {
|
|
80
|
-
|
|
81
|
-
return {
|
|
82
|
-
padding: `${props.padding.map((p) => `${p}px`).join(" ")}`
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
return { padding: `${props.padding}px` };
|
|
86
|
-
});
|
|
87
|
-
const radiusStyle = computed(() => ({
|
|
88
|
-
borderRadius: `${props.radius}px`
|
|
89
|
-
}));
|
|
106
|
+
const paddingStyle = computed(() => ({ padding: toCssBox(props.padding) }));
|
|
107
|
+
const radiusStyle = computed(() => ({ borderRadius: toCssLength(props.radius) }));
|
|
90
108
|
return (_ctx, _cache) => {
|
|
91
109
|
return openBlock(), createElementBlock("div", {
|
|
92
|
-
class: normalizeClass(["tao-block", { "tao-block--shadow": __props.shadow, "tao-block--hover": __props.hover }]),
|
|
110
|
+
class: normalizeClass(["tao-block", [unref(surfaceClass)(__props.surface), { "tao-block--shadow": __props.shadow, "tao-block--hover": __props.hover }]]),
|
|
93
111
|
style: normalizeStyle([paddingStyle.value, radiusStyle.value])
|
|
94
112
|
}, [
|
|
95
113
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
@@ -97,20 +115,57 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
|
|
|
97
115
|
};
|
|
98
116
|
}
|
|
99
117
|
});
|
|
100
|
-
const TaoBlock = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["__scopeId", "data-v-
|
|
118
|
+
const TaoBlock = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["__scopeId", "data-v-3d9abbef"]]);
|
|
101
119
|
const formFieldKey = Symbol("taoFormField");
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
120
|
+
function isDev() {
|
|
121
|
+
try {
|
|
122
|
+
return process.env.NODE_ENV !== "production";
|
|
123
|
+
} catch {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
const warned = /* @__PURE__ */ new Set();
|
|
128
|
+
function deprecationWarning(component, what, instead) {
|
|
129
|
+
if (!isDev()) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const key = `${component}:${what}`;
|
|
133
|
+
if (warned.has(key)) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
warned.add(key);
|
|
137
|
+
console.warn(`[TaoUI] ${component}: ${what} is deprecated — ${instead}. It will be removed in 3.0.`);
|
|
138
|
+
}
|
|
139
|
+
function warnDeprecated(component, replacements) {
|
|
140
|
+
var _a;
|
|
141
|
+
if (!isDev()) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const passed = (_a = getCurrentInstance()) == null ? void 0 : _a.vnode.props;
|
|
145
|
+
if (!passed) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const names = new Set(Object.keys(passed).map((name) => camelize(name)));
|
|
149
|
+
for (const [name, instead] of Object.entries(replacements)) {
|
|
150
|
+
if (!names.has(name)) {
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
const isListener = /^on[A-Z]/.test(name);
|
|
154
|
+
const label = isListener ? `event "${name[2].toLowerCase()}${name.slice(3)}"` : `prop "${name}"`;
|
|
155
|
+
deprecationWarning(component, label, instead);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
const _hoisted_1$O = ["for"];
|
|
159
|
+
const _hoisted_2$H = {
|
|
105
160
|
key: 0,
|
|
106
161
|
class: "tao-input__affix tao-input__affix--prefix"
|
|
107
162
|
};
|
|
108
|
-
const
|
|
109
|
-
const
|
|
163
|
+
const _hoisted_3$y = ["id", "type", "value", "placeholder", "disabled", "aria-invalid", "aria-describedby"];
|
|
164
|
+
const _hoisted_4$t = {
|
|
110
165
|
key: 1,
|
|
111
166
|
class: "tao-input__affix tao-input__affix--suffix"
|
|
112
167
|
};
|
|
113
|
-
const
|
|
168
|
+
const _hoisted_5$m = {
|
|
114
169
|
key: 1,
|
|
115
170
|
class: "tao-input__error"
|
|
116
171
|
};
|
|
@@ -122,6 +177,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
122
177
|
type: { default: "text" },
|
|
123
178
|
placeholder: { default: "" },
|
|
124
179
|
disabled: { type: Boolean, default: false },
|
|
180
|
+
size: {},
|
|
125
181
|
error: { type: Boolean, default: false },
|
|
126
182
|
errorMessage: { default: "" },
|
|
127
183
|
label: { default: "" },
|
|
@@ -149,13 +205,19 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
149
205
|
focused.value = true;
|
|
150
206
|
emit("focus", event);
|
|
151
207
|
}
|
|
208
|
+
warnDeprecated("TaoInput", {
|
|
209
|
+
label: "use `label` of TaoFormField",
|
|
210
|
+
errorMessage: "use `error` of TaoFormField"
|
|
211
|
+
});
|
|
152
212
|
return (_ctx, _cache) => {
|
|
153
|
-
return openBlock(), createElementBlock("div",
|
|
213
|
+
return openBlock(), createElementBlock("div", {
|
|
214
|
+
class: normalizeClass(["tao-input-wrapper", unref(sizeClass)(__props.size)])
|
|
215
|
+
}, [
|
|
154
216
|
__props.label && !unref(field) ? (openBlock(), createElementBlock("label", {
|
|
155
217
|
key: 0,
|
|
156
218
|
class: "tao-input__label",
|
|
157
219
|
for: controlId.value
|
|
158
|
-
}, toDisplayString(__props.label), 9,
|
|
220
|
+
}, toDisplayString(__props.label), 9, _hoisted_1$O)) : createCommentVNode("", true),
|
|
159
221
|
createElementVNode("div", {
|
|
160
222
|
class: normalizeClass(["tao-input-shell", {
|
|
161
223
|
"tao-input-shell--focused": focused.value,
|
|
@@ -165,7 +227,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
165
227
|
"tao-input-shell--suffix": _ctx.$slots.suffix
|
|
166
228
|
}])
|
|
167
229
|
}, [
|
|
168
|
-
_ctx.$slots.prefix ? (openBlock(), createElementBlock("span",
|
|
230
|
+
_ctx.$slots.prefix ? (openBlock(), createElementBlock("span", _hoisted_2$H, [
|
|
169
231
|
renderSlot(_ctx.$slots, "prefix", {}, void 0, true)
|
|
170
232
|
])) : createCommentVNode("", true),
|
|
171
233
|
createElementVNode("input", {
|
|
@@ -180,29 +242,32 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
180
242
|
onInput: handleInput,
|
|
181
243
|
onBlur: handleBlur,
|
|
182
244
|
onFocus: handleFocus
|
|
183
|
-
}, null, 42,
|
|
184
|
-
_ctx.$slots.suffix ? (openBlock(), createElementBlock("span",
|
|
245
|
+
}, null, 42, _hoisted_3$y),
|
|
246
|
+
_ctx.$slots.suffix ? (openBlock(), createElementBlock("span", _hoisted_4$t, [
|
|
185
247
|
renderSlot(_ctx.$slots, "suffix", {}, void 0, true)
|
|
186
248
|
])) : createCommentVNode("", true)
|
|
187
249
|
], 2),
|
|
188
|
-
__props.error && __props.errorMessage ? (openBlock(), createElementBlock("span",
|
|
189
|
-
]);
|
|
250
|
+
__props.error && __props.errorMessage ? (openBlock(), createElementBlock("span", _hoisted_5$m, toDisplayString(__props.errorMessage), 1)) : createCommentVNode("", true)
|
|
251
|
+
], 2);
|
|
190
252
|
};
|
|
191
253
|
}
|
|
192
254
|
});
|
|
193
|
-
const TaoInput = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__scopeId", "data-v-
|
|
255
|
+
const TaoInput = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__scopeId", "data-v-aca887be"]]);
|
|
194
256
|
const _hoisted_1$N = {
|
|
195
257
|
key: 0,
|
|
196
258
|
class: "tao-input-group__addon tao-input-group__addon--before"
|
|
197
259
|
};
|
|
198
260
|
const _hoisted_2$G = { class: "tao-input-group__field" };
|
|
199
|
-
const _hoisted_3$
|
|
261
|
+
const _hoisted_3$x = {
|
|
200
262
|
key: 1,
|
|
201
263
|
class: "tao-input-group__addon tao-input-group__addon--after"
|
|
202
264
|
};
|
|
203
265
|
const _sfc_main$W = /* @__PURE__ */ defineComponent({
|
|
204
266
|
...{ name: "TaoInputGroup" },
|
|
205
267
|
__name: "TaoInputGroup",
|
|
268
|
+
props: {
|
|
269
|
+
size: {}
|
|
270
|
+
},
|
|
206
271
|
setup(__props) {
|
|
207
272
|
const focused = ref(false);
|
|
208
273
|
function onFocusIn() {
|
|
@@ -217,7 +282,7 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent({
|
|
|
217
282
|
}
|
|
218
283
|
return (_ctx, _cache) => {
|
|
219
284
|
return openBlock(), createElementBlock("div", {
|
|
220
|
-
class: normalizeClass(["tao-input-group", { "tao-input-group--focused": focused.value }]),
|
|
285
|
+
class: normalizeClass(["tao-input-group", [unref(sizeClass)(__props.size), { "tao-input-group--focused": focused.value }]]),
|
|
221
286
|
role: "group",
|
|
222
287
|
onFocusin: onFocusIn,
|
|
223
288
|
onFocusout: onFocusOut
|
|
@@ -228,21 +293,342 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent({
|
|
|
228
293
|
createElementVNode("div", _hoisted_2$G, [
|
|
229
294
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
230
295
|
]),
|
|
231
|
-
_ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
296
|
+
_ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_3$x, [
|
|
232
297
|
renderSlot(_ctx.$slots, "after", {}, void 0, true)
|
|
233
298
|
])) : createCommentVNode("", true)
|
|
234
299
|
], 34);
|
|
235
300
|
};
|
|
236
301
|
}
|
|
237
302
|
});
|
|
238
|
-
const TaoInputGroup = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["__scopeId", "data-v-
|
|
303
|
+
const TaoInputGroup = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["__scopeId", "data-v-55b2d297"]]);
|
|
304
|
+
const localeRu = {
|
|
305
|
+
code: "ru-RU",
|
|
306
|
+
alert: { closeLabel: "Закрыть" },
|
|
307
|
+
avatar: {
|
|
308
|
+
fallbackLabel: "Аватар",
|
|
309
|
+
notificationsLabel: "{count} уведомлений",
|
|
310
|
+
dotLabels: {
|
|
311
|
+
success: "в сети",
|
|
312
|
+
danger: "занят",
|
|
313
|
+
warning: "отошёл",
|
|
314
|
+
info: "статус",
|
|
315
|
+
neutral: "не в сети"
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
breadcrumb: { ariaLabel: "Хлебные крошки" },
|
|
319
|
+
carousel: {
|
|
320
|
+
ariaLabel: "Лента",
|
|
321
|
+
prevLabel: "Назад",
|
|
322
|
+
nextLabel: "Вперёд",
|
|
323
|
+
dotsLabel: "Слайды",
|
|
324
|
+
slideLabel: "Слайд {n} из {count}"
|
|
325
|
+
},
|
|
326
|
+
combobox: {
|
|
327
|
+
placeholder: "Начните вводить",
|
|
328
|
+
emptyText: "Ничего не найдено",
|
|
329
|
+
clearText: "Очистить",
|
|
330
|
+
createText: "Добавить «{text}»"
|
|
331
|
+
},
|
|
332
|
+
confirm: { ok: "ОК", cancel: "Отмена" },
|
|
333
|
+
copy: { copyLabel: "Копировать", successText: "Скопировано!" },
|
|
334
|
+
date: {
|
|
335
|
+
placeholder: "Дата",
|
|
336
|
+
todayText: "Сегодня",
|
|
337
|
+
clearText: "Очистить",
|
|
338
|
+
prevMonthLabel: "Предыдущий месяц",
|
|
339
|
+
nextMonthLabel: "Следующий месяц"
|
|
340
|
+
},
|
|
341
|
+
dateRange: {
|
|
342
|
+
placeholder: "Период",
|
|
343
|
+
todayText: "Сегодня",
|
|
344
|
+
clearText: "Очистить",
|
|
345
|
+
prevMonthLabel: "Предыдущий месяц",
|
|
346
|
+
nextMonthLabel: "Следующий месяц"
|
|
347
|
+
},
|
|
348
|
+
drawer: { closeLabel: "Закрыть" },
|
|
349
|
+
dropdownMenu: { menuLabel: "Меню" },
|
|
350
|
+
empty: { title: "Ничего нет" },
|
|
351
|
+
fileDrop: {
|
|
352
|
+
clearLabel: "Очистить файлы",
|
|
353
|
+
removeLabel: "Убрать «{name}»",
|
|
354
|
+
zoneText: "Перетащите файл сюда или нажмите, чтобы выбрать",
|
|
355
|
+
units: ["Б", "КБ", "МБ"],
|
|
356
|
+
decimalSeparator: ","
|
|
357
|
+
},
|
|
358
|
+
inputNumber: { incrementLabel: "Увеличить", decrementLabel: "Уменьшить" },
|
|
359
|
+
list: { emptyText: "Ничего нет" },
|
|
360
|
+
modal: { closeLabel: "Закрыть" },
|
|
361
|
+
pagination: {
|
|
362
|
+
ariaLabel: "Пагинация",
|
|
363
|
+
prevLabel: "Назад",
|
|
364
|
+
nextLabel: "Вперёд",
|
|
365
|
+
pageLabel: "Страница {page}",
|
|
366
|
+
jumpPrevLabel: "Назад на {n} страниц",
|
|
367
|
+
jumpNextLabel: "Вперёд на {n} страниц",
|
|
368
|
+
totalText: "{from}–{to} из {total}",
|
|
369
|
+
emptyTotalText: "0 из 0"
|
|
370
|
+
},
|
|
371
|
+
quantity: { decrementLabel: "Уменьшить", removeLabel: "Убрать", incrementLabel: "Увеличить" },
|
|
372
|
+
scrollTop: { ariaLabel: "Наверх" },
|
|
373
|
+
select: { placeholder: "Выберите", clearText: "Очистить" },
|
|
374
|
+
stages: {
|
|
375
|
+
ariaLabel: "Стадии",
|
|
376
|
+
statusLabels: { wait: "ожидание", work: "в работе", ok: "готово", bad: "ошибка" }
|
|
377
|
+
},
|
|
378
|
+
table: { emptyText: "Нет данных" },
|
|
379
|
+
tag: { closeLabel: "Убрать" },
|
|
380
|
+
toast: { closeLabel: "Закрыть уведомление" }
|
|
381
|
+
};
|
|
382
|
+
const confirmDefaults = {
|
|
383
|
+
ok: localeRu.confirm.ok,
|
|
384
|
+
cancel: localeRu.confirm.cancel,
|
|
385
|
+
surface: "glass"
|
|
386
|
+
};
|
|
387
|
+
const currentConfirm = ref(null);
|
|
388
|
+
const queue = [];
|
|
389
|
+
function configureConfirmDefaults(partial) {
|
|
390
|
+
Object.assign(confirmDefaults, partial);
|
|
391
|
+
}
|
|
392
|
+
function pump() {
|
|
393
|
+
if (currentConfirm.value) {
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
currentConfirm.value = queue.shift() ?? null;
|
|
397
|
+
}
|
|
398
|
+
function enqueueConfirm(record) {
|
|
399
|
+
queue.push(record);
|
|
400
|
+
pump();
|
|
401
|
+
}
|
|
402
|
+
function resolveConfirm(value) {
|
|
403
|
+
const item = currentConfirm.value;
|
|
404
|
+
if (!item) {
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
currentConfirm.value = null;
|
|
408
|
+
item.resolve(value);
|
|
409
|
+
pump();
|
|
410
|
+
}
|
|
411
|
+
let viewportMounts$1 = 0;
|
|
412
|
+
function registerConfirmHost() {
|
|
413
|
+
viewportMounts$1 += 1;
|
|
414
|
+
}
|
|
415
|
+
function unregisterConfirmHost() {
|
|
416
|
+
viewportMounts$1 = Math.max(0, viewportMounts$1 - 1);
|
|
417
|
+
}
|
|
418
|
+
function hasConfirmHost() {
|
|
419
|
+
if (viewportMounts$1 > 0) {
|
|
420
|
+
return true;
|
|
421
|
+
}
|
|
422
|
+
if (typeof document === "undefined") {
|
|
423
|
+
return false;
|
|
424
|
+
}
|
|
425
|
+
return Boolean(document.querySelector("[data-tao-confirm-host]"));
|
|
426
|
+
}
|
|
427
|
+
const TOAST_POSITIONS = [
|
|
428
|
+
"topRight",
|
|
429
|
+
"topLeft",
|
|
430
|
+
"topCenter",
|
|
431
|
+
"bottomRight",
|
|
432
|
+
"bottomLeft",
|
|
433
|
+
"bottomCenter",
|
|
434
|
+
"center"
|
|
435
|
+
];
|
|
436
|
+
const toastDefaults = {
|
|
437
|
+
position: "topCenter",
|
|
438
|
+
timeout: 3e3,
|
|
439
|
+
closable: true,
|
|
440
|
+
progress: true,
|
|
441
|
+
closeLabel: localeRu.toast.closeLabel,
|
|
442
|
+
surface: "glass"
|
|
443
|
+
};
|
|
444
|
+
const toasts = ref([]);
|
|
445
|
+
const toastsByPosition = computed(() => {
|
|
446
|
+
const grouped = {};
|
|
447
|
+
for (const position of TOAST_POSITIONS) {
|
|
448
|
+
grouped[position] = [];
|
|
449
|
+
}
|
|
450
|
+
for (const toast2 of toasts.value) {
|
|
451
|
+
grouped[toast2.position].push(toast2);
|
|
452
|
+
}
|
|
453
|
+
return grouped;
|
|
454
|
+
});
|
|
455
|
+
function configureToastDefaults(partial) {
|
|
456
|
+
Object.assign(toastDefaults, partial);
|
|
457
|
+
}
|
|
458
|
+
function addToast(record) {
|
|
459
|
+
if (record.displayMode === "once" && record.dedupeId) {
|
|
460
|
+
const exists = toasts.value.some((item) => item.dedupeId === record.dedupeId);
|
|
461
|
+
if (exists) {
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
if (record.displayMode === "replace" && record.dedupeId) {
|
|
466
|
+
toasts.value = toasts.value.filter((item) => item.dedupeId !== record.dedupeId);
|
|
467
|
+
}
|
|
468
|
+
toasts.value = [...toasts.value, record];
|
|
469
|
+
}
|
|
470
|
+
function removeToast(id) {
|
|
471
|
+
var _a;
|
|
472
|
+
const item = toasts.value.find((toast2) => toast2.id === id);
|
|
473
|
+
if (!item) {
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
toasts.value = toasts.value.filter((toast2) => toast2.id !== id);
|
|
477
|
+
(_a = item.onClosed) == null ? void 0 : _a.call(item);
|
|
478
|
+
}
|
|
479
|
+
function dismissToasts(id) {
|
|
480
|
+
if (id) {
|
|
481
|
+
removeToast(id);
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
const items = toasts.value;
|
|
485
|
+
toasts.value = [];
|
|
486
|
+
items.forEach((item) => {
|
|
487
|
+
var _a;
|
|
488
|
+
return (_a = item.onClosed) == null ? void 0 : _a.call(item);
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
let viewportMounts = 0;
|
|
492
|
+
function registerToastViewport() {
|
|
493
|
+
viewportMounts += 1;
|
|
494
|
+
}
|
|
495
|
+
function unregisterToastViewport() {
|
|
496
|
+
viewportMounts = Math.max(0, viewportMounts - 1);
|
|
497
|
+
}
|
|
498
|
+
function hasToastViewport() {
|
|
499
|
+
if (viewportMounts > 0) {
|
|
500
|
+
return true;
|
|
501
|
+
}
|
|
502
|
+
if (typeof document === "undefined") {
|
|
503
|
+
return false;
|
|
504
|
+
}
|
|
505
|
+
return Boolean(document.querySelector("[data-tao-toast-viewport]"));
|
|
506
|
+
}
|
|
507
|
+
const localeEn = {
|
|
508
|
+
code: "en-US",
|
|
509
|
+
alert: { closeLabel: "Close" },
|
|
510
|
+
avatar: {
|
|
511
|
+
fallbackLabel: "Avatar",
|
|
512
|
+
notificationsLabel: "{count} notifications",
|
|
513
|
+
dotLabels: {
|
|
514
|
+
success: "online",
|
|
515
|
+
danger: "busy",
|
|
516
|
+
warning: "away",
|
|
517
|
+
info: "status",
|
|
518
|
+
neutral: "offline"
|
|
519
|
+
}
|
|
520
|
+
},
|
|
521
|
+
breadcrumb: { ariaLabel: "Breadcrumb" },
|
|
522
|
+
carousel: {
|
|
523
|
+
ariaLabel: "Carousel",
|
|
524
|
+
prevLabel: "Previous",
|
|
525
|
+
nextLabel: "Next",
|
|
526
|
+
dotsLabel: "Slides",
|
|
527
|
+
slideLabel: "Slide {n} of {count}"
|
|
528
|
+
},
|
|
529
|
+
combobox: {
|
|
530
|
+
placeholder: "Start typing",
|
|
531
|
+
emptyText: "Nothing found",
|
|
532
|
+
clearText: "Clear",
|
|
533
|
+
createText: "Add “{text}”"
|
|
534
|
+
},
|
|
535
|
+
confirm: { ok: "OK", cancel: "Cancel" },
|
|
536
|
+
copy: { copyLabel: "Copy", successText: "Copied!" },
|
|
537
|
+
date: {
|
|
538
|
+
placeholder: "Date",
|
|
539
|
+
todayText: "Today",
|
|
540
|
+
clearText: "Clear",
|
|
541
|
+
prevMonthLabel: "Previous month",
|
|
542
|
+
nextMonthLabel: "Next month"
|
|
543
|
+
},
|
|
544
|
+
dateRange: {
|
|
545
|
+
placeholder: "Period",
|
|
546
|
+
todayText: "Today",
|
|
547
|
+
clearText: "Clear",
|
|
548
|
+
prevMonthLabel: "Previous month",
|
|
549
|
+
nextMonthLabel: "Next month"
|
|
550
|
+
},
|
|
551
|
+
drawer: { closeLabel: "Close" },
|
|
552
|
+
dropdownMenu: { menuLabel: "Menu" },
|
|
553
|
+
empty: { title: "Nothing here" },
|
|
554
|
+
fileDrop: {
|
|
555
|
+
clearLabel: "Clear files",
|
|
556
|
+
removeLabel: "Remove “{name}”",
|
|
557
|
+
zoneText: "Drop a file here or click to choose",
|
|
558
|
+
units: ["B", "KB", "MB"],
|
|
559
|
+
decimalSeparator: "."
|
|
560
|
+
},
|
|
561
|
+
inputNumber: { incrementLabel: "Increase", decrementLabel: "Decrease" },
|
|
562
|
+
list: { emptyText: "Nothing here" },
|
|
563
|
+
modal: { closeLabel: "Close" },
|
|
564
|
+
pagination: {
|
|
565
|
+
ariaLabel: "Pagination",
|
|
566
|
+
prevLabel: "Previous",
|
|
567
|
+
nextLabel: "Next",
|
|
568
|
+
pageLabel: "Page {page}",
|
|
569
|
+
jumpPrevLabel: "Back {n} pages",
|
|
570
|
+
jumpNextLabel: "Forward {n} pages",
|
|
571
|
+
totalText: "{from}–{to} of {total}",
|
|
572
|
+
emptyTotalText: "0 of 0"
|
|
573
|
+
},
|
|
574
|
+
quantity: { decrementLabel: "Decrease", removeLabel: "Remove", incrementLabel: "Increase" },
|
|
575
|
+
scrollTop: { ariaLabel: "Back to top" },
|
|
576
|
+
select: { placeholder: "Select", clearText: "Clear" },
|
|
577
|
+
stages: {
|
|
578
|
+
ariaLabel: "Stages",
|
|
579
|
+
statusLabels: { wait: "pending", work: "in progress", ok: "done", bad: "failed" }
|
|
580
|
+
},
|
|
581
|
+
table: { emptyText: "No data" },
|
|
582
|
+
tag: { closeLabel: "Remove" },
|
|
583
|
+
toast: { closeLabel: "Close notification" }
|
|
584
|
+
};
|
|
585
|
+
const current = shallowRef(localeRu);
|
|
586
|
+
function taoLocale() {
|
|
587
|
+
return current.value;
|
|
588
|
+
}
|
|
589
|
+
function isPlainObject(value) {
|
|
590
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
591
|
+
}
|
|
592
|
+
function merge(base, overrides) {
|
|
593
|
+
if (!isPlainObject(base) || !isPlainObject(overrides)) {
|
|
594
|
+
return overrides === void 0 ? base : overrides;
|
|
595
|
+
}
|
|
596
|
+
const out = { ...base };
|
|
597
|
+
for (const [key, value] of Object.entries(overrides)) {
|
|
598
|
+
if (value !== void 0) {
|
|
599
|
+
out[key] = merge(base[key], value);
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
return out;
|
|
603
|
+
}
|
|
604
|
+
function setTaoLocale(locale, base = localeRu) {
|
|
605
|
+
current.value = merge(base, locale);
|
|
606
|
+
configureToastDefaults({ closeLabel: current.value.toast.closeLabel });
|
|
607
|
+
configureConfirmDefaults({ ok: current.value.confirm.ok, cancel: current.value.confirm.cancel });
|
|
608
|
+
}
|
|
609
|
+
function useLocaleText(props, section) {
|
|
610
|
+
return computed(() => {
|
|
611
|
+
const base = current.value[section];
|
|
612
|
+
const own = props;
|
|
613
|
+
const out = { ...base };
|
|
614
|
+
for (const key of Object.keys(base)) {
|
|
615
|
+
if (own[key] !== void 0) {
|
|
616
|
+
out[key] = own[key];
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
return out;
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
function formatText(template, values) {
|
|
623
|
+
return template.replace(/\{(\w+)\}/g, (match, key) => key in values ? String(values[key]) : match);
|
|
624
|
+
}
|
|
239
625
|
const _hoisted_1$M = ["id", "value", "placeholder", "disabled", "aria-invalid", "aria-describedby", "aria-valuenow", "aria-valuemin", "aria-valuemax"];
|
|
240
626
|
const _hoisted_2$F = {
|
|
241
627
|
key: 0,
|
|
242
628
|
class: "tao-input-number__steppers"
|
|
243
629
|
};
|
|
244
|
-
const _hoisted_3$
|
|
245
|
-
const _hoisted_4$
|
|
630
|
+
const _hoisted_3$w = ["aria-label", "disabled"];
|
|
631
|
+
const _hoisted_4$s = { "aria-hidden": "true" };
|
|
246
632
|
const _hoisted_5$l = ["aria-label", "disabled"];
|
|
247
633
|
const _hoisted_6$g = { "aria-hidden": "true" };
|
|
248
634
|
const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
@@ -255,19 +641,22 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
255
641
|
step: { default: 1 },
|
|
256
642
|
precision: {},
|
|
257
643
|
disabled: { type: Boolean, default: false },
|
|
644
|
+
error: { type: Boolean, default: false },
|
|
645
|
+
size: {},
|
|
258
646
|
placeholder: { default: "" },
|
|
259
647
|
controls: { type: Boolean, default: true },
|
|
260
|
-
incrementLabel: {
|
|
261
|
-
decrementLabel: {
|
|
648
|
+
incrementLabel: {},
|
|
649
|
+
decrementLabel: {}
|
|
262
650
|
},
|
|
263
651
|
emits: ["update:modelValue", "commit", "blur", "focus"],
|
|
264
652
|
setup(__props, { emit: __emit }) {
|
|
265
653
|
const props = __props;
|
|
654
|
+
const l10n = useLocaleText(props, "inputNumber");
|
|
266
655
|
const emit = __emit;
|
|
267
656
|
const field = inject(formFieldKey, null);
|
|
268
657
|
const localId = useId();
|
|
269
658
|
const controlId = computed(() => (field == null ? void 0 : field.id) ?? localId);
|
|
270
|
-
const invalid = computed(() => Boolean(field == null ? void 0 : field.invalid.value));
|
|
659
|
+
const invalid = computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
271
660
|
const describedBy = computed(() => field == null ? void 0 : field.describedBy.value);
|
|
272
661
|
const focused = ref(false);
|
|
273
662
|
const draft = ref(toDraft(props.modelValue));
|
|
@@ -379,7 +768,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
379
768
|
const atMax = computed(() => props.max !== void 0 && (props.modelValue ?? 0) >= props.max);
|
|
380
769
|
return (_ctx, _cache) => {
|
|
381
770
|
return openBlock(), createElementBlock("div", {
|
|
382
|
-
class: normalizeClass(["tao-input-number", { "tao-input-number--invalid": invalid.value, "tao-input-number--controls": __props.controls }])
|
|
771
|
+
class: normalizeClass(["tao-input-number", [unref(sizeClass)(__props.size), { "tao-input-number--invalid": invalid.value, "tao-input-number--controls": __props.controls }]])
|
|
383
772
|
}, [
|
|
384
773
|
createElementVNode("input", {
|
|
385
774
|
id: controlId.value,
|
|
@@ -405,21 +794,21 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
405
794
|
createElementVNode("button", {
|
|
406
795
|
type: "button",
|
|
407
796
|
class: "tao-input-number__step",
|
|
408
|
-
"aria-label":
|
|
797
|
+
"aria-label": unref(l10n).incrementLabel,
|
|
409
798
|
tabindex: "-1",
|
|
410
799
|
disabled: __props.disabled || atMax.value,
|
|
411
800
|
onClick: _cache[0] || (_cache[0] = ($event) => bump(1))
|
|
412
801
|
}, [
|
|
413
|
-
createElementVNode("span", _hoisted_4$
|
|
802
|
+
createElementVNode("span", _hoisted_4$s, [
|
|
414
803
|
renderSlot(_ctx.$slots, "increment-icon", {}, () => [
|
|
415
804
|
_cache[2] || (_cache[2] = createTextVNode("+", -1))
|
|
416
805
|
], true)
|
|
417
806
|
])
|
|
418
|
-
], 8, _hoisted_3$
|
|
807
|
+
], 8, _hoisted_3$w),
|
|
419
808
|
createElementVNode("button", {
|
|
420
809
|
type: "button",
|
|
421
810
|
class: "tao-input-number__step",
|
|
422
|
-
"aria-label":
|
|
811
|
+
"aria-label": unref(l10n).decrementLabel,
|
|
423
812
|
tabindex: "-1",
|
|
424
813
|
disabled: __props.disabled || atMin.value,
|
|
425
814
|
onClick: _cache[1] || (_cache[1] = ($event) => bump(-1))
|
|
@@ -435,11 +824,11 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
435
824
|
};
|
|
436
825
|
}
|
|
437
826
|
});
|
|
438
|
-
const TaoInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["__scopeId", "data-v-
|
|
827
|
+
const TaoInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["__scopeId", "data-v-52c1f25a"]]);
|
|
439
828
|
const _hoisted_1$L = ["aria-label", "disabled"];
|
|
440
829
|
const _hoisted_2$E = { "aria-hidden": "true" };
|
|
441
|
-
const _hoisted_3$
|
|
442
|
-
const _hoisted_4$
|
|
830
|
+
const _hoisted_3$v = ["id", "value", "disabled", "aria-invalid", "aria-describedby", "aria-valuenow", "aria-valuemin", "aria-valuemax"];
|
|
831
|
+
const _hoisted_4$r = ["aria-label", "disabled"];
|
|
443
832
|
const _hoisted_5$k = { "aria-hidden": "true" };
|
|
444
833
|
const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
445
834
|
...{ name: "TaoQuantity" },
|
|
@@ -449,20 +838,23 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
|
449
838
|
min: { default: 1 },
|
|
450
839
|
max: {},
|
|
451
840
|
disabled: { type: Boolean, default: false },
|
|
841
|
+
error: { type: Boolean, default: false },
|
|
842
|
+
size: {},
|
|
452
843
|
allowRemove: { type: Boolean, default: true },
|
|
453
844
|
forceMaxLimit: { type: Boolean, default: true },
|
|
454
|
-
decrementLabel: {
|
|
455
|
-
removeLabel: {
|
|
456
|
-
incrementLabel: {
|
|
845
|
+
decrementLabel: {},
|
|
846
|
+
removeLabel: {},
|
|
847
|
+
incrementLabel: {}
|
|
457
848
|
},
|
|
458
849
|
emits: ["update:modelValue", "change", "dec", "inc", "blur", "focus"],
|
|
459
850
|
setup(__props, { emit: __emit }) {
|
|
460
851
|
const props = __props;
|
|
852
|
+
const l10n = useLocaleText(props, "quantity");
|
|
461
853
|
const emit = __emit;
|
|
462
854
|
const field = inject(formFieldKey, null);
|
|
463
855
|
const localId = useId();
|
|
464
856
|
const controlId = computed(() => (field == null ? void 0 : field.id) ?? localId);
|
|
465
|
-
const invalid = computed(() => Boolean(field == null ? void 0 : field.invalid.value));
|
|
857
|
+
const invalid = computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
466
858
|
const describedBy = computed(() => field == null ? void 0 : field.describedBy.value);
|
|
467
859
|
const focused = ref(false);
|
|
468
860
|
const draft = ref(String(props.modelValue));
|
|
@@ -562,14 +954,17 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
|
562
954
|
const atMax = computed(() => props.modelValue >= ceiling.value);
|
|
563
955
|
const minusDisabled = computed(() => props.disabled || !props.allowRemove && atMin.value);
|
|
564
956
|
const plusDisabled = computed(() => props.disabled || atMax.value);
|
|
565
|
-
const minusLabel = computed(() => atMin.value && props.allowRemove ?
|
|
957
|
+
const minusLabel = computed(() => atMin.value && props.allowRemove ? l10n.value.removeLabel : l10n.value.decrementLabel);
|
|
566
958
|
return (_ctx, _cache) => {
|
|
567
959
|
return openBlock(), createElementBlock("div", {
|
|
568
|
-
class: normalizeClass(["tao-quantity",
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
960
|
+
class: normalizeClass(["tao-quantity", [
|
|
961
|
+
unref(sizeClass)(__props.size),
|
|
962
|
+
{
|
|
963
|
+
"tao-quantity--invalid": invalid.value,
|
|
964
|
+
"tao-quantity--focused": focused.value,
|
|
965
|
+
"tao-quantity--disabled": __props.disabled
|
|
966
|
+
}
|
|
967
|
+
]])
|
|
573
968
|
}, [
|
|
574
969
|
createElementVNode("button", {
|
|
575
970
|
type: "button",
|
|
@@ -603,11 +998,11 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
|
603
998
|
onFocus,
|
|
604
999
|
onBlur,
|
|
605
1000
|
onKeydown
|
|
606
|
-
}, null, 40, _hoisted_3$
|
|
1001
|
+
}, null, 40, _hoisted_3$v),
|
|
607
1002
|
createElementVNode("button", {
|
|
608
1003
|
type: "button",
|
|
609
1004
|
class: "tao-quantity__btn tao-quantity__btn--inc",
|
|
610
|
-
"aria-label":
|
|
1005
|
+
"aria-label": unref(l10n).incrementLabel,
|
|
611
1006
|
disabled: plusDisabled.value,
|
|
612
1007
|
onClick: onInc
|
|
613
1008
|
}, [
|
|
@@ -616,12 +1011,12 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
|
616
1011
|
_cache[1] || (_cache[1] = createTextVNode("+", -1))
|
|
617
1012
|
], true)
|
|
618
1013
|
])
|
|
619
|
-
], 8, _hoisted_4$
|
|
1014
|
+
], 8, _hoisted_4$r)
|
|
620
1015
|
], 2);
|
|
621
1016
|
};
|
|
622
1017
|
}
|
|
623
1018
|
});
|
|
624
|
-
const TaoQuantity = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["__scopeId", "data-v-
|
|
1019
|
+
const TaoQuantity = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["__scopeId", "data-v-e27165e3"]]);
|
|
625
1020
|
const _hoisted_1$K = {
|
|
626
1021
|
key: 0,
|
|
627
1022
|
class: "tao-card__cover"
|
|
@@ -630,11 +1025,11 @@ const _hoisted_2$D = {
|
|
|
630
1025
|
key: 0,
|
|
631
1026
|
class: "tao-card__overlay"
|
|
632
1027
|
};
|
|
633
|
-
const _hoisted_3$
|
|
1028
|
+
const _hoisted_3$u = {
|
|
634
1029
|
key: 1,
|
|
635
1030
|
class: "tao-card__overlay"
|
|
636
1031
|
};
|
|
637
|
-
const _hoisted_4$
|
|
1032
|
+
const _hoisted_4$q = {
|
|
638
1033
|
key: 0,
|
|
639
1034
|
class: "tao-card__header-title"
|
|
640
1035
|
};
|
|
@@ -655,7 +1050,7 @@ const _hoisted_9$5 = {
|
|
|
655
1050
|
key: 3,
|
|
656
1051
|
class: "tao-card__body"
|
|
657
1052
|
};
|
|
658
|
-
const _hoisted_10$
|
|
1053
|
+
const _hoisted_10$4 = {
|
|
659
1054
|
key: 4,
|
|
660
1055
|
class: "tao-card__footer"
|
|
661
1056
|
};
|
|
@@ -670,7 +1065,8 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
|
670
1065
|
hover: { type: Boolean, default: false },
|
|
671
1066
|
active: { type: Boolean, default: false },
|
|
672
1067
|
overflow: { type: Boolean, default: false },
|
|
673
|
-
flush: { type: Boolean, default: false }
|
|
1068
|
+
flush: { type: Boolean, default: false },
|
|
1069
|
+
surface: { default: "flat" }
|
|
674
1070
|
},
|
|
675
1071
|
setup(__props) {
|
|
676
1072
|
const props = __props;
|
|
@@ -683,16 +1079,13 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
|
683
1079
|
if (props.flush) {
|
|
684
1080
|
return { padding: "0" };
|
|
685
1081
|
}
|
|
686
|
-
|
|
687
|
-
return { padding: `${props.padding.map((p) => `${p}px`).join(" ")}` };
|
|
688
|
-
}
|
|
689
|
-
return { padding: `${props.padding}px` };
|
|
1082
|
+
return { padding: toCssBox(props.padding) };
|
|
690
1083
|
});
|
|
691
|
-
const radiusStyle = computed(() => ({ borderRadius:
|
|
1084
|
+
const radiusStyle = computed(() => ({ borderRadius: toCssLength(props.radius) }));
|
|
692
1085
|
const showPanelShadow = computed(() => props.shadow && !props.shadowBottomOnly && !props.flush);
|
|
693
1086
|
return (_ctx, _cache) => {
|
|
694
1087
|
return openBlock(), createElementBlock("div", {
|
|
695
|
-
class: normalizeClass(["tao-card", {
|
|
1088
|
+
class: normalizeClass(["tao-card", [unref(surfaceClass)(__props.surface), {
|
|
696
1089
|
"tao-card--shadow": showPanelShadow.value,
|
|
697
1090
|
"tao-card--shadow-bottom": __props.shadowBottomOnly,
|
|
698
1091
|
"tao-card--hover": __props.hover,
|
|
@@ -700,7 +1093,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
|
700
1093
|
"tao-card--overflow": __props.overflow,
|
|
701
1094
|
"tao-card--flush": __props.flush,
|
|
702
1095
|
"tao-card--cover-only": coverOnly.value
|
|
703
|
-
}]),
|
|
1096
|
+
}]]),
|
|
704
1097
|
style: normalizeStyle(radiusStyle.value)
|
|
705
1098
|
}, [
|
|
706
1099
|
_ctx.$slots.cover ? (openBlock(), createElementBlock("div", _hoisted_1$K, [
|
|
@@ -708,7 +1101,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
|
708
1101
|
_ctx.$slots.overlay ? (openBlock(), createElementBlock("div", _hoisted_2$D, [
|
|
709
1102
|
renderSlot(_ctx.$slots, "overlay", {}, void 0, true)
|
|
710
1103
|
])) : createCommentVNode("", true)
|
|
711
|
-
])) : _ctx.$slots.overlay ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
1104
|
+
])) : _ctx.$slots.overlay ? (openBlock(), createElementBlock("div", _hoisted_3$u, [
|
|
712
1105
|
renderSlot(_ctx.$slots, "overlay", {}, void 0, true)
|
|
713
1106
|
])) : createCommentVNode("", true),
|
|
714
1107
|
hasContent.value ? (openBlock(), createElementBlock("div", {
|
|
@@ -716,7 +1109,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
|
716
1109
|
class: "tao-card__content",
|
|
717
1110
|
style: normalizeStyle(paddingStyle.value)
|
|
718
1111
|
}, [
|
|
719
|
-
_ctx.$slots.headerTitle ? (openBlock(), createElementBlock("h2", _hoisted_4$
|
|
1112
|
+
_ctx.$slots.headerTitle ? (openBlock(), createElementBlock("h2", _hoisted_4$q, [
|
|
720
1113
|
renderSlot(_ctx.$slots, "headerTitle", {}, void 0, true)
|
|
721
1114
|
])) : createCommentVNode("", true),
|
|
722
1115
|
_ctx.$slots.header || _ctx.$slots.headerSecondary ? (openBlock(), createElementBlock("div", {
|
|
@@ -741,7 +1134,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
|
741
1134
|
_ctx.$slots.default ? (openBlock(), createElementBlock("div", _hoisted_9$5, [
|
|
742
1135
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
743
1136
|
])) : createCommentVNode("", true),
|
|
744
|
-
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_10$
|
|
1137
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_10$4, [
|
|
745
1138
|
renderSlot(_ctx.$slots, "footer", {}, void 0, true)
|
|
746
1139
|
])) : createCommentVNode("", true)
|
|
747
1140
|
], 4)) : createCommentVNode("", true)
|
|
@@ -749,7 +1142,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
|
749
1142
|
};
|
|
750
1143
|
}
|
|
751
1144
|
});
|
|
752
|
-
const TaoCard = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-
|
|
1145
|
+
const TaoCard = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-53c366d1"]]);
|
|
753
1146
|
const FOCUSABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
754
1147
|
function getFocusable(root) {
|
|
755
1148
|
return [...root.querySelectorAll(FOCUSABLE)].filter(
|
|
@@ -808,8 +1201,8 @@ const _hoisted_2$C = {
|
|
|
808
1201
|
key: 0,
|
|
809
1202
|
class: "tao-modal__header"
|
|
810
1203
|
};
|
|
811
|
-
const _hoisted_3$
|
|
812
|
-
const _hoisted_4$
|
|
1204
|
+
const _hoisted_3$t = ["id"];
|
|
1205
|
+
const _hoisted_4$p = { key: 1 };
|
|
813
1206
|
const _hoisted_5$i = ["aria-label"];
|
|
814
1207
|
const _hoisted_6$e = { "aria-hidden": "true" };
|
|
815
1208
|
const _hoisted_7$b = { class: "tao-modal__content" };
|
|
@@ -824,11 +1217,12 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
|
824
1217
|
modelValue: { type: Boolean },
|
|
825
1218
|
title: { default: "" },
|
|
826
1219
|
closable: { type: Boolean, default: true },
|
|
827
|
-
closeLabel: {
|
|
1220
|
+
closeLabel: {}
|
|
828
1221
|
},
|
|
829
1222
|
emits: ["update:modelValue", "close"],
|
|
830
1223
|
setup(__props, { emit: __emit }) {
|
|
831
1224
|
const props = __props;
|
|
1225
|
+
const l10n = useLocaleText(props, "modal");
|
|
832
1226
|
const emit = __emit;
|
|
833
1227
|
const panelRef = ref(null);
|
|
834
1228
|
const titleId = useId();
|
|
@@ -939,13 +1333,13 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
|
939
1333
|
key: 0,
|
|
940
1334
|
id: unref(titleId),
|
|
941
1335
|
class: "tao-modal__title"
|
|
942
|
-
}, toDisplayString(__props.title), 9, _hoisted_3$
|
|
1336
|
+
}, toDisplayString(__props.title), 9, _hoisted_3$t)) : (openBlock(), createElementBlock("span", _hoisted_4$p))
|
|
943
1337
|
], true),
|
|
944
1338
|
__props.closable ? (openBlock(), createElementBlock("button", {
|
|
945
1339
|
key: 0,
|
|
946
1340
|
type: "button",
|
|
947
1341
|
class: "tao-modal__close",
|
|
948
|
-
"aria-label":
|
|
1342
|
+
"aria-label": unref(l10n).closeLabel,
|
|
949
1343
|
onClick: close
|
|
950
1344
|
}, [
|
|
951
1345
|
createElementVNode("span", _hoisted_6$e, [
|
|
@@ -970,24 +1364,29 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
|
970
1364
|
};
|
|
971
1365
|
}
|
|
972
1366
|
});
|
|
973
|
-
const TaoModal = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
1367
|
+
const TaoModal = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-742274be"]]);
|
|
1368
|
+
function tabValue(tab) {
|
|
1369
|
+
return tab.value ?? tab.key;
|
|
1370
|
+
}
|
|
1371
|
+
const _hoisted_1$I = ["id", "aria-selected", "aria-controls", "tabindex", "disabled", "onClick"];
|
|
1372
|
+
const _hoisted_2$B = ["id", "aria-labelledby"];
|
|
977
1373
|
const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
978
1374
|
...{ name: "TaoTabs" },
|
|
979
1375
|
__name: "TaoTabs",
|
|
980
1376
|
props: {
|
|
981
|
-
|
|
1377
|
+
items: { default: void 0 },
|
|
1378
|
+
tabs: { default: void 0 },
|
|
982
1379
|
modelValue: {},
|
|
983
|
-
justify: { default: "" }
|
|
1380
|
+
justify: { default: "" },
|
|
1381
|
+
size: {}
|
|
984
1382
|
},
|
|
985
|
-
emits: ["update:modelValue"],
|
|
1383
|
+
emits: ["update:modelValue", "change"],
|
|
986
1384
|
setup(__props, { emit: __emit }) {
|
|
987
1385
|
const props = __props;
|
|
988
1386
|
const emit = __emit;
|
|
989
1387
|
const uid = useId();
|
|
990
|
-
const
|
|
1388
|
+
const list = computed(() => props.items ?? props.tabs ?? []);
|
|
1389
|
+
const enabledTabs = computed(() => list.value.filter((tab) => !tab.disabled));
|
|
991
1390
|
function tabId(key) {
|
|
992
1391
|
return `${uid}-${key}`;
|
|
993
1392
|
}
|
|
@@ -995,9 +1394,12 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
|
995
1394
|
return `${uid}-panel-${key}`;
|
|
996
1395
|
}
|
|
997
1396
|
function selectTab(key, focus = false) {
|
|
998
|
-
const tab =
|
|
1397
|
+
const tab = list.value.find((item) => tabValue(item) === key);
|
|
999
1398
|
if (tab && !tab.disabled) {
|
|
1000
1399
|
emit("update:modelValue", key);
|
|
1400
|
+
if (key !== props.modelValue) {
|
|
1401
|
+
emit("change", key);
|
|
1402
|
+
}
|
|
1001
1403
|
if (focus) {
|
|
1002
1404
|
void nextTick(() => {
|
|
1003
1405
|
var _a;
|
|
@@ -1011,12 +1413,11 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
|
1011
1413
|
if (!enabled.length) {
|
|
1012
1414
|
return;
|
|
1013
1415
|
}
|
|
1014
|
-
const
|
|
1015
|
-
const next = enabled[(
|
|
1016
|
-
selectTab(next
|
|
1416
|
+
const current2 = enabled.findIndex((tab) => tabValue(tab) === props.modelValue);
|
|
1417
|
+
const next = enabled[(current2 + delta + enabled.length) % enabled.length];
|
|
1418
|
+
selectTab(tabValue(next), true);
|
|
1017
1419
|
}
|
|
1018
1420
|
function onKeydown(event) {
|
|
1019
|
-
var _a;
|
|
1020
1421
|
if (event.key === "ArrowRight" || event.key === "ArrowDown") {
|
|
1021
1422
|
event.preventDefault();
|
|
1022
1423
|
move(1);
|
|
@@ -1029,43 +1430,52 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
|
1029
1430
|
}
|
|
1030
1431
|
if (event.key === "Home") {
|
|
1031
1432
|
event.preventDefault();
|
|
1032
|
-
|
|
1433
|
+
const first = enabledTabs.value[0];
|
|
1434
|
+
selectTab(first ? tabValue(first) : props.modelValue, true);
|
|
1033
1435
|
return;
|
|
1034
1436
|
}
|
|
1035
1437
|
if (event.key === "End") {
|
|
1036
1438
|
event.preventDefault();
|
|
1037
1439
|
const last = enabledTabs.value[enabledTabs.value.length - 1];
|
|
1038
|
-
selectTab(
|
|
1440
|
+
selectTab(last ? tabValue(last) : props.modelValue, true);
|
|
1039
1441
|
}
|
|
1040
1442
|
}
|
|
1443
|
+
warnDeprecated("TaoTabs", {
|
|
1444
|
+
tabs: "use `items` (with `value` instead of `key`)"
|
|
1445
|
+
});
|
|
1446
|
+
if (list.value.some((tab) => tab.key !== void 0)) {
|
|
1447
|
+
deprecationWarning("TaoTabs", "item `key`", "use item `value`");
|
|
1448
|
+
}
|
|
1041
1449
|
return (_ctx, _cache) => {
|
|
1042
|
-
return openBlock(), createElementBlock("div",
|
|
1450
|
+
return openBlock(), createElementBlock("div", {
|
|
1451
|
+
class: normalizeClass(["tao-tabs", unref(sizeClass)(__props.size)])
|
|
1452
|
+
}, [
|
|
1043
1453
|
createElementVNode("div", {
|
|
1044
1454
|
class: "tao-tabs__list",
|
|
1045
1455
|
style: normalizeStyle({ justifyContent: __props.justify || void 0 }),
|
|
1046
1456
|
role: "tablist",
|
|
1047
1457
|
onKeydown
|
|
1048
1458
|
}, [
|
|
1049
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
1459
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(list.value, (tab) => {
|
|
1050
1460
|
return openBlock(), createElementBlock("button", {
|
|
1051
|
-
key: tab
|
|
1461
|
+
key: unref(tabValue)(tab),
|
|
1052
1462
|
type: "button",
|
|
1053
1463
|
class: "tao-tabs__tab",
|
|
1054
1464
|
role: "tab",
|
|
1055
|
-
id: tabId(tab
|
|
1056
|
-
"aria-selected": tab
|
|
1057
|
-
"aria-controls": panelId(tab
|
|
1058
|
-
tabindex: tab
|
|
1465
|
+
id: tabId(unref(tabValue)(tab)),
|
|
1466
|
+
"aria-selected": unref(tabValue)(tab) === __props.modelValue,
|
|
1467
|
+
"aria-controls": panelId(unref(tabValue)(tab)),
|
|
1468
|
+
tabindex: unref(tabValue)(tab) === __props.modelValue ? 0 : -1,
|
|
1059
1469
|
disabled: tab.disabled,
|
|
1060
|
-
onClick: ($event) => selectTab(tab
|
|
1470
|
+
onClick: ($event) => selectTab(unref(tabValue)(tab))
|
|
1061
1471
|
}, [
|
|
1062
1472
|
_ctx.$slots.label ? renderSlot(_ctx.$slots, "label", {
|
|
1063
1473
|
text: tab.label,
|
|
1064
|
-
value: tab
|
|
1474
|
+
value: unref(tabValue)(tab)
|
|
1065
1475
|
}, void 0, true, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1066
1476
|
createTextVNode(toDisplayString(tab.label), 1)
|
|
1067
1477
|
], 64))
|
|
1068
|
-
], 8,
|
|
1478
|
+
], 8, _hoisted_1$I);
|
|
1069
1479
|
}), 128))
|
|
1070
1480
|
], 36),
|
|
1071
1481
|
createElementVNode("div", {
|
|
@@ -1075,12 +1485,12 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
|
1075
1485
|
"aria-labelledby": tabId(__props.modelValue)
|
|
1076
1486
|
}, [
|
|
1077
1487
|
renderSlot(_ctx.$slots, "default", { activeTab: __props.modelValue }, void 0, true)
|
|
1078
|
-
], 8,
|
|
1079
|
-
]);
|
|
1488
|
+
], 8, _hoisted_2$B)
|
|
1489
|
+
], 2);
|
|
1080
1490
|
};
|
|
1081
1491
|
}
|
|
1082
1492
|
});
|
|
1083
|
-
const TaoTabs = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["__scopeId", "data-v-
|
|
1493
|
+
const TaoTabs = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["__scopeId", "data-v-a9238d96"]]);
|
|
1084
1494
|
function listenFocusLoss(onLoss) {
|
|
1085
1495
|
function onVisibilityChange() {
|
|
1086
1496
|
if (document.hidden) {
|
|
@@ -1462,11 +1872,11 @@ const TaoPopover = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["__scopeId", "data
|
|
|
1462
1872
|
const spoilerGroupKey = Symbol("taoSpoilerGroup");
|
|
1463
1873
|
const _hoisted_1$G = { class: "tao-spoiler" };
|
|
1464
1874
|
const _hoisted_2$A = ["aria-expanded", "aria-controls"];
|
|
1465
|
-
const _hoisted_3$
|
|
1875
|
+
const _hoisted_3$s = {
|
|
1466
1876
|
key: 0,
|
|
1467
1877
|
class: "tao-spoiler__title"
|
|
1468
1878
|
};
|
|
1469
|
-
const _hoisted_4$
|
|
1879
|
+
const _hoisted_4$o = ["id"];
|
|
1470
1880
|
const _hoisted_5$h = { class: "tao-spoiler__content-inner" };
|
|
1471
1881
|
const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
1472
1882
|
...{ name: "TaoSpoiler" },
|
|
@@ -1477,7 +1887,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
|
1477
1887
|
modelValue: { type: Boolean, default: void 0 },
|
|
1478
1888
|
name: { default: void 0 }
|
|
1479
1889
|
},
|
|
1480
|
-
emits: ["update:modelValue"],
|
|
1890
|
+
emits: ["update:modelValue", "change"],
|
|
1481
1891
|
setup(__props, { emit: __emit }) {
|
|
1482
1892
|
const props = __props;
|
|
1483
1893
|
const emit = __emit;
|
|
@@ -1502,6 +1912,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
|
1502
1912
|
internal.value = next;
|
|
1503
1913
|
}
|
|
1504
1914
|
emit("update:modelValue", next);
|
|
1915
|
+
emit("change", next);
|
|
1505
1916
|
}
|
|
1506
1917
|
function onBeforeEnter(el) {
|
|
1507
1918
|
el.style.height = "0";
|
|
@@ -1534,7 +1945,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
|
1534
1945
|
createElementVNode("span", {
|
|
1535
1946
|
class: normalizeClass(["tao-spoiler__icon", { "tao-spoiler__icon--open": isOpen.value }])
|
|
1536
1947
|
}, "▶", 2),
|
|
1537
|
-
__props.title || _ctx.$slots.title ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
1948
|
+
__props.title || _ctx.$slots.title ? (openBlock(), createElementBlock("span", _hoisted_3$s, [
|
|
1538
1949
|
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
1539
1950
|
createTextVNode(toDisplayString(__props.title), 1)
|
|
1540
1951
|
], true)
|
|
@@ -1556,7 +1967,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
|
1556
1967
|
createElementVNode("div", _hoisted_5$h, [
|
|
1557
1968
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
1558
1969
|
])
|
|
1559
|
-
], 8, _hoisted_4$
|
|
1970
|
+
], 8, _hoisted_4$o)) : createCommentVNode("", true)
|
|
1560
1971
|
]),
|
|
1561
1972
|
_: 3
|
|
1562
1973
|
})
|
|
@@ -1564,7 +1975,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
|
1564
1975
|
};
|
|
1565
1976
|
}
|
|
1566
1977
|
});
|
|
1567
|
-
const TaoSpoiler = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["__scopeId", "data-v-
|
|
1978
|
+
const TaoSpoiler = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["__scopeId", "data-v-5a3147a2"]]);
|
|
1568
1979
|
const _hoisted_1$F = { class: "tao-spoiler-group" };
|
|
1569
1980
|
const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
1570
1981
|
...{ name: "TaoSpoilerGroup" },
|
|
@@ -1604,12 +2015,14 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
1604
2015
|
__name: "TaoCopy",
|
|
1605
2016
|
props: {
|
|
1606
2017
|
text: {},
|
|
1607
|
-
|
|
1608
|
-
|
|
2018
|
+
successText: { default: void 0 },
|
|
2019
|
+
successMessage: { default: void 0 },
|
|
2020
|
+
copyLabel: {},
|
|
1609
2021
|
tip: { type: Boolean, default: true }
|
|
1610
2022
|
},
|
|
1611
2023
|
setup(__props) {
|
|
1612
2024
|
const props = __props;
|
|
2025
|
+
const l10n = useLocaleText(props, "copy");
|
|
1613
2026
|
const copied = ref(false);
|
|
1614
2027
|
const triggerRef = ref(null);
|
|
1615
2028
|
const tipRef = ref(null);
|
|
@@ -1694,6 +2107,10 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
1694
2107
|
visibleObserver == null ? void 0 : visibleObserver.disconnect();
|
|
1695
2108
|
visibleObserver = null;
|
|
1696
2109
|
});
|
|
2110
|
+
const doneText = computed(() => props.successText ?? props.successMessage ?? taoLocale().copy.successText);
|
|
2111
|
+
warnDeprecated("TaoCopy", {
|
|
2112
|
+
successMessage: "use `successText`"
|
|
2113
|
+
});
|
|
1697
2114
|
return (_ctx, _cache) => {
|
|
1698
2115
|
return openBlock(), createElementBlock("span", {
|
|
1699
2116
|
ref_key: "triggerRef",
|
|
@@ -1707,7 +2124,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
1707
2124
|
createElementVNode("button", {
|
|
1708
2125
|
type: "button",
|
|
1709
2126
|
class: normalizeClass(["tao-copy__button", { "tao-copy__button--copied": copied.value }]),
|
|
1710
|
-
"aria-label": copied.value ?
|
|
2127
|
+
"aria-label": copied.value ? doneText.value : unref(l10n).copyLabel,
|
|
1711
2128
|
onClick: copy
|
|
1712
2129
|
}, [..._cache[0] || (_cache[0] = [
|
|
1713
2130
|
createElementVNode("svg", {
|
|
@@ -1737,38 +2154,44 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
1737
2154
|
])], 10, _hoisted_1$E)
|
|
1738
2155
|
], true),
|
|
1739
2156
|
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
1740
|
-
copied.value && __props.tip &&
|
|
2157
|
+
copied.value && __props.tip && doneText.value ? (openBlock(), createElementBlock("div", {
|
|
1741
2158
|
key: 0,
|
|
1742
2159
|
ref_key: "tipRef",
|
|
1743
2160
|
ref: tipRef,
|
|
1744
2161
|
class: "tao-copy__tip",
|
|
1745
2162
|
role: "status",
|
|
1746
2163
|
style: normalizeStyle(tipStyle.value)
|
|
1747
|
-
}, toDisplayString(
|
|
2164
|
+
}, toDisplayString(doneText.value), 5)) : createCommentVNode("", true)
|
|
1748
2165
|
]))
|
|
1749
2166
|
], 2);
|
|
1750
2167
|
};
|
|
1751
2168
|
}
|
|
1752
2169
|
});
|
|
1753
|
-
const TaoCopy = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-
|
|
2170
|
+
const TaoCopy = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-16581b4e"]]);
|
|
1754
2171
|
const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
1755
2172
|
...{ name: "TaoContainer" },
|
|
1756
2173
|
__name: "TaoContainer",
|
|
1757
2174
|
props: {
|
|
1758
|
-
|
|
2175
|
+
width: {},
|
|
2176
|
+
size: {},
|
|
1759
2177
|
free: { type: Boolean, default: false }
|
|
1760
2178
|
},
|
|
1761
2179
|
setup(__props) {
|
|
2180
|
+
const props = __props;
|
|
2181
|
+
const resolvedWidth = computed(() => props.width ?? props.size ?? "wide");
|
|
2182
|
+
warnDeprecated("TaoContainer", {
|
|
2183
|
+
size: "use `width`"
|
|
2184
|
+
});
|
|
1762
2185
|
return (_ctx, _cache) => {
|
|
1763
2186
|
return openBlock(), createElementBlock("div", {
|
|
1764
|
-
class: normalizeClass(["tao-container", [`tao-container--${
|
|
2187
|
+
class: normalizeClass(["tao-container", [`tao-container--${resolvedWidth.value}`, { "tao-container--center": !__props.free }]])
|
|
1765
2188
|
}, [
|
|
1766
2189
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
1767
2190
|
], 2);
|
|
1768
2191
|
};
|
|
1769
2192
|
}
|
|
1770
2193
|
});
|
|
1771
|
-
const TaoContainer = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-
|
|
2194
|
+
const TaoContainer = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-ef005f57"]]);
|
|
1772
2195
|
const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
1773
2196
|
...{ name: "TaoFlex" },
|
|
1774
2197
|
__name: "TaoFlex",
|
|
@@ -1789,7 +2212,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
|
1789
2212
|
alignItems: __props.align,
|
|
1790
2213
|
flexDirection: __props.direction,
|
|
1791
2214
|
flexWrap: __props.wrap,
|
|
1792
|
-
gap: __props.gap
|
|
2215
|
+
gap: unref(toCssLength)(__props.gap)
|
|
1793
2216
|
})
|
|
1794
2217
|
}, {
|
|
1795
2218
|
default: withCtx(() => [
|
|
@@ -1806,13 +2229,18 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
|
|
|
1806
2229
|
props: {
|
|
1807
2230
|
block: { type: Boolean, default: false },
|
|
1808
2231
|
expand: { type: Boolean, default: false },
|
|
2232
|
+
direction: { default: void 0 },
|
|
1809
2233
|
vertical: { type: Boolean, default: false }
|
|
1810
2234
|
},
|
|
1811
2235
|
setup(__props) {
|
|
1812
2236
|
const props = __props;
|
|
2237
|
+
const isColumn = computed(() => (props.direction ?? (props.vertical ? "column" : "row")) === "column");
|
|
2238
|
+
warnDeprecated("TaoSpace", {
|
|
2239
|
+
vertical: 'use direction="column"'
|
|
2240
|
+
});
|
|
1813
2241
|
return (_ctx, _cache) => {
|
|
1814
2242
|
return openBlock(), createElementBlock("div", {
|
|
1815
|
-
class: normalizeClass(["tao-space", { "tao-space--vertical":
|
|
2243
|
+
class: normalizeClass(["tao-space", { "tao-space--vertical": isColumn.value }]),
|
|
1816
2244
|
style: normalizeStyle([props.block ? "display: flex; flex-wrap: initial;" : "", props.expand ? "width: 100%" : ""])
|
|
1817
2245
|
}, [
|
|
1818
2246
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
@@ -1820,7 +2248,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
|
|
|
1820
2248
|
};
|
|
1821
2249
|
}
|
|
1822
2250
|
});
|
|
1823
|
-
const TaoSpace = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["__scopeId", "data-v-
|
|
2251
|
+
const TaoSpace = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["__scopeId", "data-v-67c9d3a2"]]);
|
|
1824
2252
|
const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
1825
2253
|
...{ name: "TaoGrid" },
|
|
1826
2254
|
__name: "TaoGrid",
|
|
@@ -1833,9 +2261,9 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
1833
2261
|
const props = __props;
|
|
1834
2262
|
const isFixed = computed(() => props.cols > 0);
|
|
1835
2263
|
const gridStyle = computed(() => ({
|
|
1836
|
-
"--tao-grid-min": props.min,
|
|
2264
|
+
"--tao-grid-min": toCssLength(props.min),
|
|
1837
2265
|
"--tao-grid-cols": isFixed.value ? String(props.cols) : void 0,
|
|
1838
|
-
"--tao-grid-gap": props.gap
|
|
2266
|
+
"--tao-grid-gap": toCssLength(props.gap)
|
|
1839
2267
|
}));
|
|
1840
2268
|
return (_ctx, _cache) => {
|
|
1841
2269
|
return openBlock(), createElementBlock("div", {
|
|
@@ -1847,7 +2275,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
1847
2275
|
};
|
|
1848
2276
|
}
|
|
1849
2277
|
});
|
|
1850
|
-
const TaoGrid = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["__scopeId", "data-v-
|
|
2278
|
+
const TaoGrid = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["__scopeId", "data-v-5baa4944"]]);
|
|
1851
2279
|
const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
1852
2280
|
...{ name: "TaoGridItem" },
|
|
1853
2281
|
__name: "TaoGridItem",
|
|
@@ -1874,8 +2302,8 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
|
1874
2302
|
const TaoGridItem = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["__scopeId", "data-v-ad288026"]]);
|
|
1875
2303
|
const _hoisted_1$D = { class: "tao-split__pane tao-split__pane--start" };
|
|
1876
2304
|
const _hoisted_2$z = ["aria-orientation", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-disabled", "tabindex"];
|
|
1877
|
-
const _hoisted_3$
|
|
1878
|
-
const _hoisted_4$
|
|
2305
|
+
const _hoisted_3$r = { class: "tao-split__pane tao-split__pane--end" };
|
|
2306
|
+
const _hoisted_4$n = {
|
|
1879
2307
|
key: 0,
|
|
1880
2308
|
class: "tao-split__shield"
|
|
1881
2309
|
};
|
|
@@ -1892,7 +2320,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
1892
2320
|
resizable: { type: Boolean, default: true },
|
|
1893
2321
|
step: {}
|
|
1894
2322
|
},
|
|
1895
|
-
emits: ["update:modelValue"],
|
|
2323
|
+
emits: ["update:modelValue", "change"],
|
|
1896
2324
|
setup(__props, { emit: __emit }) {
|
|
1897
2325
|
const props = __props;
|
|
1898
2326
|
const emit = __emit;
|
|
@@ -1907,6 +2335,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
1907
2335
|
const ariaOrientation = computed(() => isRow.value ? "vertical" : "horizontal");
|
|
1908
2336
|
let dragPointer = -1;
|
|
1909
2337
|
let dragStartPx = 0;
|
|
2338
|
+
let dragStartValue = 0;
|
|
1910
2339
|
let dragStartCoord = 0;
|
|
1911
2340
|
let savedBodyCursor = "";
|
|
1912
2341
|
let savedHtmlCursor = "";
|
|
@@ -2016,6 +2445,9 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
2016
2445
|
dragPointer = -1;
|
|
2017
2446
|
restoreDragCursor();
|
|
2018
2447
|
applyLayout(true);
|
|
2448
|
+
if (!valuesEqual(size.value, dragStartValue)) {
|
|
2449
|
+
emit("change", size.value);
|
|
2450
|
+
}
|
|
2019
2451
|
}
|
|
2020
2452
|
function setStartFromDelta(delta) {
|
|
2021
2453
|
const avail = measureAvailable();
|
|
@@ -2031,6 +2463,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
2031
2463
|
dragPointer = event.pointerId;
|
|
2032
2464
|
isDragging.value = true;
|
|
2033
2465
|
dragStartPx = startPx.value;
|
|
2466
|
+
dragStartValue = size.value;
|
|
2034
2467
|
dragStartCoord = isRow.value ? event.clientX : event.clientY;
|
|
2035
2468
|
applyDragCursor();
|
|
2036
2469
|
event.preventDefault();
|
|
@@ -2078,6 +2511,13 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
2078
2511
|
const ariaValueNow = computed(() => size.value);
|
|
2079
2512
|
const ariaValueText = computed(() => props.unit === "%" ? `${size.value}%` : `${Math.round(size.value)}px`);
|
|
2080
2513
|
function onKeydown(event) {
|
|
2514
|
+
const before = size.value;
|
|
2515
|
+
moveByKey(event);
|
|
2516
|
+
if (!valuesEqual(before, size.value)) {
|
|
2517
|
+
emit("change", size.value);
|
|
2518
|
+
}
|
|
2519
|
+
}
|
|
2520
|
+
function moveByKey(event) {
|
|
2081
2521
|
if (!props.resizable) {
|
|
2082
2522
|
return;
|
|
2083
2523
|
}
|
|
@@ -2188,15 +2628,15 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
2188
2628
|
onDragstart: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
2189
2629
|
}, ["prevent"]))
|
|
2190
2630
|
}, null, 40, _hoisted_2$z),
|
|
2191
|
-
createElementVNode("div", _hoisted_3$
|
|
2631
|
+
createElementVNode("div", _hoisted_3$r, [
|
|
2192
2632
|
renderSlot(_ctx.$slots, "end", {}, void 0, true)
|
|
2193
2633
|
]),
|
|
2194
|
-
isDragging.value ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
2634
|
+
isDragging.value ? (openBlock(), createElementBlock("div", _hoisted_4$n)) : createCommentVNode("", true)
|
|
2195
2635
|
], 6);
|
|
2196
2636
|
};
|
|
2197
2637
|
}
|
|
2198
2638
|
});
|
|
2199
|
-
const TaoSplit = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-
|
|
2639
|
+
const TaoSplit = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-f34ab385"]]);
|
|
2200
2640
|
const _hoisted_1$C = { class: "tao-icon" };
|
|
2201
2641
|
const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
2202
2642
|
...{ name: "TaoIcon" },
|
|
@@ -2289,7 +2729,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
2289
2729
|
const TaoLoader = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__scopeId", "data-v-49a9f1b2"]]);
|
|
2290
2730
|
const _hoisted_1$B = { class: "tao-image" };
|
|
2291
2731
|
const _hoisted_2$y = ["src", "alt", "loading"];
|
|
2292
|
-
const _hoisted_3$
|
|
2732
|
+
const _hoisted_3$q = { class: "tao-image__placeholder" };
|
|
2293
2733
|
const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
2294
2734
|
...{ name: "TaoImage" },
|
|
2295
2735
|
__name: "TaoImage",
|
|
@@ -2334,7 +2774,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
2334
2774
|
onError: handleError
|
|
2335
2775
|
}, null, 42, _hoisted_2$y)) : createCommentVNode("", true),
|
|
2336
2776
|
!__props.src || hasError.value ? renderSlot(_ctx.$slots, "default", {}, () => [
|
|
2337
|
-
createElementVNode("div", _hoisted_3$
|
|
2777
|
+
createElementVNode("div", _hoisted_3$q, toDisplayString(__props.placeholderText), 1)
|
|
2338
2778
|
], true, 1) : createCommentVNode("", true)
|
|
2339
2779
|
]);
|
|
2340
2780
|
};
|
|
@@ -2343,11 +2783,11 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
2343
2783
|
const TaoImage = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-61f47c52"]]);
|
|
2344
2784
|
const _hoisted_1$A = ["for"];
|
|
2345
2785
|
const _hoisted_2$x = ["id", "checked", "disabled", "aria-checked", "aria-invalid", "aria-describedby"];
|
|
2346
|
-
const _hoisted_3$
|
|
2786
|
+
const _hoisted_3$p = {
|
|
2347
2787
|
key: 0,
|
|
2348
2788
|
class: "tao-checkbox__label"
|
|
2349
2789
|
};
|
|
2350
|
-
const _hoisted_4$
|
|
2790
|
+
const _hoisted_4$m = {
|
|
2351
2791
|
key: 1,
|
|
2352
2792
|
class: "tao-checkbox__label"
|
|
2353
2793
|
};
|
|
@@ -2356,9 +2796,11 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
2356
2796
|
__name: "TaoCheckbox",
|
|
2357
2797
|
props: {
|
|
2358
2798
|
value: { type: Boolean, default: void 0 },
|
|
2799
|
+
checked: { type: Boolean, default: void 0 },
|
|
2359
2800
|
modelValue: { type: Boolean, default: void 0 },
|
|
2360
2801
|
label: { default: "" },
|
|
2361
2802
|
disabled: { type: Boolean, default: false },
|
|
2803
|
+
size: {},
|
|
2362
2804
|
error: { type: Boolean, default: false },
|
|
2363
2805
|
indeterminate: { type: Boolean, default: false }
|
|
2364
2806
|
},
|
|
@@ -2376,6 +2818,9 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
2376
2818
|
if (props.modelValue !== void 0) {
|
|
2377
2819
|
return props.modelValue;
|
|
2378
2820
|
}
|
|
2821
|
+
if (props.checked !== void 0) {
|
|
2822
|
+
return props.checked;
|
|
2823
|
+
}
|
|
2379
2824
|
return Boolean(props.value);
|
|
2380
2825
|
},
|
|
2381
2826
|
set: (next) => {
|
|
@@ -2403,9 +2848,12 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
2403
2848
|
},
|
|
2404
2849
|
{ flush: "post" }
|
|
2405
2850
|
);
|
|
2851
|
+
warnDeprecated("TaoCheckbox", {
|
|
2852
|
+
value: "use `checked` or v-model"
|
|
2853
|
+
});
|
|
2406
2854
|
return (_ctx, _cache) => {
|
|
2407
2855
|
return openBlock(), createElementBlock("label", {
|
|
2408
|
-
class: normalizeClass(["tao-checkbox", { "tao-checkbox--disabled": __props.disabled }]),
|
|
2856
|
+
class: normalizeClass(["tao-checkbox", [unref(sizeClass)(__props.size), { "tao-checkbox--disabled": __props.disabled }]]),
|
|
2409
2857
|
for: controlId.value
|
|
2410
2858
|
}, [
|
|
2411
2859
|
renderSlot(_ctx.$slots, "pre", { text: __props.label }, void 0, true),
|
|
@@ -2423,7 +2871,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
2423
2871
|
onChange: onInputChange
|
|
2424
2872
|
}, null, 40, _hoisted_2$x),
|
|
2425
2873
|
_cache[0] || (_cache[0] = createElementVNode("span", { class: "tao-checkbox__box" }, null, -1)),
|
|
2426
|
-
__props.label ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
2874
|
+
__props.label ? (openBlock(), createElementBlock("span", _hoisted_3$p, toDisplayString(__props.label), 1)) : (openBlock(), createElementBlock("span", _hoisted_4$m, [
|
|
2427
2875
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
2428
2876
|
])),
|
|
2429
2877
|
renderSlot(_ctx.$slots, "post", { text: __props.label }, void 0, true)
|
|
@@ -2431,33 +2879,40 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
2431
2879
|
};
|
|
2432
2880
|
}
|
|
2433
2881
|
});
|
|
2434
|
-
const TaoCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-
|
|
2882
|
+
const TaoCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-13f6cd33"]]);
|
|
2435
2883
|
const _hoisted_1$z = {
|
|
2436
2884
|
key: 0,
|
|
2437
2885
|
class: "tao-tag__prefix"
|
|
2438
2886
|
};
|
|
2439
2887
|
const _hoisted_2$w = { class: "tao-tag__text" };
|
|
2440
|
-
const _hoisted_3$
|
|
2441
|
-
const _hoisted_4$
|
|
2888
|
+
const _hoisted_3$o = ["aria-label"];
|
|
2889
|
+
const _hoisted_4$l = { "aria-hidden": "true" };
|
|
2442
2890
|
const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
2443
2891
|
...{ name: "TaoTag" },
|
|
2444
2892
|
__name: "TaoTag",
|
|
2445
2893
|
props: {
|
|
2446
|
-
|
|
2894
|
+
tone: { default: void 0 },
|
|
2895
|
+
type: { default: void 0 },
|
|
2447
2896
|
color: {},
|
|
2448
2897
|
background: {},
|
|
2449
2898
|
borderColor: {},
|
|
2899
|
+
clickable: { type: Boolean, default: false },
|
|
2450
2900
|
pointer: { type: Boolean, default: false },
|
|
2451
2901
|
closable: { type: Boolean, default: false },
|
|
2452
|
-
closeLabel: {
|
|
2453
|
-
flat: { type: Boolean, default: false }
|
|
2902
|
+
closeLabel: {},
|
|
2903
|
+
flat: { type: Boolean, default: false },
|
|
2904
|
+
size: {}
|
|
2454
2905
|
},
|
|
2455
2906
|
emits: ["close"],
|
|
2456
2907
|
setup(__props, { emit: __emit }) {
|
|
2457
2908
|
const props = __props;
|
|
2909
|
+
const l10n = useLocaleText(props, "tag");
|
|
2458
2910
|
const emit = __emit;
|
|
2459
2911
|
const slots = useSlots();
|
|
2460
|
-
const
|
|
2912
|
+
const resolvedTone = computed(() => {
|
|
2913
|
+
const value = props.tone ?? props.type ?? "";
|
|
2914
|
+
return value === "error" ? "danger" : value;
|
|
2915
|
+
});
|
|
2461
2916
|
const style = computed(() => ({
|
|
2462
2917
|
color: props.color || "",
|
|
2463
2918
|
background: props.background || "",
|
|
@@ -2466,12 +2921,17 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
2466
2921
|
function onClose(event) {
|
|
2467
2922
|
emit("close", event);
|
|
2468
2923
|
}
|
|
2924
|
+
warnDeprecated("TaoTag", {
|
|
2925
|
+
type: "use `tone`",
|
|
2926
|
+
pointer: "use `clickable`"
|
|
2927
|
+
});
|
|
2469
2928
|
return (_ctx, _cache) => {
|
|
2470
2929
|
return openBlock(), createElementBlock("span", {
|
|
2471
2930
|
class: normalizeClass(["tao-tag", [
|
|
2472
|
-
|
|
2931
|
+
resolvedTone.value ? `tao-tag--${resolvedTone.value}` : "",
|
|
2932
|
+
unref(sizeClass)(__props.size),
|
|
2473
2933
|
{
|
|
2474
|
-
"tao-tag--pointer": __props.pointer,
|
|
2934
|
+
"tao-tag--pointer": __props.clickable || __props.pointer,
|
|
2475
2935
|
"tao-tag--closable": __props.closable,
|
|
2476
2936
|
"tao-tag--prefix": Boolean(unref(slots).prefix),
|
|
2477
2937
|
"tao-tag--flat": __props.flat
|
|
@@ -2489,26 +2949,26 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
2489
2949
|
key: 1,
|
|
2490
2950
|
type: "button",
|
|
2491
2951
|
class: "tao-tag__close",
|
|
2492
|
-
"aria-label":
|
|
2952
|
+
"aria-label": unref(l10n).closeLabel,
|
|
2493
2953
|
onClick: withModifiers(onClose, ["stop"])
|
|
2494
2954
|
}, [
|
|
2495
|
-
createElementVNode("span", _hoisted_4$
|
|
2955
|
+
createElementVNode("span", _hoisted_4$l, [
|
|
2496
2956
|
renderSlot(_ctx.$slots, "close-icon", {}, () => [
|
|
2497
2957
|
_cache[0] || (_cache[0] = createTextVNode("✕", -1))
|
|
2498
2958
|
], true)
|
|
2499
2959
|
])
|
|
2500
|
-
], 8, _hoisted_3$
|
|
2960
|
+
], 8, _hoisted_3$o)) : createCommentVNode("", true)
|
|
2501
2961
|
], 6);
|
|
2502
2962
|
};
|
|
2503
2963
|
}
|
|
2504
2964
|
});
|
|
2505
|
-
const TaoTag = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-
|
|
2965
|
+
const TaoTag = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-ca0b1b42"]]);
|
|
2506
2966
|
const _hoisted_1$y = ["role", "aria-hidden"];
|
|
2507
2967
|
const _hoisted_2$v = {
|
|
2508
2968
|
key: 1,
|
|
2509
2969
|
class: "tao-divider__text"
|
|
2510
2970
|
};
|
|
2511
|
-
const _hoisted_3$
|
|
2971
|
+
const _hoisted_3$n = {
|
|
2512
2972
|
key: 2,
|
|
2513
2973
|
class: "tao-divider__line tao-divider__line--end"
|
|
2514
2974
|
};
|
|
@@ -2526,6 +2986,9 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
2526
2986
|
const slots = useSlots();
|
|
2527
2987
|
const gapSize = computed(() => props.size === "big" ? "large" : props.size);
|
|
2528
2988
|
const hasLabel = computed(() => Boolean(props.text) || Boolean(slots.default));
|
|
2989
|
+
if (props.size === "big") {
|
|
2990
|
+
deprecationWarning("TaoDivider", 'size "big"', 'use size="large"');
|
|
2991
|
+
}
|
|
2529
2992
|
return (_ctx, _cache) => {
|
|
2530
2993
|
return openBlock(), createElementBlock("div", {
|
|
2531
2994
|
class: normalizeClass(["tao-divider", [
|
|
@@ -2548,12 +3011,12 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
2548
3011
|
createTextVNode(toDisplayString(__props.text), 1)
|
|
2549
3012
|
], true)
|
|
2550
3013
|
])) : createCommentVNode("", true),
|
|
2551
|
-
__props.variant !== "gap" && hasLabel.value ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
3014
|
+
__props.variant !== "gap" && hasLabel.value ? (openBlock(), createElementBlock("span", _hoisted_3$n)) : createCommentVNode("", true)
|
|
2552
3015
|
], 10, _hoisted_1$y);
|
|
2553
3016
|
};
|
|
2554
3017
|
}
|
|
2555
3018
|
});
|
|
2556
|
-
const TaoDivider = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-
|
|
3019
|
+
const TaoDivider = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-32544dcc"]]);
|
|
2557
3020
|
const _hoisted_1$x = {
|
|
2558
3021
|
key: 0,
|
|
2559
3022
|
class: "tao-fieldset__legend"
|
|
@@ -2609,16 +3072,8 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
2609
3072
|
}
|
|
2610
3073
|
});
|
|
2611
3074
|
const TaoAnimatedBorder = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-c9434028"]]);
|
|
2612
|
-
const _hoisted_1$w =
|
|
2613
|
-
|
|
2614
|
-
class: "tao-textarea tao-textarea--dummy"
|
|
2615
|
-
};
|
|
2616
|
-
const _hoisted_2$t = {
|
|
2617
|
-
key: 1,
|
|
2618
|
-
class: "tao-textarea-wrap"
|
|
2619
|
-
};
|
|
2620
|
-
const _hoisted_3$n = ["id", "placeholder", "spellcheck", "autocomplete", "minlength", "maxlength", "disabled", "rows", "value", "aria-invalid", "aria-describedby"];
|
|
2621
|
-
const _hoisted_4$l = ["id"];
|
|
3075
|
+
const _hoisted_1$w = ["id", "placeholder", "spellcheck", "autocomplete", "minlength", "maxlength", "disabled", "readonly", "rows", "value", "aria-invalid", "aria-describedby"];
|
|
3076
|
+
const _hoisted_2$t = ["id"];
|
|
2622
3077
|
const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
2623
3078
|
...{ name: "TaoTextarea" },
|
|
2624
3079
|
__name: "TaoTextarea",
|
|
@@ -2629,6 +3084,9 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
2629
3084
|
minlength: { default: 0 },
|
|
2630
3085
|
maxlength: { default: void 0 },
|
|
2631
3086
|
disabled: { type: Boolean, default: false },
|
|
3087
|
+
size: {},
|
|
3088
|
+
variant: {},
|
|
3089
|
+
readonly: { type: Boolean, default: false },
|
|
2632
3090
|
noSpace: { type: Boolean, default: false },
|
|
2633
3091
|
dummy: { type: Boolean, default: false },
|
|
2634
3092
|
rows: { default: 3 },
|
|
@@ -2636,9 +3094,12 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
2636
3094
|
modelValue: { default: "" },
|
|
2637
3095
|
noBorder: { type: Boolean, default: false },
|
|
2638
3096
|
noBackground: { type: Boolean, default: false },
|
|
3097
|
+
autofocus: { type: Boolean, default: false },
|
|
2639
3098
|
autoFocus: { type: Boolean, default: false },
|
|
2640
3099
|
borderInverse: { type: Boolean, default: false },
|
|
3100
|
+
align: { default: void 0 },
|
|
2641
3101
|
textCenter: { type: Boolean, default: false },
|
|
3102
|
+
blurOnEnter: { type: Boolean, default: false },
|
|
2642
3103
|
submitOnEnter: { type: Boolean, default: false },
|
|
2643
3104
|
error: { type: Boolean, default: false },
|
|
2644
3105
|
id: {},
|
|
@@ -2653,6 +3114,26 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
2653
3114
|
const controlId = computed(() => props.id || (field == null ? void 0 : field.id) || localId);
|
|
2654
3115
|
const invalid = computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
2655
3116
|
const counterId = computed(() => `${controlId.value}-count`);
|
|
3117
|
+
const resolvedVariant = computed(() => {
|
|
3118
|
+
if (props.variant) {
|
|
3119
|
+
return props.variant;
|
|
3120
|
+
}
|
|
3121
|
+
if (props.noBorder) {
|
|
3122
|
+
return props.noBackground ? "plain" : "filled";
|
|
3123
|
+
}
|
|
3124
|
+
return "bar";
|
|
3125
|
+
});
|
|
3126
|
+
const alignClass = computed(() => {
|
|
3127
|
+
const align = props.align ?? (props.textCenter ? "center" : "start");
|
|
3128
|
+
return align === "start" ? void 0 : `tao-textarea--align-${align}`;
|
|
3129
|
+
});
|
|
3130
|
+
const variantClasses = computed(() => [
|
|
3131
|
+
`tao-textarea--${resolvedVariant.value}`,
|
|
3132
|
+
{
|
|
3133
|
+
"tao-textarea--inverse": props.borderInverse && resolvedVariant.value === "bar",
|
|
3134
|
+
"tao-textarea--no-background": !props.variant && props.noBackground && !props.noBorder
|
|
3135
|
+
}
|
|
3136
|
+
]);
|
|
2656
3137
|
const describedBy = computed(() => {
|
|
2657
3138
|
const ids = [field == null ? void 0 : field.describedBy.value, props.count ? counterId.value : void 0].filter(Boolean);
|
|
2658
3139
|
return ids.length ? ids.join(" ") : void 0;
|
|
@@ -2670,7 +3151,15 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
2670
3151
|
const textareaRef = ref(null);
|
|
2671
3152
|
function onInput(e) {
|
|
2672
3153
|
const target = e.target;
|
|
2673
|
-
|
|
3154
|
+
let value = target.value;
|
|
3155
|
+
if (props.noSpace && value.includes(" ")) {
|
|
3156
|
+
const caret = target.selectionStart ?? value.length;
|
|
3157
|
+
const nextCaret = value.slice(0, caret).replace(/ /g, "").length;
|
|
3158
|
+
value = value.replace(/ /g, "");
|
|
3159
|
+
target.value = value;
|
|
3160
|
+
target.setSelectionRange(nextCaret, nextCaret);
|
|
3161
|
+
}
|
|
3162
|
+
emit("update:modelValue", value);
|
|
2674
3163
|
autoResize();
|
|
2675
3164
|
}
|
|
2676
3165
|
function onChange(e) {
|
|
@@ -2685,7 +3174,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
2685
3174
|
function onKeydown(event) {
|
|
2686
3175
|
var _a;
|
|
2687
3176
|
emit("keydown", event);
|
|
2688
|
-
if (props.submitOnEnter && event.key === "Enter" && !event.shiftKey) {
|
|
3177
|
+
if ((props.blurOnEnter || props.submitOnEnter) && event.key === "Enter" && !event.shiftKey) {
|
|
2689
3178
|
(_a = textareaRef.value) == null ? void 0 : _a.blur();
|
|
2690
3179
|
event.preventDefault();
|
|
2691
3180
|
return;
|
|
@@ -2710,31 +3199,47 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
2710
3199
|
);
|
|
2711
3200
|
onMounted(() => {
|
|
2712
3201
|
var _a;
|
|
2713
|
-
if (props.autoFocus) {
|
|
3202
|
+
if (props.autofocus || props.autoFocus) {
|
|
2714
3203
|
(_a = textareaRef.value) == null ? void 0 : _a.focus();
|
|
2715
3204
|
}
|
|
2716
3205
|
nextTick(autoResize);
|
|
2717
3206
|
});
|
|
3207
|
+
warnDeprecated("TaoTextarea", {
|
|
3208
|
+
noBorder: 'use variant="filled"',
|
|
3209
|
+
noBackground: 'use variant="plain"',
|
|
3210
|
+
borderInverse: "use `variant` (the bar on the right goes away)",
|
|
3211
|
+
dummy: "use `readonly`",
|
|
3212
|
+
textCenter: 'use align="center"',
|
|
3213
|
+
autoFocus: "use `autofocus`",
|
|
3214
|
+
submitOnEnter: "use `blurOnEnter`"
|
|
3215
|
+
});
|
|
2718
3216
|
return (_ctx, _cache) => {
|
|
2719
|
-
return __props.dummy ? (openBlock(), createElementBlock("span",
|
|
3217
|
+
return __props.dummy ? (openBlock(), createElementBlock("span", {
|
|
3218
|
+
key: 0,
|
|
3219
|
+
class: normalizeClass(["tao-textarea tao-textarea--dummy", [unref(sizeClass)(__props.size), variantClasses.value, alignClass.value]])
|
|
3220
|
+
}, toDisplayString(__props.modelValue), 3)) : (openBlock(), createElementBlock("div", {
|
|
3221
|
+
key: 1,
|
|
3222
|
+
class: normalizeClass(["tao-textarea-wrap", unref(sizeClass)(__props.size)])
|
|
3223
|
+
}, [
|
|
2720
3224
|
createElementVNode("textarea", {
|
|
2721
3225
|
id: controlId.value,
|
|
2722
3226
|
ref_key: "textareaRef",
|
|
2723
3227
|
ref: textareaRef,
|
|
2724
|
-
class: normalizeClass(["tao-textarea",
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
3228
|
+
class: normalizeClass(["tao-textarea", [
|
|
3229
|
+
variantClasses.value,
|
|
3230
|
+
alignClass.value,
|
|
3231
|
+
{
|
|
3232
|
+
"tao-textarea--no-resize": !__props.resize,
|
|
3233
|
+
"tao-textarea--invalid": invalid.value
|
|
3234
|
+
}
|
|
3235
|
+
]]),
|
|
2732
3236
|
placeholder: __props.placeholder,
|
|
2733
3237
|
spellcheck: __props.spellcheck,
|
|
2734
3238
|
autocomplete: __props.autocomplete,
|
|
2735
3239
|
minlength: __props.minlength,
|
|
2736
3240
|
maxlength: __props.maxlength,
|
|
2737
3241
|
disabled: __props.disabled,
|
|
3242
|
+
readonly: __props.readonly,
|
|
2738
3243
|
rows: __props.rows,
|
|
2739
3244
|
value: __props.modelValue,
|
|
2740
3245
|
"aria-invalid": invalid.value || void 0,
|
|
@@ -2745,17 +3250,17 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
2745
3250
|
onFocus,
|
|
2746
3251
|
onBlur,
|
|
2747
3252
|
onKeydown
|
|
2748
|
-
}, null, 42,
|
|
3253
|
+
}, null, 42, _hoisted_1$w),
|
|
2749
3254
|
__props.count ? (openBlock(), createElementBlock("span", {
|
|
2750
3255
|
key: 0,
|
|
2751
3256
|
id: counterId.value,
|
|
2752
3257
|
class: normalizeClass(["tao-textarea__count", { "tao-textarea__count--limit": atLimit.value }])
|
|
2753
|
-
}, toDisplayString(countLabel.value), 11,
|
|
2754
|
-
]));
|
|
3258
|
+
}, toDisplayString(countLabel.value), 11, _hoisted_2$t)) : createCommentVNode("", true)
|
|
3259
|
+
], 2));
|
|
2755
3260
|
};
|
|
2756
3261
|
}
|
|
2757
3262
|
});
|
|
2758
|
-
const TaoTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-
|
|
3263
|
+
const TaoTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-50628dd9"]]);
|
|
2759
3264
|
const _hoisted_1$v = ["tabindex", "aria-label"];
|
|
2760
3265
|
const _hoisted_2$s = { class: "tao-scroll-top__content" };
|
|
2761
3266
|
const RIPPLE_DURATION = 750;
|
|
@@ -2768,12 +3273,14 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
2768
3273
|
bottom: { default: 24 },
|
|
2769
3274
|
zIndex: { default: 1e3 },
|
|
2770
3275
|
boundary: { default: 300 },
|
|
2771
|
-
|
|
3276
|
+
outline: { type: Boolean, default: void 0 },
|
|
3277
|
+
hasOutline: { type: Boolean, default: void 0 },
|
|
2772
3278
|
tabindex: { default: 0 },
|
|
2773
|
-
ariaLabel: {
|
|
3279
|
+
ariaLabel: {}
|
|
2774
3280
|
},
|
|
2775
3281
|
setup(__props) {
|
|
2776
3282
|
const props = __props;
|
|
3283
|
+
useLocaleText(props, "scrollTop");
|
|
2777
3284
|
const fmtProp = (value, unit = "px") => typeof value === "number" ? value + unit : value;
|
|
2778
3285
|
let prevPos = 0;
|
|
2779
3286
|
let activeBack = false;
|
|
@@ -2848,6 +3355,10 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
2848
3355
|
onBeforeUnmount(() => {
|
|
2849
3356
|
window.removeEventListener("scroll", onScroll);
|
|
2850
3357
|
});
|
|
3358
|
+
warnDeprecated("TaoScrollTop", {
|
|
3359
|
+
hasOutline: "use `outline`",
|
|
3360
|
+
tabindex: "pass `tabindex` as a plain attribute"
|
|
3361
|
+
});
|
|
2851
3362
|
return (_ctx, _cache) => {
|
|
2852
3363
|
return openBlock(), createBlock(Transition, { name: "tao-scroll-top-fade" }, {
|
|
2853
3364
|
default: withCtx(() => [
|
|
@@ -2856,7 +3367,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
2856
3367
|
type: "button",
|
|
2857
3368
|
style: normalizeStyle(mainStyle),
|
|
2858
3369
|
tabindex: props.tabindex,
|
|
2859
|
-
class: normalizeClass(["tao-scroll-top", { "tao-scroll-top--no-outline":
|
|
3370
|
+
class: normalizeClass(["tao-scroll-top", { "tao-scroll-top--no-outline": (props.outline ?? props.hasOutline) === false }]),
|
|
2860
3371
|
"aria-label": props.ariaLabel,
|
|
2861
3372
|
onClick: withModifiers(onClick, ["prevent"])
|
|
2862
3373
|
}, [
|
|
@@ -2884,7 +3395,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
2884
3395
|
};
|
|
2885
3396
|
}
|
|
2886
3397
|
});
|
|
2887
|
-
const TaoScrollTop = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-
|
|
3398
|
+
const TaoScrollTop = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-9ec6a1a2"]]);
|
|
2888
3399
|
const _hoisted_1$u = { class: "tao-progress" };
|
|
2889
3400
|
const _hoisted_2$r = {
|
|
2890
3401
|
key: 0,
|
|
@@ -2964,7 +3475,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
2964
3475
|
}
|
|
2965
3476
|
});
|
|
2966
3477
|
const TaoProgress = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__scopeId", "data-v-1aae89cd"]]);
|
|
2967
|
-
const _hoisted_1$t = ["id", "tabindex", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-disabled", "aria-describedby"];
|
|
3478
|
+
const _hoisted_1$t = ["id", "tabindex", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-disabled", "aria-invalid", "aria-describedby"];
|
|
2968
3479
|
const _hoisted_2$q = ["placeholder"];
|
|
2969
3480
|
const _hoisted_3$l = {
|
|
2970
3481
|
key: 1,
|
|
@@ -2981,10 +3492,12 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
2981
3492
|
placeholder: { default: "" },
|
|
2982
3493
|
modelValue: {},
|
|
2983
3494
|
disabled: { type: Boolean, default: false },
|
|
2984
|
-
|
|
3495
|
+
error: { type: Boolean, default: false },
|
|
3496
|
+
variant: { default: "bar" },
|
|
3497
|
+
size: {},
|
|
2985
3498
|
wheel: { default: 0 }
|
|
2986
3499
|
},
|
|
2987
|
-
emits: ["update:modelValue"],
|
|
3500
|
+
emits: ["update:modelValue", "change"],
|
|
2988
3501
|
setup(__props, { emit: __emit }) {
|
|
2989
3502
|
const props = __props;
|
|
2990
3503
|
const emit = __emit;
|
|
@@ -2992,6 +3505,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
2992
3505
|
const localId = useId();
|
|
2993
3506
|
const controlId = computed(() => (field == null ? void 0 : field.id) ?? localId);
|
|
2994
3507
|
const describedBy = computed(() => field == null ? void 0 : field.describedBy.value);
|
|
3508
|
+
const invalid = computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
2995
3509
|
function packModelValue(value) {
|
|
2996
3510
|
return typeof props.modelValue === "string" ? `${value}` : value;
|
|
2997
3511
|
}
|
|
@@ -2999,10 +3513,11 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
2999
3513
|
const raw = typeof props.modelValue === "string" ? parseFloat(props.modelValue) : props.modelValue;
|
|
3000
3514
|
return Number.isFinite(raw) ? raw : props.min;
|
|
3001
3515
|
}
|
|
3002
|
-
const
|
|
3516
|
+
const current2 = computed(() => unpackModelValue());
|
|
3003
3517
|
const trackRef = ref(null);
|
|
3004
3518
|
const isDragging = ref(false);
|
|
3005
3519
|
let dragPointer = -1;
|
|
3520
|
+
let dragStartValue = 0;
|
|
3006
3521
|
const shadowInputRef = ref(null);
|
|
3007
3522
|
const shadowModel = ref("0");
|
|
3008
3523
|
const showShadowModel = ref(false);
|
|
@@ -3011,13 +3526,18 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
3011
3526
|
if (range <= 0) {
|
|
3012
3527
|
return 0;
|
|
3013
3528
|
}
|
|
3014
|
-
return (
|
|
3529
|
+
return (current2.value - props.min) / range * 100;
|
|
3015
3530
|
});
|
|
3016
3531
|
function clampValue(v) {
|
|
3017
3532
|
return Math.min(Math.max(v, props.min), props.max);
|
|
3018
3533
|
}
|
|
3019
|
-
function commit(value) {
|
|
3020
|
-
|
|
3534
|
+
function commit(value, final = false) {
|
|
3535
|
+
const next = clampValue(value);
|
|
3536
|
+
const changed = next !== current2.value;
|
|
3537
|
+
emit("update:modelValue", packModelValue(next));
|
|
3538
|
+
if (final && changed) {
|
|
3539
|
+
emit("change", packModelValue(next));
|
|
3540
|
+
}
|
|
3021
3541
|
}
|
|
3022
3542
|
function calculateValue(event) {
|
|
3023
3543
|
if (!trackRef.value) {
|
|
@@ -3050,12 +3570,16 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
3050
3570
|
isDragging.value = false;
|
|
3051
3571
|
releaseDragCapture();
|
|
3052
3572
|
dragPointer = -1;
|
|
3573
|
+
if (current2.value !== dragStartValue) {
|
|
3574
|
+
emit("change", packModelValue(current2.value));
|
|
3575
|
+
}
|
|
3053
3576
|
}
|
|
3054
3577
|
function onPointerDown(event) {
|
|
3055
3578
|
if (props.disabled || showShadowModel.value || event.button !== 0 || !trackRef.value) {
|
|
3056
3579
|
return;
|
|
3057
3580
|
}
|
|
3058
3581
|
dragPointer = event.pointerId;
|
|
3582
|
+
dragStartValue = current2.value;
|
|
3059
3583
|
isDragging.value = true;
|
|
3060
3584
|
commit(calculateValue(event));
|
|
3061
3585
|
event.preventDefault();
|
|
@@ -3096,17 +3620,17 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
3096
3620
|
};
|
|
3097
3621
|
if (event.key in keys) {
|
|
3098
3622
|
event.preventDefault();
|
|
3099
|
-
commit(
|
|
3623
|
+
commit(current2.value + keys[event.key], true);
|
|
3100
3624
|
return;
|
|
3101
3625
|
}
|
|
3102
3626
|
if (event.key === "Home") {
|
|
3103
3627
|
event.preventDefault();
|
|
3104
|
-
commit(props.min);
|
|
3628
|
+
commit(props.min, true);
|
|
3105
3629
|
return;
|
|
3106
3630
|
}
|
|
3107
3631
|
if (event.key === "End") {
|
|
3108
3632
|
event.preventDefault();
|
|
3109
|
-
commit(props.max);
|
|
3633
|
+
commit(props.max, true);
|
|
3110
3634
|
}
|
|
3111
3635
|
}
|
|
3112
3636
|
function onWheel(event) {
|
|
@@ -3115,13 +3639,13 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
3115
3639
|
}
|
|
3116
3640
|
event.preventDefault();
|
|
3117
3641
|
const delta = event.deltaY < 0 ? props.wheel : -props.wheel;
|
|
3118
|
-
commit(
|
|
3642
|
+
commit(current2.value + delta, true);
|
|
3119
3643
|
}
|
|
3120
3644
|
function onBlurShadowModel() {
|
|
3121
3645
|
if (shadowModel.value) {
|
|
3122
|
-
const
|
|
3123
|
-
shadowModel.value = `${
|
|
3124
|
-
|
|
3646
|
+
const next = clampValue(parseFloat(shadowModel.value) || 0);
|
|
3647
|
+
shadowModel.value = `${packModelValue(next)}`;
|
|
3648
|
+
commit(next, true);
|
|
3125
3649
|
}
|
|
3126
3650
|
showShadowModel.value = false;
|
|
3127
3651
|
}
|
|
@@ -3156,15 +3680,17 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
3156
3680
|
ref_key: "trackRef",
|
|
3157
3681
|
ref: trackRef,
|
|
3158
3682
|
class: normalizeClass(["tao-slider", [
|
|
3159
|
-
`tao-slider--${__props.
|
|
3160
|
-
|
|
3683
|
+
`tao-slider--${__props.variant}`,
|
|
3684
|
+
unref(sizeClass)(__props.size),
|
|
3685
|
+
{ "tao-slider--show-value": __props.showValue, "tao-slider--disabled": __props.disabled, "tao-slider--invalid": invalid.value }
|
|
3161
3686
|
]]),
|
|
3162
3687
|
role: "slider",
|
|
3163
3688
|
tabindex: __props.disabled ? -1 : 0,
|
|
3164
3689
|
"aria-valuemin": __props.min,
|
|
3165
3690
|
"aria-valuemax": __props.max,
|
|
3166
|
-
"aria-valuenow":
|
|
3691
|
+
"aria-valuenow": current2.value,
|
|
3167
3692
|
"aria-disabled": __props.disabled || void 0,
|
|
3693
|
+
"aria-invalid": invalid.value || void 0,
|
|
3168
3694
|
"aria-describedby": describedBy.value,
|
|
3169
3695
|
onContextmenu: withModifiers(onContextMenu, ["prevent"]),
|
|
3170
3696
|
onPointerdown: onPointerDown,
|
|
@@ -3208,37 +3734,37 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
3208
3734
|
};
|
|
3209
3735
|
}
|
|
3210
3736
|
});
|
|
3211
|
-
const TaoSlider = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-
|
|
3212
|
-
const _hoisted_1$s = { class: "tao-file-
|
|
3213
|
-
const _hoisted_2$p =
|
|
3214
|
-
const _hoisted_3$k =
|
|
3215
|
-
const _hoisted_4$j =
|
|
3216
|
-
const _hoisted_5$f =
|
|
3217
|
-
const _hoisted_6$c = {
|
|
3737
|
+
const TaoSlider = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-47d32e2a"]]);
|
|
3738
|
+
const _hoisted_1$s = { class: "tao-file-drop__row" };
|
|
3739
|
+
const _hoisted_2$p = ["aria-label"];
|
|
3740
|
+
const _hoisted_3$k = { "aria-hidden": "true" };
|
|
3741
|
+
const _hoisted_4$j = ["accept", "multiple"];
|
|
3742
|
+
const _hoisted_5$f = {
|
|
3218
3743
|
key: 0,
|
|
3219
3744
|
class: "tao-file-drop__list"
|
|
3220
3745
|
};
|
|
3221
|
-
const
|
|
3222
|
-
const
|
|
3223
|
-
const
|
|
3224
|
-
const
|
|
3746
|
+
const _hoisted_6$c = { class: "tao-file-drop__name" };
|
|
3747
|
+
const _hoisted_7$a = { class: "tao-file-drop__meta" };
|
|
3748
|
+
const _hoisted_8$9 = ["aria-label", "onClick"];
|
|
3749
|
+
const _hoisted_9$4 = { "aria-hidden": "true" };
|
|
3225
3750
|
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
3226
3751
|
...{ name: "TaoFileDrop" },
|
|
3227
3752
|
__name: "TaoFileDrop",
|
|
3228
3753
|
props: {
|
|
3229
3754
|
modelValue: { default: () => [] },
|
|
3230
|
-
size: {
|
|
3755
|
+
size: {},
|
|
3231
3756
|
accept: { default: "*" },
|
|
3232
3757
|
multiple: { type: Boolean, default: false },
|
|
3233
3758
|
showClear: { type: Boolean, default: false },
|
|
3234
|
-
clearLabel: {
|
|
3235
|
-
removeLabel: {
|
|
3759
|
+
clearLabel: {},
|
|
3760
|
+
removeLabel: {},
|
|
3236
3761
|
formatSize: {},
|
|
3237
3762
|
list: { type: Boolean, default: true }
|
|
3238
3763
|
},
|
|
3239
|
-
emits: ["update:modelValue", "files", "clear-request"],
|
|
3764
|
+
emits: ["update:modelValue", "change", "files", "clear-request"],
|
|
3240
3765
|
setup(__props, { emit: __emit }) {
|
|
3241
3766
|
const props = __props;
|
|
3767
|
+
const l10n = useLocaleText(props, "fileDrop");
|
|
3242
3768
|
const emit = __emit;
|
|
3243
3769
|
const isDragging = ref(false);
|
|
3244
3770
|
const fileInput = ref(null);
|
|
@@ -3269,6 +3795,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
3269
3795
|
}
|
|
3270
3796
|
function commit(files) {
|
|
3271
3797
|
emit("update:modelValue", files);
|
|
3798
|
+
emit("change", files);
|
|
3272
3799
|
emit("files", files);
|
|
3273
3800
|
}
|
|
3274
3801
|
function handleDragOver(event) {
|
|
@@ -3327,17 +3854,18 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
3327
3854
|
resetInput();
|
|
3328
3855
|
}
|
|
3329
3856
|
function defaultFormatSize(bytes) {
|
|
3857
|
+
const { units, decimalSeparator } = taoLocale().fileDrop;
|
|
3330
3858
|
if (bytes < 1024) {
|
|
3331
|
-
return `${bytes}
|
|
3859
|
+
return `${bytes} ${units[0]}`;
|
|
3332
3860
|
}
|
|
3333
3861
|
const kb = bytes / 1024;
|
|
3334
3862
|
if (kb < 1024) {
|
|
3335
3863
|
const value2 = kb < 10 ? kb.toFixed(1) : String(Math.round(kb));
|
|
3336
|
-
return `${value2.replace(".",
|
|
3864
|
+
return `${value2.replace(".", decimalSeparator)} ${units[1]}`;
|
|
3337
3865
|
}
|
|
3338
3866
|
const mb = kb / 1024;
|
|
3339
3867
|
const value = mb < 10 ? mb.toFixed(1) : String(Math.round(mb));
|
|
3340
|
-
return `${value.replace(".",
|
|
3868
|
+
return `${value.replace(".", decimalSeparator)} ${units[2]}`;
|
|
3341
3869
|
}
|
|
3342
3870
|
function sizeLabel(bytes) {
|
|
3343
3871
|
return props.formatSize ? props.formatSize(bytes) : defaultFormatSize(bytes);
|
|
@@ -3352,30 +3880,35 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
3352
3880
|
});
|
|
3353
3881
|
});
|
|
3354
3882
|
onBeforeUnmount(() => stopFocusLoss == null ? void 0 : stopFocusLoss());
|
|
3883
|
+
warnDeprecated("TaoFileDrop", {
|
|
3884
|
+
onFiles: 'listen to "change"'
|
|
3885
|
+
});
|
|
3355
3886
|
return (_ctx, _cache) => {
|
|
3356
|
-
return openBlock(), createElementBlock("div",
|
|
3357
|
-
|
|
3887
|
+
return openBlock(), createElementBlock("div", {
|
|
3888
|
+
class: normalizeClass(["tao-file-drop", unref(sizeClass)(__props.size)])
|
|
3889
|
+
}, [
|
|
3890
|
+
createElementVNode("div", _hoisted_1$s, [
|
|
3358
3891
|
__props.showClear && __props.modelValue.length ? (openBlock(), createElementBlock("button", {
|
|
3359
3892
|
key: 0,
|
|
3360
3893
|
type: "button",
|
|
3361
3894
|
class: "tao-file-drop__clear",
|
|
3362
|
-
"aria-label":
|
|
3895
|
+
"aria-label": unref(l10n).clearLabel,
|
|
3363
3896
|
onClick: requestClear
|
|
3364
3897
|
}, [
|
|
3365
|
-
createElementVNode("span",
|
|
3898
|
+
createElementVNode("span", _hoisted_3$k, [
|
|
3366
3899
|
renderSlot(_ctx.$slots, "clear-icon", {}, () => [
|
|
3367
3900
|
_cache[1] || (_cache[1] = createTextVNode("✕", -1))
|
|
3368
3901
|
], true)
|
|
3369
3902
|
])
|
|
3370
|
-
], 8,
|
|
3903
|
+
], 8, _hoisted_2$p)) : createCommentVNode("", true),
|
|
3371
3904
|
createElementVNode("label", {
|
|
3372
|
-
class: normalizeClass(["tao-file-drop__zone",
|
|
3905
|
+
class: normalizeClass(["tao-file-drop__zone", { "tao-file-drop__zone--dragging": isDragging.value }]),
|
|
3373
3906
|
onDragover: handleDragOver,
|
|
3374
3907
|
onDragleave: handleDragLeave,
|
|
3375
3908
|
onDrop: handleDrop
|
|
3376
3909
|
}, [
|
|
3377
3910
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
3378
|
-
|
|
3911
|
+
createTextVNode(toDisplayString(unref(taoLocale)().fileDrop.zoneText), 1)
|
|
3379
3912
|
], true),
|
|
3380
3913
|
createElementVNode("input", {
|
|
3381
3914
|
ref_key: "fileInput",
|
|
@@ -3387,37 +3920,37 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
3387
3920
|
onChange: handleFileSelect,
|
|
3388
3921
|
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
3389
3922
|
}, ["stop"]))
|
|
3390
|
-
}, null, 40,
|
|
3923
|
+
}, null, 40, _hoisted_4$j)
|
|
3391
3924
|
], 34)
|
|
3392
3925
|
]),
|
|
3393
|
-
__props.list && __props.modelValue.length ? (openBlock(), createElementBlock("ul",
|
|
3926
|
+
__props.list && __props.modelValue.length ? (openBlock(), createElementBlock("ul", _hoisted_5$f, [
|
|
3394
3927
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.modelValue, (file, index) => {
|
|
3395
3928
|
return openBlock(), createElementBlock("li", {
|
|
3396
3929
|
key: fileKey(file, index),
|
|
3397
3930
|
class: "tao-file-drop__file"
|
|
3398
3931
|
}, [
|
|
3399
|
-
createElementVNode("span",
|
|
3400
|
-
createElementVNode("span",
|
|
3932
|
+
createElementVNode("span", _hoisted_6$c, toDisplayString(file.name), 1),
|
|
3933
|
+
createElementVNode("span", _hoisted_7$a, toDisplayString(sizeLabel(file.size)), 1),
|
|
3401
3934
|
createElementVNode("button", {
|
|
3402
3935
|
type: "button",
|
|
3403
3936
|
class: "tao-file-drop__remove",
|
|
3404
|
-
"aria-label":
|
|
3937
|
+
"aria-label": unref(l10n).removeLabel.replace("{name}", file.name),
|
|
3405
3938
|
onClick: ($event) => removeAt(index)
|
|
3406
3939
|
}, [
|
|
3407
|
-
createElementVNode("span",
|
|
3940
|
+
createElementVNode("span", _hoisted_9$4, [
|
|
3408
3941
|
renderSlot(_ctx.$slots, "remove-icon", {}, () => [
|
|
3409
|
-
_cache[
|
|
3942
|
+
_cache[2] || (_cache[2] = createTextVNode("✕", -1))
|
|
3410
3943
|
], true)
|
|
3411
3944
|
])
|
|
3412
|
-
], 8,
|
|
3945
|
+
], 8, _hoisted_8$9)
|
|
3413
3946
|
]);
|
|
3414
3947
|
}), 128))
|
|
3415
3948
|
])) : createCommentVNode("", true)
|
|
3416
|
-
]);
|
|
3949
|
+
], 2);
|
|
3417
3950
|
};
|
|
3418
3951
|
}
|
|
3419
3952
|
});
|
|
3420
|
-
const TaoFileDrop = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-
|
|
3953
|
+
const TaoFileDrop = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-f8c58faa"]]);
|
|
3421
3954
|
const _hoisted_1$r = ["aria-expanded", "aria-label"];
|
|
3422
3955
|
const _hoisted_2$o = {
|
|
3423
3956
|
key: 1,
|
|
@@ -3430,11 +3963,12 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
3430
3963
|
__name: "TaoDropdownMenu",
|
|
3431
3964
|
props: {
|
|
3432
3965
|
actions: { default: () => [] },
|
|
3433
|
-
menuLabel: {
|
|
3966
|
+
menuLabel: {}
|
|
3434
3967
|
},
|
|
3435
|
-
emits: ["selected"],
|
|
3968
|
+
emits: ["select", "selected"],
|
|
3436
3969
|
setup(__props, { emit: __emit }) {
|
|
3437
3970
|
const props = __props;
|
|
3971
|
+
const l10n = useLocaleText(props, "dropdownMenu");
|
|
3438
3972
|
const emit = __emit;
|
|
3439
3973
|
const menuRef = ref(null);
|
|
3440
3974
|
const listRef = ref(null);
|
|
@@ -3490,6 +4024,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
3490
4024
|
function emitAction(id) {
|
|
3491
4025
|
var _a;
|
|
3492
4026
|
isOpen.value = false;
|
|
4027
|
+
emit("select", id);
|
|
3493
4028
|
emit("selected", id);
|
|
3494
4029
|
(_a = triggerRef.value) == null ? void 0 : _a.focus();
|
|
3495
4030
|
}
|
|
@@ -3546,6 +4081,9 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
3546
4081
|
window.removeEventListener("scroll", onWinScroll, true);
|
|
3547
4082
|
window.removeEventListener("resize", updatePosition);
|
|
3548
4083
|
});
|
|
4084
|
+
warnDeprecated("TaoDropdownMenu", {
|
|
4085
|
+
onSelected: 'listen to "select"'
|
|
4086
|
+
});
|
|
3549
4087
|
return (_ctx, _cache) => {
|
|
3550
4088
|
return openBlock(), createElementBlock("div", {
|
|
3551
4089
|
ref_key: "menuRef",
|
|
@@ -3559,7 +4097,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
3559
4097
|
class: "tao-dropdown-menu__button",
|
|
3560
4098
|
"aria-haspopup": "menu",
|
|
3561
4099
|
"aria-expanded": isOpen.value,
|
|
3562
|
-
"aria-label": _ctx.$slots.button ? void 0 :
|
|
4100
|
+
"aria-label": _ctx.$slots.button ? void 0 : unref(l10n).menuLabel,
|
|
3563
4101
|
onClick: toggleMenu
|
|
3564
4102
|
}, [
|
|
3565
4103
|
_ctx.$slots.button ? renderSlot(_ctx.$slots, "button", {}, void 0, true, 0) : (openBlock(), createElementBlock("span", _hoisted_2$o, [
|
|
@@ -3601,16 +4139,20 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
3601
4139
|
};
|
|
3602
4140
|
}
|
|
3603
4141
|
});
|
|
3604
|
-
const TaoDropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-
|
|
4142
|
+
const TaoDropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-5db490aa"]]);
|
|
3605
4143
|
const _hoisted_1$q = ["aria-invalid", "aria-describedby"];
|
|
3606
|
-
const _hoisted_2$n = ["id", "value", "placeholder", "type", "inputmode", "pattern", "maxlength", "onInput", "onPaste", "onKeydown", "onFocus"];
|
|
4144
|
+
const _hoisted_2$n = ["id", "value", "placeholder", "type", "disabled", "aria-invalid", "inputmode", "pattern", "maxlength", "onInput", "onPaste", "onKeydown", "onFocus"];
|
|
3607
4145
|
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
3608
4146
|
...{ name: "TaoPinCode" },
|
|
3609
4147
|
__name: "TaoPinCode",
|
|
3610
4148
|
props: {
|
|
3611
4149
|
length: {},
|
|
4150
|
+
masked: { type: Boolean, default: false },
|
|
3612
4151
|
hidden: { type: Boolean, default: false },
|
|
3613
4152
|
placeholder: { default: "" },
|
|
4153
|
+
disabled: { type: Boolean, default: false },
|
|
4154
|
+
error: { type: Boolean, default: false },
|
|
4155
|
+
size: {},
|
|
3614
4156
|
modelValue: { default: "" },
|
|
3615
4157
|
numbersOnly: { type: Boolean, default: false },
|
|
3616
4158
|
clearOn: { default: "focus" }
|
|
@@ -3622,7 +4164,8 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
3622
4164
|
const field = inject(formFieldKey, null);
|
|
3623
4165
|
const localId = useId();
|
|
3624
4166
|
const controlId = computed(() => (field == null ? void 0 : field.id) ?? localId);
|
|
3625
|
-
const invalid = computed(() => Boolean(field == null ? void 0 : field.invalid.value));
|
|
4167
|
+
const invalid = computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
4168
|
+
const isMasked = computed(() => props.masked || props.hidden);
|
|
3626
4169
|
const describedBy = computed(() => field == null ? void 0 : field.describedBy.value);
|
|
3627
4170
|
const numbers = ref([]);
|
|
3628
4171
|
const inputRefs = ref([]);
|
|
@@ -3784,9 +4327,12 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
3784
4327
|
},
|
|
3785
4328
|
{ immediate: true }
|
|
3786
4329
|
);
|
|
4330
|
+
warnDeprecated("TaoPinCode", {
|
|
4331
|
+
hidden: "use `masked`"
|
|
4332
|
+
});
|
|
3787
4333
|
return (_ctx, _cache) => {
|
|
3788
4334
|
return openBlock(), createElementBlock("div", {
|
|
3789
|
-
class: "tao-pin-code",
|
|
4335
|
+
class: normalizeClass(["tao-pin-code", [unref(sizeClass)(__props.size), { "tao-pin-code--disabled": __props.disabled }]]),
|
|
3790
4336
|
role: "group",
|
|
3791
4337
|
"aria-invalid": invalid.value || void 0,
|
|
3792
4338
|
"aria-describedby": describedBy.value
|
|
@@ -3803,7 +4349,9 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
3803
4349
|
}]),
|
|
3804
4350
|
value: num,
|
|
3805
4351
|
placeholder: __props.placeholder,
|
|
3806
|
-
type:
|
|
4352
|
+
type: isMasked.value ? "password" : "text",
|
|
4353
|
+
disabled: __props.disabled,
|
|
4354
|
+
"aria-invalid": invalid.value || void 0,
|
|
3807
4355
|
inputmode: __props.numbersOnly ? "numeric" : "text",
|
|
3808
4356
|
pattern: __props.numbersOnly ? "[0-9]" : void 0,
|
|
3809
4357
|
autocomplete: "one-time-code",
|
|
@@ -3815,16 +4363,17 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
3815
4363
|
onBlur
|
|
3816
4364
|
}, null, 42, _hoisted_2$n);
|
|
3817
4365
|
}), 128))
|
|
3818
|
-
],
|
|
4366
|
+
], 10, _hoisted_1$q);
|
|
3819
4367
|
};
|
|
3820
4368
|
}
|
|
3821
4369
|
});
|
|
3822
|
-
const TaoPinCode = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-
|
|
4370
|
+
const TaoPinCode = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-6f0df8bd"]]);
|
|
3823
4371
|
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
3824
4372
|
...{ name: "TaoLink" },
|
|
3825
4373
|
__name: "TaoLink",
|
|
3826
4374
|
props: {
|
|
3827
4375
|
to: { default: void 0 },
|
|
4376
|
+
newTab: { type: Boolean, default: false },
|
|
3828
4377
|
asNewTab: { type: Boolean, default: false },
|
|
3829
4378
|
private: { type: Boolean, default: false },
|
|
3830
4379
|
exactPath: { type: Boolean, default: false }
|
|
@@ -3836,8 +4385,9 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
3836
4385
|
const linkKind = globals.NuxtLink ? "nuxt" : globals.RouterLink ? "router" : "a";
|
|
3837
4386
|
const linkComponent = linkKind === "nuxt" ? globals.NuxtLink : linkKind === "router" ? globals.RouterLink : "a";
|
|
3838
4387
|
const linkProps = computed(() => {
|
|
3839
|
-
const
|
|
3840
|
-
const
|
|
4388
|
+
const newTab = props.newTab || props.asNewTab;
|
|
4389
|
+
const target = newTab ? "_blank" : void 0;
|
|
4390
|
+
const rel = props.private && "noopener noreferrer" || newTab && "noopener" || void 0;
|
|
3841
4391
|
if (linkKind === "a") {
|
|
3842
4392
|
return {
|
|
3843
4393
|
href: typeof props.to === "string" ? props.to : void 0,
|
|
@@ -3852,6 +4402,9 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
3852
4402
|
...linkKind === "nuxt" ? { exactPath: props.exactPath } : {}
|
|
3853
4403
|
};
|
|
3854
4404
|
});
|
|
4405
|
+
warnDeprecated("TaoLink", {
|
|
4406
|
+
asNewTab: "use `newTab`"
|
|
4407
|
+
});
|
|
3855
4408
|
return (_ctx, _cache) => {
|
|
3856
4409
|
return openBlock(), createBlock(resolveDynamicComponent(unref(linkComponent)), mergeProps(linkProps.value, { draggable: "false" }), {
|
|
3857
4410
|
default: withCtx(() => [
|
|
@@ -3869,7 +4422,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
3869
4422
|
props: {
|
|
3870
4423
|
label: {},
|
|
3871
4424
|
hint: {},
|
|
3872
|
-
error: {}
|
|
4425
|
+
error: {},
|
|
4426
|
+
size: {}
|
|
3873
4427
|
},
|
|
3874
4428
|
setup(__props) {
|
|
3875
4429
|
const props = __props;
|
|
@@ -3905,7 +4459,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
3905
4459
|
}
|
|
3906
4460
|
return (_ctx, _cache) => {
|
|
3907
4461
|
return openBlock(), createElementBlock("div", {
|
|
3908
|
-
class: normalizeClass(["tao-form-field", { "tao-form-field--invalid": invalid.value }])
|
|
4462
|
+
class: normalizeClass(["tao-form-field", [unref(sizeClass)(__props.size), { "tao-form-field--invalid": invalid.value }]])
|
|
3909
4463
|
}, [
|
|
3910
4464
|
__props.label ? (openBlock(), createElementBlock("label", {
|
|
3911
4465
|
key: 0,
|
|
@@ -3928,7 +4482,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
3928
4482
|
};
|
|
3929
4483
|
}
|
|
3930
4484
|
});
|
|
3931
|
-
const TaoFormField = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-
|
|
4485
|
+
const TaoFormField = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-3cf90e3a"]]);
|
|
3932
4486
|
const _hoisted_1$o = ["id", "aria-expanded", "aria-invalid", "aria-describedby", "disabled"];
|
|
3933
4487
|
const _hoisted_2$m = { class: "tao-select__value" };
|
|
3934
4488
|
const _hoisted_3$i = ["aria-activedescendant"];
|
|
@@ -3939,16 +4493,17 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
3939
4493
|
props: {
|
|
3940
4494
|
modelValue: { default: null },
|
|
3941
4495
|
options: { default: () => [] },
|
|
3942
|
-
placeholder: {
|
|
4496
|
+
placeholder: {},
|
|
3943
4497
|
disabled: { type: Boolean, default: false },
|
|
3944
4498
|
error: { type: Boolean, default: false },
|
|
3945
|
-
clearText: {
|
|
4499
|
+
clearText: {},
|
|
3946
4500
|
clearable: { type: Boolean, default: true },
|
|
3947
|
-
size: {
|
|
4501
|
+
size: {}
|
|
3948
4502
|
},
|
|
3949
4503
|
emits: ["update:modelValue", "change"],
|
|
3950
4504
|
setup(__props, { emit: __emit }) {
|
|
3951
4505
|
const props = __props;
|
|
4506
|
+
const l10n = useLocaleText(props, "select");
|
|
3952
4507
|
const emit = __emit;
|
|
3953
4508
|
const field = inject(formFieldKey, null);
|
|
3954
4509
|
const localId = useId();
|
|
@@ -3962,6 +4517,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
3962
4517
|
const panelRef = ref(null);
|
|
3963
4518
|
const listRef = ref(null);
|
|
3964
4519
|
const listStyle = ref({ top: "0px", left: "0px", width: "0px" });
|
|
4520
|
+
const panelSize = ref("medium");
|
|
3965
4521
|
const selected = computed(() => props.options.find((option) => option.value === props.modelValue) ?? null);
|
|
3966
4522
|
const enabledIndexes = computed(
|
|
3967
4523
|
() => props.options.map((option, index) => option.disabled ? -1 : index).filter((index) => index >= 0)
|
|
@@ -4118,6 +4674,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
4118
4674
|
}
|
|
4119
4675
|
watch(open, (isOpen) => {
|
|
4120
4676
|
if (isOpen) {
|
|
4677
|
+
panelSize.value = resolveSize(triggerRef.value, props.size);
|
|
4121
4678
|
document.addEventListener("pointerdown", onDocumentPointer);
|
|
4122
4679
|
window.addEventListener("resize", onViewportChange);
|
|
4123
4680
|
window.addEventListener("scroll", onViewportChange, true);
|
|
@@ -4135,7 +4692,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
4135
4692
|
return (_ctx, _cache) => {
|
|
4136
4693
|
var _a;
|
|
4137
4694
|
return openBlock(), createElementBlock("div", {
|
|
4138
|
-
class: normalizeClass(["tao-select", [
|
|
4695
|
+
class: normalizeClass(["tao-select", [unref(sizeClass)(__props.size), { "tao-select--open": open.value, "tao-select--invalid": invalid.value }]])
|
|
4139
4696
|
}, [
|
|
4140
4697
|
createElementVNode("button", {
|
|
4141
4698
|
id: controlId.value,
|
|
@@ -4153,7 +4710,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
4153
4710
|
onClick: toggle,
|
|
4154
4711
|
onKeydown: onTriggerKeydown
|
|
4155
4712
|
}, [
|
|
4156
|
-
createElementVNode("span", _hoisted_2$m, toDisplayString(((_a = selected.value) == null ? void 0 : _a.label) ??
|
|
4713
|
+
createElementVNode("span", _hoisted_2$m, toDisplayString(((_a = selected.value) == null ? void 0 : _a.label) ?? unref(l10n).placeholder), 1),
|
|
4157
4714
|
createElementVNode("span", {
|
|
4158
4715
|
class: normalizeClass(["tao-select__chevron", { "tao-select__chevron--custom": _ctx.$slots.chevron }]),
|
|
4159
4716
|
"aria-hidden": "true"
|
|
@@ -4166,7 +4723,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
4166
4723
|
key: 0,
|
|
4167
4724
|
ref_key: "panelRef",
|
|
4168
4725
|
ref: panelRef,
|
|
4169
|
-
class: normalizeClass(["tao-select__panel",
|
|
4726
|
+
class: normalizeClass(["tao-select__panel", unref(sizeClass)(panelSize.value)]),
|
|
4170
4727
|
style: normalizeStyle(listStyle.value)
|
|
4171
4728
|
}, [
|
|
4172
4729
|
createElementVNode("ul", {
|
|
@@ -4208,7 +4765,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
4208
4765
|
onClick: clear
|
|
4209
4766
|
}, [
|
|
4210
4767
|
renderSlot(_ctx.$slots, "clear", {}, () => [
|
|
4211
|
-
createTextVNode(toDisplayString(
|
|
4768
|
+
createTextVNode(toDisplayString(unref(l10n).clearText), 1)
|
|
4212
4769
|
], true)
|
|
4213
4770
|
], 32)) : createCommentVNode("", true)
|
|
4214
4771
|
], 6)) : createCommentVNode("", true)
|
|
@@ -4217,7 +4774,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
4217
4774
|
};
|
|
4218
4775
|
}
|
|
4219
4776
|
});
|
|
4220
|
-
const TaoSelect = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-
|
|
4777
|
+
const TaoSelect = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-47d327a3"]]);
|
|
4221
4778
|
const _hoisted_1$n = ["id", "aria-expanded", "aria-activedescendant", "aria-invalid", "aria-describedby", "disabled", "placeholder", "value"];
|
|
4222
4779
|
const _hoisted_2$l = {
|
|
4223
4780
|
key: 0,
|
|
@@ -4230,18 +4787,19 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
4230
4787
|
props: {
|
|
4231
4788
|
modelValue: { default: null },
|
|
4232
4789
|
options: { default: () => [] },
|
|
4233
|
-
placeholder: {
|
|
4790
|
+
placeholder: {},
|
|
4234
4791
|
disabled: { type: Boolean, default: false },
|
|
4235
4792
|
error: { type: Boolean, default: false },
|
|
4236
|
-
emptyText: {
|
|
4237
|
-
clearText: {
|
|
4793
|
+
emptyText: {},
|
|
4794
|
+
clearText: {},
|
|
4238
4795
|
clearable: { type: Boolean, default: true },
|
|
4239
|
-
size: {
|
|
4796
|
+
size: {},
|
|
4240
4797
|
allowCreate: { type: Boolean, default: false }
|
|
4241
4798
|
},
|
|
4242
4799
|
emits: ["update:modelValue", "change", "create"],
|
|
4243
4800
|
setup(__props, { emit: __emit }) {
|
|
4244
4801
|
const props = __props;
|
|
4802
|
+
const l10n = useLocaleText(props, "combobox");
|
|
4245
4803
|
const emit = __emit;
|
|
4246
4804
|
const field = inject(formFieldKey, null);
|
|
4247
4805
|
const localId = useId();
|
|
@@ -4258,6 +4816,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
4258
4816
|
const fieldRef = ref(null);
|
|
4259
4817
|
const inputRef = ref(null);
|
|
4260
4818
|
const panelRef = ref(null);
|
|
4819
|
+
const panelSize = ref("medium");
|
|
4261
4820
|
const listRef = ref(null);
|
|
4262
4821
|
const listStyle = ref({ top: "0px", left: "0px", width: "0px" });
|
|
4263
4822
|
const selected = computed(() => {
|
|
@@ -4587,6 +5146,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
4587
5146
|
});
|
|
4588
5147
|
watch(open, (isOpen) => {
|
|
4589
5148
|
if (isOpen) {
|
|
5149
|
+
panelSize.value = resolveSize(fieldRef.value, props.size);
|
|
4590
5150
|
document.addEventListener("pointerdown", onDocumentPointer);
|
|
4591
5151
|
window.addEventListener("resize", onViewportChange);
|
|
4592
5152
|
window.addEventListener("scroll", onViewportChange, true);
|
|
@@ -4611,7 +5171,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
4611
5171
|
return (_ctx, _cache) => {
|
|
4612
5172
|
return openBlock(), createElementBlock("div", {
|
|
4613
5173
|
class: normalizeClass(["tao-combobox", [
|
|
4614
|
-
|
|
5174
|
+
unref(sizeClass)(__props.size),
|
|
4615
5175
|
{
|
|
4616
5176
|
"tao-combobox--open": open.value,
|
|
4617
5177
|
"tao-combobox--invalid": invalid.value,
|
|
@@ -4641,7 +5201,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
4641
5201
|
"aria-invalid": invalid.value || void 0,
|
|
4642
5202
|
"aria-describedby": describedBy.value,
|
|
4643
5203
|
disabled: __props.disabled,
|
|
4644
|
-
placeholder:
|
|
5204
|
+
placeholder: unref(l10n).placeholder,
|
|
4645
5205
|
value: query.value,
|
|
4646
5206
|
onInput: _cache[0] || (_cache[0] = ($event) => {
|
|
4647
5207
|
query.value = $event.target.value;
|
|
@@ -4663,7 +5223,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
4663
5223
|
key: 0,
|
|
4664
5224
|
ref_key: "panelRef",
|
|
4665
5225
|
ref: panelRef,
|
|
4666
|
-
class: normalizeClass(["tao-combobox__panel",
|
|
5226
|
+
class: normalizeClass(["tao-combobox__panel", unref(sizeClass)(panelSize.value)]),
|
|
4667
5227
|
style: normalizeStyle(listStyle.value)
|
|
4668
5228
|
}, [
|
|
4669
5229
|
createElementVNode("ul", {
|
|
@@ -4675,7 +5235,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
4675
5235
|
}, [
|
|
4676
5236
|
!rows.value.length ? (openBlock(), createElementBlock("li", _hoisted_2$l, [
|
|
4677
5237
|
renderSlot(_ctx.$slots, "empty", {}, () => [
|
|
4678
|
-
createTextVNode(toDisplayString(
|
|
5238
|
+
createTextVNode(toDisplayString(unref(l10n).emptyText), 1)
|
|
4679
5239
|
], true)
|
|
4680
5240
|
])) : createCommentVNode("", true),
|
|
4681
5241
|
(openBlock(true), createElementBlock(Fragment, null, renderList(rows.value, (row, index) => {
|
|
@@ -4699,7 +5259,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
4699
5259
|
row.kind === "create" ? renderSlot(_ctx.$slots, "create", {
|
|
4700
5260
|
text: row.text
|
|
4701
5261
|
}, () => [
|
|
4702
|
-
createTextVNode(
|
|
5262
|
+
createTextVNode(toDisplayString(unref(formatText)(unref(taoLocale)().combobox.createText, { text: row.text })), 1)
|
|
4703
5263
|
], true, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
4704
5264
|
createTextVNode(toDisplayString(row.option.label), 1)
|
|
4705
5265
|
], 64))
|
|
@@ -4714,7 +5274,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
4714
5274
|
onClick: clear
|
|
4715
5275
|
}, [
|
|
4716
5276
|
renderSlot(_ctx.$slots, "clear", {}, () => [
|
|
4717
|
-
createTextVNode(toDisplayString(
|
|
5277
|
+
createTextVNode(toDisplayString(unref(l10n).clearText), 1)
|
|
4718
5278
|
], true)
|
|
4719
5279
|
], 32)) : createCommentVNode("", true)
|
|
4720
5280
|
], 6)) : createCommentVNode("", true)
|
|
@@ -4723,7 +5283,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
4723
5283
|
};
|
|
4724
5284
|
}
|
|
4725
5285
|
});
|
|
4726
|
-
const TaoCombobox = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-
|
|
5286
|
+
const TaoCombobox = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-e75a5550"]]);
|
|
4727
5287
|
const ISO_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
4728
5288
|
function formatTaoDateIso(parts) {
|
|
4729
5289
|
return `${String(parts.y).padStart(4, "0")}-${String(parts.m).padStart(2, "0")}-${String(parts.d).padStart(2, "0")}`;
|
|
@@ -4895,20 +5455,23 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
4895
5455
|
__name: "TaoDate",
|
|
4896
5456
|
props: {
|
|
4897
5457
|
modelValue: { default: null },
|
|
4898
|
-
placeholder: {
|
|
5458
|
+
placeholder: {},
|
|
4899
5459
|
disabled: { type: Boolean, default: false },
|
|
5460
|
+
size: {},
|
|
4900
5461
|
error: { type: Boolean, default: false },
|
|
4901
5462
|
min: { default: void 0 },
|
|
4902
5463
|
max: { default: void 0 },
|
|
4903
|
-
locale: {
|
|
4904
|
-
todayText: {
|
|
4905
|
-
clearText: {
|
|
4906
|
-
prevMonthLabel: {
|
|
4907
|
-
nextMonthLabel: {
|
|
5464
|
+
locale: {},
|
|
5465
|
+
todayText: {},
|
|
5466
|
+
clearText: {},
|
|
5467
|
+
prevMonthLabel: {},
|
|
5468
|
+
nextMonthLabel: {}
|
|
4908
5469
|
},
|
|
4909
5470
|
emits: ["update:modelValue", "change"],
|
|
4910
5471
|
setup(__props, { emit: __emit }) {
|
|
4911
5472
|
const props = __props;
|
|
5473
|
+
const l10n = useLocaleText(props, "date");
|
|
5474
|
+
const dateLocale = computed(() => props.locale ?? taoLocale().code);
|
|
4912
5475
|
const emit = __emit;
|
|
4913
5476
|
const field = inject(formFieldKey, null);
|
|
4914
5477
|
const localId = useId();
|
|
@@ -4927,9 +5490,9 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
4927
5490
|
const parsed = parseTaoDate(props.modelValue);
|
|
4928
5491
|
return parsed ? formatTaoDateIso(parsed) : null;
|
|
4929
5492
|
});
|
|
4930
|
-
const displayLabel = computed(() => valueIso.value ? formatTaoDateLabel(valueIso.value,
|
|
4931
|
-
const weekdays = computed(() => taoWeekdayLabels(
|
|
4932
|
-
const monthLabel = computed(() => formatTaoMonthLabel(viewYear.value, viewMonth.value,
|
|
5493
|
+
const displayLabel = computed(() => valueIso.value ? formatTaoDateLabel(valueIso.value, dateLocale.value) : "");
|
|
5494
|
+
const weekdays = computed(() => taoWeekdayLabels(dateLocale.value));
|
|
5495
|
+
const monthLabel = computed(() => formatTaoMonthLabel(viewYear.value, viewMonth.value, dateLocale.value));
|
|
4933
5496
|
const cells = computed(() => buildTaoDateGrid(viewYear.value, viewMonth.value));
|
|
4934
5497
|
const todayIso = computed(() => todayTaoDate());
|
|
4935
5498
|
const todayEnabled = computed(() => isTaoDateInRange(todayIso.value, props.min, props.max));
|
|
@@ -5101,7 +5664,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
5101
5664
|
});
|
|
5102
5665
|
return (_ctx, _cache) => {
|
|
5103
5666
|
return openBlock(), createElementBlock("div", {
|
|
5104
|
-
class: normalizeClass(["tao-date", { "tao-date--open": open.value, "tao-date--invalid": invalid.value }])
|
|
5667
|
+
class: normalizeClass(["tao-date", [unref(sizeClass)(__props.size), { "tao-date--open": open.value, "tao-date--invalid": invalid.value }]])
|
|
5105
5668
|
}, [
|
|
5106
5669
|
createElementVNode("button", {
|
|
5107
5670
|
id: controlId.value,
|
|
@@ -5119,7 +5682,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
5119
5682
|
onClick: toggle,
|
|
5120
5683
|
onKeydown: onTriggerKeydown
|
|
5121
5684
|
}, [
|
|
5122
|
-
createElementVNode("span", _hoisted_2$k, toDisplayString(displayLabel.value ||
|
|
5685
|
+
createElementVNode("span", _hoisted_2$k, toDisplayString(displayLabel.value || unref(l10n).placeholder), 1),
|
|
5123
5686
|
createElementVNode("span", _hoisted_3$g, [
|
|
5124
5687
|
renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
5125
5688
|
_cache[4] || (_cache[4] = createElementVNode("svg", {
|
|
@@ -5166,7 +5729,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
5166
5729
|
createElementVNode("button", {
|
|
5167
5730
|
type: "button",
|
|
5168
5731
|
class: "tao-date__nav",
|
|
5169
|
-
"aria-label":
|
|
5732
|
+
"aria-label": unref(l10n).prevMonthLabel,
|
|
5170
5733
|
onClick: _cache[0] || (_cache[0] = ($event) => goMonth(-1))
|
|
5171
5734
|
}, [
|
|
5172
5735
|
createElementVNode("span", _hoisted_7$9, [
|
|
@@ -5193,7 +5756,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
5193
5756
|
createElementVNode("button", {
|
|
5194
5757
|
type: "button",
|
|
5195
5758
|
class: "tao-date__nav",
|
|
5196
|
-
"aria-label":
|
|
5759
|
+
"aria-label": unref(l10n).nextMonthLabel,
|
|
5197
5760
|
onClick: _cache[1] || (_cache[1] = ($event) => goMonth(1))
|
|
5198
5761
|
}, [
|
|
5199
5762
|
createElementVNode("span", _hoisted_10$3, [
|
|
@@ -5235,7 +5798,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
5235
5798
|
"tao-date__day--disabled": !unref(isTaoDateInRange)(cell.iso, __props.min, __props.max)
|
|
5236
5799
|
}]),
|
|
5237
5800
|
role: "gridcell",
|
|
5238
|
-
"aria-label": unref(formatTaoDateLabel)(cell.iso,
|
|
5801
|
+
"aria-label": unref(formatTaoDateLabel)(cell.iso, dateLocale.value),
|
|
5239
5802
|
"aria-selected": cell.iso === valueIso.value,
|
|
5240
5803
|
disabled: !unref(isTaoDateInRange)(cell.iso, __props.min, __props.max),
|
|
5241
5804
|
onMousedown: _cache[2] || (_cache[2] = withModifiers(() => {
|
|
@@ -5252,7 +5815,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
5252
5815
|
onClick: _cache[3] || (_cache[3] = ($event) => selectDay(todayIso.value))
|
|
5253
5816
|
}, [
|
|
5254
5817
|
renderSlot(_ctx.$slots, "today", {}, () => [
|
|
5255
|
-
createTextVNode(toDisplayString(
|
|
5818
|
+
createTextVNode(toDisplayString(unref(l10n).todayText), 1)
|
|
5256
5819
|
], true)
|
|
5257
5820
|
], 8, _hoisted_15),
|
|
5258
5821
|
valueIso.value ? (openBlock(), createElementBlock("button", {
|
|
@@ -5262,7 +5825,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
5262
5825
|
onClick: clear
|
|
5263
5826
|
}, [
|
|
5264
5827
|
renderSlot(_ctx.$slots, "clear", {}, () => [
|
|
5265
|
-
createTextVNode(toDisplayString(
|
|
5828
|
+
createTextVNode(toDisplayString(unref(l10n).clearText), 1)
|
|
5266
5829
|
], true)
|
|
5267
5830
|
])) : createCommentVNode("", true)
|
|
5268
5831
|
])
|
|
@@ -5272,7 +5835,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
5272
5835
|
};
|
|
5273
5836
|
}
|
|
5274
5837
|
});
|
|
5275
|
-
const TaoDate = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-
|
|
5838
|
+
const TaoDate = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-97f71e11"]]);
|
|
5276
5839
|
const _hoisted_1$l = ["id", "aria-expanded", "aria-invalid", "aria-describedby", "disabled"];
|
|
5277
5840
|
const _hoisted_2$j = { class: "tao-date-range__value" };
|
|
5278
5841
|
const _hoisted_3$f = {
|
|
@@ -5298,20 +5861,23 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5298
5861
|
__name: "TaoDateRange",
|
|
5299
5862
|
props: {
|
|
5300
5863
|
modelValue: { default: null },
|
|
5301
|
-
placeholder: {
|
|
5864
|
+
placeholder: {},
|
|
5302
5865
|
disabled: { type: Boolean, default: false },
|
|
5866
|
+
size: {},
|
|
5303
5867
|
error: { type: Boolean, default: false },
|
|
5304
5868
|
min: { default: void 0 },
|
|
5305
5869
|
max: { default: void 0 },
|
|
5306
|
-
locale: {
|
|
5307
|
-
todayText: {
|
|
5308
|
-
clearText: {
|
|
5309
|
-
prevMonthLabel: {
|
|
5310
|
-
nextMonthLabel: {
|
|
5870
|
+
locale: {},
|
|
5871
|
+
todayText: {},
|
|
5872
|
+
clearText: {},
|
|
5873
|
+
prevMonthLabel: {},
|
|
5874
|
+
nextMonthLabel: {}
|
|
5311
5875
|
},
|
|
5312
5876
|
emits: ["update:modelValue", "change"],
|
|
5313
5877
|
setup(__props, { emit: __emit }) {
|
|
5314
5878
|
const props = __props;
|
|
5879
|
+
const l10n = useLocaleText(props, "dateRange");
|
|
5880
|
+
const dateLocale = computed(() => props.locale ?? taoLocale().code);
|
|
5315
5881
|
const emit = __emit;
|
|
5316
5882
|
const field = inject(formFieldKey, null);
|
|
5317
5883
|
const localId = useId();
|
|
@@ -5336,10 +5902,10 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5336
5902
|
return committed.value;
|
|
5337
5903
|
});
|
|
5338
5904
|
const displayLabel = computed(
|
|
5339
|
-
() => committed.value ? formatTaoDateRangeLabel(committed.value.start, committed.value.end,
|
|
5905
|
+
() => committed.value ? formatTaoDateRangeLabel(committed.value.start, committed.value.end, dateLocale.value) : ""
|
|
5340
5906
|
);
|
|
5341
|
-
const weekdays = computed(() => taoWeekdayLabels(
|
|
5342
|
-
const monthLabel = computed(() => formatTaoMonthLabel(viewYear.value, viewMonth.value,
|
|
5907
|
+
const weekdays = computed(() => taoWeekdayLabels(dateLocale.value));
|
|
5908
|
+
const monthLabel = computed(() => formatTaoMonthLabel(viewYear.value, viewMonth.value, dateLocale.value));
|
|
5343
5909
|
const cells = computed(() => buildTaoDateGrid(viewYear.value, viewMonth.value));
|
|
5344
5910
|
const todayIso = computed(() => todayTaoDate());
|
|
5345
5911
|
const todayEnabled = computed(() => isTaoDateInRange(todayIso.value, props.min, props.max));
|
|
@@ -5558,7 +6124,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5558
6124
|
});
|
|
5559
6125
|
return (_ctx, _cache) => {
|
|
5560
6126
|
return openBlock(), createElementBlock("div", {
|
|
5561
|
-
class: normalizeClass(["tao-date-range", { "tao-date-range--open": open.value, "tao-date-range--invalid": invalid.value }])
|
|
6127
|
+
class: normalizeClass(["tao-date-range", [unref(sizeClass)(__props.size), { "tao-date-range--open": open.value, "tao-date-range--invalid": invalid.value }]])
|
|
5562
6128
|
}, [
|
|
5563
6129
|
createElementVNode("button", {
|
|
5564
6130
|
id: controlId.value,
|
|
@@ -5576,7 +6142,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5576
6142
|
onClick: toggle,
|
|
5577
6143
|
onKeydown: onTriggerKeydown
|
|
5578
6144
|
}, [
|
|
5579
|
-
createElementVNode("span", _hoisted_2$j, toDisplayString(displayLabel.value ||
|
|
6145
|
+
createElementVNode("span", _hoisted_2$j, toDisplayString(displayLabel.value || unref(l10n).placeholder), 1),
|
|
5580
6146
|
createElementVNode("span", _hoisted_3$f, [
|
|
5581
6147
|
renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
5582
6148
|
_cache[3] || (_cache[3] = createElementVNode("svg", {
|
|
@@ -5623,7 +6189,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5623
6189
|
createElementVNode("button", {
|
|
5624
6190
|
type: "button",
|
|
5625
6191
|
class: "tao-date__nav",
|
|
5626
|
-
"aria-label":
|
|
6192
|
+
"aria-label": unref(l10n).prevMonthLabel,
|
|
5627
6193
|
onClick: _cache[0] || (_cache[0] = ($event) => goMonth(-1))
|
|
5628
6194
|
}, [
|
|
5629
6195
|
createElementVNode("span", _hoisted_7$8, [
|
|
@@ -5650,7 +6216,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5650
6216
|
createElementVNode("button", {
|
|
5651
6217
|
type: "button",
|
|
5652
6218
|
class: "tao-date__nav",
|
|
5653
|
-
"aria-label":
|
|
6219
|
+
"aria-label": unref(l10n).nextMonthLabel,
|
|
5654
6220
|
onClick: _cache[1] || (_cache[1] = ($event) => goMonth(1))
|
|
5655
6221
|
}, [
|
|
5656
6222
|
createElementVNode("span", _hoisted_10$2, [
|
|
@@ -5700,7 +6266,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5700
6266
|
"tao-date__day--disabled": !unref(isTaoDateInRange)(cell.iso, __props.min, __props.max)
|
|
5701
6267
|
}]),
|
|
5702
6268
|
role: "gridcell",
|
|
5703
|
-
"aria-label": unref(formatTaoDateLabel)(cell.iso,
|
|
6269
|
+
"aria-label": unref(formatTaoDateLabel)(cell.iso, dateLocale.value),
|
|
5704
6270
|
"aria-selected": daySelected(cell.iso),
|
|
5705
6271
|
disabled: !unref(isTaoDateInRange)(cell.iso, __props.min, __props.max),
|
|
5706
6272
|
onMousedown: _cache[2] || (_cache[2] = withModifiers(() => {
|
|
@@ -5718,7 +6284,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5718
6284
|
onClick: selectToday
|
|
5719
6285
|
}, [
|
|
5720
6286
|
renderSlot(_ctx.$slots, "today", {}, () => [
|
|
5721
|
-
createTextVNode(toDisplayString(
|
|
6287
|
+
createTextVNode(toDisplayString(unref(l10n).todayText), 1)
|
|
5722
6288
|
], true)
|
|
5723
6289
|
], 8, _hoisted_14),
|
|
5724
6290
|
committed.value ? (openBlock(), createElementBlock("button", {
|
|
@@ -5728,7 +6294,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5728
6294
|
onClick: clear
|
|
5729
6295
|
}, [
|
|
5730
6296
|
renderSlot(_ctx.$slots, "clear", {}, () => [
|
|
5731
|
-
createTextVNode(toDisplayString(
|
|
6297
|
+
createTextVNode(toDisplayString(unref(l10n).clearText), 1)
|
|
5732
6298
|
], true)
|
|
5733
6299
|
])) : createCommentVNode("", true)
|
|
5734
6300
|
])
|
|
@@ -5738,7 +6304,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5738
6304
|
};
|
|
5739
6305
|
}
|
|
5740
6306
|
});
|
|
5741
|
-
const TaoDateRange = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-
|
|
6307
|
+
const TaoDateRange = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-da3794c7"]]);
|
|
5742
6308
|
const _hoisted_1$k = ["for"];
|
|
5743
6309
|
const _hoisted_2$i = ["id", "checked", "disabled", "aria-checked", "aria-invalid", "aria-describedby"];
|
|
5744
6310
|
const _hoisted_3$e = {
|
|
@@ -5755,7 +6321,9 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
5755
6321
|
props: {
|
|
5756
6322
|
modelValue: { type: Boolean, default: false },
|
|
5757
6323
|
label: { default: "" },
|
|
5758
|
-
disabled: { type: Boolean, default: false }
|
|
6324
|
+
disabled: { type: Boolean, default: false },
|
|
6325
|
+
error: { type: Boolean, default: false },
|
|
6326
|
+
size: {}
|
|
5759
6327
|
},
|
|
5760
6328
|
emits: ["update:modelValue", "change"],
|
|
5761
6329
|
setup(__props, { emit: __emit }) {
|
|
@@ -5764,7 +6332,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
5764
6332
|
const field = inject(formFieldKey, null);
|
|
5765
6333
|
const localId = useId();
|
|
5766
6334
|
const controlId = computed(() => (field == null ? void 0 : field.id) ?? localId);
|
|
5767
|
-
const invalid = computed(() => Boolean(field == null ? void 0 : field.invalid.value));
|
|
6335
|
+
const invalid = computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
5768
6336
|
const describedBy = computed(() => field == null ? void 0 : field.describedBy.value);
|
|
5769
6337
|
function toggle() {
|
|
5770
6338
|
if (props.disabled) {
|
|
@@ -5776,7 +6344,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
5776
6344
|
}
|
|
5777
6345
|
return (_ctx, _cache) => {
|
|
5778
6346
|
return openBlock(), createElementBlock("label", {
|
|
5779
|
-
class: normalizeClass(["tao-switch", { "tao-switch--disabled": __props.disabled, "tao-switch--on": __props.modelValue, "tao-switch--invalid": invalid.value }]),
|
|
6347
|
+
class: normalizeClass(["tao-switch", [unref(sizeClass)(__props.size), { "tao-switch--disabled": __props.disabled, "tao-switch--on": __props.modelValue, "tao-switch--invalid": invalid.value }]]),
|
|
5780
6348
|
for: controlId.value
|
|
5781
6349
|
}, [
|
|
5782
6350
|
createElementVNode("input", {
|
|
@@ -5804,7 +6372,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
5804
6372
|
};
|
|
5805
6373
|
}
|
|
5806
6374
|
});
|
|
5807
|
-
const TaoSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-
|
|
6375
|
+
const TaoSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-28965b34"]]);
|
|
5808
6376
|
const radioGroupKey = Symbol("taoRadioGroup");
|
|
5809
6377
|
const _hoisted_1$j = ["for"];
|
|
5810
6378
|
const _hoisted_2$h = ["id", "name", "value", "checked", "disabled", "aria-invalid", "aria-describedby"];
|
|
@@ -5824,7 +6392,9 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
5824
6392
|
modelValue: { type: [String, Number, Boolean] },
|
|
5825
6393
|
name: {},
|
|
5826
6394
|
label: { default: "" },
|
|
5827
|
-
disabled: { type: Boolean, default: false }
|
|
6395
|
+
disabled: { type: Boolean, default: false },
|
|
6396
|
+
error: { type: Boolean, default: false },
|
|
6397
|
+
size: {}
|
|
5828
6398
|
},
|
|
5829
6399
|
emits: ["update:modelValue", "change"],
|
|
5830
6400
|
setup(__props, { emit: __emit }) {
|
|
@@ -5834,13 +6404,13 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
5834
6404
|
const field = inject(formFieldKey, null);
|
|
5835
6405
|
const localId = useId();
|
|
5836
6406
|
const controlId = computed(() => group ? localId : (field == null ? void 0 : field.id) ?? localId);
|
|
5837
|
-
const invalid = computed(() => Boolean(field == null ? void 0 : field.invalid.value));
|
|
6407
|
+
const invalid = computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
5838
6408
|
const describedBy = computed(() => group ? void 0 : field == null ? void 0 : field.describedBy.value);
|
|
5839
6409
|
const isDisabled = computed(() => props.disabled || Boolean(group == null ? void 0 : group.disabled.value));
|
|
5840
6410
|
const inputName = computed(() => (group == null ? void 0 : group.name.value) ?? props.name);
|
|
5841
6411
|
const isChecked = computed(() => {
|
|
5842
|
-
const
|
|
5843
|
-
return
|
|
6412
|
+
const current2 = group ? group.model.value : props.modelValue;
|
|
6413
|
+
return current2 === props.value;
|
|
5844
6414
|
});
|
|
5845
6415
|
function onChange() {
|
|
5846
6416
|
if (isDisabled.value) {
|
|
@@ -5855,7 +6425,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
5855
6425
|
}
|
|
5856
6426
|
return (_ctx, _cache) => {
|
|
5857
6427
|
return openBlock(), createElementBlock("label", {
|
|
5858
|
-
class: normalizeClass(["tao-radio", { "tao-radio--disabled": isDisabled.value, "tao-radio--invalid": invalid.value && !unref(group) }]),
|
|
6428
|
+
class: normalizeClass(["tao-radio", [unref(sizeClass)(__props.size), { "tao-radio--disabled": isDisabled.value, "tao-radio--invalid": invalid.value && !unref(group) }]]),
|
|
5859
6429
|
for: controlId.value
|
|
5860
6430
|
}, [
|
|
5861
6431
|
createElementVNode("input", {
|
|
@@ -5881,7 +6451,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
5881
6451
|
};
|
|
5882
6452
|
}
|
|
5883
6453
|
});
|
|
5884
|
-
const TaoRadio = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-
|
|
6454
|
+
const TaoRadio = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-70ac1c11"]]);
|
|
5885
6455
|
const _hoisted_1$i = ["id", "disabled", "aria-describedby", "aria-invalid", "aria-labelledby"];
|
|
5886
6456
|
const _hoisted_2$g = {
|
|
5887
6457
|
key: 0,
|
|
@@ -5895,7 +6465,9 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
5895
6465
|
name: {},
|
|
5896
6466
|
legend: {},
|
|
5897
6467
|
disabled: { type: Boolean, default: false },
|
|
5898
|
-
|
|
6468
|
+
error: { type: Boolean, default: false },
|
|
6469
|
+
direction: { default: "row" },
|
|
6470
|
+
size: {}
|
|
5899
6471
|
},
|
|
5900
6472
|
emits: ["update:modelValue", "change"],
|
|
5901
6473
|
setup(__props, { emit: __emit }) {
|
|
@@ -5906,7 +6478,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
5906
6478
|
const groupName = computed(() => props.name || autoName);
|
|
5907
6479
|
const model = computed(() => props.modelValue);
|
|
5908
6480
|
const groupDisabled = computed(() => props.disabled);
|
|
5909
|
-
const invalid = computed(() => Boolean(field == null ? void 0 : field.invalid.value));
|
|
6481
|
+
const invalid = computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
5910
6482
|
const describedBy = computed(() => field == null ? void 0 : field.describedBy.value);
|
|
5911
6483
|
const labelledBy = computed(() => props.legend || !field ? void 0 : `${field.id}-label`);
|
|
5912
6484
|
function setValue(value) {
|
|
@@ -5923,7 +6495,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
5923
6495
|
var _a;
|
|
5924
6496
|
return openBlock(), createElementBlock("fieldset", {
|
|
5925
6497
|
id: (_a = unref(field)) == null ? void 0 : _a.id,
|
|
5926
|
-
class: normalizeClass(["tao-radio-group", [`tao-radio-group--${__props.direction}`, { "tao-radio-group--invalid": invalid.value }]]),
|
|
6498
|
+
class: normalizeClass(["tao-radio-group", [`tao-radio-group--${__props.direction}`, unref(sizeClass)(__props.size), { "tao-radio-group--invalid": invalid.value }]]),
|
|
5927
6499
|
disabled: __props.disabled,
|
|
5928
6500
|
"aria-describedby": describedBy.value,
|
|
5929
6501
|
"aria-invalid": invalid.value || void 0,
|
|
@@ -5935,7 +6507,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
5935
6507
|
};
|
|
5936
6508
|
}
|
|
5937
6509
|
});
|
|
5938
|
-
const TaoRadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-
|
|
6510
|
+
const TaoRadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-c76ef504"]]);
|
|
5939
6511
|
const segmentedKey = Symbol("taoSegmented");
|
|
5940
6512
|
const _hoisted_1$h = ["disabled", "aria-describedby", "aria-invalid", "aria-labelledby", "id"];
|
|
5941
6513
|
const _hoisted_2$f = {
|
|
@@ -5950,7 +6522,8 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
5950
6522
|
name: {},
|
|
5951
6523
|
legend: {},
|
|
5952
6524
|
disabled: { type: Boolean, default: false },
|
|
5953
|
-
|
|
6525
|
+
error: { type: Boolean, default: false },
|
|
6526
|
+
size: {},
|
|
5954
6527
|
block: { type: Boolean, default: false }
|
|
5955
6528
|
},
|
|
5956
6529
|
emits: ["update:modelValue", "change"],
|
|
@@ -5962,8 +6535,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
5962
6535
|
const groupName = computed(() => props.name || autoName);
|
|
5963
6536
|
const model = computed(() => props.modelValue);
|
|
5964
6537
|
const groupDisabled = computed(() => props.disabled);
|
|
5965
|
-
const
|
|
5966
|
-
const invalid = computed(() => Boolean(field == null ? void 0 : field.invalid.value));
|
|
6538
|
+
const invalid = computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
5967
6539
|
const describedBy = computed(() => field == null ? void 0 : field.describedBy.value);
|
|
5968
6540
|
const trackRef = ref(null);
|
|
5969
6541
|
const thumbStyle = ref({ opacity: "0" });
|
|
@@ -6003,7 +6575,6 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
6003
6575
|
name: groupName,
|
|
6004
6576
|
model,
|
|
6005
6577
|
disabled: groupDisabled,
|
|
6006
|
-
size: groupSize,
|
|
6007
6578
|
setValue
|
|
6008
6579
|
});
|
|
6009
6580
|
onMounted(() => {
|
|
@@ -6040,7 +6611,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
6040
6611
|
var _a;
|
|
6041
6612
|
return openBlock(), createElementBlock("fieldset", {
|
|
6042
6613
|
class: normalizeClass(["tao-segmented", [
|
|
6043
|
-
|
|
6614
|
+
unref(sizeClass)(__props.size),
|
|
6044
6615
|
{
|
|
6045
6616
|
"tao-segmented--block": __props.block,
|
|
6046
6617
|
"tao-segmented--disabled": __props.disabled,
|
|
@@ -6070,7 +6641,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
6070
6641
|
};
|
|
6071
6642
|
}
|
|
6072
6643
|
});
|
|
6073
|
-
const TaoSegmented = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-
|
|
6644
|
+
const TaoSegmented = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-7dc6820f"]]);
|
|
6074
6645
|
const _hoisted_1$g = ["for"];
|
|
6075
6646
|
const _hoisted_2$e = ["id", "name", "value", "checked", "disabled", "aria-label"];
|
|
6076
6647
|
const _hoisted_3$c = { class: "tao-segmented-option__face" };
|
|
@@ -6113,10 +6684,9 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
6113
6684
|
const localId = useId();
|
|
6114
6685
|
const isDisabled = computed(() => props.disabled || Boolean(group == null ? void 0 : group.disabled.value));
|
|
6115
6686
|
const inputName = computed(() => (group == null ? void 0 : group.name.value) ?? props.name);
|
|
6116
|
-
const size = computed(() => (group == null ? void 0 : group.size.value) ?? "medium");
|
|
6117
6687
|
const isChecked = computed(() => {
|
|
6118
|
-
const
|
|
6119
|
-
return
|
|
6688
|
+
const current2 = group ? group.model.value : props.modelValue;
|
|
6689
|
+
return current2 === props.value;
|
|
6120
6690
|
});
|
|
6121
6691
|
const hasLabel = computed(() => Boolean(props.label || slots.default));
|
|
6122
6692
|
const isIconOnly = computed(() => Boolean((props.icon || slots.icon) && !hasLabel.value));
|
|
@@ -6145,14 +6715,11 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
6145
6715
|
}
|
|
6146
6716
|
return (_ctx, _cache) => {
|
|
6147
6717
|
return openBlock(), createElementBlock("label", {
|
|
6148
|
-
class: normalizeClass(["tao-segmented-option",
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
"tao-segmented-option--icon-only": isIconOnly.value
|
|
6154
|
-
}
|
|
6155
|
-
]]),
|
|
6718
|
+
class: normalizeClass(["tao-segmented-option", {
|
|
6719
|
+
"tao-segmented-option--checked": isChecked.value,
|
|
6720
|
+
"tao-segmented-option--disabled": props.disabled,
|
|
6721
|
+
"tao-segmented-option--icon-only": isIconOnly.value
|
|
6722
|
+
}]),
|
|
6156
6723
|
for: unref(localId)
|
|
6157
6724
|
}, [
|
|
6158
6725
|
createElementVNode("input", {
|
|
@@ -6183,7 +6750,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
6183
6750
|
};
|
|
6184
6751
|
}
|
|
6185
6752
|
});
|
|
6186
|
-
const TaoSegmentedOption = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-
|
|
6753
|
+
const TaoSegmentedOption = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-fba7ca12"]]);
|
|
6187
6754
|
const _hoisted_1$f = ["role", "aria-live"];
|
|
6188
6755
|
const _hoisted_2$d = { class: "tao-alert__body" };
|
|
6189
6756
|
const _hoisted_3$b = {
|
|
@@ -6200,21 +6767,31 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
6200
6767
|
...{ name: "TaoAlert" },
|
|
6201
6768
|
__name: "TaoAlert",
|
|
6202
6769
|
props: {
|
|
6203
|
-
|
|
6770
|
+
tone: { default: void 0 },
|
|
6771
|
+
type: { default: void 0 },
|
|
6204
6772
|
title: { default: "" },
|
|
6205
6773
|
closable: { type: Boolean, default: false },
|
|
6206
|
-
closeLabel: {
|
|
6774
|
+
closeLabel: {}
|
|
6207
6775
|
},
|
|
6208
6776
|
emits: ["close"],
|
|
6209
6777
|
setup(__props, { emit: __emit }) {
|
|
6210
6778
|
const props = __props;
|
|
6779
|
+
const l10n = useLocaleText(props, "alert");
|
|
6211
6780
|
const emit = __emit;
|
|
6212
|
-
const
|
|
6213
|
-
|
|
6781
|
+
const resolvedTone = computed(() => {
|
|
6782
|
+
const value = props.tone ?? props.type ?? "info";
|
|
6783
|
+
return value === "danger" ? "error" : value;
|
|
6784
|
+
});
|
|
6785
|
+
const live = computed(
|
|
6786
|
+
() => resolvedTone.value === "error" || resolvedTone.value === "warning" ? "assertive" : "polite"
|
|
6787
|
+
);
|
|
6788
|
+
warnDeprecated("TaoAlert", {
|
|
6789
|
+
type: "use `tone`"
|
|
6790
|
+
});
|
|
6214
6791
|
return (_ctx, _cache) => {
|
|
6215
6792
|
return openBlock(), createElementBlock("div", {
|
|
6216
|
-
class: normalizeClass(["tao-alert", `tao-alert--${
|
|
6217
|
-
role:
|
|
6793
|
+
class: normalizeClass(["tao-alert", `tao-alert--${resolvedTone.value}`]),
|
|
6794
|
+
role: resolvedTone.value === "error" ? "alert" : "status",
|
|
6218
6795
|
"aria-live": live.value
|
|
6219
6796
|
}, [
|
|
6220
6797
|
createElementVNode("div", _hoisted_2$d, [
|
|
@@ -6227,7 +6804,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
6227
6804
|
key: 0,
|
|
6228
6805
|
type: "button",
|
|
6229
6806
|
class: "tao-alert__close",
|
|
6230
|
-
"aria-label":
|
|
6807
|
+
"aria-label": unref(l10n).closeLabel,
|
|
6231
6808
|
onClick: _cache[0] || (_cache[0] = ($event) => emit("close"))
|
|
6232
6809
|
}, [
|
|
6233
6810
|
createElementVNode("span", _hoisted_6$8, [
|
|
@@ -6240,7 +6817,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
6240
6817
|
};
|
|
6241
6818
|
}
|
|
6242
6819
|
});
|
|
6243
|
-
const TaoAlert = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-
|
|
6820
|
+
const TaoAlert = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-94376652"]]);
|
|
6244
6821
|
const _hoisted_1$e = { key: 0 };
|
|
6245
6822
|
const _hoisted_2$c = ["aria-sort"];
|
|
6246
6823
|
const _hoisted_3$a = ["onClick"];
|
|
@@ -6261,8 +6838,9 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
6261
6838
|
rows: { default: () => [] },
|
|
6262
6839
|
rowKey: { type: [String, Function], default: "id" },
|
|
6263
6840
|
loading: { type: Boolean, default: false },
|
|
6264
|
-
emptyText: {
|
|
6841
|
+
emptyText: {},
|
|
6265
6842
|
striped: { type: [Boolean, String], default: false },
|
|
6843
|
+
size: {},
|
|
6266
6844
|
compact: { type: Boolean, default: false },
|
|
6267
6845
|
hover: { type: Boolean, default: true },
|
|
6268
6846
|
head: { type: Boolean, default: true },
|
|
@@ -6273,9 +6851,10 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
6273
6851
|
sort: { default: null },
|
|
6274
6852
|
caption: { default: "" }
|
|
6275
6853
|
},
|
|
6276
|
-
emits: ["update:sort", "sort", "row-click"],
|
|
6854
|
+
emits: ["update:sort", "change", "sort", "row-click"],
|
|
6277
6855
|
setup(__props, { emit: __emit }) {
|
|
6278
6856
|
const props = __props;
|
|
6857
|
+
const l10n = useLocaleText(props, "table");
|
|
6279
6858
|
const emit = __emit;
|
|
6280
6859
|
const colCount = computed(() => Math.max(props.columns.length, 1));
|
|
6281
6860
|
const isEmpty = computed(() => !props.rows.length && !props.loading);
|
|
@@ -6317,9 +6896,10 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
6317
6896
|
if (!column.sortable) {
|
|
6318
6897
|
return;
|
|
6319
6898
|
}
|
|
6320
|
-
const
|
|
6321
|
-
const next =
|
|
6899
|
+
const current2 = sortDir(column);
|
|
6900
|
+
const next = current2 == null ? { key: column.key, dir: "asc" } : current2 === "asc" ? { key: column.key, dir: "desc" } : null;
|
|
6322
6901
|
emit("update:sort", next);
|
|
6902
|
+
emit("change", next);
|
|
6323
6903
|
emit("sort", next);
|
|
6324
6904
|
}
|
|
6325
6905
|
function onRowClick(row, index) {
|
|
@@ -6328,19 +6908,25 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
6328
6908
|
}
|
|
6329
6909
|
emit("row-click", row, index);
|
|
6330
6910
|
}
|
|
6911
|
+
warnDeprecated("TaoTable", {
|
|
6912
|
+
compact: 'use size="small"',
|
|
6913
|
+
onSort: 'listen to "change" (or v-model:sort)'
|
|
6914
|
+
});
|
|
6331
6915
|
return (_ctx, _cache) => {
|
|
6332
6916
|
return openBlock(), createElementBlock("div", {
|
|
6333
|
-
class: normalizeClass(["tao-table-wrap",
|
|
6334
|
-
"
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6917
|
+
class: normalizeClass(["tao-table-wrap", [
|
|
6918
|
+
unref(sizeClass)(__props.size ?? (__props.compact ? "small" : void 0)),
|
|
6919
|
+
{
|
|
6920
|
+
"tao-table-wrap--sticky": __props.sticky,
|
|
6921
|
+
"tao-table-wrap--loading": __props.loading
|
|
6922
|
+
}
|
|
6923
|
+
]]),
|
|
6924
|
+
style: normalizeStyle(__props.maxHeight ? { maxHeight: unref(toCssLength)(__props.maxHeight) } : void 0)
|
|
6338
6925
|
}, [
|
|
6339
6926
|
createElementVNode("table", {
|
|
6340
6927
|
class: normalizeClass(["tao-table", {
|
|
6341
6928
|
"tao-table--striped": stripeFrom.value === "odd",
|
|
6342
6929
|
"tao-table--striped-even": stripeFrom.value === "even",
|
|
6343
|
-
"tao-table--compact": __props.compact,
|
|
6344
6930
|
"tao-table--hover": __props.hover,
|
|
6345
6931
|
"tao-table--head": __props.head,
|
|
6346
6932
|
"tao-table--lines": __props.lines,
|
|
@@ -6384,7 +6970,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
6384
6970
|
colspan: colCount.value
|
|
6385
6971
|
}, [
|
|
6386
6972
|
renderSlot(_ctx.$slots, "empty", {}, () => [
|
|
6387
|
-
createTextVNode(toDisplayString(
|
|
6973
|
+
createTextVNode(toDisplayString(unref(l10n).emptyText), 1)
|
|
6388
6974
|
], true)
|
|
6389
6975
|
], 8, _hoisted_6$7)
|
|
6390
6976
|
])) : createCommentVNode("", true),
|
|
@@ -6428,7 +7014,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
6428
7014
|
};
|
|
6429
7015
|
}
|
|
6430
7016
|
});
|
|
6431
|
-
const TaoTable = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-
|
|
7017
|
+
const TaoTable = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-3b34cb39"]]);
|
|
6432
7018
|
function buildPaginationItems(page, pageCount, siblingCount = 1) {
|
|
6433
7019
|
if (pageCount <= 0) {
|
|
6434
7020
|
return [];
|
|
@@ -6436,10 +7022,10 @@ function buildPaginationItems(page, pageCount, siblingCount = 1) {
|
|
|
6436
7022
|
if (pageCount <= 7) {
|
|
6437
7023
|
return Array.from({ length: pageCount }, (_, index) => ({ type: "page", page: index + 1 }));
|
|
6438
7024
|
}
|
|
6439
|
-
const
|
|
7025
|
+
const current2 = Math.min(Math.max(page, 1), pageCount);
|
|
6440
7026
|
const siblings = Math.max(0, siblingCount);
|
|
6441
|
-
const left = Math.max(2,
|
|
6442
|
-
const right = Math.min(pageCount - 1,
|
|
7027
|
+
const left = Math.max(2, current2 - siblings);
|
|
7028
|
+
const right = Math.min(pageCount - 1, current2 + siblings);
|
|
6443
7029
|
const items = [{ type: "page", page: 1 }];
|
|
6444
7030
|
if (left > 2) {
|
|
6445
7031
|
items.push({ type: "ellipsis", id: "left" });
|
|
@@ -6480,24 +7066,25 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
6480
7066
|
siblingCount: { default: 1 },
|
|
6481
7067
|
disabled: { type: Boolean, default: false },
|
|
6482
7068
|
showTotal: { type: Boolean, default: true },
|
|
6483
|
-
size: {
|
|
7069
|
+
size: {},
|
|
6484
7070
|
jump: { default: 5 },
|
|
6485
|
-
ariaLabel: {
|
|
6486
|
-
prevLabel: {
|
|
6487
|
-
nextLabel: {
|
|
6488
|
-
pageLabel: {
|
|
6489
|
-
jumpPrevLabel: {
|
|
6490
|
-
jumpNextLabel: {
|
|
7071
|
+
ariaLabel: {},
|
|
7072
|
+
prevLabel: {},
|
|
7073
|
+
nextLabel: {},
|
|
7074
|
+
pageLabel: {},
|
|
7075
|
+
jumpPrevLabel: {},
|
|
7076
|
+
jumpNextLabel: {}
|
|
6491
7077
|
},
|
|
6492
7078
|
emits: ["update:page", "change"],
|
|
6493
7079
|
setup(__props, { emit: __emit }) {
|
|
6494
7080
|
const props = __props;
|
|
7081
|
+
const l10n = useLocaleText(props, "pagination");
|
|
6495
7082
|
const emit = __emit;
|
|
6496
7083
|
const pageCount = computed(() => Math.max(1, Math.ceil(Math.max(props.total, 0) / Math.max(props.pageSize, 1))));
|
|
6497
|
-
const
|
|
6498
|
-
const items = computed(() => buildPaginationItems(
|
|
6499
|
-
const from = computed(() => props.total === 0 ? 0 : (
|
|
6500
|
-
const to = computed(() => Math.min(
|
|
7084
|
+
const current2 = computed(() => Math.min(Math.max(props.page, 1), pageCount.value));
|
|
7085
|
+
const items = computed(() => buildPaginationItems(current2.value, pageCount.value, props.siblingCount));
|
|
7086
|
+
const from = computed(() => props.total === 0 ? 0 : (current2.value - 1) * props.pageSize + 1);
|
|
7087
|
+
const to = computed(() => Math.min(current2.value * props.pageSize, props.total));
|
|
6501
7088
|
watch(
|
|
6502
7089
|
() => [props.page, pageCount.value],
|
|
6503
7090
|
([page, count]) => {
|
|
@@ -6520,8 +7107,8 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
6520
7107
|
}
|
|
6521
7108
|
return (_ctx, _cache) => {
|
|
6522
7109
|
return openBlock(), createElementBlock("nav", {
|
|
6523
|
-
class: normalizeClass(["tao-pagination",
|
|
6524
|
-
"aria-label":
|
|
7110
|
+
class: normalizeClass(["tao-pagination", unref(sizeClass)(__props.size)]),
|
|
7111
|
+
"aria-label": unref(l10n).ariaLabel
|
|
6525
7112
|
}, [
|
|
6526
7113
|
__props.showTotal ? (openBlock(), createElementBlock("p", _hoisted_2$b, [
|
|
6527
7114
|
renderSlot(_ctx.$slots, "total", {
|
|
@@ -6530,9 +7117,9 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
6530
7117
|
total: __props.total
|
|
6531
7118
|
}, () => [
|
|
6532
7119
|
__props.total === 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
6533
|
-
createTextVNode(
|
|
7120
|
+
createTextVNode(toDisplayString(unref(taoLocale)().pagination.emptyTotalText), 1)
|
|
6534
7121
|
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
6535
|
-
createTextVNode(toDisplayString(
|
|
7122
|
+
createTextVNode(toDisplayString(unref(formatText)(unref(taoLocale)().pagination.totalText, { from: from.value, to: to.value, total: __props.total })), 1)
|
|
6536
7123
|
], 64))
|
|
6537
7124
|
], true)
|
|
6538
7125
|
])) : createCommentVNode("", true),
|
|
@@ -6540,9 +7127,9 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
6540
7127
|
createElementVNode("button", {
|
|
6541
7128
|
type: "button",
|
|
6542
7129
|
class: "tao-pagination__btn",
|
|
6543
|
-
"aria-label":
|
|
6544
|
-
disabled: __props.disabled ||
|
|
6545
|
-
onClick: _cache[0] || (_cache[0] = ($event) => goTo(
|
|
7130
|
+
"aria-label": unref(l10n).prevLabel,
|
|
7131
|
+
disabled: __props.disabled || current2.value <= 1,
|
|
7132
|
+
onClick: _cache[0] || (_cache[0] = ($event) => goTo(current2.value - 1))
|
|
6546
7133
|
}, [
|
|
6547
7134
|
createElementVNode("span", _hoisted_5$9, [
|
|
6548
7135
|
renderSlot(_ctx.$slots, "prev-icon", {}, () => [
|
|
@@ -6558,15 +7145,15 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
6558
7145
|
key: 0,
|
|
6559
7146
|
type: "button",
|
|
6560
7147
|
class: "tao-pagination__btn tao-pagination__btn--jump",
|
|
6561
|
-
"aria-label": item.id === "left" ?
|
|
7148
|
+
"aria-label": item.id === "left" ? unref(l10n).jumpPrevLabel.replace("{n}", String(__props.jump)) : unref(l10n).jumpNextLabel.replace("{n}", String(__props.jump)),
|
|
6562
7149
|
disabled: __props.disabled,
|
|
6563
|
-
onClick: ($event) => goTo(item.id === "left" ?
|
|
7150
|
+
onClick: ($event) => goTo(item.id === "left" ? current2.value - __props.jump : current2.value + __props.jump)
|
|
6564
7151
|
}, " … ", 8, _hoisted_6$6)) : item.type === "ellipsis" ? (openBlock(), createElementBlock("span", _hoisted_7$5, "…")) : (openBlock(), createElementBlock("button", {
|
|
6565
7152
|
key: 2,
|
|
6566
7153
|
type: "button",
|
|
6567
|
-
class: normalizeClass(["tao-pagination__btn", { "tao-pagination__btn--current": item.page ===
|
|
6568
|
-
"aria-current": item.page ===
|
|
6569
|
-
"aria-label":
|
|
7154
|
+
class: normalizeClass(["tao-pagination__btn", { "tao-pagination__btn--current": item.page === current2.value }]),
|
|
7155
|
+
"aria-current": item.page === current2.value ? "page" : void 0,
|
|
7156
|
+
"aria-label": unref(l10n).pageLabel.replace("{page}", String(item.page)),
|
|
6570
7157
|
disabled: __props.disabled,
|
|
6571
7158
|
onClick: ($event) => goTo(item.page)
|
|
6572
7159
|
}, toDisplayString(item.page), 11, _hoisted_8$5))
|
|
@@ -6575,9 +7162,9 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
6575
7162
|
createElementVNode("button", {
|
|
6576
7163
|
type: "button",
|
|
6577
7164
|
class: "tao-pagination__btn",
|
|
6578
|
-
"aria-label":
|
|
6579
|
-
disabled: __props.disabled ||
|
|
6580
|
-
onClick: _cache[1] || (_cache[1] = ($event) => goTo(
|
|
7165
|
+
"aria-label": unref(l10n).nextLabel,
|
|
7166
|
+
disabled: __props.disabled || current2.value >= pageCount.value,
|
|
7167
|
+
onClick: _cache[1] || (_cache[1] = ($event) => goTo(current2.value + 1))
|
|
6581
7168
|
}, [
|
|
6582
7169
|
createElementVNode("span", _hoisted_10$1, [
|
|
6583
7170
|
renderSlot(_ctx.$slots, "next-icon", {}, () => [
|
|
@@ -6590,7 +7177,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
6590
7177
|
};
|
|
6591
7178
|
}
|
|
6592
7179
|
});
|
|
6593
|
-
const TaoPagination = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-
|
|
7180
|
+
const TaoPagination = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-7e381e8c"]]);
|
|
6594
7181
|
const _hoisted_1$c = { class: "tao-empty" };
|
|
6595
7182
|
const _hoisted_2$a = {
|
|
6596
7183
|
key: 0,
|
|
@@ -6612,15 +7199,17 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
6612
7199
|
...{ name: "TaoEmpty" },
|
|
6613
7200
|
__name: "TaoEmpty",
|
|
6614
7201
|
props: {
|
|
6615
|
-
title: {
|
|
7202
|
+
title: {}
|
|
6616
7203
|
},
|
|
6617
7204
|
setup(__props) {
|
|
7205
|
+
const props = __props;
|
|
7206
|
+
const l10n = useLocaleText(props, "empty");
|
|
6618
7207
|
return (_ctx, _cache) => {
|
|
6619
7208
|
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
6620
7209
|
_ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_2$a, [
|
|
6621
7210
|
renderSlot(_ctx.$slots, "icon", {}, void 0, true)
|
|
6622
7211
|
])) : createCommentVNode("", true),
|
|
6623
|
-
|
|
7212
|
+
unref(l10n).title ? (openBlock(), createElementBlock("p", _hoisted_3$8, toDisplayString(unref(l10n).title), 1)) : createCommentVNode("", true),
|
|
6624
7213
|
_ctx.$slots.default ? (openBlock(), createElementBlock("p", _hoisted_4$8, [
|
|
6625
7214
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
6626
7215
|
])) : createCommentVNode("", true),
|
|
@@ -6631,8 +7220,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
6631
7220
|
};
|
|
6632
7221
|
}
|
|
6633
7222
|
});
|
|
6634
|
-
const TaoEmpty = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-
|
|
6635
|
-
const taoListKey = Symbol("taoList");
|
|
7223
|
+
const TaoEmpty = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-7d3efeaf"]]);
|
|
6636
7224
|
const _hoisted_1$b = ["aria-label"];
|
|
6637
7225
|
const _hoisted_2$9 = {
|
|
6638
7226
|
key: 0,
|
|
@@ -6642,7 +7230,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
6642
7230
|
...{ name: "TaoList" },
|
|
6643
7231
|
__name: "TaoList",
|
|
6644
7232
|
props: {
|
|
6645
|
-
size: {
|
|
7233
|
+
size: {},
|
|
6646
7234
|
bordered: { type: Boolean, default: true },
|
|
6647
7235
|
divided: { type: Boolean, default: true },
|
|
6648
7236
|
maxHeight: {},
|
|
@@ -6651,19 +7239,14 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
6651
7239
|
},
|
|
6652
7240
|
setup(__props) {
|
|
6653
7241
|
const props = __props;
|
|
6654
|
-
const size = computed(() => props.size);
|
|
6655
|
-
provide(taoListKey, { size });
|
|
6656
7242
|
const listStyle = computed(() => {
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
}
|
|
6660
|
-
const value = typeof props.maxHeight === "number" ? `${props.maxHeight}px` : props.maxHeight;
|
|
6661
|
-
return { maxHeight: value };
|
|
7243
|
+
const value = toCssLength(props.maxHeight);
|
|
7244
|
+
return value ? { maxHeight: value } : void 0;
|
|
6662
7245
|
});
|
|
6663
7246
|
return (_ctx, _cache) => {
|
|
6664
7247
|
return openBlock(), createElementBlock("ul", {
|
|
6665
7248
|
class: normalizeClass(["tao-list", [
|
|
6666
|
-
|
|
7249
|
+
unref(sizeClass)(__props.size),
|
|
6667
7250
|
{
|
|
6668
7251
|
"tao-list--bordered": __props.bordered,
|
|
6669
7252
|
"tao-list--divided": __props.divided,
|
|
@@ -6677,14 +7260,14 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
6677
7260
|
}, [
|
|
6678
7261
|
__props.empty ? (openBlock(), createElementBlock("li", _hoisted_2$9, [
|
|
6679
7262
|
renderSlot(_ctx.$slots, "empty", {}, () => [
|
|
6680
|
-
|
|
7263
|
+
createTextVNode(toDisplayString(unref(taoLocale)().list.emptyText), 1)
|
|
6681
7264
|
], true)
|
|
6682
7265
|
])) : renderSlot(_ctx.$slots, "default", {}, void 0, true, 1)
|
|
6683
7266
|
], 14, _hoisted_1$b);
|
|
6684
7267
|
};
|
|
6685
7268
|
}
|
|
6686
7269
|
});
|
|
6687
|
-
const TaoList = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-
|
|
7270
|
+
const TaoList = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-183f5d21"]]);
|
|
6688
7271
|
const _hoisted_1$a = ["aria-current", "aria-disabled"];
|
|
6689
7272
|
const _hoisted_2$8 = {
|
|
6690
7273
|
key: 0,
|
|
@@ -6718,17 +7301,6 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
6718
7301
|
const props = __props;
|
|
6719
7302
|
const emit = __emit;
|
|
6720
7303
|
const slots = useSlots();
|
|
6721
|
-
const list = inject(taoListKey, null);
|
|
6722
|
-
const sizeClass = computed(() => {
|
|
6723
|
-
const size = props.size ?? (list == null ? void 0 : list.size.value) ?? "medium";
|
|
6724
|
-
if (size === "small") {
|
|
6725
|
-
return "s";
|
|
6726
|
-
}
|
|
6727
|
-
if (size === "large") {
|
|
6728
|
-
return "l";
|
|
6729
|
-
}
|
|
6730
|
-
return "m";
|
|
6731
|
-
});
|
|
6732
7304
|
const hasAction = computed(() => Boolean(slots.action));
|
|
6733
7305
|
const hasPrefix = computed(() => Boolean(slots.prefix));
|
|
6734
7306
|
const hasSuffix = computed(() => Boolean(slots.suffix));
|
|
@@ -6742,7 +7314,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
6742
7314
|
return (_ctx, _cache) => {
|
|
6743
7315
|
return openBlock(), createElementBlock("li", {
|
|
6744
7316
|
class: normalizeClass(["tao-list-item", [
|
|
6745
|
-
|
|
7317
|
+
unref(sizeClass)(__props.size),
|
|
6746
7318
|
{
|
|
6747
7319
|
"tao-list-item--selected": __props.selected,
|
|
6748
7320
|
"tao-list-item--disabled": __props.disabled,
|
|
@@ -6798,7 +7370,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
6798
7370
|
};
|
|
6799
7371
|
}
|
|
6800
7372
|
});
|
|
6801
|
-
const TaoListItem = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-
|
|
7373
|
+
const TaoListItem = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-215a8394"]]);
|
|
6802
7374
|
const _hoisted_1$9 = {
|
|
6803
7375
|
class: "tao-skeleton-group",
|
|
6804
7376
|
"aria-hidden": true
|
|
@@ -6851,11 +7423,12 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
6851
7423
|
title: { default: "" },
|
|
6852
7424
|
side: { default: "right" },
|
|
6853
7425
|
closable: { type: Boolean, default: true },
|
|
6854
|
-
closeLabel: {
|
|
7426
|
+
closeLabel: {}
|
|
6855
7427
|
},
|
|
6856
7428
|
emits: ["update:modelValue", "close"],
|
|
6857
7429
|
setup(__props, { emit: __emit }) {
|
|
6858
7430
|
const props = __props;
|
|
7431
|
+
const l10n = useLocaleText(props, "drawer");
|
|
6859
7432
|
const emit = __emit;
|
|
6860
7433
|
const panelRef = ref(null);
|
|
6861
7434
|
const titleId = useId();
|
|
@@ -6964,7 +7537,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
6964
7537
|
key: 2,
|
|
6965
7538
|
type: "button",
|
|
6966
7539
|
class: "tao-drawer__close",
|
|
6967
|
-
"aria-label":
|
|
7540
|
+
"aria-label": unref(l10n).closeLabel,
|
|
6968
7541
|
onClick: close
|
|
6969
7542
|
}, [
|
|
6970
7543
|
createElementVNode("span", _hoisted_6$4, [
|
|
@@ -6989,7 +7562,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
6989
7562
|
};
|
|
6990
7563
|
}
|
|
6991
7564
|
});
|
|
6992
|
-
const TaoDrawer = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-
|
|
7565
|
+
const TaoDrawer = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-886b5507"]]);
|
|
6993
7566
|
const _hoisted_1$7 = ["title"];
|
|
6994
7567
|
const _hoisted_2$6 = { class: "tao-avatar__face" };
|
|
6995
7568
|
const _hoisted_3$5 = ["src", "alt"];
|
|
@@ -7009,13 +7582,14 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
7009
7582
|
size: { default: "medium" },
|
|
7010
7583
|
dot: { type: [Boolean, String], default: false },
|
|
7011
7584
|
count: { default: void 0 },
|
|
7012
|
-
fallbackLabel: {
|
|
7013
|
-
notificationsLabel: {
|
|
7585
|
+
fallbackLabel: {},
|
|
7586
|
+
notificationsLabel: {},
|
|
7014
7587
|
dotLabels: { default: () => ({}) }
|
|
7015
7588
|
},
|
|
7016
7589
|
setup(__props) {
|
|
7017
7590
|
const props = __props;
|
|
7018
|
-
const
|
|
7591
|
+
const l10n = useLocaleText(props, "avatar");
|
|
7592
|
+
const sizeClass2 = computed(() => {
|
|
7019
7593
|
if (props.size === "small" || props.size === "s") {
|
|
7020
7594
|
return "s";
|
|
7021
7595
|
}
|
|
@@ -7056,21 +7630,14 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
7056
7630
|
}
|
|
7057
7631
|
return String(props.count);
|
|
7058
7632
|
});
|
|
7059
|
-
const defaultDotLabel = {
|
|
7060
|
-
success: "в сети",
|
|
7061
|
-
danger: "занят",
|
|
7062
|
-
warning: "отошёл",
|
|
7063
|
-
info: "статус",
|
|
7064
|
-
neutral: "не в сети"
|
|
7065
|
-
};
|
|
7066
7633
|
const label = computed(() => {
|
|
7067
|
-
const base = props.alt || props.name ||
|
|
7634
|
+
const base = props.alt || props.name || l10n.value.fallbackLabel;
|
|
7068
7635
|
const extra = [];
|
|
7069
7636
|
if (dotTone.value) {
|
|
7070
|
-
extra.push(props.dotLabels[dotTone.value] ??
|
|
7637
|
+
extra.push(props.dotLabels[dotTone.value] ?? taoLocale().avatar.dotLabels[dotTone.value]);
|
|
7071
7638
|
}
|
|
7072
7639
|
if (badge.value) {
|
|
7073
|
-
extra.push(
|
|
7640
|
+
extra.push(l10n.value.notificationsLabel.replace("{count}", badge.value));
|
|
7074
7641
|
}
|
|
7075
7642
|
return extra.length ? `${base}, ${extra.join(", ")}` : base;
|
|
7076
7643
|
});
|
|
@@ -7085,9 +7652,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
7085
7652
|
function onImgError() {
|
|
7086
7653
|
imgFailed.value = true;
|
|
7087
7654
|
}
|
|
7655
|
+
if (props.size === "s" || props.size === "m" || props.size === "l") {
|
|
7656
|
+
deprecationWarning("TaoAvatar", `size "${props.size}"`, "use small / medium / large");
|
|
7657
|
+
}
|
|
7088
7658
|
return (_ctx, _cache) => {
|
|
7089
7659
|
return openBlock(), createElementBlock("span", {
|
|
7090
|
-
class: normalizeClass(["tao-avatar", `tao-avatar--${
|
|
7660
|
+
class: normalizeClass(["tao-avatar", `tao-avatar--${sizeClass2.value}`]),
|
|
7091
7661
|
title: label.value
|
|
7092
7662
|
}, [
|
|
7093
7663
|
createElementVNode("span", _hoisted_2$6, [
|
|
@@ -7113,7 +7683,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
7113
7683
|
};
|
|
7114
7684
|
}
|
|
7115
7685
|
});
|
|
7116
|
-
const TaoAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-
|
|
7686
|
+
const TaoAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-2257342d"]]);
|
|
7117
7687
|
const _hoisted_1$6 = ["aria-label"];
|
|
7118
7688
|
const _hoisted_2$5 = { class: "tao-breadcrumb__list" };
|
|
7119
7689
|
const _hoisted_3$4 = {
|
|
@@ -7135,13 +7705,15 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
7135
7705
|
__name: "TaoBreadcrumb",
|
|
7136
7706
|
props: {
|
|
7137
7707
|
items: {},
|
|
7138
|
-
ariaLabel: {
|
|
7708
|
+
ariaLabel: {}
|
|
7139
7709
|
},
|
|
7140
7710
|
setup(__props) {
|
|
7711
|
+
const props = __props;
|
|
7712
|
+
const l10n = useLocaleText(props, "breadcrumb");
|
|
7141
7713
|
return (_ctx, _cache) => {
|
|
7142
7714
|
return openBlock(), createElementBlock("nav", {
|
|
7143
7715
|
class: "tao-breadcrumb",
|
|
7144
|
-
"aria-label":
|
|
7716
|
+
"aria-label": unref(l10n).ariaLabel
|
|
7145
7717
|
}, [
|
|
7146
7718
|
createElementVNode("ol", _hoisted_2$5, [
|
|
7147
7719
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item, index) => {
|
|
@@ -7167,7 +7739,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
7167
7739
|
};
|
|
7168
7740
|
}
|
|
7169
7741
|
});
|
|
7170
|
-
const TaoBreadcrumb = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-
|
|
7742
|
+
const TaoBreadcrumb = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-b853fbd5"]]);
|
|
7171
7743
|
const _hoisted_1$5 = ["aria-label"];
|
|
7172
7744
|
const _hoisted_2$4 = {
|
|
7173
7745
|
class: "tao-counter__row",
|
|
@@ -7250,6 +7822,24 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
7250
7822
|
}
|
|
7251
7823
|
});
|
|
7252
7824
|
const TaoCounter = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-9e11d2be"]]);
|
|
7825
|
+
const GLIDE_TIME = 325;
|
|
7826
|
+
const FLICK_SPEED = 0.3;
|
|
7827
|
+
function glideTarget(from, velocity, pitch, max) {
|
|
7828
|
+
if (pitch <= 0) {
|
|
7829
|
+
return from;
|
|
7830
|
+
}
|
|
7831
|
+
let slide = Math.round((from + velocity * GLIDE_TIME) / pitch);
|
|
7832
|
+
if (velocity > FLICK_SPEED) {
|
|
7833
|
+
slide = Math.max(slide, Math.floor(from / pitch) + 1);
|
|
7834
|
+
} else if (velocity < -FLICK_SPEED) {
|
|
7835
|
+
slide = Math.min(slide, Math.ceil(from / pitch) - 1);
|
|
7836
|
+
}
|
|
7837
|
+
return Math.min(Math.max(slide * pitch, 0), Math.max(max, 0));
|
|
7838
|
+
}
|
|
7839
|
+
function glideDuration(distance, velocity) {
|
|
7840
|
+
const sameDirection = Math.abs(velocity) > 0.05 && Math.sign(velocity) === Math.sign(distance);
|
|
7841
|
+
return sameDirection ? Math.min(Math.max(3 * Math.abs(distance) / Math.abs(velocity), 220), 900) : Math.min(200 + Math.abs(distance) * 1.2, 450);
|
|
7842
|
+
}
|
|
7253
7843
|
const _hoisted_1$4 = { class: "tao-carousel__row" };
|
|
7254
7844
|
const _hoisted_2$3 = ["aria-label", "disabled"];
|
|
7255
7845
|
const _hoisted_3$3 = { "aria-hidden": "true" };
|
|
@@ -7269,20 +7859,22 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7269
7859
|
autoplay: { default: 0 },
|
|
7270
7860
|
loop: { type: Boolean, default: false },
|
|
7271
7861
|
dots: { type: Boolean, default: false },
|
|
7272
|
-
ariaLabel: {
|
|
7273
|
-
prevLabel: {
|
|
7274
|
-
nextLabel: {
|
|
7275
|
-
dotsLabel: {
|
|
7276
|
-
slideLabel: {
|
|
7862
|
+
ariaLabel: {},
|
|
7863
|
+
prevLabel: {},
|
|
7864
|
+
nextLabel: {},
|
|
7865
|
+
dotsLabel: {},
|
|
7866
|
+
slideLabel: {}
|
|
7277
7867
|
},
|
|
7278
7868
|
emits: ["update:modelValue", "change"],
|
|
7279
7869
|
setup(__props, { emit: __emit }) {
|
|
7280
7870
|
const props = __props;
|
|
7871
|
+
const l10n = useLocaleText(props, "carousel");
|
|
7281
7872
|
const emit = __emit;
|
|
7282
7873
|
const track = ref(null);
|
|
7283
7874
|
const index = ref(props.modelValue);
|
|
7284
7875
|
const count = ref(0);
|
|
7285
7876
|
const dragging = ref(false);
|
|
7877
|
+
const gliding = ref(false);
|
|
7286
7878
|
const hoverPaused = ref(false);
|
|
7287
7879
|
const focusPaused = ref(false);
|
|
7288
7880
|
let dragStartX = 0;
|
|
@@ -7290,6 +7882,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7290
7882
|
let dragMoved = 0;
|
|
7291
7883
|
let dragPointer = -1;
|
|
7292
7884
|
let scrollFrame = 0;
|
|
7885
|
+
let glideFrame = 0;
|
|
7886
|
+
let settleTimer = 0;
|
|
7887
|
+
let samples = [];
|
|
7293
7888
|
let focusFrame = 0;
|
|
7294
7889
|
let autoplayTimer = 0;
|
|
7295
7890
|
const step = computed(() => Math.max(1, Math.round(props.perView)));
|
|
@@ -7322,7 +7917,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7322
7917
|
if (width <= 0 || total <= 0) {
|
|
7323
7918
|
return 0;
|
|
7324
7919
|
}
|
|
7325
|
-
const left = ((_a = track.value) == null ? void 0 : _a.scrollLeft) ?? 0;
|
|
7920
|
+
const left = scrollLeft ?? ((_a = track.value) == null ? void 0 : _a.scrollLeft) ?? 0;
|
|
7326
7921
|
const last = Math.max(total - step.value, 0);
|
|
7327
7922
|
return Math.min(Math.max(Math.round(left / (width + gap)), 0), last);
|
|
7328
7923
|
}
|
|
@@ -7345,6 +7940,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7345
7940
|
goTo(index.value + step.value);
|
|
7346
7941
|
}
|
|
7347
7942
|
function goTo(next, instant = false) {
|
|
7943
|
+
cancelGlide();
|
|
7348
7944
|
const el = track.value;
|
|
7349
7945
|
const { width, gap, total } = metrics();
|
|
7350
7946
|
if (!el || width <= 0 || total <= 0) {
|
|
@@ -7375,7 +7971,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7375
7971
|
autoplayTimer = 0;
|
|
7376
7972
|
}
|
|
7377
7973
|
function canAutoplay() {
|
|
7378
|
-
return props.autoplay > 0 && count.value > step.value && !hoverPaused.value && !focusPaused.value && !dragging.value && typeof document !== "undefined" && !document.hidden && !prefersReducedMotion() && (props.loop || index.value < lastIndex.value);
|
|
7974
|
+
return props.autoplay > 0 && count.value > step.value && !hoverPaused.value && !focusPaused.value && !dragging.value && !gliding.value && typeof document !== "undefined" && !document.hidden && !prefersReducedMotion() && (props.loop || index.value < lastIndex.value);
|
|
7379
7975
|
}
|
|
7380
7976
|
function tickAutoplay() {
|
|
7381
7977
|
if (!canAutoplay()) {
|
|
@@ -7427,20 +8023,103 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7427
8023
|
});
|
|
7428
8024
|
}
|
|
7429
8025
|
function onScroll() {
|
|
7430
|
-
if (dragging.value) {
|
|
8026
|
+
if (dragging.value || gliding.value) {
|
|
7431
8027
|
return;
|
|
7432
8028
|
}
|
|
7433
8029
|
cancelAnimationFrame(scrollFrame);
|
|
7434
|
-
scrollFrame = requestAnimationFrame(() =>
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
|
|
7439
|
-
|
|
8030
|
+
scrollFrame = requestAnimationFrame(() => setIndex(nearestIndex()));
|
|
8031
|
+
if (!supportsScrollEnd()) {
|
|
8032
|
+
window.clearTimeout(settleTimer);
|
|
8033
|
+
settleTimer = window.setTimeout(settle, 150);
|
|
8034
|
+
}
|
|
8035
|
+
}
|
|
8036
|
+
function supportsScrollEnd() {
|
|
8037
|
+
return typeof window !== "undefined" && "onscrollend" in window;
|
|
8038
|
+
}
|
|
8039
|
+
function settle() {
|
|
8040
|
+
window.clearTimeout(settleTimer);
|
|
8041
|
+
const el = track.value;
|
|
8042
|
+
if (!el || dragging.value || gliding.value || getComputedStyle(el).scrollSnapType !== "none") {
|
|
8043
|
+
return;
|
|
8044
|
+
}
|
|
8045
|
+
const max = el.scrollWidth - el.clientWidth;
|
|
8046
|
+
if (el.scrollLeft >= max - 1) {
|
|
8047
|
+
return;
|
|
8048
|
+
}
|
|
8049
|
+
const target = glideTarget$1(el.scrollLeft, 0);
|
|
8050
|
+
if (Math.abs(target - el.scrollLeft) >= 1) {
|
|
8051
|
+
glideTo(target, 0);
|
|
8052
|
+
}
|
|
8053
|
+
}
|
|
8054
|
+
function onUserScrollInput() {
|
|
8055
|
+
if (!dragging.value) {
|
|
8056
|
+
cancelGlide();
|
|
8057
|
+
}
|
|
8058
|
+
}
|
|
8059
|
+
function recordSample(x) {
|
|
8060
|
+
const t = performance.now();
|
|
8061
|
+
samples.push({ x, t });
|
|
8062
|
+
while (samples.length > 2 && t - samples[0].t > 100) {
|
|
8063
|
+
samples.shift();
|
|
8064
|
+
}
|
|
8065
|
+
}
|
|
8066
|
+
function releaseVelocity() {
|
|
8067
|
+
const first = samples[0];
|
|
8068
|
+
const last = samples[samples.length - 1];
|
|
8069
|
+
if (!first || !last || last.t === first.t || performance.now() - last.t > 80) {
|
|
8070
|
+
return 0;
|
|
8071
|
+
}
|
|
8072
|
+
return -(last.x - first.x) / (last.t - first.t);
|
|
8073
|
+
}
|
|
8074
|
+
function cancelGlide() {
|
|
8075
|
+
if (!glideFrame) {
|
|
8076
|
+
return;
|
|
8077
|
+
}
|
|
8078
|
+
cancelAnimationFrame(glideFrame);
|
|
8079
|
+
glideFrame = 0;
|
|
8080
|
+
gliding.value = false;
|
|
8081
|
+
}
|
|
8082
|
+
function glideTarget$1(from, velocity) {
|
|
8083
|
+
const el = track.value;
|
|
8084
|
+
const { width, gap } = metrics();
|
|
8085
|
+
if (!el || width <= 0) {
|
|
8086
|
+
return from;
|
|
8087
|
+
}
|
|
8088
|
+
return glideTarget(from, velocity, width + gap, el.scrollWidth - el.clientWidth);
|
|
8089
|
+
}
|
|
8090
|
+
function finishGlide() {
|
|
8091
|
+
glideFrame = 0;
|
|
8092
|
+
gliding.value = false;
|
|
8093
|
+
setIndex(nearestIndex());
|
|
8094
|
+
syncAutoplay();
|
|
8095
|
+
}
|
|
8096
|
+
function glideTo(target, velocity) {
|
|
8097
|
+
const el = track.value;
|
|
8098
|
+
if (!el) {
|
|
8099
|
+
return;
|
|
8100
|
+
}
|
|
8101
|
+
cancelGlide();
|
|
8102
|
+
const from = el.scrollLeft;
|
|
8103
|
+
const distance = target - from;
|
|
8104
|
+
setIndex(nearestIndex(target));
|
|
8105
|
+
if (Math.abs(distance) < 1 || prefersReducedMotion()) {
|
|
8106
|
+
el.scrollLeft = target;
|
|
8107
|
+
syncAutoplay();
|
|
8108
|
+
return;
|
|
8109
|
+
}
|
|
8110
|
+
const duration = glideDuration(distance, velocity);
|
|
8111
|
+
const start = performance.now();
|
|
8112
|
+
gliding.value = true;
|
|
8113
|
+
const frame = (now) => {
|
|
8114
|
+
const t = Math.min((now - start) / duration, 1);
|
|
8115
|
+
el.scrollLeft = from + distance * (1 - (1 - t) ** 3);
|
|
8116
|
+
if (t < 1) {
|
|
8117
|
+
glideFrame = requestAnimationFrame(frame);
|
|
7440
8118
|
return;
|
|
7441
8119
|
}
|
|
7442
|
-
|
|
7443
|
-
}
|
|
8120
|
+
finishGlide();
|
|
8121
|
+
};
|
|
8122
|
+
glideFrame = requestAnimationFrame(frame);
|
|
7444
8123
|
}
|
|
7445
8124
|
function releaseDragCapture() {
|
|
7446
8125
|
const el = track.value;
|
|
@@ -7466,8 +8145,12 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7466
8145
|
if (!keepClickGuard) {
|
|
7467
8146
|
dragMoved = 0;
|
|
7468
8147
|
}
|
|
7469
|
-
|
|
7470
|
-
|
|
8148
|
+
const el = track.value;
|
|
8149
|
+
const velocity = releaseVelocity();
|
|
8150
|
+
samples = [];
|
|
8151
|
+
if (el) {
|
|
8152
|
+
glideTo(glideTarget$1(el.scrollLeft, velocity), velocity);
|
|
8153
|
+
return;
|
|
7471
8154
|
}
|
|
7472
8155
|
syncAutoplay();
|
|
7473
8156
|
}
|
|
@@ -7475,10 +8158,13 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7475
8158
|
if (event.pointerType !== "mouse" || event.button !== 0 || !track.value) {
|
|
7476
8159
|
return;
|
|
7477
8160
|
}
|
|
8161
|
+
cancelGlide();
|
|
7478
8162
|
dragPointer = event.pointerId;
|
|
7479
8163
|
dragStartX = event.clientX;
|
|
7480
8164
|
dragStartScroll = track.value.scrollLeft;
|
|
7481
8165
|
dragMoved = 0;
|
|
8166
|
+
samples = [];
|
|
8167
|
+
recordSample(event.clientX);
|
|
7482
8168
|
dragging.value = true;
|
|
7483
8169
|
try {
|
|
7484
8170
|
track.value.setPointerCapture(event.pointerId);
|
|
@@ -7490,7 +8176,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7490
8176
|
return;
|
|
7491
8177
|
}
|
|
7492
8178
|
const dx = event.clientX - dragStartX;
|
|
7493
|
-
dragMoved = Math.abs(dx);
|
|
8179
|
+
dragMoved = Math.max(dragMoved, Math.abs(dx));
|
|
8180
|
+
recordSample(event.clientX);
|
|
7494
8181
|
track.value.scrollLeft = dragStartScroll - dx;
|
|
7495
8182
|
}
|
|
7496
8183
|
function onPointerEnd(event) {
|
|
@@ -7544,7 +8231,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7544
8231
|
}
|
|
7545
8232
|
);
|
|
7546
8233
|
watch(
|
|
7547
|
-
() => [props.autoplay, props.loop, count.value, dragging.value, index.value],
|
|
8234
|
+
() => [props.autoplay, props.loop, count.value, dragging.value, gliding.value, index.value],
|
|
7548
8235
|
() => syncAutoplay()
|
|
7549
8236
|
);
|
|
7550
8237
|
onMounted(() => {
|
|
@@ -7560,6 +8247,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7560
8247
|
onUpdated(refreshCount);
|
|
7561
8248
|
onBeforeUnmount(() => {
|
|
7562
8249
|
endDrag();
|
|
8250
|
+
cancelGlide();
|
|
8251
|
+
window.clearTimeout(settleTimer);
|
|
7563
8252
|
cancelAnimationFrame(scrollFrame);
|
|
7564
8253
|
cancelAnimationFrame(focusFrame);
|
|
7565
8254
|
stopAutoplay();
|
|
@@ -7585,7 +8274,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7585
8274
|
key: 0,
|
|
7586
8275
|
type: "button",
|
|
7587
8276
|
class: "tao-carousel__nav",
|
|
7588
|
-
"aria-label":
|
|
8277
|
+
"aria-label": unref(l10n).prevLabel,
|
|
7589
8278
|
disabled: atStart.value,
|
|
7590
8279
|
onClick: goPrev
|
|
7591
8280
|
}, [
|
|
@@ -7613,11 +8302,14 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7613
8302
|
createElementVNode("div", {
|
|
7614
8303
|
ref_key: "track",
|
|
7615
8304
|
ref: track,
|
|
7616
|
-
class: normalizeClass(["tao-carousel__track", { "tao-carousel__track--dragging": dragging.value }]),
|
|
8305
|
+
class: normalizeClass(["tao-carousel__track", { "tao-carousel__track--dragging": dragging.value, "tao-carousel__track--gliding": gliding.value }]),
|
|
7617
8306
|
role: "region",
|
|
7618
|
-
"aria-label":
|
|
8307
|
+
"aria-label": unref(l10n).ariaLabel,
|
|
7619
8308
|
tabindex: "0",
|
|
7620
8309
|
onScroll,
|
|
8310
|
+
onScrollend: settle,
|
|
8311
|
+
onWheelPassive: onUserScrollInput,
|
|
8312
|
+
onTouchstartPassive: onUserScrollInput,
|
|
7621
8313
|
onKeydown,
|
|
7622
8314
|
onPointerdown: onPointerDown,
|
|
7623
8315
|
onPointermove: onPointerMove,
|
|
@@ -7636,7 +8328,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7636
8328
|
key: 0,
|
|
7637
8329
|
type: "button",
|
|
7638
8330
|
class: "tao-carousel__nav",
|
|
7639
|
-
"aria-label":
|
|
8331
|
+
"aria-label": unref(l10n).nextLabel,
|
|
7640
8332
|
disabled: atEnd.value,
|
|
7641
8333
|
onClick: goNext
|
|
7642
8334
|
}, [
|
|
@@ -7671,14 +8363,14 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7671
8363
|
key: 0,
|
|
7672
8364
|
class: "tao-carousel__dots",
|
|
7673
8365
|
role: "group",
|
|
7674
|
-
"aria-label":
|
|
8366
|
+
"aria-label": unref(l10n).dotsLabel
|
|
7675
8367
|
}, [
|
|
7676
8368
|
(openBlock(true), createElementBlock(Fragment, null, renderList(snapCount.value, (n) => {
|
|
7677
8369
|
return openBlock(), createElementBlock("button", {
|
|
7678
8370
|
key: n,
|
|
7679
8371
|
type: "button",
|
|
7680
8372
|
class: normalizeClass(["tao-carousel__dot", { "tao-carousel__dot--active": n - 1 === index.value }]),
|
|
7681
|
-
"aria-label":
|
|
8373
|
+
"aria-label": unref(l10n).slideLabel.replace("{n}", String(n)).replace("{count}", String(snapCount.value)),
|
|
7682
8374
|
"aria-current": n - 1 === index.value ? "true" : void 0,
|
|
7683
8375
|
onClick: ($event) => goTo(n - 1)
|
|
7684
8376
|
}, [
|
|
@@ -7697,7 +8389,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7697
8389
|
};
|
|
7698
8390
|
}
|
|
7699
8391
|
});
|
|
7700
|
-
const TaoCarousel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
8392
|
+
const TaoCarousel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-d83a4f4e"]]);
|
|
7701
8393
|
const _hoisted_1$3 = ["aria-label"];
|
|
7702
8394
|
const _hoisted_2$2 = ["aria-label"];
|
|
7703
8395
|
const _hoisted_3$2 = {
|
|
@@ -7738,18 +8430,14 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
7738
8430
|
__name: "TaoStages",
|
|
7739
8431
|
props: {
|
|
7740
8432
|
items: { default: () => [] },
|
|
7741
|
-
|
|
7742
|
-
|
|
8433
|
+
direction: { default: void 0 },
|
|
8434
|
+
vertical: { type: Boolean, default: void 0 },
|
|
8435
|
+
ariaLabel: {},
|
|
7743
8436
|
statusLabels: { default: () => ({}) }
|
|
7744
8437
|
},
|
|
7745
8438
|
setup(__props) {
|
|
7746
8439
|
const props = __props;
|
|
7747
|
-
const
|
|
7748
|
-
wait: "ожидание",
|
|
7749
|
-
work: "в работе",
|
|
7750
|
-
ok: "готово",
|
|
7751
|
-
bad: "ошибка"
|
|
7752
|
-
};
|
|
8440
|
+
const l10n = useLocaleText(props, "stages");
|
|
7753
8441
|
function statusOf(item) {
|
|
7754
8442
|
if (item.status === "danger") {
|
|
7755
8443
|
return "bad";
|
|
@@ -7758,12 +8446,16 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
7758
8446
|
}
|
|
7759
8447
|
function itemLabel(item) {
|
|
7760
8448
|
const status = statusOf(item);
|
|
7761
|
-
return `${item.label ?? item.key}, ${props.statusLabels[status] ??
|
|
8449
|
+
return `${item.label ?? item.key}, ${props.statusLabels[status] ?? taoLocale().stages.statusLabels[status]}`;
|
|
7762
8450
|
}
|
|
8451
|
+
const isRow = computed(() => (props.direction ?? (props.vertical === false ? "row" : "column")) === "row");
|
|
8452
|
+
warnDeprecated("TaoStages", {
|
|
8453
|
+
vertical: "use `direction`"
|
|
8454
|
+
});
|
|
7763
8455
|
return (_ctx, _cache) => {
|
|
7764
8456
|
return openBlock(), createElementBlock("ul", {
|
|
7765
|
-
class: normalizeClass(["tao-stages", { "tao-stages--horizontal":
|
|
7766
|
-
"aria-label":
|
|
8457
|
+
class: normalizeClass(["tao-stages", { "tao-stages--horizontal": isRow.value }]),
|
|
8458
|
+
"aria-label": unref(l10n).ariaLabel
|
|
7767
8459
|
}, [
|
|
7768
8460
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item, index) => {
|
|
7769
8461
|
return openBlock(), createElementBlock("li", {
|
|
@@ -7832,86 +8524,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
7832
8524
|
};
|
|
7833
8525
|
}
|
|
7834
8526
|
});
|
|
7835
|
-
const TaoStages = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-
|
|
7836
|
-
const TOAST_POSITIONS = [
|
|
7837
|
-
"topRight",
|
|
7838
|
-
"topLeft",
|
|
7839
|
-
"topCenter",
|
|
7840
|
-
"bottomRight",
|
|
7841
|
-
"bottomLeft",
|
|
7842
|
-
"bottomCenter",
|
|
7843
|
-
"center"
|
|
7844
|
-
];
|
|
7845
|
-
const toastDefaults = {
|
|
7846
|
-
position: "topCenter",
|
|
7847
|
-
timeout: 3e3,
|
|
7848
|
-
closable: true,
|
|
7849
|
-
progress: true,
|
|
7850
|
-
closeLabel: "Закрыть уведомление"
|
|
7851
|
-
};
|
|
7852
|
-
const toasts = ref([]);
|
|
7853
|
-
const toastsByPosition = computed(() => {
|
|
7854
|
-
const grouped = {};
|
|
7855
|
-
for (const position of TOAST_POSITIONS) {
|
|
7856
|
-
grouped[position] = [];
|
|
7857
|
-
}
|
|
7858
|
-
for (const toast2 of toasts.value) {
|
|
7859
|
-
grouped[toast2.position].push(toast2);
|
|
7860
|
-
}
|
|
7861
|
-
return grouped;
|
|
7862
|
-
});
|
|
7863
|
-
function configureToastDefaults(partial) {
|
|
7864
|
-
Object.assign(toastDefaults, partial);
|
|
7865
|
-
}
|
|
7866
|
-
function addToast(record) {
|
|
7867
|
-
if (record.displayMode === "once" && record.dedupeId) {
|
|
7868
|
-
const exists = toasts.value.some((item) => item.dedupeId === record.dedupeId);
|
|
7869
|
-
if (exists) {
|
|
7870
|
-
return;
|
|
7871
|
-
}
|
|
7872
|
-
}
|
|
7873
|
-
if (record.displayMode === "replace" && record.dedupeId) {
|
|
7874
|
-
toasts.value = toasts.value.filter((item) => item.dedupeId !== record.dedupeId);
|
|
7875
|
-
}
|
|
7876
|
-
toasts.value = [...toasts.value, record];
|
|
7877
|
-
}
|
|
7878
|
-
function removeToast(id) {
|
|
7879
|
-
var _a;
|
|
7880
|
-
const item = toasts.value.find((toast2) => toast2.id === id);
|
|
7881
|
-
if (!item) {
|
|
7882
|
-
return;
|
|
7883
|
-
}
|
|
7884
|
-
toasts.value = toasts.value.filter((toast2) => toast2.id !== id);
|
|
7885
|
-
(_a = item.onClosed) == null ? void 0 : _a.call(item);
|
|
7886
|
-
}
|
|
7887
|
-
function dismissToasts(id) {
|
|
7888
|
-
if (id) {
|
|
7889
|
-
removeToast(id);
|
|
7890
|
-
return;
|
|
7891
|
-
}
|
|
7892
|
-
const items = toasts.value;
|
|
7893
|
-
toasts.value = [];
|
|
7894
|
-
items.forEach((item) => {
|
|
7895
|
-
var _a;
|
|
7896
|
-
return (_a = item.onClosed) == null ? void 0 : _a.call(item);
|
|
7897
|
-
});
|
|
7898
|
-
}
|
|
7899
|
-
let viewportMounts$1 = 0;
|
|
7900
|
-
function registerToastViewport() {
|
|
7901
|
-
viewportMounts$1 += 1;
|
|
7902
|
-
}
|
|
7903
|
-
function unregisterToastViewport() {
|
|
7904
|
-
viewportMounts$1 = Math.max(0, viewportMounts$1 - 1);
|
|
7905
|
-
}
|
|
7906
|
-
function hasToastViewport() {
|
|
7907
|
-
if (viewportMounts$1 > 0) {
|
|
7908
|
-
return true;
|
|
7909
|
-
}
|
|
7910
|
-
if (typeof document === "undefined") {
|
|
7911
|
-
return false;
|
|
7912
|
-
}
|
|
7913
|
-
return Boolean(document.querySelector("[data-tao-toast-viewport]"));
|
|
7914
|
-
}
|
|
8527
|
+
const TaoStages = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-45cc2ad5"]]);
|
|
7915
8528
|
const _hoisted_1$2 = ["role"];
|
|
7916
8529
|
const _hoisted_2$1 = {
|
|
7917
8530
|
class: "tao-toast__icon",
|
|
@@ -8019,7 +8632,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
8019
8632
|
});
|
|
8020
8633
|
return (_ctx, _cache) => {
|
|
8021
8634
|
return openBlock(), createElementBlock("div", {
|
|
8022
|
-
class: normalizeClass(["tao-toast", [`tao-toast--${__props.toast.type}`, { "tao-toast--paused": paused.value }]]),
|
|
8635
|
+
class: normalizeClass(["tao-toast", [`tao-toast--${__props.toast.type}`, unref(surfaceClass)(__props.toast.surface), { "tao-toast--paused": paused.value }]]),
|
|
8023
8636
|
role: __props.toast.type === "error" || __props.toast.type === "danger" || __props.toast.type === "warning" ? "alert" : "status",
|
|
8024
8637
|
"aria-live": "polite",
|
|
8025
8638
|
onMouseenter: pause,
|
|
@@ -8139,7 +8752,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
8139
8752
|
};
|
|
8140
8753
|
}
|
|
8141
8754
|
});
|
|
8142
|
-
const TaoToastItem = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
8755
|
+
const TaoToastItem = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-e0b96c7f"]]);
|
|
8143
8756
|
const _hoisted_1$1 = { class: "tao-toast-slot__inner" };
|
|
8144
8757
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
8145
8758
|
...{ name: "TaoToastViewport" },
|
|
@@ -8194,50 +8807,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
8194
8807
|
}
|
|
8195
8808
|
});
|
|
8196
8809
|
const TaoToastViewport = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-d07e8a95"]]);
|
|
8197
|
-
const confirmDefaults = {
|
|
8198
|
-
ok: "ОК",
|
|
8199
|
-
cancel: "Отмена"
|
|
8200
|
-
};
|
|
8201
|
-
const currentConfirm = ref(null);
|
|
8202
|
-
const queue = [];
|
|
8203
|
-
function configureConfirmDefaults(partial) {
|
|
8204
|
-
Object.assign(confirmDefaults, partial);
|
|
8205
|
-
}
|
|
8206
|
-
function pump() {
|
|
8207
|
-
if (currentConfirm.value) {
|
|
8208
|
-
return;
|
|
8209
|
-
}
|
|
8210
|
-
currentConfirm.value = queue.shift() ?? null;
|
|
8211
|
-
}
|
|
8212
|
-
function enqueueConfirm(record) {
|
|
8213
|
-
queue.push(record);
|
|
8214
|
-
pump();
|
|
8215
|
-
}
|
|
8216
|
-
function resolveConfirm(value) {
|
|
8217
|
-
const item = currentConfirm.value;
|
|
8218
|
-
if (!item) {
|
|
8219
|
-
return;
|
|
8220
|
-
}
|
|
8221
|
-
currentConfirm.value = null;
|
|
8222
|
-
item.resolve(value);
|
|
8223
|
-
pump();
|
|
8224
|
-
}
|
|
8225
|
-
let viewportMounts = 0;
|
|
8226
|
-
function registerConfirmHost() {
|
|
8227
|
-
viewportMounts += 1;
|
|
8228
|
-
}
|
|
8229
|
-
function unregisterConfirmHost() {
|
|
8230
|
-
viewportMounts = Math.max(0, viewportMounts - 1);
|
|
8231
|
-
}
|
|
8232
|
-
function hasConfirmHost() {
|
|
8233
|
-
if (viewportMounts > 0) {
|
|
8234
|
-
return true;
|
|
8235
|
-
}
|
|
8236
|
-
if (typeof document === "undefined") {
|
|
8237
|
-
return false;
|
|
8238
|
-
}
|
|
8239
|
-
return Boolean(document.querySelector("[data-tao-confirm-host]"));
|
|
8240
|
-
}
|
|
8241
8810
|
const _hoisted_1 = ["aria-labelledby", "aria-describedby"];
|
|
8242
8811
|
const _hoisted_2 = {
|
|
8243
8812
|
class: "tao-confirm__icon",
|
|
@@ -8349,7 +8918,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
8349
8918
|
default: withCtx(() => [
|
|
8350
8919
|
unref(currentConfirm) ? (openBlock(), createElementBlock("div", {
|
|
8351
8920
|
key: 0,
|
|
8352
|
-
class: "tao-confirm",
|
|
8921
|
+
class: normalizeClass(["tao-confirm", { "tao-confirm--glass": unref(currentConfirm).surface === "glass" }]),
|
|
8353
8922
|
"data-tao-confirm-host": "",
|
|
8354
8923
|
onKeydown
|
|
8355
8924
|
}, [
|
|
@@ -8360,7 +8929,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
8360
8929
|
createElementVNode("div", {
|
|
8361
8930
|
ref_key: "panelRef",
|
|
8362
8931
|
ref: panelRef,
|
|
8363
|
-
class: normalizeClass(["tao-confirm__panel", { "tao-confirm__panel--danger": unref(currentConfirm).danger }]),
|
|
8932
|
+
class: normalizeClass(["tao-confirm__panel", [unref(surfaceClass)(unref(currentConfirm).surface), { "tao-confirm__panel--danger": unref(currentConfirm).danger }]]),
|
|
8364
8933
|
role: "alertdialog",
|
|
8365
8934
|
"aria-modal": "true",
|
|
8366
8935
|
"aria-labelledby": unref(currentConfirm).title ? "tao-confirm-title" : void 0,
|
|
@@ -8435,7 +9004,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
8435
9004
|
}, 8, ["variant"])
|
|
8436
9005
|
])
|
|
8437
9006
|
], 10, _hoisted_1)
|
|
8438
|
-
],
|
|
9007
|
+
], 34)) : createCommentVNode("", true)
|
|
8439
9008
|
]),
|
|
8440
9009
|
_: 1
|
|
8441
9010
|
})
|
|
@@ -8443,7 +9012,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
8443
9012
|
};
|
|
8444
9013
|
}
|
|
8445
9014
|
});
|
|
8446
|
-
const TaoConfirmHost = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
9015
|
+
const TaoConfirmHost = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-03fe6839"]]);
|
|
8447
9016
|
const TYPE_TIMEOUT = {
|
|
8448
9017
|
success: 3e3,
|
|
8449
9018
|
error: 5e3,
|
|
@@ -8488,6 +9057,7 @@ function flushDraft(draft) {
|
|
|
8488
9057
|
position: draft.position,
|
|
8489
9058
|
closable: draft.closable,
|
|
8490
9059
|
progress: draft.progress,
|
|
9060
|
+
surface: draft.surface,
|
|
8491
9061
|
displayMode: draft.displayMode,
|
|
8492
9062
|
dedupeId,
|
|
8493
9063
|
actions: draft.actions,
|
|
@@ -8504,6 +9074,7 @@ function createDraft$1() {
|
|
|
8504
9074
|
position: toastDefaults.position,
|
|
8505
9075
|
closable: toastDefaults.closable,
|
|
8506
9076
|
progress: toastDefaults.progress,
|
|
9077
|
+
surface: toastDefaults.surface,
|
|
8507
9078
|
actions: []
|
|
8508
9079
|
};
|
|
8509
9080
|
}
|
|
@@ -8600,6 +9171,10 @@ function createBuilder$1() {
|
|
|
8600
9171
|
draft.progress = value;
|
|
8601
9172
|
return ctx;
|
|
8602
9173
|
},
|
|
9174
|
+
surface(value) {
|
|
9175
|
+
draft.surface = value;
|
|
9176
|
+
return ctx;
|
|
9177
|
+
},
|
|
8603
9178
|
id(value) {
|
|
8604
9179
|
draft.dedupeId = value;
|
|
8605
9180
|
return ctx;
|
|
@@ -8650,6 +9225,9 @@ function shortcut(type, message, options) {
|
|
|
8650
9225
|
if ((options == null ? void 0 : options.progress) !== void 0) {
|
|
8651
9226
|
builder.progress(options.progress);
|
|
8652
9227
|
}
|
|
9228
|
+
if (options == null ? void 0 : options.surface) {
|
|
9229
|
+
builder.surface(options.surface);
|
|
9230
|
+
}
|
|
8653
9231
|
if (options == null ? void 0 : options.id) {
|
|
8654
9232
|
builder.id(options.id);
|
|
8655
9233
|
}
|
|
@@ -8733,7 +9311,8 @@ function createDraft() {
|
|
|
8733
9311
|
message: "",
|
|
8734
9312
|
okLabel: confirmDefaults.ok,
|
|
8735
9313
|
cancelLabel: confirmDefaults.cancel,
|
|
8736
|
-
danger: false
|
|
9314
|
+
danger: false,
|
|
9315
|
+
surface: confirmDefaults.surface
|
|
8737
9316
|
};
|
|
8738
9317
|
}
|
|
8739
9318
|
function createBuilder() {
|
|
@@ -8763,6 +9342,10 @@ function createBuilder() {
|
|
|
8763
9342
|
draft.danger = value;
|
|
8764
9343
|
return ctx;
|
|
8765
9344
|
},
|
|
9345
|
+
surface(value) {
|
|
9346
|
+
draft.surface = value;
|
|
9347
|
+
return ctx;
|
|
9348
|
+
},
|
|
8766
9349
|
then(onFulfilled, onRejected) {
|
|
8767
9350
|
return promise.then(onFulfilled, onRejected);
|
|
8768
9351
|
}
|
|
@@ -8780,6 +9363,7 @@ function createBuilder() {
|
|
|
8780
9363
|
okLabel: draft.okLabel,
|
|
8781
9364
|
cancelLabel: draft.cancelLabel,
|
|
8782
9365
|
danger: draft.danger,
|
|
9366
|
+
surface: draft.surface,
|
|
8783
9367
|
resolve: settle
|
|
8784
9368
|
});
|
|
8785
9369
|
}, 0);
|
|
@@ -8801,6 +9385,9 @@ function applyOptions(builder, options) {
|
|
|
8801
9385
|
if (options.danger) {
|
|
8802
9386
|
builder.danger(true);
|
|
8803
9387
|
}
|
|
9388
|
+
if (options.surface) {
|
|
9389
|
+
builder.surface(options.surface);
|
|
9390
|
+
}
|
|
8804
9391
|
return builder;
|
|
8805
9392
|
}
|
|
8806
9393
|
function confirmFn(title, options) {
|
|
@@ -8883,7 +9470,10 @@ const components = [
|
|
|
8883
9470
|
TaoConfirmHost
|
|
8884
9471
|
];
|
|
8885
9472
|
const TaoUI = {
|
|
8886
|
-
install(app) {
|
|
9473
|
+
install(app, options = {}) {
|
|
9474
|
+
if (options.locale) {
|
|
9475
|
+
setTaoLocale(options.locale);
|
|
9476
|
+
}
|
|
8887
9477
|
components.forEach((component) => {
|
|
8888
9478
|
app.component(component.name, component);
|
|
8889
9479
|
});
|
|
@@ -8957,8 +9547,12 @@ export {
|
|
|
8957
9547
|
formatTaoDateIso,
|
|
8958
9548
|
formatTaoDateLabel,
|
|
8959
9549
|
formatTaoDateRangeLabel,
|
|
9550
|
+
localeEn,
|
|
9551
|
+
localeRu,
|
|
8960
9552
|
parseTaoDate,
|
|
8961
9553
|
parseTaoDateRange,
|
|
9554
|
+
setTaoLocale,
|
|
9555
|
+
taoLocale,
|
|
8962
9556
|
toast,
|
|
8963
9557
|
todayTaoDate
|
|
8964
9558
|
};
|