@indielayer/ui 1.0.0-alpha.3 → 1.0.0-alpha.7
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 +25 -87
- package/lib/components/badge/Badge.vue.d.ts +5 -0
- package/lib/components/checkbox/Checkbox.vue.d.ts +1 -1
- package/lib/components/drawer/Drawer.vue.d.ts +3 -3
- package/lib/components/icon/Icon.vue.d.ts +5 -1
- package/lib/components/input/Input.vue.d.ts +4 -1
- package/lib/components/menu/Menu.vue.d.ts +16 -4
- package/lib/components/menu/MenuItem.vue.d.ts +18 -6
- package/lib/components/radio/Radio.vue.d.ts +1 -1
- package/lib/components/select/Select.vue.d.ts +1 -1
- package/lib/components/slider/Slider.vue.d.ts +1 -1
- package/lib/components/tab/Tab.vue.d.ts +8 -3
- package/lib/components/tab/TabGroup.vue.d.ts +20 -0
- package/lib/components/table/Table.vue.d.ts +1 -0
- package/lib/components/textarea/Textarea.vue.d.ts +6 -1
- package/lib/components/toggle/Toggle.vue.d.ts +1 -1
- package/lib/composables/colors.d.ts +1 -1
- package/lib/composables/css.d.ts +4 -4
- package/lib/create.d.ts +1 -0
- package/lib/index.cjs.js +2 -2
- package/lib/index.es.js +277 -88
- package/lib/style.css +1 -1
- package/lib/version.d.ts +1 -1
- package/package.json +15 -15
- package/src/components/badge/Badge.vue +13 -0
- package/src/components/button/Button.vue +4 -4
- package/src/components/checkbox/Checkbox.vue +1 -1
- package/src/components/container/Container.vue +1 -1
- package/src/components/icon/Icon.vue +77 -10
- package/src/components/input/Input.vue +5 -3
- package/src/components/link/Link.vue +1 -1
- package/src/components/menu/Menu.vue +8 -2
- package/src/components/menu/MenuItem.vue +25 -12
- package/src/components/modal/Modal.vue +3 -1
- package/src/components/radio/Radio.vue +4 -4
- package/src/components/scroll/Scroll.vue +1 -1
- package/src/components/select/Select.vue +0 -0
- package/src/components/tab/Tab.vue +52 -8
- package/src/components/tab/TabGroup.vue +25 -7
- package/src/components/table/Table.vue +2 -0
- package/src/components/textarea/Textarea.vue +4 -1
- package/src/components/toggle/Toggle.vue +1 -1
- package/src/create.ts +4 -2
- package/src/version.ts +1 -1
- package/volar.d.ts +1 -1
package/lib/index.es.js
CHANGED
|
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { inject, defineComponent, computed, openBlock, createBlock, resolveDynamicComponent, normalizeClass, normalizeStyle, withCtx, createElementBlock, renderSlot, createCommentVNode, Fragment, pushScopeId, popScopeId, createElementVNode, ref, watch, resolveComponent, toDisplayString, createVNode, renderList, createTextVNode, provide, onMounted, onUnmounted, withKeys, withModifiers, withDirectives, vModelCheckbox, Transition, vShow, getCurrentScope, onScopeDispose, getCurrentInstance, onBeforeMount, nextTick, unref, reactive, toRefs,
|
|
20
|
+
import { inject, defineComponent, computed, openBlock, createBlock, resolveDynamicComponent, normalizeClass, normalizeStyle, withCtx, createElementBlock, renderSlot, createCommentVNode, Fragment, pushScopeId, popScopeId, createElementVNode, ref, watchEffect, mergeProps, watch, resolveComponent, toDisplayString, createVNode, renderList, createTextVNode, provide, onMounted, onUnmounted, withKeys, withModifiers, withDirectives, vModelCheckbox, Transition, vShow, getCurrentScope, onScopeDispose, getCurrentInstance, onBeforeMount, nextTick, unref, reactive, toRefs, Teleport, toHandlers, TransitionGroup, useCssModule, vModelRadio, vModelSelect, onBeforeUnmount } from "vue";
|
|
21
21
|
const isHex = (hex) => /^#(?:[A-Fa-f0-9]{3}){1,2}$/.test(hex);
|
|
22
22
|
const isRGB = (rgb) => /^rgb[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*(?:,(?![)])|(?=[)]))){3}[)]$/.test(rgb);
|
|
23
23
|
const isRGBA = (rgba) => /^^rgba[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*,){3}\s*0*(?:\.\d+|1(?:\.0*)?)\s*[)]$/.test(rgba);
|
|
@@ -365,7 +365,7 @@ const tailwindColors = Object.freeze({
|
|
|
365
365
|
900: "#881337"
|
|
366
366
|
}
|
|
367
367
|
});
|
|
368
|
-
var version = "1.0.0-alpha.
|
|
368
|
+
var version = "1.0.0-alpha.7";
|
|
369
369
|
const injectTabKey = Symbol();
|
|
370
370
|
const injectFormKey = Symbol();
|
|
371
371
|
const injectIconsKey = Symbol();
|
|
@@ -536,7 +536,7 @@ const _hoisted_1$u = {
|
|
|
536
536
|
key: 0,
|
|
537
537
|
class: "flex-none pr-2"
|
|
538
538
|
};
|
|
539
|
-
const _hoisted_2$
|
|
539
|
+
const _hoisted_2$l = {
|
|
540
540
|
key: 1,
|
|
541
541
|
width: "24",
|
|
542
542
|
height: "24",
|
|
@@ -580,7 +580,7 @@ function _sfc_render$I(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
580
580
|
default: withCtx(() => [
|
|
581
581
|
_ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_1$u, [
|
|
582
582
|
renderSlot(_ctx.$slots, "icon", {}, void 0, true)
|
|
583
|
-
])) : _ctx.type ? (openBlock(), createElementBlock("svg", _hoisted_2$
|
|
583
|
+
])) : _ctx.type ? (openBlock(), createElementBlock("svg", _hoisted_2$l, [
|
|
584
584
|
_ctx.type === "info" ? (openBlock(), createElementBlock("path", _hoisted_3$f)) : createCommentVNode("", true),
|
|
585
585
|
_ctx.type === "success" ? (openBlock(), createElementBlock("path", _hoisted_4$d)) : createCommentVNode("", true),
|
|
586
586
|
_ctx.type === "error" ? (openBlock(), createElementBlock("path", _hoisted_5$7)) : createCommentVNode("", true),
|
|
@@ -637,7 +637,8 @@ const _sfc_main$H = defineComponent({
|
|
|
637
637
|
}
|
|
638
638
|
}),
|
|
639
639
|
setup(props) {
|
|
640
|
-
const icons = inject(injectIconsKey, {
|
|
640
|
+
const icons = inject(injectIconsKey, () => {
|
|
641
|
+
}, false);
|
|
641
642
|
const sizeClasses = computed(() => {
|
|
642
643
|
if (props.size === "xs")
|
|
643
644
|
return "h-3 w-3";
|
|
@@ -649,24 +650,77 @@ const _sfc_main$H = defineComponent({
|
|
|
649
650
|
return "h-9 w-9";
|
|
650
651
|
return "h-5 w-5";
|
|
651
652
|
});
|
|
653
|
+
const isWrapSVG = ref(false);
|
|
654
|
+
const computedIcon = ref("");
|
|
655
|
+
const computedFilled = ref(props.filled);
|
|
656
|
+
const computedViewBox = ref(props.viewBox);
|
|
657
|
+
const attrs = ref({});
|
|
658
|
+
watchEffect(() => {
|
|
659
|
+
const injectedIcon = icons[props.icon];
|
|
660
|
+
isWrapSVG.value = false;
|
|
661
|
+
computedIcon.value = injectedIcon;
|
|
662
|
+
if (injectedIcon) {
|
|
663
|
+
if (typeof injectedIcon === "string") {
|
|
664
|
+
if (injectedIcon.startsWith("<svg")) {
|
|
665
|
+
isWrapSVG.value = true;
|
|
666
|
+
const { content, attributes } = getSVG(injectedIcon);
|
|
667
|
+
attrs.value = attributes;
|
|
668
|
+
computedIcon.value = content;
|
|
669
|
+
} else {
|
|
670
|
+
isWrapSVG.value = false;
|
|
671
|
+
computedIcon.value = injectedIcon;
|
|
672
|
+
}
|
|
673
|
+
} else if (typeof injectedIcon === "object") {
|
|
674
|
+
computedIcon.value = injectedIcon.icon;
|
|
675
|
+
computedFilled.value = injectedIcon.filled || props.filled;
|
|
676
|
+
computedViewBox.value = injectedIcon.viewBox || injectedIcon.viewbox || props.viewBox;
|
|
677
|
+
}
|
|
678
|
+
} else {
|
|
679
|
+
computedIcon.value = props.icon;
|
|
680
|
+
}
|
|
681
|
+
});
|
|
682
|
+
function getSVG(svgString) {
|
|
683
|
+
svgString = svgString.trim();
|
|
684
|
+
const content = svgString.substring(svgString.indexOf(">") + 1, svgString.lastIndexOf("</svg>"));
|
|
685
|
+
const attrsRaw = svgString.substring(svgString.indexOf("<svg") + 4, svgString.indexOf(">")).trim().match(/[\w-]+="[^"]*"/g);
|
|
686
|
+
const attributes = {};
|
|
687
|
+
attrsRaw == null ? void 0 : attrsRaw.forEach((a) => {
|
|
688
|
+
const [attribute, value] = a.split("=");
|
|
689
|
+
if (!["height", "width", "class"].includes(attribute))
|
|
690
|
+
attributes[attribute] = value.replace(/(^"|"$)/g, "");
|
|
691
|
+
});
|
|
692
|
+
return {
|
|
693
|
+
attributes,
|
|
694
|
+
content
|
|
695
|
+
};
|
|
696
|
+
}
|
|
652
697
|
return {
|
|
653
|
-
|
|
698
|
+
attrs,
|
|
699
|
+
isWrapSVG,
|
|
700
|
+
computedIcon,
|
|
701
|
+
computedFilled,
|
|
702
|
+
computedViewBox,
|
|
654
703
|
sizeClasses
|
|
655
704
|
};
|
|
656
705
|
}
|
|
657
706
|
});
|
|
658
|
-
const _hoisted_1$t = ["
|
|
707
|
+
const _hoisted_1$t = ["innerHTML"];
|
|
708
|
+
const _hoisted_2$k = ["stroke-linejoin", "stroke-linecap", "stroke", "fill", "viewBox", "innerHTML"];
|
|
659
709
|
function _sfc_render$H(_ctx, _cache, $props, $setup, $data, $options) {
|
|
660
|
-
return openBlock(), createElementBlock("svg", {
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
"stroke-linecap": _ctx.filled ? void 0 : "round",
|
|
666
|
-
"stroke-linejoin": _ctx.filled ? void 0 : "round",
|
|
710
|
+
return _ctx.isWrapSVG ? (openBlock(), createElementBlock("svg", mergeProps({
|
|
711
|
+
key: 0,
|
|
712
|
+
class: ["inline", _ctx.sizeClasses]
|
|
713
|
+
}, _ctx.attrs, { innerHTML: _ctx.computedIcon }), null, 16, _hoisted_1$t)) : (openBlock(), createElementBlock("svg", {
|
|
714
|
+
key: 1,
|
|
667
715
|
xmlns: "http://www.w3.org/2000/svg",
|
|
668
|
-
|
|
669
|
-
|
|
716
|
+
class: normalizeClass(["inline", [_ctx.sizeClasses, { "stroke-2": !_ctx.computedFilled }]]),
|
|
717
|
+
"stroke-linejoin": _ctx.computedFilled ? void 0 : "round",
|
|
718
|
+
"stroke-linecap": _ctx.computedFilled ? void 0 : "round",
|
|
719
|
+
stroke: _ctx.computedFilled ? void 0 : "currentColor",
|
|
720
|
+
fill: _ctx.computedFilled ? "currentColor" : "none",
|
|
721
|
+
viewBox: _ctx.computedViewBox,
|
|
722
|
+
innerHTML: _ctx.computedIcon
|
|
723
|
+
}, null, 10, _hoisted_2$k));
|
|
670
724
|
}
|
|
671
725
|
var XIcon = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["render", _sfc_render$H]]);
|
|
672
726
|
const avatar = "_avatar_v7jzc_2";
|
|
@@ -802,6 +856,8 @@ const _sfc_main$F = defineComponent({
|
|
|
802
856
|
type: String,
|
|
803
857
|
default: "right"
|
|
804
858
|
},
|
|
859
|
+
offsetX: [Number, String],
|
|
860
|
+
offsetY: [Number, String],
|
|
805
861
|
animated: Boolean,
|
|
806
862
|
outlined: Boolean,
|
|
807
863
|
icon: String,
|
|
@@ -836,8 +892,17 @@ const _sfc_main$F = defineComponent({
|
|
|
836
892
|
}
|
|
837
893
|
return classes;
|
|
838
894
|
});
|
|
895
|
+
const offsetStyle = computed(() => {
|
|
896
|
+
const style = {};
|
|
897
|
+
if (props.offsetX)
|
|
898
|
+
style[props.align === "left" ? "marginLeft" : "marginRight"] = props.offsetX + "px";
|
|
899
|
+
if (props.offsetY)
|
|
900
|
+
style[props.position === "top" ? "marginTop" : "marginBottom"] = props.offsetY + "px";
|
|
901
|
+
return style;
|
|
902
|
+
});
|
|
839
903
|
return {
|
|
840
904
|
styles,
|
|
905
|
+
offsetStyle,
|
|
841
906
|
positionClasses
|
|
842
907
|
};
|
|
843
908
|
}
|
|
@@ -862,7 +927,8 @@ function _sfc_render$F(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
862
927
|
{
|
|
863
928
|
"border-2 border-gray-50 dark:border-gray-900": _ctx.outlined
|
|
864
929
|
}
|
|
865
|
-
]])
|
|
930
|
+
]]),
|
|
931
|
+
style: normalizeStyle(_ctx.offsetStyle)
|
|
866
932
|
}, [
|
|
867
933
|
_ctx.animated ? (openBlock(), createElementBlock("div", _hoisted_2$i)) : createCommentVNode("", true),
|
|
868
934
|
createElementVNode("div", {
|
|
@@ -878,7 +944,7 @@ function _sfc_render$F(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
878
944
|
}, [
|
|
879
945
|
renderSlot(_ctx.$slots, "content")
|
|
880
946
|
], 2)
|
|
881
|
-
],
|
|
947
|
+
], 6)) : createCommentVNode("", true)
|
|
882
948
|
])
|
|
883
949
|
]),
|
|
884
950
|
_: 3
|
|
@@ -1095,11 +1161,11 @@ const _sfc_main$C = defineComponent({
|
|
|
1095
1161
|
hover: { bg: !props.loading ? gray[100] : "" },
|
|
1096
1162
|
active: { bg: !props.loading ? gray[200] : "" },
|
|
1097
1163
|
dark: {
|
|
1098
|
-
bg: gray[
|
|
1164
|
+
bg: gray[800],
|
|
1099
1165
|
text: "white",
|
|
1100
1166
|
border: gray[600],
|
|
1101
|
-
hover: { bg: !props.loading ? gray[
|
|
1102
|
-
active: { bg: !props.loading ? gray[
|
|
1167
|
+
hover: { bg: !props.loading ? gray[700] : "" },
|
|
1168
|
+
active: { bg: !props.loading ? gray[600] : "" }
|
|
1103
1169
|
}
|
|
1104
1170
|
}));
|
|
1105
1171
|
}
|
|
@@ -1349,7 +1415,7 @@ function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1349
1415
|
size: _ctx.computedSize,
|
|
1350
1416
|
icon: _ctx.iconRight,
|
|
1351
1417
|
class: normalizeClass(["shrink-0", [
|
|
1352
|
-
[_ctx.$slots.default ? "
|
|
1418
|
+
[_ctx.$slots.default ? "ml-2" : "m-0.5"],
|
|
1353
1419
|
{
|
|
1354
1420
|
invisible: _ctx.loading
|
|
1355
1421
|
}
|
|
@@ -1362,7 +1428,7 @@ function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1362
1428
|
const cssModules$7 = {
|
|
1363
1429
|
"$style": style0$7
|
|
1364
1430
|
};
|
|
1365
|
-
var XButton = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$C], ["__cssModules", cssModules$7], ["__scopeId", "data-v-
|
|
1431
|
+
var XButton = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$C], ["__cssModules", cssModules$7], ["__scopeId", "data-v-6cb75733"]]);
|
|
1366
1432
|
var style0$6 = {
|
|
1367
1433
|
"button-group": "_button-group_s7fyl_2",
|
|
1368
1434
|
"button-group--rounded": "_button-group--rounded_s7fyl_1"
|
|
@@ -1543,7 +1609,7 @@ const _sfc_main$z = defineComponent({
|
|
|
1543
1609
|
const checked = ref(false);
|
|
1544
1610
|
watch(() => props.modelValue, (value) => {
|
|
1545
1611
|
checked.value = !!value;
|
|
1546
|
-
});
|
|
1612
|
+
}, { immediate: true });
|
|
1547
1613
|
watch(() => checked.value, (value) => {
|
|
1548
1614
|
emit("update:modelValue", value);
|
|
1549
1615
|
});
|
|
@@ -1626,7 +1692,7 @@ const _sfc_main$z = defineComponent({
|
|
|
1626
1692
|
});
|
|
1627
1693
|
}
|
|
1628
1694
|
});
|
|
1629
|
-
const _withScopeId$2 = (n) => (pushScopeId("data-v-
|
|
1695
|
+
const _withScopeId$2 = (n) => (pushScopeId("data-v-05f49cb5"), n = n(), popScopeId(), n);
|
|
1630
1696
|
const _hoisted_1$p = { class: "inline-block relative cursor-pointer align-middle mb-1 pb-2" };
|
|
1631
1697
|
const _hoisted_2$g = ["aria-checked", "aria-disabled", "disabled", "name", "required"];
|
|
1632
1698
|
const _hoisted_3$d = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("path", { d: "M0 11l2-2 5 5L18 3l2 2L7 18z" }, null, -1));
|
|
@@ -1699,7 +1765,7 @@ function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1699
1765
|
const cssModules$5 = {
|
|
1700
1766
|
"$style": style0$5
|
|
1701
1767
|
};
|
|
1702
|
-
var Checkbox = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_render$z], ["__cssModules", cssModules$5], ["__scopeId", "data-v-
|
|
1768
|
+
var Checkbox = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_render$z], ["__cssModules", cssModules$5], ["__scopeId", "data-v-05f49cb5"]]);
|
|
1703
1769
|
const _sfc_main$y = defineComponent({
|
|
1704
1770
|
name: "XCollapse",
|
|
1705
1771
|
components: {
|
|
@@ -1888,7 +1954,7 @@ const _sfc_main$x = defineComponent({
|
|
|
1888
1954
|
}
|
|
1889
1955
|
});
|
|
1890
1956
|
function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1891
|
-
return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), { class: "
|
|
1957
|
+
return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), { class: "max-w-screen-2xl mx-auto px-4" }, {
|
|
1892
1958
|
default: withCtx(() => [
|
|
1893
1959
|
renderSlot(_ctx.$slots, "default")
|
|
1894
1960
|
]),
|
|
@@ -2339,6 +2405,48 @@ function useScroll(element, options = {}) {
|
|
|
2339
2405
|
directions
|
|
2340
2406
|
};
|
|
2341
2407
|
}
|
|
2408
|
+
var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
|
|
2409
|
+
var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
|
|
2410
|
+
var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
|
|
2411
|
+
var __objRest$1 = (source, exclude) => {
|
|
2412
|
+
var target = {};
|
|
2413
|
+
for (var prop in source)
|
|
2414
|
+
if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
2415
|
+
target[prop] = source[prop];
|
|
2416
|
+
if (source != null && __getOwnPropSymbols$6)
|
|
2417
|
+
for (var prop of __getOwnPropSymbols$6(source)) {
|
|
2418
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
|
|
2419
|
+
target[prop] = source[prop];
|
|
2420
|
+
}
|
|
2421
|
+
return target;
|
|
2422
|
+
};
|
|
2423
|
+
function useMutationObserver(target, callback, options) {
|
|
2424
|
+
const _a2 = options, { window: window2 = defaultWindow } = _a2, mutationOptions = __objRest$1(_a2, ["window"]);
|
|
2425
|
+
let observer;
|
|
2426
|
+
const isSupported = window2 && "MutationObserver" in window2;
|
|
2427
|
+
const cleanup = () => {
|
|
2428
|
+
if (observer) {
|
|
2429
|
+
observer.disconnect();
|
|
2430
|
+
observer = void 0;
|
|
2431
|
+
}
|
|
2432
|
+
};
|
|
2433
|
+
const stopWatch = watch(() => unrefElement(target), (el) => {
|
|
2434
|
+
cleanup();
|
|
2435
|
+
if (isSupported && window2 && el) {
|
|
2436
|
+
observer = new MutationObserver(callback);
|
|
2437
|
+
observer.observe(el, mutationOptions);
|
|
2438
|
+
}
|
|
2439
|
+
}, { immediate: true });
|
|
2440
|
+
const stop = () => {
|
|
2441
|
+
cleanup();
|
|
2442
|
+
stopWatch();
|
|
2443
|
+
};
|
|
2444
|
+
tryOnScopeDispose(stop);
|
|
2445
|
+
return {
|
|
2446
|
+
isSupported,
|
|
2447
|
+
stop
|
|
2448
|
+
};
|
|
2449
|
+
}
|
|
2342
2450
|
var SwipeDirection;
|
|
2343
2451
|
(function(SwipeDirection2) {
|
|
2344
2452
|
SwipeDirection2["UP"] = "UP";
|
|
@@ -2470,7 +2578,7 @@ const _sfc_main$v = defineComponent({
|
|
|
2470
2578
|
useResizeObserver(scrollEl, triggerScroll);
|
|
2471
2579
|
if (props.horizontal && props.mousewheel)
|
|
2472
2580
|
useEventListener(scrollEl, "wheel", (e) => {
|
|
2473
|
-
if (!scrollEl.value)
|
|
2581
|
+
if (!scrollEl.value || scrollEl.value.scrollWidth <= scrollEl.value.clientWidth)
|
|
2474
2582
|
return;
|
|
2475
2583
|
e.preventDefault();
|
|
2476
2584
|
scrollEl.value.scrollLeft += e.deltaY + e.deltaX;
|
|
@@ -2523,7 +2631,7 @@ function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2523
2631
|
const cssModules$4 = {
|
|
2524
2632
|
"$style": style0$4
|
|
2525
2633
|
};
|
|
2526
|
-
var XScroll = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$v], ["__cssModules", cssModules$4], ["__scopeId", "data-v-
|
|
2634
|
+
var XScroll = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$v], ["__cssModules", cssModules$4], ["__scopeId", "data-v-7362ac18"]]);
|
|
2527
2635
|
const _sfc_main$u = defineComponent({
|
|
2528
2636
|
name: "XDrawer",
|
|
2529
2637
|
components: {
|
|
@@ -2886,7 +2994,8 @@ const _sfc_main$r = defineComponent({
|
|
|
2886
2994
|
type: String,
|
|
2887
2995
|
default: "text"
|
|
2888
2996
|
},
|
|
2889
|
-
inputClass: String
|
|
2997
|
+
inputClass: String,
|
|
2998
|
+
block: Boolean
|
|
2890
2999
|
}),
|
|
2891
3000
|
emits: useInputtable.emits(),
|
|
2892
3001
|
setup(props, { emit }) {
|
|
@@ -2922,8 +3031,8 @@ const _sfc_main$r = defineComponent({
|
|
|
2922
3031
|
if (!e.target)
|
|
2923
3032
|
return;
|
|
2924
3033
|
const target = e.target;
|
|
2925
|
-
const value = Number(target.value);
|
|
2926
3034
|
if (props.type === "number") {
|
|
3035
|
+
const value = Number(target.value);
|
|
2927
3036
|
if (typeof props.min !== "undefined") {
|
|
2928
3037
|
if (value < props.min)
|
|
2929
3038
|
target.value = props.min.toString();
|
|
@@ -2963,7 +3072,7 @@ const _hoisted_8$1 = ["textContent"];
|
|
|
2963
3072
|
function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2964
3073
|
const _component_x_icon = resolveComponent("x-icon");
|
|
2965
3074
|
return openBlock(), createElementBlock("label", {
|
|
2966
|
-
class: normalizeClass(["inline-block relative align-bottom text-left", { "mb-3": _ctx.isInsideForm }])
|
|
3075
|
+
class: normalizeClass(["inline-block relative align-bottom text-left", { "mb-3": _ctx.isInsideForm, "w-full": _ctx.block }])
|
|
2967
3076
|
}, [
|
|
2968
3077
|
_ctx.label ? (openBlock(), createElementBlock("p", {
|
|
2969
3078
|
key: 0,
|
|
@@ -3001,7 +3110,7 @@ function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3001
3110
|
placeholder: _ctx.placeholder,
|
|
3002
3111
|
readonly: _ctx.readonly,
|
|
3003
3112
|
type: _ctx.currentType,
|
|
3004
|
-
value: _ctx.modelValue
|
|
3113
|
+
value: _ctx.modelValue || ""
|
|
3005
3114
|
}, _ctx.$attrs, toHandlers(_ctx.inputListeners), {
|
|
3006
3115
|
onChange: _cache[0] || (_cache[0] = (...args) => _ctx.onChange && _ctx.onChange(...args))
|
|
3007
3116
|
}), null, 16, _hoisted_3$b),
|
|
@@ -3080,7 +3189,7 @@ const _sfc_main$q = defineComponent({
|
|
|
3080
3189
|
};
|
|
3081
3190
|
}
|
|
3082
3191
|
});
|
|
3083
|
-
const _withScopeId$1 = (n) => (pushScopeId("data-v-
|
|
3192
|
+
const _withScopeId$1 = (n) => (pushScopeId("data-v-af336fea"), n = n(), popScopeId(), n);
|
|
3084
3193
|
const _hoisted_1$i = {
|
|
3085
3194
|
key: 0,
|
|
3086
3195
|
class: "inline-flex items-center"
|
|
@@ -3107,7 +3216,7 @@ const _hoisted_2$d = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ create
|
|
|
3107
3216
|
function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3108
3217
|
return openBlock(), createBlock(resolveDynamicComponent(_ctx.to ? "router-link" : _ctx.tag), {
|
|
3109
3218
|
to: _ctx.to,
|
|
3110
|
-
class: normalizeClass(["transition duration-300 ease-in-out cursor-pointer text-[color:var(--x-text)] dark:text-[color:var(--x-dark-text)]", [
|
|
3219
|
+
class: normalizeClass(["transition duration-300 ease-in-out cursor-pointer inline-flex text-[color:var(--x-text)] dark:text-[color:var(--x-dark-text)]", [
|
|
3111
3220
|
[_ctx.shadow ? _ctx.$style["link--shadow"] : ""],
|
|
3112
3221
|
{
|
|
3113
3222
|
"underline": _ctx.underline
|
|
@@ -3127,7 +3236,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3127
3236
|
const cssModules$3 = {
|
|
3128
3237
|
"$style": style0$3
|
|
3129
3238
|
};
|
|
3130
|
-
var XLink = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$q], ["__cssModules", cssModules$3], ["__scopeId", "data-v-
|
|
3239
|
+
var XLink = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$q], ["__cssModules", cssModules$3], ["__scopeId", "data-v-af336fea"]]);
|
|
3131
3240
|
var style0$2 = {
|
|
3132
3241
|
"menu-item": "_menu-item_1v1kj_2",
|
|
3133
3242
|
"menu-item--active": "_menu-item--active_1v1kj_1"
|
|
@@ -3156,8 +3265,14 @@ const _sfc_main$p = defineComponent({
|
|
|
3156
3265
|
icon: String,
|
|
3157
3266
|
iconRight: String,
|
|
3158
3267
|
loading: Boolean,
|
|
3159
|
-
rounded:
|
|
3160
|
-
|
|
3268
|
+
rounded: {
|
|
3269
|
+
type: Boolean,
|
|
3270
|
+
default: true
|
|
3271
|
+
},
|
|
3272
|
+
filled: {
|
|
3273
|
+
type: Boolean,
|
|
3274
|
+
default: true
|
|
3275
|
+
},
|
|
3161
3276
|
selected: Boolean,
|
|
3162
3277
|
disabled: Boolean
|
|
3163
3278
|
}),
|
|
@@ -3165,26 +3280,28 @@ const _sfc_main$p = defineComponent({
|
|
|
3165
3280
|
setup(props, { emit }) {
|
|
3166
3281
|
const elRef = ref();
|
|
3167
3282
|
const isActive = ref(false);
|
|
3168
|
-
const filled = computed(() =>
|
|
3283
|
+
const filled = computed(() => {
|
|
3284
|
+
var _a2;
|
|
3285
|
+
return props.filled || ((_a2 = props.item) == null ? void 0 : _a2.filled);
|
|
3286
|
+
});
|
|
3169
3287
|
const cItem = computed(() => __spreadValues(__spreadValues({}, props), props.item));
|
|
3170
3288
|
const htmlTag = cItem.value.to || cItem.value.href ? "x-link" : "div";
|
|
3171
|
-
const isSupported = window && "MutationObserver" in window;
|
|
3172
|
-
const classObserver = isSupported ? new MutationObserver(check) : null;
|
|
3173
3289
|
onMounted(() => {
|
|
3174
3290
|
if (!elRef.value)
|
|
3175
3291
|
return;
|
|
3176
3292
|
check();
|
|
3177
|
-
if (
|
|
3178
|
-
|
|
3293
|
+
if (htmlTag === "x-link")
|
|
3294
|
+
useMutationObserver(elRef.value.$el, check, {
|
|
3179
3295
|
attributes: true,
|
|
3180
3296
|
attributeFilter: ["class"]
|
|
3181
3297
|
});
|
|
3182
3298
|
});
|
|
3183
|
-
onBeforeUnmount(() => {
|
|
3184
|
-
if (classObserver)
|
|
3185
|
-
classObserver.disconnect();
|
|
3186
|
-
});
|
|
3187
3299
|
function onItemClick(e) {
|
|
3300
|
+
if (cItem.value.disabled) {
|
|
3301
|
+
e.stopPropagation();
|
|
3302
|
+
e.preventDefault();
|
|
3303
|
+
return;
|
|
3304
|
+
}
|
|
3188
3305
|
cItem.value.onClick && cItem.value.onClick(e);
|
|
3189
3306
|
emit("click", e);
|
|
3190
3307
|
}
|
|
@@ -3209,7 +3326,12 @@ const _sfc_main$p = defineComponent({
|
|
|
3209
3326
|
const color = colors.getPalette(cItem.value.color || "gray");
|
|
3210
3327
|
const gray = colors.getPalette("gray");
|
|
3211
3328
|
if (cItem.value.disabled)
|
|
3212
|
-
return css.
|
|
3329
|
+
return css.variables({
|
|
3330
|
+
text: gray[300],
|
|
3331
|
+
dark: {
|
|
3332
|
+
text: gray[600]
|
|
3333
|
+
}
|
|
3334
|
+
});
|
|
3213
3335
|
if (filled.value) {
|
|
3214
3336
|
if (isActive.value) {
|
|
3215
3337
|
return css.variables({
|
|
@@ -3303,7 +3425,7 @@ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3303
3425
|
href: _ctx.cItem.href,
|
|
3304
3426
|
target: _ctx.cItem.target,
|
|
3305
3427
|
color: _ctx.cItem.color,
|
|
3306
|
-
class: normalizeClass(["relative flex items-center whitespace-nowrap px-3 mt-1", [
|
|
3428
|
+
class: normalizeClass(["relative !flex items-center whitespace-nowrap px-3 mt-1", [
|
|
3307
3429
|
_ctx.$style["menu-item"],
|
|
3308
3430
|
[_ctx.isActive ? _ctx.$style["menu-item--active"] : ""],
|
|
3309
3431
|
{
|
|
@@ -3358,7 +3480,7 @@ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3358
3480
|
const cssModules$2 = {
|
|
3359
3481
|
"$style": style0$2
|
|
3360
3482
|
};
|
|
3361
|
-
var XMenuItem = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$p], ["__cssModules", cssModules$2], ["__scopeId", "data-v-
|
|
3483
|
+
var XMenuItem = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$p], ["__cssModules", cssModules$2], ["__scopeId", "data-v-295f8cb3"]]);
|
|
3362
3484
|
const _sfc_main$o = defineComponent({
|
|
3363
3485
|
name: "XMenu",
|
|
3364
3486
|
components: {
|
|
@@ -3375,8 +3497,14 @@ const _sfc_main$o = defineComponent({
|
|
|
3375
3497
|
collapseIcon: String,
|
|
3376
3498
|
expanded: Boolean,
|
|
3377
3499
|
disabled: Boolean,
|
|
3378
|
-
rounded:
|
|
3379
|
-
|
|
3500
|
+
rounded: {
|
|
3501
|
+
type: Boolean,
|
|
3502
|
+
default: true
|
|
3503
|
+
},
|
|
3504
|
+
filled: {
|
|
3505
|
+
type: Boolean,
|
|
3506
|
+
default: true
|
|
3507
|
+
}
|
|
3380
3508
|
}),
|
|
3381
3509
|
emits: ["expand"]
|
|
3382
3510
|
});
|
|
@@ -3467,7 +3595,8 @@ var Menu = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$o]])
|
|
|
3467
3595
|
const _sfc_main$n = defineComponent({
|
|
3468
3596
|
name: "XModal",
|
|
3469
3597
|
components: {
|
|
3470
|
-
XScroll
|
|
3598
|
+
XScroll,
|
|
3599
|
+
XIcon
|
|
3471
3600
|
},
|
|
3472
3601
|
props: {
|
|
3473
3602
|
size: {
|
|
@@ -3592,7 +3721,7 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3592
3721
|
}, [
|
|
3593
3722
|
_ctx.showClose ? (openBlock(), createElementBlock("div", {
|
|
3594
3723
|
key: 0,
|
|
3595
|
-
class: normalizeClass(["absolute p-1 top-4 right-4 rounded-full bg-opacity-10 hover:bg-opacity-30 cursor-pointer", [
|
|
3724
|
+
class: normalizeClass(["flex absolute p-1 top-4 z-10 right-4 rounded-full bg-opacity-10 hover:bg-opacity-30 cursor-pointer", [
|
|
3596
3725
|
_ctx.$slots.image ? "bg-gray-900 text-white" : "bg-gray-500 text-gray-800 dark:text-gray-300"
|
|
3597
3726
|
]]),
|
|
3598
3727
|
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.close && _ctx.close(...args))
|
|
@@ -4429,7 +4558,7 @@ const _sfc_main$g = defineComponent({
|
|
|
4429
4558
|
});
|
|
4430
4559
|
}
|
|
4431
4560
|
});
|
|
4432
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
|
4561
|
+
const _withScopeId = (n) => (pushScopeId("data-v-4e34dad2"), n = n(), popScopeId(), n);
|
|
4433
4562
|
const _hoisted_1$c = ["aria-selected", "aria-disabled"];
|
|
4434
4563
|
const _hoisted_2$8 = ["name", "required", "disabled"];
|
|
4435
4564
|
const _hoisted_3$6 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("circle", {
|
|
@@ -4446,10 +4575,11 @@ function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4446
4575
|
const _component_x_spinner = resolveComponent("x-spinner");
|
|
4447
4576
|
return openBlock(), createElementBlock("label", {
|
|
4448
4577
|
ref: "elRef",
|
|
4449
|
-
|
|
4578
|
+
tabindex: "0",
|
|
4579
|
+
class: "inline-block mb-1 relative cursor-pointer focus:outline-none group",
|
|
4450
4580
|
"aria-selected": _ctx.selected ? "true" : "false",
|
|
4451
4581
|
"aria-disabled": _ctx.disabled || _ctx.loading ? "true" : void 0,
|
|
4452
|
-
|
|
4582
|
+
style: normalizeStyle(_ctx.styles),
|
|
4453
4583
|
onKeypress: _cache[1] || (_cache[1] = withKeys(withModifiers(($event) => _ctx.$emit("update:modelValue", _ctx.value), ["prevent", "stop"]), ["space"]))
|
|
4454
4584
|
}, [
|
|
4455
4585
|
createElementVNode("div", {
|
|
@@ -4466,15 +4596,14 @@ function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4466
4596
|
[vModelRadio, _ctx.selected]
|
|
4467
4597
|
]),
|
|
4468
4598
|
createElementVNode("div", {
|
|
4469
|
-
class: normalizeClass(["rounded-full flex justify-center items-center flex-shrink-0 border-2 border-[color:var(--x-border)] bg-[color:var(--x-bg)] dark:border-[color:var(--x-dark-border)] dark:bg-[color:var(--x-dark-bg)]", [
|
|
4599
|
+
class: normalizeClass(["rounded-full flex justify-center items-center flex-shrink-0 border-2 outline-offset-2 outline-slate-300 dark:outline-slate-500 group-focus:outline-1 group-focus:outline border-[color:var(--x-border)] bg-[color:var(--x-bg)] dark:border-[color:var(--x-dark-border)] dark:bg-[color:var(--x-dark-bg)]", [
|
|
4470
4600
|
[_ctx.glow && !_ctx.disabled && !_ctx.loading ? _ctx.$style["radio--glow"] : ""],
|
|
4471
4601
|
{
|
|
4472
4602
|
"h-4 w-4": _ctx.size === "sm" || _ctx.size === "xs",
|
|
4473
4603
|
"h-5 w-5": !_ctx.size || !["xs", "sm", "xl"].includes(_ctx.size),
|
|
4474
4604
|
"h-6 w-6": _ctx.size === "xl"
|
|
4475
4605
|
}
|
|
4476
|
-
]])
|
|
4477
|
-
style: normalizeStyle(_ctx.styles)
|
|
4606
|
+
]])
|
|
4478
4607
|
}, [
|
|
4479
4608
|
_ctx.loading ? (openBlock(), createBlock(_component_x_spinner, {
|
|
4480
4609
|
key: 0,
|
|
@@ -4491,7 +4620,7 @@ function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4491
4620
|
}]),
|
|
4492
4621
|
viewBox: "0 0 20 20"
|
|
4493
4622
|
}, _hoisted_4$5, 2))
|
|
4494
|
-
],
|
|
4623
|
+
], 2),
|
|
4495
4624
|
_ctx.label ? (openBlock(), createElementBlock("span", {
|
|
4496
4625
|
key: 0,
|
|
4497
4626
|
class: normalizeClass(["font-medium text-gray-800 dark:text-gray-200 pl-2", {
|
|
@@ -4520,12 +4649,12 @@ function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4520
4649
|
class: "text-sm text-red-500 mt-1",
|
|
4521
4650
|
textContent: toDisplayString(_ctx.errorInternal)
|
|
4522
4651
|
}, null, 8, _hoisted_6$2)) : createCommentVNode("", true)
|
|
4523
|
-
],
|
|
4652
|
+
], 44, _hoisted_1$c);
|
|
4524
4653
|
}
|
|
4525
4654
|
const cssModules = {
|
|
4526
4655
|
"$style": style0
|
|
4527
4656
|
};
|
|
4528
|
-
var Radio = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$g], ["__cssModules", cssModules], ["__scopeId", "data-v-
|
|
4657
|
+
var Radio = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$g], ["__cssModules", cssModules], ["__scopeId", "data-v-4e34dad2"]]);
|
|
4529
4658
|
const _sfc_main$f = defineComponent({
|
|
4530
4659
|
name: "XTag",
|
|
4531
4660
|
props: __spreadProps(__spreadValues(__spreadValues({}, useCommon.props()), useColors.props("gray")), {
|
|
@@ -5535,13 +5664,14 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5535
5664
|
"text-align": header.align,
|
|
5536
5665
|
sort: _ctx.getSort(header.value, _ctx.sort),
|
|
5537
5666
|
sortable: header.sortable,
|
|
5667
|
+
width: header.width,
|
|
5538
5668
|
onClick: ($event) => header.sortable ? _ctx.sortHeader(header) : null
|
|
5539
5669
|
}, {
|
|
5540
5670
|
default: withCtx(() => [
|
|
5541
5671
|
createTextVNode(toDisplayString(header.text), 1)
|
|
5542
5672
|
]),
|
|
5543
5673
|
_: 2
|
|
5544
|
-
}, 1032, ["sticky-header", "text-align", "sort", "sortable", "onClick"]);
|
|
5674
|
+
}, 1032, ["sticky-header", "text-align", "sort", "sortable", "width", "onClick"]);
|
|
5545
5675
|
}), 128))
|
|
5546
5676
|
]),
|
|
5547
5677
|
_: 1
|
|
@@ -5586,10 +5716,13 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5586
5716
|
var Table = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5]]);
|
|
5587
5717
|
const _sfc_main$4 = defineComponent({
|
|
5588
5718
|
name: "XTab",
|
|
5719
|
+
components: {
|
|
5720
|
+
XIcon,
|
|
5721
|
+
XLink
|
|
5722
|
+
},
|
|
5589
5723
|
props: __spreadProps(__spreadValues({}, useCommon.props()), {
|
|
5590
5724
|
value: {
|
|
5591
|
-
type: [String, Number]
|
|
5592
|
-
required: true
|
|
5725
|
+
type: [String, Number]
|
|
5593
5726
|
},
|
|
5594
5727
|
tag: {
|
|
5595
5728
|
type: String,
|
|
@@ -5598,11 +5731,14 @@ const _sfc_main$4 = defineComponent({
|
|
|
5598
5731
|
to: String,
|
|
5599
5732
|
label: String,
|
|
5600
5733
|
icon: String,
|
|
5601
|
-
disabled: Boolean
|
|
5734
|
+
disabled: Boolean,
|
|
5735
|
+
exact: Boolean
|
|
5602
5736
|
}),
|
|
5603
5737
|
setup(props) {
|
|
5738
|
+
const cValue = computed(() => props.to || props.value);
|
|
5604
5739
|
const cLabel = computed(() => props.label || props.value);
|
|
5605
5740
|
const teleportTo = ref(null);
|
|
5741
|
+
const elRef = ref();
|
|
5606
5742
|
const tabs = inject(injectTabKey, {
|
|
5607
5743
|
tabsContentRef: ref(null),
|
|
5608
5744
|
activateTab: () => {
|
|
@@ -5613,20 +5749,53 @@ const _sfc_main$4 = defineComponent({
|
|
|
5613
5749
|
grow: false
|
|
5614
5750
|
})
|
|
5615
5751
|
});
|
|
5752
|
+
const cExact = computed(() => tabs.state.exact || props.exact);
|
|
5753
|
+
const cSize = computed(() => props.size || tabs.state.size);
|
|
5616
5754
|
onMounted(() => {
|
|
5617
5755
|
teleportTo.value = tabs.tabsContentRef.value;
|
|
5756
|
+
if (props.to) {
|
|
5757
|
+
check();
|
|
5758
|
+
useMutationObserver(elRef.value.$el, check, {
|
|
5759
|
+
attributes: true,
|
|
5760
|
+
attributeFilter: ["class"]
|
|
5761
|
+
});
|
|
5762
|
+
}
|
|
5618
5763
|
});
|
|
5764
|
+
function check() {
|
|
5765
|
+
var _a2;
|
|
5766
|
+
if (elRef.value && elRef.value.$el && props.to) {
|
|
5767
|
+
const active = (_a2 = elRef.value) == null ? void 0 : _a2.$el.classList.contains(cExact.value ? "router-link-exact-active" : "router-link-active");
|
|
5768
|
+
if (active)
|
|
5769
|
+
tabs.activateTab(cValue.value);
|
|
5770
|
+
}
|
|
5771
|
+
}
|
|
5619
5772
|
const state = reactive({
|
|
5620
|
-
selected: computed(() => tabs.state.active ===
|
|
5773
|
+
selected: computed(() => tabs.state.active === cValue.value)
|
|
5621
5774
|
});
|
|
5622
5775
|
function onClickTab() {
|
|
5623
|
-
|
|
5776
|
+
if (!props.to)
|
|
5777
|
+
tabs.activateTab(cValue.value);
|
|
5624
5778
|
}
|
|
5779
|
+
const sizeClasses = computed(() => {
|
|
5780
|
+
if (cSize.value === "xs")
|
|
5781
|
+
return "text-xs";
|
|
5782
|
+
else if (cSize.value === "sm")
|
|
5783
|
+
return "text-sm";
|
|
5784
|
+
else if (cSize.value === "lg")
|
|
5785
|
+
return "text-lg";
|
|
5786
|
+
else if (cSize.value === "xl")
|
|
5787
|
+
return "text-xl";
|
|
5788
|
+
return "";
|
|
5789
|
+
});
|
|
5625
5790
|
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
|
5626
5791
|
variant: tabs.state.variant,
|
|
5627
5792
|
grow: tabs.state.grow,
|
|
5793
|
+
elRef,
|
|
5628
5794
|
cLabel,
|
|
5795
|
+
cValue,
|
|
5796
|
+
cSize,
|
|
5629
5797
|
tabs,
|
|
5798
|
+
sizeClasses,
|
|
5630
5799
|
teleportTo,
|
|
5631
5800
|
onClickTab
|
|
5632
5801
|
});
|
|
@@ -5635,14 +5804,16 @@ const _sfc_main$4 = defineComponent({
|
|
|
5635
5804
|
const _hoisted_1$3 = ["data-value"];
|
|
5636
5805
|
const _hoisted_2$2 = { class: "flex items-center justify-center" };
|
|
5637
5806
|
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5638
|
-
const
|
|
5807
|
+
const _component_XIcon = resolveComponent("XIcon");
|
|
5639
5808
|
return openBlock(), createElementBlock("li", {
|
|
5640
|
-
"data-value": _ctx.
|
|
5809
|
+
"data-value": _ctx.cValue,
|
|
5641
5810
|
class: normalizeClass(["shrink-0 font-medium", { "flex-1": _ctx.grow }])
|
|
5642
5811
|
}, [
|
|
5643
|
-
(openBlock(), createBlock(resolveDynamicComponent(_ctx.to ? "
|
|
5812
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.to ? "x-link" : _ctx.tag), {
|
|
5813
|
+
ref: "elRef",
|
|
5644
5814
|
to: _ctx.to,
|
|
5645
5815
|
class: normalizeClass(["py-2 transition-colors duration-150 ease-in-out whitespace-nowrap text-center", [
|
|
5816
|
+
_ctx.sizeClasses,
|
|
5646
5817
|
{
|
|
5647
5818
|
"px-8": _ctx.variant === "block",
|
|
5648
5819
|
"text-[color:var(--x-tabs-text)] dark:text-[color:var(--x-dark-tabs-text)]": _ctx.selected,
|
|
@@ -5659,14 +5830,14 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5659
5830
|
renderSlot(_ctx.$slots, "tab", {
|
|
5660
5831
|
label: _ctx.label,
|
|
5661
5832
|
value: _ctx.value,
|
|
5662
|
-
size: _ctx.
|
|
5833
|
+
size: _ctx.cSize,
|
|
5663
5834
|
icon: _ctx.icon
|
|
5664
5835
|
}, () => [
|
|
5665
5836
|
createElementVNode("div", _hoisted_2$2, [
|
|
5666
|
-
_ctx.icon ? (openBlock(), createBlock(
|
|
5837
|
+
_ctx.icon ? (openBlock(), createBlock(_component_XIcon, {
|
|
5667
5838
|
key: 0,
|
|
5668
5839
|
icon: _ctx.icon,
|
|
5669
|
-
size: _ctx.
|
|
5840
|
+
size: _ctx.cSize,
|
|
5670
5841
|
class: "mr-1.5 shrink-0"
|
|
5671
5842
|
}, null, 8, ["icon", "size"])) : createCommentVNode("", true),
|
|
5672
5843
|
createElementVNode("span", null, toDisplayString(_ctx.cLabel), 1)
|
|
@@ -5685,18 +5856,23 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5685
5856
|
}
|
|
5686
5857
|
var Tab = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4]]);
|
|
5687
5858
|
const _sfc_main$3 = defineComponent({
|
|
5688
|
-
name: "
|
|
5859
|
+
name: "XTabGroup",
|
|
5689
5860
|
components: {
|
|
5690
5861
|
XScroll
|
|
5691
5862
|
},
|
|
5692
|
-
props: __spreadProps(__spreadValues({}, useColors.props("primary")), {
|
|
5863
|
+
props: __spreadProps(__spreadValues(__spreadValues({}, useCommon.props()), useColors.props("primary")), {
|
|
5693
5864
|
modelValue: [String, Number],
|
|
5694
5865
|
variant: {
|
|
5695
5866
|
type: String,
|
|
5696
5867
|
default: "line"
|
|
5697
5868
|
},
|
|
5869
|
+
align: {
|
|
5870
|
+
type: String,
|
|
5871
|
+
default: "left"
|
|
5872
|
+
},
|
|
5698
5873
|
ghost: Boolean,
|
|
5699
|
-
grow: Boolean
|
|
5874
|
+
grow: Boolean,
|
|
5875
|
+
exact: Boolean
|
|
5700
5876
|
}),
|
|
5701
5877
|
emits: ["update:modelValue"],
|
|
5702
5878
|
setup(props, { emit }) {
|
|
@@ -5705,13 +5881,20 @@ const _sfc_main$3 = defineComponent({
|
|
|
5705
5881
|
const trackerRef = ref();
|
|
5706
5882
|
const tabsRef = ref();
|
|
5707
5883
|
const tabsContentRef = ref();
|
|
5884
|
+
const active = ref();
|
|
5885
|
+
watchEffect(() => {
|
|
5886
|
+
active.value = props.modelValue;
|
|
5887
|
+
});
|
|
5708
5888
|
const state = reactive({
|
|
5709
|
-
active: computed(() =>
|
|
5889
|
+
active: computed(() => active.value),
|
|
5710
5890
|
variant: computed(() => props.variant),
|
|
5711
5891
|
ghost: computed(() => props.ghost),
|
|
5712
|
-
grow: computed(() => props.grow)
|
|
5892
|
+
grow: computed(() => props.grow),
|
|
5893
|
+
exact: computed(() => props.exact),
|
|
5894
|
+
size: computed(() => props.size)
|
|
5713
5895
|
});
|
|
5714
5896
|
function activateTab(tab) {
|
|
5897
|
+
active.value = tab;
|
|
5715
5898
|
emit("update:modelValue", tab);
|
|
5716
5899
|
}
|
|
5717
5900
|
provide(injectTabKey, {
|
|
@@ -5735,13 +5918,13 @@ const _sfc_main$3 = defineComponent({
|
|
|
5735
5918
|
scrollRef.value.scrollEl.scrollTo({ left: center, behavior: "smooth" });
|
|
5736
5919
|
}, 100);
|
|
5737
5920
|
useResizeObserver(wrapperRef, () => {
|
|
5738
|
-
updateTracker(
|
|
5921
|
+
updateTracker(active.value);
|
|
5739
5922
|
});
|
|
5740
|
-
watch(() =>
|
|
5923
|
+
watch(() => active.value, (value) => {
|
|
5741
5924
|
updateTracker(value);
|
|
5742
5925
|
});
|
|
5743
5926
|
onMounted(() => {
|
|
5744
|
-
updateTracker(
|
|
5927
|
+
updateTracker(active.value);
|
|
5745
5928
|
});
|
|
5746
5929
|
const css = useCSS("tabs");
|
|
5747
5930
|
const colors = useColors();
|
|
@@ -5792,7 +5975,9 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5792
5975
|
class: normalizeClass(["flex relative min-w-full w-fit", {
|
|
5793
5976
|
"border-b border-gray-200 dark:border-gray-700": _ctx.variant === "line",
|
|
5794
5977
|
"space-x-8": _ctx.variant === "line" && !_ctx.grow,
|
|
5795
|
-
"z-[1]": _ctx.variant === "block"
|
|
5978
|
+
"z-[1]": _ctx.variant === "block",
|
|
5979
|
+
"justify-center": _ctx.align === "center",
|
|
5980
|
+
"justify-end": _ctx.align === "right"
|
|
5796
5981
|
}])
|
|
5797
5982
|
}, [
|
|
5798
5983
|
renderSlot(_ctx.$slots, "default")
|
|
@@ -5822,6 +6007,7 @@ const _sfc_main$2 = defineComponent({
|
|
|
5822
6007
|
type: String,
|
|
5823
6008
|
default: "ltr"
|
|
5824
6009
|
},
|
|
6010
|
+
rows: Number,
|
|
5825
6011
|
max: Number,
|
|
5826
6012
|
maxlength: Number,
|
|
5827
6013
|
min: Number,
|
|
@@ -5832,7 +6018,8 @@ const _sfc_main$2 = defineComponent({
|
|
|
5832
6018
|
default: true
|
|
5833
6019
|
},
|
|
5834
6020
|
preventEnter: Boolean,
|
|
5835
|
-
inputClass: String
|
|
6021
|
+
inputClass: String,
|
|
6022
|
+
block: Boolean
|
|
5836
6023
|
}),
|
|
5837
6024
|
emits: useInputtable.emits(),
|
|
5838
6025
|
setup(props, { emit }) {
|
|
@@ -5882,13 +6069,13 @@ const _sfc_main$2 = defineComponent({
|
|
|
5882
6069
|
}
|
|
5883
6070
|
});
|
|
5884
6071
|
const _hoisted_1$1 = ["textContent"];
|
|
5885
|
-
const _hoisted_2$1 = ["disabled", "max", "maxlength", "min", "dir", "minlength", "name", "placeholder", "readonly", "value"];
|
|
6072
|
+
const _hoisted_2$1 = ["disabled", "max", "maxlength", "min", "dir", "rows", "minlength", "name", "placeholder", "readonly", "value"];
|
|
5886
6073
|
const _hoisted_3$1 = ["textContent"];
|
|
5887
6074
|
const _hoisted_4$1 = ["textContent"];
|
|
5888
6075
|
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5889
6076
|
var _a2;
|
|
5890
6077
|
return openBlock(), createElementBlock("label", {
|
|
5891
|
-
class: normalizeClass(["inline-block relative align-bottom text-left", { "mb-3": _ctx.isInsideForm }])
|
|
6078
|
+
class: normalizeClass(["inline-block relative align-bottom text-left", { "mb-3": _ctx.isInsideForm, "w-full": _ctx.block }])
|
|
5892
6079
|
}, [
|
|
5893
6080
|
_ctx.label ? (openBlock(), createElementBlock("p", {
|
|
5894
6081
|
key: 0,
|
|
@@ -5922,6 +6109,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5922
6109
|
maxlength: _ctx.maxlength,
|
|
5923
6110
|
min: _ctx.min,
|
|
5924
6111
|
dir: _ctx.dir,
|
|
6112
|
+
rows: _ctx.rows,
|
|
5925
6113
|
minlength: _ctx.minlength,
|
|
5926
6114
|
name: _ctx.name,
|
|
5927
6115
|
placeholder: _ctx.placeholder,
|
|
@@ -5991,7 +6179,7 @@ const _hoisted_4 = ["textContent"];
|
|
|
5991
6179
|
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5992
6180
|
const _component_x_spinner = resolveComponent("x-spinner");
|
|
5993
6181
|
return openBlock(), createElementBlock("label", {
|
|
5994
|
-
class: normalizeClass(["inline-block
|
|
6182
|
+
class: normalizeClass(["inline-block", [!_ctx.disabled ? "cursor-pointer" : "cursor-not-allowed"]])
|
|
5995
6183
|
}, [
|
|
5996
6184
|
createElementVNode("div", _hoisted_1, [
|
|
5997
6185
|
createElementVNode("div", {
|
|
@@ -6161,6 +6349,7 @@ const create = (createOptions = {}) => {
|
|
|
6161
6349
|
app.component(`${options.prefix}${component.name.slice(1)}`, component);
|
|
6162
6350
|
});
|
|
6163
6351
|
app.provide(injectColorsKey, options.colors);
|
|
6352
|
+
app.provide(injectIconsKey, options.icons);
|
|
6164
6353
|
};
|
|
6165
6354
|
return {
|
|
6166
6355
|
install: install2
|