@1337exp/taoui 3.3.1 → 3.4.1

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/dist/index.d.ts CHANGED
@@ -616,8 +616,13 @@ light: boolean;
616
616
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
617
617
 
618
618
  declare const __VLS_component_29: DefineComponent<ExtractPropTypes<__VLS_WithDefaults_29<__VLS_TypePropsToRuntimeProps_31<Props_14>, {
619
+ variant: string;
620
+ side: string;
621
+ offset: undefined;
622
+ label: undefined;
623
+ labelSide: undefined;
619
624
  size: number;
620
- right: number;
625
+ right: undefined;
621
626
  bottom: number;
622
627
  zIndex: number;
623
628
  boundary: number;
@@ -625,8 +630,13 @@ outline: undefined;
625
630
  hasOutline: undefined;
626
631
  tabindex: number;
627
632
  }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults_29<__VLS_TypePropsToRuntimeProps_31<Props_14>, {
633
+ variant: string;
634
+ side: string;
635
+ offset: undefined;
636
+ label: undefined;
637
+ labelSide: undefined;
628
638
  size: number;
629
- right: number;
639
+ right: undefined;
630
640
  bottom: number;
631
641
  zIndex: number;
632
642
  boundary: number;
@@ -634,10 +644,15 @@ outline: undefined;
634
644
  hasOutline: undefined;
635
645
  tabindex: number;
636
646
  }>>> & Readonly<{}>, {
647
+ label: string;
637
648
  size: number;
649
+ variant: "solid" | "ghost" | "text";
638
650
  tabindex: number;
639
651
  bottom: string | number;
640
652
  right: string | number;
653
+ side: "left" | "right";
654
+ offset: string | number;
655
+ labelSide: "left" | "right";
641
656
  zIndex: number;
642
657
  boundary: number;
643
658
  outline: boolean;
@@ -4089,7 +4104,29 @@ declare interface Props_13 {
4089
4104
  }
4090
4105
 
4091
4106
  declare interface Props_14 {
4107
+ /**
4108
+ * `solid` — accent circle; `ghost` — light circle on a raised surface; `text` — bare uppercase caption with an arrow.
4109
+ * `solid` — круг акцентного цвета; `ghost` — лёгкий круг на приподнятой поверхности; `text` — подпись капсом со стрелкой.
4110
+ */
4111
+ variant?: 'solid' | 'ghost' | 'text';
4112
+ /** Which edge of the page the button sits on. / У какого края страницы стоит кнопка. */
4113
+ side?: 'left' | 'right';
4114
+ /** Offset from that edge; `right` is its older name. / Отступ от этого края; `right` — прежнее имя. */
4115
+ offset?: string | number;
4116
+ /**
4117
+ * Caption: beside the button on mouse hover (and keyboard focus) for `solid` / `ghost`, always visible for `text`
4118
+ * (the locale text by default there; an empty string hides it).
4119
+ * Подпись: рядом с кнопкой при наведении мыши (и фокусе с клавиатуры) у `solid` / `ghost`, у `text` видна всегда
4120
+ * (по умолчанию — текст локали; пустая строка скрывает).
4121
+ */
4122
+ label?: string;
4123
+ /**
4124
+ * Where the caption goes relative to the button. Default: opposite to `side`, so it opens towards the page.
4125
+ * С какой стороны подпись относительно кнопки. По умолчанию — противоположная `side`, то есть к странице.
4126
+ */
4127
+ labelSide?: 'left' | 'right';
4092
4128
  size?: number;
4129
+ /** Older name of `offset`. / Прежнее имя `offset`. */
4093
4130
  right?: string | number;
4094
4131
  bottom?: string | number;
4095
4132
  zIndex?: number;
package/dist/index.mjs CHANGED
@@ -18,7 +18,7 @@ const _hoisted_2$L = {
18
18
  key: 0,
19
19
  class: "tao-button__loader"
20
20
  };
21
- const _hoisted_3$D = {
21
+ const _hoisted_3$E = {
22
22
  key: 1,
23
23
  class: "tao-button__icon"
24
24
  };
@@ -63,7 +63,7 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
63
63
  onClick: handleClick
64
64
  }, [
65
65
  __props.loading ? (openBlock(), createElementBlock("span", _hoisted_2$L)) : createCommentVNode("", true),
66
- __props.icon ? (openBlock(), createElementBlock("span", _hoisted_3$D, toDisplayString(__props.icon), 1)) : createCommentVNode("", true),
66
+ __props.icon ? (openBlock(), createElementBlock("span", _hoisted_3$E, toDisplayString(__props.icon), 1)) : createCommentVNode("", true),
67
67
  createElementVNode("span", _hoisted_4$x, [
68
68
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
69
69
  ])
@@ -160,7 +160,7 @@ const _hoisted_2$K = {
160
160
  key: 0,
161
161
  class: "tao-input__affix tao-input__affix--prefix"
162
162
  };
163
- const _hoisted_3$C = ["id", "type", "value", "placeholder", "disabled", "aria-invalid", "aria-describedby"];
163
+ const _hoisted_3$D = ["id", "type", "value", "placeholder", "disabled", "aria-invalid", "aria-describedby"];
164
164
  const _hoisted_4$w = {
165
165
  key: 1,
166
166
  class: "tao-input__affix tao-input__affix--suffix"
@@ -242,7 +242,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
242
242
  onInput: handleInput,
243
243
  onBlur: handleBlur,
244
244
  onFocus: handleFocus
245
- }, null, 42, _hoisted_3$C),
245
+ }, null, 42, _hoisted_3$D),
246
246
  _ctx.$slots.suffix ? (openBlock(), createElementBlock("span", _hoisted_4$w, [
247
247
  renderSlot(_ctx.$slots, "suffix", {}, void 0, true)
248
248
  ])) : createCommentVNode("", true)
