coles-solid-library 0.1.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Button/Button.d.ts +4 -7
- package/dist/components/Chip/Chip.d.ts +0 -1
- package/dist/components/Container/container.d.ts +9 -0
- package/dist/components/Form/formGroup.d.ts +49 -23
- package/dist/components/Form/formHelp/formArray.d.ts +85 -0
- package/dist/components/Form/formHelp/models.d.ts +31 -0
- package/dist/components/Form/formHelp/validators.d.ts +81 -0
- package/dist/components/FormField/coleError.d.ts +7 -0
- package/dist/components/FormField/formField.d.ts +1 -1
- package/dist/components/FormField/formProvider.d.ts +9 -0
- package/dist/components/Header/header.d.ts +7 -0
- package/dist/components/Menu/menu.d.ts +9 -0
- package/dist/components/Menu/menuitem.d.ts +6 -0
- package/dist/components/Select/select.component.d.ts +0 -1
- package/dist/components/TabV2/tabs.d.ts +24 -0
- package/dist/components/TableV2/cell.d.ts +2 -1
- package/dist/components/TableV2/header.d.ts +1 -0
- package/dist/components/TableV2/table.d.ts +3 -3
- package/dist/components/TableV2/tableProvider.d.ts +1 -3
- package/dist/components/expansion/expansion.d.ts +0 -1
- package/dist/components/popup/popup.component.d.ts +0 -12
- package/dist/index.d.ts +5 -1
- package/dist/index.esm.js +1092 -642
- package/package.json +1 -1
- package/readme.md +37 -10
- package/themes/_variables.scss +28 -21
- package/themes/themes.scss +66 -58
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { sharedConfig,
|
|
1
|
+
import { sharedConfig, untrack, createRenderEffect, getOwner, createEffect, runWithOwner, createMemo, createSignal, createRoot, onCleanup, splitProps, mergeProps, createContext, useContext, createComponent, Show, onMount, For, $PROXY, batch, $TRACK, getListener, children } from 'solid-js';
|
|
2
2
|
|
|
3
3
|
const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "inert", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
|
|
4
4
|
const Properties = /*#__PURE__*/new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
|
|
@@ -102,11 +102,11 @@ const $$EVENTS = "_$DX_DELEGATE";
|
|
|
102
102
|
function template(html, isImportNode, isSVG, isMathML) {
|
|
103
103
|
let node;
|
|
104
104
|
const create = () => {
|
|
105
|
-
const t = document.createElement("template");
|
|
105
|
+
const t = isMathML ? document.createElementNS("http://www.w3.org/1998/Math/MathML", "template") : document.createElement("template");
|
|
106
106
|
t.innerHTML = html;
|
|
107
|
-
return t.content.firstChild;
|
|
107
|
+
return isSVG ? t.content.firstChild.firstChild : isMathML ? t.firstChild : t.content.firstChild;
|
|
108
108
|
};
|
|
109
|
-
const fn = () => (node || (node = create())).cloneNode(true);
|
|
109
|
+
const fn = isImportNode ? () => untrack(() => document.importNode(node || (node = create()), true)) : () => (node || (node = create())).cloneNode(true);
|
|
110
110
|
fn.cloneNode = fn;
|
|
111
111
|
return fn;
|
|
112
112
|
}
|
|
@@ -166,7 +166,7 @@ function classList(node, value, prev = {}) {
|
|
|
166
166
|
}
|
|
167
167
|
return prev;
|
|
168
168
|
}
|
|
169
|
-
function style$
|
|
169
|
+
function style$9(node, value, prev) {
|
|
170
170
|
if (!value) return prev ? setAttribute(node, "style") : value;
|
|
171
171
|
const nodeStyle = node.style;
|
|
172
172
|
if (typeof value === "string") return nodeStyle.cssText = value;
|
|
@@ -243,7 +243,7 @@ function toggleClassKey(node, key, value) {
|
|
|
243
243
|
}
|
|
244
244
|
function assignProp(node, prop, value, prev, isSVG, skipRef, props) {
|
|
245
245
|
let isCE, isProp, isChildProp, propAlias, forceProp;
|
|
246
|
-
if (prop === "style") return style$
|
|
246
|
+
if (prop === "style") return style$9(node, value, prev);
|
|
247
247
|
if (prop === "classList") return classList(node, value, prev);
|
|
248
248
|
if (value === prev) return prev;
|
|
249
249
|
if (prop === "ref") {
|
|
@@ -528,21 +528,49 @@ function styleInject(css, ref) {
|
|
|
528
528
|
}
|
|
529
529
|
}
|
|
530
530
|
|
|
531
|
-
var css_248z$
|
|
532
|
-
var style$
|
|
533
|
-
styleInject(css_248z$
|
|
531
|
+
var css_248z$f = ".Button_customButtonStyle__1TOXE {\n border-radius: 8px;\n font-family: \"Roboto, sans-serif\";\n padding: 8px 8px;\n border: none;\n transition: transform 0.2s ease, background 0.2s ease;\n}\n.Button_customButtonStyle__1TOXE:active {\n transform: scale(0.9);\n box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.3);\n}\n.Button_customButtonStyle__1TOXE:not(:disabled):hover {\n cursor: pointer;\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15);\n}\n.Button_customButtonStyle__1TOXE:disabled:hover {\n cursor: not-allowed;\n}\n\n.Button_primary__auYD2 {\n background-color: var(--primary-color, #4CAF50);\n color: var(--on-primary-color, #fff);\n}\n\n.Button_primaryVariant__NbKc2 {\n background-color: var(--primary-color-varient, #43A047);\n color: var(--on-primary-color, #fff);\n}\n\n.Button_secondary__DVppl {\n background-color: var(--secondary-color, #14b9c3);\n color: var(--on-secondary-color, #000000);\n}\n\n.Button_secondaryVariant__suwON {\n background-color: var(--secondary-color-varient, #0b969f);\n color: var(--on-secondary-color, #000000);\n}\n\n.Button_background__E82uk {\n background-color: var(--background-color, #ffffff);\n color: var(--on-background-color, #000000);\n}\n\n.Button_surface__EF0NA {\n background-color: var(--surface-color, #EEEEEE);\n color: var(--on-surface-color, #000000);\n}\n\n.Button_surfaceVariant__-SFxJ {\n background-color: var(--surface-color-variant, #ccc);\n color: var(--on-surface-color, #000000);\n}\n\n.Button_container__E1Hq5 {\n background-color: var(--container-color, #ffffff);\n color: var(--on-container-color, #000);\n}\n\n.Button_error__Yab6f {\n background-color: var(--error-color, #B00020);\n color: var(--on-error-color, #ffffff);\n}\n\n.Button_borderPrimary__uJ-qE {\n border: 1px solid var(--primary-color, #4CAF50);\n}\n\n.Button_borderPrimaryVariant__qkdEf {\n border: 1px solid var(--primary-color-varient, #43A047);\n}\n\n.Button_borderSecondary__-P9is {\n border: 1px solid var(--secondary-color, #14b9c3);\n}\n\n.Button_borderSecondaryVariant__6dCZ7 {\n border: 1px solid var(--secondary-color-varient, #0b969f);\n}\n\n.Button_borderBackground__lm7yB {\n border: 1px solid var(--background-color, #ffffff);\n}\n\n.Button_borderSurface__AJQxT {\n border: 1px solid var(--surface-color, #EEEEEE);\n}\n\n.Button_borderSurfaceVariant__Cfk2f {\n border: 1px solid var(--surface-color-variant, #ccc);\n}\n\n.Button_borderContainer__GXDhL {\n border: 1px solid var(--container-color, #ffffff);\n}\n\n.Button_borderError__f2lZ- {\n border: 1px solid var(--error-color, #B00020);\n}\n\n.Button_none__vPYWY {\n border: none;\n}\n\n.Button_transparent__aet0J {\n background-color: transparent !important;\n border: none;\n outline: none;\n padding: 0px;\n margin: 0px;\n}";
|
|
532
|
+
var style$8 = {"customButtonStyle":"Button_customButtonStyle__1TOXE","primary":"Button_primary__auYD2","primaryVariant":"Button_primaryVariant__NbKc2","secondary":"Button_secondary__DVppl","secondaryVariant":"Button_secondaryVariant__suwON","background":"Button_background__E82uk","surface":"Button_surface__EF0NA","surfaceVariant":"Button_surfaceVariant__-SFxJ","container":"Button_container__E1Hq5","error":"Button_error__Yab6f","borderPrimary":"Button_borderPrimary__uJ-qE","borderPrimaryVariant":"Button_borderPrimaryVariant__qkdEf","borderSecondary":"Button_borderSecondary__-P9is","borderSecondaryVariant":"Button_borderSecondaryVariant__6dCZ7","borderBackground":"Button_borderBackground__lm7yB","borderSurface":"Button_borderSurface__AJQxT","borderSurfaceVariant":"Button_borderSurfaceVariant__Cfk2f","borderContainer":"Button_borderContainer__GXDhL","borderError":"Button_borderError__f2lZ-","none":"Button_none__vPYWY","transparent":"Button_transparent__aet0J"};
|
|
533
|
+
styleInject(css_248z$f);
|
|
534
534
|
|
|
535
|
-
var _tmpl$$
|
|
535
|
+
var _tmpl$$j = /*#__PURE__*/template(`<button>`);
|
|
536
536
|
const Button = props => {
|
|
537
|
-
const
|
|
537
|
+
const [local, others] = splitProps(props, ["theme", "transparent", "borderTheme"]);
|
|
538
|
+
const isTransparent = () => {
|
|
539
|
+
if (Object.keys(props).includes("transparent") && props.transparent !== false) {
|
|
540
|
+
return true;
|
|
541
|
+
}
|
|
542
|
+
return false;
|
|
543
|
+
};
|
|
544
|
+
const transparent = createMemo(() => isTransparent() ? style$8.transparent : "");
|
|
545
|
+
const getBorderThemeName = theme => {
|
|
546
|
+
switch (theme) {
|
|
547
|
+
case "primary":
|
|
548
|
+
return "borderPrimary";
|
|
549
|
+
case "primaryVariant":
|
|
550
|
+
return "borderPrimaryVariant";
|
|
551
|
+
case "secondary":
|
|
552
|
+
return "borderSecondary";
|
|
553
|
+
case "secondaryVariant":
|
|
554
|
+
return "borderSecondaryVariant";
|
|
555
|
+
case "surface":
|
|
556
|
+
return "borderSurface";
|
|
557
|
+
case "surfaceVariant":
|
|
558
|
+
return "borderSurfaceVariant";
|
|
559
|
+
case "background":
|
|
560
|
+
return "borderBackground";
|
|
561
|
+
case "container":
|
|
562
|
+
return "borderContainer";
|
|
563
|
+
case "error":
|
|
564
|
+
return "borderError";
|
|
565
|
+
default:
|
|
566
|
+
return "none";
|
|
567
|
+
}
|
|
568
|
+
};
|
|
538
569
|
return (() => {
|
|
539
|
-
var _el$ = _tmpl$$
|
|
540
|
-
spread(_el$, mergeProps(
|
|
541
|
-
"onClick": e => {
|
|
542
|
-
if (props.onClick) props.onClick(e);
|
|
543
|
-
},
|
|
570
|
+
var _el$ = _tmpl$$j();
|
|
571
|
+
spread(_el$, mergeProps(others, {
|
|
544
572
|
get ["class"]() {
|
|
545
|
-
return `${style$
|
|
573
|
+
return `${style$8[local?.theme ?? "container"]} ${style$8[getBorderThemeName(local?.borderTheme ?? 'none')]} ${style$8.customButtonStyle} ${transparent()} ${props?.class ?? ""} `;
|
|
546
574
|
}
|
|
547
575
|
}), false, true);
|
|
548
576
|
insert(_el$, () => props.children);
|
|
@@ -550,11 +578,11 @@ const Button = props => {
|
|
|
550
578
|
})();
|
|
551
579
|
};
|
|
552
580
|
|
|
553
|
-
var css_248z$
|
|
554
|
-
var style$
|
|
555
|
-
styleInject(css_248z$
|
|
581
|
+
var css_248z$e = ".Carosel-module_carouselHeader__JAhGf {\n display: flex;\n flex-direction: row;\n width: 100%;\n}\n.Carosel-module_carouselHeader__JAhGf div {\n flex-grow: 1;\n text-align: center;\n}\n.Carosel-module_carouselHeader__JAhGf button {\n flex-basis: 1;\n}\n\n.Carosel-module_carousel__cHoMx {\n position: relative;\n width: 100%;\n margin: auto;\n overflow: hidden;\n border-radius: 10px;\n}\n\n.Carosel-module_carouselSlides__MgPU3 {\n display: flex;\n transition: transform 0.5s ease-in-out;\n width: 100%;\n height: 100%;\n}\n\n.Carosel-module_carouselSlide__--NkY {\n min-width: 100%;\n padding: 5px;\n box-sizing: border-box;\n}\n\n.Carosel-module_carouselButton__E1gGu {\n opacity: 0.5;\n border: none;\n padding: 10px;\n cursor: pointer;\n}\n.Carosel-module_carouselButton__E1gGu:hover {\n opacity: 1;\n}";
|
|
582
|
+
var style$7 = {"carouselHeader":"Carosel-module_carouselHeader__JAhGf","carousel":"Carosel-module_carousel__cHoMx","carouselSlides":"Carosel-module_carouselSlides__MgPU3","carouselSlide":"Carosel-module_carouselSlide__--NkY","carouselButton":"Carosel-module_carouselButton__E1gGu"};
|
|
583
|
+
styleInject(css_248z$e);
|
|
556
584
|
|
|
557
|
-
var _tmpl$$
|
|
585
|
+
var _tmpl$$i = /*#__PURE__*/template(`<div>No <!> Found`),
|
|
558
586
|
_tmpl$2$9 = /*#__PURE__*/template(`<div>No Elements Found`),
|
|
559
587
|
_tmpl$3$4 = /*#__PURE__*/template(`<div>`),
|
|
560
588
|
_tmpl$4$2 = /*#__PURE__*/template(`<div><div><div></div></div><div>`);
|
|
@@ -627,7 +655,7 @@ const Carousel = ({
|
|
|
627
655
|
}
|
|
628
656
|
}
|
|
629
657
|
return props.notFoundName ? (() => {
|
|
630
|
-
var _el$ = _tmpl$$
|
|
658
|
+
var _el$ = _tmpl$$i(),
|
|
631
659
|
_el$2 = _el$.firstChild,
|
|
632
660
|
_el$4 = _el$2.nextSibling;
|
|
633
661
|
_el$4.nextSibling;
|
|
@@ -668,7 +696,7 @@ const Carousel = ({
|
|
|
668
696
|
_el$11 = _el$7.nextSibling;
|
|
669
697
|
insert(_el$7, createComponent(Button, {
|
|
670
698
|
get ["class"]() {
|
|
671
|
-
return `${style$
|
|
699
|
+
return `${style$7.carouselButton}`;
|
|
672
700
|
},
|
|
673
701
|
onClick: prevSlide,
|
|
674
702
|
children: "\u276E"
|
|
@@ -681,7 +709,7 @@ const Carousel = ({
|
|
|
681
709
|
get children() {
|
|
682
710
|
var _el$9 = _tmpl$3$4();
|
|
683
711
|
insert(_el$9, slideName);
|
|
684
|
-
createRenderEffect(() => className(_el$9, `${style$
|
|
712
|
+
createRenderEffect(() => className(_el$9, `${style$7.carouselSlide}`));
|
|
685
713
|
return _el$9;
|
|
686
714
|
}
|
|
687
715
|
}), null);
|
|
@@ -692,23 +720,23 @@ const Carousel = ({
|
|
|
692
720
|
get children() {
|
|
693
721
|
var _el$10 = _tmpl$3$4();
|
|
694
722
|
insert(_el$10, slideName);
|
|
695
|
-
createRenderEffect(() => className(_el$10, `${style$
|
|
723
|
+
createRenderEffect(() => className(_el$10, `${style$7.carouselSlide}`));
|
|
696
724
|
return _el$10;
|
|
697
725
|
}
|
|
698
726
|
}), null);
|
|
699
727
|
insert(_el$7, createComponent(Button, {
|
|
700
728
|
get ["class"]() {
|
|
701
|
-
return `${style$
|
|
729
|
+
return `${style$7.carouselButton}`;
|
|
702
730
|
},
|
|
703
731
|
onClick: nextSlide,
|
|
704
732
|
children: "\u276F"
|
|
705
733
|
}), null);
|
|
706
734
|
insert(_el$11, slideElement);
|
|
707
735
|
createRenderEffect(_p$ => {
|
|
708
|
-
var _v$ = `${style$
|
|
709
|
-
_v$2 = `${style$
|
|
710
|
-
_v$3 = `${style$
|
|
711
|
-
_v$4 = `${style$
|
|
736
|
+
var _v$ = `${style$7.carousel}`,
|
|
737
|
+
_v$2 = `${style$7.carouselHeader}`,
|
|
738
|
+
_v$3 = `${style$7.carouselSlides}`,
|
|
739
|
+
_v$4 = `${style$7.carouselSlide}`;
|
|
712
740
|
_v$ !== _p$.e && className(_el$6, _p$.e = _v$);
|
|
713
741
|
_v$2 !== _p$.t && className(_el$7, _p$.t = _v$2);
|
|
714
742
|
_v$3 !== _p$.a && className(_el$8, _p$.a = _v$3);
|
|
@@ -733,15 +761,15 @@ const Slide = props => {
|
|
|
733
761
|
return createMemo(() => props.children);
|
|
734
762
|
};
|
|
735
763
|
|
|
736
|
-
var css_248z$
|
|
737
|
-
var style$
|
|
738
|
-
styleInject(css_248z$
|
|
764
|
+
var css_248z$d = ".Chip-module_Chip__HWK4W {\n display: flex;\n flex-direction: row;\n padding: 5px 10px;\n margin-left: 8px;\n border-radius: 15px;\n height: -moz-max-content;\n height: max-content;\n min-width: -moz-min-content;\n min-width: min-content;\n max-width: -moz-max-content;\n max-width: max-content;\n margin: 5px;\n}\n.Chip-module_Chip__HWK4W span {\n margin: 0px 2px;\n width: -moz-max-content;\n width: max-content;\n max-width: 10em;\n text-overflow: ellipsis;\n}\n.Chip-module_Chip__HWK4W button {\n font-size: 1rem !important;\n height: -moz-min-content;\n height: min-content;\n margin: auto 0px;\n padding: 0px 4px !important;\n margin-left: 5px !important;\n border-radius: 8px;\n}\n\n.Chip-module_removeChipButton__kl1mU {\n margin: 0 !important;\n margin-left: 5px !important;\n padding: 0 !important;\n font-size: 1rem !important;\n}\n\n.Chip-module_hover__fvVQS:hover {\n cursor: pointer;\n}\n\n.Chip-module_tertiary__TtdnV {\n background-color: inherit;\n color: var(--on-container-color, #000);\n border: 1px solid var(--primary-color, #4CAF50);\n margin-right: 6px;\n}\n.Chip-module_tertiary__TtdnV button {\n background-color: inherit;\n color: var(--on-container-color, #000);\n font-weight: 700;\n}";
|
|
765
|
+
var style$6 = {"Chip":"Chip-module_Chip__HWK4W","removeChipButton":"Chip-module_removeChipButton__kl1mU","hover":"Chip-module_hover__fvVQS","tertiary":"Chip-module_tertiary__TtdnV"};
|
|
766
|
+
styleInject(css_248z$d);
|
|
739
767
|
|
|
740
|
-
var _tmpl$$
|
|
768
|
+
var _tmpl$$h = /*#__PURE__*/template(`<span>`),
|
|
741
769
|
_tmpl$2$8 = /*#__PURE__*/template(`<span>:`),
|
|
742
770
|
_tmpl$3$3 = /*#__PURE__*/template(`<span><span>`);
|
|
743
771
|
const Chip = props => {
|
|
744
|
-
const hoverChip = props.onClick ? `${style$
|
|
772
|
+
const hoverChip = props.onClick ? `${style$6.hover}` : "";
|
|
745
773
|
return (() => {
|
|
746
774
|
var _el$ = _tmpl$3$3(),
|
|
747
775
|
_el$4 = _el$.firstChild;
|
|
@@ -752,7 +780,7 @@ const Chip = props => {
|
|
|
752
780
|
},
|
|
753
781
|
get children() {
|
|
754
782
|
return [(() => {
|
|
755
|
-
var _el$2 = _tmpl$$
|
|
783
|
+
var _el$2 = _tmpl$$h();
|
|
756
784
|
insert(_el$2, () => props.key);
|
|
757
785
|
return _el$2;
|
|
758
786
|
})(), _tmpl$2$8()];
|
|
@@ -765,11 +793,9 @@ const Chip = props => {
|
|
|
765
793
|
},
|
|
766
794
|
get children() {
|
|
767
795
|
return createComponent(Button, {
|
|
768
|
-
|
|
769
|
-
return props.styleType ?? 'tertiary';
|
|
770
|
-
},
|
|
796
|
+
transparent: true,
|
|
771
797
|
get ["class"]() {
|
|
772
|
-
return `${style$
|
|
798
|
+
return `${style$6.hover} ${style$6.removeChipButton}`;
|
|
773
799
|
},
|
|
774
800
|
get onClick() {
|
|
775
801
|
return props.remove;
|
|
@@ -778,17 +804,17 @@ const Chip = props => {
|
|
|
778
804
|
});
|
|
779
805
|
}
|
|
780
806
|
}), null);
|
|
781
|
-
createRenderEffect(() => className(_el$, `${style$
|
|
807
|
+
createRenderEffect(() => className(_el$, `${style$6['tertiary']} ${style$6.Chip} ${props.class ?? ""} ${hoverChip}`));
|
|
782
808
|
return _el$;
|
|
783
809
|
})();
|
|
784
810
|
};
|
|
785
811
|
delegateEvents(["click"]);
|
|
786
812
|
|
|
787
|
-
var css_248z$
|
|
788
|
-
var style$
|
|
789
|
-
styleInject(css_248z$
|
|
813
|
+
var css_248z$c = ".chipbar-module_chipbar__PjssB {\n display: flex;\n flex-direction: row;\n min-width: 100%;\n width: -moz-max-content;\n width: max-content;\n max-width: 100%;\n padding: var(--spacing-1, 8px) 0px;\n border-bottom: 1px solid var(--on-background, white);\n}\n\n.chipbar-module_chipContainer__lnYfX {\n display: flex;\n flex-direction: row;\n overflow-x: hidden;\n scroll-behavior: smooth;\n flex-grow: 1;\n}\n.chipbar-module_chipContainer__lnYfX span {\n height: -moz-min-content;\n height: min-content;\n margin: auto 0px;\n}\n.chipbar-module_chipContainer__lnYfX span button {\n width: -moz-max-content;\n width: max-content;\n padding: 5px;\n}\n\n.chipbar-module_leftArrow__OS8vV {\n margin-right: 10px;\n align-self: flex-start;\n margin: auto 0px;\n}\n\n.chipbar-module_rightArrow__T4ubJ {\n margin-left: 10px;\n align-self: flex-end;\n margin: auto 0px;\n}";
|
|
814
|
+
var style$5 = {"chipbar":"chipbar-module_chipbar__PjssB","chipContainer":"chipbar-module_chipContainer__lnYfX","leftArrow":"chipbar-module_leftArrow__OS8vV","rightArrow":"chipbar-module_rightArrow__T4ubJ"};
|
|
815
|
+
styleInject(css_248z$c);
|
|
790
816
|
|
|
791
|
-
var _tmpl$$
|
|
817
|
+
var _tmpl$$g = /*#__PURE__*/template(`<span>`),
|
|
792
818
|
_tmpl$2$7 = /*#__PURE__*/template(`<div><div>`);
|
|
793
819
|
function Chipbar(props) {
|
|
794
820
|
const hasSignalChips = props.chips !== undefined;
|
|
@@ -850,12 +876,12 @@ function Chipbar(props) {
|
|
|
850
876
|
return showLeft();
|
|
851
877
|
},
|
|
852
878
|
get children() {
|
|
853
|
-
var _el$2 = _tmpl$$
|
|
879
|
+
var _el$2 = _tmpl$$g();
|
|
854
880
|
insert(_el$2, createComponent(Button, {
|
|
855
881
|
onMouseDown: scrollLeft,
|
|
856
882
|
children: "\u2190"
|
|
857
883
|
}));
|
|
858
|
-
createRenderEffect(() => className(_el$2, `${style$
|
|
884
|
+
createRenderEffect(() => className(_el$2, `${style$5.leftArrow}`));
|
|
859
885
|
return _el$2;
|
|
860
886
|
}
|
|
861
887
|
}), _el$3);
|
|
@@ -865,7 +891,7 @@ function Chipbar(props) {
|
|
|
865
891
|
return (hasSignalChips || !hasSignalChips && props.clearAll !== undefined);
|
|
866
892
|
},
|
|
867
893
|
get children() {
|
|
868
|
-
var _el$4 = _tmpl$$
|
|
894
|
+
var _el$4 = _tmpl$$g();
|
|
869
895
|
insert(_el$4, createComponent(Button, {
|
|
870
896
|
onClick: () => clearAll() ,
|
|
871
897
|
children: "Clear All"
|
|
@@ -909,18 +935,18 @@ function Chipbar(props) {
|
|
|
909
935
|
return showRight();
|
|
910
936
|
},
|
|
911
937
|
get children() {
|
|
912
|
-
var _el$5 = _tmpl$$
|
|
938
|
+
var _el$5 = _tmpl$$g();
|
|
913
939
|
insert(_el$5, createComponent(Button, {
|
|
914
940
|
onMouseDown: scrollRight,
|
|
915
941
|
children: "\u2192"
|
|
916
942
|
}));
|
|
917
|
-
createRenderEffect(() => className(_el$5, `${style$
|
|
943
|
+
createRenderEffect(() => className(_el$5, `${style$5.rightArrow}`));
|
|
918
944
|
return _el$5;
|
|
919
945
|
}
|
|
920
946
|
}), null);
|
|
921
947
|
createRenderEffect(_p$ => {
|
|
922
|
-
var _v$ = `${style$
|
|
923
|
-
_v$2 = `${style$
|
|
948
|
+
var _v$ = `${style$5.chipbar}`,
|
|
949
|
+
_v$2 = `${style$5.chipContainer}`;
|
|
924
950
|
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
925
951
|
_v$2 !== _p$.t && className(_el$3, _p$.t = _v$2);
|
|
926
952
|
return _p$;
|
|
@@ -932,18 +958,18 @@ function Chipbar(props) {
|
|
|
932
958
|
})();
|
|
933
959
|
}
|
|
934
960
|
|
|
935
|
-
var css_248z$
|
|
936
|
-
var styles$
|
|
937
|
-
styleInject(css_248z$
|
|
961
|
+
var css_248z$b = ".body-module_compBody__d3HyU {\n width: 70%;\n margin: 0 auto;\n border-radius: 15px;\n padding: 8px;\n padding-top: 0px;\n background-color: var(--surface-color, #EEEEEE);\n color: var(--on-surface-color, #000000);\n}\n@media screen and (max-width: 768px) {\n .body-module_compBody__d3HyU {\n width: 95%;\n margin: 0 auto;\n }\n}";
|
|
962
|
+
var styles$6 = {"compBody":"body-module_compBody__d3HyU"};
|
|
963
|
+
styleInject(css_248z$b);
|
|
938
964
|
|
|
939
|
-
var _tmpl$$
|
|
965
|
+
var _tmpl$$f = /*#__PURE__*/template(`<div>`);
|
|
940
966
|
const Body = props => {
|
|
941
967
|
const [customProps, normalProps] = splitProps(props, ["children", "class", 'style']);
|
|
942
968
|
return (() => {
|
|
943
|
-
var _el$ = _tmpl$$
|
|
969
|
+
var _el$ = _tmpl$$f();
|
|
944
970
|
spread(_el$, mergeProps(normalProps, {
|
|
945
971
|
get ["class"]() {
|
|
946
|
-
return `${styles$
|
|
972
|
+
return `${styles$6.compBody} ${customProps.class ?? ""}`;
|
|
947
973
|
}
|
|
948
974
|
}), false, true);
|
|
949
975
|
insert(_el$, () => customProps.children);
|
|
@@ -958,6 +984,10 @@ const Provider$1 = props => {
|
|
|
958
984
|
const [getFocused, setFocused] = createSignal(false);
|
|
959
985
|
const [getValue, setValue] = createSignal(props.value ?? "");
|
|
960
986
|
const [getFieldType, setFieldType] = createSignal(props.type ?? "text");
|
|
987
|
+
const [getFormFieldRef, setFormFieldRef] = createSignal();
|
|
988
|
+
const [getErrors, setErrors] = createSignal({
|
|
989
|
+
err: []
|
|
990
|
+
});
|
|
961
991
|
return createComponent(FormFieldContext.Provider, {
|
|
962
992
|
get value() {
|
|
963
993
|
return {
|
|
@@ -971,6 +1001,10 @@ const Provider$1 = props => {
|
|
|
971
1001
|
setValue,
|
|
972
1002
|
getFieldType,
|
|
973
1003
|
setFieldType,
|
|
1004
|
+
getFormFieldRef,
|
|
1005
|
+
setFormFieldRef,
|
|
1006
|
+
getErrors,
|
|
1007
|
+
setErrors,
|
|
974
1008
|
formName: props.formName
|
|
975
1009
|
};
|
|
976
1010
|
},
|
|
@@ -993,9 +1027,7 @@ function useFormProvider() {
|
|
|
993
1027
|
* @param theme - The theme to set. Defaults to 'dark'.
|
|
994
1028
|
*/
|
|
995
1029
|
function addTheme(theme = 'dark') {
|
|
996
|
-
|
|
997
|
-
document.body.setAttribute('data-theme', theme);
|
|
998
|
-
});
|
|
1030
|
+
document.body.setAttribute('data-theme', theme);
|
|
999
1031
|
}
|
|
1000
1032
|
function isNullish(params) {
|
|
1001
1033
|
return params === null || params === undefined;
|
|
@@ -1056,50 +1088,90 @@ function Clone(obj, maintainFunctions, seen = new WeakMap()) {
|
|
|
1056
1088
|
return clonedObj;
|
|
1057
1089
|
}
|
|
1058
1090
|
|
|
1059
|
-
function
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1091
|
+
// export function useClickOutside(
|
|
1092
|
+
// ref: Accessor<AllHTMLElements | undefined | null>,
|
|
1093
|
+
// handler: (e: MouseEvent) => void
|
|
1094
|
+
// ) {
|
|
1095
|
+
// const mouse: Accessor<{x:number;y:number;}> = useEventSignal("mousemove", {x: 0, y: 0}, (e, set) => {
|
|
1096
|
+
// set({x: (e as MouseEvent).clientX, y: (e as MouseEvent).clientY});
|
|
1097
|
+
// });
|
|
1098
|
+
// const listener = (e: MouseEvent) => {
|
|
1099
|
+
// if (isNullish(ref())) return;
|
|
1100
|
+
// const mousePos = mouse();
|
|
1101
|
+
// const {top, bottom, left, right} = ref()!.getBoundingClientRect();
|
|
1102
|
+
// const conditions = [
|
|
1103
|
+
// mousePos.x < left,
|
|
1104
|
+
// mousePos.x > right,
|
|
1105
|
+
// mousePos.y < top,export function useClickOutside(
|
|
1106
|
+
// ref: Accessor<AllHTMLElements | undefined | null>,
|
|
1107
|
+
// handler: (e: MouseEvent) => void
|
|
1108
|
+
// ) {
|
|
1109
|
+
// const mouse: Accessor<{x:number;y:number;}> = useEventSignal("mousemove", {x: 0, y: 0}, (e, set) => {
|
|
1110
|
+
// set({x: (e as MouseEvent).clientX, y: (e as MouseEvent).clientY});
|
|
1111
|
+
// });
|
|
1112
|
+
// const listener = (e: MouseEvent) => {
|
|
1113
|
+
// if (isNullish(ref())) return;
|
|
1114
|
+
// const mousePos = mouse();
|
|
1115
|
+
// const {top, bottom, left, right} = ref()!.getBoundingClientRect();
|
|
1116
|
+
// const conditions = [
|
|
1117
|
+
// mousePos.x < left,
|
|
1118
|
+
// mousePos.x > right,
|
|
1119
|
+
// mousePos.y < top,
|
|
1120
|
+
// mousePos.y > bottom
|
|
1121
|
+
// ]
|
|
1122
|
+
// if (conditions.includes(true)) {
|
|
1123
|
+
// handler(e)
|
|
1124
|
+
// };
|
|
1125
|
+
// };
|
|
1126
|
+
// (ref() as HTMLElement)?.addEventListener("click", listener);
|
|
1127
|
+
// onCleanup(() => {
|
|
1128
|
+
// (ref() as HTMLElement)?.removeEventListener("click", listener);
|
|
1129
|
+
// });
|
|
1130
|
+
// };
|
|
1131
|
+
// mousePos.y > bottom
|
|
1132
|
+
// ]
|
|
1133
|
+
// if (conditions.includes(true)) {
|
|
1134
|
+
// handler(e)
|
|
1135
|
+
// };
|
|
1136
|
+
// };
|
|
1137
|
+
// (ref() as HTMLElement)?.addEventListener("click", listener);
|
|
1138
|
+
// onCleanup(() => {
|
|
1139
|
+
// (ref() as HTMLElement)?.removeEventListener("click", listener);
|
|
1140
|
+
// });
|
|
1141
|
+
// };
|
|
1142
|
+
/**
|
|
1143
|
+
* A hook that executes a callback when clicking outside of all specified elements.
|
|
1144
|
+
*
|
|
1145
|
+
* @param elementRefs - An array of signals (accessors) returning target HTMLElements (or undefined initially).
|
|
1146
|
+
* @param callback - The function to execute when a click occurs outside all the target elements.
|
|
1147
|
+
*/
|
|
1148
|
+
function useClickOutside(elementRefs, callback) {
|
|
1149
|
+
// Handler that checks if the click is outside all the elements.
|
|
1150
|
+
const handleClick = event => {
|
|
1151
|
+
// Loop through each element reference.
|
|
1152
|
+
for (const ref of elementRefs) {
|
|
1153
|
+
const el = ref();
|
|
1154
|
+
// If the element exists and the click occurred inside it, do nothing.
|
|
1155
|
+
if (el && el.contains(event.target)) {
|
|
1156
|
+
return;
|
|
1157
|
+
}
|
|
1092
1158
|
}
|
|
1159
|
+
// If the click was not inside any of the referenced elements, execute the callback.
|
|
1160
|
+
callback();
|
|
1093
1161
|
};
|
|
1094
|
-
|
|
1162
|
+
// Set up the event listener when the component mounts.
|
|
1163
|
+
onMount(() => {
|
|
1164
|
+
document.addEventListener('click', handleClick);
|
|
1165
|
+
});
|
|
1166
|
+
// Clean up the event listener when the component unmounts.
|
|
1095
1167
|
onCleanup(() => {
|
|
1096
|
-
|
|
1168
|
+
document.removeEventListener('click', handleClick);
|
|
1097
1169
|
});
|
|
1098
1170
|
}
|
|
1099
1171
|
|
|
1100
|
-
var css_248z$8 = ".formfield-module_formField__w6mH9 {\n display: inline-block;\n border-radius: var(--border-radius-md);\n box-sizing: border-box;\n}\n.formfield-module_formField__w6mH9 label {\n position: relative;\n top: -0.5rem;\n padding-right: 10px;\n}\n.formfield-module_formField__w6mH9:has(textarea) {\n position: relative;\n margin: var(--spacing-1, 8px);\n}\n.formfield-module_formField__w6mH9:has(textarea) textarea {\n width: auto;\n min-width: 95%;\n font-family: var(--font-family, \"Roboto, sans-serif\");\n font-size: var(--font-size-base, 16px);\n padding-bottom: var(--spacing-1, 8px);\n border: none;\n}\n.formfield-module_formField__w6mH9:has(textarea) textarea:focus {\n outline: none;\n}\n.formfield-module_formField__w6mH9:has(textarea) legend {\n height: var(--spacing-3, 24px);\n position: absolute;\n top: calc(var(--spacing-2) * -1);\n left: var(--spacing-1, 8px);\n transition: all 0.2s ease;\n}\n.formfield-module_formField__w6mH9:has(.formfield-module_coles-solid-selectControl__T4o-N) {\n position: relative;\n margin: var(--spacing-1, 8px);\n width: -moz-min-content;\n width: min-content;\n}\n.formfield-module_formField__w6mH9:has(.formfield-module_coles-solid-selectControl__T4o-N) legend {\n height: var(--spacing-3, 24px);\n position: absolute;\n top: calc(var(--spacing-2) * -1);\n left: var(--spacing-1, 8px);\n transition: all 0.2s ease;\n}\n.formfield-module_formField__w6mH9:has(input[type=text]) {\n height: calc(var(--spacing-4, 32px) + var(--spacing-2, 16px));\n position: relative;\n margin-top: var(--spacing-2);\n margin-bottom: var(--spacing-2);\n}\n.formfield-module_formField__w6mH9:has(input[type=text]) legend {\n height: var(--spacing-3, 24px);\n position: absolute;\n top: calc(var(--spacing-2) * -1);\n left: var(--spacing-1, 8px);\n transition: all 0.2s ease;\n}\n.formfield-module_formField__w6mH9:has(input[type=text]) input[type=text] {\n background-color: transparent !important;\n height: calc(var(--spacing-4, 32px) + var(--spacing-2, 16px) - var(--spacing-3, 24px));\n border-radius: var(--border-radius-sm, 4px);\n margin: var(--spacing-1, 8px) 0px;\n font-family: var(--font-family, \"Roboto, sans-serif\");\n font-size: var(--font-size-base, 16px);\n width: auto;\n min-width: 95%;\n}\n.formfield-module_formField__w6mH9:has(input[type=text]) input[type=text]::-moz-placeholder {\n opacity: 0.75;\n}\n.formfield-module_formField__w6mH9:has(input[type=text]) input[type=text]::placeholder {\n opacity: 0.75;\n}\n.formfield-module_formField__w6mH9:has(input[type=number]) {\n height: calc(var(--spacing-4, 32px) + var(--spacing-2, 16px));\n position: relative;\n margin-top: var(--spacing-2);\n margin-bottom: var(--spacing-2);\n}\n.formfield-module_formField__w6mH9:has(input[type=number]) legend {\n height: var(--spacing-3, 24px);\n position: absolute;\n top: calc(var(--spacing-2) * -1);\n left: var(--spacing-1, 8px);\n transition: all 0.2s ease;\n}\n.formfield-module_formField__w6mH9:has(input[type=number]) input[type=number] {\n background-color: transparent !important;\n color: var(--on-primary-color, #ffffff);\n height: calc(var(--spacing-4, 32px) + var(--spacing-2, 16px) - var(--spacing-3, 24px));\n border-radius: var(--border-radius-sm, 4px);\n margin: var(--spacing-1, 8px) 0px;\n font-family: var(--font-family, \"Roboto, sans-serif\");\n font-size: var(--font-size-base, 16px);\n width: auto;\n min-width: 95%;\n}\n.formfield-module_formField__w6mH9:has(input[type=number]) input[type=number]::-moz-placeholder {\n opacity: 0.75;\n}\n.formfield-module_formField__w6mH9:has(input[type=number]) input[type=number]::placeholder {\n opacity: 0.75;\n}\n.formfield-module_formField__w6mH9:has(.formfield-module_coles-solid-selectControl__T4o-N) {\n height: calc(var(--spacing-4) * 2.3) !important;\n}\n@media screen and (max-width: 768px) {\n .formfield-module_formField__w6mH9 {\n max-width: 75%;\n }\n}\n\n.formfield-module_primary__7BYyQ {\n background-color: var(--primary-color, #3F51B5);\n color: var(--on-primary-color, white);\n}\n.formfield-module_primary__7BYyQ:has(input[type=text]) legend {\n background: linear-gradient(to bottom, transparent 60%, var(--primary-color, #3F51B5) 40%);\n}\n.formfield-module_primary__7BYyQ:has(input[type=text]) input[type=text] {\n color: var(--on-primary-color, white);\n}\n.formfield-module_primary__7BYyQ:has(input[type=number]) legend {\n background: linear-gradient(to bottom, transparent 60%, var(--primary-color, #3F51B5) 40%);\n}\n.formfield-module_primary__7BYyQ:has(input[type=number]) input[type=number] {\n color: var(--on-primary-color, white);\n}\n.formfield-module_primary__7BYyQ:has(textarea) {\n width: 100%;\n height: auto;\n}\n.formfield-module_primary__7BYyQ:has(textarea) textarea {\n background-color: var(--primary-color, #3F51B5);\n color: var(--on-primary-color, white);\n}\n.formfield-module_primary__7BYyQ:has(textarea) legend {\n background: linear-gradient(to bottom, transparent 60%, var(--primary-color, #3F51B5) 40%);\n}\n\n.formfield-module_accent__L-LRd {\n background-color: var(--secondary-color, #5C6BC0);\n color: var(--on-secondary-color, white);\n}\n.formfield-module_accent__L-LRd:has(input[type=text]) legend {\n background: linear-gradient(to bottom, transparent 60%, var(--secondary-color, #5C6BC0) 40%);\n}\n.formfield-module_accent__L-LRd:has(input[type=text]) input[type=text] {\n color: var(--on-secondary-color, white);\n}\n.formfield-module_accent__L-LRd:has(input[type=number]) legend {\n background: linear-gradient(to bottom, transparent 60%, var(--secondary-color, #5C6BC0) 40%);\n}\n.formfield-module_accent__L-LRd:has(input[type=number]) input[type=number] {\n color: var(--on-secondary-color, white);\n}\n.formfield-module_accent__L-LRd:has(textarea) textarea {\n background-color: var(--secondary-color, #5C6BC0);\n color: var(--on-secondary-color, white);\n}\n.formfield-module_accent__L-LRd:has(textarea) legend {\n background: linear-gradient(to bottom, transparent 60%, var(--secondary-color, #5C6BC0) 40%);\n}\n\n.formfield-module_tertiary__B0ozS {\n background-color: var(--tertiary-color, #8A2BE2);\n color: var(--on-tertiary-color, white);\n}\n.formfield-module_tertiary__B0ozS:has(input[type=text]) legend {\n background: linear-gradient(to bottom, transparent 60%, var(--tertiary-color, #8A2BE2) 40%);\n}\n.formfield-module_tertiary__B0ozS:has(input[type=text]) input[type=text] {\n color: var(--on-tertiary-color, white);\n}\n.formfield-module_tertiary__B0ozS:has(input[type=number]) legend {\n background: linear-gradient(to bottom, transparent 60%, var(--tertiary-color, #8A2BE2) 40%);\n}\n.formfield-module_tertiary__B0ozS:has(input[type=number]) input[type=number] {\n color: var(--on-tertiary-color, white);\n}\n.formfield-module_tertiary__B0ozS:has(textarea) textarea {\n background-color: var(--tertiary-color, #8A2BE2);\n color: var(--on-tertiary-color, white);\n}\n.formfield-module_tertiary__B0ozS:has(textarea) legend {\n background: linear-gradient(to bottom, transparent 60%, var(--tertiary-color, #8A2BE2) 40%);\n}\n\n.formfield-module_moveLegendInside__zQ4vt {\n opacity: 0;\n height: var(--spacing-3, 24px) !important;\n}\n\n.formfield-module_checkboxPadding__DU1CG {\n padding: 0px;\n padding-bottom: 10px;\n padding-left: 10px;\n padding-right: 10px;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZvcm1maWVsZC5tb2R1bGUuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLHFCQUFxQjtFQUNyQixzQ0FBc0M7RUFDdEMsc0JBQXNCO0FBQ3hCO0FBQ0E7RUFDRSxrQkFBa0I7RUFDbEIsWUFBWTtFQUNaLG1CQUFtQjtBQUNyQjtBQUNBO0VBQ0Usa0JBQWtCO0VBQ2xCLDZCQUE2QjtBQUMvQjtBQUNBO0VBQ0UsV0FBVztFQUNYLGNBQWM7RUFDZCxxREFBcUQ7RUFDckQsc0NBQXNDO0VBQ3RDLHFDQUFxQztFQUNyQyxZQUFZO0FBQ2Q7QUFDQTtFQUNFLGFBQWE7QUFDZjtBQUNBO0VBQ0UsOEJBQThCO0VBQzlCLGtCQUFrQjtFQUNsQixnQ0FBZ0M7RUFDaEMsMkJBQTJCO0VBQzNCLHlCQUF5QjtBQUMzQjtBQUNBO0VBQ0Usa0JBQWtCO0VBQ2xCLDZCQUE2QjtFQUM3Qix1QkFBa0I7RUFBbEIsa0JBQWtCO0FBQ3BCO0FBQ0E7RUFDRSw4QkFBOEI7RUFDOUIsa0JBQWtCO0VBQ2xCLGdDQUFnQztFQUNoQywyQkFBMkI7RUFDM0IseUJBQXlCO0FBQzNCO0FBQ0E7RU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MikgNDAlKTtcbn1cblxuLm1vdmVMZWdlbmRJbnNpZGUge1xuICBvcGFjaXR5OiAwO1xuICBoZWlnaHQ6IHZhcigtLXNwYWNpbmctMywgMjRweCkgIWltcG9ydGFudDtcbn1cblxuLmNoZWNrYm94UGFkZGluZyB7XG4gIHBhZGRpbmc6IDBweDtcbiAgcGFkZGluZy1ib3R0b206IDEwcHg7XG4gIHBhZGRpbmctbGVmdDogMTBweDtcbiAgcGFkZGluZy1yaWdodDogMTBweDtcbn0iXX0= */";
|
|
1101
|
-
var style$
|
|
1102
|
-
styleInject(css_248z$
|
|
1172
|
+
var css_248z$a = ".formfield-module_formField__w6mH9 {\n display: inline-block;\n border-radius: var(--border-radius-md);\n box-sizing: border-box;\n border: none;\n background-color: var(--container-color, #ffffff);\n color: var(--on-container-color, #000);\n margin-top: 0px !important;\n margin-bottom: 0px !important;\n}\n.formfield-module_formField__w6mH9 label {\n position: relative;\n top: -0.5rem;\n padding-right: 10px;\n}\n.formfield-module_formField__w6mH9:has(textarea) {\n position: relative;\n margin: 8px;\n}\n.formfield-module_formField__w6mH9:has(textarea) textarea {\n background-color: var(--container-color, #ffffff);\n color: var(--on-container-color, #000);\n width: auto;\n min-width: 95%;\n font-family: \"Roboto, sans-serif\";\n font-size: 16px;\n padding-bottom: 8px;\n border: none;\n}\n.formfield-module_formField__w6mH9:has(textarea) textarea:focus {\n outline: none;\n}\n.formfield-module_formField__w6mH9:has(textarea) textarea::-moz-placeholder {\n color: var(--on-container-color, #000);\n opacity: var(--text-emphasis-medium, 87%);\n}\n.formfield-module_formField__w6mH9:has(textarea) textarea::placeholder {\n color: var(--on-container-color, #000);\n opacity: var(--text-emphasis-medium, 87%);\n}\n.formfield-module_formField__w6mH9:has(textarea) legend {\n height: 24px;\n position: absolute;\n top: -16px;\n left: 8px;\n transition: all 0.25s ease;\n}\n.formfield-module_formField__w6mH9:has([is=coles-solid-select]) {\n position: relative;\n height: 48px !important;\n padding: 0px !important;\n width: 100%;\n}\n.formfield-module_formField__w6mH9:has([is=coles-solid-select]) legend {\n position: absolute;\n transform: translateY(-20px);\n height: 16px;\n max-height: 16px;\n transition: all 0.25s ease;\n top: 8px;\n z-index: 10000;\n}\n.formfield-module_formField__w6mH9:has([is=coles-solid-select]) [is=coles-solid-select] {\n position: absolute;\n left: 0px;\n right: 0px;\n padding: 0px !important;\n margin: 0px !important;\n height: 48px !important;\n border-radius: 4px;\n font-family: \"Roboto, sans-serif\";\n font-size: 16px;\n width: auto;\n min-width: 95%;\n}\n.formfield-module_formField__w6mH9:has([is=coles-solid-select]) [is=coles-solid-select]:nth-child(n) {\n border-radius: 4px;\n}\n.formfield-module_formField__w6mH9:has(input[type=text]) {\n height: 48px;\n position: relative;\n width: 100%;\n margin-top: 16px;\n margin-bottom: 16px;\n}\n.formfield-module_formField__w6mH9:has(input[type=text]) legend {\n position: absolute;\n height: 24px;\n top: -16px;\n left: 8px;\n transition: all 0.25s ease;\n}\n.formfield-module_formField__w6mH9:has(input[type=text]) input[type=text] {\n background-color: transparent !important;\n height: 24px;\n border-radius: 4px;\n margin: 8px 0px;\n font-family: \"Roboto, sans-serif\";\n font-size: 16px;\n width: 100%;\n min-width: 95%;\n}\n.formfield-module_formField__w6mH9:has(input[type=text]) input[type=text]::-moz-placeholder {\n opacity: 0.75;\n}\n.formfield-module_formField__w6mH9:has(input[type=text]) input[type=text]::placeholder {\n opacity: 0.75;\n}\n.formfield-module_formField__w6mH9:has(input[type=number]) {\n height: 48px;\n position: relative;\n width: 100%;\n margin-top: 16px;\n margin-bottom: 16px;\n}\n.formfield-module_formField__w6mH9:has(input[type=number]) legend {\n height: 24px;\n position: absolute;\n top: -16px;\n left: 8px;\n transition: all 0.25s ease;\n}\n.formfield-module_formField__w6mH9:has(input[type=number]) input[type=number] {\n background-color: transparent !important;\n color: var(--on-primary-color, #fff);\n height: 24px;\n border-radius: 4px;\n margin: 8px 0px;\n font-family: \"Roboto, sans-serif\";\n font-size: 16px;\n width: 100%;\n min-width: 95%;\n}\n.formfield-module_formField__w6mH9:has(input[type=number]) input[type=number]::-moz-placeholder {\n opacity: 0.75;\n}\n.formfield-module_formField__w6mH9:has(input[type=number]) input[type=number]::placeholder {\n opacity: 0.75;\n}\n@media screen and (max-width: 768px) {\n .formfield-module_formField__w6mH9 {\n max-width: 75%;\n }\n}\n\n.formfield-module_topMargin__dahW5 {\n margin-top: 12px;\n}\n\n.formfield-module_primary__7BYyQ:has(input[type=text]) input[type=text] {\n color: var(--on-container-color, #000);\n}\n.formfield-module_primary__7BYyQ:has(input[type=text]) input[type=text]::-moz-placeholder {\n color: var(--on-container-color, #000);\n opacity: var(--text-emphasis-medium, 87%);\n}\n.formfield-module_primary__7BYyQ:has(input[type=text]) input[type=text]::placeholder {\n color: var(--on-container-color, #000);\n opacity: var(--text-emphasis-medium, 87%);\n}\n.formfield-module_primary__7BYyQ:has(input[type=number]) input[type=number] {\n color: var(--on-container-color, #000);\n}\n.formfield-module_primary__7BYyQ:has(input[type=number]) input[type=number]::-moz-placeholder {\n color: var(--on-container-color, #000);\n opacity: var(--text-emphasis-medium, 87%);\n}\n.formfield-module_primary__7BYyQ:has(input[type=number]) input[type=number]::placeholder {\n color: var(--on-container-color, #000);\n opacity: var(--text-emphasis-medium, 87%);\n}\n.formfield-module_primary__7BYyQ:has([is=coles-solid-select]) [is=coles-solid-select] {\n background-color: var(--container-color, #ffffff);\n color: var(--on-container-color, #000);\n}\n.formfield-module_primary__7BYyQ:has(textarea) {\n width: 100%;\n height: auto;\n}\n.formfield-module_primary__7BYyQ:has(textarea) textarea {\n background-color: var(--container-color, #ffffff);\n color: var(--on-container-color, #000);\n}\n.formfield-module_primary__7BYyQ:has(textarea) textarea::-moz-placeholder {\n color: var(--on-container-color, #000);\n opacity: var(--text-emphasis-medium, 87%);\n}\n.formfield-module_primary__7BYyQ:has(textarea) textarea::placeholder {\n color: var(--on-container-color, #000);\n opacity: var(--text-emphasis-medium, 87%);\n}\n\n.formfield-module_legendStyle__gnI49 {\n background-color: transparent;\n opacity: var(--text-emphasis-medium, 87%);\n width: 100%;\n}\n\n.formfield-module_moveLegendInside__zQ4vt {\n opacity: 0;\n visibility: hidden;\n}\n\n.formfield-module_moveLegendOutside__CPF3p {\n visibility: visible;\n}\n\n.formfield-module_movedLegendOutside__hmyRU {\n margin-top: 0px;\n}\n\n.formfield-module_checkboxPadding__DU1CG {\n padding: 0px;\n padding-bottom: 10px;\n padding-left: 10px;\n padding-right: 10px;\n}\n\n.formfield-module_errorContainer__HR4PL {\n position: relative;\n min-height: 2rem;\n}\n\n.formfield-module_error__wNBh2 {\n position: absolute;\n background: transparent;\n color: var(--error-color, #B00020);\n font-size: 10px;\n}";
|
|
1173
|
+
var style$4 = {"formField":"formfield-module_formField__w6mH9","primary":"formfield-module_primary__7BYyQ","legendStyle":"formfield-module_legendStyle__gnI49","moveLegendInside":"formfield-module_moveLegendInside__zQ4vt","moveLegendOutside":"formfield-module_moveLegendOutside__CPF3p","movedLegendOutside":"formfield-module_movedLegendOutside__hmyRU","errorContainer":"formfield-module_errorContainer__HR4PL","error":"formfield-module_error__wNBh2"};
|
|
1174
|
+
styleInject(css_248z$a);
|
|
1103
1175
|
|
|
1104
1176
|
const $RAW = Symbol("store-raw"),
|
|
1105
1177
|
$NODE = Symbol("store-node"),
|
|
@@ -1315,7 +1387,7 @@ function createStore(...[store, options]) {
|
|
|
1315
1387
|
return [wrappedStore, setStore];
|
|
1316
1388
|
}
|
|
1317
1389
|
|
|
1318
|
-
var _tmpl$$
|
|
1390
|
+
var _tmpl$$e = /*#__PURE__*/template(`<form>`);
|
|
1319
1391
|
const FormContext = createContext();
|
|
1320
1392
|
const useFormContext = () => {
|
|
1321
1393
|
return useContext(FormContext);
|
|
@@ -1338,10 +1410,10 @@ const FormInner = props => {
|
|
|
1338
1410
|
const [formRef, setFormRef] = createSignal();
|
|
1339
1411
|
const formData = useFormContext();
|
|
1340
1412
|
const submitFunction = e => {
|
|
1413
|
+
const submitData = Clone(formData?.data ?? {});
|
|
1341
1414
|
e.preventDefault();
|
|
1342
1415
|
if (formData.formGroup.validate()) {
|
|
1343
|
-
|
|
1344
|
-
props?.onSubmit?.(submitData ?? {});
|
|
1416
|
+
props?.onSubmit?.(submitData);
|
|
1345
1417
|
}
|
|
1346
1418
|
};
|
|
1347
1419
|
createEffect(() => {
|
|
@@ -1351,7 +1423,7 @@ const FormInner = props => {
|
|
|
1351
1423
|
formRef()?.removeEventListener('submit', submitFunction);
|
|
1352
1424
|
});
|
|
1353
1425
|
return (() => {
|
|
1354
|
-
var _el$ = _tmpl$$
|
|
1426
|
+
var _el$ = _tmpl$$e();
|
|
1355
1427
|
use(setFormRef, _el$);
|
|
1356
1428
|
insert(_el$, () => props.children);
|
|
1357
1429
|
return _el$;
|
|
@@ -1374,7 +1446,8 @@ const Provider = props => {
|
|
|
1374
1446
|
});
|
|
1375
1447
|
};
|
|
1376
1448
|
|
|
1377
|
-
var _tmpl$$
|
|
1449
|
+
var _tmpl$$d = /*#__PURE__*/template(`<fieldset><legend><span>`),
|
|
1450
|
+
_tmpl$2$6 = /*#__PURE__*/template(`<div>`);
|
|
1378
1451
|
const FormField = props => {
|
|
1379
1452
|
return createComponent(Provider$1, {
|
|
1380
1453
|
get name() {
|
|
@@ -1410,74 +1483,132 @@ const FormField2 = props => {
|
|
|
1410
1483
|
const hasText = !context?.getTextInside?.();
|
|
1411
1484
|
return !isFocused && (!hasText || !hasValue(currentVal));
|
|
1412
1485
|
});
|
|
1413
|
-
const theChildren = children(() => props.children);
|
|
1414
1486
|
const [fieldRef, setFieldRef] = createSignal();
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1487
|
+
const theChildren = children(() => props.children);
|
|
1488
|
+
const formErrors = () => {
|
|
1489
|
+
const allErrors = (formContext?.formGroup.getErrors(local?.formName ?? '') ?? []).filter(error => error.hasError);
|
|
1490
|
+
if (allErrors.length === 0) return [];
|
|
1491
|
+
let errKeys = allErrors.map(error => error.key);
|
|
1492
|
+
// test just require
|
|
1493
|
+
if (errKeys.includes('required')) {
|
|
1494
|
+
errKeys = errKeys.filter(err => err !== 'minLength' && err !== 'maxLength');
|
|
1420
1495
|
}
|
|
1421
|
-
|
|
1422
|
-
|
|
1496
|
+
//---
|
|
1497
|
+
return context?.getErrors?.().err.filter(err => errKeys.includes(err.key));
|
|
1498
|
+
};
|
|
1423
1499
|
const hasRequired = createMemo(() => {
|
|
1424
1500
|
if (isNullish(local?.formName)) return false;
|
|
1425
1501
|
if (Object.keys(props).includes('required') && props.required !== false) return true;
|
|
1426
1502
|
return formContext?.formGroup?.hasValidator?.(local?.formName ?? '', 'required');
|
|
1427
1503
|
});
|
|
1504
|
+
const getErrorLocStyle = index => {
|
|
1505
|
+
const fieldBox = fieldRef()?.getBoundingClientRect();
|
|
1506
|
+
if (!fieldBox) return {};
|
|
1507
|
+
return {
|
|
1508
|
+
top: `${index * 12}px`
|
|
1509
|
+
};
|
|
1510
|
+
};
|
|
1428
1511
|
createEffect(() => {
|
|
1429
1512
|
context.setName(props.name);
|
|
1430
1513
|
});
|
|
1431
1514
|
context?.setFocused?.(false);
|
|
1515
|
+
useClickOutside([fieldRef], () => {
|
|
1516
|
+
if (!isNullish(formContext?.data)) {
|
|
1517
|
+
context?.setTextInside(!hasValue(formContext?.data?.[local?.formName ?? '']));
|
|
1518
|
+
} else if (!isNullish(context?.getValue)) {
|
|
1519
|
+
context?.setTextInside(!hasValue(context?.getValue()));
|
|
1520
|
+
}
|
|
1521
|
+
context?.setFocused(prev => {
|
|
1522
|
+
if (prev) {
|
|
1523
|
+
formContext?.formGroup?.validate?.(local?.formName ?? '');
|
|
1524
|
+
}
|
|
1525
|
+
return false;
|
|
1526
|
+
});
|
|
1527
|
+
});
|
|
1432
1528
|
onMount(() => {
|
|
1433
1529
|
if (context?.getValue !== undefined) {
|
|
1434
1530
|
const textInside = !hasValue(context?.getValue?.());
|
|
1435
1531
|
context.setTextInside(textInside);
|
|
1436
1532
|
}
|
|
1437
1533
|
});
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1534
|
+
createEffect(() => {
|
|
1535
|
+
const fieldRefer = fieldRef?.();
|
|
1536
|
+
if (fieldRefer) {
|
|
1537
|
+
context?.setFormFieldRef?.(fieldRefer);
|
|
1441
1538
|
}
|
|
1442
|
-
return '';
|
|
1443
1539
|
});
|
|
1444
|
-
return (() => {
|
|
1445
|
-
var _el$ = _tmpl$$
|
|
1446
|
-
_el$2 = _el$.firstChild
|
|
1540
|
+
return [(() => {
|
|
1541
|
+
var _el$ = _tmpl$$d(),
|
|
1542
|
+
_el$2 = _el$.firstChild,
|
|
1543
|
+
_el$3 = _el$2.firstChild;
|
|
1447
1544
|
use(setFieldRef, _el$);
|
|
1448
1545
|
spread(_el$, mergeProps(others, {
|
|
1449
|
-
"onClick": () => context.setFocused(true),
|
|
1450
1546
|
get ["class"]() {
|
|
1451
|
-
return `${style$
|
|
1547
|
+
return `${style$4["primary"]} ${hasInsideText() ? style$4.movedLegendInside : style$4.movedLegendOutside} ${style$4.formField} ${local.class ?? ''}`;
|
|
1452
1548
|
}
|
|
1453
1549
|
}), false, true);
|
|
1454
|
-
insert(_el$
|
|
1550
|
+
insert(_el$3, createComponent(Show, {
|
|
1455
1551
|
get when() {
|
|
1456
|
-
return
|
|
1552
|
+
return !hasRequired();
|
|
1457
1553
|
},
|
|
1458
1554
|
get children() {
|
|
1459
1555
|
return context.getName();
|
|
1460
1556
|
}
|
|
1461
1557
|
}), null);
|
|
1462
|
-
insert(_el$
|
|
1558
|
+
insert(_el$3, createComponent(Show, {
|
|
1463
1559
|
get when() {
|
|
1464
|
-
return
|
|
1560
|
+
return hasRequired();
|
|
1465
1561
|
},
|
|
1466
1562
|
get children() {
|
|
1467
1563
|
return [createMemo(() => context?.getName()), " *"];
|
|
1468
1564
|
}
|
|
1469
1565
|
}), null);
|
|
1470
1566
|
insert(_el$, theChildren, null);
|
|
1471
|
-
createRenderEffect(
|
|
1567
|
+
createRenderEffect(_p$ => {
|
|
1568
|
+
var _v$ = `${hasInsideText() ? style$4.moveLegendInside : style$4.moveLegendOutside} ${local?.legendClass ?? ''}`,
|
|
1569
|
+
_v$2 = `${style$4.legendStyle}`;
|
|
1570
|
+
_v$ !== _p$.e && className(_el$2, _p$.e = _v$);
|
|
1571
|
+
_v$2 !== _p$.t && className(_el$3, _p$.t = _v$2);
|
|
1572
|
+
return _p$;
|
|
1573
|
+
}, {
|
|
1574
|
+
e: undefined,
|
|
1575
|
+
t: undefined
|
|
1576
|
+
});
|
|
1472
1577
|
return _el$;
|
|
1473
|
-
})()
|
|
1578
|
+
})(), (() => {
|
|
1579
|
+
var _el$4 = _tmpl$2$6();
|
|
1580
|
+
insert(_el$4, createComponent(For, {
|
|
1581
|
+
get each() {
|
|
1582
|
+
return formErrors();
|
|
1583
|
+
},
|
|
1584
|
+
children: (error, index) => {
|
|
1585
|
+
return (() => {
|
|
1586
|
+
var _el$5 = _tmpl$2$6();
|
|
1587
|
+
insert(_el$5, () => error.display);
|
|
1588
|
+
createRenderEffect(_p$ => {
|
|
1589
|
+
var _v$3 = style$4.error,
|
|
1590
|
+
_v$4 = getErrorLocStyle(index());
|
|
1591
|
+
_v$3 !== _p$.e && className(_el$5, _p$.e = _v$3);
|
|
1592
|
+
_p$.t = style$9(_el$5, _v$4, _p$.t);
|
|
1593
|
+
return _p$;
|
|
1594
|
+
}, {
|
|
1595
|
+
e: undefined,
|
|
1596
|
+
t: undefined
|
|
1597
|
+
});
|
|
1598
|
+
return _el$5;
|
|
1599
|
+
})();
|
|
1600
|
+
}
|
|
1601
|
+
}));
|
|
1602
|
+
createRenderEffect(() => className(_el$4, style$4.errorContainer));
|
|
1603
|
+
return _el$4;
|
|
1604
|
+
})()];
|
|
1474
1605
|
};
|
|
1475
1606
|
|
|
1476
|
-
var css_248z$
|
|
1477
|
-
var styles$
|
|
1478
|
-
styleInject(css_248z$
|
|
1607
|
+
var css_248z$9 = "@charset \"UTF-8\";\n.input-module_input__-LMoi {\n width: 100%;\n max-width: 400px;\n border-radius: var(--border-radius-lg, 16px);\n font-size: var(--font-size-base, 16px);\n}\n@media screen and (max-width: 768px) {\n .input-module_input__-LMoi {\n width: 100%;\n max-width: 100%;\n }\n}\n.input-module_input__-LMoi[type=checkbox] {\n width: -moz-min-content;\n width: min-content;\n -webkit-appearance: none;\n border: 1px solid #cacece;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), inset 0px -15px 10px -12px rgba(0, 0, 0, 0.05);\n padding: var(--spacing-1, 8px);\n border-radius: var(--border-radius-sm);\n display: inline-block;\n position: relative;\n}\n.input-module_input__-LMoi[type=checkbox]:checked {\n background-color: inherit;\n border: 1px solid #adb8c0;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), inset 0px -15px 10px -12px rgba(0, 0, 0, 0.05), inset 15px 10px -12px rgba(255, 255, 255, 0.1);\n color: inherit;\n}\n.input-module_input__-LMoi[type=checkbox]:checked:after {\n content: \"✔\";\n position: absolute;\n top: -15%;\n left: 15%;\n width: 10px;\n height: 10px;\n border-radius: 10%;\n}\n.input-module_input__-LMoi:not([type=checkbox])::-moz-placeholder {\n opacity: 0;\n}\n.input-module_input__-LMoi:not([type=checkbox])::placeholder {\n opacity: 0;\n}\n.input-module_input__-LMoi:focus {\n outline: none;\n}\n.input-module_input__-LMoi.input-module_error__vs2kz {\n border: 1px solid var(--warn-color);\n}\n.input-module_input__-LMoi.input-module_success__beiu5 {\n border: 1px solid green;\n}\n.input-module_input__-LMoi.input-module_warning__b6S5s {\n border: 1px solid orange;\n}\n.input-module_input__-LMoi.input-module_info__pWO0n {\n border: 1px solid blue;\n}\n.input-module_input__-LMoi.input-module_disabled__40ZHw {\n border: 1px solid gray;\n}\n\n.input-module_inFormField__kk-PD {\n border: none;\n outline: none;\n}\n\n.input-module_checkbox__Yu-9M {\n cursor: pointer;\n}\n\n.input-module_transparent__aXcGX {\n background-color: inherit !important;\n opacity: 1;\n color: inherit !important;\n border: none;\n}\n.input-module_transparent__aXcGX :focus {\n outline: none;\n}";
|
|
1608
|
+
var styles$5 = {"input":"input-module_input__-LMoi","inFormField":"input-module_inFormField__kk-PD","transparent":"input-module_transparent__aXcGX"};
|
|
1609
|
+
styleInject(css_248z$9);
|
|
1479
1610
|
|
|
1480
|
-
var _tmpl$$
|
|
1611
|
+
var _tmpl$$c = /*#__PURE__*/template(`<input>`);
|
|
1481
1612
|
const Input = props => {
|
|
1482
1613
|
const [customProps, normalProps] = splitProps(props, ["tooltip", "transparent", "value", "onChange"]);
|
|
1483
1614
|
const noTransparent = type => "checkbox" !== (type ?? "text");
|
|
@@ -1562,7 +1693,7 @@ const Input = props => {
|
|
|
1562
1693
|
}
|
|
1563
1694
|
});
|
|
1564
1695
|
return (() => {
|
|
1565
|
-
var _el$ = _tmpl$$
|
|
1696
|
+
var _el$ = _tmpl$$c();
|
|
1566
1697
|
spread(_el$, mergeProps(normalProps, {
|
|
1567
1698
|
get placeholder() {
|
|
1568
1699
|
return placeholder();
|
|
@@ -1577,7 +1708,12 @@ const Input = props => {
|
|
|
1577
1708
|
},
|
|
1578
1709
|
"onBlur": e => {
|
|
1579
1710
|
if (!isNullish(context.getName)) {
|
|
1580
|
-
context?.setFocused?.(
|
|
1711
|
+
context?.setFocused?.(prev => {
|
|
1712
|
+
if (prev) {
|
|
1713
|
+
formContext?.formGroup?.validate?.(context?.formName ?? '');
|
|
1714
|
+
}
|
|
1715
|
+
return false;
|
|
1716
|
+
});
|
|
1581
1717
|
const noValue = !e.currentTarget?.value?.trim();
|
|
1582
1718
|
const noFormValue = !formContext?.data?.[context?.formName ?? ''];
|
|
1583
1719
|
const noContextValue = !context?.getValue();
|
|
@@ -1589,7 +1725,7 @@ const Input = props => {
|
|
|
1589
1725
|
},
|
|
1590
1726
|
"onChange": onChange,
|
|
1591
1727
|
get ["class"]() {
|
|
1592
|
-
return `${styles$
|
|
1728
|
+
return `${styles$5.input} ${hasTrasparent() && noTransparent(normalProps.type) ? styles$5?.transparent : ""} ${!!context?.getName?.() ? styles$5?.inFormField : ''} ${props?.class ?? ""}`;
|
|
1593
1729
|
},
|
|
1594
1730
|
get title() {
|
|
1595
1731
|
return customProps.tooltip;
|
|
@@ -1599,22 +1735,21 @@ const Input = props => {
|
|
|
1599
1735
|
})();
|
|
1600
1736
|
};
|
|
1601
1737
|
|
|
1602
|
-
var css_248z$6 = "/* Container and control (trigger) */\n.selectStyles_solid_select__NKR-3 {\n position: relative;\n display: inline-block;\n width: -moz-max-content;\n width: max-content;\n height: -moz-max-content;\n height: max-content;\n margin-right: calc(var(--spacing-1, 8px) * 1.5);\n border-radius: var(--border-radius-md, 8px);\n text-align: left;\n}\n\n.selectStyles_solid_select__value__6Wfm7 {\n flex-grow: 1;\n}\n\n.selectStyles_solid_select__arrow__kTemB {\n float: right;\n}\n\n.selectStyles_solid_select__control__5tiE- {\n display: flex;\n align-items: center;\n min-width: 200px;\n width: 100%;\n padding: calc(var(--spacing-1, 8px) * 0.5) var(--spacing-1, 8px);\n cursor: pointer;\n}\n\n.selectStyles_solid_select__control__5tiE-:hover {\n border-color: #999;\n}\n\n/* Placeholder text style */\n.selectStyles_solid_select__placeholder__G5WXj {\n color: #888;\n}\n\n/* Dropdown arrow icon */\n.selectStyles_solid_select__arrow__kTemB {\n font-size: 0.7em;\n margin-left: 8px;\n}\n\n/* Dropdown menu */\n.selectStyles_solid_select__dropdown__HDHJw {\n position: absolute;\n top: 100%;\n left: 0;\n z-index: 90000;\n width: -moz-fit-content !important;\n width: fit-content !important;\n min-height: var(--spacing-4, 32px);\n max-height: 200px;\n min-width: 200px;\n border-radius: var(--border-radius-md, 8px);\n overflow-y: auto;\n border: 1px solid #ccc;\n box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);\n}\n\n.selectStyles_option-label__hZrPh {\n width: -moz-fit-content;\n width: fit-content;\n}\n\n.selectStyles_solid_select__option__euHDA {\n width: -moz-fit-content;\n width: fit-content;\n}\n.selectStyles_solid_select__option__euHDA:has(.selectStyles_selected__ux-hP) {\n font-weight: bold;\n}\n.selectStyles_solid_select__option__euHDA:hover {\n cursor: pointer;\n}\n\n/* Colors */\n.selectStyles_solid_select__transparent__ak6Va {\n background-color: transparent;\n color: var(--on-background-color);\n}\n\n.selectStyles_solid_select__primary__tQ3sJ {\n background-color: var(--primary-color);\n color: var(--on-primary-color);\n}\n\n.selectStyles_solid_select__option_primary__zixQP {\n background-color: var(--primary-color);\n color: var(--on-primary-color);\n}\n.selectStyles_solid_select__option_primary__zixQP:has(.selectStyles_selected__ux-hP) {\n background: var(--primary-color-dark);\n}\n\n.selectStyles_solid_select__option_primary__zixQP:hover {\n background: var(--primary-color-dark);\n}\n\n.selectStyles_solid_select__primary_dropdown__ohWbr {\n background-color: var(--primary-color);\n color: var(--on-primary-color);\n}\n\n.selectStyles_solid_select__accent__Rt07n {\n background-color: var(--secondary-color);\n color: var(--on-secondary-color);\n}\n.selectStyles_solid_select__accent__Rt07n:has(.selectStyles_selected__ux-hP) {\n background: var(--secondary-color-dark);\n}\n\n.selectStyles_solid_select__option_accent__xYJuA {\n background-color: var(--secondary-color);\n color: var(--on-secondary-color);\n}\n\n.selectStyles_solid_select__option_accent__xYJuA:hover {\n background: var(--secondary-color-dark);\n}\n\n.selectStyles_solid_select__accent_dropdown__PY023 {\n background-color: var(--secondary-color);\n color: var(--on-secondary-color);\n}\n\n.selectStyles_solid_select__tertiary__8D4YE {\n background-color: var(--tertiary-color);\n color: var(--on-tertiary-color);\n}\n.selectStyles_solid_select__tertiary__8D4YE:has(.selectStyles_selected__ux-hP) {\n background: var(--tertiary-color-dark);\n}\n\n.selectStyles_solid_select__option_tertiary__OIRkB {\n background-color: var(--tertiary-color);\n color: var(--on-tertiary-color);\n}\n\n.selectStyles_solid_select__option_tertiary__OIRkB:hover {\n background: var(--tertiary-color-dark);\n}\n\n.selectStyles_solid_select__tertiary_dropdown__k1M09 {\n background-color: var(--tertiary-color);\n color: var(--on-tertiary-color);\n}\n\n/* Option items */\n.selectStyles_solid_select__option__euHDA {\n padding: 8px;\n cursor: pointer;\n display: flex;\n align-items: center;\n min-height: var(--spacing-4, 32px);\n width: 95%;\n min-width: 200px;\n}\n\n.selectStyles_checkmark__zu0id {\n display: inline-block;\n width: 1.2em; /* reserve space for the checkmark */\n margin-right: 4px;\n text-align: center;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNlbGVjdFN0eWxlcy5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLG9DQUFvQztBQUNwQztFQUNFLGtCQUFrQjtFQUNsQixxQkFBcUI7RUFDckIsdUJBQWtCO0VBQWxCLGtCQUFrQjtFQUNsQix3QkFBbUI7RUFBbkIsbUJBQW1CO0VBQ25CLCtDQUErQztFQUMvQywyQ0FBMkM7RUFDM0MsZ0JBQWdCO0FBQ2xCOztBQUVBO0VBQ0UsWUFBWTtBQUNkOztBQUVBO0VBQ0UsWUFBWTtBQUNkOztBQUVBO0VBQ0UsYUFBYTtFQUNiLG1CQUFtQjtFQUNuQixnQkFBZ0I7RUFDaEIsV0FBVztFQUNYLGdFQUFnRTtFQUNoRSxlQUFlO0FBQ2pCOztBQUVBO0VBQ0Usa0JBQWtCO0FBQ3BCOztBQUVBLDJCQUEyQjtBQUMzQjtFQUNFLFdBQVc7QUFDYjs7QUFFQSx3QkFBd0I7QUFDeEI7RUFDRSxnQkFBZ0I7RUFDaEIsZ0JBQWdCO0FBQ2xCOztBQUVBLGtCQUFrQjtBQUNsQjtFQUNFLGtCQUFrQjtFQUNsQixTQUFTO0VBQ1QsT0FBTztFQUNQLGNBQWM7RUFDZCxrQ0FBNkI7RUFBN0IsNkJBQTZCO0VBQzdCLGtDQUFrQztFQUNsQyxpQkFBaUI7RUFDakIsZ0JBQWdCO0VBQ2hCLDJDQUEyQztFQUMzQyxnQkFBZ0I7RUFDaEIsc0JBQXNCO0VBQ3RCLHdDQUF3QztBQUMxQzs7QUFFQTt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0aW9uIHtcbiAgcGFkZGluZzogOHB4O1xuICBjdXJzb3I6IHBvaW50ZXI7XG4gIGRpc3BsYXk6IGZsZXg7XG4gIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gIG1pbi1oZWlnaHQ6IHZhcigtLXNwYWNpbmctNCwgMzJweCk7XG4gIHdpZHRoOiA5NSU7XG4gIG1pbi13aWR0aDogMjAwcHg7XG59XG5cbi5jaGVja21hcmsge1xuICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG4gIHdpZHRoOiAxLjJlbTsgLyogcmVzZXJ2ZSBzcGFjZSBmb3IgdGhlIGNoZWNrbWFyayAqL1xuICBtYXJnaW4tcmlnaHQ6IDRweDtcbiAgdGV4dC1hbGlnbjogY2VudGVyO1xufSJdfQ== */";
|
|
1603
|
-
var styles$
|
|
1604
|
-
styleInject(css_248z$
|
|
1738
|
+
var css_248z$8 = ".selectStyles-module_solid_select__placeholder__VO5-- {\n opacity: var(--text-emphasis-medium, 87%);\n}\n\n.selectStyles-module_solid_select__transparent__nOpvm {\n background-color: transparent;\n}\n\n.selectStyles-module_solid_select__3plh1 {\n display: inline-block;\n position: relative;\n background-color: var(--container-color, #ffffff);\n color: var(--on-container-color, #000);\n text-align: left;\n border-radius: 8px;\n width: 100%;\n margin: 0px 6px;\n}\n\n.selectStyles-module_solid_select__control__Wmmpg {\n display: flex;\n align-items: center;\n width: 100%;\n max-height: 48px;\n border-radius: 8px;\n background-color: var(--container-color, #ffffff);\n color: var(--on-container-color, #000);\n cursor: pointer;\n}\n.selectStyles-module_solid_select__control__Wmmpg:first-child {\n flex-grow: 1;\n}\n.selectStyles-module_solid_select__control__Wmmpg:last-child {\n padding: 0px 6px;\n margin: 0px;\n}\n\n.selectStyles-module_solid_select__control_no_form__Cq9Sc {\n display: flex;\n align-items: center;\n width: 100%;\n height: 48px;\n border-radius: 8px;\n width: 200px;\n margin-top: 2px;\n cursor: pointer;\n}\n.selectStyles-module_solid_select__control_no_form__Cq9Sc:first-child {\n flex-grow: 1;\n}\n.selectStyles-module_solid_select__control_no_form__Cq9Sc:last-child {\n padding: 0px 6px;\n margin: 0px;\n}\n\n.selectStyles-module_solid_select__arrow__OPCZo {\n font-size: 0.7em;\n}\n\n.selectStyles-module_solid_select__value__rNtqF {\n flex-grow: 1;\n}\n\n.selectStyles-module_solid_select__dropdown__UCt-N {\n position: absolute;\n background-color: var(--surface-color, #EEEEEE);\n top: 100%;\n left: 0;\n z-index: 999999999999999;\n max-height: 200px;\n border-radius: 8px;\n overflow-x: hidden;\n overflow-y: auto;\n box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);\n transform-origin: top;\n transform: scaleY(0);\n transition: transform 0.3s ease-out, opacity 0.3s ease-out;\n opacity: 0;\n}\n\n.selectStyles-module_dropTop__IVz9p {\n transform-origin: bottom;\n}\n\n.selectStyles-module_dropBottom__cYJF0 {\n transform-origin: top;\n}\n\n.selectStyles-module_open__f8zLA {\n transform: scaleY(1);\n opacity: 1;\n}\n\n.selectStyles-module_solid_select__option__47WMY {\n padding: 8px;\n cursor: pointer;\n display: flex;\n align-items: center;\n min-height: 32px;\n background-color: var(--container-color, #ffffff);\n color: var(--on-container-color, #000);\n border-radius: 8px;\n}\n.selectStyles-module_solid_select__option__47WMY:hover {\n border: 2px inset var(--primary-color-varient, #43A047);\n}\n.selectStyles-module_solid_select__option__47WMY:has(.selectStyles-module_selected__1-CKm) {\n font-weight: bold;\n}\n\n.selectStyles-module_checkmark__UWcbd {\n display: inline-block;\n width: 1.2em;\n margin-right: 4px;\n text-align: center;\n}\n\n.selectStyles-module_option-label__bBFSW {\n width: -moz-max-content;\n width: max-content;\n height: -moz-max-content;\n height: max-content;\n}";
|
|
1739
|
+
var styles$4 = {"solid_select__placeholder":"selectStyles-module_solid_select__placeholder__VO5--","solid_select__transparent":"selectStyles-module_solid_select__transparent__nOpvm","solid_select":"selectStyles-module_solid_select__3plh1","solid_select__control":"selectStyles-module_solid_select__control__Wmmpg","solid_select__control_no_form":"selectStyles-module_solid_select__control_no_form__Cq9Sc","solid_select__arrow":"selectStyles-module_solid_select__arrow__OPCZo","solid_select__value":"selectStyles-module_solid_select__value__rNtqF","solid_select__dropdown":"selectStyles-module_solid_select__dropdown__UCt-N","dropTop":"selectStyles-module_dropTop__IVz9p","dropBottom":"selectStyles-module_dropBottom__cYJF0","open":"selectStyles-module_open__f8zLA","solid_select__option":"selectStyles-module_solid_select__option__47WMY","selected":"selectStyles-module_selected__1-CKm","checkmark":"selectStyles-module_checkmark__UWcbd","option-label":"selectStyles-module_option-label__bBFSW"};
|
|
1740
|
+
styleInject(css_248z$8);
|
|
1605
1741
|
|
|
1606
|
-
var _tmpl$$
|
|
1607
|
-
_tmpl$2$
|
|
1608
|
-
_tmpl$3$2 = /*#__PURE__*/template(`<span
|
|
1609
|
-
_tmpl$4$1 = /*#__PURE__*/template(`<
|
|
1610
|
-
_tmpl$5$1 = /*#__PURE__*/template(`<div
|
|
1611
|
-
_tmpl$6 = /*#__PURE__*/template(`<div tabindex=0><div><span>`);
|
|
1742
|
+
var _tmpl$$b = /*#__PURE__*/template(`<span>`),
|
|
1743
|
+
_tmpl$2$5 = /*#__PURE__*/template(`<span>▲`),
|
|
1744
|
+
_tmpl$3$2 = /*#__PURE__*/template(`<span>▼`),
|
|
1745
|
+
_tmpl$4$1 = /*#__PURE__*/template(`<div>`),
|
|
1746
|
+
_tmpl$5$1 = /*#__PURE__*/template(`<div is=coles-solid-select tabindex=0><div><span>`, true, false, false);
|
|
1612
1747
|
const SelectContext = createContext();
|
|
1613
1748
|
function Select(props) {
|
|
1614
1749
|
const isMultiple = Object.keys(props).includes("multiple") || props.multiple === true;
|
|
1615
1750
|
const [placeholder, setPlaceholder] = createSignal(props?.placeholder ?? "Select...");
|
|
1616
1751
|
// Internal state for selected value(s). Use provided value or defaultValue or an initial default.
|
|
1617
|
-
const [currStyle, setCurrStyle] = createSignal(
|
|
1752
|
+
const [currStyle, setCurrStyle] = createSignal("primary");
|
|
1618
1753
|
const defaultSelected = isMultiple ? props.value ?? props.defaultValue ?? [] : props.value ?? props.defaultValue ?? undefined;
|
|
1619
1754
|
const [selected, setSelected] = createSignal(defaultSelected);
|
|
1620
1755
|
const [selectRef, setSelectRef] = createSignal();
|
|
@@ -1634,6 +1769,12 @@ function Select(props) {
|
|
|
1634
1769
|
};
|
|
1635
1770
|
// Signal for dropdown open/closed
|
|
1636
1771
|
const [open, setOpen] = createSignal(false);
|
|
1772
|
+
const menuLocRef = createMemo(() => {
|
|
1773
|
+
if (!!form?.getFormFieldRef) {
|
|
1774
|
+
return form.getFormFieldRef();
|
|
1775
|
+
}
|
|
1776
|
+
return selectRef();
|
|
1777
|
+
});
|
|
1637
1778
|
// Map of option value to label (JSX) for displaying selected labels
|
|
1638
1779
|
const optionsMap = new Map();
|
|
1639
1780
|
const registerOption = (val, label) => {
|
|
@@ -1667,9 +1808,6 @@ function Select(props) {
|
|
|
1667
1808
|
setOpen(false);
|
|
1668
1809
|
}
|
|
1669
1810
|
};
|
|
1670
|
-
const toggleOpen = () => {
|
|
1671
|
-
setOpen(!open());
|
|
1672
|
-
};
|
|
1673
1811
|
// Compute the content to display in the closed select (trigger area)
|
|
1674
1812
|
const displayValue = createMemo(() => {
|
|
1675
1813
|
const current = currentValue(); //selected();
|
|
@@ -1678,14 +1816,16 @@ function Select(props) {
|
|
|
1678
1816
|
if (selectedArray.length === 0) {
|
|
1679
1817
|
if (hasForm && form.getTextInside() && !form.getFocused()) {
|
|
1680
1818
|
return (() => {
|
|
1681
|
-
var _el$ = _tmpl$$
|
|
1819
|
+
var _el$ = _tmpl$$b();
|
|
1682
1820
|
insert(_el$, () => form.getName() || props.placeholder || "Select...");
|
|
1821
|
+
createRenderEffect(() => className(_el$, `${styles$4["solid_select__placeholder"]}`));
|
|
1683
1822
|
return _el$;
|
|
1684
1823
|
})();
|
|
1685
1824
|
}
|
|
1686
1825
|
return (() => {
|
|
1687
|
-
var _el$2 = _tmpl$$
|
|
1826
|
+
var _el$2 = _tmpl$$b();
|
|
1688
1827
|
insert(_el$2, () => props.placeholder || "Select...");
|
|
1828
|
+
createRenderEffect(() => className(_el$2, `${styles$4["solid_select__placeholder"]}`));
|
|
1689
1829
|
return _el$2;
|
|
1690
1830
|
})();
|
|
1691
1831
|
}
|
|
@@ -1694,7 +1834,7 @@ function Select(props) {
|
|
|
1694
1834
|
} else {
|
|
1695
1835
|
const labels = selectedArray.map(val => optionsMap.get(val) || String(val));
|
|
1696
1836
|
return (() => {
|
|
1697
|
-
var _el$3 = _tmpl
|
|
1837
|
+
var _el$3 = _tmpl$$b();
|
|
1698
1838
|
insert(_el$3, () => labels.join(", "));
|
|
1699
1839
|
return _el$3;
|
|
1700
1840
|
})();
|
|
@@ -1705,14 +1845,16 @@ function Select(props) {
|
|
|
1705
1845
|
if (isNullish(singleVal) || typeof singleVal === "string" && !!!singleVal.trim()) {
|
|
1706
1846
|
if (hasForm && form.getTextInside() && !form.getFocused()) {
|
|
1707
1847
|
return (() => {
|
|
1708
|
-
var _el$4 = _tmpl$$
|
|
1848
|
+
var _el$4 = _tmpl$$b();
|
|
1709
1849
|
insert(_el$4, () => form.getName() || props.placeholder || "Select...");
|
|
1850
|
+
createRenderEffect(() => className(_el$4, `${styles$4["solid_select__placeholder"]}`));
|
|
1710
1851
|
return _el$4;
|
|
1711
1852
|
})();
|
|
1712
1853
|
}
|
|
1713
1854
|
return (() => {
|
|
1714
|
-
var _el$5 = _tmpl$$
|
|
1855
|
+
var _el$5 = _tmpl$$b();
|
|
1715
1856
|
insert(_el$5, () => props.placeholder || "Select...");
|
|
1857
|
+
createRenderEffect(() => className(_el$5, `${styles$4["solid_select__placeholder"]}`));
|
|
1716
1858
|
return _el$5;
|
|
1717
1859
|
})();
|
|
1718
1860
|
} else if (props.renderValue) {
|
|
@@ -1720,7 +1862,7 @@ function Select(props) {
|
|
|
1720
1862
|
} else {
|
|
1721
1863
|
const label = optionsMap.get(singleVal) || String(singleVal);
|
|
1722
1864
|
return (() => {
|
|
1723
|
-
var _el$6 = _tmpl
|
|
1865
|
+
var _el$6 = _tmpl$$b();
|
|
1724
1866
|
insert(_el$6, label);
|
|
1725
1867
|
return _el$6;
|
|
1726
1868
|
})();
|
|
@@ -1728,16 +1870,16 @@ function Select(props) {
|
|
|
1728
1870
|
}
|
|
1729
1871
|
});
|
|
1730
1872
|
const dropdownBelowScreen = () => {
|
|
1731
|
-
if (
|
|
1732
|
-
const selectRect =
|
|
1873
|
+
if (menuLocRef() && dropdownRef()) {
|
|
1874
|
+
const selectRect = menuLocRef().getBoundingClientRect();
|
|
1733
1875
|
const dropdownRect = dropdownRef().getBoundingClientRect();
|
|
1734
1876
|
return selectRect.bottom + dropdownRect.height > window.innerHeight;
|
|
1735
1877
|
}
|
|
1736
1878
|
return false;
|
|
1737
1879
|
};
|
|
1738
1880
|
const selectLocation = () => {
|
|
1739
|
-
if (
|
|
1740
|
-
const rect =
|
|
1881
|
+
if (menuLocRef()) {
|
|
1882
|
+
const rect = menuLocRef().getBoundingClientRect();
|
|
1741
1883
|
if (dropdownBelowScreen()) {
|
|
1742
1884
|
return {
|
|
1743
1885
|
x: rect.left,
|
|
@@ -1754,12 +1896,6 @@ function Select(props) {
|
|
|
1754
1896
|
y: 0
|
|
1755
1897
|
};
|
|
1756
1898
|
};
|
|
1757
|
-
const selectWidth = () => {
|
|
1758
|
-
if (selectRef()) {
|
|
1759
|
-
return selectRef().getBoundingClientRect().width;
|
|
1760
|
-
}
|
|
1761
|
-
return 0;
|
|
1762
|
-
};
|
|
1763
1899
|
// Update width of select to match option text width
|
|
1764
1900
|
createEffect(() => {
|
|
1765
1901
|
if (selectRef() && dropdownRef()) {
|
|
@@ -1787,20 +1923,21 @@ function Select(props) {
|
|
|
1787
1923
|
}
|
|
1788
1924
|
});
|
|
1789
1925
|
const isTransparent = Object.keys(props).includes("transparent") || props.transparent === true;
|
|
1790
|
-
const styleClass = !isTransparent ? "solid_select__" + currStyle() : '';
|
|
1791
|
-
const styleClassDropdown = "solid_select__" + currStyle() + "_dropdown";
|
|
1792
1926
|
const styleClassTransparent = isTransparent ? "solid_select__transparent" : "";
|
|
1793
1927
|
// Give Current Value to Props
|
|
1794
1928
|
createEffect(() => {
|
|
1795
1929
|
!!props?.onChange ? props.onChange(currentValue()) : null;
|
|
1796
1930
|
});
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1931
|
+
useClickOutside([dropdownRef, selectRef], () => {
|
|
1932
|
+
setOpen(false);
|
|
1933
|
+
form?.setFocused?.(prev => {
|
|
1934
|
+
if (prev) {
|
|
1935
|
+
formContext?.formGroup?.validate?.(form?.formName ?? '');
|
|
1801
1936
|
}
|
|
1802
|
-
|
|
1803
|
-
|
|
1937
|
+
return false;
|
|
1938
|
+
});
|
|
1939
|
+
});
|
|
1940
|
+
onMount(() => {
|
|
1804
1941
|
if (hasForm) {
|
|
1805
1942
|
const formValue = currentValue() ?? isMultiple ? [] : undefined;
|
|
1806
1943
|
const typedFormValue = isMultiple ? formValue : formValue;
|
|
@@ -1826,34 +1963,33 @@ function Select(props) {
|
|
|
1826
1963
|
}
|
|
1827
1964
|
}
|
|
1828
1965
|
}
|
|
1829
|
-
onCleanup(() => document.removeEventListener("mousedown", handleOutsideClick));
|
|
1830
1966
|
});
|
|
1831
1967
|
return (() => {
|
|
1832
|
-
var _el$7 = _tmpl$
|
|
1968
|
+
var _el$7 = _tmpl$5$1(),
|
|
1833
1969
|
_el$8 = _el$7.firstChild,
|
|
1834
1970
|
_el$9 = _el$8.firstChild;
|
|
1835
1971
|
_el$7.$$keydown = e => {
|
|
1836
1972
|
// (Optional) keyboard support for navigation can be added here
|
|
1837
1973
|
if (e.key === "Escape") setOpen(false);
|
|
1838
1974
|
};
|
|
1839
|
-
_el$7.addEventListener("
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
form.setFocused(true);
|
|
1845
|
-
}
|
|
1846
|
-
});
|
|
1847
|
-
_el$8.$$click = toggleOpen;
|
|
1975
|
+
_el$7.addEventListener("focus", () => form?.setFocused?.(true));
|
|
1976
|
+
_el$7._$owner = getOwner();
|
|
1977
|
+
_el$8.$$click = e => {
|
|
1978
|
+
setOpen(old => !old);
|
|
1979
|
+
};
|
|
1848
1980
|
use(setSelectRef, _el$8);
|
|
1981
|
+
_el$9.$$click = e => {
|
|
1982
|
+
setOpen(old => !old);
|
|
1983
|
+
e.stopPropagation();
|
|
1984
|
+
};
|
|
1849
1985
|
insert(_el$9, displayValue);
|
|
1850
1986
|
insert(_el$8, createComponent(Show, {
|
|
1851
1987
|
get when() {
|
|
1852
1988
|
return open();
|
|
1853
1989
|
},
|
|
1854
1990
|
get children() {
|
|
1855
|
-
var _el$10 = _tmpl$
|
|
1856
|
-
createRenderEffect(() => className(_el$10, styles$
|
|
1991
|
+
var _el$10 = _tmpl$2$5();
|
|
1992
|
+
createRenderEffect(() => className(_el$10, styles$4['solid_select__arrow']));
|
|
1857
1993
|
return _el$10;
|
|
1858
1994
|
}
|
|
1859
1995
|
}), null);
|
|
@@ -1862,8 +1998,8 @@ function Select(props) {
|
|
|
1862
1998
|
return !open();
|
|
1863
1999
|
},
|
|
1864
2000
|
get children() {
|
|
1865
|
-
var _el$11 = _tmpl$
|
|
1866
|
-
createRenderEffect(() => className(_el$11, styles$
|
|
2001
|
+
var _el$11 = _tmpl$3$2();
|
|
2002
|
+
createRenderEffect(() => className(_el$11, styles$4['solid_select__arrow']));
|
|
1867
2003
|
return _el$11;
|
|
1868
2004
|
}
|
|
1869
2005
|
}), null);
|
|
@@ -1877,64 +2013,62 @@ function Select(props) {
|
|
|
1877
2013
|
selectStyle: currStyle
|
|
1878
2014
|
},
|
|
1879
2015
|
get children() {
|
|
1880
|
-
return createComponent(
|
|
1881
|
-
get when() {
|
|
1882
|
-
return open();
|
|
1883
|
-
},
|
|
2016
|
+
return createComponent(Portal, {
|
|
1884
2017
|
get children() {
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
a: undefined,
|
|
1904
|
-
o: undefined
|
|
1905
|
-
});
|
|
1906
|
-
return _el$12;
|
|
1907
|
-
}
|
|
2018
|
+
var _el$12 = _tmpl$4$1();
|
|
2019
|
+
use(setDropdownRef, _el$12);
|
|
2020
|
+
insert(_el$12, () => props.children);
|
|
2021
|
+
createRenderEffect(_p$ => {
|
|
2022
|
+
var _v$ = `${styles$4['solid_select__dropdown']} ${dropdownBelowScreen() ? styles$4.dropTop : styles$4.dropBottom} ${open() ? styles$4.open : ''} ${props.dropdownClass || ""}`,
|
|
2023
|
+
_v$2 = `${selectLocation().y}px`,
|
|
2024
|
+
_v$3 = `${selectLocation().x}px`,
|
|
2025
|
+
_v$4 = `${menuLocRef()?.getBoundingClientRect().width ?? 100}px !important`;
|
|
2026
|
+
_v$ !== _p$.e && className(_el$12, _p$.e = _v$);
|
|
2027
|
+
_v$2 !== _p$.t && ((_p$.t = _v$2) != null ? _el$12.style.setProperty("top", _v$2) : _el$12.style.removeProperty("top"));
|
|
2028
|
+
_v$3 !== _p$.a && ((_p$.a = _v$3) != null ? _el$12.style.setProperty("left", _v$3) : _el$12.style.removeProperty("left"));
|
|
2029
|
+
_v$4 !== _p$.o && ((_p$.o = _v$4) != null ? _el$12.style.setProperty("width", _v$4) : _el$12.style.removeProperty("width"));
|
|
2030
|
+
return _p$;
|
|
2031
|
+
}, {
|
|
2032
|
+
e: undefined,
|
|
2033
|
+
t: undefined,
|
|
2034
|
+
a: undefined,
|
|
2035
|
+
o: undefined
|
|
1908
2036
|
});
|
|
2037
|
+
return _el$12;
|
|
1909
2038
|
}
|
|
1910
2039
|
});
|
|
1911
2040
|
}
|
|
1912
2041
|
}), null);
|
|
1913
2042
|
createRenderEffect(_p$ => {
|
|
1914
2043
|
var _v$5 = props.id,
|
|
1915
|
-
_v$6 = `${
|
|
2044
|
+
_v$6 = `${styles$4.solid_select__control_no_form} ${styles$4[styleClassTransparent]} coles-solid-selectControl`,
|
|
1916
2045
|
_v$7 = props.tooltip,
|
|
1917
|
-
_v$8 = `${styles$
|
|
1918
|
-
_v$9 =
|
|
1919
|
-
|
|
2046
|
+
_v$8 = `${styles$4['solid_select__control']} ${props.class || ""}`,
|
|
2047
|
+
_v$9 = !hasForm ? {
|
|
2048
|
+
height: '48px'
|
|
2049
|
+
} : {},
|
|
2050
|
+
_v$10 = styles$4['solid_select__value'];
|
|
2051
|
+
_v$5 !== _p$.e && (_el$7.id = _p$.e = _v$5);
|
|
1920
2052
|
_v$6 !== _p$.t && className(_el$7, _p$.t = _v$6);
|
|
1921
|
-
_v$7 !== _p$.a &&
|
|
2053
|
+
_v$7 !== _p$.a && (_el$7.title = _p$.a = _v$7);
|
|
1922
2054
|
_v$8 !== _p$.o && className(_el$8, _p$.o = _v$8);
|
|
1923
|
-
|
|
2055
|
+
_p$.i = style$9(_el$8, _v$9, _p$.i);
|
|
2056
|
+
_v$10 !== _p$.n && className(_el$9, _p$.n = _v$10);
|
|
1924
2057
|
return _p$;
|
|
1925
2058
|
}, {
|
|
1926
2059
|
e: undefined,
|
|
1927
2060
|
t: undefined,
|
|
1928
2061
|
a: undefined,
|
|
1929
2062
|
o: undefined,
|
|
1930
|
-
i: undefined
|
|
2063
|
+
i: undefined,
|
|
2064
|
+
n: undefined
|
|
1931
2065
|
});
|
|
1932
2066
|
return _el$7;
|
|
1933
2067
|
})();
|
|
1934
2068
|
}
|
|
1935
2069
|
delegateEvents(["keydown", "click"]);
|
|
1936
2070
|
|
|
1937
|
-
var _tmpl$$
|
|
2071
|
+
var _tmpl$$a = /*#__PURE__*/template(`<div><span></span><span is=coles-select-label>`, true, false, false);
|
|
1938
2072
|
function Option(props) {
|
|
1939
2073
|
const select = useContext(SelectContext);
|
|
1940
2074
|
if (!select) {
|
|
@@ -2008,17 +2142,18 @@ function Option(props) {
|
|
|
2008
2142
|
}
|
|
2009
2143
|
};
|
|
2010
2144
|
return (() => {
|
|
2011
|
-
var _el$ = _tmpl$$
|
|
2145
|
+
var _el$ = _tmpl$$a(),
|
|
2012
2146
|
_el$2 = _el$.firstChild,
|
|
2013
2147
|
_el$3 = _el$2.nextSibling;
|
|
2014
2148
|
_el$.$$click = handleClick;
|
|
2015
2149
|
insert(_el$2, () => select.isSelected(props.value) ? "✓" : "");
|
|
2150
|
+
_el$3._$owner = getOwner();
|
|
2016
2151
|
insert(_el$3, () => props.children ?? "");
|
|
2017
2152
|
createRenderEffect(_p$ => {
|
|
2018
|
-
var _v$ = `${styles$
|
|
2153
|
+
var _v$ = `${styles$4['solid_select__option']} ${props.class || ""}`,
|
|
2019
2154
|
_v$2 = !!select.isSelected(props.value),
|
|
2020
|
-
_v$3 = `${styles$
|
|
2021
|
-
_v$4 = `${styles$
|
|
2155
|
+
_v$3 = `${styles$4['checkmark']}`,
|
|
2156
|
+
_v$4 = `${styles$4['option-label']}`;
|
|
2022
2157
|
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
2023
2158
|
_v$2 !== _p$.t && _el$.classList.toggle("selected", _p$.t = _v$2);
|
|
2024
2159
|
_v$3 !== _p$.a && className(_el$2, _p$.a = _v$3);
|
|
@@ -2035,12 +2170,12 @@ function Option(props) {
|
|
|
2035
2170
|
}
|
|
2036
2171
|
delegateEvents(["click"]);
|
|
2037
2172
|
|
|
2038
|
-
var css_248z$
|
|
2039
|
-
var style$
|
|
2040
|
-
styleInject(css_248z$
|
|
2173
|
+
var css_248z$7 = ".snackbar-module_snack__Dkcmp {\n position: fixed;\n bottom: 10px;\n left: 45vw;\n right: 45vw;\n border-radius: 15px;\n margin: 0;\n padding: 0;\n z-index: 9999;\n display: flex;\n flex-direction: row;\n align-items: flex-end;\n max-width: 10vw;\n padding: 5px;\n}\n@media screen and (max-width: 768px) {\n .snackbar-module_snack__Dkcmp {\n left: 8vw;\n right: 8vw;\n bottom: 20vh;\n max-width: 70vw;\n }\n}\n.snackbar-module_snack__Dkcmp span {\n flex-grow: 1;\n margin: auto 0;\n text-wrap: wrap;\n}\n.snackbar-module_snack__Dkcmp button {\n margin: auto 0;\n}\n\n.snackbar-module_error__7IShA {\n border: 2px solid var(--error-color, #B00020);\n font-weight: bold;\n}\n\n.snackbar-module_success__JPkNY {\n border-color: #4caf50;\n border: 2px solid #4caf50;\n color: #4caf50;\n}\n\n.snackbar-module_info__52mgJ {\n border: 2px solid var(--secondary-color, #14b9c3);\n}\n\n.snackbar-module_warning__K1oCK {\n border-color: #ff9800;\n border: 2px solid #ff9800;\n color: #ff9800;\n}\n\n.snackbar-module_open__Bdhg1 {\n animation: snackbar-module_slideIn__aM-2K 0.5s forwards;\n}\n\n.snackbar-module_close__-JXxs {\n animation: snackbar-module_slideOut__6sQkv 0.5s forwards;\n}\n\n.snackbar-module_primary__j2zPB {\n background-color: var(--container-color, #ffffff);\n color: var(--on-container-color, #000);\n}\n.snackbar-module_primary__j2zPB:hover {\n cursor: pointer;\n}";
|
|
2174
|
+
var style$3 = {"snack":"snackbar-module_snack__Dkcmp","error":"snackbar-module_error__7IShA","success":"snackbar-module_success__JPkNY","info":"snackbar-module_info__52mgJ","warning":"snackbar-module_warning__K1oCK","open":"snackbar-module_open__Bdhg1","slideIn":"snackbar-module_slideIn__aM-2K","close":"snackbar-module_close__-JXxs","slideOut":"snackbar-module_slideOut__6sQkv","primary":"snackbar-module_primary__j2zPB"};
|
|
2175
|
+
styleInject(css_248z$7);
|
|
2041
2176
|
|
|
2042
|
-
var _tmpl$$
|
|
2043
|
-
_tmpl$2$
|
|
2177
|
+
var _tmpl$$9 = /*#__PURE__*/template(`<div>`),
|
|
2178
|
+
_tmpl$2$4 = /*#__PURE__*/template(`<div><span>`);
|
|
2044
2179
|
const [snackbars, setSnackbars] = createSignal([]);
|
|
2045
2180
|
const addSnackbar = snack => {
|
|
2046
2181
|
setSnackbars(old => [...old, snack]);
|
|
@@ -2054,7 +2189,7 @@ const SnackbarController = () => {
|
|
|
2054
2189
|
return snackbars().length > 0;
|
|
2055
2190
|
},
|
|
2056
2191
|
get children() {
|
|
2057
|
-
var _el$ = _tmpl$$
|
|
2192
|
+
var _el$ = _tmpl$$9();
|
|
2058
2193
|
insert(_el$, createComponent(For, {
|
|
2059
2194
|
get each() {
|
|
2060
2195
|
return snackbars();
|
|
@@ -2066,7 +2201,7 @@ const SnackbarController = () => {
|
|
|
2066
2201
|
onClose: () => removeSnackbar(index())
|
|
2067
2202
|
}))
|
|
2068
2203
|
}));
|
|
2069
|
-
createRenderEffect(() => className(_el$, style$
|
|
2204
|
+
createRenderEffect(() => className(_el$, style$3.snackContainer));
|
|
2070
2205
|
return _el$;
|
|
2071
2206
|
}
|
|
2072
2207
|
});
|
|
@@ -2086,7 +2221,7 @@ const Snackbar = props => {
|
|
|
2086
2221
|
return isOpen();
|
|
2087
2222
|
},
|
|
2088
2223
|
get children() {
|
|
2089
|
-
var _el$2 = _tmpl$2$
|
|
2224
|
+
var _el$2 = _tmpl$2$4(),
|
|
2090
2225
|
_el$3 = _el$2.firstChild;
|
|
2091
2226
|
insert(_el$3, () => props.message);
|
|
2092
2227
|
insert(_el$2, createComponent(Button, {
|
|
@@ -2097,7 +2232,7 @@ const Snackbar = props => {
|
|
|
2097
2232
|
}), null);
|
|
2098
2233
|
createRenderEffect(_p$ => {
|
|
2099
2234
|
var _v$ = `${10 + props.index * (50 + messageLength * 8)}px`,
|
|
2100
|
-
_v$2 = `${style$
|
|
2235
|
+
_v$2 = `${style$3.primary} ${style$3.snack} ${style$3[props.severity ?? 'info']}`;
|
|
2101
2236
|
_v$ !== _p$.e && ((_p$.e = _v$) != null ? _el$2.style.setProperty("bottom", _v$) : _el$2.style.removeProperty("bottom"));
|
|
2102
2237
|
_v$2 !== _p$.t && className(_el$2, _p$.t = _v$2);
|
|
2103
2238
|
return _p$;
|
|
@@ -2112,58 +2247,76 @@ const Snackbar = props => {
|
|
|
2112
2247
|
});
|
|
2113
2248
|
};
|
|
2114
2249
|
|
|
2115
|
-
var css_248z$
|
|
2116
|
-
var style$
|
|
2117
|
-
styleInject(css_248z$
|
|
2250
|
+
var css_248z$6 = ".popup-module_popup__Oeq7F {\n padding: 0px;\n padding-top: 8px;\n padding-bottom: 8px;\n overflow: hidden;\n position: fixed;\n top: 50%;\n left: 50%;\n border: var(--primary-color, #4CAF50) 1px solid;\n border-radius: 8px;\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);\n z-index: 1000;\n text-align: center;\n}\n\n.popup-module_wrapper__S7cXt {\n padding: 0px;\n overflow-y: hidden;\n padding-bottom: 5px;\n display: flex;\n flex-direction: column;\n}\n.popup-module_wrapper__S7cXt :not(span):nth-child(2) {\n margin-top: 5%;\n height: 95%;\n flex-grow: 1;\n overflow-y: auto;\n}\n\n.popup-module_header__aKiI0 {\n background-color: var(--subheader-background-color, #388E3C);\n color: var(--subheader-on-background-color, #fff);\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 5%;\n overflow-y: hidden;\n padding: 5px;\n min-height: 2em;\n}\n.popup-module_header__aKiI0 button {\n background-color: var(--subheader-background-color, #388E3C);\n color: var(--subheader-on-background-color, #fff);\n}\n.popup-module_header__aKiI0 h2 {\n text-align: left;\n margin-left: 5%;\n flex-grow: 1;\n padding: 0px;\n padding-bottom: 5px;\n margin: 0px;\n margin-left: 1em;\n}\n.popup-module_header__aKiI0 span {\n flex-shrink: 0;\n width: -moz-min-content;\n width: min-content;\n height: -moz-min-content;\n height: min-content;\n}\n.popup-module_header__aKiI0 span button:hover {\n cursor: pointer;\n}\n\n.popup-module_body__ouRAt {\n flex-grow: 1;\n}\n\n.popup-module_tertiary__69E41, .popup-module_accent__AzLZ1, .popup-module_primary__tm77N {\n background-color: var(--surface-color, #EEEEEE);\n color: var(--on-surface-color, #000000);\n}";
|
|
2251
|
+
var style$2 = {"popup":"popup-module_popup__Oeq7F","wrapper":"popup-module_wrapper__S7cXt","header":"popup-module_header__aKiI0","body":"popup-module_body__ouRAt","primary":"popup-module_primary__tm77N"};
|
|
2252
|
+
styleInject(css_248z$6);
|
|
2118
2253
|
|
|
2119
|
-
var _tmpl$$
|
|
2120
|
-
_tmpl$2$
|
|
2121
|
-
/**
|
|
2122
|
-
*
|
|
2123
|
-
* @param title {string} {string} - The title of the modal.
|
|
2124
|
-
* @param width {string} {string} - The css width of the modal.
|
|
2125
|
-
* @param maxWidth {string} {string} - The optional css max-width of the modal.
|
|
2126
|
-
* @param height {string} {string} - The css height of the modal.
|
|
2127
|
-
* @param maxHeight {string} {string} - The optional css max-height of the modal.
|
|
2128
|
-
* @param translate {x{x: string, y: string} - Override the default x and y coordinates of the modal.
|
|
2129
|
-
* @param backgroundClick [Accessor <bool>, Setter <bool>] - A signal and setter for enabling the background click.
|
|
2130
|
-
* @returns - A Modal component.
|
|
2131
|
-
*/
|
|
2254
|
+
var _tmpl$$8 = /*#__PURE__*/template(`<b>X`),
|
|
2255
|
+
_tmpl$2$3 = /*#__PURE__*/template(`<div><div><h2></h2><span></span></div><div>`);
|
|
2132
2256
|
const Modal = props => {
|
|
2133
2257
|
const defaultX = props.translate?.x ?? "-50%";
|
|
2134
2258
|
const defaultY = props.translate?.y ?? "-50%";
|
|
2135
2259
|
const [popupRef, setPopupRef] = createSignal();
|
|
2136
|
-
|
|
2137
|
-
|
|
2260
|
+
// Flag to ignore the click that triggered opening the modal.
|
|
2261
|
+
const [ignoreFirstClick, setIgnoreFirstClick] = createSignal(true);
|
|
2262
|
+
const isShown = createMemo(() => props.show[0]());
|
|
2263
|
+
// When the modal becomes visible, set the flag and clear it on the next tick.
|
|
2264
|
+
createEffect(() => {
|
|
2265
|
+
if (isShown()) {
|
|
2266
|
+
setIgnoreFirstClick(true);
|
|
2267
|
+
// Use a 0ms timeout to clear the flag after the current event loop.
|
|
2268
|
+
setTimeout(() => setIgnoreFirstClick(false), 0);
|
|
2269
|
+
}
|
|
2270
|
+
});
|
|
2271
|
+
const clickOutside = e => {
|
|
2272
|
+
// Only process if modal is visible and we're not in the first click.
|
|
2273
|
+
if (!props.show[0]() || ignoreFirstClick()) return;
|
|
2274
|
+
const popupBox = popupRef()?.getBoundingClientRect();
|
|
2275
|
+
if (!isNullish(popupBox)) {
|
|
2276
|
+
const outLeft = e.clientX < popupBox.left;
|
|
2277
|
+
const outRight = e.clientX > popupBox.right;
|
|
2278
|
+
const outTop = e.clientY < popupBox.top;
|
|
2279
|
+
const outBottom = e.clientY > popupBox.bottom;
|
|
2280
|
+
if (outLeft || outRight || outTop || outBottom) {
|
|
2281
|
+
props.show[1](false);
|
|
2282
|
+
}
|
|
2283
|
+
}
|
|
2284
|
+
};
|
|
2285
|
+
onMount(() => {
|
|
2286
|
+
document.addEventListener("click", clickOutside);
|
|
2287
|
+
});
|
|
2288
|
+
onCleanup(() => {
|
|
2289
|
+
document.removeEventListener("click", clickOutside);
|
|
2138
2290
|
});
|
|
2139
2291
|
return createComponent(Show, {
|
|
2140
2292
|
get when() {
|
|
2141
|
-
return
|
|
2293
|
+
return isShown();
|
|
2142
2294
|
},
|
|
2143
2295
|
get children() {
|
|
2144
2296
|
return createComponent(Portal, {
|
|
2145
2297
|
get children() {
|
|
2146
|
-
var _el$ = _tmpl$2$
|
|
2298
|
+
var _el$ = _tmpl$2$3(),
|
|
2147
2299
|
_el$2 = _el$.firstChild,
|
|
2148
2300
|
_el$3 = _el$2.firstChild,
|
|
2149
2301
|
_el$4 = _el$3.nextSibling,
|
|
2150
2302
|
_el$6 = _el$2.nextSibling;
|
|
2151
2303
|
use(el => setPopupRef(el), _el$);
|
|
2152
|
-
`translate(${defaultX}
|
|
2304
|
+
`translate(${defaultX}, ${defaultY})` != null ? _el$.style.setProperty("transform", `translate(${defaultX}, ${defaultY})`) : _el$.style.removeProperty("transform");
|
|
2153
2305
|
insert(_el$3, () => props.title ?? "Modal");
|
|
2154
2306
|
insert(_el$4, createComponent(Button, {
|
|
2155
|
-
|
|
2307
|
+
transparent: true,
|
|
2308
|
+
onClick: () => props.show[1](old => !old),
|
|
2156
2309
|
get children() {
|
|
2157
|
-
return _tmpl$$
|
|
2310
|
+
return _tmpl$$8();
|
|
2158
2311
|
}
|
|
2159
2312
|
}));
|
|
2160
2313
|
insert(_el$6, () => props.children);
|
|
2161
2314
|
createRenderEffect(_p$ => {
|
|
2162
2315
|
var _v$ = props.width ? props.width : isMobile() ? "90vw" : "45vw",
|
|
2163
2316
|
_v$2 = props.height ? props.height : isMobile() ? "90vh" : "60vh",
|
|
2164
|
-
_v$3 = `${style$
|
|
2165
|
-
_v$4 =
|
|
2166
|
-
_v$5 = style$
|
|
2317
|
+
_v$3 = `${style$2["primary"]} ${style$2.wrapper} ${style$2.popup}`,
|
|
2318
|
+
_v$4 = style$2.header,
|
|
2319
|
+
_v$5 = style$2.body;
|
|
2167
2320
|
_v$ !== _p$.e && ((_p$.e = _v$) != null ? _el$.style.setProperty("width", _v$) : _el$.style.removeProperty("width"));
|
|
2168
2321
|
_v$2 !== _p$.t && ((_p$.t = _v$2) != null ? _el$.style.setProperty("height", _v$2) : _el$.style.removeProperty("height"));
|
|
2169
2322
|
_v$3 !== _p$.a && className(_el$, _p$.a = _v$3);
|
|
@@ -2184,237 +2337,11 @@ const Modal = props => {
|
|
|
2184
2337
|
});
|
|
2185
2338
|
};
|
|
2186
2339
|
|
|
2187
|
-
var css_248z$
|
|
2188
|
-
var style$2 = {"tabs":"tabs-module_tabs__AqLFl","singleTabs":"tabs-module_singleTabs__SOD5d","hover":"tabs-module_hover__4r8g4","tabHeader":"tabs-module_tabHeader__X1-FY","tabBody":"tabs-module_tabBody__rJfud","leftArrow":"tabs-module_leftArrow__0imd-","rightArrow":"tabs-module_rightArrow__aCBVp","transparent":"tabs-module_transparent__yL988"};
|
|
2189
|
-
styleInject(css_248z$3);
|
|
2190
|
-
|
|
2191
|
-
var _tmpl$$4 = /*#__PURE__*/template(`<span>`),
|
|
2192
|
-
_tmpl$2$3 = /*#__PURE__*/template(`<div><div><div></div></div><div>`),
|
|
2193
|
-
_tmpl$3$1 = /*#__PURE__*/template(`<b>`);
|
|
2194
|
-
const tabContext = createContext({
|
|
2195
|
-
tabs: () => ({}),
|
|
2196
|
-
setTabs: () => {}
|
|
2197
|
-
});
|
|
2198
|
-
function getTabContext() {
|
|
2199
|
-
return useContext(tabContext);
|
|
2200
|
-
}
|
|
2201
|
-
const TabProvider = props => {
|
|
2202
|
-
const [tabs, setTabs] = createSignal(props.value, {
|
|
2203
|
-
equals: (a, b) => {
|
|
2204
|
-
const sameLength = Object.keys(a).length === Object.keys(b).length;
|
|
2205
|
-
if (!sameLength) return false;
|
|
2206
|
-
for (const key in a) {
|
|
2207
|
-
if (a[key] !== b[key]) return false;
|
|
2208
|
-
}
|
|
2209
|
-
if (JSON.stringify(a) !== JSON.stringify(b)) return false;
|
|
2210
|
-
return true;
|
|
2211
|
-
}
|
|
2212
|
-
});
|
|
2213
|
-
return createComponent(tabContext.Provider, {
|
|
2214
|
-
value: {
|
|
2215
|
-
tabs,
|
|
2216
|
-
setTabs
|
|
2217
|
-
},
|
|
2218
|
-
get children() {
|
|
2219
|
-
return props.children;
|
|
2220
|
-
}
|
|
2221
|
-
});
|
|
2222
|
-
};
|
|
2223
|
-
const Tabs = props => {
|
|
2224
|
-
return createComponent(TabProvider, {
|
|
2225
|
-
value: {},
|
|
2226
|
-
get children() {
|
|
2227
|
-
return createComponent(TabInternal, props);
|
|
2228
|
-
}
|
|
2229
|
-
});
|
|
2230
|
-
};
|
|
2231
|
-
const TabInternal = props => {
|
|
2232
|
-
const {
|
|
2233
|
-
tabs,
|
|
2234
|
-
setTabs
|
|
2235
|
-
} = useContext(tabContext);
|
|
2236
|
-
const [selectedTab, setSelectedTab] = createSignal(Object.keys(tabs())[0]);
|
|
2237
|
-
const currentElement = createMemo(() => tabs()[selectedTab()]);
|
|
2238
|
-
children(() => props.children);
|
|
2239
|
-
const hasTranparent = createMemo(() => Object.keys(props).includes("transparent"));
|
|
2240
|
-
createRenderEffect(() => {
|
|
2241
|
-
setSelectedTab(Object.keys(tabs())[0]);
|
|
2242
|
-
});
|
|
2243
|
-
const [showLeft, setShowLeft] = createSignal(false);
|
|
2244
|
-
const [showRight, setShowRight] = createSignal(false);
|
|
2245
|
-
const scrollFunction = e => {
|
|
2246
|
-
const scrollLeft = tabContainer?.scrollLeft;
|
|
2247
|
-
tabContainer?.offsetWidth;
|
|
2248
|
-
const scrollWidth = tabContainer?.scrollWidth ?? 0;
|
|
2249
|
-
const clientWidth = tabContainer?.clientWidth ?? 0;
|
|
2250
|
-
const newWidth = scrollWidth - clientWidth;
|
|
2251
|
-
const showRight = Object.keys(tabs()).length >= 3 && isMobile() || scrollLeft !== newWidth;
|
|
2252
|
-
const showLeft = scrollLeft > 0;
|
|
2253
|
-
setShowRight(showRight);
|
|
2254
|
-
setShowLeft(showLeft);
|
|
2255
|
-
if (scrollLeft <= 0) {
|
|
2256
|
-
setShowLeft(false);
|
|
2257
|
-
}
|
|
2258
|
-
};
|
|
2259
|
-
let tabContainer;
|
|
2260
|
-
onMount(() => {
|
|
2261
|
-
if (tabContainer) {
|
|
2262
|
-
tabContainer.addEventListener("scroll", scrollFunction);
|
|
2263
|
-
scrollFunction();
|
|
2264
|
-
}
|
|
2265
|
-
});
|
|
2266
|
-
onCleanup(() => {
|
|
2267
|
-
if (tabContainer) {
|
|
2268
|
-
tabContainer.removeEventListener("scroll", scrollFunction);
|
|
2269
|
-
}
|
|
2270
|
-
});
|
|
2271
|
-
const scrollLeft = () => {
|
|
2272
|
-
tabContainer.scrollLeft -= 100;
|
|
2273
|
-
scrollFunction();
|
|
2274
|
-
};
|
|
2275
|
-
const scrollRight = () => {
|
|
2276
|
-
tabContainer.scrollLeft += 100;
|
|
2277
|
-
scrollFunction();
|
|
2278
|
-
setShowLeft(true);
|
|
2279
|
-
};
|
|
2280
|
-
const styleType = props.styleType ?? "accent";
|
|
2281
|
-
const [tabsArr, setTabsArr] = createSignal(Object.keys(tabs()));
|
|
2282
|
-
createEffect(() => {
|
|
2283
|
-
setTabsArr(Object.keys(tabs()));
|
|
2284
|
-
});
|
|
2285
|
-
return (() => {
|
|
2286
|
-
var _el$ = _tmpl$2$3(),
|
|
2287
|
-
_el$2 = _el$.firstChild,
|
|
2288
|
-
_el$4 = _el$2.firstChild,
|
|
2289
|
-
_el$6 = _el$2.nextSibling;
|
|
2290
|
-
insert(_el$2, createComponent(Show, {
|
|
2291
|
-
get when() {
|
|
2292
|
-
return showLeft();
|
|
2293
|
-
},
|
|
2294
|
-
get children() {
|
|
2295
|
-
var _el$3 = _tmpl$$4();
|
|
2296
|
-
insert(_el$3, createComponent(Button, {
|
|
2297
|
-
onClick: scrollLeft,
|
|
2298
|
-
children: "\u2190"
|
|
2299
|
-
}));
|
|
2300
|
-
createRenderEffect(() => className(_el$3, style$2.leftArrow));
|
|
2301
|
-
return _el$3;
|
|
2302
|
-
}
|
|
2303
|
-
}), _el$4);
|
|
2304
|
-
var _ref$ = tabContainer;
|
|
2305
|
-
typeof _ref$ === "function" ? use(_ref$, _el$4) : tabContainer = _el$4;
|
|
2306
|
-
insert(_el$4, createComponent(For, {
|
|
2307
|
-
get each() {
|
|
2308
|
-
return tabsArr();
|
|
2309
|
-
},
|
|
2310
|
-
children: (tab, index) => (() => {
|
|
2311
|
-
var _el$7 = _tmpl$$4();
|
|
2312
|
-
_el$7.$$click = () => setSelectedTab(tab);
|
|
2313
|
-
insert(_el$7, createComponent(Show, {
|
|
2314
|
-
get when() {
|
|
2315
|
-
return tab === selectedTab();
|
|
2316
|
-
},
|
|
2317
|
-
get children() {
|
|
2318
|
-
var _el$8 = _tmpl$3$1();
|
|
2319
|
-
insert(_el$8, tab);
|
|
2320
|
-
return _el$8;
|
|
2321
|
-
}
|
|
2322
|
-
}), null);
|
|
2323
|
-
insert(_el$7, createComponent(Show, {
|
|
2324
|
-
get when() {
|
|
2325
|
-
return tab !== selectedTab();
|
|
2326
|
-
},
|
|
2327
|
-
children: tab
|
|
2328
|
-
}), null);
|
|
2329
|
-
createRenderEffect(() => className(_el$7, style$2.hover));
|
|
2330
|
-
return _el$7;
|
|
2331
|
-
})()
|
|
2332
|
-
}));
|
|
2333
|
-
insert(_el$2, createComponent(Show, {
|
|
2334
|
-
get when() {
|
|
2335
|
-
return showRight();
|
|
2336
|
-
},
|
|
2337
|
-
get children() {
|
|
2338
|
-
var _el$5 = _tmpl$$4();
|
|
2339
|
-
insert(_el$5, createComponent(Button, {
|
|
2340
|
-
onClick: scrollRight,
|
|
2341
|
-
children: "\u2192"
|
|
2342
|
-
}));
|
|
2343
|
-
createRenderEffect(() => className(_el$5, style$2.rightArrow));
|
|
2344
|
-
return _el$5;
|
|
2345
|
-
}
|
|
2346
|
-
}), null);
|
|
2347
|
-
insert(_el$6, currentElement);
|
|
2348
|
-
createRenderEffect(_p$ => {
|
|
2349
|
-
var _v$ = style$2.tabs,
|
|
2350
|
-
_v$2 = `${style$2[styleType]} ${style$2.singleTabs} ${hasTranparent() === true ? style$2.transparent : ""}`,
|
|
2351
|
-
_v$3 = style$2.tabHeader,
|
|
2352
|
-
_v$4 = `${styleType} ${style$2.tabBody} ${hasTranparent() === true ? style$2.transparent : ""}`;
|
|
2353
|
-
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
2354
|
-
_v$2 !== _p$.t && className(_el$2, _p$.t = _v$2);
|
|
2355
|
-
_v$3 !== _p$.a && className(_el$4, _p$.a = _v$3);
|
|
2356
|
-
_v$4 !== _p$.o && className(_el$6, _p$.o = _v$4);
|
|
2357
|
-
return _p$;
|
|
2358
|
-
}, {
|
|
2359
|
-
e: undefined,
|
|
2360
|
-
t: undefined,
|
|
2361
|
-
a: undefined,
|
|
2362
|
-
o: undefined
|
|
2363
|
-
});
|
|
2364
|
-
return _el$;
|
|
2365
|
-
})();
|
|
2366
|
-
};
|
|
2367
|
-
const Tab = props => {
|
|
2368
|
-
const {
|
|
2369
|
-
tabs,
|
|
2370
|
-
setTabs
|
|
2371
|
-
} = getTabContext();
|
|
2372
|
-
createEffect(() => {
|
|
2373
|
-
if (props.hidden) {
|
|
2374
|
-
if (props.hidden()) {
|
|
2375
|
-
setTabs(old => {
|
|
2376
|
-
const newTabs = {
|
|
2377
|
-
...old
|
|
2378
|
-
};
|
|
2379
|
-
delete newTabs[props.name];
|
|
2380
|
-
return newTabs;
|
|
2381
|
-
});
|
|
2382
|
-
} else {
|
|
2383
|
-
if (!!props.name && !Object.keys(tabs()).includes(props.name)) {
|
|
2384
|
-
setTabs(old => ({
|
|
2385
|
-
...old,
|
|
2386
|
-
[props.name]: props.children
|
|
2387
|
-
}));
|
|
2388
|
-
}
|
|
2389
|
-
}
|
|
2390
|
-
}
|
|
2391
|
-
});
|
|
2392
|
-
onMount(() => {
|
|
2393
|
-
if (props.name !== undefined) {
|
|
2394
|
-
if (!props.hidden || props.hidden && !props.hidden()) {
|
|
2395
|
-
setTabs(old => ({
|
|
2396
|
-
...old,
|
|
2397
|
-
[props.name]: props.children
|
|
2398
|
-
}));
|
|
2399
|
-
}
|
|
2400
|
-
}
|
|
2401
|
-
});
|
|
2402
|
-
return createComponent(Show, {
|
|
2403
|
-
get when() {
|
|
2404
|
-
return !props.hidden || props.hidden();
|
|
2405
|
-
},
|
|
2406
|
-
get children() {
|
|
2407
|
-
return props.children;
|
|
2408
|
-
}
|
|
2409
|
-
});
|
|
2410
|
-
};
|
|
2411
|
-
delegateEvents(["click"]);
|
|
2412
|
-
|
|
2413
|
-
var css_248z$2 = ".TextArea-module_areaStyle__AshKi {\n padding: 0.5rem;\n margin-right: calc(var(--spacing-1, 8px) / 2);\n border: 1px solid #ccc;\n border-radius: var(--border-radius-md, 6px);\n width: 98%;\n height: 100%;\n resize: none;\n}\n@media screen and (max-width: 768px) {\n .TextArea-module_areaStyle__AshKi {\n width: 90%;\n }\n}\n\n.TextArea-module_picButton__TV9ZE {\n padding: calc(var(--spacing-1, 8px) / 2) var(--spacing-1, 8px) !important;\n background-color: transparent;\n border-top: 1px solid white;\n border-bottom: 1px solid white;\n}\n\n.TextArea-module_transparent__pwXRO {\n background-color: transparent;\n border: none;\n color: white;\n padding: 0.5rem;\n width: inherit;\n height: 100%;\n resize: none;\n}\n.TextArea-module_transparent__pwXRO:focus {\n outline: none;\n border: none;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRleHRBcmVhLm1vZHVsZS5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0VBQ0UsZUFBZTtFQUNmLDZDQUE2QztFQUM3QyxzQkFBc0I7RUFDdEIsMkNBQTJDO0VBQzNDLFVBQVU7RUFDVixZQUFZO0VBQ1osWUFBWTtBQUNkO0FBQ0E7RUFDRTtJQUNFLFVBQVU7RUFDWjtBQUNGOztBQUVBO0VBQ0UseUVBQXlFO0VBQ3pFLDZCQUE2QjtFQUM3QiwyQkFBMkI7RUFDM0IsOEJBQThCO0FBQ2hDOztBQUVBO0VBQ0UsNkJBQTZCO0VBQzdCLFlBQVk7RUFDWixZQUFZO0VBQ1osZUFBZTtFQUNmLGNBQWM7RUFDZCxZQUFZO0VBQ1osWUFBWTtBQUNkO0FBQ0E7RUFDRSxhQUFhO0VBQ2IsWUFBWTtBQUNkIiwiZmlsZSI6IlRleHRBcmVhLm1vZHVsZS5zY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmFyZWFTdHlsZSB7XG4gIHBhZGRpbmc6IDAuNXJlbTtcbiAgbWFyZ2luLXJpZ2h0OiBjYWxjKHZhcigtLXNwYWNpbmctMSwgOHB4KSAvIDIpO1xuICBib3JkZXI6IDFweCBzb2xpZCAjY2NjO1xuICBib3JkZXItcmFkaXVzOiB2YXIoLS1ib3JkZXItcmFkaXVzLW1kLCA2cHgpO1xuICB3aWR0aDogOTglO1xuICBoZWlnaHQ6IDEwMCU7XG4gIHJlc2l6ZTogbm9uZTtcbn1cbkBtZWRpYSBzY3JlZW4gYW5kIChtYXgtd2lkdGg6IDc2OHB4KSB7XG4gIC5hcmVhU3R5bGUge1xuICAgIHdpZHRoOiA5MCU7XG4gIH1cbn1cblxuLnBpY0J1dHRvbiB7XG4gIHBhZGRpbmc6IGNhbGModmFyKC0tc3BhY2luZy0xLCA4cHgpIC8gMikgdmFyKC0tc3BhY2luZy0xLCA4cHgpICFpbXBvcnRhbnQ7XG4gIGJhY2tncm91bmQtY29sb3I6IHRyYW5zcGFyZW50O1xuICBib3JkZXItdG9wOiAxcHggc29saWQgd2hpdGU7XG4gIGJvcmRlci1ib3R0b206IDFweCBzb2xpZCB3aGl0ZTtcbn1cblxuLnRyYW5zcGFyZW50IHtcbiAgYmFja2dyb3VuZC1jb2xvcjogdHJhbnNwYXJlbnQ7XG4gIGJvcmRlcjogbm9uZTtcbiAgY29sb3I6IHdoaXRlO1xuICBwYWRkaW5nOiAwLjVyZW07XG4gIHdpZHRoOiBpbmhlcml0O1xuICBoZWlnaHQ6IDEwMCU7XG4gIHJlc2l6ZTogbm9uZTtcbn1cbi50cmFuc3BhcmVudDpmb2N1cyB7XG4gIG91dGxpbmU6IG5vbmU7XG4gIGJvcmRlcjogbm9uZTtcbn0iXX0= */";
|
|
2340
|
+
var css_248z$5 = ".TextArea-module_areaStyle__AshKi {\n background-color: var(--container-color, #ffffff);\n color: var(--on-container-color, #000);\n padding: 0.5rem;\n margin-right: calc(var(--spacing-1, 8px) / 2);\n border: 1px solid #ccc;\n border-radius: var(--border-radius-md, 6px);\n width: 98%;\n height: 100%;\n resize: none;\n}\n@media screen and (max-width: 768px) {\n .TextArea-module_areaStyle__AshKi {\n width: 90%;\n }\n}\n.TextArea-module_areaStyle__AshKi::-moz-placeholder {\n color: var(--on-container-color, #000);\n opacity: var(--text-emphasis-medium, 87%);\n}\n.TextArea-module_areaStyle__AshKi::placeholder {\n color: var(--on-container-color, #000);\n opacity: var(--text-emphasis-medium, 87%);\n}\n\n.TextArea-module_picButton__TV9ZE {\n padding: calc(var(--spacing-1, 8px) / 2) var(--spacing-1, 8px) !important;\n background-color: transparent;\n border-top: 1px solid white;\n border-bottom: 1px solid white;\n}\n\n.TextArea-module_transparent__pwXRO {\n background-color: transparent;\n border: none;\n color: white;\n padding: 0.5rem;\n width: inherit;\n height: 100%;\n resize: none;\n}\n.TextArea-module_transparent__pwXRO:focus {\n outline: none;\n border: none;\n}";
|
|
2414
2341
|
var style$1 = {"areaStyle":"TextArea-module_areaStyle__AshKi"};
|
|
2415
|
-
styleInject(css_248z$
|
|
2342
|
+
styleInject(css_248z$5);
|
|
2416
2343
|
|
|
2417
|
-
var _tmpl$$
|
|
2344
|
+
var _tmpl$$7 = /*#__PURE__*/template(`<textarea>`);
|
|
2418
2345
|
const TextArea = props => {
|
|
2419
2346
|
let myElement;
|
|
2420
2347
|
const [customProps, normalProps] = splitProps(props, ["minSize", "text", "setText", "class", "tooltip", "transparent"]);
|
|
@@ -2449,7 +2376,7 @@ const TextArea = props => {
|
|
|
2449
2376
|
}
|
|
2450
2377
|
});
|
|
2451
2378
|
return (() => {
|
|
2452
|
-
var _el$ = _tmpl$$
|
|
2379
|
+
var _el$ = _tmpl$$7();
|
|
2453
2380
|
use(el => {
|
|
2454
2381
|
myElement = el;
|
|
2455
2382
|
OnInput();
|
|
@@ -2466,7 +2393,7 @@ const TextArea = props => {
|
|
|
2466
2393
|
}
|
|
2467
2394
|
},
|
|
2468
2395
|
get placeholder() {
|
|
2469
|
-
return createMemo(() => !!(!!context.getName &&
|
|
2396
|
+
return createMemo(() => !!(!!context.getName && context.getTextInside() && !context.getFocused()))() ? context.getName() : props.placeholder;
|
|
2470
2397
|
},
|
|
2471
2398
|
get ["class"]() {
|
|
2472
2399
|
return `${style$1.areaStyle} ${customProps.class ?? ""} ${customProps.transparent ? customProps.transparent : ""}`;
|
|
@@ -2493,15 +2420,15 @@ const TextArea = props => {
|
|
|
2493
2420
|
})();
|
|
2494
2421
|
};
|
|
2495
2422
|
|
|
2496
|
-
var css_248z$
|
|
2497
|
-
var style = {"header":"expansion-module_header__eaZ-i","
|
|
2498
|
-
styleInject(css_248z$
|
|
2423
|
+
var css_248z$4 = ".expansion-module_header__eaZ-i {\n width: 100%;\n max-width: 100%;\n display: flex;\n flex-direction: row;\n height: -moz-min-content;\n height: min-content;\n text-wrap: wrap;\n}\n.expansion-module_header__eaZ-i :first-child {\n flex-grow: 1;\n}\n.expansion-module_header__eaZ-i :last-child {\n align-self: flex-end;\n padding: 10px;\n fill: var(--on-container-color, #000);\n}\n.expansion-module_header__eaZ-i button {\n height: -moz-min-content;\n height: min-content;\n background: none;\n}\n.expansion-module_header__eaZ-i button svg {\n height: 50%;\n}\n\n.expansion-module_opened__BFLJk {\n border-radius: 8px 8px 0px 0px;\n}\n\n.expansion-module_closed__VmSJ7 {\n border-radius: 4px 4px 8px 8px;\n}\n\n.expansion-module_body__OYZTn {\n display: hidden;\n max-height: 0;\n opacity: 0;\n transition: max-height 0.5s ease, opacity 0.5s ease;\n padding: calc(var(--spacing-1, 8px) - 2px);\n border-radius: 0px 0px 8px 8px;\n}\n.expansion-module_body__OYZTn :nth-child(n) {\n text-wrap: wrap !important;\n}\n\n.expansion-module_open__L1UJR {\n max-height: 800px;\n opacity: 1;\n}\n\n.expansion-module_totalPanel__o0hyd {\n max-width: 100%;\n display: flex !important;\n flex-direction: column !important;\n border-radius: 4px 4px 8px 8px;\n}\n\n.expansion-module_hover__lzPNA:hover {\n cursor: pointer;\n}\n\n.expansion-module_accent__HYwcP {\n background-color: var(--container-color, #ffffff);\n color: var(--on-container-color, #000);\n}";
|
|
2424
|
+
var style = {"header":"expansion-module_header__eaZ-i","opened":"expansion-module_opened__BFLJk","closed":"expansion-module_closed__VmSJ7","body":"expansion-module_body__OYZTn","open":"expansion-module_open__L1UJR","totalPanel":"expansion-module_totalPanel__o0hyd","hover":"expansion-module_hover__lzPNA","accent":"expansion-module_accent__HYwcP"};
|
|
2425
|
+
styleInject(css_248z$4);
|
|
2499
2426
|
|
|
2500
|
-
var _tmpl$$
|
|
2427
|
+
var _tmpl$$6 = /*#__PURE__*/template(`<svg width=46 height=44><path d="M24.15 12.7875L37.6625 25.575C39.1 26.95 39.1 29.15 37.6625 30.525C36.225 31.9 33.925 31.9 32.4875 30.525L24.15 22.6875C23.4312 22 22.425 22 21.7062 22.6875L13.3687 30.525C11.9312 31.9 9.63123 31.9 8.19373 30.525C6.75623 29.15 6.75623 26.95 8.19373 25.575L21.7062 12.7875C22.425 12.2375 23.575 12.2375 24.15 12.7875Z"stroke=white stroke-width=2 stroke-miterlimit=10 stroke-linecap=round stroke-linejoin=round>`),
|
|
2501
2428
|
_tmpl$2$2 = /*#__PURE__*/template(`<svg width=44 height=43><path d="M20.7625 31.8469L7.83752 19.35C6.46252 18.0062 6.46252 15.8562 7.83752 14.5125C9.21252 13.1687 11.4125 13.1687 12.7875 14.5125L20.7625 22.1719C21.45 22.8437 22.4125 22.8437 23.1 22.1719L31.075 14.5125C32.45 13.1687 34.65 13.1687 36.025 14.5125C37.4 15.8562 37.4 18.0062 36.025 19.35L23.1 31.8469C22.55 32.3844 21.45 32.3844 20.7625 31.8469Z"stroke=white stroke-width=2 stroke-miterlimit=10 stroke-linecap=round stroke-linejoin=round>`);
|
|
2502
2429
|
const UpArrow = props => {
|
|
2503
2430
|
return (() => {
|
|
2504
|
-
var _el$ = _tmpl$$
|
|
2431
|
+
var _el$ = _tmpl$$6();
|
|
2505
2432
|
spread(_el$, mergeProps(props, {
|
|
2506
2433
|
"viewBox": "0 0 46 44",
|
|
2507
2434
|
"fill": "none",
|
|
@@ -2522,17 +2449,17 @@ const DownArrow = props => {
|
|
|
2522
2449
|
})();
|
|
2523
2450
|
};
|
|
2524
2451
|
|
|
2525
|
-
var _tmpl$$
|
|
2526
|
-
_tmpl$2$1 = /*#__PURE__*/template(`<div><div><span>`);
|
|
2452
|
+
var _tmpl$$5 = /*#__PURE__*/template(`<div><div><span></span></div><div>`);
|
|
2527
2453
|
const ExpansionPanel = props => {
|
|
2528
2454
|
const [open, setOpen] = createSignal(!!props.startOpen);
|
|
2529
2455
|
return (() => {
|
|
2530
|
-
var _el$ = _tmpl
|
|
2456
|
+
var _el$ = _tmpl$$5(),
|
|
2531
2457
|
_el$2 = _el$.firstChild,
|
|
2532
|
-
_el$3 = _el$2.firstChild
|
|
2458
|
+
_el$3 = _el$2.firstChild,
|
|
2459
|
+
_el$4 = _el$2.nextSibling;
|
|
2533
2460
|
spread(_el$, mergeProps(props, {
|
|
2534
2461
|
get ["class"]() {
|
|
2535
|
-
return `${style.totalPanel}
|
|
2462
|
+
return `${style.totalPanel}`;
|
|
2536
2463
|
}
|
|
2537
2464
|
}), false, true);
|
|
2538
2465
|
_el$3.style.setProperty("width", "min-content");
|
|
@@ -2592,18 +2519,17 @@ const ExpansionPanel = props => {
|
|
|
2592
2519
|
})];
|
|
2593
2520
|
}
|
|
2594
2521
|
}), null);
|
|
2595
|
-
insert(_el
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
})
|
|
2606
|
-
createRenderEffect(() => className(_el$2, `${style[props.styleType ?? 'accent']} ${style.header}`));
|
|
2522
|
+
insert(_el$4, () => props.children[1]);
|
|
2523
|
+
createRenderEffect(_p$ => {
|
|
2524
|
+
var _v$ = `${style['accent']} ${style.header} ${open() ? style.opened : style.closed}`,
|
|
2525
|
+
_v$2 = `${style['accent']} ${style.body} ${open() ? style.open : ''}`;
|
|
2526
|
+
_v$ !== _p$.e && className(_el$2, _p$.e = _v$);
|
|
2527
|
+
_v$2 !== _p$.t && className(_el$4, _p$.t = _v$2);
|
|
2528
|
+
return _p$;
|
|
2529
|
+
}, {
|
|
2530
|
+
e: undefined,
|
|
2531
|
+
t: undefined
|
|
2532
|
+
});
|
|
2607
2533
|
return _el$;
|
|
2608
2534
|
})();
|
|
2609
2535
|
};
|
|
@@ -110349,82 +110275,169 @@ const Icon = props => {
|
|
|
110349
110275
|
}, others));
|
|
110350
110276
|
};
|
|
110351
110277
|
|
|
110352
|
-
|
|
110353
|
-
|
|
110354
|
-
|
|
110355
|
-
|
|
110356
|
-
|
|
110357
|
-
|
|
110358
|
-
|
|
110359
|
-
|
|
110360
|
-
|
|
110361
|
-
|
|
110362
|
-
|
|
110363
|
-
|
|
110364
|
-
|
|
110365
|
-
|
|
110366
|
-
|
|
110367
|
-
|
|
110368
|
-
|
|
110369
|
-
|
|
110370
|
-
|
|
110371
|
-
|
|
110372
|
-
|
|
110373
|
-
|
|
110374
|
-
|
|
110375
|
-
|
|
110376
|
-
|
|
110278
|
+
/**
|
|
110279
|
+
* A class that encapsulates an array of form controls along with their validation logic.
|
|
110280
|
+
*
|
|
110281
|
+
* @template T - An object type representing the shape of a single form control's value.
|
|
110282
|
+
*/
|
|
110283
|
+
class FormArray {
|
|
110284
|
+
/**
|
|
110285
|
+
* An array of array-level validators. Each validator validates the entire array of form control values.
|
|
110286
|
+
* Each element is a ValidatorResult function that returns a validation result for the entire array.
|
|
110287
|
+
*
|
|
110288
|
+
* @private
|
|
110289
|
+
*/
|
|
110290
|
+
internalArrayValidation;
|
|
110291
|
+
/**
|
|
110292
|
+
* An array of control-level validators. Each element is a tuple where the first value is not used
|
|
110293
|
+
* in this class and the second value is an array of validators that validate a single control value.
|
|
110294
|
+
*
|
|
110295
|
+
* @private
|
|
110296
|
+
*/
|
|
110297
|
+
internalValidation;
|
|
110298
|
+
/**
|
|
110299
|
+
* A function to update the current state of control-level validations.
|
|
110300
|
+
*
|
|
110301
|
+
* @private
|
|
110302
|
+
*/
|
|
110303
|
+
setValidation;
|
|
110304
|
+
/**
|
|
110305
|
+
* An array of error arrays. Each inner array holds the errors corresponding to a single form control.
|
|
110306
|
+
*
|
|
110307
|
+
* @private
|
|
110308
|
+
*/
|
|
110309
|
+
errors = [];
|
|
110310
|
+
/**
|
|
110311
|
+
* Creates an instance of FormArray.
|
|
110312
|
+
*
|
|
110313
|
+
* @param arrayValidation - A tuple where the first element is an initial array of control-level validation definitions
|
|
110314
|
+
* and the second element is an array of array-level validators.
|
|
110315
|
+
*/
|
|
110316
|
+
constructor(arrayValidation) {
|
|
110317
|
+
const [valid, setValid] = createStore(arrayValidation[0]);
|
|
110318
|
+
this.internalArrayValidation = arrayValidation[1];
|
|
110319
|
+
this.internalValidation = valid;
|
|
110320
|
+
this.setValidation = setValid;
|
|
110377
110321
|
}
|
|
110378
|
-
|
|
110379
|
-
|
|
110380
|
-
|
|
110322
|
+
/**
|
|
110323
|
+
* Removes a control's validation at the specified index.
|
|
110324
|
+
*
|
|
110325
|
+
* @param index - The index of the control to remove.
|
|
110326
|
+
*/
|
|
110327
|
+
remove(index) {
|
|
110328
|
+
this.setValidation(old => {
|
|
110329
|
+
const copy = [...old];
|
|
110330
|
+
copy.splice(index, 1);
|
|
110331
|
+
return copy;
|
|
110332
|
+
});
|
|
110381
110333
|
}
|
|
110382
|
-
|
|
110383
|
-
|
|
110334
|
+
/**
|
|
110335
|
+
* Replaces a control's validation at the specified index with a new validation.
|
|
110336
|
+
*
|
|
110337
|
+
* @param index - The index of the control to replace.
|
|
110338
|
+
* @param controlValidation - The new validation to apply for the control.
|
|
110339
|
+
*/
|
|
110340
|
+
replace(index, controlValidation) {
|
|
110341
|
+
this.setValidation(old => {
|
|
110342
|
+
const copy = [...old];
|
|
110343
|
+
copy.splice(index, 1, controlValidation);
|
|
110344
|
+
return copy;
|
|
110345
|
+
});
|
|
110384
110346
|
}
|
|
110385
|
-
|
|
110386
|
-
|
|
110347
|
+
/**
|
|
110348
|
+
* Adds a new control validation to the array.
|
|
110349
|
+
*
|
|
110350
|
+
* @param controlValidation - The validation definition to add.
|
|
110351
|
+
*/
|
|
110352
|
+
add(controlValidation) {
|
|
110353
|
+
this.setValidation(old => {
|
|
110354
|
+
return [...old, controlValidation];
|
|
110355
|
+
});
|
|
110387
110356
|
}
|
|
110388
|
-
|
|
110389
|
-
|
|
110390
|
-
|
|
110391
|
-
|
|
110392
|
-
|
|
110357
|
+
/**
|
|
110358
|
+
* Checks if any validation errors exist.
|
|
110359
|
+
*
|
|
110360
|
+
* @param index - (Optional) The index of the control to check for errors.
|
|
110361
|
+
* If not provided, it checks the entire form array.
|
|
110362
|
+
* @returns `true` if any errors are found, otherwise `false`.
|
|
110363
|
+
*/
|
|
110364
|
+
hasError(index) {
|
|
110365
|
+
if (isNullish(index)) {
|
|
110366
|
+
// Check errors for all controls if no index is provided.
|
|
110367
|
+
return this.errors.flat().some(error => error.hasError);
|
|
110368
|
+
}
|
|
110369
|
+
// Check errors for a specific control.
|
|
110370
|
+
return this.errors[index].some(error => error.hasError);
|
|
110393
110371
|
}
|
|
110394
|
-
|
|
110395
|
-
|
|
110372
|
+
/**
|
|
110373
|
+
* Checks if a specific validator error exists for a control at the given index.
|
|
110374
|
+
*
|
|
110375
|
+
* @param index - The index of the control.
|
|
110376
|
+
* @param errKey - The key identifying the specific error to check for.
|
|
110377
|
+
* @returns `true` if the specific error is present, otherwise `false`.
|
|
110378
|
+
*/
|
|
110379
|
+
hasValidator(index, errKey) {
|
|
110380
|
+
return this.errors[index].some(error => error.key === errKey);
|
|
110381
|
+
}
|
|
110382
|
+
/**
|
|
110383
|
+
* Validates the provided form control values.
|
|
110384
|
+
*
|
|
110385
|
+
* @param values - The array of form control values.
|
|
110386
|
+
* @param index - (Optional) The index of a single control to validate.
|
|
110387
|
+
* If not provided, the method validates all controls in the form array.
|
|
110388
|
+
* @returns `true` if all validations pass, otherwise `false`.
|
|
110389
|
+
*/
|
|
110390
|
+
validate(values, index) {
|
|
110391
|
+
if (isNullish(values)) {
|
|
110396
110392
|
console.error('Data is null');
|
|
110397
110393
|
return false;
|
|
110398
110394
|
}
|
|
110399
|
-
|
|
110400
|
-
|
|
110401
|
-
|
|
110402
|
-
const
|
|
110403
|
-
|
|
110404
|
-
|
|
110405
|
-
|
|
110406
|
-
|
|
110407
|
-
if (errorIndex !== -1) {
|
|
110408
|
-
this.errors[typedKey][errorIndex].hasError = !hasError;
|
|
110409
|
-
}
|
|
110410
|
-
return hasError;
|
|
110395
|
+
// Validate all controls in the form array.
|
|
110396
|
+
if (isNullish(index)) {
|
|
110397
|
+
this.errors = values.map((value, i) => {
|
|
110398
|
+
const errors = this.internalValidation.map(([_, validators]) => {
|
|
110399
|
+
return validators.map(validator => ({
|
|
110400
|
+
key: validator.errKey,
|
|
110401
|
+
hasError: !validator.revalidate(value)
|
|
110402
|
+
}));
|
|
110411
110403
|
});
|
|
110412
|
-
|
|
110404
|
+
const arrayErrors = this.internalArrayValidation.map(validator => ({
|
|
110405
|
+
key: validator.errKey,
|
|
110406
|
+
hasError: !validator.revalidate(values)
|
|
110407
|
+
}));
|
|
110408
|
+
this.errors[i] = [...errors.flat(), ...arrayErrors];
|
|
110409
|
+
return [...errors.flat(), ...arrayErrors];
|
|
110413
110410
|
});
|
|
110411
|
+
return this.errors.flat().every(error => !error.hasError);
|
|
110414
110412
|
}
|
|
110415
|
-
|
|
110416
|
-
|
|
110417
|
-
|
|
110418
|
-
|
|
110419
|
-
|
|
110420
|
-
|
|
110421
|
-
this.errors[key][errorIndex].hasError = hasError;
|
|
110422
|
-
}
|
|
110423
|
-
return !hasError;
|
|
110413
|
+
// Validate a specific control in the form array.
|
|
110414
|
+
const errors = this.internalValidation.map(([_, validators]) => {
|
|
110415
|
+
return validators.map(validator => ({
|
|
110416
|
+
key: validator.errKey,
|
|
110417
|
+
hasError: !validator.revalidate(values[index])
|
|
110418
|
+
}));
|
|
110424
110419
|
});
|
|
110420
|
+
this.errors[index] = errors.flat();
|
|
110421
|
+
return this.errors[index].every(error => !error.hasError);
|
|
110425
110422
|
}
|
|
110426
110423
|
}
|
|
110424
|
+
|
|
110425
|
+
/**
|
|
110426
|
+
* A collection of static validator functions that return a ValidatorResult.
|
|
110427
|
+
* These validators can be used to validate common conditions such as required fields,
|
|
110428
|
+
* email format, minimum/maximum length, custom patterns, and more.
|
|
110429
|
+
*/
|
|
110427
110430
|
class Validators {
|
|
110431
|
+
/**
|
|
110432
|
+
* Validates that a value is present (i.e. not null or undefined).
|
|
110433
|
+
* For strings, it checks that the trimmed string is not empty.
|
|
110434
|
+
* For arrays, it verifies that the array is not empty.
|
|
110435
|
+
*
|
|
110436
|
+
* @template T - The type of the value to validate.
|
|
110437
|
+
* @returns A ValidatorResult that includes the error key and a revalidation function.
|
|
110438
|
+
*
|
|
110439
|
+
* @private
|
|
110440
|
+
*/
|
|
110428
110441
|
static required() {
|
|
110429
110442
|
const errKey = 'required';
|
|
110430
110443
|
return this.createValidatorResult(errKey, value => {
|
|
@@ -110434,38 +110447,219 @@ class Validators {
|
|
|
110434
110447
|
return true;
|
|
110435
110448
|
});
|
|
110436
110449
|
}
|
|
110450
|
+
/**
|
|
110451
|
+
* A getter that returns the required validator.
|
|
110452
|
+
*
|
|
110453
|
+
* @returns A ValidatorResult for validating required fields.
|
|
110454
|
+
*/
|
|
110437
110455
|
static get Required() {
|
|
110438
110456
|
return Validators.required();
|
|
110439
110457
|
}
|
|
110458
|
+
/**
|
|
110459
|
+
* Validates that a string is in a valid email format.
|
|
110460
|
+
*
|
|
110461
|
+
* @returns A ValidatorResult that includes the error key and a revalidation function for email validation.
|
|
110462
|
+
*
|
|
110463
|
+
* @private
|
|
110464
|
+
*/
|
|
110440
110465
|
static email() {
|
|
110441
110466
|
const errKey = 'email';
|
|
110442
110467
|
return this.createValidatorResult(errKey, value => /^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/.test(value));
|
|
110443
110468
|
}
|
|
110469
|
+
/**
|
|
110470
|
+
* A getter that returns the email validator.
|
|
110471
|
+
*
|
|
110472
|
+
* @returns A ValidatorResult for validating email format.
|
|
110473
|
+
*/
|
|
110444
110474
|
static get Email() {
|
|
110445
110475
|
return Validators.email();
|
|
110446
110476
|
}
|
|
110477
|
+
/**
|
|
110478
|
+
* Creates a validator that checks if a value meets the minimum length requirement.
|
|
110479
|
+
*
|
|
110480
|
+
* @param length - The minimum length required.
|
|
110481
|
+
* @returns A ValidatorResult that includes the error key and a revalidation function for minimum length.
|
|
110482
|
+
*/
|
|
110447
110483
|
static minLength(length) {
|
|
110448
110484
|
const errKey = 'minLength';
|
|
110449
|
-
return this.createValidatorResult(errKey, value =>
|
|
110485
|
+
return this.createValidatorResult(errKey, value => {
|
|
110486
|
+
if (isNullish(value)) return false;
|
|
110487
|
+
return !(value.length < length);
|
|
110488
|
+
});
|
|
110450
110489
|
}
|
|
110490
|
+
/**
|
|
110491
|
+
* Creates a validator that checks if a value does not exceed the maximum length.
|
|
110492
|
+
*
|
|
110493
|
+
* @param length - The maximum allowed length.
|
|
110494
|
+
* @returns A ValidatorResult that includes the error key and a revalidation function for maximum length.
|
|
110495
|
+
*/
|
|
110451
110496
|
static maxLength(length) {
|
|
110452
110497
|
const errKey = 'maxLength';
|
|
110453
|
-
return this.createValidatorResult(errKey, value =>
|
|
110498
|
+
return this.createValidatorResult(errKey, value => {
|
|
110499
|
+
if (isNullish(value)) return false;
|
|
110500
|
+
return value.length <= length;
|
|
110501
|
+
});
|
|
110454
110502
|
}
|
|
110503
|
+
/**
|
|
110504
|
+
* Creates a validator that checks if a string matches the provided regular expression pattern.
|
|
110505
|
+
*
|
|
110506
|
+
* @param errKey - The error key to associate with this validator.
|
|
110507
|
+
* @param pattern - The regular expression pattern to test the value against.
|
|
110508
|
+
* @returns A ValidatorResult that includes the provided error key and a revalidation function.
|
|
110509
|
+
*/
|
|
110455
110510
|
static pattern(errKey, pattern) {
|
|
110456
110511
|
return this.createValidatorResult(errKey, value => pattern.test(value));
|
|
110457
110512
|
}
|
|
110458
|
-
|
|
110513
|
+
/**
|
|
110514
|
+
* Creates a custom validator with a provided validation function.
|
|
110515
|
+
*
|
|
110516
|
+
* @template T - The type of the value to validate.
|
|
110517
|
+
* @param errKey - The error key to associate with this validator.
|
|
110518
|
+
* @param validator - A function that receives a value of type T and returns a boolean indicating validity.
|
|
110519
|
+
* @returns A ValidatorResult that includes the error key and a revalidation function.
|
|
110520
|
+
*/
|
|
110521
|
+
static custom(errKey, validator, hide) {
|
|
110459
110522
|
return this.createValidatorResult(errKey, validator);
|
|
110460
110523
|
}
|
|
110461
|
-
|
|
110524
|
+
/**
|
|
110525
|
+
* A helper function that creates a ValidatorResult object.
|
|
110526
|
+
*
|
|
110527
|
+
* @template T - The type of the value to validate.
|
|
110528
|
+
* @param errKey - The error key associated with the validator.
|
|
110529
|
+
* @param revalidate - A function that revalidates a given value and returns true if valid, false otherwise.
|
|
110530
|
+
* @returns A ValidatorResult containing the error key and revalidation function.
|
|
110531
|
+
*
|
|
110532
|
+
* @private
|
|
110533
|
+
*/
|
|
110534
|
+
static createValidatorResult(errKey, revalidate, hide) {
|
|
110462
110535
|
return {
|
|
110463
110536
|
errKey,
|
|
110464
|
-
revalidate
|
|
110537
|
+
revalidate,
|
|
110538
|
+
hide
|
|
110465
110539
|
};
|
|
110466
110540
|
}
|
|
110467
110541
|
}
|
|
110468
110542
|
|
|
110543
|
+
/**
|
|
110544
|
+
* Represents a group of form controls and manages their state, validation, and errors.
|
|
110545
|
+
*
|
|
110546
|
+
* @template T - The shape of the form's data, where each property corresponds to a form control.
|
|
110547
|
+
*/
|
|
110548
|
+
class FormGroup {
|
|
110549
|
+
data;
|
|
110550
|
+
internalDataSignal;
|
|
110551
|
+
validators = {};
|
|
110552
|
+
errors;
|
|
110553
|
+
keys = [];
|
|
110554
|
+
constructor(data) {
|
|
110555
|
+
this.data = data;
|
|
110556
|
+
const newData = {};
|
|
110557
|
+
const newValidators = {};
|
|
110558
|
+
const newErrors = {};
|
|
110559
|
+
for (const key in data) {
|
|
110560
|
+
const value = data[key];
|
|
110561
|
+
this.keys.push(key);
|
|
110562
|
+
if (value instanceof FormArray) {
|
|
110563
|
+
// If the value is a FormArray, store it directly.
|
|
110564
|
+
newData[key] = value;
|
|
110565
|
+
} else {
|
|
110566
|
+
// Otherwise, initialize the data, validators, and errors for the control.
|
|
110567
|
+
newData[key] = value[0];
|
|
110568
|
+
newValidators[key] = value[1];
|
|
110569
|
+
newErrors[key] = value[1].map(validator => ({
|
|
110570
|
+
key: validator.errKey,
|
|
110571
|
+
hasError: false
|
|
110572
|
+
}));
|
|
110573
|
+
}
|
|
110574
|
+
}
|
|
110575
|
+
this.internalDataSignal = createStore(newData);
|
|
110576
|
+
this.validators = newValidators;
|
|
110577
|
+
this.errors = createSignal(newErrors);
|
|
110578
|
+
}
|
|
110579
|
+
get(key) {
|
|
110580
|
+
if (!key) return Clone(this.internalDataSignal[0]);
|
|
110581
|
+
return Clone(this.internalDataSignal[0][key]);
|
|
110582
|
+
}
|
|
110583
|
+
/**
|
|
110584
|
+
* Checks whether a specific validator error exists for a given control.
|
|
110585
|
+
*
|
|
110586
|
+
* @param key - The key of the form control.
|
|
110587
|
+
* @param errKey - The error key to check for.
|
|
110588
|
+
* @returns `true` if the error exists, otherwise `false`.
|
|
110589
|
+
*/
|
|
110590
|
+
hasValidator(key, errKey) {
|
|
110591
|
+
return this.errors[0]()?.[key]?.some(error => error.key === errKey);
|
|
110592
|
+
}
|
|
110593
|
+
getErrors(key) {
|
|
110594
|
+
return this.errors[0]()?.[key];
|
|
110595
|
+
}
|
|
110596
|
+
/**
|
|
110597
|
+
* Determines if a specific control has any validation errors.
|
|
110598
|
+
*
|
|
110599
|
+
* @param key - The key of the form control.
|
|
110600
|
+
* @returns `true` if any error is present, otherwise `false`.
|
|
110601
|
+
*/
|
|
110602
|
+
hasError(key) {
|
|
110603
|
+
return this.errors[0]()?.[key]?.some(error => error.hasError);
|
|
110604
|
+
}
|
|
110605
|
+
setError(key, errKey, hasError) {
|
|
110606
|
+
const errorIndex = this.errors[0]()[key].findIndex(error => error.key === errKey);
|
|
110607
|
+
if (errorIndex !== -1) {
|
|
110608
|
+
this.errors[1](old => {
|
|
110609
|
+
old[key][errorIndex].hasError = hasError;
|
|
110610
|
+
return Clone(old);
|
|
110611
|
+
});
|
|
110612
|
+
}
|
|
110613
|
+
}
|
|
110614
|
+
/**
|
|
110615
|
+
* Sets a new value for a specified form control.
|
|
110616
|
+
*
|
|
110617
|
+
* @param key - The key of the form control to update.
|
|
110618
|
+
* @param value - The new value to assign to the control.
|
|
110619
|
+
*/
|
|
110620
|
+
set(key, value) {
|
|
110621
|
+
this.internalDataSignal[1](old => ({
|
|
110622
|
+
...old,
|
|
110623
|
+
[key]: value
|
|
110624
|
+
}));
|
|
110625
|
+
}
|
|
110626
|
+
/**
|
|
110627
|
+
* Validates the form data.
|
|
110628
|
+
*
|
|
110629
|
+
* If a key is provided, only that control is validated. If no key is provided, the entire form is validated.
|
|
110630
|
+
*
|
|
110631
|
+
* @param key - (Optional) The key of the control to validate.
|
|
110632
|
+
* @returns `true` if the control(s) pass all validations; otherwise, `false`.
|
|
110633
|
+
*/
|
|
110634
|
+
validate(key) {
|
|
110635
|
+
if (isNullish(this.internalDataSignal?.[0])) {
|
|
110636
|
+
console.error('Data is null');
|
|
110637
|
+
return false;
|
|
110638
|
+
}
|
|
110639
|
+
// Validate all controls if no key is specified.
|
|
110640
|
+
if (!key) {
|
|
110641
|
+
const results = this.keys.map(key => this.validate(key));
|
|
110642
|
+
return results.every(result => result);
|
|
110643
|
+
}
|
|
110644
|
+
// For a specific control key, handle FormArray differently.
|
|
110645
|
+
if (this.internalDataSignal[0][key] instanceof FormArray) {
|
|
110646
|
+
return this.internalDataSignal[0][key].validate(this.internalDataSignal[0][key].get());
|
|
110647
|
+
}
|
|
110648
|
+
const validators = this.validators[key];
|
|
110649
|
+
if (!validators) return true;
|
|
110650
|
+
return !validators.map(validator => {
|
|
110651
|
+
const hasError = !validator.revalidate(this.internalDataSignal[0][key]);
|
|
110652
|
+
const toHide = validator.hide?.(this.internalDataSignal[0][key]);
|
|
110653
|
+
if (toHide) {
|
|
110654
|
+
this.setError(key, validator.errKey, false);
|
|
110655
|
+
return true;
|
|
110656
|
+
}
|
|
110657
|
+
this.setError(key, validator.errKey, hasError);
|
|
110658
|
+
return !hasError;
|
|
110659
|
+
}).includes(false);
|
|
110660
|
+
}
|
|
110661
|
+
}
|
|
110662
|
+
|
|
110469
110663
|
function createTableContext() {
|
|
110470
110664
|
return createContext({});
|
|
110471
110665
|
}
|
|
@@ -110491,8 +110685,7 @@ const ColumnProvider = props => {
|
|
|
110491
110685
|
return createComponent(ColumnContext.Provider, {
|
|
110492
110686
|
get value() {
|
|
110493
110687
|
return {
|
|
110494
|
-
name: props.name
|
|
110495
|
-
rowNumber: props.rowNumber
|
|
110688
|
+
name: props.name
|
|
110496
110689
|
};
|
|
110497
110690
|
},
|
|
110498
110691
|
get children() {
|
|
@@ -110504,21 +110697,25 @@ const useColumnContext = () => {
|
|
|
110504
110697
|
return useContext(ColumnContext);
|
|
110505
110698
|
};
|
|
110506
110699
|
|
|
110507
|
-
var css_248z = ".table-module_table__um-mK {\n border-collapse: collapse;\n
|
|
110508
|
-
var styles = {"table":"table-module_table__um-mK"};
|
|
110509
|
-
styleInject(css_248z);
|
|
110700
|
+
var css_248z$3 = ".table-module_table__um-mK {\n border-collapse: collapse;\n text-align: center;\n}\n.table-module_table__um-mK thead tr th {\n padding: 0.5rem;\n}\n.table-module_table__um-mK tr td {\n padding: 0.5rem;\n width: -moz-max-content;\n width: max-content;\n}";
|
|
110701
|
+
var styles$3 = {"table":"table-module_table__um-mK"};
|
|
110702
|
+
styleInject(css_248z$3);
|
|
110510
110703
|
|
|
110511
|
-
var _tmpl
|
|
110512
|
-
_tmpl$2 = /*#__PURE__*/template(`<col>`),
|
|
110513
|
-
_tmpl$3 = /*#__PURE__*/template(`<tr>`),
|
|
110704
|
+
var _tmpl$$4 = /*#__PURE__*/template(`<table><colgroup></colgroup><thead></thead><tbody></tbody><tfoot>`),
|
|
110705
|
+
_tmpl$2$1 = /*#__PURE__*/template(`<col>`),
|
|
110706
|
+
_tmpl$3$1 = /*#__PURE__*/template(`<tr>`),
|
|
110514
110707
|
_tmpl$4 = /*#__PURE__*/template(`<th>`),
|
|
110515
110708
|
_tmpl$5 = /*#__PURE__*/template(`<td>`);
|
|
110516
110709
|
const Table = props => {
|
|
110517
110710
|
const formContext = useFormContext();
|
|
110518
110711
|
const tableContext = {};
|
|
110519
|
-
|
|
110712
|
+
const getProps = () => props;
|
|
110713
|
+
// const internalData = (() => {
|
|
110714
|
+
// return props.data();
|
|
110715
|
+
// });
|
|
110716
|
+
// tableContext.getDataSource = () => props.data();
|
|
110520
110717
|
tableContext.setDataSource = data => {
|
|
110521
|
-
|
|
110718
|
+
getProps().setData?.(() => [...data]);
|
|
110522
110719
|
formContext.setData(data);
|
|
110523
110720
|
};
|
|
110524
110721
|
const [headers, setHeaders] = createSignal({});
|
|
@@ -110638,25 +110835,25 @@ const Table = props => {
|
|
|
110638
110835
|
return createComponent(TableProvider, mergeProps(tableContext, {
|
|
110639
110836
|
get children() {
|
|
110640
110837
|
return [(() => {
|
|
110641
|
-
var _el$ = _tmpl
|
|
110838
|
+
var _el$ = _tmpl$$4(),
|
|
110642
110839
|
_el$2 = _el$.firstChild,
|
|
110643
110840
|
_el$3 = _el$2.nextSibling,
|
|
110644
110841
|
_el$4 = _el$3.nextSibling,
|
|
110645
110842
|
_el$5 = _el$4.nextSibling;
|
|
110646
|
-
spread(_el$2, mergeProps(() =>
|
|
110843
|
+
spread(_el$2, mergeProps(() => getProps()?.otherStyles?.colGroup?.all, {
|
|
110647
110844
|
get style() {
|
|
110648
|
-
return
|
|
110845
|
+
return getProps().otherStyles?.colGroup?.style;
|
|
110649
110846
|
},
|
|
110650
110847
|
get ["class"]() {
|
|
110651
|
-
return
|
|
110848
|
+
return getProps().otherStyles?.colGroup?.class;
|
|
110652
110849
|
}
|
|
110653
110850
|
}), false, true);
|
|
110654
110851
|
insert(_el$2, createComponent(For, {
|
|
110655
110852
|
get each() {
|
|
110656
|
-
return
|
|
110853
|
+
return getProps().columns;
|
|
110657
110854
|
},
|
|
110658
110855
|
children: column => (() => {
|
|
110659
|
-
var _el$6 = _tmpl$2();
|
|
110856
|
+
var _el$6 = _tmpl$2$1();
|
|
110660
110857
|
spread(_el$6, mergeProps(() => columnStyle()[column]?.all, {
|
|
110661
110858
|
get style() {
|
|
110662
110859
|
return columnStyle()[column]?.style;
|
|
@@ -110668,12 +110865,12 @@ const Table = props => {
|
|
|
110668
110865
|
return _el$6;
|
|
110669
110866
|
})()
|
|
110670
110867
|
}));
|
|
110671
|
-
spread(_el$3, mergeProps(() =>
|
|
110868
|
+
spread(_el$3, mergeProps(() => getProps()?.otherStyles?.thead?.all, {
|
|
110672
110869
|
get style() {
|
|
110673
|
-
return
|
|
110870
|
+
return getProps().otherStyles?.thead?.style;
|
|
110674
110871
|
},
|
|
110675
110872
|
get ["class"]() {
|
|
110676
|
-
return
|
|
110873
|
+
return getProps().otherStyles?.thead?.class;
|
|
110677
110874
|
}
|
|
110678
110875
|
}), false, true);
|
|
110679
110876
|
insert(_el$3, createComponent(For, {
|
|
@@ -110682,10 +110879,10 @@ const Table = props => {
|
|
|
110682
110879
|
},
|
|
110683
110880
|
children: rowNum => {
|
|
110684
110881
|
return (() => {
|
|
110685
|
-
var _el$7 = _tmpl$3();
|
|
110882
|
+
var _el$7 = _tmpl$3$1();
|
|
110686
110883
|
insert(_el$7, createComponent(For, {
|
|
110687
110884
|
get each() {
|
|
110688
|
-
return
|
|
110885
|
+
return getProps().columns;
|
|
110689
110886
|
},
|
|
110690
110887
|
children: (column, index) => {
|
|
110691
110888
|
const headCell = headers()[rowNum]?.[column];
|
|
@@ -110707,7 +110904,7 @@ const Table = props => {
|
|
|
110707
110904
|
createRenderEffect(_p$ => {
|
|
110708
110905
|
var _v$4 = headerRowStyle()[rowNum]?.style,
|
|
110709
110906
|
_v$5 = headerRowStyle()[rowNum]?.class;
|
|
110710
|
-
_p$.e = style$
|
|
110907
|
+
_p$.e = style$9(_el$7, _v$4, _p$.e);
|
|
110711
110908
|
_v$5 !== _p$.t && className(_el$7, _p$.t = _v$5);
|
|
110712
110909
|
return _p$;
|
|
110713
110910
|
}, {
|
|
@@ -110718,17 +110915,17 @@ const Table = props => {
|
|
|
110718
110915
|
})();
|
|
110719
110916
|
}
|
|
110720
110917
|
}));
|
|
110721
|
-
spread(_el$4, mergeProps(() =>
|
|
110918
|
+
spread(_el$4, mergeProps(() => getProps()?.otherStyles?.tbody?.all, {
|
|
110722
110919
|
get style() {
|
|
110723
|
-
return
|
|
110920
|
+
return getProps().otherStyles?.tbody?.style;
|
|
110724
110921
|
},
|
|
110725
110922
|
get ["class"]() {
|
|
110726
|
-
return
|
|
110923
|
+
return getProps().otherStyles?.tbody?.class;
|
|
110727
110924
|
}
|
|
110728
110925
|
}), false, true);
|
|
110729
110926
|
insert(_el$4, createComponent(For, {
|
|
110730
110927
|
get each() {
|
|
110731
|
-
return
|
|
110928
|
+
return getProps().data();
|
|
110732
110929
|
},
|
|
110733
110930
|
children: (item, index) => createComponent(For, {
|
|
110734
110931
|
get each() {
|
|
@@ -110736,7 +110933,7 @@ const Table = props => {
|
|
|
110736
110933
|
},
|
|
110737
110934
|
children: rowNum => {
|
|
110738
110935
|
return (() => {
|
|
110739
|
-
var _el$9 = _tmpl$3();
|
|
110936
|
+
var _el$9 = _tmpl$3$1();
|
|
110740
110937
|
spread(_el$9, mergeProps(() => rowStyleFactory(rowNum)?.all, {
|
|
110741
110938
|
get style() {
|
|
110742
110939
|
return rowStyleFactory(rowNum)?.style;
|
|
@@ -110747,11 +110944,10 @@ const Table = props => {
|
|
|
110747
110944
|
}), false, true);
|
|
110748
110945
|
insert(_el$9, createComponent(For, {
|
|
110749
110946
|
get each() {
|
|
110750
|
-
return
|
|
110947
|
+
return getProps().columns;
|
|
110751
110948
|
},
|
|
110752
110949
|
children: column => {
|
|
110753
110950
|
const cell = rows()[rowNum]?.[column];
|
|
110754
|
-
// @ts-ignore
|
|
110755
110951
|
return !!cell ? (() => {
|
|
110756
110952
|
var _el$10 = _tmpl$5();
|
|
110757
110953
|
spread(_el$10, mergeProps(() => cellStyle?.()?.[rowNum]?.[column]?.all, {
|
|
@@ -110772,12 +110968,12 @@ const Table = props => {
|
|
|
110772
110968
|
}
|
|
110773
110969
|
})
|
|
110774
110970
|
}));
|
|
110775
|
-
spread(_el$5, mergeProps(() =>
|
|
110971
|
+
spread(_el$5, mergeProps(() => getProps()?.otherStyles?.tfoot?.all, {
|
|
110776
110972
|
get style() {
|
|
110777
|
-
return
|
|
110973
|
+
return getProps().otherStyles?.tfoot?.style;
|
|
110778
110974
|
},
|
|
110779
110975
|
get ["class"]() {
|
|
110780
|
-
return
|
|
110976
|
+
return getProps().otherStyles?.tfoot?.class;
|
|
110781
110977
|
}
|
|
110782
110978
|
}), false, true);
|
|
110783
110979
|
insert(_el$5, createComponent(For, {
|
|
@@ -110786,7 +110982,7 @@ const Table = props => {
|
|
|
110786
110982
|
},
|
|
110787
110983
|
children: rowNum => {
|
|
110788
110984
|
return (() => {
|
|
110789
|
-
var _el$11 = _tmpl$3();
|
|
110985
|
+
var _el$11 = _tmpl$3$1();
|
|
110790
110986
|
spread(_el$11, mergeProps(() => footerStyle()[rowNum]?.all, {
|
|
110791
110987
|
get style() {
|
|
110792
110988
|
return footerStyle()[rowNum]?.style;
|
|
@@ -110797,7 +110993,7 @@ const Table = props => {
|
|
|
110797
110993
|
}), false, true);
|
|
110798
110994
|
insert(_el$11, createComponent(For, {
|
|
110799
110995
|
get each() {
|
|
110800
|
-
return
|
|
110996
|
+
return getProps().columns;
|
|
110801
110997
|
},
|
|
110802
110998
|
children: column => {
|
|
110803
110999
|
const footCell = footerCell()[rowNum]?.[column];
|
|
@@ -110821,12 +111017,12 @@ const Table = props => {
|
|
|
110821
111017
|
}
|
|
110822
111018
|
}));
|
|
110823
111019
|
createRenderEffect(_p$ => {
|
|
110824
|
-
var _v$ =
|
|
110825
|
-
_v$2 = `${styles.table} ${
|
|
110826
|
-
_v$3 =
|
|
111020
|
+
var _v$ = getProps().id,
|
|
111021
|
+
_v$2 = `${styles$3.table} ${getProps().class}`,
|
|
111022
|
+
_v$3 = getProps().style;
|
|
110827
111023
|
_v$ !== _p$.e && setAttribute(_el$, "id", _p$.e = _v$);
|
|
110828
111024
|
_v$2 !== _p$.t && className(_el$, _p$.t = _v$2);
|
|
110829
|
-
_p$.a = style$
|
|
111025
|
+
_p$.a = style$9(_el$, _v$3, _p$.a);
|
|
110830
111026
|
return _p$;
|
|
110831
111027
|
}, {
|
|
110832
111028
|
e: undefined,
|
|
@@ -110849,21 +111045,21 @@ const Row = props => {
|
|
|
110849
111045
|
createEffect(() => {
|
|
110850
111046
|
switch (true) {
|
|
110851
111047
|
case props.header === true || Object.keys(props).includes('header') && props.header !== false:
|
|
110852
|
-
tableContext
|
|
111048
|
+
tableContext?.addHeaderRowStyle?.(rowNumber, {
|
|
110853
111049
|
class: local.class,
|
|
110854
111050
|
style: local.style,
|
|
110855
111051
|
all: others
|
|
110856
111052
|
});
|
|
110857
111053
|
break;
|
|
110858
111054
|
case props.footer === true || Object.keys(props).includes('footer') && props.footer !== false:
|
|
110859
|
-
tableContext
|
|
111055
|
+
tableContext?.addFooterRowStyle?.(rowNumber, {
|
|
110860
111056
|
class: local.class,
|
|
110861
111057
|
style: local.style,
|
|
110862
111058
|
all: others
|
|
110863
111059
|
});
|
|
110864
111060
|
break;
|
|
110865
111061
|
default:
|
|
110866
|
-
tableContext
|
|
111062
|
+
tableContext?.addRowStyle?.(rowNumber, {
|
|
110867
111063
|
class: local.class,
|
|
110868
111064
|
style: local.style,
|
|
110869
111065
|
all: others
|
|
@@ -110875,13 +111071,12 @@ const Row = props => {
|
|
|
110875
111071
|
};
|
|
110876
111072
|
|
|
110877
111073
|
const Column = props => {
|
|
110878
|
-
const
|
|
110879
|
-
|
|
110880
|
-
|
|
110881
|
-
}
|
|
111074
|
+
const {
|
|
111075
|
+
addColumnStyle
|
|
111076
|
+
} = useTableContext();
|
|
110882
111077
|
const [local, others] = splitProps(props, ["name", "rowNumber", "children", "class", "style"]);
|
|
110883
111078
|
createEffect(() => {
|
|
110884
|
-
|
|
111079
|
+
addColumnStyle?.(local.name, {
|
|
110885
111080
|
class: local.class,
|
|
110886
111081
|
style: local.style,
|
|
110887
111082
|
all: others
|
|
@@ -110891,9 +111086,6 @@ const Column = props => {
|
|
|
110891
111086
|
get name() {
|
|
110892
111087
|
return props?.name ?? ``;
|
|
110893
111088
|
},
|
|
110894
|
-
get rowNumber() {
|
|
110895
|
-
return props?.rowNumber ?? 1;
|
|
110896
|
-
},
|
|
110897
111089
|
get children() {
|
|
110898
111090
|
return props.children;
|
|
110899
111091
|
}
|
|
@@ -110901,23 +111093,27 @@ const Column = props => {
|
|
|
110901
111093
|
};
|
|
110902
111094
|
|
|
110903
111095
|
const Cell = props => {
|
|
110904
|
-
const
|
|
110905
|
-
|
|
110906
|
-
|
|
110907
|
-
|
|
110908
|
-
|
|
110909
|
-
|
|
111096
|
+
const {
|
|
111097
|
+
name
|
|
111098
|
+
} = useColumnContext();
|
|
111099
|
+
const {
|
|
111100
|
+
addFooterCell,
|
|
111101
|
+
addFootCellStyle,
|
|
111102
|
+
addRowCell,
|
|
111103
|
+
addCellStyle
|
|
111104
|
+
} = useTableContext();
|
|
111105
|
+
const [local, others] = splitProps(props, ["children", "class", "style", "footer", "rowNumber"]);
|
|
110910
111106
|
createEffect(() => {
|
|
110911
111107
|
if (Object.keys(props).includes('footer') && props.footer !== false) {
|
|
110912
|
-
|
|
110913
|
-
|
|
111108
|
+
addFooterCell?.((local?.rowNumber ?? 1) - 1, name, local.children);
|
|
111109
|
+
addFootCellStyle?.((local?.rowNumber ?? 1) - 1, name, {
|
|
110914
111110
|
class: local.class,
|
|
110915
111111
|
style: local.style,
|
|
110916
111112
|
all: others
|
|
110917
111113
|
});
|
|
110918
111114
|
} else {
|
|
110919
|
-
|
|
110920
|
-
|
|
111115
|
+
addRowCell?.((local?.rowNumber ?? 1) - 1, name, local.children);
|
|
111116
|
+
addCellStyle?.((local?.rowNumber ?? 1) - 1, name, {
|
|
110921
111117
|
class: local.class,
|
|
110922
111118
|
style: local.style,
|
|
110923
111119
|
all: others
|
|
@@ -110936,10 +111132,10 @@ const Header = props => {
|
|
|
110936
111132
|
if (isNullish(columnInfo)) {
|
|
110937
111133
|
throw new Error("Header must be wrapped in a Column");
|
|
110938
111134
|
}
|
|
110939
|
-
const [local, others] = splitProps(props, ["children", "class", "style"]);
|
|
111135
|
+
const [local, others] = splitProps(props, ["children", "class", "style", "rowNumber"]);
|
|
110940
111136
|
createEffect(() => {
|
|
110941
|
-
tableContext
|
|
110942
|
-
tableContext
|
|
111137
|
+
tableContext?.addHeaderCell?.(columnInfo.name, (props?.rowNumber ?? 1) - 1, local.children);
|
|
111138
|
+
tableContext?.addHeaderStyle?.(columnInfo.name, (props?.rowNumber ?? 1) - 1, {
|
|
110943
111139
|
class: local.class,
|
|
110944
111140
|
style: local.style,
|
|
110945
111141
|
all: others
|
|
@@ -110948,4 +111144,258 @@ const Header = props => {
|
|
|
110948
111144
|
return [];
|
|
110949
111145
|
};
|
|
110950
111146
|
|
|
110951
|
-
|
|
111147
|
+
var css_248z$2 = "/* TabBar.module.scss */\n.tabs-module_tabBarContainer__9ZZz8 {\n display: flex;\n flex-direction: column;\n margin-bottom: 8px;\n background-color: inherit;\n color: inherit;\n border-radius: 8px;\n}\n\n.tabs-module_end__Nzyvl, .tabs-module_stretch__dMuvv, .tabs-module_center__TTX82, .tabs-module_start__DOlNm {\n position: relative;\n display: flex;\n align-items: center;\n}\n\n.tabs-module_start__DOlNm {\n justify-content: flex-start;\n}\n\n.tabs-module_center__TTX82 {\n justify-content: center;\n}\n\n.tabs-module_stretch__dMuvv button {\n flex-grow: 1;\n}\n\n.tabs-module_end__Nzyvl {\n justify-content: flex-end;\n}\n\n.tabs-module_tabButton__U8x7L {\n background: none;\n border: none;\n padding: 8px 16px;\n cursor: pointer;\n color: inherit;\n font-size: 14px;\n position: relative;\n border-radius: 8px;\n}\n\n.tabs-module_active__Cdyyt {\n font-weight: bold;\n opacity: var(--text-emphasis-high, 100%);\n}\n\n.tabs-module_inactive__NisIK {\n opacity: var(--text-emphasis-medium, 87%);\n}\n\n.tabs-module_indicator__-IbxY {\n position: absolute;\n bottom: 0;\n left: 0;\n height: 3px;\n background-color: var(--secondary-color, #14b9c3);\n transition: transform 0.5s ease, width 0.5s ease; /* smooth animation */\n border-radius: 16px;\n z-index: 2;\n}\n\n.tabs-module_barRail__-dfNh {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 3px;\n background-color: #ccc;\n border-radius: 4px;\n z-index: 1;\n}";
|
|
111148
|
+
var styles$2 = {"tabBarContainer":"tabs-module_tabBarContainer__9ZZz8","end":"tabs-module_end__Nzyvl","stretch":"tabs-module_stretch__dMuvv","center":"tabs-module_center__TTX82","start":"tabs-module_start__DOlNm","tabButton":"tabs-module_tabButton__U8x7L","active":"tabs-module_active__Cdyyt","inactive":"tabs-module_inactive__NisIK","indicator":"tabs-module_indicator__-IbxY","barRail":"tabs-module_barRail__-dfNh"};
|
|
111149
|
+
styleInject(css_248z$2);
|
|
111150
|
+
|
|
111151
|
+
var _tmpl$$3 = /*#__PURE__*/template(`<div>`),
|
|
111152
|
+
_tmpl$2 = /*#__PURE__*/template(`<div><div><div>`),
|
|
111153
|
+
_tmpl$3 = /*#__PURE__*/template(`<button>`);
|
|
111154
|
+
const TabBar = props => {
|
|
111155
|
+
// Refs to each tab button element for measuring position/width
|
|
111156
|
+
let tabRefs = [];
|
|
111157
|
+
// Signal to hold the dynamic style for the indicator (left offset and width)
|
|
111158
|
+
const [indicatorStyle, setIndicatorStyle] = createSignal({});
|
|
111159
|
+
const noRail = createMemo(() => {
|
|
111160
|
+
if (Object.keys(props).includes("noRail") && props.noRail !== false) {
|
|
111161
|
+
return true;
|
|
111162
|
+
}
|
|
111163
|
+
return false;
|
|
111164
|
+
});
|
|
111165
|
+
// Effect: update indicator position & width whenever activeTab changes
|
|
111166
|
+
createEffect(() => {
|
|
111167
|
+
const currentIndex = props.activeTab;
|
|
111168
|
+
const tabEl = tabRefs[currentIndex];
|
|
111169
|
+
if (tabEl) {
|
|
111170
|
+
const offsetLeft = tabEl.offsetLeft;
|
|
111171
|
+
const tabWidth = tabEl.offsetWidth;
|
|
111172
|
+
tabEl.style;
|
|
111173
|
+
setIndicatorStyle({
|
|
111174
|
+
width: `${tabWidth}px`,
|
|
111175
|
+
transform: `translateX(${offsetLeft}px)`
|
|
111176
|
+
});
|
|
111177
|
+
}
|
|
111178
|
+
});
|
|
111179
|
+
const getPosition = createMemo(() => {
|
|
111180
|
+
switch (props?.tabPosition) {
|
|
111181
|
+
case "center":
|
|
111182
|
+
return styles$2.center;
|
|
111183
|
+
case "end":
|
|
111184
|
+
return styles$2.end;
|
|
111185
|
+
case "start":
|
|
111186
|
+
return styles$2.start;
|
|
111187
|
+
default:
|
|
111188
|
+
return styles$2.stretch;
|
|
111189
|
+
}
|
|
111190
|
+
});
|
|
111191
|
+
// Prepare style objects for container and indicator based on props (for customization)
|
|
111192
|
+
const containerStyle = {
|
|
111193
|
+
...(props.colors?.background ? {
|
|
111194
|
+
background: props.colors.background
|
|
111195
|
+
} : {}),
|
|
111196
|
+
...(props.size?.height ? {
|
|
111197
|
+
height: props.size.height
|
|
111198
|
+
} : {})
|
|
111199
|
+
};
|
|
111200
|
+
const indicatorBaseStyle = {
|
|
111201
|
+
...(props.colors?.indicator ? {
|
|
111202
|
+
"background-color": props.colors.indicator
|
|
111203
|
+
} : {}),
|
|
111204
|
+
...(props.size?.indicatorHeight ? {
|
|
111205
|
+
height: props.size.indicatorHeight
|
|
111206
|
+
} : {}),
|
|
111207
|
+
// Apply custom transition timing if provided, otherwise use default from CSS
|
|
111208
|
+
...(props.animationTiming ? {
|
|
111209
|
+
transition: `transform ${props.animationTiming}, width ${props.animationTiming}`
|
|
111210
|
+
} : {})
|
|
111211
|
+
};
|
|
111212
|
+
const isActive = index => index === props.activeTab;
|
|
111213
|
+
const isActiveClass = index => isActive(index) ? styles$2.active : '';
|
|
111214
|
+
return (() => {
|
|
111215
|
+
var _el$ = _tmpl$2(),
|
|
111216
|
+
_el$2 = _el$.firstChild,
|
|
111217
|
+
_el$4 = _el$2.firstChild;
|
|
111218
|
+
insert(_el$2, createComponent(For, {
|
|
111219
|
+
get each() {
|
|
111220
|
+
return props.tabs;
|
|
111221
|
+
},
|
|
111222
|
+
children: (label, index) => (() => {
|
|
111223
|
+
var _el$5 = _tmpl$3();
|
|
111224
|
+
_el$5.$$click = () => props.onTabChange?.(label, index());
|
|
111225
|
+
use(el => tabRefs[index()] = el, _el$5);
|
|
111226
|
+
insert(_el$5, label);
|
|
111227
|
+
createRenderEffect(_p$ => {
|
|
111228
|
+
var _v$6 = {
|
|
111229
|
+
[styles$2.tabButton]: true,
|
|
111230
|
+
[styles$2.active]: index() === props.activeTab,
|
|
111231
|
+
[styles$2.inactive]: index() !== props.activeTab
|
|
111232
|
+
},
|
|
111233
|
+
_v$7 = {
|
|
111234
|
+
...(props.size?.fontSize ? {
|
|
111235
|
+
"font-size": props.size.fontSize
|
|
111236
|
+
} : {}),
|
|
111237
|
+
...(props.colors?.text ? {
|
|
111238
|
+
color: props.colors.text
|
|
111239
|
+
} : {}),
|
|
111240
|
+
...(props.colors?.activeText && isActive(index()) ? {
|
|
111241
|
+
color: props.colors.activeText
|
|
111242
|
+
} : {})
|
|
111243
|
+
};
|
|
111244
|
+
_p$.e = classList(_el$5, _v$6, _p$.e);
|
|
111245
|
+
_p$.t = style$9(_el$5, _v$7, _p$.t);
|
|
111246
|
+
return _p$;
|
|
111247
|
+
}, {
|
|
111248
|
+
e: undefined,
|
|
111249
|
+
t: undefined
|
|
111250
|
+
});
|
|
111251
|
+
return _el$5;
|
|
111252
|
+
})()
|
|
111253
|
+
}), _el$4);
|
|
111254
|
+
insert(_el$2, createComponent(Show, {
|
|
111255
|
+
get when() {
|
|
111256
|
+
return !noRail();
|
|
111257
|
+
},
|
|
111258
|
+
get children() {
|
|
111259
|
+
var _el$3 = _tmpl$$3();
|
|
111260
|
+
createRenderEffect(() => className(_el$3, styles$2.barRail));
|
|
111261
|
+
return _el$3;
|
|
111262
|
+
}
|
|
111263
|
+
}), _el$4);
|
|
111264
|
+
createRenderEffect(_p$ => {
|
|
111265
|
+
var _v$ = styles$2.tabBarContainer,
|
|
111266
|
+
_v$2 = containerStyle,
|
|
111267
|
+
_v$3 = `${getPosition()} ${props?.class ?? ''}`,
|
|
111268
|
+
_v$4 = `${styles$2.indicator} ${props.indicatorClass} ${isActiveClass(props.activeTab)}`,
|
|
111269
|
+
_v$5 = {
|
|
111270
|
+
...indicatorBaseStyle,
|
|
111271
|
+
...indicatorStyle()
|
|
111272
|
+
};
|
|
111273
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
111274
|
+
_p$.t = style$9(_el$, _v$2, _p$.t);
|
|
111275
|
+
_v$3 !== _p$.a && className(_el$2, _p$.a = _v$3);
|
|
111276
|
+
_v$4 !== _p$.o && className(_el$4, _p$.o = _v$4);
|
|
111277
|
+
_p$.i = style$9(_el$4, _v$5, _p$.i);
|
|
111278
|
+
return _p$;
|
|
111279
|
+
}, {
|
|
111280
|
+
e: undefined,
|
|
111281
|
+
t: undefined,
|
|
111282
|
+
a: undefined,
|
|
111283
|
+
o: undefined,
|
|
111284
|
+
i: undefined
|
|
111285
|
+
});
|
|
111286
|
+
return _el$;
|
|
111287
|
+
})();
|
|
111288
|
+
};
|
|
111289
|
+
delegateEvents(["click"]);
|
|
111290
|
+
|
|
111291
|
+
var css_248z$1 = ".container-module_primary__EvZuR {\n background-color: var(--primary-color, #4CAF50);\n color: var(--on-primary-color, #fff);\n}\n\n.container-module_primaryVariant__lC3Dg {\n background-color: var(--primary-color-varient, #43A047);\n color: var(--on-primary-color, #fff);\n}\n\n.container-module_secondary__-ywDW {\n background-color: var(--secondary-color, #14b9c3);\n color: var(--on-secondary-color, #000000);\n}\n\n.container-module_secondaryVariant__E7Gxe {\n background-color: var(--secondary-color-varient, #0b969f);\n color: var(--on-secondary-color, #000000);\n}\n\n.container-module_background__TT8pn {\n background-color: var(--background-color, #ffffff);\n color: var(--on-background-color, #000000);\n}\n\n.container-module_surface__59oDI {\n background-color: var(--surface-color, #EEEEEE);\n color: var(--on-surface-color, #000000);\n}\n\n.container-module_surfaceVariant__S9Pyg {\n background-color: var(--surface-color-variant, #ccc);\n color: var(--on-surface-color, #000000);\n}\n\n.container-module_container__Xfc8t {\n background-color: var(--container-color, #ffffff);\n color: var(--on-container-color, #000);\n}\n\n.container-module_error__anU8a {\n background-color: var(--error-color, #B00020);\n color: var(--on-error-color, #ffffff);\n}\n\n.container-module_header__2SLww {\n background-color: var(--header-background-color, #2E7D32);\n color: var(--header-on-background-color, #fff);\n height: 50px;\n}\n\n.container-module_subheader__Y2LUC {\n background-color: var(--subheader-background-color, #388E3C);\n color: var(--subheader-on-background-color, #fff);\n height: 38px;\n}";
|
|
111292
|
+
var styles$1 = {"primary":"container-module_primary__EvZuR","primaryVariant":"container-module_primaryVariant__lC3Dg","secondary":"container-module_secondary__-ywDW","secondaryVariant":"container-module_secondaryVariant__E7Gxe","background":"container-module_background__TT8pn","surface":"container-module_surface__59oDI","surfaceVariant":"container-module_surfaceVariant__S9Pyg","container":"container-module_container__Xfc8t","error":"container-module_error__anU8a","header":"container-module_header__2SLww","subheader":"container-module_subheader__Y2LUC"};
|
|
111293
|
+
styleInject(css_248z$1);
|
|
111294
|
+
|
|
111295
|
+
var _tmpl$$2 = /*#__PURE__*/template(`<div>`);
|
|
111296
|
+
const Container = props => {
|
|
111297
|
+
const [local, other] = splitProps(props, ["children", "class", "theme"]);
|
|
111298
|
+
return (() => {
|
|
111299
|
+
var _el$ = _tmpl$$2();
|
|
111300
|
+
spread(_el$, mergeProps(other, {
|
|
111301
|
+
get ["class"]() {
|
|
111302
|
+
return `${styles$1[local.theme]} ${local.class}`;
|
|
111303
|
+
}
|
|
111304
|
+
}), false, true);
|
|
111305
|
+
insert(_el$, () => local.children);
|
|
111306
|
+
return _el$;
|
|
111307
|
+
})();
|
|
111308
|
+
};
|
|
111309
|
+
|
|
111310
|
+
var css_248z = ".menu-module_menu__UDlDL {\n background-color: var(--primary-color-varient, #43A047);\n padding: 1px;\n margin: 0px;\n width: 100px;\n border-radius: 8px;\n transform-origin: top;\n transform: scaleY(0);\n transition: transform 0.3s ease-out, opacity 0.3s ease-out;\n opacity: 0;\n}\n\n.menu-module_open__TpFnL {\n transform: scaleY(1);\n opacity: 1;\n}\n\n.menu-module_list__WPlII {\n background-color: var(--container-color, #ffffff);\n color: var(--on-container-color, #000);\n width: 100%;\n list-style: none;\n padding: 4px 0;\n margin: 0;\n border-radius: 8px;\n}\n\n.menu-module_menuItem__oXBNs {\n padding: 0.5rem 0;\n width: 100%;\n}\n.menu-module_menuItem__oXBNs:hover {\n background-color: var(--surface-color-variant, #ccc);\n cursor: pointer;\n}";
|
|
111311
|
+
var styles = {"menu":"menu-module_menu__UDlDL","open":"menu-module_open__TpFnL","list":"menu-module_list__WPlII","menuItem":"menu-module_menuItem__oXBNs"};
|
|
111312
|
+
styleInject(css_248z);
|
|
111313
|
+
|
|
111314
|
+
var _tmpl$$1 = /*#__PURE__*/template(`<div><ul>`);
|
|
111315
|
+
const Menu = props => {
|
|
111316
|
+
const [local, others] = splitProps(props, ['anchorElement', 'children', 'ref', 'show', 'position']);
|
|
111317
|
+
const [menuRef, setMenuRef] = createSignal();
|
|
111318
|
+
const openStyle = () => {
|
|
111319
|
+
if (local.show[0]()) {
|
|
111320
|
+
return styles.open;
|
|
111321
|
+
}
|
|
111322
|
+
return '';
|
|
111323
|
+
};
|
|
111324
|
+
createEffect(() => {
|
|
111325
|
+
const menu = menuRef();
|
|
111326
|
+
const anchor = local.anchorElement();
|
|
111327
|
+
if (menu && anchor) {
|
|
111328
|
+
const rect = anchor.getBoundingClientRect();
|
|
111329
|
+
menu.style.position = 'absolute';
|
|
111330
|
+
menu.style.top = `${rect.bottom}px`;
|
|
111331
|
+
if ((local?.position ?? 'left') === 'left') {
|
|
111332
|
+
menu.style.left = `${rect.left}px`;
|
|
111333
|
+
} else if (local.position === 'center') {
|
|
111334
|
+
menu.style.left = `${rect.left + rect.width - menu.offsetWidth / 2 - anchor.offsetWidth / 2}px`;
|
|
111335
|
+
} else {
|
|
111336
|
+
menu.style.left = `${rect.left + rect.width - menu.offsetWidth}px`;
|
|
111337
|
+
}
|
|
111338
|
+
}
|
|
111339
|
+
});
|
|
111340
|
+
onCleanup(() => {
|
|
111341
|
+
const menu = menuRef();
|
|
111342
|
+
if (menu) {
|
|
111343
|
+
menu.style.top = '';
|
|
111344
|
+
menu.style.left = '';
|
|
111345
|
+
}
|
|
111346
|
+
});
|
|
111347
|
+
useClickOutside([menuRef, local.anchorElement], () => {
|
|
111348
|
+
local.show[1](false);
|
|
111349
|
+
});
|
|
111350
|
+
return createComponent(Portal, {
|
|
111351
|
+
get children() {
|
|
111352
|
+
var _el$ = _tmpl$$1(),
|
|
111353
|
+
_el$2 = _el$.firstChild;
|
|
111354
|
+
use(setMenuRef, _el$);
|
|
111355
|
+
spread(_el$, mergeProps(others, {
|
|
111356
|
+
get ["class"]() {
|
|
111357
|
+
return `${styles.menu} ${openStyle()}`;
|
|
111358
|
+
}
|
|
111359
|
+
}), false, true);
|
|
111360
|
+
insert(_el$2, () => local.children);
|
|
111361
|
+
createRenderEffect(() => className(_el$2, `${styles.list}`));
|
|
111362
|
+
return _el$;
|
|
111363
|
+
}
|
|
111364
|
+
});
|
|
111365
|
+
};
|
|
111366
|
+
|
|
111367
|
+
var _tmpl$ = /*#__PURE__*/template(`<li>`);
|
|
111368
|
+
const MenuItem = props => {
|
|
111369
|
+
const [local, others] = splitProps(props, ['children', 'class']);
|
|
111370
|
+
return (() => {
|
|
111371
|
+
var _el$ = _tmpl$();
|
|
111372
|
+
spread(_el$, mergeProps(others, {
|
|
111373
|
+
get ["class"]() {
|
|
111374
|
+
return `${styles.menuItem} ${local.class}`;
|
|
111375
|
+
}
|
|
111376
|
+
}), false, true);
|
|
111377
|
+
insert(_el$, () => local.children);
|
|
111378
|
+
return _el$;
|
|
111379
|
+
})();
|
|
111380
|
+
};
|
|
111381
|
+
|
|
111382
|
+
const ColeError = props => {
|
|
111383
|
+
const formField = useFormProvider();
|
|
111384
|
+
createEffect(() => {
|
|
111385
|
+
if (!!formField?.formName && !!props.errorName) {
|
|
111386
|
+
formField?.setErrors(prev => {
|
|
111387
|
+
const newError = {
|
|
111388
|
+
key: props.errorName,
|
|
111389
|
+
hasError: false,
|
|
111390
|
+
display: props.children
|
|
111391
|
+
};
|
|
111392
|
+
return {
|
|
111393
|
+
err: [...prev?.err, newError]
|
|
111394
|
+
};
|
|
111395
|
+
});
|
|
111396
|
+
}
|
|
111397
|
+
});
|
|
111398
|
+
return [];
|
|
111399
|
+
};
|
|
111400
|
+
|
|
111401
|
+
export { Body, Button, Carousel, Cell, Chip, Chipbar, Column, Container, ExpansionPanel, ColeError as FieldError, Form, FormField, FormGroup, Header, Icon, Input, Menu, MenuItem, Modal, Option, Row, Select, SelectContext, Slide, SnackbarController, TabBar, Table, TextArea, Validators, addSnackbar, addTheme, carouselTitleContext };
|