@indielayer/ui 1.0.0-alpha.0 → 1.0.0-alpha.5
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/LICENSE +21 -0
- package/README.md +26 -72
- package/lib/components/avatar/Avatar.vue.d.ts +2 -2
- package/lib/components/badge/Badge.vue.d.ts +2 -2
- package/lib/components/button/Button.vue.d.ts +2 -2
- package/lib/components/button/ButtonGroup.vue.d.ts +2 -2
- package/lib/components/checkbox/Checkbox.vue.d.ts +4 -3
- package/lib/components/drawer/Drawer.vue.d.ts +2 -2
- package/lib/components/icon/Icon.vue.d.ts +7 -3
- package/lib/components/index.d.ts +2 -2
- package/lib/components/input/Input.vue.d.ts +3 -2
- package/lib/components/menu/Menu.vue.d.ts +2 -2
- package/lib/components/menu/MenuItem.vue.d.ts +3 -3
- package/lib/components/notifications/Notifications.vue.d.ts +2 -2
- package/lib/components/pagination/Pagination.vue.d.ts +3 -2
- package/lib/components/pagination/PaginationItem.vue.d.ts +2 -2
- package/lib/components/radio/Radio.vue.d.ts +2 -2
- package/lib/components/select/Select.vue.d.ts +3 -2
- package/lib/components/slider/Slider.vue.d.ts +2 -2
- package/lib/components/spacer/Spacer.vue.d.ts +1 -1
- package/lib/components/spinner/Spinner.vue.d.ts +2 -2
- package/lib/components/{tabs → tab}/Tab.vue.d.ts +2 -2
- package/lib/components/{tabs/Tabs.vue.d.ts → tab/TabGroup.vue.d.ts} +0 -0
- package/lib/components/table/TableBody.vue.d.ts +1 -1
- package/lib/components/table/TableHead.vue.d.ts +1 -1
- package/lib/components/tag/Tag.vue.d.ts +2 -2
- package/lib/components/textarea/Textarea.vue.d.ts +3 -11
- package/lib/components/toggle/Toggle.vue.d.ts +2 -2
- package/lib/composables/keys.d.ts +1 -0
- package/lib/create.d.ts +12 -0
- package/lib/index.cjs.js +2 -2
- package/lib/index.d.ts +2 -0
- package/lib/index.es.js +271 -130
- package/lib/install.d.ts +4 -6
- package/lib/nuxt.js +15 -16
- package/lib/nuxt.plugin.js +8 -0
- package/lib/style.css +1 -1
- package/lib/version.d.ts +1 -1
- package/package.json +21 -15
- package/src/components/alert/Alert.vue +164 -0
- package/src/components/avatar/Avatar.vue +137 -0
- package/src/components/badge/Badge.vue +107 -0
- package/src/components/breadcrumbs/Breadcrumbs.vue +60 -0
- package/src/components/button/Button.vue +433 -0
- package/src/components/button/ButtonGroup.vue +73 -0
- package/src/components/card/Card.vue +25 -0
- package/src/components/checkbox/Checkbox.vue +205 -0
- package/src/components/collapse/Collapse.vue +181 -0
- package/src/components/container/Container.vue +23 -0
- package/src/components/divider/Divider.vue +52 -0
- package/src/components/drawer/Drawer.vue +244 -0
- package/src/components/form/Form.vue +111 -0
- package/src/components/icon/Icon.vue +123 -0
- package/src/components/image/Image.vue +36 -0
- package/src/components/index.ts +45 -0
- package/src/components/input/Input.vue +199 -0
- package/src/components/link/Link.vue +110 -0
- package/src/components/menu/Menu.vue +118 -0
- package/src/components/menu/MenuItem.vue +277 -0
- package/src/components/modal/Modal.vue +175 -0
- package/src/components/notifications/Notifications.vue +318 -0
- package/src/components/pagination/Pagination.vue +181 -0
- package/src/components/pagination/PaginationItem.vue +58 -0
- package/src/components/popover/Popover.vue +194 -0
- package/src/components/popover/PopoverContainer.vue +23 -0
- package/src/components/progress/Progress.vue +86 -0
- package/src/components/radio/Radio.vue +220 -0
- package/src/components/scroll/Scroll.vue +143 -0
- package/src/components/select/Select.vue +408 -0
- package/src/components/skeleton/Skeleton.vue +23 -0
- package/src/components/slider/Slider.vue +240 -0
- package/src/components/spacer/Spacer.vue +11 -0
- package/src/components/spinner/Spinner.vue +45 -0
- package/src/components/tab/Tab.vue +100 -0
- package/src/components/tab/TabGroup.vue +151 -0
- package/src/components/table/Table.vue +172 -0
- package/src/components/table/TableBody.vue +13 -0
- package/src/components/table/TableCell.vue +78 -0
- package/src/components/table/TableHead.vue +15 -0
- package/src/components/table/TableHeader.vue +94 -0
- package/src/components/table/TableRow.vue +43 -0
- package/src/components/tag/Tag.vue +98 -0
- package/src/components/textarea/Textarea.vue +156 -0
- package/src/components/toggle/Toggle.vue +144 -0
- package/src/components/tooltip/Tooltip.vue +26 -0
- package/src/composables/colors-utils.ts +378 -0
- package/src/composables/colors.ts +82 -0
- package/src/composables/common.ts +20 -0
- package/src/composables/css.ts +45 -0
- package/src/composables/index.ts +7 -0
- package/src/composables/inputtable.ts +128 -0
- package/src/composables/interactive.ts +16 -0
- package/src/composables/keys.ts +8 -0
- package/src/composables/notification.ts +10 -0
- package/src/create.ts +38 -0
- package/src/exports/nuxt.js +32 -0
- package/src/exports/nuxt.plugin.js +8 -0
- package/src/exports/tailwind.preset.js +55 -0
- package/src/index.ts +8 -0
- package/src/install.ts +8 -0
- package/src/shims-vue.d.ts +6 -0
- package/src/version.ts +1 -0
- package/volar.d.ts +1 -1
package/lib/index.es.js
CHANGED
|
@@ -17,14 +17,13 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { defineComponent, computed, openBlock, createBlock, resolveDynamicComponent, normalizeClass, normalizeStyle, withCtx, createElementBlock, renderSlot, createCommentVNode, Fragment, pushScopeId, popScopeId, createElementVNode,
|
|
21
|
-
var version = "0.2.4";
|
|
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, onBeforeUnmount, TransitionGroup, useCssModule, vModelRadio, vModelSelect } from "vue";
|
|
22
21
|
const isHex = (hex) => /^#(?:[A-Fa-f0-9]{3}){1,2}$/.test(hex);
|
|
23
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);
|
|
24
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);
|
|
25
24
|
const parseRGB = (rgb) => {
|
|
26
25
|
var _a2;
|
|
27
|
-
return (_a2 = rgb.match(
|
|
26
|
+
return (_a2 = rgb.match(new RegExp("(?<=\\().+?(?=\\))", "g"))) == null ? void 0 : _a2[0].split(",");
|
|
28
27
|
};
|
|
29
28
|
const hexToRGB = (hex) => {
|
|
30
29
|
var _a2;
|
|
@@ -48,23 +47,6 @@ const colorShade = (color, percentage) => {
|
|
|
48
47
|
const blue = calcPrimary(b);
|
|
49
48
|
return "rgb" + (a ? "a(" : "(") + red + "," + green + "," + blue + (a ? "," + a : ")");
|
|
50
49
|
};
|
|
51
|
-
const shades = ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"];
|
|
52
|
-
const indielayerColors = ["primary", "secondary", "success", "warning", "error"];
|
|
53
|
-
function calculateColors() {
|
|
54
|
-
const customColors2 = {};
|
|
55
|
-
const e = document.createElement("div");
|
|
56
|
-
document.body.appendChild(e);
|
|
57
|
-
indielayerColors.forEach((color) => {
|
|
58
|
-
const c = __spreadValues({}, tailwindColors.gray);
|
|
59
|
-
shades.forEach((shade) => {
|
|
60
|
-
e.className = `bg-${color}-${shade}`;
|
|
61
|
-
c[shade] = window.getComputedStyle(e, null).getPropertyValue("background-color");
|
|
62
|
-
});
|
|
63
|
-
customColors2[color] = c;
|
|
64
|
-
});
|
|
65
|
-
e.remove();
|
|
66
|
-
return customColors2;
|
|
67
|
-
}
|
|
68
50
|
Object.freeze([
|
|
69
51
|
"bg-primary-50",
|
|
70
52
|
"bg-primary-100",
|
|
@@ -383,11 +365,23 @@ const tailwindColors = Object.freeze({
|
|
|
383
365
|
900: "#881337"
|
|
384
366
|
}
|
|
385
367
|
});
|
|
386
|
-
|
|
368
|
+
var version = "1.0.0-alpha.5";
|
|
369
|
+
const injectTabKey = Symbol();
|
|
370
|
+
const injectFormKey = Symbol();
|
|
371
|
+
const injectIconsKey = Symbol();
|
|
372
|
+
const injectColorsKey = Symbol();
|
|
373
|
+
const injectButtonGroupKey = Symbol();
|
|
374
|
+
const injectNotificationKey = Symbol();
|
|
387
375
|
const colorCache = {};
|
|
376
|
+
const defaultColors = {
|
|
377
|
+
primary: tailwindColors.sky,
|
|
378
|
+
secondary: tailwindColors.slate,
|
|
379
|
+
success: tailwindColors.green,
|
|
380
|
+
warning: tailwindColors.yellow,
|
|
381
|
+
error: tailwindColors.red
|
|
382
|
+
};
|
|
388
383
|
const useColors = () => {
|
|
389
|
-
|
|
390
|
-
customColors = calculateColors();
|
|
384
|
+
const customColors = inject(injectColorsKey) || defaultColors;
|
|
391
385
|
const getTailwindColor = (color) => tailwindColors[color];
|
|
392
386
|
const getColorOpacity = (color, opacity) => setOpacity(color, opacity);
|
|
393
387
|
const getPalette = (color) => {
|
|
@@ -470,6 +464,7 @@ var _export_sfc = (sfc, props) => {
|
|
|
470
464
|
return target;
|
|
471
465
|
};
|
|
472
466
|
const _sfc_main$I = defineComponent({
|
|
467
|
+
name: "XAlert",
|
|
473
468
|
props: __spreadProps(__spreadValues({}, useColors.props()), {
|
|
474
469
|
tag: {
|
|
475
470
|
type: String,
|
|
@@ -536,12 +531,12 @@ const _sfc_main$I = defineComponent({
|
|
|
536
531
|
};
|
|
537
532
|
}
|
|
538
533
|
});
|
|
539
|
-
const _withScopeId$3 = (n) => (pushScopeId("data-v-
|
|
534
|
+
const _withScopeId$3 = (n) => (pushScopeId("data-v-35ce54d8"), n = n(), popScopeId(), n);
|
|
540
535
|
const _hoisted_1$u = {
|
|
541
536
|
key: 0,
|
|
542
537
|
class: "flex-none pr-2"
|
|
543
538
|
};
|
|
544
|
-
const _hoisted_2$
|
|
539
|
+
const _hoisted_2$l = {
|
|
545
540
|
key: 1,
|
|
546
541
|
width: "24",
|
|
547
542
|
height: "24",
|
|
@@ -569,7 +564,7 @@ const _hoisted_6$7 = {
|
|
|
569
564
|
key: 3,
|
|
570
565
|
d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
|
|
571
566
|
};
|
|
572
|
-
const _hoisted_7$
|
|
567
|
+
const _hoisted_7$2 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ createElementVNode("div", { class: "flex-grow" }, null, -1));
|
|
573
568
|
const _hoisted_8$2 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ createElementVNode("path", { d: "M6 18L18 6M6 6l12 12" }, null, -1));
|
|
574
569
|
const _hoisted_9$1 = [
|
|
575
570
|
_hoisted_8$2
|
|
@@ -585,7 +580,7 @@ function _sfc_render$I(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
585
580
|
default: withCtx(() => [
|
|
586
581
|
_ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_1$u, [
|
|
587
582
|
renderSlot(_ctx.$slots, "icon", {}, void 0, true)
|
|
588
|
-
])) : _ctx.type ? (openBlock(), createElementBlock("svg", _hoisted_2$
|
|
583
|
+
])) : _ctx.type ? (openBlock(), createElementBlock("svg", _hoisted_2$l, [
|
|
589
584
|
_ctx.type === "info" ? (openBlock(), createElementBlock("path", _hoisted_3$f)) : createCommentVNode("", true),
|
|
590
585
|
_ctx.type === "success" ? (openBlock(), createElementBlock("path", _hoisted_4$d)) : createCommentVNode("", true),
|
|
591
586
|
_ctx.type === "error" ? (openBlock(), createElementBlock("path", _hoisted_5$7)) : createCommentVNode("", true),
|
|
@@ -593,7 +588,7 @@ function _sfc_render$I(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
593
588
|
])) : createCommentVNode("", true),
|
|
594
589
|
renderSlot(_ctx.$slots, "default", {}, void 0, true),
|
|
595
590
|
_ctx.removable ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
596
|
-
_hoisted_7$
|
|
591
|
+
_hoisted_7$2,
|
|
597
592
|
(openBlock(), createElementBlock("svg", {
|
|
598
593
|
width: "24",
|
|
599
594
|
height: "24",
|
|
@@ -614,7 +609,7 @@ function _sfc_render$I(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
614
609
|
const cssModules$9 = {
|
|
615
610
|
"$style": style0$9
|
|
616
611
|
};
|
|
617
|
-
var Alert = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["render", _sfc_render$I], ["__cssModules", cssModules$9], ["__scopeId", "data-v-
|
|
612
|
+
var Alert = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["render", _sfc_render$I], ["__cssModules", cssModules$9], ["__scopeId", "data-v-35ce54d8"]]);
|
|
618
613
|
const useCommon = () => {
|
|
619
614
|
};
|
|
620
615
|
const validators$5 = Object.freeze({
|
|
@@ -627,12 +622,8 @@ useCommon.props = () => ({
|
|
|
627
622
|
}
|
|
628
623
|
});
|
|
629
624
|
useCommon.validators = () => __spreadValues({}, validators$5);
|
|
630
|
-
const injectTabKey = Symbol();
|
|
631
|
-
const injectFormKey = Symbol();
|
|
632
|
-
const injectIconsKey = Symbol();
|
|
633
|
-
const injectButtonGroupKey = Symbol();
|
|
634
|
-
const injectNotificationKey = Symbol();
|
|
635
625
|
const _sfc_main$H = defineComponent({
|
|
626
|
+
name: "XIcon",
|
|
636
627
|
validators: __spreadValues({}, useCommon.validators()),
|
|
637
628
|
props: __spreadProps(__spreadValues({}, useCommon.props()), {
|
|
638
629
|
icon: {
|
|
@@ -658,24 +649,77 @@ const _sfc_main$H = defineComponent({
|
|
|
658
649
|
return "h-9 w-9";
|
|
659
650
|
return "h-5 w-5";
|
|
660
651
|
});
|
|
652
|
+
const isWrapSVG = ref(false);
|
|
653
|
+
const computedIcon = ref("");
|
|
654
|
+
const computedFilled = ref(props.filled);
|
|
655
|
+
const computedViewBox = ref(props.viewBox);
|
|
656
|
+
const attrs = ref({});
|
|
657
|
+
watchEffect(() => {
|
|
658
|
+
const injectedIcon = icons[props.icon];
|
|
659
|
+
isWrapSVG.value = false;
|
|
660
|
+
computedIcon.value = injectedIcon;
|
|
661
|
+
if (injectedIcon) {
|
|
662
|
+
if (typeof injectedIcon === "string") {
|
|
663
|
+
if (injectedIcon.startsWith("<svg")) {
|
|
664
|
+
isWrapSVG.value = true;
|
|
665
|
+
const { content, attributes } = getSVG(injectedIcon);
|
|
666
|
+
attrs.value = attributes;
|
|
667
|
+
computedIcon.value = content;
|
|
668
|
+
} else {
|
|
669
|
+
isWrapSVG.value = false;
|
|
670
|
+
computedIcon.value = injectedIcon;
|
|
671
|
+
}
|
|
672
|
+
} else if (typeof injectedIcon === "object") {
|
|
673
|
+
computedIcon.value = injectedIcon.icon;
|
|
674
|
+
computedFilled.value = injectedIcon.filled || props.filled;
|
|
675
|
+
computedViewBox.value = injectedIcon.viewBox || injectedIcon.viewbox || props.viewBox;
|
|
676
|
+
}
|
|
677
|
+
} else {
|
|
678
|
+
computedIcon.value = props.icon;
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
function getSVG(svgString) {
|
|
682
|
+
const temp = document.createElement("template");
|
|
683
|
+
temp.innerHTML = svgString.trim();
|
|
684
|
+
const [svg] = temp.content.children;
|
|
685
|
+
const names = svg.getAttributeNames();
|
|
686
|
+
const attributes = {};
|
|
687
|
+
names.forEach((n) => {
|
|
688
|
+
if (!["height", "width", "class"].includes(n))
|
|
689
|
+
attributes[n] = svg.getAttribute(n);
|
|
690
|
+
});
|
|
691
|
+
return {
|
|
692
|
+
attributes,
|
|
693
|
+
content: svg.innerHTML
|
|
694
|
+
};
|
|
695
|
+
}
|
|
661
696
|
return {
|
|
662
|
-
|
|
697
|
+
attrs,
|
|
698
|
+
isWrapSVG,
|
|
699
|
+
computedIcon,
|
|
700
|
+
computedFilled,
|
|
701
|
+
computedViewBox,
|
|
663
702
|
sizeClasses
|
|
664
703
|
};
|
|
665
704
|
}
|
|
666
705
|
});
|
|
667
|
-
const _hoisted_1$t = ["
|
|
706
|
+
const _hoisted_1$t = ["innerHTML"];
|
|
707
|
+
const _hoisted_2$k = ["stroke-linejoin", "stroke-linecap", "stroke", "fill", "viewBox", "innerHTML"];
|
|
668
708
|
function _sfc_render$H(_ctx, _cache, $props, $setup, $data, $options) {
|
|
669
|
-
return openBlock(), createElementBlock("svg", {
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
"stroke-linecap": _ctx.filled ? void 0 : "round",
|
|
675
|
-
"stroke-linejoin": _ctx.filled ? void 0 : "round",
|
|
709
|
+
return _ctx.isWrapSVG ? (openBlock(), createElementBlock("svg", mergeProps({
|
|
710
|
+
key: 0,
|
|
711
|
+
class: ["inline", _ctx.sizeClasses]
|
|
712
|
+
}, _ctx.attrs, { innerHTML: _ctx.computedIcon }), null, 16, _hoisted_1$t)) : (openBlock(), createElementBlock("svg", {
|
|
713
|
+
key: 1,
|
|
676
714
|
xmlns: "http://www.w3.org/2000/svg",
|
|
677
|
-
|
|
678
|
-
|
|
715
|
+
class: normalizeClass(["inline", [_ctx.sizeClasses, { "stroke-2": !_ctx.computedFilled }]]),
|
|
716
|
+
"stroke-linejoin": _ctx.computedFilled ? void 0 : "round",
|
|
717
|
+
"stroke-linecap": _ctx.computedFilled ? void 0 : "round",
|
|
718
|
+
stroke: _ctx.computedFilled ? void 0 : "currentColor",
|
|
719
|
+
fill: _ctx.computedFilled ? "currentColor" : "none",
|
|
720
|
+
viewBox: _ctx.computedViewBox,
|
|
721
|
+
innerHTML: _ctx.computedIcon
|
|
722
|
+
}, null, 10, _hoisted_2$k));
|
|
679
723
|
}
|
|
680
724
|
var XIcon = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["render", _sfc_render$H]]);
|
|
681
725
|
const avatar = "_avatar_v7jzc_2";
|
|
@@ -683,6 +727,7 @@ var style0$8 = {
|
|
|
683
727
|
avatar
|
|
684
728
|
};
|
|
685
729
|
const _sfc_main$G = defineComponent({
|
|
730
|
+
name: "XAvatar",
|
|
686
731
|
components: {
|
|
687
732
|
XIcon
|
|
688
733
|
},
|
|
@@ -794,8 +839,9 @@ function _sfc_render$G(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
794
839
|
const cssModules$8 = {
|
|
795
840
|
"$style": style0$8
|
|
796
841
|
};
|
|
797
|
-
var Avatar = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["render", _sfc_render$G], ["__cssModules", cssModules$8], ["__scopeId", "data-v-
|
|
842
|
+
var Avatar = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["render", _sfc_render$G], ["__cssModules", cssModules$8], ["__scopeId", "data-v-243016db"]]);
|
|
798
843
|
const _sfc_main$F = defineComponent({
|
|
844
|
+
name: "XBadge",
|
|
799
845
|
props: __spreadProps(__spreadValues(__spreadValues({}, useCommon.props()), useColors.props("primary")), {
|
|
800
846
|
tag: {
|
|
801
847
|
type: String,
|
|
@@ -893,6 +939,7 @@ function _sfc_render$F(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
893
939
|
}
|
|
894
940
|
var Badge = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["render", _sfc_render$F]]);
|
|
895
941
|
const _sfc_main$E = defineComponent({
|
|
942
|
+
name: "XBreadcrumbs",
|
|
896
943
|
props: {
|
|
897
944
|
items: Array,
|
|
898
945
|
icon: String,
|
|
@@ -969,8 +1016,8 @@ var Breadcrumbs = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["render", _sfc_rend
|
|
|
969
1016
|
const useInteractive = (el) => {
|
|
970
1017
|
return {
|
|
971
1018
|
focus: () => {
|
|
972
|
-
var _a2,
|
|
973
|
-
(
|
|
1019
|
+
var _a2, _b;
|
|
1020
|
+
(_b = (_a2 = el.value) == null ? void 0 : _a2.focus) == null ? void 0 : _b.call(_a2);
|
|
974
1021
|
}
|
|
975
1022
|
};
|
|
976
1023
|
};
|
|
@@ -979,6 +1026,7 @@ useInteractive.props = () => ({
|
|
|
979
1026
|
loading: Boolean
|
|
980
1027
|
});
|
|
981
1028
|
const _sfc_main$D = defineComponent({
|
|
1029
|
+
name: "XSpinner",
|
|
982
1030
|
components: {
|
|
983
1031
|
XIcon
|
|
984
1032
|
},
|
|
@@ -1021,6 +1069,7 @@ var style0$7 = {
|
|
|
1021
1069
|
"button--glow": "_button--glow_1sbr9_1"
|
|
1022
1070
|
};
|
|
1023
1071
|
const _sfc_main$C = defineComponent({
|
|
1072
|
+
name: "XButton",
|
|
1024
1073
|
components: {
|
|
1025
1074
|
XIcon,
|
|
1026
1075
|
XSpinner
|
|
@@ -1099,7 +1148,7 @@ const _sfc_main$C = defineComponent({
|
|
|
1099
1148
|
hover: { bg: !props.loading ? gray[100] : "" },
|
|
1100
1149
|
active: { bg: !props.loading ? gray[200] : "" },
|
|
1101
1150
|
dark: {
|
|
1102
|
-
bg: gray[
|
|
1151
|
+
bg: gray[800],
|
|
1103
1152
|
text: "white",
|
|
1104
1153
|
border: gray[600],
|
|
1105
1154
|
hover: { bg: !props.loading ? gray[800] : "" },
|
|
@@ -1353,7 +1402,7 @@ function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1353
1402
|
size: _ctx.computedSize,
|
|
1354
1403
|
icon: _ctx.iconRight,
|
|
1355
1404
|
class: normalizeClass(["shrink-0", [
|
|
1356
|
-
[_ctx.$slots.default ? "
|
|
1405
|
+
[_ctx.$slots.default ? "ml-2" : "m-0.5"],
|
|
1357
1406
|
{
|
|
1358
1407
|
invisible: _ctx.loading
|
|
1359
1408
|
}
|
|
@@ -1366,12 +1415,13 @@ function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1366
1415
|
const cssModules$7 = {
|
|
1367
1416
|
"$style": style0$7
|
|
1368
1417
|
};
|
|
1369
|
-
var XButton = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$C], ["__cssModules", cssModules$7], ["__scopeId", "data-v-
|
|
1418
|
+
var XButton = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$C], ["__cssModules", cssModules$7], ["__scopeId", "data-v-7ada6753"]]);
|
|
1370
1419
|
var style0$6 = {
|
|
1371
1420
|
"button-group": "_button-group_s7fyl_2",
|
|
1372
1421
|
"button-group--rounded": "_button-group--rounded_s7fyl_1"
|
|
1373
1422
|
};
|
|
1374
1423
|
const _sfc_main$B = defineComponent({
|
|
1424
|
+
name: "XButtonGroup",
|
|
1375
1425
|
validators: __spreadValues({}, useCommon.validators()),
|
|
1376
1426
|
props: __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, useCommon.props()), useColors.props()), useInteractive.props()), {
|
|
1377
1427
|
tag: {
|
|
@@ -1408,6 +1458,7 @@ const cssModules$6 = {
|
|
|
1408
1458
|
};
|
|
1409
1459
|
var ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", _sfc_render$B], ["__cssModules", cssModules$6]]);
|
|
1410
1460
|
const _sfc_main$A = defineComponent({
|
|
1461
|
+
name: "XCard",
|
|
1411
1462
|
props: {
|
|
1412
1463
|
tag: {
|
|
1413
1464
|
type: String,
|
|
@@ -1529,6 +1580,7 @@ var style0$5 = {
|
|
|
1529
1580
|
"checkbox--glow": "_checkbox--glow_1dz66_1"
|
|
1530
1581
|
};
|
|
1531
1582
|
const _sfc_main$z = defineComponent({
|
|
1583
|
+
name: "XCheckbox",
|
|
1532
1584
|
components: {
|
|
1533
1585
|
XSpinner
|
|
1534
1586
|
},
|
|
@@ -1627,7 +1679,7 @@ const _sfc_main$z = defineComponent({
|
|
|
1627
1679
|
});
|
|
1628
1680
|
}
|
|
1629
1681
|
});
|
|
1630
|
-
const _withScopeId$2 = (n) => (pushScopeId("data-v-
|
|
1682
|
+
const _withScopeId$2 = (n) => (pushScopeId("data-v-54fce636"), n = n(), popScopeId(), n);
|
|
1631
1683
|
const _hoisted_1$p = { class: "inline-block relative cursor-pointer align-middle mb-1 pb-2" };
|
|
1632
1684
|
const _hoisted_2$g = ["aria-checked", "aria-disabled", "disabled", "name", "required"];
|
|
1633
1685
|
const _hoisted_3$d = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("path", { d: "M0 11l2-2 5 5L18 3l2 2L7 18z" }, null, -1));
|
|
@@ -1692,7 +1744,7 @@ function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1692
1744
|
], 34),
|
|
1693
1745
|
_ctx.errorInternal ? (openBlock(), createElementBlock("p", {
|
|
1694
1746
|
key: 0,
|
|
1695
|
-
class: "text-sm text-
|
|
1747
|
+
class: "text-sm text-red-500 mt-1",
|
|
1696
1748
|
textContent: toDisplayString(_ctx.errorInternal)
|
|
1697
1749
|
}, null, 8, _hoisted_6$6)) : createCommentVNode("", true)
|
|
1698
1750
|
]);
|
|
@@ -1700,8 +1752,9 @@ function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1700
1752
|
const cssModules$5 = {
|
|
1701
1753
|
"$style": style0$5
|
|
1702
1754
|
};
|
|
1703
|
-
var Checkbox = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_render$z], ["__cssModules", cssModules$5], ["__scopeId", "data-v-
|
|
1755
|
+
var Checkbox = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_render$z], ["__cssModules", cssModules$5], ["__scopeId", "data-v-54fce636"]]);
|
|
1704
1756
|
const _sfc_main$y = defineComponent({
|
|
1757
|
+
name: "XCollapse",
|
|
1705
1758
|
components: {
|
|
1706
1759
|
XIcon
|
|
1707
1760
|
},
|
|
@@ -1879,6 +1932,7 @@ function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1879
1932
|
}
|
|
1880
1933
|
var XCollapse = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_render$y]]);
|
|
1881
1934
|
const _sfc_main$x = defineComponent({
|
|
1935
|
+
name: "XContainer",
|
|
1882
1936
|
props: {
|
|
1883
1937
|
tag: {
|
|
1884
1938
|
type: String,
|
|
@@ -1887,7 +1941,7 @@ const _sfc_main$x = defineComponent({
|
|
|
1887
1941
|
}
|
|
1888
1942
|
});
|
|
1889
1943
|
function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1890
|
-
return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), { class: "
|
|
1944
|
+
return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), { class: "max-w-screen-2xl mx-auto px-4" }, {
|
|
1891
1945
|
default: withCtx(() => [
|
|
1892
1946
|
renderSlot(_ctx.$slots, "default")
|
|
1893
1947
|
]),
|
|
@@ -1896,6 +1950,7 @@ function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1896
1950
|
}
|
|
1897
1951
|
var Container = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["render", _sfc_render$x]]);
|
|
1898
1952
|
const _sfc_main$w = defineComponent({
|
|
1953
|
+
name: "XDivider",
|
|
1899
1954
|
props: {
|
|
1900
1955
|
label: String,
|
|
1901
1956
|
vertical: Boolean
|
|
@@ -1947,10 +2002,12 @@ function tryOnScopeDispose(fn) {
|
|
|
1947
2002
|
}
|
|
1948
2003
|
return false;
|
|
1949
2004
|
}
|
|
2005
|
+
var _a;
|
|
1950
2006
|
const isClient = typeof window !== "undefined";
|
|
1951
2007
|
const isString = (val) => typeof val === "string";
|
|
1952
2008
|
const noop = () => {
|
|
1953
2009
|
};
|
|
2010
|
+
isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
1954
2011
|
function createFilterWrapper(filter, fn) {
|
|
1955
2012
|
function wrapper(...args) {
|
|
1956
2013
|
filter(() => fn.apply(this, args), { fn, thisArg: this, args });
|
|
@@ -1992,7 +2049,7 @@ function debounceFilter(ms, options = {}) {
|
|
|
1992
2049
|
function throttleFilter(ms, trailing = true, leading = true) {
|
|
1993
2050
|
let lastExec = 0;
|
|
1994
2051
|
let timer;
|
|
1995
|
-
let
|
|
2052
|
+
let isLeading = true;
|
|
1996
2053
|
const clear = () => {
|
|
1997
2054
|
if (timer) {
|
|
1998
2055
|
clearTimeout(timer);
|
|
@@ -2007,24 +2064,20 @@ function throttleFilter(ms, trailing = true, leading = true) {
|
|
|
2007
2064
|
lastExec = Date.now();
|
|
2008
2065
|
return invoke();
|
|
2009
2066
|
}
|
|
2010
|
-
if (elapsed > duration) {
|
|
2067
|
+
if (elapsed > duration && (leading || !isLeading)) {
|
|
2011
2068
|
lastExec = Date.now();
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
else
|
|
2015
|
-
invoke();
|
|
2016
|
-
}
|
|
2017
|
-
if (trailing) {
|
|
2069
|
+
invoke();
|
|
2070
|
+
} else if (trailing) {
|
|
2018
2071
|
timer = setTimeout(() => {
|
|
2019
2072
|
lastExec = Date.now();
|
|
2020
|
-
|
|
2021
|
-
preventLeading = true;
|
|
2073
|
+
isLeading = true;
|
|
2022
2074
|
clear();
|
|
2023
2075
|
invoke();
|
|
2024
2076
|
}, duration);
|
|
2025
2077
|
}
|
|
2026
2078
|
if (!leading && !timer)
|
|
2027
|
-
timer = setTimeout(() =>
|
|
2079
|
+
timer = setTimeout(() => isLeading = true, duration);
|
|
2080
|
+
isLeading = false;
|
|
2028
2081
|
};
|
|
2029
2082
|
return filter;
|
|
2030
2083
|
}
|
|
@@ -2129,10 +2182,11 @@ function onClickOutside(target, handler, options = {}) {
|
|
|
2129
2182
|
}
|
|
2130
2183
|
function useMediaQuery(query, options = {}) {
|
|
2131
2184
|
const { window: window2 = defaultWindow } = options;
|
|
2185
|
+
const isSupported = Boolean(window2 && "matchMedia" in window2);
|
|
2132
2186
|
let mediaQuery;
|
|
2133
2187
|
const matches = ref(false);
|
|
2134
2188
|
const update = () => {
|
|
2135
|
-
if (!
|
|
2189
|
+
if (!isSupported)
|
|
2136
2190
|
return;
|
|
2137
2191
|
if (!mediaQuery)
|
|
2138
2192
|
mediaQuery = window2.matchMedia(query);
|
|
@@ -2338,7 +2392,15 @@ function useScroll(element, options = {}) {
|
|
|
2338
2392
|
directions
|
|
2339
2393
|
};
|
|
2340
2394
|
}
|
|
2341
|
-
|
|
2395
|
+
var SwipeDirection;
|
|
2396
|
+
(function(SwipeDirection2) {
|
|
2397
|
+
SwipeDirection2["UP"] = "UP";
|
|
2398
|
+
SwipeDirection2["RIGHT"] = "RIGHT";
|
|
2399
|
+
SwipeDirection2["DOWN"] = "DOWN";
|
|
2400
|
+
SwipeDirection2["LEFT"] = "LEFT";
|
|
2401
|
+
SwipeDirection2["NONE"] = "NONE";
|
|
2402
|
+
})(SwipeDirection || (SwipeDirection = {}));
|
|
2403
|
+
function useSwipe(target, options) {
|
|
2342
2404
|
const {
|
|
2343
2405
|
threshold = 50,
|
|
2344
2406
|
onSwipe,
|
|
@@ -2356,11 +2418,11 @@ function useSwipe(target, options = {}) {
|
|
|
2356
2418
|
const isSwiping = ref(false);
|
|
2357
2419
|
const direction = computed(() => {
|
|
2358
2420
|
if (!isThresholdExceeded.value)
|
|
2359
|
-
return
|
|
2421
|
+
return SwipeDirection.NONE;
|
|
2360
2422
|
if (abs(diffX.value) > abs(diffY.value)) {
|
|
2361
|
-
return diffX.value > 0 ?
|
|
2423
|
+
return diffX.value > 0 ? SwipeDirection.LEFT : SwipeDirection.RIGHT;
|
|
2362
2424
|
} else {
|
|
2363
|
-
return diffY.value > 0 ?
|
|
2425
|
+
return diffY.value > 0 ? SwipeDirection.UP : SwipeDirection.DOWN;
|
|
2364
2426
|
}
|
|
2365
2427
|
});
|
|
2366
2428
|
const getTouchEventCoords = (e) => [e.touches[0].clientX, e.touches[0].clientY];
|
|
@@ -2429,8 +2491,6 @@ function checkPassiveEventSupport(document2) {
|
|
|
2429
2491
|
document2.removeEventListener("x", noop);
|
|
2430
2492
|
return supportsPassive;
|
|
2431
2493
|
}
|
|
2432
|
-
var _a, _b;
|
|
2433
|
-
isClient && (window == null ? void 0 : window.navigator) && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.platform) && /iP(ad|hone|od)/.test((_b = window == null ? void 0 : window.navigator) == null ? void 0 : _b.platform);
|
|
2434
2494
|
const scrollWrap = "_scrollWrap_1k3q9_2";
|
|
2435
2495
|
const horizontal = "_horizontal_1k3q9_11";
|
|
2436
2496
|
const vertical = "_vertical_1k3q9_17";
|
|
@@ -2446,6 +2506,7 @@ var style0$4 = {
|
|
|
2446
2506
|
hideScroll
|
|
2447
2507
|
};
|
|
2448
2508
|
const _sfc_main$v = defineComponent({
|
|
2509
|
+
name: "XScroll",
|
|
2449
2510
|
props: {
|
|
2450
2511
|
shadow: Boolean,
|
|
2451
2512
|
horizontal: Boolean,
|
|
@@ -2515,8 +2576,9 @@ function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2515
2576
|
const cssModules$4 = {
|
|
2516
2577
|
"$style": style0$4
|
|
2517
2578
|
};
|
|
2518
|
-
var XScroll = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$v], ["__cssModules", cssModules$4], ["__scopeId", "data-v-
|
|
2579
|
+
var XScroll = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$v], ["__cssModules", cssModules$4], ["__scopeId", "data-v-ff88aa62"]]);
|
|
2519
2580
|
const _sfc_main$u = defineComponent({
|
|
2581
|
+
name: "XDrawer",
|
|
2520
2582
|
components: {
|
|
2521
2583
|
XScroll
|
|
2522
2584
|
},
|
|
@@ -2737,6 +2799,7 @@ function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2737
2799
|
}
|
|
2738
2800
|
var Drawer = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$u]]);
|
|
2739
2801
|
const _sfc_main$t = defineComponent({
|
|
2802
|
+
name: "XForm",
|
|
2740
2803
|
inheritAttrs: false,
|
|
2741
2804
|
props: {
|
|
2742
2805
|
autoValidate: {
|
|
@@ -2822,6 +2885,7 @@ function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2822
2885
|
var Form = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$t]]);
|
|
2823
2886
|
const fallback = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";
|
|
2824
2887
|
const _sfc_main$s = defineComponent({
|
|
2888
|
+
name: "XImage",
|
|
2825
2889
|
props: {
|
|
2826
2890
|
src: String
|
|
2827
2891
|
},
|
|
@@ -2851,6 +2915,7 @@ function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2851
2915
|
}
|
|
2852
2916
|
var Image$1 = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$s]]);
|
|
2853
2917
|
const _sfc_main$r = defineComponent({
|
|
2918
|
+
name: "XInput",
|
|
2854
2919
|
validators: __spreadValues({}, useCommon.validators()),
|
|
2855
2920
|
props: __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, useCommon.props()), useInteractive.props()), useInputtable.props()), {
|
|
2856
2921
|
showPasswordToggle: {
|
|
@@ -2902,12 +2967,16 @@ const _sfc_main$r = defineComponent({
|
|
|
2902
2967
|
return "px-5 py-4 text-xl";
|
|
2903
2968
|
return "px-3 py-2";
|
|
2904
2969
|
});
|
|
2970
|
+
const css = useCSS("input");
|
|
2971
|
+
const colors = useColors();
|
|
2972
|
+
const color = colors.getPalette("primary");
|
|
2973
|
+
const style = css.get("border", color[500]);
|
|
2905
2974
|
function onChange(e) {
|
|
2906
2975
|
if (!e.target)
|
|
2907
2976
|
return;
|
|
2908
2977
|
const target = e.target;
|
|
2909
|
-
const value = Number(target.value);
|
|
2910
2978
|
if (props.type === "number") {
|
|
2979
|
+
const value = Number(target.value);
|
|
2911
2980
|
if (typeof props.min !== "undefined") {
|
|
2912
2981
|
if (value < props.min)
|
|
2913
2982
|
target.value = props.min.toString();
|
|
@@ -2926,6 +2995,7 @@ const _sfc_main$r = defineComponent({
|
|
|
2926
2995
|
currentType,
|
|
2927
2996
|
labelClasses,
|
|
2928
2997
|
sizeClasses,
|
|
2998
|
+
style,
|
|
2929
2999
|
elRef,
|
|
2930
3000
|
onChange,
|
|
2931
3001
|
togglePasswordVisibility
|
|
@@ -2941,7 +3011,7 @@ const _hoisted_6$4 = {
|
|
|
2941
3011
|
key: 1,
|
|
2942
3012
|
d: "M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"
|
|
2943
3013
|
};
|
|
2944
|
-
const _hoisted_7$
|
|
3014
|
+
const _hoisted_7$1 = ["textContent"];
|
|
2945
3015
|
const _hoisted_8$1 = ["textContent"];
|
|
2946
3016
|
function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2947
3017
|
const _component_x_icon = resolveComponent("x-icon");
|
|
@@ -2962,17 +3032,18 @@ function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2962
3032
|
}, null, 8, ["size", "icon"])) : createCommentVNode("", true),
|
|
2963
3033
|
createElementVNode("input", mergeProps({
|
|
2964
3034
|
ref: "elRef",
|
|
2965
|
-
class: ["appearance-none block w-full placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none
|
|
3035
|
+
class: ["appearance-none block w-full placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none transition-colors duration-150 ease-in-out border-gray-300 hover:border-gray-400 dark:border-gray-700 border shadow-sm rounded-md focus:border-[color:var(--x-input-border)]", [
|
|
2966
3036
|
_ctx.sizeClasses,
|
|
2967
3037
|
_ctx.disabled ? "bg-gray-100 dark:bg-gray-700 text-gray-500 cursor-not-allowed" : "bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-200",
|
|
2968
3038
|
_ctx.type === "password" ? "pr-9" : "",
|
|
2969
3039
|
{
|
|
2970
3040
|
"!pl-9": _ctx.icon,
|
|
2971
3041
|
"!pr-9": _ctx.iconRight,
|
|
2972
|
-
"border-
|
|
3042
|
+
"border-red-500 focus:border-red-500 dark:focus:border-red-500": _ctx.errorInternal
|
|
2973
3043
|
},
|
|
2974
3044
|
_ctx.inputClass
|
|
2975
3045
|
]],
|
|
3046
|
+
style: _ctx.style,
|
|
2976
3047
|
disabled: _ctx.disabled,
|
|
2977
3048
|
min: _ctx.min,
|
|
2978
3049
|
max: _ctx.max,
|
|
@@ -3012,9 +3083,9 @@ function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3012
3083
|
]),
|
|
3013
3084
|
_ctx.errorInternal ? (openBlock(), createElementBlock("p", {
|
|
3014
3085
|
key: 1,
|
|
3015
|
-
class: "text-sm text-
|
|
3086
|
+
class: "text-sm text-red-500 mt-1",
|
|
3016
3087
|
textContent: toDisplayString(_ctx.errorInternal)
|
|
3017
|
-
}, null, 8, _hoisted_7$
|
|
3088
|
+
}, null, 8, _hoisted_7$1)) : _ctx.helper ? (openBlock(), createElementBlock("p", {
|
|
3018
3089
|
key: 2,
|
|
3019
3090
|
class: "text-sm text-gray-500 mt-1",
|
|
3020
3091
|
textContent: toDisplayString(_ctx.helper)
|
|
@@ -3026,6 +3097,7 @@ var style0$3 = {
|
|
|
3026
3097
|
"link--shadow": "_link--shadow_1tilo_1"
|
|
3027
3098
|
};
|
|
3028
3099
|
const _sfc_main$q = defineComponent({
|
|
3100
|
+
name: "XLink",
|
|
3029
3101
|
props: __spreadProps(__spreadValues({}, useColors.props()), {
|
|
3030
3102
|
tag: {
|
|
3031
3103
|
type: String,
|
|
@@ -3061,7 +3133,7 @@ const _sfc_main$q = defineComponent({
|
|
|
3061
3133
|
};
|
|
3062
3134
|
}
|
|
3063
3135
|
});
|
|
3064
|
-
const _withScopeId$1 = (n) => (pushScopeId("data-v-
|
|
3136
|
+
const _withScopeId$1 = (n) => (pushScopeId("data-v-b6c57c10"), n = n(), popScopeId(), n);
|
|
3065
3137
|
const _hoisted_1$i = {
|
|
3066
3138
|
key: 0,
|
|
3067
3139
|
class: "inline-flex items-center"
|
|
@@ -3108,12 +3180,13 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3108
3180
|
const cssModules$3 = {
|
|
3109
3181
|
"$style": style0$3
|
|
3110
3182
|
};
|
|
3111
|
-
var XLink = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$q], ["__cssModules", cssModules$3], ["__scopeId", "data-v-
|
|
3183
|
+
var XLink = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$q], ["__cssModules", cssModules$3], ["__scopeId", "data-v-b6c57c10"]]);
|
|
3112
3184
|
var style0$2 = {
|
|
3113
3185
|
"menu-item": "_menu-item_1v1kj_2",
|
|
3114
3186
|
"menu-item--active": "_menu-item--active_1v1kj_1"
|
|
3115
3187
|
};
|
|
3116
3188
|
const _sfc_main$p = defineComponent({
|
|
3189
|
+
name: "XMenuItem",
|
|
3117
3190
|
components: {
|
|
3118
3191
|
XSpinner,
|
|
3119
3192
|
XLink
|
|
@@ -3145,16 +3218,20 @@ const _sfc_main$p = defineComponent({
|
|
|
3145
3218
|
setup(props, { emit }) {
|
|
3146
3219
|
const elRef = ref();
|
|
3147
3220
|
const isActive = ref(false);
|
|
3148
|
-
const filled = computed(() =>
|
|
3221
|
+
const filled = computed(() => {
|
|
3222
|
+
var _a2;
|
|
3223
|
+
return props.filled || ((_a2 = props.item) == null ? void 0 : _a2.filled);
|
|
3224
|
+
});
|
|
3149
3225
|
const cItem = computed(() => __spreadValues(__spreadValues({}, props), props.item));
|
|
3150
3226
|
const htmlTag = cItem.value.to || cItem.value.href ? "x-link" : "div";
|
|
3151
|
-
const
|
|
3227
|
+
const isSupported = window && "MutationObserver" in window;
|
|
3228
|
+
const classObserver = isSupported ? new MutationObserver(check) : null;
|
|
3152
3229
|
onMounted(() => {
|
|
3153
3230
|
if (!elRef.value)
|
|
3154
3231
|
return;
|
|
3155
3232
|
check();
|
|
3156
|
-
if (htmlTag === "x-link")
|
|
3157
|
-
classObserver.observe(elRef.value.$el, {
|
|
3233
|
+
if (isSupported && htmlTag === "x-link")
|
|
3234
|
+
classObserver == null ? void 0 : classObserver.observe(elRef.value.$el, {
|
|
3158
3235
|
attributes: true,
|
|
3159
3236
|
attributeFilter: ["class"]
|
|
3160
3237
|
});
|
|
@@ -3337,7 +3414,7 @@ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3337
3414
|
const cssModules$2 = {
|
|
3338
3415
|
"$style": style0$2
|
|
3339
3416
|
};
|
|
3340
|
-
var XMenuItem = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$p], ["__cssModules", cssModules$2], ["__scopeId", "data-v-
|
|
3417
|
+
var XMenuItem = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$p], ["__cssModules", cssModules$2], ["__scopeId", "data-v-6f9d99e4"]]);
|
|
3341
3418
|
const _sfc_main$o = defineComponent({
|
|
3342
3419
|
name: "XMenu",
|
|
3343
3420
|
components: {
|
|
@@ -3437,13 +3514,14 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3437
3514
|
rounded: _ctx.rounded,
|
|
3438
3515
|
class: normalizeClass({ "my-2": item.divider }),
|
|
3439
3516
|
onActive: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("expand"))
|
|
3440
|
-
}, null,
|
|
3517
|
+
}, null, 40, ["color", "size", "item", "disabled", "filled", "rounded", "class"]))
|
|
3441
3518
|
], 64);
|
|
3442
3519
|
}), 128))
|
|
3443
3520
|
])) : createCommentVNode("", true);
|
|
3444
3521
|
}
|
|
3445
3522
|
var Menu = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$o]]);
|
|
3446
3523
|
const _sfc_main$n = defineComponent({
|
|
3524
|
+
name: "XModal",
|
|
3447
3525
|
components: {
|
|
3448
3526
|
XScroll
|
|
3449
3527
|
},
|
|
@@ -3607,6 +3685,7 @@ const validators$4 = {
|
|
|
3607
3685
|
position: ["bottom", "top"]
|
|
3608
3686
|
};
|
|
3609
3687
|
const _sfc_main$m = defineComponent({
|
|
3688
|
+
name: "XNotifications",
|
|
3610
3689
|
components: {
|
|
3611
3690
|
XIcon
|
|
3612
3691
|
},
|
|
@@ -3698,7 +3777,7 @@ const _sfc_main$m = defineComponent({
|
|
|
3698
3777
|
add(isMessage ? preset : __spreadValues(__spreadValues({}, preset), notification));
|
|
3699
3778
|
}
|
|
3700
3779
|
function add(notification) {
|
|
3701
|
-
var _a2,
|
|
3780
|
+
var _a2, _b;
|
|
3702
3781
|
const mergeProps2 = {
|
|
3703
3782
|
id: Date.now(),
|
|
3704
3783
|
iconColor: props.color,
|
|
@@ -3712,7 +3791,7 @@ const _sfc_main$m = defineComponent({
|
|
|
3712
3791
|
internalPosition.value = merged.position;
|
|
3713
3792
|
const color = colors.getPalette(merged.iconColor);
|
|
3714
3793
|
const colorAction = colors.getPalette(((_a2 = merged.action) == null ? void 0 : _a2.color) || "primary");
|
|
3715
|
-
|
|
3794
|
+
const cssVariables = css.variables({
|
|
3716
3795
|
icon: color[400],
|
|
3717
3796
|
action: colorAction[400],
|
|
3718
3797
|
hover: {
|
|
@@ -3726,8 +3805,9 @@ const _sfc_main$m = defineComponent({
|
|
|
3726
3805
|
}
|
|
3727
3806
|
}
|
|
3728
3807
|
});
|
|
3808
|
+
merged.style = Object.keys(cssVariables).map((key) => `${key}: ${cssVariables[key]}`).join(";");
|
|
3729
3809
|
notifications.value.push(merged);
|
|
3730
|
-
(
|
|
3810
|
+
(_b = listRef.value) == null ? void 0 : _b.scrollTo({ top: 0, behavior: "smooth" });
|
|
3731
3811
|
if (merged.timeout)
|
|
3732
3812
|
setTimer(merged, merged.timeout);
|
|
3733
3813
|
}
|
|
@@ -3824,7 +3904,9 @@ function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3824
3904
|
key: 2,
|
|
3825
3905
|
icon: _ctx.removeIcon,
|
|
3826
3906
|
class: "text-gray-400 hover:text-gray-500 ml-3 shrink-0 cursor-pointer",
|
|
3827
|
-
onClick: (
|
|
3907
|
+
onClick: () => {
|
|
3908
|
+
_ctx.remove(notification);
|
|
3909
|
+
}
|
|
3828
3910
|
}, null, 8, ["icon", "onClick"])) : createCommentVNode("", true)
|
|
3829
3911
|
])
|
|
3830
3912
|
], 6);
|
|
@@ -3838,6 +3920,7 @@ function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3838
3920
|
}
|
|
3839
3921
|
var Notifications = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$m]]);
|
|
3840
3922
|
const _sfc_main$l = defineComponent({
|
|
3923
|
+
name: "XPaginationItem",
|
|
3841
3924
|
components: {
|
|
3842
3925
|
XButton
|
|
3843
3926
|
},
|
|
@@ -3888,6 +3971,7 @@ function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3888
3971
|
}
|
|
3889
3972
|
var XPaginationItem = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$l]]);
|
|
3890
3973
|
const _sfc_main$k = defineComponent({
|
|
3974
|
+
name: "XPagination",
|
|
3891
3975
|
components: {
|
|
3892
3976
|
XIcon,
|
|
3893
3977
|
XButton,
|
|
@@ -3934,6 +4018,10 @@ const _sfc_main$k = defineComponent({
|
|
|
3934
4018
|
return "h-5 w-5";
|
|
3935
4019
|
return "h-3 w-3";
|
|
3936
4020
|
});
|
|
4021
|
+
const css = useCSS("pagination");
|
|
4022
|
+
const colors = useColors();
|
|
4023
|
+
const color = colors.getPalette("primary");
|
|
4024
|
+
const style = css.get("bg", color[500]);
|
|
3937
4025
|
const quickInput = ref(props.modelValue + "");
|
|
3938
4026
|
function onQuickInput() {
|
|
3939
4027
|
const number = parseInt(quickInput.value);
|
|
@@ -3976,6 +4064,7 @@ const _sfc_main$k = defineComponent({
|
|
|
3976
4064
|
nextIcon,
|
|
3977
4065
|
quickInput,
|
|
3978
4066
|
quickButtonSize,
|
|
4067
|
+
style,
|
|
3979
4068
|
onQuickInput,
|
|
3980
4069
|
prevPage,
|
|
3981
4070
|
nextPage
|
|
@@ -3993,11 +4082,7 @@ const _hoisted_5$3 = {
|
|
|
3993
4082
|
key: 1,
|
|
3994
4083
|
class: "flex items-center space-x-2"
|
|
3995
4084
|
};
|
|
3996
|
-
const _hoisted_6$3 =
|
|
3997
|
-
key: 2,
|
|
3998
|
-
class: "flex space-x-6"
|
|
3999
|
-
};
|
|
4000
|
-
const _hoisted_7$1 = ["onClick"];
|
|
4085
|
+
const _hoisted_6$3 = ["onClick"];
|
|
4001
4086
|
function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4002
4087
|
const _component_x_button = resolveComponent("x-button");
|
|
4003
4088
|
const _component_x_input = resolveComponent("x-input");
|
|
@@ -4065,15 +4150,19 @@ function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4065
4150
|
selected: _ctx.modelValue === _ctx.totalPages,
|
|
4066
4151
|
onInput: _cache[3] || (_cache[3] = (value) => _ctx.$emit("update:modelValue", value))
|
|
4067
4152
|
}, null, 8, ["value", "links", "size", "selected"])) : createCommentVNode("", true)
|
|
4068
|
-
])) : _ctx.variant === "dots" ? (openBlock(), createElementBlock("ul",
|
|
4153
|
+
])) : _ctx.variant === "dots" ? (openBlock(), createElementBlock("ul", {
|
|
4154
|
+
key: 2,
|
|
4155
|
+
class: "flex space-x-6",
|
|
4156
|
+
style: normalizeStyle(_ctx.style)
|
|
4157
|
+
}, [
|
|
4069
4158
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.totalPages, (i) => {
|
|
4070
4159
|
return openBlock(), createElementBlock("li", {
|
|
4071
4160
|
key: i,
|
|
4072
|
-
class: normalizeClass(["rounded-full cursor-pointer", [_ctx.dotsClass, i === _ctx.modelValue ? "bg-
|
|
4161
|
+
class: normalizeClass(["rounded-full cursor-pointer", [_ctx.dotsClass, i === _ctx.modelValue ? "bg-[color:var(--x-pagination-bg)]" : "bg-gray-100 hover:bg-gray-200"]]),
|
|
4073
4162
|
onClick: ($event) => _ctx.$emit("update:modelValue", i)
|
|
4074
|
-
}, null, 10,
|
|
4163
|
+
}, null, 10, _hoisted_6$3);
|
|
4075
4164
|
}), 128))
|
|
4076
|
-
])) : createCommentVNode("", true);
|
|
4165
|
+
], 4)) : createCommentVNode("", true);
|
|
4077
4166
|
}
|
|
4078
4167
|
var Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$k]]);
|
|
4079
4168
|
const popover = "_popover_2vipi_2";
|
|
@@ -4098,6 +4187,7 @@ const validators$3 = {
|
|
|
4098
4187
|
position: ["bottom", "left", "right", "top"]
|
|
4099
4188
|
};
|
|
4100
4189
|
const _sfc_main$j = defineComponent({
|
|
4190
|
+
name: "XPopover",
|
|
4101
4191
|
validators: validators$3,
|
|
4102
4192
|
props: {
|
|
4103
4193
|
align: {
|
|
@@ -4220,6 +4310,7 @@ const cssModules$1 = {
|
|
|
4220
4310
|
};
|
|
4221
4311
|
var XPopover = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$j], ["__cssModules", cssModules$1]]);
|
|
4222
4312
|
const _sfc_main$i = defineComponent({
|
|
4313
|
+
name: "XPopoverContainer",
|
|
4223
4314
|
props: {
|
|
4224
4315
|
tag: {
|
|
4225
4316
|
default: "div",
|
|
@@ -4237,6 +4328,7 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4237
4328
|
}
|
|
4238
4329
|
var XPopoverContainer = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$i]]);
|
|
4239
4330
|
const _sfc_main$h = defineComponent({
|
|
4331
|
+
name: "XProgress",
|
|
4240
4332
|
props: __spreadProps(__spreadValues({}, useColors.props("primary")), {
|
|
4241
4333
|
percentage: {
|
|
4242
4334
|
type: Number,
|
|
@@ -4298,6 +4390,7 @@ var style0 = {
|
|
|
4298
4390
|
"radio--glow": "_radio--glow_14rlz_1"
|
|
4299
4391
|
};
|
|
4300
4392
|
const _sfc_main$g = defineComponent({
|
|
4393
|
+
name: "XRadio",
|
|
4301
4394
|
components: {
|
|
4302
4395
|
XSpinner
|
|
4303
4396
|
},
|
|
@@ -4392,7 +4485,7 @@ const _sfc_main$g = defineComponent({
|
|
|
4392
4485
|
});
|
|
4393
4486
|
}
|
|
4394
4487
|
});
|
|
4395
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
|
4488
|
+
const _withScopeId = (n) => (pushScopeId("data-v-857bd200"), n = n(), popScopeId(), n);
|
|
4396
4489
|
const _hoisted_1$c = ["aria-selected", "aria-disabled"];
|
|
4397
4490
|
const _hoisted_2$8 = ["name", "required", "disabled"];
|
|
4398
4491
|
const _hoisted_3$6 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("circle", {
|
|
@@ -4480,7 +4573,7 @@ function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4480
4573
|
], 2)) : createCommentVNode("", true),
|
|
4481
4574
|
_ctx.errorInternal ? (openBlock(), createElementBlock("p", {
|
|
4482
4575
|
key: 1,
|
|
4483
|
-
class: "text-sm text-
|
|
4576
|
+
class: "text-sm text-red-500 mt-1",
|
|
4484
4577
|
textContent: toDisplayString(_ctx.errorInternal)
|
|
4485
4578
|
}, null, 8, _hoisted_6$2)) : createCommentVNode("", true)
|
|
4486
4579
|
], 40, _hoisted_1$c);
|
|
@@ -4488,8 +4581,9 @@ function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4488
4581
|
const cssModules = {
|
|
4489
4582
|
"$style": style0
|
|
4490
4583
|
};
|
|
4491
|
-
var Radio = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$g], ["__cssModules", cssModules], ["__scopeId", "data-v-
|
|
4584
|
+
var Radio = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$g], ["__cssModules", cssModules], ["__scopeId", "data-v-857bd200"]]);
|
|
4492
4585
|
const _sfc_main$f = defineComponent({
|
|
4586
|
+
name: "XTag",
|
|
4493
4587
|
props: __spreadProps(__spreadValues(__spreadValues({}, useCommon.props()), useColors.props("gray")), {
|
|
4494
4588
|
tag: {
|
|
4495
4589
|
type: String,
|
|
@@ -4573,6 +4667,7 @@ function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4573
4667
|
}
|
|
4574
4668
|
var XTag = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$f]]);
|
|
4575
4669
|
const _sfc_main$e = defineComponent({
|
|
4670
|
+
name: "XSelect",
|
|
4576
4671
|
components: {
|
|
4577
4672
|
XTag,
|
|
4578
4673
|
XMenuItem,
|
|
@@ -4656,6 +4751,10 @@ const _sfc_main$e = defineComponent({
|
|
|
4656
4751
|
return "px-5 py-4 text-xl";
|
|
4657
4752
|
return "px-3 py-2";
|
|
4658
4753
|
});
|
|
4754
|
+
const css = useCSS("select");
|
|
4755
|
+
const colors = useColors();
|
|
4756
|
+
const color = colors.getPalette("primary");
|
|
4757
|
+
const style = css.get("border", color[500]);
|
|
4659
4758
|
const availableOptions = computed(() => {
|
|
4660
4759
|
var _a2;
|
|
4661
4760
|
return (_a2 = props.options) == null ? void 0 : _a2.filter((option) => !option.disabled);
|
|
@@ -4793,6 +4892,7 @@ const _sfc_main$e = defineComponent({
|
|
|
4793
4892
|
internalOptions,
|
|
4794
4893
|
labelClasses,
|
|
4795
4894
|
sizeClasses,
|
|
4895
|
+
style,
|
|
4796
4896
|
isEmpty,
|
|
4797
4897
|
getLabel,
|
|
4798
4898
|
handleRemove
|
|
@@ -4864,13 +4964,14 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4864
4964
|
]),
|
|
4865
4965
|
default: withCtx(() => [
|
|
4866
4966
|
createElementVNode("div", {
|
|
4867
|
-
class: normalizeClass(["w-full border border-gray-300 hover:border-gray-400 dark:border-gray-700 pr-8
|
|
4967
|
+
class: normalizeClass(["w-full border border-gray-300 hover:border-gray-400 dark:border-gray-700 pr-8 transition-colors duration-150 ease-in-out rounded-md shadow-sm group-focus:border-[color:var(--x-select-border)]", [
|
|
4868
4968
|
_ctx.sizeClasses,
|
|
4869
4969
|
_ctx.disabled ? "bg-gray-100 dark:bg-gray-700 text-gray-500 dark:text-gray-400 cursor-not-allowed" : "bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-200",
|
|
4870
4970
|
{
|
|
4871
|
-
"border-
|
|
4971
|
+
"border-red-500 focus:border-red-500 dark:focus:border-red-500": _ctx.errorInternal
|
|
4872
4972
|
}
|
|
4873
|
-
]])
|
|
4973
|
+
]]),
|
|
4974
|
+
style: normalizeStyle(_ctx.style)
|
|
4874
4975
|
}, [
|
|
4875
4976
|
_ctx.multiple && Array.isArray(_ctx.selected) && _ctx.selected.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.selected, (value) => {
|
|
4876
4977
|
return openBlock(), createBlock(_component_x_tag, {
|
|
@@ -4892,7 +4993,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4892
4993
|
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
4893
4994
|
_ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_3$4, toDisplayString(_ctx.placeholder), 1)) : (openBlock(), createElementBlock("div", _hoisted_4$4, "\xA0"))
|
|
4894
4995
|
], 64))
|
|
4895
|
-
],
|
|
4996
|
+
], 6)
|
|
4896
4997
|
]),
|
|
4897
4998
|
_: 1
|
|
4898
4999
|
}, 8, ["disabled", "dismiss-on-click"]),
|
|
@@ -4941,7 +5042,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4941
5042
|
]),
|
|
4942
5043
|
_ctx.errorInternal ? (openBlock(), createElementBlock("p", {
|
|
4943
5044
|
key: 1,
|
|
4944
|
-
class: "text-sm text-
|
|
5045
|
+
class: "text-sm text-red-500 mt-1",
|
|
4945
5046
|
textContent: toDisplayString(_ctx.errorInternal)
|
|
4946
5047
|
}, null, 8, _hoisted_11)) : _ctx.helper ? (openBlock(), createElementBlock("p", {
|
|
4947
5048
|
key: 2,
|
|
@@ -4952,6 +5053,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4952
5053
|
}
|
|
4953
5054
|
var Select = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$e]]);
|
|
4954
5055
|
const _sfc_main$d = defineComponent({
|
|
5056
|
+
name: "XSkeleton",
|
|
4955
5057
|
props: {
|
|
4956
5058
|
tag: {
|
|
4957
5059
|
type: String,
|
|
@@ -4970,6 +5072,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4970
5072
|
}
|
|
4971
5073
|
var Skeleton = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$d]]);
|
|
4972
5074
|
const _sfc_main$c = defineComponent({
|
|
5075
|
+
name: "XSlider",
|
|
4973
5076
|
components: {
|
|
4974
5077
|
XProgress
|
|
4975
5078
|
},
|
|
@@ -5006,10 +5109,12 @@ const _sfc_main$c = defineComponent({
|
|
|
5006
5109
|
});
|
|
5007
5110
|
const css = useCSS("slider");
|
|
5008
5111
|
const colors = useColors();
|
|
5112
|
+
const primary = colors.getPalette("primary");
|
|
5009
5113
|
const style = computed(() => {
|
|
5010
5114
|
const color = colors.getPalette(props.color);
|
|
5011
5115
|
return css.variables({
|
|
5012
|
-
bg: color[500]
|
|
5116
|
+
bg: color[500],
|
|
5117
|
+
border: primary[500]
|
|
5013
5118
|
});
|
|
5014
5119
|
});
|
|
5015
5120
|
watch(() => props.modelValue, (val) => {
|
|
@@ -5148,7 +5253,7 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5148
5253
|
]),
|
|
5149
5254
|
createElementVNode("div", {
|
|
5150
5255
|
ref: "dragRef",
|
|
5151
|
-
class: normalizeClass(["absolute w-[20px] h-[20px] -mt-[13px] -ml-[10px] rounded-full bg-white border shadow-sm group-focus:border-
|
|
5256
|
+
class: normalizeClass(["absolute w-[20px] h-[20px] -mt-[13px] -ml-[10px] rounded-full bg-white border shadow-sm group-focus:border-[color:var(--x-slider-border)]", [_ctx.isDragging ? "cursor-grabbing" : "cursor-grab"]]),
|
|
5152
5257
|
style: normalizeStyle(`left: ${_ctx.value}%;`)
|
|
5153
5258
|
}, null, 6)
|
|
5154
5259
|
], 2),
|
|
@@ -5156,22 +5261,26 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5156
5261
|
]),
|
|
5157
5262
|
_ctx.errorInternal ? (openBlock(), createElementBlock("p", {
|
|
5158
5263
|
key: 1,
|
|
5159
|
-
class: "text-sm text-
|
|
5264
|
+
class: "text-sm text-red-500 mt-1",
|
|
5160
5265
|
textContent: toDisplayString(_ctx.errorInternal)
|
|
5161
5266
|
}, null, 8, _hoisted_4$3)) : createCommentVNode("", true)
|
|
5162
5267
|
], 6);
|
|
5163
5268
|
}
|
|
5164
5269
|
var Slider = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$c]]);
|
|
5165
|
-
const _sfc_main$b = {
|
|
5270
|
+
const _sfc_main$b = defineComponent({
|
|
5271
|
+
name: "XSpacer"
|
|
5272
|
+
});
|
|
5166
5273
|
const _hoisted_1$7 = { class: "flex-grow" };
|
|
5167
|
-
function _sfc_render$b(_ctx, _cache) {
|
|
5274
|
+
function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5168
5275
|
return openBlock(), createElementBlock("div", _hoisted_1$7);
|
|
5169
5276
|
}
|
|
5170
5277
|
var Spacer = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$b]]);
|
|
5171
|
-
const _sfc_main$a = {
|
|
5278
|
+
const _sfc_main$a = defineComponent({
|
|
5279
|
+
name: "XTableHead"
|
|
5280
|
+
});
|
|
5172
5281
|
const _hoisted_1$6 = { class: "align-bottom" };
|
|
5173
5282
|
const _hoisted_2$4 = { class: "text-sm text-gray-600 dark:text-gray-400 border-b" };
|
|
5174
|
-
function _sfc_render$a(_ctx, _cache) {
|
|
5283
|
+
function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5175
5284
|
return openBlock(), createElementBlock("thead", _hoisted_1$6, [
|
|
5176
5285
|
createElementVNode("tr", _hoisted_2$4, [
|
|
5177
5286
|
renderSlot(_ctx.$slots, "default")
|
|
@@ -5184,6 +5293,7 @@ const validators$2 = {
|
|
|
5184
5293
|
textAlign: ["left", "center", "right", "justify"]
|
|
5185
5294
|
};
|
|
5186
5295
|
const _sfc_main$9 = defineComponent({
|
|
5296
|
+
name: "XTableHeader",
|
|
5187
5297
|
validators: validators$2,
|
|
5188
5298
|
props: {
|
|
5189
5299
|
sort: {
|
|
@@ -5258,8 +5368,10 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5258
5368
|
], 2);
|
|
5259
5369
|
}
|
|
5260
5370
|
var TableHeader = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$9]]);
|
|
5261
|
-
const _sfc_main$8 = {
|
|
5262
|
-
|
|
5371
|
+
const _sfc_main$8 = defineComponent({
|
|
5372
|
+
name: "XTableBody"
|
|
5373
|
+
});
|
|
5374
|
+
function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5263
5375
|
return openBlock(), createElementBlock("tbody", null, [
|
|
5264
5376
|
renderSlot(_ctx.$slots, "default")
|
|
5265
5377
|
]);
|
|
@@ -5269,6 +5381,7 @@ const validators$1 = {
|
|
|
5269
5381
|
verticalAlign: ["baseline", "bottom", "middle", "text-bottom", "text-top", "top"]
|
|
5270
5382
|
};
|
|
5271
5383
|
const _sfc_main$7 = defineComponent({
|
|
5384
|
+
name: "XTableRow",
|
|
5272
5385
|
validators: validators$1,
|
|
5273
5386
|
props: {
|
|
5274
5387
|
pointer: Boolean,
|
|
@@ -5318,6 +5431,7 @@ const validators = {
|
|
|
5318
5431
|
]
|
|
5319
5432
|
};
|
|
5320
5433
|
const _sfc_main$6 = defineComponent({
|
|
5434
|
+
name: "XTableCell",
|
|
5321
5435
|
validators,
|
|
5322
5436
|
props: {
|
|
5323
5437
|
textAlign: {
|
|
@@ -5364,6 +5478,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5364
5478
|
}
|
|
5365
5479
|
var TableCell = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6]]);
|
|
5366
5480
|
const _sfc_main$5 = defineComponent({
|
|
5481
|
+
name: "XTable",
|
|
5367
5482
|
components: {
|
|
5368
5483
|
TableHead,
|
|
5369
5484
|
TableHeader,
|
|
@@ -5526,6 +5641,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5526
5641
|
}
|
|
5527
5642
|
var Table = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5]]);
|
|
5528
5643
|
const _sfc_main$4 = defineComponent({
|
|
5644
|
+
name: "XTab",
|
|
5529
5645
|
props: __spreadProps(__spreadValues({}, useCommon.props()), {
|
|
5530
5646
|
value: {
|
|
5531
5647
|
type: [String, Number],
|
|
@@ -5625,6 +5741,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5625
5741
|
}
|
|
5626
5742
|
var Tab = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4]]);
|
|
5627
5743
|
const _sfc_main$3 = defineComponent({
|
|
5744
|
+
name: "XTabGroup",
|
|
5628
5745
|
components: {
|
|
5629
5746
|
XScroll
|
|
5630
5747
|
},
|
|
@@ -5750,10 +5867,11 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5750
5867
|
createElementVNode("div", _hoisted_1$2, null, 512)
|
|
5751
5868
|
]);
|
|
5752
5869
|
}
|
|
5753
|
-
var
|
|
5870
|
+
var TabGroup = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
|
|
5754
5871
|
const _sfc_main$2 = defineComponent({
|
|
5872
|
+
name: "XTextarea",
|
|
5755
5873
|
validators: __spreadValues({}, useCommon.validators()),
|
|
5756
|
-
props: __spreadProps(__spreadValues(__spreadValues(__spreadValues(
|
|
5874
|
+
props: __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, useCommon.props()), useInteractive.props()), useInputtable.props()), {
|
|
5757
5875
|
helper: String,
|
|
5758
5876
|
label: String,
|
|
5759
5877
|
dir: {
|
|
@@ -5791,6 +5909,10 @@ const _sfc_main$2 = defineComponent({
|
|
|
5791
5909
|
watch([() => props.modelValue, () => props.size], () => {
|
|
5792
5910
|
setTimeout(resize);
|
|
5793
5911
|
});
|
|
5912
|
+
const css = useCSS("textarea");
|
|
5913
|
+
const colors = useColors();
|
|
5914
|
+
const color = colors.getPalette("primary");
|
|
5915
|
+
const style = css.get("border", color[500]);
|
|
5794
5916
|
function onInput() {
|
|
5795
5917
|
resize();
|
|
5796
5918
|
}
|
|
@@ -5809,6 +5931,7 @@ const _sfc_main$2 = defineComponent({
|
|
|
5809
5931
|
const interactive = useInteractive(elRef);
|
|
5810
5932
|
return __spreadProps(__spreadValues(__spreadValues({}, interactive), useInputtable(props, { focus: interactive.focus, emit })), {
|
|
5811
5933
|
elRef,
|
|
5934
|
+
style,
|
|
5812
5935
|
onInput,
|
|
5813
5936
|
onEnter
|
|
5814
5937
|
});
|
|
@@ -5835,7 +5958,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5835
5958
|
}, null, 10, _hoisted_1$1)) : createCommentVNode("", true),
|
|
5836
5959
|
createElementVNode("textarea", mergeProps({
|
|
5837
5960
|
ref: "elRef",
|
|
5838
|
-
class: ["appearance-none block w-full placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none
|
|
5961
|
+
class: ["appearance-none block w-full placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none transition-colors duration-150 ease-in-out border-gray-300 dark:border-gray-700 resize-none overflow-hidden border shadow-sm rounded-md focus:border-[color:var(--x-textarea-border)]", [
|
|
5839
5962
|
_ctx.disabled ? "bg-gray-100 dark:bg-gray-700 text-gray-500 cursor-not-allowed" : "bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-200",
|
|
5840
5963
|
{
|
|
5841
5964
|
"px-2 py-1 text-xs": _ctx.size === "xs",
|
|
@@ -5845,10 +5968,11 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5845
5968
|
"px-5 py-4 text-xl": _ctx.size === "xl"
|
|
5846
5969
|
},
|
|
5847
5970
|
{
|
|
5848
|
-
"border-
|
|
5971
|
+
"border-red-500 focus:border-red-500 dark:focus:border-red-500": _ctx.errorInternal
|
|
5849
5972
|
},
|
|
5850
5973
|
_ctx.inputClass
|
|
5851
5974
|
]],
|
|
5975
|
+
style: _ctx.style,
|
|
5852
5976
|
disabled: _ctx.disabled,
|
|
5853
5977
|
max: _ctx.max,
|
|
5854
5978
|
maxlength: _ctx.maxlength,
|
|
@@ -5865,7 +5989,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5865
5989
|
}), null, 16, _hoisted_2$1),
|
|
5866
5990
|
_ctx.errorInternal ? (openBlock(), createElementBlock("p", {
|
|
5867
5991
|
key: 1,
|
|
5868
|
-
class: "text-sm text-
|
|
5992
|
+
class: "text-sm text-red-500 mt-1",
|
|
5869
5993
|
textContent: toDisplayString(_ctx.errorInternal)
|
|
5870
5994
|
}, null, 8, _hoisted_3$1)) : _ctx.helper ? (openBlock(), createElementBlock("p", {
|
|
5871
5995
|
key: 2,
|
|
@@ -5876,6 +6000,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5876
6000
|
}
|
|
5877
6001
|
var Textarea = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
|
|
5878
6002
|
const _sfc_main$1 = defineComponent({
|
|
6003
|
+
name: "XToggle",
|
|
5879
6004
|
components: {
|
|
5880
6005
|
XSpinner
|
|
5881
6006
|
},
|
|
@@ -5992,13 +6117,14 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5992
6117
|
]),
|
|
5993
6118
|
_ctx.errorInternal ? (openBlock(), createElementBlock("p", {
|
|
5994
6119
|
key: 0,
|
|
5995
|
-
class: "text-sm text-
|
|
6120
|
+
class: "text-sm text-red-500 mt-1",
|
|
5996
6121
|
textContent: toDisplayString(_ctx.errorInternal)
|
|
5997
6122
|
}, null, 8, _hoisted_4)) : createCommentVNode("", true)
|
|
5998
6123
|
], 2);
|
|
5999
6124
|
}
|
|
6000
6125
|
var Toggle = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
|
|
6001
6126
|
const _sfc_main = defineComponent({
|
|
6127
|
+
name: "XTooltip",
|
|
6002
6128
|
components: {
|
|
6003
6129
|
XPopover,
|
|
6004
6130
|
XPopoverContainer
|
|
@@ -6068,7 +6194,7 @@ var components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
|
|
|
6068
6194
|
XTableHeader: TableHeader,
|
|
6069
6195
|
XTableRow: TableRow,
|
|
6070
6196
|
XTab: Tab,
|
|
6071
|
-
|
|
6197
|
+
XTabGroup: TabGroup,
|
|
6072
6198
|
XTag,
|
|
6073
6199
|
XTextarea: Textarea,
|
|
6074
6200
|
XToggle: Toggle,
|
|
@@ -6080,9 +6206,24 @@ const useNotification = () => {
|
|
|
6080
6206
|
console.warn("useNotification must have a parent wrapped with Notifications component");
|
|
6081
6207
|
return notification;
|
|
6082
6208
|
};
|
|
6083
|
-
const
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
|
|
6209
|
+
const defaultOptions = {
|
|
6210
|
+
prefix: "X"
|
|
6211
|
+
};
|
|
6212
|
+
const create = (createOptions = {}) => {
|
|
6213
|
+
const install2 = (app, installOptions = {}) => {
|
|
6214
|
+
const options = __spreadValues(__spreadValues(__spreadValues({}, defaultOptions), createOptions), installOptions);
|
|
6215
|
+
if (options.components)
|
|
6216
|
+
options.components.forEach((component) => {
|
|
6217
|
+
app.component(`${options.prefix}${component.name.slice(1)}`, component);
|
|
6218
|
+
});
|
|
6219
|
+
app.provide(injectColorsKey, options.colors);
|
|
6220
|
+
app.provide(injectIconsKey, options.icons);
|
|
6221
|
+
};
|
|
6222
|
+
return {
|
|
6223
|
+
install: install2
|
|
6224
|
+
};
|
|
6087
6225
|
};
|
|
6088
|
-
|
|
6226
|
+
var install = create({
|
|
6227
|
+
components: Object.keys(components).map((key) => components[key])
|
|
6228
|
+
});
|
|
6229
|
+
export { Alert as XAlert, Avatar as XAvatar, Badge as XBadge, Breadcrumbs as XBreadcrumbs, XButton, ButtonGroup as XButtonGroup, Card as XCard, Checkbox as XCheckbox, XCollapse, Container as XContainer, XDivider, Drawer as XDrawer, Form as XForm, XIcon, Image$1 as XImage, Input as XInput, XLink, Menu as XMenu, XMenuItem, Modal as XModal, Notifications as XNotifications, Pagination as XPagination, XPaginationItem, XPopover, XPopoverContainer, XProgress, Radio as XRadio, XScroll, Select as XSelect, Skeleton as XSkeleton, Slider as XSlider, Spacer as XSpacer, XSpinner, Tab as XTab, TabGroup as XTabGroup, Table as XTable, TableBody as XTableBody, TableCell as XTableCell, TableHead as XTableHead, TableHeader as XTableHeader, TableRow as XTableRow, XTag, Textarea as XTextarea, Toggle as XToggle, Tooltip as XTooltip, tailwindColors as colors, create as createUI, install as default, injectButtonGroupKey, injectColorsKey, injectFormKey, injectIconsKey, injectNotificationKey, injectTabKey, useCSS, useColors, useCommon, useInputtable, useInteractive, useNotification, version };
|