@@ -258,7 +258,7 @@ const _hoisted_1$Q = {
258
258
  class: "tao-input-group__addon tao-input-group__addon--before"
259
259
  };
260
260
  const _hoisted_2$J = { class: "tao-input-group__field" };
261
- const _hoisted_3$B = {
261
+ const _hoisted_3$C = {
262
262
  key: 1,
263
263
  class: "tao-input-group__addon tao-input-group__addon--after"
264
264
  };
@@ -293,7 +293,7 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent({
293
293
  createElementVNode("div", _hoisted_2$J, [
294
294
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
295
295
  ]),
296
- _ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_3$B, [
296
+ _ctx.$slots.after ? (openBlock(), createElementBlock("div", _hoisted_3$C, [
297
297
  renderSlot(_ctx.$slots, "after", {}, void 0, true)
298
298
  ])) : createCommentVNode("", true)
299
299
  ], 34);
@@ -649,7 +649,7 @@ const _hoisted_2$I = {
649
649
  key: 0,
650
650
  class: "tao-input-number__steppers"
651
651
  };
652
- const _hoisted_3$A = ["aria-label", "disabled"];
652
+ const _hoisted_3$B = ["aria-label", "disabled"];
653
653
  const _hoisted_4$v = { "aria-hidden": "true" };
654
654
  const _hoisted_5$n = ["aria-label", "disabled"];
655
655
  const _hoisted_6$i = { "aria-hidden": "true" };
@@ -829,7 +829,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
829
829
  _cache[2] || (_cache[2] = createTextVNode("+", -1))
830
830
  ], true)
831
831
  ])
832
- ], 8, _hoisted_3$A),
832
+ ], 8, _hoisted_3$B),
833
833
  createElementVNode("button", {
834
834
  type: "button",
835
835
  class: "tao-input-number__step",
@@ -852,7 +852,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
852
852
  const TaoInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["__scopeId", "data-v-3f4e6197"]]);
853
853
  const _hoisted_1$O = ["aria-label", "disabled"];
854
854
  const _hoisted_2$H = { "aria-hidden": "true" };
855
- const _hoisted_3$z = ["id", "value", "disabled", "aria-invalid", "aria-describedby", "aria-valuenow", "aria-valuemin", "aria-valuemax"];
855
+ const _hoisted_3$A = ["id", "value", "disabled", "aria-invalid", "aria-describedby", "aria-valuenow", "aria-valuemin", "aria-valuemax"];
856
856
  const _hoisted_4$u = ["aria-label", "disabled"];
