@1337exp/taoui 1.13.1 → 2.0.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 +74 -14
- package/README.ru.md +621 -561
- package/dist/index.cjs +1171 -602
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +737 -380
- package/dist/index.mjs +1172 -603
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -4785
- package/package.json +66 -61
- package/src/styles/index.css +2 -1
- package/src/styles/primitives.css +42 -5
- package/src/styles/size.css +57 -0
package/dist/index.cjs
CHANGED
|
@@ -2,22 +2,36 @@
|
|
|
2
2
|
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue")) : typeof define === "function" && define.amd ? define(["exports", "vue"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.TaoUI = {}, global.Vue));
|
|
3
3
|
})(this, function(exports2, vue) {
|
|
4
4
|
"use strict";
|
|
5
|
+
const sizes = ["small", "medium", "large"];
|
|
6
|
+
function sizeClass(size) {
|
|
7
|
+
return size ? `tao-size-${size}` : void 0;
|
|
8
|
+
}
|
|
9
|
+
function resolveSize(el, size) {
|
|
10
|
+
if (size) {
|
|
11
|
+
return size;
|
|
12
|
+
}
|
|
13
|
+
if (!el || typeof getComputedStyle === "undefined") {
|
|
14
|
+
return "medium";
|
|
15
|
+
}
|
|
16
|
+
const value = getComputedStyle(el).getPropertyValue("--tao-size").trim();
|
|
17
|
+
return sizes.includes(value) ? value : "medium";
|
|
18
|
+
}
|
|
5
19
|
const _hoisted_1$P = ["type", "disabled"];
|
|
6
20
|
const _hoisted_2$I = {
|
|
7
21
|
key: 0,
|
|
8
22
|
class: "tao-button__loader"
|
|
9
23
|
};
|
|
10
|
-
const _hoisted_3$
|
|
24
|
+
const _hoisted_3$z = {
|
|
11
25
|
key: 1,
|
|
12
26
|
class: "tao-button__icon"
|
|
13
27
|
};
|
|
14
|
-
const _hoisted_4$
|
|
28
|
+
const _hoisted_4$u = { class: "tao-button__content" };
|
|
15
29
|
const _sfc_main$Z = /* @__PURE__ */ vue.defineComponent({
|
|
16
30
|
...{ name: "TaoButton" },
|
|
17
31
|
__name: "TaoButton",
|
|
18
32
|
props: {
|
|
19
33
|
type: { default: "button" },
|
|
20
|
-
size: {
|
|
34
|
+
size: {},
|
|
21
35
|
variant: { default: "primary" },
|
|
22
36
|
tone: { default: "" },
|
|
23
37
|
disabled: { type: Boolean, default: false },
|
|
@@ -37,7 +51,7 @@
|
|
|
37
51
|
return (_ctx, _cache) => {
|
|
38
52
|
return vue.openBlock(), vue.createElementBlock("button", {
|
|
39
53
|
class: vue.normalizeClass(["tao-button", [
|
|
40
|
-
|
|
54
|
+
vue.unref(sizeClass)(__props.size),
|
|
41
55
|
`tao-button--${__props.variant}`,
|
|
42
56
|
{
|
|
43
57
|
"tao-button--disabled": __props.disabled,
|
|
@@ -52,8 +66,8 @@
|
|
|
52
66
|
onClick: handleClick
|
|
53
67
|
}, [
|
|
54
68
|
__props.loading ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$I)) : vue.createCommentVNode("", true),
|
|
55
|
-
__props.icon ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$
|
|
56
|
-
vue.createElementVNode("span", _hoisted_4$
|
|
69
|
+
__props.icon ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$z, vue.toDisplayString(__props.icon), 1)) : vue.createCommentVNode("", true),
|
|
70
|
+
vue.createElementVNode("span", _hoisted_4$u, [
|
|
57
71
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
58
72
|
])
|
|
59
73
|
], 10, _hoisted_1$P);
|
|
@@ -67,7 +81,16 @@
|
|
|
67
81
|
}
|
|
68
82
|
return target;
|
|
69
83
|
};
|
|
70
|
-
const TaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["__scopeId", "data-v-
|
|
84
|
+
const TaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["__scopeId", "data-v-eb25f649"]]);
|
|
85
|
+
function toCssLength(value) {
|
|
86
|
+
if (value === void 0 || value === null || value === "") {
|
|
87
|
+
return void 0;
|
|
88
|
+
}
|
|
89
|
+
return typeof value === "number" ? `${value}px` : value;
|
|
90
|
+
}
|
|
91
|
+
function toCssBox(value) {
|
|
92
|
+
return Array.isArray(value) ? value.map((part) => toCssLength(part) ?? "0").join(" ") : toCssLength(value);
|
|
93
|
+
}
|
|
71
94
|
const _sfc_main$Y = /* @__PURE__ */ vue.defineComponent({
|
|
72
95
|
...{ name: "TaoBlock" },
|
|
73
96
|
__name: "TaoBlock",
|
|
@@ -79,17 +102,8 @@
|
|
|
79
102
|
},
|
|
80
103
|
setup(__props) {
|
|
81
104
|
const props = __props;
|
|
82
|
-
const paddingStyle = vue.computed(() => {
|
|
83
|
-
|
|
84
|
-
return {
|
|
85
|
-
padding: `${props.padding.map((p) => `${p}px`).join(" ")}`
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
return { padding: `${props.padding}px` };
|
|
89
|
-
});
|
|
90
|
-
const radiusStyle = vue.computed(() => ({
|
|
91
|
-
borderRadius: `${props.radius}px`
|
|
92
|
-
}));
|
|
105
|
+
const paddingStyle = vue.computed(() => ({ padding: toCssBox(props.padding) }));
|
|
106
|
+
const radiusStyle = vue.computed(() => ({ borderRadius: toCssLength(props.radius) }));
|
|
93
107
|
return (_ctx, _cache) => {
|
|
94
108
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
95
109
|
class: vue.normalizeClass(["tao-block", { "tao-block--shadow": __props.shadow, "tao-block--hover": __props.hover }]),
|
|
@@ -100,20 +114,57 @@
|
|
|
100
114
|
};
|
|
101
115
|
}
|
|
102
116
|
});
|
|
103
|
-
const TaoBlock = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["__scopeId", "data-v-
|
|
117
|
+
const TaoBlock = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["__scopeId", "data-v-9f97afe2"]]);
|
|
104
118
|
const formFieldKey = Symbol("taoFormField");
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
119
|
+
function isDev() {
|
|
120
|
+
try {
|
|
121
|
+
return process.env.NODE_ENV !== "production";
|
|
122
|
+
} catch {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
const warned = /* @__PURE__ */ new Set();
|
|
127
|
+
function deprecationWarning(component, what, instead) {
|
|
128
|
+
if (!isDev()) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
const key = `${component}:${what}`;
|
|
132
|
+
if (warned.has(key)) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
warned.add(key);
|
|
136
|
+
console.warn(`[TaoUI] ${component}: ${what} is deprecated — ${instead}. It will be removed in 3.0.`);
|
|
137
|
+
}
|
|
138
|
+
function warnDeprecated(component, replacements) {
|
|
139
|
+
var _a;
|
|
140
|
+
if (!isDev()) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
const passed = (_a = vue.getCurrentInstance()) == null ? void 0 : _a.vnode.props;
|
|
144
|
+
if (!passed) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const names = new Set(Object.keys(passed).map((name) => vue.camelize(name)));
|
|
148
|
+
for (const [name, instead] of Object.entries(replacements)) {
|
|
149
|
+
if (!names.has(name)) {
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
const isListener = /^on[A-Z]/.test(name);
|
|
153
|
+
const label = isListener ? `event "${name[2].toLowerCase()}${name.slice(3)}"` : `prop "${name}"`;
|
|
154
|
+
deprecationWarning(component, label, instead);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
const _hoisted_1$O = ["for"];
|
|
158
|
+
const _hoisted_2$H = {
|
|
108
159
|
key: 0,
|
|
109
160
|
class: "tao-input__affix tao-input__affix--prefix"
|
|
110
161
|
};
|
|
111
|
-
const
|
|
112
|
-
const
|
|
162
|
+
const _hoisted_3$y = ["id", "type", "value", "placeholder", "disabled", "aria-invalid", "aria-describedby"];
|
|
163
|
+
const _hoisted_4$t = {
|
|
113
164
|
key: 1,
|
|
114
165
|
class: "tao-input__affix tao-input__affix--suffix"
|
|
115
166
|
};
|
|
116
|
-
const
|
|
167
|
+
const _hoisted_5$m = {
|
|
117
168
|
key: 1,
|
|
118
169
|
class: "tao-input__error"
|
|
119
170
|
};
|
|
@@ -125,6 +176,7 @@
|
|
|
125
176
|
type: { default: "text" },
|
|
126
177
|
placeholder: { default: "" },
|
|
127
178
|
disabled: { type: Boolean, default: false },
|
|
179
|
+
size: {},
|
|
128
180
|
error: { type: Boolean, default: false },
|
|
129
181
|
errorMessage: { default: "" },
|
|
130
182
|
label: { default: "" },
|
|
@@ -152,13 +204,19 @@
|
|
|
152
204
|
focused.value = true;
|
|
153
205
|
emit("focus", event);
|
|
154
206
|
}
|
|
207
|
+
warnDeprecated("TaoInput", {
|
|
208
|
+
label: "use `label` of TaoFormField",
|
|
209
|
+
errorMessage: "use `error` of TaoFormField"
|
|
210
|
+
});
|
|
155
211
|
return (_ctx, _cache) => {
|
|
156
|
-
return vue.openBlock(), vue.createElementBlock("div",
|
|
212
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
213
|
+
class: vue.normalizeClass(["tao-input-wrapper", vue.unref(sizeClass)(__props.size)])
|
|
214
|
+
}, [
|
|
157
215
|
__props.label && !vue.unref(field) ? (vue.openBlock(), vue.createElementBlock("label", {
|
|
158
216
|
key: 0,
|
|
159
217
|
class: "tao-input__label",
|
|
160
218
|
for: controlId.value
|
|
161
|
-
}, vue.toDisplayString(__props.label), 9,
|
|
219
|
+
}, vue.toDisplayString(__props.label), 9, _hoisted_1$O)) : vue.createCommentVNode("", true),
|
|
162
220
|
vue.createElementVNode("div", {
|
|
163
221
|
class: vue.normalizeClass(["tao-input-shell", {
|
|
164
222
|
"tao-input-shell--focused": focused.value,
|
|
@@ -168,7 +226,7 @@
|
|
|
168
226
|
"tao-input-shell--suffix": _ctx.$slots.suffix
|
|
169
227
|
}])
|
|
170
228
|
}, [
|
|
171
|
-
_ctx.$slots.prefix ? (vue.openBlock(), vue.createElementBlock("span",
|
|
229
|
+
_ctx.$slots.prefix ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$H, [
|
|
172
230
|
vue.renderSlot(_ctx.$slots, "prefix", {}, void 0, true)
|
|
173
231
|
])) : vue.createCommentVNode("", true),
|
|
174
232
|
vue.createElementVNode("input", {
|
|
@@ -183,29 +241,32 @@
|
|
|
183
241
|
onInput: handleInput,
|
|
184
242
|
onBlur: handleBlur,
|
|
185
243
|
onFocus: handleFocus
|
|
186
|
-
}, null, 42,
|
|
187
|
-
_ctx.$slots.suffix ? (vue.openBlock(), vue.createElementBlock("span",
|
|
244
|
+
}, null, 42, _hoisted_3$y),
|
|
245
|
+
_ctx.$slots.suffix ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$t, [
|
|
188
246
|
vue.renderSlot(_ctx.$slots, "suffix", {}, void 0, true)
|
|
189
247
|
])) : vue.createCommentVNode("", true)
|
|
190
248
|
], 2),
|
|
191
|
-
__props.error && __props.errorMessage ? (vue.openBlock(), vue.createElementBlock("span",
|
|
192
|
-
]);
|
|
249
|
+
__props.error && __props.errorMessage ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5$m, vue.toDisplayString(__props.errorMessage), 1)) : vue.createCommentVNode("", true)
|
|
250
|
+
], 2);
|
|
193
251
|
};
|
|
194
252
|
}
|
|
195
253
|
});
|
|
196
|
-
const TaoInput = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__scopeId", "data-v-
|
|
254
|
+
const TaoInput = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__scopeId", "data-v-aca887be"]]);
|
|
197
255
|
const _hoisted_1$N = {
|
|
198
256
|
key: 0,
|
|
199
257
|
class: "tao-input-group__addon tao-input-group__addon--before"
|
|
200
258
|
};
|
|
201
259
|
const _hoisted_2$G = { class: "tao-input-group__field" };
|
|
202
|
-
const _hoisted_3$
|
|
260
|
+
const _hoisted_3$x = {
|
|
203
261
|
key: 1,
|
|
204
262
|
class: "tao-input-group__addon tao-input-group__addon--after"
|
|
205
263
|
};
|
|
206
264
|
const _sfc_main$W = /* @__PURE__ */ vue.defineComponent({
|
|
207
265
|
...{ name: "TaoInputGroup" },
|
|
208
266
|
__name: "TaoInputGroup",
|
|
267
|
+
props: {
|
|
268
|
+
size: {}
|
|
269
|
+
},
|
|
209
270
|
setup(__props) {
|
|
210
271
|
const focused = vue.ref(false);
|
|
211
272
|
function onFocusIn() {
|
|
@@ -220,7 +281,7 @@
|
|
|
220
281
|
}
|
|
221
282
|
return (_ctx, _cache) => {
|
|
222
283
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
223
|
-
class: vue.normalizeClass(["tao-input-group", { "tao-input-group--focused": focused.value }]),
|
|
284
|
+
class: vue.normalizeClass(["tao-input-group", [vue.unref(sizeClass)(__props.size), { "tao-input-group--focused": focused.value }]]),
|
|
224
285
|
role: "group",
|
|
225
286
|
onFocusin: onFocusIn,
|
|
226
287
|
onFocusout: onFocusOut
|
|
@@ -231,21 +292,340 @@
|
|
|
231
292
|
vue.createElementVNode("div", _hoisted_2$G, [
|
|
232
293
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
233
294
|
]),
|
|
234
|
-
_ctx.$slots.after ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$
|
|
295
|
+
_ctx.$slots.after ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$x, [
|
|
235
296
|
vue.renderSlot(_ctx.$slots, "after", {}, void 0, true)
|
|
236
297
|
])) : vue.createCommentVNode("", true)
|
|
237
298
|
], 34);
|
|
238
299
|
};
|
|
239
300
|
}
|
|
240
301
|
});
|
|
241
|
-
const TaoInputGroup = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["__scopeId", "data-v-
|
|
302
|
+
const TaoInputGroup = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["__scopeId", "data-v-55b2d297"]]);
|
|
303
|
+
const localeRu = {
|
|
304
|
+
code: "ru-RU",
|
|
305
|
+
alert: { closeLabel: "Закрыть" },
|
|
306
|
+
avatar: {
|
|
307
|
+
fallbackLabel: "Аватар",
|
|
308
|
+
notificationsLabel: "{count} уведомлений",
|
|
309
|
+
dotLabels: {
|
|
310
|
+
success: "в сети",
|
|
311
|
+
danger: "занят",
|
|
312
|
+
warning: "отошёл",
|
|
313
|
+
info: "статус",
|
|
314
|
+
neutral: "не в сети"
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
breadcrumb: { ariaLabel: "Хлебные крошки" },
|
|
318
|
+
carousel: {
|
|
319
|
+
ariaLabel: "Лента",
|
|
320
|
+
prevLabel: "Назад",
|
|
321
|
+
nextLabel: "Вперёд",
|
|
322
|
+
dotsLabel: "Слайды",
|
|
323
|
+
slideLabel: "Слайд {n} из {count}"
|
|
324
|
+
},
|
|
325
|
+
combobox: {
|
|
326
|
+
placeholder: "Начните вводить",
|
|
327
|
+
emptyText: "Ничего не найдено",
|
|
328
|
+
clearText: "Очистить",
|
|
329
|
+
createText: "Добавить «{text}»"
|
|
330
|
+
},
|
|
331
|
+
confirm: { ok: "ОК", cancel: "Отмена" },
|
|
332
|
+
copy: { copyLabel: "Копировать", successText: "Скопировано!" },
|
|
333
|
+
date: {
|
|
334
|
+
placeholder: "Дата",
|
|
335
|
+
todayText: "Сегодня",
|
|
336
|
+
clearText: "Очистить",
|
|
337
|
+
prevMonthLabel: "Предыдущий месяц",
|
|
338
|
+
nextMonthLabel: "Следующий месяц"
|
|
339
|
+
},
|
|
340
|
+
dateRange: {
|
|
341
|
+
placeholder: "Период",
|
|
342
|
+
todayText: "Сегодня",
|
|
343
|
+
clearText: "Очистить",
|
|
344
|
+
prevMonthLabel: "Предыдущий месяц",
|
|
345
|
+
nextMonthLabel: "Следующий месяц"
|
|
346
|
+
},
|
|
347
|
+
drawer: { closeLabel: "Закрыть" },
|
|
348
|
+
dropdownMenu: { menuLabel: "Меню" },
|
|
349
|
+
empty: { title: "Ничего нет" },
|
|
350
|
+
fileDrop: {
|
|
351
|
+
clearLabel: "Очистить файлы",
|
|
352
|
+
removeLabel: "Убрать «{name}»",
|
|
353
|
+
zoneText: "Перетащите файл сюда или нажмите, чтобы выбрать",
|
|
354
|
+
units: ["Б", "КБ", "МБ"],
|
|
355
|
+
decimalSeparator: ","
|
|
356
|
+
},
|
|
357
|
+
inputNumber: { incrementLabel: "Увеличить", decrementLabel: "Уменьшить" },
|
|
358
|
+
list: { emptyText: "Ничего нет" },
|
|
359
|
+
modal: { closeLabel: "Закрыть" },
|
|
360
|
+
pagination: {
|
|
361
|
+
ariaLabel: "Пагинация",
|
|
362
|
+
prevLabel: "Назад",
|
|
363
|
+
nextLabel: "Вперёд",
|
|
364
|
+
pageLabel: "Страница {page}",
|
|
365
|
+
jumpPrevLabel: "Назад на {n} страниц",
|
|
366
|
+
jumpNextLabel: "Вперёд на {n} страниц",
|
|
367
|
+
totalText: "{from}–{to} из {total}",
|
|
368
|
+
emptyTotalText: "0 из 0"
|
|
369
|
+
},
|
|
370
|
+
quantity: { decrementLabel: "Уменьшить", removeLabel: "Убрать", incrementLabel: "Увеличить" },
|
|
371
|
+
scrollTop: { ariaLabel: "Наверх" },
|
|
372
|
+
select: { placeholder: "Выберите", clearText: "Очистить" },
|
|
373
|
+
stages: {
|
|
374
|
+
ariaLabel: "Стадии",
|
|
375
|
+
statusLabels: { wait: "ожидание", work: "в работе", ok: "готово", bad: "ошибка" }
|
|
376
|
+
},
|
|
377
|
+
table: { emptyText: "Нет данных" },
|
|
378
|
+
tag: { closeLabel: "Убрать" },
|
|
379
|
+
toast: { closeLabel: "Закрыть уведомление" }
|
|
380
|
+
};
|
|
381
|
+
const confirmDefaults = {
|
|
382
|
+
ok: localeRu.confirm.ok,
|
|
383
|
+
cancel: localeRu.confirm.cancel
|
|
384
|
+
};
|
|
385
|
+
const currentConfirm = vue.ref(null);
|
|
386
|
+
const queue = [];
|
|
387
|
+
function configureConfirmDefaults(partial) {
|
|
388
|
+
Object.assign(confirmDefaults, partial);
|
|
389
|
+
}
|
|
390
|
+
function pump() {
|
|
391
|
+
if (currentConfirm.value) {
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
currentConfirm.value = queue.shift() ?? null;
|
|
395
|
+
}
|
|
396
|
+
function enqueueConfirm(record) {
|
|
397
|
+
queue.push(record);
|
|
398
|
+
pump();
|
|
399
|
+
}
|
|
400
|
+
function resolveConfirm(value) {
|
|
401
|
+
const item = currentConfirm.value;
|
|
402
|
+
if (!item) {
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
currentConfirm.value = null;
|
|
406
|
+
item.resolve(value);
|
|
407
|
+
pump();
|
|
408
|
+
}
|
|
409
|
+
let viewportMounts$1 = 0;
|
|
410
|
+
function registerConfirmHost() {
|
|
411
|
+
viewportMounts$1 += 1;
|
|
412
|
+
}
|
|
413
|
+
function unregisterConfirmHost() {
|
|
414
|
+
viewportMounts$1 = Math.max(0, viewportMounts$1 - 1);
|
|
415
|
+
}
|
|
416
|
+
function hasConfirmHost() {
|
|
417
|
+
if (viewportMounts$1 > 0) {
|
|
418
|
+
return true;
|
|
419
|
+
}
|
|
420
|
+
if (typeof document === "undefined") {
|
|
421
|
+
return false;
|
|
422
|
+
}
|
|
423
|
+
return Boolean(document.querySelector("[data-tao-confirm-host]"));
|
|
424
|
+
}
|
|
425
|
+
const TOAST_POSITIONS = [
|
|
426
|
+
"topRight",
|
|
427
|
+
"topLeft",
|
|
428
|
+
"topCenter",
|
|
429
|
+
"bottomRight",
|
|
430
|
+
"bottomLeft",
|
|
431
|
+
"bottomCenter",
|
|
432
|
+
"center"
|
|
433
|
+
];
|
|
434
|
+
const toastDefaults = {
|
|
435
|
+
position: "topCenter",
|
|
436
|
+
timeout: 3e3,
|
|
437
|
+
closable: true,
|
|
438
|
+
progress: true,
|
|
439
|
+
closeLabel: localeRu.toast.closeLabel
|
|
440
|
+
};
|
|
441
|
+
const toasts = vue.ref([]);
|
|
442
|
+
const toastsByPosition = vue.computed(() => {
|
|
443
|
+
const grouped = {};
|
|
444
|
+
for (const position of TOAST_POSITIONS) {
|
|
445
|
+
grouped[position] = [];
|
|
446
|
+
}
|
|
447
|
+
for (const toast2 of toasts.value) {
|
|
448
|
+
grouped[toast2.position].push(toast2);
|
|
449
|
+
}
|
|
450
|
+
return grouped;
|
|
451
|
+
});
|
|
452
|
+
function configureToastDefaults(partial) {
|
|
453
|
+
Object.assign(toastDefaults, partial);
|
|
454
|
+
}
|
|
455
|
+
function addToast(record) {
|
|
456
|
+
if (record.displayMode === "once" && record.dedupeId) {
|
|
457
|
+
const exists = toasts.value.some((item) => item.dedupeId === record.dedupeId);
|
|
458
|
+
if (exists) {
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
if (record.displayMode === "replace" && record.dedupeId) {
|
|
463
|
+
toasts.value = toasts.value.filter((item) => item.dedupeId !== record.dedupeId);
|
|
464
|
+
}
|
|
465
|
+
toasts.value = [...toasts.value, record];
|
|
466
|
+
}
|
|
467
|
+
function removeToast(id) {
|
|
468
|
+
var _a;
|
|
469
|
+
const item = toasts.value.find((toast2) => toast2.id === id);
|
|
470
|
+
if (!item) {
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
toasts.value = toasts.value.filter((toast2) => toast2.id !== id);
|
|
474
|
+
(_a = item.onClosed) == null ? void 0 : _a.call(item);
|
|
475
|
+
}
|
|
476
|
+
function dismissToasts(id) {
|
|
477
|
+
if (id) {
|
|
478
|
+
removeToast(id);
|
|
479
|
+
return;
|
|
480
|
+
}
|
|
481
|
+
const items = toasts.value;
|
|
482
|
+
toasts.value = [];
|
|
483
|
+
items.forEach((item) => {
|
|
484
|
+
var _a;
|
|
485
|
+
return (_a = item.onClosed) == null ? void 0 : _a.call(item);
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
let viewportMounts = 0;
|
|
489
|
+
function registerToastViewport() {
|
|
490
|
+
viewportMounts += 1;
|
|
491
|
+
}
|
|
492
|
+
function unregisterToastViewport() {
|
|
493
|
+
viewportMounts = Math.max(0, viewportMounts - 1);
|
|
494
|
+
}
|
|
495
|
+
function hasToastViewport() {
|
|
496
|
+
if (viewportMounts > 0) {
|
|
497
|
+
return true;
|
|
498
|
+
}
|
|
499
|
+
if (typeof document === "undefined") {
|
|
500
|
+
return false;
|
|
501
|
+
}
|
|
502
|
+
return Boolean(document.querySelector("[data-tao-toast-viewport]"));
|
|
503
|
+
}
|
|
504
|
+
const localeEn = {
|
|
505
|
+
code: "en-US",
|
|
506
|
+
alert: { closeLabel: "Close" },
|
|
507
|
+
avatar: {
|
|
508
|
+
fallbackLabel: "Avatar",
|
|
509
|
+
notificationsLabel: "{count} notifications",
|
|
510
|
+
dotLabels: {
|
|
511
|
+
success: "online",
|
|
512
|
+
danger: "busy",
|
|
513
|
+
warning: "away",
|
|
514
|
+
info: "status",
|
|
515
|
+
neutral: "offline"
|
|
516
|
+
}
|
|
517
|
+
},
|
|
518
|
+
breadcrumb: { ariaLabel: "Breadcrumb" },
|
|
519
|
+
carousel: {
|
|
520
|
+
ariaLabel: "Carousel",
|
|
521
|
+
prevLabel: "Previous",
|
|
522
|
+
nextLabel: "Next",
|
|
523
|
+
dotsLabel: "Slides",
|
|
524
|
+
slideLabel: "Slide {n} of {count}"
|
|
525
|
+
},
|
|
526
|
+
combobox: {
|
|
527
|
+
placeholder: "Start typing",
|
|
528
|
+
emptyText: "Nothing found",
|
|
529
|
+
clearText: "Clear",
|
|
530
|
+
createText: "Add “{text}”"
|
|
531
|
+
},
|
|
532
|
+
confirm: { ok: "OK", cancel: "Cancel" },
|
|
533
|
+
copy: { copyLabel: "Copy", successText: "Copied!" },
|
|
534
|
+
date: {
|
|
535
|
+
placeholder: "Date",
|
|
536
|
+
todayText: "Today",
|
|
537
|
+
clearText: "Clear",
|
|
538
|
+
prevMonthLabel: "Previous month",
|
|
539
|
+
nextMonthLabel: "Next month"
|
|
540
|
+
},
|
|
541
|
+
dateRange: {
|
|
542
|
+
placeholder: "Period",
|
|
543
|
+
todayText: "Today",
|
|
544
|
+
clearText: "Clear",
|
|
545
|
+
prevMonthLabel: "Previous month",
|
|
546
|
+
nextMonthLabel: "Next month"
|
|
547
|
+
},
|
|
548
|
+
drawer: { closeLabel: "Close" },
|
|
549
|
+
dropdownMenu: { menuLabel: "Menu" },
|
|
550
|
+
empty: { title: "Nothing here" },
|
|
551
|
+
fileDrop: {
|
|
552
|
+
clearLabel: "Clear files",
|
|
553
|
+
removeLabel: "Remove “{name}”",
|
|
554
|
+
zoneText: "Drop a file here or click to choose",
|
|
555
|
+
units: ["B", "KB", "MB"],
|
|
556
|
+
decimalSeparator: "."
|
|
557
|
+
},
|
|
558
|
+
inputNumber: { incrementLabel: "Increase", decrementLabel: "Decrease" },
|
|
559
|
+
list: { emptyText: "Nothing here" },
|
|
560
|
+
modal: { closeLabel: "Close" },
|
|
561
|
+
pagination: {
|
|
562
|
+
ariaLabel: "Pagination",
|
|
563
|
+
prevLabel: "Previous",
|
|
564
|
+
nextLabel: "Next",
|
|
565
|
+
pageLabel: "Page {page}",
|
|
566
|
+
jumpPrevLabel: "Back {n} pages",
|
|
567
|
+
jumpNextLabel: "Forward {n} pages",
|
|
568
|
+
totalText: "{from}–{to} of {total}",
|
|
569
|
+
emptyTotalText: "0 of 0"
|
|
570
|
+
},
|
|
571
|
+
quantity: { decrementLabel: "Decrease", removeLabel: "Remove", incrementLabel: "Increase" },
|
|
572
|
+
scrollTop: { ariaLabel: "Back to top" },
|
|
573
|
+
select: { placeholder: "Select", clearText: "Clear" },
|
|
574
|
+
stages: {
|
|
575
|
+
ariaLabel: "Stages",
|
|
576
|
+
statusLabels: { wait: "pending", work: "in progress", ok: "done", bad: "failed" }
|
|
577
|
+
},
|
|
578
|
+
table: { emptyText: "No data" },
|
|
579
|
+
tag: { closeLabel: "Remove" },
|
|
580
|
+
toast: { closeLabel: "Close notification" }
|
|
581
|
+
};
|
|
582
|
+
const current = vue.shallowRef(localeRu);
|
|
583
|
+
function taoLocale() {
|
|
584
|
+
return current.value;
|
|
585
|
+
}
|
|
586
|
+
function isPlainObject(value) {
|
|
587
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
588
|
+
}
|
|
589
|
+
function merge(base, overrides) {
|
|
590
|
+
if (!isPlainObject(base) || !isPlainObject(overrides)) {
|
|
591
|
+
return overrides === void 0 ? base : overrides;
|
|
592
|
+
}
|
|
593
|
+
const out = { ...base };
|
|
594
|
+
for (const [key, value] of Object.entries(overrides)) {
|
|
595
|
+
if (value !== void 0) {
|
|
596
|
+
out[key] = merge(base[key], value);
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
return out;
|
|
600
|
+
}
|
|
601
|
+
function setTaoLocale(locale, base = localeRu) {
|
|
602
|
+
current.value = merge(base, locale);
|
|
603
|
+
configureToastDefaults({ closeLabel: current.value.toast.closeLabel });
|
|
604
|
+
configureConfirmDefaults({ ok: current.value.confirm.ok, cancel: current.value.confirm.cancel });
|
|
605
|
+
}
|
|
606
|
+
function useLocaleText(props, section) {
|
|
607
|
+
return vue.computed(() => {
|
|
608
|
+
const base = current.value[section];
|
|
609
|
+
const own = props;
|
|
610
|
+
const out = { ...base };
|
|
611
|
+
for (const key of Object.keys(base)) {
|
|
612
|
+
if (own[key] !== void 0) {
|
|
613
|
+
out[key] = own[key];
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
return out;
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
function formatText(template, values) {
|
|
620
|
+
return template.replace(/\{(\w+)\}/g, (match, key) => key in values ? String(values[key]) : match);
|
|
621
|
+
}
|
|
242
622
|
const _hoisted_1$M = ["id", "value", "placeholder", "disabled", "aria-invalid", "aria-describedby", "aria-valuenow", "aria-valuemin", "aria-valuemax"];
|
|
243
623
|
const _hoisted_2$F = {
|
|
244
624
|
key: 0,
|
|
245
625
|
class: "tao-input-number__steppers"
|
|
246
626
|
};
|
|
247
|
-
const _hoisted_3$
|
|
248
|
-
const _hoisted_4$
|
|
627
|
+
const _hoisted_3$w = ["aria-label", "disabled"];
|
|
628
|
+
const _hoisted_4$s = { "aria-hidden": "true" };
|
|
249
629
|
const _hoisted_5$l = ["aria-label", "disabled"];
|
|
250
630
|
const _hoisted_6$g = { "aria-hidden": "true" };
|
|
251
631
|
const _sfc_main$V = /* @__PURE__ */ vue.defineComponent({
|
|
@@ -258,19 +638,22 @@
|
|
|
258
638
|
step: { default: 1 },
|
|
259
639
|
precision: {},
|
|
260
640
|
disabled: { type: Boolean, default: false },
|
|
641
|
+
error: { type: Boolean, default: false },
|
|
642
|
+
size: {},
|
|
261
643
|
placeholder: { default: "" },
|
|
262
644
|
controls: { type: Boolean, default: true },
|
|
263
|
-
incrementLabel: {
|
|
264
|
-
decrementLabel: {
|
|
645
|
+
incrementLabel: {},
|
|
646
|
+
decrementLabel: {}
|
|
265
647
|
},
|
|
266
648
|
emits: ["update:modelValue", "commit", "blur", "focus"],
|
|
267
649
|
setup(__props, { emit: __emit }) {
|
|
268
650
|
const props = __props;
|
|
651
|
+
const l10n = useLocaleText(props, "inputNumber");
|
|
269
652
|
const emit = __emit;
|
|
270
653
|
const field = vue.inject(formFieldKey, null);
|
|
271
654
|
const localId = vue.useId();
|
|
272
655
|
const controlId = vue.computed(() => (field == null ? void 0 : field.id) ?? localId);
|
|
273
|
-
const invalid = vue.computed(() => Boolean(field == null ? void 0 : field.invalid.value));
|
|
656
|
+
const invalid = vue.computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
274
657
|
const describedBy = vue.computed(() => field == null ? void 0 : field.describedBy.value);
|
|
275
658
|
const focused = vue.ref(false);
|
|
276
659
|
const draft = vue.ref(toDraft(props.modelValue));
|
|
@@ -382,7 +765,7 @@
|
|
|
382
765
|
const atMax = vue.computed(() => props.max !== void 0 && (props.modelValue ?? 0) >= props.max);
|
|
383
766
|
return (_ctx, _cache) => {
|
|
384
767
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
385
|
-
class: vue.normalizeClass(["tao-input-number", { "tao-input-number--invalid": invalid.value, "tao-input-number--controls": __props.controls }])
|
|
768
|
+
class: vue.normalizeClass(["tao-input-number", [vue.unref(sizeClass)(__props.size), { "tao-input-number--invalid": invalid.value, "tao-input-number--controls": __props.controls }]])
|
|
386
769
|
}, [
|
|
387
770
|
vue.createElementVNode("input", {
|
|
388
771
|
id: controlId.value,
|
|
@@ -408,21 +791,21 @@
|
|
|
408
791
|
vue.createElementVNode("button", {
|
|
409
792
|
type: "button",
|
|
410
793
|
class: "tao-input-number__step",
|
|
411
|
-
"aria-label":
|
|
794
|
+
"aria-label": vue.unref(l10n).incrementLabel,
|
|
412
795
|
tabindex: "-1",
|
|
413
796
|
disabled: __props.disabled || atMax.value,
|
|
414
797
|
onClick: _cache[0] || (_cache[0] = ($event) => bump(1))
|
|
415
798
|
}, [
|
|
416
|
-
vue.createElementVNode("span", _hoisted_4$
|
|
799
|
+
vue.createElementVNode("span", _hoisted_4$s, [
|
|
417
800
|
vue.renderSlot(_ctx.$slots, "increment-icon", {}, () => [
|
|
418
801
|
_cache[2] || (_cache[2] = vue.createTextVNode("+", -1))
|
|
419
802
|
], true)
|
|
420
803
|
])
|
|
421
|
-
], 8, _hoisted_3$
|
|
804
|
+
], 8, _hoisted_3$w),
|
|
422
805
|
vue.createElementVNode("button", {
|
|
423
806
|
type: "button",
|
|
424
807
|
class: "tao-input-number__step",
|
|
425
|
-
"aria-label":
|
|
808
|
+
"aria-label": vue.unref(l10n).decrementLabel,
|
|
426
809
|
tabindex: "-1",
|
|
427
810
|
disabled: __props.disabled || atMin.value,
|
|
428
811
|
onClick: _cache[1] || (_cache[1] = ($event) => bump(-1))
|
|
@@ -438,11 +821,11 @@
|
|
|
438
821
|
};
|
|
439
822
|
}
|
|
440
823
|
});
|
|
441
|
-
const TaoInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["__scopeId", "data-v-
|
|
824
|
+
const TaoInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["__scopeId", "data-v-52c1f25a"]]);
|
|
442
825
|
const _hoisted_1$L = ["aria-label", "disabled"];
|
|
443
826
|
const _hoisted_2$E = { "aria-hidden": "true" };
|
|
444
|
-
const _hoisted_3$
|
|
445
|
-
const _hoisted_4$
|
|
827
|
+
const _hoisted_3$v = ["id", "value", "disabled", "aria-invalid", "aria-describedby", "aria-valuenow", "aria-valuemin", "aria-valuemax"];
|
|
828
|
+
const _hoisted_4$r = ["aria-label", "disabled"];
|
|
446
829
|
const _hoisted_5$k = { "aria-hidden": "true" };
|
|
447
830
|
const _sfc_main$U = /* @__PURE__ */ vue.defineComponent({
|
|
448
831
|
...{ name: "TaoQuantity" },
|
|
@@ -452,20 +835,23 @@
|
|
|
452
835
|
min: { default: 1 },
|
|
453
836
|
max: {},
|
|
454
837
|
disabled: { type: Boolean, default: false },
|
|
838
|
+
error: { type: Boolean, default: false },
|
|
839
|
+
size: {},
|
|
455
840
|
allowRemove: { type: Boolean, default: true },
|
|
456
841
|
forceMaxLimit: { type: Boolean, default: true },
|
|
457
|
-
decrementLabel: {
|
|
458
|
-
removeLabel: {
|
|
459
|
-
incrementLabel: {
|
|
842
|
+
decrementLabel: {},
|
|
843
|
+
removeLabel: {},
|
|
844
|
+
incrementLabel: {}
|
|
460
845
|
},
|
|
461
846
|
emits: ["update:modelValue", "change", "dec", "inc", "blur", "focus"],
|
|
462
847
|
setup(__props, { emit: __emit }) {
|
|
463
848
|
const props = __props;
|
|
849
|
+
const l10n = useLocaleText(props, "quantity");
|
|
464
850
|
const emit = __emit;
|
|
465
851
|
const field = vue.inject(formFieldKey, null);
|
|
466
852
|
const localId = vue.useId();
|
|
467
853
|
const controlId = vue.computed(() => (field == null ? void 0 : field.id) ?? localId);
|
|
468
|
-
const invalid = vue.computed(() => Boolean(field == null ? void 0 : field.invalid.value));
|
|
854
|
+
const invalid = vue.computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
469
855
|
const describedBy = vue.computed(() => field == null ? void 0 : field.describedBy.value);
|
|
470
856
|
const focused = vue.ref(false);
|
|
471
857
|
const draft = vue.ref(String(props.modelValue));
|
|
@@ -565,14 +951,17 @@
|
|
|
565
951
|
const atMax = vue.computed(() => props.modelValue >= ceiling.value);
|
|
566
952
|
const minusDisabled = vue.computed(() => props.disabled || !props.allowRemove && atMin.value);
|
|
567
953
|
const plusDisabled = vue.computed(() => props.disabled || atMax.value);
|
|
568
|
-
const minusLabel = vue.computed(() => atMin.value && props.allowRemove ?
|
|
954
|
+
const minusLabel = vue.computed(() => atMin.value && props.allowRemove ? l10n.value.removeLabel : l10n.value.decrementLabel);
|
|
569
955
|
return (_ctx, _cache) => {
|
|
570
956
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
571
|
-
class: vue.normalizeClass(["tao-quantity",
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
957
|
+
class: vue.normalizeClass(["tao-quantity", [
|
|
958
|
+
vue.unref(sizeClass)(__props.size),
|
|
959
|
+
{
|
|
960
|
+
"tao-quantity--invalid": invalid.value,
|
|
961
|
+
"tao-quantity--focused": focused.value,
|
|
962
|
+
"tao-quantity--disabled": __props.disabled
|
|
963
|
+
}
|
|
964
|
+
]])
|
|
576
965
|
}, [
|
|
577
966
|
vue.createElementVNode("button", {
|
|
578
967
|
type: "button",
|
|
@@ -606,11 +995,11 @@
|
|
|
606
995
|
onFocus,
|
|
607
996
|
onBlur,
|
|
608
997
|
onKeydown
|
|
609
|
-
}, null, 40, _hoisted_3$
|
|
998
|
+
}, null, 40, _hoisted_3$v),
|
|
610
999
|
vue.createElementVNode("button", {
|
|
611
1000
|
type: "button",
|
|
612
1001
|
class: "tao-quantity__btn tao-quantity__btn--inc",
|
|
613
|
-
"aria-label":
|
|
1002
|
+
"aria-label": vue.unref(l10n).incrementLabel,
|
|
614
1003
|
disabled: plusDisabled.value,
|
|
615
1004
|
onClick: onInc
|
|
616
1005
|
}, [
|
|
@@ -619,12 +1008,12 @@
|
|
|
619
1008
|
_cache[1] || (_cache[1] = vue.createTextVNode("+", -1))
|
|
620
1009
|
], true)
|
|
621
1010
|
])
|
|
622
|
-
], 8, _hoisted_4$
|
|
1011
|
+
], 8, _hoisted_4$r)
|
|
623
1012
|
], 2);
|
|
624
1013
|
};
|
|
625
1014
|
}
|
|
626
1015
|
});
|
|
627
|
-
const TaoQuantity = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["__scopeId", "data-v-
|
|
1016
|
+
const TaoQuantity = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["__scopeId", "data-v-e27165e3"]]);
|
|
628
1017
|
const _hoisted_1$K = {
|
|
629
1018
|
key: 0,
|
|
630
1019
|
class: "tao-card__cover"
|
|
@@ -633,11 +1022,11 @@
|
|
|
633
1022
|
key: 0,
|
|
634
1023
|
class: "tao-card__overlay"
|
|
635
1024
|
};
|
|
636
|
-
const _hoisted_3$
|
|
1025
|
+
const _hoisted_3$u = {
|
|
637
1026
|
key: 1,
|
|
638
1027
|
class: "tao-card__overlay"
|
|
639
1028
|
};
|
|
640
|
-
const _hoisted_4$
|
|
1029
|
+
const _hoisted_4$q = {
|
|
641
1030
|
key: 0,
|
|
642
1031
|
class: "tao-card__header-title"
|
|
643
1032
|
};
|
|
@@ -658,7 +1047,7 @@
|
|
|
658
1047
|
key: 3,
|
|
659
1048
|
class: "tao-card__body"
|
|
660
1049
|
};
|
|
661
|
-
const _hoisted_10$
|
|
1050
|
+
const _hoisted_10$4 = {
|
|
662
1051
|
key: 4,
|
|
663
1052
|
class: "tao-card__footer"
|
|
664
1053
|
};
|
|
@@ -686,12 +1075,9 @@
|
|
|
686
1075
|
if (props.flush) {
|
|
687
1076
|
return { padding: "0" };
|
|
688
1077
|
}
|
|
689
|
-
|
|
690
|
-
return { padding: `${props.padding.map((p) => `${p}px`).join(" ")}` };
|
|
691
|
-
}
|
|
692
|
-
return { padding: `${props.padding}px` };
|
|
1078
|
+
return { padding: toCssBox(props.padding) };
|
|
693
1079
|
});
|
|
694
|
-
const radiusStyle = vue.computed(() => ({ borderRadius:
|
|
1080
|
+
const radiusStyle = vue.computed(() => ({ borderRadius: toCssLength(props.radius) }));
|
|
695
1081
|
const showPanelShadow = vue.computed(() => props.shadow && !props.shadowBottomOnly && !props.flush);
|
|
696
1082
|
return (_ctx, _cache) => {
|
|
697
1083
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
@@ -711,7 +1097,7 @@
|
|
|
711
1097
|
_ctx.$slots.overlay ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$D, [
|
|
712
1098
|
vue.renderSlot(_ctx.$slots, "overlay", {}, void 0, true)
|
|
713
1099
|
])) : vue.createCommentVNode("", true)
|
|
714
|
-
])) : _ctx.$slots.overlay ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$
|
|
1100
|
+
])) : _ctx.$slots.overlay ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$u, [
|
|
715
1101
|
vue.renderSlot(_ctx.$slots, "overlay", {}, void 0, true)
|
|
716
1102
|
])) : vue.createCommentVNode("", true),
|
|
717
1103
|
hasContent.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
@@ -719,7 +1105,7 @@
|
|
|
719
1105
|
class: "tao-card__content",
|
|
720
1106
|
style: vue.normalizeStyle(paddingStyle.value)
|
|
721
1107
|
}, [
|
|
722
|
-
_ctx.$slots.headerTitle ? (vue.openBlock(), vue.createElementBlock("h2", _hoisted_4$
|
|
1108
|
+
_ctx.$slots.headerTitle ? (vue.openBlock(), vue.createElementBlock("h2", _hoisted_4$q, [
|
|
723
1109
|
vue.renderSlot(_ctx.$slots, "headerTitle", {}, void 0, true)
|
|
724
1110
|
])) : vue.createCommentVNode("", true),
|
|
725
1111
|
_ctx.$slots.header || _ctx.$slots.headerSecondary ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
@@ -744,7 +1130,7 @@
|
|
|
744
1130
|
_ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$5, [
|
|
745
1131
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
746
1132
|
])) : vue.createCommentVNode("", true),
|
|
747
|
-
_ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$
|
|
1133
|
+
_ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$4, [
|
|
748
1134
|
vue.renderSlot(_ctx.$slots, "footer", {}, void 0, true)
|
|
749
1135
|
])) : vue.createCommentVNode("", true)
|
|
750
1136
|
], 4)) : vue.createCommentVNode("", true)
|
|
@@ -752,7 +1138,7 @@
|
|
|
752
1138
|
};
|
|
753
1139
|
}
|
|
754
1140
|
});
|
|
755
|
-
const TaoCard = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-
|
|
1141
|
+
const TaoCard = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-00d63b5f"]]);
|
|
756
1142
|
const FOCUSABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
757
1143
|
function getFocusable(root) {
|
|
758
1144
|
return [...root.querySelectorAll(FOCUSABLE)].filter(
|
|
@@ -811,8 +1197,8 @@
|
|
|
811
1197
|
key: 0,
|
|
812
1198
|
class: "tao-modal__header"
|
|
813
1199
|
};
|
|
814
|
-
const _hoisted_3$
|
|
815
|
-
const _hoisted_4$
|
|
1200
|
+
const _hoisted_3$t = ["id"];
|
|
1201
|
+
const _hoisted_4$p = { key: 1 };
|
|
816
1202
|
const _hoisted_5$i = ["aria-label"];
|
|
817
1203
|
const _hoisted_6$e = { "aria-hidden": "true" };
|
|
818
1204
|
const _hoisted_7$b = { class: "tao-modal__content" };
|
|
@@ -827,11 +1213,12 @@
|
|
|
827
1213
|
modelValue: { type: Boolean },
|
|
828
1214
|
title: { default: "" },
|
|
829
1215
|
closable: { type: Boolean, default: true },
|
|
830
|
-
closeLabel: {
|
|
1216
|
+
closeLabel: {}
|
|
831
1217
|
},
|
|
832
1218
|
emits: ["update:modelValue", "close"],
|
|
833
1219
|
setup(__props, { emit: __emit }) {
|
|
834
1220
|
const props = __props;
|
|
1221
|
+
const l10n = useLocaleText(props, "modal");
|
|
835
1222
|
const emit = __emit;
|
|
836
1223
|
const panelRef = vue.ref(null);
|
|
837
1224
|
const titleId = vue.useId();
|
|
@@ -942,13 +1329,13 @@
|
|
|
942
1329
|
key: 0,
|
|
943
1330
|
id: vue.unref(titleId),
|
|
944
1331
|
class: "tao-modal__title"
|
|
945
|
-
}, vue.toDisplayString(__props.title), 9, _hoisted_3$
|
|
1332
|
+
}, vue.toDisplayString(__props.title), 9, _hoisted_3$t)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$p))
|
|
946
1333
|
], true),
|
|
947
1334
|
__props.closable ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
948
1335
|
key: 0,
|
|
949
1336
|
type: "button",
|
|
950
1337
|
class: "tao-modal__close",
|
|
951
|
-
"aria-label":
|
|
1338
|
+
"aria-label": vue.unref(l10n).closeLabel,
|
|
952
1339
|
onClick: close
|
|
953
1340
|
}, [
|
|
954
1341
|
vue.createElementVNode("span", _hoisted_6$e, [
|
|
@@ -973,24 +1360,29 @@
|
|
|
973
1360
|
};
|
|
974
1361
|
}
|
|
975
1362
|
});
|
|
976
|
-
const TaoModal = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
1363
|
+
const TaoModal = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-742274be"]]);
|
|
1364
|
+
function tabValue(tab) {
|
|
1365
|
+
return tab.value ?? tab.key;
|
|
1366
|
+
}
|
|
1367
|
+
const _hoisted_1$I = ["id", "aria-selected", "aria-controls", "tabindex", "disabled", "onClick"];
|
|
1368
|
+
const _hoisted_2$B = ["id", "aria-labelledby"];
|
|
980
1369
|
const _sfc_main$R = /* @__PURE__ */ vue.defineComponent({
|
|
981
1370
|
...{ name: "TaoTabs" },
|
|
982
1371
|
__name: "TaoTabs",
|
|
983
1372
|
props: {
|
|
984
|
-
|
|
1373
|
+
items: { default: void 0 },
|
|
1374
|
+
tabs: { default: void 0 },
|
|
985
1375
|
modelValue: {},
|
|
986
|
-
justify: { default: "" }
|
|
1376
|
+
justify: { default: "" },
|
|
1377
|
+
size: {}
|
|
987
1378
|
},
|
|
988
|
-
emits: ["update:modelValue"],
|
|
1379
|
+
emits: ["update:modelValue", "change"],
|
|
989
1380
|
setup(__props, { emit: __emit }) {
|
|
990
1381
|
const props = __props;
|
|
991
1382
|
const emit = __emit;
|
|
992
1383
|
const uid = vue.useId();
|
|
993
|
-
const
|
|
1384
|
+
const list = vue.computed(() => props.items ?? props.tabs ?? []);
|
|
1385
|
+
const enabledTabs = vue.computed(() => list.value.filter((tab) => !tab.disabled));
|
|
994
1386
|
function tabId(key) {
|
|
995
1387
|
return `${uid}-${key}`;
|
|
996
1388
|
}
|
|
@@ -998,9 +1390,12 @@
|
|
|
998
1390
|
return `${uid}-panel-${key}`;
|
|
999
1391
|
}
|
|
1000
1392
|
function selectTab(key, focus = false) {
|
|
1001
|
-
const tab =
|
|
1393
|
+
const tab = list.value.find((item) => tabValue(item) === key);
|
|
1002
1394
|
if (tab && !tab.disabled) {
|
|
1003
1395
|
emit("update:modelValue", key);
|
|
1396
|
+
if (key !== props.modelValue) {
|
|
1397
|
+
emit("change", key);
|
|
1398
|
+
}
|
|
1004
1399
|
if (focus) {
|
|
1005
1400
|
void vue.nextTick(() => {
|
|
1006
1401
|
var _a;
|
|
@@ -1014,12 +1409,11 @@
|
|
|
1014
1409
|
if (!enabled.length) {
|
|
1015
1410
|
return;
|
|
1016
1411
|
}
|
|
1017
|
-
const
|
|
1018
|
-
const next = enabled[(
|
|
1019
|
-
selectTab(next
|
|
1412
|
+
const current2 = enabled.findIndex((tab) => tabValue(tab) === props.modelValue);
|
|
1413
|
+
const next = enabled[(current2 + delta + enabled.length) % enabled.length];
|
|
1414
|
+
selectTab(tabValue(next), true);
|
|
1020
1415
|
}
|
|
1021
1416
|
function onKeydown(event) {
|
|
1022
|
-
var _a;
|
|
1023
1417
|
if (event.key === "ArrowRight" || event.key === "ArrowDown") {
|
|
1024
1418
|
event.preventDefault();
|
|
1025
1419
|
move(1);
|
|
@@ -1032,43 +1426,52 @@
|
|
|
1032
1426
|
}
|
|
1033
1427
|
if (event.key === "Home") {
|
|
1034
1428
|
event.preventDefault();
|
|
1035
|
-
|
|
1429
|
+
const first = enabledTabs.value[0];
|
|
1430
|
+
selectTab(first ? tabValue(first) : props.modelValue, true);
|
|
1036
1431
|
return;
|
|
1037
1432
|
}
|
|
1038
1433
|
if (event.key === "End") {
|
|
1039
1434
|
event.preventDefault();
|
|
1040
1435
|
const last = enabledTabs.value[enabledTabs.value.length - 1];
|
|
1041
|
-
selectTab(
|
|
1436
|
+
selectTab(last ? tabValue(last) : props.modelValue, true);
|
|
1042
1437
|
}
|
|
1043
1438
|
}
|
|
1439
|
+
warnDeprecated("TaoTabs", {
|
|
1440
|
+
tabs: "use `items` (with `value` instead of `key`)"
|
|
1441
|
+
});
|
|
1442
|
+
if (list.value.some((tab) => tab.key !== void 0)) {
|
|
1443
|
+
deprecationWarning("TaoTabs", "item `key`", "use item `value`");
|
|
1444
|
+
}
|
|
1044
1445
|
return (_ctx, _cache) => {
|
|
1045
|
-
return vue.openBlock(), vue.createElementBlock("div",
|
|
1446
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
1447
|
+
class: vue.normalizeClass(["tao-tabs", vue.unref(sizeClass)(__props.size)])
|
|
1448
|
+
}, [
|
|
1046
1449
|
vue.createElementVNode("div", {
|
|
1047
1450
|
class: "tao-tabs__list",
|
|
1048
1451
|
style: vue.normalizeStyle({ justifyContent: __props.justify || void 0 }),
|
|
1049
1452
|
role: "tablist",
|
|
1050
1453
|
onKeydown
|
|
1051
1454
|
}, [
|
|
1052
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(
|
|
1455
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(list.value, (tab) => {
|
|
1053
1456
|
return vue.openBlock(), vue.createElementBlock("button", {
|
|
1054
|
-
key: tab
|
|
1457
|
+
key: vue.unref(tabValue)(tab),
|
|
1055
1458
|
type: "button",
|
|
1056
1459
|
class: "tao-tabs__tab",
|
|
1057
1460
|
role: "tab",
|
|
1058
|
-
id: tabId(
|
|
1059
|
-
"aria-selected": tab
|
|
1060
|
-
"aria-controls": panelId(
|
|
1061
|
-
tabindex: tab
|
|
1461
|
+
id: tabId(vue.unref(tabValue)(tab)),
|
|
1462
|
+
"aria-selected": vue.unref(tabValue)(tab) === __props.modelValue,
|
|
1463
|
+
"aria-controls": panelId(vue.unref(tabValue)(tab)),
|
|
1464
|
+
tabindex: vue.unref(tabValue)(tab) === __props.modelValue ? 0 : -1,
|
|
1062
1465
|
disabled: tab.disabled,
|
|
1063
|
-
onClick: ($event) => selectTab(
|
|
1466
|
+
onClick: ($event) => selectTab(vue.unref(tabValue)(tab))
|
|
1064
1467
|
}, [
|
|
1065
1468
|
_ctx.$slots.label ? vue.renderSlot(_ctx.$slots, "label", {
|
|
1066
1469
|
text: tab.label,
|
|
1067
|
-
value: tab
|
|
1470
|
+
value: vue.unref(tabValue)(tab)
|
|
1068
1471
|
}, void 0, true, 0) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
1069
1472
|
vue.createTextVNode(vue.toDisplayString(tab.label), 1)
|
|
1070
1473
|
], 64))
|
|
1071
|
-
], 8,
|
|
1474
|
+
], 8, _hoisted_1$I);
|
|
1072
1475
|
}), 128))
|
|
1073
1476
|
], 36),
|
|
1074
1477
|
vue.createElementVNode("div", {
|
|
@@ -1078,12 +1481,12 @@
|
|
|
1078
1481
|
"aria-labelledby": tabId(__props.modelValue)
|
|
1079
1482
|
}, [
|
|
1080
1483
|
vue.renderSlot(_ctx.$slots, "default", { activeTab: __props.modelValue }, void 0, true)
|
|
1081
|
-
], 8,
|
|
1082
|
-
]);
|
|
1484
|
+
], 8, _hoisted_2$B)
|
|
1485
|
+
], 2);
|
|
1083
1486
|
};
|
|
1084
1487
|
}
|
|
1085
1488
|
});
|
|
1086
|
-
const TaoTabs = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["__scopeId", "data-v-
|
|
1489
|
+
const TaoTabs = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["__scopeId", "data-v-a9238d96"]]);
|
|
1087
1490
|
function listenFocusLoss(onLoss) {
|
|
1088
1491
|
function onVisibilityChange() {
|
|
1089
1492
|
if (document.hidden) {
|
|
@@ -1465,11 +1868,11 @@
|
|
|
1465
1868
|
const spoilerGroupKey = Symbol("taoSpoilerGroup");
|
|
1466
1869
|
const _hoisted_1$G = { class: "tao-spoiler" };
|
|
1467
1870
|
const _hoisted_2$A = ["aria-expanded", "aria-controls"];
|
|
1468
|
-
const _hoisted_3$
|
|
1871
|
+
const _hoisted_3$s = {
|
|
1469
1872
|
key: 0,
|
|
1470
1873
|
class: "tao-spoiler__title"
|
|
1471
1874
|
};
|
|
1472
|
-
const _hoisted_4$
|
|
1875
|
+
const _hoisted_4$o = ["id"];
|
|
1473
1876
|
const _hoisted_5$h = { class: "tao-spoiler__content-inner" };
|
|
1474
1877
|
const _sfc_main$O = /* @__PURE__ */ vue.defineComponent({
|
|
1475
1878
|
...{ name: "TaoSpoiler" },
|
|
@@ -1480,7 +1883,7 @@
|
|
|
1480
1883
|
modelValue: { type: Boolean, default: void 0 },
|
|
1481
1884
|
name: { default: void 0 }
|
|
1482
1885
|
},
|
|
1483
|
-
emits: ["update:modelValue"],
|
|
1886
|
+
emits: ["update:modelValue", "change"],
|
|
1484
1887
|
setup(__props, { emit: __emit }) {
|
|
1485
1888
|
const props = __props;
|
|
1486
1889
|
const emit = __emit;
|
|
@@ -1505,6 +1908,7 @@
|
|
|
1505
1908
|
internal.value = next;
|
|
1506
1909
|
}
|
|
1507
1910
|
emit("update:modelValue", next);
|
|
1911
|
+
emit("change", next);
|
|
1508
1912
|
}
|
|
1509
1913
|
function onBeforeEnter(el) {
|
|
1510
1914
|
el.style.height = "0";
|
|
@@ -1537,7 +1941,7 @@
|
|
|
1537
1941
|
vue.createElementVNode("span", {
|
|
1538
1942
|
class: vue.normalizeClass(["tao-spoiler__icon", { "tao-spoiler__icon--open": isOpen.value }])
|
|
1539
1943
|
}, "▶", 2),
|
|
1540
|
-
__props.title || _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$
|
|
1944
|
+
__props.title || _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$s, [
|
|
1541
1945
|
vue.renderSlot(_ctx.$slots, "title", {}, () => [
|
|
1542
1946
|
vue.createTextVNode(vue.toDisplayString(__props.title), 1)
|
|
1543
1947
|
], true)
|
|
@@ -1559,7 +1963,7 @@
|
|
|
1559
1963
|
vue.createElementVNode("div", _hoisted_5$h, [
|
|
1560
1964
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
1561
1965
|
])
|
|
1562
|
-
], 8, _hoisted_4$
|
|
1966
|
+
], 8, _hoisted_4$o)) : vue.createCommentVNode("", true)
|
|
1563
1967
|
]),
|
|
1564
1968
|
_: 3
|
|
1565
1969
|
})
|
|
@@ -1567,7 +1971,7 @@
|
|
|
1567
1971
|
};
|
|
1568
1972
|
}
|
|
1569
1973
|
});
|
|
1570
|
-
const TaoSpoiler = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["__scopeId", "data-v-
|
|
1974
|
+
const TaoSpoiler = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["__scopeId", "data-v-5a3147a2"]]);
|
|
1571
1975
|
const _hoisted_1$F = { class: "tao-spoiler-group" };
|
|
1572
1976
|
const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
|
|
1573
1977
|
...{ name: "TaoSpoilerGroup" },
|
|
@@ -1607,12 +2011,14 @@
|
|
|
1607
2011
|
__name: "TaoCopy",
|
|
1608
2012
|
props: {
|
|
1609
2013
|
text: {},
|
|
1610
|
-
|
|
1611
|
-
|
|
2014
|
+
successText: { default: void 0 },
|
|
2015
|
+
successMessage: { default: void 0 },
|
|
2016
|
+
copyLabel: {},
|
|
1612
2017
|
tip: { type: Boolean, default: true }
|
|
1613
2018
|
},
|
|
1614
2019
|
setup(__props) {
|
|
1615
2020
|
const props = __props;
|
|
2021
|
+
const l10n = useLocaleText(props, "copy");
|
|
1616
2022
|
const copied = vue.ref(false);
|
|
1617
2023
|
const triggerRef = vue.ref(null);
|
|
1618
2024
|
const tipRef = vue.ref(null);
|
|
@@ -1697,6 +2103,10 @@
|
|
|
1697
2103
|
visibleObserver == null ? void 0 : visibleObserver.disconnect();
|
|
1698
2104
|
visibleObserver = null;
|
|
1699
2105
|
});
|
|
2106
|
+
const doneText = vue.computed(() => props.successText ?? props.successMessage ?? taoLocale().copy.successText);
|
|
2107
|
+
warnDeprecated("TaoCopy", {
|
|
2108
|
+
successMessage: "use `successText`"
|
|
2109
|
+
});
|
|
1700
2110
|
return (_ctx, _cache) => {
|
|
1701
2111
|
return vue.openBlock(), vue.createElementBlock("span", {
|
|
1702
2112
|
ref_key: "triggerRef",
|
|
@@ -1710,7 +2120,7 @@
|
|
|
1710
2120
|
vue.createElementVNode("button", {
|
|
1711
2121
|
type: "button",
|
|
1712
2122
|
class: vue.normalizeClass(["tao-copy__button", { "tao-copy__button--copied": copied.value }]),
|
|
1713
|
-
"aria-label": copied.value ?
|
|
2123
|
+
"aria-label": copied.value ? doneText.value : vue.unref(l10n).copyLabel,
|
|
1714
2124
|
onClick: copy
|
|
1715
2125
|
}, [..._cache[0] || (_cache[0] = [
|
|
1716
2126
|
vue.createElementVNode("svg", {
|
|
@@ -1740,38 +2150,44 @@
|
|
|
1740
2150
|
])], 10, _hoisted_1$E)
|
|
1741
2151
|
], true),
|
|
1742
2152
|
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
1743
|
-
copied.value && __props.tip &&
|
|
2153
|
+
copied.value && __props.tip && doneText.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
1744
2154
|
key: 0,
|
|
1745
2155
|
ref_key: "tipRef",
|
|
1746
2156
|
ref: tipRef,
|
|
1747
2157
|
class: "tao-copy__tip",
|
|
1748
2158
|
role: "status",
|
|
1749
2159
|
style: vue.normalizeStyle(tipStyle.value)
|
|
1750
|
-
}, vue.toDisplayString(
|
|
2160
|
+
}, vue.toDisplayString(doneText.value), 5)) : vue.createCommentVNode("", true)
|
|
1751
2161
|
]))
|
|
1752
2162
|
], 2);
|
|
1753
2163
|
};
|
|
1754
2164
|
}
|
|
1755
2165
|
});
|
|
1756
|
-
const TaoCopy = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-
|
|
2166
|
+
const TaoCopy = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-16581b4e"]]);
|
|
1757
2167
|
const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
|
|
1758
2168
|
...{ name: "TaoContainer" },
|
|
1759
2169
|
__name: "TaoContainer",
|
|
1760
2170
|
props: {
|
|
1761
|
-
|
|
2171
|
+
width: {},
|
|
2172
|
+
size: {},
|
|
1762
2173
|
free: { type: Boolean, default: false }
|
|
1763
2174
|
},
|
|
1764
2175
|
setup(__props) {
|
|
2176
|
+
const props = __props;
|
|
2177
|
+
const resolvedWidth = vue.computed(() => props.width ?? props.size ?? "wide");
|
|
2178
|
+
warnDeprecated("TaoContainer", {
|
|
2179
|
+
size: "use `width`"
|
|
2180
|
+
});
|
|
1765
2181
|
return (_ctx, _cache) => {
|
|
1766
2182
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
1767
|
-
class: vue.normalizeClass(["tao-container", [`tao-container--${
|
|
2183
|
+
class: vue.normalizeClass(["tao-container", [`tao-container--${resolvedWidth.value}`, { "tao-container--center": !__props.free }]])
|
|
1768
2184
|
}, [
|
|
1769
2185
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
1770
2186
|
], 2);
|
|
1771
2187
|
};
|
|
1772
2188
|
}
|
|
1773
2189
|
});
|
|
1774
|
-
const TaoContainer = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-
|
|
2190
|
+
const TaoContainer = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-ef005f57"]]);
|
|
1775
2191
|
const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
|
|
1776
2192
|
...{ name: "TaoFlex" },
|
|
1777
2193
|
__name: "TaoFlex",
|
|
@@ -1792,7 +2208,7 @@
|
|
|
1792
2208
|
alignItems: __props.align,
|
|
1793
2209
|
flexDirection: __props.direction,
|
|
1794
2210
|
flexWrap: __props.wrap,
|
|
1795
|
-
gap: __props.gap
|
|
2211
|
+
gap: vue.unref(toCssLength)(__props.gap)
|
|
1796
2212
|
})
|
|
1797
2213
|
}, {
|
|
1798
2214
|
default: vue.withCtx(() => [
|
|
@@ -1809,13 +2225,18 @@
|
|
|
1809
2225
|
props: {
|
|
1810
2226
|
block: { type: Boolean, default: false },
|
|
1811
2227
|
expand: { type: Boolean, default: false },
|
|
2228
|
+
direction: { default: void 0 },
|
|
1812
2229
|
vertical: { type: Boolean, default: false }
|
|
1813
2230
|
},
|
|
1814
2231
|
setup(__props) {
|
|
1815
2232
|
const props = __props;
|
|
2233
|
+
const isColumn = vue.computed(() => (props.direction ?? (props.vertical ? "column" : "row")) === "column");
|
|
2234
|
+
warnDeprecated("TaoSpace", {
|
|
2235
|
+
vertical: 'use direction="column"'
|
|
2236
|
+
});
|
|
1816
2237
|
return (_ctx, _cache) => {
|
|
1817
2238
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
1818
|
-
class: vue.normalizeClass(["tao-space", { "tao-space--vertical":
|
|
2239
|
+
class: vue.normalizeClass(["tao-space", { "tao-space--vertical": isColumn.value }]),
|
|
1819
2240
|
style: vue.normalizeStyle([props.block ? "display: flex; flex-wrap: initial;" : "", props.expand ? "width: 100%" : ""])
|
|
1820
2241
|
}, [
|
|
1821
2242
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
@@ -1823,7 +2244,7 @@
|
|
|
1823
2244
|
};
|
|
1824
2245
|
}
|
|
1825
2246
|
});
|
|
1826
|
-
const TaoSpace = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["__scopeId", "data-v-
|
|
2247
|
+
const TaoSpace = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["__scopeId", "data-v-67c9d3a2"]]);
|
|
1827
2248
|
const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
|
|
1828
2249
|
...{ name: "TaoGrid" },
|
|
1829
2250
|
__name: "TaoGrid",
|
|
@@ -1836,9 +2257,9 @@
|
|
|
1836
2257
|
const props = __props;
|
|
1837
2258
|
const isFixed = vue.computed(() => props.cols > 0);
|
|
1838
2259
|
const gridStyle = vue.computed(() => ({
|
|
1839
|
-
"--tao-grid-min": props.min,
|
|
2260
|
+
"--tao-grid-min": toCssLength(props.min),
|
|
1840
2261
|
"--tao-grid-cols": isFixed.value ? String(props.cols) : void 0,
|
|
1841
|
-
"--tao-grid-gap": props.gap
|
|
2262
|
+
"--tao-grid-gap": toCssLength(props.gap)
|
|
1842
2263
|
}));
|
|
1843
2264
|
return (_ctx, _cache) => {
|
|
1844
2265
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
@@ -1850,7 +2271,7 @@
|
|
|
1850
2271
|
};
|
|
1851
2272
|
}
|
|
1852
2273
|
});
|
|
1853
|
-
const TaoGrid = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["__scopeId", "data-v-
|
|
2274
|
+
const TaoGrid = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["__scopeId", "data-v-5baa4944"]]);
|
|
1854
2275
|
const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
|
|
1855
2276
|
...{ name: "TaoGridItem" },
|
|
1856
2277
|
__name: "TaoGridItem",
|
|
@@ -1877,8 +2298,8 @@
|
|
|
1877
2298
|
const TaoGridItem = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["__scopeId", "data-v-ad288026"]]);
|
|
1878
2299
|
const _hoisted_1$D = { class: "tao-split__pane tao-split__pane--start" };
|
|
1879
2300
|
const _hoisted_2$z = ["aria-orientation", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-disabled", "tabindex"];
|
|
1880
|
-
const _hoisted_3$
|
|
1881
|
-
const _hoisted_4$
|
|
2301
|
+
const _hoisted_3$r = { class: "tao-split__pane tao-split__pane--end" };
|
|
2302
|
+
const _hoisted_4$n = {
|
|
1882
2303
|
key: 0,
|
|
1883
2304
|
class: "tao-split__shield"
|
|
1884
2305
|
};
|
|
@@ -1895,7 +2316,7 @@
|
|
|
1895
2316
|
resizable: { type: Boolean, default: true },
|
|
1896
2317
|
step: {}
|
|
1897
2318
|
},
|
|
1898
|
-
emits: ["update:modelValue"],
|
|
2319
|
+
emits: ["update:modelValue", "change"],
|
|
1899
2320
|
setup(__props, { emit: __emit }) {
|
|
1900
2321
|
const props = __props;
|
|
1901
2322
|
const emit = __emit;
|
|
@@ -1910,6 +2331,7 @@
|
|
|
1910
2331
|
const ariaOrientation = vue.computed(() => isRow.value ? "vertical" : "horizontal");
|
|
1911
2332
|
let dragPointer = -1;
|
|
1912
2333
|
let dragStartPx = 0;
|
|
2334
|
+
let dragStartValue = 0;
|
|
1913
2335
|
let dragStartCoord = 0;
|
|
1914
2336
|
let savedBodyCursor = "";
|
|
1915
2337
|
let savedHtmlCursor = "";
|
|
@@ -2019,6 +2441,9 @@
|
|
|
2019
2441
|
dragPointer = -1;
|
|
2020
2442
|
restoreDragCursor();
|
|
2021
2443
|
applyLayout(true);
|
|
2444
|
+
if (!valuesEqual(size.value, dragStartValue)) {
|
|
2445
|
+
emit("change", size.value);
|
|
2446
|
+
}
|
|
2022
2447
|
}
|
|
2023
2448
|
function setStartFromDelta(delta) {
|
|
2024
2449
|
const avail = measureAvailable();
|
|
@@ -2034,6 +2459,7 @@
|
|
|
2034
2459
|
dragPointer = event.pointerId;
|
|
2035
2460
|
isDragging.value = true;
|
|
2036
2461
|
dragStartPx = startPx.value;
|
|
2462
|
+
dragStartValue = size.value;
|
|
2037
2463
|
dragStartCoord = isRow.value ? event.clientX : event.clientY;
|
|
2038
2464
|
applyDragCursor();
|
|
2039
2465
|
event.preventDefault();
|
|
@@ -2081,6 +2507,13 @@
|
|
|
2081
2507
|
const ariaValueNow = vue.computed(() => size.value);
|
|
2082
2508
|
const ariaValueText = vue.computed(() => props.unit === "%" ? `${size.value}%` : `${Math.round(size.value)}px`);
|
|
2083
2509
|
function onKeydown(event) {
|
|
2510
|
+
const before = size.value;
|
|
2511
|
+
moveByKey(event);
|
|
2512
|
+
if (!valuesEqual(before, size.value)) {
|
|
2513
|
+
emit("change", size.value);
|
|
2514
|
+
}
|
|
2515
|
+
}
|
|
2516
|
+
function moveByKey(event) {
|
|
2084
2517
|
if (!props.resizable) {
|
|
2085
2518
|
return;
|
|
2086
2519
|
}
|
|
@@ -2191,15 +2624,15 @@
|
|
|
2191
2624
|
onDragstart: _cache[0] || (_cache[0] = vue.withModifiers(() => {
|
|
2192
2625
|
}, ["prevent"]))
|
|
2193
2626
|
}, null, 40, _hoisted_2$z),
|
|
2194
|
-
vue.createElementVNode("div", _hoisted_3$
|
|
2627
|
+
vue.createElementVNode("div", _hoisted_3$r, [
|
|
2195
2628
|
vue.renderSlot(_ctx.$slots, "end", {}, void 0, true)
|
|
2196
2629
|
]),
|
|
2197
|
-
isDragging.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$
|
|
2630
|
+
isDragging.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$n)) : vue.createCommentVNode("", true)
|
|
2198
2631
|
], 6);
|
|
2199
2632
|
};
|
|
2200
2633
|
}
|
|
2201
2634
|
});
|
|
2202
|
-
const TaoSplit = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-
|
|
2635
|
+
const TaoSplit = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-f34ab385"]]);
|
|
2203
2636
|
const _hoisted_1$C = { class: "tao-icon" };
|
|
2204
2637
|
const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
|
|
2205
2638
|
...{ name: "TaoIcon" },
|
|
@@ -2292,7 +2725,7 @@
|
|
|
2292
2725
|
const TaoLoader = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__scopeId", "data-v-49a9f1b2"]]);
|
|
2293
2726
|
const _hoisted_1$B = { class: "tao-image" };
|
|
2294
2727
|
const _hoisted_2$y = ["src", "alt", "loading"];
|
|
2295
|
-
const _hoisted_3$
|
|
2728
|
+
const _hoisted_3$q = { class: "tao-image__placeholder" };
|
|
2296
2729
|
const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
|
|
2297
2730
|
...{ name: "TaoImage" },
|
|
2298
2731
|
__name: "TaoImage",
|
|
@@ -2337,7 +2770,7 @@
|
|
|
2337
2770
|
onError: handleError
|
|
2338
2771
|
}, null, 42, _hoisted_2$y)) : vue.createCommentVNode("", true),
|
|
2339
2772
|
!__props.src || hasError.value ? vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
2340
|
-
vue.createElementVNode("div", _hoisted_3$
|
|
2773
|
+
vue.createElementVNode("div", _hoisted_3$q, vue.toDisplayString(__props.placeholderText), 1)
|
|
2341
2774
|
], true, 1) : vue.createCommentVNode("", true)
|
|
2342
2775
|
]);
|
|
2343
2776
|
};
|
|
@@ -2346,11 +2779,11 @@
|
|
|
2346
2779
|
const TaoImage = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-61f47c52"]]);
|
|
2347
2780
|
const _hoisted_1$A = ["for"];
|
|
2348
2781
|
const _hoisted_2$x = ["id", "checked", "disabled", "aria-checked", "aria-invalid", "aria-describedby"];
|
|
2349
|
-
const _hoisted_3$
|
|
2782
|
+
const _hoisted_3$p = {
|
|
2350
2783
|
key: 0,
|
|
2351
2784
|
class: "tao-checkbox__label"
|
|
2352
2785
|
};
|
|
2353
|
-
const _hoisted_4$
|
|
2786
|
+
const _hoisted_4$m = {
|
|
2354
2787
|
key: 1,
|
|
2355
2788
|
class: "tao-checkbox__label"
|
|
2356
2789
|
};
|
|
@@ -2359,9 +2792,11 @@
|
|
|
2359
2792
|
__name: "TaoCheckbox",
|
|
2360
2793
|
props: {
|
|
2361
2794
|
value: { type: Boolean, default: void 0 },
|
|
2795
|
+
checked: { type: Boolean, default: void 0 },
|
|
2362
2796
|
modelValue: { type: Boolean, default: void 0 },
|
|
2363
2797
|
label: { default: "" },
|
|
2364
2798
|
disabled: { type: Boolean, default: false },
|
|
2799
|
+
size: {},
|
|
2365
2800
|
error: { type: Boolean, default: false },
|
|
2366
2801
|
indeterminate: { type: Boolean, default: false }
|
|
2367
2802
|
},
|
|
@@ -2379,6 +2814,9 @@
|
|
|
2379
2814
|
if (props.modelValue !== void 0) {
|
|
2380
2815
|
return props.modelValue;
|
|
2381
2816
|
}
|
|
2817
|
+
if (props.checked !== void 0) {
|
|
2818
|
+
return props.checked;
|
|
2819
|
+
}
|
|
2382
2820
|
return Boolean(props.value);
|
|
2383
2821
|
},
|
|
2384
2822
|
set: (next) => {
|
|
@@ -2406,9 +2844,12 @@
|
|
|
2406
2844
|
},
|
|
2407
2845
|
{ flush: "post" }
|
|
2408
2846
|
);
|
|
2847
|
+
warnDeprecated("TaoCheckbox", {
|
|
2848
|
+
value: "use `checked` or v-model"
|
|
2849
|
+
});
|
|
2409
2850
|
return (_ctx, _cache) => {
|
|
2410
2851
|
return vue.openBlock(), vue.createElementBlock("label", {
|
|
2411
|
-
class: vue.normalizeClass(["tao-checkbox", { "tao-checkbox--disabled": __props.disabled }]),
|
|
2852
|
+
class: vue.normalizeClass(["tao-checkbox", [vue.unref(sizeClass)(__props.size), { "tao-checkbox--disabled": __props.disabled }]]),
|
|
2412
2853
|
for: controlId.value
|
|
2413
2854
|
}, [
|
|
2414
2855
|
vue.renderSlot(_ctx.$slots, "pre", { text: __props.label }, void 0, true),
|
|
@@ -2426,7 +2867,7 @@
|
|
|
2426
2867
|
onChange: onInputChange
|
|
2427
2868
|
}, null, 40, _hoisted_2$x),
|
|
2428
2869
|
_cache[0] || (_cache[0] = vue.createElementVNode("span", { class: "tao-checkbox__box" }, null, -1)),
|
|
2429
|
-
__props.label ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$
|
|
2870
|
+
__props.label ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$p, vue.toDisplayString(__props.label), 1)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$m, [
|
|
2430
2871
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
2431
2872
|
])),
|
|
2432
2873
|
vue.renderSlot(_ctx.$slots, "post", { text: __props.label }, void 0, true)
|
|
@@ -2434,33 +2875,40 @@
|
|
|
2434
2875
|
};
|
|
2435
2876
|
}
|
|
2436
2877
|
});
|
|
2437
|
-
const TaoCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-
|
|
2878
|
+
const TaoCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-13f6cd33"]]);
|
|
2438
2879
|
const _hoisted_1$z = {
|
|
2439
2880
|
key: 0,
|
|
2440
2881
|
class: "tao-tag__prefix"
|
|
2441
2882
|
};
|
|
2442
2883
|
const _hoisted_2$w = { class: "tao-tag__text" };
|
|
2443
|
-
const _hoisted_3$
|
|
2444
|
-
const _hoisted_4$
|
|
2884
|
+
const _hoisted_3$o = ["aria-label"];
|
|
2885
|
+
const _hoisted_4$l = { "aria-hidden": "true" };
|
|
2445
2886
|
const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
|
|
2446
2887
|
...{ name: "TaoTag" },
|
|
2447
2888
|
__name: "TaoTag",
|
|
2448
2889
|
props: {
|
|
2449
|
-
|
|
2890
|
+
tone: { default: void 0 },
|
|
2891
|
+
type: { default: void 0 },
|
|
2450
2892
|
color: {},
|
|
2451
2893
|
background: {},
|
|
2452
2894
|
borderColor: {},
|
|
2895
|
+
clickable: { type: Boolean, default: false },
|
|
2453
2896
|
pointer: { type: Boolean, default: false },
|
|
2454
2897
|
closable: { type: Boolean, default: false },
|
|
2455
|
-
closeLabel: {
|
|
2456
|
-
flat: { type: Boolean, default: false }
|
|
2898
|
+
closeLabel: {},
|
|
2899
|
+
flat: { type: Boolean, default: false },
|
|
2900
|
+
size: {}
|
|
2457
2901
|
},
|
|
2458
2902
|
emits: ["close"],
|
|
2459
2903
|
setup(__props, { emit: __emit }) {
|
|
2460
2904
|
const props = __props;
|
|
2905
|
+
const l10n = useLocaleText(props, "tag");
|
|
2461
2906
|
const emit = __emit;
|
|
2462
2907
|
const slots = vue.useSlots();
|
|
2463
|
-
const
|
|
2908
|
+
const resolvedTone = vue.computed(() => {
|
|
2909
|
+
const value = props.tone ?? props.type ?? "";
|
|
2910
|
+
return value === "error" ? "danger" : value;
|
|
2911
|
+
});
|
|
2464
2912
|
const style = vue.computed(() => ({
|
|
2465
2913
|
color: props.color || "",
|
|
2466
2914
|
background: props.background || "",
|
|
@@ -2469,12 +2917,17 @@
|
|
|
2469
2917
|
function onClose(event) {
|
|
2470
2918
|
emit("close", event);
|
|
2471
2919
|
}
|
|
2920
|
+
warnDeprecated("TaoTag", {
|
|
2921
|
+
type: "use `tone`",
|
|
2922
|
+
pointer: "use `clickable`"
|
|
2923
|
+
});
|
|
2472
2924
|
return (_ctx, _cache) => {
|
|
2473
2925
|
return vue.openBlock(), vue.createElementBlock("span", {
|
|
2474
2926
|
class: vue.normalizeClass(["tao-tag", [
|
|
2475
|
-
|
|
2927
|
+
resolvedTone.value ? `tao-tag--${resolvedTone.value}` : "",
|
|
2928
|
+
vue.unref(sizeClass)(__props.size),
|
|
2476
2929
|
{
|
|
2477
|
-
"tao-tag--pointer": __props.pointer,
|
|
2930
|
+
"tao-tag--pointer": __props.clickable || __props.pointer,
|
|
2478
2931
|
"tao-tag--closable": __props.closable,
|
|
2479
2932
|
"tao-tag--prefix": Boolean(vue.unref(slots).prefix),
|
|
2480
2933
|
"tao-tag--flat": __props.flat
|
|
@@ -2492,26 +2945,26 @@
|
|
|
2492
2945
|
key: 1,
|
|
2493
2946
|
type: "button",
|
|
2494
2947
|
class: "tao-tag__close",
|
|
2495
|
-
"aria-label":
|
|
2948
|
+
"aria-label": vue.unref(l10n).closeLabel,
|
|
2496
2949
|
onClick: vue.withModifiers(onClose, ["stop"])
|
|
2497
2950
|
}, [
|
|
2498
|
-
vue.createElementVNode("span", _hoisted_4$
|
|
2951
|
+
vue.createElementVNode("span", _hoisted_4$l, [
|
|
2499
2952
|
vue.renderSlot(_ctx.$slots, "close-icon", {}, () => [
|
|
2500
2953
|
_cache[0] || (_cache[0] = vue.createTextVNode("✕", -1))
|
|
2501
2954
|
], true)
|
|
2502
2955
|
])
|
|
2503
|
-
], 8, _hoisted_3$
|
|
2956
|
+
], 8, _hoisted_3$o)) : vue.createCommentVNode("", true)
|
|
2504
2957
|
], 6);
|
|
2505
2958
|
};
|
|
2506
2959
|
}
|
|
2507
2960
|
});
|
|
2508
|
-
const TaoTag = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-
|
|
2961
|
+
const TaoTag = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-ca0b1b42"]]);
|
|
2509
2962
|
const _hoisted_1$y = ["role", "aria-hidden"];
|
|
2510
2963
|
const _hoisted_2$v = {
|
|
2511
2964
|
key: 1,
|
|
2512
2965
|
class: "tao-divider__text"
|
|
2513
2966
|
};
|
|
2514
|
-
const _hoisted_3$
|
|
2967
|
+
const _hoisted_3$n = {
|
|
2515
2968
|
key: 2,
|
|
2516
2969
|
class: "tao-divider__line tao-divider__line--end"
|
|
2517
2970
|
};
|
|
@@ -2529,6 +2982,9 @@
|
|
|
2529
2982
|
const slots = vue.useSlots();
|
|
2530
2983
|
const gapSize = vue.computed(() => props.size === "big" ? "large" : props.size);
|
|
2531
2984
|
const hasLabel = vue.computed(() => Boolean(props.text) || Boolean(slots.default));
|
|
2985
|
+
if (props.size === "big") {
|
|
2986
|
+
deprecationWarning("TaoDivider", 'size "big"', 'use size="large"');
|
|
2987
|
+
}
|
|
2532
2988
|
return (_ctx, _cache) => {
|
|
2533
2989
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
2534
2990
|
class: vue.normalizeClass(["tao-divider", [
|
|
@@ -2551,12 +3007,12 @@
|
|
|
2551
3007
|
vue.createTextVNode(vue.toDisplayString(__props.text), 1)
|
|
2552
3008
|
], true)
|
|
2553
3009
|
])) : vue.createCommentVNode("", true),
|
|
2554
|
-
__props.variant !== "gap" && hasLabel.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$
|
|
3010
|
+
__props.variant !== "gap" && hasLabel.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$n)) : vue.createCommentVNode("", true)
|
|
2555
3011
|
], 10, _hoisted_1$y);
|
|
2556
3012
|
};
|
|
2557
3013
|
}
|
|
2558
3014
|
});
|
|
2559
|
-
const TaoDivider = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-
|
|
3015
|
+
const TaoDivider = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-32544dcc"]]);
|
|
2560
3016
|
const _hoisted_1$x = {
|
|
2561
3017
|
key: 0,
|
|
2562
3018
|
class: "tao-fieldset__legend"
|
|
@@ -2612,16 +3068,8 @@
|
|
|
2612
3068
|
}
|
|
2613
3069
|
});
|
|
2614
3070
|
const TaoAnimatedBorder = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-c9434028"]]);
|
|
2615
|
-
const _hoisted_1$w =
|
|
2616
|
-
|
|
2617
|
-
class: "tao-textarea tao-textarea--dummy"
|
|
2618
|
-
};
|
|
2619
|
-
const _hoisted_2$t = {
|
|
2620
|
-
key: 1,
|
|
2621
|
-
class: "tao-textarea-wrap"
|
|
2622
|
-
};
|
|
2623
|
-
const _hoisted_3$n = ["id", "placeholder", "spellcheck", "autocomplete", "minlength", "maxlength", "disabled", "rows", "value", "aria-invalid", "aria-describedby"];
|
|
2624
|
-
const _hoisted_4$l = ["id"];
|
|
3071
|
+
const _hoisted_1$w = ["id", "placeholder", "spellcheck", "autocomplete", "minlength", "maxlength", "disabled", "readonly", "rows", "value", "aria-invalid", "aria-describedby"];
|
|
3072
|
+
const _hoisted_2$t = ["id"];
|
|
2625
3073
|
const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
2626
3074
|
...{ name: "TaoTextarea" },
|
|
2627
3075
|
__name: "TaoTextarea",
|
|
@@ -2632,6 +3080,9 @@
|
|
|
2632
3080
|
minlength: { default: 0 },
|
|
2633
3081
|
maxlength: { default: void 0 },
|
|
2634
3082
|
disabled: { type: Boolean, default: false },
|
|
3083
|
+
size: {},
|
|
3084
|
+
variant: {},
|
|
3085
|
+
readonly: { type: Boolean, default: false },
|
|
2635
3086
|
noSpace: { type: Boolean, default: false },
|
|
2636
3087
|
dummy: { type: Boolean, default: false },
|
|
2637
3088
|
rows: { default: 3 },
|
|
@@ -2639,9 +3090,12 @@
|
|
|
2639
3090
|
modelValue: { default: "" },
|
|
2640
3091
|
noBorder: { type: Boolean, default: false },
|
|
2641
3092
|
noBackground: { type: Boolean, default: false },
|
|
3093
|
+
autofocus: { type: Boolean, default: false },
|
|
2642
3094
|
autoFocus: { type: Boolean, default: false },
|
|
2643
3095
|
borderInverse: { type: Boolean, default: false },
|
|
3096
|
+
align: { default: void 0 },
|
|
2644
3097
|
textCenter: { type: Boolean, default: false },
|
|
3098
|
+
blurOnEnter: { type: Boolean, default: false },
|
|
2645
3099
|
submitOnEnter: { type: Boolean, default: false },
|
|
2646
3100
|
error: { type: Boolean, default: false },
|
|
2647
3101
|
id: {},
|
|
@@ -2656,6 +3110,26 @@
|
|
|
2656
3110
|
const controlId = vue.computed(() => props.id || (field == null ? void 0 : field.id) || localId);
|
|
2657
3111
|
const invalid = vue.computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
2658
3112
|
const counterId = vue.computed(() => `${controlId.value}-count`);
|
|
3113
|
+
const resolvedVariant = vue.computed(() => {
|
|
3114
|
+
if (props.variant) {
|
|
3115
|
+
return props.variant;
|
|
3116
|
+
}
|
|
3117
|
+
if (props.noBorder) {
|
|
3118
|
+
return props.noBackground ? "plain" : "filled";
|
|
3119
|
+
}
|
|
3120
|
+
return "bar";
|
|
3121
|
+
});
|
|
3122
|
+
const alignClass = vue.computed(() => {
|
|
3123
|
+
const align = props.align ?? (props.textCenter ? "center" : "start");
|
|
3124
|
+
return align === "start" ? void 0 : `tao-textarea--align-${align}`;
|
|
3125
|
+
});
|
|
3126
|
+
const variantClasses = vue.computed(() => [
|
|
3127
|
+
`tao-textarea--${resolvedVariant.value}`,
|
|
3128
|
+
{
|
|
3129
|
+
"tao-textarea--inverse": props.borderInverse && resolvedVariant.value === "bar",
|
|
3130
|
+
"tao-textarea--no-background": !props.variant && props.noBackground && !props.noBorder
|
|
3131
|
+
}
|
|
3132
|
+
]);
|
|
2659
3133
|
const describedBy = vue.computed(() => {
|
|
2660
3134
|
const ids = [field == null ? void 0 : field.describedBy.value, props.count ? counterId.value : void 0].filter(Boolean);
|
|
2661
3135
|
return ids.length ? ids.join(" ") : void 0;
|
|
@@ -2673,7 +3147,15 @@
|
|
|
2673
3147
|
const textareaRef = vue.ref(null);
|
|
2674
3148
|
function onInput(e) {
|
|
2675
3149
|
const target = e.target;
|
|
2676
|
-
|
|
3150
|
+
let value = target.value;
|
|
3151
|
+
if (props.noSpace && value.includes(" ")) {
|
|
3152
|
+
const caret = target.selectionStart ?? value.length;
|
|
3153
|
+
const nextCaret = value.slice(0, caret).replace(/ /g, "").length;
|
|
3154
|
+
value = value.replace(/ /g, "");
|
|
3155
|
+
target.value = value;
|
|
3156
|
+
target.setSelectionRange(nextCaret, nextCaret);
|
|
3157
|
+
}
|
|
3158
|
+
emit("update:modelValue", value);
|
|
2677
3159
|
autoResize();
|
|
2678
3160
|
}
|
|
2679
3161
|
function onChange(e) {
|
|
@@ -2688,7 +3170,7 @@
|
|
|
2688
3170
|
function onKeydown(event) {
|
|
2689
3171
|
var _a;
|
|
2690
3172
|
emit("keydown", event);
|
|
2691
|
-
if (props.submitOnEnter && event.key === "Enter" && !event.shiftKey) {
|
|
3173
|
+
if ((props.blurOnEnter || props.submitOnEnter) && event.key === "Enter" && !event.shiftKey) {
|
|
2692
3174
|
(_a = textareaRef.value) == null ? void 0 : _a.blur();
|
|
2693
3175
|
event.preventDefault();
|
|
2694
3176
|
return;
|
|
@@ -2713,31 +3195,47 @@
|
|
|
2713
3195
|
);
|
|
2714
3196
|
vue.onMounted(() => {
|
|
2715
3197
|
var _a;
|
|
2716
|
-
if (props.autoFocus) {
|
|
3198
|
+
if (props.autofocus || props.autoFocus) {
|
|
2717
3199
|
(_a = textareaRef.value) == null ? void 0 : _a.focus();
|
|
2718
3200
|
}
|
|
2719
3201
|
vue.nextTick(autoResize);
|
|
2720
3202
|
});
|
|
3203
|
+
warnDeprecated("TaoTextarea", {
|
|
3204
|
+
noBorder: 'use variant="filled"',
|
|
3205
|
+
noBackground: 'use variant="plain"',
|
|
3206
|
+
borderInverse: "use `variant` (the bar on the right goes away)",
|
|
3207
|
+
dummy: "use `readonly`",
|
|
3208
|
+
textCenter: 'use align="center"',
|
|
3209
|
+
autoFocus: "use `autofocus`",
|
|
3210
|
+
submitOnEnter: "use `blurOnEnter`"
|
|
3211
|
+
});
|
|
2721
3212
|
return (_ctx, _cache) => {
|
|
2722
|
-
return __props.dummy ? (vue.openBlock(), vue.createElementBlock("span",
|
|
3213
|
+
return __props.dummy ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
3214
|
+
key: 0,
|
|
3215
|
+
class: vue.normalizeClass(["tao-textarea tao-textarea--dummy", [vue.unref(sizeClass)(__props.size), variantClasses.value, alignClass.value]])
|
|
3216
|
+
}, vue.toDisplayString(__props.modelValue), 3)) : (vue.openBlock(), vue.createElementBlock("div", {
|
|
3217
|
+
key: 1,
|
|
3218
|
+
class: vue.normalizeClass(["tao-textarea-wrap", vue.unref(sizeClass)(__props.size)])
|
|
3219
|
+
}, [
|
|
2723
3220
|
vue.createElementVNode("textarea", {
|
|
2724
3221
|
id: controlId.value,
|
|
2725
3222
|
ref_key: "textareaRef",
|
|
2726
3223
|
ref: textareaRef,
|
|
2727
|
-
class: vue.normalizeClass(["tao-textarea",
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
3224
|
+
class: vue.normalizeClass(["tao-textarea", [
|
|
3225
|
+
variantClasses.value,
|
|
3226
|
+
alignClass.value,
|
|
3227
|
+
{
|
|
3228
|
+
"tao-textarea--no-resize": !__props.resize,
|
|
3229
|
+
"tao-textarea--invalid": invalid.value
|
|
3230
|
+
}
|
|
3231
|
+
]]),
|
|
2735
3232
|
placeholder: __props.placeholder,
|
|
2736
3233
|
spellcheck: __props.spellcheck,
|
|
2737
3234
|
autocomplete: __props.autocomplete,
|
|
2738
3235
|
minlength: __props.minlength,
|
|
2739
3236
|
maxlength: __props.maxlength,
|
|
2740
3237
|
disabled: __props.disabled,
|
|
3238
|
+
readonly: __props.readonly,
|
|
2741
3239
|
rows: __props.rows,
|
|
2742
3240
|
value: __props.modelValue,
|
|
2743
3241
|
"aria-invalid": invalid.value || void 0,
|
|
@@ -2748,17 +3246,17 @@
|
|
|
2748
3246
|
onFocus,
|
|
2749
3247
|
onBlur,
|
|
2750
3248
|
onKeydown
|
|
2751
|
-
}, null, 42,
|
|
3249
|
+
}, null, 42, _hoisted_1$w),
|
|
2752
3250
|
__props.count ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
2753
3251
|
key: 0,
|
|
2754
3252
|
id: counterId.value,
|
|
2755
3253
|
class: vue.normalizeClass(["tao-textarea__count", { "tao-textarea__count--limit": atLimit.value }])
|
|
2756
|
-
}, vue.toDisplayString(countLabel.value), 11,
|
|
2757
|
-
]));
|
|
3254
|
+
}, vue.toDisplayString(countLabel.value), 11, _hoisted_2$t)) : vue.createCommentVNode("", true)
|
|
3255
|
+
], 2));
|
|
2758
3256
|
};
|
|
2759
3257
|
}
|
|
2760
3258
|
});
|
|
2761
|
-
const TaoTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-
|
|
3259
|
+
const TaoTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-50628dd9"]]);
|
|
2762
3260
|
const _hoisted_1$v = ["tabindex", "aria-label"];
|
|
2763
3261
|
const _hoisted_2$s = { class: "tao-scroll-top__content" };
|
|
2764
3262
|
const RIPPLE_DURATION = 750;
|
|
@@ -2771,12 +3269,14 @@
|
|
|
2771
3269
|
bottom: { default: 24 },
|
|
2772
3270
|
zIndex: { default: 1e3 },
|
|
2773
3271
|
boundary: { default: 300 },
|
|
2774
|
-
|
|
3272
|
+
outline: { type: Boolean, default: void 0 },
|
|
3273
|
+
hasOutline: { type: Boolean, default: void 0 },
|
|
2775
3274
|
tabindex: { default: 0 },
|
|
2776
|
-
ariaLabel: {
|
|
3275
|
+
ariaLabel: {}
|
|
2777
3276
|
},
|
|
2778
3277
|
setup(__props) {
|
|
2779
3278
|
const props = __props;
|
|
3279
|
+
useLocaleText(props, "scrollTop");
|
|
2780
3280
|
const fmtProp = (value, unit = "px") => typeof value === "number" ? value + unit : value;
|
|
2781
3281
|
let prevPos = 0;
|
|
2782
3282
|
let activeBack = false;
|
|
@@ -2851,6 +3351,10 @@
|
|
|
2851
3351
|
vue.onBeforeUnmount(() => {
|
|
2852
3352
|
window.removeEventListener("scroll", onScroll);
|
|
2853
3353
|
});
|
|
3354
|
+
warnDeprecated("TaoScrollTop", {
|
|
3355
|
+
hasOutline: "use `outline`",
|
|
3356
|
+
tabindex: "pass `tabindex` as a plain attribute"
|
|
3357
|
+
});
|
|
2854
3358
|
return (_ctx, _cache) => {
|
|
2855
3359
|
return vue.openBlock(), vue.createBlock(vue.Transition, { name: "tao-scroll-top-fade" }, {
|
|
2856
3360
|
default: vue.withCtx(() => [
|
|
@@ -2859,7 +3363,7 @@
|
|
|
2859
3363
|
type: "button",
|
|
2860
3364
|
style: vue.normalizeStyle(mainStyle),
|
|
2861
3365
|
tabindex: props.tabindex,
|
|
2862
|
-
class: vue.normalizeClass(["tao-scroll-top", { "tao-scroll-top--no-outline":
|
|
3366
|
+
class: vue.normalizeClass(["tao-scroll-top", { "tao-scroll-top--no-outline": (props.outline ?? props.hasOutline) === false }]),
|
|
2863
3367
|
"aria-label": props.ariaLabel,
|
|
2864
3368
|
onClick: vue.withModifiers(onClick, ["prevent"])
|
|
2865
3369
|
}, [
|
|
@@ -2887,7 +3391,7 @@
|
|
|
2887
3391
|
};
|
|
2888
3392
|
}
|
|
2889
3393
|
});
|
|
2890
|
-
const TaoScrollTop = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-
|
|
3394
|
+
const TaoScrollTop = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-9ec6a1a2"]]);
|
|
2891
3395
|
const _hoisted_1$u = { class: "tao-progress" };
|
|
2892
3396
|
const _hoisted_2$r = {
|
|
2893
3397
|
key: 0,
|
|
@@ -2967,7 +3471,7 @@
|
|
|
2967
3471
|
}
|
|
2968
3472
|
});
|
|
2969
3473
|
const TaoProgress = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__scopeId", "data-v-1aae89cd"]]);
|
|
2970
|
-
const _hoisted_1$t = ["id", "tabindex", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-disabled", "aria-describedby"];
|
|
3474
|
+
const _hoisted_1$t = ["id", "tabindex", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-disabled", "aria-invalid", "aria-describedby"];
|
|
2971
3475
|
const _hoisted_2$q = ["placeholder"];
|
|
2972
3476
|
const _hoisted_3$l = {
|
|
2973
3477
|
key: 1,
|
|
@@ -2984,10 +3488,12 @@
|
|
|
2984
3488
|
placeholder: { default: "" },
|
|
2985
3489
|
modelValue: {},
|
|
2986
3490
|
disabled: { type: Boolean, default: false },
|
|
2987
|
-
|
|
3491
|
+
error: { type: Boolean, default: false },
|
|
3492
|
+
variant: { default: "bar" },
|
|
3493
|
+
size: {},
|
|
2988
3494
|
wheel: { default: 0 }
|
|
2989
3495
|
},
|
|
2990
|
-
emits: ["update:modelValue"],
|
|
3496
|
+
emits: ["update:modelValue", "change"],
|
|
2991
3497
|
setup(__props, { emit: __emit }) {
|
|
2992
3498
|
const props = __props;
|
|
2993
3499
|
const emit = __emit;
|
|
@@ -2995,6 +3501,7 @@
|
|
|
2995
3501
|
const localId = vue.useId();
|
|
2996
3502
|
const controlId = vue.computed(() => (field == null ? void 0 : field.id) ?? localId);
|
|
2997
3503
|
const describedBy = vue.computed(() => field == null ? void 0 : field.describedBy.value);
|
|
3504
|
+
const invalid = vue.computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
2998
3505
|
function packModelValue(value) {
|
|
2999
3506
|
return typeof props.modelValue === "string" ? `${value}` : value;
|
|
3000
3507
|
}
|
|
@@ -3002,10 +3509,11 @@
|
|
|
3002
3509
|
const raw = typeof props.modelValue === "string" ? parseFloat(props.modelValue) : props.modelValue;
|
|
3003
3510
|
return Number.isFinite(raw) ? raw : props.min;
|
|
3004
3511
|
}
|
|
3005
|
-
const
|
|
3512
|
+
const current2 = vue.computed(() => unpackModelValue());
|
|
3006
3513
|
const trackRef = vue.ref(null);
|
|
3007
3514
|
const isDragging = vue.ref(false);
|
|
3008
3515
|
let dragPointer = -1;
|
|
3516
|
+
let dragStartValue = 0;
|
|
3009
3517
|
const shadowInputRef = vue.ref(null);
|
|
3010
3518
|
const shadowModel = vue.ref("0");
|
|
3011
3519
|
const showShadowModel = vue.ref(false);
|
|
@@ -3014,13 +3522,18 @@
|
|
|
3014
3522
|
if (range <= 0) {
|
|
3015
3523
|
return 0;
|
|
3016
3524
|
}
|
|
3017
|
-
return (
|
|
3525
|
+
return (current2.value - props.min) / range * 100;
|
|
3018
3526
|
});
|
|
3019
3527
|
function clampValue(v) {
|
|
3020
3528
|
return Math.min(Math.max(v, props.min), props.max);
|
|
3021
3529
|
}
|
|
3022
|
-
function commit(value) {
|
|
3023
|
-
|
|
3530
|
+
function commit(value, final = false) {
|
|
3531
|
+
const next = clampValue(value);
|
|
3532
|
+
const changed = next !== current2.value;
|
|
3533
|
+
emit("update:modelValue", packModelValue(next));
|
|
3534
|
+
if (final && changed) {
|
|
3535
|
+
emit("change", packModelValue(next));
|
|
3536
|
+
}
|
|
3024
3537
|
}
|
|
3025
3538
|
function calculateValue(event) {
|
|
3026
3539
|
if (!trackRef.value) {
|
|
@@ -3053,12 +3566,16 @@
|
|
|
3053
3566
|
isDragging.value = false;
|
|
3054
3567
|
releaseDragCapture();
|
|
3055
3568
|
dragPointer = -1;
|
|
3569
|
+
if (current2.value !== dragStartValue) {
|
|
3570
|
+
emit("change", packModelValue(current2.value));
|
|
3571
|
+
}
|
|
3056
3572
|
}
|
|
3057
3573
|
function onPointerDown(event) {
|
|
3058
3574
|
if (props.disabled || showShadowModel.value || event.button !== 0 || !trackRef.value) {
|
|
3059
3575
|
return;
|
|
3060
3576
|
}
|
|
3061
3577
|
dragPointer = event.pointerId;
|
|
3578
|
+
dragStartValue = current2.value;
|
|
3062
3579
|
isDragging.value = true;
|
|
3063
3580
|
commit(calculateValue(event));
|
|
3064
3581
|
event.preventDefault();
|
|
@@ -3099,17 +3616,17 @@
|
|
|
3099
3616
|
};
|
|
3100
3617
|
if (event.key in keys) {
|
|
3101
3618
|
event.preventDefault();
|
|
3102
|
-
commit(
|
|
3619
|
+
commit(current2.value + keys[event.key], true);
|
|
3103
3620
|
return;
|
|
3104
3621
|
}
|
|
3105
3622
|
if (event.key === "Home") {
|
|
3106
3623
|
event.preventDefault();
|
|
3107
|
-
commit(props.min);
|
|
3624
|
+
commit(props.min, true);
|
|
3108
3625
|
return;
|
|
3109
3626
|
}
|
|
3110
3627
|
if (event.key === "End") {
|
|
3111
3628
|
event.preventDefault();
|
|
3112
|
-
commit(props.max);
|
|
3629
|
+
commit(props.max, true);
|
|
3113
3630
|
}
|
|
3114
3631
|
}
|
|
3115
3632
|
function onWheel(event) {
|
|
@@ -3118,13 +3635,13 @@
|
|
|
3118
3635
|
}
|
|
3119
3636
|
event.preventDefault();
|
|
3120
3637
|
const delta = event.deltaY < 0 ? props.wheel : -props.wheel;
|
|
3121
|
-
commit(
|
|
3638
|
+
commit(current2.value + delta, true);
|
|
3122
3639
|
}
|
|
3123
3640
|
function onBlurShadowModel() {
|
|
3124
3641
|
if (shadowModel.value) {
|
|
3125
|
-
const
|
|
3126
|
-
shadowModel.value = `${
|
|
3127
|
-
|
|
3642
|
+
const next = clampValue(parseFloat(shadowModel.value) || 0);
|
|
3643
|
+
shadowModel.value = `${packModelValue(next)}`;
|
|
3644
|
+
commit(next, true);
|
|
3128
3645
|
}
|
|
3129
3646
|
showShadowModel.value = false;
|
|
3130
3647
|
}
|
|
@@ -3159,15 +3676,17 @@
|
|
|
3159
3676
|
ref_key: "trackRef",
|
|
3160
3677
|
ref: trackRef,
|
|
3161
3678
|
class: vue.normalizeClass(["tao-slider", [
|
|
3162
|
-
`tao-slider--${__props.
|
|
3163
|
-
|
|
3679
|
+
`tao-slider--${__props.variant}`,
|
|
3680
|
+
vue.unref(sizeClass)(__props.size),
|
|
3681
|
+
{ "tao-slider--show-value": __props.showValue, "tao-slider--disabled": __props.disabled, "tao-slider--invalid": invalid.value }
|
|
3164
3682
|
]]),
|
|
3165
3683
|
role: "slider",
|
|
3166
3684
|
tabindex: __props.disabled ? -1 : 0,
|
|
3167
3685
|
"aria-valuemin": __props.min,
|
|
3168
3686
|
"aria-valuemax": __props.max,
|
|
3169
|
-
"aria-valuenow":
|
|
3687
|
+
"aria-valuenow": current2.value,
|
|
3170
3688
|
"aria-disabled": __props.disabled || void 0,
|
|
3689
|
+
"aria-invalid": invalid.value || void 0,
|
|
3171
3690
|
"aria-describedby": describedBy.value,
|
|
3172
3691
|
onContextmenu: vue.withModifiers(onContextMenu, ["prevent"]),
|
|
3173
3692
|
onPointerdown: onPointerDown,
|
|
@@ -3211,37 +3730,37 @@
|
|
|
3211
3730
|
};
|
|
3212
3731
|
}
|
|
3213
3732
|
});
|
|
3214
|
-
const TaoSlider = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-
|
|
3215
|
-
const _hoisted_1$s = { class: "tao-file-
|
|
3216
|
-
const _hoisted_2$p =
|
|
3217
|
-
const _hoisted_3$k =
|
|
3218
|
-
const _hoisted_4$j =
|
|
3219
|
-
const _hoisted_5$f =
|
|
3220
|
-
const _hoisted_6$c = {
|
|
3733
|
+
const TaoSlider = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-47d32e2a"]]);
|
|
3734
|
+
const _hoisted_1$s = { class: "tao-file-drop__row" };
|
|
3735
|
+
const _hoisted_2$p = ["aria-label"];
|
|
3736
|
+
const _hoisted_3$k = { "aria-hidden": "true" };
|
|
3737
|
+
const _hoisted_4$j = ["accept", "multiple"];
|
|
3738
|
+
const _hoisted_5$f = {
|
|
3221
3739
|
key: 0,
|
|
3222
3740
|
class: "tao-file-drop__list"
|
|
3223
3741
|
};
|
|
3224
|
-
const
|
|
3225
|
-
const
|
|
3226
|
-
const
|
|
3227
|
-
const
|
|
3742
|
+
const _hoisted_6$c = { class: "tao-file-drop__name" };
|
|
3743
|
+
const _hoisted_7$a = { class: "tao-file-drop__meta" };
|
|
3744
|
+
const _hoisted_8$9 = ["aria-label", "onClick"];
|
|
3745
|
+
const _hoisted_9$4 = { "aria-hidden": "true" };
|
|
3228
3746
|
const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
3229
3747
|
...{ name: "TaoFileDrop" },
|
|
3230
3748
|
__name: "TaoFileDrop",
|
|
3231
3749
|
props: {
|
|
3232
3750
|
modelValue: { default: () => [] },
|
|
3233
|
-
size: {
|
|
3751
|
+
size: {},
|
|
3234
3752
|
accept: { default: "*" },
|
|
3235
3753
|
multiple: { type: Boolean, default: false },
|
|
3236
3754
|
showClear: { type: Boolean, default: false },
|
|
3237
|
-
clearLabel: {
|
|
3238
|
-
removeLabel: {
|
|
3755
|
+
clearLabel: {},
|
|
3756
|
+
removeLabel: {},
|
|
3239
3757
|
formatSize: {},
|
|
3240
3758
|
list: { type: Boolean, default: true }
|
|
3241
3759
|
},
|
|
3242
|
-
emits: ["update:modelValue", "files", "clear-request"],
|
|
3760
|
+
emits: ["update:modelValue", "change", "files", "clear-request"],
|
|
3243
3761
|
setup(__props, { emit: __emit }) {
|
|
3244
3762
|
const props = __props;
|
|
3763
|
+
const l10n = useLocaleText(props, "fileDrop");
|
|
3245
3764
|
const emit = __emit;
|
|
3246
3765
|
const isDragging = vue.ref(false);
|
|
3247
3766
|
const fileInput = vue.ref(null);
|
|
@@ -3272,6 +3791,7 @@
|
|
|
3272
3791
|
}
|
|
3273
3792
|
function commit(files) {
|
|
3274
3793
|
emit("update:modelValue", files);
|
|
3794
|
+
emit("change", files);
|
|
3275
3795
|
emit("files", files);
|
|
3276
3796
|
}
|
|
3277
3797
|
function handleDragOver(event) {
|
|
@@ -3330,17 +3850,18 @@
|
|
|
3330
3850
|
resetInput();
|
|
3331
3851
|
}
|
|
3332
3852
|
function defaultFormatSize(bytes) {
|
|
3853
|
+
const { units, decimalSeparator } = taoLocale().fileDrop;
|
|
3333
3854
|
if (bytes < 1024) {
|
|
3334
|
-
return `${bytes}
|
|
3855
|
+
return `${bytes} ${units[0]}`;
|
|
3335
3856
|
}
|
|
3336
3857
|
const kb = bytes / 1024;
|
|
3337
3858
|
if (kb < 1024) {
|
|
3338
3859
|
const value2 = kb < 10 ? kb.toFixed(1) : String(Math.round(kb));
|
|
3339
|
-
return `${value2.replace(".",
|
|
3860
|
+
return `${value2.replace(".", decimalSeparator)} ${units[1]}`;
|
|
3340
3861
|
}
|
|
3341
3862
|
const mb = kb / 1024;
|
|
3342
3863
|
const value = mb < 10 ? mb.toFixed(1) : String(Math.round(mb));
|
|
3343
|
-
return `${value.replace(".",
|
|
3864
|
+
return `${value.replace(".", decimalSeparator)} ${units[2]}`;
|
|
3344
3865
|
}
|
|
3345
3866
|
function sizeLabel(bytes) {
|
|
3346
3867
|
return props.formatSize ? props.formatSize(bytes) : defaultFormatSize(bytes);
|
|
@@ -3355,30 +3876,35 @@
|
|
|
3355
3876
|
});
|
|
3356
3877
|
});
|
|
3357
3878
|
vue.onBeforeUnmount(() => stopFocusLoss == null ? void 0 : stopFocusLoss());
|
|
3879
|
+
warnDeprecated("TaoFileDrop", {
|
|
3880
|
+
onFiles: 'listen to "change"'
|
|
3881
|
+
});
|
|
3358
3882
|
return (_ctx, _cache) => {
|
|
3359
|
-
return vue.openBlock(), vue.createElementBlock("div",
|
|
3360
|
-
vue.
|
|
3883
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
3884
|
+
class: vue.normalizeClass(["tao-file-drop", vue.unref(sizeClass)(__props.size)])
|
|
3885
|
+
}, [
|
|
3886
|
+
vue.createElementVNode("div", _hoisted_1$s, [
|
|
3361
3887
|
__props.showClear && __props.modelValue.length ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
3362
3888
|
key: 0,
|
|
3363
3889
|
type: "button",
|
|
3364
3890
|
class: "tao-file-drop__clear",
|
|
3365
|
-
"aria-label":
|
|
3891
|
+
"aria-label": vue.unref(l10n).clearLabel,
|
|
3366
3892
|
onClick: requestClear
|
|
3367
3893
|
}, [
|
|
3368
|
-
vue.createElementVNode("span",
|
|
3894
|
+
vue.createElementVNode("span", _hoisted_3$k, [
|
|
3369
3895
|
vue.renderSlot(_ctx.$slots, "clear-icon", {}, () => [
|
|
3370
3896
|
_cache[1] || (_cache[1] = vue.createTextVNode("✕", -1))
|
|
3371
3897
|
], true)
|
|
3372
3898
|
])
|
|
3373
|
-
], 8,
|
|
3899
|
+
], 8, _hoisted_2$p)) : vue.createCommentVNode("", true),
|
|
3374
3900
|
vue.createElementVNode("label", {
|
|
3375
|
-
class: vue.normalizeClass(["tao-file-drop__zone",
|
|
3901
|
+
class: vue.normalizeClass(["tao-file-drop__zone", { "tao-file-drop__zone--dragging": isDragging.value }]),
|
|
3376
3902
|
onDragover: handleDragOver,
|
|
3377
3903
|
onDragleave: handleDragLeave,
|
|
3378
3904
|
onDrop: handleDrop
|
|
3379
3905
|
}, [
|
|
3380
3906
|
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
3381
|
-
|
|
3907
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(taoLocale)().fileDrop.zoneText), 1)
|
|
3382
3908
|
], true),
|
|
3383
3909
|
vue.createElementVNode("input", {
|
|
3384
3910
|
ref_key: "fileInput",
|
|
@@ -3390,37 +3916,37 @@
|
|
|
3390
3916
|
onChange: handleFileSelect,
|
|
3391
3917
|
onClick: _cache[0] || (_cache[0] = vue.withModifiers(() => {
|
|
3392
3918
|
}, ["stop"]))
|
|
3393
|
-
}, null, 40,
|
|
3919
|
+
}, null, 40, _hoisted_4$j)
|
|
3394
3920
|
], 34)
|
|
3395
3921
|
]),
|
|
3396
|
-
__props.list && __props.modelValue.length ? (vue.openBlock(), vue.createElementBlock("ul",
|
|
3922
|
+
__props.list && __props.modelValue.length ? (vue.openBlock(), vue.createElementBlock("ul", _hoisted_5$f, [
|
|
3397
3923
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.modelValue, (file, index) => {
|
|
3398
3924
|
return vue.openBlock(), vue.createElementBlock("li", {
|
|
3399
3925
|
key: fileKey(file, index),
|
|
3400
3926
|
class: "tao-file-drop__file"
|
|
3401
3927
|
}, [
|
|
3402
|
-
vue.createElementVNode("span",
|
|
3403
|
-
vue.createElementVNode("span",
|
|
3928
|
+
vue.createElementVNode("span", _hoisted_6$c, vue.toDisplayString(file.name), 1),
|
|
3929
|
+
vue.createElementVNode("span", _hoisted_7$a, vue.toDisplayString(sizeLabel(file.size)), 1),
|
|
3404
3930
|
vue.createElementVNode("button", {
|
|
3405
3931
|
type: "button",
|
|
3406
3932
|
class: "tao-file-drop__remove",
|
|
3407
|
-
"aria-label":
|
|
3933
|
+
"aria-label": vue.unref(l10n).removeLabel.replace("{name}", file.name),
|
|
3408
3934
|
onClick: ($event) => removeAt(index)
|
|
3409
3935
|
}, [
|
|
3410
|
-
vue.createElementVNode("span",
|
|
3936
|
+
vue.createElementVNode("span", _hoisted_9$4, [
|
|
3411
3937
|
vue.renderSlot(_ctx.$slots, "remove-icon", {}, () => [
|
|
3412
|
-
_cache[
|
|
3938
|
+
_cache[2] || (_cache[2] = vue.createTextVNode("✕", -1))
|
|
3413
3939
|
], true)
|
|
3414
3940
|
])
|
|
3415
|
-
], 8,
|
|
3941
|
+
], 8, _hoisted_8$9)
|
|
3416
3942
|
]);
|
|
3417
3943
|
}), 128))
|
|
3418
3944
|
])) : vue.createCommentVNode("", true)
|
|
3419
|
-
]);
|
|
3945
|
+
], 2);
|
|
3420
3946
|
};
|
|
3421
3947
|
}
|
|
3422
3948
|
});
|
|
3423
|
-
const TaoFileDrop = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-
|
|
3949
|
+
const TaoFileDrop = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-f8c58faa"]]);
|
|
3424
3950
|
const _hoisted_1$r = ["aria-expanded", "aria-label"];
|
|
3425
3951
|
const _hoisted_2$o = {
|
|
3426
3952
|
key: 1,
|
|
@@ -3433,11 +3959,12 @@
|
|
|
3433
3959
|
__name: "TaoDropdownMenu",
|
|
3434
3960
|
props: {
|
|
3435
3961
|
actions: { default: () => [] },
|
|
3436
|
-
menuLabel: {
|
|
3962
|
+
menuLabel: {}
|
|
3437
3963
|
},
|
|
3438
|
-
emits: ["selected"],
|
|
3964
|
+
emits: ["select", "selected"],
|
|
3439
3965
|
setup(__props, { emit: __emit }) {
|
|
3440
3966
|
const props = __props;
|
|
3967
|
+
const l10n = useLocaleText(props, "dropdownMenu");
|
|
3441
3968
|
const emit = __emit;
|
|
3442
3969
|
const menuRef = vue.ref(null);
|
|
3443
3970
|
const listRef = vue.ref(null);
|
|
@@ -3493,6 +4020,7 @@
|
|
|
3493
4020
|
function emitAction(id) {
|
|
3494
4021
|
var _a;
|
|
3495
4022
|
isOpen.value = false;
|
|
4023
|
+
emit("select", id);
|
|
3496
4024
|
emit("selected", id);
|
|
3497
4025
|
(_a = triggerRef.value) == null ? void 0 : _a.focus();
|
|
3498
4026
|
}
|
|
@@ -3549,6 +4077,9 @@
|
|
|
3549
4077
|
window.removeEventListener("scroll", onWinScroll, true);
|
|
3550
4078
|
window.removeEventListener("resize", updatePosition);
|
|
3551
4079
|
});
|
|
4080
|
+
warnDeprecated("TaoDropdownMenu", {
|
|
4081
|
+
onSelected: 'listen to "select"'
|
|
4082
|
+
});
|
|
3552
4083
|
return (_ctx, _cache) => {
|
|
3553
4084
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
3554
4085
|
ref_key: "menuRef",
|
|
@@ -3562,7 +4093,7 @@
|
|
|
3562
4093
|
class: "tao-dropdown-menu__button",
|
|
3563
4094
|
"aria-haspopup": "menu",
|
|
3564
4095
|
"aria-expanded": isOpen.value,
|
|
3565
|
-
"aria-label": _ctx.$slots.button ? void 0 :
|
|
4096
|
+
"aria-label": _ctx.$slots.button ? void 0 : vue.unref(l10n).menuLabel,
|
|
3566
4097
|
onClick: toggleMenu
|
|
3567
4098
|
}, [
|
|
3568
4099
|
_ctx.$slots.button ? vue.renderSlot(_ctx.$slots, "button", {}, void 0, true, 0) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$o, [
|
|
@@ -3604,16 +4135,20 @@
|
|
|
3604
4135
|
};
|
|
3605
4136
|
}
|
|
3606
4137
|
});
|
|
3607
|
-
const TaoDropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-
|
|
4138
|
+
const TaoDropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-5db490aa"]]);
|
|
3608
4139
|
const _hoisted_1$q = ["aria-invalid", "aria-describedby"];
|
|
3609
|
-
const _hoisted_2$n = ["id", "value", "placeholder", "type", "inputmode", "pattern", "maxlength", "onInput", "onPaste", "onKeydown", "onFocus"];
|
|
4140
|
+
const _hoisted_2$n = ["id", "value", "placeholder", "type", "disabled", "aria-invalid", "inputmode", "pattern", "maxlength", "onInput", "onPaste", "onKeydown", "onFocus"];
|
|
3610
4141
|
const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
3611
4142
|
...{ name: "TaoPinCode" },
|
|
3612
4143
|
__name: "TaoPinCode",
|
|
3613
4144
|
props: {
|
|
3614
4145
|
length: {},
|
|
4146
|
+
masked: { type: Boolean, default: false },
|
|
3615
4147
|
hidden: { type: Boolean, default: false },
|
|
3616
4148
|
placeholder: { default: "" },
|
|
4149
|
+
disabled: { type: Boolean, default: false },
|
|
4150
|
+
error: { type: Boolean, default: false },
|
|
4151
|
+
size: {},
|
|
3617
4152
|
modelValue: { default: "" },
|
|
3618
4153
|
numbersOnly: { type: Boolean, default: false },
|
|
3619
4154
|
clearOn: { default: "focus" }
|
|
@@ -3625,7 +4160,8 @@
|
|
|
3625
4160
|
const field = vue.inject(formFieldKey, null);
|
|
3626
4161
|
const localId = vue.useId();
|
|
3627
4162
|
const controlId = vue.computed(() => (field == null ? void 0 : field.id) ?? localId);
|
|
3628
|
-
const invalid = vue.computed(() => Boolean(field == null ? void 0 : field.invalid.value));
|
|
4163
|
+
const invalid = vue.computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
4164
|
+
const isMasked = vue.computed(() => props.masked || props.hidden);
|
|
3629
4165
|
const describedBy = vue.computed(() => field == null ? void 0 : field.describedBy.value);
|
|
3630
4166
|
const numbers = vue.ref([]);
|
|
3631
4167
|
const inputRefs = vue.ref([]);
|
|
@@ -3787,9 +4323,12 @@
|
|
|
3787
4323
|
},
|
|
3788
4324
|
{ immediate: true }
|
|
3789
4325
|
);
|
|
4326
|
+
warnDeprecated("TaoPinCode", {
|
|
4327
|
+
hidden: "use `masked`"
|
|
4328
|
+
});
|
|
3790
4329
|
return (_ctx, _cache) => {
|
|
3791
4330
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
3792
|
-
class: "tao-pin-code",
|
|
4331
|
+
class: vue.normalizeClass(["tao-pin-code", [vue.unref(sizeClass)(__props.size), { "tao-pin-code--disabled": __props.disabled }]]),
|
|
3793
4332
|
role: "group",
|
|
3794
4333
|
"aria-invalid": invalid.value || void 0,
|
|
3795
4334
|
"aria-describedby": describedBy.value
|
|
@@ -3806,7 +4345,9 @@
|
|
|
3806
4345
|
}]),
|
|
3807
4346
|
value: num,
|
|
3808
4347
|
placeholder: __props.placeholder,
|
|
3809
|
-
type:
|
|
4348
|
+
type: isMasked.value ? "password" : "text",
|
|
4349
|
+
disabled: __props.disabled,
|
|
4350
|
+
"aria-invalid": invalid.value || void 0,
|
|
3810
4351
|
inputmode: __props.numbersOnly ? "numeric" : "text",
|
|
3811
4352
|
pattern: __props.numbersOnly ? "[0-9]" : void 0,
|
|
3812
4353
|
autocomplete: "one-time-code",
|
|
@@ -3818,16 +4359,17 @@
|
|
|
3818
4359
|
onBlur
|
|
3819
4360
|
}, null, 42, _hoisted_2$n);
|
|
3820
4361
|
}), 128))
|
|
3821
|
-
],
|
|
4362
|
+
], 10, _hoisted_1$q);
|
|
3822
4363
|
};
|
|
3823
4364
|
}
|
|
3824
4365
|
});
|
|
3825
|
-
const TaoPinCode = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-
|
|
4366
|
+
const TaoPinCode = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-6f0df8bd"]]);
|
|
3826
4367
|
const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
3827
4368
|
...{ name: "TaoLink" },
|
|
3828
4369
|
__name: "TaoLink",
|
|
3829
4370
|
props: {
|
|
3830
4371
|
to: { default: void 0 },
|
|
4372
|
+
newTab: { type: Boolean, default: false },
|
|
3831
4373
|
asNewTab: { type: Boolean, default: false },
|
|
3832
4374
|
private: { type: Boolean, default: false },
|
|
3833
4375
|
exactPath: { type: Boolean, default: false }
|
|
@@ -3839,8 +4381,9 @@
|
|
|
3839
4381
|
const linkKind = globals.NuxtLink ? "nuxt" : globals.RouterLink ? "router" : "a";
|
|
3840
4382
|
const linkComponent = linkKind === "nuxt" ? globals.NuxtLink : linkKind === "router" ? globals.RouterLink : "a";
|
|
3841
4383
|
const linkProps = vue.computed(() => {
|
|
3842
|
-
const
|
|
3843
|
-
const
|
|
4384
|
+
const newTab = props.newTab || props.asNewTab;
|
|
4385
|
+
const target = newTab ? "_blank" : void 0;
|
|
4386
|
+
const rel = props.private && "noopener noreferrer" || newTab && "noopener" || void 0;
|
|
3844
4387
|
if (linkKind === "a") {
|
|
3845
4388
|
return {
|
|
3846
4389
|
href: typeof props.to === "string" ? props.to : void 0,
|
|
@@ -3855,6 +4398,9 @@
|
|
|
3855
4398
|
...linkKind === "nuxt" ? { exactPath: props.exactPath } : {}
|
|
3856
4399
|
};
|
|
3857
4400
|
});
|
|
4401
|
+
warnDeprecated("TaoLink", {
|
|
4402
|
+
asNewTab: "use `newTab`"
|
|
4403
|
+
});
|
|
3858
4404
|
return (_ctx, _cache) => {
|
|
3859
4405
|
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(linkComponent)), vue.mergeProps(linkProps.value, { draggable: "false" }), {
|
|
3860
4406
|
default: vue.withCtx(() => [
|
|
@@ -3872,7 +4418,8 @@
|
|
|
3872
4418
|
props: {
|
|
3873
4419
|
label: {},
|
|
3874
4420
|
hint: {},
|
|
3875
|
-
error: {}
|
|
4421
|
+
error: {},
|
|
4422
|
+
size: {}
|
|
3876
4423
|
},
|
|
3877
4424
|
setup(__props) {
|
|
3878
4425
|
const props = __props;
|
|
@@ -3908,7 +4455,7 @@
|
|
|
3908
4455
|
}
|
|
3909
4456
|
return (_ctx, _cache) => {
|
|
3910
4457
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
3911
|
-
class: vue.normalizeClass(["tao-form-field", { "tao-form-field--invalid": invalid.value }])
|
|
4458
|
+
class: vue.normalizeClass(["tao-form-field", [vue.unref(sizeClass)(__props.size), { "tao-form-field--invalid": invalid.value }]])
|
|
3912
4459
|
}, [
|
|
3913
4460
|
__props.label ? (vue.openBlock(), vue.createElementBlock("label", {
|
|
3914
4461
|
key: 0,
|
|
@@ -3931,7 +4478,7 @@
|
|
|
3931
4478
|
};
|
|
3932
4479
|
}
|
|
3933
4480
|
});
|
|
3934
|
-
const TaoFormField = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-
|
|
4481
|
+
const TaoFormField = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-3cf90e3a"]]);
|
|
3935
4482
|
const _hoisted_1$o = ["id", "aria-expanded", "aria-invalid", "aria-describedby", "disabled"];
|
|
3936
4483
|
const _hoisted_2$m = { class: "tao-select__value" };
|
|
3937
4484
|
const _hoisted_3$i = ["aria-activedescendant"];
|
|
@@ -3942,16 +4489,17 @@
|
|
|
3942
4489
|
props: {
|
|
3943
4490
|
modelValue: { default: null },
|
|
3944
4491
|
options: { default: () => [] },
|
|
3945
|
-
placeholder: {
|
|
4492
|
+
placeholder: {},
|
|
3946
4493
|
disabled: { type: Boolean, default: false },
|
|
3947
4494
|
error: { type: Boolean, default: false },
|
|
3948
|
-
clearText: {
|
|
4495
|
+
clearText: {},
|
|
3949
4496
|
clearable: { type: Boolean, default: true },
|
|
3950
|
-
size: {
|
|
4497
|
+
size: {}
|
|
3951
4498
|
},
|
|
3952
4499
|
emits: ["update:modelValue", "change"],
|
|
3953
4500
|
setup(__props, { emit: __emit }) {
|
|
3954
4501
|
const props = __props;
|
|
4502
|
+
const l10n = useLocaleText(props, "select");
|
|
3955
4503
|
const emit = __emit;
|
|
3956
4504
|
const field = vue.inject(formFieldKey, null);
|
|
3957
4505
|
const localId = vue.useId();
|
|
@@ -3965,6 +4513,7 @@
|
|
|
3965
4513
|
const panelRef = vue.ref(null);
|
|
3966
4514
|
const listRef = vue.ref(null);
|
|
3967
4515
|
const listStyle = vue.ref({ top: "0px", left: "0px", width: "0px" });
|
|
4516
|
+
const panelSize = vue.ref("medium");
|
|
3968
4517
|
const selected = vue.computed(() => props.options.find((option) => option.value === props.modelValue) ?? null);
|
|
3969
4518
|
const enabledIndexes = vue.computed(
|
|
3970
4519
|
() => props.options.map((option, index) => option.disabled ? -1 : index).filter((index) => index >= 0)
|
|
@@ -4121,6 +4670,7 @@
|
|
|
4121
4670
|
}
|
|
4122
4671
|
vue.watch(open, (isOpen) => {
|
|
4123
4672
|
if (isOpen) {
|
|
4673
|
+
panelSize.value = resolveSize(triggerRef.value, props.size);
|
|
4124
4674
|
document.addEventListener("pointerdown", onDocumentPointer);
|
|
4125
4675
|
window.addEventListener("resize", onViewportChange);
|
|
4126
4676
|
window.addEventListener("scroll", onViewportChange, true);
|
|
@@ -4138,7 +4688,7 @@
|
|
|
4138
4688
|
return (_ctx, _cache) => {
|
|
4139
4689
|
var _a;
|
|
4140
4690
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
4141
|
-
class: vue.normalizeClass(["tao-select", [
|
|
4691
|
+
class: vue.normalizeClass(["tao-select", [vue.unref(sizeClass)(__props.size), { "tao-select--open": open.value, "tao-select--invalid": invalid.value }]])
|
|
4142
4692
|
}, [
|
|
4143
4693
|
vue.createElementVNode("button", {
|
|
4144
4694
|
id: controlId.value,
|
|
@@ -4156,7 +4706,7 @@
|
|
|
4156
4706
|
onClick: toggle,
|
|
4157
4707
|
onKeydown: onTriggerKeydown
|
|
4158
4708
|
}, [
|
|
4159
|
-
vue.createElementVNode("span", _hoisted_2$m, vue.toDisplayString(((_a = selected.value) == null ? void 0 : _a.label) ??
|
|
4709
|
+
vue.createElementVNode("span", _hoisted_2$m, vue.toDisplayString(((_a = selected.value) == null ? void 0 : _a.label) ?? vue.unref(l10n).placeholder), 1),
|
|
4160
4710
|
vue.createElementVNode("span", {
|
|
4161
4711
|
class: vue.normalizeClass(["tao-select__chevron", { "tao-select__chevron--custom": _ctx.$slots.chevron }]),
|
|
4162
4712
|
"aria-hidden": "true"
|
|
@@ -4169,7 +4719,7 @@
|
|
|
4169
4719
|
key: 0,
|
|
4170
4720
|
ref_key: "panelRef",
|
|
4171
4721
|
ref: panelRef,
|
|
4172
|
-
class: vue.normalizeClass(["tao-select__panel",
|
|
4722
|
+
class: vue.normalizeClass(["tao-select__panel", vue.unref(sizeClass)(panelSize.value)]),
|
|
4173
4723
|
style: vue.normalizeStyle(listStyle.value)
|
|
4174
4724
|
}, [
|
|
4175
4725
|
vue.createElementVNode("ul", {
|
|
@@ -4211,7 +4761,7 @@
|
|
|
4211
4761
|
onClick: clear
|
|
4212
4762
|
}, [
|
|
4213
4763
|
vue.renderSlot(_ctx.$slots, "clear", {}, () => [
|
|
4214
|
-
vue.createTextVNode(vue.toDisplayString(
|
|
4764
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(l10n).clearText), 1)
|
|
4215
4765
|
], true)
|
|
4216
4766
|
], 32)) : vue.createCommentVNode("", true)
|
|
4217
4767
|
], 6)) : vue.createCommentVNode("", true)
|
|
@@ -4220,7 +4770,7 @@
|
|
|
4220
4770
|
};
|
|
4221
4771
|
}
|
|
4222
4772
|
});
|
|
4223
|
-
const TaoSelect = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-
|
|
4773
|
+
const TaoSelect = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-47d327a3"]]);
|
|
4224
4774
|
const _hoisted_1$n = ["id", "aria-expanded", "aria-activedescendant", "aria-invalid", "aria-describedby", "disabled", "placeholder", "value"];
|
|
4225
4775
|
const _hoisted_2$l = {
|
|
4226
4776
|
key: 0,
|
|
@@ -4233,18 +4783,19 @@
|
|
|
4233
4783
|
props: {
|
|
4234
4784
|
modelValue: { default: null },
|
|
4235
4785
|
options: { default: () => [] },
|
|
4236
|
-
placeholder: {
|
|
4786
|
+
placeholder: {},
|
|
4237
4787
|
disabled: { type: Boolean, default: false },
|
|
4238
4788
|
error: { type: Boolean, default: false },
|
|
4239
|
-
emptyText: {
|
|
4240
|
-
clearText: {
|
|
4789
|
+
emptyText: {},
|
|
4790
|
+
clearText: {},
|
|
4241
4791
|
clearable: { type: Boolean, default: true },
|
|
4242
|
-
size: {
|
|
4792
|
+
size: {},
|
|
4243
4793
|
allowCreate: { type: Boolean, default: false }
|
|
4244
4794
|
},
|
|
4245
4795
|
emits: ["update:modelValue", "change", "create"],
|
|
4246
4796
|
setup(__props, { emit: __emit }) {
|
|
4247
4797
|
const props = __props;
|
|
4798
|
+
const l10n = useLocaleText(props, "combobox");
|
|
4248
4799
|
const emit = __emit;
|
|
4249
4800
|
const field = vue.inject(formFieldKey, null);
|
|
4250
4801
|
const localId = vue.useId();
|
|
@@ -4261,6 +4812,7 @@
|
|
|
4261
4812
|
const fieldRef = vue.ref(null);
|
|
4262
4813
|
const inputRef = vue.ref(null);
|
|
4263
4814
|
const panelRef = vue.ref(null);
|
|
4815
|
+
const panelSize = vue.ref("medium");
|
|
4264
4816
|
const listRef = vue.ref(null);
|
|
4265
4817
|
const listStyle = vue.ref({ top: "0px", left: "0px", width: "0px" });
|
|
4266
4818
|
const selected = vue.computed(() => {
|
|
@@ -4590,6 +5142,7 @@
|
|
|
4590
5142
|
});
|
|
4591
5143
|
vue.watch(open, (isOpen) => {
|
|
4592
5144
|
if (isOpen) {
|
|
5145
|
+
panelSize.value = resolveSize(fieldRef.value, props.size);
|
|
4593
5146
|
document.addEventListener("pointerdown", onDocumentPointer);
|
|
4594
5147
|
window.addEventListener("resize", onViewportChange);
|
|
4595
5148
|
window.addEventListener("scroll", onViewportChange, true);
|
|
@@ -4614,7 +5167,7 @@
|
|
|
4614
5167
|
return (_ctx, _cache) => {
|
|
4615
5168
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
4616
5169
|
class: vue.normalizeClass(["tao-combobox", [
|
|
4617
|
-
|
|
5170
|
+
vue.unref(sizeClass)(__props.size),
|
|
4618
5171
|
{
|
|
4619
5172
|
"tao-combobox--open": open.value,
|
|
4620
5173
|
"tao-combobox--invalid": invalid.value,
|
|
@@ -4644,7 +5197,7 @@
|
|
|
4644
5197
|
"aria-invalid": invalid.value || void 0,
|
|
4645
5198
|
"aria-describedby": describedBy.value,
|
|
4646
5199
|
disabled: __props.disabled,
|
|
4647
|
-
placeholder:
|
|
5200
|
+
placeholder: vue.unref(l10n).placeholder,
|
|
4648
5201
|
value: query.value,
|
|
4649
5202
|
onInput: _cache[0] || (_cache[0] = ($event) => {
|
|
4650
5203
|
query.value = $event.target.value;
|
|
@@ -4666,7 +5219,7 @@
|
|
|
4666
5219
|
key: 0,
|
|
4667
5220
|
ref_key: "panelRef",
|
|
4668
5221
|
ref: panelRef,
|
|
4669
|
-
class: vue.normalizeClass(["tao-combobox__panel",
|
|
5222
|
+
class: vue.normalizeClass(["tao-combobox__panel", vue.unref(sizeClass)(panelSize.value)]),
|
|
4670
5223
|
style: vue.normalizeStyle(listStyle.value)
|
|
4671
5224
|
}, [
|
|
4672
5225
|
vue.createElementVNode("ul", {
|
|
@@ -4678,7 +5231,7 @@
|
|
|
4678
5231
|
}, [
|
|
4679
5232
|
!rows.value.length ? (vue.openBlock(), vue.createElementBlock("li", _hoisted_2$l, [
|
|
4680
5233
|
vue.renderSlot(_ctx.$slots, "empty", {}, () => [
|
|
4681
|
-
vue.createTextVNode(vue.toDisplayString(
|
|
5234
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(l10n).emptyText), 1)
|
|
4682
5235
|
], true)
|
|
4683
5236
|
])) : vue.createCommentVNode("", true),
|
|
4684
5237
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(rows.value, (row, index) => {
|
|
@@ -4702,7 +5255,7 @@
|
|
|
4702
5255
|
row.kind === "create" ? vue.renderSlot(_ctx.$slots, "create", {
|
|
4703
5256
|
text: row.text
|
|
4704
5257
|
}, () => [
|
|
4705
|
-
vue.createTextVNode(
|
|
5258
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(formatText)(vue.unref(taoLocale)().combobox.createText, { text: row.text })), 1)
|
|
4706
5259
|
], true, 0) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
4707
5260
|
vue.createTextVNode(vue.toDisplayString(row.option.label), 1)
|
|
4708
5261
|
], 64))
|
|
@@ -4717,7 +5270,7 @@
|
|
|
4717
5270
|
onClick: clear
|
|
4718
5271
|
}, [
|
|
4719
5272
|
vue.renderSlot(_ctx.$slots, "clear", {}, () => [
|
|
4720
|
-
vue.createTextVNode(vue.toDisplayString(
|
|
5273
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(l10n).clearText), 1)
|
|
4721
5274
|
], true)
|
|
4722
5275
|
], 32)) : vue.createCommentVNode("", true)
|
|
4723
5276
|
], 6)) : vue.createCommentVNode("", true)
|
|
@@ -4726,7 +5279,7 @@
|
|
|
4726
5279
|
};
|
|
4727
5280
|
}
|
|
4728
5281
|
});
|
|
4729
|
-
const TaoCombobox = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-
|
|
5282
|
+
const TaoCombobox = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-e75a5550"]]);
|
|
4730
5283
|
const ISO_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
4731
5284
|
function formatTaoDateIso(parts) {
|
|
4732
5285
|
return `${String(parts.y).padStart(4, "0")}-${String(parts.m).padStart(2, "0")}-${String(parts.d).padStart(2, "0")}`;
|
|
@@ -4898,20 +5451,23 @@
|
|
|
4898
5451
|
__name: "TaoDate",
|
|
4899
5452
|
props: {
|
|
4900
5453
|
modelValue: { default: null },
|
|
4901
|
-
placeholder: {
|
|
5454
|
+
placeholder: {},
|
|
4902
5455
|
disabled: { type: Boolean, default: false },
|
|
5456
|
+
size: {},
|
|
4903
5457
|
error: { type: Boolean, default: false },
|
|
4904
5458
|
min: { default: void 0 },
|
|
4905
5459
|
max: { default: void 0 },
|
|
4906
|
-
locale: {
|
|
4907
|
-
todayText: {
|
|
4908
|
-
clearText: {
|
|
4909
|
-
prevMonthLabel: {
|
|
4910
|
-
nextMonthLabel: {
|
|
5460
|
+
locale: {},
|
|
5461
|
+
todayText: {},
|
|
5462
|
+
clearText: {},
|
|
5463
|
+
prevMonthLabel: {},
|
|
5464
|
+
nextMonthLabel: {}
|
|
4911
5465
|
},
|
|
4912
5466
|
emits: ["update:modelValue", "change"],
|
|
4913
5467
|
setup(__props, { emit: __emit }) {
|
|
4914
5468
|
const props = __props;
|
|
5469
|
+
const l10n = useLocaleText(props, "date");
|
|
5470
|
+
const dateLocale = vue.computed(() => props.locale ?? taoLocale().code);
|
|
4915
5471
|
const emit = __emit;
|
|
4916
5472
|
const field = vue.inject(formFieldKey, null);
|
|
4917
5473
|
const localId = vue.useId();
|
|
@@ -4930,9 +5486,9 @@
|
|
|
4930
5486
|
const parsed = parseTaoDate(props.modelValue);
|
|
4931
5487
|
return parsed ? formatTaoDateIso(parsed) : null;
|
|
4932
5488
|
});
|
|
4933
|
-
const displayLabel = vue.computed(() => valueIso.value ? formatTaoDateLabel(valueIso.value,
|
|
4934
|
-
const weekdays = vue.computed(() => taoWeekdayLabels(
|
|
4935
|
-
const monthLabel = vue.computed(() => formatTaoMonthLabel(viewYear.value, viewMonth.value,
|
|
5489
|
+
const displayLabel = vue.computed(() => valueIso.value ? formatTaoDateLabel(valueIso.value, dateLocale.value) : "");
|
|
5490
|
+
const weekdays = vue.computed(() => taoWeekdayLabels(dateLocale.value));
|
|
5491
|
+
const monthLabel = vue.computed(() => formatTaoMonthLabel(viewYear.value, viewMonth.value, dateLocale.value));
|
|
4936
5492
|
const cells = vue.computed(() => buildTaoDateGrid(viewYear.value, viewMonth.value));
|
|
4937
5493
|
const todayIso = vue.computed(() => todayTaoDate());
|
|
4938
5494
|
const todayEnabled = vue.computed(() => isTaoDateInRange(todayIso.value, props.min, props.max));
|
|
@@ -5104,7 +5660,7 @@
|
|
|
5104
5660
|
});
|
|
5105
5661
|
return (_ctx, _cache) => {
|
|
5106
5662
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
5107
|
-
class: vue.normalizeClass(["tao-date", { "tao-date--open": open.value, "tao-date--invalid": invalid.value }])
|
|
5663
|
+
class: vue.normalizeClass(["tao-date", [vue.unref(sizeClass)(__props.size), { "tao-date--open": open.value, "tao-date--invalid": invalid.value }]])
|
|
5108
5664
|
}, [
|
|
5109
5665
|
vue.createElementVNode("button", {
|
|
5110
5666
|
id: controlId.value,
|
|
@@ -5122,7 +5678,7 @@
|
|
|
5122
5678
|
onClick: toggle,
|
|
5123
5679
|
onKeydown: onTriggerKeydown
|
|
5124
5680
|
}, [
|
|
5125
|
-
vue.createElementVNode("span", _hoisted_2$k, vue.toDisplayString(displayLabel.value ||
|
|
5681
|
+
vue.createElementVNode("span", _hoisted_2$k, vue.toDisplayString(displayLabel.value || vue.unref(l10n).placeholder), 1),
|
|
5126
5682
|
vue.createElementVNode("span", _hoisted_3$g, [
|
|
5127
5683
|
vue.renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
5128
5684
|
_cache[4] || (_cache[4] = vue.createElementVNode("svg", {
|
|
@@ -5169,7 +5725,7 @@
|
|
|
5169
5725
|
vue.createElementVNode("button", {
|
|
5170
5726
|
type: "button",
|
|
5171
5727
|
class: "tao-date__nav",
|
|
5172
|
-
"aria-label":
|
|
5728
|
+
"aria-label": vue.unref(l10n).prevMonthLabel,
|
|
5173
5729
|
onClick: _cache[0] || (_cache[0] = ($event) => goMonth(-1))
|
|
5174
5730
|
}, [
|
|
5175
5731
|
vue.createElementVNode("span", _hoisted_7$9, [
|
|
@@ -5196,7 +5752,7 @@
|
|
|
5196
5752
|
vue.createElementVNode("button", {
|
|
5197
5753
|
type: "button",
|
|
5198
5754
|
class: "tao-date__nav",
|
|
5199
|
-
"aria-label":
|
|
5755
|
+
"aria-label": vue.unref(l10n).nextMonthLabel,
|
|
5200
5756
|
onClick: _cache[1] || (_cache[1] = ($event) => goMonth(1))
|
|
5201
5757
|
}, [
|
|
5202
5758
|
vue.createElementVNode("span", _hoisted_10$3, [
|
|
@@ -5238,7 +5794,7 @@
|
|
|
5238
5794
|
"tao-date__day--disabled": !vue.unref(isTaoDateInRange)(cell.iso, __props.min, __props.max)
|
|
5239
5795
|
}]),
|
|
5240
5796
|
role: "gridcell",
|
|
5241
|
-
"aria-label": vue.unref(formatTaoDateLabel)(cell.iso,
|
|
5797
|
+
"aria-label": vue.unref(formatTaoDateLabel)(cell.iso, dateLocale.value),
|
|
5242
5798
|
"aria-selected": cell.iso === valueIso.value,
|
|
5243
5799
|
disabled: !vue.unref(isTaoDateInRange)(cell.iso, __props.min, __props.max),
|
|
5244
5800
|
onMousedown: _cache[2] || (_cache[2] = vue.withModifiers(() => {
|
|
@@ -5255,7 +5811,7 @@
|
|
|
5255
5811
|
onClick: _cache[3] || (_cache[3] = ($event) => selectDay(todayIso.value))
|
|
5256
5812
|
}, [
|
|
5257
5813
|
vue.renderSlot(_ctx.$slots, "today", {}, () => [
|
|
5258
|
-
vue.createTextVNode(vue.toDisplayString(
|
|
5814
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(l10n).todayText), 1)
|
|
5259
5815
|
], true)
|
|
5260
5816
|
], 8, _hoisted_15),
|
|
5261
5817
|
valueIso.value ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
@@ -5265,7 +5821,7 @@
|
|
|
5265
5821
|
onClick: clear
|
|
5266
5822
|
}, [
|
|
5267
5823
|
vue.renderSlot(_ctx.$slots, "clear", {}, () => [
|
|
5268
|
-
vue.createTextVNode(vue.toDisplayString(
|
|
5824
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(l10n).clearText), 1)
|
|
5269
5825
|
], true)
|
|
5270
5826
|
])) : vue.createCommentVNode("", true)
|
|
5271
5827
|
])
|
|
@@ -5275,7 +5831,7 @@
|
|
|
5275
5831
|
};
|
|
5276
5832
|
}
|
|
5277
5833
|
});
|
|
5278
|
-
const TaoDate = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-
|
|
5834
|
+
const TaoDate = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-97f71e11"]]);
|
|
5279
5835
|
const _hoisted_1$l = ["id", "aria-expanded", "aria-invalid", "aria-describedby", "disabled"];
|
|
5280
5836
|
const _hoisted_2$j = { class: "tao-date-range__value" };
|
|
5281
5837
|
const _hoisted_3$f = {
|
|
@@ -5301,20 +5857,23 @@
|
|
|
5301
5857
|
__name: "TaoDateRange",
|
|
5302
5858
|
props: {
|
|
5303
5859
|
modelValue: { default: null },
|
|
5304
|
-
placeholder: {
|
|
5860
|
+
placeholder: {},
|
|
5305
5861
|
disabled: { type: Boolean, default: false },
|
|
5862
|
+
size: {},
|
|
5306
5863
|
error: { type: Boolean, default: false },
|
|
5307
5864
|
min: { default: void 0 },
|
|
5308
5865
|
max: { default: void 0 },
|
|
5309
|
-
locale: {
|
|
5310
|
-
todayText: {
|
|
5311
|
-
clearText: {
|
|
5312
|
-
prevMonthLabel: {
|
|
5313
|
-
nextMonthLabel: {
|
|
5866
|
+
locale: {},
|
|
5867
|
+
todayText: {},
|
|
5868
|
+
clearText: {},
|
|
5869
|
+
prevMonthLabel: {},
|
|
5870
|
+
nextMonthLabel: {}
|
|
5314
5871
|
},
|
|
5315
5872
|
emits: ["update:modelValue", "change"],
|
|
5316
5873
|
setup(__props, { emit: __emit }) {
|
|
5317
5874
|
const props = __props;
|
|
5875
|
+
const l10n = useLocaleText(props, "dateRange");
|
|
5876
|
+
const dateLocale = vue.computed(() => props.locale ?? taoLocale().code);
|
|
5318
5877
|
const emit = __emit;
|
|
5319
5878
|
const field = vue.inject(formFieldKey, null);
|
|
5320
5879
|
const localId = vue.useId();
|
|
@@ -5339,10 +5898,10 @@
|
|
|
5339
5898
|
return committed.value;
|
|
5340
5899
|
});
|
|
5341
5900
|
const displayLabel = vue.computed(
|
|
5342
|
-
() => committed.value ? formatTaoDateRangeLabel(committed.value.start, committed.value.end,
|
|
5901
|
+
() => committed.value ? formatTaoDateRangeLabel(committed.value.start, committed.value.end, dateLocale.value) : ""
|
|
5343
5902
|
);
|
|
5344
|
-
const weekdays = vue.computed(() => taoWeekdayLabels(
|
|
5345
|
-
const monthLabel = vue.computed(() => formatTaoMonthLabel(viewYear.value, viewMonth.value,
|
|
5903
|
+
const weekdays = vue.computed(() => taoWeekdayLabels(dateLocale.value));
|
|
5904
|
+
const monthLabel = vue.computed(() => formatTaoMonthLabel(viewYear.value, viewMonth.value, dateLocale.value));
|
|
5346
5905
|
const cells = vue.computed(() => buildTaoDateGrid(viewYear.value, viewMonth.value));
|
|
5347
5906
|
const todayIso = vue.computed(() => todayTaoDate());
|
|
5348
5907
|
const todayEnabled = vue.computed(() => isTaoDateInRange(todayIso.value, props.min, props.max));
|
|
@@ -5561,7 +6120,7 @@
|
|
|
5561
6120
|
});
|
|
5562
6121
|
return (_ctx, _cache) => {
|
|
5563
6122
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
5564
|
-
class: vue.normalizeClass(["tao-date-range", { "tao-date-range--open": open.value, "tao-date-range--invalid": invalid.value }])
|
|
6123
|
+
class: vue.normalizeClass(["tao-date-range", [vue.unref(sizeClass)(__props.size), { "tao-date-range--open": open.value, "tao-date-range--invalid": invalid.value }]])
|
|
5565
6124
|
}, [
|
|
5566
6125
|
vue.createElementVNode("button", {
|
|
5567
6126
|
id: controlId.value,
|
|
@@ -5579,7 +6138,7 @@
|
|
|
5579
6138
|
onClick: toggle,
|
|
5580
6139
|
onKeydown: onTriggerKeydown
|
|
5581
6140
|
}, [
|
|
5582
|
-
vue.createElementVNode("span", _hoisted_2$j, vue.toDisplayString(displayLabel.value ||
|
|
6141
|
+
vue.createElementVNode("span", _hoisted_2$j, vue.toDisplayString(displayLabel.value || vue.unref(l10n).placeholder), 1),
|
|
5583
6142
|
vue.createElementVNode("span", _hoisted_3$f, [
|
|
5584
6143
|
vue.renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
5585
6144
|
_cache[3] || (_cache[3] = vue.createElementVNode("svg", {
|
|
@@ -5626,7 +6185,7 @@
|
|
|
5626
6185
|
vue.createElementVNode("button", {
|
|
5627
6186
|
type: "button",
|
|
5628
6187
|
class: "tao-date__nav",
|
|
5629
|
-
"aria-label":
|
|
6188
|
+
"aria-label": vue.unref(l10n).prevMonthLabel,
|
|
5630
6189
|
onClick: _cache[0] || (_cache[0] = ($event) => goMonth(-1))
|
|
5631
6190
|
}, [
|
|
5632
6191
|
vue.createElementVNode("span", _hoisted_7$8, [
|
|
@@ -5653,7 +6212,7 @@
|
|
|
5653
6212
|
vue.createElementVNode("button", {
|
|
5654
6213
|
type: "button",
|
|
5655
6214
|
class: "tao-date__nav",
|
|
5656
|
-
"aria-label":
|
|
6215
|
+
"aria-label": vue.unref(l10n).nextMonthLabel,
|
|
5657
6216
|
onClick: _cache[1] || (_cache[1] = ($event) => goMonth(1))
|
|
5658
6217
|
}, [
|
|
5659
6218
|
vue.createElementVNode("span", _hoisted_10$2, [
|
|
@@ -5703,7 +6262,7 @@
|
|
|
5703
6262
|
"tao-date__day--disabled": !vue.unref(isTaoDateInRange)(cell.iso, __props.min, __props.max)
|
|
5704
6263
|
}]),
|
|
5705
6264
|
role: "gridcell",
|
|
5706
|
-
"aria-label": vue.unref(formatTaoDateLabel)(cell.iso,
|
|
6265
|
+
"aria-label": vue.unref(formatTaoDateLabel)(cell.iso, dateLocale.value),
|
|
5707
6266
|
"aria-selected": daySelected(cell.iso),
|
|
5708
6267
|
disabled: !vue.unref(isTaoDateInRange)(cell.iso, __props.min, __props.max),
|
|
5709
6268
|
onMousedown: _cache[2] || (_cache[2] = vue.withModifiers(() => {
|
|
@@ -5721,7 +6280,7 @@
|
|
|
5721
6280
|
onClick: selectToday
|
|
5722
6281
|
}, [
|
|
5723
6282
|
vue.renderSlot(_ctx.$slots, "today", {}, () => [
|
|
5724
|
-
vue.createTextVNode(vue.toDisplayString(
|
|
6283
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(l10n).todayText), 1)
|
|
5725
6284
|
], true)
|
|
5726
6285
|
], 8, _hoisted_14),
|
|
5727
6286
|
committed.value ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
@@ -5731,7 +6290,7 @@
|
|
|
5731
6290
|
onClick: clear
|
|
5732
6291
|
}, [
|
|
5733
6292
|
vue.renderSlot(_ctx.$slots, "clear", {}, () => [
|
|
5734
|
-
vue.createTextVNode(vue.toDisplayString(
|
|
6293
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(l10n).clearText), 1)
|
|
5735
6294
|
], true)
|
|
5736
6295
|
])) : vue.createCommentVNode("", true)
|
|
5737
6296
|
])
|
|
@@ -5741,7 +6300,7 @@
|
|
|
5741
6300
|
};
|
|
5742
6301
|
}
|
|
5743
6302
|
});
|
|
5744
|
-
const TaoDateRange = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-
|
|
6303
|
+
const TaoDateRange = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-da3794c7"]]);
|
|
5745
6304
|
const _hoisted_1$k = ["for"];
|
|
5746
6305
|
const _hoisted_2$i = ["id", "checked", "disabled", "aria-checked", "aria-invalid", "aria-describedby"];
|
|
5747
6306
|
const _hoisted_3$e = {
|
|
@@ -5758,7 +6317,9 @@
|
|
|
5758
6317
|
props: {
|
|
5759
6318
|
modelValue: { type: Boolean, default: false },
|
|
5760
6319
|
label: { default: "" },
|
|
5761
|
-
disabled: { type: Boolean, default: false }
|
|
6320
|
+
disabled: { type: Boolean, default: false },
|
|
6321
|
+
error: { type: Boolean, default: false },
|
|
6322
|
+
size: {}
|
|
5762
6323
|
},
|
|
5763
6324
|
emits: ["update:modelValue", "change"],
|
|
5764
6325
|
setup(__props, { emit: __emit }) {
|
|
@@ -5767,7 +6328,7 @@
|
|
|
5767
6328
|
const field = vue.inject(formFieldKey, null);
|
|
5768
6329
|
const localId = vue.useId();
|
|
5769
6330
|
const controlId = vue.computed(() => (field == null ? void 0 : field.id) ?? localId);
|
|
5770
|
-
const invalid = vue.computed(() => Boolean(field == null ? void 0 : field.invalid.value));
|
|
6331
|
+
const invalid = vue.computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
5771
6332
|
const describedBy = vue.computed(() => field == null ? void 0 : field.describedBy.value);
|
|
5772
6333
|
function toggle() {
|
|
5773
6334
|
if (props.disabled) {
|
|
@@ -5779,7 +6340,7 @@
|
|
|
5779
6340
|
}
|
|
5780
6341
|
return (_ctx, _cache) => {
|
|
5781
6342
|
return vue.openBlock(), vue.createElementBlock("label", {
|
|
5782
|
-
class: vue.normalizeClass(["tao-switch", { "tao-switch--disabled": __props.disabled, "tao-switch--on": __props.modelValue, "tao-switch--invalid": invalid.value }]),
|
|
6343
|
+
class: vue.normalizeClass(["tao-switch", [vue.unref(sizeClass)(__props.size), { "tao-switch--disabled": __props.disabled, "tao-switch--on": __props.modelValue, "tao-switch--invalid": invalid.value }]]),
|
|
5783
6344
|
for: controlId.value
|
|
5784
6345
|
}, [
|
|
5785
6346
|
vue.createElementVNode("input", {
|
|
@@ -5807,7 +6368,7 @@
|
|
|
5807
6368
|
};
|
|
5808
6369
|
}
|
|
5809
6370
|
});
|
|
5810
|
-
const TaoSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-
|
|
6371
|
+
const TaoSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-28965b34"]]);
|
|
5811
6372
|
const radioGroupKey = Symbol("taoRadioGroup");
|
|
5812
6373
|
const _hoisted_1$j = ["for"];
|
|
5813
6374
|
const _hoisted_2$h = ["id", "name", "value", "checked", "disabled", "aria-invalid", "aria-describedby"];
|
|
@@ -5827,7 +6388,9 @@
|
|
|
5827
6388
|
modelValue: { type: [String, Number, Boolean] },
|
|
5828
6389
|
name: {},
|
|
5829
6390
|
label: { default: "" },
|
|
5830
|
-
disabled: { type: Boolean, default: false }
|
|
6391
|
+
disabled: { type: Boolean, default: false },
|
|
6392
|
+
error: { type: Boolean, default: false },
|
|
6393
|
+
size: {}
|
|
5831
6394
|
},
|
|
5832
6395
|
emits: ["update:modelValue", "change"],
|
|
5833
6396
|
setup(__props, { emit: __emit }) {
|
|
@@ -5837,13 +6400,13 @@
|
|
|
5837
6400
|
const field = vue.inject(formFieldKey, null);
|
|
5838
6401
|
const localId = vue.useId();
|
|
5839
6402
|
const controlId = vue.computed(() => group ? localId : (field == null ? void 0 : field.id) ?? localId);
|
|
5840
|
-
const invalid = vue.computed(() => Boolean(field == null ? void 0 : field.invalid.value));
|
|
6403
|
+
const invalid = vue.computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
5841
6404
|
const describedBy = vue.computed(() => group ? void 0 : field == null ? void 0 : field.describedBy.value);
|
|
5842
6405
|
const isDisabled = vue.computed(() => props.disabled || Boolean(group == null ? void 0 : group.disabled.value));
|
|
5843
6406
|
const inputName = vue.computed(() => (group == null ? void 0 : group.name.value) ?? props.name);
|
|
5844
6407
|
const isChecked = vue.computed(() => {
|
|
5845
|
-
const
|
|
5846
|
-
return
|
|
6408
|
+
const current2 = group ? group.model.value : props.modelValue;
|
|
6409
|
+
return current2 === props.value;
|
|
5847
6410
|
});
|
|
5848
6411
|
function onChange() {
|
|
5849
6412
|
if (isDisabled.value) {
|
|
@@ -5858,7 +6421,7 @@
|
|
|
5858
6421
|
}
|
|
5859
6422
|
return (_ctx, _cache) => {
|
|
5860
6423
|
return vue.openBlock(), vue.createElementBlock("label", {
|
|
5861
|
-
class: vue.normalizeClass(["tao-radio", { "tao-radio--disabled": isDisabled.value, "tao-radio--invalid": invalid.value && !vue.unref(group) }]),
|
|
6424
|
+
class: vue.normalizeClass(["tao-radio", [vue.unref(sizeClass)(__props.size), { "tao-radio--disabled": isDisabled.value, "tao-radio--invalid": invalid.value && !vue.unref(group) }]]),
|
|
5862
6425
|
for: controlId.value
|
|
5863
6426
|
}, [
|
|
5864
6427
|
vue.createElementVNode("input", {
|
|
@@ -5884,7 +6447,7 @@
|
|
|
5884
6447
|
};
|
|
5885
6448
|
}
|
|
5886
6449
|
});
|
|
5887
|
-
const TaoRadio = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-
|
|
6450
|
+
const TaoRadio = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-70ac1c11"]]);
|
|
5888
6451
|
const _hoisted_1$i = ["id", "disabled", "aria-describedby", "aria-invalid", "aria-labelledby"];
|
|
5889
6452
|
const _hoisted_2$g = {
|
|
5890
6453
|
key: 0,
|
|
@@ -5898,7 +6461,9 @@
|
|
|
5898
6461
|
name: {},
|
|
5899
6462
|
legend: {},
|
|
5900
6463
|
disabled: { type: Boolean, default: false },
|
|
5901
|
-
|
|
6464
|
+
error: { type: Boolean, default: false },
|
|
6465
|
+
direction: { default: "row" },
|
|
6466
|
+
size: {}
|
|
5902
6467
|
},
|
|
5903
6468
|
emits: ["update:modelValue", "change"],
|
|
5904
6469
|
setup(__props, { emit: __emit }) {
|
|
@@ -5909,7 +6474,7 @@
|
|
|
5909
6474
|
const groupName = vue.computed(() => props.name || autoName);
|
|
5910
6475
|
const model = vue.computed(() => props.modelValue);
|
|
5911
6476
|
const groupDisabled = vue.computed(() => props.disabled);
|
|
5912
|
-
const invalid = vue.computed(() => Boolean(field == null ? void 0 : field.invalid.value));
|
|
6477
|
+
const invalid = vue.computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
5913
6478
|
const describedBy = vue.computed(() => field == null ? void 0 : field.describedBy.value);
|
|
5914
6479
|
const labelledBy = vue.computed(() => props.legend || !field ? void 0 : `${field.id}-label`);
|
|
5915
6480
|
function setValue(value) {
|
|
@@ -5926,7 +6491,7 @@
|
|
|
5926
6491
|
var _a;
|
|
5927
6492
|
return vue.openBlock(), vue.createElementBlock("fieldset", {
|
|
5928
6493
|
id: (_a = vue.unref(field)) == null ? void 0 : _a.id,
|
|
5929
|
-
class: vue.normalizeClass(["tao-radio-group", [`tao-radio-group--${__props.direction}`, { "tao-radio-group--invalid": invalid.value }]]),
|
|
6494
|
+
class: vue.normalizeClass(["tao-radio-group", [`tao-radio-group--${__props.direction}`, vue.unref(sizeClass)(__props.size), { "tao-radio-group--invalid": invalid.value }]]),
|
|
5930
6495
|
disabled: __props.disabled,
|
|
5931
6496
|
"aria-describedby": describedBy.value,
|
|
5932
6497
|
"aria-invalid": invalid.value || void 0,
|
|
@@ -5938,7 +6503,7 @@
|
|
|
5938
6503
|
};
|
|
5939
6504
|
}
|
|
5940
6505
|
});
|
|
5941
|
-
const TaoRadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-
|
|
6506
|
+
const TaoRadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-c76ef504"]]);
|
|
5942
6507
|
const segmentedKey = Symbol("taoSegmented");
|
|
5943
6508
|
const _hoisted_1$h = ["disabled", "aria-describedby", "aria-invalid", "aria-labelledby", "id"];
|
|
5944
6509
|
const _hoisted_2$f = {
|
|
@@ -5953,7 +6518,8 @@
|
|
|
5953
6518
|
name: {},
|
|
5954
6519
|
legend: {},
|
|
5955
6520
|
disabled: { type: Boolean, default: false },
|
|
5956
|
-
|
|
6521
|
+
error: { type: Boolean, default: false },
|
|
6522
|
+
size: {},
|
|
5957
6523
|
block: { type: Boolean, default: false }
|
|
5958
6524
|
},
|
|
5959
6525
|
emits: ["update:modelValue", "change"],
|
|
@@ -5965,8 +6531,7 @@
|
|
|
5965
6531
|
const groupName = vue.computed(() => props.name || autoName);
|
|
5966
6532
|
const model = vue.computed(() => props.modelValue);
|
|
5967
6533
|
const groupDisabled = vue.computed(() => props.disabled);
|
|
5968
|
-
const
|
|
5969
|
-
const invalid = vue.computed(() => Boolean(field == null ? void 0 : field.invalid.value));
|
|
6534
|
+
const invalid = vue.computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
5970
6535
|
const describedBy = vue.computed(() => field == null ? void 0 : field.describedBy.value);
|
|
5971
6536
|
const trackRef = vue.ref(null);
|
|
5972
6537
|
const thumbStyle = vue.ref({ opacity: "0" });
|
|
@@ -6006,7 +6571,6 @@
|
|
|
6006
6571
|
name: groupName,
|
|
6007
6572
|
model,
|
|
6008
6573
|
disabled: groupDisabled,
|
|
6009
|
-
size: groupSize,
|
|
6010
6574
|
setValue
|
|
6011
6575
|
});
|
|
6012
6576
|
vue.onMounted(() => {
|
|
@@ -6043,7 +6607,7 @@
|
|
|
6043
6607
|
var _a;
|
|
6044
6608
|
return vue.openBlock(), vue.createElementBlock("fieldset", {
|
|
6045
6609
|
class: vue.normalizeClass(["tao-segmented", [
|
|
6046
|
-
|
|
6610
|
+
vue.unref(sizeClass)(__props.size),
|
|
6047
6611
|
{
|
|
6048
6612
|
"tao-segmented--block": __props.block,
|
|
6049
6613
|
"tao-segmented--disabled": __props.disabled,
|
|
@@ -6073,7 +6637,7 @@
|
|
|
6073
6637
|
};
|
|
6074
6638
|
}
|
|
6075
6639
|
});
|
|
6076
|
-
const TaoSegmented = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-
|
|
6640
|
+
const TaoSegmented = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-7dc6820f"]]);
|
|
6077
6641
|
const _hoisted_1$g = ["for"];
|
|
6078
6642
|
const _hoisted_2$e = ["id", "name", "value", "checked", "disabled", "aria-label"];
|
|
6079
6643
|
const _hoisted_3$c = { class: "tao-segmented-option__face" };
|
|
@@ -6116,10 +6680,9 @@
|
|
|
6116
6680
|
const localId = vue.useId();
|
|
6117
6681
|
const isDisabled = vue.computed(() => props.disabled || Boolean(group == null ? void 0 : group.disabled.value));
|
|
6118
6682
|
const inputName = vue.computed(() => (group == null ? void 0 : group.name.value) ?? props.name);
|
|
6119
|
-
const size = vue.computed(() => (group == null ? void 0 : group.size.value) ?? "medium");
|
|
6120
6683
|
const isChecked = vue.computed(() => {
|
|
6121
|
-
const
|
|
6122
|
-
return
|
|
6684
|
+
const current2 = group ? group.model.value : props.modelValue;
|
|
6685
|
+
return current2 === props.value;
|
|
6123
6686
|
});
|
|
6124
6687
|
const hasLabel = vue.computed(() => Boolean(props.label || slots.default));
|
|
6125
6688
|
const isIconOnly = vue.computed(() => Boolean((props.icon || slots.icon) && !hasLabel.value));
|
|
@@ -6148,14 +6711,11 @@
|
|
|
6148
6711
|
}
|
|
6149
6712
|
return (_ctx, _cache) => {
|
|
6150
6713
|
return vue.openBlock(), vue.createElementBlock("label", {
|
|
6151
|
-
class: vue.normalizeClass(["tao-segmented-option",
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
"tao-segmented-option--icon-only": isIconOnly.value
|
|
6157
|
-
}
|
|
6158
|
-
]]),
|
|
6714
|
+
class: vue.normalizeClass(["tao-segmented-option", {
|
|
6715
|
+
"tao-segmented-option--checked": isChecked.value,
|
|
6716
|
+
"tao-segmented-option--disabled": props.disabled,
|
|
6717
|
+
"tao-segmented-option--icon-only": isIconOnly.value
|
|
6718
|
+
}]),
|
|
6159
6719
|
for: vue.unref(localId)
|
|
6160
6720
|
}, [
|
|
6161
6721
|
vue.createElementVNode("input", {
|
|
@@ -6186,7 +6746,7 @@
|
|
|
6186
6746
|
};
|
|
6187
6747
|
}
|
|
6188
6748
|
});
|
|
6189
|
-
const TaoSegmentedOption = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-
|
|
6749
|
+
const TaoSegmentedOption = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-fba7ca12"]]);
|
|
6190
6750
|
const _hoisted_1$f = ["role", "aria-live"];
|
|
6191
6751
|
const _hoisted_2$d = { class: "tao-alert__body" };
|
|
6192
6752
|
const _hoisted_3$b = {
|
|
@@ -6203,21 +6763,31 @@
|
|
|
6203
6763
|
...{ name: "TaoAlert" },
|
|
6204
6764
|
__name: "TaoAlert",
|
|
6205
6765
|
props: {
|
|
6206
|
-
|
|
6766
|
+
tone: { default: void 0 },
|
|
6767
|
+
type: { default: void 0 },
|
|
6207
6768
|
title: { default: "" },
|
|
6208
6769
|
closable: { type: Boolean, default: false },
|
|
6209
|
-
closeLabel: {
|
|
6770
|
+
closeLabel: {}
|
|
6210
6771
|
},
|
|
6211
6772
|
emits: ["close"],
|
|
6212
6773
|
setup(__props, { emit: __emit }) {
|
|
6213
6774
|
const props = __props;
|
|
6775
|
+
const l10n = useLocaleText(props, "alert");
|
|
6214
6776
|
const emit = __emit;
|
|
6215
|
-
const
|
|
6216
|
-
|
|
6777
|
+
const resolvedTone = vue.computed(() => {
|
|
6778
|
+
const value = props.tone ?? props.type ?? "info";
|
|
6779
|
+
return value === "danger" ? "error" : value;
|
|
6780
|
+
});
|
|
6781
|
+
const live = vue.computed(
|
|
6782
|
+
() => resolvedTone.value === "error" || resolvedTone.value === "warning" ? "assertive" : "polite"
|
|
6783
|
+
);
|
|
6784
|
+
warnDeprecated("TaoAlert", {
|
|
6785
|
+
type: "use `tone`"
|
|
6786
|
+
});
|
|
6217
6787
|
return (_ctx, _cache) => {
|
|
6218
6788
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
6219
|
-
class: vue.normalizeClass(["tao-alert", `tao-alert--${
|
|
6220
|
-
role:
|
|
6789
|
+
class: vue.normalizeClass(["tao-alert", `tao-alert--${resolvedTone.value}`]),
|
|
6790
|
+
role: resolvedTone.value === "error" ? "alert" : "status",
|
|
6221
6791
|
"aria-live": live.value
|
|
6222
6792
|
}, [
|
|
6223
6793
|
vue.createElementVNode("div", _hoisted_2$d, [
|
|
@@ -6230,7 +6800,7 @@
|
|
|
6230
6800
|
key: 0,
|
|
6231
6801
|
type: "button",
|
|
6232
6802
|
class: "tao-alert__close",
|
|
6233
|
-
"aria-label":
|
|
6803
|
+
"aria-label": vue.unref(l10n).closeLabel,
|
|
6234
6804
|
onClick: _cache[0] || (_cache[0] = ($event) => emit("close"))
|
|
6235
6805
|
}, [
|
|
6236
6806
|
vue.createElementVNode("span", _hoisted_6$8, [
|
|
@@ -6243,7 +6813,7 @@
|
|
|
6243
6813
|
};
|
|
6244
6814
|
}
|
|
6245
6815
|
});
|
|
6246
|
-
const TaoAlert = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-
|
|
6816
|
+
const TaoAlert = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-94376652"]]);
|
|
6247
6817
|
const _hoisted_1$e = { key: 0 };
|
|
6248
6818
|
const _hoisted_2$c = ["aria-sort"];
|
|
6249
6819
|
const _hoisted_3$a = ["onClick"];
|
|
@@ -6264,8 +6834,9 @@
|
|
|
6264
6834
|
rows: { default: () => [] },
|
|
6265
6835
|
rowKey: { type: [String, Function], default: "id" },
|
|
6266
6836
|
loading: { type: Boolean, default: false },
|
|
6267
|
-
emptyText: {
|
|
6837
|
+
emptyText: {},
|
|
6268
6838
|
striped: { type: [Boolean, String], default: false },
|
|
6839
|
+
size: {},
|
|
6269
6840
|
compact: { type: Boolean, default: false },
|
|
6270
6841
|
hover: { type: Boolean, default: true },
|
|
6271
6842
|
head: { type: Boolean, default: true },
|
|
@@ -6276,9 +6847,10 @@
|
|
|
6276
6847
|
sort: { default: null },
|
|
6277
6848
|
caption: { default: "" }
|
|
6278
6849
|
},
|
|
6279
|
-
emits: ["update:sort", "sort", "row-click"],
|
|
6850
|
+
emits: ["update:sort", "change", "sort", "row-click"],
|
|
6280
6851
|
setup(__props, { emit: __emit }) {
|
|
6281
6852
|
const props = __props;
|
|
6853
|
+
const l10n = useLocaleText(props, "table");
|
|
6282
6854
|
const emit = __emit;
|
|
6283
6855
|
const colCount = vue.computed(() => Math.max(props.columns.length, 1));
|
|
6284
6856
|
const isEmpty = vue.computed(() => !props.rows.length && !props.loading);
|
|
@@ -6320,9 +6892,10 @@
|
|
|
6320
6892
|
if (!column.sortable) {
|
|
6321
6893
|
return;
|
|
6322
6894
|
}
|
|
6323
|
-
const
|
|
6324
|
-
const next =
|
|
6895
|
+
const current2 = sortDir(column);
|
|
6896
|
+
const next = current2 == null ? { key: column.key, dir: "asc" } : current2 === "asc" ? { key: column.key, dir: "desc" } : null;
|
|
6325
6897
|
emit("update:sort", next);
|
|
6898
|
+
emit("change", next);
|
|
6326
6899
|
emit("sort", next);
|
|
6327
6900
|
}
|
|
6328
6901
|
function onRowClick(row, index) {
|
|
@@ -6331,19 +6904,25 @@
|
|
|
6331
6904
|
}
|
|
6332
6905
|
emit("row-click", row, index);
|
|
6333
6906
|
}
|
|
6907
|
+
warnDeprecated("TaoTable", {
|
|
6908
|
+
compact: 'use size="small"',
|
|
6909
|
+
onSort: 'listen to "change" (or v-model:sort)'
|
|
6910
|
+
});
|
|
6334
6911
|
return (_ctx, _cache) => {
|
|
6335
6912
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
6336
|
-
class: vue.normalizeClass(["tao-table-wrap",
|
|
6337
|
-
"
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6913
|
+
class: vue.normalizeClass(["tao-table-wrap", [
|
|
6914
|
+
vue.unref(sizeClass)(__props.size ?? (__props.compact ? "small" : void 0)),
|
|
6915
|
+
{
|
|
6916
|
+
"tao-table-wrap--sticky": __props.sticky,
|
|
6917
|
+
"tao-table-wrap--loading": __props.loading
|
|
6918
|
+
}
|
|
6919
|
+
]]),
|
|
6920
|
+
style: vue.normalizeStyle(__props.maxHeight ? { maxHeight: vue.unref(toCssLength)(__props.maxHeight) } : void 0)
|
|
6341
6921
|
}, [
|
|
6342
6922
|
vue.createElementVNode("table", {
|
|
6343
6923
|
class: vue.normalizeClass(["tao-table", {
|
|
6344
6924
|
"tao-table--striped": stripeFrom.value === "odd",
|
|
6345
6925
|
"tao-table--striped-even": stripeFrom.value === "even",
|
|
6346
|
-
"tao-table--compact": __props.compact,
|
|
6347
6926
|
"tao-table--hover": __props.hover,
|
|
6348
6927
|
"tao-table--head": __props.head,
|
|
6349
6928
|
"tao-table--lines": __props.lines,
|
|
@@ -6387,7 +6966,7 @@
|
|
|
6387
6966
|
colspan: colCount.value
|
|
6388
6967
|
}, [
|
|
6389
6968
|
vue.renderSlot(_ctx.$slots, "empty", {}, () => [
|
|
6390
|
-
vue.createTextVNode(vue.toDisplayString(
|
|
6969
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(l10n).emptyText), 1)
|
|
6391
6970
|
], true)
|
|
6392
6971
|
], 8, _hoisted_6$7)
|
|
6393
6972
|
])) : vue.createCommentVNode("", true),
|
|
@@ -6431,7 +7010,7 @@
|
|
|
6431
7010
|
};
|
|
6432
7011
|
}
|
|
6433
7012
|
});
|
|
6434
|
-
const TaoTable = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-
|
|
7013
|
+
const TaoTable = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-3b34cb39"]]);
|
|
6435
7014
|
function buildPaginationItems(page, pageCount, siblingCount = 1) {
|
|
6436
7015
|
if (pageCount <= 0) {
|
|
6437
7016
|
return [];
|
|
@@ -6439,10 +7018,10 @@
|
|
|
6439
7018
|
if (pageCount <= 7) {
|
|
6440
7019
|
return Array.from({ length: pageCount }, (_, index) => ({ type: "page", page: index + 1 }));
|
|
6441
7020
|
}
|
|
6442
|
-
const
|
|
7021
|
+
const current2 = Math.min(Math.max(page, 1), pageCount);
|
|
6443
7022
|
const siblings = Math.max(0, siblingCount);
|
|
6444
|
-
const left = Math.max(2,
|
|
6445
|
-
const right = Math.min(pageCount - 1,
|
|
7023
|
+
const left = Math.max(2, current2 - siblings);
|
|
7024
|
+
const right = Math.min(pageCount - 1, current2 + siblings);
|
|
6446
7025
|
const items = [{ type: "page", page: 1 }];
|
|
6447
7026
|
if (left > 2) {
|
|
6448
7027
|
items.push({ type: "ellipsis", id: "left" });
|
|
@@ -6483,24 +7062,25 @@
|
|
|
6483
7062
|
siblingCount: { default: 1 },
|
|
6484
7063
|
disabled: { type: Boolean, default: false },
|
|
6485
7064
|
showTotal: { type: Boolean, default: true },
|
|
6486
|
-
size: {
|
|
7065
|
+
size: {},
|
|
6487
7066
|
jump: { default: 5 },
|
|
6488
|
-
ariaLabel: {
|
|
6489
|
-
prevLabel: {
|
|
6490
|
-
nextLabel: {
|
|
6491
|
-
pageLabel: {
|
|
6492
|
-
jumpPrevLabel: {
|
|
6493
|
-
jumpNextLabel: {
|
|
7067
|
+
ariaLabel: {},
|
|
7068
|
+
prevLabel: {},
|
|
7069
|
+
nextLabel: {},
|
|
7070
|
+
pageLabel: {},
|
|
7071
|
+
jumpPrevLabel: {},
|
|
7072
|
+
jumpNextLabel: {}
|
|
6494
7073
|
},
|
|
6495
7074
|
emits: ["update:page", "change"],
|
|
6496
7075
|
setup(__props, { emit: __emit }) {
|
|
6497
7076
|
const props = __props;
|
|
7077
|
+
const l10n = useLocaleText(props, "pagination");
|
|
6498
7078
|
const emit = __emit;
|
|
6499
7079
|
const pageCount = vue.computed(() => Math.max(1, Math.ceil(Math.max(props.total, 0) / Math.max(props.pageSize, 1))));
|
|
6500
|
-
const
|
|
6501
|
-
const items = vue.computed(() => buildPaginationItems(
|
|
6502
|
-
const from = vue.computed(() => props.total === 0 ? 0 : (
|
|
6503
|
-
const to = vue.computed(() => Math.min(
|
|
7080
|
+
const current2 = vue.computed(() => Math.min(Math.max(props.page, 1), pageCount.value));
|
|
7081
|
+
const items = vue.computed(() => buildPaginationItems(current2.value, pageCount.value, props.siblingCount));
|
|
7082
|
+
const from = vue.computed(() => props.total === 0 ? 0 : (current2.value - 1) * props.pageSize + 1);
|
|
7083
|
+
const to = vue.computed(() => Math.min(current2.value * props.pageSize, props.total));
|
|
6504
7084
|
vue.watch(
|
|
6505
7085
|
() => [props.page, pageCount.value],
|
|
6506
7086
|
([page, count]) => {
|
|
@@ -6523,8 +7103,8 @@
|
|
|
6523
7103
|
}
|
|
6524
7104
|
return (_ctx, _cache) => {
|
|
6525
7105
|
return vue.openBlock(), vue.createElementBlock("nav", {
|
|
6526
|
-
class: vue.normalizeClass(["tao-pagination",
|
|
6527
|
-
"aria-label":
|
|
7106
|
+
class: vue.normalizeClass(["tao-pagination", vue.unref(sizeClass)(__props.size)]),
|
|
7107
|
+
"aria-label": vue.unref(l10n).ariaLabel
|
|
6528
7108
|
}, [
|
|
6529
7109
|
__props.showTotal ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_2$b, [
|
|
6530
7110
|
vue.renderSlot(_ctx.$slots, "total", {
|
|
@@ -6533,9 +7113,9 @@
|
|
|
6533
7113
|
total: __props.total
|
|
6534
7114
|
}, () => [
|
|
6535
7115
|
__props.total === 0 ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
6536
|
-
vue.createTextVNode(
|
|
7116
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(taoLocale)().pagination.emptyTotalText), 1)
|
|
6537
7117
|
], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
6538
|
-
vue.createTextVNode(vue.toDisplayString(
|
|
7118
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(formatText)(vue.unref(taoLocale)().pagination.totalText, { from: from.value, to: to.value, total: __props.total })), 1)
|
|
6539
7119
|
], 64))
|
|
6540
7120
|
], true)
|
|
6541
7121
|
])) : vue.createCommentVNode("", true),
|
|
@@ -6543,9 +7123,9 @@
|
|
|
6543
7123
|
vue.createElementVNode("button", {
|
|
6544
7124
|
type: "button",
|
|
6545
7125
|
class: "tao-pagination__btn",
|
|
6546
|
-
"aria-label":
|
|
6547
|
-
disabled: __props.disabled ||
|
|
6548
|
-
onClick: _cache[0] || (_cache[0] = ($event) => goTo(
|
|
7126
|
+
"aria-label": vue.unref(l10n).prevLabel,
|
|
7127
|
+
disabled: __props.disabled || current2.value <= 1,
|
|
7128
|
+
onClick: _cache[0] || (_cache[0] = ($event) => goTo(current2.value - 1))
|
|
6549
7129
|
}, [
|
|
6550
7130
|
vue.createElementVNode("span", _hoisted_5$9, [
|
|
6551
7131
|
vue.renderSlot(_ctx.$slots, "prev-icon", {}, () => [
|
|
@@ -6561,15 +7141,15 @@
|
|
|
6561
7141
|
key: 0,
|
|
6562
7142
|
type: "button",
|
|
6563
7143
|
class: "tao-pagination__btn tao-pagination__btn--jump",
|
|
6564
|
-
"aria-label": item.id === "left" ?
|
|
7144
|
+
"aria-label": item.id === "left" ? vue.unref(l10n).jumpPrevLabel.replace("{n}", String(__props.jump)) : vue.unref(l10n).jumpNextLabel.replace("{n}", String(__props.jump)),
|
|
6565
7145
|
disabled: __props.disabled,
|
|
6566
|
-
onClick: ($event) => goTo(item.id === "left" ?
|
|
7146
|
+
onClick: ($event) => goTo(item.id === "left" ? current2.value - __props.jump : current2.value + __props.jump)
|
|
6567
7147
|
}, " … ", 8, _hoisted_6$6)) : item.type === "ellipsis" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_7$5, "…")) : (vue.openBlock(), vue.createElementBlock("button", {
|
|
6568
7148
|
key: 2,
|
|
6569
7149
|
type: "button",
|
|
6570
|
-
class: vue.normalizeClass(["tao-pagination__btn", { "tao-pagination__btn--current": item.page ===
|
|
6571
|
-
"aria-current": item.page ===
|
|
6572
|
-
"aria-label":
|
|
7150
|
+
class: vue.normalizeClass(["tao-pagination__btn", { "tao-pagination__btn--current": item.page === current2.value }]),
|
|
7151
|
+
"aria-current": item.page === current2.value ? "page" : void 0,
|
|
7152
|
+
"aria-label": vue.unref(l10n).pageLabel.replace("{page}", String(item.page)),
|
|
6573
7153
|
disabled: __props.disabled,
|
|
6574
7154
|
onClick: ($event) => goTo(item.page)
|
|
6575
7155
|
}, vue.toDisplayString(item.page), 11, _hoisted_8$5))
|
|
@@ -6578,9 +7158,9 @@
|
|
|
6578
7158
|
vue.createElementVNode("button", {
|
|
6579
7159
|
type: "button",
|
|
6580
7160
|
class: "tao-pagination__btn",
|
|
6581
|
-
"aria-label":
|
|
6582
|
-
disabled: __props.disabled ||
|
|
6583
|
-
onClick: _cache[1] || (_cache[1] = ($event) => goTo(
|
|
7161
|
+
"aria-label": vue.unref(l10n).nextLabel,
|
|
7162
|
+
disabled: __props.disabled || current2.value >= pageCount.value,
|
|
7163
|
+
onClick: _cache[1] || (_cache[1] = ($event) => goTo(current2.value + 1))
|
|
6584
7164
|
}, [
|
|
6585
7165
|
vue.createElementVNode("span", _hoisted_10$1, [
|
|
6586
7166
|
vue.renderSlot(_ctx.$slots, "next-icon", {}, () => [
|
|
@@ -6593,7 +7173,7 @@
|
|
|
6593
7173
|
};
|
|
6594
7174
|
}
|
|
6595
7175
|
});
|
|
6596
|
-
const TaoPagination = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-
|
|
7176
|
+
const TaoPagination = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-7e381e8c"]]);
|
|
6597
7177
|
const _hoisted_1$c = { class: "tao-empty" };
|
|
6598
7178
|
const _hoisted_2$a = {
|
|
6599
7179
|
key: 0,
|
|
@@ -6615,15 +7195,17 @@
|
|
|
6615
7195
|
...{ name: "TaoEmpty" },
|
|
6616
7196
|
__name: "TaoEmpty",
|
|
6617
7197
|
props: {
|
|
6618
|
-
title: {
|
|
7198
|
+
title: {}
|
|
6619
7199
|
},
|
|
6620
7200
|
setup(__props) {
|
|
7201
|
+
const props = __props;
|
|
7202
|
+
const l10n = useLocaleText(props, "empty");
|
|
6621
7203
|
return (_ctx, _cache) => {
|
|
6622
7204
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
|
|
6623
7205
|
_ctx.$slots.icon ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$a, [
|
|
6624
7206
|
vue.renderSlot(_ctx.$slots, "icon", {}, void 0, true)
|
|
6625
7207
|
])) : vue.createCommentVNode("", true),
|
|
6626
|
-
|
|
7208
|
+
vue.unref(l10n).title ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_3$8, vue.toDisplayString(vue.unref(l10n).title), 1)) : vue.createCommentVNode("", true),
|
|
6627
7209
|
_ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_4$8, [
|
|
6628
7210
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
6629
7211
|
])) : vue.createCommentVNode("", true),
|
|
@@ -6634,8 +7216,7 @@
|
|
|
6634
7216
|
};
|
|
6635
7217
|
}
|
|
6636
7218
|
});
|
|
6637
|
-
const TaoEmpty = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-
|
|
6638
|
-
const taoListKey = Symbol("taoList");
|
|
7219
|
+
const TaoEmpty = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-7d3efeaf"]]);
|
|
6639
7220
|
const _hoisted_1$b = ["aria-label"];
|
|
6640
7221
|
const _hoisted_2$9 = {
|
|
6641
7222
|
key: 0,
|
|
@@ -6645,7 +7226,7 @@
|
|
|
6645
7226
|
...{ name: "TaoList" },
|
|
6646
7227
|
__name: "TaoList",
|
|
6647
7228
|
props: {
|
|
6648
|
-
size: {
|
|
7229
|
+
size: {},
|
|
6649
7230
|
bordered: { type: Boolean, default: true },
|
|
6650
7231
|
divided: { type: Boolean, default: true },
|
|
6651
7232
|
maxHeight: {},
|
|
@@ -6654,19 +7235,14 @@
|
|
|
6654
7235
|
},
|
|
6655
7236
|
setup(__props) {
|
|
6656
7237
|
const props = __props;
|
|
6657
|
-
const size = vue.computed(() => props.size);
|
|
6658
|
-
vue.provide(taoListKey, { size });
|
|
6659
7238
|
const listStyle = vue.computed(() => {
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
}
|
|
6663
|
-
const value = typeof props.maxHeight === "number" ? `${props.maxHeight}px` : props.maxHeight;
|
|
6664
|
-
return { maxHeight: value };
|
|
7239
|
+
const value = toCssLength(props.maxHeight);
|
|
7240
|
+
return value ? { maxHeight: value } : void 0;
|
|
6665
7241
|
});
|
|
6666
7242
|
return (_ctx, _cache) => {
|
|
6667
7243
|
return vue.openBlock(), vue.createElementBlock("ul", {
|
|
6668
7244
|
class: vue.normalizeClass(["tao-list", [
|
|
6669
|
-
|
|
7245
|
+
vue.unref(sizeClass)(__props.size),
|
|
6670
7246
|
{
|
|
6671
7247
|
"tao-list--bordered": __props.bordered,
|
|
6672
7248
|
"tao-list--divided": __props.divided,
|
|
@@ -6680,14 +7256,14 @@
|
|
|
6680
7256
|
}, [
|
|
6681
7257
|
__props.empty ? (vue.openBlock(), vue.createElementBlock("li", _hoisted_2$9, [
|
|
6682
7258
|
vue.renderSlot(_ctx.$slots, "empty", {}, () => [
|
|
6683
|
-
|
|
7259
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(taoLocale)().list.emptyText), 1)
|
|
6684
7260
|
], true)
|
|
6685
7261
|
])) : vue.renderSlot(_ctx.$slots, "default", {}, void 0, true, 1)
|
|
6686
7262
|
], 14, _hoisted_1$b);
|
|
6687
7263
|
};
|
|
6688
7264
|
}
|
|
6689
7265
|
});
|
|
6690
|
-
const TaoList = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-
|
|
7266
|
+
const TaoList = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-183f5d21"]]);
|
|
6691
7267
|
const _hoisted_1$a = ["aria-current", "aria-disabled"];
|
|
6692
7268
|
const _hoisted_2$8 = {
|
|
6693
7269
|
key: 0,
|
|
@@ -6721,17 +7297,6 @@
|
|
|
6721
7297
|
const props = __props;
|
|
6722
7298
|
const emit = __emit;
|
|
6723
7299
|
const slots = vue.useSlots();
|
|
6724
|
-
const list = vue.inject(taoListKey, null);
|
|
6725
|
-
const sizeClass = vue.computed(() => {
|
|
6726
|
-
const size = props.size ?? (list == null ? void 0 : list.size.value) ?? "medium";
|
|
6727
|
-
if (size === "small") {
|
|
6728
|
-
return "s";
|
|
6729
|
-
}
|
|
6730
|
-
if (size === "large") {
|
|
6731
|
-
return "l";
|
|
6732
|
-
}
|
|
6733
|
-
return "m";
|
|
6734
|
-
});
|
|
6735
7300
|
const hasAction = vue.computed(() => Boolean(slots.action));
|
|
6736
7301
|
const hasPrefix = vue.computed(() => Boolean(slots.prefix));
|
|
6737
7302
|
const hasSuffix = vue.computed(() => Boolean(slots.suffix));
|
|
@@ -6745,7 +7310,7 @@
|
|
|
6745
7310
|
return (_ctx, _cache) => {
|
|
6746
7311
|
return vue.openBlock(), vue.createElementBlock("li", {
|
|
6747
7312
|
class: vue.normalizeClass(["tao-list-item", [
|
|
6748
|
-
|
|
7313
|
+
vue.unref(sizeClass)(__props.size),
|
|
6749
7314
|
{
|
|
6750
7315
|
"tao-list-item--selected": __props.selected,
|
|
6751
7316
|
"tao-list-item--disabled": __props.disabled,
|
|
@@ -6801,7 +7366,7 @@
|
|
|
6801
7366
|
};
|
|
6802
7367
|
}
|
|
6803
7368
|
});
|
|
6804
|
-
const TaoListItem = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-
|
|
7369
|
+
const TaoListItem = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-215a8394"]]);
|
|
6805
7370
|
const _hoisted_1$9 = {
|
|
6806
7371
|
class: "tao-skeleton-group",
|
|
6807
7372
|
"aria-hidden": true
|
|
@@ -6854,11 +7419,12 @@
|
|
|
6854
7419
|
title: { default: "" },
|
|
6855
7420
|
side: { default: "right" },
|
|
6856
7421
|
closable: { type: Boolean, default: true },
|
|
6857
|
-
closeLabel: {
|
|
7422
|
+
closeLabel: {}
|
|
6858
7423
|
},
|
|
6859
7424
|
emits: ["update:modelValue", "close"],
|
|
6860
7425
|
setup(__props, { emit: __emit }) {
|
|
6861
7426
|
const props = __props;
|
|
7427
|
+
const l10n = useLocaleText(props, "drawer");
|
|
6862
7428
|
const emit = __emit;
|
|
6863
7429
|
const panelRef = vue.ref(null);
|
|
6864
7430
|
const titleId = vue.useId();
|
|
@@ -6967,7 +7533,7 @@
|
|
|
6967
7533
|
key: 2,
|
|
6968
7534
|
type: "button",
|
|
6969
7535
|
class: "tao-drawer__close",
|
|
6970
|
-
"aria-label":
|
|
7536
|
+
"aria-label": vue.unref(l10n).closeLabel,
|
|
6971
7537
|
onClick: close
|
|
6972
7538
|
}, [
|
|
6973
7539
|
vue.createElementVNode("span", _hoisted_6$4, [
|
|
@@ -6992,7 +7558,7 @@
|
|
|
6992
7558
|
};
|
|
6993
7559
|
}
|
|
6994
7560
|
});
|
|
6995
|
-
const TaoDrawer = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-
|
|
7561
|
+
const TaoDrawer = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-886b5507"]]);
|
|
6996
7562
|
const _hoisted_1$7 = ["title"];
|
|
6997
7563
|
const _hoisted_2$6 = { class: "tao-avatar__face" };
|
|
6998
7564
|
const _hoisted_3$5 = ["src", "alt"];
|
|
@@ -7012,13 +7578,14 @@
|
|
|
7012
7578
|
size: { default: "medium" },
|
|
7013
7579
|
dot: { type: [Boolean, String], default: false },
|
|
7014
7580
|
count: { default: void 0 },
|
|
7015
|
-
fallbackLabel: {
|
|
7016
|
-
notificationsLabel: {
|
|
7581
|
+
fallbackLabel: {},
|
|
7582
|
+
notificationsLabel: {},
|
|
7017
7583
|
dotLabels: { default: () => ({}) }
|
|
7018
7584
|
},
|
|
7019
7585
|
setup(__props) {
|
|
7020
7586
|
const props = __props;
|
|
7021
|
-
const
|
|
7587
|
+
const l10n = useLocaleText(props, "avatar");
|
|
7588
|
+
const sizeClass2 = vue.computed(() => {
|
|
7022
7589
|
if (props.size === "small" || props.size === "s") {
|
|
7023
7590
|
return "s";
|
|
7024
7591
|
}
|
|
@@ -7059,21 +7626,14 @@
|
|
|
7059
7626
|
}
|
|
7060
7627
|
return String(props.count);
|
|
7061
7628
|
});
|
|
7062
|
-
const defaultDotLabel = {
|
|
7063
|
-
success: "в сети",
|
|
7064
|
-
danger: "занят",
|
|
7065
|
-
warning: "отошёл",
|
|
7066
|
-
info: "статус",
|
|
7067
|
-
neutral: "не в сети"
|
|
7068
|
-
};
|
|
7069
7629
|
const label = vue.computed(() => {
|
|
7070
|
-
const base = props.alt || props.name ||
|
|
7630
|
+
const base = props.alt || props.name || l10n.value.fallbackLabel;
|
|
7071
7631
|
const extra = [];
|
|
7072
7632
|
if (dotTone.value) {
|
|
7073
|
-
extra.push(props.dotLabels[dotTone.value] ??
|
|
7633
|
+
extra.push(props.dotLabels[dotTone.value] ?? taoLocale().avatar.dotLabels[dotTone.value]);
|
|
7074
7634
|
}
|
|
7075
7635
|
if (badge.value) {
|
|
7076
|
-
extra.push(
|
|
7636
|
+
extra.push(l10n.value.notificationsLabel.replace("{count}", badge.value));
|
|
7077
7637
|
}
|
|
7078
7638
|
return extra.length ? `${base}, ${extra.join(", ")}` : base;
|
|
7079
7639
|
});
|
|
@@ -7088,9 +7648,12 @@
|
|
|
7088
7648
|
function onImgError() {
|
|
7089
7649
|
imgFailed.value = true;
|
|
7090
7650
|
}
|
|
7651
|
+
if (props.size === "s" || props.size === "m" || props.size === "l") {
|
|
7652
|
+
deprecationWarning("TaoAvatar", `size "${props.size}"`, "use small / medium / large");
|
|
7653
|
+
}
|
|
7091
7654
|
return (_ctx, _cache) => {
|
|
7092
7655
|
return vue.openBlock(), vue.createElementBlock("span", {
|
|
7093
|
-
class: vue.normalizeClass(["tao-avatar", `tao-avatar--${
|
|
7656
|
+
class: vue.normalizeClass(["tao-avatar", `tao-avatar--${sizeClass2.value}`]),
|
|
7094
7657
|
title: label.value
|
|
7095
7658
|
}, [
|
|
7096
7659
|
vue.createElementVNode("span", _hoisted_2$6, [
|
|
@@ -7116,7 +7679,7 @@
|
|
|
7116
7679
|
};
|
|
7117
7680
|
}
|
|
7118
7681
|
});
|
|
7119
|
-
const TaoAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-
|
|
7682
|
+
const TaoAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-2257342d"]]);
|
|
7120
7683
|
const _hoisted_1$6 = ["aria-label"];
|
|
7121
7684
|
const _hoisted_2$5 = { class: "tao-breadcrumb__list" };
|
|
7122
7685
|
const _hoisted_3$4 = {
|
|
@@ -7138,13 +7701,15 @@
|
|
|
7138
7701
|
__name: "TaoBreadcrumb",
|
|
7139
7702
|
props: {
|
|
7140
7703
|
items: {},
|
|
7141
|
-
ariaLabel: {
|
|
7704
|
+
ariaLabel: {}
|
|
7142
7705
|
},
|
|
7143
7706
|
setup(__props) {
|
|
7707
|
+
const props = __props;
|
|
7708
|
+
const l10n = useLocaleText(props, "breadcrumb");
|
|
7144
7709
|
return (_ctx, _cache) => {
|
|
7145
7710
|
return vue.openBlock(), vue.createElementBlock("nav", {
|
|
7146
7711
|
class: "tao-breadcrumb",
|
|
7147
|
-
"aria-label":
|
|
7712
|
+
"aria-label": vue.unref(l10n).ariaLabel
|
|
7148
7713
|
}, [
|
|
7149
7714
|
vue.createElementVNode("ol", _hoisted_2$5, [
|
|
7150
7715
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.items, (item, index) => {
|
|
@@ -7170,7 +7735,7 @@
|
|
|
7170
7735
|
};
|
|
7171
7736
|
}
|
|
7172
7737
|
});
|
|
7173
|
-
const TaoBreadcrumb = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-
|
|
7738
|
+
const TaoBreadcrumb = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-b853fbd5"]]);
|
|
7174
7739
|
const _hoisted_1$5 = ["aria-label"];
|
|
7175
7740
|
const _hoisted_2$4 = {
|
|
7176
7741
|
class: "tao-counter__row",
|
|
@@ -7253,6 +7818,24 @@
|
|
|
7253
7818
|
}
|
|
7254
7819
|
});
|
|
7255
7820
|
const TaoCounter = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-9e11d2be"]]);
|
|
7821
|
+
const GLIDE_TIME = 325;
|
|
7822
|
+
const FLICK_SPEED = 0.3;
|
|
7823
|
+
function glideTarget(from, velocity, pitch, max) {
|
|
7824
|
+
if (pitch <= 0) {
|
|
7825
|
+
return from;
|
|
7826
|
+
}
|
|
7827
|
+
let slide = Math.round((from + velocity * GLIDE_TIME) / pitch);
|
|
7828
|
+
if (velocity > FLICK_SPEED) {
|
|
7829
|
+
slide = Math.max(slide, Math.floor(from / pitch) + 1);
|
|
7830
|
+
} else if (velocity < -FLICK_SPEED) {
|
|
7831
|
+
slide = Math.min(slide, Math.ceil(from / pitch) - 1);
|
|
7832
|
+
}
|
|
7833
|
+
return Math.min(Math.max(slide * pitch, 0), Math.max(max, 0));
|
|
7834
|
+
}
|
|
7835
|
+
function glideDuration(distance, velocity) {
|
|
7836
|
+
const sameDirection = Math.abs(velocity) > 0.05 && Math.sign(velocity) === Math.sign(distance);
|
|
7837
|
+
return sameDirection ? Math.min(Math.max(3 * Math.abs(distance) / Math.abs(velocity), 220), 900) : Math.min(200 + Math.abs(distance) * 1.2, 450);
|
|
7838
|
+
}
|
|
7256
7839
|
const _hoisted_1$4 = { class: "tao-carousel__row" };
|
|
7257
7840
|
const _hoisted_2$3 = ["aria-label", "disabled"];
|
|
7258
7841
|
const _hoisted_3$3 = { "aria-hidden": "true" };
|
|
@@ -7272,20 +7855,22 @@
|
|
|
7272
7855
|
autoplay: { default: 0 },
|
|
7273
7856
|
loop: { type: Boolean, default: false },
|
|
7274
7857
|
dots: { type: Boolean, default: false },
|
|
7275
|
-
ariaLabel: {
|
|
7276
|
-
prevLabel: {
|
|
7277
|
-
nextLabel: {
|
|
7278
|
-
dotsLabel: {
|
|
7279
|
-
slideLabel: {
|
|
7858
|
+
ariaLabel: {},
|
|
7859
|
+
prevLabel: {},
|
|
7860
|
+
nextLabel: {},
|
|
7861
|
+
dotsLabel: {},
|
|
7862
|
+
slideLabel: {}
|
|
7280
7863
|
},
|
|
7281
7864
|
emits: ["update:modelValue", "change"],
|
|
7282
7865
|
setup(__props, { emit: __emit }) {
|
|
7283
7866
|
const props = __props;
|
|
7867
|
+
const l10n = useLocaleText(props, "carousel");
|
|
7284
7868
|
const emit = __emit;
|
|
7285
7869
|
const track = vue.ref(null);
|
|
7286
7870
|
const index = vue.ref(props.modelValue);
|
|
7287
7871
|
const count = vue.ref(0);
|
|
7288
7872
|
const dragging = vue.ref(false);
|
|
7873
|
+
const gliding = vue.ref(false);
|
|
7289
7874
|
const hoverPaused = vue.ref(false);
|
|
7290
7875
|
const focusPaused = vue.ref(false);
|
|
7291
7876
|
let dragStartX = 0;
|
|
@@ -7293,6 +7878,9 @@
|
|
|
7293
7878
|
let dragMoved = 0;
|
|
7294
7879
|
let dragPointer = -1;
|
|
7295
7880
|
let scrollFrame = 0;
|
|
7881
|
+
let glideFrame = 0;
|
|
7882
|
+
let settleTimer = 0;
|
|
7883
|
+
let samples = [];
|
|
7296
7884
|
let focusFrame = 0;
|
|
7297
7885
|
let autoplayTimer = 0;
|
|
7298
7886
|
const step = vue.computed(() => Math.max(1, Math.round(props.perView)));
|
|
@@ -7325,7 +7913,7 @@
|
|
|
7325
7913
|
if (width <= 0 || total <= 0) {
|
|
7326
7914
|
return 0;
|
|
7327
7915
|
}
|
|
7328
|
-
const left = ((_a = track.value) == null ? void 0 : _a.scrollLeft) ?? 0;
|
|
7916
|
+
const left = scrollLeft ?? ((_a = track.value) == null ? void 0 : _a.scrollLeft) ?? 0;
|
|
7329
7917
|
const last = Math.max(total - step.value, 0);
|
|
7330
7918
|
return Math.min(Math.max(Math.round(left / (width + gap)), 0), last);
|
|
7331
7919
|
}
|
|
@@ -7348,6 +7936,7 @@
|
|
|
7348
7936
|
goTo(index.value + step.value);
|
|
7349
7937
|
}
|
|
7350
7938
|
function goTo(next, instant = false) {
|
|
7939
|
+
cancelGlide();
|
|
7351
7940
|
const el = track.value;
|
|
7352
7941
|
const { width, gap, total } = metrics();
|
|
7353
7942
|
if (!el || width <= 0 || total <= 0) {
|
|
@@ -7378,7 +7967,7 @@
|
|
|
7378
7967
|
autoplayTimer = 0;
|
|
7379
7968
|
}
|
|
7380
7969
|
function canAutoplay() {
|
|
7381
|
-
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);
|
|
7970
|
+
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);
|
|
7382
7971
|
}
|
|
7383
7972
|
function tickAutoplay() {
|
|
7384
7973
|
if (!canAutoplay()) {
|
|
@@ -7430,20 +8019,103 @@
|
|
|
7430
8019
|
});
|
|
7431
8020
|
}
|
|
7432
8021
|
function onScroll() {
|
|
7433
|
-
if (dragging.value) {
|
|
8022
|
+
if (dragging.value || gliding.value) {
|
|
7434
8023
|
return;
|
|
7435
8024
|
}
|
|
7436
8025
|
cancelAnimationFrame(scrollFrame);
|
|
7437
|
-
scrollFrame = requestAnimationFrame(() =>
|
|
7438
|
-
|
|
7439
|
-
|
|
7440
|
-
|
|
7441
|
-
|
|
7442
|
-
|
|
8026
|
+
scrollFrame = requestAnimationFrame(() => setIndex(nearestIndex()));
|
|
8027
|
+
if (!supportsScrollEnd()) {
|
|
8028
|
+
window.clearTimeout(settleTimer);
|
|
8029
|
+
settleTimer = window.setTimeout(settle, 150);
|
|
8030
|
+
}
|
|
8031
|
+
}
|
|
8032
|
+
function supportsScrollEnd() {
|
|
8033
|
+
return typeof window !== "undefined" && "onscrollend" in window;
|
|
8034
|
+
}
|
|
8035
|
+
function settle() {
|
|
8036
|
+
window.clearTimeout(settleTimer);
|
|
8037
|
+
const el = track.value;
|
|
8038
|
+
if (!el || dragging.value || gliding.value || getComputedStyle(el).scrollSnapType !== "none") {
|
|
8039
|
+
return;
|
|
8040
|
+
}
|
|
8041
|
+
const max = el.scrollWidth - el.clientWidth;
|
|
8042
|
+
if (el.scrollLeft >= max - 1) {
|
|
8043
|
+
return;
|
|
8044
|
+
}
|
|
8045
|
+
const target = glideTarget$1(el.scrollLeft, 0);
|
|
8046
|
+
if (Math.abs(target - el.scrollLeft) >= 1) {
|
|
8047
|
+
glideTo(target, 0);
|
|
8048
|
+
}
|
|
8049
|
+
}
|
|
8050
|
+
function onUserScrollInput() {
|
|
8051
|
+
if (!dragging.value) {
|
|
8052
|
+
cancelGlide();
|
|
8053
|
+
}
|
|
8054
|
+
}
|
|
8055
|
+
function recordSample(x) {
|
|
8056
|
+
const t = performance.now();
|
|
8057
|
+
samples.push({ x, t });
|
|
8058
|
+
while (samples.length > 2 && t - samples[0].t > 100) {
|
|
8059
|
+
samples.shift();
|
|
8060
|
+
}
|
|
8061
|
+
}
|
|
8062
|
+
function releaseVelocity() {
|
|
8063
|
+
const first = samples[0];
|
|
8064
|
+
const last = samples[samples.length - 1];
|
|
8065
|
+
if (!first || !last || last.t === first.t || performance.now() - last.t > 80) {
|
|
8066
|
+
return 0;
|
|
8067
|
+
}
|
|
8068
|
+
return -(last.x - first.x) / (last.t - first.t);
|
|
8069
|
+
}
|
|
8070
|
+
function cancelGlide() {
|
|
8071
|
+
if (!glideFrame) {
|
|
8072
|
+
return;
|
|
8073
|
+
}
|
|
8074
|
+
cancelAnimationFrame(glideFrame);
|
|
8075
|
+
glideFrame = 0;
|
|
8076
|
+
gliding.value = false;
|
|
8077
|
+
}
|
|
8078
|
+
function glideTarget$1(from, velocity) {
|
|
8079
|
+
const el = track.value;
|
|
8080
|
+
const { width, gap } = metrics();
|
|
8081
|
+
if (!el || width <= 0) {
|
|
8082
|
+
return from;
|
|
8083
|
+
}
|
|
8084
|
+
return glideTarget(from, velocity, width + gap, el.scrollWidth - el.clientWidth);
|
|
8085
|
+
}
|
|
8086
|
+
function finishGlide() {
|
|
8087
|
+
glideFrame = 0;
|
|
8088
|
+
gliding.value = false;
|
|
8089
|
+
setIndex(nearestIndex());
|
|
8090
|
+
syncAutoplay();
|
|
8091
|
+
}
|
|
8092
|
+
function glideTo(target, velocity) {
|
|
8093
|
+
const el = track.value;
|
|
8094
|
+
if (!el) {
|
|
8095
|
+
return;
|
|
8096
|
+
}
|
|
8097
|
+
cancelGlide();
|
|
8098
|
+
const from = el.scrollLeft;
|
|
8099
|
+
const distance = target - from;
|
|
8100
|
+
setIndex(nearestIndex(target));
|
|
8101
|
+
if (Math.abs(distance) < 1 || prefersReducedMotion()) {
|
|
8102
|
+
el.scrollLeft = target;
|
|
8103
|
+
syncAutoplay();
|
|
8104
|
+
return;
|
|
8105
|
+
}
|
|
8106
|
+
const duration = glideDuration(distance, velocity);
|
|
8107
|
+
const start = performance.now();
|
|
8108
|
+
gliding.value = true;
|
|
8109
|
+
const frame = (now) => {
|
|
8110
|
+
const t = Math.min((now - start) / duration, 1);
|
|
8111
|
+
el.scrollLeft = from + distance * (1 - (1 - t) ** 3);
|
|
8112
|
+
if (t < 1) {
|
|
8113
|
+
glideFrame = requestAnimationFrame(frame);
|
|
7443
8114
|
return;
|
|
7444
8115
|
}
|
|
7445
|
-
|
|
7446
|
-
}
|
|
8116
|
+
finishGlide();
|
|
8117
|
+
};
|
|
8118
|
+
glideFrame = requestAnimationFrame(frame);
|
|
7447
8119
|
}
|
|
7448
8120
|
function releaseDragCapture() {
|
|
7449
8121
|
const el = track.value;
|
|
@@ -7469,8 +8141,12 @@
|
|
|
7469
8141
|
if (!keepClickGuard) {
|
|
7470
8142
|
dragMoved = 0;
|
|
7471
8143
|
}
|
|
7472
|
-
|
|
7473
|
-
|
|
8144
|
+
const el = track.value;
|
|
8145
|
+
const velocity = releaseVelocity();
|
|
8146
|
+
samples = [];
|
|
8147
|
+
if (el) {
|
|
8148
|
+
glideTo(glideTarget$1(el.scrollLeft, velocity), velocity);
|
|
8149
|
+
return;
|
|
7474
8150
|
}
|
|
7475
8151
|
syncAutoplay();
|
|
7476
8152
|
}
|
|
@@ -7478,10 +8154,13 @@
|
|
|
7478
8154
|
if (event.pointerType !== "mouse" || event.button !== 0 || !track.value) {
|
|
7479
8155
|
return;
|
|
7480
8156
|
}
|
|
8157
|
+
cancelGlide();
|
|
7481
8158
|
dragPointer = event.pointerId;
|
|
7482
8159
|
dragStartX = event.clientX;
|
|
7483
8160
|
dragStartScroll = track.value.scrollLeft;
|
|
7484
8161
|
dragMoved = 0;
|
|
8162
|
+
samples = [];
|
|
8163
|
+
recordSample(event.clientX);
|
|
7485
8164
|
dragging.value = true;
|
|
7486
8165
|
try {
|
|
7487
8166
|
track.value.setPointerCapture(event.pointerId);
|
|
@@ -7493,7 +8172,8 @@
|
|
|
7493
8172
|
return;
|
|
7494
8173
|
}
|
|
7495
8174
|
const dx = event.clientX - dragStartX;
|
|
7496
|
-
dragMoved = Math.abs(dx);
|
|
8175
|
+
dragMoved = Math.max(dragMoved, Math.abs(dx));
|
|
8176
|
+
recordSample(event.clientX);
|
|
7497
8177
|
track.value.scrollLeft = dragStartScroll - dx;
|
|
7498
8178
|
}
|
|
7499
8179
|
function onPointerEnd(event) {
|
|
@@ -7547,7 +8227,7 @@
|
|
|
7547
8227
|
}
|
|
7548
8228
|
);
|
|
7549
8229
|
vue.watch(
|
|
7550
|
-
() => [props.autoplay, props.loop, count.value, dragging.value, index.value],
|
|
8230
|
+
() => [props.autoplay, props.loop, count.value, dragging.value, gliding.value, index.value],
|
|
7551
8231
|
() => syncAutoplay()
|
|
7552
8232
|
);
|
|
7553
8233
|
vue.onMounted(() => {
|
|
@@ -7563,6 +8243,8 @@
|
|
|
7563
8243
|
vue.onUpdated(refreshCount);
|
|
7564
8244
|
vue.onBeforeUnmount(() => {
|
|
7565
8245
|
endDrag();
|
|
8246
|
+
cancelGlide();
|
|
8247
|
+
window.clearTimeout(settleTimer);
|
|
7566
8248
|
cancelAnimationFrame(scrollFrame);
|
|
7567
8249
|
cancelAnimationFrame(focusFrame);
|
|
7568
8250
|
stopAutoplay();
|
|
@@ -7588,7 +8270,7 @@
|
|
|
7588
8270
|
key: 0,
|
|
7589
8271
|
type: "button",
|
|
7590
8272
|
class: "tao-carousel__nav",
|
|
7591
|
-
"aria-label":
|
|
8273
|
+
"aria-label": vue.unref(l10n).prevLabel,
|
|
7592
8274
|
disabled: atStart.value,
|
|
7593
8275
|
onClick: goPrev
|
|
7594
8276
|
}, [
|
|
@@ -7616,11 +8298,14 @@
|
|
|
7616
8298
|
vue.createElementVNode("div", {
|
|
7617
8299
|
ref_key: "track",
|
|
7618
8300
|
ref: track,
|
|
7619
|
-
class: vue.normalizeClass(["tao-carousel__track", { "tao-carousel__track--dragging": dragging.value }]),
|
|
8301
|
+
class: vue.normalizeClass(["tao-carousel__track", { "tao-carousel__track--dragging": dragging.value, "tao-carousel__track--gliding": gliding.value }]),
|
|
7620
8302
|
role: "region",
|
|
7621
|
-
"aria-label":
|
|
8303
|
+
"aria-label": vue.unref(l10n).ariaLabel,
|
|
7622
8304
|
tabindex: "0",
|
|
7623
8305
|
onScroll,
|
|
8306
|
+
onScrollend: settle,
|
|
8307
|
+
onWheelPassive: onUserScrollInput,
|
|
8308
|
+
onTouchstartPassive: onUserScrollInput,
|
|
7624
8309
|
onKeydown,
|
|
7625
8310
|
onPointerdown: onPointerDown,
|
|
7626
8311
|
onPointermove: onPointerMove,
|
|
@@ -7639,7 +8324,7 @@
|
|
|
7639
8324
|
key: 0,
|
|
7640
8325
|
type: "button",
|
|
7641
8326
|
class: "tao-carousel__nav",
|
|
7642
|
-
"aria-label":
|
|
8327
|
+
"aria-label": vue.unref(l10n).nextLabel,
|
|
7643
8328
|
disabled: atEnd.value,
|
|
7644
8329
|
onClick: goNext
|
|
7645
8330
|
}, [
|
|
@@ -7674,14 +8359,14 @@
|
|
|
7674
8359
|
key: 0,
|
|
7675
8360
|
class: "tao-carousel__dots",
|
|
7676
8361
|
role: "group",
|
|
7677
|
-
"aria-label":
|
|
8362
|
+
"aria-label": vue.unref(l10n).dotsLabel
|
|
7678
8363
|
}, [
|
|
7679
8364
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(snapCount.value, (n) => {
|
|
7680
8365
|
return vue.openBlock(), vue.createElementBlock("button", {
|
|
7681
8366
|
key: n,
|
|
7682
8367
|
type: "button",
|
|
7683
8368
|
class: vue.normalizeClass(["tao-carousel__dot", { "tao-carousel__dot--active": n - 1 === index.value }]),
|
|
7684
|
-
"aria-label":
|
|
8369
|
+
"aria-label": vue.unref(l10n).slideLabel.replace("{n}", String(n)).replace("{count}", String(snapCount.value)),
|
|
7685
8370
|
"aria-current": n - 1 === index.value ? "true" : void 0,
|
|
7686
8371
|
onClick: ($event) => goTo(n - 1)
|
|
7687
8372
|
}, [
|
|
@@ -7700,7 +8385,7 @@
|
|
|
7700
8385
|
};
|
|
7701
8386
|
}
|
|
7702
8387
|
});
|
|
7703
|
-
const TaoCarousel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
8388
|
+
const TaoCarousel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-d83a4f4e"]]);
|
|
7704
8389
|
const _hoisted_1$3 = ["aria-label"];
|
|
7705
8390
|
const _hoisted_2$2 = ["aria-label"];
|
|
7706
8391
|
const _hoisted_3$2 = {
|
|
@@ -7741,18 +8426,14 @@
|
|
|
7741
8426
|
__name: "TaoStages",
|
|
7742
8427
|
props: {
|
|
7743
8428
|
items: { default: () => [] },
|
|
7744
|
-
|
|
7745
|
-
|
|
8429
|
+
direction: { default: void 0 },
|
|
8430
|
+
vertical: { type: Boolean, default: void 0 },
|
|
8431
|
+
ariaLabel: {},
|
|
7746
8432
|
statusLabels: { default: () => ({}) }
|
|
7747
8433
|
},
|
|
7748
8434
|
setup(__props) {
|
|
7749
8435
|
const props = __props;
|
|
7750
|
-
const
|
|
7751
|
-
wait: "ожидание",
|
|
7752
|
-
work: "в работе",
|
|
7753
|
-
ok: "готово",
|
|
7754
|
-
bad: "ошибка"
|
|
7755
|
-
};
|
|
8436
|
+
const l10n = useLocaleText(props, "stages");
|
|
7756
8437
|
function statusOf(item) {
|
|
7757
8438
|
if (item.status === "danger") {
|
|
7758
8439
|
return "bad";
|
|
@@ -7761,12 +8442,16 @@
|
|
|
7761
8442
|
}
|
|
7762
8443
|
function itemLabel(item) {
|
|
7763
8444
|
const status = statusOf(item);
|
|
7764
|
-
return `${item.label ?? item.key}, ${props.statusLabels[status] ??
|
|
8445
|
+
return `${item.label ?? item.key}, ${props.statusLabels[status] ?? taoLocale().stages.statusLabels[status]}`;
|
|
7765
8446
|
}
|
|
8447
|
+
const isRow = vue.computed(() => (props.direction ?? (props.vertical === false ? "row" : "column")) === "row");
|
|
8448
|
+
warnDeprecated("TaoStages", {
|
|
8449
|
+
vertical: "use `direction`"
|
|
8450
|
+
});
|
|
7766
8451
|
return (_ctx, _cache) => {
|
|
7767
8452
|
return vue.openBlock(), vue.createElementBlock("ul", {
|
|
7768
|
-
class: vue.normalizeClass(["tao-stages", { "tao-stages--horizontal":
|
|
7769
|
-
"aria-label":
|
|
8453
|
+
class: vue.normalizeClass(["tao-stages", { "tao-stages--horizontal": isRow.value }]),
|
|
8454
|
+
"aria-label": vue.unref(l10n).ariaLabel
|
|
7770
8455
|
}, [
|
|
7771
8456
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.items, (item, index) => {
|
|
7772
8457
|
return vue.openBlock(), vue.createElementBlock("li", {
|
|
@@ -7835,86 +8520,7 @@
|
|
|
7835
8520
|
};
|
|
7836
8521
|
}
|
|
7837
8522
|
});
|
|
7838
|
-
const TaoStages = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-
|
|
7839
|
-
const TOAST_POSITIONS = [
|
|
7840
|
-
"topRight",
|
|
7841
|
-
"topLeft",
|
|
7842
|
-
"topCenter",
|
|
7843
|
-
"bottomRight",
|
|
7844
|
-
"bottomLeft",
|
|
7845
|
-
"bottomCenter",
|
|
7846
|
-
"center"
|
|
7847
|
-
];
|
|
7848
|
-
const toastDefaults = {
|
|
7849
|
-
position: "topCenter",
|
|
7850
|
-
timeout: 3e3,
|
|
7851
|
-
closable: true,
|
|
7852
|
-
progress: true,
|
|
7853
|
-
closeLabel: "Закрыть уведомление"
|
|
7854
|
-
};
|
|
7855
|
-
const toasts = vue.ref([]);
|
|
7856
|
-
const toastsByPosition = vue.computed(() => {
|
|
7857
|
-
const grouped = {};
|
|
7858
|
-
for (const position of TOAST_POSITIONS) {
|
|
7859
|
-
grouped[position] = [];
|
|
7860
|
-
}
|
|
7861
|
-
for (const toast2 of toasts.value) {
|
|
7862
|
-
grouped[toast2.position].push(toast2);
|
|
7863
|
-
}
|
|
7864
|
-
return grouped;
|
|
7865
|
-
});
|
|
7866
|
-
function configureToastDefaults(partial) {
|
|
7867
|
-
Object.assign(toastDefaults, partial);
|
|
7868
|
-
}
|
|
7869
|
-
function addToast(record) {
|
|
7870
|
-
if (record.displayMode === "once" && record.dedupeId) {
|
|
7871
|
-
const exists = toasts.value.some((item) => item.dedupeId === record.dedupeId);
|
|
7872
|
-
if (exists) {
|
|
7873
|
-
return;
|
|
7874
|
-
}
|
|
7875
|
-
}
|
|
7876
|
-
if (record.displayMode === "replace" && record.dedupeId) {
|
|
7877
|
-
toasts.value = toasts.value.filter((item) => item.dedupeId !== record.dedupeId);
|
|
7878
|
-
}
|
|
7879
|
-
toasts.value = [...toasts.value, record];
|
|
7880
|
-
}
|
|
7881
|
-
function removeToast(id) {
|
|
7882
|
-
var _a;
|
|
7883
|
-
const item = toasts.value.find((toast2) => toast2.id === id);
|
|
7884
|
-
if (!item) {
|
|
7885
|
-
return;
|
|
7886
|
-
}
|
|
7887
|
-
toasts.value = toasts.value.filter((toast2) => toast2.id !== id);
|
|
7888
|
-
(_a = item.onClosed) == null ? void 0 : _a.call(item);
|
|
7889
|
-
}
|
|
7890
|
-
function dismissToasts(id) {
|
|
7891
|
-
if (id) {
|
|
7892
|
-
removeToast(id);
|
|
7893
|
-
return;
|
|
7894
|
-
}
|
|
7895
|
-
const items = toasts.value;
|
|
7896
|
-
toasts.value = [];
|
|
7897
|
-
items.forEach((item) => {
|
|
7898
|
-
var _a;
|
|
7899
|
-
return (_a = item.onClosed) == null ? void 0 : _a.call(item);
|
|
7900
|
-
});
|
|
7901
|
-
}
|
|
7902
|
-
let viewportMounts$1 = 0;
|
|
7903
|
-
function registerToastViewport() {
|
|
7904
|
-
viewportMounts$1 += 1;
|
|
7905
|
-
}
|
|
7906
|
-
function unregisterToastViewport() {
|
|
7907
|
-
viewportMounts$1 = Math.max(0, viewportMounts$1 - 1);
|
|
7908
|
-
}
|
|
7909
|
-
function hasToastViewport() {
|
|
7910
|
-
if (viewportMounts$1 > 0) {
|
|
7911
|
-
return true;
|
|
7912
|
-
}
|
|
7913
|
-
if (typeof document === "undefined") {
|
|
7914
|
-
return false;
|
|
7915
|
-
}
|
|
7916
|
-
return Boolean(document.querySelector("[data-tao-toast-viewport]"));
|
|
7917
|
-
}
|
|
8523
|
+
const TaoStages = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-45cc2ad5"]]);
|
|
7918
8524
|
const _hoisted_1$2 = ["role"];
|
|
7919
8525
|
const _hoisted_2$1 = {
|
|
7920
8526
|
class: "tao-toast__icon",
|
|
@@ -8197,50 +8803,6 @@
|
|
|
8197
8803
|
}
|
|
8198
8804
|
});
|
|
8199
8805
|
const TaoToastViewport = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-d07e8a95"]]);
|
|
8200
|
-
const confirmDefaults = {
|
|
8201
|
-
ok: "ОК",
|
|
8202
|
-
cancel: "Отмена"
|
|
8203
|
-
};
|
|
8204
|
-
const currentConfirm = vue.ref(null);
|
|
8205
|
-
const queue = [];
|
|
8206
|
-
function configureConfirmDefaults(partial) {
|
|
8207
|
-
Object.assign(confirmDefaults, partial);
|
|
8208
|
-
}
|
|
8209
|
-
function pump() {
|
|
8210
|
-
if (currentConfirm.value) {
|
|
8211
|
-
return;
|
|
8212
|
-
}
|
|
8213
|
-
currentConfirm.value = queue.shift() ?? null;
|
|
8214
|
-
}
|
|
8215
|
-
function enqueueConfirm(record) {
|
|
8216
|
-
queue.push(record);
|
|
8217
|
-
pump();
|
|
8218
|
-
}
|
|
8219
|
-
function resolveConfirm(value) {
|
|
8220
|
-
const item = currentConfirm.value;
|
|
8221
|
-
if (!item) {
|
|
8222
|
-
return;
|
|
8223
|
-
}
|
|
8224
|
-
currentConfirm.value = null;
|
|
8225
|
-
item.resolve(value);
|
|
8226
|
-
pump();
|
|
8227
|
-
}
|
|
8228
|
-
let viewportMounts = 0;
|
|
8229
|
-
function registerConfirmHost() {
|
|
8230
|
-
viewportMounts += 1;
|
|
8231
|
-
}
|
|
8232
|
-
function unregisterConfirmHost() {
|
|
8233
|
-
viewportMounts = Math.max(0, viewportMounts - 1);
|
|
8234
|
-
}
|
|
8235
|
-
function hasConfirmHost() {
|
|
8236
|
-
if (viewportMounts > 0) {
|
|
8237
|
-
return true;
|
|
8238
|
-
}
|
|
8239
|
-
if (typeof document === "undefined") {
|
|
8240
|
-
return false;
|
|
8241
|
-
}
|
|
8242
|
-
return Boolean(document.querySelector("[data-tao-confirm-host]"));
|
|
8243
|
-
}
|
|
8244
8806
|
const _hoisted_1 = ["aria-labelledby", "aria-describedby"];
|
|
8245
8807
|
const _hoisted_2 = {
|
|
8246
8808
|
class: "tao-confirm__icon",
|
|
@@ -8886,7 +9448,10 @@
|
|
|
8886
9448
|
TaoConfirmHost
|
|
8887
9449
|
];
|
|
8888
9450
|
const TaoUI = {
|
|
8889
|
-
install(app) {
|
|
9451
|
+
install(app, options = {}) {
|
|
9452
|
+
if (options.locale) {
|
|
9453
|
+
setTaoLocale(options.locale);
|
|
9454
|
+
}
|
|
8890
9455
|
components.forEach((component) => {
|
|
8891
9456
|
app.component(component.name, component);
|
|
8892
9457
|
});
|
|
@@ -8959,8 +9524,12 @@
|
|
|
8959
9524
|
exports2.formatTaoDateIso = formatTaoDateIso;
|
|
8960
9525
|
exports2.formatTaoDateLabel = formatTaoDateLabel;
|
|
8961
9526
|
exports2.formatTaoDateRangeLabel = formatTaoDateRangeLabel;
|
|
9527
|
+
exports2.localeEn = localeEn;
|
|
9528
|
+
exports2.localeRu = localeRu;
|
|
8962
9529
|
exports2.parseTaoDate = parseTaoDate;
|
|
8963
9530
|
exports2.parseTaoDateRange = parseTaoDateRange;
|
|
9531
|
+
exports2.setTaoLocale = setTaoLocale;
|
|
9532
|
+
exports2.taoLocale = taoLocale;
|
|
8964
9533
|
exports2.toast = toast;
|
|
8965
9534
|
exports2.todayTaoDate = todayTaoDate;
|
|
8966
9535
|
Object.defineProperties(exports2, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|