@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 +1 -1
- package/README.ru.md +1 -1
- package/dist/index.cjs +75 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.mjs +76 -34
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +69 -36
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -382,8 +382,8 @@ onChange?: ((value: boolean) => any) | undefined;
|
|
|
382
382
|
error: boolean;
|
|
383
383
|
label: string;
|
|
384
384
|
disabled: boolean;
|
|
385
|
-
modelValue: boolean;
|
|
386
385
|
value: boolean;
|
|
386
|
+
modelValue: boolean;
|
|
387
387
|
indeterminate: boolean;
|
|
388
388
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
389
389
|
|
|
@@ -1545,7 +1545,7 @@ peek?: number;
|
|
|
1545
1545
|
/** How many slides fit in the viewport. 5 = product strip. 1 = one card. */
|
|
1546
1546
|
perView?: number;
|
|
1547
1547
|
controls?: boolean;
|
|
1548
|
-
/** Interval in ms. 0 — off. Pauses on hover, focus, drag, and reduced motion. */
|
|
1548
|
+
/** Interval in ms. 0 — off. Pauses on hover, keyboard focus, drag, and reduced motion. */
|
|
1549
1549
|
autoplay?: number;
|
|
1550
1550
|
loop?: boolean;
|
|
1551
1551
|
/** Pips under the track: one per snap. Inactive are dots, the current one stretches into a pill. */
|
|
@@ -1578,7 +1578,7 @@ peek?: number;
|
|
|
1578
1578
|
/** How many slides fit in the viewport. 5 = product strip. 1 = one card. */
|
|
1579
1579
|
perView?: number;
|
|
1580
1580
|
controls?: boolean;
|
|
1581
|
-
/** Interval in ms. 0 — off. Pauses on hover, focus, drag, and reduced motion. */
|
|
1581
|
+
/** Interval in ms. 0 — off. Pauses on hover, keyboard focus, drag, and reduced motion. */
|
|
1582
1582
|
autoplay?: number;
|
|
1583
1583
|
loop?: boolean;
|
|
1584
1584
|
/** Pips under the track: one per snap. Inactive are dots, the current one stretches into a pill. */
|
|
@@ -1722,6 +1722,7 @@ shadowBottomOnly: boolean;
|
|
|
1722
1722
|
hover: boolean;
|
|
1723
1723
|
active: boolean;
|
|
1724
1724
|
overflow: boolean;
|
|
1725
|
+
flush: boolean;
|
|
1725
1726
|
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults_6<__VLS_TypePropsToRuntimeProps_6<Props_4>, {
|
|
1726
1727
|
padding: number;
|
|
1727
1728
|
radius: number;
|
|
@@ -1730,6 +1731,7 @@ shadowBottomOnly: boolean;
|
|
|
1730
1731
|
hover: boolean;
|
|
1731
1732
|
active: boolean;
|
|
1732
1733
|
overflow: boolean;
|
|
1734
|
+
flush: boolean;
|
|
1733
1735
|
}>>> & Readonly<{}>, {
|
|
1734
1736
|
padding: number | number[];
|
|
1735
1737
|
radius: number;
|
|
@@ -1738,6 +1740,7 @@ hover: boolean;
|
|
|
1738
1740
|
shadowBottomOnly: boolean;
|
|
1739
1741
|
active: boolean;
|
|
1740
1742
|
overflow: boolean;
|
|
1743
|
+
flush: boolean;
|
|
1741
1744
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
1742
1745
|
|
|
1743
1746
|
declare const __VLS_component_8: DefineComponent<ExtractPropTypes<__VLS_WithDefaults_7<__VLS_TypePropsToRuntimeProps_7<Props_5>, {
|
|
@@ -2445,6 +2448,7 @@ declare function __VLS_template_6(): {
|
|
|
2445
2448
|
|
|
2446
2449
|
declare function __VLS_template_7(): {
|
|
2447
2450
|
cover?(_: {}): any;
|
|
2451
|
+
overlay?(_: {}): any;
|
|
2448
2452
|
headerTitle?(_: {}): any;
|
|
2449
2453
|
header?(_: {}): any;
|
|
2450
2454
|
headerSecondary?(_: {}): any;
|
|
@@ -3762,6 +3766,8 @@ declare interface Props_4 {
|
|
|
3762
3766
|
hover?: boolean;
|
|
3763
3767
|
active?: boolean;
|
|
3764
3768
|
overflow?: boolean;
|
|
3769
|
+
/** Плитка: без отступа и без тени, cover/body тянутся на ячейку. */
|
|
3770
|
+
flush?: boolean;
|
|
3765
3771
|
}
|
|
3766
3772
|
|
|
3767
3773
|
declare interface Props_5 {
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, openBlock, createElementBlock, normalizeClass, createCommentVNode, toDisplayString, createElementVNode, renderSlot, computed, normalizeStyle, inject, useId, ref, unref, watch, createTextVNode, onBeforeUnmount, createBlock, Teleport, createVNode, Transition, withCtx, withModifiers, nextTick, Fragment, renderList, onMounted, provide, resolveDynamicComponent, useCssVars,
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, createCommentVNode, toDisplayString, createElementVNode, renderSlot, computed, normalizeStyle, inject, useId, ref, unref, watch, createTextVNode, useSlots, onBeforeUnmount, createBlock, Teleport, createVNode, Transition, withCtx, withModifiers, nextTick, Fragment, renderList, onMounted, provide, resolveDynamicComponent, useCssVars, reactive, onBeforeMount, withDirectives, vModelText, getCurrentInstance, mergeProps, TransitionGroup, onUpdated, createApp } from "vue";
|
|
2
2
|
const _hoisted_1$P = ["type", "disabled"];
|
|
3
3
|
const _hoisted_2$I = {
|
|
4
4
|
key: 0,
|
|
@@ -624,26 +624,34 @@ const _hoisted_1$K = {
|
|
|
624
624
|
};
|
|
625
625
|
const _hoisted_2$D = {
|
|
626
626
|
key: 0,
|
|
627
|
-
class: "tao-
|
|
627
|
+
class: "tao-card__overlay"
|
|
628
|
+
};
|
|
629
|
+
const _hoisted_3$w = {
|
|
630
|
+
key: 1,
|
|
631
|
+
class: "tao-card__overlay"
|
|
628
632
|
};
|
|
629
|
-
const _hoisted_3$w = { key: 0 };
|
|
630
633
|
const _hoisted_4$r = {
|
|
634
|
+
key: 0,
|
|
635
|
+
class: "tao-card__header-title"
|
|
636
|
+
};
|
|
637
|
+
const _hoisted_5$j = { key: 0 };
|
|
638
|
+
const _hoisted_6$f = {
|
|
631
639
|
key: 2,
|
|
632
640
|
class: "tao-card__title-block"
|
|
633
641
|
};
|
|
634
|
-
const
|
|
642
|
+
const _hoisted_7$c = {
|
|
635
643
|
key: 0,
|
|
636
644
|
class: "tao-card__title"
|
|
637
645
|
};
|
|
638
|
-
const
|
|
646
|
+
const _hoisted_8$b = {
|
|
639
647
|
key: 1,
|
|
640
648
|
class: "tao-card__sub"
|
|
641
649
|
};
|
|
642
|
-
const
|
|
650
|
+
const _hoisted_9$5 = {
|
|
643
651
|
key: 3,
|
|
644
652
|
class: "tao-card__body"
|
|
645
653
|
};
|
|
646
|
-
const
|
|
654
|
+
const _hoisted_10$5 = {
|
|
647
655
|
key: 4,
|
|
648
656
|
class: "tao-card__footer"
|
|
649
657
|
};
|
|
@@ -657,36 +665,54 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
|
657
665
|
shadowBottomOnly: { type: Boolean, default: false },
|
|
658
666
|
hover: { type: Boolean, default: false },
|
|
659
667
|
active: { type: Boolean, default: false },
|
|
660
|
-
overflow: { type: Boolean, default: false }
|
|
668
|
+
overflow: { type: Boolean, default: false },
|
|
669
|
+
flush: { type: Boolean, default: false }
|
|
661
670
|
},
|
|
662
671
|
setup(__props) {
|
|
663
672
|
const props = __props;
|
|
673
|
+
const slots = useSlots();
|
|
674
|
+
const hasContent = computed(
|
|
675
|
+
() => Boolean(slots.headerTitle) || Boolean(slots.header) || Boolean(slots.headerSecondary) || Boolean(slots.title) || Boolean(slots.sub) || Boolean(slots.default) || Boolean(slots.footer)
|
|
676
|
+
);
|
|
677
|
+
const coverOnly = computed(() => Boolean(slots.cover) && !hasContent.value);
|
|
664
678
|
const paddingStyle = computed(() => {
|
|
679
|
+
if (props.flush) {
|
|
680
|
+
return { padding: "0" };
|
|
681
|
+
}
|
|
665
682
|
if (Array.isArray(props.padding)) {
|
|
666
683
|
return { padding: `${props.padding.map((p) => `${p}px`).join(" ")}` };
|
|
667
684
|
}
|
|
668
685
|
return { padding: `${props.padding}px` };
|
|
669
686
|
});
|
|
670
687
|
const radiusStyle = computed(() => ({ borderRadius: `${props.radius}px` }));
|
|
688
|
+
const showPanelShadow = computed(() => props.shadow && !props.shadowBottomOnly && !props.flush);
|
|
671
689
|
return (_ctx, _cache) => {
|
|
672
690
|
return openBlock(), createElementBlock("div", {
|
|
673
691
|
class: normalizeClass(["tao-card", {
|
|
674
|
-
"tao-card--shadow":
|
|
692
|
+
"tao-card--shadow": showPanelShadow.value,
|
|
675
693
|
"tao-card--shadow-bottom": __props.shadowBottomOnly,
|
|
676
694
|
"tao-card--hover": __props.hover,
|
|
677
695
|
"tao-card--active": __props.active,
|
|
678
|
-
"tao-card--overflow": __props.overflow
|
|
696
|
+
"tao-card--overflow": __props.overflow,
|
|
697
|
+
"tao-card--flush": __props.flush,
|
|
698
|
+
"tao-card--cover-only": coverOnly.value
|
|
679
699
|
}]),
|
|
680
700
|
style: normalizeStyle(radiusStyle.value)
|
|
681
701
|
}, [
|
|
682
702
|
_ctx.$slots.cover ? (openBlock(), createElementBlock("div", _hoisted_1$K, [
|
|
683
|
-
renderSlot(_ctx.$slots, "cover", {}, void 0, true)
|
|
703
|
+
renderSlot(_ctx.$slots, "cover", {}, void 0, true),
|
|
704
|
+
_ctx.$slots.overlay ? (openBlock(), createElementBlock("div", _hoisted_2$D, [
|
|
705
|
+
renderSlot(_ctx.$slots, "overlay", {}, void 0, true)
|
|
706
|
+
])) : createCommentVNode("", true)
|
|
707
|
+
])) : _ctx.$slots.overlay ? (openBlock(), createElementBlock("div", _hoisted_3$w, [
|
|
708
|
+
renderSlot(_ctx.$slots, "overlay", {}, void 0, true)
|
|
684
709
|
])) : createCommentVNode("", true),
|
|
685
|
-
|
|
710
|
+
hasContent.value ? (openBlock(), createElementBlock("div", {
|
|
711
|
+
key: 2,
|
|
686
712
|
class: "tao-card__content",
|
|
687
713
|
style: normalizeStyle(paddingStyle.value)
|
|
688
714
|
}, [
|
|
689
|
-
_ctx.$slots.headerTitle ? (openBlock(), createElementBlock("h2",
|
|
715
|
+
_ctx.$slots.headerTitle ? (openBlock(), createElementBlock("h2", _hoisted_4$r, [
|
|
690
716
|
renderSlot(_ctx.$slots, "headerTitle", {}, void 0, true)
|
|
691
717
|
])) : createCommentVNode("", true),
|
|
692
718
|
_ctx.$slots.header || _ctx.$slots.headerSecondary ? (openBlock(), createElementBlock("div", {
|
|
@@ -696,30 +722,30 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
|
696
722
|
createElementVNode("span", null, [
|
|
697
723
|
renderSlot(_ctx.$slots, "header", {}, void 0, true)
|
|
698
724
|
]),
|
|
699
|
-
_ctx.$slots.headerSecondary ? (openBlock(), createElementBlock("span",
|
|
725
|
+
_ctx.$slots.headerSecondary ? (openBlock(), createElementBlock("span", _hoisted_5$j, [
|
|
700
726
|
renderSlot(_ctx.$slots, "headerSecondary", {}, void 0, true)
|
|
701
727
|
])) : createCommentVNode("", true)
|
|
702
728
|
], 2)) : createCommentVNode("", true),
|
|
703
|
-
_ctx.$slots.title || _ctx.$slots.sub ? (openBlock(), createElementBlock("div",
|
|
704
|
-
_ctx.$slots.title ? (openBlock(), createElementBlock("h2",
|
|
729
|
+
_ctx.$slots.title || _ctx.$slots.sub ? (openBlock(), createElementBlock("div", _hoisted_6$f, [
|
|
730
|
+
_ctx.$slots.title ? (openBlock(), createElementBlock("h2", _hoisted_7$c, [
|
|
705
731
|
renderSlot(_ctx.$slots, "title", {}, void 0, true)
|
|
706
732
|
])) : createCommentVNode("", true),
|
|
707
|
-
_ctx.$slots.sub ? (openBlock(), createElementBlock("div",
|
|
733
|
+
_ctx.$slots.sub ? (openBlock(), createElementBlock("div", _hoisted_8$b, [
|
|
708
734
|
renderSlot(_ctx.$slots, "sub", {}, void 0, true)
|
|
709
735
|
])) : createCommentVNode("", true)
|
|
710
736
|
])) : createCommentVNode("", true),
|
|
711
|
-
_ctx.$slots.default ? (openBlock(), createElementBlock("div",
|
|
737
|
+
_ctx.$slots.default ? (openBlock(), createElementBlock("div", _hoisted_9$5, [
|
|
712
738
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
713
739
|
])) : createCommentVNode("", true),
|
|
714
|
-
_ctx.$slots.footer ? (openBlock(), createElementBlock("div",
|
|
740
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_10$5, [
|
|
715
741
|
renderSlot(_ctx.$slots, "footer", {}, void 0, true)
|
|
716
742
|
])) : createCommentVNode("", true)
|
|
717
|
-
], 4)
|
|
743
|
+
], 4)) : createCommentVNode("", true)
|
|
718
744
|
], 6);
|
|
719
745
|
};
|
|
720
746
|
}
|
|
721
747
|
});
|
|
722
|
-
const TaoCard = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-
|
|
748
|
+
const TaoCard = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-f4fc87bb"]]);
|
|
723
749
|
const FOCUSABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
724
750
|
function getFocusable(root) {
|
|
725
751
|
return [...root.querySelectorAll(FOCUSABLE)].filter(
|
|
@@ -7230,6 +7256,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7230
7256
|
let dragMoved = 0;
|
|
7231
7257
|
let dragPointer = -1;
|
|
7232
7258
|
let scrollFrame = 0;
|
|
7259
|
+
let focusFrame = 0;
|
|
7233
7260
|
let autoplayTimer = 0;
|
|
7234
7261
|
const step = computed(() => Math.max(1, Math.round(props.perView)));
|
|
7235
7262
|
const lastIndex = computed(() => Math.max(count.value - step.value, 0));
|
|
@@ -7338,18 +7365,32 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7338
7365
|
hoverPaused.value = false;
|
|
7339
7366
|
syncAutoplay();
|
|
7340
7367
|
}
|
|
7341
|
-
function
|
|
7342
|
-
|
|
7343
|
-
|
|
7368
|
+
function hasKeyboardFocus(root) {
|
|
7369
|
+
const active = document.activeElement;
|
|
7370
|
+
if (!(active instanceof HTMLElement) || !root.contains(active)) {
|
|
7371
|
+
return false;
|
|
7372
|
+
}
|
|
7373
|
+
try {
|
|
7374
|
+
return active.matches(":focus-visible");
|
|
7375
|
+
} catch {
|
|
7376
|
+
return true;
|
|
7377
|
+
}
|
|
7344
7378
|
}
|
|
7345
|
-
function
|
|
7379
|
+
function scheduleFocusPause(event) {
|
|
7346
7380
|
const root = event.currentTarget;
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
|
|
7381
|
+
cancelAnimationFrame(focusFrame);
|
|
7382
|
+
focusFrame = requestAnimationFrame(() => {
|
|
7383
|
+
if (!track.value) {
|
|
7384
|
+
return;
|
|
7385
|
+
}
|
|
7386
|
+
const next = hasKeyboardFocus(root);
|
|
7387
|
+
focusPaused.value = next;
|
|
7388
|
+
if (next) {
|
|
7389
|
+
stopAutoplay();
|
|
7390
|
+
return;
|
|
7391
|
+
}
|
|
7392
|
+
syncAutoplay();
|
|
7393
|
+
});
|
|
7353
7394
|
}
|
|
7354
7395
|
function onScroll() {
|
|
7355
7396
|
if (dragging.value) {
|
|
@@ -7486,6 +7527,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7486
7527
|
onBeforeUnmount(() => {
|
|
7487
7528
|
endDrag();
|
|
7488
7529
|
cancelAnimationFrame(scrollFrame);
|
|
7530
|
+
cancelAnimationFrame(focusFrame);
|
|
7489
7531
|
stopAutoplay();
|
|
7490
7532
|
document.removeEventListener("visibilitychange", onVisibilityChange);
|
|
7491
7533
|
window.removeEventListener("blur", onWindowBlur);
|
|
@@ -7497,8 +7539,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7497
7539
|
style: normalizeStyle(trackStyle.value),
|
|
7498
7540
|
onMouseenter: onMouseEnter,
|
|
7499
7541
|
onMouseleave: onMouseLeave,
|
|
7500
|
-
onFocusin:
|
|
7501
|
-
onFocusout:
|
|
7542
|
+
onFocusin: scheduleFocusPause,
|
|
7543
|
+
onFocusout: scheduleFocusPause
|
|
7502
7544
|
}, [
|
|
7503
7545
|
createElementVNode("div", _hoisted_1$4, [
|
|
7504
7546
|
renderSlot(_ctx.$slots, "prev", {
|
|
@@ -7621,7 +7663,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
7621
7663
|
};
|
|
7622
7664
|
}
|
|
7623
7665
|
});
|
|
7624
|
-
const TaoCarousel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
7666
|
+
const TaoCarousel = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-b4139b57"]]);
|
|
7625
7667
|
const _hoisted_1$3 = ["aria-label"];
|
|
7626
7668
|
const _hoisted_2$2 = ["aria-label"];
|
|
7627
7669
|
const _hoisted_3$2 = {
|