@1337exp/taoui 1.13.0 → 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 -4781
- 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.mjs
CHANGED
|
@@ -1,20 +1,34 @@
|
|
|
1
|
-
import { defineComponent, openBlock, createElementBlock, normalizeClass, createCommentVNode, toDisplayString, createElementVNode, renderSlot, computed, normalizeStyle, inject, useId, ref,
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, createCommentVNode, toDisplayString, createElementVNode, renderSlot, computed, normalizeStyle, getCurrentInstance, camelize, inject, useId, ref, shallowRef, watch, createTextVNode, useSlots, onBeforeUnmount, createBlock, Teleport, createVNode, Transition, withCtx, nextTick, Fragment, renderList, onMounted, provide, resolveDynamicComponent, withModifiers, useCssVars, reactive, onBeforeMount, withDirectives, vModelText, mergeProps, TransitionGroup, onUpdated, createApp } from "vue";
|
|
2
|
+
const sizes = ["small", "medium", "large"];
|
|
3
|
+
function sizeClass(size) {
|
|
4
|
+
return size ? `tao-size-${size}` : void 0;
|
|
5
|
+
}
|
|
6
|
+
function resolveSize(el, size) {
|
|
7
|
+
if (size) {
|
|
8
|
+
return size;
|
|
9
|
+
}
|
|
10
|
+
if (!el || typeof getComputedStyle === "undefined") {
|
|
11
|
+
return "medium";
|
|
12
|
+
}
|
|
13
|
+
const value = getComputedStyle(el).getPropertyValue("--tao-size").trim();
|
|
14
|
+
return sizes.includes(value) ? value : "medium";
|
|
15
|
+
}
|
|
2
16
|
const _hoisted_1$P = ["type", "disabled"];
|
|
3
17
|
const _hoisted_2$I = {
|
|
4
18
|
key: 0,
|
|
5
19
|
class: "tao-button__loader"
|
|
6
20
|
};
|
|
7
|
-
const _hoisted_3$
|
|
21
|
+
const _hoisted_3$z = {
|
|
8
22
|
key: 1,
|
|
9
23
|
class: "tao-button__icon"
|
|
10
24
|
};
|
|
11
|
-
const _hoisted_4$
|
|
25
|
+
const _hoisted_4$u = { class: "tao-button__content" };
|
|
12
26
|
const _sfc_main$Z = /* @__PURE__ */ defineComponent({
|
|
13
27
|
...{ name: "TaoButton" },
|
|
14
28
|
__name: "TaoButton",
|
|
15
29
|
props: {
|
|
16
30
|
type: { default: "button" },
|
|
17
|
-
size: {
|
|
31
|
+
size: {},
|
|
18
32
|
variant: { default: "primary" },
|
|
19
33
|
tone: { default: "" },
|
|
20
34
|
disabled: { type: Boolean, default: false },
|
|
@@ -34,7 +48,7 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
|
|
|
34
48
|
return (_ctx, _cache) => {
|
|
35
49
|
return openBlock(), createElementBlock("button", {
|
|
36
50
|
class: normalizeClass(["tao-button", [
|
|
37
|
-
|
|
51
|
+
unref(sizeClass)(__props.size),
|
|
38
52
|
`tao-button--${__props.variant}`,
|
|
39
53
|
{
|
|
40
54
|
"tao-button--disabled": __props.disabled,
|
|
@@ -49,8 +63,8 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
|
|
|
49
63
|
onClick: handleClick
|
|
50
64
|
}, [
|
|
51
65
|
__props.loading ? (openBlock(), createElementBlock("span", _hoisted_2$I)) : createCommentVNode("", true),
|
|
52
|
-
__props.icon ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
53
|
-
createElementVNode("span", _hoisted_4$
|
|
66
|
+
__props.icon ? (openBlock(), createElementBlock("span", _hoisted_3$z, toDisplayString(__props.icon), 1)) : createCommentVNode("", true),
|
|
67
|
+
createElementVNode("span", _hoisted_4$u, [
|
|
54
68
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
55
69
|
])
|
|
56
70
|
], 10, _hoisted_1$P);
|
|
@@ -64,7 +78,16 @@ const _export_sfc = (sfc, props) => {
|
|
|
64
78
|
}
|
|
65
79
|
return target;
|
|
66
80
|
};
|
|
67
|
-
const TaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["__scopeId", "data-v-
|
|
81
|
+
const TaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["__scopeId", "data-v-eb25f649"]]);
|
|
82
|
+
function toCssLength(value) {
|
|
83
|
+
if (value === void 0 || value === null || value === "") {
|
|
84
|
+
return void 0;
|
|
85
|
+
}
|
|
86
|
+
return typeof value === "number" ? `${value}px` : value;
|
|
87
|
+
}
|
|
88
|
+
function toCssBox(value) {
|
|
89
|
+
return Array.isArray(value) ? value.map((part) => toCssLength(part) ?? "0").join(" ") : toCssLength(value);
|
|
90
|
+
}
|
|
68
91
|
const _sfc_main$Y = /* @__PURE__ */ defineComponent({
|
|
69
92
|
...{ name: "TaoBlock" },
|
|
70
93
|
__name: "TaoBlock",
|
|
@@ -76,17 +99,8 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
|
|
|
76
99
|
},
|
|
77
100
|
setup(__props) {
|
|
78
101
|
const props = __props;
|
|
79
|
-
const paddingStyle = computed(() => {
|
|
80
|
-
|
|
81
|
-
return {
|
|
82
|
-
padding: `${props.padding.map((p) => `${p}px`).join(" ")}`
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
return { padding: `${props.padding}px` };
|
|
86
|
-
});
|
|
87
|
-
const radiusStyle = computed(() => ({
|
|
88
|
-
borderRadius: `${props.radius}px`
|
|
89
|
-
}));
|
|
102
|
+
const paddingStyle = computed(() => ({ padding: toCssBox(props.padding) }));
|
|
103
|
+
const radiusStyle = computed(() => ({ borderRadius: toCssLength(props.radius) }));
|
|
90
104
|
return (_ctx, _cache) => {
|
|
91
105
|
return openBlock(), createElementBlock("div", {
|
|
92
106
|
class: normalizeClass(["tao-block", { "tao-block--shadow": __props.shadow, "tao-block--hover": __props.hover }]),
|
|
@@ -97,20 +111,57 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
|
|
|
97
111
|
};
|
|
98
112
|
}
|
|
99
113
|
});
|
|
100
|
-
const TaoBlock = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["__scopeId", "data-v-
|
|
114
|
+
const TaoBlock = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["__scopeId", "data-v-9f97afe2"]]);
|
|
101
115
|
const formFieldKey = Symbol("taoFormField");
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
116
|
+
function isDev() {
|
|
117
|
+
try {
|
|
118
|
+
return process.env.NODE_ENV !== "production";
|
|
119
|
+
} catch {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
const warned = /* @__PURE__ */ new Set();
|
|
124
|
+
function deprecationWarning(component, what, instead) {
|
|
125
|
+
if (!isDev()) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
const key = `${component}:${what}`;
|
|
129
|
+
if (warned.has(key)) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
warned.add(key);
|
|
133
|
+
console.warn(`[TaoUI] ${component}: ${what} is deprecated — ${instead}. It will be removed in 3.0.`);
|
|
134
|
+
}
|
|
135
|
+
function warnDeprecated(component, replacements) {
|
|
136
|
+
var _a;
|
|
137
|
+
if (!isDev()) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
const passed = (_a = getCurrentInstance()) == null ? void 0 : _a.vnode.props;
|
|
141
|
+
if (!passed) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const names = new Set(Object.keys(passed).map((name) => camelize(name)));
|
|
145
|
+
for (const [name, instead] of Object.entries(replacements)) {
|
|
146
|
+
if (!names.has(name)) {
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
const isListener = /^on[A-Z]/.test(name);
|
|
150
|
+
const label = isListener ? `event "${name[2].toLowerCase()}${name.slice(3)}"` : `prop "${name}"`;
|
|
151
|
+
deprecationWarning(component, label, instead);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
const _hoisted_1$O = ["for"];
|
|
155
|
+
const _hoisted_2$H = {
|
|
105
156
|
key: 0,
|
|
106
157
|
class: "tao-input__affix tao-input__affix--prefix"
|
|
107
158
|
};
|
|
108
|
-
const
|
|
109
|
-
const
|
|
159
|
+
const _hoisted_3$y = ["id", "type", "value", "placeholder", "disabled", "aria-invalid", "aria-describedby"];
|
|
160
|
+
const _hoisted_4$t = {
|
|
110
161
|
key: 1,
|
|
111
162
|
class: "tao-input__affix tao-input__affix--suffix"
|
|
112
163
|
};
|
|
113
|
-
const
|
|
164
|
+
const _hoisted_5$m = {
|
|
114
165
|
key: 1,
|
|
115
166
|
class: "tao-input__error"
|
|
116
167
|
};
|
|
@@ -122,6 +173,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
122
173
|
type: { default: "text" },
|
|
123
174
|
placeholder: { default: "" },
|
|
124
175
|
disabled: { type: Boolean, default: false },
|
|
176
|
+
size: {},
|
|
125
177
|
error: { type: Boolean, default: false },
|
|
126
178
|
errorMessage: { default: "" },
|
|
127
179
|
label: { default: "" },
|
|
@@ -149,13 +201,19 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
149
201
|
focused.value = true;
|
|
150
202
|
emit("focus", event);
|
|
151
203
|
}
|
|
204
|
+
warnDeprecated("TaoInput", {
|
|
205
|
+
label: "use `label` of TaoFormField",
|
|
206
|
+
errorMessage: "use `error` of TaoFormField"
|
|
207
|
+
});
|
|
152
208
|
return (_ctx, _cache) => {
|
|
153
|
-
return openBlock(), createElementBlock("div",
|
|
209
|
+
return openBlock(), createElementBlock("div", {
|
|
210
|
+
class: normalizeClass(["tao-input-wrapper", unref(sizeClass)(__props.size)])
|
|
211
|
+
}, [
|
|
154
212
|
__props.label && !unref(field) ? (openBlock(), createElementBlock("label", {
|
|
155
213
|
key: 0,
|
|
156
214
|
class: "tao-input__label",
|
|
157
215
|
for: controlId.value
|
|
158
|
-
}, toDisplayString(__props.label), 9,
|
|
216
|
+
}, toDisplayString(__props.label), 9, _hoisted_1$O)) : createCommentVNode("", true),
|
|
159
217
|
createElementVNode("div", {
|
|
160
218
|
class: normalizeClass(["tao-input-shell", {
|
|
161
219
|
"tao-input-shell--focused": focused.value,
|
|
@@ -165,7 +223,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
165
223
|
"tao-input-shell--suffix": _ctx.$slots.suffix
|
|
166
224
|
}])
|
|
167
225
|
}, [
|
|
168
|
-
_ctx.$slots.prefix ? (openBlock(), createElementBlock("span",
|
|
226
|
+
_ctx.$slots.prefix ? (openBlock(), createElementBlock("span", _hoisted_2$H, [
|
|
169
227
|
renderSlot(_ctx.$slots, "prefix", {}, void 0, true)
|
|
170
228
|
])) : createCommentVNode("", true),
|
|
171
229
|
createElementVNode("input", {
|
|
@@ -180,29 +238,32 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
180
238
|
onInput: handleInput,
|
|
181
239
|
onBlur: handleBlur,
|
|
182
240
|
onFocus: handleFocus
|
|
183
|
-
}, null, 42,
|
|
184
|
-
_ctx.$slots.suffix ? (openBlock(), createElementBlock("span",
|
|
241
|
+
}, null, 42, _hoisted_3$y),
|
|
242
|
+
_ctx.$slots.suffix ? (openBlock(), createElementBlock("span", _hoisted_4$t, [
|
|
185
243
|
renderSlot(_ctx.$slots, "suffix", {}, void 0, true)
|
|
186
244
|
])) : createCommentVNode("", true)
|
|
187
245
|
], 2),
|
|
188
|
-
__props.error && __props.errorMessage ? (openBlock(), createElementBlock("span",
|
|
189
|
-
]);
|
|
246
|
+
__props.error && __props.errorMessage ? (openBlock(), createElementBlock("span", _hoisted_5$m, toDisplayString(__props.errorMessage), 1)) : createCommentVNode("", true)
|
|
247
|
+
], 2);
|
|
190
248
|
};
|
|
191
249
|
}
|
|
192
250
|
});
|
|
193
|
-
const TaoInput = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__scopeId", "data-v-
|
|
251
|
+
const TaoInput = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__scopeId", "data-v-aca887be"]]);
|
|
194
252
|
const _hoisted_1$N = {
|
|
195
253
|
key: 0,
|
|
196
254
|
class: "tao-input-group__addon tao-input-group__addon--before"
|
|
197
255
|
};
|
|
198
256
|
const _hoisted_2$G = { class: "tao-input-group__field" };
|
|
199
|
-
const _hoisted_3$
|
|
257
|
+
const _hoisted_3$x = {
|
|
200
258
|
key: 1,
|
|
201
259
|
class: "tao-input-group__addon tao-input-group__addon--after"
|
|
202
260
|
};
|
|
203
261
|
const _sfc_main$W = /* @__PURE__ */ defineComponent({
|
|
204
262
|
...{ name: "TaoInputGroup" },
|
|
205
263
|
__name: "TaoInputGroup",
|
|
264
|
+
props: {
|
|
265
|
+
size: {}
|
|
266
|
+
},
|
|
206
267
|
setup(__props) {
|
|
207
268
|
const focused = ref(false);
|
|
208
269
|
function onFocusIn() {
|
|
@@ -217,7 +278,7 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent({
|
|
|
217
278
|
}
|
|
218
279
|
return (_ctx, _cache) => {
|
|
219
280
|
return openBlock(), createElementBlock("div", {
|
|
220
|
-
class: normalizeClass(["tao-input-group", { "tao-input-group--focused": focused.value }]),
|
|
281
|
+
class: normalizeClass(["tao-input-group", [unref(sizeClass)(__props.size), { "tao-input-group--focused": focused.value }]]),
|
|
221
282
|
role: "group",
|
|
222
283
|
onFocusin: onFocusIn,
|
|
223
284
|
onFocusout: onFocusOut
|
|
@@ -228,21 +289,340 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent({
|
|
|
228
289
|
createElementVNode("div", _hoisted_2$G, [
|
|
229
290
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
230
291
|
]),
|
|
231
|
-
_ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
292
|
+
_ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_3$x, [
|
|
232
293
|
renderSlot(_ctx.$slots, "after", {}, void 0, true)
|
|
233
294
|
])) : createCommentVNode("", true)
|
|
234
295
|
], 34);
|
|
235
296
|
};
|
|
236
297
|
}
|
|
237
298
|
});
|
|
238
|
-
const TaoInputGroup = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["__scopeId", "data-v-
|
|
299
|
+
const TaoInputGroup = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["__scopeId", "data-v-55b2d297"]]);
|
|
300
|
+
const localeRu = {
|
|
301
|
+
code: "ru-RU",
|
|
302
|
+
alert: { closeLabel: "Закрыть" },
|
|
303
|
+
avatar: {
|
|
304
|
+
fallbackLabel: "Аватар",
|
|
305
|
+
notificationsLabel: "{count} уведомлений",
|
|
306
|
+
dotLabels: {
|
|
307
|
+
success: "в сети",
|
|
308
|
+
danger: "занят",
|
|
309
|
+
warning: "отошёл",
|
|
310
|
+
info: "статус",
|
|
311
|
+
neutral: "не в сети"
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
breadcrumb: { ariaLabel: "Хлебные крошки" },
|
|
315
|
+
carousel: {
|
|
316
|
+
ariaLabel: "Лента",
|
|
317
|
+
prevLabel: "Назад",
|
|
318
|
+
nextLabel: "Вперёд",
|
|
319
|
+
dotsLabel: "Слайды",
|
|
320
|
+
slideLabel: "Слайд {n} из {count}"
|
|
321
|
+
},
|
|
322
|
+
combobox: {
|
|
323
|
+
placeholder: "Начните вводить",
|
|
324
|
+
emptyText: "Ничего не найдено",
|
|
325
|
+
clearText: "Очистить",
|
|
326
|
+
createText: "Добавить «{text}»"
|
|
327
|
+
},
|
|
328
|
+
confirm: { ok: "ОК", cancel: "Отмена" },
|
|
329
|
+
copy: { copyLabel: "Копировать", successText: "Скопировано!" },
|
|
330
|
+
date: {
|
|
331
|
+
placeholder: "Дата",
|
|
332
|
+
todayText: "Сегодня",
|
|
333
|
+
clearText: "Очистить",
|
|
334
|
+
prevMonthLabel: "Предыдущий месяц",
|
|
335
|
+
nextMonthLabel: "Следующий месяц"
|
|
336
|
+
},
|
|
337
|
+
dateRange: {
|
|
338
|
+
placeholder: "Период",
|
|
339
|
+
todayText: "Сегодня",
|
|
340
|
+
clearText: "Очистить",
|
|
341
|
+
prevMonthLabel: "Предыдущий месяц",
|
|
342
|
+
nextMonthLabel: "Следующий месяц"
|
|
343
|
+
},
|
|
344
|
+
drawer: { closeLabel: "Закрыть" },
|
|
345
|
+
dropdownMenu: { menuLabel: "Меню" },
|
|
346
|
+
empty: { title: "Ничего нет" },
|
|
347
|
+
fileDrop: {
|
|
348
|
+
clearLabel: "Очистить файлы",
|
|
349
|
+
removeLabel: "Убрать «{name}»",
|
|
350
|
+
zoneText: "Перетащите файл сюда или нажмите, чтобы выбрать",
|
|
351
|
+
units: ["Б", "КБ", "МБ"],
|
|
352
|
+
decimalSeparator: ","
|
|
353
|
+
},
|
|
354
|
+
inputNumber: { incrementLabel: "Увеличить", decrementLabel: "Уменьшить" },
|
|
355
|
+
list: { emptyText: "Ничего нет" },
|
|
356
|
+
modal: { closeLabel: "Закрыть" },
|
|
357
|
+
pagination: {
|
|
358
|
+
ariaLabel: "Пагинация",
|
|
359
|
+
prevLabel: "Назад",
|
|
360
|
+
nextLabel: "Вперёд",
|
|
361
|
+
pageLabel: "Страница {page}",
|
|
362
|
+
jumpPrevLabel: "Назад на {n} страниц",
|
|
363
|
+
jumpNextLabel: "Вперёд на {n} страниц",
|
|
364
|
+
totalText: "{from}–{to} из {total}",
|
|
365
|
+
emptyTotalText: "0 из 0"
|
|
366
|
+
},
|
|
367
|
+
quantity: { decrementLabel: "Уменьшить", removeLabel: "Убрать", incrementLabel: "Увеличить" },
|
|
368
|
+
scrollTop: { ariaLabel: "Наверх" },
|
|
369
|
+
select: { placeholder: "Выберите", clearText: "Очистить" },
|
|
370
|
+
stages: {
|
|
371
|
+
ariaLabel: "Стадии",
|
|
372
|
+
statusLabels: { wait: "ожидание", work: "в работе", ok: "готово", bad: "ошибка" }
|
|
373
|
+
},
|
|
374
|
+
table: { emptyText: "Нет данных" },
|
|
375
|
+
tag: { closeLabel: "Убрать" },
|
|
376
|
+
toast: { closeLabel: "Закрыть уведомление" }
|
|
377
|
+
};
|
|
378
|
+
const confirmDefaults = {
|
|
379
|
+
ok: localeRu.confirm.ok,
|
|
380
|
+
cancel: localeRu.confirm.cancel
|
|
381
|
+
};
|
|
382
|
+
const currentConfirm = ref(null);
|
|
383
|
+
const queue = [];
|
|
384
|
+
function configureConfirmDefaults(partial) {
|
|
385
|
+
Object.assign(confirmDefaults, partial);
|
|
386
|
+
}
|
|
387
|
+
function pump() {
|
|
388
|
+
if (currentConfirm.value) {
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
currentConfirm.value = queue.shift() ?? null;
|
|
392
|
+
}
|
|
393
|
+
function enqueueConfirm(record) {
|
|
394
|
+
queue.push(record);
|
|
395
|
+
pump();
|
|
396
|
+
}
|
|
397
|
+
function resolveConfirm(value) {
|
|
398
|
+
const item = currentConfirm.value;
|
|
399
|
+
if (!item) {
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
currentConfirm.value = null;
|
|
403
|
+
item.resolve(value);
|
|
404
|
+
pump();
|
|
405
|
+
}
|
|
406
|
+
let viewportMounts$1 = 0;
|
|
407
|
+
function registerConfirmHost() {
|
|
408
|
+
viewportMounts$1 += 1;
|
|
409
|
+
}
|
|
410
|
+
function unregisterConfirmHost() {
|
|
411
|
+
viewportMounts$1 = Math.max(0, viewportMounts$1 - 1);
|
|
412
|
+
}
|
|
413
|
+
function hasConfirmHost() {
|
|
414
|
+
if (viewportMounts$1 > 0) {
|
|
415
|
+
return true;
|
|
416
|
+
}
|
|
417
|
+
if (typeof document === "undefined") {
|
|
418
|
+
return false;
|
|
419
|
+
}
|
|
420
|
+
return Boolean(document.querySelector("[data-tao-confirm-host]"));
|
|
421
|
+
}
|
|
422
|
+
const TOAST_POSITIONS = [
|
|
423
|
+
"topRight",
|
|
424
|
+
"topLeft",
|
|
425
|
+
"topCenter",
|
|
426
|
+
"bottomRight",
|
|
427
|
+
"bottomLeft",
|
|
428
|
+
"bottomCenter",
|
|
429
|
+
"center"
|
|
430
|
+
];
|
|
431
|
+
const toastDefaults = {
|
|
432
|
+
position: "topCenter",
|
|
433
|
+
timeout: 3e3,
|
|
434
|
+
closable: true,
|
|
435
|
+
progress: true,
|
|
436
|
+
closeLabel: localeRu.toast.closeLabel
|
|
437
|
+
};
|
|
438
|
+
const toasts = ref([]);
|
|
439
|
+
const toastsByPosition = computed(() => {
|
|
440
|
+
const grouped = {};
|
|
441
|
+
for (const position of TOAST_POSITIONS) {
|
|
442
|
+
grouped[position] = [];
|
|
443
|
+
}
|
|
444
|
+
for (const toast2 of toasts.value) {
|
|
445
|
+
grouped[toast2.position].push(toast2);
|
|
446
|
+
}
|
|
447
|
+
return grouped;
|
|
448
|
+
});
|
|
449
|
+
function configureToastDefaults(partial) {
|
|
450
|
+
Object.assign(toastDefaults, partial);
|
|
451
|
+
}
|
|
452
|
+
function addToast(record) {
|
|
453
|
+
if (record.displayMode === "once" && record.dedupeId) {
|
|
454
|
+
const exists = toasts.value.some((item) => item.dedupeId === record.dedupeId);
|
|
455
|
+
if (exists) {
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
if (record.displayMode === "replace" && record.dedupeId) {
|
|
460
|
+
toasts.value = toasts.value.filter((item) => item.dedupeId !== record.dedupeId);
|
|
461
|
+
}
|
|
462
|
+
toasts.value = [...toasts.value, record];
|
|
463
|
+
}
|
|
464
|
+
function removeToast(id) {
|
|
465
|
+
var _a;
|
|
466
|
+
const item = toasts.value.find((toast2) => toast2.id === id);
|
|
467
|
+
if (!item) {
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
toasts.value = toasts.value.filter((toast2) => toast2.id !== id);
|
|
471
|
+
(_a = item.onClosed) == null ? void 0 : _a.call(item);
|
|
472
|
+
}
|
|
473
|
+
function dismissToasts(id) {
|
|
474
|
+
if (id) {
|
|
475
|
+
removeToast(id);
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
const items = toasts.value;
|
|
479
|
+
toasts.value = [];
|
|
480
|
+
items.forEach((item) => {
|
|
481
|
+
var _a;
|
|
482
|
+
return (_a = item.onClosed) == null ? void 0 : _a.call(item);
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
let viewportMounts = 0;
|
|
486
|
+
function registerToastViewport() {
|
|
487
|
+
viewportMounts += 1;
|
|
488
|
+
}
|
|
489
|
+
function unregisterToastViewport() {
|
|
490
|
+
viewportMounts = Math.max(0, viewportMounts - 1);
|
|
491
|
+
}
|
|
492
|
+
function hasToastViewport() {
|
|
493
|
+
if (viewportMounts > 0) {
|
|
494
|
+
return true;
|
|
495
|
+
}
|
|
496
|
+
if (typeof document === "undefined") {
|
|
497
|
+
return false;
|
|
498
|
+
}
|
|
499
|
+
return Boolean(document.querySelector("[data-tao-toast-viewport]"));
|
|
500
|
+
}
|
|
501
|
+
const localeEn = {
|
|
502
|
+
code: "en-US",
|
|
503
|
+
alert: { closeLabel: "Close" },
|
|
504
|
+
avatar: {
|
|
505
|
+
fallbackLabel: "Avatar",
|
|
506
|
+
notificationsLabel: "{count} notifications",
|
|
507
|
+
dotLabels: {
|
|
508
|
+
success: "online",
|
|
509
|
+
danger: "busy",
|
|
510
|
+
warning: "away",
|
|
511
|
+
info: "status",
|
|
512
|
+
neutral: "offline"
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
breadcrumb: { ariaLabel: "Breadcrumb" },
|
|
516
|
+
carousel: {
|
|
517
|
+
ariaLabel: "Carousel",
|
|
518
|
+
prevLabel: "Previous",
|
|
519
|
+
nextLabel: "Next",
|
|
520
|
+
dotsLabel: "Slides",
|
|
521
|
+
slideLabel: "Slide {n} of {count}"
|
|
522
|
+
},
|
|
523
|
+
combobox: {
|
|
524
|
+
placeholder: "Start typing",
|
|
525
|
+
emptyText: "Nothing found",
|
|
526
|
+
clearText: "Clear",
|
|
527
|
+
createText: "Add “{text}”"
|
|
528
|
+
},
|
|
529
|
+
confirm: { ok: "OK", cancel: "Cancel" },
|
|
530
|
+
copy: { copyLabel: "Copy", successText: "Copied!" },
|
|
531
|
+
date: {
|
|
532
|
+
placeholder: "Date",
|
|
533
|
+
todayText: "Today",
|
|
534
|
+
clearText: "Clear",
|
|
535
|
+
prevMonthLabel: "Previous month",
|
|
536
|
+
nextMonthLabel: "Next month"
|
|
537
|
+
},
|
|
538
|
+
dateRange: {
|
|
539
|
+
placeholder: "Period",
|
|
540
|
+
todayText: "Today",
|
|
541
|
+
clearText: "Clear",
|
|
542
|
+
prevMonthLabel: "Previous month",
|
|
543
|
+
nextMonthLabel: "Next month"
|
|
544
|
+
},
|
|
545
|
+
drawer: { closeLabel: "Close" },
|
|
546
|
+
dropdownMenu: { menuLabel: "Menu" },
|
|
547
|
+
empty: { title: "Nothing here" },
|
|
548
|
+
fileDrop: {
|
|
549
|
+
clearLabel: "Clear files",
|
|
550
|
+
removeLabel: "Remove “{name}”",
|
|
551
|
+
zoneText: "Drop a file here or click to choose",
|
|
552
|
+
units: ["B", "KB", "MB"],
|
|
553
|
+
decimalSeparator: "."
|
|
554
|
+
},
|
|
555
|
+
inputNumber: { incrementLabel: "Increase", decrementLabel: "Decrease" },
|
|
556
|
+
list: { emptyText: "Nothing here" },
|
|
557
|
+
modal: { closeLabel: "Close" },
|
|
558
|
+
pagination: {
|
|
559
|
+
ariaLabel: "Pagination",
|
|
560
|
+
prevLabel: "Previous",
|
|
561
|
+
nextLabel: "Next",
|
|
562
|
+
pageLabel: "Page {page}",
|
|
563
|
+
jumpPrevLabel: "Back {n} pages",
|
|
564
|
+
jumpNextLabel: "Forward {n} pages",
|
|
565
|
+
totalText: "{from}–{to} of {total}",
|
|
566
|
+
emptyTotalText: "0 of 0"
|
|
567
|
+
},
|
|
568
|
+
quantity: { decrementLabel: "Decrease", removeLabel: "Remove", incrementLabel: "Increase" },
|
|
569
|
+
scrollTop: { ariaLabel: "Back to top" },
|
|
570
|
+
select: { placeholder: "Select", clearText: "Clear" },
|
|
571
|
+
stages: {
|
|
572
|
+
ariaLabel: "Stages",
|
|
573
|
+
statusLabels: { wait: "pending", work: "in progress", ok: "done", bad: "failed" }
|
|
574
|
+
},
|
|
575
|
+
table: { emptyText: "No data" },
|
|
576
|
+
tag: { closeLabel: "Remove" },
|
|
577
|
+
toast: { closeLabel: "Close notification" }
|
|
578
|
+
};
|
|
579
|
+
const current = shallowRef(localeRu);
|
|
580
|
+
function taoLocale() {
|
|
581
|
+
return current.value;
|
|
582
|
+
}
|
|
583
|
+
function isPlainObject(value) {
|
|
584
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
585
|
+
}
|
|
586
|
+
function merge(base, overrides) {
|
|
587
|
+
if (!isPlainObject(base) || !isPlainObject(overrides)) {
|
|
588
|
+
return overrides === void 0 ? base : overrides;
|
|
589
|
+
}
|
|
590
|
+
const out = { ...base };
|
|
591
|
+
for (const [key, value] of Object.entries(overrides)) {
|
|
592
|
+
if (value !== void 0) {
|
|
593
|
+
out[key] = merge(base[key], value);
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
return out;
|
|
597
|
+
}
|
|
598
|
+
function setTaoLocale(locale, base = localeRu) {
|
|
599
|
+
current.value = merge(base, locale);
|
|
600
|
+
configureToastDefaults({ closeLabel: current.value.toast.closeLabel });
|
|
601
|
+
configureConfirmDefaults({ ok: current.value.confirm.ok, cancel: current.value.confirm.cancel });
|
|
602
|
+
}
|
|
603
|
+
function useLocaleText(props, section) {
|
|
604
|
+
return computed(() => {
|
|
605
|
+
const base = current.value[section];
|
|
606
|
+
const own = props;
|
|
607
|
+
const out = { ...base };
|
|
608
|
+
for (const key of Object.keys(base)) {
|
|
609
|
+
if (own[key] !== void 0) {
|
|
610
|
+
out[key] = own[key];
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
return out;
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
function formatText(template, values) {
|
|
617
|
+
return template.replace(/\{(\w+)\}/g, (match, key) => key in values ? String(values[key]) : match);
|
|
618
|
+
}
|
|
239
619
|
const _hoisted_1$M = ["id", "value", "placeholder", "disabled", "aria-invalid", "aria-describedby", "aria-valuenow", "aria-valuemin", "aria-valuemax"];
|
|
240
620
|
const _hoisted_2$F = {
|
|
241
621
|
key: 0,
|
|
242
622
|
class: "tao-input-number__steppers"
|
|
243
623
|
};
|
|
244
|
-
const _hoisted_3$
|
|
245
|
-
const _hoisted_4$
|
|
624
|
+
const _hoisted_3$w = ["aria-label", "disabled"];
|
|
625
|
+
const _hoisted_4$s = { "aria-hidden": "true" };
|
|
246
626
|
const _hoisted_5$l = ["aria-label", "disabled"];
|
|
247
627
|
const _hoisted_6$g = { "aria-hidden": "true" };
|
|
248
628
|
const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
@@ -255,19 +635,22 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
255
635
|
step: { default: 1 },
|
|
256
636
|
precision: {},
|
|
257
637
|
disabled: { type: Boolean, default: false },
|
|
638
|
+
error: { type: Boolean, default: false },
|
|
639
|
+
size: {},
|
|
258
640
|
placeholder: { default: "" },
|
|
259
641
|
controls: { type: Boolean, default: true },
|
|
260
|
-
incrementLabel: {
|
|
261
|
-
decrementLabel: {
|
|
642
|
+
incrementLabel: {},
|
|
643
|
+
decrementLabel: {}
|
|
262
644
|
},
|
|
263
645
|
emits: ["update:modelValue", "commit", "blur", "focus"],
|
|
264
646
|
setup(__props, { emit: __emit }) {
|
|
265
647
|
const props = __props;
|
|
648
|
+
const l10n = useLocaleText(props, "inputNumber");
|
|
266
649
|
const emit = __emit;
|
|
267
650
|
const field = inject(formFieldKey, null);
|
|
268
651
|
const localId = useId();
|
|
269
652
|
const controlId = computed(() => (field == null ? void 0 : field.id) ?? localId);
|
|
270
|
-
const invalid = computed(() => Boolean(field == null ? void 0 : field.invalid.value));
|
|
653
|
+
const invalid = computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
271
654
|
const describedBy = computed(() => field == null ? void 0 : field.describedBy.value);
|
|
272
655
|
const focused = ref(false);
|
|
273
656
|
const draft = ref(toDraft(props.modelValue));
|
|
@@ -379,7 +762,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
379
762
|
const atMax = computed(() => props.max !== void 0 && (props.modelValue ?? 0) >= props.max);
|
|
380
763
|
return (_ctx, _cache) => {
|
|
381
764
|
return openBlock(), createElementBlock("div", {
|
|
382
|
-
class: normalizeClass(["tao-input-number", { "tao-input-number--invalid": invalid.value, "tao-input-number--controls": __props.controls }])
|
|
765
|
+
class: normalizeClass(["tao-input-number", [unref(sizeClass)(__props.size), { "tao-input-number--invalid": invalid.value, "tao-input-number--controls": __props.controls }]])
|
|
383
766
|
}, [
|
|
384
767
|
createElementVNode("input", {
|
|
385
768
|
id: controlId.value,
|
|
@@ -405,21 +788,21 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
405
788
|
createElementVNode("button", {
|
|
406
789
|
type: "button",
|
|
407
790
|
class: "tao-input-number__step",
|
|
408
|
-
"aria-label":
|
|
791
|
+
"aria-label": unref(l10n).incrementLabel,
|
|
409
792
|
tabindex: "-1",
|
|
410
793
|
disabled: __props.disabled || atMax.value,
|
|
411
794
|
onClick: _cache[0] || (_cache[0] = ($event) => bump(1))
|
|
412
795
|
}, [
|
|
413
|
-
createElementVNode("span", _hoisted_4$
|
|
796
|
+
createElementVNode("span", _hoisted_4$s, [
|
|
414
797
|
renderSlot(_ctx.$slots, "increment-icon", {}, () => [
|
|
415
798
|
_cache[2] || (_cache[2] = createTextVNode("+", -1))
|
|
416
799
|
], true)
|
|
417
800
|
])
|
|
418
|
-
], 8, _hoisted_3$
|
|
801
|
+
], 8, _hoisted_3$w),
|
|
419
802
|
createElementVNode("button", {
|
|
420
803
|
type: "button",
|
|
421
804
|
class: "tao-input-number__step",
|
|
422
|
-
"aria-label":
|
|
805
|
+
"aria-label": unref(l10n).decrementLabel,
|
|
423
806
|
tabindex: "-1",
|
|
424
807
|
disabled: __props.disabled || atMin.value,
|
|
425
808
|
onClick: _cache[1] || (_cache[1] = ($event) => bump(-1))
|
|
@@ -435,11 +818,11 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
435
818
|
};
|
|
436
819
|
}
|
|
437
820
|
});
|
|
438
|
-
const TaoInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["__scopeId", "data-v-
|
|
821
|
+
const TaoInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["__scopeId", "data-v-52c1f25a"]]);
|
|
439
822
|
const _hoisted_1$L = ["aria-label", "disabled"];
|
|
440
823
|
const _hoisted_2$E = { "aria-hidden": "true" };
|
|
441
|
-
const _hoisted_3$
|
|
442
|
-
const _hoisted_4$
|
|
824
|
+
const _hoisted_3$v = ["id", "value", "disabled", "aria-invalid", "aria-describedby", "aria-valuenow", "aria-valuemin", "aria-valuemax"];
|
|
825
|
+
const _hoisted_4$r = ["aria-label", "disabled"];
|
|
443
826
|
const _hoisted_5$k = { "aria-hidden": "true" };
|
|
444
827
|
const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
445
828
|
...{ name: "TaoQuantity" },
|
|
@@ -449,20 +832,23 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
|
449
832
|
min: { default: 1 },
|
|
450
833
|
max: {},
|
|
451
834
|
disabled: { type: Boolean, default: false },
|
|
835
|
+
error: { type: Boolean, default: false },
|
|
836
|
+
size: {},
|
|
452
837
|
allowRemove: { type: Boolean, default: true },
|
|
453
838
|
forceMaxLimit: { type: Boolean, default: true },
|
|
454
|
-
decrementLabel: {
|
|
455
|
-
removeLabel: {
|
|
456
|
-
incrementLabel: {
|
|
839
|
+
decrementLabel: {},
|
|
840
|
+
removeLabel: {},
|
|
841
|
+
incrementLabel: {}
|
|
457
842
|
},
|
|
458
843
|
emits: ["update:modelValue", "change", "dec", "inc", "blur", "focus"],
|
|
459
844
|
setup(__props, { emit: __emit }) {
|
|
460
845
|
const props = __props;
|
|
846
|
+
const l10n = useLocaleText(props, "quantity");
|
|
461
847
|
const emit = __emit;
|
|
462
848
|
const field = inject(formFieldKey, null);
|
|
463
849
|
const localId = useId();
|
|
464
850
|
const controlId = computed(() => (field == null ? void 0 : field.id) ?? localId);
|
|
465
|
-
const invalid = computed(() => Boolean(field == null ? void 0 : field.invalid.value));
|
|
851
|
+
const invalid = computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
466
852
|
const describedBy = computed(() => field == null ? void 0 : field.describedBy.value);
|
|
467
853
|
const focused = ref(false);
|
|
468
854
|
const draft = ref(String(props.modelValue));
|
|
@@ -562,14 +948,17 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
|
562
948
|
const atMax = computed(() => props.modelValue >= ceiling.value);
|
|
563
949
|
const minusDisabled = computed(() => props.disabled || !props.allowRemove && atMin.value);
|
|
564
950
|
const plusDisabled = computed(() => props.disabled || atMax.value);
|
|
565
|
-
const minusLabel = computed(() => atMin.value && props.allowRemove ?
|
|
951
|
+
const minusLabel = computed(() => atMin.value && props.allowRemove ? l10n.value.removeLabel : l10n.value.decrementLabel);
|
|
566
952
|
return (_ctx, _cache) => {
|
|
567
953
|
return openBlock(), createElementBlock("div", {
|
|
568
|
-
class: normalizeClass(["tao-quantity",
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
954
|
+
class: normalizeClass(["tao-quantity", [
|
|
955
|
+
unref(sizeClass)(__props.size),
|
|
956
|
+
{
|
|
957
|
+
"tao-quantity--invalid": invalid.value,
|
|
958
|
+
"tao-quantity--focused": focused.value,
|
|
959
|
+
"tao-quantity--disabled": __props.disabled
|
|
960
|
+
}
|
|
961
|
+
]])
|
|
573
962
|
}, [
|
|
574
963
|
createElementVNode("button", {
|
|
575
964
|
type: "button",
|
|
@@ -603,11 +992,11 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
|
603
992
|
onFocus,
|
|
604
993
|
onBlur,
|
|
605
994
|
onKeydown
|
|
606
|
-
}, null, 40, _hoisted_3$
|
|
995
|
+
}, null, 40, _hoisted_3$v),
|
|
607
996
|
createElementVNode("button", {
|
|
608
997
|
type: "button",
|
|
609
998
|
class: "tao-quantity__btn tao-quantity__btn--inc",
|
|
610
|
-
"aria-label":
|
|
999
|
+
"aria-label": unref(l10n).incrementLabel,
|
|
611
1000
|
disabled: plusDisabled.value,
|
|
612
1001
|
onClick: onInc
|
|
613
1002
|
}, [
|
|
@@ -616,12 +1005,12 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
|
616
1005
|
_cache[1] || (_cache[1] = createTextVNode("+", -1))
|
|
617
1006
|
], true)
|
|
618
1007
|
])
|
|
619
|
-
], 8, _hoisted_4$
|
|
1008
|
+
], 8, _hoisted_4$r)
|
|
620
1009
|
], 2);
|
|
621
1010
|
};
|
|
622
1011
|
}
|
|
623
1012
|
});
|
|
624
|
-
const TaoQuantity = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["__scopeId", "data-v-
|
|
1013
|
+
const TaoQuantity = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["__scopeId", "data-v-e27165e3"]]);
|
|
625
1014
|
const _hoisted_1$K = {
|
|
626
1015
|
key: 0,
|
|
627
1016
|
class: "tao-card__cover"
|
|
@@ -630,11 +1019,11 @@ const _hoisted_2$D = {
|
|
|
630
1019
|
key: 0,
|
|
631
1020
|
class: "tao-card__overlay"
|
|
632
1021
|
};
|
|
633
|
-
const _hoisted_3$
|
|
1022
|
+
const _hoisted_3$u = {
|
|
634
1023
|
key: 1,
|
|
635
1024
|
class: "tao-card__overlay"
|
|
636
1025
|
};
|
|
637
|
-
const _hoisted_4$
|
|
1026
|
+
const _hoisted_4$q = {
|
|
638
1027
|
key: 0,
|
|
639
1028
|
class: "tao-card__header-title"
|
|
640
1029
|
};
|
|
@@ -655,7 +1044,7 @@ const _hoisted_9$5 = {
|
|
|
655
1044
|
key: 3,
|
|
656
1045
|
class: "tao-card__body"
|
|
657
1046
|
};
|
|
658
|
-
const _hoisted_10$
|
|
1047
|
+
const _hoisted_10$4 = {
|
|
659
1048
|
key: 4,
|
|
660
1049
|
class: "tao-card__footer"
|
|
661
1050
|
};
|
|
@@ -683,12 +1072,9 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
|
683
1072
|
if (props.flush) {
|
|
684
1073
|
return { padding: "0" };
|
|
685
1074
|
}
|
|
686
|
-
|
|
687
|
-
return { padding: `${props.padding.map((p) => `${p}px`).join(" ")}` };
|
|
688
|
-
}
|
|
689
|
-
return { padding: `${props.padding}px` };
|
|
1075
|
+
return { padding: toCssBox(props.padding) };
|
|
690
1076
|
});
|
|
691
|
-
const radiusStyle = computed(() => ({ borderRadius:
|
|
1077
|
+
const radiusStyle = computed(() => ({ borderRadius: toCssLength(props.radius) }));
|
|
692
1078
|
const showPanelShadow = computed(() => props.shadow && !props.shadowBottomOnly && !props.flush);
|
|
693
1079
|
return (_ctx, _cache) => {
|
|
694
1080
|
return openBlock(), createElementBlock("div", {
|
|
@@ -708,7 +1094,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
|
708
1094
|
_ctx.$slots.overlay ? (openBlock(), createElementBlock("div", _hoisted_2$D, [
|
|
709
1095
|
renderSlot(_ctx.$slots, "overlay", {}, void 0, true)
|
|
710
1096
|
])) : createCommentVNode("", true)
|
|
711
|
-
])) : _ctx.$slots.overlay ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
1097
|
+
])) : _ctx.$slots.overlay ? (openBlock(), createElementBlock("div", _hoisted_3$u, [
|
|
712
1098
|
renderSlot(_ctx.$slots, "overlay", {}, void 0, true)
|
|
713
1099
|
])) : createCommentVNode("", true),
|
|
714
1100
|
hasContent.value ? (openBlock(), createElementBlock("div", {
|
|
@@ -716,7 +1102,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
|
716
1102
|
class: "tao-card__content",
|
|
717
1103
|
style: normalizeStyle(paddingStyle.value)
|
|
718
1104
|
}, [
|
|
719
|
-
_ctx.$slots.headerTitle ? (openBlock(), createElementBlock("h2", _hoisted_4$
|
|
1105
|
+
_ctx.$slots.headerTitle ? (openBlock(), createElementBlock("h2", _hoisted_4$q, [
|
|
720
1106
|
renderSlot(_ctx.$slots, "headerTitle", {}, void 0, true)
|
|
721
1107
|
])) : createCommentVNode("", true),
|
|
722
1108
|
_ctx.$slots.header || _ctx.$slots.headerSecondary ? (openBlock(), createElementBlock("div", {
|
|
@@ -741,7 +1127,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
|
741
1127
|
_ctx.$slots.default ? (openBlock(), createElementBlock("div", _hoisted_9$5, [
|
|
742
1128
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
743
1129
|
])) : createCommentVNode("", true),
|
|
744
|
-
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_10$
|
|
1130
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_10$4, [
|
|
745
1131
|
renderSlot(_ctx.$slots, "footer", {}, void 0, true)
|
|
746
1132
|
])) : createCommentVNode("", true)
|
|
747
1133
|
], 4)) : createCommentVNode("", true)
|
|
@@ -749,7 +1135,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
|
749
1135
|
};
|
|
750
1136
|
}
|
|
751
1137
|
});
|
|
752
|
-
const TaoCard = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-
|
|
1138
|
+
const TaoCard = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-00d63b5f"]]);
|
|
753
1139
|
const FOCUSABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
754
1140
|
function getFocusable(root) {
|
|
755
1141
|
return [...root.querySelectorAll(FOCUSABLE)].filter(
|
|
@@ -808,8 +1194,8 @@ const _hoisted_2$C = {
|
|
|
808
1194
|
key: 0,
|
|
809
1195
|
class: "tao-modal__header"
|
|
810
1196
|
};
|
|
811
|
-
const _hoisted_3$
|
|
812
|
-
const _hoisted_4$
|
|
1197
|
+
const _hoisted_3$t = ["id"];
|
|
1198
|
+
const _hoisted_4$p = { key: 1 };
|
|
813
1199
|
const _hoisted_5$i = ["aria-label"];
|
|
814
1200
|
const _hoisted_6$e = { "aria-hidden": "true" };
|
|
815
1201
|
const _hoisted_7$b = { class: "tao-modal__content" };
|
|
@@ -824,11 +1210,12 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
|
824
1210
|
modelValue: { type: Boolean },
|
|
825
1211
|
title: { default: "" },
|
|
826
1212
|
closable: { type: Boolean, default: true },
|
|
827
|
-
closeLabel: {
|
|
1213
|
+
closeLabel: {}
|
|
828
1214
|
},
|
|
829
1215
|
emits: ["update:modelValue", "close"],
|
|
830
1216
|
setup(__props, { emit: __emit }) {
|
|
831
1217
|
const props = __props;
|
|
1218
|
+
const l10n = useLocaleText(props, "modal");
|
|
832
1219
|
const emit = __emit;
|
|
833
1220
|
const panelRef = ref(null);
|
|
834
1221
|
const titleId = useId();
|
|
@@ -939,13 +1326,13 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
|
939
1326
|
key: 0,
|
|
940
1327
|
id: unref(titleId),
|
|
941
1328
|
class: "tao-modal__title"
|
|
942
|
-
}, toDisplayString(__props.title), 9, _hoisted_3$
|
|
1329
|
+
}, toDisplayString(__props.title), 9, _hoisted_3$t)) : (openBlock(), createElementBlock("span", _hoisted_4$p))
|
|
943
1330
|
], true),
|
|
944
1331
|
__props.closable ? (openBlock(), createElementBlock("button", {
|
|
945
1332
|
key: 0,
|
|
946
1333
|
type: "button",
|
|
947
1334
|
class: "tao-modal__close",
|
|
948
|
-
"aria-label":
|
|
1335
|
+
"aria-label": unref(l10n).closeLabel,
|
|
949
1336
|
onClick: close
|
|
950
1337
|
}, [
|
|
951
1338
|
createElementVNode("span", _hoisted_6$e, [
|
|
@@ -970,24 +1357,29 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
|
970
1357
|
};
|
|
971
1358
|
}
|
|
972
1359
|
});
|
|
973
|
-
const TaoModal = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
1360
|
+
const TaoModal = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-742274be"]]);
|
|
1361
|
+
function tabValue(tab) {
|
|
1362
|
+
return tab.value ?? tab.key;
|
|
1363
|
+
}
|
|
1364
|
+
const _hoisted_1$I = ["id", "aria-selected", "aria-controls", "tabindex", "disabled", "onClick"];
|
|
1365
|
+
const _hoisted_2$B = ["id", "aria-labelledby"];
|
|
977
1366
|
const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
978
1367
|
...{ name: "TaoTabs" },
|
|
979
1368
|
__name: "TaoTabs",
|
|
980
1369
|
props: {
|
|
981
|
-
|
|
1370
|
+
items: { default: void 0 },
|
|
1371
|
+
tabs: { default: void 0 },
|
|
982
1372
|
modelValue: {},
|
|
983
|
-
justify: { default: "" }
|
|
1373
|
+
justify: { default: "" },
|
|
1374
|
+
size: {}
|
|
984
1375
|
},
|
|
985
|
-
emits: ["update:modelValue"],
|
|
1376
|
+
emits: ["update:modelValue", "change"],
|
|
986
1377
|
setup(__props, { emit: __emit }) {
|
|
987
1378
|
const props = __props;
|
|
988
1379
|
const emit = __emit;
|
|
989
1380
|
const uid = useId();
|
|
990
|
-
const
|
|
1381
|
+
const list = computed(() => props.items ?? props.tabs ?? []);
|
|
1382
|
+
const enabledTabs = computed(() => list.value.filter((tab) => !tab.disabled));
|
|
991
1383
|
function tabId(key) {
|
|
992
1384
|
return `${uid}-${key}`;
|
|
993
1385
|
}
|
|
@@ -995,9 +1387,12 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
|
995
1387
|
return `${uid}-panel-${key}`;
|
|
996
1388
|
}
|
|
997
1389
|
function selectTab(key, focus = false) {
|
|
998
|
-
const tab =
|
|
1390
|
+
const tab = list.value.find((item) => tabValue(item) === key);
|
|
999
1391
|
if (tab && !tab.disabled) {
|
|
1000
1392
|
emit("update:modelValue", key);
|
|
1393
|
+
if (key !== props.modelValue) {
|
|
1394
|
+
emit("change", key);
|
|
1395
|
+
}
|
|
1001
1396
|
if (focus) {
|
|
1002
1397
|
void nextTick(() => {
|
|
1003
1398
|
var _a;
|
|
@@ -1011,12 +1406,11 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
|
1011
1406
|
if (!enabled.length) {
|
|
1012
1407
|
return;
|
|
1013
1408
|
}
|
|
1014
|
-
const
|
|
1015
|
-
const next = enabled[(
|
|
1016
|
-
selectTab(next
|
|
1409
|
+
const current2 = enabled.findIndex((tab) => tabValue(tab) === props.modelValue);
|
|
1410
|
+
const next = enabled[(current2 + delta + enabled.length) % enabled.length];
|
|
1411
|
+
selectTab(tabValue(next), true);
|
|
1017
1412
|
}
|
|
1018
1413
|
function onKeydown(event) {
|
|
1019
|
-
var _a;
|
|
1020
1414
|
if (event.key === "ArrowRight" || event.key === "ArrowDown") {
|
|
1021
1415
|
event.preventDefault();
|
|
1022
1416
|
move(1);
|
|
@@ -1029,43 +1423,52 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
|
1029
1423
|
}
|
|
1030
1424
|
if (event.key === "Home") {
|
|
1031
1425
|
event.preventDefault();
|
|
1032
|
-
|
|
1426
|
+
const first = enabledTabs.value[0];
|
|
1427
|
+
selectTab(first ? tabValue(first) : props.modelValue, true);
|
|
1033
1428
|
return;
|
|
1034
1429
|
}
|
|
1035
1430
|
if (event.key === "End") {
|
|
1036
1431
|
event.preventDefault();
|
|
1037
1432
|
const last = enabledTabs.value[enabledTabs.value.length - 1];
|
|
1038
|
-
selectTab(
|
|
1433
|
+
selectTab(last ? tabValue(last) : props.modelValue, true);
|
|
1039
1434
|
}
|
|
1040
1435
|
}
|
|
1436
|
+
warnDeprecated("TaoTabs", {
|
|
1437
|
+
tabs: "use `items` (with `value` instead of `key`)"
|
|
1438
|
+
});
|
|
1439
|
+
if (list.value.some((tab) => tab.key !== void 0)) {
|
|
1440
|
+
deprecationWarning("TaoTabs", "item `key`", "use item `value`");
|
|
1441
|
+
}
|
|
1041
1442
|
return (_ctx, _cache) => {
|
|
1042
|
-
return openBlock(), createElementBlock("div",
|
|
1443
|
+
return openBlock(), createElementBlock("div", {
|
|
1444
|
+
class: normalizeClass(["tao-tabs", unref(sizeClass)(__props.size)])
|
|
1445
|
+
}, [
|
|
1043
1446
|
createElementVNode("div", {
|
|
1044
1447
|
class: "tao-tabs__list",
|
|
1045
1448
|
style: normalizeStyle({ justifyContent: __props.justify || void 0 }),
|
|
1046
1449
|
role: "tablist",
|
|
1047
1450
|
onKeydown
|
|
1048
1451
|
}, [
|
|
1049
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
1452
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(list.value, (tab) => {
|
|
1050
1453
|
return openBlock(), createElementBlock("button", {
|
|
1051
|
-
key: tab
|
|
1454
|
+
key: unref(tabValue)(tab),
|
|
1052
1455
|
type: "button",
|
|
1053
1456
|
class: "tao-tabs__tab",
|
|
1054
1457
|
role: "tab",
|
|
1055
|
-
id: tabId(tab
|
|
1056
|
-
"aria-selected": tab
|
|
1057
|
-
"aria-controls": panelId(tab
|
|
1058
|
-
tabindex: tab
|
|
1458
|
+
id: tabId(unref(tabValue)(tab)),
|
|
1459
|
+
"aria-selected": unref(tabValue)(tab) === __props.modelValue,
|
|
1460
|
+
"aria-controls": panelId(unref(tabValue)(tab)),
|
|
1461
|
+
tabindex: unref(tabValue)(tab) === __props.modelValue ? 0 : -1,
|
|
1059
1462
|
disabled: tab.disabled,
|
|
1060
|
-
onClick: ($event) => selectTab(tab
|
|
1463
|
+
onClick: ($event) => selectTab(unref(tabValue)(tab))
|
|
1061
1464
|
}, [
|
|
1062
1465
|
_ctx.$slots.label ? renderSlot(_ctx.$slots, "label", {
|
|
1063
1466
|
text: tab.label,
|
|
1064
|
-
value: tab
|
|
1467
|
+
value: unref(tabValue)(tab)
|
|
1065
1468
|
}, void 0, true, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1066
1469
|
createTextVNode(toDisplayString(tab.label), 1)
|
|
1067
1470
|
], 64))
|
|
1068
|
-
], 8,
|
|
1471
|
+
], 8, _hoisted_1$I);
|
|
1069
1472
|
}), 128))
|
|
1070
1473
|
], 36),
|
|
1071
1474
|
createElementVNode("div", {
|
|
@@ -1075,12 +1478,12 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
|
1075
1478
|
"aria-labelledby": tabId(__props.modelValue)
|
|
1076
1479
|
}, [
|
|
1077
1480
|
renderSlot(_ctx.$slots, "default", { activeTab: __props.modelValue }, void 0, true)
|
|
1078
|
-
], 8,
|
|
1079
|
-
]);
|
|
1481
|
+
], 8, _hoisted_2$B)
|
|
1482
|
+
], 2);
|
|
1080
1483
|
};
|
|
1081
1484
|
}
|
|
1082
1485
|
});
|
|
1083
|
-
const TaoTabs = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["__scopeId", "data-v-
|
|
1486
|
+
const TaoTabs = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["__scopeId", "data-v-a9238d96"]]);
|
|
1084
1487
|
function listenFocusLoss(onLoss) {
|
|
1085
1488
|
function onVisibilityChange() {
|
|
1086
1489
|
if (document.hidden) {
|
|
@@ -1462,11 +1865,11 @@ const TaoPopover = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["__scopeId", "data
|
|
|
1462
1865
|
const spoilerGroupKey = Symbol("taoSpoilerGroup");
|
|
1463
1866
|
const _hoisted_1$G = { class: "tao-spoiler" };
|
|
1464
1867
|
const _hoisted_2$A = ["aria-expanded", "aria-controls"];
|
|
1465
|
-
const _hoisted_3$
|
|
1868
|
+
const _hoisted_3$s = {
|
|
1466
1869
|
key: 0,
|
|
1467
1870
|
class: "tao-spoiler__title"
|
|
1468
1871
|
};
|
|
1469
|
-
const _hoisted_4$
|
|
1872
|
+
const _hoisted_4$o = ["id"];
|
|
1470
1873
|
const _hoisted_5$h = { class: "tao-spoiler__content-inner" };
|
|
1471
1874
|
const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
1472
1875
|
...{ name: "TaoSpoiler" },
|
|
@@ -1477,7 +1880,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
|
1477
1880
|
modelValue: { type: Boolean, default: void 0 },
|
|
1478
1881
|
name: { default: void 0 }
|
|
1479
1882
|
},
|
|
1480
|
-
emits: ["update:modelValue"],
|
|
1883
|
+
emits: ["update:modelValue", "change"],
|
|
1481
1884
|
setup(__props, { emit: __emit }) {
|
|
1482
1885
|
const props = __props;
|
|
1483
1886
|
const emit = __emit;
|
|
@@ -1502,6 +1905,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
|
1502
1905
|
internal.value = next;
|
|
1503
1906
|
}
|
|
1504
1907
|
emit("update:modelValue", next);
|
|
1908
|
+
emit("change", next);
|
|
1505
1909
|
}
|
|
1506
1910
|
function onBeforeEnter(el) {
|
|
1507
1911
|
el.style.height = "0";
|
|
@@ -1534,7 +1938,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
|
1534
1938
|
createElementVNode("span", {
|
|
1535
1939
|
class: normalizeClass(["tao-spoiler__icon", { "tao-spoiler__icon--open": isOpen.value }])
|
|
1536
1940
|
}, "▶", 2),
|
|
1537
|
-
__props.title || _ctx.$slots.title ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
1941
|
+
__props.title || _ctx.$slots.title ? (openBlock(), createElementBlock("span", _hoisted_3$s, [
|
|
1538
1942
|
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
1539
1943
|
createTextVNode(toDisplayString(__props.title), 1)
|
|
1540
1944
|
], true)
|
|
@@ -1556,7 +1960,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
|
1556
1960
|
createElementVNode("div", _hoisted_5$h, [
|
|
1557
1961
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
1558
1962
|
])
|
|
1559
|
-
], 8, _hoisted_4$
|
|
1963
|
+
], 8, _hoisted_4$o)) : createCommentVNode("", true)
|
|
1560
1964
|
]),
|
|
1561
1965
|
_: 3
|
|
1562
1966
|
})
|
|
@@ -1564,7 +1968,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
|
1564
1968
|
};
|
|
1565
1969
|
}
|
|
1566
1970
|
});
|
|
1567
|
-
const TaoSpoiler = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["__scopeId", "data-v-
|
|
1971
|
+
const TaoSpoiler = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["__scopeId", "data-v-5a3147a2"]]);
|
|
1568
1972
|
const _hoisted_1$F = { class: "tao-spoiler-group" };
|
|
1569
1973
|
const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
1570
1974
|
...{ name: "TaoSpoilerGroup" },
|
|
@@ -1604,12 +2008,14 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
1604
2008
|
__name: "TaoCopy",
|
|
1605
2009
|
props: {
|
|
1606
2010
|
text: {},
|
|
1607
|
-
|
|
1608
|
-
|
|
2011
|
+
successText: { default: void 0 },
|
|
2012
|
+
successMessage: { default: void 0 },
|
|
2013
|
+
copyLabel: {},
|
|
1609
2014
|
tip: { type: Boolean, default: true }
|
|
1610
2015
|
},
|
|
1611
2016
|
setup(__props) {
|
|
1612
2017
|
const props = __props;
|
|
2018
|
+
const l10n = useLocaleText(props, "copy");
|
|
1613
2019
|
const copied = ref(false);
|
|
1614
2020
|
const triggerRef = ref(null);
|
|
1615
2021
|
const tipRef = ref(null);
|
|
@@ -1694,6 +2100,10 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
1694
2100
|
visibleObserver == null ? void 0 : visibleObserver.disconnect();
|
|
1695
2101
|
visibleObserver = null;
|
|
1696
2102
|
});
|
|
2103
|
+
const doneText = computed(() => props.successText ?? props.successMessage ?? taoLocale().copy.successText);
|
|
2104
|
+
warnDeprecated("TaoCopy", {
|
|
2105
|
+
successMessage: "use `successText`"
|
|
2106
|
+
});
|
|
1697
2107
|
return (_ctx, _cache) => {
|
|
1698
2108
|
return openBlock(), createElementBlock("span", {
|
|
1699
2109
|
ref_key: "triggerRef",
|
|
@@ -1707,7 +2117,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
1707
2117
|
createElementVNode("button", {
|
|
1708
2118
|
type: "button",
|
|
1709
2119
|
class: normalizeClass(["tao-copy__button", { "tao-copy__button--copied": copied.value }]),
|
|
1710
|
-
"aria-label": copied.value ?
|
|
2120
|
+
"aria-label": copied.value ? doneText.value : unref(l10n).copyLabel,
|
|
1711
2121
|
onClick: copy
|
|
1712
2122
|
}, [..._cache[0] || (_cache[0] = [
|
|
1713
2123
|
createElementVNode("svg", {
|
|
@@ -1737,38 +2147,44 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
1737
2147
|
])], 10, _hoisted_1$E)
|
|
1738
2148
|
], true),
|
|
1739
2149
|
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
1740
|
-
copied.value && __props.tip &&
|
|
2150
|
+
copied.value && __props.tip && doneText.value ? (openBlock(), createElementBlock("div", {
|
|
1741
2151
|
key: 0,
|
|
1742
2152
|
ref_key: "tipRef",
|
|
1743
2153
|
ref: tipRef,
|
|
1744
2154
|
class: "tao-copy__tip",
|
|
1745
2155
|
role: "status",
|
|
1746
2156
|
style: normalizeStyle(tipStyle.value)
|
|
1747
|
-
}, toDisplayString(
|
|
2157
|
+
}, toDisplayString(doneText.value), 5)) : createCommentVNode("", true)
|
|
1748
2158
|
]))
|
|
1749
2159
|
], 2);
|
|
1750
2160
|
};
|
|
1751
2161
|
}
|
|
1752
2162
|
});
|
|
1753
|
-
const TaoCopy = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-
|
|
2163
|
+
const TaoCopy = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-16581b4e"]]);
|
|
1754
2164
|
const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
1755
2165
|
...{ name: "TaoContainer" },
|
|
1756
2166
|
__name: "TaoContainer",
|
|
1757
2167
|
props: {
|
|
1758
|
-
|
|
2168
|
+
width: {},
|
|
2169
|
+
size: {},
|
|
1759
2170
|
free: { type: Boolean, default: false }
|
|
1760
2171
|
},
|
|
1761
2172
|
setup(__props) {
|
|
2173
|
+
const props = __props;
|
|
2174
|
+
const resolvedWidth = computed(() => props.width ?? props.size ?? "wide");
|
|
2175
|
+
warnDeprecated("TaoContainer", {
|
|
2176
|
+
size: "use `width`"
|
|
2177
|
+
});
|
|
1762
2178
|
return (_ctx, _cache) => {
|
|
1763
2179
|
return openBlock(), createElementBlock("div", {
|
|
1764
|
-
class: normalizeClass(["tao-container", [`tao-container--${
|
|
2180
|
+
class: normalizeClass(["tao-container", [`tao-container--${resolvedWidth.value}`, { "tao-container--center": !__props.free }]])
|
|
1765
2181
|
}, [
|
|
1766
2182
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
1767
2183
|
], 2);
|
|
1768
2184
|
};
|
|
1769
2185
|
}
|
|
1770
2186
|
});
|
|
1771
|
-
const TaoContainer = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-
|
|
2187
|
+
const TaoContainer = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-ef005f57"]]);
|
|
1772
2188
|
const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
1773
2189
|
...{ name: "TaoFlex" },
|
|
1774
2190
|
__name: "TaoFlex",
|
|
@@ -1789,7 +2205,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
|
1789
2205
|
alignItems: __props.align,
|
|
1790
2206
|
flexDirection: __props.direction,
|
|
1791
2207
|
flexWrap: __props.wrap,
|
|
1792
|
-
gap: __props.gap
|
|
2208
|
+
gap: unref(toCssLength)(__props.gap)
|
|
1793
2209
|
})
|
|
1794
2210
|
}, {
|
|
1795
2211
|
default: withCtx(() => [
|
|
@@ -1806,13 +2222,18 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
|
|
|
1806
2222
|
props: {
|
|
1807
2223
|
block: { type: Boolean, default: false },
|
|
1808
2224
|
expand: { type: Boolean, default: false },
|
|
2225
|
+
direction: { default: void 0 },
|
|
1809
2226
|
vertical: { type: Boolean, default: false }
|
|
1810
2227
|
},
|
|
1811
2228
|
setup(__props) {
|
|
1812
2229
|
const props = __props;
|
|
2230
|
+
const isColumn = computed(() => (props.direction ?? (props.vertical ? "column" : "row")) === "column");
|
|
2231
|
+
warnDeprecated("TaoSpace", {
|
|
2232
|
+
vertical: 'use direction="column"'
|
|
2233
|
+
});
|
|
1813
2234
|
return (_ctx, _cache) => {
|
|
1814
2235
|
return openBlock(), createElementBlock("div", {
|
|
1815
|
-
class: normalizeClass(["tao-space", { "tao-space--vertical":
|
|
2236
|
+
class: normalizeClass(["tao-space", { "tao-space--vertical": isColumn.value }]),
|
|
1816
2237
|
style: normalizeStyle([props.block ? "display: flex; flex-wrap: initial;" : "", props.expand ? "width: 100%" : ""])
|
|
1817
2238
|
}, [
|
|
1818
2239
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
@@ -1820,7 +2241,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
|
|
|
1820
2241
|
};
|
|
1821
2242
|
}
|
|
1822
2243
|
});
|
|
1823
|
-
const TaoSpace = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["__scopeId", "data-v-
|
|
2244
|
+
const TaoSpace = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["__scopeId", "data-v-67c9d3a2"]]);
|
|
1824
2245
|
const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
1825
2246
|
...{ name: "TaoGrid" },
|
|
1826
2247
|
__name: "TaoGrid",
|
|
@@ -1833,9 +2254,9 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
1833
2254
|
const props = __props;
|
|
1834
2255
|
const isFixed = computed(() => props.cols > 0);
|
|
1835
2256
|
const gridStyle = computed(() => ({
|
|
1836
|
-
"--tao-grid-min": props.min,
|
|
2257
|
+
"--tao-grid-min": toCssLength(props.min),
|
|
1837
2258
|
"--tao-grid-cols": isFixed.value ? String(props.cols) : void 0,
|
|
1838
|
-
"--tao-grid-gap": props.gap
|
|
2259
|
+
"--tao-grid-gap": toCssLength(props.gap)
|
|
1839
2260
|
}));
|
|
1840
2261
|
return (_ctx, _cache) => {
|
|
1841
2262
|
return openBlock(), createElementBlock("div", {
|
|
@@ -1847,7 +2268,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
1847
2268
|
};
|
|
1848
2269
|
}
|
|
1849
2270
|
});
|
|
1850
|
-
const TaoGrid = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["__scopeId", "data-v-
|
|
2271
|
+
const TaoGrid = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["__scopeId", "data-v-5baa4944"]]);
|
|
1851
2272
|
const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
1852
2273
|
...{ name: "TaoGridItem" },
|
|
1853
2274
|
__name: "TaoGridItem",
|
|
@@ -1874,8 +2295,8 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
|
1874
2295
|
const TaoGridItem = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["__scopeId", "data-v-ad288026"]]);
|
|
1875
2296
|
const _hoisted_1$D = { class: "tao-split__pane tao-split__pane--start" };
|
|
1876
2297
|
const _hoisted_2$z = ["aria-orientation", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-disabled", "tabindex"];
|
|
1877
|
-
const _hoisted_3$
|
|
1878
|
-
const _hoisted_4$
|
|
2298
|
+
const _hoisted_3$r = { class: "tao-split__pane tao-split__pane--end" };
|
|
2299
|
+
const _hoisted_4$n = {
|
|
1879
2300
|
key: 0,
|
|
1880
2301
|
class: "tao-split__shield"
|
|
1881
2302
|
};
|
|
@@ -1892,7 +2313,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
1892
2313
|
resizable: { type: Boolean, default: true },
|
|
1893
2314
|
step: {}
|
|
1894
2315
|
},
|
|
1895
|
-
emits: ["update:modelValue"],
|
|
2316
|
+
emits: ["update:modelValue", "change"],
|
|
1896
2317
|
setup(__props, { emit: __emit }) {
|
|
1897
2318
|
const props = __props;
|
|
1898
2319
|
const emit = __emit;
|
|
@@ -1907,6 +2328,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
1907
2328
|
const ariaOrientation = computed(() => isRow.value ? "vertical" : "horizontal");
|
|
1908
2329
|
let dragPointer = -1;
|
|
1909
2330
|
let dragStartPx = 0;
|
|
2331
|
+
let dragStartValue = 0;
|
|
1910
2332
|
let dragStartCoord = 0;
|
|
1911
2333
|
let savedBodyCursor = "";
|
|
1912
2334
|
let savedHtmlCursor = "";
|
|
@@ -2016,6 +2438,9 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
2016
2438
|
dragPointer = -1;
|
|
2017
2439
|
restoreDragCursor();
|
|
2018
2440
|
applyLayout(true);
|
|
2441
|
+
if (!valuesEqual(size.value, dragStartValue)) {
|
|
2442
|
+
emit("change", size.value);
|
|
2443
|
+
}
|
|
2019
2444
|
}
|
|
2020
2445
|
function setStartFromDelta(delta) {
|
|
2021
2446
|
const avail = measureAvailable();
|
|
@@ -2031,6 +2456,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
2031
2456
|
dragPointer = event.pointerId;
|
|
2032
2457
|
isDragging.value = true;
|
|
2033
2458
|
dragStartPx = startPx.value;
|
|
2459
|
+
dragStartValue = size.value;
|
|
2034
2460
|
dragStartCoord = isRow.value ? event.clientX : event.clientY;
|
|
2035
2461
|
applyDragCursor();
|
|
2036
2462
|
event.preventDefault();
|
|
@@ -2078,6 +2504,13 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
2078
2504
|
const ariaValueNow = computed(() => size.value);
|
|
2079
2505
|
const ariaValueText = computed(() => props.unit === "%" ? `${size.value}%` : `${Math.round(size.value)}px`);
|
|
2080
2506
|
function onKeydown(event) {
|
|
2507
|
+
const before = size.value;
|
|
2508
|
+
moveByKey(event);
|
|
2509
|
+
if (!valuesEqual(before, size.value)) {
|
|
2510
|
+
emit("change", size.value);
|
|
2511
|
+
}
|
|
2512
|
+
}
|
|
2513
|
+
function moveByKey(event) {
|
|
2081
2514
|
if (!props.resizable) {
|
|
2082
2515
|
return;
|
|
2083
2516
|
}
|
|
@@ -2188,15 +2621,15 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
2188
2621
|
onDragstart: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
2189
2622
|
}, ["prevent"]))
|
|
2190
2623
|
}, null, 40, _hoisted_2$z),
|
|
2191
|
-
createElementVNode("div", _hoisted_3$
|
|
2624
|
+
createElementVNode("div", _hoisted_3$r, [
|
|
2192
2625
|
renderSlot(_ctx.$slots, "end", {}, void 0, true)
|
|
2193
2626
|
]),
|
|
2194
|
-
isDragging.value ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
2627
|
+
isDragging.value ? (openBlock(), createElementBlock("div", _hoisted_4$n)) : createCommentVNode("", true)
|
|
2195
2628
|
], 6);
|
|
2196
2629
|
};
|
|
2197
2630
|
}
|
|
2198
2631
|
});
|
|
2199
|
-
const TaoSplit = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-
|
|
2632
|
+
const TaoSplit = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-f34ab385"]]);
|
|
2200
2633
|
const _hoisted_1$C = { class: "tao-icon" };
|
|
2201
2634
|
const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
2202
2635
|
...{ name: "TaoIcon" },
|
|
@@ -2289,7 +2722,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
2289
2722
|
const TaoLoader = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__scopeId", "data-v-49a9f1b2"]]);
|
|
2290
2723
|
const _hoisted_1$B = { class: "tao-image" };
|
|
2291
2724
|
const _hoisted_2$y = ["src", "alt", "loading"];
|
|
2292
|
-
const _hoisted_3$
|
|
2725
|
+
const _hoisted_3$q = { class: "tao-image__placeholder" };
|
|
2293
2726
|
const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
2294
2727
|
...{ name: "TaoImage" },
|
|
2295
2728
|
__name: "TaoImage",
|
|
@@ -2334,7 +2767,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
2334
2767
|
onError: handleError
|
|
2335
2768
|
}, null, 42, _hoisted_2$y)) : createCommentVNode("", true),
|
|
2336
2769
|
!__props.src || hasError.value ? renderSlot(_ctx.$slots, "default", {}, () => [
|
|
2337
|
-
createElementVNode("div", _hoisted_3$
|
|
2770
|
+
createElementVNode("div", _hoisted_3$q, toDisplayString(__props.placeholderText), 1)
|
|
2338
2771
|
], true, 1) : createCommentVNode("", true)
|
|
2339
2772
|
]);
|
|
2340
2773
|
};
|
|
@@ -2343,11 +2776,11 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
2343
2776
|
const TaoImage = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-61f47c52"]]);
|
|
2344
2777
|
const _hoisted_1$A = ["for"];
|
|
2345
2778
|
const _hoisted_2$x = ["id", "checked", "disabled", "aria-checked", "aria-invalid", "aria-describedby"];
|
|
2346
|
-
const _hoisted_3$
|
|
2779
|
+
const _hoisted_3$p = {
|
|
2347
2780
|
key: 0,
|
|
2348
2781
|
class: "tao-checkbox__label"
|
|
2349
2782
|
};
|
|
2350
|
-
const _hoisted_4$
|
|
2783
|
+
const _hoisted_4$m = {
|
|
2351
2784
|
key: 1,
|
|
2352
2785
|
class: "tao-checkbox__label"
|
|
2353
2786
|
};
|
|
@@ -2356,9 +2789,11 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
2356
2789
|
__name: "TaoCheckbox",
|
|
2357
2790
|
props: {
|
|
2358
2791
|
value: { type: Boolean, default: void 0 },
|
|
2792
|
+
checked: { type: Boolean, default: void 0 },
|
|
2359
2793
|
modelValue: { type: Boolean, default: void 0 },
|
|
2360
2794
|
label: { default: "" },
|
|
2361
2795
|
disabled: { type: Boolean, default: false },
|
|
2796
|
+
size: {},
|
|
2362
2797
|
error: { type: Boolean, default: false },
|
|
2363
2798
|
indeterminate: { type: Boolean, default: false }
|
|
2364
2799
|
},
|
|
@@ -2376,6 +2811,9 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
2376
2811
|
if (props.modelValue !== void 0) {
|
|
2377
2812
|
return props.modelValue;
|
|
2378
2813
|
}
|
|
2814
|
+
if (props.checked !== void 0) {
|
|
2815
|
+
return props.checked;
|
|
2816
|
+
}
|
|
2379
2817
|
return Boolean(props.value);
|
|
2380
2818
|
},
|
|
2381
2819
|
set: (next) => {
|
|
@@ -2403,9 +2841,12 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
2403
2841
|
},
|
|
2404
2842
|
{ flush: "post" }
|
|
2405
2843
|
);
|
|
2844
|
+
warnDeprecated("TaoCheckbox", {
|
|
2845
|
+
value: "use `checked` or v-model"
|
|
2846
|
+
});
|
|
2406
2847
|
return (_ctx, _cache) => {
|
|
2407
2848
|
return openBlock(), createElementBlock("label", {
|
|
2408
|
-
class: normalizeClass(["tao-checkbox", { "tao-checkbox--disabled": __props.disabled }]),
|
|
2849
|
+
class: normalizeClass(["tao-checkbox", [unref(sizeClass)(__props.size), { "tao-checkbox--disabled": __props.disabled }]]),
|
|
2409
2850
|
for: controlId.value
|
|
2410
2851
|
}, [
|
|
2411
2852
|
renderSlot(_ctx.$slots, "pre", { text: __props.label }, void 0, true),
|
|
@@ -2423,7 +2864,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
2423
2864
|
onChange: onInputChange
|
|
2424
2865
|
}, null, 40, _hoisted_2$x),
|
|
2425
2866
|
_cache[0] || (_cache[0] = createElementVNode("span", { class: "tao-checkbox__box" }, null, -1)),
|
|
2426
|
-
__props.label ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
2867
|
+
__props.label ? (openBlock(), createElementBlock("span", _hoisted_3$p, toDisplayString(__props.label), 1)) : (openBlock(), createElementBlock("span", _hoisted_4$m, [
|
|
2427
2868
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
2428
2869
|
])),
|
|
2429
2870
|
renderSlot(_ctx.$slots, "post", { text: __props.label }, void 0, true)
|
|
@@ -2431,33 +2872,40 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
2431
2872
|
};
|
|
2432
2873
|
}
|
|
2433
2874
|
});
|
|
2434
|
-
const TaoCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-
|
|
2875
|
+
const TaoCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-13f6cd33"]]);
|
|
2435
2876
|
const _hoisted_1$z = {
|
|
2436
2877
|
key: 0,
|
|
2437
2878
|
class: "tao-tag__prefix"
|
|
2438
2879
|
};
|
|
2439
2880
|
const _hoisted_2$w = { class: "tao-tag__text" };
|
|
2440
|
-
const _hoisted_3$
|
|
2441
|
-
const _hoisted_4$
|
|
2881
|
+
const _hoisted_3$o = ["aria-label"];
|
|
2882
|
+
const _hoisted_4$l = { "aria-hidden": "true" };
|
|
2442
2883
|
const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
2443
2884
|
...{ name: "TaoTag" },
|
|
2444
2885
|
__name: "TaoTag",
|
|
2445
2886
|
props: {
|
|
2446
|
-
|
|
2887
|
+
tone: { default: void 0 },
|
|
2888
|
+
type: { default: void 0 },
|
|
2447
2889
|
color: {},
|
|
2448
2890
|
background: {},
|
|
2449
2891
|
borderColor: {},
|
|
2892
|
+
clickable: { type: Boolean, default: false },
|
|
2450
2893
|
pointer: { type: Boolean, default: false },
|
|
2451
2894
|
closable: { type: Boolean, default: false },
|
|
2452
|
-
closeLabel: {
|
|
2453
|
-
flat: { type: Boolean, default: false }
|
|
2895
|
+
closeLabel: {},
|
|
2896
|
+
flat: { type: Boolean, default: false },
|
|
2897
|
+
size: {}
|
|
2454
2898
|
},
|
|
2455
2899
|
emits: ["close"],
|
|
2456
2900
|
setup(__props, { emit: __emit }) {
|
|
2457
2901
|
const props = __props;
|
|
2902
|
+
const l10n = useLocaleText(props, "tag");
|
|
2458
2903
|
const emit = __emit;
|
|
2459
2904
|
const slots = useSlots();
|
|
2460
|
-
const
|
|
2905
|
+
const resolvedTone = computed(() => {
|
|
2906
|
+
const value = props.tone ?? props.type ?? "";
|
|
2907
|
+
return value === "error" ? "danger" : value;
|
|
2908
|
+
});
|
|
2461
2909
|
const style = computed(() => ({
|
|
2462
2910
|
color: props.color || "",
|
|
2463
2911
|
background: props.background || "",
|
|
@@ -2466,12 +2914,17 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
2466
2914
|
function onClose(event) {
|
|
2467
2915
|
emit("close", event);
|
|
2468
2916
|
}
|
|
2917
|
+
warnDeprecated("TaoTag", {
|
|
2918
|
+
type: "use `tone`",
|
|
2919
|
+
pointer: "use `clickable`"
|
|
2920
|
+
});
|
|
2469
2921
|
return (_ctx, _cache) => {
|
|
2470
2922
|
return openBlock(), createElementBlock("span", {
|
|
2471
2923
|
class: normalizeClass(["tao-tag", [
|
|
2472
|
-
|
|
2924
|
+
resolvedTone.value ? `tao-tag--${resolvedTone.value}` : "",
|
|
2925
|
+
unref(sizeClass)(__props.size),
|
|
2473
2926
|
{
|
|
2474
|
-
"tao-tag--pointer": __props.pointer,
|
|
2927
|
+
"tao-tag--pointer": __props.clickable || __props.pointer,
|
|
2475
2928
|
"tao-tag--closable": __props.closable,
|
|
2476
2929
|
"tao-tag--prefix": Boolean(unref(slots).prefix),
|
|
2477
2930
|
"tao-tag--flat": __props.flat
|
|
@@ -2489,26 +2942,26 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
2489
2942
|
key: 1,
|
|
2490
2943
|
type: "button",
|
|
2491
2944
|
class: "tao-tag__close",
|
|
2492
|
-
"aria-label":
|
|
2945
|
+
"aria-label": unref(l10n).closeLabel,
|
|
2493
2946
|
onClick: withModifiers(onClose, ["stop"])
|
|
2494
2947
|
}, [
|
|
2495
|
-
createElementVNode("span", _hoisted_4$
|
|
2948
|
+
createElementVNode("span", _hoisted_4$l, [
|
|
2496
2949
|
renderSlot(_ctx.$slots, "close-icon", {}, () => [
|
|
2497
2950
|
_cache[0] || (_cache[0] = createTextVNode("✕", -1))
|
|
2498
2951
|
], true)
|
|
2499
2952
|
])
|
|
2500
|
-
], 8, _hoisted_3$
|
|
2953
|
+
], 8, _hoisted_3$o)) : createCommentVNode("", true)
|
|
2501
2954
|
], 6);
|
|
2502
2955
|
};
|
|
2503
2956
|
}
|
|
2504
2957
|
});
|
|
2505
|
-
const TaoTag = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-
|
|
2958
|
+
const TaoTag = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-ca0b1b42"]]);
|
|
2506
2959
|
const _hoisted_1$y = ["role", "aria-hidden"];
|
|
2507
2960
|
const _hoisted_2$v = {
|
|
2508
2961
|
key: 1,
|
|
2509
2962
|
class: "tao-divider__text"
|
|
2510
2963
|
};
|
|
2511
|
-
const _hoisted_3$
|
|
2964
|
+
const _hoisted_3$n = {
|
|
2512
2965
|
key: 2,
|
|
2513
2966
|
class: "tao-divider__line tao-divider__line--end"
|
|
2514
2967
|
};
|
|
@@ -2526,6 +2979,9 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
2526
2979
|
const slots = useSlots();
|
|
2527
2980
|
const gapSize = computed(() => props.size === "big" ? "large" : props.size);
|
|
2528
2981
|
const hasLabel = computed(() => Boolean(props.text) || Boolean(slots.default));
|
|
2982
|
+
if (props.size === "big") {
|
|
2983
|
+
deprecationWarning("TaoDivider", 'size "big"', 'use size="large"');
|
|
2984
|
+
}
|
|
2529
2985
|
return (_ctx, _cache) => {
|
|
2530
2986
|
return openBlock(), createElementBlock("div", {
|
|
2531
2987
|
class: normalizeClass(["tao-divider", [
|
|
@@ -2548,12 +3004,12 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
2548
3004
|
createTextVNode(toDisplayString(__props.text), 1)
|
|
2549
3005
|
], true)
|
|
2550
3006
|
])) : createCommentVNode("", true),
|
|
2551
|
-
__props.variant !== "gap" && hasLabel.value ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
3007
|
+
__props.variant !== "gap" && hasLabel.value ? (openBlock(), createElementBlock("span", _hoisted_3$n)) : createCommentVNode("", true)
|
|
2552
3008
|
], 10, _hoisted_1$y);
|
|
2553
3009
|
};
|
|
2554
3010
|
}
|
|
2555
3011
|
});
|
|
2556
|
-
const TaoDivider = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-
|
|
3012
|
+
const TaoDivider = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-32544dcc"]]);
|
|
2557
3013
|
const _hoisted_1$x = {
|
|
2558
3014
|
key: 0,
|
|
2559
3015
|
class: "tao-fieldset__legend"
|
|
@@ -2609,16 +3065,8 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
2609
3065
|
}
|
|
2610
3066
|
});
|
|
2611
3067
|
const TaoAnimatedBorder = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-c9434028"]]);
|
|
2612
|
-
const _hoisted_1$w =
|
|
2613
|
-
|
|
2614
|
-
class: "tao-textarea tao-textarea--dummy"
|
|
2615
|
-
};
|
|
2616
|
-
const _hoisted_2$t = {
|
|
2617
|
-
key: 1,
|
|
2618
|
-
class: "tao-textarea-wrap"
|
|
2619
|
-
};
|
|
2620
|
-
const _hoisted_3$n = ["id", "placeholder", "spellcheck", "autocomplete", "minlength", "maxlength", "disabled", "rows", "value", "aria-invalid", "aria-describedby"];
|
|
2621
|
-
const _hoisted_4$l = ["id"];
|
|
3068
|
+
const _hoisted_1$w = ["id", "placeholder", "spellcheck", "autocomplete", "minlength", "maxlength", "disabled", "readonly", "rows", "value", "aria-invalid", "aria-describedby"];
|
|
3069
|
+
const _hoisted_2$t = ["id"];
|
|
2622
3070
|
const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
2623
3071
|
...{ name: "TaoTextarea" },
|
|
2624
3072
|
__name: "TaoTextarea",
|
|
@@ -2629,6 +3077,9 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
2629
3077
|
minlength: { default: 0 },
|
|
2630
3078
|
maxlength: { default: void 0 },
|
|
2631
3079
|
disabled: { type: Boolean, default: false },
|
|
3080
|
+
size: {},
|
|
3081
|
+
variant: {},
|
|
3082
|
+
readonly: { type: Boolean, default: false },
|
|
2632
3083
|
noSpace: { type: Boolean, default: false },
|
|
2633
3084
|
dummy: { type: Boolean, default: false },
|
|
2634
3085
|
rows: { default: 3 },
|
|
@@ -2636,9 +3087,12 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
2636
3087
|
modelValue: { default: "" },
|
|
2637
3088
|
noBorder: { type: Boolean, default: false },
|
|
2638
3089
|
noBackground: { type: Boolean, default: false },
|
|
3090
|
+
autofocus: { type: Boolean, default: false },
|
|
2639
3091
|
autoFocus: { type: Boolean, default: false },
|
|
2640
3092
|
borderInverse: { type: Boolean, default: false },
|
|
3093
|
+
align: { default: void 0 },
|
|
2641
3094
|
textCenter: { type: Boolean, default: false },
|
|
3095
|
+
blurOnEnter: { type: Boolean, default: false },
|
|
2642
3096
|
submitOnEnter: { type: Boolean, default: false },
|
|
2643
3097
|
error: { type: Boolean, default: false },
|
|
2644
3098
|
id: {},
|
|
@@ -2653,6 +3107,26 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
2653
3107
|
const controlId = computed(() => props.id || (field == null ? void 0 : field.id) || localId);
|
|
2654
3108
|
const invalid = computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
2655
3109
|
const counterId = computed(() => `${controlId.value}-count`);
|
|
3110
|
+
const resolvedVariant = computed(() => {
|
|
3111
|
+
if (props.variant) {
|
|
3112
|
+
return props.variant;
|
|
3113
|
+
}
|
|
3114
|
+
if (props.noBorder) {
|
|
3115
|
+
return props.noBackground ? "plain" : "filled";
|
|
3116
|
+
}
|
|
3117
|
+
return "bar";
|
|
3118
|
+
});
|
|
3119
|
+
const alignClass = computed(() => {
|
|
3120
|
+
const align = props.align ?? (props.textCenter ? "center" : "start");
|
|
3121
|
+
return align === "start" ? void 0 : `tao-textarea--align-${align}`;
|
|
3122
|
+
});
|
|
3123
|
+
const variantClasses = computed(() => [
|
|
3124
|
+
`tao-textarea--${resolvedVariant.value}`,
|
|
3125
|
+
{
|
|
3126
|
+
"tao-textarea--inverse": props.borderInverse && resolvedVariant.value === "bar",
|
|
3127
|
+
"tao-textarea--no-background": !props.variant && props.noBackground && !props.noBorder
|
|
3128
|
+
}
|
|
3129
|
+
]);
|
|
2656
3130
|
const describedBy = computed(() => {
|
|
2657
3131
|
const ids = [field == null ? void 0 : field.describedBy.value, props.count ? counterId.value : void 0].filter(Boolean);
|
|
2658
3132
|
return ids.length ? ids.join(" ") : void 0;
|
|
@@ -2670,7 +3144,15 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
2670
3144
|
const textareaRef = ref(null);
|
|
2671
3145
|
function onInput(e) {
|
|
2672
3146
|
const target = e.target;
|
|
2673
|
-
|
|
3147
|
+
let value = target.value;
|
|
3148
|
+
if (props.noSpace && value.includes(" ")) {
|
|
3149
|
+
const caret = target.selectionStart ?? value.length;
|
|
3150
|
+
const nextCaret = value.slice(0, caret).replace(/ /g, "").length;
|
|
3151
|
+
value = value.replace(/ /g, "");
|
|
3152
|
+
target.value = value;
|
|
3153
|
+
target.setSelectionRange(nextCaret, nextCaret);
|
|
3154
|
+
}
|
|
3155
|
+
emit("update:modelValue", value);
|
|
2674
3156
|
autoResize();
|
|
2675
3157
|
}
|
|
2676
3158
|
function onChange(e) {
|
|
@@ -2685,7 +3167,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
2685
3167
|
function onKeydown(event) {
|
|
2686
3168
|
var _a;
|
|
2687
3169
|
emit("keydown", event);
|
|
2688
|
-
if (props.submitOnEnter && event.key === "Enter" && !event.shiftKey) {
|
|
3170
|
+
if ((props.blurOnEnter || props.submitOnEnter) && event.key === "Enter" && !event.shiftKey) {
|
|
2689
3171
|
(_a = textareaRef.value) == null ? void 0 : _a.blur();
|
|
2690
3172
|
event.preventDefault();
|
|
2691
3173
|
return;
|
|
@@ -2710,31 +3192,47 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
2710
3192
|
);
|
|
2711
3193
|
onMounted(() => {
|
|
2712
3194
|
var _a;
|
|
2713
|
-
if (props.autoFocus) {
|
|
3195
|
+
if (props.autofocus || props.autoFocus) {
|
|
2714
3196
|
(_a = textareaRef.value) == null ? void 0 : _a.focus();
|
|
2715
3197
|
}
|
|
2716
3198
|
nextTick(autoResize);
|
|
2717
3199
|
});
|
|
3200
|
+
warnDeprecated("TaoTextarea", {
|
|
3201
|
+
noBorder: 'use variant="filled"',
|
|
3202
|
+
noBackground: 'use variant="plain"',
|
|
3203
|
+
borderInverse: "use `variant` (the bar on the right goes away)",
|
|
3204
|
+
dummy: "use `readonly`",
|
|
3205
|
+
textCenter: 'use align="center"',
|
|
3206
|
+
autoFocus: "use `autofocus`",
|
|
3207
|
+
submitOnEnter: "use `blurOnEnter`"
|
|
3208
|
+
});
|
|
2718
3209
|
return (_ctx, _cache) => {
|
|
2719
|
-
return __props.dummy ? (openBlock(), createElementBlock("span",
|
|
3210
|
+
return __props.dummy ? (openBlock(), createElementBlock("span", {
|
|
3211
|
+
key: 0,
|
|
3212
|
+
class: normalizeClass(["tao-textarea tao-textarea--dummy", [unref(sizeClass)(__props.size), variantClasses.value, alignClass.value]])
|
|
3213
|
+
}, toDisplayString(__props.modelValue), 3)) : (openBlock(), createElementBlock("div", {
|
|
3214
|
+
key: 1,
|
|
3215
|
+
class: normalizeClass(["tao-textarea-wrap", unref(sizeClass)(__props.size)])
|
|
3216
|
+
}, [
|
|
2720
3217
|
createElementVNode("textarea", {
|
|
2721
3218
|
id: controlId.value,
|
|
2722
3219
|
ref_key: "textareaRef",
|
|
2723
3220
|
ref: textareaRef,
|
|
2724
|
-
class: normalizeClass(["tao-textarea",
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
3221
|
+
class: normalizeClass(["tao-textarea", [
|
|
3222
|
+
variantClasses.value,
|
|
3223
|
+
alignClass.value,
|
|
3224
|
+
{
|
|
3225
|
+
"tao-textarea--no-resize": !__props.resize,
|
|
3226
|
+
"tao-textarea--invalid": invalid.value
|
|
3227
|
+
}
|
|
3228
|
+
]]),
|
|
2732
3229
|
placeholder: __props.placeholder,
|
|
2733
3230
|
spellcheck: __props.spellcheck,
|
|
2734
3231
|
autocomplete: __props.autocomplete,
|
|
2735
3232
|
minlength: __props.minlength,
|
|
2736
3233
|
maxlength: __props.maxlength,
|
|
2737
3234
|
disabled: __props.disabled,
|
|
3235
|
+
readonly: __props.readonly,
|
|
2738
3236
|
rows: __props.rows,
|
|
2739
3237
|
value: __props.modelValue,
|
|
2740
3238
|
"aria-invalid": invalid.value || void 0,
|
|
@@ -2745,17 +3243,17 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
2745
3243
|
onFocus,
|
|
2746
3244
|
onBlur,
|
|
2747
3245
|
onKeydown
|
|
2748
|
-
}, null, 42,
|
|
3246
|
+
}, null, 42, _hoisted_1$w),
|
|
2749
3247
|
__props.count ? (openBlock(), createElementBlock("span", {
|
|
2750
3248
|
key: 0,
|
|
2751
3249
|
id: counterId.value,
|
|
2752
3250
|
class: normalizeClass(["tao-textarea__count", { "tao-textarea__count--limit": atLimit.value }])
|
|
2753
|
-
}, toDisplayString(countLabel.value), 11,
|
|
2754
|
-
]));
|
|
3251
|
+
}, toDisplayString(countLabel.value), 11, _hoisted_2$t)) : createCommentVNode("", true)
|
|
3252
|
+
], 2));
|
|
2755
3253
|
};
|
|
2756
3254
|
}
|
|
2757
3255
|
});
|
|
2758
|
-
const TaoTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-
|
|
3256
|
+
const TaoTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-50628dd9"]]);
|
|
2759
3257
|
const _hoisted_1$v = ["tabindex", "aria-label"];
|
|
2760
3258
|
const _hoisted_2$s = { class: "tao-scroll-top__content" };
|
|
2761
3259
|
const RIPPLE_DURATION = 750;
|
|
@@ -2768,12 +3266,14 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
2768
3266
|
bottom: { default: 24 },
|
|
2769
3267
|
zIndex: { default: 1e3 },
|
|
2770
3268
|
boundary: { default: 300 },
|
|
2771
|
-
|
|
3269
|
+
outline: { type: Boolean, default: void 0 },
|
|
3270
|
+
hasOutline: { type: Boolean, default: void 0 },
|
|
2772
3271
|
tabindex: { default: 0 },
|
|
2773
|
-
ariaLabel: {
|
|
3272
|
+
ariaLabel: {}
|
|
2774
3273
|
},
|
|
2775
3274
|
setup(__props) {
|
|
2776
3275
|
const props = __props;
|
|
3276
|
+
useLocaleText(props, "scrollTop");
|
|
2777
3277
|
const fmtProp = (value, unit = "px") => typeof value === "number" ? value + unit : value;
|
|
2778
3278
|
let prevPos = 0;
|
|
2779
3279
|
let activeBack = false;
|
|
@@ -2848,6 +3348,10 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
2848
3348
|
onBeforeUnmount(() => {
|
|
2849
3349
|
window.removeEventListener("scroll", onScroll);
|
|
2850
3350
|
});
|
|
3351
|
+
warnDeprecated("TaoScrollTop", {
|
|
3352
|
+
hasOutline: "use `outline`",
|
|
3353
|
+
tabindex: "pass `tabindex` as a plain attribute"
|
|
3354
|
+
});
|
|
2851
3355
|
return (_ctx, _cache) => {
|
|
2852
3356
|
return openBlock(), createBlock(Transition, { name: "tao-scroll-top-fade" }, {
|
|
2853
3357
|
default: withCtx(() => [
|
|
@@ -2856,7 +3360,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
2856
3360
|
type: "button",
|
|
2857
3361
|
style: normalizeStyle(mainStyle),
|
|
2858
3362
|
tabindex: props.tabindex,
|
|
2859
|
-
class: normalizeClass(["tao-scroll-top", { "tao-scroll-top--no-outline":
|
|
3363
|
+
class: normalizeClass(["tao-scroll-top", { "tao-scroll-top--no-outline": (props.outline ?? props.hasOutline) === false }]),
|
|
2860
3364
|
"aria-label": props.ariaLabel,
|
|
2861
3365
|
onClick: withModifiers(onClick, ["prevent"])
|
|
2862
3366
|
}, [
|
|
@@ -2884,7 +3388,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
2884
3388
|
};
|
|
2885
3389
|
}
|
|
2886
3390
|
});
|
|
2887
|
-
const TaoScrollTop = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-
|
|
3391
|
+
const TaoScrollTop = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-9ec6a1a2"]]);
|
|
2888
3392
|
const _hoisted_1$u = { class: "tao-progress" };
|
|
2889
3393
|
const _hoisted_2$r = {
|
|
2890
3394
|
key: 0,
|
|
@@ -2964,7 +3468,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
2964
3468
|
}
|
|
2965
3469
|
});
|
|
2966
3470
|
const TaoProgress = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__scopeId", "data-v-1aae89cd"]]);
|
|
2967
|
-
const _hoisted_1$t = ["id", "tabindex", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-disabled", "aria-describedby"];
|
|
3471
|
+
const _hoisted_1$t = ["id", "tabindex", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-disabled", "aria-invalid", "aria-describedby"];
|
|
2968
3472
|
const _hoisted_2$q = ["placeholder"];
|
|
2969
3473
|
const _hoisted_3$l = {
|
|
2970
3474
|
key: 1,
|
|
@@ -2981,10 +3485,12 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
2981
3485
|
placeholder: { default: "" },
|
|
2982
3486
|
modelValue: {},
|
|
2983
3487
|
disabled: { type: Boolean, default: false },
|
|
2984
|
-
|
|
3488
|
+
error: { type: Boolean, default: false },
|
|
3489
|
+
variant: { default: "bar" },
|
|
3490
|
+
size: {},
|
|
2985
3491
|
wheel: { default: 0 }
|
|
2986
3492
|
},
|
|
2987
|
-
emits: ["update:modelValue"],
|
|
3493
|
+
emits: ["update:modelValue", "change"],
|
|
2988
3494
|
setup(__props, { emit: __emit }) {
|
|
2989
3495
|
const props = __props;
|
|
2990
3496
|
const emit = __emit;
|
|
@@ -2992,6 +3498,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
2992
3498
|
const localId = useId();
|
|
2993
3499
|
const controlId = computed(() => (field == null ? void 0 : field.id) ?? localId);
|
|
2994
3500
|
const describedBy = computed(() => field == null ? void 0 : field.describedBy.value);
|
|
3501
|
+
const invalid = computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
2995
3502
|
function packModelValue(value) {
|
|
2996
3503
|
return typeof props.modelValue === "string" ? `${value}` : value;
|
|
2997
3504
|
}
|
|
@@ -2999,10 +3506,11 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
2999
3506
|
const raw = typeof props.modelValue === "string" ? parseFloat(props.modelValue) : props.modelValue;
|
|
3000
3507
|
return Number.isFinite(raw) ? raw : props.min;
|
|
3001
3508
|
}
|
|
3002
|
-
const
|
|
3509
|
+
const current2 = computed(() => unpackModelValue());
|
|
3003
3510
|
const trackRef = ref(null);
|
|
3004
3511
|
const isDragging = ref(false);
|
|
3005
3512
|
let dragPointer = -1;
|
|
3513
|
+
let dragStartValue = 0;
|
|
3006
3514
|
const shadowInputRef = ref(null);
|
|
3007
3515
|
const shadowModel = ref("0");
|
|
3008
3516
|
const showShadowModel = ref(false);
|
|
@@ -3011,13 +3519,18 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
3011
3519
|
if (range <= 0) {
|
|
3012
3520
|
return 0;
|
|
3013
3521
|
}
|
|
3014
|
-
return (
|
|
3522
|
+
return (current2.value - props.min) / range * 100;
|
|
3015
3523
|
});
|
|
3016
3524
|
function clampValue(v) {
|
|
3017
3525
|
return Math.min(Math.max(v, props.min), props.max);
|
|
3018
3526
|
}
|
|
3019
|
-
function commit(value) {
|
|
3020
|
-
|
|
3527
|
+
function commit(value, final = false) {
|
|
3528
|
+
const next = clampValue(value);
|
|
3529
|
+
const changed = next !== current2.value;
|
|
3530
|
+
emit("update:modelValue", packModelValue(next));
|
|
3531
|
+
if (final && changed) {
|
|
3532
|
+
emit("change", packModelValue(next));
|
|
3533
|
+
}
|
|
3021
3534
|
}
|
|
3022
3535
|
function calculateValue(event) {
|
|
3023
3536
|
if (!trackRef.value) {
|
|
@@ -3050,12 +3563,16 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
3050
3563
|
isDragging.value = false;
|
|
3051
3564
|
releaseDragCapture();
|
|
3052
3565
|
dragPointer = -1;
|
|
3566
|
+
if (current2.value !== dragStartValue) {
|
|
3567
|
+
emit("change", packModelValue(current2.value));
|
|
3568
|
+
}
|
|
3053
3569
|
}
|
|
3054
3570
|
function onPointerDown(event) {
|
|
3055
3571
|
if (props.disabled || showShadowModel.value || event.button !== 0 || !trackRef.value) {
|
|
3056
3572
|
return;
|
|
3057
3573
|
}
|
|
3058
3574
|
dragPointer = event.pointerId;
|
|
3575
|
+
dragStartValue = current2.value;
|
|
3059
3576
|
isDragging.value = true;
|
|
3060
3577
|
commit(calculateValue(event));
|
|
3061
3578
|
event.preventDefault();
|
|
@@ -3096,17 +3613,17 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
3096
3613
|
};
|
|
3097
3614
|
if (event.key in keys) {
|
|
3098
3615
|
event.preventDefault();
|
|
3099
|
-
commit(
|
|
3616
|
+
commit(current2.value + keys[event.key], true);
|
|
3100
3617
|
return;
|
|
3101
3618
|
}
|
|
3102
3619
|
if (event.key === "Home") {
|
|
3103
3620
|
event.preventDefault();
|
|
3104
|
-
commit(props.min);
|
|
3621
|
+
commit(props.min, true);
|
|
3105
3622
|
return;
|
|
3106
3623
|
}
|
|
3107
3624
|
if (event.key === "End") {
|
|
3108
3625
|
event.preventDefault();
|
|
3109
|
-
commit(props.max);
|
|
3626
|
+
commit(props.max, true);
|
|
3110
3627
|
}
|
|
3111
3628
|
}
|
|
3112
3629
|
function onWheel(event) {
|
|
@@ -3115,13 +3632,13 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
3115
3632
|
}
|
|
3116
3633
|
event.preventDefault();
|
|
3117
3634
|
const delta = event.deltaY < 0 ? props.wheel : -props.wheel;
|
|
3118
|
-
commit(
|
|
3635
|
+
commit(current2.value + delta, true);
|
|
3119
3636
|
}
|
|
3120
3637
|
function onBlurShadowModel() {
|
|
3121
3638
|
if (shadowModel.value) {
|
|
3122
|
-
const
|
|
3123
|
-
shadowModel.value = `${
|
|
3124
|
-
|
|
3639
|
+
const next = clampValue(parseFloat(shadowModel.value) || 0);
|
|
3640
|
+
shadowModel.value = `${packModelValue(next)}`;
|
|
3641
|
+
commit(next, true);
|
|
3125
3642
|
}
|
|
3126
3643
|
showShadowModel.value = false;
|
|
3127
3644
|
}
|
|
@@ -3156,15 +3673,17 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
3156
3673
|
ref_key: "trackRef",
|
|
3157
3674
|
ref: trackRef,
|
|
3158
3675
|
class: normalizeClass(["tao-slider", [
|
|
3159
|
-
`tao-slider--${__props.
|
|
3160
|
-
|
|
3676
|
+
`tao-slider--${__props.variant}`,
|
|
3677
|
+
unref(sizeClass)(__props.size),
|
|
3678
|
+
{ "tao-slider--show-value": __props.showValue, "tao-slider--disabled": __props.disabled, "tao-slider--invalid": invalid.value }
|
|
3161
3679
|
]]),
|
|
3162
3680
|
role: "slider",
|
|
3163
3681
|
tabindex: __props.disabled ? -1 : 0,
|
|
3164
3682
|
"aria-valuemin": __props.min,
|
|
3165
3683
|
"aria-valuemax": __props.max,
|
|
3166
|
-
"aria-valuenow":
|
|
3684
|
+
"aria-valuenow": current2.value,
|
|
3167
3685
|
"aria-disabled": __props.disabled || void 0,
|
|
3686
|
+
"aria-invalid": invalid.value || void 0,
|
|
3168
3687
|
"aria-describedby": describedBy.value,
|
|
3169
3688
|
onContextmenu: withModifiers(onContextMenu, ["prevent"]),
|
|
3170
3689
|
onPointerdown: onPointerDown,
|
|
@@ -3208,37 +3727,37 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
3208
3727
|
};
|
|
3209
3728
|
}
|
|
3210
3729
|
});
|
|
3211
|
-
const TaoSlider = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-
|
|
3212
|
-
const _hoisted_1$s = { class: "tao-file-
|
|
3213
|
-
const _hoisted_2$p =
|
|
3214
|
-
const _hoisted_3$k =
|
|
3215
|
-
const _hoisted_4$j =
|
|
3216
|
-
const _hoisted_5$f =
|
|
3217
|
-
const _hoisted_6$c = {
|
|
3730
|
+
const TaoSlider = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-47d32e2a"]]);
|
|
3731
|
+
const _hoisted_1$s = { class: "tao-file-drop__row" };
|
|
3732
|
+
const _hoisted_2$p = ["aria-label"];
|
|
3733
|
+
const _hoisted_3$k = { "aria-hidden": "true" };
|
|
3734
|
+
const _hoisted_4$j = ["accept", "multiple"];
|
|
3735
|
+
const _hoisted_5$f = {
|
|
3218
3736
|
key: 0,
|
|
3219
3737
|
class: "tao-file-drop__list"
|
|
3220
3738
|
};
|
|
3221
|
-
const
|
|
3222
|
-
const
|
|
3223
|
-
const
|
|
3224
|
-
const
|
|
3739
|
+
const _hoisted_6$c = { class: "tao-file-drop__name" };
|
|
3740
|
+
const _hoisted_7$a = { class: "tao-file-drop__meta" };
|
|
3741
|
+
const _hoisted_8$9 = ["aria-label", "onClick"];
|
|
3742
|
+
const _hoisted_9$4 = { "aria-hidden": "true" };
|
|
3225
3743
|
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
3226
3744
|
...{ name: "TaoFileDrop" },
|
|
3227
3745
|
__name: "TaoFileDrop",
|
|
3228
3746
|
props: {
|
|
3229
3747
|
modelValue: { default: () => [] },
|
|
3230
|
-
size: {
|
|
3748
|
+
size: {},
|
|
3231
3749
|
accept: { default: "*" },
|
|
3232
3750
|
multiple: { type: Boolean, default: false },
|
|
3233
3751
|
showClear: { type: Boolean, default: false },
|
|
3234
|
-
clearLabel: {
|
|
3235
|
-
removeLabel: {
|
|
3752
|
+
clearLabel: {},
|
|
3753
|
+
removeLabel: {},
|
|
3236
3754
|
formatSize: {},
|
|
3237
3755
|
list: { type: Boolean, default: true }
|
|
3238
3756
|
},
|
|
3239
|
-
emits: ["update:modelValue", "files", "clear-request"],
|
|
3757
|
+
emits: ["update:modelValue", "change", "files", "clear-request"],
|
|
3240
3758
|
setup(__props, { emit: __emit }) {
|
|
3241
3759
|
const props = __props;
|
|
3760
|
+
const l10n = useLocaleText(props, "fileDrop");
|
|
3242
3761
|
const emit = __emit;
|
|
3243
3762
|
const isDragging = ref(false);
|
|
3244
3763
|
const fileInput = ref(null);
|
|
@@ -3269,6 +3788,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
3269
3788
|
}
|
|
3270
3789
|
function commit(files) {
|
|
3271
3790
|
emit("update:modelValue", files);
|
|
3791
|
+
emit("change", files);
|
|
3272
3792
|
emit("files", files);
|
|
3273
3793
|
}
|
|
3274
3794
|
function handleDragOver(event) {
|
|
@@ -3327,17 +3847,18 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
3327
3847
|
resetInput();
|
|
3328
3848
|
}
|
|
3329
3849
|
function defaultFormatSize(bytes) {
|
|
3850
|
+
const { units, decimalSeparator } = taoLocale().fileDrop;
|
|
3330
3851
|
if (bytes < 1024) {
|
|
3331
|
-
return `${bytes}
|
|
3852
|
+
return `${bytes} ${units[0]}`;
|
|
3332
3853
|
}
|
|
3333
3854
|
const kb = bytes / 1024;
|
|
3334
3855
|
if (kb < 1024) {
|
|
3335
3856
|
const value2 = kb < 10 ? kb.toFixed(1) : String(Math.round(kb));
|
|
3336
|
-
return `${value2.replace(".",
|
|
3857
|
+
return `${value2.replace(".", decimalSeparator)} ${units[1]}`;
|
|
3337
3858
|
}
|
|
3338
3859
|
const mb = kb / 1024;
|
|
3339
3860
|
const value = mb < 10 ? mb.toFixed(1) : String(Math.round(mb));
|
|
3340
|
-
return `${value.replace(".",
|
|
3861
|
+
return `${value.replace(".", decimalSeparator)} ${units[2]}`;
|
|
3341
3862
|
}
|
|
3342
3863
|
function sizeLabel(bytes) {
|
|
3343
3864
|
return props.formatSize ? props.formatSize(bytes) : defaultFormatSize(bytes);
|
|
@@ -3352,30 +3873,35 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
3352
3873
|
});
|
|
3353
3874
|
});
|
|
3354
3875
|
onBeforeUnmount(() => stopFocusLoss == null ? void 0 : stopFocusLoss());
|
|
3876
|
+
warnDeprecated("TaoFileDrop", {
|
|
3877
|
+
onFiles: 'listen to "change"'
|
|
3878
|
+
});
|
|
3355
3879
|
return (_ctx, _cache) => {
|
|
3356
|
-
return openBlock(), createElementBlock("div",
|
|
3357
|
-
|
|
3880
|
+
return openBlock(), createElementBlock("div", {
|
|
3881
|
+
class: normalizeClass(["tao-file-drop", unref(sizeClass)(__props.size)])
|
|
3882
|
+
}, [
|
|
3883
|
+
createElementVNode("div", _hoisted_1$s, [
|
|
3358
3884
|
__props.showClear && __props.modelValue.length ? (openBlock(), createElementBlock("button", {
|
|
3359
3885
|
key: 0,
|
|
3360
3886
|
type: "button",
|
|
3361
3887
|
class: "tao-file-drop__clear",
|
|
3362
|
-
"aria-label":
|
|
3888
|
+
"aria-label": unref(l10n).clearLabel,
|
|
3363
3889
|
onClick: requestClear
|
|
3364
3890
|
}, [
|
|
3365
|
-
createElementVNode("span",
|
|
3891
|
+
createElementVNode("span", _hoisted_3$k, [
|
|
3366
3892
|
renderSlot(_ctx.$slots, "clear-icon", {}, () => [
|
|
3367
3893
|
_cache[1] || (_cache[1] = createTextVNode("✕", -1))
|
|
3368
3894
|
], true)
|
|
3369
3895
|
])
|
|
3370
|
-
], 8,
|
|
3896
|
+
], 8, _hoisted_2$p)) : createCommentVNode("", true),
|
|
3371
3897
|
createElementVNode("label", {
|
|
3372
|
-
class: normalizeClass(["tao-file-drop__zone",
|
|
3898
|
+
class: normalizeClass(["tao-file-drop__zone", { "tao-file-drop__zone--dragging": isDragging.value }]),
|
|
3373
3899
|
onDragover: handleDragOver,
|
|
3374
3900
|
onDragleave: handleDragLeave,
|
|
3375
3901
|
onDrop: handleDrop
|
|
3376
3902
|
}, [
|
|
3377
3903
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
3378
|
-
|
|
3904
|
+
createTextVNode(toDisplayString(unref(taoLocale)().fileDrop.zoneText), 1)
|
|
3379
3905
|
], true),
|
|
3380
3906
|
createElementVNode("input", {
|
|
3381
3907
|
ref_key: "fileInput",
|
|
@@ -3387,37 +3913,37 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
3387
3913
|
onChange: handleFileSelect,
|
|
3388
3914
|
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
3389
3915
|
}, ["stop"]))
|
|
3390
|
-
}, null, 40,
|
|
3916
|
+
}, null, 40, _hoisted_4$j)
|
|
3391
3917
|
], 34)
|
|
3392
3918
|
]),
|
|
3393
|
-
__props.list && __props.modelValue.length ? (openBlock(), createElementBlock("ul",
|
|
3919
|
+
__props.list && __props.modelValue.length ? (openBlock(), createElementBlock("ul", _hoisted_5$f, [
|
|
3394
3920
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.modelValue, (file, index) => {
|
|
3395
3921
|
return openBlock(), createElementBlock("li", {
|
|
3396
3922
|
key: fileKey(file, index),
|
|
3397
3923
|
class: "tao-file-drop__file"
|
|
3398
3924
|
}, [
|
|
3399
|
-
createElementVNode("span",
|
|
3400
|
-
createElementVNode("span",
|
|
3925
|
+
createElementVNode("span", _hoisted_6$c, toDisplayString(file.name), 1),
|
|
3926
|
+
createElementVNode("span", _hoisted_7$a, toDisplayString(sizeLabel(file.size)), 1),
|
|
3401
3927
|
createElementVNode("button", {
|
|
3402
3928
|
type: "button",
|
|
3403
3929
|
class: "tao-file-drop__remove",
|
|
3404
|
-
"aria-label":
|
|
3930
|
+
"aria-label": unref(l10n).removeLabel.replace("{name}", file.name),
|
|
3405
3931
|
onClick: ($event) => removeAt(index)
|
|
3406
3932
|
}, [
|
|
3407
|
-
createElementVNode("span",
|
|
3933
|
+
createElementVNode("span", _hoisted_9$4, [
|
|
3408
3934
|
renderSlot(_ctx.$slots, "remove-icon", {}, () => [
|
|
3409
|
-
_cache[
|
|
3935
|
+
_cache[2] || (_cache[2] = createTextVNode("✕", -1))
|
|
3410
3936
|
], true)
|
|
3411
3937
|
])
|
|
3412
|
-
], 8,
|
|
3938
|
+
], 8, _hoisted_8$9)
|
|
3413
3939
|
]);
|
|
3414
3940
|
}), 128))
|
|
3415
3941
|
])) : createCommentVNode("", true)
|
|
3416
|
-
]);
|
|
3942
|
+
], 2);
|
|
3417
3943
|
};
|
|
3418
3944
|
}
|
|
3419
3945
|
});
|
|
3420
|
-
const TaoFileDrop = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-
|
|
3946
|
+
const TaoFileDrop = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-f8c58faa"]]);
|
|
3421
3947
|
const _hoisted_1$r = ["aria-expanded", "aria-label"];
|
|
3422
3948
|
const _hoisted_2$o = {
|
|
3423
3949
|
key: 1,
|
|
@@ -3430,11 +3956,12 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
3430
3956
|
__name: "TaoDropdownMenu",
|
|
3431
3957
|
props: {
|
|
3432
3958
|
actions: { default: () => [] },
|
|
3433
|
-
menuLabel: {
|
|
3959
|
+
menuLabel: {}
|
|
3434
3960
|
},
|
|
3435
|
-
emits: ["selected"],
|
|
3961
|
+
emits: ["select", "selected"],
|
|
3436
3962
|
setup(__props, { emit: __emit }) {
|
|
3437
3963
|
const props = __props;
|
|
3964
|
+
const l10n = useLocaleText(props, "dropdownMenu");
|
|
3438
3965
|
const emit = __emit;
|
|
3439
3966
|
const menuRef = ref(null);
|
|
3440
3967
|
const listRef = ref(null);
|
|
@@ -3490,6 +4017,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
3490
4017
|
function emitAction(id) {
|
|
3491
4018
|
var _a;
|
|
3492
4019
|
isOpen.value = false;
|
|
4020
|
+
emit("select", id);
|
|
3493
4021
|
emit("selected", id);
|
|
3494
4022
|
(_a = triggerRef.value) == null ? void 0 : _a.focus();
|
|
3495
4023
|
}
|
|
@@ -3546,6 +4074,9 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
3546
4074
|
window.removeEventListener("scroll", onWinScroll, true);
|
|
3547
4075
|
window.removeEventListener("resize", updatePosition);
|
|
3548
4076
|
});
|
|
4077
|
+
warnDeprecated("TaoDropdownMenu", {
|
|
4078
|
+
onSelected: 'listen to "select"'
|
|
4079
|
+
});
|
|
3549
4080
|
return (_ctx, _cache) => {
|
|
3550
4081
|
return openBlock(), createElementBlock("div", {
|
|
3551
4082
|
ref_key: "menuRef",
|
|
@@ -3559,7 +4090,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
3559
4090
|
class: "tao-dropdown-menu__button",
|
|
3560
4091
|
"aria-haspopup": "menu",
|
|
3561
4092
|
"aria-expanded": isOpen.value,
|
|
3562
|
-
"aria-label": _ctx.$slots.button ? void 0 :
|
|
4093
|
+
"aria-label": _ctx.$slots.button ? void 0 : unref(l10n).menuLabel,
|
|
3563
4094
|
onClick: toggleMenu
|
|
3564
4095
|
}, [
|
|
3565
4096
|
_ctx.$slots.button ? renderSlot(_ctx.$slots, "button", {}, void 0, true, 0) : (openBlock(), createElementBlock("span", _hoisted_2$o, [
|
|
@@ -3601,16 +4132,20 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
3601
4132
|
};
|
|
3602
4133
|
}
|
|
3603
4134
|
});
|
|
3604
|
-
const TaoDropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-
|
|
4135
|
+
const TaoDropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-5db490aa"]]);
|
|
3605
4136
|
const _hoisted_1$q = ["aria-invalid", "aria-describedby"];
|
|
3606
|
-
const _hoisted_2$n = ["id", "value", "placeholder", "type", "inputmode", "pattern", "maxlength", "onInput", "onPaste", "onKeydown", "onFocus"];
|
|
4137
|
+
const _hoisted_2$n = ["id", "value", "placeholder", "type", "disabled", "aria-invalid", "inputmode", "pattern", "maxlength", "onInput", "onPaste", "onKeydown", "onFocus"];
|
|
3607
4138
|
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
3608
4139
|
...{ name: "TaoPinCode" },
|
|
3609
4140
|
__name: "TaoPinCode",
|
|
3610
4141
|
props: {
|
|
3611
4142
|
length: {},
|
|
4143
|
+
masked: { type: Boolean, default: false },
|
|
3612
4144
|
hidden: { type: Boolean, default: false },
|
|
3613
4145
|
placeholder: { default: "" },
|
|
4146
|
+
disabled: { type: Boolean, default: false },
|
|
4147
|
+
error: { type: Boolean, default: false },
|
|
4148
|
+
size: {},
|
|
3614
4149
|
modelValue: { default: "" },
|
|
3615
4150
|
numbersOnly: { type: Boolean, default: false },
|
|
3616
4151
|
clearOn: { default: "focus" }
|
|
@@ -3622,7 +4157,8 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
3622
4157
|
const field = inject(formFieldKey, null);
|
|
3623
4158
|
const localId = useId();
|
|
3624
4159
|
const controlId = computed(() => (field == null ? void 0 : field.id) ?? localId);
|
|
3625
|
-
const invalid = computed(() => Boolean(field == null ? void 0 : field.invalid.value));
|
|
4160
|
+
const invalid = computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
4161
|
+
const isMasked = computed(() => props.masked || props.hidden);
|
|
3626
4162
|
const describedBy = computed(() => field == null ? void 0 : field.describedBy.value);
|
|
3627
4163
|
const numbers = ref([]);
|
|
3628
4164
|
const inputRefs = ref([]);
|
|
@@ -3784,9 +4320,12 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
3784
4320
|
},
|
|
3785
4321
|
{ immediate: true }
|
|
3786
4322
|
);
|
|
4323
|
+
warnDeprecated("TaoPinCode", {
|
|
4324
|
+
hidden: "use `masked`"
|
|
4325
|
+
});
|
|
3787
4326
|
return (_ctx, _cache) => {
|
|
3788
4327
|
return openBlock(), createElementBlock("div", {
|
|
3789
|
-
class: "tao-pin-code",
|
|
4328
|
+
class: normalizeClass(["tao-pin-code", [unref(sizeClass)(__props.size), { "tao-pin-code--disabled": __props.disabled }]]),
|
|
3790
4329
|
role: "group",
|
|
3791
4330
|
"aria-invalid": invalid.value || void 0,
|
|
3792
4331
|
"aria-describedby": describedBy.value
|
|
@@ -3803,7 +4342,9 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
3803
4342
|
}]),
|
|
3804
4343
|
value: num,
|
|
3805
4344
|
placeholder: __props.placeholder,
|
|
3806
|
-
type:
|
|
4345
|
+
type: isMasked.value ? "password" : "text",
|
|
4346
|
+
disabled: __props.disabled,
|
|
4347
|
+
"aria-invalid": invalid.value || void 0,
|
|
3807
4348
|
inputmode: __props.numbersOnly ? "numeric" : "text",
|
|
3808
4349
|
pattern: __props.numbersOnly ? "[0-9]" : void 0,
|
|
3809
4350
|
autocomplete: "one-time-code",
|
|
@@ -3815,16 +4356,17 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
3815
4356
|
onBlur
|
|
3816
4357
|
}, null, 42, _hoisted_2$n);
|
|
3817
4358
|
}), 128))
|
|
3818
|
-
],
|
|
4359
|
+
], 10, _hoisted_1$q);
|
|
3819
4360
|
};
|
|
3820
4361
|
}
|
|
3821
4362
|
});
|
|
3822
|
-
const TaoPinCode = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-
|
|
4363
|
+
const TaoPinCode = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-6f0df8bd"]]);
|
|
3823
4364
|
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
3824
4365
|
...{ name: "TaoLink" },
|
|
3825
4366
|
__name: "TaoLink",
|
|
3826
4367
|
props: {
|
|
3827
4368
|
to: { default: void 0 },
|
|
4369
|
+
newTab: { type: Boolean, default: false },
|
|
3828
4370
|
asNewTab: { type: Boolean, default: false },
|
|
3829
4371
|
private: { type: Boolean, default: false },
|
|
3830
4372
|
exactPath: { type: Boolean, default: false }
|
|
@@ -3836,8 +4378,9 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
3836
4378
|
const linkKind = globals.NuxtLink ? "nuxt" : globals.RouterLink ? "router" : "a";
|
|
3837
4379
|
const linkComponent = linkKind === "nuxt" ? globals.NuxtLink : linkKind === "router" ? globals.RouterLink : "a";
|
|
3838
4380
|
const linkProps = computed(() => {
|
|
3839
|
-
const
|
|
3840
|
-
const
|
|
4381
|
+
const newTab = props.newTab || props.asNewTab;
|
|
4382
|
+
const target = newTab ? "_blank" : void 0;
|
|
4383
|
+
const rel = props.private && "noopener noreferrer" || newTab && "noopener" || void 0;
|
|
3841
4384
|
if (linkKind === "a") {
|
|
3842
4385
|
return {
|
|
3843
4386
|
href: typeof props.to === "string" ? props.to : void 0,
|
|
@@ -3852,6 +4395,9 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
3852
4395
|
...linkKind === "nuxt" ? { exactPath: props.exactPath } : {}
|
|
3853
4396
|
};
|
|
3854
4397
|
});
|
|
4398
|
+
warnDeprecated("TaoLink", {
|
|
4399
|
+
asNewTab: "use `newTab`"
|
|
4400
|
+
});
|
|
3855
4401
|
return (_ctx, _cache) => {
|
|
3856
4402
|
return openBlock(), createBlock(resolveDynamicComponent(unref(linkComponent)), mergeProps(linkProps.value, { draggable: "false" }), {
|
|
3857
4403
|
default: withCtx(() => [
|
|
@@ -3869,7 +4415,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
3869
4415
|
props: {
|
|
3870
4416
|
label: {},
|
|
3871
4417
|
hint: {},
|
|
3872
|
-
error: {}
|
|
4418
|
+
error: {},
|
|
4419
|
+
size: {}
|
|
3873
4420
|
},
|
|
3874
4421
|
setup(__props) {
|
|
3875
4422
|
const props = __props;
|
|
@@ -3905,7 +4452,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
3905
4452
|
}
|
|
3906
4453
|
return (_ctx, _cache) => {
|
|
3907
4454
|
return openBlock(), createElementBlock("div", {
|
|
3908
|
-
class: normalizeClass(["tao-form-field", { "tao-form-field--invalid": invalid.value }])
|
|
4455
|
+
class: normalizeClass(["tao-form-field", [unref(sizeClass)(__props.size), { "tao-form-field--invalid": invalid.value }]])
|
|
3909
4456
|
}, [
|
|
3910
4457
|
__props.label ? (openBlock(), createElementBlock("label", {
|
|
3911
4458
|
key: 0,
|
|
@@ -3928,7 +4475,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
3928
4475
|
};
|
|
3929
4476
|
}
|
|
3930
4477
|
});
|
|
3931
|
-
const TaoFormField = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-
|
|
4478
|
+
const TaoFormField = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-3cf90e3a"]]);
|
|
3932
4479
|
const _hoisted_1$o = ["id", "aria-expanded", "aria-invalid", "aria-describedby", "disabled"];
|
|
3933
4480
|
const _hoisted_2$m = { class: "tao-select__value" };
|
|
3934
4481
|
const _hoisted_3$i = ["aria-activedescendant"];
|
|
@@ -3939,16 +4486,17 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
3939
4486
|
props: {
|
|
3940
4487
|
modelValue: { default: null },
|
|
3941
4488
|
options: { default: () => [] },
|
|
3942
|
-
placeholder: {
|
|
4489
|
+
placeholder: {},
|
|
3943
4490
|
disabled: { type: Boolean, default: false },
|
|
3944
4491
|
error: { type: Boolean, default: false },
|
|
3945
|
-
clearText: {
|
|
4492
|
+
clearText: {},
|
|
3946
4493
|
clearable: { type: Boolean, default: true },
|
|
3947
|
-
size: {
|
|
4494
|
+
size: {}
|
|
3948
4495
|
},
|
|
3949
4496
|
emits: ["update:modelValue", "change"],
|
|
3950
4497
|
setup(__props, { emit: __emit }) {
|
|
3951
4498
|
const props = __props;
|
|
4499
|
+
const l10n = useLocaleText(props, "select");
|
|
3952
4500
|
const emit = __emit;
|
|
3953
4501
|
const field = inject(formFieldKey, null);
|
|
3954
4502
|
const localId = useId();
|
|
@@ -3962,6 +4510,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
3962
4510
|
const panelRef = ref(null);
|
|
3963
4511
|
const listRef = ref(null);
|
|
3964
4512
|
const listStyle = ref({ top: "0px", left: "0px", width: "0px" });
|
|
4513
|
+
const panelSize = ref("medium");
|
|
3965
4514
|
const selected = computed(() => props.options.find((option) => option.value === props.modelValue) ?? null);
|
|
3966
4515
|
const enabledIndexes = computed(
|
|
3967
4516
|
() => props.options.map((option, index) => option.disabled ? -1 : index).filter((index) => index >= 0)
|
|
@@ -4118,6 +4667,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
4118
4667
|
}
|
|
4119
4668
|
watch(open, (isOpen) => {
|
|
4120
4669
|
if (isOpen) {
|
|
4670
|
+
panelSize.value = resolveSize(triggerRef.value, props.size);
|
|
4121
4671
|
document.addEventListener("pointerdown", onDocumentPointer);
|
|
4122
4672
|
window.addEventListener("resize", onViewportChange);
|
|
4123
4673
|
window.addEventListener("scroll", onViewportChange, true);
|
|
@@ -4135,7 +4685,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
4135
4685
|
return (_ctx, _cache) => {
|
|
4136
4686
|
var _a;
|
|
4137
4687
|
return openBlock(), createElementBlock("div", {
|
|
4138
|
-
class: normalizeClass(["tao-select", [
|
|
4688
|
+
class: normalizeClass(["tao-select", [unref(sizeClass)(__props.size), { "tao-select--open": open.value, "tao-select--invalid": invalid.value }]])
|
|
4139
4689
|
}, [
|
|
4140
4690
|
createElementVNode("button", {
|
|
4141
4691
|
id: controlId.value,
|
|
@@ -4153,7 +4703,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
4153
4703
|
onClick: toggle,
|
|
4154
4704
|
onKeydown: onTriggerKeydown
|
|
4155
4705
|
}, [
|
|
4156
|
-
createElementVNode("span", _hoisted_2$m, toDisplayString(((_a = selected.value) == null ? void 0 : _a.label) ??
|
|
4706
|
+
createElementVNode("span", _hoisted_2$m, toDisplayString(((_a = selected.value) == null ? void 0 : _a.label) ?? unref(l10n).placeholder), 1),
|
|
4157
4707
|
createElementVNode("span", {
|
|
4158
4708
|
class: normalizeClass(["tao-select__chevron", { "tao-select__chevron--custom": _ctx.$slots.chevron }]),
|
|
4159
4709
|
"aria-hidden": "true"
|
|
@@ -4166,7 +4716,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
4166
4716
|
key: 0,
|
|
4167
4717
|
ref_key: "panelRef",
|
|
4168
4718
|
ref: panelRef,
|
|
4169
|
-
class: normalizeClass(["tao-select__panel",
|
|
4719
|
+
class: normalizeClass(["tao-select__panel", unref(sizeClass)(panelSize.value)]),
|
|
4170
4720
|
style: normalizeStyle(listStyle.value)
|
|
4171
4721
|
}, [
|
|
4172
4722
|
createElementVNode("ul", {
|
|
@@ -4208,7 +4758,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
4208
4758
|
onClick: clear
|
|
4209
4759
|
}, [
|
|
4210
4760
|
renderSlot(_ctx.$slots, "clear", {}, () => [
|
|
4211
|
-
createTextVNode(toDisplayString(
|
|
4761
|
+
createTextVNode(toDisplayString(unref(l10n).clearText), 1)
|
|
4212
4762
|
], true)
|
|
4213
4763
|
], 32)) : createCommentVNode("", true)
|
|
4214
4764
|
], 6)) : createCommentVNode("", true)
|
|
@@ -4217,7 +4767,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
4217
4767
|
};
|
|
4218
4768
|
}
|
|
4219
4769
|
});
|
|
4220
|
-
const TaoSelect = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-
|
|
4770
|
+
const TaoSelect = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-47d327a3"]]);
|
|
4221
4771
|
const _hoisted_1$n = ["id", "aria-expanded", "aria-activedescendant", "aria-invalid", "aria-describedby", "disabled", "placeholder", "value"];
|
|
4222
4772
|
const _hoisted_2$l = {
|
|
4223
4773
|
key: 0,
|
|
@@ -4230,18 +4780,19 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
4230
4780
|
props: {
|
|
4231
4781
|
modelValue: { default: null },
|
|
4232
4782
|
options: { default: () => [] },
|
|
4233
|
-
placeholder: {
|
|
4783
|
+
placeholder: {},
|
|
4234
4784
|
disabled: { type: Boolean, default: false },
|
|
4235
4785
|
error: { type: Boolean, default: false },
|
|
4236
|
-
emptyText: {
|
|
4237
|
-
clearText: {
|
|
4786
|
+
emptyText: {},
|
|
4787
|
+
clearText: {},
|
|
4238
4788
|
clearable: { type: Boolean, default: true },
|
|
4239
|
-
size: {
|
|
4789
|
+
size: {},
|
|
4240
4790
|
allowCreate: { type: Boolean, default: false }
|
|
4241
4791
|
},
|
|
4242
4792
|
emits: ["update:modelValue", "change", "create"],
|
|
4243
4793
|
setup(__props, { emit: __emit }) {
|
|
4244
4794
|
const props = __props;
|
|
4795
|
+
const l10n = useLocaleText(props, "combobox");
|
|
4245
4796
|
const emit = __emit;
|
|
4246
4797
|
const field = inject(formFieldKey, null);
|
|
4247
4798
|
const localId = useId();
|
|
@@ -4258,6 +4809,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
4258
4809
|
const fieldRef = ref(null);
|
|
4259
4810
|
const inputRef = ref(null);
|
|
4260
4811
|
const panelRef = ref(null);
|
|
4812
|
+
const panelSize = ref("medium");
|
|
4261
4813
|
const listRef = ref(null);
|
|
4262
4814
|
const listStyle = ref({ top: "0px", left: "0px", width: "0px" });
|
|
4263
4815
|
const selected = computed(() => {
|
|
@@ -4587,6 +5139,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
4587
5139
|
});
|
|
4588
5140
|
watch(open, (isOpen) => {
|
|
4589
5141
|
if (isOpen) {
|
|
5142
|
+
panelSize.value = resolveSize(fieldRef.value, props.size);
|
|
4590
5143
|
document.addEventListener("pointerdown", onDocumentPointer);
|
|
4591
5144
|
window.addEventListener("resize", onViewportChange);
|
|
4592
5145
|
window.addEventListener("scroll", onViewportChange, true);
|
|
@@ -4611,7 +5164,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
4611
5164
|
return (_ctx, _cache) => {
|
|
4612
5165
|
return openBlock(), createElementBlock("div", {
|
|
4613
5166
|
class: normalizeClass(["tao-combobox", [
|
|
4614
|
-
|
|
5167
|
+
unref(sizeClass)(__props.size),
|
|
4615
5168
|
{
|
|
4616
5169
|
"tao-combobox--open": open.value,
|
|
4617
5170
|
"tao-combobox--invalid": invalid.value,
|
|
@@ -4641,7 +5194,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
4641
5194
|
"aria-invalid": invalid.value || void 0,
|
|
4642
5195
|
"aria-describedby": describedBy.value,
|
|
4643
5196
|
disabled: __props.disabled,
|
|
4644
|
-
placeholder:
|
|
5197
|
+
placeholder: unref(l10n).placeholder,
|
|
4645
5198
|
value: query.value,
|
|
4646
5199
|
onInput: _cache[0] || (_cache[0] = ($event) => {
|
|
4647
5200
|
query.value = $event.target.value;
|
|
@@ -4663,7 +5216,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
4663
5216
|
key: 0,
|
|
4664
5217
|
ref_key: "panelRef",
|
|
4665
5218
|
ref: panelRef,
|
|
4666
|
-
class: normalizeClass(["tao-combobox__panel",
|
|
5219
|
+
class: normalizeClass(["tao-combobox__panel", unref(sizeClass)(panelSize.value)]),
|
|
4667
5220
|
style: normalizeStyle(listStyle.value)
|
|
4668
5221
|
}, [
|
|
4669
5222
|
createElementVNode("ul", {
|
|
@@ -4675,7 +5228,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
4675
5228
|
}, [
|
|
4676
5229
|
!rows.value.length ? (openBlock(), createElementBlock("li", _hoisted_2$l, [
|
|
4677
5230
|
renderSlot(_ctx.$slots, "empty", {}, () => [
|
|
4678
|
-
createTextVNode(toDisplayString(
|
|
5231
|
+
createTextVNode(toDisplayString(unref(l10n).emptyText), 1)
|
|
4679
5232
|
], true)
|
|
4680
5233
|
])) : createCommentVNode("", true),
|
|
4681
5234
|
(openBlock(true), createElementBlock(Fragment, null, renderList(rows.value, (row, index) => {
|
|
@@ -4699,7 +5252,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
4699
5252
|
row.kind === "create" ? renderSlot(_ctx.$slots, "create", {
|
|
4700
5253
|
text: row.text
|
|
4701
5254
|
}, () => [
|
|
4702
|
-
createTextVNode(
|
|
5255
|
+
createTextVNode(toDisplayString(unref(formatText)(unref(taoLocale)().combobox.createText, { text: row.text })), 1)
|
|
4703
5256
|
], true, 0) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
4704
5257
|
createTextVNode(toDisplayString(row.option.label), 1)
|
|
4705
5258
|
], 64))
|
|
@@ -4714,7 +5267,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
4714
5267
|
onClick: clear
|
|
4715
5268
|
}, [
|
|
4716
5269
|
renderSlot(_ctx.$slots, "clear", {}, () => [
|
|
4717
|
-
createTextVNode(toDisplayString(
|
|
5270
|
+
createTextVNode(toDisplayString(unref(l10n).clearText), 1)
|
|
4718
5271
|
], true)
|
|
4719
5272
|
], 32)) : createCommentVNode("", true)
|
|
4720
5273
|
], 6)) : createCommentVNode("", true)
|
|
@@ -4723,7 +5276,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
4723
5276
|
};
|
|
4724
5277
|
}
|
|
4725
5278
|
});
|
|
4726
|
-
const TaoCombobox = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-
|
|
5279
|
+
const TaoCombobox = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-e75a5550"]]);
|
|
4727
5280
|
const ISO_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
4728
5281
|
function formatTaoDateIso(parts) {
|
|
4729
5282
|
return `${String(parts.y).padStart(4, "0")}-${String(parts.m).padStart(2, "0")}-${String(parts.d).padStart(2, "0")}`;
|
|
@@ -4895,20 +5448,23 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
4895
5448
|
__name: "TaoDate",
|
|
4896
5449
|
props: {
|
|
4897
5450
|
modelValue: { default: null },
|
|
4898
|
-
placeholder: {
|
|
5451
|
+
placeholder: {},
|
|
4899
5452
|
disabled: { type: Boolean, default: false },
|
|
5453
|
+
size: {},
|
|
4900
5454
|
error: { type: Boolean, default: false },
|
|
4901
5455
|
min: { default: void 0 },
|
|
4902
5456
|
max: { default: void 0 },
|
|
4903
|
-
locale: {
|
|
4904
|
-
todayText: {
|
|
4905
|
-
clearText: {
|
|
4906
|
-
prevMonthLabel: {
|
|
4907
|
-
nextMonthLabel: {
|
|
5457
|
+
locale: {},
|
|
5458
|
+
todayText: {},
|
|
5459
|
+
clearText: {},
|
|
5460
|
+
prevMonthLabel: {},
|
|
5461
|
+
nextMonthLabel: {}
|
|
4908
5462
|
},
|
|
4909
5463
|
emits: ["update:modelValue", "change"],
|
|
4910
5464
|
setup(__props, { emit: __emit }) {
|
|
4911
5465
|
const props = __props;
|
|
5466
|
+
const l10n = useLocaleText(props, "date");
|
|
5467
|
+
const dateLocale = computed(() => props.locale ?? taoLocale().code);
|
|
4912
5468
|
const emit = __emit;
|
|
4913
5469
|
const field = inject(formFieldKey, null);
|
|
4914
5470
|
const localId = useId();
|
|
@@ -4927,9 +5483,9 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
4927
5483
|
const parsed = parseTaoDate(props.modelValue);
|
|
4928
5484
|
return parsed ? formatTaoDateIso(parsed) : null;
|
|
4929
5485
|
});
|
|
4930
|
-
const displayLabel = computed(() => valueIso.value ? formatTaoDateLabel(valueIso.value,
|
|
4931
|
-
const weekdays = computed(() => taoWeekdayLabels(
|
|
4932
|
-
const monthLabel = computed(() => formatTaoMonthLabel(viewYear.value, viewMonth.value,
|
|
5486
|
+
const displayLabel = computed(() => valueIso.value ? formatTaoDateLabel(valueIso.value, dateLocale.value) : "");
|
|
5487
|
+
const weekdays = computed(() => taoWeekdayLabels(dateLocale.value));
|
|
5488
|
+
const monthLabel = computed(() => formatTaoMonthLabel(viewYear.value, viewMonth.value, dateLocale.value));
|
|
4933
5489
|
const cells = computed(() => buildTaoDateGrid(viewYear.value, viewMonth.value));
|
|
4934
5490
|
const todayIso = computed(() => todayTaoDate());
|
|
4935
5491
|
const todayEnabled = computed(() => isTaoDateInRange(todayIso.value, props.min, props.max));
|
|
@@ -5101,7 +5657,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
5101
5657
|
});
|
|
5102
5658
|
return (_ctx, _cache) => {
|
|
5103
5659
|
return openBlock(), createElementBlock("div", {
|
|
5104
|
-
class: normalizeClass(["tao-date", { "tao-date--open": open.value, "tao-date--invalid": invalid.value }])
|
|
5660
|
+
class: normalizeClass(["tao-date", [unref(sizeClass)(__props.size), { "tao-date--open": open.value, "tao-date--invalid": invalid.value }]])
|
|
5105
5661
|
}, [
|
|
5106
5662
|
createElementVNode("button", {
|
|
5107
5663
|
id: controlId.value,
|
|
@@ -5119,7 +5675,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
5119
5675
|
onClick: toggle,
|
|
5120
5676
|
onKeydown: onTriggerKeydown
|
|
5121
5677
|
}, [
|
|
5122
|
-
createElementVNode("span", _hoisted_2$k, toDisplayString(displayLabel.value ||
|
|
5678
|
+
createElementVNode("span", _hoisted_2$k, toDisplayString(displayLabel.value || unref(l10n).placeholder), 1),
|
|
5123
5679
|
createElementVNode("span", _hoisted_3$g, [
|
|
5124
5680
|
renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
5125
5681
|
_cache[4] || (_cache[4] = createElementVNode("svg", {
|
|
@@ -5166,7 +5722,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
5166
5722
|
createElementVNode("button", {
|
|
5167
5723
|
type: "button",
|
|
5168
5724
|
class: "tao-date__nav",
|
|
5169
|
-
"aria-label":
|
|
5725
|
+
"aria-label": unref(l10n).prevMonthLabel,
|
|
5170
5726
|
onClick: _cache[0] || (_cache[0] = ($event) => goMonth(-1))
|
|
5171
5727
|
}, [
|
|
5172
5728
|
createElementVNode("span", _hoisted_7$9, [
|
|
@@ -5193,7 +5749,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
5193
5749
|
createElementVNode("button", {
|
|
5194
5750
|
type: "button",
|
|
5195
5751
|
class: "tao-date__nav",
|
|
5196
|
-
"aria-label":
|
|
5752
|
+
"aria-label": unref(l10n).nextMonthLabel,
|
|
5197
5753
|
onClick: _cache[1] || (_cache[1] = ($event) => goMonth(1))
|
|
5198
5754
|
}, [
|
|
5199
5755
|
createElementVNode("span", _hoisted_10$3, [
|
|
@@ -5235,7 +5791,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
5235
5791
|
"tao-date__day--disabled": !unref(isTaoDateInRange)(cell.iso, __props.min, __props.max)
|
|
5236
5792
|
}]),
|
|
5237
5793
|
role: "gridcell",
|
|
5238
|
-
"aria-label": unref(formatTaoDateLabel)(cell.iso,
|
|
5794
|
+
"aria-label": unref(formatTaoDateLabel)(cell.iso, dateLocale.value),
|
|
5239
5795
|
"aria-selected": cell.iso === valueIso.value,
|
|
5240
5796
|
disabled: !unref(isTaoDateInRange)(cell.iso, __props.min, __props.max),
|
|
5241
5797
|
onMousedown: _cache[2] || (_cache[2] = withModifiers(() => {
|
|
@@ -5252,7 +5808,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
5252
5808
|
onClick: _cache[3] || (_cache[3] = ($event) => selectDay(todayIso.value))
|
|
5253
5809
|
}, [
|
|
5254
5810
|
renderSlot(_ctx.$slots, "today", {}, () => [
|
|
5255
|
-
createTextVNode(toDisplayString(
|
|
5811
|
+
createTextVNode(toDisplayString(unref(l10n).todayText), 1)
|
|
5256
5812
|
], true)
|
|
5257
5813
|
], 8, _hoisted_15),
|
|
5258
5814
|
valueIso.value ? (openBlock(), createElementBlock("button", {
|
|
@@ -5262,7 +5818,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
5262
5818
|
onClick: clear
|
|
5263
5819
|
}, [
|
|
5264
5820
|
renderSlot(_ctx.$slots, "clear", {}, () => [
|
|
5265
|
-
createTextVNode(toDisplayString(
|
|
5821
|
+
createTextVNode(toDisplayString(unref(l10n).clearText), 1)
|
|
5266
5822
|
], true)
|
|
5267
5823
|
])) : createCommentVNode("", true)
|
|
5268
5824
|
])
|
|
@@ -5272,7 +5828,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
5272
5828
|
};
|
|
5273
5829
|
}
|
|
5274
5830
|
});
|
|
5275
|
-
const TaoDate = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-
|
|
5831
|
+
const TaoDate = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-97f71e11"]]);
|
|
5276
5832
|
const _hoisted_1$l = ["id", "aria-expanded", "aria-invalid", "aria-describedby", "disabled"];
|
|
5277
5833
|
const _hoisted_2$j = { class: "tao-date-range__value" };
|
|
5278
5834
|
const _hoisted_3$f = {
|
|
@@ -5298,20 +5854,23 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5298
5854
|
__name: "TaoDateRange",
|
|
5299
5855
|
props: {
|
|
5300
5856
|
modelValue: { default: null },
|
|
5301
|
-
placeholder: {
|
|
5857
|
+
placeholder: {},
|
|
5302
5858
|
disabled: { type: Boolean, default: false },
|
|
5859
|
+
size: {},
|
|
5303
5860
|
error: { type: Boolean, default: false },
|
|
5304
5861
|
min: { default: void 0 },
|
|
5305
5862
|
max: { default: void 0 },
|
|
5306
|
-
locale: {
|
|
5307
|
-
todayText: {
|
|
5308
|
-
clearText: {
|
|
5309
|
-
prevMonthLabel: {
|
|
5310
|
-
nextMonthLabel: {
|
|
5863
|
+
locale: {},
|
|
5864
|
+
todayText: {},
|
|
5865
|
+
clearText: {},
|
|
5866
|
+
prevMonthLabel: {},
|
|
5867
|
+
nextMonthLabel: {}
|
|
5311
5868
|
},
|
|
5312
5869
|
emits: ["update:modelValue", "change"],
|
|
5313
5870
|
setup(__props, { emit: __emit }) {
|
|
5314
5871
|
const props = __props;
|
|
5872
|
+
const l10n = useLocaleText(props, "dateRange");
|
|
5873
|
+
const dateLocale = computed(() => props.locale ?? taoLocale().code);
|
|
5315
5874
|
const emit = __emit;
|
|
5316
5875
|
const field = inject(formFieldKey, null);
|
|
5317
5876
|
const localId = useId();
|
|
@@ -5336,10 +5895,10 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5336
5895
|
return committed.value;
|
|
5337
5896
|
});
|
|
5338
5897
|
const displayLabel = computed(
|
|
5339
|
-
() => committed.value ? formatTaoDateRangeLabel(committed.value.start, committed.value.end,
|
|
5898
|
+
() => committed.value ? formatTaoDateRangeLabel(committed.value.start, committed.value.end, dateLocale.value) : ""
|
|
5340
5899
|
);
|
|
5341
|
-
const weekdays = computed(() => taoWeekdayLabels(
|
|
5342
|
-
const monthLabel = computed(() => formatTaoMonthLabel(viewYear.value, viewMonth.value,
|
|
5900
|
+
const weekdays = computed(() => taoWeekdayLabels(dateLocale.value));
|
|
5901
|
+
const monthLabel = computed(() => formatTaoMonthLabel(viewYear.value, viewMonth.value, dateLocale.value));
|
|
5343
5902
|
const cells = computed(() => buildTaoDateGrid(viewYear.value, viewMonth.value));
|
|
5344
5903
|
const todayIso = computed(() => todayTaoDate());
|
|
5345
5904
|
const todayEnabled = computed(() => isTaoDateInRange(todayIso.value, props.min, props.max));
|
|
@@ -5558,7 +6117,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5558
6117
|
});
|
|
5559
6118
|
return (_ctx, _cache) => {
|
|
5560
6119
|
return openBlock(), createElementBlock("div", {
|
|
5561
|
-
class: normalizeClass(["tao-date-range", { "tao-date-range--open": open.value, "tao-date-range--invalid": invalid.value }])
|
|
6120
|
+
class: normalizeClass(["tao-date-range", [unref(sizeClass)(__props.size), { "tao-date-range--open": open.value, "tao-date-range--invalid": invalid.value }]])
|
|
5562
6121
|
}, [
|
|
5563
6122
|
createElementVNode("button", {
|
|
5564
6123
|
id: controlId.value,
|
|
@@ -5576,7 +6135,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5576
6135
|
onClick: toggle,
|
|
5577
6136
|
onKeydown: onTriggerKeydown
|
|
5578
6137
|
}, [
|
|
5579
|
-
createElementVNode("span", _hoisted_2$j, toDisplayString(displayLabel.value ||
|
|
6138
|
+
createElementVNode("span", _hoisted_2$j, toDisplayString(displayLabel.value || unref(l10n).placeholder), 1),
|
|
5580
6139
|
createElementVNode("span", _hoisted_3$f, [
|
|
5581
6140
|
renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
5582
6141
|
_cache[3] || (_cache[3] = createElementVNode("svg", {
|
|
@@ -5623,7 +6182,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5623
6182
|
createElementVNode("button", {
|
|
5624
6183
|
type: "button",
|
|
5625
6184
|
class: "tao-date__nav",
|
|
5626
|
-
"aria-label":
|
|
6185
|
+
"aria-label": unref(l10n).prevMonthLabel,
|
|
5627
6186
|
onClick: _cache[0] || (_cache[0] = ($event) => goMonth(-1))
|
|
5628
6187
|
}, [
|
|
5629
6188
|
createElementVNode("span", _hoisted_7$8, [
|
|
@@ -5650,7 +6209,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5650
6209
|
createElementVNode("button", {
|
|
5651
6210
|
type: "button",
|
|
5652
6211
|
class: "tao-date__nav",
|
|
5653
|
-
"aria-label":
|
|
6212
|
+
"aria-label": unref(l10n).nextMonthLabel,
|
|
5654
6213
|
onClick: _cache[1] || (_cache[1] = ($event) => goMonth(1))
|
|
5655
6214
|
}, [
|
|
5656
6215
|
createElementVNode("span", _hoisted_10$2, [
|
|
@@ -5700,7 +6259,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5700
6259
|
"tao-date__day--disabled": !unref(isTaoDateInRange)(cell.iso, __props.min, __props.max)
|
|
5701
6260
|
}]),
|
|
5702
6261
|
role: "gridcell",
|
|
5703
|
-
"aria-label": unref(formatTaoDateLabel)(cell.iso,
|
|
6262
|
+
"aria-label": unref(formatTaoDateLabel)(cell.iso, dateLocale.value),
|
|
5704
6263
|
"aria-selected": daySelected(cell.iso),
|
|
5705
6264
|
disabled: !unref(isTaoDateInRange)(cell.iso, __props.min, __props.max),
|
|
5706
6265
|
onMousedown: _cache[2] || (_cache[2] = withModifiers(() => {
|
|
@@ -5718,7 +6277,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5718
6277
|
onClick: selectToday
|
|
5719
6278
|
}, [
|
|
5720
6279
|
renderSlot(_ctx.$slots, "today", {}, () => [
|
|
5721
|
-
createTextVNode(toDisplayString(
|
|
6280
|
+
createTextVNode(toDisplayString(unref(l10n).todayText), 1)
|
|
5722
6281
|
], true)
|
|
5723
6282
|
], 8, _hoisted_14),
|
|
5724
6283
|
committed.value ? (openBlock(), createElementBlock("button", {
|
|
@@ -5728,7 +6287,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5728
6287
|
onClick: clear
|
|
5729
6288
|
}, [
|
|
5730
6289
|
renderSlot(_ctx.$slots, "clear", {}, () => [
|
|
5731
|
-
createTextVNode(toDisplayString(
|
|
6290
|
+
createTextVNode(toDisplayString(unref(l10n).clearText), 1)
|
|
5732
6291
|
], true)
|
|
5733
6292
|
])) : createCommentVNode("", true)
|
|
5734
6293
|
])
|
|
@@ -5738,7 +6297,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
5738
6297
|
};
|
|
5739
6298
|
}
|
|
5740
6299
|
});
|
|
5741
|
-
const TaoDateRange = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-
|
|
6300
|
+
const TaoDateRange = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-da3794c7"]]);
|
|
5742
6301
|
const _hoisted_1$k = ["for"];
|
|
5743
6302
|
const _hoisted_2$i = ["id", "checked", "disabled", "aria-checked", "aria-invalid", "aria-describedby"];
|
|
5744
6303
|
const _hoisted_3$e = {
|
|
@@ -5755,7 +6314,9 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
5755
6314
|
props: {
|
|
5756
6315
|
modelValue: { type: Boolean, default: false },
|
|
5757
6316
|
label: { default: "" },
|
|
5758
|
-
disabled: { type: Boolean, default: false }
|
|
6317
|
+
disabled: { type: Boolean, default: false },
|
|
6318
|
+
error: { type: Boolean, default: false },
|
|
6319
|
+
size: {}
|
|
5759
6320
|
},
|
|
5760
6321
|
emits: ["update:modelValue", "change"],
|
|
5761
6322
|
setup(__props, { emit: __emit }) {
|
|
@@ -5764,7 +6325,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
5764
6325
|
const field = inject(formFieldKey, null);
|
|
5765
6326
|
const localId = useId();
|
|
5766
6327
|
const controlId = computed(() => (field == null ? void 0 : field.id) ?? localId);
|
|
5767
|
-
const invalid = computed(() => Boolean(field == null ? void 0 : field.invalid.value));
|
|
6328
|
+
const invalid = computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
5768
6329
|
const describedBy = computed(() => field == null ? void 0 : field.describedBy.value);
|
|
5769
6330
|
function toggle() {
|
|
5770
6331
|
if (props.disabled) {
|
|
@@ -5776,7 +6337,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
5776
6337
|
}
|
|
5777
6338
|
return (_ctx, _cache) => {
|
|
5778
6339
|
return openBlock(), createElementBlock("label", {
|
|
5779
|
-
class: normalizeClass(["tao-switch", { "tao-switch--disabled": __props.disabled, "tao-switch--on": __props.modelValue, "tao-switch--invalid": invalid.value }]),
|
|
6340
|
+
class: normalizeClass(["tao-switch", [unref(sizeClass)(__props.size), { "tao-switch--disabled": __props.disabled, "tao-switch--on": __props.modelValue, "tao-switch--invalid": invalid.value }]]),
|
|
5780
6341
|
for: controlId.value
|
|
5781
6342
|
}, [
|
|
5782
6343
|
createElementVNode("input", {
|
|
@@ -5804,7 +6365,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
5804
6365
|
};
|
|
5805
6366
|
}
|
|
5806
6367
|
});
|
|
5807
|
-
const TaoSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-
|
|
6368
|
+
const TaoSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-28965b34"]]);
|
|
5808
6369
|
const radioGroupKey = Symbol("taoRadioGroup");
|
|
5809
6370
|
const _hoisted_1$j = ["for"];
|
|
5810
6371
|
const _hoisted_2$h = ["id", "name", "value", "checked", "disabled", "aria-invalid", "aria-describedby"];
|
|
@@ -5824,7 +6385,9 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
5824
6385
|
modelValue: { type: [String, Number, Boolean] },
|
|
5825
6386
|
name: {},
|
|
5826
6387
|
label: { default: "" },
|
|
5827
|
-
disabled: { type: Boolean, default: false }
|
|
6388
|
+
disabled: { type: Boolean, default: false },
|
|
6389
|
+
error: { type: Boolean, default: false },
|
|
6390
|
+
size: {}
|
|
5828
6391
|
},
|
|
5829
6392
|
emits: ["update:modelValue", "change"],
|
|
5830
6393
|
setup(__props, { emit: __emit }) {
|
|
@@ -5834,13 +6397,13 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
5834
6397
|
const field = inject(formFieldKey, null);
|
|
5835
6398
|
const localId = useId();
|
|
5836
6399
|
const controlId = computed(() => group ? localId : (field == null ? void 0 : field.id) ?? localId);
|
|
5837
|
-
const invalid = computed(() => Boolean(field == null ? void 0 : field.invalid.value));
|
|
6400
|
+
const invalid = computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
5838
6401
|
const describedBy = computed(() => group ? void 0 : field == null ? void 0 : field.describedBy.value);
|
|
5839
6402
|
const isDisabled = computed(() => props.disabled || Boolean(group == null ? void 0 : group.disabled.value));
|
|
5840
6403
|
const inputName = computed(() => (group == null ? void 0 : group.name.value) ?? props.name);
|
|
5841
6404
|
const isChecked = computed(() => {
|
|
5842
|
-
const
|
|
5843
|
-
return
|
|
6405
|
+
const current2 = group ? group.model.value : props.modelValue;
|
|
6406
|
+
return current2 === props.value;
|
|
5844
6407
|
});
|
|
5845
6408
|
function onChange() {
|
|
5846
6409
|
if (isDisabled.value) {
|
|
@@ -5855,7 +6418,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
5855
6418
|
}
|
|
5856
6419
|
return (_ctx, _cache) => {
|
|
5857
6420
|
return openBlock(), createElementBlock("label", {
|
|
5858
|
-
class: normalizeClass(["tao-radio", { "tao-radio--disabled": isDisabled.value, "tao-radio--invalid": invalid.value && !unref(group) }]),
|
|
6421
|
+
class: normalizeClass(["tao-radio", [unref(sizeClass)(__props.size), { "tao-radio--disabled": isDisabled.value, "tao-radio--invalid": invalid.value && !unref(group) }]]),
|
|
5859
6422
|
for: controlId.value
|
|
5860
6423
|
}, [
|
|
5861
6424
|
createElementVNode("input", {
|
|
@@ -5881,7 +6444,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
5881
6444
|
};
|
|
5882
6445
|
}
|
|
5883
6446
|
});
|
|
5884
|
-
const TaoRadio = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-
|
|
6447
|
+
const TaoRadio = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-70ac1c11"]]);
|
|
5885
6448
|
const _hoisted_1$i = ["id", "disabled", "aria-describedby", "aria-invalid", "aria-labelledby"];
|
|
5886
6449
|
const _hoisted_2$g = {
|
|
5887
6450
|
key: 0,
|
|
@@ -5895,7 +6458,9 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
5895
6458
|
name: {},
|
|
5896
6459
|
legend: {},
|
|
5897
6460
|
disabled: { type: Boolean, default: false },
|
|
5898
|
-
|
|
6461
|
+
error: { type: Boolean, default: false },
|
|
6462
|
+
direction: { default: "row" },
|
|
6463
|
+
size: {}
|
|
5899
6464
|
},
|
|
5900
6465
|
emits: ["update:modelValue", "change"],
|
|
5901
6466
|
setup(__props, { emit: __emit }) {
|
|
@@ -5906,7 +6471,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
5906
6471
|
const groupName = computed(() => props.name || autoName);
|
|
5907
6472
|
const model = computed(() => props.modelValue);
|
|
5908
6473
|
const groupDisabled = computed(() => props.disabled);
|
|
5909
|
-
const invalid = computed(() => Boolean(field == null ? void 0 : field.invalid.value));
|
|
6474
|
+
const invalid = computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
5910
6475
|
const describedBy = computed(() => field == null ? void 0 : field.describedBy.value);
|
|
5911
6476
|
const labelledBy = computed(() => props.legend || !field ? void 0 : `${field.id}-label`);
|
|
5912
6477
|
function setValue(value) {
|
|
@@ -5923,7 +6488,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
5923
6488
|
var _a;
|
|
5924
6489
|
return openBlock(), createElementBlock("fieldset", {
|
|
5925
6490
|
id: (_a = unref(field)) == null ? void 0 : _a.id,
|
|
5926
|
-
class: normalizeClass(["tao-radio-group", [`tao-radio-group--${__props.direction}`, { "tao-radio-group--invalid": invalid.value }]]),
|
|
6491
|
+
class: normalizeClass(["tao-radio-group", [`tao-radio-group--${__props.direction}`, unref(sizeClass)(__props.size), { "tao-radio-group--invalid": invalid.value }]]),
|
|
5927
6492
|
disabled: __props.disabled,
|
|
5928
6493
|
"aria-describedby": describedBy.value,
|
|
5929
6494
|
"aria-invalid": invalid.value || void 0,
|
|
@@ -5935,7 +6500,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
5935
6500
|
};
|
|
5936
6501
|
}
|
|
5937
6502
|
});
|
|
5938
|
-
const TaoRadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-
|
|
6503
|
+
const TaoRadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-c76ef504"]]);
|
|
5939
6504
|
const segmentedKey = Symbol("taoSegmented");
|
|
5940
6505
|
const _hoisted_1$h = ["disabled", "aria-describedby", "aria-invalid", "aria-labelledby", "id"];
|
|
5941
6506
|
const _hoisted_2$f = {
|
|
@@ -5950,7 +6515,8 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
5950
6515
|
name: {},
|
|
5951
6516
|
legend: {},
|
|
5952
6517
|
disabled: { type: Boolean, default: false },
|
|
5953
|
-
|
|
6518
|
+
error: { type: Boolean, default: false },
|
|
6519
|
+
size: {},
|
|
5954
6520
|
block: { type: Boolean, default: false }
|
|
5955
6521
|
},
|
|
5956
6522
|
emits: ["update:modelValue", "change"],
|
|
@@ -5962,8 +6528,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
5962
6528
|
const groupName = computed(() => props.name || autoName);
|
|
5963
6529
|
const model = computed(() => props.modelValue);
|
|
5964
6530
|
const groupDisabled = computed(() => props.disabled);
|
|
5965
|
-
const
|
|
5966
|
-
const invalid = computed(() => Boolean(field == null ? void 0 : field.invalid.value));
|
|
6531
|
+
const invalid = computed(() => props.error || Boolean(field == null ? void 0 : field.invalid.value));
|
|
5967
6532
|
const describedBy = computed(() => field == null ? void 0 : field.describedBy.value);
|
|
5968
6533
|
const trackRef = ref(null);
|
|
5969
6534
|
const thumbStyle = ref({ opacity: "0" });
|
|
@@ -6003,7 +6568,6 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
6003
6568
|
name: groupName,
|
|
6004
6569
|
model,
|
|
6005
6570
|
disabled: groupDisabled,
|
|
6006
|
-
size: groupSize,
|
|
6007
6571
|
setValue
|
|
6008
6572
|
});
|
|
6009
6573
|
onMounted(() => {
|
|
@@ -6040,7 +6604,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
6040
6604
|
var _a;
|
|
6041
6605
|
return openBlock(), createElementBlock("fieldset", {
|
|
6042
6606
|
class: normalizeClass(["tao-segmented", [
|
|
6043
|
-
|
|
6607
|
+
unref(sizeClass)(__props.size),
|
|
6044
6608
|
{
|
|
6045
6609
|
"tao-segmented--block": __props.block,
|
|
6046
6610
|
"tao-segmented--disabled": __props.disabled,
|
|
@@ -6070,7 +6634,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
6070
6634
|
};
|
|
6071
6635
|
}
|
|
6072
6636
|
});
|
|
6073
|
-
const TaoSegmented = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-
|
|
6637
|
+
const TaoSegmented = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-7dc6820f"]]);
|
|
6074
6638
|
const _hoisted_1$g = ["for"];
|
|
6075
6639
|
const _hoisted_2$e = ["id", "name", "value", "checked", "disabled", "aria-label"];
|
|
6076
6640
|
const _hoisted_3$c = { class: "tao-segmented-option__face" };
|
|
@@ -6113,10 +6677,9 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
6113
6677
|
const localId = useId();
|
|
6114
6678
|
const isDisabled = computed(() => props.disabled || Boolean(group == null ? void 0 : group.disabled.value));
|
|
6115
6679
|
const inputName = computed(() => (group == null ? void 0 : group.name.value) ?? props.name);
|
|
6116
|
-
const size = computed(() => (group == null ? void 0 : group.size.value) ?? "medium");
|
|
6117
6680
|
const isChecked = computed(() => {
|
|
6118
|
-
const
|
|
6119
|
-
return
|
|
6681
|
+
const current2 = group ? group.model.value : props.modelValue;
|
|
6682
|
+
return current2 === props.value;
|
|
6120
6683
|
});
|
|
6121
6684
|
const hasLabel = computed(() => Boolean(props.label || slots.default));
|
|
6122
6685
|
const isIconOnly = computed(() => Boolean((props.icon || slots.icon) && !hasLabel.value));
|
|
@@ -6145,14 +6708,11 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
6145
6708
|
}
|
|
6146
6709
|
return (_ctx, _cache) => {
|
|
6147
6710
|
return openBlock(), createElementBlock("label", {
|
|
6148
|
-
class: normalizeClass(["tao-segmented-option",
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
"tao-segmented-option--icon-only": isIconOnly.value
|
|
6154
|
-
}
|
|
6155
|
-
]]),
|
|
6711
|
+
class: normalizeClass(["tao-segmented-option", {
|
|
6712
|
+
"tao-segmented-option--checked": isChecked.value,
|
|
6713
|
+
"tao-segmented-option--disabled": props.disabled,
|
|
6714
|
+
"tao-segmented-option--icon-only": isIconOnly.value
|
|
6715
|
+
}]),
|
|
6156
6716
|
for: unref(localId)
|
|
6157
6717
|
}, [
|
|
6158
6718
|
createElementVNode("input", {
|
|
@@ -6183,7 +6743,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
6183
6743
|
};
|
|
6184
6744
|
}
|
|
6185
6745
|
});
|
|
6186
|
-
const TaoSegmentedOption = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-
|
|
6746
|
+
const TaoSegmentedOption = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-fba7ca12"]]);
|
|
6187
6747
|
const _hoisted_1$f = ["role", "aria-live"];
|
|
6188
6748
|
const _hoisted_2$d = { class: "tao-alert__body" };
|
|
6189
6749
|
const _hoisted_3$b = {
|
|
@@ -6200,21 +6760,31 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
6200
6760
|
...{ name: "TaoAlert" },
|
|
6201
6761
|
__name: "TaoAlert",
|
|
6202
6762
|
props: {
|
|
6203
|
-
|
|
6763
|
+
tone: { default: void 0 },
|
|
6764
|
+
type: { default: void 0 },
|
|
6204
6765
|
title: { default: "" },
|
|
6205
6766
|
closable: { type: Boolean, default: false },
|
|
6206
|
-
closeLabel: {
|
|
6767
|
+
closeLabel: {}
|
|
6207
6768
|
},
|
|
6208
6769
|
emits: ["close"],
|
|
6209
6770
|
setup(__props, { emit: __emit }) {
|
|
6210
6771
|
const props = __props;
|
|
6772
|
+
const l10n = useLocaleText(props, "alert");
|
|
6211
6773
|
const emit = __emit;
|
|
6212
|
-
const
|
|
6213
|
-
|
|
6774
|
+
const resolvedTone = computed(() => {
|
|
6775
|
+
const value = props.tone ?? props.type ?? "info";
|
|
6776
|
+
return value === "danger" ? "error" : value;
|
|
6777
|
+
});
|
|
6778
|
+
const live = computed(
|
|
6779
|
+
() => resolvedTone.value === "error" || resolvedTone.value === "warning" ? "assertive" : "polite"
|
|
6780
|
+
);
|
|
6781
|
+
warnDeprecated("TaoAlert", {
|
|
6782
|
+
type: "use `tone`"
|
|
6783
|
+
});
|
|
6214
6784
|
return (_ctx, _cache) => {
|
|
6215
6785
|
return openBlock(), createElementBlock("div", {
|
|
6216
|
-
class: normalizeClass(["tao-alert", `tao-alert--${
|
|
6217
|
-
role:
|
|
6786
|
+
class: normalizeClass(["tao-alert", `tao-alert--${resolvedTone.value}`]),
|
|
6787
|
+
role: resolvedTone.value === "error" ? "alert" : "status",
|
|
6218
6788
|
"aria-live": live.value
|
|
6219
6789
|
}, [
|
|
6220
6790
|
createElementVNode("div", _hoisted_2$d, [
|
|
@@ -6227,7 +6797,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
6227
6797
|
key: 0,
|
|
6228
6798
|
type: "button",
|
|
6229
6799
|
class: "tao-alert__close",
|
|
6230
|
-
"aria-label":
|
|
6800
|
+
"aria-label": unref(l10n).closeLabel,
|
|
6231
6801
|
onClick: _cache[0] || (_cache[0] = ($event) => emit("close"))
|
|
6232
6802
|
}, [
|
|
6233
6803
|
createElementVNode("span", _hoisted_6$8, [
|
|
@@ -6240,7 +6810,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
6240
6810
|
};
|
|
6241
6811
|
}
|
|
6242
6812
|
});
|
|
6243
|
-
const TaoAlert = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-
|
|
6813
|
+
const TaoAlert = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-94376652"]]);
|
|
6244
6814
|
const _hoisted_1$e = { key: 0 };
|
|
6245
6815
|
const _hoisted_2$c = ["aria-sort"];
|
|
6246
6816
|
const _hoisted_3$a = ["onClick"];
|
|
@@ -6261,8 +6831,9 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
6261
6831
|
rows: { default: () => [] },
|
|
6262
6832
|
rowKey: { type: [String, Function], default: "id" },
|
|
6263
6833
|
loading: { type: Boolean, default: false },
|
|
6264
|
-
emptyText: {
|
|
6834
|
+
emptyText: {},
|
|
6265
6835
|
striped: { type: [Boolean, String], default: false },
|
|
6836
|
+
size: {},
|
|
6266
6837
|
compact: { type: Boolean, default: false },
|
|
6267
6838
|
hover: { type: Boolean, default: true },
|
|
6268
6839
|
head: { type: Boolean, default: true },
|
|
@@ -6273,9 +6844,10 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
6273
6844
|
sort: { default: null },
|
|
6274
6845
|
caption: { default: "" }
|
|
6275
6846
|
},
|
|
6276
|
-
emits: ["update:sort", "sort", "row-click"],
|
|
6847
|
+
emits: ["update:sort", "change", "sort", "row-click"],
|
|
6277
6848
|
setup(__props, { emit: __emit }) {
|
|
6278
6849
|
const props = __props;
|
|
6850
|
+
const l10n = useLocaleText(props, "table");
|
|
6279
6851
|
const emit = __emit;
|
|
6280
6852
|
const colCount = computed(() => Math.max(props.columns.length, 1));
|
|
6281
6853
|
const isEmpty = computed(() => !props.rows.length && !props.loading);
|
|
@@ -6317,9 +6889,10 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
6317
6889
|
if (!column.sortable) {
|
|
6318
6890
|
return;
|
|
6319
6891
|
}
|
|
6320
|
-
const
|
|
6321
|
-
const next =
|
|
6892
|
+
const current2 = sortDir(column);
|
|
6893
|
+
const next = current2 == null ? { key: column.key, dir: "asc" } : current2 === "asc" ? { key: column.key, dir: "desc" } : null;
|
|
6322
6894
|
emit("update:sort", next);
|
|
6895
|
+
emit("change", next);
|
|
6323
6896
|
emit("sort", next);
|
|
6324
6897
|
}
|
|
6325
6898
|
function onRowClick(row, index) {
|
|
@@ -6328,19 +6901,25 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
6328
6901
|
}
|
|
6329
6902
|
emit("row-click", row, index);
|
|
6330
6903
|
}
|
|
6904
|
+
warnDeprecated("TaoTable", {
|
|
6905
|
+
compact: 'use size="small"',
|
|
6906
|
+
onSort: 'listen to "change" (or v-model:sort)'
|
|
6907
|
+
});
|
|
6331
6908
|
return (_ctx, _cache) => {
|
|
6332
6909
|
return openBlock(), createElementBlock("div", {
|
|
6333
|
-
class: normalizeClass(["tao-table-wrap",
|
|
6334
|
-
"
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6910
|
+
class: normalizeClass(["tao-table-wrap", [
|
|
6911
|
+
unref(sizeClass)(__props.size ?? (__props.compact ? "small" : void 0)),
|
|
6912
|
+
{
|
|
6913
|
+
"tao-table-wrap--sticky": __props.sticky,
|
|
6914
|
+
"tao-table-wrap--loading": __props.loading
|
|
6915
|
+
}
|
|
6916
|
+
]]),
|
|
6917
|
+
style: normalizeStyle(__props.maxHeight ? { maxHeight: unref(toCssLength)(__props.maxHeight) } : void 0)
|
|
6338
6918
|
}, [
|
|
6339
6919
|
createElementVNode("table", {
|
|
6340
6920
|
class: normalizeClass(["tao-table", {
|
|
6341
6921
|
"tao-table--striped": stripeFrom.value === "odd",
|
|
6342
6922
|
"tao-table--striped-even": stripeFrom.value === "even",
|
|
6343
|
-
"tao-table--compact": __props.compact,
|
|
6344
6923
|
"tao-table--hover": __props.hover,
|
|
6345
6924
|
"tao-table--head": __props.head,
|
|
6346
6925
|
"tao-table--lines": __props.lines,
|
|
@@ -6384,7 +6963,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
6384
6963
|
colspan: colCount.value
|
|
6385
6964
|
}, [
|
|
6386
6965
|
renderSlot(_ctx.$slots, "empty", {}, () => [
|
|
6387
|
-
createTextVNode(toDisplayString(
|
|
6966
|
+
createTextVNode(toDisplayString(unref(l10n).emptyText), 1)
|
|
6388
6967
|
], true)
|
|
6389
6968
|
], 8, _hoisted_6$7)
|
|
6390
6969
|
])) : createCommentVNode("", true),
|
|
@@ -6428,7 +7007,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
6428
7007
|
};
|
|
6429
7008
|
}
|
|
6430
7009
|
});
|
|
6431
|
-
const TaoTable = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-
|
|
7010
|
+
const TaoTable = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-3b34cb39"]]);
|
|
6432
7011
|
function buildPaginationItems(page, pageCount, siblingCount = 1) {
|
|
6433
7012
|
if (pageCount <= 0) {
|
|
6434
7013
|
return [];
|
|
@@ -6436,10 +7015,10 @@ function buildPaginationItems(page, pageCount, siblingCount = 1) {
|
|
|
6436
7015
|
if (pageCount <= 7) {
|
|
6437
7016
|
return Array.from({ length: pageCount }, (_, index) => ({ type: "page", page: index + 1 }));
|
|
6438
7017
|
}
|
|
6439
|
-
const
|
|
7018
|
+
const current2 = Math.min(Math.max(page, 1), pageCount);
|
|
6440
7019
|
const siblings = Math.max(0, siblingCount);
|
|
6441
|
-
const left = Math.max(2,
|
|
6442
|
-
const right = Math.min(pageCount - 1,
|
|
7020
|
+
const left = Math.max(2, current2 - siblings);
|
|
7021
|
+
const right = Math.min(pageCount - 1, current2 + siblings);
|
|
6443
7022
|
const items = [{ type: "page", page: 1 }];
|
|
6444
7023
|
if (left > 2) {
|
|
6445
7024
|
items.push({ type: "ellipsis", id: "left" });
|
|
@@ -6480,24 +7059,25 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
6480
7059
|
siblingCount: { default: 1 },
|
|
6481
7060
|
disabled: { type: Boolean, default: false },
|
|
6482
7061
|
showTotal: { type: Boolean, default: true },
|
|
6483
|
-
size: {
|
|
7062
|
+
size: {},
|
|
6484
7063
|
jump: { default: 5 },
|
|
6485
|
-
ariaLabel: {
|
|
6486
|
-
prevLabel: {
|
|
6487
|
-
nextLabel: {
|
|
6488
|
-
pageLabel: {
|
|
6489
|
-
jumpPrevLabel: {
|
|
6490
|
-
jumpNextLabel: {
|
|
7064
|
+
ariaLabel: {},
|
|
7065
|
+
prevLabel: {},
|
|
7066
|
+
nextLabel: {},
|
|
7067
|
+
pageLabel: {},
|
|
7068
|
+
jumpPrevLabel: {},
|
|
7069
|
+
jumpNextLabel: {}
|
|
6491
7070
|
},
|
|
6492
7071
|
emits: ["update:page", "change"],
|
|
6493
7072
|
setup(__props, { emit: __emit }) {
|
|
6494
7073
|
const props = __props;
|
|
7074
|
+
const l10n = useLocaleText(props, "pagination");
|
|
6495
7075
|
const emit = __emit;
|
|
6496
7076
|
const pageCount = computed(() => Math.max(1, Math.ceil(Math.max(props.total, 0) / Math.max(props.pageSize, 1))));
|
|
6497
|
-
const
|
|
6498
|
-
const items = computed(() => buildPaginationItems(
|
|
6499
|
-
const from = computed(() => props.total === 0 ? 0 : (
|
|
6500
|
-
const to = computed(() => Math.min(
|
|
7077
|
+
const current2 = computed(() => Math.min(Math.max(props.page, 1), pageCount.value));
|
|
7078
|
+
const items = computed(() => buildPaginationItems(current2.value, pageCount.value, props.siblingCount));
|
|
7079
|
+
const from = computed(() => props.total === 0 ? 0 : (current2.value - 1) * props.pageSize + 1);
|
|
7080
|
+
const to = computed(() => Math.min(current2.value * props.pageSize, props.total));
|
|
6501
7081
|
watch(
|
|
6502
7082
|
() => [props.page, pageCount.value],
|
|
6503
7083
|
([page, count]) => {
|
|
@@ -6520,8 +7100,8 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
6520
7100
|
}
|
|
6521
7101
|
return (_ctx, _cache) => {
|
|
6522
7102
|
return openBlock(), createElementBlock("nav", {
|
|
6523
|
-
class: normalizeClass(["tao-pagination",
|
|
6524
|
-
"aria-label":
|
|
7103
|
+
class: normalizeClass(["tao-pagination", unref(sizeClass)(__props.size)]),
|
|
7104
|
+
"aria-label": unref(l10n).ariaLabel
|
|
6525
7105
|
}, [
|
|
6526
7106
|
__props.showTotal ? (openBlock(), createElementBlock("p", _hoisted_2$b, [
|
|
6527
7107
|
renderSlot(_ctx.$slots, "total", {
|
|
@@ -6530,9 +7110,9 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
6530
7110
|
total: __props.total
|
|
6531
7111
|
}, () => [
|
|
6532
7112
|
__props.total === 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
6533
|
-
createTextVNode(
|
|
7113
|
+
createTextVNode(toDisplayString(unref(taoLocale)().pagination.emptyTotalText), 1)
|
|
6534
7114
|
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
6535
|
-
createTextVNode(toDisplayString(
|
|
7115
|
+
createTextVNode(toDisplayString(unref(formatText)(unref(taoLocale)().pagination.totalText, { from: from.value, to: to.value, total: __props.total })), 1)
|
|
6536
7116
|
], 64))
|
|
6537
7117
|
], true)
|
|
6538
7118
|
])) : createCommentVNode("", true),
|
|
@@ -6540,9 +7120,9 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
6540
7120
|
createElementVNode("button", {
|
|
6541
7121
|
type: "button",
|
|
6542
7122
|
class: "tao-pagination__btn",
|
|
6543
|
-
"aria-label":
|
|
6544
|
-
disabled: __props.disabled ||
|
|
6545
|
-
onClick: _cache[0] || (_cache[0] = ($event) => goTo(
|
|
7123
|
+
"aria-label": unref(l10n).prevLabel,
|
|
7124
|
+
disabled: __props.disabled || current2.value <= 1,
|
|
7125
|
+
onClick: _cache[0] || (_cache[0] = ($event) => goTo(current2.value - 1))
|
|
6546
7126
|
}, [
|
|
6547
7127
|
createElementVNode("span", _hoisted_5$9, [
|
|
6548
7128
|
renderSlot(_ctx.$slots, "prev-icon", {}, () => [
|
|
@@ -6558,15 +7138,15 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
6558
7138
|
key: 0,
|
|
6559
7139
|
type: "button",
|
|
6560
7140
|
class: "tao-pagination__btn tao-pagination__btn--jump",
|
|
6561
|
-
"aria-label": item.id === "left" ?
|
|
7141
|
+
"aria-label": item.id === "left" ? unref(l10n).jumpPrevLabel.replace("{n}", String(__props.jump)) : unref(l10n).jumpNextLabel.replace("{n}", String(__props.jump)),
|
|
6562
7142
|
disabled: __props.disabled,
|
|
6563
|
-
onClick: ($event) => goTo(item.id === "left" ?
|
|
7143
|
+
onClick: ($event) => goTo(item.id === "left" ? current2.value - __props.jump : current2.value + __props.jump)
|
|
6564
7144
|
}, " … ", 8, _hoisted_6$6)) : item.type === "ellipsis" ? (openBlock(), createElementBlock("span", _hoisted_7$5, "…")) : (openBlock(), createElementBlock("button", {
|
|
6565
7145
|
key: 2,
|
|
6566
7146
|
type: "button",
|
|
6567
|
-
class: normalizeClass(["tao-pagination__btn", { "tao-pagination__btn--current": item.page ===
|
|
6568
|
-
"aria-current": item.page ===
|
|
6569
|
-
"aria-label":
|
|
7147
|
+
class: normalizeClass(["tao-pagination__btn", { "tao-pagination__btn--current": item.page === current2.value }]),
|
|
7148
|
+
"aria-current": item.page === current2.value ? "page" : void 0,
|
|
7149
|
+
"aria-label": unref(l10n).pageLabel.replace("{page}", String(item.page)),
|
|
6570
7150
|
disabled: __props.disabled,
|
|
6571
7151
|
onClick: ($event) => goTo(item.page)
|
|
6572
7152
|
}, toDisplayString(item.page), 11, _hoisted_8$5))
|
|
@@ -6575,9 +7155,9 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
6575
7155
|
createElementVNode("button", {
|
|
6576
7156
|
type: "button",
|
|
6577
7157
|
class: "tao-pagination__btn",
|
|
6578
|
-
"aria-label":
|
|
6579
|
-
disabled: __props.disabled ||
|
|
6580
|
-
onClick: _cache[1] || (_cache[1] = ($event) => goTo(
|
|
7158
|
+
"aria-label": unref(l10n).nextLabel,
|
|
7159
|
+
disabled: __props.disabled || current2.value >= pageCount.value,
|
|
7160
|
+
onClick: _cache[1] || (_cache[1] = ($event) => goTo(current2.value + 1))
|
|
6581
7161
|
}, [
|
|
6582
7162
|
createElementVNode("span", _hoisted_10$1, [
|
|
6583
7163
|
renderSlot(_ctx.$slots, "next-icon", {}, () => [
|
|
@@ -6590,7 +7170,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
6590
7170
|
};
|
|
6591
7171
|
}
|
|
6592
7172
|
});
|
|
6593
|
-
const TaoPagination = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-
|
|
7173
|
+
const TaoPagination = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-7e381e8c"]]);
|
|
6594
7174
|
const _hoisted_1$c = { class: "tao-empty" };
|
|
6595
7175
|
const _hoisted_2$a = {
|
|
6596
7176
|
key: 0,
|
|
@@ -6612,15 +7192,17 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
6612
7192
|
...{ name: "TaoEmpty" },
|
|
6613
7193
|
__name: "TaoEmpty",
|
|
6614
7194
|
props: {
|
|
6615
|
-
title: {
|
|
7195
|
+
title: {}
|
|
6616
7196
|
},
|
|
6617
7197
|
setup(__props) {
|
|
7198
|
+
const props = __props;
|
|
7199
|
+
const l10n = useLocaleText(props, "empty");
|
|
6618
7200
|
return (_ctx, _cache) => {
|
|
6619
7201
|
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
6620
7202
|
_ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_2$a, [
|
|
6621
7203
|
renderSlot(_ctx.$slots, "icon", {}, void 0, true)
|
|
6622
7204
|
])) : createCommentVNode("", true),
|
|
6623
|
-
|
|
7205
|
+
unref(l10n).title ? (openBlock(), createElementBlock("p", _hoisted_3$8, toDisplayString(unref(l10n).title), 1)) : createCommentVNode("", true),
|
|
6624
7206
|
_ctx.$slots.default ? (openBlock(), createElementBlock("p", _hoisted_4$8, [
|
|
6625
7207
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
6626
7208
|
])) : createCommentVNode("", true),
|
|
@@ -6631,8 +7213,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
6631
7213
|
};
|
|
6632
7214
|
}
|
|
6633
7215
|
});
|
|
6634
|
-
const TaoEmpty = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-
|
|
6635
|
-
const taoListKey = Symbol("taoList");
|
|
7216
|
+
const TaoEmpty = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-7d3efeaf"]]);
|
|
6636
7217
|
const _hoisted_1$b = ["aria-label"];
|
|
6637
7218
|
const _hoisted_2$9 = {
|
|
6638
7219
|
key: 0,
|
|
@@ -6642,7 +7223,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
6642
7223
|
...{ name: "TaoList" },
|
|
6643
7224
|
__name: "TaoList",
|
|
6644
7225
|
props: {
|
|
6645
|
-
size: {
|
|
7226
|
+
size: {},
|
|
6646
7227
|
bordered: { type: Boolean, default: true },
|
|
6647
7228
|
divided: { type: Boolean, default: true },
|
|
6648
7229
|
maxHeight: {},
|
|
@@ -6651,19 +7232,14 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
6651
7232
|
},
|
|
6652
7233
|
setup(__props) {
|
|
6653
7234
|
const props = __props;
|
|
6654
|
-
const size = computed(() => props.size);
|
|
6655
|
-
provide(taoListKey, { size });
|
|
6656
7235
|
const listStyle = computed(() => {
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
}
|
|
6660
|
-
const value = typeof props.maxHeight === "number" ? `${props.maxHeight}px` : props.maxHeight;
|
|
6661
|
-
return { maxHeight: value };
|
|
7236
|
+
const value = toCssLength(props.maxHeight);
|
|
7237
|
+
return value ? { maxHeight: value } : void 0;
|
|
6662
7238
|
});
|
|
6663
7239
|
return (_ctx, _cache) => {
|
|
6664
7240
|
return openBlock(), createElementBlock("ul", {
|
|
6665
7241
|
class: normalizeClass(["tao-list", [
|
|
6666
|
-
|
|
7242
|
+
unref(sizeClass)(__props.size),
|
|
6667
7243
|
{
|
|
6668
7244
|
"tao-list--bordered": __props.bordered,
|
|
6669
7245
|
"tao-list--divided": __props.divided,
|
|
@@ -6677,14 +7253,14 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
6677
7253
|
}, [
|
|
6678
7254
|
__props.empty ? (openBlock(), createElementBlock("li", _hoisted_2$9, [
|
|
6679
7255
|
renderSlot(_ctx.$slots, "empty", {}, () => [
|
|
6680
|
-
|
|
7256
|
+
createTextVNode(toDisplayString(unref(taoLocale)().list.emptyText), 1)
|
|
6681
7257
|
], true)
|
|
6682
7258
|
])) : renderSlot(_ctx.$slots, "default", {}, void 0, true, 1)
|
|
6683
7259
|
], 14, _hoisted_1$b);
|
|
6684
7260
|
};
|
|
6685
7261
|
}
|
|
6686
7262
|
});
|
|
6687
|
-
const TaoList = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-
|
|
7263
|
+
const TaoList = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-183f5d21"]]);
|
|
6688
7264
|
const _hoisted_1$a = ["aria-current", "aria-disabled"];
|
|
6689
7265
|
const _hoisted_2$8 = {
|
|
6690
7266
|
key: 0,
|
|
@@ -6718,17 +7294,6 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
6718
7294
|
const props = __props;
|
|
6719
7295
|
const emit = __emit;
|
|
6720
7296
|
const slots = useSlots();
|
|
6721
|
-
const list = inject(taoListKey, null);
|
|
6722
|
-
const sizeClass = computed(() => {
|
|
6723
|
-
const size = props.size ?? (list == null ? void 0 : list.size.value) ?? "medium";
|
|
6724
|
-
if (size === "small") {
|
|
6725
|
-
return "s";
|
|
6726
|
-
}
|
|
6727
|
-
if (size === "large") {
|
|
6728
|
-
return "l";
|
|
6729
|
-
}
|
|
6730
|
-
return "m";
|
|
6731
|
-
});
|
|
6732
7297
|
const hasAction = computed(() => Boolean(slots.action));
|
|
6733
7298
|
const hasPrefix = computed(() => Boolean(slots.prefix));
|
|
6734
7299
|
const hasSuffix = computed(() => Boolean(slots.suffix));
|
|
@@ -6742,7 +7307,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
6742
7307
|
return (_ctx, _cache) => {
|
|
6743
7308
|
return openBlock(), createElementBlock("li", {
|
|
6744
7309
|
class: normalizeClass(["tao-list-item", [
|
|
6745
|
-
|
|
7310
|
+
unref(sizeClass)(__props.size),
|
|
6746
7311
|
{
|
|
6747
7312
|
"tao-list-item--selected": __props.selected,
|
|
6748
7313
|
"tao-list-item--disabled": __props.disabled,
|
|
@@ -6798,7 +7363,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
6798
7363
|
};
|
|
6799
7364
|
}
|
|
6800
7365
|
});
|
|
6801
|
-
const TaoListItem = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-
|
|
7366
|
+
const TaoListItem = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-215a8394"]]);
|
|
6802
7367
|
const _hoisted_1$9 = {
|
|
6803
7368
|
class: "tao-skeleton-group",
|
|
6804
7369
|
"aria-hidden": true
|
|
@@ -6851,11 +7416,12 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
6851
7416
|
title: { default: "" },
|
|
6852
7417
|
side: { default: "right" },
|
|
6853
7418
|
closable: { type: Boolean, default: true },
|
|
6854
|
-
closeLabel: {
|
|
7419
|
+
closeLabel: {}
|
|
6855
7420
|
},
|
|
6856
7421
|
emits: ["update:modelValue", "close"],
|
|
6857
7422
|
setup(__props, { emit: __emit }) {
|
|
6858
7423
|
const props = __props;
|
|
7424
|
+
const l10n = useLocaleText(props, "drawer");
|
|
6859
7425
|
const emit = __emit;
|
|
6860
7426
|
const panelRef = ref(null);
|
|
6861
7427
|
const titleId = useId();
|
|
@@ -6964,7 +7530,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
6964
7530
|
key: 2,
|
|
6965
7531
|
type: "button",
|
|
6966
7532
|
class: "tao-drawer__close",
|
|
6967
|
-
"aria-label":
|
|
7533
|
+
"aria-label": unref(l10n).closeLabel,
|
|
6968
7534
|
onClick: close
|
|
6969
7535
|
}, [
|
|
6970
7536
|
createElementVNode("span", _hoisted_6$4, [
|
|
@@ -6989,7 +7555,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
6989
7555
|
};
|
|
6990
7556
|
}
|
|
6991
7557
|
});
|
|
6992
|
-
const TaoDrawer = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-
|
|
7558
|
+
const TaoDrawer = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-886b5507"]]);
|
|
6993
7559
|
const _hoisted_1$7 = ["title"];
|
|
6994
7560
|
const _hoisted_2$6 = { class: "tao-avatar__face" };
|
|
6995
7561
|
const _hoisted_3$5 = ["src", "alt"];
|
|
@@ -7009,13 +7575,14 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
7009
7575
|
size: { default: "medium" },
|
|
7010
7576
|
dot: { type: [Boolean, String], default: false },
|
|
7011
7577
|
count: { default: void 0 },
|
|
7012
|
-
fallbackLabel: {
|
|
7013
|
-
notificationsLabel: {
|
|
7578
|
+
fallbackLabel: {},
|
|
7579
|
+
notificationsLabel: {},
|
|
7014
7580
|
dotLabels: { default: () => ({}) }
|
|
7015
7581
|
},
|
|
7016
7582
|
setup(__props) {
|
|
7017
7583
|
const props = __props;
|
|
7018
|
-
const
|
|
7584
|
+
const l10n = useLocaleText(props, "avatar");
|
|
7585
|
+
const sizeClass2 = computed(() => {
|
|
7019
7586
|
if (props.size === "small" || props.size === "s") {
|
|
7020
7587
|
return "s";
|
|
7021
7588
|
}
|
|
@@ -7056,21 +7623,14 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
7056
7623
|
}
|
|
7057
7624
|
return String(props.count);
|
|
7058
7625
|
});
|
|
7059
|
-
const defaultDotLabel = {
|
|
7060
|
-
success: "в сети",
|
|
7061
|
-
danger: "занят",
|
|
7062
|
-
warning: "отошёл",
|
|
7063
|
-
info: "статус",
|
|
7064
|
-
neutral: "не в сети"
|
|
7065
|
-
};
|
|
7066
7626
|
const label = computed(() => {
|
|
7067
|
-
const base = props.alt || props.name ||
|
|
7627
|
+
const base = props.alt || props.name || l10n.value.fallbackLabel;
|
|
7068
7628
|
const extra = [];
|
|
7069
7629
|
if (dotTone.value) {
|
|
7070
|
-
extra.push(props.dotLabels[dotTone.value] ??
|
|
7630
|
+
extra.push(props.dotLabels[dotTone.value] ?? taoLocale().avatar.dotLabels[dotTone.value]);
|
|
7071
7631
|
}
|
|
7072
7632
|
if (badge.value) {
|
|
7073
|
-
extra.push(
|
|
7633
|
+
extra.push(l10n.value.notificationsLabel.replace("{count}", badge.value));
|
|
7074
7634
|
}
|
|
7075
7635
|
return extra.length ? `${base}, ${extra.join(", ")}` : base;
|
|
7076
7636
|
});
|
|
@@ -7085,9 +7645,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
7085
7645
|
function onImgError() {
|
|
7086
7646
|
imgFailed.value = true;
|
|
7087
7647
|
}
|
|
7648
|
+
if (props.size === "s" || props.size === "m" || props.size === "l") {
|
|
7649
|
+
deprecationWarning("TaoAvatar", `size "${props.size}"`, "use small / medium / large");
|
|
7650
|
+
}
|
|
7088
7651
|
return (_ctx, _cache) => {
|
|
7089
7652
|
return openBlock(), createElementBlock("span", {
|
|
7090
|
-
class: normalizeClass(["tao-avatar", `tao-avatar--${
|
|
7653
|
+
class: normalizeClass(["tao-avatar", `tao-avatar--${sizeClass2.value}`]),
|
|
7091
7654
|
title: label.value
|
|
7092
7655
|
}, [
|
|
7093
7656
|
createElementVNode("span", _hoisted_2$6, [
|
|
@@ -7113,7 +7676,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
7113
7676
|
};
|
|
7114
7677
|
}
|
|
7115
7678
|
});
|
|
7116
|
-
const TaoAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-
|
|
7679
|
+
const TaoAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-2257342d"]]);
|
|
7117
7680
|
const _hoisted_1$6 = ["aria-label"];
|
|
7118
7681
|
const _hoisted_2$5 = { class: "tao-breadcrumb__list" };
|
|
7119
7682
|
const _hoisted_3$4 = {
|
|
@@ -7135,13 +7698,15 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
7135
7698
|
__name: "TaoBreadcrumb",
|
|
7136
7699
|
props: {
|
|
7137
7700
|
items: {},
|
|
7138
|
-
ariaLabel: {
|
|
7701
|
+
ariaLabel: {}
|
|
7139
7702
|
},
|
|
7140
7703
|
setup(__props) {
|
|
7704
|
+
const props = __props;
|
|
7705
|
+
const l10n = useLocaleText(props, "breadcrumb");
|
|
7141
7706
|
return (_ctx, _cache) => {
|
|
7142
7707
|
return openBlock(), createElementBlock("nav", {
|
|
7143
7708
|
class: "tao-breadcrumb",
|
|
7144
|
-
"aria-label":
|
|
7709
|
+
"aria-label": unref(l10n).ariaLabel
|
|
7145
7710
|
}, [
|
|
7146
7711
|
createElementVNode("ol", _hoisted_2$5, [
|
|
7147
7712
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item, index) => {
|
|
@@ -7167,7 +7732,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
7167
7732
|
};
|
|
7168
7733
|
}
|
|
7169
7734
|
});
|
|
7170
|
-
const TaoBreadcrumb = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-
|
|
7735
|
+
const TaoBreadcrumb = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-b853fbd5"]]);
|
|
7171
7736
|
const _hoisted_1$5 = ["aria-label"];
|
|
7172
7737
|
const _hoisted_2$4 = {
|
|
7173
7738
|
class: "tao-counter__row",
|
|
@@ -7250,6 +7815,24 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
7250
7815
|
}
|
|
7251
7816
|
});
|
|
7252
7817
|
const TaoCounter = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-9e11d2be"]]);
|
|
7818
|
+
const GLIDE_TIME = 325;
|
|
7819
|
+
const FLICK_SPEED = 0.3;
|
|
7820
|
+
function glideTarget(from, velocity, pitch, max) {
|
|
7821
|
+
if (pitch <= 0) {
|
|
7822
|
+
return from;
|
|
7823
|
+
}
|
|
7824
|
+
let slide = Math.round((from + velocity * GLIDE_TIME) / pitch);
|
|
7825
|
+
if (velocity > FLICK_SPEED) {
|
|
7826
|
+
slide = Math.max(slide, Math.floor(from / pitch) + 1);
|
|
7827
|
+
} else if (velocity < -FLICK_SPEED) {
|
|
7828
|
+
slide = Math.min(slide, Math.ceil(from / pitch) - 1);
|
|
7829
|
+
}
|
|
7830
|
+
return Math.min(Math.max(slide * pitch, 0), Math.max(max, 0));
|
|
7831
|
+
}
|
|
7832
|
+
function glideDuration(distance, velocity) {
|
|
7833
|
+
const sameDirection = Math.abs(velocity) > 0.05 && Math.sign(velocity) === Math.sign(distance);
|
|
7834
|
+
return sameDirection ? Math.min(Math.max(3 * Math.abs(distance) / Math.abs(velocity), 220), 900) : Math.min(200 + Math.abs(distance) * 1.2, 450);
|
|
7835
|
+
}
|
|
7253
7836
|
const _hoisted_1$4 = { class: "tao-carousel__row" };
|
|
7254
7837
|
const _hoisted_2$3 = ["aria-label", "disabled"];
|
|
7255
7838
|
const _hoisted_3$3 = { "aria-hidden": "true" };
|
|
@@ -7269,20 +7852,22 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7269
7852
|
autoplay: { default: 0 },
|
|
7270
7853
|
loop: { type: Boolean, default: false },
|
|
7271
7854
|
dots: { type: Boolean, default: false },
|
|
7272
|
-
ariaLabel: {
|
|
7273
|
-
prevLabel: {
|
|
7274
|
-
nextLabel: {
|
|
7275
|
-
dotsLabel: {
|
|
7276
|
-
slideLabel: {
|
|
7855
|
+
ariaLabel: {},
|
|
7856
|
+
prevLabel: {},
|
|
7857
|
+
nextLabel: {},
|
|
7858
|
+
dotsLabel: {},
|
|
7859
|
+
slideLabel: {}
|
|
7277
7860
|
},
|
|
7278
7861
|
emits: ["update:modelValue", "change"],
|
|
7279
7862
|
setup(__props, { emit: __emit }) {
|
|
7280
7863
|
const props = __props;
|
|
7864
|
+
const l10n = useLocaleText(props, "carousel");
|
|
7281
7865
|
const emit = __emit;
|
|
7282
7866
|
const track = ref(null);
|
|
7283
7867
|
const index = ref(props.modelValue);
|
|
7284
7868
|
const count = ref(0);
|
|
7285
7869
|
const dragging = ref(false);
|
|
7870
|
+
const gliding = ref(false);
|
|
7286
7871
|
const hoverPaused = ref(false);
|
|
7287
7872
|
const focusPaused = ref(false);
|
|
7288
7873
|
let dragStartX = 0;
|
|
@@ -7290,6 +7875,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7290
7875
|
let dragMoved = 0;
|
|
7291
7876
|
let dragPointer = -1;
|
|
7292
7877
|
let scrollFrame = 0;
|
|
7878
|
+
let glideFrame = 0;
|
|
7879
|
+
let settleTimer = 0;
|
|
7880
|
+
let samples = [];
|
|
7293
7881
|
let focusFrame = 0;
|
|
7294
7882
|
let autoplayTimer = 0;
|
|
7295
7883
|
const step = computed(() => Math.max(1, Math.round(props.perView)));
|
|
@@ -7322,7 +7910,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7322
7910
|
if (width <= 0 || total <= 0) {
|
|
7323
7911
|
return 0;
|
|
7324
7912
|
}
|
|
7325
|
-
const left = ((_a = track.value) == null ? void 0 : _a.scrollLeft) ?? 0;
|
|
7913
|
+
const left = scrollLeft ?? ((_a = track.value) == null ? void 0 : _a.scrollLeft) ?? 0;
|
|
7326
7914
|
const last = Math.max(total - step.value, 0);
|
|
7327
7915
|
return Math.min(Math.max(Math.round(left / (width + gap)), 0), last);
|
|
7328
7916
|
}
|
|
@@ -7345,6 +7933,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7345
7933
|
goTo(index.value + step.value);
|
|
7346
7934
|
}
|
|
7347
7935
|
function goTo(next, instant = false) {
|
|
7936
|
+
cancelGlide();
|
|
7348
7937
|
const el = track.value;
|
|
7349
7938
|
const { width, gap, total } = metrics();
|
|
7350
7939
|
if (!el || width <= 0 || total <= 0) {
|
|
@@ -7375,7 +7964,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7375
7964
|
autoplayTimer = 0;
|
|
7376
7965
|
}
|
|
7377
7966
|
function canAutoplay() {
|
|
7378
|
-
return props.autoplay > 0 && count.value > step.value && !hoverPaused.value && !focusPaused.value && !dragging.value && typeof document !== "undefined" && !document.hidden && !prefersReducedMotion() && (props.loop || index.value < lastIndex.value);
|
|
7967
|
+
return props.autoplay > 0 && count.value > step.value && !hoverPaused.value && !focusPaused.value && !dragging.value && !gliding.value && typeof document !== "undefined" && !document.hidden && !prefersReducedMotion() && (props.loop || index.value < lastIndex.value);
|
|
7379
7968
|
}
|
|
7380
7969
|
function tickAutoplay() {
|
|
7381
7970
|
if (!canAutoplay()) {
|
|
@@ -7427,20 +8016,103 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7427
8016
|
});
|
|
7428
8017
|
}
|
|
7429
8018
|
function onScroll() {
|
|
7430
|
-
if (dragging.value) {
|
|
8019
|
+
if (dragging.value || gliding.value) {
|
|
7431
8020
|
return;
|
|
7432
8021
|
}
|
|
7433
8022
|
cancelAnimationFrame(scrollFrame);
|
|
7434
|
-
scrollFrame = requestAnimationFrame(() =>
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
|
|
7439
|
-
|
|
8023
|
+
scrollFrame = requestAnimationFrame(() => setIndex(nearestIndex()));
|
|
8024
|
+
if (!supportsScrollEnd()) {
|
|
8025
|
+
window.clearTimeout(settleTimer);
|
|
8026
|
+
settleTimer = window.setTimeout(settle, 150);
|
|
8027
|
+
}
|
|
8028
|
+
}
|
|
8029
|
+
function supportsScrollEnd() {
|
|
8030
|
+
return typeof window !== "undefined" && "onscrollend" in window;
|
|
8031
|
+
}
|
|
8032
|
+
function settle() {
|
|
8033
|
+
window.clearTimeout(settleTimer);
|
|
8034
|
+
const el = track.value;
|
|
8035
|
+
if (!el || dragging.value || gliding.value || getComputedStyle(el).scrollSnapType !== "none") {
|
|
8036
|
+
return;
|
|
8037
|
+
}
|
|
8038
|
+
const max = el.scrollWidth - el.clientWidth;
|
|
8039
|
+
if (el.scrollLeft >= max - 1) {
|
|
8040
|
+
return;
|
|
8041
|
+
}
|
|
8042
|
+
const target = glideTarget$1(el.scrollLeft, 0);
|
|
8043
|
+
if (Math.abs(target - el.scrollLeft) >= 1) {
|
|
8044
|
+
glideTo(target, 0);
|
|
8045
|
+
}
|
|
8046
|
+
}
|
|
8047
|
+
function onUserScrollInput() {
|
|
8048
|
+
if (!dragging.value) {
|
|
8049
|
+
cancelGlide();
|
|
8050
|
+
}
|
|
8051
|
+
}
|
|
8052
|
+
function recordSample(x) {
|
|
8053
|
+
const t = performance.now();
|
|
8054
|
+
samples.push({ x, t });
|
|
8055
|
+
while (samples.length > 2 && t - samples[0].t > 100) {
|
|
8056
|
+
samples.shift();
|
|
8057
|
+
}
|
|
8058
|
+
}
|
|
8059
|
+
function releaseVelocity() {
|
|
8060
|
+
const first = samples[0];
|
|
8061
|
+
const last = samples[samples.length - 1];
|
|
8062
|
+
if (!first || !last || last.t === first.t || performance.now() - last.t > 80) {
|
|
8063
|
+
return 0;
|
|
8064
|
+
}
|
|
8065
|
+
return -(last.x - first.x) / (last.t - first.t);
|
|
8066
|
+
}
|
|
8067
|
+
function cancelGlide() {
|
|
8068
|
+
if (!glideFrame) {
|
|
8069
|
+
return;
|
|
8070
|
+
}
|
|
8071
|
+
cancelAnimationFrame(glideFrame);
|
|
8072
|
+
glideFrame = 0;
|
|
8073
|
+
gliding.value = false;
|
|
8074
|
+
}
|
|
8075
|
+
function glideTarget$1(from, velocity) {
|
|
8076
|
+
const el = track.value;
|
|
8077
|
+
const { width, gap } = metrics();
|
|
8078
|
+
if (!el || width <= 0) {
|
|
8079
|
+
return from;
|
|
8080
|
+
}
|
|
8081
|
+
return glideTarget(from, velocity, width + gap, el.scrollWidth - el.clientWidth);
|
|
8082
|
+
}
|
|
8083
|
+
function finishGlide() {
|
|
8084
|
+
glideFrame = 0;
|
|
8085
|
+
gliding.value = false;
|
|
8086
|
+
setIndex(nearestIndex());
|
|
8087
|
+
syncAutoplay();
|
|
8088
|
+
}
|
|
8089
|
+
function glideTo(target, velocity) {
|
|
8090
|
+
const el = track.value;
|
|
8091
|
+
if (!el) {
|
|
8092
|
+
return;
|
|
8093
|
+
}
|
|
8094
|
+
cancelGlide();
|
|
8095
|
+
const from = el.scrollLeft;
|
|
8096
|
+
const distance = target - from;
|
|
8097
|
+
setIndex(nearestIndex(target));
|
|
8098
|
+
if (Math.abs(distance) < 1 || prefersReducedMotion()) {
|
|
8099
|
+
el.scrollLeft = target;
|
|
8100
|
+
syncAutoplay();
|
|
8101
|
+
return;
|
|
8102
|
+
}
|
|
8103
|
+
const duration = glideDuration(distance, velocity);
|
|
8104
|
+
const start = performance.now();
|
|
8105
|
+
gliding.value = true;
|
|
8106
|
+
const frame = (now) => {
|
|
8107
|
+
const t = Math.min((now - start) / duration, 1);
|
|
8108
|
+
el.scrollLeft = from + distance * (1 - (1 - t) ** 3);
|
|
8109
|
+
if (t < 1) {
|
|
8110
|
+
glideFrame = requestAnimationFrame(frame);
|
|
7440
8111
|
return;
|
|
7441
8112
|
}
|
|
7442
|
-
|
|
7443
|
-
}
|
|
8113
|
+
finishGlide();
|
|
8114
|
+
};
|
|
8115
|
+
glideFrame = requestAnimationFrame(frame);
|
|
7444
8116
|
}
|
|
7445
8117
|
function releaseDragCapture() {
|
|
7446
8118
|
const el = track.value;
|
|
@@ -7466,8 +8138,12 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7466
8138
|
if (!keepClickGuard) {
|
|
7467
8139
|
dragMoved = 0;
|
|
7468
8140
|
}
|
|
7469
|
-
|
|
7470
|
-
|
|
8141
|
+
const el = track.value;
|
|
8142
|
+
const velocity = releaseVelocity();
|
|
8143
|
+
samples = [];
|
|
8144
|
+
if (el) {
|
|
8145
|
+
glideTo(glideTarget$1(el.scrollLeft, velocity), velocity);
|
|
8146
|
+
return;
|
|
7471
8147
|
}
|
|
7472
8148
|
syncAutoplay();
|
|
7473
8149
|
}
|
|
@@ -7475,10 +8151,13 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7475
8151
|
if (event.pointerType !== "mouse" || event.button !== 0 || !track.value) {
|
|
7476
8152
|
return;
|
|
7477
8153
|
}
|
|
8154
|
+
cancelGlide();
|
|
7478
8155
|
dragPointer = event.pointerId;
|
|
7479
8156
|
dragStartX = event.clientX;
|
|
7480
8157
|
dragStartScroll = track.value.scrollLeft;
|
|
7481
8158
|
dragMoved = 0;
|
|
8159
|
+
samples = [];
|
|
8160
|
+
recordSample(event.clientX);
|
|
7482
8161
|
dragging.value = true;
|
|
7483
8162
|
try {
|
|
7484
8163
|
track.value.setPointerCapture(event.pointerId);
|
|
@@ -7490,7 +8169,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7490
8169
|
return;
|
|
7491
8170
|
}
|
|
7492
8171
|
const dx = event.clientX - dragStartX;
|
|
7493
|
-
dragMoved = Math.abs(dx);
|
|
8172
|
+
dragMoved = Math.max(dragMoved, Math.abs(dx));
|
|
8173
|
+
recordSample(event.clientX);
|
|
7494
8174
|
track.value.scrollLeft = dragStartScroll - dx;
|
|
7495
8175
|
}
|
|
7496
8176
|
function onPointerEnd(event) {
|
|
@@ -7544,7 +8224,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7544
8224
|
}
|
|
7545
8225
|
);
|
|
7546
8226
|
watch(
|
|
7547
|
-
() => [props.autoplay, props.loop, count.value, dragging.value, index.value],
|
|
8227
|
+
() => [props.autoplay, props.loop, count.value, dragging.value, gliding.value, index.value],
|
|
7548
8228
|
() => syncAutoplay()
|
|
7549
8229
|
);
|
|
7550
8230
|
onMounted(() => {
|
|
@@ -7560,6 +8240,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7560
8240
|
onUpdated(refreshCount);
|
|
7561
8241
|
onBeforeUnmount(() => {
|
|
7562
8242
|
endDrag();
|
|
8243
|
+
cancelGlide();
|
|
8244
|
+
window.clearTimeout(settleTimer);
|
|
7563
8245
|
cancelAnimationFrame(scrollFrame);
|
|
7564
8246
|
cancelAnimationFrame(focusFrame);
|
|
7565
8247
|
stopAutoplay();
|
|
@@ -7585,7 +8267,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7585
8267
|
key: 0,
|
|
7586
8268
|
type: "button",
|
|
7587
8269
|
class: "tao-carousel__nav",
|
|
7588
|
-
"aria-label":
|
|
8270
|
+
"aria-label": unref(l10n).prevLabel,
|
|
7589
8271
|
disabled: atStart.value,
|
|
7590
8272
|
onClick: goPrev
|
|
7591
8273
|
}, [
|
|
@@ -7613,11 +8295,14 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7613
8295
|
createElementVNode("div", {
|
|
7614
8296
|
ref_key: "track",
|
|
7615
8297
|
ref: track,
|
|
7616
|
-
class: normalizeClass(["tao-carousel__track", { "tao-carousel__track--dragging": dragging.value }]),
|
|
8298
|
+
class: normalizeClass(["tao-carousel__track", { "tao-carousel__track--dragging": dragging.value, "tao-carousel__track--gliding": gliding.value }]),
|
|
7617
8299
|
role: "region",
|
|
7618
|
-
"aria-label":
|
|
8300
|
+
"aria-label": unref(l10n).ariaLabel,
|
|
7619
8301
|
tabindex: "0",
|
|
7620
8302
|
onScroll,
|
|
8303
|
+
onScrollend: settle,
|
|
8304
|
+
onWheelPassive: onUserScrollInput,
|
|
8305
|
+
onTouchstartPassive: onUserScrollInput,
|
|
7621
8306
|
onKeydown,
|
|
7622
8307
|
onPointerdown: onPointerDown,
|
|
7623
8308
|
onPointermove: onPointerMove,
|
|
@@ -7636,7 +8321,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7636
8321
|
key: 0,
|
|
7637
8322
|
type: "button",
|
|
7638
8323
|
class: "tao-carousel__nav",
|
|
7639
|
-
"aria-label":
|
|
8324
|
+
"aria-label": unref(l10n).nextLabel,
|
|
7640
8325
|
disabled: atEnd.value,
|
|
7641
8326
|
onClick: goNext
|
|
7642
8327
|
}, [
|
|
@@ -7671,14 +8356,14 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7671
8356
|
key: 0,
|
|
7672
8357
|
class: "tao-carousel__dots",
|
|
7673
8358
|
role: "group",
|
|
7674
|
-
"aria-label":
|
|
8359
|
+
"aria-label": unref(l10n).dotsLabel
|
|
7675
8360
|
}, [
|
|
7676
8361
|
(openBlock(true), createElementBlock(Fragment, null, renderList(snapCount.value, (n) => {
|
|
7677
8362
|
return openBlock(), createElementBlock("button", {
|
|
7678
8363
|
key: n,
|
|
7679
8364
|
type: "button",
|
|
7680
8365
|
class: normalizeClass(["tao-carousel__dot", { "tao-carousel__dot--active": n - 1 === index.value }]),
|
|
7681
|
-
"aria-label":
|
|
8366
|
+
"aria-label": unref(l10n).slideLabel.replace("{n}", String(n)).replace("{count}", String(snapCount.value)),
|
|
7682
8367
|
"aria-current": n - 1 === index.value ? "true" : void 0,
|
|
7683
8368
|
onClick: ($event) => goTo(n - 1)
|
|
7684
8369
|
}, [
|
|
@@ -7697,7 +8382,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7697
8382
|
};
|
|
7698
8383
|
}
|
|
7699
8384
|
});
|
|
7700
|
-
const TaoCarousel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
8385
|
+
const TaoCarousel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-d83a4f4e"]]);
|
|
7701
8386
|
const _hoisted_1$3 = ["aria-label"];
|
|
7702
8387
|
const _hoisted_2$2 = ["aria-label"];
|
|
7703
8388
|
const _hoisted_3$2 = {
|
|
@@ -7738,18 +8423,14 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
7738
8423
|
__name: "TaoStages",
|
|
7739
8424
|
props: {
|
|
7740
8425
|
items: { default: () => [] },
|
|
7741
|
-
|
|
7742
|
-
|
|
8426
|
+
direction: { default: void 0 },
|
|
8427
|
+
vertical: { type: Boolean, default: void 0 },
|
|
8428
|
+
ariaLabel: {},
|
|
7743
8429
|
statusLabels: { default: () => ({}) }
|
|
7744
8430
|
},
|
|
7745
8431
|
setup(__props) {
|
|
7746
8432
|
const props = __props;
|
|
7747
|
-
const
|
|
7748
|
-
wait: "ожидание",
|
|
7749
|
-
work: "в работе",
|
|
7750
|
-
ok: "готово",
|
|
7751
|
-
bad: "ошибка"
|
|
7752
|
-
};
|
|
8433
|
+
const l10n = useLocaleText(props, "stages");
|
|
7753
8434
|
function statusOf(item) {
|
|
7754
8435
|
if (item.status === "danger") {
|
|
7755
8436
|
return "bad";
|
|
@@ -7758,12 +8439,16 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
7758
8439
|
}
|
|
7759
8440
|
function itemLabel(item) {
|
|
7760
8441
|
const status = statusOf(item);
|
|
7761
|
-
return `${item.label ?? item.key}, ${props.statusLabels[status] ??
|
|
8442
|
+
return `${item.label ?? item.key}, ${props.statusLabels[status] ?? taoLocale().stages.statusLabels[status]}`;
|
|
7762
8443
|
}
|
|
8444
|
+
const isRow = computed(() => (props.direction ?? (props.vertical === false ? "row" : "column")) === "row");
|
|
8445
|
+
warnDeprecated("TaoStages", {
|
|
8446
|
+
vertical: "use `direction`"
|
|
8447
|
+
});
|
|
7763
8448
|
return (_ctx, _cache) => {
|
|
7764
8449
|
return openBlock(), createElementBlock("ul", {
|
|
7765
|
-
class: normalizeClass(["tao-stages", { "tao-stages--horizontal":
|
|
7766
|
-
"aria-label":
|
|
8450
|
+
class: normalizeClass(["tao-stages", { "tao-stages--horizontal": isRow.value }]),
|
|
8451
|
+
"aria-label": unref(l10n).ariaLabel
|
|
7767
8452
|
}, [
|
|
7768
8453
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item, index) => {
|
|
7769
8454
|
return openBlock(), createElementBlock("li", {
|
|
@@ -7832,86 +8517,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
7832
8517
|
};
|
|
7833
8518
|
}
|
|
7834
8519
|
});
|
|
7835
|
-
const TaoStages = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-
|
|
7836
|
-
const TOAST_POSITIONS = [
|
|
7837
|
-
"topRight",
|
|
7838
|
-
"topLeft",
|
|
7839
|
-
"topCenter",
|
|
7840
|
-
"bottomRight",
|
|
7841
|
-
"bottomLeft",
|
|
7842
|
-
"bottomCenter",
|
|
7843
|
-
"center"
|
|
7844
|
-
];
|
|
7845
|
-
const toastDefaults = {
|
|
7846
|
-
position: "topCenter",
|
|
7847
|
-
timeout: 3e3,
|
|
7848
|
-
closable: true,
|
|
7849
|
-
progress: true,
|
|
7850
|
-
closeLabel: "Закрыть уведомление"
|
|
7851
|
-
};
|
|
7852
|
-
const toasts = ref([]);
|
|
7853
|
-
const toastsByPosition = computed(() => {
|
|
7854
|
-
const grouped = {};
|
|
7855
|
-
for (const position of TOAST_POSITIONS) {
|
|
7856
|
-
grouped[position] = [];
|
|
7857
|
-
}
|
|
7858
|
-
for (const toast2 of toasts.value) {
|
|
7859
|
-
grouped[toast2.position].push(toast2);
|
|
7860
|
-
}
|
|
7861
|
-
return grouped;
|
|
7862
|
-
});
|
|
7863
|
-
function configureToastDefaults(partial) {
|
|
7864
|
-
Object.assign(toastDefaults, partial);
|
|
7865
|
-
}
|
|
7866
|
-
function addToast(record) {
|
|
7867
|
-
if (record.displayMode === "once" && record.dedupeId) {
|
|
7868
|
-
const exists = toasts.value.some((item) => item.dedupeId === record.dedupeId);
|
|
7869
|
-
if (exists) {
|
|
7870
|
-
return;
|
|
7871
|
-
}
|
|
7872
|
-
}
|
|
7873
|
-
if (record.displayMode === "replace" && record.dedupeId) {
|
|
7874
|
-
toasts.value = toasts.value.filter((item) => item.dedupeId !== record.dedupeId);
|
|
7875
|
-
}
|
|
7876
|
-
toasts.value = [...toasts.value, record];
|
|
7877
|
-
}
|
|
7878
|
-
function removeToast(id) {
|
|
7879
|
-
var _a;
|
|
7880
|
-
const item = toasts.value.find((toast2) => toast2.id === id);
|
|
7881
|
-
if (!item) {
|
|
7882
|
-
return;
|
|
7883
|
-
}
|
|
7884
|
-
toasts.value = toasts.value.filter((toast2) => toast2.id !== id);
|
|
7885
|
-
(_a = item.onClosed) == null ? void 0 : _a.call(item);
|
|
7886
|
-
}
|
|
7887
|
-
function dismissToasts(id) {
|
|
7888
|
-
if (id) {
|
|
7889
|
-
removeToast(id);
|
|
7890
|
-
return;
|
|
7891
|
-
}
|
|
7892
|
-
const items = toasts.value;
|
|
7893
|
-
toasts.value = [];
|
|
7894
|
-
items.forEach((item) => {
|
|
7895
|
-
var _a;
|
|
7896
|
-
return (_a = item.onClosed) == null ? void 0 : _a.call(item);
|
|
7897
|
-
});
|
|
7898
|
-
}
|
|
7899
|
-
let viewportMounts$1 = 0;
|
|
7900
|
-
function registerToastViewport() {
|
|
7901
|
-
viewportMounts$1 += 1;
|
|
7902
|
-
}
|
|
7903
|
-
function unregisterToastViewport() {
|
|
7904
|
-
viewportMounts$1 = Math.max(0, viewportMounts$1 - 1);
|
|
7905
|
-
}
|
|
7906
|
-
function hasToastViewport() {
|
|
7907
|
-
if (viewportMounts$1 > 0) {
|
|
7908
|
-
return true;
|
|
7909
|
-
}
|
|
7910
|
-
if (typeof document === "undefined") {
|
|
7911
|
-
return false;
|
|
7912
|
-
}
|
|
7913
|
-
return Boolean(document.querySelector("[data-tao-toast-viewport]"));
|
|
7914
|
-
}
|
|
8520
|
+
const TaoStages = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-45cc2ad5"]]);
|
|
7915
8521
|
const _hoisted_1$2 = ["role"];
|
|
7916
8522
|
const _hoisted_2$1 = {
|
|
7917
8523
|
class: "tao-toast__icon",
|
|
@@ -8194,50 +8800,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
8194
8800
|
}
|
|
8195
8801
|
});
|
|
8196
8802
|
const TaoToastViewport = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-d07e8a95"]]);
|
|
8197
|
-
const confirmDefaults = {
|
|
8198
|
-
ok: "ОК",
|
|
8199
|
-
cancel: "Отмена"
|
|
8200
|
-
};
|
|
8201
|
-
const currentConfirm = ref(null);
|
|
8202
|
-
const queue = [];
|
|
8203
|
-
function configureConfirmDefaults(partial) {
|
|
8204
|
-
Object.assign(confirmDefaults, partial);
|
|
8205
|
-
}
|
|
8206
|
-
function pump() {
|
|
8207
|
-
if (currentConfirm.value) {
|
|
8208
|
-
return;
|
|
8209
|
-
}
|
|
8210
|
-
currentConfirm.value = queue.shift() ?? null;
|
|
8211
|
-
}
|
|
8212
|
-
function enqueueConfirm(record) {
|
|
8213
|
-
queue.push(record);
|
|
8214
|
-
pump();
|
|
8215
|
-
}
|
|
8216
|
-
function resolveConfirm(value) {
|
|
8217
|
-
const item = currentConfirm.value;
|
|
8218
|
-
if (!item) {
|
|
8219
|
-
return;
|
|
8220
|
-
}
|
|
8221
|
-
currentConfirm.value = null;
|
|
8222
|
-
item.resolve(value);
|
|
8223
|
-
pump();
|
|
8224
|
-
}
|
|
8225
|
-
let viewportMounts = 0;
|
|
8226
|
-
function registerConfirmHost() {
|
|
8227
|
-
viewportMounts += 1;
|
|
8228
|
-
}
|
|
8229
|
-
function unregisterConfirmHost() {
|
|
8230
|
-
viewportMounts = Math.max(0, viewportMounts - 1);
|
|
8231
|
-
}
|
|
8232
|
-
function hasConfirmHost() {
|
|
8233
|
-
if (viewportMounts > 0) {
|
|
8234
|
-
return true;
|
|
8235
|
-
}
|
|
8236
|
-
if (typeof document === "undefined") {
|
|
8237
|
-
return false;
|
|
8238
|
-
}
|
|
8239
|
-
return Boolean(document.querySelector("[data-tao-confirm-host]"));
|
|
8240
|
-
}
|
|
8241
8803
|
const _hoisted_1 = ["aria-labelledby", "aria-describedby"];
|
|
8242
8804
|
const _hoisted_2 = {
|
|
8243
8805
|
class: "tao-confirm__icon",
|
|
@@ -8883,7 +9445,10 @@ const components = [
|
|
|
8883
9445
|
TaoConfirmHost
|
|
8884
9446
|
];
|
|
8885
9447
|
const TaoUI = {
|
|
8886
|
-
install(app) {
|
|
9448
|
+
install(app, options = {}) {
|
|
9449
|
+
if (options.locale) {
|
|
9450
|
+
setTaoLocale(options.locale);
|
|
9451
|
+
}
|
|
8887
9452
|
components.forEach((component) => {
|
|
8888
9453
|
app.component(component.name, component);
|
|
8889
9454
|
});
|
|
@@ -8957,8 +9522,12 @@ export {
|
|
|
8957
9522
|
formatTaoDateIso,
|
|
8958
9523
|
formatTaoDateLabel,
|
|
8959
9524
|
formatTaoDateRangeLabel,
|
|
9525
|
+
localeEn,
|
|
9526
|
+
localeRu,
|
|
8960
9527
|
parseTaoDate,
|
|
8961
9528
|
parseTaoDateRange,
|
|
9529
|
+
setTaoLocale,
|
|
9530
|
+
taoLocale,
|
|
8962
9531
|
toast,
|
|
8963
9532
|
todayTaoDate
|
|
8964
9533
|
};
|