@lmb-it/kitsconcerto-native 0.1.277 → 0.1.284
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/components/Avatar/index.cjs +1 -0
- package/components/Avatar/index.cjs.map +1 -1
- package/components/Avatar/index.js +1 -0
- package/components/Avatar/index.js.map +1 -1
- package/components/Banner/banner.cjs +1 -0
- package/components/Banner/banner.cjs.map +1 -1
- package/components/Banner/banner.js +1 -0
- package/components/Banner/banner.js.map +1 -1
- package/components/BottomTabBar/index.cjs +1 -0
- package/components/BottomTabBar/index.cjs.map +1 -1
- package/components/BottomTabBar/index.js +1 -0
- package/components/BottomTabBar/index.js.map +1 -1
- package/components/BreadCrumb/index.cjs.map +1 -1
- package/components/BreadCrumb/index.js.map +1 -1
- package/components/Button/Button.cjs +1 -0
- package/components/Button/Button.cjs.map +1 -1
- package/components/Button/Button.js +1 -0
- package/components/Button/Button.js.map +1 -1
- package/components/Carousel/index.cjs +1 -0
- package/components/Carousel/index.cjs.map +1 -1
- package/components/Carousel/index.js +1 -0
- package/components/Carousel/index.js.map +1 -1
- package/components/ChatBubble/index.cjs +1 -0
- package/components/ChatBubble/index.cjs.map +1 -1
- package/components/ChatBubble/index.js +1 -0
- package/components/ChatBubble/index.js.map +1 -1
- package/components/Chip/index.cjs +1 -0
- package/components/Chip/index.cjs.map +1 -1
- package/components/Chip/index.js +1 -0
- package/components/Chip/index.js.map +1 -1
- package/components/DateSeparator/index.cjs +1 -0
- package/components/DateSeparator/index.cjs.map +1 -1
- package/components/DateSeparator/index.js +1 -0
- package/components/DateSeparator/index.js.map +1 -1
- package/components/DetailsList/index.cjs +1 -0
- package/components/DetailsList/index.cjs.map +1 -1
- package/components/DetailsList/index.js +1 -0
- package/components/DetailsList/index.js.map +1 -1
- package/components/EmptyState/index.cjs +1 -0
- package/components/EmptyState/index.cjs.map +1 -1
- package/components/EmptyState/index.js +1 -0
- package/components/EmptyState/index.js.map +1 -1
- package/components/Gallery/index.cjs +1 -0
- package/components/Gallery/index.cjs.map +1 -1
- package/components/Gallery/index.js +1 -0
- package/components/Gallery/index.js.map +1 -1
- package/components/MessageComposer/index.cjs +1 -0
- package/components/MessageComposer/index.cjs.map +1 -1
- package/components/MessageComposer/index.js +1 -0
- package/components/MessageComposer/index.js.map +1 -1
- package/components/MessageReceipt/index.cjs +1 -0
- package/components/MessageReceipt/index.cjs.map +1 -1
- package/components/MessageReceipt/index.js +1 -0
- package/components/MessageReceipt/index.js.map +1 -1
- package/components/ProgressBar/index.cjs +1 -0
- package/components/ProgressBar/index.cjs.map +1 -1
- package/components/ProgressBar/index.js +1 -0
- package/components/ProgressBar/index.js.map +1 -1
- package/components/SegmentedControl/index.cjs +1 -0
- package/components/SegmentedControl/index.cjs.map +1 -1
- package/components/SegmentedControl/index.js +1 -0
- package/components/SegmentedControl/index.js.map +1 -1
- package/components/StatCard/index.cjs +1 -0
- package/components/StatCard/index.cjs.map +1 -1
- package/components/StatCard/index.js +1 -0
- package/components/StatCard/index.js.map +1 -1
- package/components/Stepper/index.cjs +1 -0
- package/components/Stepper/index.cjs.map +1 -1
- package/components/Stepper/index.js +1 -0
- package/components/Stepper/index.js.map +1 -1
- package/components/Tabs/index.cjs +1 -0
- package/components/Tabs/index.cjs.map +1 -1
- package/components/Tabs/index.js +1 -0
- package/components/Tabs/index.js.map +1 -1
- package/components/Timeline/index.cjs +1 -0
- package/components/Timeline/index.cjs.map +1 -1
- package/components/Timeline/index.js +1 -0
- package/components/Timeline/index.js.map +1 -1
- package/components/Translate/index.cjs +1 -0
- package/components/Translate/index.cjs.map +1 -1
- package/components/Translate/index.js +1 -0
- package/components/Translate/index.js.map +1 -1
- package/components/TypingIndicator/index.cjs +1 -0
- package/components/TypingIndicator/index.cjs.map +1 -1
- package/components/TypingIndicator/index.js +1 -0
- package/components/TypingIndicator/index.js.map +1 -1
- package/components/overlay/ConfirmDialog/index.cjs +1 -0
- package/components/overlay/ConfirmDialog/index.cjs.map +1 -1
- package/components/overlay/ConfirmDialog/index.js +1 -0
- package/components/overlay/ConfirmDialog/index.js.map +1 -1
- package/components/overlay/Dialog/index.cjs +1 -0
- package/components/overlay/Dialog/index.cjs.map +1 -1
- package/components/overlay/Dialog/index.js +1 -0
- package/components/overlay/Dialog/index.js.map +1 -1
- package/contexts/BreadcrumbContext.cjs +33 -0
- package/contexts/BreadcrumbContext.cjs.map +1 -0
- package/contexts/BreadcrumbContext.js +28 -0
- package/contexts/BreadcrumbContext.js.map +1 -0
- package/form/controls/Checkbox/index.cjs +1 -0
- package/form/controls/Checkbox/index.cjs.map +1 -1
- package/form/controls/Checkbox/index.js +1 -0
- package/form/controls/Checkbox/index.js.map +1 -1
- package/form/controls/RadioButton/radio.cjs +1 -0
- package/form/controls/RadioButton/radio.cjs.map +1 -1
- package/form/controls/RadioButton/radio.js +1 -0
- package/form/controls/RadioButton/radio.js.map +1 -1
- package/form/controls/TriStateCheckbox/index.cjs +1 -0
- package/form/controls/TriStateCheckbox/index.cjs.map +1 -1
- package/form/controls/TriStateCheckbox/index.js +1 -0
- package/form/controls/TriStateCheckbox/index.js.map +1 -1
- package/form/file-pickers/index.cjs +1 -0
- package/form/file-pickers/index.cjs.map +1 -1
- package/form/file-pickers/index.js +1 -0
- package/form/file-pickers/index.js.map +1 -1
- package/form/helpers/FormContainer/index.cjs +1 -0
- package/form/helpers/FormContainer/index.cjs.map +1 -1
- package/form/helpers/FormContainer/index.js +1 -0
- package/form/helpers/FormContainer/index.js.map +1 -1
- package/form/inputs/ColorPicker/index.cjs +1 -0
- package/form/inputs/ColorPicker/index.cjs.map +1 -1
- package/form/inputs/ColorPicker/index.js +1 -0
- package/form/inputs/ColorPicker/index.js.map +1 -1
- package/form/inputs/Datepicker/index.cjs +1 -0
- package/form/inputs/Datepicker/index.cjs.map +1 -1
- package/form/inputs/Datepicker/index.js +1 -0
- package/form/inputs/Datepicker/index.js.map +1 -1
- package/form/inputs/InputLocation/index.cjs +1 -0
- package/form/inputs/InputLocation/index.cjs.map +1 -1
- package/form/inputs/InputLocation/index.js +1 -0
- package/form/inputs/InputLocation/index.js.map +1 -1
- package/form/inputs/InputMask/index.cjs +1 -0
- package/form/inputs/InputMask/index.cjs.map +1 -1
- package/form/inputs/InputMask/index.js +1 -0
- package/form/inputs/InputMask/index.js.map +1 -1
- package/form/inputs/InputNumber/index.cjs +1 -0
- package/form/inputs/InputNumber/index.cjs.map +1 -1
- package/form/inputs/InputNumber/index.js +1 -0
- package/form/inputs/InputNumber/index.js.map +1 -1
- package/form/inputs/InputPassword/index.cjs +1 -0
- package/form/inputs/InputPassword/index.cjs.map +1 -1
- package/form/inputs/InputPassword/index.js +1 -0
- package/form/inputs/InputPassword/index.js.map +1 -1
- package/form/inputs/InputSwitch/index.cjs +1 -0
- package/form/inputs/InputSwitch/index.cjs.map +1 -1
- package/form/inputs/InputSwitch/index.js +1 -0
- package/form/inputs/InputSwitch/index.js.map +1 -1
- package/form/inputs/InputText/index.cjs +1 -0
- package/form/inputs/InputText/index.cjs.map +1 -1
- package/form/inputs/InputText/index.js +1 -0
- package/form/inputs/InputText/index.js.map +1 -1
- package/form/inputs/InputTextarea/index.cjs +1 -0
- package/form/inputs/InputTextarea/index.cjs.map +1 -1
- package/form/inputs/InputTextarea/index.js +1 -0
- package/form/inputs/InputTextarea/index.js.map +1 -1
- package/form/inputs/PhoneInput/index.cjs +1 -0
- package/form/inputs/PhoneInput/index.cjs.map +1 -1
- package/form/inputs/PhoneInput/index.js +1 -0
- package/form/inputs/PhoneInput/index.js.map +1 -1
- package/form/selects/AutoComplete/index.cjs +1 -0
- package/form/selects/AutoComplete/index.cjs.map +1 -1
- package/form/selects/AutoComplete/index.js +1 -0
- package/form/selects/AutoComplete/index.js.map +1 -1
- package/form/selects/CascadeSelect/index.cjs +1 -0
- package/form/selects/CascadeSelect/index.cjs.map +1 -1
- package/form/selects/CascadeSelect/index.js +1 -0
- package/form/selects/CascadeSelect/index.js.map +1 -1
- package/form/selects/Dropdown/index.cjs +1 -0
- package/form/selects/Dropdown/index.cjs.map +1 -1
- package/form/selects/Dropdown/index.js +1 -0
- package/form/selects/Dropdown/index.js.map +1 -1
- package/form/selects/ListBox/index.cjs +1 -0
- package/form/selects/ListBox/index.cjs.map +1 -1
- package/form/selects/ListBox/index.js +1 -0
- package/form/selects/ListBox/index.js.map +1 -1
- package/form/selects/MultiSelect/index.cjs +1 -0
- package/form/selects/MultiSelect/index.cjs.map +1 -1
- package/form/selects/MultiSelect/index.js +1 -0
- package/form/selects/MultiSelect/index.js.map +1 -1
- package/form/selects/TreeSelect/index.cjs +1 -0
- package/form/selects/TreeSelect/index.cjs.map +1 -1
- package/form/selects/TreeSelect/index.js +1 -0
- package/form/selects/TreeSelect/index.js.map +1 -1
- package/form/selects/helpers/SelectPopupOverlay.cjs +1 -0
- package/form/selects/helpers/SelectPopupOverlay.cjs.map +1 -1
- package/form/selects/helpers/SelectPopupOverlay.js +1 -0
- package/form/selects/helpers/SelectPopupOverlay.js.map +1 -1
- package/form-renderer/components/fields/FileUploader/index.cjs +1 -0
- package/form-renderer/components/fields/FileUploader/index.cjs.map +1 -1
- package/form-renderer/components/fields/FileUploader/index.js +1 -0
- package/form-renderer/components/fields/FileUploader/index.js.map +1 -1
- package/form-renderer/components/fields/Group/index.cjs +1 -0
- package/form-renderer/components/fields/Group/index.cjs.map +1 -1
- package/form-renderer/components/fields/Group/index.js +1 -0
- package/form-renderer/components/fields/Group/index.js.map +1 -1
- package/form-renderer/components/fields/Radios/index.cjs +1 -0
- package/form-renderer/components/fields/Radios/index.cjs.map +1 -1
- package/form-renderer/components/fields/Radios/index.js +1 -0
- package/form-renderer/components/fields/Radios/index.js.map +1 -1
- package/form-renderer/components/fields/Select/index.cjs +1 -0
- package/form-renderer/components/fields/Select/index.cjs.map +1 -1
- package/form-renderer/components/fields/Select/index.js +1 -0
- package/form-renderer/components/fields/Select/index.js.map +1 -1
- package/hooks/main.cjs +1 -0
- package/hooks/main.cjs.map +1 -1
- package/hooks/main.js +1 -0
- package/hooks/main.js.map +1 -1
- package/hooks/useBreadcrumbTrail.cjs +21 -0
- package/hooks/useBreadcrumbTrail.cjs.map +1 -0
- package/hooks/useBreadcrumbTrail.js +16 -0
- package/hooks/useBreadcrumbTrail.js.map +1 -0
- package/index.cjs +5 -0
- package/index.cjs.map +1 -1
- package/index.d.ts +144 -5
- package/index.js +2 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/primitives/Card/index.cjs +1 -0
- package/primitives/Card/index.cjs.map +1 -1
- package/primitives/Card/index.js +1 -0
- package/primitives/Card/index.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/form/selects/Dropdown/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport { Dropdown } from \"@lmb-it/kitsconcertomobile\";\nimport type { IDropdownSelect } from \"@lmb-it/kitsconcerto-types\";\nimport { KitsContainer } from \"../../../_compat\";\nimport { ClHelper } from \"../../helpers/Functions\";\nimport { useSelectBase } from \"../hooks/useSelectBase\";\nimport {useComponentDefaults, useLanguage, useResolvedStyle} from \"../../../hooks\";\nimport SelectPopupOverlay from \"../helpers/SelectPopupOverlay\";\nimport useThemedFont from \"../../../hooks/useThemedFont\";\n\nconst KitsDropdown = ({ className, ref, ...rawProps }: IDropdownSelect) => {\n const {mergedProps: props, themeStyle, elementStyles} = useComponentDefaults('DropdownSelect', rawProps, 'Select');\n const resolvedThemeStyle = useResolvedStyle(themeStyle);\n const resolvedRootStyle = useResolvedStyle(elementStyles?.root || {});\n const {\n id,\n rightAddon,\n leftAddon,\n errors,\n invalid,\n disabled,\n required,\n label,\n localProps,\n helperText,\n isFloatedLabel,\n withFilter,\n attached,\n inputSize,\n placeholder,\n hideError,\n virtualScroll,\n emptyFilterMessage,\n filterBy,\n loading,\n showClear,\n containerStyle,\n popup,\n } = props;\n\n const { list, keys, onChange, selectedValue } = useSelectBase();\n\n /* The panel's own copy. The native Dropdown lives in `apps/mobile`, which\n this package imports, so it cannot reach LocaleContext itself without a\n cycle between the two workspaces — the sentence is resolved here, where\n `useLanguage()` already is, and passed down as a prop.\n\n ⛔ `isRTL` is the READER's language, never `I18nManager.isRTL`. A\n consumer that forces RTL at boot keeps that process direction after the\n reader switches to English, and the filter field must follow the reader. */\n const { t, isRTL } = useLanguage();\n /* The face the consuming app's theme names for body text. React Native does\n not cascade fontFamily through Views, so the panel has to be told. */\n const bodyFont = useThemedFont('body');\n\n const ClState = ClHelper({\n inputSize: inputSize ?? \"\",\n isChecked: false,\n isInvalid: !!invalid,\n isDisabled: !!disabled,\n });\n\n const dropdownValue = selectedValue != null && typeof selectedValue !== 'object'\n ? selectedValue.toString()\n : selectedValue;\n\n const Element = (\n <Dropdown\n emptyFilterMessage={emptyFilterMessage ?? t('emptyFilterMessage')}\n filterPlaceholder={t('searchPlaceholder')}\n isRTL={isRTL}\n fontFamily={bodyFont}\n popup={popup}\n popupTitle={label ?? placeholder}\n /* The container is this library's own Dialog. It is injected rather\n than imported by the native Dropdown because that component lives\n in `apps/mobile`, which this package imports — the reverse import\n would be a cycle between the two workspaces. */\n renderPopup={({visible, onClose, title, children}: {\n visible: boolean;\n onClose: () => void;\n title?: React.ReactNode;\n children: React.ReactNode;\n }) => (\n <SelectPopupOverlay visible={visible} onClose={onClose} title={title}>\n {children}\n </SelectPopupOverlay>\n )}\n value={dropdownValue}\n placeholder={placeholder}\n options={Array.isArray(list) ? list : []}\n disabled={disabled}\n loading={loading}\n showClear={showClear ?? (!required && selectedValue != null)}\n style={{ width: '100%', height: attached ? '100%' : undefined, borderRadius: 0, ...(resolvedRootStyle && Object.keys(resolvedRootStyle).length > 0 ? resolvedRootStyle : resolvedThemeStyle) }}\n onChange={onChange}\n {...keys}\n invalid={hideError && !!invalid}\n filter={!!withFilter}\n filterBy={filterBy ?? 'label'}\n virtualScrollerOptions={virtualScroll}\n className={`w-full ${className ?? ''} ${ClState}`}\n {...(localProps ? localProps : {})}\n />\n );\n\n if (attached) {\n return Element;\n }\n\n return (\n <KitsContainer\n id={id}\n inputSize={inputSize}\n isFloatedLabel={isFloatedLabel}\n rightAddon={rightAddon}\n leftAddon={leftAddon}\n required={required}\n hideError={hideError}\n errors={errors}\n helperText={helperText}\n invalid={invalid}\n label={label}\n containerStyle={containerStyle}\n elementStyles={elementStyles}\n >\n {Element}\n </KitsContainer>\n );\n}\nexport default KitsDropdown;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/form/selects/Dropdown/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport { Dropdown } from \"@lmb-it/kitsconcertomobile\";\nimport type { IDropdownSelect } from \"@lmb-it/kitsconcerto-types\";\nimport { KitsContainer } from \"../../../_compat\";\nimport { ClHelper } from \"../../helpers/Functions\";\nimport { useSelectBase } from \"../hooks/useSelectBase\";\nimport {useComponentDefaults, useLanguage, useResolvedStyle} from \"../../../hooks\";\nimport SelectPopupOverlay from \"../helpers/SelectPopupOverlay\";\nimport useThemedFont from \"../../../hooks/useThemedFont\";\n\nconst KitsDropdown = ({ className, ref, ...rawProps }: IDropdownSelect) => {\n const {mergedProps: props, themeStyle, elementStyles} = useComponentDefaults('DropdownSelect', rawProps, 'Select');\n const resolvedThemeStyle = useResolvedStyle(themeStyle);\n const resolvedRootStyle = useResolvedStyle(elementStyles?.root || {});\n const {\n id,\n rightAddon,\n leftAddon,\n errors,\n invalid,\n disabled,\n required,\n label,\n localProps,\n helperText,\n isFloatedLabel,\n withFilter,\n attached,\n inputSize,\n placeholder,\n hideError,\n virtualScroll,\n emptyFilterMessage,\n filterBy,\n loading,\n showClear,\n containerStyle,\n popup,\n } = props;\n\n const { list, keys, onChange, selectedValue } = useSelectBase();\n\n /* The panel's own copy. The native Dropdown lives in `apps/mobile`, which\n this package imports, so it cannot reach LocaleContext itself without a\n cycle between the two workspaces — the sentence is resolved here, where\n `useLanguage()` already is, and passed down as a prop.\n\n ⛔ `isRTL` is the READER's language, never `I18nManager.isRTL`. A\n consumer that forces RTL at boot keeps that process direction after the\n reader switches to English, and the filter field must follow the reader. */\n const { t, isRTL } = useLanguage();\n /* The face the consuming app's theme names for body text. React Native does\n not cascade fontFamily through Views, so the panel has to be told. */\n const bodyFont = useThemedFont('body');\n\n const ClState = ClHelper({\n inputSize: inputSize ?? \"\",\n isChecked: false,\n isInvalid: !!invalid,\n isDisabled: !!disabled,\n });\n\n const dropdownValue = selectedValue != null && typeof selectedValue !== 'object'\n ? selectedValue.toString()\n : selectedValue;\n\n const Element = (\n <Dropdown\n emptyFilterMessage={emptyFilterMessage ?? t('emptyFilterMessage')}\n filterPlaceholder={t('searchPlaceholder')}\n isRTL={isRTL}\n fontFamily={bodyFont}\n popup={popup}\n popupTitle={label ?? placeholder}\n /* The container is this library's own Dialog. It is injected rather\n than imported by the native Dropdown because that component lives\n in `apps/mobile`, which this package imports — the reverse import\n would be a cycle between the two workspaces. */\n renderPopup={({visible, onClose, title, children}: {\n visible: boolean;\n onClose: () => void;\n title?: React.ReactNode;\n children: React.ReactNode;\n }) => (\n <SelectPopupOverlay visible={visible} onClose={onClose} title={title}>\n {children}\n </SelectPopupOverlay>\n )}\n value={dropdownValue}\n placeholder={placeholder}\n options={Array.isArray(list) ? list : []}\n disabled={disabled}\n loading={loading}\n showClear={showClear ?? (!required && selectedValue != null)}\n style={{ width: '100%', height: attached ? '100%' : undefined, borderRadius: 0, ...(resolvedRootStyle && Object.keys(resolvedRootStyle).length > 0 ? resolvedRootStyle : resolvedThemeStyle) }}\n onChange={onChange}\n {...keys}\n invalid={hideError && !!invalid}\n filter={!!withFilter}\n filterBy={filterBy ?? 'label'}\n virtualScrollerOptions={virtualScroll}\n className={`w-full ${className ?? ''} ${ClState}`}\n {...(localProps ? localProps : {})}\n />\n );\n\n if (attached) {\n return Element;\n }\n\n return (\n <KitsContainer\n id={id}\n inputSize={inputSize}\n isFloatedLabel={isFloatedLabel}\n rightAddon={rightAddon}\n leftAddon={leftAddon}\n required={required}\n hideError={hideError}\n errors={errors}\n helperText={helperText}\n invalid={invalid}\n label={label}\n containerStyle={containerStyle}\n elementStyles={elementStyles}\n >\n {Element}\n </KitsContainer>\n );\n}\nexport default KitsDropdown;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,MAAM,eAAe,CAAC,EAAE,WAAW,GAAA,EAAK,GAAG,UAAS,KAAuB;AACvE,EAAA,MAAM,EAAC,aAAa,KAAA,EAAO,UAAA,EAAY,eAAa,GAAI,oBAAA,CAAqB,gBAAA,EAAkB,QAAA,EAAU,QAAQ,CAAA;AACjH,EAAA,MAAM,kBAAA,GAAqB,iBAAiB,UAAU,CAAA;AACtD,EAAA,MAAM,iBAAA,GAAoB,gBAAA,CAAiB,aAAA,EAAe,IAAA,IAAQ,EAAE,CAAA;AACpE,EAAA,MAAM;AAAA,IACF,EAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,cAAA;AAAA,IACA,UAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA;AAAA,IACA,WAAA;AAAA,IACA,SAAA;AAAA,IACA,aAAA;AAAA,IACA,kBAAA;AAAA,IACA,QAAA;AAAA,IACA,OAAA;AAAA,IACA,SAAA;AAAA,IACA,cAAA;AAAA,IACA;AAAA,GACJ,GAAI,KAAA;AAEJ,EAAA,MAAM,EAAE,IAAA,EAAM,IAAA,EAAM,QAAA,EAAU,aAAA,KAAkB,aAAA,EAAc;AAU9D,EAAA,MAAM,EAAE,CAAA,EAAG,KAAA,EAAM,GAAI,WAAA,EAAY;AAGjC,EAAA,MAAM,QAAA,GAAW,cAAc,MAAM,CAAA;AAErC,EAAA,MAAM,UAAU,QAAA,CAAS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AA,IAAa,CAAC,CAAC,OAAA;AAAA,MACxB,MAAA,EAAQ,CAAC,CAAC,UAAA;AAAA,MACV,UAAU,QAAA,IAAY,OAAA;AAAA,MACtB,sBAAA,EAAwB,aAAA;AAAA,MACxB,SAAA,EAAW,CAAA,OAAA,EAAU,SAAA,IAAa,EAAE,IAAI,OAAO,CAAA,CAAA;AAAA,MAC9C,GAAI,UAAA,GAAa,UAAA,GAAa;AAAC;AAAA,GACpC;AAGJ,EAAA,IAAI,QAAA,EAAU;AACV,IAAA,OAAO,OAAA;AAAA,EACX;AAEA,EAAA,uBACI,GAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACG,EAAA;AAAA,MACA,SAAA;AAAA,MACA,cAAA;AAAA,MACA,UAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA;AAAA,MACA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,MACA,OAAA;AAAA,MACA,KAAA;AAAA,MACA,cAAA;AAAA,MACA,aAAA;AAAA,MAEC,QAAA,EAAA;AAAA;AAAA,GACL;AAER;;;;"}
|
|
@@ -90,6 +90,7 @@ require('../../../apps/mobile/src/Core/Input/Slot.cjs');
|
|
|
90
90
|
var locale = require('../../../hooks/locale.cjs');
|
|
91
91
|
require('../../../contexts/DialogContext.cjs');
|
|
92
92
|
require('../../../contexts/PermissionsContext.cjs');
|
|
93
|
+
require('../../../contexts/BreadcrumbContext.cjs');
|
|
93
94
|
var useComponentDefaults = require('../../../hooks/useComponentDefaults.cjs');
|
|
94
95
|
var useResolvedStyle = require('../../../hooks/useResolvedStyle.cjs');
|
|
95
96
|
var index = require('../../../primitives/Box/index.cjs');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../src/form/selects/ListBox/index.native.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useState } from \"react\";\nimport { ScrollView, Pressable, TextInput } from \"react-native\";\nimport { VStack, Box, Text } from '../../../_compat';\nimport type { IListBoxSelect } from \"@lmb-it/kitsconcerto-types\";\nimport { useSelectBase } from \"../hooks/useSelectBase\";\nimport KitsContainer from \"../../helpers/FormContainer\";\nimport { resolveThemeTokenForNative } from \"@lmb-it/kitsconcertomobile\";\nimport { useComponentDefaults, useLanguage, useResolvedStyle } from \"@lmb-it/kitsconcerto/hooks\";\n\nconst KitsListBox = (rawProps: IListBoxSelect) => {\n const { mergedProps: props, themeStyle, elementStyles } = useComponentDefaults('ListBox', rawProps, 'Select');\n const resolvedThemeStyle = useResolvedStyle(themeStyle);\n const resolvedRootStyle = useResolvedStyle(elementStyles?.root || {});\n const {\n id,\n label,\n disabled,\n invalid,\n errors,\n helperText,\n inputSize = \"md\",\n isMultiple,\n withFilter,\n filterBy,\n hideError,\n } = props;\n\n const { list, labelKey, valueKey, childrenKey, onChange, selectedValue } = useSelectBase();\n\n const [filterText, setFilterText] = useState(\"\");\n\n /* Same rule as the Dropdown's panel: the filter's copy and its edge come\n from the reader's language, not from the platform's layout direction. */\n const { t: translate, isRTL } = useLanguage();\n\n const t = resolveThemeTokenForNative;\n const primaryBg = t('highlight-bg') || t('primary.100') || '#E8EAF6';\n const primaryText = t('primary.700') || '#303F9F';\n const borderClr = invalid ? (t('danger') || '#EF4444') : (t('border') || '#D1D5DB');\n const textColor = t('text') || '#1F2937';\n const placeholderColor = t('text-secondary') || '#9CA3AF';\n const groupBg = t('surface-ground') || '#F9FAFB';\n\n const isSelected = useCallback((val: any) => {\n if (isMultiple && Array.isArray(selectedValue)) {\n return selectedValue.includes(val);\n }\n return selectedValue === val;\n }, [isMultiple, selectedValue]);\n\n const onSelect = useCallback((val: any, item: any) => {\n if (isMultiple && Array.isArray(selectedValue)) {\n const newVals = selectedValue.includes(val)\n ? selectedValue.filter((v: any) => v !== val)\n : [...selectedValue, val];\n onChange({ target: { value: newVals } }, newVals);\n } else {\n onChange({ target: { value: val } }, item);\n }\n }, [isMultiple, selectedValue, onChange]);\n\n const filteredList = useMemo(() => {\n if (!withFilter || !filterText.trim()) return list;\n const query = filterText.toLowerCase();\n const searchKey = filterBy || labelKey;\n\n if (childrenKey) {\n return list.reduce((acc: any[], group: any) => {\n const children = group[childrenKey];\n if (Array.isArray(children)) {\n const matched = children.filter((item: any) =>\n String(item[searchKey] ?? \"\").toLowerCase().includes(query)\n );\n if (matched.length > 0) {\n acc.push({ ...group, [childrenKey]: matched });\n }\n }\n return acc;\n }, []);\n }\n\n return list.filter((item: any) =>\n String(item[searchKey] ?? \"\").toLowerCase().includes(query)\n );\n }, [list, filterText, withFilter, filterBy, labelKey, childrenKey]);\n\n const renderItem = (item: any, index: number) => {\n const val = item[valueKey];\n const selected = isSelected(val);\n return (\n <Pressable\n key={`${val}-${index}`}\n style={{\n padding: 10,\n backgroundColor: selected ? primaryBg : 'transparent',\n }}\n onPress={() => !disabled && onSelect(val, item)}\n >\n <Text\n color={selected ? primaryText : textColor}\n fontWeight={selected ? \"bold\" : \"normal\"}\n size={inputSize}\n >\n {item[labelKey]}\n </Text>\n </Pressable>\n );\n };\n\n const renderGroupedItems = () => {\n return filteredList.map((group: any, gi: number) => {\n const children = group[childrenKey!];\n if (!Array.isArray(children)) {\n return renderItem(group, gi);\n }\n return (\n <Box key={`group-${gi}`}>\n <Box style={{ backgroundColor: groupBg, paddingHorizontal: 12, paddingVertical: 8 }}>\n <Text fontWeight=\"600\" color={textColor} size={inputSize}>\n {group[labelKey]}\n </Text>\n </Box>\n {children.map((item: any, ci: number) => renderItem(item, ci))}\n </Box>\n );\n });\n };\n\n return (\n <KitsContainer\n id={id}\n label={label}\n invalid={!!invalid}\n hideError={hideError}\n helperText={helperText}\n errors={errors}\n elementStyles={elementStyles}\n >\n <Box\n borderWidth={1}\n borderColor={borderClr}\n borderRadius=\"$sm\"\n height={250}\n opacity={disabled ? 0.5 : 1}\n style={resolvedRootStyle && Object.keys(resolvedRootStyle).length ? resolvedRootStyle : (Object.keys(resolvedThemeStyle).length ? resolvedThemeStyle : undefined)}\n >\n {withFilter && (\n <TextInput\n value={filterText}\n onChangeText={setFilterText}\n placeholder={translate('searchPlaceholder')}\n placeholderTextColor={placeholderColor}\n style={{\n borderBottomWidth: 1,\n borderBottomColor: borderClr,\n paddingHorizontal: 12,\n paddingVertical: 8,\n fontSize: 14,\n color: textColor,\n textAlign: isRTL ? 'right' : 'left',\n writingDirection: isRTL ? 'rtl' : 'ltr',\n }}\n />\n )}\n <ScrollView>\n <VStack>\n {childrenKey\n ? renderGroupedItems()\n : filteredList.map((item: any, i: number) => renderItem(item, i))\n }\n </VStack>\n </ScrollView>\n </Box>\n </KitsContainer>\n );\n};\n\nexport default KitsListBox;\n"],"names":["useComponentDefaults","useResolvedStyle","useSelectBase","useState","useLanguage","resolveThemeTokenForNative","useCallback","useMemo","jsx","Pressable","Text","Box","KitsContainer","jsxs","TextInput","ScrollView","VStack"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAM,WAAA,GAAc,CAAC,QAAA,KAA6B;AAC9C,EAAA,MAAM,EAAE,aAAa,KAAA,EAAO,UAAA,EAAY,eAAc,GAAIA,4BAAA,CAAqB,SAAA,EAAW,QAAA,EAAU,QAAQ,CAAA;AAC5G,EAAA,MAAM,kBAAA,GAAqBC,yBAAiB,UAAU,CAAA;AACtD,EAAA,MAAM,iBAAA,GAAoBA,wBAAA,CAAiB,aAAA,EAAe,IAAA,IAAQ,EAAE,CAAA;AACpE,EAAA,MAAM;AAAA,IACF,EAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,IACA,OAAA;AAAA,IACA,MAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA,GAAY,IAAA;AAAA,IACZ,UAAA;AAAA,IACA,UAAA;AAAA,IACA,QAAA;AAAA,IACA;AAAA,GACJ,GAAI,KAAA;AAEJ,EAAA,MAAM,EAAE,MAAM,QAAA,EAAU,QAAA,EAAU,a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,cAACM,qBAAA;AAAA,cAAA;AAAA,gBACG,KAAA,EAAO,UAAA;AAAA,gBACP,YAAA,EAAc,aAAA;AAAA,gBACd,WAAA,EAAa,UAAU,mBAAmB,CAAA;AAAA,gBAC1C,oBAAA,EAAsB,gBAAA;AAAA,gBACtB,KAAA,EAAO;AAAA,kBACH,iBAAA,EAAmB,CAAA;AAAA,kBACnB,iBAAA,EAAmB,SAAA;AAAA,kBACnB,iBAAA,EAAmB,EAAA;AAAA,kBACnB,eAAA,EAAiB,CAAA;AAAA,kBACjB,QAAA,EAAU,EAAA;AAAA,kBACV,KAAA,EAAO,SAAA;AAAA,kBACP,SAAA,EAAW,QAAQ,OAAA,GAAU,MAAA;AAAA,kBAC7B,gBAAA,EAAkB,QAAQ,KAAA,GAAQ;AAAA;AACtC;AAAA,aACJ;AAAA,2CAEHC,sBAAA,EAAA,EACG,QAAA,kBAAAP,cAAA,CAACQ,sBAAA,EAAA,EACI,QAAA,EAAA,WAAA,GACK,oBAAmB,GACnB,YAAA,CAAa,GAAA,CAAI,CAAC,MAAW,CAAA,KAAc,UAAA,CAAW,MAAM,CAAC,CAAC,GAExE,CAAA,EACJ;AAAA;AAAA;AAAA;AACJ;AAAA,GACJ;AAER;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../src/form/selects/ListBox/index.native.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useState } from \"react\";\nimport { ScrollView, Pressable, TextInput } from \"react-native\";\nimport { VStack, Box, Text } from '../../../_compat';\nimport type { IListBoxSelect } from \"@lmb-it/kitsconcerto-types\";\nimport { useSelectBase } from \"../hooks/useSelectBase\";\nimport KitsContainer from \"../../helpers/FormContainer\";\nimport { resolveThemeTokenForNative } from \"@lmb-it/kitsconcertomobile\";\nimport { useComponentDefaults, useLanguage, useResolvedStyle } from \"@lmb-it/kitsconcerto/hooks\";\n\nconst KitsListBox = (rawProps: IListBoxSelect) => {\n const { mergedProps: props, themeStyle, elementStyles } = useComponentDefaults('ListBox', rawProps, 'Select');\n const resolvedThemeStyle = useResolvedStyle(themeStyle);\n const resolvedRootStyle = useResolvedStyle(elementStyles?.root || {});\n const {\n id,\n label,\n disabled,\n invalid,\n errors,\n helperText,\n inputSize = \"md\",\n isMultiple,\n withFilter,\n filterBy,\n hideError,\n } = props;\n\n const { list, labelKey, valueKey, childrenKey, onChange, selectedValue } = useSelectBase();\n\n const [filterText, setFilterText] = useState(\"\");\n\n /* Same rule as the Dropdown's panel: the filter's copy and its edge come\n from the reader's language, not from the platform's layout direction. */\n const { t: translate, isRTL } = useLanguage();\n\n const t = resolveThemeTokenForNative;\n const primaryBg = t('highlight-bg') || t('primary.100') || '#E8EAF6';\n const primaryText = t('primary.700') || '#303F9F';\n const borderClr = invalid ? (t('danger') || '#EF4444') : (t('border') || '#D1D5DB');\n const textColor = t('text') || '#1F2937';\n const placeholderColor = t('text-secondary') || '#9CA3AF';\n const groupBg = t('surface-ground') || '#F9FAFB';\n\n const isSelected = useCallback((val: any) => {\n if (isMultiple && Array.isArray(selectedValue)) {\n return selectedValue.includes(val);\n }\n return selectedValue === val;\n }, [isMultiple, selectedValue]);\n\n const onSelect = useCallback((val: any, item: any) => {\n if (isMultiple && Array.isArray(selectedValue)) {\n const newVals = selectedValue.includes(val)\n ? selectedValue.filter((v: any) => v !== val)\n : [...selectedValue, val];\n onChange({ target: { value: newVals } }, newVals);\n } else {\n onChange({ target: { value: val } }, item);\n }\n }, [isMultiple, selectedValue, onChange]);\n\n const filteredList = useMemo(() => {\n if (!withFilter || !filterText.trim()) return list;\n const query = filterText.toLowerCase();\n const searchKey = filterBy || labelKey;\n\n if (childrenKey) {\n return list.reduce((acc: any[], group: any) => {\n const children = group[childrenKey];\n if (Array.isArray(children)) {\n const matched = children.filter((item: any) =>\n String(item[searchKey] ?? \"\").toLowerCase().includes(query)\n );\n if (matched.length > 0) {\n acc.push({ ...group, [childrenKey]: matched });\n }\n }\n return acc;\n }, []);\n }\n\n return list.filter((item: any) =>\n String(item[searchKey] ?? \"\").toLowerCase().includes(query)\n );\n }, [list, filterText, withFilter, filterBy, labelKey, childrenKey]);\n\n const renderItem = (item: any, index: number) => {\n const val = item[valueKey];\n const selected = isSelected(val);\n return (\n <Pressable\n key={`${val}-${index}`}\n style={{\n padding: 10,\n backgroundColor: selected ? primaryBg : 'transparent',\n }}\n onPress={() => !disabled && onSelect(val, item)}\n >\n <Text\n color={selected ? primaryText : textColor}\n fontWeight={selected ? \"bold\" : \"normal\"}\n size={inputSize}\n >\n {item[labelKey]}\n </Text>\n </Pressable>\n );\n };\n\n const renderGroupedItems = () => {\n return filteredList.map((group: any, gi: number) => {\n const children = group[childrenKey!];\n if (!Array.isArray(children)) {\n return renderItem(group, gi);\n }\n return (\n <Box key={`group-${gi}`}>\n <Box style={{ backgroundColor: groupBg, paddingHorizontal: 12, paddingVertical: 8 }}>\n <Text fontWeight=\"600\" color={textColor} size={inputSize}>\n {group[labelKey]}\n </Text>\n </Box>\n {children.map((item: any, ci: number) => renderItem(item, ci))}\n </Box>\n );\n });\n };\n\n return (\n <KitsContainer\n id={id}\n label={label}\n invalid={!!invalid}\n hideError={hideError}\n helperText={helperText}\n errors={errors}\n elementStyles={elementStyles}\n >\n <Box\n borderWidth={1}\n borderColor={borderClr}\n borderRadius=\"$sm\"\n height={250}\n opacity={disabled ? 0.5 : 1}\n style={resolvedRootStyle && Object.keys(resolvedRootStyle).length ? resolvedRootStyle : (Object.keys(resolvedThemeStyle).length ? resolvedThemeStyle : undefined)}\n >\n {withFilter && (\n <TextInput\n value={filterText}\n onChangeText={setFilterText}\n placeholder={translate('searchPlaceholder')}\n placeholderTextColor={placeholderColor}\n style={{\n borderBottomWidth: 1,\n borderBottomColor: borderClr,\n paddingHorizontal: 12,\n paddingVertical: 8,\n fontSize: 14,\n color: textColor,\n textAlign: isRTL ? 'right' : 'left',\n writingDirection: isRTL ? 'rtl' : 'ltr',\n }}\n />\n )}\n <ScrollView>\n <VStack>\n {childrenKey\n ? renderGroupedItems()\n : filteredList.map((item: any, i: number) => renderItem(item, i))\n }\n </VStack>\n </ScrollView>\n </Box>\n </KitsContainer>\n );\n};\n\nexport default KitsListBox;\n"],"names":["useComponentDefaults","useResolvedStyle","useSelectBase","useState","useLanguage","resolveThemeTokenForNative","useCallback","useMemo","jsx","Pressable","Text","Box","KitsContainer","jsxs","TextInput","ScrollView","VStack"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAM,WAAA,GAAc,CAAC,QAAA,KAA6B;AAC9C,EAAA,MAAM,EAAE,aAAa,KAAA,EAAO,UAAA,EAAY,eAAc,GAAIA,4BAAA,CAAqB,SAAA,EAAW,QAAA,EAAU,QAAQ,CAAA;AAC5G,EAAA,MAAM,kBAAA,GAAqBC,yBAAiB,UAAU,CAAA;AACtD,EAAA,MAAM,iBAAA,GAAoBA,wBAAA,CAAiB,aAAA,EAAe,IAAA,IAAQ,EAAE,CAAA;AACpE,EAAA,MAAM;AAAA,IACF,EAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,IACA,OAAA;AAAA,IACA,MAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA,GAAY,IAAA;AAAA,IACZ,UAAA;AAAA,IACA,UAAA;AAAA,IACA,QAAA;AAAA,IACA;AAAA,GACJ,GAAI,KAAA;AAEJ,EAAA,MAAM,EAAE,MAAM,QAAA,EAAU,QAAA,EAAU,aAAa,QAAA,EAAU,aAAA,KAAkBC,2BAAA,EAAc;AAEzF,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAIC,eAAS,EAAE,CAAA;AAI/C,EAAA,MAAM,EAAE,CAAA,EAAG,SAAA,EAAW,KAAA,KAAUC,kBAAA,EAAY;AAE5C,EAAA,MAAM,CAAA,GAAIC,gCAAA;AACV,EAAA,MAAM,YAAY,CAAA,CAAE,cAAc,CAAA,I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mB,EAAA;AAAA,kBACnB,eAAA,EAAiB,CAAA;AAAA,kBACjB,QAAA,EAAU,EAAA;AAAA,kBACV,KAAA,EAAO,SAAA;AAAA,kBACP,SAAA,EAAW,QAAQ,OAAA,GAAU,MAAA;AAAA,kBAC7B,gBAAA,EAAkB,QAAQ,KAAA,GAAQ;AAAA;AACtC;AAAA,aACJ;AAAA,2CAEHC,sBAAA,EAAA,EACG,QAAA,kBAAAP,cAAA,CAACQ,sBAAA,EAAA,EACI,QAAA,EAAA,WAAA,GACK,oBAAmB,GACnB,YAAA,CAAa,GAAA,CAAI,CAAC,MAAW,CAAA,KAAc,UAAA,CAAW,MAAM,CAAC,CAAC,GAExE,CAAA,EACJ;AAAA;AAAA;AAAA;AACJ;AAAA,GACJ;AAER;;;;"}
|
|
@@ -86,6 +86,7 @@ import '../../../apps/mobile/src/Core/Input/Slot.js';
|
|
|
86
86
|
import { useLanguage } from '../../../hooks/locale.js';
|
|
87
87
|
import '../../../contexts/DialogContext.js';
|
|
88
88
|
import '../../../contexts/PermissionsContext.js';
|
|
89
|
+
import '../../../contexts/BreadcrumbContext.js';
|
|
89
90
|
import useComponentDefaults from '../../../hooks/useComponentDefaults.js';
|
|
90
91
|
import useResolvedStyle from '../../../hooks/useResolvedStyle.js';
|
|
91
92
|
import Box from '../../../primitives/Box/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/form/selects/ListBox/index.native.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useState } from \"react\";\nimport { ScrollView, Pressable, TextInput } from \"react-native\";\nimport { VStack, Box, Text } from '../../../_compat';\nimport type { IListBoxSelect } from \"@lmb-it/kitsconcerto-types\";\nimport { useSelectBase } from \"../hooks/useSelectBase\";\nimport KitsContainer from \"../../helpers/FormContainer\";\nimport { resolveThemeTokenForNative } from \"@lmb-it/kitsconcertomobile\";\nimport { useComponentDefaults, useLanguage, useResolvedStyle } from \"@lmb-it/kitsconcerto/hooks\";\n\nconst KitsListBox = (rawProps: IListBoxSelect) => {\n const { mergedProps: props, themeStyle, elementStyles } = useComponentDefaults('ListBox', rawProps, 'Select');\n const resolvedThemeStyle = useResolvedStyle(themeStyle);\n const resolvedRootStyle = useResolvedStyle(elementStyles?.root || {});\n const {\n id,\n label,\n disabled,\n invalid,\n errors,\n helperText,\n inputSize = \"md\",\n isMultiple,\n withFilter,\n filterBy,\n hideError,\n } = props;\n\n const { list, labelKey, valueKey, childrenKey, onChange, selectedValue } = useSelectBase();\n\n const [filterText, setFilterText] = useState(\"\");\n\n /* Same rule as the Dropdown's panel: the filter's copy and its edge come\n from the reader's language, not from the platform's layout direction. */\n const { t: translate, isRTL } = useLanguage();\n\n const t = resolveThemeTokenForNative;\n const primaryBg = t('highlight-bg') || t('primary.100') || '#E8EAF6';\n const primaryText = t('primary.700') || '#303F9F';\n const borderClr = invalid ? (t('danger') || '#EF4444') : (t('border') || '#D1D5DB');\n const textColor = t('text') || '#1F2937';\n const placeholderColor = t('text-secondary') || '#9CA3AF';\n const groupBg = t('surface-ground') || '#F9FAFB';\n\n const isSelected = useCallback((val: any) => {\n if (isMultiple && Array.isArray(selectedValue)) {\n return selectedValue.includes(val);\n }\n return selectedValue === val;\n }, [isMultiple, selectedValue]);\n\n const onSelect = useCallback((val: any, item: any) => {\n if (isMultiple && Array.isArray(selectedValue)) {\n const newVals = selectedValue.includes(val)\n ? selectedValue.filter((v: any) => v !== val)\n : [...selectedValue, val];\n onChange({ target: { value: newVals } }, newVals);\n } else {\n onChange({ target: { value: val } }, item);\n }\n }, [isMultiple, selectedValue, onChange]);\n\n const filteredList = useMemo(() => {\n if (!withFilter || !filterText.trim()) return list;\n const query = filterText.toLowerCase();\n const searchKey = filterBy || labelKey;\n\n if (childrenKey) {\n return list.reduce((acc: any[], group: any) => {\n const children = group[childrenKey];\n if (Array.isArray(children)) {\n const matched = children.filter((item: any) =>\n String(item[searchKey] ?? \"\").toLowerCase().includes(query)\n );\n if (matched.length > 0) {\n acc.push({ ...group, [childrenKey]: matched });\n }\n }\n return acc;\n }, []);\n }\n\n return list.filter((item: any) =>\n String(item[searchKey] ?? \"\").toLowerCase().includes(query)\n );\n }, [list, filterText, withFilter, filterBy, labelKey, childrenKey]);\n\n const renderItem = (item: any, index: number) => {\n const val = item[valueKey];\n const selected = isSelected(val);\n return (\n <Pressable\n key={`${val}-${index}`}\n style={{\n padding: 10,\n backgroundColor: selected ? primaryBg : 'transparent',\n }}\n onPress={() => !disabled && onSelect(val, item)}\n >\n <Text\n color={selected ? primaryText : textColor}\n fontWeight={selected ? \"bold\" : \"normal\"}\n size={inputSize}\n >\n {item[labelKey]}\n </Text>\n </Pressable>\n );\n };\n\n const renderGroupedItems = () => {\n return filteredList.map((group: any, gi: number) => {\n const children = group[childrenKey!];\n if (!Array.isArray(children)) {\n return renderItem(group, gi);\n }\n return (\n <Box key={`group-${gi}`}>\n <Box style={{ backgroundColor: groupBg, paddingHorizontal: 12, paddingVertical: 8 }}>\n <Text fontWeight=\"600\" color={textColor} size={inputSize}>\n {group[labelKey]}\n </Text>\n </Box>\n {children.map((item: any, ci: number) => renderItem(item, ci))}\n </Box>\n );\n });\n };\n\n return (\n <KitsContainer\n id={id}\n label={label}\n invalid={!!invalid}\n hideError={hideError}\n helperText={helperText}\n errors={errors}\n elementStyles={elementStyles}\n >\n <Box\n borderWidth={1}\n borderColor={borderClr}\n borderRadius=\"$sm\"\n height={250}\n opacity={disabled ? 0.5 : 1}\n style={resolvedRootStyle && Object.keys(resolvedRootStyle).length ? resolvedRootStyle : (Object.keys(resolvedThemeStyle).length ? resolvedThemeStyle : undefined)}\n >\n {withFilter && (\n <TextInput\n value={filterText}\n onChangeText={setFilterText}\n placeholder={translate('searchPlaceholder')}\n placeholderTextColor={placeholderColor}\n style={{\n borderBottomWidth: 1,\n borderBottomColor: borderClr,\n paddingHorizontal: 12,\n paddingVertical: 8,\n fontSize: 14,\n color: textColor,\n textAlign: isRTL ? 'right' : 'left',\n writingDirection: isRTL ? 'rtl' : 'ltr',\n }}\n />\n )}\n <ScrollView>\n <VStack>\n {childrenKey\n ? renderGroupedItems()\n : filteredList.map((item: any, i: number) => renderItem(item, i))\n }\n </VStack>\n </ScrollView>\n </Box>\n </KitsContainer>\n );\n};\n\nexport default KitsListBox;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAM,WAAA,GAAc,CAAC,QAAA,KAA6B;AAC9C,EAAA,MAAM,EAAE,aAAa,KAAA,EAAO,UAAA,EAAY,eAAc,GAAI,oBAAA,CAAqB,SAAA,EAAW,QAAA,EAAU,QAAQ,CAAA;AAC5G,EAAA,MAAM,kBAAA,GAAqB,iBAAiB,UAAU,CAAA;AACtD,EAAA,MAAM,iBAAA,GAAoB,gBAAA,CAAiB,aAAA,EAAe,IAAA,IAAQ,EAAE,CAAA;AACpE,EAAA,MAAM;AAAA,IACF,EAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,IACA,OAAA;AAAA,IACA,MAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA,GAAY,IAAA;AAAA,IACZ,UAAA;AAAA,IACA,UAAA;AAAA,IACA,QAAA;AAAA,IACA;AAAA,GACJ,GAAI,KAAA;AAEJ,EAAA,MAAM,EAAE,MAAM,QAAA,EAAU,QAAA,EAAU,aAAa,QAAA,EAAU,aAAA,KAAkB,aAAA,EAAc;AAEzF,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAI,SAAS,EAAE,CAAA;AAI/C,EAAA,MAAM,EAAE,CAAA,EAAG,SAAA,EAAW,KAAA,KAAU,WAAA,EAAY;AAE5C,EAAA,MAAM,CAAA,GAAI,0BAAA;AACV,EAAA,MAAM,YAAY,CAAA,CAAE,cAAc,CAAA,IAAK,CAAA,CAAE,aAAa,CAAA,IAAK,SAAA;AAC3D,EAAA,MAAM,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BACV,KAAA,EAAO,SAAA;AAAA,kBACP,SAAA,EAAW,QAAQ,OAAA,GAAU,MAAA;AAAA,kBAC7B,gBAAA,EAAkB,QAAQ,KAAA,GAAQ;AAAA;AACtC;AAAA,aACJ;AAAA,gCAEH,UAAA,EAAA,EACG,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EACI,QAAA,EAAA,WAAA,GACK,oBAAmB,GACnB,YAAA,CAAa,GAAA,CAAI,CAAC,MAAW,CAAA,KAAc,UAAA,CAAW,MAAM,CAAC,CAAC,GAExE,CAAA,EACJ;AAAA;AAAA;AAAA;AACJ;AAAA,GACJ;AAER;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/form/selects/ListBox/index.native.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useState } from \"react\";\nimport { ScrollView, Pressable, TextInput } from \"react-native\";\nimport { VStack, Box, Text } from '../../../_compat';\nimport type { IListBoxSelect } from \"@lmb-it/kitsconcerto-types\";\nimport { useSelectBase } from \"../hooks/useSelectBase\";\nimport KitsContainer from \"../../helpers/FormContainer\";\nimport { resolveThemeTokenForNative } from \"@lmb-it/kitsconcertomobile\";\nimport { useComponentDefaults, useLanguage, useResolvedStyle } from \"@lmb-it/kitsconcerto/hooks\";\n\nconst KitsListBox = (rawProps: IListBoxSelect) => {\n const { mergedProps: props, themeStyle, elementStyles } = useComponentDefaults('ListBox', rawProps, 'Select');\n const resolvedThemeStyle = useResolvedStyle(themeStyle);\n const resolvedRootStyle = useResolvedStyle(elementStyles?.root || {});\n const {\n id,\n label,\n disabled,\n invalid,\n errors,\n helperText,\n inputSize = \"md\",\n isMultiple,\n withFilter,\n filterBy,\n hideError,\n } = props;\n\n const { list, labelKey, valueKey, childrenKey, onChange, selectedValue } = useSelectBase();\n\n const [filterText, setFilterText] = useState(\"\");\n\n /* Same rule as the Dropdown's panel: the filter's copy and its edge come\n from the reader's language, not from the platform's layout direction. */\n const { t: translate, isRTL } = useLanguage();\n\n const t = resolveThemeTokenForNative;\n const primaryBg = t('highlight-bg') || t('primary.100') || '#E8EAF6';\n const primaryText = t('primary.700') || '#303F9F';\n const borderClr = invalid ? (t('danger') || '#EF4444') : (t('border') || '#D1D5DB');\n const textColor = t('text') || '#1F2937';\n const placeholderColor = t('text-secondary') || '#9CA3AF';\n const groupBg = t('surface-ground') || '#F9FAFB';\n\n const isSelected = useCallback((val: any) => {\n if (isMultiple && Array.isArray(selectedValue)) {\n return selectedValue.includes(val);\n }\n return selectedValue === val;\n }, [isMultiple, selectedValue]);\n\n const onSelect = useCallback((val: any, item: any) => {\n if (isMultiple && Array.isArray(selectedValue)) {\n const newVals = selectedValue.includes(val)\n ? selectedValue.filter((v: any) => v !== val)\n : [...selectedValue, val];\n onChange({ target: { value: newVals } }, newVals);\n } else {\n onChange({ target: { value: val } }, item);\n }\n }, [isMultiple, selectedValue, onChange]);\n\n const filteredList = useMemo(() => {\n if (!withFilter || !filterText.trim()) return list;\n const query = filterText.toLowerCase();\n const searchKey = filterBy || labelKey;\n\n if (childrenKey) {\n return list.reduce((acc: any[], group: any) => {\n const children = group[childrenKey];\n if (Array.isArray(children)) {\n const matched = children.filter((item: any) =>\n String(item[searchKey] ?? \"\").toLowerCase().includes(query)\n );\n if (matched.length > 0) {\n acc.push({ ...group, [childrenKey]: matched });\n }\n }\n return acc;\n }, []);\n }\n\n return list.filter((item: any) =>\n String(item[searchKey] ?? \"\").toLowerCase().includes(query)\n );\n }, [list, filterText, withFilter, filterBy, labelKey, childrenKey]);\n\n const renderItem = (item: any, index: number) => {\n const val = item[valueKey];\n const selected = isSelected(val);\n return (\n <Pressable\n key={`${val}-${index}`}\n style={{\n padding: 10,\n backgroundColor: selected ? primaryBg : 'transparent',\n }}\n onPress={() => !disabled && onSelect(val, item)}\n >\n <Text\n color={selected ? primaryText : textColor}\n fontWeight={selected ? \"bold\" : \"normal\"}\n size={inputSize}\n >\n {item[labelKey]}\n </Text>\n </Pressable>\n );\n };\n\n const renderGroupedItems = () => {\n return filteredList.map((group: any, gi: number) => {\n const children = group[childrenKey!];\n if (!Array.isArray(children)) {\n return renderItem(group, gi);\n }\n return (\n <Box key={`group-${gi}`}>\n <Box style={{ backgroundColor: groupBg, paddingHorizontal: 12, paddingVertical: 8 }}>\n <Text fontWeight=\"600\" color={textColor} size={inputSize}>\n {group[labelKey]}\n </Text>\n </Box>\n {children.map((item: any, ci: number) => renderItem(item, ci))}\n </Box>\n );\n });\n };\n\n return (\n <KitsContainer\n id={id}\n label={label}\n invalid={!!invalid}\n hideError={hideError}\n helperText={helperText}\n errors={errors}\n elementStyles={elementStyles}\n >\n <Box\n borderWidth={1}\n borderColor={borderClr}\n borderRadius=\"$sm\"\n height={250}\n opacity={disabled ? 0.5 : 1}\n style={resolvedRootStyle && Object.keys(resolvedRootStyle).length ? resolvedRootStyle : (Object.keys(resolvedThemeStyle).length ? resolvedThemeStyle : undefined)}\n >\n {withFilter && (\n <TextInput\n value={filterText}\n onChangeText={setFilterText}\n placeholder={translate('searchPlaceholder')}\n placeholderTextColor={placeholderColor}\n style={{\n borderBottomWidth: 1,\n borderBottomColor: borderClr,\n paddingHorizontal: 12,\n paddingVertical: 8,\n fontSize: 14,\n color: textColor,\n textAlign: isRTL ? 'right' : 'left',\n writingDirection: isRTL ? 'rtl' : 'ltr',\n }}\n />\n )}\n <ScrollView>\n <VStack>\n {childrenKey\n ? renderGroupedItems()\n : filteredList.map((item: any, i: number) => renderItem(item, i))\n }\n </VStack>\n </ScrollView>\n </Box>\n </KitsContainer>\n );\n};\n\nexport default KitsListBox;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAM,WAAA,GAAc,CAAC,QAAA,KAA6B;AAC9C,EAAA,MAAM,EAAE,aAAa,KAAA,EAAO,UAAA,EAAY,eAAc,GAAI,oBAAA,CAAqB,SAAA,EAAW,QAAA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Base.cjs');
|
|
|
91
91
|
var locale = require('../../../hooks/locale.cjs');
|
|
92
92
|
require('../../../contexts/DialogContext.cjs');
|
|
93
93
|
require('../../../contexts/PermissionsContext.cjs');
|
|
94
|
+
require('../../../contexts/BreadcrumbContext.cjs');
|
|
94
95
|
var useComponentDefaults = require('../../../hooks/useComponentDefaults.cjs');
|
|
95
96
|
var useResolvedStyle = require('../../../hooks/useResolvedStyle.cjs');
|
|
96
97
|
var useThemedFont = require('../../../hooks/useThemedFont.cjs');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../src/form/selects/MultiSelect/index.native.tsx"],"sourcesContent":["import React, {useCallback, useEffect} from \"react\";\nimport {MultiSelect} from \"@lmb-it/kitsconcertomobile\";\nimport KitsContainer from \"../../helpers/FormContainer\";\nimport type {IMultiSelect} from \"@lmb-it/kitsconcerto-types\";\nimport {ClHelper} from \"../../helpers/Functions\";\nimport {checkKeys} from \"../helper\";\nimport {useSelectBase} from \"../hooks/useSelectBase\";\nimport {useComponentDefaults, useLanguage, useResolvedStyle} from \"@lmb-it/kitsconcerto/hooks\";\nimport SelectPopupOverlay from \"../helpers/SelectPopupOverlay\";\nimport useThemedFont from \"@lmb-it/kitsconcerto/hooks/useThemedFont\";\n\nconst KitsMultiSelect = ({ className, ref, ...rawProps }: IMultiSelect) => {\n const {mergedProps: props, themeStyle, elementStyles} = useComponentDefaults('MultiSelect', rawProps, 'Select');\n const resolvedThemeStyle = useResolvedStyle(themeStyle);\n const resolvedRootStyle = useResolvedStyle(elementStyles?.root || {});\n const {\n id,\n disabled,\n isFloatedLabel,\n rightAddon,\n leftAddon,\n required,\n errors,\n invalid,\n placeholder,\n virtualScroll,\n label,\n inputSize,\n helperText,\n emptyFilterMessage,\n selectionLimit,\n localProps,\n hideError,\n withFilter,\n loading,\n showClear,\n valueMode,\n popup,\n } = props;\n\n const { list, keys, onChange, selectedValue, childrenKey, labelKey, valueKey } = useSelectBase();\n\n /* Same rule as the Dropdown's panel — see that file. The sentence and the\n edge are resolved here, where LocaleContext is, and passed down. */\n const { t, isRTL } = useLanguage();\n const bodyFont = useThemedFont('body');\n\n useEffect(() => {\n checkKeys(list, labelKey, !childrenKey ? valueKey : undefined);\n }, [list]);\n\n const ClState = ClHelper({\n inputSize: inputSize ?? \"\",\n isChecked: false,\n isInvalid: !!invalid,\n isDisabled: !!disabled,\n });\n\n const handleChange = useCallback((e: any, items: any) => {\n if (selectionLimit && Array.isArray(e?.target?.value) && e.target.value.length > selectionLimit) {\n return;\n }\n onChange && onChange(e, items);\n }, [selectionLimit, onChange]);\n\n const Element = <MultiSelect\n emptyFilterMessage={emptyFilterMessage ?? t('emptyFilterMessage')}\n filterPlaceholder={t('searchPlaceholder')}\n isRTL={isRTL}\n fontFamily={bodyFont}\n popup={popup}\n popupTitle={label ?? placeholder}\n renderPopup={({visible, onClose, title, children}: {\n visible: boolean;\n onClose: () => void;\n title?: React.ReactNode;\n children: React.ReactNode;\n }) => (\n <SelectPopupOverlay visible={visible} onClose={onClose} title={title}>\n {children}\n </SelectPopupOverlay>\n )}\n value={selectedValue}\n onChange={handleChange}\n disabled={disabled}\n loading={loading}\n showClear={showClear}\n options={typeof list !== \"function\" ? list : []}\n placeholder={placeholder}\n {...keys}\n filter={withFilter !== false}\n selectionLimit={selectionLimit}\n display={valueMode === \"comma\" ? \"comma\" : (localProps?.maxSelectedLabels ? undefined : \"chip\")}\n maxSelectedLabels={selectionLimit ?? localProps?.maxSelectedLabels ?? 10}\n className={`w-full ${ClState}`}\n style={{ borderRadius: 0, ...(resolvedRootStyle && Object.keys(resolvedRootStyle).length > 0 ? resolvedRootStyle : resolvedThemeStyle) }}\n {...(localProps ? localProps : {})}\n />\n\n return (\n <KitsContainer\n id={id}\n inputSize={inputSize}\n isFloatedLabel={isFloatedLabel}\n rightAddon={rightAddon}\n leftAddon={leftAddon}\n required={required}\n hideError={hideError}\n errors={errors}\n helperText={helperText}\n invalid={invalid}\n label={label}\n elementStyles={elementStyles}\n >\n {Element}\n </KitsContainer>\n );\n}\n\nKitsMultiSelect.displayName = \"MultiSelect\";\nexport default KitsMultiSelect;\n"],"names":["useComponentDefaults","useResolvedStyle","useSelectBase","useLanguage","useThemedFont","useEffect","checkKeys","ClHelper","useCallback","jsx","MultiSelect","SelectPopupOverlay","KitsContainer"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../src/form/selects/MultiSelect/index.native.tsx"],"sourcesContent":["import React, {useCallback, useEffect} from \"react\";\nimport {MultiSelect} from \"@lmb-it/kitsconcertomobile\";\nimport KitsContainer from \"../../helpers/FormContainer\";\nimport type {IMultiSelect} from \"@lmb-it/kitsconcerto-types\";\nimport {ClHelper} from \"../../helpers/Functions\";\nimport {checkKeys} from \"../helper\";\nimport {useSelectBase} from \"../hooks/useSelectBase\";\nimport {useComponentDefaults, useLanguage, useResolvedStyle} from \"@lmb-it/kitsconcerto/hooks\";\nimport SelectPopupOverlay from \"../helpers/SelectPopupOverlay\";\nimport useThemedFont from \"@lmb-it/kitsconcerto/hooks/useThemedFont\";\n\nconst KitsMultiSelect = ({ className, ref, ...rawProps }: IMultiSelect) => {\n const {mergedProps: props, themeStyle, elementStyles} = useComponentDefaults('MultiSelect', rawProps, 'Select');\n const resolvedThemeStyle = useResolvedStyle(themeStyle);\n const resolvedRootStyle = useResolvedStyle(elementStyles?.root || {});\n const {\n id,\n disabled,\n isFloatedLabel,\n rightAddon,\n leftAddon,\n required,\n errors,\n invalid,\n placeholder,\n virtualScroll,\n label,\n inputSize,\n helperText,\n emptyFilterMessage,\n selectionLimit,\n localProps,\n hideError,\n withFilter,\n loading,\n showClear,\n valueMode,\n popup,\n } = props;\n\n const { list, keys, onChange, selectedValue, childrenKey, labelKey, valueKey } = useSelectBase();\n\n /* Same rule as the Dropdown's panel — see that file. The sentence and the\n edge are resolved here, where LocaleContext is, and passed down. */\n const { t, isRTL } = useLanguage();\n const bodyFont = useThemedFont('body');\n\n useEffect(() => {\n checkKeys(list, labelKey, !childrenKey ? valueKey : undefined);\n }, [list]);\n\n const ClState = ClHelper({\n inputSize: inputSize ?? \"\",\n isChecked: false,\n isInvalid: !!invalid,\n isDisabled: !!disabled,\n });\n\n const handleChange = useCallback((e: any, items: any) => {\n if (selectionLimit && Array.isArray(e?.target?.value) && e.target.value.length > selectionLimit) {\n return;\n }\n onChange && onChange(e, items);\n }, [selectionLimit, onChange]);\n\n const Element = <MultiSelect\n emptyFilterMessage={emptyFilterMessage ?? t('emptyFilterMessage')}\n filterPlaceholder={t('searchPlaceholder')}\n isRTL={isRTL}\n fontFamily={bodyFont}\n popup={popup}\n popupTitle={label ?? placeholder}\n renderPopup={({visible, onClose, title, children}: {\n visible: boolean;\n onClose: () => void;\n title?: React.ReactNode;\n children: React.ReactNode;\n }) => (\n <SelectPopupOverlay visible={visible} onClose={onClose} title={title}>\n {children}\n </SelectPopupOverlay>\n )}\n value={selectedValue}\n onChange={handleChange}\n disabled={disabled}\n loading={loading}\n showClear={showClear}\n options={typeof list !== \"function\" ? list : []}\n placeholder={placeholder}\n {...keys}\n filter={withFilter !== false}\n selectionLimit={selectionLimit}\n display={valueMode === \"comma\" ? \"comma\" : (localProps?.maxSelectedLabels ? undefined : \"chip\")}\n maxSelectedLabels={selectionLimit ?? localProps?.maxSelectedLabels ?? 10}\n className={`w-full ${ClState}`}\n style={{ borderRadius: 0, ...(resolvedRootStyle && Object.keys(resolvedRootStyle).length > 0 ? resolvedRootStyle : resolvedThemeStyle) }}\n {...(localProps ? localProps : {})}\n />\n\n return (\n <KitsContainer\n id={id}\n inputSize={inputSize}\n isFloatedLabel={isFloatedLabel}\n rightAddon={rightAddon}\n leftAddon={leftAddon}\n required={required}\n hideError={hideError}\n errors={errors}\n helperText={helperText}\n invalid={invalid}\n label={label}\n elementStyles={elementStyles}\n >\n {Element}\n </KitsContainer>\n );\n}\n\nKitsMultiSelect.displayName = \"MultiSelect\";\nexport default KitsMultiSelect;\n"],"names":["useComponentDefaults","useResolvedStyle","useSelectBase","useLanguage","useThemedFont","useEffect","checkKeys","ClHelper","useCallback","jsx","MultiSelect","SelectPopupOverlay","KitsContainer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,MAAM,kBAAkB,CAAC,EAAE,WAAW,GAAA,EAAK,GAAG,UAAS,KAAoB;AACvE,EAAA,MAAM,EAAC,aAAa,KAAA,EAAO,UAAA,EAAY,eAAa,GAAIA,4BAAA,CAAqB,aAAA,EAAe,QAAA,EAAU,QAAQ,CAAA;AAC9G,EAAA,MAAM,kBAAA,GAAqBC,yBAAiB,UAAU,CAAA;AACtD,EAAA,MAAM,iBAAA,GAAoBA,wBAAA,CAAiB,aAAA,EAAe,IAAA,IAAQ,EAAE,CAAA;AACpE,EAAA,MAAM;AAAA,IACF,EAAA;AAAA,IACA,QAAA;AAAA,IACA,cAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;AAAA,IACA,WAAA;AAAA,IACA,aAAA;AAAA,IACA,KAAA;AAAA,IACA,SAAA;AAAA,IACA,UAAA;AAAA,IACA,kBAAA;AAAA,IACA,cAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA;AAAA,IACA,UAAA;AAAA,IACA,OAAA;AAAA,IACA,SAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,GACJ,GAAI,KAAA;AAEJ,EAAA,MAAM,EAAE,MAAM,IAAA,EAAM,QAAA,EAAU,eAAe,WAAA,EAAa,QAAA,EAAU,QAAA,EAAS,GAAIC,2BAAA,EAAc;AAI/F,EAAA,MAAM,EAAE,CAAA,EAAG,KAAA,EAAM,GAAIC,kBAAA,EAAY;AACjC,EAAA,MAAM,QAAA,GAAWC,sBAAc,MAAM,CAAA;AAErC,EAAAC,eAAA,CAAU,MAAM;AAC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MACV,QAAA;AAAA,MACA,OAAA;AAAA,MACA,SAAA;AAAA,MACA,OAAA,EAAS,OAAO,IAAA,KAAS,UAAA,GAAa,OAAO,EAAC;AAAA,MAC9C,WAAA;AAAA,MACC,GAAG,IAAA;AAAA,MACJ,QAAQ,UAAA,KAAe,KAAA;AAAA,MACvB,cAAA;AAAA,MACA,SAAS,SAAA,KAAc,OAAA,GAAU,OAAA,GAAW,UAAA,EAAY,oBAAoB,MAAA,GAAY,MAAA;AAAA,MACxF,iBAAA,EAAmB,cAAA,IAAkB,UAAA,EAAY,iBAAA,IAAqB,EAAA;AAAA,MACtE,SAAA,EAAW,UAAU,OAAO,CAAA,CAAA;AAAA,MAC5B,KAAA,EAAO,EAAE,YAAA,EAAc,CAAA,EAAG,GAAI,iBAAA,IAAqB,MAAA,CAAO,IAAA,CAAK,iBAAiB,CAAA,CAAE,MAAA,GAAS,CAAA,GAAI,oBAAoB,kBAAA,EAAoB;AAAA,MACtI,GAAI,UAAA,GAAa,UAAA,GAAa;AAAC;AAAA,GACpC;AAEA,EAAA,uBACIF,cAAA;AAAA,IAACG,oBAAA;AAAA,IAAA;AAAA,MACG,EAAA;AAAA,MACA,SAAA;AAAA,MACA,cAAA;AAAA,MACA,UAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA;AAAA,MACA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,MACA,OAAA;AAAA,MACA,KAAA;AAAA,MACA,aAAA;AAAA,MAEC,QAAA,EAAA;AAAA;AAAA,GACL;AAER;AAEA,eAAA,CAAgB,WAAA,GAAc,aAAA;;;;"}
|
|
@@ -87,6 +87,7 @@ import { useSelectBase } from '../hooks/useSelectBase.js';
|
|
|
87
87
|
import { useLanguage } from '../../../hooks/locale.js';
|
|
88
88
|
import '../../../contexts/DialogContext.js';
|
|
89
89
|
import '../../../contexts/PermissionsContext.js';
|
|
90
|
+
import '../../../contexts/BreadcrumbContext.js';
|
|
90
91
|
import useComponentDefaults from '../../../hooks/useComponentDefaults.js';
|
|
91
92
|
import useResolvedStyle from '../../../hooks/useResolvedStyle.js';
|
|
92
93
|
import useThemedFont from '../../../hooks/useThemedFont.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/form/selects/MultiSelect/index.native.tsx"],"sourcesContent":["import React, {useCallback, useEffect} from \"react\";\nimport {MultiSelect} from \"@lmb-it/kitsconcertomobile\";\nimport KitsContainer from \"../../helpers/FormContainer\";\nimport type {IMultiSelect} from \"@lmb-it/kitsconcerto-types\";\nimport {ClHelper} from \"../../helpers/Functions\";\nimport {checkKeys} from \"../helper\";\nimport {useSelectBase} from \"../hooks/useSelectBase\";\nimport {useComponentDefaults, useLanguage, useResolvedStyle} from \"@lmb-it/kitsconcerto/hooks\";\nimport SelectPopupOverlay from \"../helpers/SelectPopupOverlay\";\nimport useThemedFont from \"@lmb-it/kitsconcerto/hooks/useThemedFont\";\n\nconst KitsMultiSelect = ({ className, ref, ...rawProps }: IMultiSelect) => {\n const {mergedProps: props, themeStyle, elementStyles} = useComponentDefaults('MultiSelect', rawProps, 'Select');\n const resolvedThemeStyle = useResolvedStyle(themeStyle);\n const resolvedRootStyle = useResolvedStyle(elementStyles?.root || {});\n const {\n id,\n disabled,\n isFloatedLabel,\n rightAddon,\n leftAddon,\n required,\n errors,\n invalid,\n placeholder,\n virtualScroll,\n label,\n inputSize,\n helperText,\n emptyFilterMessage,\n selectionLimit,\n localProps,\n hideError,\n withFilter,\n loading,\n showClear,\n valueMode,\n popup,\n } = props;\n\n const { list, keys, onChange, selectedValue, childrenKey, labelKey, valueKey } = useSelectBase();\n\n /* Same rule as the Dropdown's panel — see that file. The sentence and the\n edge are resolved here, where LocaleContext is, and passed down. */\n const { t, isRTL } = useLanguage();\n const bodyFont = useThemedFont('body');\n\n useEffect(() => {\n checkKeys(list, labelKey, !childrenKey ? valueKey : undefined);\n }, [list]);\n\n const ClState = ClHelper({\n inputSize: inputSize ?? \"\",\n isChecked: false,\n isInvalid: !!invalid,\n isDisabled: !!disabled,\n });\n\n const handleChange = useCallback((e: any, items: any) => {\n if (selectionLimit && Array.isArray(e?.target?.value) && e.target.value.length > selectionLimit) {\n return;\n }\n onChange && onChange(e, items);\n }, [selectionLimit, onChange]);\n\n const Element = <MultiSelect\n emptyFilterMessage={emptyFilterMessage ?? t('emptyFilterMessage')}\n filterPlaceholder={t('searchPlaceholder')}\n isRTL={isRTL}\n fontFamily={bodyFont}\n popup={popup}\n popupTitle={label ?? placeholder}\n renderPopup={({visible, onClose, title, children}: {\n visible: boolean;\n onClose: () => void;\n title?: React.ReactNode;\n children: React.ReactNode;\n }) => (\n <SelectPopupOverlay visible={visible} onClose={onClose} title={title}>\n {children}\n </SelectPopupOverlay>\n )}\n value={selectedValue}\n onChange={handleChange}\n disabled={disabled}\n loading={loading}\n showClear={showClear}\n options={typeof list !== \"function\" ? list : []}\n placeholder={placeholder}\n {...keys}\n filter={withFilter !== false}\n selectionLimit={selectionLimit}\n display={valueMode === \"comma\" ? \"comma\" : (localProps?.maxSelectedLabels ? undefined : \"chip\")}\n maxSelectedLabels={selectionLimit ?? localProps?.maxSelectedLabels ?? 10}\n className={`w-full ${ClState}`}\n style={{ borderRadius: 0, ...(resolvedRootStyle && Object.keys(resolvedRootStyle).length > 0 ? resolvedRootStyle : resolvedThemeStyle) }}\n {...(localProps ? localProps : {})}\n />\n\n return (\n <KitsContainer\n id={id}\n inputSize={inputSize}\n isFloatedLabel={isFloatedLabel}\n rightAddon={rightAddon}\n leftAddon={leftAddon}\n required={required}\n hideError={hideError}\n errors={errors}\n helperText={helperText}\n invalid={invalid}\n label={label}\n elementStyles={elementStyles}\n >\n {Element}\n </KitsContainer>\n );\n}\n\nKitsMultiSelect.displayName = \"MultiSelect\";\nexport default KitsMultiSelect;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/form/selects/MultiSelect/index.native.tsx"],"sourcesContent":["import React, {useCallback, useEffect} from \"react\";\nimport {MultiSelect} from \"@lmb-it/kitsconcertomobile\";\nimport KitsContainer from \"../../helpers/FormContainer\";\nimport type {IMultiSelect} from \"@lmb-it/kitsconcerto-types\";\nimport {ClHelper} from \"../../helpers/Functions\";\nimport {checkKeys} from \"../helper\";\nimport {useSelectBase} from \"../hooks/useSelectBase\";\nimport {useComponentDefaults, useLanguage, useResolvedStyle} from \"@lmb-it/kitsconcerto/hooks\";\nimport SelectPopupOverlay from \"../helpers/SelectPopupOverlay\";\nimport useThemedFont from \"@lmb-it/kitsconcerto/hooks/useThemedFont\";\n\nconst KitsMultiSelect = ({ className, ref, ...rawProps }: IMultiSelect) => {\n const {mergedProps: props, themeStyle, elementStyles} = useComponentDefaults('MultiSelect', rawProps, 'Select');\n const resolvedThemeStyle = useResolvedStyle(themeStyle);\n const resolvedRootStyle = useResolvedStyle(elementStyles?.root || {});\n const {\n id,\n disabled,\n isFloatedLabel,\n rightAddon,\n leftAddon,\n required,\n errors,\n invalid,\n placeholder,\n virtualScroll,\n label,\n inputSize,\n helperText,\n emptyFilterMessage,\n selectionLimit,\n localProps,\n hideError,\n withFilter,\n loading,\n showClear,\n valueMode,\n popup,\n } = props;\n\n const { list, keys, onChange, selectedValue, childrenKey, labelKey, valueKey } = useSelectBase();\n\n /* Same rule as the Dropdown's panel — see that file. The sentence and the\n edge are resolved here, where LocaleContext is, and passed down. */\n const { t, isRTL } = useLanguage();\n const bodyFont = useThemedFont('body');\n\n useEffect(() => {\n checkKeys(list, labelKey, !childrenKey ? valueKey : undefined);\n }, [list]);\n\n const ClState = ClHelper({\n inputSize: inputSize ?? \"\",\n isChecked: false,\n isInvalid: !!invalid,\n isDisabled: !!disabled,\n });\n\n const handleChange = useCallback((e: any, items: any) => {\n if (selectionLimit && Array.isArray(e?.target?.value) && e.target.value.length > selectionLimit) {\n return;\n }\n onChange && onChange(e, items);\n }, [selectionLimit, onChange]);\n\n const Element = <MultiSelect\n emptyFilterMessage={emptyFilterMessage ?? t('emptyFilterMessage')}\n filterPlaceholder={t('searchPlaceholder')}\n isRTL={isRTL}\n fontFamily={bodyFont}\n popup={popup}\n popupTitle={label ?? placeholder}\n renderPopup={({visible, onClose, title, children}: {\n visible: boolean;\n onClose: () => void;\n title?: React.ReactNode;\n children: React.ReactNode;\n }) => (\n <SelectPopupOverlay visible={visible} onClose={onClose} title={title}>\n {children}\n </SelectPopupOverlay>\n )}\n value={selectedValue}\n onChange={handleChange}\n disabled={disabled}\n loading={loading}\n showClear={showClear}\n options={typeof list !== \"function\" ? list : []}\n placeholder={placeholder}\n {...keys}\n filter={withFilter !== false}\n selectionLimit={selectionLimit}\n display={valueMode === \"comma\" ? \"comma\" : (localProps?.maxSelectedLabels ? undefined : \"chip\")}\n maxSelectedLabels={selectionLimit ?? localProps?.maxSelectedLabels ?? 10}\n className={`w-full ${ClState}`}\n style={{ borderRadius: 0, ...(resolvedRootStyle && Object.keys(resolvedRootStyle).length > 0 ? resolvedRootStyle : resolvedThemeStyle) }}\n {...(localProps ? localProps : {})}\n />\n\n return (\n <KitsContainer\n id={id}\n inputSize={inputSize}\n isFloatedLabel={isFloatedLabel}\n rightAddon={rightAddon}\n leftAddon={leftAddon}\n required={required}\n hideError={hideError}\n errors={errors}\n helperText={helperText}\n invalid={invalid}\n label={label}\n elementStyles={elementStyles}\n >\n {Element}\n </KitsContainer>\n );\n}\n\nKitsMultiSelect.displayName = \"MultiSelect\";\nexport default KitsMultiSelect;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,MAAM,kBAAkB,CAAC,EAAE,WAAW,GAAA,EAAK,GAAG,UAAS,KAAoB;AACvE,EAAA,MAAM,EAAC,aAAa,KAAA,EAAO,UAAA,EAAY,eAAa,GAAI,oBAAA,CAAqB,aAAA,EAAe,QAAA,EAAU,QAAQ,CAAA;AAC9G,EAAA,MAAM,k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AA,EAAc,CAAA,EAAG,GAAI,iBAAA,IAAqB,MAAA,CAAO,IAAA,CAAK,iBAAiB,CAAA,CAAE,MAAA,GAAS,CAAA,GAAI,oBAAoB,kBAAA,EAAoB;AAAA,MACtI,GAAI,UAAA,GAAa,UAAA,GAAa;AAAC;AAAA,GACpC;AAEA,EAAA,uBACI,GAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACG,EAAA;AAAA,MACA,SAAA;AAAA,MACA,cAAA;AAAA,MACA,UAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA;AAAA,MACA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,MACA,OAAA;AAAA,MACA,KAAA;AAAA,MACA,aAAA;AAAA,MAEC,QAAA,EAAA;AAAA;AAAA,GACL;AAER;AAEA,eAAA,CAAgB,WAAA,GAAc,aAAA;;;;"}
|
|
@@ -88,6 +88,7 @@ require('../../../apps/mobile/src/Core/Input/Slot.cjs');
|
|
|
88
88
|
var useTreeBuild = require('../hooks/useTreeBuild.cjs');
|
|
89
89
|
require('../../../contexts/DialogContext.cjs');
|
|
90
90
|
require('../../../contexts/PermissionsContext.cjs');
|
|
91
|
+
require('../../../contexts/BreadcrumbContext.cjs');
|
|
91
92
|
var useComponentDefaults = require('../../../hooks/useComponentDefaults.cjs');
|
|
92
93
|
var useResolvedStyle = require('../../../hooks/useResolvedStyle.cjs');
|
|
93
94
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../src/form/selects/TreeSelect/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport KitsContainer from \"../../helpers/FormContainer\";\nimport type { ITreeSelect } from \"@lmb-it/kitsconcerto-types\";\nimport { TreeSelect } from \"@lmb-it/kitsconcertomobile\";\nimport { ClHelper } from \"../../helpers/Functions\";\nimport { useTreeBuild } from \"../hooks/useTreeBuild\";\nimport { useComponentDefaults, useResolvedStyle } from \"@lmb-it/kitsconcerto/hooks\";\n\nconst KitsTreeSelect = <T = any,>({ ref, ...rawProps }: ITreeSelect) => {\n const { mergedProps: props, themeStyle, elementStyles } = useComponentDefaults('TreeSelect', rawProps, 'Select');\n const resolvedThemeStyle = useResolvedStyle(themeStyle);\n const resolvedRootStyle = useResolvedStyle(elementStyles?.root || {});\n const {\n rightAddon,\n leftAddon,\n errors,\n invalid,\n label,\n id,\n placeholder,\n required,\n disabled,\n helperText,\n attached,\n isFloatedLabel,\n inputSize,\n valueMode,\n isMultiple,\n localProps,\n withFilter,\n filterBy,\n hideError,\n onlyParentsWithChildren,\n resetFilterOnHide,\n scrollHeight,\n emptyMessage,\n showClear,\n containerStyle,\n } = props;\n\n const { nodes, value, handleChange } = useTreeBuild<T>({\n isStructured: props.isStructured,\n ref,\n });\n\n\n\n const Element = (\n <TreeSelect\n value={value}\n filter={withFilter}\n filterBy={filterBy}\n options={nodes}\n display={isMultiple ? valueMode : \"comma\"}\n onChange={handleChange}\n selectionMode={isMultiple ? 'checkbox' : 'single'}\n placeholder={placeholder}\n disabled={disabled}\n invalid={invalid}\n showClear={showClear ?? !required}\n isModal={false}\n onlyParentsWithChildren={onlyParentsWithChildren}\n resetFilterOnHide={resetFilterOnHide}\n scrollHeight={scrollHeight}\n emptyMessage={emptyMessage}\n style={resolvedRootStyle && Object.keys(resolvedRootStyle).length ? resolvedRootStyle : (Object.keys(resolvedThemeStyle).length ? resolvedThemeStyle : undefined)}\n {...localProps}\n />\n );\n\n if (attached) {\n return Element;\n }\n\n return (\n <KitsContainer\n id={id}\n inputSize={inputSize}\n isFloatedLabel={isFloatedLabel}\n rightAddon={rightAddon}\n leftAddon={leftAddon}\n required={required}\n hideError={hideError}\n errors={errors}\n helperText={helperText}\n invalid={invalid}\n label={label}\n containerStyle={containerStyle}\n elementStyles={elementStyles}\n >\n {Element}\n </KitsContainer>\n );\n}\nexport default KitsTreeSelect;\n"],"names":["useComponentDefaults","useResolvedStyle","useTreeBuild","jsx","TreeSelect","KitsContainer"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../src/form/selects/TreeSelect/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport KitsContainer from \"../../helpers/FormContainer\";\nimport type { ITreeSelect } from \"@lmb-it/kitsconcerto-types\";\nimport { TreeSelect } from \"@lmb-it/kitsconcertomobile\";\nimport { ClHelper } from \"../../helpers/Functions\";\nimport { useTreeBuild } from \"../hooks/useTreeBuild\";\nimport { useComponentDefaults, useResolvedStyle } from \"@lmb-it/kitsconcerto/hooks\";\n\nconst KitsTreeSelect = <T = any,>({ ref, ...rawProps }: ITreeSelect) => {\n const { mergedProps: props, themeStyle, elementStyles } = useComponentDefaults('TreeSelect', rawProps, 'Select');\n const resolvedThemeStyle = useResolvedStyle(themeStyle);\n const resolvedRootStyle = useResolvedStyle(elementStyles?.root || {});\n const {\n rightAddon,\n leftAddon,\n errors,\n invalid,\n label,\n id,\n placeholder,\n required,\n disabled,\n helperText,\n attached,\n isFloatedLabel,\n inputSize,\n valueMode,\n isMultiple,\n localProps,\n withFilter,\n filterBy,\n hideError,\n onlyParentsWithChildren,\n resetFilterOnHide,\n scrollHeight,\n emptyMessage,\n showClear,\n containerStyle,\n } = props;\n\n const { nodes, value, handleChange } = useTreeBuild<T>({\n isStructured: props.isStructured,\n ref,\n });\n\n\n\n const Element = (\n <TreeSelect\n value={value}\n filter={withFilter}\n filterBy={filterBy}\n options={nodes}\n display={isMultiple ? valueMode : \"comma\"}\n onChange={handleChange}\n selectionMode={isMultiple ? 'checkbox' : 'single'}\n placeholder={placeholder}\n disabled={disabled}\n invalid={invalid}\n showClear={showClear ?? !required}\n isModal={false}\n onlyParentsWithChildren={onlyParentsWithChildren}\n resetFilterOnHide={resetFilterOnHide}\n scrollHeight={scrollHeight}\n emptyMessage={emptyMessage}\n style={resolvedRootStyle && Object.keys(resolvedRootStyle).length ? resolvedRootStyle : (Object.keys(resolvedThemeStyle).length ? resolvedThemeStyle : undefined)}\n {...localProps}\n />\n );\n\n if (attached) {\n return Element;\n }\n\n return (\n <KitsContainer\n id={id}\n inputSize={inputSize}\n isFloatedLabel={isFloatedLabel}\n rightAddon={rightAddon}\n leftAddon={leftAddon}\n required={required}\n hideError={hideError}\n errors={errors}\n helperText={helperText}\n invalid={invalid}\n label={label}\n containerStyle={containerStyle}\n elementStyles={elementStyles}\n >\n {Element}\n </KitsContainer>\n );\n}\nexport default KitsTreeSelect;\n"],"names":["useComponentDefaults","useResolvedStyle","useTreeBuild","jsx","TreeSelect","KitsContainer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAM,iBAAiB,CAAW,EAAE,GAAA,EAAK,GAAG,UAAS,KAAmB;AACpE,EAAA,MAAM,EAAE,aAAa,KAAA,EAAO,UAAA,EAAY,eAAc,GAAIA,4BAAA,CAAqB,YAAA,EAAc,QAAA,EAAU,QAAQ,CAAA;AAC/G,EAAA,MAAM,kBAAA,GAAqBC,yBAAiB,UAAU,CAAA;AACtD,EAAA,MAAM,iBAAA,GAAoBA,wBAAA,CAAiB,aAAA,EAAe,IAAA,IAAQ,EAAE,CAAA;AACpE,EAAA,MAAM;AAAA,IACF,UAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;AAAA,IACA,KAAA;AAAA,IACA,EAAA;AAAA,IACA,WAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA,QAAA;AAAA,IACA,cAAA;AAAA,IACA,SAAA;AAAA,IACA,SAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA;AAAA,IACA,uBAAA;AAAA,IACA,iBAAA;AAAA,IACA,YAAA;AAAA,IACA,YAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,GACJ,GAAI,KAAA;AAEJ,EAAA,M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 @@ import '../../../apps/mobile/src/Core/Input/Slot.js';
|
|
|
84
84
|
import { useTreeBuild } from '../hooks/useTreeBuild.js';
|
|
85
85
|
import '../../../contexts/DialogContext.js';
|
|
86
86
|
import '../../../contexts/PermissionsContext.js';
|
|
87
|
+
import '../../../contexts/BreadcrumbContext.js';
|
|
87
88
|
import useComponentDefaults from '../../../hooks/useComponentDefaults.js';
|
|
88
89
|
import useResolvedStyle from '../../../hooks/useResolvedStyle.js';
|
|
89
90
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/form/selects/TreeSelect/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport KitsContainer from \"../../helpers/FormContainer\";\nimport type { ITreeSelect } from \"@lmb-it/kitsconcerto-types\";\nimport { TreeSelect } from \"@lmb-it/kitsconcertomobile\";\nimport { ClHelper } from \"../../helpers/Functions\";\nimport { useTreeBuild } from \"../hooks/useTreeBuild\";\nimport { useComponentDefaults, useResolvedStyle } from \"@lmb-it/kitsconcerto/hooks\";\n\nconst KitsTreeSelect = <T = any,>({ ref, ...rawProps }: ITreeSelect) => {\n const { mergedProps: props, themeStyle, elementStyles } = useComponentDefaults('TreeSelect', rawProps, 'Select');\n const resolvedThemeStyle = useResolvedStyle(themeStyle);\n const resolvedRootStyle = useResolvedStyle(elementStyles?.root || {});\n const {\n rightAddon,\n leftAddon,\n errors,\n invalid,\n label,\n id,\n placeholder,\n required,\n disabled,\n helperText,\n attached,\n isFloatedLabel,\n inputSize,\n valueMode,\n isMultiple,\n localProps,\n withFilter,\n filterBy,\n hideError,\n onlyParentsWithChildren,\n resetFilterOnHide,\n scrollHeight,\n emptyMessage,\n showClear,\n containerStyle,\n } = props;\n\n const { nodes, value, handleChange } = useTreeBuild<T>({\n isStructured: props.isStructured,\n ref,\n });\n\n\n\n const Element = (\n <TreeSelect\n value={value}\n filter={withFilter}\n filterBy={filterBy}\n options={nodes}\n display={isMultiple ? valueMode : \"comma\"}\n onChange={handleChange}\n selectionMode={isMultiple ? 'checkbox' : 'single'}\n placeholder={placeholder}\n disabled={disabled}\n invalid={invalid}\n showClear={showClear ?? !required}\n isModal={false}\n onlyParentsWithChildren={onlyParentsWithChildren}\n resetFilterOnHide={resetFilterOnHide}\n scrollHeight={scrollHeight}\n emptyMessage={emptyMessage}\n style={resolvedRootStyle && Object.keys(resolvedRootStyle).length ? resolvedRootStyle : (Object.keys(resolvedThemeStyle).length ? resolvedThemeStyle : undefined)}\n {...localProps}\n />\n );\n\n if (attached) {\n return Element;\n }\n\n return (\n <KitsContainer\n id={id}\n inputSize={inputSize}\n isFloatedLabel={isFloatedLabel}\n rightAddon={rightAddon}\n leftAddon={leftAddon}\n required={required}\n hideError={hideError}\n errors={errors}\n helperText={helperText}\n invalid={invalid}\n label={label}\n containerStyle={containerStyle}\n elementStyles={elementStyles}\n >\n {Element}\n </KitsContainer>\n );\n}\nexport default KitsTreeSelect;\n"],"names":["TreeSelect"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/form/selects/TreeSelect/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport KitsContainer from \"../../helpers/FormContainer\";\nimport type { ITreeSelect } from \"@lmb-it/kitsconcerto-types\";\nimport { TreeSelect } from \"@lmb-it/kitsconcertomobile\";\nimport { ClHelper } from \"../../helpers/Functions\";\nimport { useTreeBuild } from \"../hooks/useTreeBuild\";\nimport { useComponentDefaults, useResolvedStyle } from \"@lmb-it/kitsconcerto/hooks\";\n\nconst KitsTreeSelect = <T = any,>({ ref, ...rawProps }: ITreeSelect) => {\n const { mergedProps: props, themeStyle, elementStyles } = useComponentDefaults('TreeSelect', rawProps, 'Select');\n const resolvedThemeStyle = useResolvedStyle(themeStyle);\n const resolvedRootStyle = useResolvedStyle(elementStyles?.root || {});\n const {\n rightAddon,\n leftAddon,\n errors,\n invalid,\n label,\n id,\n placeholder,\n required,\n disabled,\n helperText,\n attached,\n isFloatedLabel,\n inputSize,\n valueMode,\n isMultiple,\n localProps,\n withFilter,\n filterBy,\n hideError,\n onlyParentsWithChildren,\n resetFilterOnHide,\n scrollHeight,\n emptyMessage,\n showClear,\n containerStyle,\n } = props;\n\n const { nodes, value, handleChange } = useTreeBuild<T>({\n isStructured: props.isStructured,\n ref,\n });\n\n\n\n const Element = (\n <TreeSelect\n value={value}\n filter={withFilter}\n filterBy={filterBy}\n options={nodes}\n display={isMultiple ? valueMode : \"comma\"}\n onChange={handleChange}\n selectionMode={isMultiple ? 'checkbox' : 'single'}\n placeholder={placeholder}\n disabled={disabled}\n invalid={invalid}\n showClear={showClear ?? !required}\n isModal={false}\n onlyParentsWithChildren={onlyParentsWithChildren}\n resetFilterOnHide={resetFilterOnHide}\n scrollHeight={scrollHeight}\n emptyMessage={emptyMessage}\n style={resolvedRootStyle && Object.keys(resolvedRootStyle).length ? resolvedRootStyle : (Object.keys(resolvedThemeStyle).length ? resolvedThemeStyle : undefined)}\n {...localProps}\n />\n );\n\n if (attached) {\n return Element;\n }\n\n return (\n <KitsContainer\n id={id}\n inputSize={inputSize}\n isFloatedLabel={isFloatedLabel}\n rightAddon={rightAddon}\n leftAddon={leftAddon}\n required={required}\n hideError={hideError}\n errors={errors}\n helperText={helperText}\n invalid={invalid}\n label={label}\n containerStyle={containerStyle}\n elementStyles={elementStyles}\n >\n {Element}\n </KitsContainer>\n );\n}\nexport default KitsTreeSelect;\n"],"names":["TreeSelect"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAM,iBAAiB,CAAW,EAAE,GAAA,EAAK,GAAG,UAAS,KAAmB;AACpE,EAAA,MAAM,EAAE,aAAa,KAAA,EAAO,UAAA,EAAY,eAAc,GAAI,oBAAA,CAAqB,YAAA,EAAc,QAAA,EAAU,QAAQ,CAAA;AAC/G,EAAA,MAAM,kBAAA,GAAqB,iBAAiB,UAAU,CAAA;AACtD,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E,MAAA,GAAS,iBAAA,GAAqB,MAAA,CAAO,IAAA,CAAK,kBAAkB,CAAA,CAAE,SAAS,kBAAA,GAAqB,MAAA;AAAA,MACtJ,GAAG;AAAA;AAAA,GACR;AAGJ,EAAA,IAAI,QAAA,EAAU;AACV,IAAA,OAAO,OAAA;AAAA,EACX;AAEA,EAAA,uBACI,GAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACG,EAAA;AAAA,MACA,SAAA;AAAA,MACA,cAAA;AAAA,MACA,UAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA;AAAA,MACA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,MACA,OAAA;AAAA,MACA,KAAA;AAAA,MACA,cAAA;AAAA,MACA,aAAA;AAAA,MAEC,QAAA,EAAA;AAAA;AAAA,GACL;AAER;;;;"}
|
|
@@ -90,6 +90,7 @@ var index_native = require('../../../components/overlay/Dialog/index.cjs');
|
|
|
90
90
|
var locale = require('../../../hooks/locale.cjs');
|
|
91
91
|
require('../../../contexts/DialogContext.cjs');
|
|
92
92
|
require('../../../contexts/PermissionsContext.cjs');
|
|
93
|
+
require('../../../contexts/BreadcrumbContext.cjs');
|
|
93
94
|
var useThemedFont = require('../../../hooks/useThemedFont.cjs');
|
|
94
95
|
var KitsThemeProvider_native = require('../../../contexts/Theme/KitsThemeProvider.cjs');
|
|
95
96
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectPopupOverlay.cjs","sources":["../../../../../src/form/selects/helpers/SelectPopupOverlay.native.tsx"],"sourcesContent":["import React from 'react';\nimport {Pressable, StyleSheet, Text, View, useWindowDimensions} from 'react-native';\nimport {useSafeAreaInsets} from 'react-native-safe-area-context';\nimport {readerEdge, useKeyboardHeight} from '@lmb-it/kitsconcertomobile';\nimport KitsDialogControlled from '../../../components/overlay/Dialog';\nimport {useKitsTheme} from '../../../contexts/Theme';\nimport {useLanguage} from '../../../hooks';\nimport useThemedFont from '../../../hooks/useThemedFont';\n\n/**\n * The container a select's options live in when `popup` is on.\n *\n * ⛔ THIS IS NOT A SECOND OVERLAY MECHANISM. It is the library's own\n * `KitsDialogControlled` in bottom-sheet position, so the scrim, the slide\n * animation, the safe-area insets, `dismissableMask` and Android's hardware\n * back all come from the one place that already owns them. The only thing\n * this file adds is the header row and the sizing a picker needs.\n *\n * ⛔ IT USES `content` MODE ON PURPOSE. The Dialog's default template puts its\n * children inside a ScrollView with `maxHeight: 400`. A FlatList inside a\n * ScrollView scrolls badly and warns, and a 400pt cap is the very thing the\n * popup exists to escape. `content` replaces the whole header/body/footer\n * template, so the caller's search field can be pinned and its list can own\n * the remaining height.\n *\n * WHY A FIXED FRACTION OF THE SCREEN. The popup's whole purpose is that its\n * height does not depend on where the trigger happens to sit or on whether the\n * keyboard is up. It takes a fixed share of the window, the search field sits\n * at the top of it, and the list takes the rest.\n */\n\nexport interface ISelectPopupOverlayProps {\n /** Open state. */\n visible: boolean;\n /** Called for every dismissal route — the ✕, the scrim, Android back. */\n onClose: () => void;\n /** Title shown beside the close control. Falls back to the field's label. */\n title?: React.ReactNode;\n /** The search field and the list. */\n children: React.ReactNode;\n}\n\n/** Share of the window height the sheet occupies when the keyboard is down. */\nconst SHEET_HEIGHT_RATIO = 0.75;\n/** Never shorter than this, even on a small screen with the keyboard up. */\nconst SHEET_MIN_HEIGHT = 240;\n\nconst SelectPopupOverlay = ({visible, onClose, title, children}: ISelectPopupOverlayProps) => {\n const {resolveToken} = useKitsTheme();\n const {isRTL} = useLanguage();\n /* Physical edges to write so the header lands where the reader starts. */\n const edge = readerEdge(isRTL);\n const insets = useSafeAreaInsets();\n const {height: windowHeight} = useWindowDimensions();\n /* Raw RN <Text> does not inherit `fontFamily` through View parents, so a\n consumer that swaps the theme font would see it everywhere except here.\n See useThemedFont's own note. */\n const headingFont = useThemedFont('heading');\n const keyboardHeight = useKeyboardHeight();\n\n /*\n * ⛔ \"OWNS THE SCREEN\" MEANS ABOVE THE KEYBOARD, NOT BEHIND IT. A sheet\n * pinned to the bottom at a fixed 75% still has its lower half under the\n * keyboard the moment the search field takes focus, and the list is back to\n * competing for the gap — the exact fault the popup exists to escape, one\n * layer along. The sheet is capped to what is actually visible.\n *\n * The keyboard replaces the bottom inset rather than adding to it: it\n * covers the home indicator.\n */\n const visibleHeight = windowHeight - Math.max(insets.bottom, keyboardHeight) - insets.top;\n const sheetHeight = Math.max(\n Math.min(SHEET_MIN_HEIGHT, visibleHeight),\n Math.min(Math.round(windowHeight * SHEET_HEIGHT_RATIO), visibleHeight),\n );\n\n const textColor = resolveToken('text');\n const borderColor = resolveToken('border');\n const grabberColor = resolveToken('gray.300');\n const subtextColor = resolveToken('gray.500');\n\n return (\n <KitsDialogControlled\n onHide={onClose}\n state={{\n visible,\n position: 'bottom',\n // Tap-outside dismiss. `onRequestClose` inside the Dialog gives\n // Android's back button the same route.\n dismissableMask: true,\n onClose,\n style: {\n height: sheetHeight,\n // The keyboard already clears the home indicator, so the\n // inset is only owed when the keyboard is down.\n paddingBottom: keyboardHeight > 0 ? 0 : insets.bottom,\n marginBottom: keyboardHeight,\n },\n content: ({hide}: {hide: () => void}) => (\n <View style={styles.root}>\n <View style={[styles.grabber, {backgroundColor: grabberColor}]} />\n <View\n style={[\n styles.header,\n {borderBottomColor: borderColor},\n /* ⛔ THE PHYSICAL EDGE IS COMPUTED, NEVER NAMED.\n React Native mirrors `flexDirection: 'row'`\n and `textAlign` when the process is RTL — the\n App calls `I18nManager.forceRTL` — so naming\n the RTL edge for an RTL reader asks for it\n twice and lands on the LTR one. That is why\n this header drew its title LEFT and its ✕\n RIGHT in Arabic while the option rows below\n it, which already went through `readerEdge`,\n were correct. See `readerEdge`. */\n {flexDirection: edge.flexDirection},\n ]}>\n <Text\n numberOfLines={1}\n style={[\n styles.title,\n {color: textColor, fontFamily: headingFont},\n {\n textAlign: edge.textAlign,\n /* `writingDirection` is NOT mirrored — it\n orders glyphs inside the line, so it\n takes the reader's own direction. */\n writingDirection: isRTL ? ('rtl' as const) : ('ltr' as const),\n },\n ]}>\n {title}\n </Text>\n <Pressable onPress={hide} hitSlop={12} accessibilityRole=\"button\">\n <Text style={[styles.close, {color: subtextColor}]}>✕</Text>\n </Pressable>\n </View>\n {children}\n </View>\n ),\n }}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n root: {\n flex: 1,\n minHeight: 0,\n },\n grabber: {\n width: 40,\n height: 4,\n borderRadius: 2,\n alignSelf: 'center',\n marginTop: 8,\n marginBottom: 4,\n },\n header: {\n alignItems: 'center',\n paddingHorizontal: 16,\n paddingVertical: 12,\n borderBottomWidth: 1,\n gap: 12,\n },\n title: {\n flex: 1,\n fontSize: 17,\n fontWeight: '700',\n },\n close: {\n fontSize: 18,\n },\n});\n\nexport default SelectPopupOverlay;\n"],"names":["useKitsTheme","useLanguage","readerEdge","useSafeAreaInsets","useWindowDimensions","useThemedFont","useKeyboardHeight","jsx","KitsDialogControlled","jsxs","View","Text","Pressable","StyleSheet"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,MAAM,kBAAA,GAAqB,IAAA;AAE3B,MAAM,gBAAA,GAAmB,GAAA;AAEzB,MAAM,qBAAqB,CAAC,EAAC,SAAS,OAAA,EAAS,KAAA,EAAO,UAAQ,KAAgC;AAC1F,EAAA,MAAM,EAAC,YAAA,EAAY,GAAIA,qCAAA,EAAa;AACpC,EAAA,MAAM,EAAC,KAAA,EAAK,GAAIC,kBAAA,EAAY;AAE5B,EAAA,MAAM,IAAA,GAAOC,sBAAW,KAAK,CAAA;AAC7B,EAAA,MAAM,SAASC,4CAAA,EAAkB;AACjC,EAAA,MAAM,EAAC,MAAA,EAAQ,YAAA,EAAY,GAAIC,+BAAA,EAAoB;AAInD,EAAA,MAAM,WAAA,GAAcC,sBAAc,SAAS,CAAA;AAC3C,EAAA,MAAM,iBAAiBC,mCAAA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AAAA,GAClB;AAAA,EACA,MAAA,EAAQ;AAAA,IACJ,UAAA,EAAY,QAAA;AAAA,IACZ,iBAAA,EAAmB,EAAA;AAAA,IACnB,eAAA,EAAiB,EAAA;AAAA,IACjB,iBAAA,EAAmB,CAAA;AAAA,IACnB,GAAA,EAAK;AAAA,GACT;AAAA,EACA,KAAA,EAAO;AAAA,IACH,IAAA,EAAM,CAAA;AAAA,IACN,QAAA,EAAU,EAAA;AAAA,IACV,UAAA,EAAY;AAAA,GAChB;AAAA,EACA,KAAA,EAAO;AAAA,IACH,QAAA,EAAU;AAAA;AAElB,CAAC,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"SelectPopupOverlay.cjs","sources":["../../../../../src/form/selects/helpers/SelectPopupOverlay.native.tsx"],"sourcesContent":["import React from 'react';\nimport {Pressable, StyleSheet, Text, View, useWindowDimensions} from 'react-native';\nimport {useSafeAreaInsets} from 'react-native-safe-area-context';\nimport {readerEdge, useKeyboardHeight} from '@lmb-it/kitsconcertomobile';\nimport KitsDialogControlled from '../../../components/overlay/Dialog';\nimport {useKitsTheme} from '../../../contexts/Theme';\nimport {useLanguage} from '../../../hooks';\nimport useThemedFont from '../../../hooks/useThemedFont';\n\n/**\n * The container a select's options live in when `popup` is on.\n *\n * ⛔ THIS IS NOT A SECOND OVERLAY MECHANISM. It is the library's own\n * `KitsDialogControlled` in bottom-sheet position, so the scrim, the slide\n * animation, the safe-area insets, `dismissableMask` and Android's hardware\n * back all come from the one place that already owns them. The only thing\n * this file adds is the header row and the sizing a picker needs.\n *\n * ⛔ IT USES `content` MODE ON PURPOSE. The Dialog's default template puts its\n * children inside a ScrollView with `maxHeight: 400`. A FlatList inside a\n * ScrollView scrolls badly and warns, and a 400pt cap is the very thing the\n * popup exists to escape. `content` replaces the whole header/body/footer\n * template, so the caller's search field can be pinned and its list can own\n * the remaining height.\n *\n * WHY A FIXED FRACTION OF THE SCREEN. The popup's whole purpose is that its\n * height does not depend on where the trigger happens to sit or on whether the\n * keyboard is up. It takes a fixed share of the window, the search field sits\n * at the top of it, and the list takes the rest.\n */\n\nexport interface ISelectPopupOverlayProps {\n /** Open state. */\n visible: boolean;\n /** Called for every dismissal route — the ✕, the scrim, Android back. */\n onClose: () => void;\n /** Title shown beside the close control. Falls back to the field's label. */\n title?: React.ReactNode;\n /** The search field and the list. */\n children: React.ReactNode;\n}\n\n/** Share of the window height the sheet occupies when the keyboard is down. */\nconst SHEET_HEIGHT_RATIO = 0.75;\n/** Never shorter than this, even on a small screen with the keyboard up. */\nconst SHEET_MIN_HEIGHT = 240;\n\nconst SelectPopupOverlay = ({visible, onClose, title, children}: ISelectPopupOverlayProps) => {\n const {resolveToken} = useKitsTheme();\n const {isRTL} = useLanguage();\n /* Physical edges to write so the header lands where the reader starts. */\n const edge = readerEdge(isRTL);\n const insets = useSafeAreaInsets();\n const {height: windowHeight} = useWindowDimensions();\n /* Raw RN <Text> does not inherit `fontFamily` through View parents, so a\n consumer that swaps the theme font would see it everywhere except here.\n See useThemedFont's own note. */\n const headingFont = useThemedFont('heading');\n const keyboardHeight = useKeyboardHeight();\n\n /*\n * ⛔ \"OWNS THE SCREEN\" MEANS ABOVE THE KEYBOARD, NOT BEHIND IT. A sheet\n * pinned to the bottom at a fixed 75% still has its lower half under the\n * keyboard the moment the search field takes focus, and the list is back to\n * competing for the gap — the exact fault the popup exists to escape, one\n * layer along. The sheet is capped to what is actually visible.\n *\n * The keyboard replaces the bottom inset rather than adding to it: it\n * covers the home indicator.\n */\n const visibleHeight = windowHeight - Math.max(insets.bottom, keyboardHeight) - insets.top;\n const sheetHeight = Math.max(\n Math.min(SHEET_MIN_HEIGHT, visibleHeight),\n Math.min(Math.round(windowHeight * SHEET_HEIGHT_RATIO), visibleHeight),\n );\n\n const textColor = resolveToken('text');\n const borderColor = resolveToken('border');\n const grabberColor = resolveToken('gray.300');\n const subtextColor = resolveToken('gray.500');\n\n return (\n <KitsDialogControlled\n onHide={onClose}\n state={{\n visible,\n position: 'bottom',\n // Tap-outside dismiss. `onRequestClose` inside the Dialog gives\n // Android's back button the same route.\n dismissableMask: true,\n onClose,\n style: {\n height: sheetHeight,\n // The keyboard already clears the home indicator, so the\n // inset is only owed when the keyboard is down.\n paddingBottom: keyboardHeight > 0 ? 0 : insets.bottom,\n marginBottom: keyboardHeight,\n },\n content: ({hide}: {hide: () => void}) => (\n <View style={styles.root}>\n <View style={[styles.grabber, {backgroundColor: grabberColor}]} />\n <View\n style={[\n styles.header,\n {borderBottomColor: borderColor},\n /* ⛔ THE PHYSICAL EDGE IS COMPUTED, NEVER NAMED.\n React Native mirrors `flexDirection: 'row'`\n and `textAlign` when the process is RTL — the\n App calls `I18nManager.forceRTL` — so naming\n the RTL edge for an RTL reader asks for it\n twice and lands on the LTR one. That is why\n this header drew its title LEFT and its ✕\n RIGHT in Arabic while the option rows below\n it, which already went through `readerEdge`,\n were correct. See `readerEdge`. */\n {flexDirection: edge.flexDirection},\n ]}>\n <Text\n numberOfLines={1}\n style={[\n styles.title,\n {color: textColor, fontFamily: headingFont},\n {\n textAlign: edge.textAlign,\n /* `writingDirection` is NOT mirrored — it\n orders glyphs inside the line, so it\n takes the reader's own direction. */\n writingDirection: isRTL ? ('rtl' as const) : ('ltr' as const),\n },\n ]}>\n {title}\n </Text>\n <Pressable onPress={hide} hitSlop={12} accessibilityRole=\"button\">\n <Text style={[styles.close, {color: subtextColor}]}>✕</Text>\n </Pressable>\n </View>\n {children}\n </View>\n ),\n }}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n root: {\n flex: 1,\n minHeight: 0,\n },\n grabber: {\n width: 40,\n height: 4,\n borderRadius: 2,\n alignSelf: 'center',\n marginTop: 8,\n marginBottom: 4,\n },\n header: {\n alignItems: 'center',\n paddingHorizontal: 16,\n paddingVertical: 12,\n borderBottomWidth: 1,\n gap: 12,\n },\n title: {\n flex: 1,\n fontSize: 17,\n fontWeight: '700',\n },\n close: {\n fontSize: 18,\n },\n});\n\nexport default SelectPopupOverlay;\n"],"names":["useKitsTheme","useLanguage","readerEdge","useSafeAreaInsets","useWindowDimensions","useThemedFont","useKeyboardHeight","jsx","KitsDialogControlled","jsxs","View","Text","Pressable","StyleSheet"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,MAAM,kBAAA,GAAqB,IAAA;AAE3B,MAAM,gBAAA,GAAmB,GAAA;AAEzB,MAAM,qBAAqB,CAAC,EAAC,SAAS,OAAA,EAAS,KAAA,EAAO,UAAQ,KAAgC;AAC1F,EAAA,MAAM,EAAC,YAAA,EAAY,GAAIA,qCAAA,EAAa;AACpC,EAAA,MAAM,EAAC,KAAA,EAAK,GAAIC,kBAAA,EAAY;AAE5B,EAAA,MAAM,IAAA,GAAOC,sBAAW,KAAK,CAAA;AAC7B,EAAA,MAAM,SAASC,4CAAA,EAAkB;AACjC,EAAA,MAAM,EAAC,MAAA,EAAQ,YAAA,EAAY,GAAIC,+BAAA,EAAoB;AAInD,EAAA,MAAM,WAAA,GAAcC,sBAAc,SAAS,CAAA;AAC3C,EAAA,MAAM,iBAAiBC,mCAAA,EAAkB;AAYzC,EAAA,MAAM,aAAA,GAAgB,eAAe,IAAA,CAAK,GAAA,CAAI,OAAO,MAAA,EAAQ,cAAc,IAAI,MAAA,CAAO,GAAA;AACtF,EAAA,MAAM,cAAc,IAAA,CAAK,GAAA;AAAA,IACrB,IAAA,CAAK,GAAA,CAAI,gBAAA,EAAkB,aAAa,CAAA;AAAA,IACxC,KAAK,GAAA,CAAI,IAAA,CAAK,MAAM,YAAA,GAAe,kBAAkB,GAAG,aAAa;AAAA,GACzE;AAEA,EAAA,MAAM,SAAA,GAAY,aAAa,MAAM,CAAA;AACrC,EAAA,MAAM,WAAA,GAAc,aAAa,QAAQ,CAAA;AACzC,EAAA,MAAM,YAAA,GAAe,aAAa,UAAU,CAAA;AAC5C,EAAA,MAAM,YAAA,GA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A;AAAA,wBAIhB,gBAAA,EAAkB,QAAS,KAAA,GAAmB;AAAA;AAClD,qBACJ;AAAA,oBACC,QAAA,EAAA;AAAA;AAAA,iBACL;AAAA,gCACAJ,cAAA,CAACK,yBAAU,OAAA,EAAS,IAAA,EAAM,SAAS,EAAA,EAAI,iBAAA,EAAkB,UACrD,QAAA,kBAAAL,cAAA,CAACI,gBAAA,EAAA,EAAK,OAAO,CAAC,MAAA,CAAO,OAAO,EAAC,KAAA,EAAO,cAAa,CAAA,EAAG,oBAAC,CAAA,EACzD;AAAA;AAAA;AAAA,WACJ;AAAA,UACC;AAAA,SAAA,EACL;AAAA;AAER;AAAA,GACJ;AAER;AAEA,MAAM,MAAA,GAASE,uBAAW,MAAA,CAAO;AAAA,EAC7B,IAAA,EAAM;AAAA,IACF,IAAA,EAAM,CAAA;AAAA,IACN,SAAA,EAAW;AAAA,GACf;AAAA,EACA,OAAA,EAAS;AAAA,IACL,KAAA,EAAO,EAAA;AAAA,IACP,MAAA,EAAQ,CAAA;AAAA,IACR,YAAA,EAAc,CAAA;AAAA,IACd,SAAA,EAAW,QAAA;AAAA,IACX,SAAA,EAAW,CAAA;AAAA,IACX,YAAA,EAAc;AAAA,GAClB;AAAA,EACA,MAAA,EAAQ;AAAA,IACJ,UAAA,EAAY,QAAA;AAAA,IACZ,iBAAA,EAAmB,EAAA;AAAA,IACnB,eAAA,EAAiB,EAAA;AAAA,IACjB,iBAAA,EAAmB,CAAA;AAAA,IACnB,GAAA,EAAK;AAAA,GACT;AAAA,EACA,KAAA,EAAO;AAAA,IACH,IAAA,EAAM,CAAA;AAAA,IACN,QAAA,EAAU,EAAA;AAAA,IACV,UAAA,EAAY;AAAA,GAChB;AAAA,EACA,KAAA,EAAO;AAAA,IACH,QAAA,EAAU;AAAA;AAElB,CAAC,CAAA;;;;"}
|
|
@@ -86,6 +86,7 @@ import KitsDialogControlled from '../../../components/overlay/Dialog/index.js';
|
|
|
86
86
|
import { useLanguage } from '../../../hooks/locale.js';
|
|
87
87
|
import '../../../contexts/DialogContext.js';
|
|
88
88
|
import '../../../contexts/PermissionsContext.js';
|
|
89
|
+
import '../../../contexts/BreadcrumbContext.js';
|
|
89
90
|
import useThemedFont from '../../../hooks/useThemedFont.js';
|
|
90
91
|
import { useKitsTheme } from '../../../contexts/Theme/KitsThemeProvider.js';
|
|
91
92
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectPopupOverlay.js","sources":["../../../../../src/form/selects/helpers/SelectPopupOverlay.native.tsx"],"sourcesContent":["import React from 'react';\nimport {Pressable, StyleSheet, Text, View, useWindowDimensions} from 'react-native';\nimport {useSafeAreaInsets} from 'react-native-safe-area-context';\nimport {readerEdge, useKeyboardHeight} from '@lmb-it/kitsconcertomobile';\nimport KitsDialogControlled from '../../../components/overlay/Dialog';\nimport {useKitsTheme} from '../../../contexts/Theme';\nimport {useLanguage} from '../../../hooks';\nimport useThemedFont from '../../../hooks/useThemedFont';\n\n/**\n * The container a select's options live in when `popup` is on.\n *\n * ⛔ THIS IS NOT A SECOND OVERLAY MECHANISM. It is the library's own\n * `KitsDialogControlled` in bottom-sheet position, so the scrim, the slide\n * animation, the safe-area insets, `dismissableMask` and Android's hardware\n * back all come from the one place that already owns them. The only thing\n * this file adds is the header row and the sizing a picker needs.\n *\n * ⛔ IT USES `content` MODE ON PURPOSE. The Dialog's default template puts its\n * children inside a ScrollView with `maxHeight: 400`. A FlatList inside a\n * ScrollView scrolls badly and warns, and a 400pt cap is the very thing the\n * popup exists to escape. `content` replaces the whole header/body/footer\n * template, so the caller's search field can be pinned and its list can own\n * the remaining height.\n *\n * WHY A FIXED FRACTION OF THE SCREEN. The popup's whole purpose is that its\n * height does not depend on where the trigger happens to sit or on whether the\n * keyboard is up. It takes a fixed share of the window, the search field sits\n * at the top of it, and the list takes the rest.\n */\n\nexport interface ISelectPopupOverlayProps {\n /** Open state. */\n visible: boolean;\n /** Called for every dismissal route — the ✕, the scrim, Android back. */\n onClose: () => void;\n /** Title shown beside the close control. Falls back to the field's label. */\n title?: React.ReactNode;\n /** The search field and the list. */\n children: React.ReactNode;\n}\n\n/** Share of the window height the sheet occupies when the keyboard is down. */\nconst SHEET_HEIGHT_RATIO = 0.75;\n/** Never shorter than this, even on a small screen with the keyboard up. */\nconst SHEET_MIN_HEIGHT = 240;\n\nconst SelectPopupOverlay = ({visible, onClose, title, children}: ISelectPopupOverlayProps) => {\n const {resolveToken} = useKitsTheme();\n const {isRTL} = useLanguage();\n /* Physical edges to write so the header lands where the reader starts. */\n const edge = readerEdge(isRTL);\n const insets = useSafeAreaInsets();\n const {height: windowHeight} = useWindowDimensions();\n /* Raw RN <Text> does not inherit `fontFamily` through View parents, so a\n consumer that swaps the theme font would see it everywhere except here.\n See useThemedFont's own note. */\n const headingFont = useThemedFont('heading');\n const keyboardHeight = useKeyboardHeight();\n\n /*\n * ⛔ \"OWNS THE SCREEN\" MEANS ABOVE THE KEYBOARD, NOT BEHIND IT. A sheet\n * pinned to the bottom at a fixed 75% still has its lower half under the\n * keyboard the moment the search field takes focus, and the list is back to\n * competing for the gap — the exact fault the popup exists to escape, one\n * layer along. The sheet is capped to what is actually visible.\n *\n * The keyboard replaces the bottom inset rather than adding to it: it\n * covers the home indicator.\n */\n const visibleHeight = windowHeight - Math.max(insets.bottom, keyboardHeight) - insets.top;\n const sheetHeight = Math.max(\n Math.min(SHEET_MIN_HEIGHT, visibleHeight),\n Math.min(Math.round(windowHeight * SHEET_HEIGHT_RATIO), visibleHeight),\n );\n\n const textColor = resolveToken('text');\n const borderColor = resolveToken('border');\n const grabberColor = resolveToken('gray.300');\n const subtextColor = resolveToken('gray.500');\n\n return (\n <KitsDialogControlled\n onHide={onClose}\n state={{\n visible,\n position: 'bottom',\n // Tap-outside dismiss. `onRequestClose` inside the Dialog gives\n // Android's back button the same route.\n dismissableMask: true,\n onClose,\n style: {\n height: sheetHeight,\n // The keyboard already clears the home indicator, so the\n // inset is only owed when the keyboard is down.\n paddingBottom: keyboardHeight > 0 ? 0 : insets.bottom,\n marginBottom: keyboardHeight,\n },\n content: ({hide}: {hide: () => void}) => (\n <View style={styles.root}>\n <View style={[styles.grabber, {backgroundColor: grabberColor}]} />\n <View\n style={[\n styles.header,\n {borderBottomColor: borderColor},\n /* ⛔ THE PHYSICAL EDGE IS COMPUTED, NEVER NAMED.\n React Native mirrors `flexDirection: 'row'`\n and `textAlign` when the process is RTL — the\n App calls `I18nManager.forceRTL` — so naming\n the RTL edge for an RTL reader asks for it\n twice and lands on the LTR one. That is why\n this header drew its title LEFT and its ✕\n RIGHT in Arabic while the option rows below\n it, which already went through `readerEdge`,\n were correct. See `readerEdge`. */\n {flexDirection: edge.flexDirection},\n ]}>\n <Text\n numberOfLines={1}\n style={[\n styles.title,\n {color: textColor, fontFamily: headingFont},\n {\n textAlign: edge.textAlign,\n /* `writingDirection` is NOT mirrored — it\n orders glyphs inside the line, so it\n takes the reader's own direction. */\n writingDirection: isRTL ? ('rtl' as const) : ('ltr' as const),\n },\n ]}>\n {title}\n </Text>\n <Pressable onPress={hide} hitSlop={12} accessibilityRole=\"button\">\n <Text style={[styles.close, {color: subtextColor}]}>✕</Text>\n </Pressable>\n </View>\n {children}\n </View>\n ),\n }}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n root: {\n flex: 1,\n minHeight: 0,\n },\n grabber: {\n width: 40,\n height: 4,\n borderRadius: 2,\n alignSelf: 'center',\n marginTop: 8,\n marginBottom: 4,\n },\n header: {\n alignItems: 'center',\n paddingHorizontal: 16,\n paddingVertical: 12,\n borderBottomWidth: 1,\n gap: 12,\n },\n title: {\n flex: 1,\n fontSize: 17,\n fontWeight: '700',\n },\n close: {\n fontSize: 18,\n },\n});\n\nexport default SelectPopupOverlay;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,MAAM,kBAAA,GAAqB,IAAA;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,EAAO,cAAa,CAAA,EAAG,oBAAC,CAAA,EACzD;AAAA;AAAA;AAAA,WACJ;AAAA,UACC;AAAA,SAAA,EACL;AAAA;AAER;AAAA,GACJ;AAER;AAEA,MAAM,MAAA,GAAS,WAAW,MAAA,CAAO;AAAA,EAC7B,IAAA,EAAM;AAAA,IACF,IAAA,EAAM,CAAA;AAAA,IACN,SAAA,EAAW;AAAA,GACf;AAAA,EACA,OAAA,EAAS;AAAA,IACL,KAAA,EAAO,EAAA;AAAA,IACP,MAAA,EAAQ,CAAA;AAAA,IACR,YAAA,EAAc,CAAA;AAAA,IACd,SAAA,EAAW,QAAA;AAAA,IACX,SAAA,EAAW,CAAA;AAAA,IACX,YAAA,EAAc;AAAA,GAClB;AAAA,EACA,MAAA,EAAQ;AAAA,IACJ,UAAA,EAAY,QAAA;AAAA,IACZ,iBAAA,EAAmB,EAAA;AAAA,IACnB,eAAA,EAAiB,EAAA;AAAA,IACjB,iBAAA,EAAmB,CAAA;AAAA,IACnB,GAAA,EAAK;AAAA,GACT;AAAA,EACA,KAAA,EAAO;AAAA,IACH,IAAA,EAAM,CAAA;AAAA,IACN,QAAA,EAAU,EAAA;AAAA,IACV,UAAA,EAAY;AAAA,GAChB;AAAA,EACA,KAAA,EAAO;AAAA,IACH,QAAA,EAAU;AAAA;AAElB,CAAC,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"SelectPopupOverlay.js","sources":["../../../../../src/form/selects/helpers/SelectPopupOverlay.native.tsx"],"sourcesContent":["import React from 'react';\nimport {Pressable, StyleSheet, Text, View, useWindowDimensions} from 'react-native';\nimport {useSafeAreaInsets} from 'react-native-safe-area-context';\nimport {readerEdge, useKeyboardHeight} from '@lmb-it/kitsconcertomobile';\nimport KitsDialogControlled from '../../../components/overlay/Dialog';\nimport {useKitsTheme} from '../../../contexts/Theme';\nimport {useLanguage} from '../../../hooks';\nimport useThemedFont from '../../../hooks/useThemedFont';\n\n/**\n * The container a select's options live in when `popup` is on.\n *\n * ⛔ THIS IS NOT A SECOND OVERLAY MECHANISM. It is the library's own\n * `KitsDialogControlled` in bottom-sheet position, so the scrim, the slide\n * animation, the safe-area insets, `dismissableMask` and Android's hardware\n * back all come from the one place that already owns them. The only thing\n * this file adds is the header row and the sizing a picker needs.\n *\n * ⛔ IT USES `content` MODE ON PURPOSE. The Dialog's default template puts its\n * children inside a ScrollView with `maxHeight: 400`. A FlatList inside a\n * ScrollView scrolls badly and warns, and a 400pt cap is the very thing the\n * popup exists to escape. `content` replaces the whole header/body/footer\n * template, so the caller's search field can be pinned and its list can own\n * the remaining height.\n *\n * WHY A FIXED FRACTION OF THE SCREEN. The popup's whole purpose is that its\n * height does not depend on where the trigger happens to sit or on whether the\n * keyboard is up. It takes a fixed share of the window, the search field sits\n * at the top of it, and the list takes the rest.\n */\n\nexport interface ISelectPopupOverlayProps {\n /** Open state. */\n visible: boolean;\n /** Called for every dismissal route — the ✕, the scrim, Android back. */\n onClose: () => void;\n /** Title shown beside the close control. Falls back to the field's label. */\n title?: React.ReactNode;\n /** The search field and the list. */\n children: React.ReactNode;\n}\n\n/** Share of the window height the sheet occupies when the keyboard is down. */\nconst SHEET_HEIGHT_RATIO = 0.75;\n/** Never shorter than this, even on a small screen with the keyboard up. */\nconst SHEET_MIN_HEIGHT = 240;\n\nconst SelectPopupOverlay = ({visible, onClose, title, children}: ISelectPopupOverlayProps) => {\n const {resolveToken} = useKitsTheme();\n const {isRTL} = useLanguage();\n /* Physical edges to write so the header lands where the reader starts. */\n const edge = readerEdge(isRTL);\n const insets = useSafeAreaInsets();\n const {height: windowHeight} = useWindowDimensions();\n /* Raw RN <Text> does not inherit `fontFamily` through View parents, so a\n consumer that swaps the theme font would see it everywhere except here.\n See useThemedFont's own note. */\n const headingFont = useThemedFont('heading');\n const keyboardHeight = useKeyboardHeight();\n\n /*\n * ⛔ \"OWNS THE SCREEN\" MEANS ABOVE THE KEYBOARD, NOT BEHIND IT. A sheet\n * pinned to the bottom at a fixed 75% still has its lower half under the\n * keyboard the moment the search field takes focus, and the list is back to\n * competing for the gap — the exact fault the popup exists to escape, one\n * layer along. The sheet is capped to what is actually visible.\n *\n * The keyboard replaces the bottom inset rather than adding to it: it\n * covers the home indicator.\n */\n const visibleHeight = windowHeight - Math.max(insets.bottom, keyboardHeight) - insets.top;\n const sheetHeight = Math.max(\n Math.min(SHEET_MIN_HEIGHT, visibleHeight),\n Math.min(Math.round(windowHeight * SHEET_HEIGHT_RATIO), visibleHeight),\n );\n\n const textColor = resolveToken('text');\n const borderColor = resolveToken('border');\n const grabberColor = resolveToken('gray.300');\n const subtextColor = resolveToken('gray.500');\n\n return (\n <KitsDialogControlled\n onHide={onClose}\n state={{\n visible,\n position: 'bottom',\n // Tap-outside dismiss. `onRequestClose` inside the Dialog gives\n // Android's back button the same route.\n dismissableMask: true,\n onClose,\n style: {\n height: sheetHeight,\n // The keyboard already clears the home indicator, so the\n // inset is only owed when the keyboard is down.\n paddingBottom: keyboardHeight > 0 ? 0 : insets.bottom,\n marginBottom: keyboardHeight,\n },\n content: ({hide}: {hide: () => void}) => (\n <View style={styles.root}>\n <View style={[styles.grabber, {backgroundColor: grabberColor}]} />\n <View\n style={[\n styles.header,\n {borderBottomColor: borderColor},\n /* ⛔ THE PHYSICAL EDGE IS COMPUTED, NEVER NAMED.\n React Native mirrors `flexDirection: 'row'`\n and `textAlign` when the process is RTL — the\n App calls `I18nManager.forceRTL` — so naming\n the RTL edge for an RTL reader asks for it\n twice and lands on the LTR one. That is why\n this header drew its title LEFT and its ✕\n RIGHT in Arabic while the option rows below\n it, which already went through `readerEdge`,\n were correct. See `readerEdge`. */\n {flexDirection: edge.flexDirection},\n ]}>\n <Text\n numberOfLines={1}\n style={[\n styles.title,\n {color: textColor, fontFamily: headingFont},\n {\n textAlign: edge.textAlign,\n /* `writingDirection` is NOT mirrored — it\n orders glyphs inside the line, so it\n takes the reader's own direction. */\n writingDirection: isRTL ? ('rtl' as const) : ('ltr' as const),\n },\n ]}>\n {title}\n </Text>\n <Pressable onPress={hide} hitSlop={12} accessibilityRole=\"button\">\n <Text style={[styles.close, {color: subtextColor}]}>✕</Text>\n </Pressable>\n </View>\n {children}\n </View>\n ),\n }}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n root: {\n flex: 1,\n minHeight: 0,\n },\n grabber: {\n width: 40,\n height: 4,\n borderRadius: 2,\n alignSelf: 'center',\n marginTop: 8,\n marginBottom: 4,\n },\n header: {\n alignItems: 'center',\n paddingHorizontal: 16,\n paddingVertical: 12,\n borderBottomWidth: 1,\n gap: 12,\n },\n title: {\n flex: 1,\n fontSize: 17,\n fontWeight: '700',\n },\n close: {\n fontSize: 18,\n },\n});\n\nexport default SelectPopupOverlay;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,MAAM,kBAAA,GAAqB,IAAA;AAE3B,MAAM,gBAAA,GAAmB,GAAA;AAEzB,MAAM,qBAAqB,CAAC,EAAC,SAAS,OAAA,EAAS,KAAA,EAAO,UAAQ,KAAgC;AAC1F,EAAA,MAAM,EAAC,YAAA,EAAY,GAAI,YAAA,EAAa;AACpC,EAAA,MAAM,EAAC,KAAA,EAAK,GAAI,WAAA,EAAY;AAE5B,EAAA,MAAM,IAAA,GAAO,WAAW,KAAK,CAAA;AAC7B,EAAA,MAAM,SAAS,iBAAA,EAAkB;AACjC,EAAA,MAAM,EAAC,MAAA,EAAQ,YAAA,EAAY,GAAI,mBAAA,EAAoB;AAInD,EAAA,MAAM,WAAA,GAAc,cAAc,SAAS,CAAA;AAC3C,EAAA,MAAM,iBAAiB,iBAAA,EAAkB;AAYzC,EAAA,MAAM,aAAA,GAAgB,eAAe,IAAA,CAAK,GAAA,CAAI,OAAO,MAAA,EAAQ,cAAc,IAAI,MAAA,CAAO,GAAA;AACtF,EAAA,MAAM,cAAc,IAAA,CAAK,GAAA;AAAA,IACrB,IA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ACT;AAAA,EACA,KAAA,EAAO;AAAA,IACH,IAAA,EAAM,CAAA;AAAA,IACN,QAAA,EAAU,EAAA;AAAA,IACV,UAAA,EAAY;AAAA,GAChB;AAAA,EACA,KAAA,EAAO;AAAA,IACH,QAAA,EAAU;AAAA;AAElB,CAAC,CAAA;;;;"}
|
|
@@ -9,6 +9,7 @@ require('react');
|
|
|
9
9
|
require('axios');
|
|
10
10
|
require('../../../../contexts/DialogContext.cjs');
|
|
11
11
|
require('../../../../contexts/PermissionsContext.cjs');
|
|
12
|
+
require('../../../../contexts/BreadcrumbContext.cjs');
|
|
12
13
|
require('../../../../form/selects/SelectContext.cjs');
|
|
13
14
|
|
|
14
15
|
const FileUploader = ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../../src/form-renderer/components/fields/FileUploader/index.tsx"],"sourcesContent":["// components/fields/FileUploader.tsx\n\nimport React from 'react';\nimport {type FieldValues, useFormContext} from 'react-hook-form';\nimport {KitsFilePicker} from \"../../../../_compat\";\nimport type {IFile, UseFieldLogicElementProps} from '@lmb-it/kitsconcerto-types';\n\n/**\n * Renders a file or image uploader.\n * It uses useFieldLogic for standard field state and useFormContext for form-level\n * configurations like outputFormat and error handling.\n */\nexport const FileUploader = <T extends FieldValues>({\n element,\n control,\n getValues,\n fieldLogic,\n }: UseFieldLogicElementProps<T>) => {\n\n // 1. Get form-level context for special properties.\n // We need to know the outputFormat to correctly structure the onChange payload.\n // We also need setError and clearErrors for the custom onError handler.\n const {setError, clearErrors, getValues: getFormConfig} = useFormContext();\n const outputFormat = (getFormConfig() as any).outputFormat || 'Json'; // Get form's output format\n\n // 2. Get field-level state and props from the central logic hook.\n const {\n field,\n fieldState,\n label,\n isDisabled,\n isRequired,\n helperText,\n placeholder,\n attached,\n style: elementStyle,\n slots,\n } = fieldLogic\n\n // 3. Cast the element to its specific type to access unique properties.\n const fileElement = element as IFile<T>;\n const {\n type,\n multiple,\n limit,\n acceptedTypes,\n maxFileSize,\n minFileSize,\n classicUploader,\n children,\n } = fileElement;\n\n // 4. Define the specific handlers for this component.\n const handleOnChange = (files: File[], base64Data: any[]) => {\n if (outputFormat === 'FormData') {\n field.onChange(multiple ? files : files[0]);\n } else {\n field.onChange(multiple ? base64Data : base64Data[0]);\n }\n };\n\n const handleError = (errorMessage: string) => {\n if (errorMessage === 'clear') {\n clearErrors(field.name);\n } else {\n setError(field.name, {type: 'custom', message: errorMessage});\n }\n };\n\n // 5. Render the \"dumb\" UI component with the resolved props.\n return (\n <KitsFilePicker\n id={field.name}\n value={field.value}\n //@ts-ignore\n onChange={handleOnChange}\n onError={handleError}\n\n // --- Resolved props ---\n label={label}\n disabled={isDisabled}\n required={isRequired}\n invalid={fieldState.invalid}\n errors={fieldState.error?.message}\n helperText={helperText}\n placeholder={placeholder}\n attached={attached}\n\n // --- Props from element definition ---\n type={type}\n multiple={multiple}\n limit={limit}\n acceptedTypes={acceptedTypes}\n maxFileSize={maxFileSize}\n minFileSize={minFileSize}\n classicUploader={classicUploader}\n isJsonOutput={outputFormat === 'Json'}\n children={children}\n style={elementStyle?.input}\n containerStyle={elementStyle?.container}\n slots={slots}\n />\n );\n};\n\nexport default FileUploader;\n"],"names":["useFormContext","jsx","KitsFilePicker"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../../src/form-renderer/components/fields/FileUploader/index.tsx"],"sourcesContent":["// components/fields/FileUploader.tsx\n\nimport React from 'react';\nimport {type FieldValues, useFormContext} from 'react-hook-form';\nimport {KitsFilePicker} from \"../../../../_compat\";\nimport type {IFile, UseFieldLogicElementProps} from '@lmb-it/kitsconcerto-types';\n\n/**\n * Renders a file or image uploader.\n * It uses useFieldLogic for standard field state and useFormContext for form-level\n * configurations like outputFormat and error handling.\n */\nexport const FileUploader = <T extends FieldValues>({\n element,\n control,\n getValues,\n fieldLogic,\n }: UseFieldLogicElementProps<T>) => {\n\n // 1. Get form-level context for special properties.\n // We need to know the outputFormat to correctly structure the onChange payload.\n // We also need setError and clearErrors for the custom onError handler.\n const {setError, clearErrors, getValues: getFormConfig} = useFormContext();\n const outputFormat = (getFormConfig() as any).outputFormat || 'Json'; // Get form's output format\n\n // 2. Get field-level state and props from the central logic hook.\n const {\n field,\n fieldState,\n label,\n isDisabled,\n isRequired,\n helperText,\n placeholder,\n attached,\n style: elementStyle,\n slots,\n } = fieldLogic\n\n // 3. Cast the element to its specific type to access unique properties.\n const fileElement = element as IFile<T>;\n const {\n type,\n multiple,\n limit,\n acceptedTypes,\n maxFileSize,\n minFileSize,\n classicUploader,\n children,\n } = fileElement;\n\n // 4. Define the specific handlers for this component.\n const handleOnChange = (files: File[], base64Data: any[]) => {\n if (outputFormat === 'FormData') {\n field.onChange(multiple ? files : files[0]);\n } else {\n field.onChange(multiple ? base64Data : base64Data[0]);\n }\n };\n\n const handleError = (errorMessage: string) => {\n if (errorMessage === 'clear') {\n clearErrors(field.name);\n } else {\n setError(field.name, {type: 'custom', message: errorMessage});\n }\n };\n\n // 5. Render the \"dumb\" UI component with the resolved props.\n return (\n <KitsFilePicker\n id={field.name}\n value={field.value}\n //@ts-ignore\n onChange={handleOnChange}\n onError={handleError}\n\n // --- Resolved props ---\n label={label}\n disabled={isDisabled}\n required={isRequired}\n invalid={fieldState.invalid}\n errors={fieldState.error?.message}\n helperText={helperText}\n placeholder={placeholder}\n attached={attached}\n\n // --- Props from element definition ---\n type={type}\n multiple={multiple}\n limit={limit}\n acceptedTypes={acceptedTypes}\n maxFileSize={maxFileSize}\n minFileSize={minFileSize}\n classicUploader={classicUploader}\n isJsonOutput={outputFormat === 'Json'}\n children={children}\n style={elementStyle?.input}\n containerStyle={elementStyle?.container}\n slots={slots}\n />\n );\n};\n\nexport default FileUploader;\n"],"names":["useFormContext","jsx","KitsFilePicker"],"mappings":";;;;;;;;;;;;;;AAYO,MAAM,eAAe,CAAwB;AAAA,EACI,OAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA;AACJ,CA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AA;AAAA,IAACC,oBAAA;AAAA,IAAA;AAAA,MACG,IAAI,KAAA,CAAM,IAAA;AAAA,MACV,OAAO,KAAA,CAAM,KAAA;AAAA,MAEb,QAAA,EAAU,cAAA;AAAA,MACV,OAAA,EAAS,WAAA;AAAA,MAGT,KAAA;AAAA,MACA,QAAA,EAAU,UAAA;AAAA,MACV,QAAA,EAAU,UAAA;AAAA,MACV,SAAS,UAAA,CAAW,OAAA;AAAA,MACpB,MAAA,EAAQ,WAAW,KAAA,EAAO,OAAA;AAAA,MAC1B,UAAA;AAAA,MACA,WAAA;AAAA,MACA,QAAA;AAAA,MAGA,IAAA;AAAA,MACA,QAAA;AAAA,MACA,KAAA;AAAA,MACA,aAAA;AAAA,MACA,WAAA;AAAA,MACA,WAAA;AAAA,MACA,eAAA;AAAA,MACA,cAAc,YAAA,KAAiB,MAAA;AAAA,MAC/B,QAAA;AAAA,MACA,OAAO,YAAA,EAAc,KAAA;AAAA,MACrB,gBAAgB,YAAA,EAAc,SAAA;AAAA,MAC9B;AAAA;AAAA,GACJ;AAER;;;;;"}
|
|
@@ -5,6 +5,7 @@ import 'react';
|
|
|
5
5
|
import 'axios';
|
|
6
6
|
import '../../../../contexts/DialogContext.js';
|
|
7
7
|
import '../../../../contexts/PermissionsContext.js';
|
|
8
|
+
import '../../../../contexts/BreadcrumbContext.js';
|
|
8
9
|
import '../../../../form/selects/SelectContext.js';
|
|
9
10
|
|
|
10
11
|
const FileUploader = ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../src/form-renderer/components/fields/FileUploader/index.tsx"],"sourcesContent":["// components/fields/FileUploader.tsx\n\nimport React from 'react';\nimport {type FieldValues, useFormContext} from 'react-hook-form';\nimport {KitsFilePicker} from \"../../../../_compat\";\nimport type {IFile, UseFieldLogicElementProps} from '@lmb-it/kitsconcerto-types';\n\n/**\n * Renders a file or image uploader.\n * It uses useFieldLogic for standard field state and useFormContext for form-level\n * configurations like outputFormat and error handling.\n */\nexport const FileUploader = <T extends FieldValues>({\n element,\n control,\n getValues,\n fieldLogic,\n }: UseFieldLogicElementProps<T>) => {\n\n // 1. Get form-level context for special properties.\n // We need to know the outputFormat to correctly structure the onChange payload.\n // We also need setError and clearErrors for the custom onError handler.\n const {setError, clearErrors, getValues: getFormConfig} = useFormContext();\n const outputFormat = (getFormConfig() as any).outputFormat || 'Json'; // Get form's output format\n\n // 2. Get field-level state and props from the central logic hook.\n const {\n field,\n fieldState,\n label,\n isDisabled,\n isRequired,\n helperText,\n placeholder,\n attached,\n style: elementStyle,\n slots,\n } = fieldLogic\n\n // 3. Cast the element to its specific type to access unique properties.\n const fileElement = element as IFile<T>;\n const {\n type,\n multiple,\n limit,\n acceptedTypes,\n maxFileSize,\n minFileSize,\n classicUploader,\n children,\n } = fileElement;\n\n // 4. Define the specific handlers for this component.\n const handleOnChange = (files: File[], base64Data: any[]) => {\n if (outputFormat === 'FormData') {\n field.onChange(multiple ? files : files[0]);\n } else {\n field.onChange(multiple ? base64Data : base64Data[0]);\n }\n };\n\n const handleError = (errorMessage: string) => {\n if (errorMessage === 'clear') {\n clearErrors(field.name);\n } else {\n setError(field.name, {type: 'custom', message: errorMessage});\n }\n };\n\n // 5. Render the \"dumb\" UI component with the resolved props.\n return (\n <KitsFilePicker\n id={field.name}\n value={field.value}\n //@ts-ignore\n onChange={handleOnChange}\n onError={handleError}\n\n // --- Resolved props ---\n label={label}\n disabled={isDisabled}\n required={isRequired}\n invalid={fieldState.invalid}\n errors={fieldState.error?.message}\n helperText={helperText}\n placeholder={placeholder}\n attached={attached}\n\n // --- Props from element definition ---\n type={type}\n multiple={multiple}\n limit={limit}\n acceptedTypes={acceptedTypes}\n maxFileSize={maxFileSize}\n minFileSize={minFileSize}\n classicUploader={classicUploader}\n isJsonOutput={outputFormat === 'Json'}\n children={children}\n style={elementStyle?.input}\n containerStyle={elementStyle?.container}\n slots={slots}\n />\n );\n};\n\nexport default FileUploader;\n"],"names":["KitsFilePicker"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/form-renderer/components/fields/FileUploader/index.tsx"],"sourcesContent":["// components/fields/FileUploader.tsx\n\nimport React from 'react';\nimport {type FieldValues, useFormContext} from 'react-hook-form';\nimport {KitsFilePicker} from \"../../../../_compat\";\nimport type {IFile, UseFieldLogicElementProps} from '@lmb-it/kitsconcerto-types';\n\n/**\n * Renders a file or image uploader.\n * It uses useFieldLogic for standard field state and useFormContext for form-level\n * configurations like outputFormat and error handling.\n */\nexport const FileUploader = <T extends FieldValues>({\n element,\n control,\n getValues,\n fieldLogic,\n }: UseFieldLogicElementProps<T>) => {\n\n // 1. Get form-level context for special properties.\n // We need to know the outputFormat to correctly structure the onChange payload.\n // We also need setError and clearErrors for the custom onError handler.\n const {setError, clearErrors, getValues: getFormConfig} = useFormContext();\n const outputFormat = (getFormConfig() as any).outputFormat || 'Json'; // Get form's output format\n\n // 2. Get field-level state and props from the central logic hook.\n const {\n field,\n fieldState,\n label,\n isDisabled,\n isRequired,\n helperText,\n placeholder,\n attached,\n style: elementStyle,\n slots,\n } = fieldLogic\n\n // 3. Cast the element to its specific type to access unique properties.\n const fileElement = element as IFile<T>;\n const {\n type,\n multiple,\n limit,\n acceptedTypes,\n maxFileSize,\n minFileSize,\n classicUploader,\n children,\n } = fileElement;\n\n // 4. Define the specific handlers for this component.\n const handleOnChange = (files: File[], base64Data: any[]) => {\n if (outputFormat === 'FormData') {\n field.onChange(multiple ? files : files[0]);\n } else {\n field.onChange(multiple ? base64Data : base64Data[0]);\n }\n };\n\n const handleError = (errorMessage: string) => {\n if (errorMessage === 'clear') {\n clearErrors(field.name);\n } else {\n setError(field.name, {type: 'custom', message: errorMessage});\n }\n };\n\n // 5. Render the \"dumb\" UI component with the resolved props.\n return (\n <KitsFilePicker\n id={field.name}\n value={field.value}\n //@ts-ignore\n onChange={handleOnChange}\n onError={handleError}\n\n // --- Resolved props ---\n label={label}\n disabled={isDisabled}\n required={isRequired}\n invalid={fieldState.invalid}\n errors={fieldState.error?.message}\n helperText={helperText}\n placeholder={placeholder}\n attached={attached}\n\n // --- Props from element definition ---\n type={type}\n multiple={multiple}\n limit={limit}\n acceptedTypes={acceptedTypes}\n maxFileSize={maxFileSize}\n minFileSize={minFileSize}\n classicUploader={classicUploader}\n isJsonOutput={outputFormat === 'Json'}\n children={children}\n style={elementStyle?.input}\n containerStyle={elementStyle?.container}\n slots={slots}\n />\n );\n};\n\nexport default FileUploader;\n"],"names":["KitsFilePicker"],"mappings":";;;;;;;;;;AAYO,MAAM,eAAe,CAAwB;AAAA,EACI,OAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA;AACJ,CAAA,KAAoC;AAKpF,EAAA,MAAM,EAAC,QAAA,EAAU,WAAA,EAAa,SAAA,EAAW,aAAA,KAAiB,cAAA,EAAe;AACzE,EAAA,MAAM,YAAA,GAAgB,aAAA,EAAc,CAAU,YAAA,IAAgB,MAAA;AAG9D,EAAA,MAAM;AAAA,IACF,KAAA;AAAA,IACA,UAAA;AAAA,IACA,KAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,WAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA,EAAO,YAAA;AAAA,IACP;AAAA,GACJ,GAAI,UAAA;AAGJ,EAAA,MAAM,WAAA,GAAc,OAAA;AACpB,EAAA,MAAM;AAAA,IACF,IAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA;AAAA,IACA,aAAA;AAAA,IACA,WAAA;AAAA,IACA,WAAA;AAAA,IACA,eAAA;AAAA,IACA;AAAA,GACJ,GAAI,WAAA;AAGJ,EAAA,MAAM,cAAA,GAAiB,CAAC,KAAA,EAAe,UAAA,KAAsB;AACzD,IAAA,IAAI,iBAAiB,UAAA,EAAY;AAC7B,MAAA,KAAA,CAAM,QAAA,CAAS,QAAA,GAAW,KAAA,GAAQ,KAAA,CAAM,CAAC,CAAC,CAAA;AAAA,IAC9C,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