857
857
  const _hoisted_5$m = { "aria-hidden": "true" };
858
858
  const _sfc_main$Z = /* @__PURE__ */ defineComponent({
@@ -1023,7 +1023,7 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
1023
1023
  onFocus,
1024
1024
  onBlur,
1025
1025
  onKeydown
1026
- }, null, 40, _hoisted_3$z),
1026
+ }, null, 40, _hoisted_3$A),
1027
1027
  createElementVNode("button", {
1028
1028
  type: "button",
1029
1029
  class: "tao-quantity__btn tao-quantity__btn--inc",
@@ -1050,7 +1050,7 @@ const _hoisted_2$G = {
1050
1050
  key: 0,
1051
1051
  class: "tao-card__overlay"
1052
1052
  };
1053
- const _hoisted_3$y = {
1053
+ const _hoisted_3$z = {
1054
1054
  key: 1,
1055
1055
  class: "tao-card__overlay"
1056
1056
  };
@@ -1126,7 +1126,7 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
1126
1126
  _ctx.$slots.overlay ? (openBlock(), createElementBlock("div", _hoisted_2$G, [
1127
1127
  renderSlot(_ctx.$slots, "overlay", {}, void 0, true)
1128
1128
  ])) : createCommentVNode("", true)
1129
- ])) : _ctx.$slots.overlay ? (openBlock(), createElementBlock("div", _hoisted_3$y, [
1129
+ ])) : _ctx.$slots.overlay ? (openBlock(), createElementBlock("div", _hoisted_3$z, [
1130
1130
  renderSlot(_ctx.$slots, "overlay", {}, void 0, true)
1131
1131
  ])) : createCommentVNode("", true),
1132
1132
  hasContent.value ? (openBlock(), createElementBlock("div", {
@@ -1194,7 +1194,15 @@ function trapTab(event, root) {
1194
1194
  if (!event.shiftKey && document.activeElement === last) {
1195
1195
  event.preventDefault();
1196
1196
  first.focus();
1197
+ return;
1197
1198
  }
1199
+ const backwards = event.shiftKey;
1200
+ setTimeout(() => {
1201
+ if (!root.isConnected || root.contains(document.activeElement)) {
1202
+ return;
1203
+ }
1204
+ (backwards ? last : first).focus();
1205
+ }, 0);
1198
1206
  }
1199
1207
  let locks = 0;
1200
1208
  let previousOverflow = "";
@@ -1226,7 +1234,7 @@ const _hoisted_2$F = {
1226
1234
  key: 0,
1227
1235
  class: "tao-modal__header"
1228
1236
  };
1229
- const _hoisted_3$x = ["id"];
1237
+ const _hoisted_3$y = ["id"];
1230
1238
  const _hoisted_4$s = { key: 1 };
1231
1239
  const _hoisted_5$k = ["aria-label"];
1232
1240
  const _hoisted_6$g = { "aria-hidden": "true" };
@@ -1358,7 +1366,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
1358
1366
  key: 0,
1359
1367
  id: unref(titleId),
1360
1368
  class: "tao-modal__title"
1361
- }, toDisplayString(__props.title), 9, _hoisted_3$x)) : (openBlock(), createElementBlock("span", _hoisted_4$s))
1369
+ }, toDisplayString(__props.title), 9, _hoisted_3$y)) : (openBlock(), createElementBlock("span", _hoisted_4$s))
1362
1370
  ], true),
1363
1371
  __props.closable ? (openBlock(), createElementBlock("button", {
1364
1372
  key: 0,
@@ -1611,7 +1619,7 @@ function isMarkActive(markValue, values) {
1611
1619
  }
1612
1620
  const _hoisted_1$K = ["aria-disabled"];
1613
1621
  const _hoisted_2$D = ["id", "tabindex", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-label", "aria-orientation", "aria-disabled", "aria-invalid", "aria-describedby", "onKeydown"];
1614
- const _hoisted_3$w = {
1622
+ const _hoisted_3$x = {
1615
1623
  key: 0,
1616
1624
  class: "tao-slider__value"
1617
1625
  };
@@ -1853,7 +1861,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
1853
1861
  onBlur: _cache[0] || (_cache[0] = ($event) => pointerFocus.value = false)
1854
1862
  }, null, 46, _hoisted_2$D);
1855
1863
  }), 128)),
