@1337exp/taoui 1.10.2 → 1.10.4

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 CHANGED
@@ -11,7 +11,7 @@ change a handful of CSS variables and the whole kit follows.
11
11
 
12
12
  - **TaoBlock** — container with padding and radius
13
13
  - **TaoButton** — `primary` / `secondary` / `ghost` / `text` / `danger`. `tone` tints ghost and text (danger, success, warning, info)
14
- - **TaoCard** — card with cover / header / footer slots. `#cover` can be a photo or `TaoCarousel`
14
+ - **TaoCard** — card with cover / header / footer slots. `#cover` can be a photo or `TaoCarousel`. `flush` is a tile (no padding/shadow, fills the cell); `#overlay` is a scrim on the cover
15
15
  - **TaoCopy** — clipboard icon. After a click, a “Copied” tooltip; if the trigger is gone, the tooltip is too
16
16
  - **TaoInput** — text field with v-model, validation, and `#prefix` / `#suffix` slots (icon or text inside the frame)
17
17
  - **TaoInputGroup** — outer glue: `#before` | field | `#after` (protocol, unit, button)
package/README.ru.md CHANGED
@@ -11,7 +11,7 @@
11
11
 
12
12
  - **TaoBlock** — базовый контейнер с настраиваемыми отступами и скруглением
13
13
  - **TaoButton** — кнопка: `primary` / `secondary` / `ghost` / `text` / `danger`. `tone` красит ghost и text (danger, success, warning, info)
14
- - **TaoCard** — карточка со слотами cover / header / footer. В `#cover` — фото или `TaoCarousel`
14
+ - **TaoCard** — карточка со слотами cover / header / footer. В `#cover` — фото или `TaoCarousel`. `flush` — плитка без padding/тени на всю ячейку; `#overlay` — scrim на обложке
15
15
  - **TaoCopy** — иконка копирования в буфер. После клика сверху тултип «Скопировано»; если кнопку убрали — тултип тоже
16
16
  - **TaoInput** — поле ввода с поддержкой v-model, валидации и слотов `#prefix` / `#suffix` (иконка или текст внутри рамки)
17
17
  - **TaoInputGroup** — склейка снаружи: `#before` | поле | `#after` (протокол, единица, кнопка)
package/dist/index.cjs CHANGED
@@ -627,26 +627,34 @@
627
627
  };
628
628
  const _hoisted_2$D = {
629
629
  key: 0,
630
- class: "tao-card__header-title"
630
+ class: "tao-card__overlay"
631
+ };
632
+ const _hoisted_3$w = {
633
+ key: 1,
634
+ class: "tao-card__overlay"
631
635
  };
632
- const _hoisted_3$w = { key: 0 };
633
636
  const _hoisted_4$r = {
637
+ key: 0,
638
+ class: "tao-card__header-title"
639
+ };
640
+ const _hoisted_5$j = { key: 0 };
641
+ const _hoisted_6$f = {
634
642
  key: 2,
635
643
  class: "tao-card__title-block"
636
644
  };
