@bikdotai/bik-component-library 0.0.868-beta.1 → 0.0.868-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js.map +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +23 -10
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.js.map +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js.map +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.js.map +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/utils/iterationOnOptions.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/utils/iterationOnOptions.js.map +1 -1
- package/dist/cjs/components/dropdown/hooks/useDropdown.js +1 -1
- package/dist/cjs/components/dropdown/hooks/useDropdown.js.map +1 -1
- package/dist/esm/components/ProgressChecklist/ProgressChecklist.style.d.ts +24 -59
- package/dist/esm/components/QueryBuilder/components/Connectors/Connector.styled.d.ts +1 -4
- package/dist/esm/components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.styled.d.ts +1 -4
- package/dist/esm/components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNodeUIWrapper.styled.d.ts +3 -10
- package/dist/esm/components/QueryBuilder/components/QueryBuilderNodes.styled.d.ts +2 -7
- package/dist/esm/components/TablePagination/TablePagination.styled.d.ts +3 -8
- package/dist/esm/components/TablePagination/TablePaginationCard.d.ts +2 -4
- package/dist/esm/components/TypographyStyle.d.ts +62 -141
- package/dist/esm/components/WhatsAppTextEditor/AIRephrase.styled.d.ts +2 -5
- package/dist/esm/components/WhatsAppTextEditor/CustomEditor.styled.d.ts +7 -20
- package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditorHeader.d.ts +1 -3
- package/dist/esm/components/access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.styles.d.ts +9 -26
- package/dist/esm/components/accordion/Accordion.style.d.ts +4 -10
- package/dist/esm/components/action-button/ActionButton.styled.d.ts +2 -5
- package/dist/esm/components/adbanner/Banner.styled.d.ts +20 -88
- package/dist/esm/components/add-variableV2/AddVariableBox.styled.d.ts +1 -4
- package/dist/esm/components/add-variableV2/AddVariableV2.styled.d.ts +4 -9
- package/dist/esm/components/agent-builder/AgentBuilder.styled.d.ts +186 -328
- package/dist/esm/components/agent-listing/AgentListing.styled.d.ts +49 -88
- package/dist/esm/components/alerts/Alert.styled.d.ts +5 -11
- package/dist/esm/components/analytics-card/AnalyticsCard.styled.d.ts +4 -8
- package/dist/esm/components/analytics-chips-and-dropdowns/CommonStyles.d.ts +18 -27
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/ComparisonBarChart/ComparisonBarChart.styled.d.ts +11 -26
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.styled.d.ts +11 -26
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.styles.d.ts +2 -5
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.styled.d.ts +5 -12
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.styles.d.ts +3 -8
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.styles.d.ts +6 -17
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.styles.d.ts +2 -5
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapStyled.d.ts +11 -28
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.d.ts +1 -3
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.styled.d.ts +7 -18
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/scoreBlock/ScoreBlock.styled.d.ts +7 -18
- package/dist/esm/components/avatar/Avatar.styled.d.ts +2 -4
- package/dist/esm/components/bik-chatbot/components/ChatWindow.d.ts +2 -4
- package/dist/esm/components/bik-layout/BikSidebarV2/SidebarV2Styles.d.ts +18 -49
- package/dist/esm/components/bik-layout/CommonStyles.d.ts +28 -88
- package/dist/esm/components/bik-layout/SidebarStyles.d.ts +7 -17
- package/dist/esm/components/button/Button.styled.d.ts +2 -4
- package/dist/esm/components/button/themes.d.ts +2 -16
- package/dist/esm/components/buttonGroup/ButtonGroupStyle.d.ts +4 -9
- package/dist/esm/components/card-selection-modal/CardSelectionModal.styled.d.ts +2 -7
- package/dist/esm/components/card-selector/CardSelector.styled.d.ts +3 -8
- package/dist/esm/components/carousel-preview/CarouselPreview.style.d.ts +4 -9
- package/dist/esm/components/carousel-secondary/CarouselSecondary.style.d.ts +11 -23
- package/dist/esm/components/channel-playground/shell/TestingPlayground.style.d.ts +18 -74
- package/dist/esm/components/checkBox/CheckBox.styled.d.ts +4 -9
- package/dist/esm/components/checkList/CheckList.styled.d.ts +1 -4
- package/dist/esm/components/code-block/CodeBlock.styled.d.ts +20 -43
- package/dist/esm/components/colourInput/ColourInput.styled.d.ts +2 -7
- package/dist/esm/components/connected-app-dialog/ConnectedAppDialog.styled.d.ts +16 -49
- package/dist/esm/components/country-code-picker/CountryCodePicker.styled.d.ts +3 -8
- package/dist/esm/components/country-code-picker/CountryPicker.styled.d.ts +3 -8
- package/dist/esm/components/curtain/Curtain.styled.d.ts +5 -11
- package/dist/esm/components/custom-date-time/CustomDateTime.styled.d.ts +1 -4
- package/dist/esm/components/dashboard-review-popup/DashboardReviewPopUp.styled.d.ts +2 -7
- package/dist/esm/components/dashboard-review-popup/components/FiveStar.styled.d.ts +2 -7
- package/dist/esm/components/dashboard-review-popup/components/Form.styled.d.ts +7 -20
- package/dist/esm/components/data-source-panel/DataSourcePanel.style.d.ts +4 -13
- package/dist/esm/components/datePicker/DatePicker.styled.d.ts +15 -22
- package/dist/esm/components/datePicker/DatePickerWrapper.styled.d.ts +4 -8
- package/dist/esm/components/discount-modal/DiscountModal.styled.d.ts +6 -17
- package/dist/esm/components/discount-modal/DynamicCoupon/DynamicCoupon.styled.d.ts +8 -23
- package/dist/esm/components/dropdown/ChipDropdown.d.ts +2 -4
- package/dist/esm/components/dropdown/Common.styled.d.ts +6 -15
- package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +74 -68
- package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js.map +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.d.ts +5 -12
- package/dist/esm/components/dropdown/OpenedDropdown/components/description/Description.styled.d.ts +2 -5
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.d.ts +1 -4
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.d.ts +9 -0
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +157 -123
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.d.ts +2 -0
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.js +145 -104
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.js.map +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.d.ts +4 -18
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js +36 -29
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js.map +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.d.ts +1 -0
- package/dist/esm/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.js +39 -30
- package/dist/esm/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.js.map +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.d.ts +1 -4
- package/dist/esm/components/dropdown/OpenedDropdown/utils/iterationOnOptions.d.ts +3 -16
- package/dist/esm/components/dropdown/OpenedDropdown/utils/iterationOnOptions.js +41 -24
- package/dist/esm/components/dropdown/OpenedDropdown/utils/iterationOnOptions.js.map +1 -1
- package/dist/esm/components/dropdown/hooks/useDropdown.d.ts +3 -16
- package/dist/esm/components/dropdown/hooks/useDropdown.js +159 -149
- package/dist/esm/components/dropdown/hooks/useDropdown.js.map +1 -1
- package/dist/esm/components/dropdown/type.d.ts +17 -0
- package/dist/esm/components/dropdown-button/DropdownButton.style.d.ts +5 -9
- package/dist/esm/components/dual-icon-button/DualIconButton.styled.d.ts +5 -12
- package/dist/esm/components/file-uploader/FileUploaderStyle.d.ts +4 -9
- package/dist/esm/components/floating-action-button/FloatingActionButton.styles.d.ts +13 -24
- package/dist/esm/components/half-doughnut-chart/HalfDoughnutChart.styled.d.ts +10 -29
- package/dist/esm/components/icon-button/IconButton.styled.d.ts +2 -4
- package/dist/esm/components/input/Input.styled.d.ts +29 -114
- package/dist/esm/components/keywords-input/KeywordsInput.styled.d.ts +1 -4
- package/dist/esm/components/list-item/ListItem.styled.d.ts +2 -4
- package/dist/esm/components/list-item/themes.d.ts +1 -1
- package/dist/esm/components/modals/modal.styled.d.ts +7 -16
- package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.styled.d.ts +22 -60
- package/dist/esm/components/navigation-hyperlink/NavigationHyperlink.d.ts +1 -3
- package/dist/esm/components/pagination/Pagination.styled.d.ts +1 -4
- package/dist/esm/components/plans/DurationSelectorStyles.d.ts +1 -4
- package/dist/esm/components/plans/SubscriptionPlanSelector.d.ts +2 -6
- package/dist/esm/components/plans/SubscriptionPlanStyled.d.ts +4 -9
- package/dist/esm/components/postPicker/PostPicker.styled.d.ts +13 -43
- package/dist/esm/components/product-picker/ProductPicker.styled.d.ts +2 -7
- package/dist/esm/components/product-picker-v2/style.d.ts +25 -82
- package/dist/esm/components/progress-bar/ProgressBarComponent.d.ts +2 -5
- package/dist/esm/components/radioButton/RadioButton.styled.d.ts +3 -8
- package/dist/esm/components/radioList/RadioList.styled.d.ts +1 -4
- package/dist/esm/components/shimmer/ShimmerComponent/ShimmerStyled.d.ts +4 -9
- package/dist/esm/components/side-modal/SideModal.style.d.ts +12 -25
- package/dist/esm/components/spinner/Spinner.d.ts +2 -4
- package/dist/esm/components/states/StateComponent.styled.d.ts +9 -20
- package/dist/esm/components/stepper/Stepper.styled.d.ts +4 -10
- package/dist/esm/components/switch/Switch.d.ts +6 -12
- package/dist/esm/components/tabs/Tabs.styles.d.ts +9 -30
- package/dist/esm/components/tag/Tag.styled.d.ts +2 -4
- package/dist/esm/components/template-context-mapper/Badge/index.d.ts +2 -5
- package/dist/esm/components/template-context-mapper/modalElements/EditMediaV2.style.d.ts +5 -14
- package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.d.ts +2 -4
- package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorsPanel.d.ts +2 -7
- package/dist/esm/components/template-context-mapper/styles/TemplateAnalyticsStyles.d.ts +6 -24
- package/dist/esm/components/template-context-mapper/utils/TemplateConstants.d.ts +8 -16
- package/dist/esm/components/template-preview/EmailTemplatePreview.styled.d.ts +10 -23
- package/dist/esm/components/template-preview/RCS/RCSPreview.styled.d.ts +20 -70
- package/dist/esm/components/template-preview/SMS/SMSBubble.d.ts +2 -7
- package/dist/esm/components/template-preview/SmsTemplatePreview.styled.d.ts +10 -27
- package/dist/esm/components/template-preview/TemplatePreview.styled.d.ts +1 -4
- package/dist/esm/components/template-preview/WhatsApp/ChatHeader.style.d.ts +5 -16
- package/dist/esm/components/template-preview/WhatsApp/ChatUI.style.d.ts +11 -53
- package/dist/esm/components/template-preview/WhatsApp/ChatUiV2.d.ts +1 -3
- package/dist/esm/components/template-preview/WhatsApp/LimitedTimeOffer/LimitedTimeOffer.index.d.ts +3 -9
- package/dist/esm/components/template-preview/webpush/WebpushPreview.styled.d.ts +1 -4
- package/dist/esm/components/testimonial-card/TestimonialCard.style.d.ts +11 -30
- package/dist/esm/components/thumbnail/Thumbnail.styled.d.ts +2 -4
- package/dist/esm/components/toaster/Toaster.styled.d.ts +2 -4
- package/dist/esm/components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.style.d.ts +1 -4
- package/dist/esm/components/unsatisfactory-response-list/UnsatisfactoryResponseList.style.d.ts +1 -4
- package/dist/esm/components/variable-picker-v3/styles.d.ts +6 -15
- package/dist/esm/components/vertical-full-screen-modal/styles.d.ts +6 -15
- package/dist/esm/components/whats-new/WhatsNew.styles.d.ts +7 -18
- package/dist/esm/editor/BikEditor.styles.d.ts +7 -18
- package/dist/esm/editor/extensions/editorDropdown.styles.d.ts +12 -47
- package/package.json +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelectDropdownBottomBar.js","sources":["../../../../../../../src/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.tsx"],"sourcesContent":["import React from 'react';\nimport { Button } from '@src/components/button';\nimport { BodySecondary } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport {\n\tButtonOptions,\n\tDropdownOption,\n\tGroupedOption,\n\tSingleOption,\n} from '../../../type';\nimport { BottomBarContainer } from './MultiSelectDropdownBottomBar.styled';\n\ninterface MultiSelectDropdownBottomBarProps {\n\tonClear?: () => void;\n\tonApply: () => void;\n\tlist: DropdownOption[];\n\tbuttonText?: string;\n\tbuttonOptions?: ButtonOptions;\n\thideClearButton?: boolean;\n}\nconst MultiSelectDropdownBottomBar: React.FC<\n\tMultiSelectDropdownBottomBarProps\n> = (props) => {\n\tconst {
|
|
1
|
+
{"version":3,"file":"MultiSelectDropdownBottomBar.js","sources":["../../../../../../../src/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.tsx"],"sourcesContent":["import React from 'react';\nimport { Button } from '@src/components/button';\nimport { BodySecondary } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport {\n\tButtonOptions,\n\tDropdownOption,\n\tGroupedOption,\n\tSingleOption,\n} from '../../../type';\nimport { BottomBarContainer } from './MultiSelectDropdownBottomBar.styled';\n\ninterface MultiSelectDropdownBottomBarProps {\n\tonClear?: () => void;\n\tonApply: () => void;\n\tlist: DropdownOption[];\n\tbuttonText?: string;\n\tbuttonOptions?: ButtonOptions;\n\thideClearButton?: boolean;\n\thideSelectedCount?: boolean;\n}\nconst MultiSelectDropdownBottomBar: React.FC<\n\tMultiSelectDropdownBottomBarProps\n> = (props) => {\n\tconst {\n\t\tonClear,\n\t\tonApply,\n\t\tlist,\n\t\tbuttonText,\n\t\tbuttonOptions,\n\t\thideClearButton,\n\t\thideSelectedCount,\n\t} = props;\n\tconst {\n\t\tprimaryButtonText,\n\t\tprimaryButtonType,\n\t\tsecondaryButtonText,\n\t\tsecondaryButtonType,\n\t} = buttonOptions ?? {};\n\tconst count = list.reduce((total, option) => {\n\t\tif ((option as GroupedOption).options) {\n\t\t\tconst groupedTotal = (option as GroupedOption).options.filter(\n\t\t\t\t(op) => op.selected === true,\n\t\t\t).length;\n\t\t\treturn total + groupedTotal;\n\t\t}\n\n\t\tconst singleOption = option as SingleOption;\n\t\t// For a nested option the leaves are what the user picked, so count those\n\t\t// rather than the parent — a partly-selected group would read as zero.\n\t\tif (singleOption.children?.length) {\n\t\t\treturn (\n\t\t\t\ttotal + singleOption.children.filter((child) => child.selected).length\n\t\t\t);\n\t\t}\n\n\t\treturn singleOption.selected ? total + 1 : total;\n\t}, 0);\n\n\treturn (\n\t\t<BottomBarContainer style={{ justifyContent: 'space-between' }}>\n\t\t\t<BodySecondary style={{ flex: 1, color: COLORS.content.primary }}>\n\t\t\t\t{count && !hideSelectedCount ? `${count} selected` : ''}\n\t\t\t</BodySecondary>\n\n\t\t\t<div style={{ flexDirection: 'row', display: 'flex', gap: 12 }}>\n\t\t\t\t{!hideClearButton && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tbuttonType={secondaryButtonType || 'primary'}\n\t\t\t\t\t\tbuttonText={secondaryButtonText || 'Clear'}\n\t\t\t\t\t\tonClick={onClear}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t<Button\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\tbuttonText={primaryButtonText || buttonText || 'Apply'}\n\t\t\t\t\tbuttonType={primaryButtonType || 'primary'}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tonApply();\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</BottomBarContainer>\n\t);\n};\n\nexport default MultiSelectDropdownBottomBar;\n"],"names":["MultiSelectDropdownBottomBar","props","onClear","onApply","list","buttonText","buttonOptions","hideClearButton","hideSelectedCount","primaryButtonText","primaryButtonType","secondaryButtonText","secondaryButtonType","count","total","option","groupedTotal","op","singleOption","child","BottomBarContainer","jsx","BodySecondary","COLORS","jsxs","Button"],"mappings":";;;;;AAqBA,MAAMA,IAEF,CAACC,MAAU;AACd,QAAM;AAAA,IACL,SAAAC;AAAA,IACA,SAAAC;AAAA,IACA,MAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,mBAAAC;AAAA,EAAA,IACGP,GACE;AAAA,IACL,mBAAAQ;AAAA,IACA,mBAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,qBAAAC;AAAA,EAAA,IACGN,KAAiB,CAAA,GACfO,IAAQT,EAAK,OAAO,CAACU,GAAOC,MAAW;AAC5C,QAAKA,EAAyB,SAAS;AACtC,YAAMC,IAAgBD,EAAyB,QAAQ;AAAA,QACtD,CAACE,MAAOA,EAAG,aAAa;AAAA,MAAA,EACvB;AACF,aAAOH,IAAQE;AAAA,IAChB;AAEA,UAAME,IAAeH;AAGrB,WAAIG,EAAa,UAAU,SAEzBJ,IAAQI,EAAa,SAAS,OAAO,CAACC,MAAUA,EAAM,QAAQ,EAAE,SAI3DD,EAAa,WAAWJ,IAAQ,IAAIA;AAAA,EAC5C,GAAG,CAAC;AAEJ,2BACEM,GAAA,EAAmB,OAAO,EAAE,gBAAgB,mBAC5C,UAAA;AAAA,IAAA,gBAAAC,EAACC,KAAc,OAAO,EAAE,MAAM,GAAG,OAAOC,EAAO,QAAQ,QAAA,GACrD,eAAS,CAACf,IAAoB,GAAGK,CAAK,cAAc,IACtD;AAAA,IAEA,gBAAAW,EAAC,OAAA,EAAI,OAAO,EAAE,eAAe,OAAO,SAAS,QAAQ,KAAK,GAAA,GACxD,UAAA;AAAA,MAAA,CAACjB,KACD,gBAAAc;AAAA,QAACI;AAAA,QAAA;AAAA,UACA,MAAK;AAAA,UACL,YAAYb,KAAuB;AAAA,UACnC,YAAYD,KAAuB;AAAA,UACnC,SAAST;AAAA,QAAA;AAAA,MAAA;AAAA,MAGX,gBAAAmB;AAAA,QAACI;AAAA,QAAA;AAAA,UACA,MAAK;AAAA,UACL,YAAYhB,KAAqBJ,KAAc;AAAA,UAC/C,YAAYK,KAAqB;AAAA,UACjC,SAAS,MAAM;AACd,YAAAP,EAAA;AAAA,UACD;AAAA,QAAA;AAAA,MAAA;AAAA,IACD,EAAA,CACD;AAAA,EAAA,GACD;AAEF;"}
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const BottomBarContainer: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
3
|
-
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
4
|
-
}> & string;
|
|
1
|
+
export declare const BottomBarContainer: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DropdownOption, SingleOption } from '../../type';
|
|
2
|
-
export declare function iterateOnOptions(options: DropdownOption[], newVal: Partial<SingleOption>, checkCB?: (optionForValidation: SingleOption) => boolean): ({
|
|
2
|
+
export declare function iterateOnOptions(options: DropdownOption[], newVal: Partial<SingleOption>, checkCB?: (optionForValidation: SingleOption) => boolean): (SingleOption | {
|
|
3
|
+
options: SingleOption[];
|
|
3
4
|
label: string;
|
|
4
5
|
value: string;
|
|
5
6
|
description?: string | null | undefined;
|
|
@@ -17,23 +18,9 @@ export declare function iterateOnOptions(options: DropdownOption[], newVal: Part
|
|
|
17
18
|
'data-test'?: string | undefined;
|
|
18
19
|
hasDivider?: boolean | undefined;
|
|
19
20
|
} | {
|
|
21
|
+
options: SingleOption[];
|
|
20
22
|
label?: string | undefined;
|
|
21
|
-
value?: string | undefined;
|
|
22
|
-
description?: string | null | undefined;
|
|
23
|
-
selected?: boolean | undefined;
|
|
24
|
-
disabled?: boolean | undefined;
|
|
25
|
-
isFreeForm?: boolean | undefined;
|
|
26
|
-
subText?: string | undefined;
|
|
27
|
-
trailingIcon?: JSX.Element | undefined;
|
|
28
23
|
leadingIcon?: JSX.Element | undefined;
|
|
29
|
-
customComponent?: JSX.Element | undefined;
|
|
30
|
-
searchKey?: string | undefined;
|
|
31
|
-
selectedLabel?: string | undefined;
|
|
32
|
-
children?: SingleOption[] | undefined;
|
|
33
|
-
parent?: SingleOption | undefined;
|
|
34
|
-
'data-test'?: string | undefined;
|
|
35
|
-
hasDivider?: boolean | undefined;
|
|
36
|
-
options: SingleOption[];
|
|
37
24
|
})[];
|
|
38
25
|
export declare function iterateOnOptionsRaw(options: DropdownOption[], cb: (option: SingleOption) => void): void;
|
|
39
26
|
export declare function getSelectedOptionsAsText(selectedOption: DropdownOption[]): string | undefined;
|
|
@@ -1,36 +1,53 @@
|
|
|
1
|
-
function
|
|
2
|
-
return
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
function f(n, e) {
|
|
2
|
+
return n.children?.length ? {
|
|
3
|
+
...n,
|
|
4
|
+
...e,
|
|
5
|
+
children: n.children.map(
|
|
6
|
+
(r) => r.disabled ? { ...r } : f(r, e)
|
|
7
|
+
)
|
|
8
|
+
} : { ...n, ...e };
|
|
9
|
+
}
|
|
10
|
+
function l(n, e, r) {
|
|
11
|
+
const i = n.children.map(
|
|
12
|
+
(t) => !r || r(t) ? f(t, e) : t.children?.length ? l(t, e, r) : { ...t }
|
|
13
|
+
);
|
|
14
|
+
return {
|
|
15
|
+
...n,
|
|
16
|
+
children: i,
|
|
17
|
+
selected: i.every((t) => t.selected)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function d(n, e, r) {
|
|
21
|
+
return n.map((t) => {
|
|
22
|
+
if (t.options) {
|
|
23
|
+
const a = t.options.map((s) => !r || r(s) ? f(s, e) : s.children?.length ? l(s, e, r) : { ...s });
|
|
8
24
|
return {
|
|
9
|
-
...
|
|
10
|
-
options: [...
|
|
25
|
+
...t,
|
|
26
|
+
options: [...a]
|
|
11
27
|
};
|
|
12
28
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
...r
|
|
16
|
-
} : { ...e };
|
|
29
|
+
const u = t;
|
|
30
|
+
return !r || r(u) ? f(u, e) : u.children?.length ? l(u, e, r) : { ...t };
|
|
17
31
|
});
|
|
18
32
|
}
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
33
|
+
function o(n, e) {
|
|
34
|
+
const r = (i) => {
|
|
35
|
+
e(i), i.children?.forEach(r);
|
|
36
|
+
};
|
|
37
|
+
n.forEach((i) => {
|
|
38
|
+
i.options ? i.options.forEach(r) : r(i);
|
|
22
39
|
});
|
|
23
40
|
}
|
|
24
|
-
function
|
|
25
|
-
if (!(!
|
|
26
|
-
return
|
|
27
|
-
const
|
|
28
|
-
return
|
|
41
|
+
function g(n) {
|
|
42
|
+
if (!(!n || !n.length))
|
|
43
|
+
return n.map((e) => {
|
|
44
|
+
const r = e;
|
|
45
|
+
return r.selectedLabel ?? r.label;
|
|
29
46
|
}).join(", ");
|
|
30
47
|
}
|
|
31
48
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
49
|
+
g as getSelectedOptionsAsText,
|
|
50
|
+
d as iterateOnOptions,
|
|
51
|
+
o as iterateOnOptionsRaw
|
|
35
52
|
};
|
|
36
53
|
//# sourceMappingURL=iterationOnOptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iterationOnOptions.js","sources":["../../../../../../src/components/dropdown/OpenedDropdown/utils/iterationOnOptions.ts"],"sourcesContent":["import { DropdownOption, GroupedOption, SingleOption } from '../../type';\n\nexport function iterateOnOptions(\n\toptions: DropdownOption[],\n\tnewVal: Partial<SingleOption>,\n\tcheckCB?: (optionForValidation: SingleOption) => boolean,\n) {\n\tconst newOptions = options.map((option) => {\n\t\tif ((option as GroupedOption).options) {\n\t\t\tconst groupedOptions = (option as GroupedOption).options.map((op) => {\n\t\t\t\tif (!checkCB || checkCB(op)) {\n\t\t\t\t\treturn
|
|
1
|
+
{"version":3,"file":"iterationOnOptions.js","sources":["../../../../../../src/components/dropdown/OpenedDropdown/utils/iterationOnOptions.ts"],"sourcesContent":["import { DropdownOption, GroupedOption, SingleOption } from '../../type';\n\n/** Applies newVal to an option and, for a nested option, to its whole subtree. */\nfunction applyToSubtree(\n\toption: SingleOption,\n\tnewVal: Partial<SingleOption>,\n): SingleOption {\n\tif (!option.children?.length) {\n\t\treturn { ...option, ...newVal };\n\t}\n\n\treturn {\n\t\t...option,\n\t\t...newVal,\n\t\tchildren: option.children.map((child) =>\n\t\t\tchild.disabled ? { ...child } : applyToSubtree(child, newVal),\n\t\t),\n\t};\n}\n\n/**\n * Walks a nested option: descends into its children, then re-derives the\n * parent's own `selected` from them so a parent reads as selected only when\n * every child is. Keeps selection counts and Select All honest.\n */\nfunction walkChildren(\n\toption: SingleOption,\n\tnewVal: Partial<SingleOption>,\n\tcheckCB?: (optionForValidation: SingleOption) => boolean,\n): SingleOption {\n\tconst children = option.children!.map((child) =>\n\t\t!checkCB || checkCB(child)\n\t\t\t? applyToSubtree(child, newVal)\n\t\t\t: child.children?.length\n\t\t\t? walkChildren(child, newVal, checkCB)\n\t\t\t: { ...child },\n\t);\n\n\treturn {\n\t\t...option,\n\t\tchildren,\n\t\tselected: children.every((child) => child.selected),\n\t};\n}\n\nexport function iterateOnOptions(\n\toptions: DropdownOption[],\n\tnewVal: Partial<SingleOption>,\n\tcheckCB?: (optionForValidation: SingleOption) => boolean,\n) {\n\tconst newOptions = options.map((option) => {\n\t\tif ((option as GroupedOption).options) {\n\t\t\tconst groupedOptions = (option as GroupedOption).options.map((op) => {\n\t\t\t\tif (!checkCB || checkCB(op)) {\n\t\t\t\t\treturn applyToSubtree(op, newVal);\n\t\t\t\t}\n\n\t\t\t\tif (op.children?.length) {\n\t\t\t\t\treturn walkChildren(op, newVal, checkCB);\n\t\t\t\t}\n\n\t\t\t\treturn { ...op };\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\t...option,\n\t\t\t\toptions: [...groupedOptions],\n\t\t\t};\n\t\t}\n\n\t\tconst singleOption = option as SingleOption;\n\n\t\tif (!checkCB || checkCB(singleOption)) {\n\t\t\treturn applyToSubtree(singleOption, newVal);\n\t\t}\n\n\t\tif (singleOption.children?.length) {\n\t\t\treturn walkChildren(singleOption, newVal, checkCB);\n\t\t}\n\n\t\treturn { ...option };\n\t});\n\n\treturn newOptions;\n}\n\nexport function iterateOnOptionsRaw(\n\toptions: DropdownOption[],\n\tcb: (option: SingleOption) => void,\n) {\n\tconst visit = (option: SingleOption) => {\n\t\tcb(option);\n\t\toption.children?.forEach(visit);\n\t};\n\n\toptions.forEach((option) => {\n\t\tif ((option as GroupedOption).options) {\n\t\t\t(option as GroupedOption).options.forEach(visit);\n\t\t} else {\n\t\t\tvisit(option as SingleOption);\n\t\t}\n\t});\n}\n\nexport function getSelectedOptionsAsText(selectedOption: DropdownOption[]) {\n\tif (!selectedOption || !selectedOption.length) return undefined;\n\treturn selectedOption\n\t\t.map((option) => {\n\t\t\tconst op = option as SingleOption;\n\t\t\treturn op.selectedLabel ?? op.label;\n\t\t})\n\t\t.join(', ');\n}\n\n// get selected options as array of string\nexport function getSelectedOptionsAsArray(selectedOption: DropdownOption[]) {\n\tif (!selectedOption || !selectedOption.length) return [];\n\treturn selectedOption.map((option) => {\n\t\tconst op = option as SingleOption;\n\t\treturn op.selectedLabel ?? op.label;\n\t});\n}\n"],"names":["applyToSubtree","option","newVal","child","walkChildren","checkCB","children","iterateOnOptions","options","groupedOptions","op","singleOption","iterateOnOptionsRaw","cb","visit","getSelectedOptionsAsText","selectedOption"],"mappings":"AAGA,SAASA,EACRC,GACAC,GACe;AACf,SAAKD,EAAO,UAAU,SAIf;AAAA,IACN,GAAGA;AAAA,IACH,GAAGC;AAAA,IACH,UAAUD,EAAO,SAAS;AAAA,MAAI,CAACE,MAC9BA,EAAM,WAAW,EAAE,GAAGA,MAAUH,EAAeG,GAAOD,CAAM;AAAA,IAAA;AAAA,EAC7D,IARO,EAAE,GAAGD,GAAQ,GAAGC,EAAA;AAUzB;AAOA,SAASE,EACRH,GACAC,GACAG,GACe;AACf,QAAMC,IAAWL,EAAO,SAAU;AAAA,IAAI,CAACE,MACtC,CAACE,KAAWA,EAAQF,CAAK,IACtBH,EAAeG,GAAOD,CAAM,IAC5BC,EAAM,UAAU,SAChBC,EAAaD,GAAOD,GAAQG,CAAO,IACnC,EAAE,GAAGF,EAAA;AAAA,EAAM;AAGf,SAAO;AAAA,IACN,GAAGF;AAAA,IACH,UAAAK;AAAA,IACA,UAAUA,EAAS,MAAM,CAACH,MAAUA,EAAM,QAAQ;AAAA,EAAA;AAEpD;AAEO,SAASI,EACfC,GACAN,GACAG,GACC;AAkCD,SAjCmBG,EAAQ,IAAI,CAACP,MAAW;AAC1C,QAAKA,EAAyB,SAAS;AACtC,YAAMQ,IAAkBR,EAAyB,QAAQ,IAAI,CAACS,MACzD,CAACL,KAAWA,EAAQK,CAAE,IAClBV,EAAeU,GAAIR,CAAM,IAG7BQ,EAAG,UAAU,SACTN,EAAaM,GAAIR,GAAQG,CAAO,IAGjC,EAAE,GAAGK,EAAA,CACZ;AAED,aAAO;AAAA,QACN,GAAGT;AAAA,QACH,SAAS,CAAC,GAAGQ,CAAc;AAAA,MAAA;AAAA,IAE7B;AAEA,UAAME,IAAeV;AAErB,WAAI,CAACI,KAAWA,EAAQM,CAAY,IAC5BX,EAAeW,GAAcT,CAAM,IAGvCS,EAAa,UAAU,SACnBP,EAAaO,GAAcT,GAAQG,CAAO,IAG3C,EAAE,GAAGJ,EAAA;AAAA,EACb,CAAC;AAGF;AAEO,SAASW,EACfJ,GACAK,GACC;AACD,QAAMC,IAAQ,CAACb,MAAyB;AACvC,IAAAY,EAAGZ,CAAM,GACTA,EAAO,UAAU,QAAQa,CAAK;AAAA,EAC/B;AAEA,EAAAN,EAAQ,QAAQ,CAACP,MAAW;AAC3B,IAAKA,EAAyB,UAC5BA,EAAyB,QAAQ,QAAQa,CAAK,IAE/CA,EAAMb,CAAsB;AAAA,EAE9B,CAAC;AACF;AAEO,SAASc,EAAyBC,GAAkC;AAC1E,MAAI,GAACA,KAAkB,CAACA,EAAe;AACvC,WAAOA,EACL,IAAI,CAACf,MAAW;AAChB,YAAMS,IAAKT;AACX,aAAOS,EAAG,iBAAiBA,EAAG;AAAA,IAC/B,CAAC,EACA,KAAK,IAAI;AACZ;"}
|
|
@@ -8,7 +8,8 @@ export declare const useDropdown: (version: string | undefined, options: Dropdow
|
|
|
8
8
|
searchedOptions: DropdownOption[];
|
|
9
9
|
searchError: string | undefined;
|
|
10
10
|
retrySearch: () => void;
|
|
11
|
-
onApplyHandler: (optionSelect: SingleOption, returnOnly?: boolean) => ({
|
|
11
|
+
onApplyHandler: (optionSelect: SingleOption, returnOnly?: boolean) => (SingleOption | {
|
|
12
|
+
options: SingleOption[];
|
|
12
13
|
label: string;
|
|
13
14
|
value: string;
|
|
14
15
|
description?: string | null | undefined;
|
|
@@ -26,23 +27,9 @@ export declare const useDropdown: (version: string | undefined, options: Dropdow
|
|
|
26
27
|
'data-test'?: string | undefined;
|
|
27
28
|
hasDivider?: boolean | undefined;
|
|
28
29
|
} | {
|
|
30
|
+
options: SingleOption[];
|
|
29
31
|
label?: string | undefined;
|
|
30
|
-
value?: string | undefined;
|
|
31
|
-
description?: string | null | undefined;
|
|
32
|
-
selected?: boolean | undefined;
|
|
33
|
-
disabled?: boolean | undefined;
|
|
34
|
-
isFreeForm?: boolean | undefined;
|
|
35
|
-
subText?: string | undefined;
|
|
36
|
-
trailingIcon?: JSX.Element | undefined;
|
|
37
32
|
leadingIcon?: JSX.Element | undefined;
|
|
38
|
-
customComponent?: JSX.Element | undefined;
|
|
39
|
-
searchKey?: string | undefined;
|
|
40
|
-
selectedLabel?: string | undefined;
|
|
41
|
-
children?: SingleOption[] | undefined;
|
|
42
|
-
parent?: SingleOption | undefined;
|
|
43
|
-
'data-test'?: string | undefined;
|
|
44
|
-
hasDivider?: boolean | undefined;
|
|
45
|
-
options: SingleOption[];
|
|
46
33
|
})[] | undefined;
|
|
47
34
|
selectAllHandler: (newState: SelectAllCheckboxState) => void;
|
|
48
35
|
onMultiSelectClear: () => void;
|
|
@@ -1,105 +1,115 @@
|
|
|
1
1
|
import X from "lodash/debounce";
|
|
2
2
|
import { useState as E, useRef as j, useEffect as A, useCallback as Y, useMemo as Z } from "react";
|
|
3
|
-
import { iterateOnOptionsRaw as _, iterateOnOptions as
|
|
4
|
-
const S = (h = "1.0", b, y, I,
|
|
5
|
-
const [
|
|
3
|
+
import { iterateOnOptionsRaw as _, iterateOnOptions as g } from "../OpenedDropdown/utils/iterationOnOptions.js";
|
|
4
|
+
const S = (h = "1.0", b, y, I, O, v, k, q = [], i) => {
|
|
5
|
+
const [f, d] = E(b ?? []), [p, w] = E([]), [n, z] = E(""), [B, m] = E(void 0), C = j(f), P = j(v);
|
|
6
6
|
A(() => {
|
|
7
|
-
P.current =
|
|
8
|
-
}, [
|
|
9
|
-
if (C.current =
|
|
10
|
-
let
|
|
11
|
-
const
|
|
7
|
+
P.current = v;
|
|
8
|
+
}, [v]), A(() => {
|
|
9
|
+
if (C.current = f, p.length && n && v) {
|
|
10
|
+
let r = [...p];
|
|
11
|
+
const s = f.map((e) => {
|
|
12
12
|
if (e.options)
|
|
13
13
|
return e.options.map((l) => ({
|
|
14
14
|
value: l.value,
|
|
15
15
|
selected: l.selected
|
|
16
16
|
}));
|
|
17
|
-
const
|
|
17
|
+
const t = e;
|
|
18
18
|
return {
|
|
19
|
-
value:
|
|
20
|
-
selected:
|
|
19
|
+
value: t.value,
|
|
20
|
+
selected: t.selected
|
|
21
21
|
};
|
|
22
22
|
}).flat();
|
|
23
|
-
|
|
24
|
-
const
|
|
23
|
+
r = r.map((e) => {
|
|
24
|
+
const t = s.find(
|
|
25
25
|
(l) => e.value === l.value
|
|
26
26
|
);
|
|
27
|
-
return
|
|
27
|
+
return t ? {
|
|
28
28
|
...e,
|
|
29
|
-
selected:
|
|
29
|
+
selected: t.selected
|
|
30
30
|
} : e;
|
|
31
|
-
}), k && (
|
|
31
|
+
}), k && (r = r.map((e) => ({
|
|
32
32
|
...e,
|
|
33
33
|
disabled: !q.includes(e.value)
|
|
34
|
-
}))),
|
|
35
|
-
...
|
|
34
|
+
}))), w(O && !I ? [
|
|
35
|
+
...r.sort(
|
|
36
36
|
(e) => e.selected ? -1 : 1
|
|
37
37
|
)
|
|
38
|
-
] : [...
|
|
38
|
+
] : [...r]);
|
|
39
39
|
}
|
|
40
|
-
}, [
|
|
40
|
+
}, [f]), A(() => {
|
|
41
41
|
if (b) {
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
...
|
|
45
|
-
(
|
|
42
|
+
const r = [...b];
|
|
43
|
+
d(O && !I ? [
|
|
44
|
+
...r.sort(
|
|
45
|
+
(s) => s.selected ? -1 : 1
|
|
46
46
|
)
|
|
47
|
-
] : [...
|
|
47
|
+
] : [...r]);
|
|
48
48
|
}
|
|
49
49
|
}, [b]);
|
|
50
|
-
const H = (
|
|
51
|
-
const
|
|
52
|
-
return
|
|
50
|
+
const H = (r) => {
|
|
51
|
+
const s = [];
|
|
52
|
+
return r.forEach((e) => {
|
|
53
53
|
if (e.options) {
|
|
54
|
-
const
|
|
54
|
+
const t = e.options.filter(
|
|
55
55
|
(l) => l.selected === !0
|
|
56
56
|
);
|
|
57
|
-
|
|
57
|
+
s.push({
|
|
58
58
|
...e,
|
|
59
|
-
options: [...
|
|
59
|
+
options: [...t]
|
|
60
60
|
});
|
|
61
|
-
} else
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
61
|
+
} else {
|
|
62
|
+
const t = e;
|
|
63
|
+
if (t.children?.length) {
|
|
64
|
+
const l = t.children.filter(
|
|
65
|
+
(c) => c.selected
|
|
66
|
+
);
|
|
67
|
+
l.length && s.push({
|
|
68
|
+
...t,
|
|
69
|
+
children: l
|
|
70
|
+
});
|
|
71
|
+
} else t.selected && s.push({ ...e });
|
|
72
|
+
}
|
|
73
|
+
}), s;
|
|
74
|
+
}, L = (r) => {
|
|
75
|
+
let s = 0;
|
|
76
|
+
return r.forEach((e) => {
|
|
77
|
+
e.options ? s += e.options.filter(
|
|
78
|
+
(t) => t.selected === !0
|
|
79
|
+
).length : e.selected && s++;
|
|
80
|
+
}), s;
|
|
81
|
+
}, D = (r) => !O || !i && i !== 0 ? !1 : L(r) >= i, R = Y(async (r) => {
|
|
82
|
+
const s = P.current;
|
|
83
|
+
if (!r || !s) return;
|
|
74
84
|
const e = [];
|
|
75
|
-
_(C.current, (
|
|
76
|
-
|
|
85
|
+
_(C.current, (t) => {
|
|
86
|
+
t.selected && !e.includes(t.value) && e.push(t.value);
|
|
77
87
|
});
|
|
78
88
|
try {
|
|
79
|
-
const
|
|
80
|
-
if (m(void 0),
|
|
81
|
-
const l =
|
|
82
|
-
if (
|
|
83
|
-
const
|
|
89
|
+
const t = await s(r);
|
|
90
|
+
if (m(void 0), t) {
|
|
91
|
+
const l = t.map((c) => {
|
|
92
|
+
if (c.options) {
|
|
93
|
+
const a = c;
|
|
84
94
|
return {
|
|
85
|
-
...
|
|
86
|
-
options:
|
|
95
|
+
...a,
|
|
96
|
+
options: a.options.map((u) => ({
|
|
87
97
|
...u,
|
|
88
98
|
selected: e.includes(u.value)
|
|
89
99
|
}))
|
|
90
100
|
};
|
|
91
101
|
}
|
|
92
102
|
return {
|
|
93
|
-
...
|
|
94
|
-
selected: e.includes(
|
|
103
|
+
...c,
|
|
104
|
+
selected: e.includes(c.value)
|
|
95
105
|
};
|
|
96
106
|
});
|
|
97
|
-
|
|
107
|
+
w([...l]);
|
|
98
108
|
} else
|
|
99
|
-
|
|
100
|
-
} catch (
|
|
101
|
-
|
|
102
|
-
|
|
109
|
+
w([]);
|
|
110
|
+
} catch (t) {
|
|
111
|
+
w([]), m(
|
|
112
|
+
t instanceof Error ? t.message : "Something went wrong while fetching the list. Please try again"
|
|
103
113
|
);
|
|
104
114
|
}
|
|
105
115
|
}, []), F = Z(
|
|
@@ -107,135 +117,135 @@ const S = (h = "1.0", b, y, I, g, w, k, q = [], a) => {
|
|
|
107
117
|
[R]
|
|
108
118
|
);
|
|
109
119
|
A(() => () => F?.cancel(), [F]);
|
|
110
|
-
function G(
|
|
111
|
-
if (z(
|
|
120
|
+
function G(r) {
|
|
121
|
+
if (z(r), w([]), m(void 0), !r) {
|
|
112
122
|
F?.cancel();
|
|
113
123
|
return;
|
|
114
124
|
}
|
|
115
|
-
F(
|
|
125
|
+
F(r);
|
|
116
126
|
}
|
|
117
127
|
function J() {
|
|
118
128
|
n && (m(void 0), R(n));
|
|
119
129
|
}
|
|
120
|
-
function T(
|
|
121
|
-
if (!
|
|
122
|
-
y?.(
|
|
130
|
+
function T(r, s) {
|
|
131
|
+
if (!O)
|
|
132
|
+
y?.(r);
|
|
123
133
|
else {
|
|
124
|
-
if (
|
|
134
|
+
if (r.selected && i && D(f))
|
|
125
135
|
return;
|
|
126
|
-
if (
|
|
127
|
-
if (
|
|
128
|
-
if (
|
|
136
|
+
if (p.length && n && v)
|
|
137
|
+
if (r.selected) {
|
|
138
|
+
if (i && D(f))
|
|
129
139
|
return;
|
|
130
140
|
let e = !1;
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
{ selected:
|
|
134
|
-
(l) => l.value ===
|
|
141
|
+
const t = g(
|
|
142
|
+
f,
|
|
143
|
+
{ selected: r.selected },
|
|
144
|
+
(l) => l.value === r.value ? (e = !0, !0) : !1
|
|
135
145
|
);
|
|
136
|
-
if (e ||
|
|
137
|
-
return [...
|
|
138
|
-
|
|
146
|
+
if (e || t.push(r), s)
|
|
147
|
+
return [...t];
|
|
148
|
+
d([...t]), h === "2.0" && o(t);
|
|
139
149
|
} else {
|
|
140
|
-
let e = !1,
|
|
141
|
-
|
|
142
|
-
{ selected:
|
|
143
|
-
(l) => l.value ===
|
|
150
|
+
let e = !1, t = g(
|
|
151
|
+
f,
|
|
152
|
+
{ selected: r.selected },
|
|
153
|
+
(l) => l.value === r.value ? (e = !0, !0) : !1
|
|
144
154
|
);
|
|
145
|
-
if (e && (
|
|
146
|
-
return [...
|
|
147
|
-
|
|
155
|
+
if (e && (t = t.filter((l) => l.value !== r.value)), s)
|
|
156
|
+
return [...t];
|
|
157
|
+
d([...t]), h === "2.0" && o(t);
|
|
148
158
|
}
|
|
149
159
|
else {
|
|
150
|
-
const e =
|
|
151
|
-
|
|
152
|
-
{ selected:
|
|
153
|
-
(
|
|
160
|
+
const e = g(
|
|
161
|
+
f,
|
|
162
|
+
{ selected: r.selected },
|
|
163
|
+
(t) => t.value === r.value
|
|
154
164
|
);
|
|
155
|
-
if (
|
|
165
|
+
if (s)
|
|
156
166
|
return [...e];
|
|
157
|
-
|
|
167
|
+
d([...e]), h === "2.0" && o(e);
|
|
158
168
|
}
|
|
159
169
|
}
|
|
160
170
|
}
|
|
161
|
-
function M(
|
|
162
|
-
let
|
|
163
|
-
|
|
164
|
-
|
|
171
|
+
function M(r) {
|
|
172
|
+
let s = [...f];
|
|
173
|
+
p.forEach((e) => {
|
|
174
|
+
s = s.map((t) => {
|
|
165
175
|
const l = e;
|
|
166
|
-
return typeof l.value < "u" && l.value ===
|
|
167
|
-
...
|
|
176
|
+
return typeof l.value < "u" && l.value === t.value ? {
|
|
177
|
+
...t,
|
|
168
178
|
selected: !1
|
|
169
|
-
} :
|
|
179
|
+
} : t;
|
|
170
180
|
});
|
|
171
|
-
}),
|
|
181
|
+
}), d([...s]), h === "2.0" && o(s);
|
|
172
182
|
}
|
|
173
|
-
function N(
|
|
174
|
-
let
|
|
175
|
-
if (
|
|
176
|
-
const e = L(
|
|
177
|
-
if (
|
|
183
|
+
function N(r) {
|
|
184
|
+
let s = [...f];
|
|
185
|
+
if (i && i > 0) {
|
|
186
|
+
const e = L(s), t = i - e;
|
|
187
|
+
if (t <= 0)
|
|
178
188
|
return;
|
|
179
189
|
let l = 0;
|
|
180
|
-
|
|
181
|
-
if (l >=
|
|
190
|
+
p.forEach((c) => {
|
|
191
|
+
if (l >= t)
|
|
182
192
|
return;
|
|
183
|
-
let
|
|
184
|
-
|
|
185
|
-
const W =
|
|
186
|
-
return u.selected || u.disabled ? u : typeof W.value < "u" && W.value === u.value ? (
|
|
193
|
+
let a = !1;
|
|
194
|
+
s = s.map((u) => {
|
|
195
|
+
const W = c;
|
|
196
|
+
return u.selected || u.disabled ? u : typeof W.value < "u" && W.value === u.value ? (a = !0, l++, {
|
|
187
197
|
...u,
|
|
188
198
|
selected: !0
|
|
189
199
|
}) : u;
|
|
190
|
-
}), !
|
|
191
|
-
}),
|
|
200
|
+
}), !a && l < t && (c.disabled || (s.push({ ...c, selected: !0 }), l++));
|
|
201
|
+
}), d([...s]), h === "2.0" && o(s);
|
|
192
202
|
}
|
|
193
203
|
}
|
|
194
|
-
function Q(
|
|
195
|
-
if (
|
|
196
|
-
|
|
197
|
-
else if (
|
|
198
|
-
if (
|
|
199
|
-
const
|
|
204
|
+
function Q(r) {
|
|
205
|
+
if (p.length && n && v)
|
|
206
|
+
r === "selectAll" ? N() : M();
|
|
207
|
+
else if (r === "selectAll")
|
|
208
|
+
if (i && i > 0) {
|
|
209
|
+
const s = L(f), e = i - s;
|
|
200
210
|
if (e <= 0)
|
|
201
211
|
return;
|
|
202
|
-
let
|
|
203
|
-
const l =
|
|
204
|
-
if (
|
|
205
|
-
const
|
|
212
|
+
let t = 0;
|
|
213
|
+
const l = f.map((c) => {
|
|
214
|
+
if (c.options) {
|
|
215
|
+
const a = c;
|
|
206
216
|
return {
|
|
207
|
-
...
|
|
208
|
-
options:
|
|
217
|
+
...a,
|
|
218
|
+
options: a.options.map((u) => u.disabled || u.selected || n && !u.label?.toLowerCase().includes(n.toLowerCase()) ? u : t < e ? (t++, { ...u, selected: !0 }) : u)
|
|
209
219
|
};
|
|
210
220
|
} else {
|
|
211
|
-
const
|
|
212
|
-
return
|
|
221
|
+
const a = c;
|
|
222
|
+
return a.disabled || a.selected || n && !a.label?.toLowerCase().includes(n.toLowerCase()) ? c : t < e ? (t++, { ...c, selected: !0 }) : c;
|
|
213
223
|
}
|
|
214
224
|
});
|
|
215
|
-
|
|
225
|
+
d([...l]), h === "2.0" && o(l);
|
|
216
226
|
} else {
|
|
217
|
-
const
|
|
218
|
-
|
|
227
|
+
const s = g(
|
|
228
|
+
f,
|
|
219
229
|
{ selected: !0 },
|
|
220
230
|
(e) => n ? e.label?.toLowerCase().includes(n.toLowerCase()) && !e.disabled : !e.disabled
|
|
221
231
|
);
|
|
222
|
-
|
|
232
|
+
d([...s]), h === "2.0" && o(s);
|
|
223
233
|
}
|
|
224
|
-
else if (
|
|
225
|
-
const
|
|
226
|
-
|
|
234
|
+
else if (r === "notSelected") {
|
|
235
|
+
const s = g(
|
|
236
|
+
f,
|
|
227
237
|
{ selected: !1 },
|
|
228
238
|
(e) => !e.disabled
|
|
229
239
|
);
|
|
230
|
-
|
|
240
|
+
d([...s]), h === "2.0" && o(s);
|
|
231
241
|
}
|
|
232
242
|
}
|
|
233
243
|
function U() {
|
|
234
|
-
const
|
|
235
|
-
|
|
244
|
+
const r = g(f, { selected: !1 });
|
|
245
|
+
d([...r]), h === "2.0" && o(r);
|
|
236
246
|
}
|
|
237
|
-
function V(
|
|
238
|
-
if (!
|
|
247
|
+
function V(r) {
|
|
248
|
+
if (!O) {
|
|
239
249
|
T({
|
|
240
250
|
label: n,
|
|
241
251
|
value: n,
|
|
@@ -244,39 +254,39 @@ const S = (h = "1.0", b, y, I, g, w, k, q = [], a) => {
|
|
|
244
254
|
});
|
|
245
255
|
return;
|
|
246
256
|
}
|
|
247
|
-
const
|
|
257
|
+
const s = f.map(
|
|
248
258
|
(e) => e.options ? e : {
|
|
249
259
|
...e,
|
|
250
260
|
selected: (
|
|
251
261
|
/** free form check */
|
|
252
262
|
e.label === n && e.value === n ? (
|
|
253
263
|
/** to mark as selected or not */
|
|
254
|
-
|
|
264
|
+
r
|
|
255
265
|
) : e.selected
|
|
256
266
|
)
|
|
257
267
|
}
|
|
258
268
|
);
|
|
259
|
-
|
|
269
|
+
r && (s.some(
|
|
260
270
|
(e) => e.label === n && e.value === n
|
|
261
|
-
) ||
|
|
271
|
+
) || s.unshift({
|
|
262
272
|
label: n,
|
|
263
273
|
value: n,
|
|
264
274
|
isFreeForm: !0,
|
|
265
275
|
selected: !0
|
|
266
|
-
})),
|
|
276
|
+
})), d([...s]), h === "2.0" && o(s);
|
|
267
277
|
}
|
|
268
|
-
function o(
|
|
269
|
-
const
|
|
270
|
-
|
|
278
|
+
function o(r) {
|
|
279
|
+
const s = H(
|
|
280
|
+
r ?? C.current
|
|
271
281
|
);
|
|
272
|
-
y?.([...
|
|
282
|
+
y?.([...s]);
|
|
273
283
|
}
|
|
274
284
|
return {
|
|
275
285
|
latestDropdownOptionsRef: C,
|
|
276
|
-
dropdownOptions:
|
|
286
|
+
dropdownOptions: f,
|
|
277
287
|
search: G,
|
|
278
288
|
searchedString: n,
|
|
279
|
-
searchedOptions:
|
|
289
|
+
searchedOptions: p,
|
|
280
290
|
searchError: B,
|
|
281
291
|
retrySearch: J,
|
|
282
292
|
onApplyHandler: T,
|
|
@@ -287,7 +297,7 @@ const S = (h = "1.0", b, y, I, g, w, k, q = [], a) => {
|
|
|
287
297
|
getSelectedOptions: H,
|
|
288
298
|
getCurrentSelectionCount: L,
|
|
289
299
|
isMaxSelectionsReached: D,
|
|
290
|
-
maxSelections:
|
|
300
|
+
maxSelections: i
|
|
291
301
|
};
|
|
292
302
|
};
|
|
293
303
|
export {
|