1856
- __props.showValue ? (openBlock(), createElementBlock("div", _hoisted_3$w, [
1864
+ __props.showValue ? (openBlock(), createElementBlock("div", _hoisted_3$x, [
1857
1865
  renderSlot(_ctx.$slots, "pre-value", {}, void 0, true),
1858
1866
  createTextVNode(toDisplayString(barText.value), 1),
1859
1867
  renderSlot(_ctx.$slots, "post-value", {}, void 0, true)
@@ -1950,7 +1958,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
1950
1958
  });
1951
1959
  const _hoisted_1$J = { class: "tao-timeline__controls" };
1952
1960
  const _hoisted_2$C = { class: "tao-timeline__track" };
1953
- const _hoisted_3$v = {
1961
+ const _hoisted_3$w = {
1954
1962
  key: 0,
1955
1963
  class: "tao-timeline__time"
1956
1964
  };
@@ -2046,7 +2054,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
2046
2054
  } : void 0
2047
2055
  ]), 1032, ["model-value", "max", "step", "marks", "marks-side", "variant", "size", "disabled"])
2048
2056
  ]),
2049
- __props.showTime ? (openBlock(), createElementBlock("div", _hoisted_3$v, [
2057
+ __props.showTime ? (openBlock(), createElementBlock("div", _hoisted_3$w, [
2050
2058
  renderSlot(_ctx.$slots, "time", {
2051
2059
  time: __props.modelValue,
2052
2060
  length: __props.length,
@@ -2426,7 +2434,7 @@ const TaoPopover = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["__scopeId", "data
2426
2434
  const spoilerGroupKey = Symbol("taoSpoilerGroup");
2427
2435
  const _hoisted_1$H = { class: "tao-spoiler" };
2428
2436
  const _hoisted_2$B = ["aria-expanded", "aria-controls"];
2429
- const _hoisted_3$u = {
2437
+ const _hoisted_3$v = {
2430
2438
  key: 0,
2431
2439
  class: "tao-spoiler__title"
2432
2440
  };
@@ -2499,7 +2507,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
2499
2507
  createElementVNode("span", {
2500
2508
  class: normalizeClass(["tao-spoiler__icon", { "tao-spoiler__icon--open": isOpen.value }])
2501
2509
  }, "▶", 2),
2502
- __props.title || _ctx.$slots.title ? (openBlock(), createElementBlock("span", _hoisted_3$u, [
2510
+ __props.title || _ctx.$slots.title ? (openBlock(), createElementBlock("span", _hoisted_3$v, [
2503
2511
  renderSlot(_ctx.$slots, "title", {}, () => [
2504
2512
  createTextVNode(toDisplayString(__props.title), 1)
2505
2513
  ], true)
@@ -2856,7 +2864,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
2856
2864
  const TaoGridItem = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["__scopeId", "data-v-ad288026"]]);
2857
2865
  const _hoisted_1$E = { class: "tao-split__pane tao-split__pane--start" };
2858
2866
  const _hoisted_2$A = ["aria-orientation", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-disabled", "tabindex"];
2859
- const _hoisted_3$t = { class: "tao-split__pane tao-split__pane--end" };
2867
+ const _hoisted_3$u = { class: "tao-split__pane tao-split__pane--end" };
2860
2868
  const _hoisted_4$p = {
2861
2869
  key: 0,
2862
2870
  class: "tao-split__shield"
@@ -3182,7 +3190,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
3182
3190
  onDragstart: _cache[0] || (_cache[0] = withModifiers(() => {
3183
3191
  }, ["prevent"]))
3184
3192
  }, null, 40, _hoisted_2$A),
3185
- createElementVNode("div", _hoisted_3$t, [
3193
+ createElementVNode("div", _hoisted_3$u, [
3186
3194
  renderSlot(_ctx.$slots, "end", {}, void 0, true)
3187
3195
  ]),
3188
3196
  isDragging.value ? (openBlock(), createElementBlock("div", _hoisted_4$p)) : createCommentVNode("", true)
@@ -3283,7 +3291,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
3283
3291
  const TaoLoader = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-49a9f1b2"]]);
3284
3292
  const _hoisted_1$C = { class: "tao-image" };
3285
3293
  const _hoisted_2$z = ["src", "alt", "loading"];
3286
- const _hoisted_3$s = { class: "tao-image__placeholder" };
3294
+ const _hoisted_3$t = { class: "tao-image__placeholder" };
3287
3295
  const _sfc_main$F = /* @__PURE__ */ defineComponent({
3288
3296
  ...{ name: "TaoImage" },
3289
3297
  __name: "TaoImage",
@@ -3328,7 +3336,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
3328
3336
  onError: handleError
3329
3337
  }, null, 42, _hoisted_2$z)) : createCommentVNode("", true),
3330
3338
  !__props.src || hasError.value ? renderSlot(_ctx.$slots, "default", {}, () => [
3331
- createElementVNode("div", _hoisted_3$s, toDisplayString(__props.placeholderText), 1)
3339
+ createElementVNode("div", _hoisted_3$t, toDisplayString(__props.placeholderText), 1)
3332
3340
  ], true, 1) : createCommentVNode("", true)
3333
3341
  ]);
3334
3342
  };
@@ -3337,7 +3345,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
3337
3345
  const TaoImage = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-61f47c52"]]);
3338
3346
  const _hoisted_1$B = ["for"];
3339
3347
  const _hoisted_2$y = ["id", "checked", "disabled", "aria-checked", "aria-invalid", "aria-describedby"];
3340
- const _hoisted_3$r = {
3348
+ const _hoisted_3$s = {
3341
3349
  key: 0,
3342
3350
  class: "tao-checkbox__label"
3343
3351
  };
@@ -3425,7 +3433,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
3425
3433
  onChange: onInputChange
3426
3434
  }, null, 40, _hoisted_2$y),
3427
3435
  _cache[0] || (_cache[0] = createElementVNode("span", { class: "tao-checkbox__box" }, null, -1)),
3428
- __props.label ? (openBlock(), createElementBlock("span", _hoisted_3$r, toDisplayString(__props.label), 1)) : (openBlock(), createElementBlock("span", _hoisted_4$o, [
3436
+ __props.label ? (openBlock(), createElementBlock("span", _hoisted_3$s, toDisplayString(__props.label), 1)) : (openBlock(), createElementBlock("span", _hoisted_4$o, [
3429
3437
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
3430
3438
  ])),
3431
3439
  renderSlot(_ctx.$slots, "post", { text: __props.label }, void 0, true)
@@ -3439,7 +3447,7 @@ const _hoisted_1$A = {
3439
3447
  class: "tao-tag__prefix"
3440
3448
  };
3441
3449
  const _hoisted_2$x = { class: "tao-tag__text" };
3442
- const _hoisted_3$q = ["aria-label"];
3450
+ const _hoisted_3$r = ["aria-label"];
3443
3451
  const _hoisted_4$n = { "aria-hidden": "true" };
3444
3452
  const _sfc_main$D = /* @__PURE__ */ defineComponent({
3445
3453
  ...{ name: "TaoTag" },
@@ -3511,7 +3519,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
3511
3519
  _cache[0] || (_cache[0] = createTextVNode("✕", -1))
3512
3520
  ], true)
3513
3521
  ])
3514
- ], 8, _hoisted_3$q)) : createCommentVNode("", true)
3522
+ ], 8, _hoisted_3$r)) : createCommentVNode("", true)
3515
3523
  ], 6);
3516
3524
  };
3517
3525
  }
@@ -3522,7 +3530,7 @@ const _hoisted_2$w = {
3522
3530
  key: 1,
3523
3531
  class: "tao-divider__text"
3524
3532
  };
3525
- const _hoisted_3$p = {
3533
+ const _hoisted_3$q = {
3526
3534
  key: 2,
3527
3535
  class: "tao-divider__line tao-divider__line--end"
3528
3536
  };
@@ -3565,7 +3573,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
3565
3573
  createTextVNode(toDisplayString(__props.text), 1)
3566
3574
  ], true)
3567
3575
  ])) : createCommentVNode("", true),