637
- const _hoisted_5$j = {
645
+ const _hoisted_7$c = {
638
646
  key: 0,
639
647
  class: "tao-card__title"
640
648
  };
641
- const _hoisted_6$f = {
649
+ const _hoisted_8$b = {
642
650
  key: 1,
643
651
  class: "tao-card__sub"
644
652
  };
645
- const _hoisted_7$c = {
653
+ const _hoisted_9$5 = {
646
654
  key: 3,
647
655
  class: "tao-card__body"
648
656
  };
649
- const _hoisted_8$b = {
657
+ const _hoisted_10$5 = {
650
658
  key: 4,
651
659
  class: "tao-card__footer"
652
660
  };
@@ -660,36 +668,54 @@
660
668
  shadowBottomOnly: { type: Boolean, default: false },
661
669
  hover: { type: Boolean, default: false },
662
670
  active: { type: Boolean, default: false },
663
- overflow: { type: Boolean, default: false }
671
+ overflow: { type: Boolean, default: false },
672
+ flush: { type: Boolean, default: false }
664
673
  },
665
674
  setup(__props) {
666
675
  const props = __props;
676
+ const slots = vue.useSlots();
677
+ const hasContent = vue.computed(
678
+ () => Boolean(slots.headerTitle) || Boolean(slots.header) || Boolean(slots.headerSecondary) || Boolean(slots.title) || Boolean(slots.sub) || Boolean(slots.default) || Boolean(slots.footer)
679
+ );
680
+ const coverOnly = vue.computed(() => Boolean(slots.cover) && !hasContent.value);
667
681
  const paddingStyle = vue.computed(() => {
682
+ if (props.flush) {
683
+ return { padding: "0" };
684
+ }
668
685
  if (Array.isArray(props.padding)) {
669
686
  return { padding: `${props.padding.map((p) => `${p}px`).join(" ")}` };
670
687
  }
671
688
  return { padding: `${props.padding}px` };
672
689
  });
673
690
  const radiusStyle = vue.computed(() => ({ borderRadius: `${props.radius}px` }));
691
+ const showPanelShadow = vue.computed(() => props.shadow && !props.shadowBottomOnly && !props.flush);
674
692
  return (_ctx, _cache) => {
675
693
  return vue.openBlock(), vue.createElementBlock("div", {
676
694
  class: vue.normalizeClass(["tao-card", {
677
- "tao-card--shadow": __props.shadow && !__props.shadowBottomOnly,
695
+ "tao-card--shadow": showPanelShadow.value,
678
696
  "tao-card--shadow-bottom": __props.shadowBottomOnly,
679
697
  "tao-card--hover": __props.hover,
680
698
  "tao-card--active": __props.active,
681
- "tao-card--overflow": __props.overflow
699
+ "tao-card--overflow": __props.overflow,
700
+ "tao-card--flush": __props.flush,
701
+ "tao-card--cover-only": coverOnly.value
682
702
  }]),
683
703
  style: vue.normalizeStyle(radiusStyle.value)
684
704
  }, [
685
705
  _ctx.$slots.cover ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$K, [
686
- vue.renderSlot(_ctx.$slots, "cover", {}, void 0, true)
706
+ vue.renderSlot(_ctx.$slots, "cover", {}, void 0, true),
707
+ _ctx.$slots.overlay ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$D, [
708
+ vue.renderSlot(_ctx.$slots, "overlay", {}, void 0, true)
709
+ ])) : vue.createCommentVNode("", true)
710
+ ])) : _ctx.$slots.overlay ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$w, [
711
+ vue.renderSlot(_ctx.$slots, "overlay", {}, void 0, true)
687
712
  ])) : vue.createCommentVNode("", true),
688
- vue.createElementVNode("div", {
713
+ hasContent.value ? (vue.openBlock(), vue.createElementBlock("div", {
714
+ key: 2,
689
715
  class: "tao-card__content",
690
716
  style: vue.normalizeStyle(paddingStyle.value)
691
717
  }, [
692
- _ctx.$slots.headerTitle ? (vue.openBlock(), vue.createElementBlock("h2", _hoisted_2$D, [
718
+ _ctx.$slots.headerTitle ? (vue.openBlock(), vue.createElementBlock("h2", _hoisted_4$r, [
693
719
  vue.renderSlot(_ctx.$slots, "headerTitle", {}, void 0, true)
694
720
  ])) : vue.createCommentVNode("", true),
695
721
  _ctx.$slots.header || _ctx.$slots.headerSecondary ? (vue.openBlock(), vue.createElementBlock("div", {
@@ -699,30 +725,30 @@
699
725
  vue.createElementVNode("span", null, [
700
726
  vue.renderSlot(_ctx.$slots, "header", {}, void 0, true)
701
727
  ]),
702
- _ctx.$slots.headerSecondary ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$w, [
728
+ _ctx.$slots.headerSecondary ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5$j, [
703
729
  vue.renderSlot(_ctx.$slots, "headerSecondary", {}, void 0, true)
704
730
  ])) : vue.createCommentVNode("", true)
705
731
  ], 2)) : vue.createCommentVNode("", true),
706
- _ctx.$slots.title || _ctx.$slots.sub ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$r, [
707
- _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("h2", _hoisted_5$j, [
732
+ _ctx.$slots.title || _ctx.$slots.sub ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$f, [
733
+ _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("h2", _hoisted_7$c, [
708
734
  vue.renderSlot(_ctx.$slots, "title", {}, void 0, true)
709
735
  ])) : vue.createCommentVNode("", true),
710
- _ctx.$slots.sub ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$f, [
736
+ _ctx.$slots.sub ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8$b, [
711
737
  vue.renderSlot(_ctx.$slots, "sub", {}, void 0, true)
712
738
  ])) : vue.createCommentVNode("", true)
713
739
  ])) : vue.createCommentVNode("", true),
714
- _ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$c, [
740
+ _ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$5, [
715
741
  vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
716
742
  ])) : vue.createCommentVNode("", true),
717
- _ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8$b, [
743
+ _ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$5, [
718
744
  vue.renderSlot(_ctx.$slots, "footer", {}, void 0, true)
719
745
  ])) : vue.createCommentVNode("", true)
720
- ], 4)
746
+ ], 4)) : vue.createCommentVNode("", true)
721
747
  ], 6);
