coles-solid-library 0.5.0 → 0.5.1
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/USAGE.html +20 -12
- package/dist/__tests__/Body.test.d.ts +1 -0
- package/dist/__tests__/Button.accessibility.test.d.ts +1 -0
- package/dist/__tests__/Button.coverage.test.d.ts +1 -0
- package/dist/__tests__/Button.extra.test.d.ts +1 -0
- package/dist/__tests__/Button.test.d.ts +1 -0
- package/dist/__tests__/Carosel.test.d.ts +1 -0
- package/dist/__tests__/Checkbox.test.d.ts +1 -0
- package/dist/__tests__/Chip.performance.test.d.ts +1 -0
- package/dist/__tests__/Chip.test.d.ts +1 -0
- package/dist/__tests__/Chipbar.performance.test.d.ts +1 -0
- package/dist/__tests__/Chipbar.test.d.ts +1 -0
- package/dist/__tests__/Container.test.d.ts +1 -0
- package/dist/__tests__/CoreComponents.performance.test.d.ts +1 -0
- package/dist/__tests__/Expansion.accessibility.test.d.ts +1 -0
- package/dist/__tests__/ExpansionPanel.test.d.ts +1 -0
- package/dist/__tests__/Form.performance.test.d.ts +1 -0
- package/dist/__tests__/Form.submit.test.d.ts +1 -0
- package/dist/__tests__/FormArray.externalMutation.test.d.ts +1 -0
- package/dist/__tests__/FormArray.test.d.ts +1 -0
- package/dist/__tests__/FormBridgeRecursion.test.d.ts +1 -0
- package/dist/__tests__/FormDependencyRegression.test.d.ts +1 -0
- package/dist/__tests__/FormEnhancements.test.d.ts +1 -0
- package/dist/__tests__/FormField.resetAndClear.test.d.ts +1 -0
- package/dist/__tests__/FormField.test.d.ts +1 -0
- package/dist/__tests__/FormFieldDirtyOnFocus.test.d.ts +1 -0
- package/dist/__tests__/FormFieldDirtyState.test.d.ts +1 -0
- package/dist/__tests__/FormFieldExtra.test.d.ts +1 -0
- package/dist/__tests__/FormFieldProgrammaticSet.test.d.ts +1 -0
- package/dist/__tests__/FormGroup.additionalGaps.test.d.ts +1 -0
- package/dist/__tests__/FormGroup.gaps.test.d.ts +1 -0
- package/dist/__tests__/FormGroup.test.d.ts +1 -0
- package/dist/__tests__/FormGroupAccessors.integration.test.d.ts +1 -0
- package/dist/__tests__/FormGroupAccessors.test.d.ts +1 -0
- package/dist/__tests__/FormReactiveUpdate.test.d.ts +1 -0
- package/dist/__tests__/Icon.test.d.ts +1 -0
- package/dist/__tests__/Input.test.d.ts +1 -0
- package/dist/__tests__/InputV2EdgeCases.test.d.ts +1 -0
- package/dist/__tests__/LegacyInputDirty.test.d.ts +1 -0
- package/dist/__tests__/Menu.performance.test.d.ts +1 -0
- package/dist/__tests__/Menu.test.d.ts +1 -0
- package/dist/__tests__/MenuDropdown.test.d.ts +1 -0
- package/dist/__tests__/MenuItem.accessibility.test.d.ts +1 -0
- package/dist/__tests__/Modal.additional.test.d.ts +1 -0
- package/dist/__tests__/Modal.performance.test.d.ts +1 -0
- package/dist/__tests__/Modal.test.d.ts +1 -0
- package/dist/__tests__/Radio.test.d.ts +1 -0
- package/dist/__tests__/RadioGroup.keyboard.test.d.ts +1 -0
- package/dist/__tests__/Select.accessibility.test.d.ts +1 -0
- package/dist/__tests__/Select.formField.test.d.ts +1 -0
- package/dist/__tests__/Select.mobile.test.d.ts +1 -0
- package/dist/__tests__/Select.optionEdge.test.d.ts +1 -0
- package/dist/__tests__/Select.performance.test.d.ts +1 -0
- package/dist/__tests__/Select.test.d.ts +1 -0
- package/dist/__tests__/Snackbar.additional.test.d.ts +1 -0
- package/dist/__tests__/Snackbar.performance.test.d.ts +1 -0
- package/dist/__tests__/Snackbar.test.d.ts +1 -0
- package/dist/__tests__/TabBar.performance.test.d.ts +1 -0
- package/dist/__tests__/TabBar.test.d.ts +1 -0
- package/dist/__tests__/TableV2.additional.test.d.ts +1 -0
- package/dist/__tests__/TableV2.dropHeaderAttr.test.d.ts +1 -0
- package/dist/__tests__/TableV2.dropdownAdvanced.test.d.ts +1 -0
- package/dist/__tests__/TableV2.extra.test.d.ts +1 -0
- package/dist/__tests__/TableV2.nullCells.test.d.ts +1 -0
- package/dist/__tests__/TableV2.performance.test.d.ts +1 -0
- package/dist/__tests__/TableV2.test.d.ts +1 -0
- package/dist/__tests__/TextArea.test.d.ts +1 -0
- package/dist/__tests__/Validators.test.d.ts +1 -0
- package/dist/__tests__/globalWindowManager.performance.test.d.ts +1 -0
- package/dist/__tests__/globalWindowManager.test.d.ts +1 -0
- package/dist/__tests__/helpers/renderWithTheme.d.ts +106 -0
- package/dist/__tests__/injectStyles.test.d.ts +1 -0
- package/dist/__tests__/tools.advanced.test.d.ts +1 -0
- package/dist/__tests__/tools.clone.edge.test.d.ts +1 -0
- package/dist/__tests__/tools.test.d.ts +1 -0
- package/dist/__tests__/useClickOutside.test.d.ts +1 -0
- package/dist/__tests__/useDirectFormBinding.test.d.ts +1 -0
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.js +2 -0
- package/dist/components/Button/Button.js.map +1 -0
- package/dist/components/Button/Button.module.scss.js +2 -0
- package/dist/components/Button/Button.module.scss.js.map +1 -0
- package/dist/components/Carosel/Carosel.js +2 -0
- package/dist/components/Carosel/Carosel.js.map +1 -0
- package/dist/components/Carosel/Carosel.module.scss.js +2 -0
- package/dist/components/Carosel/Carosel.module.scss.js.map +1 -0
- package/dist/components/Carosel/Slide.js +2 -0
- package/dist/components/Carosel/Slide.js.map +1 -0
- package/dist/components/Checkbox/checkbox.js +2 -0
- package/dist/components/Checkbox/checkbox.js.map +1 -0
- package/dist/components/Checkbox/checkbox.module.scss.js +2 -0
- package/dist/components/Checkbox/checkbox.module.scss.js.map +1 -0
- package/dist/components/Chip/Chip.js +2 -0
- package/dist/components/Chip/Chip.js.map +1 -0
- package/dist/components/Chip/Chip.module.scss.js +2 -0
- package/dist/components/Chip/Chip.module.scss.js.map +1 -0
- package/dist/components/Chipbar/chipbar.js +2 -0
- package/dist/components/Chipbar/chipbar.js.map +1 -0
- package/dist/components/Chipbar/chipbar.module.scss.js +2 -0
- package/dist/components/Chipbar/chipbar.module.scss.js.map +1 -0
- package/dist/components/ComponentBody/body.component.js +2 -0
- package/dist/components/ComponentBody/body.component.js.map +1 -0
- package/dist/components/ComponentBody/body.module.scss.js +2 -0
- package/dist/components/ComponentBody/body.module.scss.js.map +1 -0
- package/dist/components/Container/container.js +2 -0
- package/dist/components/Container/container.js.map +1 -0
- package/dist/components/Container/container.module.scss.js +2 -0
- package/dist/components/Container/container.module.scss.js.map +1 -0
- package/dist/components/Form/form.js +2 -0
- package/dist/components/Form/form.js.map +1 -0
- package/dist/components/Form/formGroup.d.ts +7 -0
- package/dist/components/Form/formGroup.js +2 -0
- package/dist/components/Form/formGroup.js.map +1 -0
- package/dist/components/Form/formHelp/formArray.js +2 -0
- package/dist/components/Form/formHelp/formArray.js.map +1 -0
- package/dist/components/Form/formHelp/validators.js +2 -0
- package/dist/components/Form/formHelp/validators.js.map +1 -0
- package/dist/components/Form/useDirectFormBinding.js +2 -0
- package/dist/components/Form/useDirectFormBinding.js.map +1 -0
- package/dist/components/Form/useFormFieldBinding.js +2 -0
- package/dist/components/Form/useFormFieldBinding.js.map +1 -0
- package/dist/components/FormField/coleError.js +2 -0
- package/dist/components/FormField/coleError.js.map +1 -0
- package/dist/components/FormField/formField.js +2 -0
- package/dist/components/FormField/formField.js.map +1 -0
- package/dist/components/FormField/formProvider.js +2 -0
- package/dist/components/FormField/formProvider.js.map +1 -0
- package/dist/components/FormField/formfield.module.scss.js +2 -0
- package/dist/components/FormField/formfield.module.scss.js.map +1 -0
- package/dist/components/Icon/generated/outlined/keyboard_arrow_down.js +2 -0
- package/dist/components/Icon/generated/outlined/keyboard_arrow_down.js.map +1 -0
- package/dist/components/Icon/generated/outlined/keyboard_arrow_up.js +2 -0
- package/dist/components/Icon/generated/outlined/keyboard_arrow_up.js.map +1 -0
- package/dist/components/Icon/icon.d.ts +3 -8
- package/dist/components/Icon/icon.js +2 -0
- package/dist/components/Icon/icon.js.map +1 -0
- package/dist/components/Icon/icon.module.scss.js +2 -0
- package/dist/components/Icon/icon.module.scss.js.map +1 -0
- package/dist/components/Input/input.module.scss.js +2 -0
- package/dist/components/Input/input.module.scss.js.map +1 -0
- package/dist/components/Input/inputV2.js +2 -0
- package/dist/components/Input/inputV2.js.map +1 -0
- package/dist/components/Menu/menu.js +2 -0
- package/dist/components/Menu/menu.js.map +1 -0
- package/dist/components/Menu/menu.module.scss.js +2 -0
- package/dist/components/Menu/menu.module.scss.js.map +1 -0
- package/dist/components/Menu/menuContext.js +2 -0
- package/dist/components/Menu/menuContext.js.map +1 -0
- package/dist/components/Menu/menuDropdown.js +2 -0
- package/dist/components/Menu/menuDropdown.js.map +1 -0
- package/dist/components/Menu/menuitem.js +2 -0
- package/dist/components/Menu/menuitem.js.map +1 -0
- package/dist/components/Radio/radio-group.module.scss.js +2 -0
- package/dist/components/Radio/radio-group.module.scss.js.map +1 -0
- package/dist/components/Radio/radio.js +2 -0
- package/dist/components/Radio/radio.js.map +1 -0
- package/dist/components/Radio/radio.module.scss.js +2 -0
- package/dist/components/Radio/radio.module.scss.js.map +1 -0
- package/dist/components/Radio/radioGroup.js +2 -0
- package/dist/components/Radio/radioGroup.js.map +1 -0
- package/dist/components/Select/option.component.js +2 -0
- package/dist/components/Select/option.component.js.map +1 -0
- package/dist/components/Select/select.component.js +2 -0
- package/dist/components/Select/select.component.js.map +1 -0
- package/dist/components/Select/selectContext.js +2 -0
- package/dist/components/Select/selectContext.js.map +1 -0
- package/dist/components/Select/selectStyles.module.scss.js +2 -0
- package/dist/components/Select/selectStyles.module.scss.js.map +1 -0
- package/dist/components/Select/useHighlight.js +2 -0
- package/dist/components/Select/useHighlight.js.map +1 -0
- package/dist/components/Select/useSelectOptions.js +2 -0
- package/dist/components/Select/useSelectOptions.js.map +1 -0
- package/dist/components/Select/useTypeahead.js +2 -0
- package/dist/components/Select/useTypeahead.js.map +1 -0
- package/dist/components/Snackbar/snackbar.js +2 -0
- package/dist/components/Snackbar/snackbar.js.map +1 -0
- package/dist/components/Snackbar/snackbar.module.scss.js +2 -0
- package/dist/components/Snackbar/snackbar.module.scss.js.map +1 -0
- package/dist/components/TabV2/tabs.js +2 -0
- package/dist/components/TabV2/tabs.js.map +1 -0
- package/dist/components/TabV2/tabs.module.scss.js +2 -0
- package/dist/components/TabV2/tabs.module.scss.js.map +1 -0
- package/dist/components/TableV2/cell.js +2 -0
- package/dist/components/TableV2/cell.js.map +1 -0
- package/dist/components/TableV2/column.js +2 -0
- package/dist/components/TableV2/column.js.map +1 -0
- package/dist/components/TableV2/header.js +2 -0
- package/dist/components/TableV2/header.js.map +1 -0
- package/dist/components/TableV2/row.js +2 -0
- package/dist/components/TableV2/row.js.map +1 -0
- package/dist/components/TableV2/table.js +2 -0
- package/dist/components/TableV2/table.js.map +1 -0
- package/dist/components/TableV2/table.module.scss.js +2 -0
- package/dist/components/TableV2/table.module.scss.js.map +1 -0
- package/dist/components/TableV2/tableProvider.js +2 -0
- package/dist/components/TableV2/tableProvider.js.map +1 -0
- package/dist/components/TextArea/TextArea.js +2 -0
- package/dist/components/TextArea/TextArea.js.map +1 -0
- package/dist/components/TextArea/TextArea.module.scss.js +2 -0
- package/dist/components/TextArea/TextArea.module.scss.js.map +1 -0
- package/dist/components/expansion/expansion.js +2 -0
- package/dist/components/expansion/expansion.js.map +1 -0
- package/dist/components/expansion/expansion.module.scss.js +2 -0
- package/dist/components/expansion/expansion.module.scss.js.map +1 -0
- package/dist/components/modal/popup.component.js +2 -0
- package/dist/components/modal/popup.component.js.map +1 -0
- package/dist/components/modal/popup.module.scss.js +2 -0
- package/dist/components/modal/popup.module.scss.js.map +1 -0
- package/dist/components/svgs/arrows.js +2 -0
- package/dist/components/svgs/arrows.js.map +1 -0
- package/dist/globalWindowManager.d.ts +9 -0
- package/dist/globalWindowManager.js +2 -0
- package/dist/globalWindowManager.js.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/injectStyles.d.ts +1 -0
- package/dist/styleInject.js +2 -0
- package/dist/styleInject.js.map +1 -0
- package/dist/tools/eventTools.d.ts +12 -0
- package/dist/tools/eventTools.js +2 -0
- package/dist/tools/eventTools.js.map +1 -0
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/tools.d.ts +15 -0
- package/dist/tools/tools.js +2 -0
- package/dist/tools/tools.js.map +1 -0
- package/dist/tools/useOverlayPosition.d.ts +27 -0
- package/dist/tools/useOverlayPosition.js +2 -0
- package/dist/tools/useOverlayPosition.js.map +1 -0
- package/dist/vite.d.ts +52 -0
- package/dist/vite.js +2 -0
- package/dist/vite.js.map +1 -0
- package/package.json +146 -11
- package/readme.md +36 -0
- package/dist/generated/registries/outlined.d.ts +0 -3
- package/dist/generated/registries/outlined.js +0 -7784
- package/dist/generated/registries/rounded.d.ts +0 -3
- package/dist/generated/registries/rounded.js +0 -7784
- package/dist/generated/registries/sharp.d.ts +0 -3
- package/dist/generated/registries/sharp.js +0 -7784
- package/dist/index.esm.js +0 -5475
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import n from"../../styleInject.js";var i={input:"input-module_input__-LMoi",disabled:"input-module_disabled__40ZHw",inFormField:"input-module_inFormField__kk-PD",transparent:"input-module_transparent__aXcGX"};n('@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 transition: border 0.7s ease, padding 0.7s ease;\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 transition: padding 0.7s ease;\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}');export{i as default};
|
|
2
|
+
//# sourceMappingURL=input.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{spread as e,mergeProps as t,memo as r,template as a}from"solid-js/web";import{splitProps as o,createMemo as s,onMount as n,createEffect as u}from"solid-js";import{useFormProvider as i}from"../FormField/formProvider.js";import{isNullish as l}from"../../tools/tools.js";import m from"./input.module.scss.js";import{useFormContext as d}from"../Form/form.js";import{useDirectFormBinding as c}from"../Form/useDirectFormBinding.js";var g=a("<input>");const f=a=>{const[f,p]=o(a,["tooltip","transparent","value","onChange","formName","formIndex","formArrayName"]),T=i(),v=d(),x=c({formName:a.formName,formIndex:a.formIndex,formArrayName:a.formArrayName}),y=x.formName,I=s(()=>l(a?.value)?x.isFormArray?x.getValue():l(v?.data?.[y??""])?l(T.getValue)?a.value:T.getValue():v.data[y??""]:a.value),F=s(()=>{if(T&&v){const e=y??"";return v?.formGroup?.hasValidator?.(e,"required")}return Object.keys(p).includes("required")&&!1!==a?.required||!0===a?.required}),N=e=>{if(x.isFormArray)x.setValue(e.currentTarget.value),T?.setTextInside?.(!l(e.currentTarget.value)&&""!==e.currentTarget.value?.trim());else if(!l(v?.setData)&&v?.formGroup?.get){const t=!l(e.currentTarget.value)&&""!==e.currentTarget.value?.trim();T?.setTextInside?.(t),v.formGroup?.set?.(y??"",e.currentTarget.value),v?.setData?.(t=>({...t,[y??""]:e.currentTarget.value}))}else!l(T.getName)&&T?.getName?.()&&(e.currentTarget.value.trim()?(T?.setValue(e.currentTarget.value),T.setTextInside(!0)):(T.setValue(""),T.setTextInside(!1)));a.onChange&&a.onChange(e)};n(()=>{if(!l(T.getName))if(T.setFieldType("checkbox"===a.type?"text":a.type??"text"),l(v?.data)){if(!l(a.value)){const e=a.value;"string"!=typeof e||""!==e.trim()?(T.setValue(e),T.setTextInside(!0)):T.setTextInside(!1)}}else{const e=v.data[y??""];if("string"==typeof e){const t=e.trim();t&&(T.setValue(t),T.setTextInside(!0))}else null!=e&&(T.setValue(e),T.setTextInside(!0))}}),u(()=>{if(l(v?.data)&&!l(a.value)&&!l(T.getName)){const e=a.value,t="string"==typeof e&&""===e.trim();T.setValue(e),T.setTextInside(!t)}});return u(()=>{const e=l(I())||""===I();l(T)||e===T?.getTextInside?.()||(T?.getFocused?.(),T?.setTextInside?.(!e))}),V=g(),e(V,t(p,{get placeholder(){return(()=>{const e=F()?" *":"";return T?.getTextInside?.()&&!T?.getFocused?.()?(T?.getName?.()??a?.placeholder??"")+e:a?.placeholder?a.placeholder+e:""})()},get value(){return I()},onFocus:()=>{if(!a.disabled&&!l(T.getName)&&(T.setFocused?.(!0),y&&v?.formGroup?.markDirty)){const e=v.formGroup.getMeta(y);e&&!e.dirty&&v.formGroup.markDirty(y)}},onBlur:e=>{if(!a.disabled&&!l(T.getName)){T?.setFocused?.(e=>(e&&v?.formGroup?.validate?.(y??""),!1));const t=!e.currentTarget?.value?.trim(),r=!v?.data?.[y??""],a=!T?.getValue();T.setTextInside(t&&r&&a)}},get type(){return r(()=>"checkbox"===a.type)()?"text":a.type??"text"},onChange:N,get class(){return`${m.input} ${a.disabled?m.disabled:""} ${f.transparent?m.transparent:""} ${T?.getName?.()?m.inFormField:""} ${a?.class??""}`},get title(){return f.tooltip}}),!1,!1),V;var V};export{f as Input};
|
|
2
|
+
//# sourceMappingURL=inputV2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputV2.js","sources":["../../../src/components/Input/inputV2.tsx"],"sourcesContent":["import { Component, JSX, splitProps, createMemo, onMount, createEffect } from \"solid-js\";\nimport { useFormProvider } from \"../FormField/formProvider\";\nimport { isNullish } from \"../../tools\";\n// @ts-ignore\nimport styles from \"./input.module.scss\";\nimport { useFormContext } from \"../Form/form\";\nimport { useDirectFormBinding } from \"../Form/useDirectFormBinding\";\n\ninterface InputProps extends JSX.InputHTMLAttributes<HTMLInputElement> {\n tooltip?: string;\n transparent?: boolean;\n onChange?: (e: Event & { currentTarget: HTMLInputElement; target: HTMLInputElement }) => void;\n formName?: string;\n formIndex?: number;\n formArrayName?: string;\n}\n\nconst Input: Component<InputProps> = (props) => {\n const [customProps, normalProps] = splitProps(props, [\"tooltip\", \"transparent\", \"value\", \"onChange\", \"formName\", \"formIndex\", \"formArrayName\"]);\n const context = useFormProvider();\n const formContext = useFormContext();\n const binding = useDirectFormBinding({ formName: props.formName, formIndex: props.formIndex, formArrayName: props.formArrayName });\n const effectiveFormName = binding.formName;\n\n // Determine the input's value using form context or provided prop value\n const inputValue = createMemo(() => {\n if (!isNullish(props?.value)) {\n return props.value;\n }\n if (binding.isFormArray) {\n return binding.getValue();\n }\n if (!isNullish(formContext?.data?.[effectiveFormName ?? \"\"])) {\n return formContext.data[effectiveFormName ?? \"\"];\n }\n if (!isNullish(context.getValue)) {\n return context.getValue();\n }\n return props.value;\n });\n\n const isRequired = createMemo(() => {\n if (context && formContext) {\n const key = effectiveFormName ?? \"\";\n return formContext?.formGroup?.hasValidator?.(key, 'required');\n }\n return Object.keys(normalProps).includes(\"required\") && props?.required !== false || props?.required === true;\n })\n\n // onChange only handles non-checkbox values\n const onChange = (e: Event & { currentTarget: HTMLInputElement; target: HTMLInputElement }) => {\n if (binding.isFormArray) {\n binding.setValue(e.currentTarget.value);\n context?.setTextInside?.(!isNullish(e.currentTarget.value) && e.currentTarget.value?.trim() !== \"\");\n } else if (!isNullish(formContext?.setData) && !!formContext?.formGroup?.get) {\n interface FormData {\n [key: string]: string;\n }\n const textInside = !isNullish(e.currentTarget.value) && e.currentTarget.value?.trim() !== \"\";\n \n context?.setTextInside?.(textInside);\n formContext.formGroup?.set?.(effectiveFormName ?? \"\", e.currentTarget.value);\n formContext?.setData?.((old: FormData): FormData => ({\n ...old,\n [effectiveFormName ?? \"\"]: e.currentTarget.value,\n }));\n } else if (!isNullish(context.getName) && !!context?.getName?.()) {\n if (e.currentTarget.value.trim()) {\n context?.setValue(e.currentTarget.value);\n context.setTextInside(true);\n } else {\n context.setValue(\"\");\n context.setTextInside(false);\n }\n }\n if (props.onChange) props.onChange(e);\n };\n\n // Removed name mutation adding '*' to avoid duplicating required indicator; legend handles display.\n\n onMount(() => {\n if (!isNullish(context.getName)) {\n // Force a non-checkbox field type\n context.setFieldType(props.type === \"checkbox\" ? \"text\" : props.type ?? \"text\");\n if (!isNullish(formContext?.data)) {\n const raw = formContext.data[effectiveFormName ?? \"\"];\n if (typeof raw === 'string') {\n const formValue = raw.trim();\n if (formValue) {\n context.setValue(formValue as any);\n context.setTextInside(true);\n }\n } else if (raw !== undefined && raw !== null) {\n context.setValue(raw as any);\n context.setTextInside(true);\n }\n // If not in a form but controlled value provided\n } else if (!isNullish(props.value)) {\n const val = props.value as any;\n if (!(typeof val === 'string' && val.trim() === '')) {\n context.setValue(val);\n context.setTextInside(true);\n } else {\n context.setTextInside(false);\n }\n }\n }\n });\n\n // React to controlled prop value changes outside of form context\n createEffect(() => {\n if (isNullish(formContext?.data) && !isNullish(props.value) && !isNullish(context.getName)) {\n const val: any = props.value;\n const empty = (typeof val === 'string') ? val.trim() === '' : false;\n context.setValue(val);\n context.setTextInside(!empty);\n }\n });\n\n const placeholder = (() => {\n const reqText = isRequired() ? \" *\" : \"\";\n if (context?.getTextInside?.() && !context?.getFocused?.()) {\n return (context?.getName?.() ?? props?.placeholder ?? \"\") + reqText;\n }\n if (props?.placeholder) {\n return props.placeholder + reqText;\n }\n return \"\";\n });\n\n createEffect(() => {\n const hasInputValue = isNullish(inputValue()) || inputValue() === \"\";\n \n if (!isNullish(context) && hasInputValue !== context?.getTextInside?.()) {\n context?.getFocused?.();\n \n context?.setTextInside?.(!hasInputValue);\n }\n });\n\n return (\n <input\n {...normalProps}\n placeholder={placeholder()}\n value={inputValue()}\n onFocus={() => {\n if (props.disabled) return;\n if (!isNullish(context.getName)) {\n context.setFocused?.(true);\n if (effectiveFormName && formContext?.formGroup?.markDirty) {\n const meta = formContext.formGroup.getMeta(effectiveFormName as any);\n if (meta && !meta.dirty) formContext.formGroup.markDirty(effectiveFormName as any);\n }\n }\n }}\n onBlur={(e) => {\n if (props.disabled) return;\n if (!isNullish(context.getName)) {\n context?.setFocused?.((prev) => {\n if (prev) {\n formContext?.formGroup?.validate?.(effectiveFormName ?? \"\");\n }\n return false;\n });\n const noValue = !e.currentTarget?.value?.trim();\n const noFormValue = !formContext?.data?.[effectiveFormName ?? \"\"];\n const noContextValue = !context?.getValue();\n \n context.setTextInside((noValue && noFormValue && noContextValue));\n }\n }}\n type={props.type === \"checkbox\" ? \"text\" : props.type ?? \"text\"}\n onChange={onChange}\n class={`${styles.input} ${props.disabled ? styles.disabled : \"\"} ${customProps.transparent ? styles.transparent : \"\"} ${\n !!context?.getName?.() ? styles.inFormField : \"\"\n } ${props?.class ?? \"\"}`}\n title={customProps.tooltip}\n />\n );\n};\n\nexport { Input };\nexport default Input;\n"],"names":["Input","props","customProps","normalProps","splitProps","context","useFormProvider","formContext","useFormContext","binding","useDirectFormBinding","formName","formIndex","formArrayName","effectiveFormName","inputValue","createMemo","isNullish","value","isFormArray","getValue","data","isRequired","key","formGroup","hasValidator","Object","keys","includes","required","onChange","e","setValue","currentTarget","setTextInside","trim","setData","get","textInside","set","old","getName","onMount","setFieldType","type","val","raw","formValue","createEffect","empty","hasInputValue","getTextInside","getFocused","_el$","_tmpl$","_$spread","_$mergeProps","placeholder","reqText","onFocus","disabled","setFocused","markDirty","meta","getMeta","dirty","onBlur","prev","validate","noValue","noFormValue","noContextValue","_$memo","styles","input","transparent","inFormField","class","title","tooltip"],"mappings":"ocAiBA,MAAMA,EAAgCC,IACpC,MAAOC,EAAaC,GAAeC,EAAWH,EAAO,CAAC,UAAW,cAAe,QAAS,WAAY,WAAY,YAAa,kBACxHI,EAAUC,IACVC,EAAcC,IACdC,EAAUC,EAAqB,CAAEC,SAAUV,EAAMU,SAAUC,UAAWX,EAAMW,UAAWC,cAAeZ,EAAMY,gBAC5GC,EAAoBL,EAAQE,SAG5BI,EAAaC,EAAW,IACvBC,EAAUhB,GAAOiB,OAGlBT,EAAQU,YACHV,EAAQW,WAEZH,EAAUV,GAAac,OAAOP,GAAqB,KAGnDG,EAAUZ,EAAQe,UAGhBnB,EAAMiB,MAFJb,EAAQe,WAHRb,EAAYc,KAAKP,GAAqB,IANtCb,EAAMiB,OAcXI,EAAaN,EAAW,KAC5B,GAAIX,GAAWE,EAAa,CAC1B,MAAMgB,EAAMT,GAAqB,GACjC,OAAOP,GAAaiB,WAAWC,eAAeF,EAAK,WACrD,CACA,OAAOG,OAAOC,KAAKxB,GAAayB,SAAS,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GAASe,WAEjCf,EAAQ6B,cAAemC,GAAWC,GAAeC,EACnD,GACD,QACD3B,GAAI,OAAE4B,EAAA,IAAe,aAAfvE,EAAM2C,KAAN4B,GAA4B,OAASvE,EAAM2C,MAAQ,MAAM,EAAAd,SACrDA,EAAQ,SAAA,GAAA,MACX,GAAG2C,EAAOC,SAASzE,EAAM2D,SAAWa,EAAOb,SAAW,MAAM1D,EAAYyE,YAAcF,EAAOE,YAAc,MAC9GtE,GAASoC,YAAcgC,EAAOG,YAAc,MAC5C3E,GAAO4E,OAAS,IAAI,EAAA,SACxBC,GAAK,OAAE5E,EAAY6E,OAAO,KAAA,GAAA,GAAA1B,EApC9B,IAAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createComponent as e,Portal as t,use as o,spread as s,mergeProps as n,insert as i,effect as l,className as r,template as d}from"solid-js/web";import{splitProps as m,createSignal as c,createEffect as f,onMount as h,onCleanup as p}from"solid-js";import a from"./menu.module.scss.js";import{useMenuContext as u}from"./menuContext.js";import{isNullish as w}from"../../tools/tools.js";import{getEntryAmount as g,registerWindowManager as v,unregisterWindowManager as y}from"../../globalWindowManager.js";var x=d("<div><ul>");const C=d=>{const[C,E]=m(d,["anchorElement","children","ref","show","position","listClass"]),[$,j]=c(),W=u();let b;f(()=>{const e=d.show[0](),t=$();e&&t?(b?b.element=t:b={element:t,onClickOutside:()=>d.show[1](!1)},b.element.style.zIndex=`${999+g()}`,v(b)):!e&&b&&y(b)});const L=(e,t)=>{const o=t.getBoundingClientRect();if(e.style.position="absolute",e.style.top=`${o.bottom}px`,"left"===(C?.position??"left"))e.style.left=`${o.left}px`;else if("center"===C.position)e.style.left=o.left+o.width-e.offsetWidth/2-t.offsetWidth/2+"px";else{const t=o.width<12?1.25:1,s=e.getBoundingClientRect().width*t;e.style.left=o.right-(s+window.scrollX)+"px"}},z=()=>{const e=$(),t=C.anchorElement();e&&t&&L(e,t)};return h(()=>{const e=$(),t=C.anchorElement();e&&t&&(setTimeout(()=>{L(e,t)},50),w(W)||W.registerWithParent(e),document.addEventListener("scroll",z,!0),window.addEventListener("resize",z)),p(()=>{document.removeEventListener("scroll",z,!0),window.removeEventListener("resize",z)})}),p(()=>{const e=$();e&&(e.style.top="",e.style.left=""),w(W)||W.unregisterWithParent($()),b&&(y(b),b=void 0)}),e(t,{get children(){var e=x(),t=e.firstChild;return o(j,e),s(e,n(E,{get class(){return`${a.menu} ${C.show[0]()?a.open:""}`}}),!1,!0),i(t,()=>C.children),l(()=>r(t,`${a.list} ${C.listClass??""}`)),e}})};export{C as Menu};
|
|
2
|
+
//# sourceMappingURL=menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.js","sources":["../../../src/components/Menu/menu.tsx"],"sourcesContent":["import { Accessor, Component, JSX, splitProps, onCleanup, createSignal, createEffect, Setter, Show, onMount, createContext, useContext } from \"solid-js\";\n// @ts-ignore\nimport styles from './menu.module.scss';\nimport { Portal } from \"solid-js/web\";\nimport { MenuProvider, useMenuContext } from \"./menuContext\";\nimport { isNullish } from \"../../tools\";\nimport { getEntryAmount, registerWindowManager, unregisterWindowManager, type WindowManagerEntry } from \"../../globalWindowManager\";\n\ninterface MenuProps extends JSX.HTMLAttributes<HTMLDivElement> {\n anchorElement: Accessor<HTMLElement | undefined>;\n children: JSX.Element;\n position?: 'left' | 'center' | 'right';\n show: [Accessor<boolean>, Setter<boolean>];\n areaExclusionRefs?: Accessor<HTMLElement | undefined>[];\n submenu?: boolean;\n listClass?: string;\n}\nexport const Menu:Component<MenuProps> = (props) => {\n const [local, others] = splitProps(props, ['anchorElement', 'children', 'ref', 'show', 'position', 'listClass']);\n const [menuRef, setMenuRef] = createSignal<HTMLElement | undefined>();\n const menuContext = useMenuContext();\n const openStyle = () => {\n if (local.show[0]()) {\n return styles.open;\n }\n return '';\n };\n\n // Persist the window manager entry so we unregister the same reference we registered.\n let wmEntry: WindowManagerEntry | undefined;\n createEffect(() => {\n const visible = props.show[0]();\n const el = menuRef();\n if (visible && el) {\n if (!wmEntry) {\n wmEntry = {\n element: el,\n onClickOutside: () => props.show[1](false)\n };\n } else {\n // update element reference if it changed (shouldn't usually)\n wmEntry.element = el;\n }\n // Avoid duplicate registrations: only register if not already last added.\n // Heuristic: assign zIndex each time we show and register once.\n wmEntry.element.style.zIndex = `${999 + getEntryAmount()}`;\n // If not already in entries array, register (simple containment check by identity).\n // We can't read the internal array directly besides length heuristic, so best effort:\n registerWindowManager(wmEntry);\n } else if (!visible && wmEntry) {\n unregisterWindowManager(wmEntry);\n }\n });\n\n const getAndSetPosition = (menu: HTMLElement, anchor: HTMLElement) => {\n const rect = anchor.getBoundingClientRect();\n menu.style.position = 'absolute';\n menu.style.top = `${rect.bottom}px`;\n if ((local?.position ?? 'left') === 'left') {\n menu.style.left = `${rect.left}px`;\n } else if (local.position === 'center') {\n menu.style.left = `${rect.left + rect.width - menu.offsetWidth / 2 - anchor.offsetWidth / 2}px`;\n } else {\n const mod = rect.width < 12 ? 1.25 : 1;\n const menuFix = (menu.getBoundingClientRect().width) * mod;\n menu.style.left = `${rect.right - (menuFix + window.scrollX)}px`;\n }\n };\n const updatePosition = () => {\n const menu = menuRef();\n const anchor = local.anchorElement();\n if (menu && anchor) {\n getAndSetPosition(menu, anchor);\n }\n };\n onMount(() => {\n const menu = menuRef();\n const anchor = local.anchorElement();\n if (menu && anchor) {\n setTimeout(() => {\n getAndSetPosition(menu, anchor);\n }, 50);\n\n if (!isNullish(menuContext)) {\n menuContext!.registerWithParent(menu);\n }\n\n document.addEventListener('scroll', updatePosition, true);\n window.addEventListener('resize', updatePosition);\n };\n\n onCleanup(() => {\n document.removeEventListener('scroll', updatePosition, true);\n window.removeEventListener('resize', updatePosition);\n })\n });\n\n\n onCleanup(() => {\n const menu = menuRef();\n if (menu) {\n menu.style.top = '';\n menu.style.left = '';\n }\n \n if (!isNullish(menuContext)) {\n menuContext!.unregisterWithParent(menuRef());\n }\n if (wmEntry) {\n unregisterWindowManager(wmEntry);\n wmEntry = undefined;\n }\n });\n\n return (\n <Portal>\n <div {...others} ref={setMenuRef} class={`${styles.menu} ${openStyle()}`}>\n <ul class={`${styles.list} ${local.listClass ?? ''}`}>\n {local.children}\n </ul>\n </div>\n </Portal>\n );\n}\n"],"names":["Menu","props","local","others","splitProps","menuRef","setMenuRef","createSignal","menuContext","useMenuContext","wmEntry","createEffect","visible","show","el","element","onClickOutside","style","zIndex","getEntryAmount","registerWindowManager","unregisterWindowManager","getAndSetPosition","menu","anchor","rect","getBoundingClientRect","position","top","bottom","left","width","offsetWidth","mod","menuFix","right","window","scrollX","updatePosition","anchorElement","onMount","setTimeout","isNullish","registerWithParent","document","addEventListener","onCleanup","removeEventListener","unregisterWithParent","undefined","_$createComponent","Portal","children","_el$","_tmpl$","_el$2","firstChild","_$use","_$spread","_$mergeProps","styles","open","_$insert","_$effect","_$className","list","listClass"],"mappings":"8gBAiBO,MAAMA,EAA6BC,IACxC,MAAOC,EAAOC,GAAUC,EAAWH,EAAO,CAAC,gBAAiB,WAAY,MAAO,OAAQ,WAAY,eAC5FI,EAASC,GAAcC,IACxBC,EAAcC,IASpB,IAAIC,EACJC,EAAa,KACX,MAAMC,EAAUX,EAAMY,KAAK,KACrBC,EAAKT,IACPO,GAAWE,GACRJ,EAOHA,EAAQK,QAAUD,EANlBJ,EAAU,CACRK,QAASD,EACTE,eAAgBA,IAAMf,EAAMY,KAAK,IAAG,IAQxCH,EAAQK,QAAQE,MAAMC,OAAS,GAAG,IAAMC,MAGxCC,EAAsBV,KACZE,GAAWF,GACrBW,EAAwBX,KAI5B,MAAMY,EAAoBA,CAACC,EAAmBC,KAC5C,MAAMC,EAAOD,EAAOE,wBAGlB,GAFAH,EAAKN,MAAMU,SAAW,WACtBJ,EAAKN,MAAMW,IAAM,GAAGH,EAAKI,WACW,UAA/B3B,GAAOyB,UAAY,QACtBJ,EAAKN,MAAMa,KAAO,GAAGL,EAAKK,cACrB,GAAuB,WAAnB5B,EAAMyB,SACfJ,EA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1,2 @@
|
|
|
1
|
+
import n from"../../styleInject.js";var o={menu:"menu-module_menu__UDlDL",open:"menu-module_open__TpFnL",list:"menu-module_list__WPlII",listHeader:"menu-module_listHeader__Hv-1-",menuDropdown:"menu-module_menuDropdown__uQA25",droplist:"menu-module_droplist__-e059",openDropList:"menu-module_openDropList__pYIA-",header:"menu-module_header__xWzbR",menuItem:"menu-module_menuItem__oXBNs"};n(".menu-module_menu__UDlDL {\n background-color: var(--header-background-color, #2E7D32);\n color: var(--header-on-background-color, #fff);\n fill: var(--header-on-background-color, #fff);\n padding: 1px;\n margin: 0px;\n width: 100px;\n border-radius: 8px;\n transform-origin: top;\n max-height: 0;\n transition: max-height 0.3s ease-out, opacity 0.3s ease-out;\n opacity: 0;\n visibility: hidden;\n}\n\n.menu-module_open__TpFnL {\n max-height: 800px !important;\n opacity: 1 !important;\n visibility: visible;\n}\n\n.menu-module_list__WPlII {\n background-color: var(--container-color, #ffffff);\n color: var(--on-container-color, #000);\n fill: 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_listHeader__Hv-1- {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding-left: 4px;\n opacity: 1 !important;\n}\n\n.menu-module_menuDropdown__uQA25 {\n opacity: 1 !important;\n}\n.menu-module_menuDropdown__uQA25 button:focus, .menu-module_menuDropdown__uQA25 button:active, .menu-module_menuDropdown__uQA25 button:focus-within, .menu-module_menuDropdown__uQA25 button:focus-visible {\n outline: none !important;\n border: none !important;\n box-shadow: none !important;\n -webkit-tap-highlight-color: transparent !important;\n}\n.menu-module_menuDropdown__uQA25 button::-moz-focus-inner {\n border: 0;\n}\n\n.menu-module_droplist__-e059 {\n background-color: var(--container-color, #ffffff);\n color: var(--on-container-color, #000);\n fill: var(--on-container-color, #000);\n padding: 1px;\n margin: 0px;\n width: 98%;\n border-radius: 8px;\n transform-origin: top;\n max-height: 0;\n transition: max-height 0.3s ease-out, opacity 0.3s ease-out;\n opacity: 0;\n pointer-events: none;\n}\n\n.menu-module_openDropList__pYIA- {\n max-height: 800px !important;\n opacity: 1 !important;\n pointer-events: auto;\n}\n\n.menu-module_icon__nvdCD {\n outline: none !important;\n border: none !important;\n box-shadow: none !important;\n fill: var(--header-on-background-color, #fff);\n -webkit-tap-highlight-color: transparent !important;\n}\n.menu-module_icon__nvdCD:focus, .menu-module_icon__nvdCD:active, .menu-module_icon__nvdCD:focus-within, .menu-module_icon__nvdCD:focus-visible {\n outline: none !important;\n border: none !important;\n box-shadow: none !important;\n -webkit-tap-highlight-color: transparent !important;\n}\n.menu-module_icon__nvdCD::-moz-focus-inner {\n border: 0;\n}\n\n.menu-module_header__xWzbR {\n flex-grow: 1;\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}");export{o as default};
|
|
2
|
+
//# sourceMappingURL=menu.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menuContext.js","sources":["../../../src/components/Menu/menuContext.tsx"],"sourcesContent":["import { useContext, createContext, JSX } from \"solid-js\";\n\ninterface MenuContext {\n registerWithParent: (child: HTMLElement | undefined) => void;\n unregisterWithParent: (child: HTMLElement | undefined) => void;\n};\n\nconst MenuContext = createContext<MenuContext>();\nexport const useMenuContext = () => {\n return useContext(MenuContext);\n};\ninterface MenuProviderProps {\n registerWithParent: (child: HTMLElement | undefined) => void;\n unregisterWithParent: (child: HTMLElement | undefined) => void;\n children: JSX.Element;\n}\nexport const MenuProvider = (props: MenuProviderProps) => {\n return (\n <MenuContext.Provider value={{ registerWithParent: props.registerWithParent, unregisterWithParent: props.unregisterWithParent }}>\n {props.children}\n </MenuContext.Provider>\n );\n};"],"names":["MenuContext","createContext","useMenuContext","useContext"],"mappings":"8EAOA,MAAMA,EAAcC,IACPC,EAAiBA,IACrBC,EAAWH"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{spread as r,mergeProps as o,insert as e,createComponent as t,effect as n,className as i,template as s}from"solid-js/web";import{splitProps as a,createSignal as d,Show as l}from"solid-js";import p from"./menu.module.scss.js";import{Icon as c}from"../Icon/icon.js";import{Button as u}from"../Button/Button.js";import m from"../Icon/generated/outlined/keyboard_arrow_up.js";import h from"../Icon/generated/outlined/keyboard_arrow_down.js";var g=s("<li><span><span></span></span><ul>");const f=s=>{const[f,$]=a(s,["children","class","header","dropListClass"]),[j,w]=d(!1),C=r=>{w(r=>!r)};return v=g(),k=v.firstChild,b=k.firstChild,_=k.nextSibling,r(v,o($,{get class(){return`${p.menuDropdown} ${f.class}`}}),!1,!0),e(b,()=>s?.header?.()),e(k,t(u,{onClick:C,get children(){return[t(l,{get when(){return j()},get children(){return t(c,{icon:m,onClick:r=>{r.stopPropagation()}})}}),t(l,{get when(){return!j()},get children(){return t(c,{icon:h,onClick:r=>{r.stopPropagation()}})}})]}}),null),e(_,()=>s.children),n(r=>{var o=`${p.listHeader}`,e=`${p.header}`,t=`${p.list} ${p.droplist} ${j()?p.openDropList:""} ${f.dropListClass??""}`;return o!==r.e&&i(k,r.e=o),e!==r.t&&i(b,r.t=e),t!==r.a&&i(_,r.a=t),r},{e:void 0,t:void 0,a:void 0}),v;var v,k,b,_};export{f as MenuDropdown};
|
|
2
|
+
//# sourceMappingURL=menuDropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menuDropdown.js","sources":["../../../src/components/Menu/menuDropdown.tsx"],"sourcesContent":["\nimport { Accessor, Component, createSignal, JSX, Setter, Show, splitProps } from \"solid-js\";\n// @ts-ignore\nimport styles from './menu.module.scss';\nimport { Icon } from \"../Icon/icon\";\n// @ts-ignore — generated at build time (prebuild/pretest); types come from outlined.d.ts\nimport { KeyboardArrowUp, KeyboardArrowDown } from \"../Icon/generated/outlined\";\nimport { Button } from \"../Button/Button\";\n\ninterface MenuItemProps extends JSX.HTMLAttributes<HTMLLIElement> {\n children: JSX.Element;\n dropListClass?: string;\n header?: ()=> JSX.Element;\n}\nexport const MenuDropdown:Component<MenuItemProps> = (props) => {\n const [local, others] = splitProps(props, ['children', 'class', 'header', 'dropListClass']);\n const [isOpen, setIsOpen] = createSignal(false);\n const onButtonClick = (e: MouseEvent) => {\n setIsOpen(old => {\n return !old;\n });\n };\n return (\n <>\n <li {...others} class={`${styles.menuDropdown} ${local.class}`}>\n <span class={`${styles.listHeader}`}>\n <span class={`${styles.header}`}>\n {props?.header?.()}\n </span>\n <Button onClick={onButtonClick}>\n <Show when={isOpen()}>\n <Icon icon={KeyboardArrowUp} onClick={(e)=>{\n // onButtonClick(e);\n e.stopPropagation();\n }} />\n </Show>\n <Show when={!isOpen()}>\n <Icon icon={KeyboardArrowDown} onClick={(e)=>{\n // onButtonClick(e);\n e.stopPropagation();\n }} />\n </Show>\n </Button>\n </span>\n <ul class={`${styles.list} ${styles.droplist} ${isOpen() ? styles.openDropList : ''} ${local.dropListClass ?? ''}`}>\n {props.children}\n </ul>\n </li>\n </>\n )\n}"],"names":["MenuDropdown","props","local","others","splitProps","isOpen","setIsOpen","createSignal","onButtonClick","e","old","_el$","_tmpl$","_el$2","firstChild","_el$3","_el$4","nextSibling","_$spread","_$mergeProps","styles","menuDropdown","class","_$insert","header","_$createComponent","Button","onClick","children","Show","when","Icon","icon","KeyboardArrowUp","stopPropagation","KeyboardArrowDown","_$effect","_p$","_v$","listHeader","_v$2","_v$3","list","droplist","openDropList","dropListClass","_$className","t","a","undefined"],"mappings":"yeAcO,MAAMA,EAAyCC,IACpD,MAAOC,EAAOC,GAAUC,EAAWH,EAAO,CAAC,WAAY,QAAS,SAAU,mBACnEI,EAAQC,GAAaC,GAAa,GACnCC,EAAiBC,IACrBH,EAAUI,IACAA,IAGZ,OAAA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from"./menu.module.scss.js";var l=e("<li>");const c=e=>{const[c,i]=m(e,["children","class"]);return n=l(),s(n,r(i,{get class(){return`${t.menuItem} ${c.class}`}}),!1,!0),o(n,()=>c.children),n;var n};export{c as MenuItem};
|
|
2
|
+
//# sourceMappingURL=menuitem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menuitem.js","sources":["../../../src/components/Menu/menuitem.tsx"],"sourcesContent":["import { Component, JSX, splitProps } from \"solid-js\";\n// @ts-ignore\nimport styles from './menu.module.scss';\n\ninterface MenuItemProps extends JSX.HTMLAttributes<HTMLLIElement> {\n children: JSX.Element;\n}\nexport const MenuItem:Component<MenuItemProps> = (props) => {\n const [local, others] = splitProps(props, ['children', 'class']);\n return (\n <li {...others} class={`${styles.menuItem} ${local.class}`}>\n {local.children}\n </li>\n )\n}"],"names":["MenuItem","props","local","others","splitProps","_el$","_tmpl$","_$spread","_$mergeProps","styles","menuItem","class","_$insert","children"],"mappings":"2KAOO,MAAMA,EAAqCC,IAChD,MAAOC,EAAOC,GAAUC,EAAWH,EAAO,CAAC,WAAY,UACvD,OAAAI,EAAAC,IAAAC,EAAAF,EAAAG,EACUL,EAAM,CAAA,SAAA,GAAA,MAAS,GAAGM,EAAOC,YAAYR,EAAMS,OAAO,KAAA,GAAA,GAAAC,EAAAP,EAAA,IACvDH,EAAMW,UAAQR,EAFnB,IAAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import o from"../../styleInject.js";var r={"radio-group__label":"radio-group-module_radio-group__label__UV7dt","radio-group__options":"radio-group-module_radio-group__options__AnbeY","radio-group--disabled":"radio-group-module_radio-group--disabled__sI9-e"};o(".radio-group-module_radio-group__label__UV7dt {\n display: block;\n margin-bottom: 0.5em;\n font-weight: 600;\n}\n\n.radio-group-module_radio-group__options__AnbeY .radio-group-module_radio__6oLZe:not(:last-child) {\n margin-bottom: 0.5em;\n}\n\n.radio-group-module_radio-group--disabled__sI9-e .radio-group-module_radio-group__label__UV7dt {\n color: #ccc;\n}");export{r as default};
|
|
2
|
+
//# sourceMappingURL=radio-group.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-group.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{delegateEvents as e,addEventListener as a,insert as i,memo as d,effect as o,className as r,classList as l,setAttribute as n,template as t,use as s}from"solid-js/web";import{useContext as v,createSignal as c,onMount as u,onCleanup as b}from"solid-js";import{RadioGroupContext as m}from"./radioGroup.js";import p from"./radio.module.scss.js";var h=t("<label><input type=radio><span>"),f=t("<span>");function k(e){const t=v(m),k=!!t,[g,_]=c(e.defaultChecked??!1),y=()=>k?t.selectedValue()===e.value:void 0!==e.checked?e.checked:g(),j=()=>!!(e.disabled||k&&t.disabled),w=a=>{k?t.setSelectedValue(e.value):(void 0===e.checked&&_(!0),e.onChange?.(e.value))};let C;return u(()=>{k&&C&&t.register(C)}),b(()=>{k&&C&&t.unregister(C)}),(()=>{var v=h(),c=v.firstChild,u=c.nextSibling;a(c,"keydown",k?t.handleKeyDown:void 0,!0),c.addEventListener("change",w);var b;return"function"==typeof C?s(C,c):C=c,i(v,(b=d(()=>!!e.label),()=>{return b()&&(a=f(),i(a,()=>e.label),o(()=>r(a,p.radio__label)),a);var a}),null),o(a=>{var i=p.radio,d={[p["radio--disabled"]]:j(),[p["radio--checked"]]:y()},o=p.radio__input,s=k?t.name:e.name,b=j(),m=e.label?void 0:e.ariaLabel,h=p.radio__circle;return i!==a.e&&r(v,a.e=i),a.t=l(v,d,a.t),o!==a.a&&r(c,a.a=o),s!==a.o&&n(c,"name",a.o=s),b!==a.i&&(c.disabled=a.i=b),m!==a.n&&n(c,"aria-label",a.n=m),h!==a.s&&r(u,a.s=h),a},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),o(()=>c.value=e.value.toString()),o(()=>c.checked=y()),v})()}e(["keydown"]);export{k as Radio};
|
|
2
|
+
//# sourceMappingURL=radio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio.js","sources":["../../../src/components/Radio/radio.tsx"],"sourcesContent":["import { JSX, createSignal, onMount, onCleanup, useContext } from \"solid-js\";\nimport { RadioGroupContext, RadioGroupContextType } from \"./radioGroup\";\n// @ts-ignore\nimport styles from \"./radio.module.scss\";\n\ninterface RadioProps {\n value: string | number;\n label?: string | JSX.Element;\n checked?: boolean;\n defaultChecked?: boolean;\n onChange?: (value: string | number) => void;\n disabled?: boolean;\n name?: string;\n ariaLabel?: string;\n}\n\nexport function Radio(props: RadioProps) {\n const group = useContext(RadioGroupContext) as RadioGroupContextType | undefined;\n const isInGroup = !!group;\n \n // Manage controlled vs. uncontrolled state\n const [internalChecked, setInternalChecked] = createSignal(props.defaultChecked ?? false);\n const checkedState = () => {\n if (isInGroup) {\n return group!.selectedValue() === props.value;\n }\n return props.checked !== undefined ? props.checked : internalChecked();\n };\n\n const isDisabled = () => !!(props.disabled || (isInGroup && group!.disabled));\n\n const handleChange = (e: Event) => {\n if (isInGroup) {\n group!.setSelectedValue(props.value);\n } else {\n if (props.checked === undefined) {\n setInternalChecked(true);\n }\n props.onChange?.(props.value);\n }\n };\n\n let inputRef: HTMLInputElement | undefined;\n onMount(() => {\n if (isInGroup && inputRef) {\n group!.register(inputRef);\n }\n });\n onCleanup(() => {\n if (isInGroup && inputRef) {\n group!.unregister(inputRef);\n }\n });\n\n return (\n <label \n class={styles.radio} \n classList={{\n [styles[\"radio--disabled\"]]: isDisabled(),\n [styles[\"radio--checked\"]]: checkedState(),\n }}\n >\n <input\n ref={inputRef}\n type=\"radio\"\n class={styles[\"radio__input\"]}\n name={isInGroup ? group!.name : props.name}\n value={props.value.toString()}\n checked={checkedState()}\n disabled={isDisabled()}\n aria-label={props.label ? undefined : props.ariaLabel}\n onChange={handleChange}\n onKeyDown={isInGroup ? group!.handleKeyDown : undefined}\n />\n <span class={styles[\"radio__circle\"]} />\n {props.label && <span class={styles[\"radio__label\"]}>{props.label}</span>}\n </label>\n );\n}\n"],"names":["Radio","props","group","useContext","RadioGroupContext","isInGroup","internalChecked","setInternalChecked","createSignal","defaultChecked","checkedState","selectedValue","value","undefined","checked","isDisabled","disabled","handleChange","e","setSelectedValue","onChange","inputRef","onMount","register","onCleanup","unregister","_el$","_tmpl$","_el$2","firstChild","_el$3","nextSibling","_$addEventListener","handleKeyDown","addEventListener","_c$","_$use","_$insert","_$memo","label","_el$4","_tmpl$2","_$effect","_$className","styles","_p$","_v$","radio","_v$2","_v$3","_v$4","name","_v$5","_v$6","ariaLabel","_v$7","t","_$classList","a","o","_$setAttribute","i","n","s","toString","_$delegateEvents"],"mappings":"oZAgBM,SAAUA,EAAMC,GACpB,MAAMC,EAAQC,EAAWC,GACnBC,IAAcH,GAGbI,EAAiBC,GAAsBC,EAAaP,EAAMQ,iBAAkB,GAC7EC,EAAeA,IACfL,EACKH,EAAOS,kBAAoBV,EAAMW,WAEjBC,IAAlBZ,EAAMa,QAAwBb,EAAMa,QAAUR,IAGjDS,EAAaA,OAASd,EAAMe,UAAaX,GAAaH,EAAOc,UAE7DC,EAAgBC,IAChBb,EACFH,EAAOiB,iBAAiBlB,EAAMW,aAERC,IAAlBZ,EAAMa,SACRP,GAAmB,GAErBN,EAAMmB,WAAWnB,EAAMW,SAI3B,IAAIS,EAYJ,OAXAC,EAAQ,KACFjB,GAAagB,GACfnB,EAAOqB,SAASF,KAGpBG,EAAU,KACJnB,GAAagB,GACfnB,EAAOuB,WAAWJ,KAItB,MAAA,IAAAK,EAAAC,IAAAC,EAAAF,EAAAG,WAAAC,EAAAF,EAAAG,YAAAC,EAAAJ,EAAA,UAkBiBvB,EAAYH,EAAO+B,mBAAgBpB,GAAS,GAAAe,EAAAM,iBAAA,SAD7CjB,GAAY,IARTkB,EAKU,MALV,mBAARd,EAAQe,EAARf,EAAQO,GAARP,EAAQO,EAAAS,EAAAX,GAAAS,EAAA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io--disabled":"radio-module_radio--disabled__oPPg9",radio__input:"radio-module_radio__input__64jm3",radio__circle:"radio-module_radio__circle__oVf3f",radio__label:"radio-module_radio__label__ktLh-"};o('.radio-module_radio__HTGQn {\n display: flex;\n align-items: center;\n cursor: pointer;\n}\n\n.radio-module_radio--disabled__oPPg9 {\n cursor: not-allowed;\n}\n\n.radio-module_radio__input__64jm3 {\n position: absolute;\n opacity: 0;\n pointer-events: none;\n}\n\n.radio-module_radio__circle__oVf3f {\n position: relative;\n width: 16px;\n height: 16px;\n border: 2px solid #666;\n border-radius: 50%;\n background: transparent;\n margin-right: 0.5em;\n flex-shrink: 0;\n}\n\n.radio-module_radio__circle__oVf3f:after {\n content: "";\n position: absolute;\n top: 50%;\n left: 50%;\n width: 8px;\n height: 8px;\n background: #007bff;\n border-radius: 50%;\n transform: translate(-50%, -50%);\n display: none;\n}\n\n.radio-module_radio__input__64jm3:checked + .radio-module_radio__circle__oVf3f {\n border-color: #007bff;\n}\n\n.radio-module_radio__input__64jm3:checked + .radio-module_radio__circle__oVf3f:after {\n display: block;\n}\n\n.radio-module_radio__HTGQn:hover .radio-module_radio__circle__oVf3f {\n border-color: #444;\n}\n\n.radio-module_radio__HTGQn:focus-within .radio-module_radio__circle__oVf3f {\n outline: 2px solid #80bdff;\n outline-offset: 2px;\n}\n\n.radio-module_radio__label__ktLh- {\n vertical-align: middle;\n}\n\n.radio-module_radio__input__64jm3:disabled + .radio-module_radio__circle__oVf3f {\n border-color: #ccc;\n}\n\n.radio-module_radio__input__64jm3:disabled + .radio-module_radio__circle__oVf3f:after {\n background: #ccc;\n}\n\n.radio-module_radio--disabled__oPPg9 .radio-module_radio__label__ktLh- {\n color: #ccc;\n}');export{d as default};
|
|
2
|
+
//# sourceMappingURL=radio.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{insert as e,memo as r,setAttribute as o,effect as a,className as i,createComponent as l,classList as t,template as d}from"solid-js/web";import{createContext as n,createSignal as s}from"solid-js";import{useFormProvider as u}from"../FormField/formProvider.js";import{useFormContext as f}from"../Form/form.js";import{useDirectFormBinding as m}from"../Form/useDirectFormBinding.js";import v from"./radio-group.module.scss.js";var p=d("<div><div role=radiogroup>"),c=d("<div>");const g=n();let b=0;function h(d){b++;const n=d.name??`radio-group-${b}`,[h,D]=s(d.defaultValue);u();const w=f(),A=m({formName:d.formName,formIndex:d.formIndex,formArrayName:d.formArrayName}),j=A.formName,x=e=>{void 0===d.value&&D(e),A.isFormArray&&j?A.setValue(e):j&&w?.formGroup?.set&&(w.formGroup.set(j,e),w.setData(r=>({...r,[j]:e}))),d.onChange?.(e)},y=[],F={name:n,selectedValue:()=>void 0!==d.value?d.value:h(),setSelectedValue:x,register:e=>{y.push(e)},unregister:e=>{const r=y.indexOf(e);r>=0&&y.splice(r,1)},handleKeyDown:e=>{const r=e.key;if("ArrowLeft"===r||"ArrowUp"===r||"Left"===r||"Up"===r){e.preventDefault();const r=y.indexOf(e.currentTarget),o=r>0?r-1:y.length-1,a=y[o];x(a.value),a.focus()}else if("ArrowRight"===r||"ArrowDown"===r||"Right"===r||"Down"===r){e.preventDefault();const r=y.indexOf(e.currentTarget),o=r<y.length-1?r+1:0,a=y[o];x(a.value),a.focus()}else if("Home"===r)e.preventDefault(),y.length>0&&(x(y[0].value),y[0].focus());else if("End"===r&&(e.preventDefault(),y.length>0)){const e=y.length-1;x(y[e].value),y[e].focus()}},disabled:!!d.disabled};return V=p(),_=V.firstChild,e(V,(N=r(()=>!!d.label),()=>{return N()&&(r=c(),o(r,"id",`${n}-label`),e(r,()=>d.label),a(()=>i(r,v["radio-group__label"])),r);var r}),_),e(_,l(g.Provider,{value:F,get children(){return d.children}})),a(e=>{var r=v["radio-group"],a={[v["radio-group--disabled"]]:d.disabled},l=v["radio-group__options"],s=d.label?`${n}-label`:void 0,u=d.label?void 0:d.ariaLabel,f=d.disabled?"true":void 0;return r!==e.e&&i(V,e.e=r),e.t=t(V,a,e.t),l!==e.a&&i(_,e.a=l),s!==e.o&&o(_,"aria-labelledby",e.o=s),u!==e.i&&o(_,"aria-label",e.i=u),f!==e.n&&o(_,"aria-disabled",e.n=f),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),V;var N,V,_}export{h as RadioGroup,g as RadioGroupContext};
|
|
2
|
+
//# sourceMappingURL=radioGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radioGroup.js","sources":["../../../src/components/Radio/radioGroup.tsx"],"sourcesContent":["import { createSignal, createContext, JSX } from \"solid-js\";\nimport { useFormProvider } from \"../FormField/formProvider\";\nimport { useFormContext } from \"../Form/form\";\nimport { useDirectFormBinding } from \"../Form/useDirectFormBinding\";\n// @ts-ignore\nimport styles from \"./radio-group.module.scss\";\n\ninterface RadioGroupProps {\n name?: string;\n label?: string;\n ariaLabel?: string;\n value?: string | number;\n defaultValue?: string | number;\n onChange?: (value: string | number) => void;\n disabled?: boolean;\n children: JSX.Element | JSX.Element[];\n formName?: string;\n formIndex?: number;\n formArrayName?: string;\n}\n\nexport interface RadioGroupContextType {\n name: string;\n selectedValue: () => string | number | undefined;\n setSelectedValue: (val: string | number) => void;\n register: (el: HTMLInputElement) => void;\n unregister: (el: HTMLInputElement) => void;\n handleKeyDown: (e: KeyboardEvent) => void;\n disabled: boolean;\n}\n\nexport const RadioGroupContext = createContext<RadioGroupContextType>();\n\nlet radioGroupCount = 0;\n\nexport function RadioGroup(props: RadioGroupProps) {\n radioGroupCount++;\n const groupName = props.name ?? `radio-group-${radioGroupCount}`;\n\n const [internalValue, setInternalValue] = createSignal(props.defaultValue);\n const formField = useFormProvider<any>();\n const formContext = useFormContext<any>();\n const binding = useDirectFormBinding({ formName: props.formName, formIndex: props.formIndex, formArrayName: props.formArrayName });\n const effectiveFormName = binding.formName;\n const selectedValue = () =>\n props.value !== undefined ? props.value : internalValue();\n const setSelectedValue = (val: string | number) => {\n if (props.value === undefined) {\n setInternalValue(val);\n }\n // Bridge to FormGroup/FormArray\n if (binding.isFormArray && effectiveFormName) {\n binding.setValue(val);\n } else if (effectiveFormName && formContext?.formGroup?.set) {\n formContext.formGroup.set(effectiveFormName as any, val as any);\n formContext.setData((old: any) => ({ ...old, [effectiveFormName!]: val }));\n }\n props.onChange?.(val);\n };\n\n const radioRefs: HTMLInputElement[] = [];\n\n const register = (el: HTMLInputElement) => {\n radioRefs.push(el);\n };\n\n const unregister = (el: HTMLInputElement) => {\n const index = radioRefs.indexOf(el);\n if (index >= 0) {\n radioRefs.splice(index, 1);\n }\n };\n\n const handleKeyDown = (e: KeyboardEvent) => {\n const key = e.key;\n if (key === \"ArrowLeft\" || key === \"ArrowUp\" || key === \"Left\" || key === \"Up\") {\n e.preventDefault();\n const currentIndex = radioRefs.indexOf(e.currentTarget as HTMLInputElement);\n const prevIndex = currentIndex > 0 ? currentIndex - 1 : radioRefs.length - 1;\n const prevRadio = radioRefs[prevIndex];\n setSelectedValue(prevRadio.value);\n prevRadio.focus();\n } else if (key === \"ArrowRight\" || key === \"ArrowDown\" || key === \"Right\" || key === \"Down\") {\n e.preventDefault();\n const currentIndex = radioRefs.indexOf(e.currentTarget as HTMLInputElement);\n const nextIndex = currentIndex < radioRefs.length - 1 ? currentIndex + 1 : 0;\n const nextRadio = radioRefs[nextIndex];\n setSelectedValue(nextRadio.value);\n nextRadio.focus();\n } else if (key === \"Home\") {\n e.preventDefault();\n if (radioRefs.length > 0) {\n setSelectedValue(radioRefs[0].value);\n radioRefs[0].focus();\n }\n } else if (key === \"End\") {\n e.preventDefault();\n if (radioRefs.length > 0) {\n const lastIndex = radioRefs.length - 1;\n setSelectedValue(radioRefs[lastIndex].value);\n radioRefs[lastIndex].focus();\n }\n }\n };\n\n const contextValue: RadioGroupContextType = {\n name: groupName,\n selectedValue,\n setSelectedValue,\n register,\n unregister,\n handleKeyDown,\n disabled: !!props.disabled\n };\n\n return (\n <div \n class={styles[\"radio-group\"]} \n classList={{\n [styles[\"radio-group--disabled\"]]: props.disabled\n }}\n >\n {props.label && (\n <div \n class={styles[\"radio-group__label\"]} \n id={`${groupName}-label`}\n >\n {props.label}\n </div>\n )}\n <div\n class={styles[\"radio-group__options\"]}\n role=\"radiogroup\"\n aria-labelledby={props.label ? `${groupName}-label` : undefined}\n aria-label={props.label ? undefined : props.ariaLabel}\n aria-disabled={props.disabled ? \"true\" : undefined}\n >\n <RadioGroupContext.Provider value={contextValue}>\n {props.children}\n </RadioGroupContext.Provider>\n </div>\n </div>\n );\n}\n"],"names":["RadioGroupContext","createContext","radioGroupCount","RadioGroup","props","groupName","name","internalValue","setInternalValue","createSignal","defaultValue","useFormProvider","formContext","useFormContext","binding","useDirectFormBinding","formName","formIndex","formArrayName","effectiveFormName","setSelectedValue","val","undefined","value","isFormArray","setValue","formGroup","set","setData","old","onChange","radioRefs","contextValue","selectedValue","register","el","push","unregister","index","indexOf","splice","handleKeyDown","e","key","preventDefault","currentIndex","currentTarget","prevIndex","length","prevRadio","focus","nextIndex","nextRadio","lastIndex","disabled","_el$","_tmpl$","_el$2","firstChild","_$insert","_c$","_$memo","label","_el$3","_tmpl$2","_$setAttribute","_$effect","_$className","styles","_$createComponent","Provider","children","_p$","_v$","_v$2","_v$3","_v$4","_v$5","ariaLabel","_v$6","t","_$classList","a","o","i","n"],"mappings":"geA+BO,MAAMA,EAAoBC,IAEjC,IAAIC,EAAkB,EAEhB,SAAUC,EAAWC,GACzBF,IACA,MAAMG,EAAYD,EAAME,MAAQ,eAAeJ,KAExCK,EAAeC,GAAoBC,EAAaL,EAAMM,cAC3CC,IAClB,MAAMC,EAAcC,IACdC,EAAUC,EAAqB,CAAEC,SAAUZ,EAAMY,SAAUC,UAAWb,EAAMa,UAAWC,cAAed,EAAMc,gBAC5GC,EAAoBL,EAAQE,SAG5BI,EAAoBC,SACJC,IAAhBlB,EAAMmB,OACRf,EAAiBa,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
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{delegateEvents as e,insert as t,getOwner as r,effect as o,setAttribute as i,className as s,classList as a,template as l,use as n}from"solid-js/web";import{onMount as m,onCleanup as d}from"solid-js";import c from"./selectStyles.module.scss.js";import{useFormProvider as f}from"../FormField/formProvider.js";import{useFormContext as u}from"../Form/form.js";import{useSelectContext as p}from"./selectContext.js";var v=l("<div role=option><span></span><span is=coles-select-label>",!0,!1,!1);function N(e){const l=f(),N=u(),g=p();let h;m(()=>{const t=h?.textContent?.trim()??("string"==typeof e.children||"number"==typeof e.children?String(e.children):"");g.registerOption?.(e.value,e.children,t)}),d(()=>g.unregisterOption?.(e.value));const _=t=>{if(g?.isDisabled?.())return;t.stopPropagation();const r=g?.commitValue?.(e.value)??!1,o=!!r||(e=>{if(N){const t=N.data[g?.formName??l?.formName??""];if(l?.setFocused?.(!0),Array.isArray(t)){if(t.includes(e)){const r=t.filter(t=>t!==e);return N?.formGroup?.set?.(g?.formName??l?.formName??"",r),N.setData(e=>({...e,[g?.formName??l?.formName??""]:r})),!0}return N?.formGroup?.set?.(g?.formName??l?.formName??"",[...t,e]),N.setData(r=>({...r,[g?.formName??l?.formName??""]:[...t,e]})),!0}return N?.formGroup?.set?.(g?.formName??l?.formName??"",e),N.setData(t=>({...t,[g?.formName??l?.formName??""]:e})),!0}return!1})(e.value);r||o||(e=>{if(l?.getName?.()){const t=l.getValue();if(l.setFocused(!0),Array.isArray(t)){if(t.includes(e)){const r=t.filter(t=>t!==e);return 0===r.length?l.setTextInside(!1):l.setTextInside(!0),l.setValue(r),!0}return l.setValue([...t,e]),l.setTextInside(!0),!0}return l.setValue(e),!0}})(e.value),l?.getName?.()||g?.formName?g.closeDropdown?.():g.selectValue?.(e.value),l?.setFocused?.(!0)};return(()=>{var l=v(),m=l.firstChild,d=m.nextSibling;l.$$click=_,t(m,()=>g?.isSelected?.(e.value)?"✓":"");return"function"==typeof h?n(h,d):h=d,d._$owner=r(),t(d,()=>e.children??""),o(t=>{var r=g?.isSelected?.(e.value)??!1,o=g?.isDisabled?.()??!1,n=`${c.solid_select__option} ${e.class||""} ${g?.isDisabled?.()?c.solid_select__option_disabled:""}`,f={selected:g?.isSelected?.(e.value)??!1,[c.solid_select__option_highlight]:g?.isHighlighted?.(e.value)??!1},u=`${c.checkmark}`,p=`${c["option-label"]}`;return r!==t.e&&i(l,"aria-selected",t.e=r),o!==t.t&&i(l,"aria-disabled",t.t=o),n!==t.a&&s(l,t.a=n),t.o=a(l,f,t.o),u!==t.i&&s(m,t.i=u),p!==t.n&&s(d,t.n=p),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),l})()}e(["click"]);export{N as Option};
|
|
2
|
+
//# sourceMappingURL=option.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"option.component.js","sources":["../../../src/components/Select/option.component.tsx"],"sourcesContent":["import { useContext, onMount, onCleanup, JSX } from \"solid-js\";\n// @ts-ignore\nimport styles from './selectStyles.module.scss';\nimport { useFormProvider } from \"../FormField/formProvider\";\nimport { useFormContext } from \"../Form/form\";\nimport { useSelectContext } from \"./selectContext\";\ninterface OptionProps<T> {\n value: T;\n children?: JSX.Element; \n class?: string; \n}\n\nexport function Option<T>(props: OptionProps<T>) {\n const formField = useFormProvider<T>();\n const formContext = useFormContext();\n const select = useSelectContext();\n let labelRef: HTMLSpanElement | undefined;\n\n onMount(() => {\n const labelText = labelRef?.textContent?.trim() ?? (typeof props.children === \"string\" || typeof props.children === \"number\" ? String(props.children) : \"\");\n select.registerOption?.(props.value, props.children, labelText);\n });\n onCleanup(() => select.unregisterOption?.(props.value));\n\n const selectFormFieldValue = (value: any) => {\n if (!!formField?.getName?.()) {\n const currentValue = formField.getValue();\n formField.setFocused(true);\n if (Array.isArray(currentValue)) {\n if (currentValue.includes(value)) {\n const setValue = currentValue.filter((val: any) => val !== value);\n setValue.length === 0 ? formField.setTextInside(false) : formField.setTextInside(true);\n formField.setValue(setValue as any);\n return true;\n } else {\n formField.setValue([...currentValue, value] as any);\n formField.setTextInside(true);\n return true;\n }\n } else {\n formField.setValue(value);\n return true;\n }\n }\n return false;\n };\n const selectFormContextValue = (value: T) => {\n if (formContext) {\n const currentValue = formContext.data[select?.formName ?? formField?.formName ?? ''];\n formField?.setFocused?.(true);\n if (Array.isArray(currentValue)) {\n if (currentValue.includes(value)) {\n const setValue = currentValue.filter((val: any) => val !== value);\n formContext?.formGroup?.set?.(select?.formName ?? formField?.formName ?? '', setValue);\n formContext.setData((old: any) => ({...old, [select?.formName ?? formField?.formName ?? '']: setValue}));\n return true;\n } else {\n formContext?.formGroup?.set?.(select?.formName ?? formField?.formName ?? '', [...currentValue, value]);\n formContext.setData((old: any) => ({...old, [select?.formName ?? formField?.formName ?? '']: [...currentValue, value]}));\n\n return true;\n }\n } else {\n formContext?.formGroup?.set?.(select?.formName ?? formField?.formName ?? '', value);\n formContext.setData((old: any) => ({...old, [select?.formName ?? formField?.formName ?? '']: value}));\n return true;\n }\n }\n \n return false;\n };\n\n const handleClick = (e: MouseEvent) => {\n if (select?.isDisabled?.()) return;\n e.stopPropagation();\n // FormArray-bound selects commit through the Select's own binding first\n // (FormContext/FormField fallbacks cannot address an array item).\n const arrayHandled = select?.commitValue?.(props.value) ?? false;\n const contextSuccess = arrayHandled ? true : selectFormContextValue(props.value);\n if (!arrayHandled && !contextSuccess) {\n selectFormFieldValue(props.value);\n }\n if (!formField?.getName?.() && !select?.formName) {\n select.selectValue?.(props.value);\n } else {\n // Form handled the value — still need to close for single select\n select.closeDropdown?.();\n }\n formField?.setFocused?.(true);\n };\n return (\n <div \n role=\"option\"\n aria-selected={select?.isSelected?.(props.value) ?? false}\n aria-disabled={select?.isDisabled?.() ?? false}\n class={`${styles['solid_select__option']} ${props.class || \"\"} ${select?.isDisabled?.() ? styles.solid_select__option_disabled : \"\"}`} \n classList={{ \n \"selected\": select?.isSelected?.(props.value) ?? false,\n [styles.solid_select__option_highlight]: select?.isHighlighted?.(props.value) ?? false\n }} \n onClick={handleClick}\n >\n <span class={`${styles['checkmark']}`}>{select?.isSelected?.(props.value) ?? false ? \"✓\" : \"\"}</span>\n <span ref={labelRef} is=\"coles-select-label\" class={`${styles['option-label']}`}>{props.children ?? \"\"}</span>\n </div>\n );\n}\n"],"names":["Option","props","formField","useFormProvider","formContext","useFormContext","select","useSelectContext","labelRef","onMount","labelText","textContent","trim","children","String","registerOption","value","onCleanup","unregisterOption","handleClick","e","isDisabled","stopPropagation","arrayHandled","commitValue","contextSuccess","currentValue","data","formName","setFocused","Array","isArray","includes","setValue","filter","val","formGroup","set","setData","old","selectFormContextValue","getName","getValue","length","setTextInside","selectFormFieldValue","closeDropdown","selectValue","_el$","_tmpl$","_el$2","firstChild","_el$3","nextSibling","$$click","_$insert","isSelected","_$use","_$owner","_$getOwner","_$effect","_p$","_v$","_v$2","_v$3","styles","class","solid_select__option_disabled","_v$4","selected","solid_select__option_highlight","isHighlighted","_v$5","_v$6","_$setAttribute","t","a","_$className","o","_$classList","i","n","undefined","_$delegateEvents"],"mappings":"+eAYM,SAAUA,EAAUC,GACxB,MAAMC,EAAYC,IACZC,EAAcC,IACdC,EAASC,IACf,IAAIC,EAEJC,EAAQ,KACN,MAAMC,EAAYF,GAAUG,aAAaC,SAAqC,iBAAnBX,EAAMY,UAAmD,iBAAnBZ,EAAMY,SAAwBC,OAAOb,EAAMY,UAAY,IACxJP,EAAOS,iBAAiBd,EAAMe,MAAOf,EAAMY,SAAUH,KAEvDO,EAAU,IAAMX,EAAOY,mBAAmBjB,EAAMe,QAEhD,MAgDMG,EAAeC,IACnB,GAAId,GAAQe,eAAgB,OAC5BD,EAAEE,kBAGF,MAAMC,EAAejB,GAAQkB,cAAcvB,EAAMe,SAAU,EACrDS,IAAiBF,GAhCOP,KAC9B,GAAIZ,EAAa,CACf,MAAMsB,EAAetB,EAAYuB,KAAKrB,GAAQsB,UAAY1B,GAAW0B,UAAY,IAEjF,GADA1B,GAAW2B,cAAa,GACp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AAlC,CAAA,EAbnF,EAgBF,CAACmC,EAAA,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{delegateEvents as e,effect as t,className as o,insert as r,addEventListener as i,use as l,getOwner as s,createComponent as n,Portal as a,setAttribute as d,template as c}from"solid-js/web";import{createSignal as u,createMemo as p,createEffect as f,onMount as m,children as g,onCleanup as h,Show as _}from"solid-js";import v from"./selectStyles.module.scss.js";import{isMobile as y,isNullish as b}from"../../tools/tools.js";import{useClickOutside as k}from"../../tools/eventTools.js";import{useOverlayPosition as w}from"../../tools/useOverlayPosition.js";import{useFormProvider as $}from"../FormField/formProvider.js";import{useFormContext as x}from"../Form/form.js";import{useDirectFormBinding as D}from"../Form/useDirectFormBinding.js";import{ignoreWindowManager as T}from"../../globalWindowManager.js";import{SelectContextProvider as S}from"./selectContext.js";import{useSelectOptions as F}from"./useSelectOptions.js";import{useHighlight as C}from"./useHighlight.js";import{useTypeahead as V}from"./useTypeahead.js";var j=c("<span style=opacity:0>"),A=c("<span>"),I=c("<span style=width:100%;height:100%>"),O=c("<span>▲"),N=c("<span>▼"),E=c("<div>"),M=c("<div><button type=button>Done"),G=c("<div><div role=dialog aria-modal=true tabindex=-1><div><span></span><button type=button aria-label=Close>✕</button></div><div role=listbox>"),H=c("<div is=coles-solid-select role=button tabindex=0><div style=height:100%><span>",!0,!1,!1);function q(e){const c=void 0!==e.multiple||!0===e.multiple,[q,R]=u("primary"),K=c?e.value??e.defaultValue??[]:e.value??e.defaultValue??void 0,[J,L]=u(K),[P,B]=u(),[U,W]=u(),[z,Q]=u(),[X,Y]=u();let Z;const ee=p(()=>{const t=e.mobileMode??"auto";return"popup"===t?"popup":"desktop"===t?"desktop":y()?"popup":"desktop"}),te=$(),oe=x(),re=D({formName:e.formName,formIndex:e.formIndex,formArrayName:e.formArrayName}),ie=re.formName,le=!!(ie||ie||te?.getName||te?.getValue||te?.setValue||te?.getTextInside),se=le&&!!oe?.formGroup,ne=()=>re.isFormArray?re.getValue():se?oe.data?.[ie??""]:le?te.getValue():b(e?.value)?J():e?.value,[ae,de]=u(!1),ce=()=>{const t=te?.getFormFieldRef?.(),o=!!t?.hasAttribute?.("disabled");return!!e.disabled||o},ue=p(()=>te?.getFormFieldRef?te.getFormFieldRef():P()),{options:pe,registerOption:fe,unregisterOption:me,optionEntries:ge,getOptionLabelText:he,getLabel:_e}=F(),ve=e=>{const t=ne();return c?Array.isArray(t)&&t.includes(e):t===e},ye=p(()=>"popup"===ee()?X():z()),{highlightedIndex:be,setHighlightedIndex:ke,moveHighlight:we,setHighlightToSelectedOrFirst:$e,scrollHighlightedIntoView:xe}=C({optionEntries:ge,isSelected:ve,dropdownRef:ye}),{handleTypeahead:De,resetTypeahead:Te}=V({optionEntries:ge,highlightedIndex:be,getOptionLabelText:he,onMatch:e=>{ke(e),queueMicrotask(()=>xe(e))}}),{dropTop:Se,updatePosition:Fe}=w(ue,z,ae),Ce=t=>{if(ie&&oe?.formGroup?.markDirty){const e=oe.formGroup.getMeta(ie);e&&!e.dirty&&oe.formGroup.markDirty(ie)}if(c){const o=ne()??[];let r;r=o.includes(t)?o.filter(e=>e!==t):[...o,t];const i=Z?.scrollTop;L(()=>r),e?.onChange?.(r),e?.onSelect?.(r),null!=i&&Z&&queueMicrotask(()=>{Z.scrollTop=i})}else L(()=>t),e?.onChange?.(t),e?.onSelect?.(t),de(!1)},Ve=t=>{if(!re.isFormArray)return!1;if(re.markDirty?.(),c){const o=re.getValue()??[],r=o.includes(t)?o.filter(e=>e!==t):[...o,t];re.setValue(r),L(()=>r),e?.onChange?.(r),e?.onSelect?.(r)}else re.setValue(t),L(()=>t),e?.onChange?.(t),e?.onSelect?.(t),de(!1);return!0},je=p(()=>{const i=ne();if(c){const l=Array.isArray(i)?i:[];if(0===l.length)return le&&te.getTextInside()&&!te.getFocused()?(u=j(),t(()=>o(u,`${v.solid_select__placeholder}`)),u):(d=A(),r(d,()=>e.placeholder||"Select..."),t(()=>o(d,`${v.solid_select__placeholder}`)),d);if(e.renderValue)return e.renderValue(l);{const e=l.map(e=>pe[JSON.stringify(e)]?.label||String(e));return a=I(),r(a,()=>e.join(", ")),t(()=>o(a,`${v.solid_select__value} ${v["multiselect-value"]}`)),a}}{const a=i;return b(a)||"string"==typeof a&&!a.trim()?le&&te.getTextInside()&&!te.getFocused()?(n=A(),t(()=>o(n,`${v.solid_select__placeholder}`)),n):(s=A(),r(s,()=>e.placeholder||"Select..."),t(()=>o(s,`${v.solid_select__placeholder}`)),s):e.renderValue?e.renderValue(a):(l=A(),r(l,()=>_e(a)),t(()=>o(l,`${v.solid_select__value}`)),l)}var l,s,n,a,d,u});f(()=>{if(se){const e=ne();L(e)}}),f(()=>{const e=J();le&&te.setValue?.(e)});const Ae=void 0!==e.transparent||!0===e.transparent?"solid_select__transparent":"";f(()=>{e?.onChange&&e.onChange(ne())}),k([z,U,P],()=>{ce()||"popup"!==ee()&&(de(!1),te?.setFocused?.(e=>(e&&oe?.formGroup?.validate?.(ie??""),!1)))}),m(()=>{if(le){const e=ne()??c?[]:void 0,t=e;if(c){const o=t.every(e=>!!pe[JSON.stringify(e)]);e&&e.length>0&&o?(te.setTextInside(!0),L?.(e=>[...e??[],...t])):te.setTextInside(!1)}else t?pe[JSON.stringify(t)]?(te.setTextInside(!0),L?.(e)):te.setTextInside(!1):(te.setTextInside(!1),L?.(e))}const e=z();e&&T(e)});const Ie=()=>{de(!1),te?.setFocused?.(e=>(e&&oe?.formGroup?.validate?.(ie??""),!1))};g(()=>e.children),f(()=>{const e="popup"===ee()?X():z();te?.setOverlayRef?.(e)}),h(()=>te?.setOverlayRef?.(void 0)),f(()=>{ae()?($e(),"popup"===ee()&&queueMicrotask(()=>X()?.focus())):(ke(-1),Te())}),f(()=>{e.disabled&&de(!1)});const Oe=p(()=>({isSelected:ve,selectValue:Ce,registerOption:fe,unregisterOption:me,isHighlighted:e=>{const t=JSON.stringify(e),o=ge().findIndex(e=>e.value===t);return o>=0&&o===be()},selectRef:P,selectStyle:q,isDisabled:ce,closeDropdown:()=>{c||de(!1)},formName:ie,commitValue:Ve})),Ne=()=>{ae()||(Fe(),de(!0))},Ee=e=>{if(!ce())if("Tab"!==e.key)if("ArrowDown"===e.key)e.preventDefault(),ae()?we(1):(Ne(),$e());else if("ArrowUp"===e.key)e.preventDefault(),ae()?we(-1):(Ne(),$e());else if("Home"===e.key)e.preventDefault(),ae()||Ne(),ge().length&&(ke(0),queueMicrotask(()=>xe(0)));else if("End"===e.key){e.preventDefault(),ae()||Ne();const t=ge();if(t.length){const e=t.length-1;ke(e),queueMicrotask(()=>xe(e))}}else if("Enter"===e.key){const t=ge(),o=be();if(ae()&&t.length&&o>=0&&o<t.length){e.preventDefault();const r=z(),i=r?.querySelectorAll('[role="option"]'),l=i?.[o];l?l.click():Ce(t[o].raw)}}else"Escape"===e.key?de(!1):1!==e.key.length||e.metaKey||e.ctrlKey||e.altKey||(ae()||Ne(),e.preventDefault(),De(e.key));else de(!1)},Me=p(()=>{const t=te?.getName?.();return t&&t.trim()?t.trim():e.placeholder?e.placeholder:""}),Ge=e=>{if(!ce())if("Escape"===e.key)Ie();else if("ArrowDown"===e.key)e.preventDefault(),we(1);else if("ArrowUp"===e.key)e.preventDefault(),we(-1);else if("Enter"===e.key){const t=ge(),o=be();if(t.length&&o>=0&&o<t.length){e.preventDefault();const r=X(),i=r?.querySelectorAll('[role="option"]'),l=i?.[o];l?l.click():Ce(t[o].raw)}}else 1!==e.key.length||e.metaKey||e.ctrlKey||e.altKey||(e.preventDefault(),De(e.key))};return He=H(),qe=He.firstChild,Re=qe.firstChild,i(He,"keydown","popup"===ee()?void 0:Ee,!0),He.$$click=e=>{if(ce())return;const t=e.target;z()?.contains(t)||X()?.contains(t)||(e.currentTarget?.focus?.(),ae()?de(!1):Ne())},He.addEventListener("focus",()=>{if(!ce()&&(te?.setFocused?.(!0),ie&&oe?.formGroup?.markDirty)){const e=oe.formGroup.getMeta(ie);e&&!e.dirty&&oe.formGroup.markDirty(ie)}}),l(W,He),He._$owner=s(),l(B,qe),r(Re,je),r(qe,n(_,{get when(){return ae()},get children(){var e=O();return t(()=>o(e,v.solid_select__arrow)),e}}),null),r(qe,n(_,{get when(){return!ae()},get children(){var e=N();return t(()=>o(e,v.solid_select__arrow)),e}}),null),r(He,n(S,{get value(){return Oe()},get children(){return[n(_,{get when(){return"desktop"===ee()},get children(){return n(a,{get children(){var i=E();return l(Q,i),r(i,()=>e.children),t(()=>o(i,`${v.solid_select__dropdown} ${Se()?v.dropTop:v.dropBottom} ${ae()?v.open:""} ${e.dropdownClass||""}`)),i}})}}),n(_,{get when(){return"popup"===ee()},get children(){return n(a,{get children(){return n(_,{get when(){return ae()},get children(){var i=G(),s=i.firstChild,a=s.firstChild,u=a.firstChild,p=u.nextSibling,f=a.nextSibling;return i.$$mousedown=e=>{e.target===e.currentTarget&&Ie()},l(e=>T(e),i),s.$$keydown=Ge,l(Y,s),r(u,Me),p.$$click=()=>Ie(),"function"==typeof Z?l(Z,f):Z=f,r(f,()=>e.children),r(s,n(_,{when:c,get children(){var e=M(),r=e.firstChild;return r.$$click=()=>Ie(),t(t=>{var i=v.solid_select__mobile_footer,l=v.solid_select__mobile_done;return i!==t.e&&o(e,t.e=i),l!==t.t&&o(r,t.t=l),t},{e:void 0,t:void 0}),e}}),null),t(t=>{var r=v.solid_select__mobile_backdrop,l=Me()||void 0,n=`${v.solid_select__mobile_popup} ${e.dropdownClass||""}`,c=v.solid_select__mobile_header,m=v.solid_select__mobile_title,g=v.solid_select__mobile_close,h=v.solid_select__mobile_options;return r!==t.e&&o(i,t.e=r),l!==t.t&&d(s,"aria-label",t.t=l),n!==t.a&&o(s,t.a=n),c!==t.o&&o(a,t.o=c),m!==t.i&&o(u,t.i=m),g!==t.n&&o(p,t.n=g),h!==t.s&&o(f,t.s=h),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),i}})}})}})]}}),null),t(t=>{var r=e.id,i=`${v.solid_select__control_no_form} ${v[Ae]} ${ce()?v.solid_select__disabled:""} coles-solid-selectControl`,l="popup"===ee()?"dialog":"listbox",s=!ce()&&ae(),n=ce(),a=e.tooltip,d=`${v.solid_select__control} ${e.class||""} ${ce()?v.solid_select__disabled:""}`,c=v.solid_select__value;return r!==t.e&&(He.id=t.e=r),i!==t.t&&o(He,t.t=i),l!==t.a&&(He.ariaHaspopup=t.a=l),s!==t.o&&(He.ariaExpanded=t.o=s),n!==t.i&&(He.ariaDisabled=t.i=n),a!==t.n&&(He.title=t.n=a),d!==t.s&&o(qe,t.s=d),c!==t.h&&o(Re,t.h=c),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0}),He;var He,qe,Re}e(["click","keydown","mousedown"]);export{q as Select};
|
|
2
|
+
//# sourceMappingURL=select.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.component.js","sources":["../../../src/components/Select/select.component.tsx"],"sourcesContent":["import { createSignal, createEffect, JSX, onMount, onCleanup, Show, createMemo, children } from \"solid-js\";\n// @ts-ignore\nimport styles from './selectStyles.module.scss';\nimport { isNullish, isMobile, useClickOutside } from \"../../tools\";\nimport { useOverlayPosition } from \"../../tools/useOverlayPosition\";\nimport { Portal } from \"solid-js/web\";\nimport { useFormProvider } from \"../FormField/formProvider\";\nimport { useFormContext } from \"../Form/form\";\nimport { useDirectFormBinding } from \"../Form/useDirectFormBinding\";\nimport { ignoreWindowManager } from \"../../globalWindowManager\";\nimport { SelectContextProvider, SelectContextValue } from \"./selectContext\";\nimport { useSelectOptions } from \"./useSelectOptions\";\nimport { useHighlight } from \"./useHighlight\";\nimport { useTypeahead } from \"./useTypeahead\";\n\ninterface SelectProps<T = string, K = boolean> {\n multiple?: K;\n value?: T;\n transparent?: boolean;\n id?: string;\n defaultValue?: T;\n onChange?: (value: T) => void;\n onSelect?: (value: T) => void;\n placeholder?: string;\n tooltip?: string;\n renderValue?: (selectedValue: T) => JSX.Element;\n class?: string;\n dropdownClass?: string;\n children: JSX.Element;\n disabled?: boolean;\n /** Controls mobile popup behavior.\n * 'auto' (default): uses fullscreen popup on mobile devices, desktop dropdown otherwise.\n * 'popup': always uses fullscreen popup regardless of device.\n * 'desktop': always uses desktop dropdown regardless of device.\n */\n mobileMode?: 'auto' | 'popup' | 'desktop';\n formName?: string;\n formIndex?: number;\n formArrayName?: string;\n}\nexport function Select<T, K extends boolean = false>(props: SelectProps<(K extends true ? T[]: T), K>) {\n\n const isMultiple = (props.multiple !== undefined || props.multiple === true) as K;\n const [currStyle, setCurrStyle] = createSignal(\"primary\");\n const defaultSelected = isMultiple as K ? (props.value ?? props.defaultValue ?? []) : (props.value ?? props.defaultValue ?? undefined);\n const [selected, setSelected] = createSignal<T | T[] | undefined>(defaultSelected);\n const [selectRef, setSelectRef] = createSignal<HTMLDivElement>();\n // Outer wrapper (role=\"button\") — the full-size clickable field box.\n const [controlRef, setControlRef] = createSignal<HTMLDivElement>();\n const [dropdownRef, setDropdownRef] = createSignal<HTMLDivElement>();\n const [mobilePopupRef, setMobilePopupRef] = createSignal<HTMLDivElement>();\n let mobileOptionsRef: HTMLDivElement | undefined;\n\n // Resolved rendering mode: 'popup' for fullscreen mobile popup, 'desktop' for traditional dropdown\n const resolvedMode = createMemo<'popup' | 'desktop'>(() => {\n const mode = props.mobileMode ?? 'auto';\n if (mode === 'popup') return 'popup';\n if (mode === 'desktop') return 'desktop';\n // 'auto': detect mobile at runtime\n return isMobile() ? 'popup' : 'desktop';\n });\n const form = useFormProvider<K extends true ? T[]: T>();\n const formContext = useFormContext<any>();\n const binding = useDirectFormBinding({ formName: props.formName, formIndex: props.formIndex, formArrayName: props.formArrayName });\n const effectiveFormName = binding.formName;\n const hasForm: boolean = !!effectiveFormName || !!effectiveFormName || !!form?.getName || !!form?.getValue || !!form?.setValue || !!form?.getTextInside;\n const hasFormContext = hasForm && !!formContext?.formGroup;\n \n const currentValue = () => {\n // FormArray-bound select reads the bound array-item property.\n if (binding.isFormArray) {\n return binding.getValue();\n }\n if (hasFormContext) {\n return formContext.data?.[effectiveFormName ?? ''];\n }\n if (hasForm) {\n return form.getValue();\n }\n // Uncontrolled standalone: fall back to the internal selection signal so the\n // displayed value (and multi-select toggling) reflect what the user picked.\n return !isNullish(props?.value) ? props?.value : selected();\n };\n\n // Signal for dropdown open/closed\n const [open, setOpen] = createSignal(false);\n\n const isDisabled = () => {\n const fieldset = form?.getFormFieldRef?.();\n const fieldsetDisabled = !!fieldset?.hasAttribute?.('disabled');\n return !!props.disabled || fieldsetDisabled;\n };\n\n const menuLocRef = createMemo(() => {\n if (!!form?.getFormFieldRef) {\n return form.getFormFieldRef();\n };\n return selectRef();\n });\n\n // --- Option registry (extracted hook) ---\n const {\n options,\n registerOption,\n unregisterOption,\n optionEntries,\n getOptionLabelText,\n getLabel,\n } = useSelectOptions<T>();\n\n // Helper to check if a value is selected (for Option highlighting)\n const isSelected = (val: T): boolean => {\n const current = currentValue();\n return isMultiple\n ? Array.isArray(current) && current.includes(val) \n : current === val;\n };\n\n // --- Highlight management (extracted hook) ---\n // Use combined ref so scrollIntoView works in both desktop dropdown and mobile popup modes\n const activeListRef = createMemo(() => resolvedMode() === 'popup' ? mobilePopupRef() : dropdownRef());\n const {\n highlightedIndex,\n setHighlightedIndex,\n moveHighlight,\n setHighlightToSelectedOrFirst,\n scrollHighlightedIntoView,\n } = useHighlight<T>({ optionEntries, isSelected, dropdownRef: activeListRef });\n\n // --- Typeahead search (extracted hook) ---\n const { handleTypeahead, resetTypeahead } = useTypeahead<T>({\n optionEntries,\n highlightedIndex,\n getOptionLabelText,\n onMatch: (index) => {\n setHighlightedIndex(index);\n queueMicrotask(() => scrollHighlightedIntoView(index));\n },\n });\n\n // --- Overlay positioning (extracted hook) ---\n const { dropTop, updatePosition } = useOverlayPosition(\n menuLocRef as () => HTMLElement | undefined,\n dropdownRef,\n open,\n );\n\n // Function to handle selecting/toggling an option for single or multi-select\n // When not using a form or greater FormContext\n const selectValue = (val: T) => {\n if (effectiveFormName && formContext?.formGroup?.markDirty) {\n const meta = formContext.formGroup.getMeta(effectiveFormName as any);\n if (meta && !meta.dirty) formContext.formGroup.markDirty(effectiveFormName as any);\n }\n if (isMultiple) {\n // For multi-select, toggle the value in the array. Use currentValue() (which\n // resolves controlled props, form values, or the internal signal) instead of\n // props.value — otherwise uncontrolled toggling always starts from [] and breaks.\n const current = (currentValue() ?? []) as T[];\n let newSelected: T[];\n\n if (current.includes(val)) {\n newSelected = current.filter(item => item !== val);\n } else {\n newSelected = [...current, val];\n }\n // Preserve scroll position in mobile popup before reactive updates\n const savedScrollTop = mobileOptionsRef?.scrollTop;\n setSelected(()=>newSelected);\n props?.onChange?.(newSelected as any);\n props?.onSelect?.(newSelected as any);\n if (savedScrollTop != null && mobileOptionsRef) {\n queueMicrotask(() => { mobileOptionsRef!.scrollTop = savedScrollTop; });\n } \n } else {\n setSelected(() => val);\n props?.onChange?.(val as any);\n props?.onSelect?.(val as any); \n setOpen(false); \n }\n };\n\n // Commit a value through the Select's direct binding when it targets a FormArray\n // item (formIndex / formArrayName). The Option's FormContext/FormField fallbacks\n // cannot reach an array item, so without this the write is silently dropped.\n const commitValue = (val: T): boolean => {\n if (!binding.isFormArray) return false;\n binding.markDirty?.();\n if (isMultiple) {\n const cur = (binding.getValue() ?? []) as T[];\n const next = cur.includes(val) ? cur.filter(v => v !== val) : [...cur, val];\n binding.setValue(next as any);\n setSelected(() => next as any);\n props?.onChange?.(next as any);\n props?.onSelect?.(next as any);\n } else {\n binding.setValue(val as any);\n setSelected(() => val);\n props?.onChange?.(val as any);\n props?.onSelect?.(val as any);\n setOpen(false);\n }\n return true;\n };\n\n // Compute the content to display in the closed select (trigger area)\n const displayValue = createMemo<JSX.Element>(() => {\n const current = currentValue();\n if (isMultiple) {\n const selectedArray = Array.isArray(current) ? current : [];\n if (selectedArray.length === 0) {\n if (hasForm && form.getTextInside() && !form.getFocused()) {\n return <span style={{opacity: 0}} class={`${styles[\"solid_select__placeholder\"]}`}></span>;\n }\n return <span class={`${styles[\"solid_select__placeholder\"]}`}>{props.placeholder || \"Select...\"}</span>;\n }\n if (props.renderValue) {\n return props.renderValue(selectedArray as any);\n } else {\n const labels = selectedArray.map(val => options[JSON.stringify(val)]?.label || String(val));\n return <span style={{width: '100%', height: '100%'}} class={`${styles[\"solid_select__value\"]} ${styles[\"multiselect-value\"]}`}>{labels.join(', ')}</span>;\n }\n } else {\n // Single selection\n const singleVal = current as any;\n if (isNullish(singleVal) || (typeof singleVal === \"string\" && !!!singleVal.trim())) {\n if (hasForm && form.getTextInside() && !form.getFocused()) {\n return <span class={`${styles[\"solid_select__placeholder\"]}`}></span>;\n }\n return <span class={`${styles[\"solid_select__placeholder\"]}`}>{props.placeholder || \"Select...\"}</span>;\n } else if (props.renderValue) {\n return props.renderValue(singleVal);\n } else {\n return <span class={`${styles[\"solid_select__value\"]}`}>{getLabel(singleVal)}</span>;\n }\n }\n });\n\n // --- Form sync effects ---\n createEffect(() => {\n if (hasFormContext) {\n const value = currentValue();\n setSelected(value as any);\n }\n });\n\n createEffect(() => {\n const value = selected();\n if (hasForm) {\n form.setValue?.(value as any);\n };\n });\n\n const isTransparent = props.transparent !== undefined || props.transparent === true;\n const styleClassTransparent = isTransparent ? \"solid_select__transparent\" : \"\";\n\n // Give Current Value to Props\n createEffect(() => {\n !!props?.onChange ? props.onChange(currentValue()) : null;\n });\n\n useClickOutside([dropdownRef, controlRef, selectRef], () => {\n if (isDisabled()) return;\n // Desktop mode uses click-outside; mobile popup uses backdrop tap\n if (resolvedMode() === 'popup') return;\n setOpen(false);\n form?.setFocused?.((prev) => {\n if (prev) {\n formContext?.formGroup?.validate?.(effectiveFormName ?? '');\n }\n return false;\n });\n });\n\n onMount(() => {\n if (hasForm) {\n const formValue = currentValue() ?? isMultiple ? [] : undefined;\n const typedFormValue = isMultiple ? formValue as T[] : formValue as T;\n if (isMultiple as K) {\n const isAvailableOptions = (typedFormValue as T[]).every(val => !!options[JSON.stringify(val)]);\n if (!!formValue && formValue.length > 0 && isAvailableOptions) {\n form.setTextInside(true);\n setSelected?.((old)=>[...(old ?? []) as T[], ...(typedFormValue as T[])]);\n } else {\n form.setTextInside(false);\n }\n } else {\n if (typedFormValue) {\n if (!!options[JSON.stringify(typedFormValue)]) {\n form.setTextInside(true);\n setSelected?.(formValue as any);\n } else {\n form.setTextInside(false);\n }\n } else {\n form.setTextInside(false);\n setSelected?.(formValue as any);\n }\n }\n }\n const dropdown = dropdownRef();\n if (dropdown) {\n ignoreWindowManager(dropdown);\n }\n });\n\n // --- Mobile popup window manager lifecycle ---\n const closeMobilePopup = () => {\n setOpen(false);\n form?.setFocused?.((prev) => {\n if (prev) {\n formContext?.formGroup?.validate?.(effectiveFormName ?? '');\n }\n return false;\n });\n };\n\n const childs = children(() => props.children);\n\n // --- Publish active overlay element to the form provider so a wrapping\n // FormField can treat clicks inside the (portaled) dropdown/popup as\n // \"inside\" the field. Without this, the FormField click-outside fires on\n // every option click (the overlay lives in a Portal outside the fieldset). ---\n createEffect(() => {\n const overlay = resolvedMode() === 'popup' ? mobilePopupRef() : dropdownRef();\n form?.setOverlayRef?.(overlay);\n });\n // Don't leave a dangling overlay ref in a FormField that outlives this Select.\n onCleanup(() => form?.setOverlayRef?.(undefined));\n\n // --- Open/close effects ---\n createEffect(() => {\n if (open()) {\n setHighlightToSelectedOrFirst();\n // Auto-focus mobile popup for keyboard interaction\n if (resolvedMode() === 'popup') {\n queueMicrotask(() => mobilePopupRef()?.focus());\n }\n } else {\n setHighlightedIndex(-1);\n resetTypeahead();\n }\n });\n\n createEffect(() => {\n if (props.disabled) {\n setOpen(false);\n }\n });\n\n // --- Context provider value ---\n const providerValue = createMemo<SelectContextValue<T>>(() => ({ \n isSelected, \n selectValue, \n registerOption, \n unregisterOption, \n isHighlighted: (val: T) => {\n const stringVal = JSON.stringify(val);\n const entries = optionEntries();\n const index = entries.findIndex((entry) => entry.value === stringVal);\n return index >= 0 && index === highlightedIndex();\n },\n selectRef, \n selectStyle: currStyle, \n isDisabled,\n closeDropdown: () => { if (!isMultiple) setOpen(false); },\n formName: effectiveFormName,\n commitValue,\n }));\n\n // Open the desktop dropdown. Position is measured *before* `open` flips true so the\n // placement (dropTop) and inline top/left/width/maxHeight are set in the same synchronous\n // batch that adds the `.open` class — otherwise the reveal can start with the wrong\n // transform-origin (top instead of bottom) when the menu is placed above the trigger.\n const openDropdown = () => {\n if (open()) return;\n updatePosition();\n setOpen(true);\n };\n\n // --- Keyboard handler ---\n const handleKeyDown = (e: KeyboardEvent) => {\n if (isDisabled()) return;\n if (e.key === \"Tab\") {\n setOpen(false);\n return;\n }\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n if (!open()) {\n openDropdown();\n setHighlightToSelectedOrFirst();\n } else {\n moveHighlight(1);\n }\n } else if (e.key === \"ArrowUp\") {\n e.preventDefault();\n if (!open()) {\n openDropdown();\n setHighlightToSelectedOrFirst();\n } else {\n moveHighlight(-1);\n }\n } else if (e.key === \"Home\") {\n e.preventDefault();\n if (!open()) openDropdown();\n if (optionEntries().length) {\n setHighlightedIndex(0);\n queueMicrotask(() => scrollHighlightedIntoView(0));\n }\n } else if (e.key === \"End\") {\n e.preventDefault();\n if (!open()) openDropdown();\n const entries = optionEntries();\n if (entries.length) {\n const last = entries.length - 1;\n setHighlightedIndex(last);\n queueMicrotask(() => scrollHighlightedIntoView(last));\n }\n } else if (e.key === \"Enter\") {\n const entries = optionEntries();\n const idx = highlightedIndex();\n if (open() && entries.length && idx >= 0 && idx < entries.length) {\n e.preventDefault();\n const dropdown = dropdownRef();\n const optionEls = dropdown?.querySelectorAll('[role=\"option\"]');\n const optionEl = optionEls?.[idx] as HTMLElement | undefined;\n if (optionEl) {\n optionEl.click();\n } else {\n selectValue(entries[idx].raw);\n }\n }\n } else if (e.key === \"Escape\") {\n setOpen(false);\n } else if (e.key.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey) {\n if (!open()) openDropdown();\n e.preventDefault();\n handleTypeahead(e.key);\n }\n };\n\n // --- Mobile popup keyboard handler ---\n const mobilePopupTitle = createMemo(() => {\n const formLabel = form?.getName?.();\n if (formLabel && formLabel.trim()) return formLabel.trim();\n if (props.placeholder) return props.placeholder;\n return '';\n });\n const handleMobileKeyDown = (e: KeyboardEvent) => {\n if (isDisabled()) return;\n if (e.key === \"Escape\") {\n closeMobilePopup();\n } else if (e.key === \"ArrowDown\") {\n e.preventDefault();\n moveHighlight(1);\n } else if (e.key === \"ArrowUp\") {\n e.preventDefault();\n moveHighlight(-1);\n } else if (e.key === \"Enter\") {\n const entries = optionEntries();\n const idx = highlightedIndex();\n if (entries.length && idx >= 0 && idx < entries.length) {\n e.preventDefault();\n const popup = mobilePopupRef();\n const optionEls = popup?.querySelectorAll('[role=\"option\"]');\n const optionEl = optionEls?.[idx] as HTMLElement | undefined;\n if (optionEl) {\n optionEl.click();\n } else {\n selectValue(entries[idx].raw);\n }\n }\n } else if (e.key.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey) {\n e.preventDefault();\n handleTypeahead(e.key);\n }\n };\n\n return (\n <div\n ref={setControlRef}\n id={props.id}\n is=\"coles-solid-select\"\n class={`${styles.solid_select__control_no_form} ${styles[styleClassTransparent]} ${isDisabled() ? styles.solid_select__disabled : ''} coles-solid-selectControl`} \n role=\"button\"\n aria-haspopup={resolvedMode() === 'popup' ? 'dialog' : 'listbox'}\n aria-expanded={isDisabled() ? false : open()}\n aria-disabled={isDisabled()}\n tabIndex={0}\n title={props.tooltip}\n onFocus={() => {\n if (isDisabled()) return;\n form?.setFocused?.(true);\n if (effectiveFormName && formContext?.formGroup?.markDirty) {\n const meta = formContext.formGroup.getMeta(effectiveFormName as any);\n if (meta && !meta.dirty) formContext.formGroup.markDirty(effectiveFormName as any);\n }\n }}\n onClick={(e) => {\n if (isDisabled()) return;\n // Ignore clicks that originate inside the portaled dropdown / mobile popup —\n // options manage their own selection. The trigger toggle handler lives here\n // (on the full-size wrapper) so the entire field box is clickable, not just\n // the inner control.\n const target = e.target as Node;\n if (dropdownRef()?.contains(target) || mobilePopupRef()?.contains(target)) return;\n (e.currentTarget as HTMLElement)?.focus?.();\n if (open()) setOpen(false);\n else openDropdown();\n }}\n onKeyDown={resolvedMode() === 'popup' ? undefined : handleKeyDown}\n >\n <div ref={setSelectRef}\n class={`${styles['solid_select__control']} ${props.class || \"\"} ${isDisabled() ? styles.solid_select__disabled : ''}`}\n style={{ height: '100%' }}>\n <span class={styles['solid_select__value']}>\n {displayValue()}\n </span>\n <Show when={open()}>\n <span class={styles['solid_select__arrow']}>▲</span>\n </Show>\n <Show when={!open()}>\n <span class={styles['solid_select__arrow']}>▼</span>\n </Show>\n </div>\n <SelectContextProvider value={providerValue()}>\n {/* Desktop dropdown (portal-positioned overlay) */}\n <Show when={resolvedMode() === 'desktop'}>\n <Portal>\n <div\n ref={setDropdownRef}\n class={`${styles['solid_select__dropdown']} ${dropTop() ? styles.dropTop: styles.dropBottom} ${open() ? styles.open : ''} ${props.dropdownClass || \"\"}`}>\n {/* Positioning (top/left/width/maxHeight) is owned solely by\n useOverlayPosition — see the hook wired above. */}\n {props.children}\n </div>\n </Portal>\n </Show>\n {/* Mobile fullscreen popup */}\n <Show when={resolvedMode() === 'popup'}>\n <Portal>\n <Show when={open()}>\n <div\n class={styles['solid_select__mobile_backdrop']}\n ref={(el) => ignoreWindowManager(el)}\n onMouseDown={(e) => {\n // Close when clicking the backdrop itself (outside the popup)\n if (e.target === e.currentTarget) {\n closeMobilePopup();\n }\n }}\n >\n <div\n ref={setMobilePopupRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={mobilePopupTitle() || undefined}\n class={`${styles['solid_select__mobile_popup']} ${props.dropdownClass || \"\"}`}\n onKeyDown={handleMobileKeyDown}\n tabIndex={-1}\n >\n <div class={styles['solid_select__mobile_header']}>\n <span class={styles['solid_select__mobile_title']}>\n {mobilePopupTitle()}\n </span>\n <button\n type=\"button\"\n class={styles['solid_select__mobile_close']}\n aria-label=\"Close\"\n onClick={() => closeMobilePopup()}\n >\n ✕\n </button>\n </div>\n <div ref={mobileOptionsRef} class={styles['solid_select__mobile_options']} role=\"listbox\">\n {props.children}\n </div>\n <Show when={isMultiple}>\n <div class={styles['solid_select__mobile_footer']}>\n <button\n type=\"button\"\n class={styles['solid_select__mobile_done']}\n onClick={() => closeMobilePopup()}\n >\n Done\n </button>\n </div>\n </Show>\n </div>\n </div>\n </Show>\n </Portal>\n </Show>\n </SelectContextProvider>\n </div>\n );\n}\n"],"names":["Select","props","isMultiple","undefined","multiple","currStyle","setCurrStyle","createSignal","defaultSelected","value","defaultValue","selected","setSelected","selectRef","setSelectRef","controlRef","setControlRef","dropdownRef","setDropdownRef","mobilePopupRef","setMobilePopupRef","mobileOptionsRef","resolvedMode","createMemo","mode","mobileMode","isMobile","form","useFormProvider","formContext","useFormContext","binding","useDirectFormBinding","formName","formIndex","formArrayName","effectiveFormName","hasForm","getName","getValue","setValue","getTextInside","hasFormContext","formGroup","currentValue","isFormArray","data","isNullish","open","setOpen","isDisabled","fieldset","getFormFieldRef","fieldsetDisabled","hasAttribute","disabled","menuLocRef","options","registerOption","unregisterOption","optionEntries","getOptionLabelText","getLabel","useSelectOptions","isSelected","val","current","Array","isArray","includes","activeListRef","highlightedIndex","setHighlightedIndex","moveHighlight","setHighlightToSelectedOrFirst","scrollHighlightedIntoView","useHighlight","handleTypeahead","resetTypeahead","useTypeahead","onMatch","index","queueMicrotask","dropTop","updatePosition","useOverlayPosition","selectValue","markDirty","meta","getMeta","dirty","newSelected","filter","item","savedScrollTop","scrollTop","onChange","onSelect","commitValue","cur","next","v","displayValue","selectedArray","length","getFocused","_el$","_tmpl$","_$effect","_$className","styles","_el$2","_tmpl$2","_$insert","placeholder","renderValue","labels","map","JSON","stringify","label","String","_el$3","_tmpl$3","join","singleVal","trim","_el$4","_el$5","_el$6","createEffect","styleClassTransparent","transparent","useClickOutside","setFocused","prev","validate","onMount","formValue","typedFormValue","isAvailableOptions","every","setTextInside","old","dropdown","ignoreWindowManager","closeMobilePopup","children","overlay","setOverlayRef","onCleanup","focus","providerValue","isHighlighted","stringVal","findIndex","entry","selectStyle","closeDropdown","openDropdown","handleKeyDown","e","key","preventDefault","entries","last","idx","optionEls","querySelectorAll","optionEl","click","raw","metaKey","ctrlKey","altKey","mobilePopupTitle","formLabel","handleMobileKeyDown","popup","_el$7","_tmpl$9","_el$8","firstChild","_el$9","_$addEventListener","$$click","target","contains","currentTarget","addEventListener","_$use","_$owner","_$getOwner","_$createComponent","Show","when","_el$0","_tmpl$4","_el$1","_tmpl$5","SelectContextProvider","Portal","_el$10","_tmpl$6","dropBottom","dropdownClass","_el$11","_tmpl$8","_el$12","_el$13","_el$14","_el$15","nextSibling","_el$16","$$mousedown","el","$$keydown","_el$17","_tmpl$7","_el$18","_p$","_v$","_v$2","t","_v$3","_v$4","_v$5","_v$6","_v$7","_v$8","_v$9","_$setAttribute","a","o","i","n","s","_v$0","id","_v$1","solid_select__control_no_form","solid_select__disabled","_v$10","_v$11","_v$12","_v$13","tooltip","_v$14","class","_v$15","ariaHaspopup","ariaExpanded","ariaDisabled","title","h","_$delegateEvents"],"mappings":"85CAwCM,SAAUA,EAAqCC,GAEnD,MAAMC,OAAiCC,IAAnBF,EAAMG,WAA6C,IAAnBH,EAAMG,UACnDC,EAAWC,GAAgBC,EAAa,WACzCC,EAAkBN,EAAmBD,EAAMQ,OAASR,EAAMS,cAAgB,GAAOT,EAAMQ,OAASR,EAAMS,mBAAgBP,GACrHQ,EAAUC,GAAeL,EAAkCC,IAC3DK,EAAWC,GAAgBP,KAE3BQ,EAAYC,GAAiBT,KAC7BU,EAAaC,GAAkBX,KAC/BY,EAAgBC,GAAqBb,IAC5C,IAAIc,EAGJ,MAAMC,GAAeC,EAAgC,KACnD,MAAMC,EAAOvB,EAAMwB,YAAc,OACjC,MAAa,UAATD,EAAyB,QAChB,YAATA,EAA2B,UAExBE,IAAa,QAAU,YAE1BC,GAAOC,IACPC,GAAcC,IACdC,GAAUC,EAAqB,CAAEC,SAAU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kC,GAAAjJ,EAAA0E,GAAAqC,EAAAkC,EAAAL,GAAA7B,GAAA,CAAA3D,OAAA9J,EAAA4N,OAAA5N,EAAAqO,OAAArO,EAAAsO,OAAAtO,EAAAuO,OAAAvO,EAAAwO,OAAAxO,EAAAyO,OAAAzO,EAAA2P,OAAA3P,IAAAgL,GArChD,IAAAA,GAAAE,GAAAE,EAsHF,CAACwE,EAAA,CAAA,QAAA,UAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createComponent as e}from"solid-js/web";import{createContext as r,useContext as t}from"solid-js";const o=r({}),i=()=>{const e=t(o);if(!e)throw new Error("<Select> must be used within a <SelectContext.Provider>");return e},n=r=>e(o.Provider,{get value(){return r.value},get children(){return r.children}});export{n as SelectContextProvider,i as useSelectContext};
|
|
2
|
+
//# sourceMappingURL=selectContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectContext.js","sources":["../../../src/components/Select/selectContext.tsx"],"sourcesContent":["import { createContext, JSX, useContext } from \"solid-js\";\n\nexport interface SelectContextValue<T> {\n isSelected: (val: T) => boolean;\n selectValue: (val: T) => void;\n registerOption: (val: T, label: JSX.Element, labelText?: string) => void;\n unregisterOption: (val: T) => void;\n isHighlighted: (val: T) => boolean;\n selectRef: (val: HTMLDivElement | undefined) => HTMLDivElement | undefined;\n selectStyle: () => string;\n isDisabled: () => boolean;\n /** Close the dropdown/popup without changing the value */\n closeDropdown: () => void;\n /** Resolved form field name — passed through so Option can write to FormGroup when Select has no FormField wrapper */\n formName?: string;\n /**\n * Commit a value through the Select's own direct binding (handles FormArray\n * item writes via formIndex/formArrayName, including multi-select toggle).\n * Returns true if the binding handled the write, so the Option can skip its\n * FormContext/FormField fallbacks.\n */\n commitValue?: (val: T) => boolean;\n}\nconst SelectContext = createContext<SelectContextValue<any>>({} as SelectContextValue<any>);\n\nexport const useSelectContext = () => {\n const context = useContext(SelectContext);\n if (!context) {\n throw new Error(\"<Select> must be used within a <SelectContext.Provider>\");\n }\n return context;\n};\n\nexport const SelectContextProvider = (\n props: {\n value: SelectContextValue<any>;\n children: JSX.Element;\n }\n) => {\n return <SelectContext.Provider value={props.value}>{props.children}</SelectContext.Provider>;\n};"],"names":["SelectContext","createContext","useSelectContext","context","useContext","Error","SelectContextProvider","props","_$createComponent","Provider","value","children"],"mappings":"wGAuBA,MAAMA,EAAgBC,EAAuC,IAEhDC,EAAmBA,KAC9B,MAAMC,EAAUC,EAAWJ,GAC3B,IAAKG,EACH,MAAM,IAAIE,MAAM,2DAElB,OAAOF,GAGIG,EACXC,GAKAC,EAAQR,EAAcS,SAAQ,CAAA,SAACC,GAAK,OAAEH,EAAMG,KAAK,EAAA,YAAAC,GAAA,OAAGJ,EAAMI,QAAQ"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e from"../../styleInject.js";var o={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__disabled:"selectStyles-module_solid_select__disabled__5rUz8",solid_select__arrow:"selectStyles-module_solid_select__arrow__OPCZo",solid_select__value:"selectStyles-module_solid_select__value__rNtqF","multiselect-value":"selectStyles-module_multiselect-value__UUhhP",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",solid_select__option_highlight:"selectStyles-module_solid_select__option_highlight__hPSRL",solid_select__option_disabled:"selectStyles-module_solid_select__option_disabled__IZBcA",checkmark:"selectStyles-module_checkmark__UWcbd","option-label":"selectStyles-module_option-label__bBFSW",solid_select__mobile_backdrop:"selectStyles-module_solid_select__mobile_backdrop__MQU3O",mobileBackdropFadeIn:"selectStyles-module_mobileBackdropFadeIn__BMxpT",solid_select__mobile_popup:"selectStyles-module_solid_select__mobile_popup__-MO-i",mobileSlideUp:"selectStyles-module_mobileSlideUp__JlYpt",solid_select__mobile_header:"selectStyles-module_solid_select__mobile_header__gpULA",solid_select__mobile_title:"selectStyles-module_solid_select__mobile_title__MNbIa",solid_select__mobile_close:"selectStyles-module_solid_select__mobile_close__RgfaX",solid_select__mobile_options:"selectStyles-module_solid_select__mobile_options__01rHy",solid_select__mobile_footer:"selectStyles-module_solid_select__mobile_footer__U08m7",solid_select__mobile_done:"selectStyles-module_solid_select__mobile_done__Xp6Gu"};e(".selectStyles-module_solid_select__placeholder__VO5-- {\n opacity: var(--text-emphasis-medium, 87%);\n transition: all 0.7s ease;\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 height: 100%;\n min-height: 0;\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 transition: border 0.7s ease, padding 0.7s ease;\n overflow: hidden;\n text-overflow: ellipsis;\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__disabled__5rUz8 {\n cursor: not-allowed;\n opacity: 0.6;\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 transition: all 0.3s ease;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: block;\n}\n\n.selectStyles-module_multiselect-value__UUhhP {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\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_solid_select__option_highlight__hPSRL {\n border: 2px inset var(--primary-color-varient, #43A047);\n background-color: var(--container-color, #ffffff);\n color: var(--on-container-color, #000);\n}\n\n.selectStyles-module_solid_select__option_disabled__IZBcA {\n cursor: not-allowed;\n opacity: 0.6;\n pointer-events: none;\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}\n\n.selectStyles-module_solid_select__mobile_backdrop__MQU3O {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 999999999999999;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: flex-end;\n justify-content: center;\n animation: selectStyles-module_mobileBackdropFadeIn__BMxpT 0.2s ease-out;\n}\n\n.selectStyles-module_solid_select__mobile_popup__-MO-i {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 90vw;\n max-width: 400px;\n max-height: 60vh;\n border-radius: 16px 16px 0 0;\n background-color: var(--surface-color, #EEEEEE);\n color: var(--on-surface-color, #000000);\n overflow: hidden;\n box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.45);\n animation: selectStyles-module_mobileSlideUp__JlYpt 0.3s ease-out;\n}\n\n.selectStyles-module_solid_select__mobile_header__gpULA {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 8px 16px;\n min-height: 48px;\n background-color: var(--surface-color, #EEEEEE);\n color: var(--on-surface-color, #000000);\n border-bottom: 1px solid var(--surface-color-variant, #ccc);\n flex-shrink: 0;\n}\n\n.selectStyles-module_solid_select__mobile_title__MNbIa {\n font-size: 18px;\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.selectStyles-module_solid_select__mobile_close__RgfaX {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n border: none;\n border-radius: 50%;\n background: transparent;\n color: var(--on-surface-color, #000000);\n font-size: 18px;\n cursor: pointer;\n flex-shrink: 0;\n transition: background-color 0.15s ease;\n}\n.selectStyles-module_solid_select__mobile_close__RgfaX:hover {\n background-color: var(--surface-color-variant, #ccc);\n}\n.selectStyles-module_solid_select__mobile_close__RgfaX:active {\n background-color: var(--surface-color-variant, #ccc);\n}\n\n.selectStyles-module_solid_select__mobile_options__01rHy {\n flex: 1;\n overflow-y: auto;\n overflow-x: hidden;\n padding: 8px 0;\n -webkit-overflow-scrolling: touch;\n}\n\n.selectStyles-module_solid_select__mobile_footer__U08m7 {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n padding: 8px 16px;\n min-height: 52px;\n background-color: var(--surface-color, #EEEEEE);\n border-top: 1px solid var(--surface-color-variant, #ccc);\n flex-shrink: 0;\n}\n\n.selectStyles-module_solid_select__mobile_done__Xp6Gu {\n padding: 8px 24px;\n border: none;\n border-radius: 8px;\n background-color: var(--primary-color, #4CAF50);\n color: var(--on-primary-color, #fff);\n font-size: 16px;\n font-weight: 500;\n cursor: pointer;\n transition: background-color 0.15s ease, box-shadow 0.15s ease;\n}\n.selectStyles-module_solid_select__mobile_done__Xp6Gu:hover {\n background-color: var(--primary-color-varient, #43A047);\n}\n.selectStyles-module_solid_select__mobile_done__Xp6Gu:active {\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15);\n}\n\n@keyframes selectStyles-module_mobileBackdropFadeIn__BMxpT {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n@keyframes selectStyles-module_mobileSlideUp__JlYpt {\n from {\n transform: translateY(30%);\n opacity: 0;\n }\n to {\n transform: translateY(0);\n opacity: 1;\n }\n}");export{o as default};
|
|
2
|
+
//# sourceMappingURL=selectStyles.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectStyles.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createSignal as t,createEffect as e}from"solid-js";function n(n){const[o,i]=t(-1),l=t=>{const e=n.dropdownRef();if(!e)return;const i=e.querySelectorAll('[role="option"]')[t??o()];i&&"function"==typeof i.scrollIntoView&&i.scrollIntoView({block:"nearest"})};return e(()=>{const t=n.optionEntries();t.length?o()>=t.length&&i(t.length-1):-1!==o()&&i(-1)}),{highlightedIndex:o,setHighlightedIndex:i,moveHighlight:t=>{const e=n.optionEntries();if(!e.length)return;const r=((o()<0?0:o())+t+e.length)%e.length;i(r),queueMicrotask(()=>l(r))},setHighlightToSelectedOrFirst:()=>{const t=n.optionEntries();if(!t.length)return void i(-1);let e=t.findIndex(t=>n.isSelected(t.raw));e<0&&(e=0),i(e),queueMicrotask(()=>l(e))},scrollHighlightedIntoView:l}}export{n as useHighlight};
|
|
2
|
+
//# sourceMappingURL=useHighlight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHighlight.js","sources":["../../../src/components/Select/useHighlight.ts"],"sourcesContent":["import { Accessor, createEffect, createSignal } from \"solid-js\";\nimport { OptionEntry } from \"./useSelectOptions\";\n\nexport interface HighlightConfig<T> {\n /** Accessor for the ordered option entries */\n optionEntries: Accessor<OptionEntry<T>[]>;\n /** Function to check if a value is currently selected */\n isSelected: (val: T) => boolean;\n /** Accessor for the dropdown DOM element (for scrollIntoView) */\n dropdownRef: Accessor<HTMLElement | undefined>;\n}\n\n/**\n * Manages highlighted-index state for keyboard navigation in a Select dropdown.\n * Provides movement, scroll-into-view, and reset-to-selected helpers.\n */\nexport function useHighlight<T>(config: HighlightConfig<T>) {\n const [highlightedIndex, setHighlightedIndex] = createSignal(-1);\n\n const scrollHighlightedIntoView = (index?: number) => {\n const dropdown = config.dropdownRef();\n if (!dropdown) return;\n const optionsEls = dropdown.querySelectorAll('[role=\"option\"]');\n const idx = index ?? highlightedIndex();\n const el = optionsEls[idx] as HTMLElement | undefined;\n if (el && typeof el.scrollIntoView === \"function\") {\n el.scrollIntoView({ block: \"nearest\" });\n }\n };\n\n const moveHighlight = (delta: number) => {\n const entries = config.optionEntries();\n if (!entries.length) return;\n const nextIndex = ((highlightedIndex() < 0 ? 0 : highlightedIndex()) + delta + entries.length) % entries.length;\n setHighlightedIndex(nextIndex);\n queueMicrotask(() => scrollHighlightedIntoView(nextIndex));\n };\n\n const setHighlightToSelectedOrFirst = () => {\n const entries = config.optionEntries();\n if (!entries.length) {\n setHighlightedIndex(-1);\n return;\n }\n let idx = entries.findIndex((entry) => config.isSelected(entry.raw));\n if (idx < 0) idx = 0;\n setHighlightedIndex(idx);\n queueMicrotask(() => scrollHighlightedIntoView(idx));\n };\n\n // Clamp highlighted index when entries change\n createEffect(() => {\n const entries = config.optionEntries();\n if (!entries.length) {\n if (highlightedIndex() !== -1) setHighlightedIndex(-1);\n return;\n }\n if (highlightedIndex() >= entries.length) {\n setHighlightedIndex(entries.length - 1);\n }\n });\n\n return {\n highlightedIndex,\n setHighlightedIndex,\n moveHighlight,\n setHighlightToSelectedOrFirst,\n scrollHighlightedIntoView,\n };\n}\n"],"names":["useHighlight","config","highlightedIndex","setHighlightedIndex","createSignal","scrollHighlightedIntoView","index","dropdown","dropdownRef","el","querySelectorAll","scrollIntoView","block","createEffect","entries","optionEntries","length","moveHighlight","delta","nextIndex","queueMicrotask","setHighlightToSelectedOrFirst","idx","findIndex","entry","isSelected","raw"],"mappings":"0DAgBM,SAAUA,EAAgBC,GAC9B,MAAOC,EAAkBC,GAAuBC,GAAa,GAEvDC,EAA6BC,IACjC,MAAMC,EAAWN,EAAOO,cACxB,IAAKD,EAAU,OACf,MAEME,EAFaF,EAASG,iBAAiB,mBACjCJ,GAASJ,KAEjBO,GAAmC,mBAAtBA,EAAGE,gBAClBF,EAAGE,eAAe,CAAEC,MAAO,aAoC/B,OAXAC,EAAa,KACX,MAAMC,EAAUb,EAAOc,gBAClBD,EAAQE,OAITd,KAAsBY,EAAQE,QAChCb,EAAoBW,EAAQE,OAAS,QAJjCd,KAA2BC,GAAoB,KAQhD,CACLD,mBACAC,sBACAc,cAnCqBC,IACrB,MAAMJ,EAAUb,EAAOc,gBACvB,IAAKD,EAAQE,OAAQ,OACrB,MAAMG,IAAcjB,IAAqB,EAAI,EAAIA,KAAsBgB,EAAQJ,EAAQE,QAAUF,EAAQE,OACzGb,EAAoBgB,GACpBC,eAAe,IAAMf,EAA0Bc,KA+B/CE,8BA5BoCA,KACpC,MAAMP,EAAUb,EAAOc,gBACvB,IAAKD,EAAQE,OAEX,YADAb,GAAoB,GAGtB,IAAImB,EAAMR,EAAQS,UAAWC,GAAUvB,EAAOwB,WAAWD,EAAME,MAC3DJ,EAAM,IAAGA,EAAM,GACnBnB,EAAoBmB,GACpBF,eAAe,IAAMf,EAA0BiB,KAoB/CjB,4BAEJ"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createSignal as t,createMemo as e}from"solid-js";import{createStore as r}from"solid-js/store";function i(){const[i,n]=r({}),[l,o]=t([]),s=e(()=>l().map(t=>i[t]).filter(t=>!!t));return{options:i,registerOption:(t,e,r="")=>{const i=JSON.stringify(t);n(n=>({...n,[i]:{value:i,raw:t,label:e,labelText:r}})),o(t=>t.includes(i)?t:[...t,i])},unregisterOption:t=>{const e=JSON.stringify(t);n(t=>{const r={...t};return delete r[e],r}),o(t=>t.filter(t=>t!==e))},optionEntries:s,getOptionLabelText:t=>{if(!t)return"";const e=t.labelText?.trim();return e||("string"==typeof t.label||"number"==typeof t.label?String(t.label):String(t.raw??t.value??"").trim())},getLabel:t=>{const e=JSON.stringify(t);return i[e]?.label||String(t)}}}export{i as useSelectOptions};
|
|
2
|
+
//# sourceMappingURL=useSelectOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSelectOptions.js","sources":["../../../src/components/Select/useSelectOptions.ts"],"sourcesContent":["import { createMemo, createSignal, JSX } from \"solid-js\";\nimport { createStore } from \"solid-js/store\";\n\nexport type OptionEntry<T> = {\n value: string;\n raw: T;\n label: JSX.Element;\n labelText: string;\n};\n\n/**\n * Manages the registry of options for a Select component.\n * Handles registration, unregistration, ordering, and label resolution.\n */\nexport function useSelectOptions<T>() {\n const [options, setOptions] = createStore<Record<string, OptionEntry<T>>>({});\n const [optionOrder, setOptionOrder] = createSignal<string[]>([]);\n\n const registerOption = (val: T, label: JSX.Element, labelText = \"\") => {\n const stringVal = JSON.stringify(val);\n setOptions(store => ({ ...store, [stringVal]: { value: stringVal, raw: val, label, labelText } }));\n setOptionOrder((prev) => (prev.includes(stringVal) ? prev : [...prev, stringVal]));\n };\n\n const unregisterOption = (val: T) => {\n const stringVal = JSON.stringify(val);\n setOptions(store => {\n const newStore = { ...store };\n delete newStore[stringVal];\n return newStore;\n });\n setOptionOrder((prev) => prev.filter((key) => key !== stringVal));\n };\n\n const optionEntries = createMemo(() =>\n optionOrder()\n .map((key) => options[key])\n .filter((entry): entry is OptionEntry<T> => !!entry)\n );\n\n const getOptionLabelText = (entry: OptionEntry<T>): string => {\n if (!entry) return \"\";\n const text = entry.labelText?.trim();\n if (text) return text;\n if (typeof entry.label === \"string\" || typeof entry.label === \"number\") return String(entry.label);\n return String(entry.raw ?? entry.value ?? \"\").trim();\n };\n\n const getLabel = (val: T): JSX.Element => {\n const stringVal = JSON.stringify(val);\n return options[stringVal]?.label || String(val);\n };\n\n return {\n options,\n registerOption,\n unregisterOption,\n optionEntries,\n getOptionLabelText,\n getLabel,\n };\n}\n"],"names":["useSelectOptions","options","setOptions","createStore","optionOrder","setOptionOrder","createSignal","optionEntries","createMemo","map","key","filter","entry","registerOption","val","label","labelText","stringVal","JSON","stringify","store","value","raw","prev","includes","unregisterOption","newStore","getOptionLabelText","text","trim","String","getLabel"],"mappings":"8GAcgBA,IACd,MAAOC,EAASC,GAAcC,EAA4C,CAAA,IACnEC,EAAaC,GAAkBC,EAAuB,IAkBvDC,EAAgBC,EAAW,IAC/BJ,IACGK,IAAKC,GAAQT,EAAQS,IACrBC,OAAQC,KAAqCA,IAgBlD,MAAO,CACLX,UACAY,eArCqBA,CAACC,EAAQC,EAAoBC,EAAY,MAC9D,MAAMC,EAAYC,KAAKC,UAAUL,GACjCZ,EAAWkB,IAAK,IAAUA,EAAOH,CAACA,GAAY,CAAEI,MAAOJ,EAAWK,IAAKR,EAAKC,QAAOC,gBACnFX,EAAgBkB,GAAUA,EAAKC,SAASP,GAAaM,EAAO,IAAIA,EAAMN,KAmCtEQ,iBAhCwBX,IACxB,MAAMG,EAAYC,KAAKC,UAAUL,GACjCZ,EAAWkB,IACT,MAAMM,EAAW,IAAKN,GAEtB,cADOM,EAAST,GACTS,IAETrB,EAAgBkB,GAASA,EAAKZ,OAAQD,GAAQA,IAAQO,KA0BtDV,gBACAoB,mBAlB0Bf,IAC1B,IAAKA,EAAO,MAAO,GACnB,MAAMgB,EAAOhB,EAAMI,WAAWa,OAC9B,OAAID,IACuB,iBAAhBhB,EAAMG,OAA6C,iBAAhBH,EAAMG,MAA2Be,OAAOlB,EAAMG,OACrFe,OAAOlB,EAAMU,KAAOV,EAAMS,OAAS,IAAIQ,SAc9CE,SAXgBjB,IAChB,MAAMG,EAAYC,KAAKC,UAAUL,GACjC,OAAOb,EAAQgB,IAAYF,OAASe,OAAOhB,IAW/C"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createSignal as e,onCleanup as t}from"solid-js";function o(o){const[n,i]=e("");let r,h=0;return t(()=>{r&&window.clearTimeout(r)}),{handleTypeahead:e=>{const t=Date.now(),l=n(),s=1===l.length&&l===e&&t-h<650?e:`${l}${e}`;h=t,i(s),r&&window.clearTimeout(r),r=window.setTimeout(()=>i(""),650);const a=(e=>{const t=o.optionEntries();if(!t.length)return-1;const n=e.toLowerCase(),i=o.highlightedIndex()>=0?(o.highlightedIndex()+1)%t.length:0;for(let e=0;e<t.length;e+=1){const r=(i+e)%t.length;if(o.getOptionLabelText(t[r]).toLowerCase().startsWith(n))return r}return-1})(s);a>=0&&o.onMatch(a)},resetTypeahead:()=>{i(""),r&&(window.clearTimeout(r),r=void 0)}}}export{o as useTypeahead};
|
|
2
|
+
//# sourceMappingURL=useTypeahead.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTypeahead.js","sources":["../../../src/components/Select/useTypeahead.ts"],"sourcesContent":["import { Accessor, createSignal, onCleanup } from \"solid-js\";\nimport { OptionEntry } from \"./useSelectOptions\";\n\nconst TYPEAHEAD_TIMEOUT = 650;\n\nexport interface TypeaheadConfig<T> {\n /** Accessor for the ordered option entries */\n optionEntries: Accessor<OptionEntry<T>[]>;\n /** Accessor for the current highlighted index */\n highlightedIndex: Accessor<number>;\n /** Function to get a label string from an option entry */\n getOptionLabelText: (entry: OptionEntry<T>) => string;\n /** Called when a match is found — receives the matching index */\n onMatch: (index: number) => void;\n}\n\n/**\n * Typeahead search for Select. Buffers keystrokes and finds\n * the first option whose label starts with the typed string.\n */\nexport function useTypeahead<T>(config: TypeaheadConfig<T>) {\n const [typeahead, setTypeahead] = createSignal(\"\");\n let timeoutId: number | undefined;\n let lastTypeaheadAt = 0;\n\n const resetTypeahead = () => {\n setTypeahead(\"\");\n if (timeoutId) {\n window.clearTimeout(timeoutId);\n timeoutId = undefined;\n }\n };\n\n const findMatchIndex = (search: string): number => {\n const entries = config.optionEntries();\n if (!entries.length) return -1;\n const normalized = search.toLowerCase();\n const start = config.highlightedIndex() >= 0\n ? (config.highlightedIndex() + 1) % entries.length\n : 0;\n for (let i = 0; i < entries.length; i += 1) {\n const idx = (start + i) % entries.length;\n const label = config.getOptionLabelText(entries[idx]).toLowerCase();\n if (label.startsWith(normalized)) return idx;\n }\n return -1;\n };\n\n const handleTypeahead = (key: string) => {\n const now = Date.now();\n const prev = typeahead();\n const isRepeat = prev.length === 1 && prev === key && (now - lastTypeaheadAt) < TYPEAHEAD_TIMEOUT;\n const nextBuffer = isRepeat ? key : `${prev}${key}`;\n lastTypeaheadAt = now;\n setTypeahead(nextBuffer);\n\n if (timeoutId) window.clearTimeout(timeoutId);\n timeoutId = window.setTimeout(() => setTypeahead(\"\"), TYPEAHEAD_TIMEOUT);\n\n const matchIndex = findMatchIndex(nextBuffer);\n if (matchIndex >= 0) {\n config.onMatch(matchIndex);\n }\n };\n\n onCleanup(() => {\n if (timeoutId) {\n window.clearTimeout(timeoutId);\n }\n });\n\n return { handleTypeahead, resetTypeahead };\n}\n"],"names":["useTypeahead","config","typeahead","setTypeahead","createSignal","timeoutId","lastTypeaheadAt","onCleanup","window","clearTimeout","handleTypeahead","key","now","Date","prev","nextBuffer","length","setTimeout","matchIndex","search","entries","optionEntries","normalized","toLowerCase","start","highlightedIndex","i","idx","getOptionLabelText","startsWith","findMatchIndex","onMatch","resetTypeahead","undefined"],"mappings":"uDAoBM,SAAUA,EAAgBC,GAC9B,MAAOC,EAAWC,GAAgBC,EAAa,IAC/C,IAAIC,EACAC,EAAkB,EAgDtB,OANAC,EAAU,KACJF,GACFG,OAAOC,aAAaJ,KAIjB,CAAEK,gBAvBgBC,IACvB,MAAMC,EAAMC,KAAKD,MACXE,EAAOZ,IAEPa,EAD2B,IAAhBD,EAAKE,QAAgBF,IAASH,GAAQC,EAAMN,EAhDvC,IAiDQK,EAAM,GAAGG,IAAOH,IAC9CL,EAAkBM,EAClBT,EAAaY,GAETV,GAAWG,OAAOC,aAAaJ,GACnCA,EAAYG,OAAOS,WAAW,IAAMd,EAAa,IAtD3B,KAwDtB,MAAMe,EA1BgBC,KACtB,MAAMC,EAAUnB,EAAOoB,gBACvB,IAAKD,EAAQJ,OAAQ,OAAO,EAC5B,MAAMM,EAAaH,EAAOI,cACpBC,EAAQvB,EAAOwB,oBAAsB,GACtCxB,EAAOwB,mBAAqB,GAAKL,EAAQJ,OAC1C,EACJ,IAAK,IAAIU,EAAI,EAAGA,EAAIN,EAAQJ,OAAQU,GAAK,EAAG,CAC1C,MAAMC,GAAOH,EAAQE,GAAKN,EAAQJ,OAElC,GADcf,EAAO2B,mBAAmBR,EAAQO,IAAMJ,cAC5CM,WAAWP,GAAa,OAAOK,CAC3C,CACA,OAAO,GAcYG,CAAef,GAC9BG,GAAc,GAChBjB,EAAO8B,QAAQb,IAUOc,eA9CHA,KACrB7B,EAAa,IACTE,IACFG,OAAOC,aAAaJ,GACpBA,OAAY4B,IA2ClB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createComponent as e,insert as t,mergeProps as r,effect as o,className as n,template as i,Portal as s,setStyleProperty as l}from"solid-js/web";import{createSignal as a,Show as u,For as m,onCleanup as c}from"solid-js";import d from"./snackbar.module.scss.js";import{Button as g}from"../Button/Button.js";var h=i("<div>"),v=i("<div role=status aria-live=polite><span>");const[f,p]=a([]),C=e=>p(t=>[...t,e]),b=()=>e(u,{get when(){return f().length>0},get children(){var i=h();return t(i,e(m,{get each(){return f()},children:(t,o)=>e(j,r(t,{get index(){return o()},onClose:()=>(e=>p(t=>t.filter((t,r)=>r!==e)))(o())}))})),o(()=>n(i,d.snackContainer)),i}}),j=r=>{const i=setTimeout(r.onClose,r.closeTimeout??5e3);c(()=>clearTimeout(i));const a=Math.floor(r.message.length/17);return e(s,{get mount(){return document.body},get children(){var i=v(),s=i.firstChild;return t(s,()=>r.message),t(i,e(g,{get onClick(){return r.onClose},"aria-label":"Close notification",children:"X"}),null),o(e=>{var t=10+r.index*(50+8*a)+"px",o=`${d.primary} ${d.snack} ${d[r.severity??"info"]}`;return t!==e.e&&l(i,"bottom",e.e=t),o!==e.t&&n(i,e.t=o),e},{e:void 0,t:void 0}),i}})};export{b as SnackbarController,C as addSnackbar};
|
|
2
|
+
//# sourceMappingURL=snackbar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snackbar.js","sources":["../../../src/components/Snackbar/snackbar.tsx"],"sourcesContent":["import { Component, createSignal, Show, For, onCleanup } from \"solid-js\";\n// @ts-ignore\nimport style from \"./snackbar.module.scss\"; // .snack{Error/Success/Info/Warning}\nimport { Portal } from \"solid-js/web\";\nimport { Button } from \"../Button/Button\";\n/**\n * Snackbar descriptor\n * - message: text content\n * - severity: maps to style variants\n * - closeTimeout: ms before auto close (default 5000)\n */\nexport interface Snackbar {\n message: string;\n severity?: \"error\" | \"warning\" | \"info\" | \"success\";\n closeTimeout?: number;\n}\n\nconst [snackbars, setSnackbars] = createSignal<Snackbar[]>([]);\n/** Queue a snackbar to display */\nconst addSnackbar = (snack: Snackbar) => setSnackbars(old => [...old, snack]);\n/** Remove snackbar at index */\nconst removeSnackbar = (index: number) => setSnackbars(old => old.filter((_, i) => i !== index));\n\n/** Mount once near app root to render any queued snackbars (portal not required here but container simplifies styling) */\nconst SnackbarController: Component = () => (\n <Show when={snackbars().length > 0}>\n <div class={style.snackContainer}>\n <For each={snackbars()}>{(snack, index) => (\n <Snackbar {...snack} index={index()} onClose={() => removeSnackbar(index())} />\n )}</For>\n </div>\n </Show>\n);\ninterface SnackbarProps extends Snackbar { onClose: () => void; index: number; }\n\nconst Snackbar: Component<SnackbarProps> = (props) => {\n // Timer management: ensure only one timeout per snackbar instance\n const timeout = setTimeout(props.onClose, props.closeTimeout ?? 5000);\n onCleanup(() => clearTimeout(timeout));\n const messageLinesHeuristic = Math.floor(props.message.length / 17); // maintain original vertical stacking calc\n return (\n <Portal mount={document.body}>\n <div\n style={{ bottom: `${10 + (props.index * (50 + (messageLinesHeuristic * 8)))}px` }}\n class={`${style.primary} ${style.snack} ${style[props.severity ?? 'info']}`}\n role=\"status\"\n aria-live=\"polite\"\n >\n <span>{props.message}</span>\n <Button onClick={props.onClose} aria-label=\"Close notification\">X</Button>\n </div>\n </Portal>\n );\n};\nexport { addSnackbar, SnackbarController };\nexport default addSnackbar;"],"names":["snackbars","setSnackbars","createSignal","addSnackbar","snack","old","SnackbarController","_$createComponent","Show","when","length","children","_el$","_tmpl$","_$insert","For","each","index","Snackbar","_$mergeProps","onClose","filter","_","i","removeSnackbar","_$effect","_$className","style","snackContainer","props","timeout","setTimeout","closeTimeout","onCleanup","clearTimeout","messageLinesHeuristic","Math","floor","message","Portal","mount","document","body","_el$2","_tmpl$2","_el$3","firstChild","Button","onClick","_p$","_v$","_v$2","primary","severity","e","_$setStyleProperty","t","undefined"],"mappings":"uXAiBA,MAAOA,EAAWC,GAAgBC,EAAyB,IAErDC,EA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OAAAG,EAAAD,OAAAC,IAAAd,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import n from"../../styleInject.js";var r={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"};n(".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}");export{r as default};
|
|
2
|
+
//# sourceMappingURL=snackbar.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snackbar.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{delegateEvents as t,insert as i,createComponent as e,use as o,effect as r,classList as a,style as n,className as c,template as s}from"solid-js/web";import{createSignal as d,createMemo as l,createEffect as v,For as h,Show as u}from"solid-js";import b from"./tabs.module.scss.js";var f=s("<div>"),g=s("<div><div><div>"),m=s("<button>");const T=t=>{let s=[];const[T,$]=d({}),z=l(()=>!(!Object.keys(t).includes("noRail")||!1===t.noRail));v(()=>{const i=t.activeTab,e=s[i];if(e){const t=e.offsetLeft,i=e.offsetWidth;e.style,$({width:`${i}px`,transform:`translateX(${t}px)`})}});const k=l(()=>{switch(t?.tabPosition){case"center":return b.center;case"end":return b.end;case"start":return b.start;default:return b.stretch}}),x={...t.colors?.background?{background:t.colors.background}:{},...t.size?.height?{height:t.size.height}:{}},p={...t.colors?.indicator?{"background-color":t.colors.indicator}:{},...t.size?.indicatorHeight?{height:t.size.indicatorHeight}:{},...t.animationTiming?{transition:`transform ${t.animationTiming}, width ${t.animationTiming}`}:{}},w=i=>i===t.activeTab;return C=g(),j=C.firstChild,R=j.firstChild,i(j,e(h,{get each(){return t.tabs},children:(e,c)=>{return(d=m()).$$click=()=>t.onTabChange?.(e,c()),o(t=>s[c()]=t,d),i(d,e),r(i=>{var e={[b.tabButton]:!0,[b.active]:c()===t.activeTab,[b.inactive]:c()!==t.activeTab},o={...t.size?.fontSize?{"font-size":t.size.fontSize}:{},...t.colors?.text?{color:t.colors.text}:{},...t.colors?.activeText&&w(c())?{color:t.colors.activeText}:{}};return i.e=a(d,e,i.e),i.t=n(d,o,i.t),i},{e:void 0,t:void 0}),d;var d}}),R),i(j,e(u,{get when(){return!z()},get children(){var t=f();return r(()=>c(t,b.barRail)),t}}),R),r(i=>{var e,o=b.tabBarContainer,r=x,a=`${k()} ${t?.class??""}`,s=`${b.indicator} ${t.indicatorClass} ${e=t.activeTab,w(e)?b.active:""}`,d={...p,...T()};return o!==i.e&&c(C,i.e=o),i.t=n(C,r,i.t),a!==i.a&&c(j,i.a=a),s!==i.o&&c(R,i.o=s),i.i=n(R,d,i.i),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),C;var C,j,R};t(["click"]);export{T as TabBar};
|
|
2
|
+
//# sourceMappingURL=tabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.js","sources":["../../../src/components/TabV2/tabs.tsx"],"sourcesContent":["import { Component, createEffect, createMemo, createSignal, For, JSX, Show } from \"solid-js\";\n// @ts-ignore\nimport styles from \"./tabs.module.scss\";\n\ninterface TabBarProps {\n tabs: string[]; // Array of tab labels\n activeTab: number; // Index of the active tab\n class?: string;\n indicatorClass?: string;\n noRail?: boolean; // Hide the bottom border of the tab bar\n onTabChange?: (label:string, index: number) => void; // Callback fired when a tab is clicked\n tabPosition?: \"start\" | \"center\" | \"end\" | \"stretch\"; // Position of the tab bar (default: \"stretch\")\n colors?: {\n text?: string; // Text color for inactive tabs\n activeText?: string; // Text color for the active tab\n background?: string; // Background color for the tab bar\n indicator?: string; // Color for the indicator bar\n };\n size?: {\n height?: string; // Height of the tab bar (e.g. \"50px\")\n fontSize?: string; // Font size for tab labels (e.g. \"14px\")\n indicatorHeight?: string;// Thickness of the indicator (e.g. \"3px\")\n };\n animationTiming?: string; // CSS timing for indicator transition (e.g. \"0.3s ease\")\n}\n\nexport const TabBar: Component<TabBarProps> = (props) => {\n // Refs to each tab button element for measuring position/width\n let tabRefs: HTMLButtonElement[] = [];\n\n // Signal to hold the dynamic style for the indicator (left offset and width)\n const [indicatorStyle, setIndicatorStyle] = createSignal({});\n const noRail = createMemo(() => {\n if (Object.keys(props).includes(\"noRail\") && props.noRail !== false) {\n return true;\n }\n return false;\n });\n // Effect: update indicator position & width whenever activeTab changes\n createEffect(() => {\n const currentIndex = props.activeTab;\n const tabEl = tabRefs[currentIndex];\n if (tabEl) {\n const offsetLeft = tabEl.offsetLeft;\n const tabWidth = tabEl.offsetWidth;\n tabEl.style; \n setIndicatorStyle({\n width: `${tabWidth}px`,\n transform: `translateX(${offsetLeft}px)`\n });\n }\n });\n\n const getPosition = createMemo(() => {\n switch (props?.tabPosition) {\n case \"center\": return styles.center;\n case \"end\": return styles.end;\n case \"start\": return styles.start;\n default: return styles.stretch;\n }\n });\n\n // Prepare style objects for container and indicator based on props (for customization)\n const containerStyle: JSX.CSSProperties = {\n ...(props.colors?.background ? { background: props.colors.background } : {}),\n ...(props.size?.height ? { height: props.size.height } : {})\n };\n const indicatorBaseStyle: JSX.CSSProperties = {\n ...(props.colors?.indicator ? { \"background-color\": props.colors.indicator } : {}),\n ...(props.size?.indicatorHeight ? { height: props.size.indicatorHeight } : {}),\n // Apply custom transition timing if provided, otherwise use default from CSS\n ...(props.animationTiming ? { transition: `transform ${props.animationTiming}, width ${props.animationTiming}` } : {})\n };\n\n const isActive = (index: number) => index === props.activeTab;\n const isActiveClass = (index: number) => isActive(index) ? styles.active : '';\n\n return (\n <div class={styles.tabBarContainer} style={containerStyle}>\n <div class={`${getPosition()} ${props?.class ?? ''}`}>\n <For each={props.tabs}>{(label, index) => (\n <button\n ref={(el) => tabRefs[index()] = el} \n classList={{\n [styles.tabButton]: true, \n [styles.active]: index() === props.activeTab,\n [styles.inactive]: index() !== props.activeTab \n }}\n style={{\n ...(props.size?.fontSize ? { \"font-size\": props.size.fontSize } : {}),\n ...(props.colors?.text ? { color: props.colors.text } : {}),\n ...(props.colors?.activeText && isActive(index()) ? { color: props.colors.activeText } : {})\n }}\n onClick={() => props.onTabChange?.(label, index())}\n >\n {label}\n </button>\n )}</For>\n <Show when={!noRail()}>\n <div class={styles.barRail} />\n </Show>\n <div \n class={`${styles.indicator} ${props.indicatorClass} ${isActiveClass(props.activeTab)}`} \n style={{ ...indicatorBaseStyle, ...indicatorStyle() }} \n />\n </div>\n </div>\n );\n};\n"],"names":["TabBar","props","tabRefs","indicatorStyle","setIndicatorStyle","createSignal","noRail","createMemo","Object","keys","includes","createEffect","currentIndex","activeTab","tabEl","offsetLeft","tabWidth","offsetWidth","style","width","transform","getPosition","tabPosition","styles","center","end","start","stretch","containerStyle","colors","background","size","height","indicatorBaseStyle","indicator","indicatorHeight","animationTiming","transition","isActive","index","_el$","_tmpl$2","_el$2","firstChild","_el$4","_$insert","_$createComponent","For","each","tabs","children","label","_el$5","_tmpl$3","$$click","onTabChange","_$use","el","_$effect","_p$","_v$6","tabButton","active","inactive","_v$7","fontSize","text","color","activeText","e","_$classList","t","_$style","undefined","Show","when","_el$3","_tmpl$","_$className","barRail","_v$","tabBarContainer","_v$2","_v$3","class","_v$4","indicatorClass","_v$5","a","o","i","_$delegateEvents"],"mappings":"qVA0BO,MAAMA,EAAkCC,IAE7C,IAAIC,EAA+B,GAGnC,MAAOC,EAAgBC,GAAqBC,EAAa,CAAA,GACnDC,EAASC,EAAW,OACpBC,OAAOC,KAAKR,GAAOS,SAAS,YAA8B,IAAjBT,EAAMK,SAMrDK,EAAa,KACX,MAAMC,EAAeX,EAAMY,UACrBC,EAAQZ,EAAQU,GACtB,GAAIE,EAAO,CACT,MAAMC,EAAaD,EAAMC,WACnBC,EAAYF,EAAMG,YACxBH,EAAMI,MACNd,EAAkB,CAChBe,MAAO,GAAGH,MACVI,UAAW,cAAcL,QAE7B,IAGF,MAAMM,EAAcd,EAAW,KAC7B,OAAQN,GAAOqB,aACb,IAAK,SAAU,OAAOC,EAAOC,OAC7B,IAAK,MAAO,OAAOD,EAAOE,IAC1B,IAAK,QAAS,OAAOF,EAAOG,MAC5B,QAAS,OAAOH,EAAOI,WAKrBC,EAAoC,IACpC3B,EAAM4B,QAAQC,WAAa,CAAEA,WAAY7B,EAAM4B,OAAOC,YAAe,MACrE7B,EAAM8B,MAAMC,OAAS,CAAEA,OAAQ/B,EAAM8B,KAAKC,QAA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OAAGrE,GAAQ,EAAA,YAAA4C,GAAA,IAAA0B,EAAAC,IACO,OADPnB,MAAAoB,EAAAF,EACPrD,EAAOwD,UAAOH,CAAA,IAAAhC,GAAAc,EAAAC,IAAA,IAxBXpB,EAwBWyC,EArBpBzD,EAAO0D,gBAAeC,EAAStD,EAAcuD,EAC3C,GAAG9D,OAAiBpB,GAAOmF,OAAS,KAAIC,EAuBzC,GAAG9D,EAAOW,aAAajC,EAAMqF,kBA3BrB/C,EA2BqDtC,EAAMY,UA3BzCyB,EAASC,GAAShB,EAAOuC,OAAS,KA2BmByB,EAC/E,IAAKtD,KAAuB9B,KAAkB,OAAA6E,IAAArB,EAAAU,GAAAS,EAAAtC,EAAAmB,EAAAU,EAAAW,GAAArB,EAAAY,EAAAC,EAAAhC,EAAA0C,EAAAvB,EAAAY,GAAAY,IAAAxB,EAAA6B,GAAAV,EAAApC,EAAAiB,EAAA6B,EAAAL,GAAAE,IAAA1B,EAAA8B,GAAAX,EAAAlC,EAAAe,EAAA8B,EAAAJ,GAAA1B,EAAA+B,EAAAlB,EAAA5B,EAAA2C,EAAA5B,EAAA+B,GAAA/B,GAAA,CAAAU,OAAAI,EAAAF,OAAAE,EAAAe,OAAAf,EAAAgB,OAAAhB,EAAAiB,OAAAjB,IAAAjC,EA1B7D,IAAAA,EAAAE,EAAAE,GA+BA+C,EAAA,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import n from"../../styleInject.js";var t={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"};n("/* 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}");export{t as default};
|
|
2
|
+
//# sourceMappingURL=tabs.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{splitProps as l,createEffect as e,onCleanup as o}from"solid-js";import{useColumnContext as s,useTableContext as r}from"./tableProvider.js";const t=t=>{const a=s(),{addFooterCell:c,addFootCellStyle:d,removeFooterCell:n,addRowCell:i,addCellStyle:m,removeRowCell:y}=r(),[h,C]=l(t,["children","class","style","footer","rowNumber","header"]),f=()=>a.name,p=()=>(h?.rowNumber??1)-1;let u=!1,w=!1;return e(()=>{const l=f(),e=p();if(t.children,!l)return;u&&(n?.(e,l),u=!1),w&&(y?.(e,l),w=!1);const o=!0===h.footer,s=!0===h.header;o?c&&d&&(c(e,l,h.children),d(e,l,{class:h.class,style:h.style,all:C}),u=!0):s?i&&m&&(i(e,l,h.children),m(e,l,{class:h.class,style:h.style,all:C}),w=!0):i&&m&&(i(e,l,h.children),m(e,l,{class:h.class,style:h.style,all:{...C,colSpan:C?.colSpan??1}}),w=!0)}),o(()=>{const l=f(),e=p();l&&(u&&n&&n(e,l),w&&y&&y(e,l))}),[]};export{t as Cell};
|
|
2
|
+
//# sourceMappingURL=cell.js.map
|