3568
- __props.variant !== "gap" && hasLabel.value ? (openBlock(), createElementBlock("span", _hoisted_3$p)) : createCommentVNode("", true)
3576
+ __props.variant !== "gap" && hasLabel.value ? (openBlock(), createElementBlock("span", _hoisted_3$q)) : createCommentVNode("", true)
3569
3577
  ], 10, _hoisted_1$z);
3570
3578
  };
3571
3579
  }
@@ -3817,13 +3825,23 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
3817
3825
  const TaoTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-fb037862"]]);
3818
3826
  const _hoisted_1$w = ["tabindex", "aria-label"];
3819
3827
  const _hoisted_2$t = { class: "tao-scroll-top__content" };
3828
+ const _hoisted_3$p = {
3829
+ key: 1,
3830
+ class: "tao-scroll-top__text",
3831
+ "aria-hidden": "true"
3832
+ };
3820
3833
  const RIPPLE_DURATION = 750;
3821
3834
  const _sfc_main$y = /* @__PURE__ */ defineComponent({
3822
- ...{ name: "TaoScrollTop" },
3835
+ ...{ name: "TaoScrollTop", inheritAttrs: false },
3823
3836
  __name: "TaoScrollTop",
3824
3837
  props: {
3838
+ variant: { default: "solid" },
3839
+ side: { default: "right" },
3840
+ offset: { default: void 0 },
3841
+ label: { default: void 0 },
3842
+ labelSide: { default: void 0 },
3825
3843
  size: { default: 40 },
3826
- right: { default: 24 },
3844
+ right: { default: void 0 },
3827
3845
  bottom: { default: 24 },
3828
3846
  zIndex: { default: 1e3 },
3829
3847
  boundary: { default: 300 },
@@ -3834,17 +3852,23 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
3834
3852
  },
3835
3853
  setup(__props) {
3836
3854
  const props = __props;
3837
- useLocaleText(props, "scrollTop");
3855
+ const l10n = useLocaleText(props, "scrollTop");
3838
3856
  const fmtProp = (value, unit = "px") => typeof value === "number" ? value + unit : value;
3839
3857
  let prevPos = 0;
3840
3858
  let activeBack = false;
3841
- const mainStyle = reactive({
3842
- width: fmtProp(props.size),
3843
- height: fmtProp(props.size),
3844
- right: fmtProp(props.right),
3859
+ const isText = computed(() => props.variant === "text");
3860
+ const wrapStyle = computed(() => ({
3861
+ [props.side]: fmtProp(props.offset ?? props.right ?? 24),
3845
3862
  bottom: fmtProp(props.bottom),
3846
3863
  zIndex: props.zIndex
3847
- });
3864
+ }));
3865
+ const mainStyle = computed(() => ({
3866
+ height: fmtProp(props.size),
3867
+ ...isText.value ? {} : { width: fmtProp(props.size) }
3868
+ }));
3869
+ const captionSide = computed(() => props.labelSide ?? (props.side === "right" ? "left" : "right"));
3870
+ const caption = computed(() => props.label ?? (isText.value ? l10n.value.ariaLabel : void 0));
3871
+ const accessibleName = computed(() => props.ariaLabel || props.label || l10n.value.ariaLabel);
3848
3872
  const rippleStyle = reactive({
3849
3873
  top: fmtProp(-1 * props.size),
3850
3874
  left: fmtProp(-1 * props.size),
@@ -3887,7 +3911,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
3887
3911
  isActive.value = tooFar && activeBack;
3888
3912
  }
3889
3913
  function onClick(e) {
3890
- if (!isRippleActive.value) {
3914
+ if (!isText.value && !isRippleActive.value) {
3891
3915
  const elTarget = e.currentTarget;
3892
3916
  if (elTarget) {
3893
3917
  const rect = elTarget.getBoundingClientRect();
@@ -3916,40 +3940,56 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
3916
3940
  return (_ctx, _cache) => {
3917
3941
  return openBlock(), createBlock(Transition, { name: "tao-scroll-top-fade" }, {
3918
3942
  default: withCtx(() => [
3919
- isActive.value ? (openBlock(), createElementBlock("button", {
3943
+ isActive.value ? (openBlock(), createElementBlock("div", {
3920
3944
  key: 0,
3921
- type: "button",
3922
- style: normalizeStyle(mainStyle),
3923
- tabindex: props.tabindex,
3924
- class: normalizeClass(["tao-scroll-top", { "tao-scroll-top--no-outline": (props.outline ?? props.hasOutline) === false }]),
3925
- "aria-label": props.ariaLabel,
3926
- onClick: withModifiers(onClick, ["prevent"])
3945
+ class: "tao-scroll-top-wrap",
3946
+ style: normalizeStyle(wrapStyle.value)
3927
3947
  }, [
3928
- createElementVNode("div", _hoisted_2$t, [
3929
- createElementVNode("div", {
3930
- class: normalizeClass([{ "tao-scroll-top__ripple--active": isRippleActive.value }, "tao-scroll-top__ripple"]),
3931
- style: normalizeStyle(rippleStyle)
3932
- }, null, 6),
3933
- renderSlot(_ctx.$slots, "default", {}, () => [
3934
- _cache[0] || (_cache[0] = createElementVNode("svg", {
3935
- class: "tao-scroll-top__icon",
3936
- viewBox: "0 0 24 24",
3937
- width: "16",
3938
- height: "16",
3939
- fill: "currentColor"
3940
- }, [
3941
- createElementVNode("path", { d: "M12 6l-7 7 1.4 1.4L12 8.8l5.6 5.6L19 13z" })
3942
- ], -1))
3943
- ], true)
3944
- ])
3945
- ], 14, _hoisted_1$w)) : createCommentVNode("", true)
3948
+ createElementVNode("button", mergeProps(_ctx.$attrs, {
3949
+ type: "button",
3950
+ style: mainStyle.value,
3951
+ tabindex: props.tabindex,
3952
+ class: ["tao-scroll-top", [
3953
+ `tao-scroll-top--${props.variant}`,
3954
+ { "tao-scroll-top--no-outline": (props.outline ?? props.hasOutline) === false },
3955
+ isText.value && `tao-scroll-top--caption-${captionSide.value}`
3956
+ ]],
3957
+ "aria-label": accessibleName.value,
3958
+ onClick: withModifiers(onClick, ["prevent"])
3959
+ }), [
3960
+ createElementVNode("span", _hoisted_2$t, [
3961
+ !isText.value ? (openBlock(), createElementBlock("span", {
3962
+ key: 0,
3963
+ class: normalizeClass([{ "tao-scroll-top__ripple--active": isRippleActive.value }, "tao-scroll-top__ripple"]),
3964
+ style: normalizeStyle(rippleStyle)
3965
+ }, null, 6)) : createCommentVNode("", true),
3966
+ isText.value && caption.value ? (openBlock(), createElementBlock("span", _hoisted_3$p, toDisplayString(caption.value), 1)) : createCommentVNode("", true),
3967
+ renderSlot(_ctx.$slots, "default", {}, () => [
3968
+ _cache[0] || (_cache[0] = createElementVNode("svg", {
3969
+ class: "tao-scroll-top__icon",
3970
+ viewBox: "0 0 24 24",
3971
+ width: "16",
3972
+ height: "16",
3973
+ fill: "currentColor"
3974
+ }, [
3975
+ createElementVNode("path", { d: "M12 6l-7 7 1.4 1.4L12 8.8l5.6 5.6L19 13z" })
3976
+ ], -1))
3977
+ ], true)
3978
+ ])
3979
+ ], 16, _hoisted_1$w),
3980
+ !isText.value && caption.value ? (openBlock(), createElementBlock("span", {
3981
+ key: 0,
3982
+ class: normalizeClass(["tao-scroll-top__label", `tao-scroll-top__label--${captionSide.value}`]),
3983
+ "aria-hidden": "true"
3984
+ }, toDisplayString(caption.value), 3)) : createCommentVNode("", true)
3985
+ ], 4)) : createCommentVNode("", true)
3946
3986
  ]),
3947
3987
  _: 3
3948
3988
  });
3949
3989
  };
3950
3990
  }
3951
3991
  });
3952
- const TaoScrollTop = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-89d2feaa"]]);
3992
+ const TaoScrollTop = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-89b8959a"]]);
3953
3993
  const _hoisted_1$v = { class: "tao-progress" };
3954
3994
  const _hoisted_2$s = {
3955
3995
  key: 0,