722
748
  };
723
749
  }
724
750
  });
725
- const TaoCard = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-2ff3d055"]]);
751
+ const TaoCard = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-f4fc87bb"]]);
726
752
  const FOCUSABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
727
753
  function getFocusable(root) {
728
754
  return [...root.querySelectorAll(FOCUSABLE)].filter(
@@ -7233,6 +7259,7 @@
7233
7259
  let dragMoved = 0;
7234
7260
  let dragPointer = -1;
7235
7261
  let scrollFrame = 0;
7262
+ let focusFrame = 0;
7236
7263
  let autoplayTimer = 0;
7237
7264
  const step = vue.computed(() => Math.max(1, Math.round(props.perView)));
7238
7265
  const lastIndex = vue.computed(() => Math.max(count.value - step.value, 0));
@@ -7341,18 +7368,32 @@
7341
7368
  hoverPaused.value = false;
7342
7369
  syncAutoplay();
7343
7370
  }
7344
- function onFocusIn() {
7345
- focusPaused.value = true;
7346
- stopAutoplay();
7371
+ function hasKeyboardFocus(root) {
7372
+ const active = document.activeElement;
7373
+ if (!(active instanceof HTMLElement) || !root.contains(active)) {
7374
+ return false;
7375
+ }
7376
+ try {
7377
+ return active.matches(":focus-visible");
7378
+ } catch {
7379
+ return true;
7380
+ }
7347
7381
  }
7348
- function onFocusOut(event) {
7382
+ function scheduleFocusPause(event) {
7349
7383
  const root = event.currentTarget;
7350
- const next = event.relatedTarget;
7351
- if (next && root.contains(next)) {
7352
- return;
7353
- }
7354
- focusPaused.value = false;
7355
- syncAutoplay();
7384
+ cancelAnimationFrame(focusFrame);
7385
+ focusFrame = requestAnimationFrame(() => {
7386
+ if (!track.value) {
7387
+ return;
7388
+ }
7389
+ const next = hasKeyboardFocus(root);
7390
+ focusPaused.value = next;
7391
+ if (next) {
7392
+ stopAutoplay();
7393
+ return;
7394
+ }
7395
+ syncAutoplay();
7396
+ });
7356
7397
  }
7357
7398
  function onScroll() {
7358
7399
  if (dragging.value) {
@@ -7489,6 +7530,7 @@
7489
7530
  vue.onBeforeUnmount(() => {
7490
7531
  endDrag();
7491
7532
  cancelAnimationFrame(scrollFrame);
7533
+ cancelAnimationFrame(focusFrame);
7492
7534
  stopAutoplay();
7493
7535
  document.removeEventListener("visibilitychange", onVisibilityChange);
7494
7536
  window.removeEventListener("blur", onWindowBlur);
@@ -7500,8 +7542,8 @@
7500
7542
  style: vue.normalizeStyle(trackStyle.value),
7501
7543
  onMouseenter: onMouseEnter,
7502
7544
  onMouseleave: onMouseLeave,
7503
- onFocusin: onFocusIn,
7504
- onFocusout: onFocusOut
7545
+ onFocusin: scheduleFocusPause,
7546
+ onFocusout: scheduleFocusPause
7505
7547
  }, [
7506
7548
  vue.createElementVNode("div", _hoisted_1$4, [
7507
7549
  vue.renderSlot(_ctx.$slots, "prev", {
@@ -7624,7 +7666,7 @@
7624
7666
  };
7625
7667
  }
7626
7668
  });
7627
- const TaoCarousel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-bc396e5d"]]);
7669
+ const TaoCarousel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-b4139b57"]]);
7628
7670
  const _hoisted_1$3 = ["aria-label"];
7629
7671
  const _hoisted_2$2 = ["aria-label"];
7630
7672
  const _hoisted_3$2 = {