@innovaccer/design-system 2.13.3 → 2.13.4-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/components/atoms/button/__stories__/SplitButton.story.jsx +1 -2
- package/core/components/atoms/checkbox/__stories__/Alignment.story.jsx +28 -26
- package/core/components/atoms/checkbox/__stories__/variants/Controlled.story.jsx +2 -2
- package/core/components/atoms/chip/__stories__/index.story.jsx +2 -2
- package/core/components/atoms/chip/__stories__/variants/Action.story.jsx +2 -2
- package/core/components/atoms/chip/__stories__/variants/Input.story.jsx +2 -2
- package/core/components/atoms/chip/__stories__/variants/Selection.story.jsx +6 -6
- package/core/components/atoms/chip/__stories__/variants/Type.story.jsx +2 -2
- package/core/components/atoms/chipGroup/_stories_/index.story.jsx +1 -1
- package/core/components/atoms/collapsible/__stories__/CustomTrigger.story.jsx +5 -71
- package/core/components/atoms/dropdown/Dropdown.tsx +18 -2
- package/core/components/atoms/dropdown/DropdownList.tsx +47 -57
- package/core/components/atoms/dropdown/__stories__/CustomSearchPlaceholder.story.jsx +4 -4
- package/core/components/atoms/dropdown/__stories__/DropdownItemsWithCheckbox.story.jsx +1 -3
- package/core/components/atoms/dropdown/__stories__/DropdownItemsWithIcon.story.jsx +2 -4
- package/core/components/atoms/dropdown/__stories__/DropdownItemsWithInfo.story.jsx +2 -5
- package/core/components/atoms/dropdown/__stories__/DropdownWIthIcon.story.jsx +3 -4
- package/core/components/atoms/dropdown/__stories__/DropdownWithActionButtons.story.jsx +9 -9
- package/core/components/atoms/dropdown/__stories__/DropdownWithCaption.story.jsx +7 -7
- package/core/components/atoms/dropdown/__stories__/Gender.story.jsx +6 -6
- package/core/components/atoms/dropdown/__stories__/LabelInline.story.jsx +58 -0
- package/core/components/atoms/dropdown/__stories__/{LabelPositionInDropdown.story.jsx → LabelOnTop.story.jsx} +8 -9
- package/core/components/atoms/dropdown/__stories__/Languages.story.jsx +6 -6
- package/core/components/atoms/dropdown/__stories__/Menu.story.jsx +5 -6
- package/core/components/atoms/dropdown/__stories__/OptionsLessThan50.story.jsx +3 -7
- package/core/components/atoms/dropdown/__stories__/OptionsMoreThan50.story.jsx +2 -2
- package/core/components/atoms/dropdown/__stories__/SearchInDropdown.story.jsx +3 -5
- package/core/components/atoms/dropdown/__stories__/StandardDropdown.story.jsx +2 -2
- package/core/components/atoms/dropdown/__stories__/StatusWithoutLabel.story.jsx +3 -3
- package/core/components/atoms/dropdown/__stories__/WithCheckboxAndSubInfo.story.jsx +2 -4
- package/core/components/atoms/dropdown/__stories__/index.story.jsx +2 -2
- package/core/components/atoms/dropdown/__stories__/variants/LoadingType.story.jsx +0 -1
- package/core/components/atoms/dropdown/__stories__/variants/PreSelection.story.jsx +2 -2
- package/core/components/atoms/dropdown/__stories__/variants/StaticLimit.story.jsx +2 -2
- package/core/components/atoms/dropdown/__stories__/variants/controlledDropdown/BulkMultiSelectWithApply.story.jsx +2 -2
- package/core/components/atoms/dropdown/__stories__/variants/controlledDropdown/MultiSelect.story.jsx +2 -2
- package/core/components/atoms/dropdown/__stories__/variants/controlledDropdown/SingleSelect.story.jsx +4 -4
- package/core/components/atoms/dropdown/option/DefaultOption.tsx +1 -1
- package/core/components/atoms/dropdown/utility.tsx +6 -0
- package/core/components/atoms/icon/__stories__/variants/Image.story.jsx +1 -6
- package/core/components/atoms/input/__stories__/variants/Size.story.jsx +9 -9
- package/core/components/atoms/input/__stories__/variants/controlledInput.story.jsx +3 -3
- package/core/components/atoms/metaList/_stories_/index.story.jsx +0 -1
- package/core/components/atoms/rangeSlider/__stories__/index.story.jsx +2 -2
- package/core/components/atoms/rangeSlider/__stories__/variants/Controlled.story.jsx +2 -2
- package/core/components/atoms/slider/__stories__/variants/Controlled.story.jsx +2 -2
- package/core/components/css-utilities/Miscellaneous/Miscellaneous.story.tsx +4 -0
- package/core/components/molecules/dropzone/FileSelectorUtils.tsx +3 -0
- package/core/components/molecules/editableDropdown/__stories__/index.story.jsx +2 -2
- package/core/components/molecules/fullscreenModal/__stories__/DefaultWidth.story.jsx +4 -2
- package/core/components/molecules/fullscreenModal/__stories__/LargeWidth.story.jsx +4 -2
- package/core/components/molecules/fullscreenModal/__stories__/Layering.story.jsx +3 -1
- package/core/components/molecules/fullscreenModal/__stories__/Scrolling.story.jsx +4 -2
- package/core/components/molecules/fullscreenModal/__stories__/TwoStepWorkflow.story.jsx +1 -2
- package/core/components/molecules/fullscreenModal/__stories__/twoSteps.story.jsx +0 -1
- package/core/components/molecules/fullscreenModal/__stories__/variants/dimension/Large.story.jsx +0 -1
- package/core/components/molecules/fullscreenModal/__stories__/variants/dimension/Medium.story.jsx +0 -1
- package/core/components/molecules/modal/__stories__/Alert.story.jsx +3 -1
- package/core/components/molecules/modal/__stories__/Confirmation.story.jsx +3 -1
- package/core/components/molecules/modal/__stories__/Dialog.story.jsx +3 -1
- package/core/components/molecules/modal/__stories__/Input.story.jsx +3 -1
- package/core/components/molecules/modal/__stories__/Layering.story.jsx +3 -1
- package/core/components/molecules/modal/__stories__/NoFooter.story.jsx +3 -1
- package/core/components/molecules/modal/__stories__/Scrolling.story.jsx +4 -2
- package/core/components/molecules/modal/__stories__/index.story.jsx +3 -1
- package/core/components/molecules/modal/__stories__/old.story.jsx +3 -1
- package/core/components/molecules/modal/__stories__/variants/dimension/Large.story.jsx +3 -1
- package/core/components/molecules/modal/__stories__/variants/dimension/Medium.story.jsx +3 -1
- package/core/components/molecules/modal/__stories__/variants/dimension/Small.story.jsx +3 -1
- package/core/components/molecules/popover/__stories__/Actions.story.jsx +1 -6
- package/core/components/molecules/popover/__stories__/Inputs.story.jsx +1 -6
- package/core/components/molecules/popover/__stories__/Light.story.jsx +1 -6
- package/core/components/molecules/popover/__stories__/variants/boundaryElement.story.jsx +1 -1
- package/core/components/molecules/sidesheet/__stories__/index.story.jsx +3 -1
- package/core/components/molecules/sidesheet/__stories__/variants/CustomHeader.story.jsx +3 -1
- package/core/components/molecules/sidesheet/__stories__/variants/Layering.story.jsx +3 -1
- package/core/components/molecules/sidesheet/__stories__/variants/LayeringWithModal.story.jsx +3 -1
- package/core/components/molecules/sidesheet/__stories__/variants/dimension/Large.story.jsx +3 -1
- package/core/components/molecules/sidesheet/__stories__/variants/dimension/Regular.story.jsx +4 -2
- package/core/components/molecules/sidesheet/__stories__/variants/stickyFooter.story.jsx +3 -1
- package/core/components/molecules/sidesheet/__stories__/variants/twoSteps.story.jsx +6 -4
- package/core/components/molecules/tabs/__stories__/DismissibleTab.story.jsx +1 -0
- package/core/components/molecules/tooltip/__stories__/variants/Position.story.jsx +2 -13
- package/core/components/organisms/calendar/__stories__/index.story.jsx +40 -7
- package/core/components/organisms/calendar/__stories__/variants/size.story.jsx +2 -3
- package/core/components/organisms/datePicker/DatePicker.tsx +1 -1
- package/core/components/organisms/dateRangePicker/__stories__/variants/withSingleInput.story.jsx +3 -0
- package/core/components/organisms/horizontalNav/__stories__/leftAlign.story.jsx +35 -19
- package/core/components/organisms/inlineMessage/__stories__/variants/Default.story.jsx +1 -3
- package/core/components/organisms/inlineMessage/__stories__/variants/Error.story.jsx +1 -3
- package/core/components/organisms/inlineMessage/__stories__/variants/Info.story.jsx +1 -3
- package/core/components/organisms/inlineMessage/__stories__/variants/Success.story.jsx +1 -3
- package/core/components/organisms/inlineMessage/__stories__/variants/Warning.story.jsx +1 -3
- package/core/components/organisms/pageHeader/__stories__/Responsiveness.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/variants/withNavigation.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/variants/withNavigationL1.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/variants/withStepper.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/variants/withStepperL1.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/variants/withTabs.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/variants/withTabsL1.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/withFilter.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/withFilterL1.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/withNavigation.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/withNavigationL1.story.jsx +9 -3
- package/core/components/organisms/pageHeader/__stories__/withStepperL1.story.jsx +4 -4
- package/core/components/organisms/table/__stories__/TableAsDescriptionList.story.jsx +4 -4
- package/core/components/organisms/timePicker/TimePicker.tsx +6 -113
- package/core/components/organisms/timePicker/TimePickerWithInput.tsx +124 -0
- package/core/components/organisms/timePicker/TimePickerWithSearch.tsx +198 -0
- package/core/components/organisms/timePicker/__stories__/TimeIntervals.story.jsx +52 -0
- package/core/components/organisms/timePicker/__stories__/disabledOption.story.jsx +52 -0
- package/core/components/organisms/timePicker/__stories__/fromTo.story.jsx +72 -0
- package/core/components/organisms/timePicker/__stories__/showDuration.story.jsx +52 -0
- package/core/components/organisms/timePicker/__stories__/withDatePicker.story.jsx +88 -0
- package/core/components/organisms/timePicker/__stories__/{index.story.jsx → withInput.story.jsx} +6 -3
- package/core/components/organisms/timePicker/__stories__/withSearch.story.jsx +89 -0
- package/core/components/organisms/timePicker/__tests__/TimePickerWithSearch.test.tsx +464 -0
- package/core/components/organisms/timePicker/__tests__/__snapshots__/TimePickerWithSearch.test.tsx.snap +169 -0
- package/core/components/organisms/timePicker/index.tsx +2 -0
- package/core/components/organisms/timePicker/utility/searchUtils.tsx +295 -0
- package/core/components/organisms/timePicker/utility/timePickerUtility.tsx +219 -0
- package/core/components/organisms/timePicker/utils.tsx +1 -1
- package/core/components/organisms/verticalNav/MenuItem.tsx +11 -6
- package/core/components/organisms/verticalNav/__stories__/CustomOptionsRenderer.story.jsx +10 -9
- package/core/components/organisms/verticalNav/__stories__/CustomTrigger.story.jsx +14 -12
- package/core/components/organisms/verticalNav/__stories__/FlatEdgedVerticalNav.story.jsx +5 -5
- package/core/components/organisms/verticalNav/__stories__/LabelOverflowBehaviour.story.jsx +9 -15
- package/core/components/organisms/verticalNav/__tests__/__snapshots__/VerticalNav.test.tsx.snap +26 -24
- package/core/index.tsx +1 -0
- package/css/dist/index.css +9 -8
- package/css/dist/index.css.map +1 -1
- package/css/src/components/dropdown.css +6 -6
- package/css/src/components/metricInput.css +1 -0
- package/css/src/components/verticalNav.css +2 -0
- package/dist/core/components/atoms/dropdown/Dropdown.d.ts +2 -0
- package/dist/core/components/atoms/dropdown/DropdownList.d.ts +1 -0
- package/dist/core/components/atoms/dropdown/utility.d.ts +1 -0
- package/dist/core/components/atoms/popperWrapper/PopperWrapper.d.ts +22 -22
- package/dist/core/components/organisms/datePicker/DatePicker.d.ts +1 -1
- package/dist/core/components/organisms/timePicker/TimePicker.d.ts +5 -13
- package/dist/core/components/organisms/timePicker/TimePickerWithInput.d.ts +24 -0
- package/dist/core/components/organisms/timePicker/TimePickerWithSearch.d.ts +32 -0
- package/dist/core/components/organisms/timePicker/index.d.ts +2 -0
- package/dist/core/components/organisms/timePicker/utility/searchUtils.d.ts +7 -0
- package/dist/core/components/organisms/timePicker/utility/timePickerUtility.d.ts +19 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/index.esm.js +719 -52
- package/dist/index.js +648 -74
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.br +0 -0
- package/dist/index.umd.js.gz +0 -0
- package/docs/.eslintrc.json +32 -1
- package/docs/.prettierrc +6 -0
- package/docs/README.md +14 -0
- package/docs/cypress/e2e/main.cy.js +35 -0
- package/docs/cypress/fixtures/example.json +5 -0
- package/docs/cypress/support/commands.ts +37 -0
- package/docs/cypress/support/e2e.ts +20 -0
- package/docs/cypress.config.js +9 -0
- package/docs/package.json +16 -3
- package/docs/src/components/Colors/Colors.css +4 -0
- package/docs/src/components/Colors/Colors.js +56 -61
- package/docs/src/components/Container/ComponentsContainer.js +10 -30
- package/docs/src/components/Container/Container.js +10 -41
- package/docs/src/components/ErrorBoundary.js +9 -3
- package/docs/src/components/Footer/Footer.js +11 -10
- package/docs/src/components/GlobalSearch/index.js +47 -44
- package/docs/src/components/Header/Header.css +4 -0
- package/docs/src/components/Header/Header.js +25 -19
- package/docs/src/components/Layout.js +59 -303
- package/docs/src/components/LeftNav/LeftNav.js +12 -28
- package/docs/src/components/Logos/Logos.js +12 -26
- package/docs/src/components/MDXComponents.js +213 -0
- package/docs/src/components/MDXHeading.js +12 -18
- package/docs/src/components/Meta.js +9 -9
- package/docs/src/components/PropsTable/ArgJsDoc.tsx +2 -6
- package/docs/src/components/PropsTable/ArgRow.tsx +19 -47
- package/docs/src/components/PropsTable/ArgValue.tsx +50 -93
- package/docs/src/components/PropsTable/EmptyBlock.tsx +2 -5
- package/docs/src/components/PropsTable/SectionRow.tsx +7 -18
- package/docs/src/components/PropsTable/Table.tsx +43 -130
- package/docs/src/components/PropsTable/generateImports.tsx +1 -3
- package/docs/src/components/PropsTable/index.js +94 -140
- package/docs/src/components/PropsTable/prism.css +19 -20
- package/docs/src/components/Rules/DONTs.js +1 -6
- package/docs/src/components/Rules/DOs.js +1 -6
- package/docs/src/components/Rules/IconWrapper.js +6 -7
- package/docs/src/components/Rules/InlineMessage.js +1 -5
- package/docs/src/components/Rules/Rules.js +18 -28
- package/docs/src/components/TableOfContent/TableOfContent.css +8 -1
- package/docs/src/components/TableOfContent/TableOfContent.js +67 -58
- package/docs/src/components/css/global.css +1 -1
- package/docs/src/components/css/prism.css +1 -1
- package/docs/src/components/css/style.css +13 -5
- package/docs/src/components/templates/Default.js +1 -1
- package/docs/src/components/templates/Homepage.js +4 -6
- package/docs/src/data/components/Overview.js +49 -56
- package/docs/src/data/components/images/Calendar.png +0 -0
- package/docs/src/data/components/images/MetaList.png +0 -0
- package/docs/src/data/components/images/PageHeader.png +0 -0
- package/docs/src/data/components/images/TimePicker.png +0 -0
- package/docs/src/data/components/images/mobile/Badge.png +0 -0
- package/docs/src/data/components/images/mobile/Dropdown.png +0 -0
- package/docs/src/data/components/images/mobile/Message.png +0 -0
- package/docs/src/data/components/images/mobile/MetaList.png +0 -0
- package/docs/src/data/components/images/mobile/Slider.png +0 -0
- package/docs/src/data/components/images/mobile/StatusHint.png +0 -0
- package/docs/src/data/components/images/mobile/Stepper.png +0 -0
- package/docs/src/data/components/index.js +168 -321
- package/docs/src/data/components/mobile.js +85 -125
- package/docs/src/data/components/overview.css +4 -2
- package/docs/src/data/components/patterns.js +25 -59
- package/docs/src/data/header-items.yaml +1 -0
- package/docs/src/data/nav/components.yaml +2 -8
- package/docs/src/pages/404.js +7 -17
- package/docs/src/pages/components/avatar/usage.mdx +23 -19
- package/docs/src/pages/components/calendar/usage.mdx +3 -3
- package/docs/src/pages/components/checkbox/usage.mdx +1 -1
- package/docs/src/pages/components/chips/images/actionchip-state.png +0 -0
- package/docs/src/pages/components/chips/images/inputchips-state.png +0 -0
- package/docs/src/pages/components/chips/images/selectionchip-state.png +0 -0
- package/docs/src/pages/components/chips/usage.mdx +24 -2
- package/docs/src/pages/components/datePicker/images/datePicker-3.png +0 -0
- package/docs/src/pages/components/datePicker/images/datePicker-6.png +0 -0
- package/docs/src/pages/components/datePicker/usage.mdx +9 -2
- package/docs/src/pages/components/dropdowns/usage.mdx +1 -1
- package/docs/src/pages/components/inlineEditableFields/images/inlineEditableField-2.png +0 -0
- package/docs/src/pages/components/inlineEditableFields/images/inlineEditableField-3.png +0 -0
- package/docs/src/pages/components/inlineEditableFields/images/inlineEditableFields-1.png +0 -0
- package/docs/src/pages/components/inlineEditableFields/images/inlineEditableFields-4.png +0 -0
- package/docs/src/pages/components/inlineEditableFields/usage.mdx +4 -4
- package/docs/src/pages/components/inputs/usage.mdx +7 -7
- package/docs/src/pages/components/tabs/images/tabs-1.png +0 -0
- package/docs/src/pages/content/button-guidelines/tabs/button-glossary.mdx +1776 -1
- package/docs/src/pages/content/button-guidelines/tabs/confusing-buttons.mdx +479 -8
- package/docs/src/pages/content/email-guidelines.mdx +3 -3
- package/docs/src/pages/content/house-rules/tabs/date,-time-&-numbers.mdx +24 -0
- package/docs/src/pages/content/house-rules/tabs/grammer.mdx +42 -2
- package/docs/src/pages/content/house-rules/tabs/punctuations.mdx +32 -0
- package/docs/src/pages/foundations/colors.mdx +338 -24
- package/docs/src/pages/foundations/layout/index.mdx +57 -82
- package/docs/src/pages/foundations/response-time.mdx +32 -77
- package/docs/src/pages/foundations/typography.mdx +166 -0
- package/docs/src/pages/index.js +92 -121
- package/docs/src/pages/introduction/get-started/designers.mdx +28 -188
- package/docs/src/pages/introduction/get-started/images/designers-1.png +0 -0
- package/docs/src/pages/introduction/get-started/images/designers-2.png +0 -0
- package/docs/src/pages/introduction/what's-new.mdx +322 -15
- package/docs/src/pages/mobile/components/badges/images/badge-1.png +0 -0
- package/docs/src/pages/mobile/components/badges/images/badge-2.png +0 -0
- package/docs/src/pages/mobile/components/badges/images/badge-3.png +0 -0
- package/docs/src/pages/mobile/components/badges/images/badge-4.png +0 -0
- package/docs/src/pages/mobile/components/badges/images/badge-5.png +0 -0
- package/docs/src/pages/mobile/components/badges/usage.mdx +100 -0
- package/docs/src/pages/mobile/components/card/images/mcard-1.png +0 -0
- package/docs/src/pages/mobile/components/card/images/mcard-2.png +0 -0
- package/docs/src/pages/mobile/components/card/images/mcard-3.png +0 -0
- package/docs/src/pages/mobile/components/card/images/mcard-4.png +0 -0
- package/docs/src/pages/mobile/components/card/images/mcard-5.png +0 -0
- package/docs/src/pages/mobile/components/card/images/mcard-6.png +0 -0
- package/docs/src/pages/mobile/components/card/usage.mdx +54 -67
- package/docs/src/pages/mobile/components/checkbox/images/checkbox-1.png +0 -0
- package/docs/src/pages/mobile/components/checkbox/usage.mdx +26 -2
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-1.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-10.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-11.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-2.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-3.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-4.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-5.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-6.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-7.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-8.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-9.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/usage.mdx +88 -0
- package/docs/src/pages/mobile/components/message/images/messages-1.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-10.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-11.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-12.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-2.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-3.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-4.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-5.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-6.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-7.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-8.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-9.png +0 -0
- package/docs/src/pages/mobile/components/message/usage.mdx +170 -0
- package/docs/src/pages/mobile/components/metaList/images/metaList-1.png +0 -0
- package/docs/src/pages/mobile/components/metaList/images/metaList-2.png +0 -0
- package/docs/src/pages/mobile/components/metaList/images/metaList-3.png +0 -0
- package/docs/src/pages/mobile/components/metaList/images/metaList-4.png +0 -0
- package/docs/src/pages/mobile/components/metaList/usage.mdx +71 -0
- package/docs/src/pages/mobile/components/slider/images/slider-1.png +0 -0
- package/docs/src/pages/mobile/components/slider/images/slider-2.png +0 -0
- package/docs/src/pages/mobile/components/slider/images/slider-3.png +0 -0
- package/docs/src/pages/mobile/components/slider/images/slider-4.png +0 -0
- package/docs/src/pages/mobile/components/slider/images/slider-5.png +0 -0
- package/docs/src/pages/mobile/components/slider/usage.mdx +83 -0
- package/docs/src/pages/mobile/components/statusHint/images/statushint-1.png +0 -0
- package/docs/src/pages/mobile/components/statusHint/images/statushint-2.png +0 -0
- package/docs/src/pages/mobile/components/statusHint/images/statushint-3.png +0 -0
- package/docs/src/pages/mobile/components/statusHint/images/statushint-4.png +0 -0
- package/docs/src/pages/mobile/components/statusHint/images/statushint-5.png +0 -0
- package/docs/src/pages/mobile/components/statusHint/images/statushint-6.png +0 -0
- package/docs/src/pages/mobile/components/statusHint/images/statushint-7.png +0 -0
- package/docs/src/pages/mobile/components/statusHint/usage.mdx +108 -0
- package/docs/src/pages/mobile/components/steppers/images/stepper-1.png +0 -0
- package/docs/src/pages/mobile/components/steppers/images/stepper-2.png +0 -0
- package/docs/src/pages/mobile/components/steppers/images/stepper-3.png +0 -0
- package/docs/src/pages/mobile/components/steppers/images/stepper-4.png +0 -0
- package/docs/src/pages/mobile/components/steppers/images/stepper-5.png +0 -0
- package/docs/src/pages/mobile/components/steppers/images/stepper-6.png +0 -0
- package/docs/src/pages/mobile/components/steppers/usage.mdx +111 -0
- package/docs/src/pages/mobile/foundations/layout/images/layout-2.png +0 -0
- package/docs/src/pages/mobile/foundations/layout/index.mdx +3 -1
- package/docs/src/pages/mobile/foundations/page-types/index.mdx +0 -214
- package/docs/src/pages/mobile/foundations/spacing/index.mdx +5 -0
- package/docs/src/pages/mobile/foundations/typography.mdx +1 -1
- package/docs/src/pages/patterns/uiStates/usage.mdx +92 -0
- package/docs/src/util/Frontmatter.js +4 -4
- package/docs/src/util/HeaderItems.js +2 -1
- package/docs/src/util/Helpers.js +3 -3
- package/docs/src/util/HomeIcons.js +91 -53
- package/docs/src/util/InPageNavItems.js +2 -6
- package/docs/src/util/Logos.js +2 -2
- package/docs/src/util/MdsChangelog.js +5 -10
- package/docs/src/util/MediumBlogs.js +13 -13
- package/docs/src/util/NavItems.js +14 -17
- package/docs/src/util/Search.js +2 -2
- package/docs/src/util/StorybookData.js +2 -4
- package/docs/src/util/constants.js +1 -5
- package/docs/src/util/context/NavContext.js +1 -4
- package/docs/src/util/hooks/useMetadata.js +1 -1
- package/docs/tools/build.sh +1 -0
- package/docs/tools/changelog.sh +1 -1
- package/package.json +3 -3
- package/docs/src/pages/components/index.mdx +0 -11
- package/docs/src/pages/components/inlineEditableFields/images/inlineEditableFields-2.png +0 -0
- package/docs/src/pages/components/inlineEditableFields/images/inlineEditableFields-3.png +0 -0
- package/docs/src/pages/content/button-guidelines/index.mdx +0 -7
- package/docs/src/pages/content/voice-and-tone-guidelines/index.mdx +0 -7
- package/docs/src/pages/introduction/get-started/images/designers-3.png +0 -0
- package/docs/src/pages/introduction/get-started/images/designers-4.png +0 -0
- package/docs/src/pages/introduction/get-started/images/designers-5.png +0 -0
- package/docs/src/pages/introduction/get-started/images/designers-6.png +0 -0
- package/docs/src/pages/introduction/get-started/images/designers-7.png +0 -0
- package/docs/src/pages/introduction/get-started/images/designers-8.png +0 -0
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* Generated on:
|
|
3
|
+
* Generated on: 1661977122083
|
|
4
4
|
* Package: @innovaccer/design-system
|
|
5
|
-
* Version: v2.13.
|
|
5
|
+
* Version: v2.13.4-2
|
|
6
6
|
* License: MIT
|
|
7
7
|
* Docs: https://innovaccer.github.io/design-system
|
|
8
8
|
*/
|
|
@@ -923,6 +923,15 @@
|
|
|
923
923
|
checked: false
|
|
924
924
|
};
|
|
925
925
|
};
|
|
926
|
+
var scrollToOptionIndex = function scrollToOptionIndex(scrollIndex, listOptions) {
|
|
927
|
+
var _a;
|
|
928
|
+
|
|
929
|
+
var optionID = listOptions && ((_a = listOptions[scrollIndex]) === null || _a === void 0 ? void 0 : _a.optionID);
|
|
930
|
+
var targetOption = document.getElementById(optionID);
|
|
931
|
+
targetOption && targetOption.scrollIntoView && targetOption.scrollIntoView({
|
|
932
|
+
block: 'center'
|
|
933
|
+
});
|
|
934
|
+
};
|
|
926
935
|
|
|
927
936
|
var DropdownButton = /*#__PURE__*/React__namespace.forwardRef(function (props, ref) {
|
|
928
937
|
var _a, _b;
|
|
@@ -1301,7 +1310,8 @@
|
|
|
1301
1310
|
className: 'Option-label'
|
|
1302
1311
|
}, /*#__PURE__*/React__namespace.createElement(Text, {
|
|
1303
1312
|
className: textClassName,
|
|
1304
|
-
appearance: appearance
|
|
1313
|
+
appearance: appearance,
|
|
1314
|
+
id: optionData.optionID
|
|
1305
1315
|
}, label)));
|
|
1306
1316
|
};
|
|
1307
1317
|
|
|
@@ -1643,25 +1653,25 @@
|
|
|
1643
1653
|
};
|
|
1644
1654
|
|
|
1645
1655
|
var DropdownList = function DropdownList(props) {
|
|
1646
|
-
var _a, _b, _c
|
|
1656
|
+
var _a, _b, _c;
|
|
1647
1657
|
|
|
1648
|
-
var
|
|
1649
|
-
listOptions =
|
|
1658
|
+
var _d = props.listOptions,
|
|
1659
|
+
listOptions = _d === void 0 ? [] : _d,
|
|
1650
1660
|
inputRef = props.inputRef,
|
|
1651
|
-
|
|
1652
|
-
align =
|
|
1653
|
-
|
|
1654
|
-
optionType =
|
|
1655
|
-
|
|
1656
|
-
applyButtonLabel =
|
|
1657
|
-
|
|
1658
|
-
cancelButtonLabel =
|
|
1659
|
-
|
|
1660
|
-
truncateOption =
|
|
1661
|
-
|
|
1662
|
-
withSelectAll =
|
|
1663
|
-
|
|
1664
|
-
maxHeight =
|
|
1661
|
+
_e = props.align,
|
|
1662
|
+
align = _e === void 0 ? 'right' : _e,
|
|
1663
|
+
_f = props.optionType,
|
|
1664
|
+
optionType = _f === void 0 ? 'DEFAULT' : _f,
|
|
1665
|
+
_g = props.applyButtonLabel,
|
|
1666
|
+
applyButtonLabel = _g === void 0 ? 'Apply' : _g,
|
|
1667
|
+
_h = props.cancelButtonLabel,
|
|
1668
|
+
cancelButtonLabel = _h === void 0 ? 'Cancel' : _h,
|
|
1669
|
+
_j = props.truncateOption,
|
|
1670
|
+
truncateOption = _j === void 0 ? true : _j,
|
|
1671
|
+
_k = props.withSelectAll,
|
|
1672
|
+
withSelectAll = _k === void 0 ? true : _k,
|
|
1673
|
+
_l = props.maxHeight,
|
|
1674
|
+
maxHeight = _l === void 0 ? 200 : _l,
|
|
1665
1675
|
customTrigger = props.customTrigger,
|
|
1666
1676
|
selected = props.selected,
|
|
1667
1677
|
tempSelected = props.tempSelected,
|
|
@@ -1681,8 +1691,9 @@
|
|
|
1681
1691
|
cancelOptions = props.cancelOptions,
|
|
1682
1692
|
toggleDropdown = props.toggleDropdown,
|
|
1683
1693
|
className = props.className,
|
|
1684
|
-
|
|
1685
|
-
searchPlaceholder =
|
|
1694
|
+
_m = props.searchPlaceholder,
|
|
1695
|
+
searchPlaceholder = _m === void 0 ? 'Search..' : _m,
|
|
1696
|
+
scrollIndex = props.scrollIndex;
|
|
1686
1697
|
var baseProps = extractBaseProps(props);
|
|
1687
1698
|
var dropdownRef = /*#__PURE__*/React__namespace.createRef();
|
|
1688
1699
|
var triggerRef = /*#__PURE__*/React__namespace.createRef();
|
|
@@ -1690,18 +1701,19 @@
|
|
|
1690
1701
|
var dropdownCancelButtonRef = /*#__PURE__*/React__namespace.createRef();
|
|
1691
1702
|
var dropdownApplyButtonRef = /*#__PURE__*/React__namespace.createRef();
|
|
1692
1703
|
|
|
1693
|
-
var
|
|
1694
|
-
popoverStyle =
|
|
1695
|
-
setPopoverStyle =
|
|
1704
|
+
var _o = React__namespace.useState(),
|
|
1705
|
+
popoverStyle = _o[0],
|
|
1706
|
+
setPopoverStyle = _o[1];
|
|
1696
1707
|
|
|
1697
|
-
var
|
|
1698
|
-
cursor =
|
|
1699
|
-
setCursor =
|
|
1708
|
+
var _p = React__namespace.useState(firstEnabledOption),
|
|
1709
|
+
cursor = _p[0],
|
|
1710
|
+
setCursor = _p[1];
|
|
1700
1711
|
|
|
1701
|
-
var animateOrder = 0;
|
|
1702
1712
|
React__namespace.useEffect(function () {
|
|
1703
1713
|
var _a;
|
|
1704
1714
|
|
|
1715
|
+
var timer;
|
|
1716
|
+
|
|
1705
1717
|
if (dropdownOpen) {
|
|
1706
1718
|
var width = props.width,
|
|
1707
1719
|
minWidth = props.minWidth,
|
|
@@ -1714,15 +1726,25 @@
|
|
|
1714
1726
|
maxWidth: maxWidth ? maxWidth : '100%'
|
|
1715
1727
|
};
|
|
1716
1728
|
setPopoverStyle(popperWrapperStyle);
|
|
1729
|
+
|
|
1730
|
+
if (scrollIndex && tempSelected.length === 0) {
|
|
1731
|
+
timer = setTimeout(function () {
|
|
1732
|
+
scrollToOptionIndex(scrollIndex, listOptions);
|
|
1733
|
+
}, 100);
|
|
1734
|
+
}
|
|
1717
1735
|
}
|
|
1736
|
+
|
|
1737
|
+
return function () {
|
|
1738
|
+
clearTimeout(timer);
|
|
1739
|
+
};
|
|
1718
1740
|
}, [dropdownOpen]);
|
|
1719
1741
|
React__namespace.useEffect(function () {
|
|
1720
1742
|
if (firstEnabledOption !== cursor) setCursor(firstEnabledOption);
|
|
1721
1743
|
}, [firstEnabledOption]);
|
|
1722
|
-
var
|
|
1723
|
-
triggerSize =
|
|
1724
|
-
|
|
1725
|
-
placeholder =
|
|
1744
|
+
var _q = props.triggerSize,
|
|
1745
|
+
triggerSize = _q === void 0 ? 'regular' : _q,
|
|
1746
|
+
_r = props.placeholder,
|
|
1747
|
+
placeholder = _r === void 0 ? 'Select' : _r,
|
|
1726
1748
|
icon = props.icon,
|
|
1727
1749
|
error = props.error,
|
|
1728
1750
|
disabled = props.disabled,
|
|
@@ -1757,24 +1779,15 @@
|
|
|
1757
1779
|
return Dropdown;
|
|
1758
1780
|
};
|
|
1759
1781
|
|
|
1760
|
-
var animateClass = classNames__default["default"]((_a = {}, _a['fade-in'] = dropdownOpen, _a['opacity-0'] = dropdownOpen, _a['Dropdown-items'] = true, _a));
|
|
1761
|
-
|
|
1762
|
-
var getAnimateOrderStyle = function getAnimateOrderStyle(order) {
|
|
1763
|
-
var animateStyle = {
|
|
1764
|
-
animationDelay: dropdownOpen ? order * 20 + 'ms' : ''
|
|
1765
|
-
};
|
|
1766
|
-
return animateStyle;
|
|
1767
|
-
};
|
|
1768
|
-
|
|
1769
1782
|
var getDropdownSectionClass = function getDropdownSectionClass(showClearButton) {
|
|
1770
1783
|
var _a;
|
|
1771
1784
|
|
|
1772
|
-
return classNames__default["default"]((_a = {}, _a['Dropdown-section'] = true, _a['Dropdown-section--withClear'] = showClearButton, _a)
|
|
1785
|
+
return classNames__default["default"]((_a = {}, _a['Dropdown-section'] = true, _a['Dropdown-section--withClear'] = showClearButton, _a));
|
|
1773
1786
|
};
|
|
1774
1787
|
|
|
1775
|
-
var dropdownClass = classNames__default["default"]((
|
|
1776
|
-
var dropdownWrapperClass = classNames__default["default"]((
|
|
1777
|
-
var SelectAllClass = classNames__default["default"]((
|
|
1788
|
+
var dropdownClass = classNames__default["default"]((_a = {}, _a['Dropdown'] = true, _a), className);
|
|
1789
|
+
var dropdownWrapperClass = classNames__default["default"]((_b = {}, _b['Dropdown-wrapper'] = true, _b['Dropdown-wrapper--wrap'] = !truncateOption, _b));
|
|
1790
|
+
var SelectAllClass = classNames__default["default"]((_c = {}, _c['Option-checkbox'] = true, _c['Option-checkbox--active'] = cursor === 0, _c['OptionWrapper'] = true, _c));
|
|
1778
1791
|
|
|
1779
1792
|
var onToggleDropdown = function onToggleDropdown(open, type) {
|
|
1780
1793
|
var _a;
|
|
@@ -1824,8 +1837,7 @@
|
|
|
1824
1837
|
var _a = props.footerLabel,
|
|
1825
1838
|
footerLabel = _a === void 0 ? 'Search for more options' : _a;
|
|
1826
1839
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
1827
|
-
className: "Dropdown-footer
|
|
1828
|
-
style: getAnimateOrderStyle(++animateOrder)
|
|
1840
|
+
className: "Dropdown-footer"
|
|
1829
1841
|
}, /*#__PURE__*/React__namespace.createElement(Text, {
|
|
1830
1842
|
size: "small",
|
|
1831
1843
|
appearance: 'subtle'
|
|
@@ -1838,8 +1850,7 @@
|
|
|
1838
1850
|
return option.disabled;
|
|
1839
1851
|
});
|
|
1840
1852
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
1841
|
-
className: getDropdownSectionClass(selectedGroup)
|
|
1842
|
-
style: getAnimateOrderStyle(++animateOrder)
|
|
1853
|
+
className: getDropdownSectionClass(selectedGroup)
|
|
1843
1854
|
}, /*#__PURE__*/React__namespace.createElement(Text, {
|
|
1844
1855
|
size: "small",
|
|
1845
1856
|
appearance: 'subtle'
|
|
@@ -1856,8 +1867,7 @@
|
|
|
1856
1867
|
var disable = _isEqual(previousSelected, tempSelected);
|
|
1857
1868
|
|
|
1858
1869
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
1859
|
-
className: "Dropdown-buttonWrapper
|
|
1860
|
-
style: getAnimateOrderStyle(++animateOrder)
|
|
1870
|
+
className: "Dropdown-buttonWrapper"
|
|
1861
1871
|
}, /*#__PURE__*/React__namespace.createElement(Button, {
|
|
1862
1872
|
ref: dropdownCancelButtonRef,
|
|
1863
1873
|
className: "mr-4",
|
|
@@ -1878,8 +1888,7 @@
|
|
|
1878
1888
|
|
|
1879
1889
|
var renderSearch = function renderSearch() {
|
|
1880
1890
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
1881
|
-
className: "Dropdown-inputWrapper
|
|
1882
|
-
style: getAnimateOrderStyle(++animateOrder)
|
|
1891
|
+
className: "Dropdown-inputWrapper"
|
|
1883
1892
|
}, /*#__PURE__*/React__namespace.createElement(Input, {
|
|
1884
1893
|
name: "Dropdown-search",
|
|
1885
1894
|
icon: 'search',
|
|
@@ -1914,7 +1923,6 @@
|
|
|
1914
1923
|
onSelectAll = props.onSelectAll;
|
|
1915
1924
|
var label = selectAllLabel.trim() ? selectAllLabel.trim() : 'Select All';
|
|
1916
1925
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
1917
|
-
style: getAnimateOrderStyle(++animateOrder),
|
|
1918
1926
|
className: SelectAllClass,
|
|
1919
1927
|
onMouseEnter: function onMouseEnter() {
|
|
1920
1928
|
return updateActiveOption(0, true);
|
|
@@ -1936,10 +1944,7 @@
|
|
|
1936
1944
|
var optionIsSelected = tempSelected.findIndex(function (option) {
|
|
1937
1945
|
return option.value === item.value;
|
|
1938
1946
|
}) !== -1;
|
|
1939
|
-
return /*#__PURE__*/React__namespace.createElement(
|
|
1940
|
-
style: getAnimateOrderStyle(++animateOrder),
|
|
1941
|
-
className: animateClass
|
|
1942
|
-
}, /*#__PURE__*/React__namespace.createElement(Option, {
|
|
1947
|
+
return /*#__PURE__*/React__namespace.createElement(Option, {
|
|
1943
1948
|
optionData: item,
|
|
1944
1949
|
truncateOption: truncateOption,
|
|
1945
1950
|
selected: optionIsSelected,
|
|
@@ -1956,7 +1961,7 @@
|
|
|
1956
1961
|
return props.onSelect(item, e.target.checked);
|
|
1957
1962
|
},
|
|
1958
1963
|
optionType: props.optionType
|
|
1959
|
-
})
|
|
1964
|
+
});
|
|
1960
1965
|
};
|
|
1961
1966
|
|
|
1962
1967
|
var renderDropdownSection = function renderDropdownSection() {
|
|
@@ -2200,6 +2205,12 @@
|
|
|
2200
2205
|
var options = res.options,
|
|
2201
2206
|
count = res.count;
|
|
2202
2207
|
|
|
2208
|
+
if (res.scrollToIndex) {
|
|
2209
|
+
setTimeout(function () {
|
|
2210
|
+
scrollToOptionIndex(res.scrollToIndex, options);
|
|
2211
|
+
}, 0);
|
|
2212
|
+
}
|
|
2213
|
+
|
|
2203
2214
|
if (!res.searchTerm || res.searchTerm && res.searchTerm === _this.state.searchTerm) {
|
|
2204
2215
|
updatedAsync = searchTerm === '' ? count > _this.staticLimit : updatedAsync;
|
|
2205
2216
|
var unSelectedGroup = _showSelectedItems(updatedAsync, searchTerm, withCheckbox) ? _this.getUnSelectedOptions(options, init) : options;
|
|
@@ -2209,6 +2220,7 @@
|
|
|
2209
2220
|
var disabledOptions = _this.getDisabledOptions(unSelectedGroup.slice(0, _this.staticLimit));
|
|
2210
2221
|
|
|
2211
2222
|
_this.setState(__assign(__assign({}, _this.state), {
|
|
2223
|
+
scrollIndex: res.scrollToIndex || 0,
|
|
2212
2224
|
optionsLength: optionsLength,
|
|
2213
2225
|
loading: false,
|
|
2214
2226
|
async: updatedAsync,
|
|
@@ -2676,7 +2688,8 @@
|
|
|
2676
2688
|
tempSelected = _a.tempSelected,
|
|
2677
2689
|
selectAll = _a.selectAll,
|
|
2678
2690
|
triggerLabel = _a.triggerLabel,
|
|
2679
|
-
previousSelected = _a.previousSelected
|
|
2691
|
+
previousSelected = _a.previousSelected,
|
|
2692
|
+
scrollIndex = _a.scrollIndex;
|
|
2680
2693
|
var _b = this.props,
|
|
2681
2694
|
_c = _b.withSelectAll,
|
|
2682
2695
|
withSelectAll = _c === void 0 ? true : _c,
|
|
@@ -2686,10 +2699,11 @@
|
|
|
2686
2699
|
_e = _d.triggerOptions,
|
|
2687
2700
|
triggerOptions = _e === void 0 ? {} : _e;
|
|
2688
2701
|
_d.selected;
|
|
2689
|
-
var
|
|
2702
|
+
var tabIndex = _d.tabIndex,
|
|
2703
|
+
rest = __rest(_d, ["triggerOptions", "selected", "tabIndex"]);
|
|
2690
2704
|
|
|
2691
2705
|
var remainingOptionsLen = searchedOptionsLength - options.length;
|
|
2692
|
-
var firstEnabledOption = _isSelectAllPresent(searchTerm, remainingOptionsLen, withSelectAll, withCheckbox) ? 0 : options.findIndex(function (option) {
|
|
2706
|
+
var firstEnabledOption = tabIndex ? tabIndex : _isSelectAllPresent(searchTerm, remainingOptionsLen, withSelectAll, withCheckbox) ? 0 : options.findIndex(function (option) {
|
|
2693
2707
|
return !option.disabled;
|
|
2694
2708
|
});
|
|
2695
2709
|
return /*#__PURE__*/React__namespace.createElement(DropdownList, __assign({
|
|
@@ -2715,7 +2729,8 @@
|
|
|
2715
2729
|
onSearchChange: this.updateSearchTerm,
|
|
2716
2730
|
onOptionSelect: this.onOptionSelect,
|
|
2717
2731
|
onSelectAll: this.onSelectAll,
|
|
2718
|
-
customTrigger: triggerOptions.customTrigger
|
|
2732
|
+
customTrigger: triggerOptions.customTrigger,
|
|
2733
|
+
scrollIndex: scrollIndex
|
|
2719
2734
|
}, rest));
|
|
2720
2735
|
};
|
|
2721
2736
|
|
|
@@ -4647,7 +4662,555 @@
|
|
|
4647
4662
|
return DatePicker;
|
|
4648
4663
|
}(React__namespace.Component);
|
|
4649
4664
|
|
|
4650
|
-
var
|
|
4665
|
+
var parseDate = function parseDate(date_time) {
|
|
4666
|
+
var d = new Date();
|
|
4667
|
+
d.setHours(date_time.substring(0, 2));
|
|
4668
|
+
d.setMinutes(date_time.substring(3, 5));
|
|
4669
|
+
return d;
|
|
4670
|
+
};
|
|
4671
|
+
|
|
4672
|
+
var isFormat12Hour = function isFormat12Hour(format) {
|
|
4673
|
+
return format === '12-Hour';
|
|
4674
|
+
};
|
|
4675
|
+
|
|
4676
|
+
var isTimeIn12HourFormat = function isTimeIn12HourFormat(time) {
|
|
4677
|
+
return _isTimeInAM(time) || _isTimeInPM(time);
|
|
4678
|
+
};
|
|
4679
|
+
|
|
4680
|
+
var _isTimeInAM = function _isTimeInAM(time) {
|
|
4681
|
+
return time.includes('a') || time.includes('A');
|
|
4682
|
+
};
|
|
4683
|
+
var _isTimeInPM = function _isTimeInPM(time) {
|
|
4684
|
+
return time.includes('p') || time.includes('P');
|
|
4685
|
+
};
|
|
4686
|
+
var convert12To24HourFormat$1 = function convert12To24HourFormat(timeStr) {
|
|
4687
|
+
var _a = timeStr.split(' '),
|
|
4688
|
+
time = _a[0],
|
|
4689
|
+
modifier = _a[1];
|
|
4690
|
+
|
|
4691
|
+
var timeArr = time.split(':');
|
|
4692
|
+
var hours = timeArr[0];
|
|
4693
|
+
var minutes = timeArr[1];
|
|
4694
|
+
|
|
4695
|
+
if (hours === '12' && _isTimeInAM(modifier)) {
|
|
4696
|
+
hours = '00';
|
|
4697
|
+
}
|
|
4698
|
+
|
|
4699
|
+
if (_isTimeInPM(modifier) && hours !== '12') {
|
|
4700
|
+
hours = (parseInt(hours, 10) + 12).toString();
|
|
4701
|
+
}
|
|
4702
|
+
|
|
4703
|
+
return hours + ":" + minutes;
|
|
4704
|
+
};
|
|
4705
|
+
var convertToTwoDigit = function convertToTwoDigit(val) {
|
|
4706
|
+
return ('0' + val).slice(-2);
|
|
4707
|
+
};
|
|
4708
|
+
var convert24To12HourFormat = function convert24To12HourFormat(timeStr) {
|
|
4709
|
+
var timeArr = timeStr.split(':');
|
|
4710
|
+
var hours = parseInt(timeArr[0], 10);
|
|
4711
|
+
var modifier = hours >= 12 ? 'PM' : 'AM';
|
|
4712
|
+
var convertedHours = hours % 12 || 12;
|
|
4713
|
+
var hoursInString = convertedHours.toString();
|
|
4714
|
+
hoursInString = convertToTwoDigit(hoursInString);
|
|
4715
|
+
var minutes = timeArr[1];
|
|
4716
|
+
var result = hoursInString.toString() + ":" + minutes + " " + modifier;
|
|
4717
|
+
return result;
|
|
4718
|
+
};
|
|
4719
|
+
|
|
4720
|
+
var getTimeIn24HrFormat = function getTimeIn24HrFormat(timeStr) {
|
|
4721
|
+
if (isTimeIn12HourFormat(timeStr)) {
|
|
4722
|
+
return convert12To24HourFormat$1(timeStr);
|
|
4723
|
+
}
|
|
4724
|
+
|
|
4725
|
+
return timeStr;
|
|
4726
|
+
};
|
|
4727
|
+
|
|
4728
|
+
var checkTimeDifference = function checkTimeDifference(startTime, endTime) {
|
|
4729
|
+
var parseStartTime = parseDate(startTime);
|
|
4730
|
+
var parseEndTime = parseDate(endTime);
|
|
4731
|
+
return parseStartTime > parseEndTime;
|
|
4732
|
+
};
|
|
4733
|
+
|
|
4734
|
+
var get24HourTimeList = function get24HourTimeList(startTime, endTime, interval) {
|
|
4735
|
+
var timeList = [];
|
|
4736
|
+
var parseStartTime = parseDate(startTime);
|
|
4737
|
+
var parseEndTime = parseDate(endTime);
|
|
4738
|
+
|
|
4739
|
+
while (parseStartTime <= parseEndTime) {
|
|
4740
|
+
timeList.push(parseStartTime.toTimeString().substring(0, 5));
|
|
4741
|
+
parseStartTime.setMinutes(parseStartTime.getMinutes() + interval);
|
|
4742
|
+
}
|
|
4743
|
+
|
|
4744
|
+
return timeList;
|
|
4745
|
+
};
|
|
4746
|
+
|
|
4747
|
+
var getReverseTimeList = function getReverseTimeList(startTime, endTime, interval) {
|
|
4748
|
+
var timeList = get24HourTimeList('00:00', '23:59', interval);
|
|
4749
|
+
var startTimeIndex = timeList.indexOf(startTime);
|
|
4750
|
+
var endTimeIndex = timeList.indexOf(endTime);
|
|
4751
|
+
var nextDayTimeIndex = endTime === '' ? startTimeIndex : endTimeIndex + 1;
|
|
4752
|
+
var presentDayList = timeList.slice(startTimeIndex);
|
|
4753
|
+
var nextDayList = timeList.slice(0, nextDayTimeIndex);
|
|
4754
|
+
var result = presentDayList.concat(nextDayList);
|
|
4755
|
+
return result;
|
|
4756
|
+
};
|
|
4757
|
+
|
|
4758
|
+
var getTimeListIn24HourFormat = function getTimeListIn24HourFormat(startTime, endTime, interval) {
|
|
4759
|
+
if (endTime === '' || checkTimeDifference(startTime, endTime)) {
|
|
4760
|
+
return getReverseTimeList(startTime, endTime, interval);
|
|
4761
|
+
}
|
|
4762
|
+
|
|
4763
|
+
return get24HourTimeList(startTime, endTime, interval);
|
|
4764
|
+
};
|
|
4765
|
+
|
|
4766
|
+
var getTimeDifference = function getTimeDifference(startTime, endTime) {
|
|
4767
|
+
var timeStart = new Date('07/07/2022 ' + startTime);
|
|
4768
|
+
var timeEnd = new Date('07/07/2022 ' + endTime);
|
|
4769
|
+
var diff = timeEnd.getTime() - timeStart.getTime();
|
|
4770
|
+
var diff_as_date = new Date(diff);
|
|
4771
|
+
var hour = diff_as_date.getUTCHours();
|
|
4772
|
+
var minute = diff_as_date.getUTCMinutes();
|
|
4773
|
+
return {
|
|
4774
|
+
hour: hour,
|
|
4775
|
+
minute: minute
|
|
4776
|
+
};
|
|
4777
|
+
};
|
|
4778
|
+
|
|
4779
|
+
var getCustomLabel = function getCustomLabel(time, timeFormat, showDuration, referenceTime) {
|
|
4780
|
+
var label = time;
|
|
4781
|
+
|
|
4782
|
+
if (isFormat12Hour(timeFormat)) {
|
|
4783
|
+
label = convert24To12HourFormat(time);
|
|
4784
|
+
}
|
|
4785
|
+
|
|
4786
|
+
if (showDuration && referenceTime) {
|
|
4787
|
+
var _a = getTimeDifference(referenceTime, time),
|
|
4788
|
+
hour = _a.hour,
|
|
4789
|
+
minute = _a.minute;
|
|
4790
|
+
|
|
4791
|
+
var timeDiffLabel = " (" + hour + " hr " + minute + " min)";
|
|
4792
|
+
label += timeDiffLabel;
|
|
4793
|
+
}
|
|
4794
|
+
|
|
4795
|
+
return label;
|
|
4796
|
+
};
|
|
4797
|
+
|
|
4798
|
+
var isOptionDisabled = function isOptionDisabled(time, timeFormat, disabledSlotList) {
|
|
4799
|
+
var timeValue = time;
|
|
4800
|
+
|
|
4801
|
+
if (isFormat12Hour(timeFormat)) {
|
|
4802
|
+
timeValue = convert24To12HourFormat(time);
|
|
4803
|
+
}
|
|
4804
|
+
|
|
4805
|
+
if (disabledSlotList.includes(timeValue)) {
|
|
4806
|
+
return true;
|
|
4807
|
+
}
|
|
4808
|
+
|
|
4809
|
+
return false;
|
|
4810
|
+
};
|
|
4811
|
+
|
|
4812
|
+
var convertTimeToOptionList = function convertTimeToOptionList(timeList, timeFormat, id, showDuration, referenceTime, disabledSlotList) {
|
|
4813
|
+
if (id === void 0) {
|
|
4814
|
+
id = 'TimePicker-Option-key';
|
|
4815
|
+
}
|
|
4816
|
+
|
|
4817
|
+
var optionList = timeList.map(function (time, index) {
|
|
4818
|
+
return {
|
|
4819
|
+
label: getCustomLabel(time, timeFormat, showDuration, referenceTime),
|
|
4820
|
+
value: time,
|
|
4821
|
+
disabled: disabledSlotList && isOptionDisabled(time, timeFormat, disabledSlotList),
|
|
4822
|
+
selected: false,
|
|
4823
|
+
optionID: id + index
|
|
4824
|
+
};
|
|
4825
|
+
});
|
|
4826
|
+
return optionList;
|
|
4827
|
+
};
|
|
4828
|
+
|
|
4829
|
+
var computeEndTime = function computeEndTime(startTime) {
|
|
4830
|
+
return startTime ? '' : '23:59';
|
|
4831
|
+
};
|
|
4832
|
+
|
|
4833
|
+
var getDropdownOptionList = function getDropdownOptionList(props) {
|
|
4834
|
+
var startTime = props.startTime,
|
|
4835
|
+
endTime = props.endTime,
|
|
4836
|
+
interval = props.interval,
|
|
4837
|
+
timeFormat = props.timeFormat,
|
|
4838
|
+
showDuration = props.showDuration,
|
|
4839
|
+
disabledSlotList = props.disabledSlotList,
|
|
4840
|
+
id = props.id;
|
|
4841
|
+
var startTimeIn24Hr = startTime ? getTimeIn24HrFormat(startTime) : '00:00';
|
|
4842
|
+
var endTimeIn24Hr = endTime ? getTimeIn24HrFormat(endTime) : computeEndTime(startTime);
|
|
4843
|
+
var timeList = getTimeListIn24HourFormat(startTimeIn24Hr, endTimeIn24Hr, interval);
|
|
4844
|
+
var dropdownOptionList = convertTimeToOptionList(timeList, timeFormat, id, showDuration, startTime, disabledSlotList);
|
|
4845
|
+
return dropdownOptionList;
|
|
4846
|
+
};
|
|
4847
|
+
|
|
4848
|
+
var convertMinTo60 = function convertMinTo60(time) {
|
|
4849
|
+
var parseNum = parseInt(time, 10);
|
|
4850
|
+
if (parseNum < 10) return time;
|
|
4851
|
+
var timeInNum = parseNum > 60 ? parseNum % 60 : parseNum;
|
|
4852
|
+
var min = (timeInNum.toString() + '0').slice(0, 2);
|
|
4853
|
+
return min;
|
|
4854
|
+
};
|
|
4855
|
+
|
|
4856
|
+
var get24HourCurrentTime = function get24HourCurrentTime() {
|
|
4857
|
+
var today = new Date();
|
|
4858
|
+
return convertToTwoDigit(today.getHours()) + ':' + convertToTwoDigit(today.getMinutes());
|
|
4859
|
+
};
|
|
4860
|
+
|
|
4861
|
+
var convertHourTo24 = function convertHourTo24(time) {
|
|
4862
|
+
var timeInNum = parseInt(time, 10) % 24;
|
|
4863
|
+
return timeInNum.toString();
|
|
4864
|
+
};
|
|
4865
|
+
|
|
4866
|
+
var convertHourTo12 = function convertHourTo12(time) {
|
|
4867
|
+
var timeInNum = parseInt(time, 10) % 12;
|
|
4868
|
+
return timeInNum.toString();
|
|
4869
|
+
};
|
|
4870
|
+
|
|
4871
|
+
var _checkNumber = function _checkNumber(str) {
|
|
4872
|
+
var numberRegex = /^[0-9]+$/;
|
|
4873
|
+
return numberRegex.test(str);
|
|
4874
|
+
};
|
|
4875
|
+
|
|
4876
|
+
var _checkNumberWithAMPM = function _checkNumberWithAMPM(str) {
|
|
4877
|
+
var numberWithAMPMRegex = /^[0-9]+[ AaMmPp]+$/;
|
|
4878
|
+
return numberWithAMPMRegex.test(str);
|
|
4879
|
+
};
|
|
4880
|
+
|
|
4881
|
+
var _checkNumberWithSpecialChar = function _checkNumberWithSpecialChar(str) {
|
|
4882
|
+
var numberWithSpecialCharRegex = /^[0-9]+[`\s!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?~][0-9]*$/;
|
|
4883
|
+
return numberWithSpecialCharRegex.test(str);
|
|
4884
|
+
};
|
|
4885
|
+
|
|
4886
|
+
var _checkNumberWithSpecialCharAMPM = function _checkNumberWithSpecialCharAMPM(str) {
|
|
4887
|
+
var numberWithSpecialCharAMPM = /^[0-9]+[`\s!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?~][0-9]+[ AaMmPp]+$/;
|
|
4888
|
+
return numberWithSpecialCharAMPM.test(str);
|
|
4889
|
+
};
|
|
4890
|
+
|
|
4891
|
+
var specialCharRegex = /[`\s!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?~]/;
|
|
4892
|
+
|
|
4893
|
+
var getTimeFromNumberWithSpecialChar = function getTimeFromNumberWithSpecialChar(searchTime) {
|
|
4894
|
+
var time = searchTime.split(specialCharRegex);
|
|
4895
|
+
var hour = convertHourTo24(time[0]);
|
|
4896
|
+
var hh = convertToTwoDigit(hour);
|
|
4897
|
+
var min = time[1] !== '' ? convertMinTo60(time[1]) : '00';
|
|
4898
|
+
var mm = (min + '0').slice(0, 2);
|
|
4899
|
+
return {
|
|
4900
|
+
hour: hh,
|
|
4901
|
+
min: mm
|
|
4902
|
+
};
|
|
4903
|
+
};
|
|
4904
|
+
|
|
4905
|
+
var getSearchTimeFromNumber = function getSearchTimeFromNumber(searchTerm, show12HourFormat) {
|
|
4906
|
+
var searchLen = searchTerm.length;
|
|
4907
|
+
var searchTimeInNum = parseInt(searchTerm, 10);
|
|
4908
|
+
var firstTwoTerm = searchTerm.slice(0, 2);
|
|
4909
|
+
var hh = '00';
|
|
4910
|
+
var mm = '00';
|
|
4911
|
+
|
|
4912
|
+
switch (searchLen) {
|
|
4913
|
+
case 1:
|
|
4914
|
+
hh = '0' + searchTerm;
|
|
4915
|
+
break;
|
|
4916
|
+
|
|
4917
|
+
case 2:
|
|
4918
|
+
if (searchTimeInNum <= 24 || show12HourFormat && searchTimeInNum <= 12) {
|
|
4919
|
+
hh = convertToTwoDigit(searchTerm);
|
|
4920
|
+
} else {
|
|
4921
|
+
hh = '0' + searchTerm[0];
|
|
4922
|
+
mm = convertMinTo60(searchTerm[1] + '0');
|
|
4923
|
+
}
|
|
4924
|
+
|
|
4925
|
+
break;
|
|
4926
|
+
|
|
4927
|
+
case 3:
|
|
4928
|
+
hh = '0' + searchTerm[0];
|
|
4929
|
+
mm = convertMinTo60(searchTerm.slice(1));
|
|
4930
|
+
break;
|
|
4931
|
+
|
|
4932
|
+
case 4:
|
|
4933
|
+
hh = show12HourFormat ? convertHourTo12(firstTwoTerm) : convertHourTo24(firstTwoTerm);
|
|
4934
|
+
mm = convertMinTo60(searchTerm.slice(2));
|
|
4935
|
+
break;
|
|
4936
|
+
|
|
4937
|
+
default:
|
|
4938
|
+
hh = '-1';
|
|
4939
|
+
mm = '-1';
|
|
4940
|
+
}
|
|
4941
|
+
|
|
4942
|
+
return {
|
|
4943
|
+
hour: hh,
|
|
4944
|
+
min: mm
|
|
4945
|
+
};
|
|
4946
|
+
};
|
|
4947
|
+
|
|
4948
|
+
var getTimeFromNumberWithAMPM = function getTimeFromNumberWithAMPM(searchTime) {
|
|
4949
|
+
var timeArr = searchTime.split(/[\saAmMpP]/);
|
|
4950
|
+
|
|
4951
|
+
var _a = getSearchTimeFromNumber(timeArr[0], true),
|
|
4952
|
+
hour = _a.hour,
|
|
4953
|
+
min = _a.min;
|
|
4954
|
+
|
|
4955
|
+
return {
|
|
4956
|
+
hour: hour,
|
|
4957
|
+
min: min
|
|
4958
|
+
};
|
|
4959
|
+
};
|
|
4960
|
+
|
|
4961
|
+
var formatSearchTerm = function formatSearchTerm(optionList, searchTerm) {
|
|
4962
|
+
var searchTime = {
|
|
4963
|
+
hour: '00',
|
|
4964
|
+
min: '00'
|
|
4965
|
+
};
|
|
4966
|
+
|
|
4967
|
+
if (_checkNumber(searchTerm)) {
|
|
4968
|
+
var searchTimeInHHMM = getSearchTimeFromNumber(searchTerm);
|
|
4969
|
+
|
|
4970
|
+
if (parseInt(searchTimeInHHMM.hour) <= 12 && parseInt(searchTimeInHHMM.hour) > 0) {
|
|
4971
|
+
searchTime = getCurrentRelativeTime(optionList, searchTimeInHHMM);
|
|
4972
|
+
} else {
|
|
4973
|
+
searchTime = searchTimeInHHMM;
|
|
4974
|
+
}
|
|
4975
|
+
} else if (_checkNumberWithAMPM(searchTerm)) {
|
|
4976
|
+
searchTime = getTimeFromNumberWithAMPM(searchTerm);
|
|
4977
|
+
searchTime.hour = convert12To24HourFormat(searchTime.hour, searchTerm);
|
|
4978
|
+
} else if (_checkNumberWithSpecialChar(searchTerm)) {
|
|
4979
|
+
var searchTimeInHHMM = getTimeFromNumberWithSpecialChar(searchTerm);
|
|
4980
|
+
|
|
4981
|
+
if (parseInt(searchTimeInHHMM.hour) <= 12) {
|
|
4982
|
+
searchTime = getCurrentRelativeTime(optionList, searchTimeInHHMM);
|
|
4983
|
+
} else {
|
|
4984
|
+
searchTime = searchTimeInHHMM;
|
|
4985
|
+
}
|
|
4986
|
+
} else if (_checkNumberWithSpecialCharAMPM(searchTerm)) {
|
|
4987
|
+
var timeWithoutAMPM = searchTerm.replace(/[\saApPmM]/g, '');
|
|
4988
|
+
|
|
4989
|
+
if (_checkNumber(timeWithoutAMPM)) {
|
|
4990
|
+
searchTime = getSearchTimeFromNumber(timeWithoutAMPM, true);
|
|
4991
|
+
} else if (_checkNumberWithSpecialChar(timeWithoutAMPM)) {
|
|
4992
|
+
searchTime = getTimeFromNumberWithSpecialChar(timeWithoutAMPM);
|
|
4993
|
+
}
|
|
4994
|
+
|
|
4995
|
+
searchTime.hour = convert12To24HourFormat(searchTime.hour, searchTerm);
|
|
4996
|
+
}
|
|
4997
|
+
|
|
4998
|
+
return searchTime;
|
|
4999
|
+
};
|
|
5000
|
+
|
|
5001
|
+
var convert12To24HourFormat = function convert12To24HourFormat(hours, searchTerm) {
|
|
5002
|
+
if (hours === '12' && _isTimeInAM(searchTerm)) {
|
|
5003
|
+
hours = '00';
|
|
5004
|
+
} else if (_isTimeInPM(searchTerm) && hours !== '12') {
|
|
5005
|
+
hours = (parseInt(hours, 10) + 12).toString();
|
|
5006
|
+
}
|
|
5007
|
+
|
|
5008
|
+
return hours;
|
|
5009
|
+
};
|
|
5010
|
+
|
|
5011
|
+
var getCurrentRelativeTime = function getCurrentRelativeTime(optionList, searchTime) {
|
|
5012
|
+
var searchTimeStr = searchTime.hour + ":" + searchTime.min;
|
|
5013
|
+
var currentTime = get24HourCurrentTime();
|
|
5014
|
+
var greaterTime = checkTimeDifference(currentTime, searchTimeStr);
|
|
5015
|
+
var currentTimeIndex = findClosestTimeIndex(optionList, currentTime);
|
|
5016
|
+
var searchTimeIndex = findClosestTimeIndex(optionList, searchTimeStr);
|
|
5017
|
+
|
|
5018
|
+
if (greaterTime && currentTimeIndex > searchTimeIndex) {
|
|
5019
|
+
var hourIn24Format = parseInt(searchTime.hour, 10) + 12;
|
|
5020
|
+
searchTime.hour = hourIn24Format.toString();
|
|
5021
|
+
}
|
|
5022
|
+
|
|
5023
|
+
return searchTime;
|
|
5024
|
+
};
|
|
5025
|
+
|
|
5026
|
+
var findClosestTimeIndex = function findClosestTimeIndex(optionList, searchItem) {
|
|
5027
|
+
var closestItemIndex = 0;
|
|
5028
|
+
var minTime = {
|
|
5029
|
+
hour: 100,
|
|
5030
|
+
mins: 100
|
|
5031
|
+
};
|
|
5032
|
+
|
|
5033
|
+
for (var index = 0; index < optionList.length; index++) {
|
|
5034
|
+
var _a = getTimeDifference(searchItem, optionList[index]),
|
|
5035
|
+
hour = _a.hour,
|
|
5036
|
+
minute = _a.minute;
|
|
5037
|
+
|
|
5038
|
+
if (hour < minTime.hour || hour === minTime.hour && minute < minTime.mins) {
|
|
5039
|
+
minTime.hour = hour;
|
|
5040
|
+
minTime.mins = minute;
|
|
5041
|
+
closestItemIndex = index;
|
|
5042
|
+
}
|
|
5043
|
+
}
|
|
5044
|
+
|
|
5045
|
+
return closestItemIndex;
|
|
5046
|
+
};
|
|
5047
|
+
|
|
5048
|
+
var getSearchIndex = function getSearchIndex(optionList, searchTerm) {
|
|
5049
|
+
var _a = formatSearchTerm(optionList, searchTerm),
|
|
5050
|
+
hour = _a.hour,
|
|
5051
|
+
min = _a.min;
|
|
5052
|
+
|
|
5053
|
+
if (min === '60') {
|
|
5054
|
+
min = '00';
|
|
5055
|
+
hour = (parseInt(hour, 10) + 1).toString();
|
|
5056
|
+
}
|
|
5057
|
+
|
|
5058
|
+
var searchItem = hour + ":" + min;
|
|
5059
|
+
var searchIndex = findClosestTimeIndex(optionList, searchItem);
|
|
5060
|
+
return searchIndex;
|
|
5061
|
+
};
|
|
5062
|
+
|
|
5063
|
+
var countNumberInStr = function countNumberInStr(searchTerm) {
|
|
5064
|
+
var _a;
|
|
5065
|
+
|
|
5066
|
+
return ((_a = searchTerm.match(/\d/g)) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
5067
|
+
};
|
|
5068
|
+
|
|
5069
|
+
var isValidSearchTerm = function isValidSearchTerm(searchTerm) {
|
|
5070
|
+
var totalDigit = countNumberInStr(searchTerm);
|
|
5071
|
+
return totalDigit > 0 && totalDigit < 5;
|
|
5072
|
+
};
|
|
5073
|
+
|
|
5074
|
+
var getValueFromOptionList = function getValueFromOptionList(optionList) {
|
|
5075
|
+
var list = optionList.map(function (option) {
|
|
5076
|
+
return option.value;
|
|
5077
|
+
});
|
|
5078
|
+
return list;
|
|
5079
|
+
};
|
|
5080
|
+
|
|
5081
|
+
var getSearchValueIndex = function getSearchValueIndex(options, searchTerm) {
|
|
5082
|
+
if (!isValidSearchTerm(searchTerm)) {
|
|
5083
|
+
return -1;
|
|
5084
|
+
}
|
|
5085
|
+
|
|
5086
|
+
var searchIndex = getSearchIndex(options, searchTerm);
|
|
5087
|
+
return searchIndex;
|
|
5088
|
+
};
|
|
5089
|
+
|
|
5090
|
+
var getScrollIndex = function getScrollIndex(dropdownOptionList, searchTerm) {
|
|
5091
|
+
var optionList = getValueFromOptionList(dropdownOptionList);
|
|
5092
|
+
|
|
5093
|
+
if (searchTerm === '') {
|
|
5094
|
+
var currTime = get24HourCurrentTime();
|
|
5095
|
+
var currTimeIndex = findClosestTimeIndex(optionList, currTime);
|
|
5096
|
+
return currTimeIndex;
|
|
5097
|
+
}
|
|
5098
|
+
|
|
5099
|
+
return getSearchValueIndex(optionList, searchTerm);
|
|
5100
|
+
};
|
|
5101
|
+
|
|
5102
|
+
var TimePickerWithSearch = function TimePickerWithSearch(props) {
|
|
5103
|
+
var open = props.open,
|
|
5104
|
+
endTime = props.endTime,
|
|
5105
|
+
interval = props.interval,
|
|
5106
|
+
onChange = props.onChange,
|
|
5107
|
+
startTime = props.startTime,
|
|
5108
|
+
timeFormat = props.timeFormat,
|
|
5109
|
+
showDuration = props.showDuration,
|
|
5110
|
+
noResultMessage = props.noResultMessage,
|
|
5111
|
+
disabledSlotList = props.disabledSlotList,
|
|
5112
|
+
fetchTimeOptions = props.fetchTimeOptions;
|
|
5113
|
+
|
|
5114
|
+
var _a = React__namespace.useState(0),
|
|
5115
|
+
tabIndex = _a[0],
|
|
5116
|
+
setTabIndex = _a[1];
|
|
5117
|
+
|
|
5118
|
+
var _b = React__namespace.useState(false),
|
|
5119
|
+
openPopover = _b[0],
|
|
5120
|
+
setOpenPopover = _b[1];
|
|
5121
|
+
|
|
5122
|
+
var _c = React__namespace.useState(-1),
|
|
5123
|
+
selectedIndex = _c[0],
|
|
5124
|
+
setSelectedIndex = _c[1];
|
|
5125
|
+
|
|
5126
|
+
var _d = React__namespace.useState(0),
|
|
5127
|
+
counter = _d[0],
|
|
5128
|
+
setCounter = _d[1];
|
|
5129
|
+
|
|
5130
|
+
var dropdownOptionList = getDropdownOptionList(props);
|
|
5131
|
+
React__namespace.useEffect(function () {
|
|
5132
|
+
open !== undefined && setOpenPopover(open);
|
|
5133
|
+
}, [open]);
|
|
5134
|
+
React__namespace.useEffect(function () {
|
|
5135
|
+
var timer;
|
|
5136
|
+
|
|
5137
|
+
if (openPopover && selectedIndex != -1) {
|
|
5138
|
+
setTabIndex(selectedIndex);
|
|
5139
|
+
timer = setTimeout(function () {
|
|
5140
|
+
scrollToOptionIndex(selectedIndex, dropdownOptionList);
|
|
5141
|
+
}, 100);
|
|
5142
|
+
}
|
|
5143
|
+
|
|
5144
|
+
return function () {
|
|
5145
|
+
clearTimeout(timer);
|
|
5146
|
+
};
|
|
5147
|
+
}, [openPopover]);
|
|
5148
|
+
React__namespace.useEffect(function () {
|
|
5149
|
+
setCounter(counter + 1);
|
|
5150
|
+
}, [startTime, endTime, interval, showDuration, disabledSlotList]);
|
|
5151
|
+
|
|
5152
|
+
var onChangeHandler = function onChangeHandler(props) {
|
|
5153
|
+
var time = props;
|
|
5154
|
+
|
|
5155
|
+
if (isFormat12Hour(timeFormat)) {
|
|
5156
|
+
time = convert24To12HourFormat(time);
|
|
5157
|
+
}
|
|
5158
|
+
|
|
5159
|
+
var selectIndex = dropdownOptionList.findIndex(function (option) {
|
|
5160
|
+
return option.value === props;
|
|
5161
|
+
});
|
|
5162
|
+
setSelectedIndex(selectIndex);
|
|
5163
|
+
onChange && onChange(time);
|
|
5164
|
+
};
|
|
5165
|
+
|
|
5166
|
+
var getOptionList = function getOptionList(searchTerm) {
|
|
5167
|
+
var scrollIndex;
|
|
5168
|
+
var indexValue = getScrollIndex(dropdownOptionList, searchTerm);
|
|
5169
|
+
|
|
5170
|
+
if (searchTerm === '' && selectedIndex != -1) {
|
|
5171
|
+
scrollIndex = selectedIndex;
|
|
5172
|
+
setTabIndex(selectedIndex);
|
|
5173
|
+
} else {
|
|
5174
|
+
scrollIndex = indexValue;
|
|
5175
|
+
setTabIndex(indexValue);
|
|
5176
|
+
}
|
|
5177
|
+
|
|
5178
|
+
return Promise.resolve({
|
|
5179
|
+
options: indexValue === -1 ? [] : dropdownOptionList,
|
|
5180
|
+
count: dropdownOptionList.length,
|
|
5181
|
+
scrollToIndex: scrollIndex === 0 ? scrollIndex + 1 : scrollIndex,
|
|
5182
|
+
searchTerm: searchTerm
|
|
5183
|
+
});
|
|
5184
|
+
};
|
|
5185
|
+
|
|
5186
|
+
var fetchOptionList = function fetchOptionList() {
|
|
5187
|
+
return fetchTimeOptions ? fetchTimeOptions : getOptionList;
|
|
5188
|
+
};
|
|
5189
|
+
|
|
5190
|
+
return /*#__PURE__*/React__namespace.createElement(Dropdown, {
|
|
5191
|
+
key: counter,
|
|
5192
|
+
maxHeight: 160,
|
|
5193
|
+
loadersCount: 0,
|
|
5194
|
+
withSearch: true,
|
|
5195
|
+
open: openPopover,
|
|
5196
|
+
tabIndex: tabIndex,
|
|
5197
|
+
searchPlaceholder: "Search",
|
|
5198
|
+
onChange: onChangeHandler,
|
|
5199
|
+
fetchOptions: fetchOptionList(),
|
|
5200
|
+
noResultMessage: noResultMessage,
|
|
5201
|
+
staticLimit: dropdownOptionList.length,
|
|
5202
|
+
onPopperToggle: function onPopperToggle() {
|
|
5203
|
+
setOpenPopover(!openPopover);
|
|
5204
|
+
}
|
|
5205
|
+
});
|
|
5206
|
+
};
|
|
5207
|
+
TimePickerWithSearch.defaultProps = {
|
|
5208
|
+
timeFormat: '12-Hour',
|
|
5209
|
+
interval: 15
|
|
5210
|
+
};
|
|
5211
|
+
TimePickerWithSearch.displayName = 'TimePickerWithSearch';
|
|
5212
|
+
|
|
5213
|
+
var TimePickerWithInput = function TimePickerWithInput(props) {
|
|
4651
5214
|
var validators = props.validators,
|
|
4652
5215
|
inputOptions = props.inputOptions,
|
|
4653
5216
|
inputFormat = props.inputFormat,
|
|
@@ -4725,12 +5288,18 @@
|
|
|
4725
5288
|
id: "parent-TimePicker"
|
|
4726
5289
|
}));
|
|
4727
5290
|
};
|
|
4728
|
-
|
|
5291
|
+
TimePickerWithInput.defaultProps = {
|
|
4729
5292
|
inputFormat: 'hh:mm AM',
|
|
4730
5293
|
outputFormat: 'hh:mm AM',
|
|
4731
5294
|
inputOptions: {},
|
|
4732
5295
|
validators: [time$1]
|
|
4733
5296
|
};
|
|
5297
|
+
TimePickerWithInput.displayName = 'TimePickerWithInput';
|
|
5298
|
+
|
|
5299
|
+
var TimePicker = function TimePicker(props) {
|
|
5300
|
+
return props.withSearch ? /*#__PURE__*/React__namespace.createElement(TimePickerWithSearch, __assign({}, props)) : /*#__PURE__*/React__namespace.createElement(TimePickerWithInput, __assign({}, props));
|
|
5301
|
+
};
|
|
5302
|
+
TimePicker.defaultProps = __assign(__assign({}, TimePickerWithInput.defaultProps), TimePickerWithSearch.defaultProps);
|
|
4734
5303
|
TimePicker.displayName = 'TimePicker';
|
|
4735
5304
|
|
|
4736
5305
|
var sizeMap = {
|
|
@@ -7686,12 +8255,17 @@
|
|
|
7686
8255
|
isChildrenVisible = props.isChildrenVisible,
|
|
7687
8256
|
onClick = props.onClick,
|
|
7688
8257
|
customItemRenderer = props.customItemRenderer;
|
|
7689
|
-
var baseProps = extractBaseProps(props);
|
|
7690
8258
|
|
|
7691
|
-
var onClickHandler = function onClickHandler() {
|
|
8259
|
+
var onClickHandler = function onClickHandler(ev) {
|
|
8260
|
+
ev.preventDefault();
|
|
7692
8261
|
if (onClick) onClick(menu);
|
|
7693
8262
|
};
|
|
7694
8263
|
|
|
8264
|
+
var baseProps = __assign({
|
|
8265
|
+
onClick: onClickHandler,
|
|
8266
|
+
href: menu.link
|
|
8267
|
+
}, extractBaseProps(props));
|
|
8268
|
+
|
|
7695
8269
|
var ItemClass = classNames__default["default"]((_a = {}, _a['MenuItem'] = true, _a['MenuItem--vertical'] = true, _a['MenuItem--collapsed'] = !expanded, _a['MenuItem--expanded'] = expanded, _a['MenuItem--active'] = isActive, _a['MenuItem--disabled'] = menu.disabled, _a['MenuItem--subMenu'] = isChildren && expanded, _a['MenuItem--rounded'] = rounded && expanded, _a));
|
|
7696
8270
|
|
|
7697
8271
|
var renderSubMenu = function renderSubMenu() {
|
|
@@ -7737,11 +8311,10 @@
|
|
|
7737
8311
|
}
|
|
7738
8312
|
});
|
|
7739
8313
|
|
|
7740
|
-
return customItemRenderer ? customItemRenderer(customItemProps) : /*#__PURE__*/React__namespace.createElement(
|
|
8314
|
+
return customItemRenderer ? customItemRenderer(customItemProps) : /*#__PURE__*/React__namespace.createElement(GenericText, __assign({
|
|
8315
|
+
componentType: "a",
|
|
7741
8316
|
className: ItemClass
|
|
7742
|
-
}, baseProps, {
|
|
7743
|
-
onClick: onClickHandler
|
|
7744
|
-
}), /*#__PURE__*/React__namespace.createElement("div", {
|
|
8317
|
+
}, baseProps), /*#__PURE__*/React__namespace.createElement("div", {
|
|
7745
8318
|
className: "d-flex align-items-center overflow-hidden"
|
|
7746
8319
|
}, menu.icon && /*#__PURE__*/React__namespace.createElement(Icon, {
|
|
7747
8320
|
"data-test": "DesignSystem-VerticalNav--Icon",
|
|
@@ -11049,7 +11622,7 @@
|
|
|
11049
11622
|
});
|
|
11050
11623
|
};
|
|
11051
11624
|
|
|
11052
|
-
var COMMON_MIME_TYPES = new Map([['avi', 'video/avi'], ['gif', 'image/gif'], ['ico', 'image/x-icon'], ['jpeg', 'image/jpeg'], ['jpg', 'image/jpeg'], ['mkv', 'video/x-matroska'], ['mov', 'video/quicktime'], ['mp4', 'video/mp4'], ['pdf', 'application/pdf'], ['png', 'image/png'], ['zip', 'application/zip'], ['doc', 'application/msword'], ['docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document']]);
|
|
11625
|
+
var COMMON_MIME_TYPES = new Map([['avi', 'video/avi'], ['gif', 'image/gif'], ['ico', 'image/x-icon'], ['jpeg', 'image/jpeg'], ['jpg', 'image/jpeg'], ['mkv', 'video/x-matroska'], ['mov', 'video/quicktime'], ['mp4', 'video/mp4'], ['pdf', 'application/pdf'], ['png', 'image/png'], ['zip', 'application/zip'], ['doc', 'application/msword'], ['docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'], ['csv', 'text/csv'], ['xlss', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'], ['xls', 'application/vnd.ms-excel']]);
|
|
11053
11626
|
var FILES_TO_IGNORE = ['.DS_Store', 'Thumbs.db'];
|
|
11054
11627
|
function fromEvent(evt) {
|
|
11055
11628
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -14778,7 +15351,7 @@
|
|
|
14778
15351
|
vertical: false
|
|
14779
15352
|
};
|
|
14780
15353
|
|
|
14781
|
-
var version = "2.13.
|
|
15354
|
+
var version = "2.13.4-2";
|
|
14782
15355
|
|
|
14783
15356
|
exports.Avatar = Avatar;
|
|
14784
15357
|
exports.AvatarGroup = AvatarGroup;
|
|
@@ -14843,6 +15416,7 @@
|
|
|
14843
15416
|
exports.Paragraph = Paragraph;
|
|
14844
15417
|
exports.Pills = Pills;
|
|
14845
15418
|
exports.Placeholder = Placeholder;
|
|
15419
|
+
exports.PlaceholderImage = PlaceholderImage;
|
|
14846
15420
|
exports.PlaceholderParagraph = PlaceholderParagraph;
|
|
14847
15421
|
exports.Popover = Popover;
|
|
14848
15422
|
exports.ProgressBar = ProgressBar;
|