@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.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* Generated on:
|
|
3
|
+
* Generated on: 1661977121792
|
|
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
|
*/
|
|
@@ -1279,6 +1279,15 @@ var getSelectAll$1 = function getSelectAll(selected, optionsLength, disabledOpti
|
|
|
1279
1279
|
checked: false
|
|
1280
1280
|
};
|
|
1281
1281
|
};
|
|
1282
|
+
var scrollToOptionIndex = function scrollToOptionIndex(scrollIndex, listOptions) {
|
|
1283
|
+
var _listOptions$scrollIn;
|
|
1284
|
+
|
|
1285
|
+
var optionID = listOptions && ((_listOptions$scrollIn = listOptions[scrollIndex]) === null || _listOptions$scrollIn === void 0 ? void 0 : _listOptions$scrollIn.optionID);
|
|
1286
|
+
var targetOption = document.getElementById(optionID);
|
|
1287
|
+
targetOption && targetOption.scrollIntoView && targetOption.scrollIntoView({
|
|
1288
|
+
block: 'center'
|
|
1289
|
+
});
|
|
1290
|
+
};
|
|
1282
1291
|
|
|
1283
1292
|
var _excluded$A = ["triggerSize", "placeholder", "menu", "children", "icon", "disabled", "open", "inlineLabel", "error"];
|
|
1284
1293
|
var DropdownButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
@@ -1676,7 +1685,8 @@ var DefaultOption = function DefaultOption(props) {
|
|
|
1676
1685
|
className: 'Option-label'
|
|
1677
1686
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
1678
1687
|
className: textClassName,
|
|
1679
|
-
appearance: appearance
|
|
1688
|
+
appearance: appearance,
|
|
1689
|
+
id: optionData.optionID
|
|
1680
1690
|
}, label)))
|
|
1681
1691
|
);
|
|
1682
1692
|
};
|
|
@@ -2038,7 +2048,7 @@ var alignmentMapping = {
|
|
|
2038
2048
|
};
|
|
2039
2049
|
|
|
2040
2050
|
var DropdownList = function DropdownList(props) {
|
|
2041
|
-
var
|
|
2051
|
+
var _classNames4, _classNames5;
|
|
2042
2052
|
|
|
2043
2053
|
var _props$listOptions = props.listOptions,
|
|
2044
2054
|
listOptions = _props$listOptions === void 0 ? [] : _props$listOptions,
|
|
@@ -2077,7 +2087,8 @@ var DropdownList = function DropdownList(props) {
|
|
|
2077
2087
|
toggleDropdown = props.toggleDropdown,
|
|
2078
2088
|
className = props.className,
|
|
2079
2089
|
_props$searchPlacehol = props.searchPlaceholder,
|
|
2080
|
-
searchPlaceholder = _props$searchPlacehol === void 0 ? 'Search..' : _props$searchPlacehol
|
|
2090
|
+
searchPlaceholder = _props$searchPlacehol === void 0 ? 'Search..' : _props$searchPlacehol,
|
|
2091
|
+
scrollIndex = props.scrollIndex;
|
|
2081
2092
|
var baseProps = extractBaseProps(props);
|
|
2082
2093
|
var dropdownRef = /*#__PURE__*/React.createRef();
|
|
2083
2094
|
var triggerRef = /*#__PURE__*/React.createRef();
|
|
@@ -2093,11 +2104,11 @@ var DropdownList = function DropdownList(props) {
|
|
|
2093
2104
|
var _React$useState3 = React.useState(firstEnabledOption),
|
|
2094
2105
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
2095
2106
|
cursor = _React$useState4[0],
|
|
2096
|
-
setCursor = _React$useState4[1];
|
|
2107
|
+
setCursor = _React$useState4[1];
|
|
2097
2108
|
|
|
2098
|
-
|
|
2099
|
-
var animateOrder = 0;
|
|
2100
2109
|
React.useEffect(function () {
|
|
2110
|
+
var timer;
|
|
2111
|
+
|
|
2101
2112
|
if (dropdownOpen) {
|
|
2102
2113
|
var _triggerRef$current;
|
|
2103
2114
|
|
|
@@ -2111,8 +2122,18 @@ var DropdownList = function DropdownList(props) {
|
|
|
2111
2122
|
minWidth: minWidth ? minWidth : popperMinWidth,
|
|
2112
2123
|
maxWidth: maxWidth ? maxWidth : '100%'
|
|
2113
2124
|
};
|
|
2114
|
-
setPopoverStyle(popperWrapperStyle);
|
|
2125
|
+
setPopoverStyle(popperWrapperStyle); // scrolls to current time
|
|
2126
|
+
|
|
2127
|
+
if (scrollIndex && tempSelected.length === 0) {
|
|
2128
|
+
timer = setTimeout(function () {
|
|
2129
|
+
scrollToOptionIndex(scrollIndex, listOptions);
|
|
2130
|
+
}, 100);
|
|
2131
|
+
}
|
|
2115
2132
|
}
|
|
2133
|
+
|
|
2134
|
+
return function () {
|
|
2135
|
+
clearTimeout(timer);
|
|
2136
|
+
};
|
|
2116
2137
|
}, [dropdownOpen]);
|
|
2117
2138
|
React.useEffect(function () {
|
|
2118
2139
|
if (firstEnabledOption !== cursor) setCursor(firstEnabledOption);
|
|
@@ -2153,24 +2174,15 @@ var DropdownList = function DropdownList(props) {
|
|
|
2153
2174
|
return Dropdown;
|
|
2154
2175
|
};
|
|
2155
2176
|
|
|
2156
|
-
var animateClass = classnames((_classNames2 = {}, _defineProperty$1(_classNames2, 'fade-in', dropdownOpen), _defineProperty$1(_classNames2, 'opacity-0', dropdownOpen), _defineProperty$1(_classNames2, 'Dropdown-items', true), _classNames2));
|
|
2157
|
-
|
|
2158
|
-
var getAnimateOrderStyle = function getAnimateOrderStyle(order) {
|
|
2159
|
-
var animateStyle = {
|
|
2160
|
-
animationDelay: dropdownOpen ? order * 20 + 'ms' : ''
|
|
2161
|
-
};
|
|
2162
|
-
return animateStyle;
|
|
2163
|
-
};
|
|
2164
|
-
|
|
2165
2177
|
var getDropdownSectionClass = function getDropdownSectionClass(showClearButton) {
|
|
2166
|
-
var
|
|
2178
|
+
var _classNames2;
|
|
2167
2179
|
|
|
2168
|
-
return classnames((
|
|
2180
|
+
return classnames((_classNames2 = {}, _defineProperty$1(_classNames2, 'Dropdown-section', true), _defineProperty$1(_classNames2, 'Dropdown-section--withClear', showClearButton), _classNames2));
|
|
2169
2181
|
};
|
|
2170
2182
|
|
|
2171
2183
|
var dropdownClass = classnames(_defineProperty$1({}, 'Dropdown', true), className);
|
|
2172
|
-
var dropdownWrapperClass = classnames((
|
|
2173
|
-
var SelectAllClass = classnames((
|
|
2184
|
+
var dropdownWrapperClass = classnames((_classNames4 = {}, _defineProperty$1(_classNames4, 'Dropdown-wrapper', true), _defineProperty$1(_classNames4, 'Dropdown-wrapper--wrap', !truncateOption), _classNames4));
|
|
2185
|
+
var SelectAllClass = classnames((_classNames5 = {}, _defineProperty$1(_classNames5, 'Option-checkbox', true), _defineProperty$1(_classNames5, 'Option-checkbox--active', cursor === 0), _defineProperty$1(_classNames5, 'OptionWrapper', true), _classNames5));
|
|
2174
2186
|
|
|
2175
2187
|
var onToggleDropdown = function onToggleDropdown(open, type) {
|
|
2176
2188
|
var _dropdownTriggerRef$c;
|
|
@@ -2220,8 +2232,7 @@ var DropdownList = function DropdownList(props) {
|
|
|
2220
2232
|
var _props$footerLabel = props.footerLabel,
|
|
2221
2233
|
footerLabel = _props$footerLabel === void 0 ? 'Search for more options' : _props$footerLabel;
|
|
2222
2234
|
return /*#__PURE__*/React.createElement("div", {
|
|
2223
|
-
className: "Dropdown-footer
|
|
2224
|
-
style: getAnimateOrderStyle(++animateOrder)
|
|
2235
|
+
className: "Dropdown-footer"
|
|
2225
2236
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
2226
2237
|
size: "small",
|
|
2227
2238
|
appearance: 'subtle'
|
|
@@ -2234,8 +2245,7 @@ var DropdownList = function DropdownList(props) {
|
|
|
2234
2245
|
return option.disabled;
|
|
2235
2246
|
});
|
|
2236
2247
|
return /*#__PURE__*/React.createElement("div", {
|
|
2237
|
-
className: getDropdownSectionClass(selectedGroup)
|
|
2238
|
-
style: getAnimateOrderStyle(++animateOrder)
|
|
2248
|
+
className: getDropdownSectionClass(selectedGroup)
|
|
2239
2249
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
2240
2250
|
size: "small",
|
|
2241
2251
|
appearance: 'subtle'
|
|
@@ -2252,8 +2262,7 @@ var DropdownList = function DropdownList(props) {
|
|
|
2252
2262
|
var disable = _isEqual(previousSelected, tempSelected);
|
|
2253
2263
|
|
|
2254
2264
|
return /*#__PURE__*/React.createElement("div", {
|
|
2255
|
-
className: "Dropdown-buttonWrapper
|
|
2256
|
-
style: getAnimateOrderStyle(++animateOrder)
|
|
2265
|
+
className: "Dropdown-buttonWrapper"
|
|
2257
2266
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
2258
2267
|
ref: dropdownCancelButtonRef,
|
|
2259
2268
|
className: "mr-4",
|
|
@@ -2274,8 +2283,7 @@ var DropdownList = function DropdownList(props) {
|
|
|
2274
2283
|
|
|
2275
2284
|
var renderSearch = function renderSearch() {
|
|
2276
2285
|
return /*#__PURE__*/React.createElement("div", {
|
|
2277
|
-
className: "Dropdown-inputWrapper
|
|
2278
|
-
style: getAnimateOrderStyle(++animateOrder)
|
|
2286
|
+
className: "Dropdown-inputWrapper"
|
|
2279
2287
|
}, /*#__PURE__*/React.createElement(Input, {
|
|
2280
2288
|
name: "Dropdown-search",
|
|
2281
2289
|
icon: 'search',
|
|
@@ -2312,7 +2320,6 @@ var DropdownList = function DropdownList(props) {
|
|
|
2312
2320
|
onSelectAll = props.onSelectAll;
|
|
2313
2321
|
var label = selectAllLabel.trim() ? selectAllLabel.trim() : 'Select All';
|
|
2314
2322
|
return /*#__PURE__*/React.createElement("div", {
|
|
2315
|
-
style: getAnimateOrderStyle(++animateOrder),
|
|
2316
2323
|
className: SelectAllClass,
|
|
2317
2324
|
onMouseEnter: function onMouseEnter() {
|
|
2318
2325
|
return updateActiveOption(0, true);
|
|
@@ -2338,10 +2345,7 @@ var DropdownList = function DropdownList(props) {
|
|
|
2338
2345
|
var optionIsSelected = tempSelected.findIndex(function (option) {
|
|
2339
2346
|
return option.value === item.value;
|
|
2340
2347
|
}) !== -1;
|
|
2341
|
-
return /*#__PURE__*/React.createElement(
|
|
2342
|
-
style: getAnimateOrderStyle(++animateOrder),
|
|
2343
|
-
className: animateClass
|
|
2344
|
-
}, /*#__PURE__*/React.createElement(Option, {
|
|
2348
|
+
return /*#__PURE__*/React.createElement(Option, {
|
|
2345
2349
|
optionData: item,
|
|
2346
2350
|
truncateOption: truncateOption,
|
|
2347
2351
|
selected: optionIsSelected,
|
|
@@ -2358,7 +2362,7 @@ var DropdownList = function DropdownList(props) {
|
|
|
2358
2362
|
return props.onSelect(item, e.target.checked);
|
|
2359
2363
|
},
|
|
2360
2364
|
optionType: props.optionType
|
|
2361
|
-
})
|
|
2365
|
+
});
|
|
2362
2366
|
};
|
|
2363
2367
|
|
|
2364
2368
|
var renderDropdownSection = function renderDropdownSection() {
|
|
@@ -2525,7 +2529,7 @@ var DropdownList = function DropdownList(props) {
|
|
|
2525
2529
|
|
|
2526
2530
|
DropdownList.displayName = 'DropdownList';
|
|
2527
2531
|
|
|
2528
|
-
var _excluded$v = ["triggerOptions", "selected"];
|
|
2532
|
+
var _excluded$v = ["triggerOptions", "selected", "tabIndex"];
|
|
2529
2533
|
var inputRef = /*#__PURE__*/React.createRef();
|
|
2530
2534
|
|
|
2531
2535
|
/**
|
|
@@ -2630,6 +2634,12 @@ var Dropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
2630
2634
|
var options = res.options,
|
|
2631
2635
|
count = res.count;
|
|
2632
2636
|
|
|
2637
|
+
if (res.scrollToIndex) {
|
|
2638
|
+
setTimeout(function () {
|
|
2639
|
+
scrollToOptionIndex(res.scrollToIndex, options);
|
|
2640
|
+
}, 0);
|
|
2641
|
+
}
|
|
2642
|
+
|
|
2633
2643
|
if (!res.searchTerm || res.searchTerm && res.searchTerm === _this.state.searchTerm) {
|
|
2634
2644
|
var _inputRef$current;
|
|
2635
2645
|
|
|
@@ -2641,6 +2651,7 @@ var Dropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
2641
2651
|
var disabledOptions = _this.getDisabledOptions(unSelectedGroup.slice(0, _this.staticLimit));
|
|
2642
2652
|
|
|
2643
2653
|
_this.setState(_objectSpread2(_objectSpread2({}, _this.state), {}, {
|
|
2654
|
+
scrollIndex: res.scrollToIndex || 0,
|
|
2644
2655
|
optionsLength: optionsLength,
|
|
2645
2656
|
loading: false,
|
|
2646
2657
|
async: updatedAsync,
|
|
@@ -3116,7 +3127,8 @@ var Dropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
3116
3127
|
tempSelected = _this$state7.tempSelected,
|
|
3117
3128
|
selectAll = _this$state7.selectAll,
|
|
3118
3129
|
triggerLabel = _this$state7.triggerLabel,
|
|
3119
|
-
previousSelected = _this$state7.previousSelected
|
|
3130
|
+
previousSelected = _this$state7.previousSelected,
|
|
3131
|
+
scrollIndex = _this$state7.scrollIndex;
|
|
3120
3132
|
var _this$props12 = this.props,
|
|
3121
3133
|
_this$props12$withSel = _this$props12.withSelectAll,
|
|
3122
3134
|
withSelectAll = _this$props12$withSel === void 0 ? true : _this$props12$withSel,
|
|
@@ -3126,10 +3138,11 @@ var Dropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
3126
3138
|
_this$props13$trigger = _this$props13.triggerOptions,
|
|
3127
3139
|
triggerOptions = _this$props13$trigger === void 0 ? {} : _this$props13$trigger;
|
|
3128
3140
|
_this$props13.selected;
|
|
3129
|
-
var
|
|
3141
|
+
var tabIndex = _this$props13.tabIndex,
|
|
3142
|
+
rest = _objectWithoutProperties(_this$props13, _excluded$v);
|
|
3130
3143
|
|
|
3131
3144
|
var remainingOptionsLen = searchedOptionsLength - options.length;
|
|
3132
|
-
var firstEnabledOption = _isSelectAllPresent(searchTerm, remainingOptionsLen, withSelectAll, withCheckbox) ? 0 : options.findIndex(function (option) {
|
|
3145
|
+
var firstEnabledOption = tabIndex ? tabIndex : _isSelectAllPresent(searchTerm, remainingOptionsLen, withSelectAll, withCheckbox) ? 0 : options.findIndex(function (option) {
|
|
3133
3146
|
return !option.disabled;
|
|
3134
3147
|
});
|
|
3135
3148
|
return /*#__PURE__*/React.createElement(DropdownList, _extends$2({
|
|
@@ -3155,7 +3168,8 @@ var Dropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
3155
3168
|
onSearchChange: this.updateSearchTerm,
|
|
3156
3169
|
onOptionSelect: this.onOptionSelect,
|
|
3157
3170
|
onSelectAll: this.onSelectAll,
|
|
3158
|
-
customTrigger: triggerOptions.customTrigger
|
|
3171
|
+
customTrigger: triggerOptions.customTrigger,
|
|
3172
|
+
scrollIndex: scrollIndex
|
|
3159
3173
|
}, rest));
|
|
3160
3174
|
}
|
|
3161
3175
|
}]);
|
|
@@ -5118,7 +5132,650 @@ _defineProperty$1(DatePicker, "defaultProps", _objectSpread2(_objectSpread2({},
|
|
|
5118
5132
|
closeOnSelect: true
|
|
5119
5133
|
}));
|
|
5120
5134
|
|
|
5121
|
-
var
|
|
5135
|
+
var parseDate = function parseDate(date_time) {
|
|
5136
|
+
var d = new Date();
|
|
5137
|
+
d.setHours(date_time.substring(0, 2));
|
|
5138
|
+
d.setMinutes(date_time.substring(3, 5));
|
|
5139
|
+
return d;
|
|
5140
|
+
};
|
|
5141
|
+
|
|
5142
|
+
var isFormat12Hour = function isFormat12Hour(format) {
|
|
5143
|
+
return format === '12-Hour';
|
|
5144
|
+
};
|
|
5145
|
+
|
|
5146
|
+
var isTimeIn12HourFormat = function isTimeIn12HourFormat(time) {
|
|
5147
|
+
return _isTimeInAM(time) || _isTimeInPM(time);
|
|
5148
|
+
};
|
|
5149
|
+
|
|
5150
|
+
var _isTimeInAM = function _isTimeInAM(time) {
|
|
5151
|
+
return time.includes('a') || time.includes('A');
|
|
5152
|
+
};
|
|
5153
|
+
var _isTimeInPM = function _isTimeInPM(time) {
|
|
5154
|
+
return time.includes('p') || time.includes('P');
|
|
5155
|
+
};
|
|
5156
|
+
/**
|
|
5157
|
+
* Convert time from 12 hour format to 24 hour format
|
|
5158
|
+
* @param timeStr in hh:mm [AM/PM] format
|
|
5159
|
+
* @returns time in HH:MM format
|
|
5160
|
+
*/
|
|
5161
|
+
|
|
5162
|
+
var convert12To24HourFormat$1 = function convert12To24HourFormat(timeStr) {
|
|
5163
|
+
var _timeStr$split = timeStr.split(' '),
|
|
5164
|
+
_timeStr$split2 = _slicedToArray(_timeStr$split, 2),
|
|
5165
|
+
time = _timeStr$split2[0],
|
|
5166
|
+
modifier = _timeStr$split2[1];
|
|
5167
|
+
|
|
5168
|
+
var timeArr = time.split(':');
|
|
5169
|
+
var hours = timeArr[0];
|
|
5170
|
+
var minutes = timeArr[1];
|
|
5171
|
+
|
|
5172
|
+
if (hours === '12' && _isTimeInAM(modifier)) {
|
|
5173
|
+
hours = '00';
|
|
5174
|
+
}
|
|
5175
|
+
|
|
5176
|
+
if (_isTimeInPM(modifier) && hours !== '12') {
|
|
5177
|
+
hours = (parseInt(hours, 10) + 12).toString();
|
|
5178
|
+
}
|
|
5179
|
+
|
|
5180
|
+
return "".concat(hours, ":").concat(minutes);
|
|
5181
|
+
};
|
|
5182
|
+
/**
|
|
5183
|
+
* @param val
|
|
5184
|
+
* @returns insert 0 at start in case of single digit
|
|
5185
|
+
*/
|
|
5186
|
+
|
|
5187
|
+
var convertToTwoDigit = function convertToTwoDigit(val) {
|
|
5188
|
+
return ('0' + val).slice(-2);
|
|
5189
|
+
};
|
|
5190
|
+
/**
|
|
5191
|
+
* Convert time from 24 hour format to 12 hour format
|
|
5192
|
+
* @param timeStr in HH:MM format
|
|
5193
|
+
* @returns time in hh:mm [AM/PM] format
|
|
5194
|
+
*/
|
|
5195
|
+
|
|
5196
|
+
var convert24To12HourFormat = function convert24To12HourFormat(timeStr) {
|
|
5197
|
+
var timeArr = timeStr.split(':');
|
|
5198
|
+
var hours = parseInt(timeArr[0], 10);
|
|
5199
|
+
var modifier = hours >= 12 ? 'PM' : 'AM';
|
|
5200
|
+
var convertedHours = hours % 12 || 12;
|
|
5201
|
+
var hoursInString = convertedHours.toString();
|
|
5202
|
+
hoursInString = convertToTwoDigit(hoursInString);
|
|
5203
|
+
var minutes = timeArr[1];
|
|
5204
|
+
var result = "".concat(hoursInString.toString(), ":").concat(minutes, " ").concat(modifier);
|
|
5205
|
+
return result;
|
|
5206
|
+
};
|
|
5207
|
+
|
|
5208
|
+
var getTimeIn24HrFormat = function getTimeIn24HrFormat(timeStr) {
|
|
5209
|
+
if (isTimeIn12HourFormat(timeStr)) {
|
|
5210
|
+
return convert12To24HourFormat$1(timeStr);
|
|
5211
|
+
}
|
|
5212
|
+
|
|
5213
|
+
return timeStr;
|
|
5214
|
+
};
|
|
5215
|
+
/**
|
|
5216
|
+
* @param startTime in HH:MM format
|
|
5217
|
+
* @param endTime in HH:MM format
|
|
5218
|
+
* @returns returns true if start time is greater than end time
|
|
5219
|
+
*/
|
|
5220
|
+
|
|
5221
|
+
|
|
5222
|
+
var checkTimeDifference = function checkTimeDifference(startTime, endTime) {
|
|
5223
|
+
var parseStartTime = parseDate(startTime);
|
|
5224
|
+
var parseEndTime = parseDate(endTime);
|
|
5225
|
+
return parseStartTime > parseEndTime;
|
|
5226
|
+
};
|
|
5227
|
+
/**
|
|
5228
|
+
* @param startTime in HH:MM format
|
|
5229
|
+
* @param endTime in HH:MM format
|
|
5230
|
+
* @param interval
|
|
5231
|
+
* @returns array of 24 hour time list based on interval
|
|
5232
|
+
*/
|
|
5233
|
+
|
|
5234
|
+
var get24HourTimeList = function get24HourTimeList(startTime, endTime, interval) {
|
|
5235
|
+
var timeList = [];
|
|
5236
|
+
var parseStartTime = parseDate(startTime);
|
|
5237
|
+
var parseEndTime = parseDate(endTime);
|
|
5238
|
+
|
|
5239
|
+
while (parseStartTime <= parseEndTime) {
|
|
5240
|
+
timeList.push(parseStartTime.toTimeString().substring(0, 5));
|
|
5241
|
+
parseStartTime.setMinutes(parseStartTime.getMinutes() + interval);
|
|
5242
|
+
}
|
|
5243
|
+
|
|
5244
|
+
return timeList;
|
|
5245
|
+
};
|
|
5246
|
+
/**
|
|
5247
|
+
* @param startTime in HH:MM format
|
|
5248
|
+
* @param interval
|
|
5249
|
+
* @returns time list in 24 hour format including times option for next day
|
|
5250
|
+
*/
|
|
5251
|
+
|
|
5252
|
+
|
|
5253
|
+
var getReverseTimeList = function getReverseTimeList(startTime, endTime, interval) {
|
|
5254
|
+
var timeList = get24HourTimeList('00:00', '23:59', interval);
|
|
5255
|
+
var startTimeIndex = timeList.indexOf(startTime);
|
|
5256
|
+
var endTimeIndex = timeList.indexOf(endTime);
|
|
5257
|
+
var nextDayTimeIndex = endTime === '' ? startTimeIndex : endTimeIndex + 1;
|
|
5258
|
+
var presentDayList = timeList.slice(startTimeIndex);
|
|
5259
|
+
var nextDayList = timeList.slice(0, nextDayTimeIndex);
|
|
5260
|
+
var result = presentDayList.concat(nextDayList);
|
|
5261
|
+
return result;
|
|
5262
|
+
};
|
|
5263
|
+
|
|
5264
|
+
var getTimeListIn24HourFormat = function getTimeListIn24HourFormat(startTime, endTime, interval) {
|
|
5265
|
+
if (endTime === '' || checkTimeDifference(startTime, endTime)) {
|
|
5266
|
+
return getReverseTimeList(startTime, endTime, interval);
|
|
5267
|
+
}
|
|
5268
|
+
|
|
5269
|
+
return get24HourTimeList(startTime, endTime, interval);
|
|
5270
|
+
};
|
|
5271
|
+
|
|
5272
|
+
var getTimeDifference = function getTimeDifference(startTime, endTime) {
|
|
5273
|
+
var timeStart = new Date('07/07/2022 ' + startTime);
|
|
5274
|
+
var timeEnd = new Date('07/07/2022 ' + endTime);
|
|
5275
|
+
var diff = timeEnd.getTime() - timeStart.getTime();
|
|
5276
|
+
var diff_as_date = new Date(diff);
|
|
5277
|
+
var hour = diff_as_date.getUTCHours();
|
|
5278
|
+
var minute = diff_as_date.getUTCMinutes();
|
|
5279
|
+
return {
|
|
5280
|
+
hour: hour,
|
|
5281
|
+
minute: minute
|
|
5282
|
+
};
|
|
5283
|
+
};
|
|
5284
|
+
|
|
5285
|
+
var getCustomLabel = function getCustomLabel(time, timeFormat, showDuration, referenceTime) {
|
|
5286
|
+
var label = time;
|
|
5287
|
+
|
|
5288
|
+
if (isFormat12Hour(timeFormat)) {
|
|
5289
|
+
label = convert24To12HourFormat(time);
|
|
5290
|
+
}
|
|
5291
|
+
|
|
5292
|
+
if (showDuration && referenceTime) {
|
|
5293
|
+
var _getTimeDifference = getTimeDifference(referenceTime, time),
|
|
5294
|
+
hour = _getTimeDifference.hour,
|
|
5295
|
+
minute = _getTimeDifference.minute;
|
|
5296
|
+
|
|
5297
|
+
var timeDiffLabel = " (".concat(hour, " hr ").concat(minute, " min)");
|
|
5298
|
+
label += timeDiffLabel;
|
|
5299
|
+
}
|
|
5300
|
+
|
|
5301
|
+
return label;
|
|
5302
|
+
};
|
|
5303
|
+
|
|
5304
|
+
var isOptionDisabled = function isOptionDisabled(time, timeFormat, disabledSlotList) {
|
|
5305
|
+
var timeValue = time;
|
|
5306
|
+
|
|
5307
|
+
if (isFormat12Hour(timeFormat)) {
|
|
5308
|
+
timeValue = convert24To12HourFormat(time);
|
|
5309
|
+
}
|
|
5310
|
+
|
|
5311
|
+
if (disabledSlotList.includes(timeValue)) {
|
|
5312
|
+
return true;
|
|
5313
|
+
}
|
|
5314
|
+
|
|
5315
|
+
return false;
|
|
5316
|
+
};
|
|
5317
|
+
|
|
5318
|
+
var convertTimeToOptionList = function convertTimeToOptionList(timeList, timeFormat) {
|
|
5319
|
+
var id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'TimePicker-Option-key';
|
|
5320
|
+
var showDuration = arguments.length > 3 ? arguments[3] : undefined;
|
|
5321
|
+
var referenceTime = arguments.length > 4 ? arguments[4] : undefined;
|
|
5322
|
+
var disabledSlotList = arguments.length > 5 ? arguments[5] : undefined;
|
|
5323
|
+
var optionList = timeList.map(function (time, index) {
|
|
5324
|
+
return {
|
|
5325
|
+
label: getCustomLabel(time, timeFormat, showDuration, referenceTime),
|
|
5326
|
+
value: time,
|
|
5327
|
+
disabled: disabledSlotList && isOptionDisabled(time, timeFormat, disabledSlotList),
|
|
5328
|
+
selected: false,
|
|
5329
|
+
optionID: id + index
|
|
5330
|
+
};
|
|
5331
|
+
});
|
|
5332
|
+
return optionList;
|
|
5333
|
+
};
|
|
5334
|
+
|
|
5335
|
+
var computeEndTime = function computeEndTime(startTime) {
|
|
5336
|
+
return startTime ? '' : '23:59';
|
|
5337
|
+
};
|
|
5338
|
+
|
|
5339
|
+
var getDropdownOptionList = function getDropdownOptionList(props) {
|
|
5340
|
+
var startTime = props.startTime,
|
|
5341
|
+
endTime = props.endTime,
|
|
5342
|
+
interval = props.interval,
|
|
5343
|
+
timeFormat = props.timeFormat,
|
|
5344
|
+
showDuration = props.showDuration,
|
|
5345
|
+
disabledSlotList = props.disabledSlotList,
|
|
5346
|
+
id = props.id;
|
|
5347
|
+
var startTimeIn24Hr = startTime ? getTimeIn24HrFormat(startTime) : '00:00';
|
|
5348
|
+
var endTimeIn24Hr = endTime ? getTimeIn24HrFormat(endTime) : computeEndTime(startTime);
|
|
5349
|
+
var timeList = getTimeListIn24HourFormat(startTimeIn24Hr, endTimeIn24Hr, interval);
|
|
5350
|
+
var dropdownOptionList = convertTimeToOptionList(timeList, timeFormat, id, showDuration, startTime, disabledSlotList);
|
|
5351
|
+
return dropdownOptionList;
|
|
5352
|
+
};
|
|
5353
|
+
|
|
5354
|
+
var convertMinTo60 = function convertMinTo60(time) {
|
|
5355
|
+
var parseNum = parseInt(time, 10);
|
|
5356
|
+
if (parseNum < 10) return time;
|
|
5357
|
+
var timeInNum = parseNum > 60 ? parseNum % 60 : parseNum;
|
|
5358
|
+
var min = (timeInNum.toString() + '0').slice(0, 2);
|
|
5359
|
+
return min;
|
|
5360
|
+
};
|
|
5361
|
+
|
|
5362
|
+
var get24HourCurrentTime = function get24HourCurrentTime() {
|
|
5363
|
+
var today = new Date();
|
|
5364
|
+
return convertToTwoDigit(today.getHours()) + ':' + convertToTwoDigit(today.getMinutes());
|
|
5365
|
+
};
|
|
5366
|
+
|
|
5367
|
+
var convertHourTo24 = function convertHourTo24(time) {
|
|
5368
|
+
var timeInNum = parseInt(time, 10) % 24;
|
|
5369
|
+
return timeInNum.toString();
|
|
5370
|
+
};
|
|
5371
|
+
|
|
5372
|
+
var convertHourTo12 = function convertHourTo12(time) {
|
|
5373
|
+
var timeInNum = parseInt(time, 10) % 12;
|
|
5374
|
+
return timeInNum.toString();
|
|
5375
|
+
};
|
|
5376
|
+
|
|
5377
|
+
var _checkNumber = function _checkNumber(str) {
|
|
5378
|
+
var numberRegex = /^[0-9]+$/;
|
|
5379
|
+
return numberRegex.test(str);
|
|
5380
|
+
};
|
|
5381
|
+
|
|
5382
|
+
var _checkNumberWithAMPM = function _checkNumberWithAMPM(str) {
|
|
5383
|
+
var numberWithAMPMRegex = /^[0-9]+[ AaMmPp]+$/;
|
|
5384
|
+
return numberWithAMPMRegex.test(str);
|
|
5385
|
+
};
|
|
5386
|
+
|
|
5387
|
+
var _checkNumberWithSpecialChar = function _checkNumberWithSpecialChar(str) {
|
|
5388
|
+
var numberWithSpecialCharRegex = /^[0-9]+[`\s!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?~][0-9]*$/;
|
|
5389
|
+
return numberWithSpecialCharRegex.test(str);
|
|
5390
|
+
};
|
|
5391
|
+
|
|
5392
|
+
var _checkNumberWithSpecialCharAMPM = function _checkNumberWithSpecialCharAMPM(str) {
|
|
5393
|
+
var numberWithSpecialCharAMPM = /^[0-9]+[`\s!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?~][0-9]+[ AaMmPp]+$/;
|
|
5394
|
+
return numberWithSpecialCharAMPM.test(str);
|
|
5395
|
+
};
|
|
5396
|
+
|
|
5397
|
+
var specialCharRegex = /[`\s!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?~]/;
|
|
5398
|
+
/**
|
|
5399
|
+
* @param searchTime in [number special-char number] format
|
|
5400
|
+
* @returns timeObj with hour & minute in 24 hour format
|
|
5401
|
+
*/
|
|
5402
|
+
|
|
5403
|
+
var getTimeFromNumberWithSpecialChar = function getTimeFromNumberWithSpecialChar(searchTime) {
|
|
5404
|
+
var time = searchTime.split(specialCharRegex);
|
|
5405
|
+
var hour = convertHourTo24(time[0]);
|
|
5406
|
+
var hh = convertToTwoDigit(hour);
|
|
5407
|
+
var min = time[1] !== '' ? convertMinTo60(time[1]) : '00';
|
|
5408
|
+
var mm = (min + '0').slice(0, 2);
|
|
5409
|
+
return {
|
|
5410
|
+
hour: hh,
|
|
5411
|
+
min: mm
|
|
5412
|
+
};
|
|
5413
|
+
};
|
|
5414
|
+
/**
|
|
5415
|
+
* If search term only contains number
|
|
5416
|
+
* @param searchTerm
|
|
5417
|
+
* @returns timeObj with hour & minute in 24 hour format
|
|
5418
|
+
*/
|
|
5419
|
+
|
|
5420
|
+
|
|
5421
|
+
var getSearchTimeFromNumber = function getSearchTimeFromNumber(searchTerm, show12HourFormat) {
|
|
5422
|
+
var searchLen = searchTerm.length;
|
|
5423
|
+
var searchTimeInNum = parseInt(searchTerm, 10);
|
|
5424
|
+
var firstTwoTerm = searchTerm.slice(0, 2);
|
|
5425
|
+
var hh = '00';
|
|
5426
|
+
var mm = '00';
|
|
5427
|
+
|
|
5428
|
+
switch (searchLen) {
|
|
5429
|
+
case 1:
|
|
5430
|
+
// if search term length is 1 consider it as hour
|
|
5431
|
+
hh = '0' + searchTerm;
|
|
5432
|
+
break;
|
|
5433
|
+
|
|
5434
|
+
case 2:
|
|
5435
|
+
// if search term length is 2
|
|
5436
|
+
if (searchTimeInNum <= 24 || show12HourFormat && searchTimeInNum <= 12) {
|
|
5437
|
+
// consider it as hour
|
|
5438
|
+
hh = convertToTwoDigit(searchTerm);
|
|
5439
|
+
} else {
|
|
5440
|
+
// consider first term as hour and last term as min
|
|
5441
|
+
hh = '0' + searchTerm[0];
|
|
5442
|
+
mm = convertMinTo60(searchTerm[1] + '0'); // mm = searchTerm[1] + '0';
|
|
5443
|
+
}
|
|
5444
|
+
|
|
5445
|
+
break;
|
|
5446
|
+
|
|
5447
|
+
case 3:
|
|
5448
|
+
hh = '0' + searchTerm[0];
|
|
5449
|
+
mm = convertMinTo60(searchTerm.slice(1));
|
|
5450
|
+
break;
|
|
5451
|
+
|
|
5452
|
+
case 4:
|
|
5453
|
+
hh = show12HourFormat ? convertHourTo12(firstTwoTerm) : convertHourTo24(firstTwoTerm);
|
|
5454
|
+
mm = convertMinTo60(searchTerm.slice(2));
|
|
5455
|
+
break;
|
|
5456
|
+
|
|
5457
|
+
default:
|
|
5458
|
+
// set time as -1 in case of invalid time
|
|
5459
|
+
hh = '-1';
|
|
5460
|
+
mm = '-1';
|
|
5461
|
+
}
|
|
5462
|
+
|
|
5463
|
+
return {
|
|
5464
|
+
hour: hh,
|
|
5465
|
+
min: mm
|
|
5466
|
+
};
|
|
5467
|
+
};
|
|
5468
|
+
/**
|
|
5469
|
+
* @param searchTime in [number AMPM] format
|
|
5470
|
+
* @returns timeObj with hour & minute in 24 hour format
|
|
5471
|
+
*/
|
|
5472
|
+
|
|
5473
|
+
|
|
5474
|
+
var getTimeFromNumberWithAMPM = function getTimeFromNumberWithAMPM(searchTime) {
|
|
5475
|
+
var timeArr = searchTime.split(/[\saAmMpP]/);
|
|
5476
|
+
|
|
5477
|
+
var _getSearchTimeFromNum = getSearchTimeFromNumber(timeArr[0], true),
|
|
5478
|
+
hour = _getSearchTimeFromNum.hour,
|
|
5479
|
+
min = _getSearchTimeFromNum.min;
|
|
5480
|
+
|
|
5481
|
+
return {
|
|
5482
|
+
hour: hour,
|
|
5483
|
+
min: min
|
|
5484
|
+
};
|
|
5485
|
+
};
|
|
5486
|
+
/**
|
|
5487
|
+
* @param searchTerm entered by user in any format
|
|
5488
|
+
* @returns modified search term in 24 hour format
|
|
5489
|
+
*/
|
|
5490
|
+
|
|
5491
|
+
|
|
5492
|
+
var formatSearchTerm = function formatSearchTerm(optionList, searchTerm) {
|
|
5493
|
+
var searchTime = {
|
|
5494
|
+
hour: '00',
|
|
5495
|
+
min: '00'
|
|
5496
|
+
}; // If search term only contains numbers
|
|
5497
|
+
|
|
5498
|
+
if (_checkNumber(searchTerm)) {
|
|
5499
|
+
var searchTimeInHHMM = getSearchTimeFromNumber(searchTerm);
|
|
5500
|
+
|
|
5501
|
+
if (parseInt(searchTimeInHHMM.hour) <= 12 && parseInt(searchTimeInHHMM.hour) > 0) {
|
|
5502
|
+
// switch to AM/PM based on current time
|
|
5503
|
+
searchTime = getCurrentRelativeTime(optionList, searchTimeInHHMM);
|
|
5504
|
+
} else {
|
|
5505
|
+
searchTime = searchTimeInHHMM;
|
|
5506
|
+
}
|
|
5507
|
+
} // if search term contains numbers along with [ampm]
|
|
5508
|
+
else if (_checkNumberWithAMPM(searchTerm)) {
|
|
5509
|
+
searchTime = getTimeFromNumberWithAMPM(searchTerm);
|
|
5510
|
+
searchTime.hour = convert12To24HourFormat(searchTime.hour, searchTerm);
|
|
5511
|
+
} // if search term contains numbers along with special character
|
|
5512
|
+
else if (_checkNumberWithSpecialChar(searchTerm)) {
|
|
5513
|
+
var _searchTimeInHHMM = getTimeFromNumberWithSpecialChar(searchTerm);
|
|
5514
|
+
|
|
5515
|
+
if (parseInt(_searchTimeInHHMM.hour) <= 12) {
|
|
5516
|
+
// switch to AM/PM based on current time
|
|
5517
|
+
searchTime = getCurrentRelativeTime(optionList, _searchTimeInHHMM);
|
|
5518
|
+
} else {
|
|
5519
|
+
searchTime = _searchTimeInHHMM;
|
|
5520
|
+
}
|
|
5521
|
+
} // if search term contains numbers, special character & [AmPm]
|
|
5522
|
+
else if (_checkNumberWithSpecialCharAMPM(searchTerm)) {
|
|
5523
|
+
var timeWithoutAMPM = searchTerm.replace(/[\saApPmM]/g, '');
|
|
5524
|
+
|
|
5525
|
+
if (_checkNumber(timeWithoutAMPM)) {
|
|
5526
|
+
searchTime = getSearchTimeFromNumber(timeWithoutAMPM, true);
|
|
5527
|
+
} else if (_checkNumberWithSpecialChar(timeWithoutAMPM)) {
|
|
5528
|
+
searchTime = getTimeFromNumberWithSpecialChar(timeWithoutAMPM);
|
|
5529
|
+
}
|
|
5530
|
+
|
|
5531
|
+
searchTime.hour = convert12To24HourFormat(searchTime.hour, searchTerm);
|
|
5532
|
+
}
|
|
5533
|
+
|
|
5534
|
+
return searchTime;
|
|
5535
|
+
};
|
|
5536
|
+
/**
|
|
5537
|
+
* @param hours
|
|
5538
|
+
* @param searchTerm
|
|
5539
|
+
* @returns hours based on AM/PM in 24 hour format
|
|
5540
|
+
*/
|
|
5541
|
+
|
|
5542
|
+
var convert12To24HourFormat = function convert12To24HourFormat(hours, searchTerm) {
|
|
5543
|
+
if (hours === '12' && _isTimeInAM(searchTerm)) {
|
|
5544
|
+
hours = '00';
|
|
5545
|
+
} else if (_isTimeInPM(searchTerm) && hours !== '12') {
|
|
5546
|
+
hours = (parseInt(hours, 10) + 12).toString();
|
|
5547
|
+
}
|
|
5548
|
+
|
|
5549
|
+
return hours;
|
|
5550
|
+
};
|
|
5551
|
+
/**
|
|
5552
|
+
* Switch to AM/PM time based on current time
|
|
5553
|
+
* @param optionList
|
|
5554
|
+
* @param searchTime
|
|
5555
|
+
*/
|
|
5556
|
+
|
|
5557
|
+
|
|
5558
|
+
var getCurrentRelativeTime = function getCurrentRelativeTime(optionList, searchTime) {
|
|
5559
|
+
var searchTimeStr = "".concat(searchTime.hour, ":").concat(searchTime.min);
|
|
5560
|
+
var currentTime = get24HourCurrentTime();
|
|
5561
|
+
var greaterTime = checkTimeDifference(currentTime, searchTimeStr);
|
|
5562
|
+
var currentTimeIndex = findClosestTimeIndex(optionList, currentTime);
|
|
5563
|
+
var searchTimeIndex = findClosestTimeIndex(optionList, searchTimeStr);
|
|
5564
|
+
|
|
5565
|
+
if (greaterTime && currentTimeIndex > searchTimeIndex) {
|
|
5566
|
+
var hourIn24Format = parseInt(searchTime.hour, 10) + 12;
|
|
5567
|
+
searchTime.hour = hourIn24Format.toString();
|
|
5568
|
+
}
|
|
5569
|
+
|
|
5570
|
+
return searchTime;
|
|
5571
|
+
};
|
|
5572
|
+
|
|
5573
|
+
var findClosestTimeIndex = function findClosestTimeIndex(optionList, searchItem) {
|
|
5574
|
+
var closestItemIndex = 0;
|
|
5575
|
+
var minTime = {
|
|
5576
|
+
hour: 100,
|
|
5577
|
+
mins: 100
|
|
5578
|
+
};
|
|
5579
|
+
|
|
5580
|
+
for (var index = 0; index < optionList.length; index++) {
|
|
5581
|
+
var _getTimeDifference = getTimeDifference(searchItem, optionList[index]),
|
|
5582
|
+
hour = _getTimeDifference.hour,
|
|
5583
|
+
minute = _getTimeDifference.minute;
|
|
5584
|
+
|
|
5585
|
+
if (hour < minTime.hour || hour === minTime.hour && minute < minTime.mins) {
|
|
5586
|
+
minTime.hour = hour;
|
|
5587
|
+
minTime.mins = minute;
|
|
5588
|
+
closestItemIndex = index;
|
|
5589
|
+
}
|
|
5590
|
+
}
|
|
5591
|
+
|
|
5592
|
+
return closestItemIndex;
|
|
5593
|
+
};
|
|
5594
|
+
/**
|
|
5595
|
+
* Get index of search term from option list
|
|
5596
|
+
* @param optionList
|
|
5597
|
+
* @param searchTerm
|
|
5598
|
+
* @returns Index of the search term in option list
|
|
5599
|
+
*/
|
|
5600
|
+
|
|
5601
|
+
|
|
5602
|
+
var getSearchIndex = function getSearchIndex(optionList, searchTerm) {
|
|
5603
|
+
var _formatSearchTerm = formatSearchTerm(optionList, searchTerm),
|
|
5604
|
+
hour = _formatSearchTerm.hour,
|
|
5605
|
+
min = _formatSearchTerm.min;
|
|
5606
|
+
|
|
5607
|
+
if (min === '60') {
|
|
5608
|
+
min = '00';
|
|
5609
|
+
hour = (parseInt(hour, 10) + 1).toString();
|
|
5610
|
+
}
|
|
5611
|
+
|
|
5612
|
+
var searchItem = "".concat(hour, ":").concat(min);
|
|
5613
|
+
var searchIndex = findClosestTimeIndex(optionList, searchItem);
|
|
5614
|
+
return searchIndex;
|
|
5615
|
+
};
|
|
5616
|
+
/**
|
|
5617
|
+
* @param searchTerm
|
|
5618
|
+
* @returns count number of digits present inside search term
|
|
5619
|
+
*/
|
|
5620
|
+
|
|
5621
|
+
var countNumberInStr = function countNumberInStr(searchTerm) {
|
|
5622
|
+
var _searchTerm$match;
|
|
5623
|
+
|
|
5624
|
+
return ((_searchTerm$match = searchTerm.match(/\d/g)) === null || _searchTerm$match === void 0 ? void 0 : _searchTerm$match.length) || 0;
|
|
5625
|
+
};
|
|
5626
|
+
|
|
5627
|
+
var isValidSearchTerm = function isValidSearchTerm(searchTerm) {
|
|
5628
|
+
var totalDigit = countNumberInStr(searchTerm);
|
|
5629
|
+
return totalDigit > 0 && totalDigit < 5;
|
|
5630
|
+
};
|
|
5631
|
+
|
|
5632
|
+
var getValueFromOptionList = function getValueFromOptionList(optionList) {
|
|
5633
|
+
var list = optionList.map(function (option) {
|
|
5634
|
+
return option.value;
|
|
5635
|
+
});
|
|
5636
|
+
return list;
|
|
5637
|
+
};
|
|
5638
|
+
|
|
5639
|
+
var getSearchValueIndex = function getSearchValueIndex(options, searchTerm) {
|
|
5640
|
+
// Search Term is valid if it contains number
|
|
5641
|
+
if (!isValidSearchTerm(searchTerm)) {
|
|
5642
|
+
return -1;
|
|
5643
|
+
}
|
|
5644
|
+
|
|
5645
|
+
var searchIndex = getSearchIndex(options, searchTerm);
|
|
5646
|
+
return searchIndex;
|
|
5647
|
+
};
|
|
5648
|
+
|
|
5649
|
+
var getScrollIndex = function getScrollIndex(dropdownOptionList, searchTerm) {
|
|
5650
|
+
var optionList = getValueFromOptionList(dropdownOptionList);
|
|
5651
|
+
|
|
5652
|
+
if (searchTerm === '') {
|
|
5653
|
+
// return current time index
|
|
5654
|
+
var currTime = get24HourCurrentTime();
|
|
5655
|
+
var currTimeIndex = findClosestTimeIndex(optionList, currTime);
|
|
5656
|
+
return currTimeIndex;
|
|
5657
|
+
}
|
|
5658
|
+
|
|
5659
|
+
return getSearchValueIndex(optionList, searchTerm);
|
|
5660
|
+
};
|
|
5661
|
+
|
|
5662
|
+
var TimePickerWithSearch = function TimePickerWithSearch(props) {
|
|
5663
|
+
var open = props.open,
|
|
5664
|
+
endTime = props.endTime,
|
|
5665
|
+
interval = props.interval,
|
|
5666
|
+
onChange = props.onChange,
|
|
5667
|
+
startTime = props.startTime,
|
|
5668
|
+
timeFormat = props.timeFormat,
|
|
5669
|
+
showDuration = props.showDuration,
|
|
5670
|
+
noResultMessage = props.noResultMessage,
|
|
5671
|
+
disabledSlotList = props.disabledSlotList,
|
|
5672
|
+
fetchTimeOptions = props.fetchTimeOptions;
|
|
5673
|
+
|
|
5674
|
+
var _React$useState = React.useState(0),
|
|
5675
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
5676
|
+
tabIndex = _React$useState2[0],
|
|
5677
|
+
setTabIndex = _React$useState2[1];
|
|
5678
|
+
|
|
5679
|
+
var _React$useState3 = React.useState(false),
|
|
5680
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
5681
|
+
openPopover = _React$useState4[0],
|
|
5682
|
+
setOpenPopover = _React$useState4[1];
|
|
5683
|
+
|
|
5684
|
+
var _React$useState5 = React.useState(-1),
|
|
5685
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
5686
|
+
selectedIndex = _React$useState6[0],
|
|
5687
|
+
setSelectedIndex = _React$useState6[1];
|
|
5688
|
+
|
|
5689
|
+
var _React$useState7 = React.useState(0),
|
|
5690
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
5691
|
+
counter = _React$useState8[0],
|
|
5692
|
+
setCounter = _React$useState8[1];
|
|
5693
|
+
|
|
5694
|
+
var dropdownOptionList = getDropdownOptionList(props);
|
|
5695
|
+
React.useEffect(function () {
|
|
5696
|
+
open !== undefined && setOpenPopover(open);
|
|
5697
|
+
}, [open]);
|
|
5698
|
+
React.useEffect(function () {
|
|
5699
|
+
var timer;
|
|
5700
|
+
|
|
5701
|
+
if (openPopover && selectedIndex != -1) {
|
|
5702
|
+
setTabIndex(selectedIndex);
|
|
5703
|
+
timer = setTimeout(function () {
|
|
5704
|
+
scrollToOptionIndex(selectedIndex, dropdownOptionList);
|
|
5705
|
+
}, 100);
|
|
5706
|
+
}
|
|
5707
|
+
|
|
5708
|
+
return function () {
|
|
5709
|
+
clearTimeout(timer);
|
|
5710
|
+
};
|
|
5711
|
+
}, [openPopover]); // Required to re-render dropdown forcefully whenever props changes
|
|
5712
|
+
|
|
5713
|
+
React.useEffect(function () {
|
|
5714
|
+
setCounter(counter + 1);
|
|
5715
|
+
}, [startTime, endTime, interval, showDuration, disabledSlotList]);
|
|
5716
|
+
|
|
5717
|
+
var onChangeHandler = function onChangeHandler(props) {
|
|
5718
|
+
var time = props;
|
|
5719
|
+
|
|
5720
|
+
if (isFormat12Hour(timeFormat)) {
|
|
5721
|
+
time = convert24To12HourFormat(time);
|
|
5722
|
+
}
|
|
5723
|
+
|
|
5724
|
+
var selectIndex = dropdownOptionList.findIndex(function (option) {
|
|
5725
|
+
return option.value === props;
|
|
5726
|
+
});
|
|
5727
|
+
setSelectedIndex(selectIndex);
|
|
5728
|
+
onChange && onChange(time);
|
|
5729
|
+
};
|
|
5730
|
+
|
|
5731
|
+
var getOptionList = function getOptionList(searchTerm) {
|
|
5732
|
+
var scrollIndex;
|
|
5733
|
+
var indexValue = getScrollIndex(dropdownOptionList, searchTerm);
|
|
5734
|
+
|
|
5735
|
+
if (searchTerm === '' && selectedIndex != -1) {
|
|
5736
|
+
scrollIndex = selectedIndex;
|
|
5737
|
+
setTabIndex(selectedIndex);
|
|
5738
|
+
} else {
|
|
5739
|
+
scrollIndex = indexValue;
|
|
5740
|
+
setTabIndex(indexValue);
|
|
5741
|
+
}
|
|
5742
|
+
|
|
5743
|
+
return Promise.resolve({
|
|
5744
|
+
options: indexValue === -1 ? [] : dropdownOptionList,
|
|
5745
|
+
count: dropdownOptionList.length,
|
|
5746
|
+
scrollToIndex: scrollIndex === 0 ? scrollIndex + 1 : scrollIndex,
|
|
5747
|
+
searchTerm: searchTerm
|
|
5748
|
+
});
|
|
5749
|
+
};
|
|
5750
|
+
|
|
5751
|
+
var fetchOptionList = function fetchOptionList() {
|
|
5752
|
+
return fetchTimeOptions ? fetchTimeOptions : getOptionList;
|
|
5753
|
+
};
|
|
5754
|
+
|
|
5755
|
+
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
5756
|
+
key: counter,
|
|
5757
|
+
maxHeight: 160,
|
|
5758
|
+
loadersCount: 0,
|
|
5759
|
+
withSearch: true,
|
|
5760
|
+
open: openPopover,
|
|
5761
|
+
tabIndex: tabIndex,
|
|
5762
|
+
searchPlaceholder: "Search",
|
|
5763
|
+
onChange: onChangeHandler,
|
|
5764
|
+
fetchOptions: fetchOptionList(),
|
|
5765
|
+
noResultMessage: noResultMessage,
|
|
5766
|
+
staticLimit: dropdownOptionList.length,
|
|
5767
|
+
onPopperToggle: function onPopperToggle() {
|
|
5768
|
+
setOpenPopover(!openPopover);
|
|
5769
|
+
}
|
|
5770
|
+
});
|
|
5771
|
+
};
|
|
5772
|
+
TimePickerWithSearch.defaultProps = {
|
|
5773
|
+
timeFormat: '12-Hour',
|
|
5774
|
+
interval: 15
|
|
5775
|
+
};
|
|
5776
|
+
TimePickerWithSearch.displayName = 'TimePickerWithSearch';
|
|
5777
|
+
|
|
5778
|
+
var TimePickerWithInput = function TimePickerWithInput(props) {
|
|
5122
5779
|
var validators = props.validators,
|
|
5123
5780
|
inputOptions = props.inputOptions,
|
|
5124
5781
|
inputFormat = props.inputFormat,
|
|
@@ -5192,12 +5849,18 @@ var TimePicker = function TimePicker(props) {
|
|
|
5192
5849
|
id: "parent-TimePicker"
|
|
5193
5850
|
}));
|
|
5194
5851
|
};
|
|
5195
|
-
|
|
5852
|
+
TimePickerWithInput.defaultProps = {
|
|
5196
5853
|
inputFormat: 'hh:mm AM',
|
|
5197
5854
|
outputFormat: 'hh:mm AM',
|
|
5198
5855
|
inputOptions: {},
|
|
5199
5856
|
validators: [time$1]
|
|
5200
5857
|
};
|
|
5858
|
+
TimePickerWithInput.displayName = 'TimePickerWithInput';
|
|
5859
|
+
|
|
5860
|
+
var TimePicker = function TimePicker(props) {
|
|
5861
|
+
return props.withSearch ? /*#__PURE__*/React.createElement(TimePickerWithSearch, props) : /*#__PURE__*/React.createElement(TimePickerWithInput, props);
|
|
5862
|
+
};
|
|
5863
|
+
TimePicker.defaultProps = _objectSpread2(_objectSpread2({}, TimePickerWithInput.defaultProps), TimePickerWithSearch.defaultProps);
|
|
5201
5864
|
TimePicker.displayName = 'TimePicker';
|
|
5202
5865
|
|
|
5203
5866
|
var _excluded$p = ["appearance", "size", "children", "className"];
|
|
@@ -12890,12 +13553,17 @@ var MenuItem = function MenuItem(props) {
|
|
|
12890
13553
|
isChildrenVisible = props.isChildrenVisible,
|
|
12891
13554
|
onClick = props.onClick,
|
|
12892
13555
|
customItemRenderer = props.customItemRenderer;
|
|
12893
|
-
var baseProps = extractBaseProps(props);
|
|
12894
13556
|
|
|
12895
|
-
var onClickHandler = function onClickHandler() {
|
|
13557
|
+
var onClickHandler = function onClickHandler(ev) {
|
|
13558
|
+
ev.preventDefault();
|
|
12896
13559
|
if (onClick) onClick(menu);
|
|
12897
13560
|
};
|
|
12898
13561
|
|
|
13562
|
+
var baseProps = _objectSpread2({
|
|
13563
|
+
onClick: onClickHandler,
|
|
13564
|
+
href: menu.link
|
|
13565
|
+
}, extractBaseProps(props));
|
|
13566
|
+
|
|
12899
13567
|
var ItemClass = classnames((_classNames2 = {}, _defineProperty$1(_classNames2, 'MenuItem', true), _defineProperty$1(_classNames2, 'MenuItem--vertical', true), _defineProperty$1(_classNames2, 'MenuItem--collapsed', !expanded), _defineProperty$1(_classNames2, 'MenuItem--expanded', expanded), _defineProperty$1(_classNames2, 'MenuItem--active', isActive), _defineProperty$1(_classNames2, 'MenuItem--disabled', menu.disabled), _defineProperty$1(_classNames2, 'MenuItem--subMenu', isChildren && expanded), _defineProperty$1(_classNames2, 'MenuItem--rounded', rounded && expanded), _classNames2));
|
|
12900
13568
|
|
|
12901
13569
|
var renderSubMenu = function renderSubMenu() {
|
|
@@ -12945,11 +13613,10 @@ var MenuItem = function MenuItem(props) {
|
|
|
12945
13613
|
/*#__PURE__*/
|
|
12946
13614
|
// TODO(a11y)
|
|
12947
13615
|
// eslint-disable-next-line
|
|
12948
|
-
React.createElement(
|
|
13616
|
+
React.createElement(GenericText, _extends$2({
|
|
13617
|
+
componentType: "a",
|
|
12949
13618
|
className: ItemClass
|
|
12950
|
-
}, baseProps, {
|
|
12951
|
-
onClick: onClickHandler
|
|
12952
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
13619
|
+
}, baseProps), /*#__PURE__*/React.createElement("div", {
|
|
12953
13620
|
className: "d-flex align-items-center overflow-hidden"
|
|
12954
13621
|
}, menu.icon && /*#__PURE__*/React.createElement(Icon, {
|
|
12955
13622
|
"data-test": "DesignSystem-VerticalNav--Icon",
|
|
@@ -16404,7 +17071,7 @@ var allFilesAccepted = function allFilesAccepted(options) {
|
|
|
16404
17071
|
});
|
|
16405
17072
|
};
|
|
16406
17073
|
|
|
16407
|
-
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']]);
|
|
17074
|
+
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']]);
|
|
16408
17075
|
var FILES_TO_IGNORE = ['.DS_Store', 'Thumbs.db'];
|
|
16409
17076
|
function fromEvent(_x) {
|
|
16410
17077
|
return _fromEvent.apply(this, arguments);
|
|
@@ -20338,6 +21005,6 @@ Divider.defaultProps = {
|
|
|
20338
21005
|
vertical: false
|
|
20339
21006
|
};
|
|
20340
21007
|
|
|
20341
|
-
var version = "2.13.
|
|
21008
|
+
var version = "2.13.4-2";
|
|
20342
21009
|
|
|
20343
|
-
export { Avatar, AvatarGroup, Backdrop, Badge, Breadcrumbs, Button, Calendar, Caption, Card, CardBody, CardFooter, CardHeader, CardSubdued, ChatMessage, Checkbox, Chip, ChipGroup, ChipInput, ChoiceList, Collapsible, Column, DatePicker, DateRangePicker, Dialog, Divider, Dropdown, Dropzone, EditableChipInput, EditableDropdown, EditableInput, EmptyState, FileList, FileUploader, FileUploaderList, FullscreenModal, Grid, GridCell, Heading, HorizontalNav, Icon, InlineMessage, Input, X as InputMask, Label, Legend, Link, List, Message, MetaList, MetricInput, Modal, ModalBody, ModalDescription, ModalFooter, ModalHeader, MultiSlider, Navigation, OutsideClick, PageHeader, Pagination, Paragraph, Pills, Placeholder, PlaceholderParagraph, Popover, ProgressBar, ProgressRing, Radio, RangeSlider, Row, Sidesheet, Slider, Spinner, StatusHint, Stepper, Subheading, Switch, Tab, Table, Tabs, TabsWrapper, Text, Textarea, TimePicker, Toast, Tooltip, index as Utils, VerificationCodeInput, VerticalNav, version };
|
|
21010
|
+
export { Avatar, AvatarGroup, Backdrop, Badge, Breadcrumbs, Button, Calendar, Caption, Card, CardBody, CardFooter, CardHeader, CardSubdued, ChatMessage, Checkbox, Chip, ChipGroup, ChipInput, ChoiceList, Collapsible, Column, DatePicker, DateRangePicker, Dialog, Divider, Dropdown, Dropzone, EditableChipInput, EditableDropdown, EditableInput, EmptyState, FileList, FileUploader, FileUploaderList, FullscreenModal, Grid, GridCell, Heading, HorizontalNav, Icon, InlineMessage, Input, X as InputMask, Label, Legend, Link, List, Message, MetaList, MetricInput, Modal, ModalBody, ModalDescription, ModalFooter, ModalHeader, MultiSlider, Navigation, OutsideClick, PageHeader, Pagination, Paragraph, Pills, Placeholder, PlaceholderImage, PlaceholderParagraph, Popover, ProgressBar, ProgressRing, Radio, RangeSlider, Row, Sidesheet, Slider, Spinner, StatusHint, Stepper, Subheading, Switch, Tab, Table, Tabs, TabsWrapper, Text, Textarea, TimePicker, Toast, Tooltip, index as Utils, VerificationCodeInput, VerticalNav, version };
|