@innovaccer/design-system 2.5.0 → 2.7.0-0
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/.eslintrc.json +54 -0
- package/.github/workflows/chromatic.yml +5 -0
- package/.github/workflows/main.yml +2 -2
- package/.github/workflows/pull_request.yml +2 -2
- package/.github/workflows/test.yml +1 -1
- package/.husky/commit-msg +4 -0
- package/.prettierrc +2 -2
- package/.storybook/main.js +4 -0
- package/.vscode/settings.json +11 -0
- package/CHANGELOG.md +78 -0
- package/CONTRIBUTING.md +180 -98
- package/commitlint.config.js +1 -0
- package/core/accessibility/utils/index.ts +5 -0
- package/core/accessibility/utils/isEnterKey.ts +5 -0
- package/core/accessibility/utils/isSpaceKey.ts +5 -0
- package/core/accessibility/utils/useAccessibilityProps.ts +33 -0
- package/core/common.type.tsx +22 -0
- package/core/components/atoms/_chip/__tests__/__snapshots__/_chip.test.tsx.snap +17 -9
- package/core/components/atoms/_chip/index.tsx +19 -3
- package/core/components/atoms/avatar/Avatar.tsx +4 -14
- package/core/components/atoms/avatar/__stories__/variants/Appearance.story.tsx +3 -2
- package/core/components/atoms/avatar/__tests__/Avatar.test.tsx +14 -9
- package/core/components/atoms/avatarGroup/AvatarGroup.tsx +3 -5
- package/core/components/atoms/badge/Badge.tsx +2 -12
- package/core/components/atoms/badge/__tests__/Badge.test.tsx +22 -7
- package/core/components/atoms/badge/_stories_/variants/Appearance.story.tsx +3 -2
- package/core/components/atoms/badge/_stories_/variants/Subtle.story.tsx +3 -2
- package/core/components/atoms/button/Button.tsx +10 -7
- package/core/components/atoms/button/__stories__/Alert.story.tsx +8 -1
- package/core/components/atoms/button/__stories__/Cancel.story.tsx +4 -1
- package/core/components/atoms/button/__stories__/IconButtonGroup.story.tsx +12 -3
- package/core/components/atoms/button/__stories__/IconButtonSecondary.story.tsx +6 -1
- package/core/components/atoms/button/__stories__/IconLeftSecondary.story.tsx +4 -1
- package/core/components/atoms/button/__stories__/IconRightSecondary.story.tsx +4 -1
- package/core/components/atoms/button/__stories__/IconTransparent.story.tsx +4 -1
- package/core/components/atoms/button/__stories__/LabelButtonGroup.story.tsx +14 -3
- package/core/components/atoms/button/__stories__/LargeIconExpanded.story.tsx +4 -1
- package/core/components/atoms/button/__stories__/LoadingPrimary.story.tsx +4 -1
- package/core/components/atoms/button/__stories__/Primary.story.tsx +5 -2
- package/core/components/atoms/button/__stories__/SplitButton.story.tsx +6 -1
- package/core/components/atoms/button/__stories__/Transparent.story.tsx +8 -1
- package/core/components/atoms/button/__stories__/index.story.tsx +12 -2
- package/core/components/atoms/button/__stories__/variants/Appearance.story.tsx +6 -2
- package/core/components/atoms/button/__stories__/variants/Expanded.story.tsx +6 -2
- package/core/components/atoms/button/__stories__/variants/Size.story.tsx +4 -0
- package/core/components/atoms/button/__stories__/variants/icon/Icon.story.tsx +15 -0
- package/core/components/atoms/button/__stories__/variants/icon/IconLeft.story.tsx +6 -2
- package/core/components/atoms/button/__stories__/variants/icon/IconRight.story.tsx +6 -2
- package/core/components/atoms/button/__stories__/variants/state/Alert.story.tsx +7 -17
- package/core/components/atoms/button/__stories__/variants/state/Basic.story.tsx +9 -17
- package/core/components/atoms/button/__stories__/variants/state/Primary.story.tsx +7 -17
- package/core/components/atoms/button/__stories__/variants/state/Transparent.story.tsx +13 -17
- package/core/components/atoms/button/__tests__/Button.test.tsx +1 -1
- package/core/components/atoms/button/__tests__/__snapshots__/Button.test.tsx.snap +0 -137
- package/core/components/atoms/card/__stories__/empty.story.tsx +1 -1
- package/core/components/atoms/card/__stories__/nested.story.tsx +1 -1
- package/core/components/atoms/card/__stories__/scroll.story.tsx +1 -1
- package/core/components/atoms/checkbox/Checkbox.tsx +8 -9
- package/core/components/atoms/checkbox/__stories__/variants/Size.story.tsx +2 -2
- package/core/components/atoms/chip/Chip.tsx +3 -2
- package/core/components/atoms/chip/__stories__/variants/Selection.story.tsx +17 -0
- package/core/components/atoms/chip/__stories__/variants/Type.story.tsx +2 -2
- package/core/components/atoms/chip/__tests__/Chip.test.tsx +7 -0
- package/core/components/atoms/chipGroup/__tests__/__snapshots__/chipGroup.test.tsx.snap +11 -5
- package/core/components/atoms/chipGroup/__tests__/chipGroup.test.tsx +2 -2
- package/core/components/atoms/chipGroup/_stories_/index.story.tsx +2 -2
- package/core/components/atoms/collapsible/__tests__/__snapshots__/Collapsible.test.tsx.snap +8 -0
- package/core/components/atoms/divider/Divider.tsx +44 -0
- package/core/components/atoms/divider/__stories__/BasicDividerInCard.story.tsx +74 -0
- package/core/components/atoms/divider/__stories__/HeaderDividerInCard.story.tsx +35 -0
- package/core/components/atoms/divider/__stories__/IndentedDivider.story.tsx +49 -0
- package/core/components/atoms/divider/__stories__/Vertical.story.tsx +51 -0
- package/core/components/atoms/divider/__stories__/index.story.tsx +91 -0
- package/core/components/atoms/divider/__stories__/variants/HorizontalDivider.story.tsx +27 -0
- package/core/components/atoms/divider/__tests__/Divider.test.tsx +50 -0
- package/core/components/atoms/divider/__tests__/__snapshots__/Divider.test.tsx.snap +53 -0
- package/core/components/atoms/divider/index.tsx +2 -0
- package/core/components/atoms/dropdown/Dropdown.tsx +18 -17
- package/core/components/atoms/dropdown/DropdownButton.tsx +2 -2
- package/core/components/atoms/dropdown/DropdownList.tsx +18 -7
- package/core/components/atoms/dropdown/Loading.tsx +1 -1
- package/core/components/atoms/dropdown/__stories__/CustomSearchPlaceholder.story.tsx +45 -0
- package/core/components/atoms/dropdown/__stories__/_common_/types.tsx +3 -0
- package/core/components/atoms/dropdown/__stories__/variants/Size.story.tsx +2 -2
- package/core/components/atoms/dropdown/__stories__/variants/controlledDropdown/MultiSelect.story.tsx +28 -18
- package/core/components/atoms/dropdown/__tests__/Dropdown.test.tsx +12 -1
- package/core/components/atoms/dropdown/__tests__/Loading.test.tsx +0 -1
- package/core/components/atoms/dropdown/option/DefaultOption.tsx +3 -0
- package/core/components/atoms/dropdown/option/IconOption.tsx +3 -0
- package/core/components/atoms/dropdown/option/IconWithMetaOption.tsx +3 -0
- package/core/components/atoms/dropdown/option/MetaOption.tsx +3 -0
- package/core/components/atoms/dropdown/option/index.tsx +1 -1
- package/core/components/atoms/editable/Editable.tsx +3 -0
- package/core/components/atoms/heading/Heading.tsx +4 -4
- package/core/components/atoms/heading/__stories__/variants/Appearance.story.tsx +3 -2
- package/core/components/atoms/heading/__tests__/Heading.test.tsx +4 -3
- package/core/components/atoms/icon/Icon.tsx +16 -5
- package/core/components/atoms/icon/__stories__/variants/Image.story.tsx +6 -1
- package/core/components/atoms/icon/__tests__/__snapshots__/Icon.test.tsx.snap +74 -0
- package/core/components/atoms/input/Input.tsx +17 -7
- package/core/components/atoms/input/__stories__/BasicInput.story.tsx +2 -1
- package/core/components/atoms/input/__stories__/InputWithCaption.story.tsx +91 -9
- package/core/components/atoms/input/__stories__/InputWithLabel.story.tsx +11 -3
- package/core/components/atoms/input/__stories__/LabelPosition.story.tsx +46 -4
- package/core/components/atoms/input/__stories__/RequiredVsOptional.story.tsx +12 -8
- package/core/components/atoms/input/__stories__/variants/controlledInput.story.tsx +46 -0
- package/core/components/atoms/input/__stories__/variants/types/BasicInput.story.tsx +2 -2
- package/core/components/atoms/input/__stories__/variants/types/IconLeft.story.tsx +2 -10
- package/core/components/atoms/input/__stories__/variants/types/WithLabel.story.tsx +1 -9
- package/core/components/atoms/input/__tests__/__snapshots__/Input.test.tsx.snap +19 -0
- package/core/components/atoms/label/Label.tsx +1 -1
- package/core/components/atoms/legend/Legend.tsx +5 -2
- package/core/components/atoms/legend/__stories__/variants/labelAppearance.story.tsx +2 -2
- package/core/components/atoms/link/Link.tsx +4 -4
- package/core/components/atoms/message/Message.tsx +12 -12
- package/core/components/atoms/message/__stories__/index.story.tsx +1 -1
- package/core/components/atoms/message/__stories__/variants/Appearance.story.tsx +1 -1
- package/core/components/atoms/message/__stories__/variants/AppearanceTitle.story.tsx +1 -1
- package/core/components/atoms/message/__tests__/Message.test.tsx +1 -6
- package/core/components/atoms/message/__tests__/__snapshots__/Message.test.tsx.snap +0 -45
- package/core/components/atoms/metaList/__tests__/MetaList.test.tsx +2 -2
- package/core/components/atoms/metricInput/MetricInput.tsx +17 -7
- package/core/components/atoms/metricInput/__stories__/DefaultMetric.story.tsx +8 -2
- package/core/components/atoms/metricInput/__stories__/WithPrefix.story.tsx +6 -2
- package/core/components/atoms/metricInput/__stories__/index.story.tsx +1 -0
- package/core/components/atoms/metricInput/__stories__/variants/Controlled.story.tsx +2 -0
- package/core/components/atoms/metricInput/__stories__/variants/Size.story.tsx +2 -2
- package/core/components/atoms/metricInput/__stories__/withSuffix.story.tsx +6 -2
- package/core/components/atoms/metricInput/__tests__/__snapshots__/MetricInput.test.tsx.snap +20 -4
- package/core/components/atoms/multiSlider/Handle.tsx +3 -0
- package/core/components/atoms/multiSlider/SliderUtils.tsx +1 -4
- package/core/components/atoms/multiSlider/index.tsx +9 -4
- package/core/components/atoms/outsideClick/OutsideClick.tsx +1 -2
- package/core/components/atoms/paragraph/Paragraph.tsx +2 -2
- package/core/components/atoms/paragraph/__stories__/variants/Appearance.story.tsx +2 -2
- package/core/components/atoms/paragraph/__tests__/Paragraph.test.tsx +2 -2
- package/core/components/atoms/pills/Pills.tsx +2 -12
- package/core/components/atoms/pills/__stories__/variants/Appearance.story.tsx +3 -2
- package/core/components/atoms/pills/__stories__/variants/Subtle.story.tsx +3 -2
- package/core/components/atoms/pills/__tests__/Pills.test.tsx +3 -2
- package/core/components/atoms/placeholderImage/PlaceholderImage.tsx +2 -2
- package/core/components/atoms/placeholderImage/__stories__/variants/Size.story.tsx +2 -2
- package/core/components/atoms/placeholderParagraph/PlaceholderParagraph.tsx +2 -2
- package/core/components/atoms/placeholderParagraph/__stories__/variants/Size.story.tsx +2 -2
- package/core/components/atoms/popperWrapper/PopperWrapper.tsx +2 -6
- package/core/components/atoms/progressRing/ProgressRing.tsx +2 -2
- package/core/components/atoms/progressRing/__stories__/variants/Size.story.tsx +1 -1
- package/core/components/atoms/radio/Radio.tsx +4 -5
- package/core/components/atoms/rangeSlider/RangeSlider.tsx +1 -2
- package/core/components/atoms/rangeSlider/__stories__/index.story.tsx +1 -2
- package/core/components/atoms/rangeSlider/__stories__/variants/Controlled.story.tsx +1 -2
- package/core/components/atoms/rangeSlider/__stories__/variants/CustomLabels.story.tsx +1 -2
- package/core/components/atoms/spinner/Spinner.tsx +4 -4
- package/core/components/atoms/spinner/__stories__/variants/Appearance.story.tsx +2 -2
- package/core/components/atoms/spinner/__stories__/variants/Size.story.tsx +1 -1
- package/core/components/atoms/statusHint/StatusHint.tsx +5 -3
- package/core/components/atoms/statusHint/__stories__/variants/Appearance.story.tsx +3 -2
- package/core/components/atoms/statusHint/__tests__/StatusHint.test.tsx +3 -2
- package/core/components/atoms/subheading/Subheading.tsx +2 -2
- package/core/components/atoms/subheading/__stories__/variants/Appearance.story.tsx +3 -2
- package/core/components/atoms/subheading/__tests__/Subheading.test.tsx +3 -2
- package/core/components/atoms/switchInput/Switch.tsx +14 -9
- package/core/components/atoms/switchInput/__stories__/DefaultSwitch.story.tsx +4 -1
- package/core/components/atoms/switchInput/__stories__/OffState.story.tsx +4 -1
- package/core/components/atoms/switchInput/__stories__/index.story.tsx +26 -3
- package/core/components/atoms/switchInput/__stories__/variants/Size.story.tsx +10 -1
- package/core/components/atoms/switchInput/__stories__/variants/State.story.tsx +9 -2
- package/core/components/atoms/text/Text.tsx +4 -4
- package/core/components/atoms/text/__stories__/variants/Appearance.story.tsx +2 -2
- package/core/components/atoms/text/__tests__/Text.test.tsx +2 -3
- package/core/components/atoms/textarea/__stories__/TextareaWithCaption.story.tsx +9 -3
- package/core/components/atoms/textarea/__stories__/defaultTextarea.story.tsx +10 -2
- package/core/components/atoms/textarea/__stories__/index.story.tsx +1 -0
- package/core/components/atoms/textarea/__stories__/variants/Disable.story.tsx +1 -0
- package/core/components/atoms/toast/ActionButton.tsx +2 -2
- package/core/components/atoms/toast/Toast.tsx +11 -6
- package/core/components/atoms/toast/__stories__/index.story.tsx +2 -6
- package/core/components/atoms/toast/__stories__/variants/Appearance.story.tsx +3 -2
- package/core/components/atoms/toast/__stories__/variants/ToastMessage.story.tsx +3 -2
- package/core/components/atoms/toast/__stories__/variants/ToastWithAction.story.tsx +3 -2
- package/core/components/atoms/toast/__tests__/Toast.test.tsx +1 -1
- package/core/components/atoms/toast/__tests__/__snapshots__/Toast.test.tsx.snap +24 -125
- package/core/components/css-utilities/Schema.tsx +1 -1
- package/core/components/css-utilities/Spacing/Schema.tsx +1 -1
- package/core/components/molecules/chatMessage/Box.tsx +3 -0
- package/core/components/molecules/chipInput/ChipInput.tsx +3 -0
- package/core/components/molecules/chipInput/__tests__/__snapshots__/ChipInput.test.tsx.snap +14 -2
- package/core/components/molecules/dropzone/Dropzone.tsx +6 -3
- package/core/components/molecules/dropzone/DropzoneBase.tsx +22 -38
- package/core/components/molecules/dropzone/FileSelectorUtils.tsx +1 -1
- package/core/components/molecules/dropzone/__stories__/index.story.tsx +151 -41
- package/core/components/molecules/dropzone/__tests__/Dropzone.test.tsx +2 -2
- package/core/components/molecules/dropzone/utils.tsx +6 -4
- package/core/components/molecules/editableChipInput/EditableChipInput.tsx +9 -5
- package/core/components/molecules/editableChipInput/__stories__/Uncontrolled.story.tsx +1 -1
- package/core/components/molecules/editableChipInput/__tests__/__snapshots__/EditableChipInput.test.tsx.snap +12 -4
- package/core/components/molecules/editableDropdown/EditableDropdown.tsx +2 -2
- package/core/components/molecules/editableInput/EditableInput.tsx +13 -4
- package/core/components/molecules/emptyState/EmptyState.tsx +9 -5
- package/core/components/molecules/emptyState/__stories__/pageNotLoadedWithSVG.story.tsx +26 -26
- package/core/components/molecules/fileList/FileListItem.tsx +3 -2
- package/core/components/molecules/fileUploader/FileUploaderItem.tsx +3 -2
- package/core/components/molecules/fileUploader/FileUploaderStatus.tsx +1 -1
- package/core/components/molecules/fileUploader/__stories__/_common_/types.tsx +3 -0
- package/core/components/molecules/fileUploader/__stories__/index.story.tsx +3 -222
- package/core/components/molecules/fullscreenModal/FullscreenModal.tsx +5 -7
- package/core/components/molecules/inputMask/InputMask.tsx +212 -146
- package/core/components/molecules/inputMask/__stories__/index.story.tsx +24 -0
- package/core/components/molecules/inputMask/__tests__/__snapshots__/InputMask.test.tsx.snap +1 -0
- package/core/components/molecules/modal/Modal.tsx +4 -6
- package/core/components/molecules/modal/__stories__/Confirmation.story.tsx +1 -1
- package/core/components/molecules/pagination/__tests__/__snapshots__/Pagination.test.tsx.snap +5 -1
- package/core/components/molecules/placeholder/Placeholder.tsx +2 -2
- package/core/components/molecules/popover/Popover.tsx +2 -9
- package/core/components/molecules/sidesheet/Sidesheet.tsx +5 -7
- package/core/components/molecules/sidesheet/__stories__/variants/CustomHeader.story.tsx +172 -0
- package/core/components/molecules/stepper/Step.tsx +2 -0
- package/core/components/molecules/tabs/Tabs.tsx +2 -0
- package/core/components/molecules/tabs/TabsWrapper.tsx +2 -0
- package/core/components/molecules/tabs/__stories__/CustomLabels.story.tsx +1 -1
- package/core/components/molecules/tooltip/Tooltip.tsx +4 -4
- package/core/components/molecules/verificationCodeInput/VerificationCodeInput.tsx +8 -4
- package/core/components/molecules/verificationCodeInput/__stories__/index.story.tsx +3 -1
- package/core/components/molecules/verificationCodeInput/__tests__/__snapshots__/VerificationCodeInput.test.tsx.snap +1 -0
- package/core/components/organisms/calendar/Calendar.tsx +130 -8
- package/core/components/organisms/calendar/__stories__/variants/firstDayOfWeek.story.tsx +2 -2
- package/core/components/organisms/calendar/__tests__/Calendar.test.tsx +27 -0
- package/core/components/organisms/calendar/utility.ts +3 -3
- package/core/components/organisms/choiceList/ChoiceList.tsx +12 -12
- package/core/components/organisms/datePicker/DatePicker.tsx +31 -16
- package/core/components/organisms/datePicker/Trigger.tsx +1 -5
- package/core/components/organisms/datePicker/__tests__/__snapshots__/DatePicker.test.tsx.snap +4518 -4479
- package/core/components/organisms/dateRangePicker/DateRangePicker.tsx +9 -10
- package/core/components/organisms/dateRangePicker/SingleInputTrigger.tsx +0 -1
- package/core/components/organisms/dateRangePicker/Trigger.tsx +2 -2
- package/core/components/organisms/dateRangePicker/__stories__/variants/monthsInView.story.tsx +2 -2
- package/core/components/organisms/dateRangePicker/__tests__/__snapshots__/DateRangePicker.test.tsx.snap +112 -40
- package/core/components/organisms/grid/Cell.tsx +23 -19
- package/core/components/organisms/grid/Grid.tsx +3 -4
- package/core/components/organisms/grid/GridBody.tsx +0 -1
- package/core/components/organisms/grid/GridContext.ts +1 -1
- package/core/components/organisms/grid/GridRow.tsx +4 -0
- package/core/components/organisms/grid/__stories__/_common_/editableSchema.tsx +1 -3
- package/core/components/organisms/grid/__stories__/_common_/fetchData.ts +3 -3
- package/core/components/organisms/grid/__stories__/_common_/loaderSchema.ts +0 -2
- package/core/components/organisms/grid/__stories__/_common_/schema.tsx +1 -3
- package/core/components/organisms/grid/__stories__/_common_/simpleLoaderSchema.ts +0 -2
- package/core/components/organisms/grid/__stories__/_common_/statusSchema.ts +0 -2
- package/core/components/organisms/horizontalNav/HorizontalNav.tsx +2 -0
- package/core/components/organisms/inlineMessage/InlineMessage.tsx +5 -7
- package/core/components/organisms/inlineMessage/__tests__/InlineMessage.test.tsx +3 -2
- package/core/components/organisms/inlineMessage/__tests__/__snapshots__/InlineMessage.test.tsx.snap +30 -40
- package/core/components/organisms/list/__stories__/_common_/types.tsx +3 -0
- package/core/components/organisms/list/__stories__/index.story.tsx +0 -16
- package/core/components/organisms/navigation/VerticalNavigation.tsx +4 -0
- package/core/components/organisms/table/Table.tsx +3 -2
- package/core/components/organisms/table/__stories__/CompressedTable.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/DataTable.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/NestedTableWithNestedCard.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/PinnedColumn.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/ResourceTable.story.tsx +4 -3
- package/core/components/organisms/table/__stories__/Selection.story.tsx +2 -2
- package/core/components/organisms/table/__stories__/StandardTable.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/TableAsDescriptionList.story.tsx +2 -2
- package/core/components/organisms/table/__stories__/TableAsOptionList.story.tsx +2 -2
- package/core/components/organisms/table/__stories__/TightStory.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/_common_/types.tsx +3 -0
- package/core/components/organisms/table/__stories__/syncTable.story.tsx +14 -6
- package/core/components/organisms/table/__stories__/variants/showHead.story.tsx +2 -2
- package/core/components/organisms/table/__stories__/variants/showMenu.story.tsx +2 -2
- package/core/components/organisms/table/__stories__/variants/size.story.tsx +2 -2
- package/core/components/organisms/table/__stories__/variants/type.story.tsx +2 -2
- package/core/components/organisms/table/__stories__/variants/withCheckbox.story.tsx +2 -2
- package/core/components/organisms/table/__stories__/variants/withHeader.story.tsx +0 -2
- package/core/components/organisms/table/__stories__/variants/withPagination.story.tsx +2 -2
- package/core/components/organisms/timePicker/TimePicker.tsx +4 -8
- package/core/components/organisms/timePicker/__tests__/__snapshots__/TimePicker.test.tsx.snap +14 -2
- package/core/components/organisms/verticalNav/MenuItem.tsx +2 -0
- package/core/components/organisms/verticalNav/__stories__/schema.tsx +0 -2
- package/core/components/organisms/verticalNav/__tests__/VerticalNav.test.tsx +1 -2
- package/core/components/patterns/datePicker/datePickerWithPresets.story.tsx +126 -0
- package/core/components/patterns/dateRangePicker/withCustomPopover.story.tsx +8 -8
- package/core/components/patterns/forms/CreatePassword.story.tsx +1 -1
- package/core/components/patterns/forms/VerificationCodeInput.story.tsx +2 -2
- package/core/components/patterns/table/Table with Header/tableWithHeader.story.jsx +7 -7
- package/core/global.d.ts +9 -0
- package/core/index.tsx +2 -1
- package/core/index.type.tsx +1 -0
- package/core/utils/Keys.ts +4 -0
- package/core/utils/__tests__/__snapshots__/TS.test.tsx.snap +562 -541
- package/core/utils/docPage/generateImports.tsx +2 -3
- package/core/utils/docPage/index.tsx +52 -37
- package/core/utils/docPage/sandbox.tsx +14 -7
- package/core/utils/overlayHelper.ts +7 -3
- package/core/utils/testHelper.ts +2 -2
- package/core/utils/types.tsx +1 -1
- package/core/utils/validators.ts +37 -34
- package/css/dist/index.css +1550 -1415
- package/css/dist/index.css.map +1 -1
- package/css/src/components/Legend.css +7 -7
- package/css/src/components/ProgressBar.css +1 -1
- package/css/src/components/avatarGroup.css +1 -1
- package/css/src/components/backdrop.css +12 -6
- package/css/src/components/badge.css +52 -52
- package/css/src/components/button.css +95 -94
- package/css/src/components/calendar.css +137 -126
- package/css/src/components/card.css +0 -1
- package/css/src/components/cardSubdued.css +3 -5
- package/css/src/components/chat.css +1 -1
- package/css/src/components/checkbox.css +71 -70
- package/css/src/components/chip.css +20 -17
- package/css/src/components/chipGroup.css +5 -5
- package/css/src/components/chipInput.css +1 -1
- package/css/src/components/choiceList.css +4 -4
- package/css/src/components/dateRangePicker.css +13 -13
- package/css/src/components/divider.css +20 -0
- package/css/src/components/dropdown.css +61 -61
- package/css/src/components/dropdownButton.css +36 -36
- package/css/src/components/dropzone.css +16 -20
- package/css/src/components/editableChipInput.css +10 -9
- package/css/src/components/editableDropdown.css +1 -1
- package/css/src/components/editableInput.css +1 -1
- package/css/src/components/emptyState.css +15 -15
- package/css/src/components/fileList.css +44 -45
- package/css/src/components/fullscreenModal.css +4 -3
- package/css/src/components/grid.css +217 -199
- package/css/src/components/horizontalNav.css +0 -1
- package/css/src/components/icon.css +1 -7
- package/css/src/components/inlineMessage.css +2 -1
- package/css/src/components/input.css +62 -62
- package/css/src/components/link.css +1 -1
- package/css/src/components/list.css +10 -10
- package/css/src/components/message.css +64 -70
- package/css/src/components/metaList.css +26 -26
- package/css/src/components/metricInput.css +3 -4
- package/css/src/components/modal.css +1 -1
- package/css/src/components/navigation.css +3 -3
- package/css/src/components/pageHeader.css +1 -2
- package/css/src/components/pagination.css +36 -36
- package/css/src/components/pills.css +19 -19
- package/css/src/components/placeholder.css +10 -5
- package/css/src/components/popover.css +2 -2
- package/css/src/components/progressRing.css +1 -1
- package/css/src/components/radio.css +74 -74
- package/css/src/components/slider.css +5 -5
- package/css/src/components/statusHints.css +15 -15
- package/css/src/components/switch.css +66 -41
- package/css/src/components/table.css +15 -15
- package/css/src/components/tabs.css +53 -53
- package/css/src/components/textarea.css +1 -1
- package/css/src/components/toast.css +51 -56
- package/css/src/components/verificationCodeInput.css +5 -6
- package/css/src/components/verticalNav.css +1 -2
- package/css/src/core/base.css +3 -0
- package/css/src/core/typography.css +1 -1
- package/css/src/core/utilities.css +1 -1
- package/css/src/tokens/index.css +63 -63
- package/css/src/utils/align.css +1 -1
- package/css/src/utils/background.css +1 -1
- package/css/src/utils/cursor.css +1 -1
- package/css/src/utils/display.css +1 -1
- package/css/src/utils/flex.css +1 -1
- package/css/src/utils/grid.css +1 -1
- package/css/src/utils/overflow.css +1 -1
- package/css/src/utils/position.css +1 -1
- package/css/src/utils/spacing.css +1 -1
- package/css/src/utils/utility.css +13 -13
- package/css/src/variables/index.css +6 -3
- package/dist/core/accessibility/utils/index.d.ts +4 -0
- package/dist/core/accessibility/utils/isEnterKey.d.ts +3 -0
- package/dist/core/accessibility/utils/isSpaceKey.d.ts +3 -0
- package/dist/core/accessibility/utils/useAccessibilityProps.d.ts +18 -0
- package/dist/core/common.type.d.ts +12 -0
- package/dist/core/components/atoms/avatar/Avatar.d.ts +4 -4
- package/dist/core/components/atoms/avatarGroup/AvatarGroup.d.ts +2 -3
- package/dist/core/components/atoms/badge/Badge.d.ts +2 -2
- package/dist/core/components/atoms/button/Button.d.ts +6 -6
- package/dist/core/components/atoms/checkbox/Checkbox.d.ts +3 -3
- package/dist/core/components/atoms/chip/Chip.d.ts +2 -2
- package/dist/core/components/atoms/divider/Divider.d.ts +15 -0
- package/dist/core/components/atoms/divider/index.d.ts +2 -0
- package/dist/core/components/atoms/dropdown/Dropdown.d.ts +18 -17
- package/dist/core/components/atoms/dropdown/DropdownButton.d.ts +2 -2
- package/dist/core/components/atoms/dropdown/DropdownList.d.ts +4 -3
- package/dist/core/components/atoms/dropdown/option/index.d.ts +1 -1
- package/dist/core/components/atoms/heading/Heading.d.ts +4 -4
- package/dist/core/components/atoms/icon/Icon.d.ts +5 -3
- package/dist/core/components/atoms/input/Input.d.ts +4 -4
- package/dist/core/components/atoms/legend/Legend.d.ts +2 -2
- package/dist/core/components/atoms/link/Link.d.ts +4 -4
- package/dist/core/components/atoms/message/Message.d.ts +2 -2
- package/dist/core/components/atoms/metricInput/MetricInput.d.ts +3 -3
- package/dist/core/components/atoms/multiSlider/SliderUtils.d.ts +1 -1
- package/dist/core/components/atoms/multiSlider/index.d.ts +3 -3
- package/dist/core/components/atoms/paragraph/Paragraph.d.ts +2 -2
- package/dist/core/components/atoms/pills/Pills.d.ts +2 -2
- package/dist/core/components/atoms/placeholderImage/PlaceholderImage.d.ts +2 -2
- package/dist/core/components/atoms/placeholderParagraph/PlaceholderParagraph.d.ts +2 -2
- package/dist/core/components/atoms/popperWrapper/PopperWrapper.d.ts +51 -51
- package/dist/core/components/atoms/progressRing/ProgressRing.d.ts +2 -2
- package/dist/core/components/atoms/radio/Radio.d.ts +4 -4
- package/dist/core/components/atoms/rangeSlider/RangeSlider.d.ts +1 -1
- package/dist/core/components/atoms/spinner/Spinner.d.ts +4 -4
- package/dist/core/components/atoms/statusHint/StatusHint.d.ts +2 -2
- package/dist/core/components/atoms/subheading/Subheading.d.ts +2 -2
- package/dist/core/components/atoms/switchInput/Switch.d.ts +7 -6
- package/dist/core/components/atoms/text/Text.d.ts +4 -4
- package/dist/core/components/atoms/toast/ActionButton.d.ts +2 -2
- package/dist/core/components/atoms/toast/Toast.d.ts +2 -2
- package/dist/core/components/molecules/dropzone/Dropzone.d.ts +3 -3
- package/dist/core/components/molecules/dropzone/DropzoneBase.d.ts +1 -1
- package/dist/core/components/molecules/dropzone/utils.d.ts +5 -3
- package/dist/core/components/molecules/emptyState/EmptyState.d.ts +4 -4
- package/dist/core/components/molecules/fileList/FileListItem.d.ts +1 -1
- package/dist/core/components/molecules/fileUploader/FileUploaderItem.d.ts +1 -1
- package/dist/core/components/molecules/fileUploader/FileUploaderStatus.d.ts +1 -1
- package/dist/core/components/molecules/fullscreenModal/FullscreenModal.d.ts +4 -7
- package/dist/core/components/molecules/inputMask/InputMask.d.ts +10 -2
- package/dist/core/components/molecules/modal/Modal.d.ts +3 -6
- package/dist/core/components/molecules/placeholder/Placeholder.d.ts +2 -2
- package/dist/core/components/molecules/popover/Popover.d.ts +0 -1
- package/dist/core/components/molecules/sidesheet/Sidesheet.d.ts +3 -6
- package/dist/core/components/molecules/tooltip/Tooltip.d.ts +3 -3
- package/dist/core/components/organisms/calendar/Calendar.d.ts +31 -0
- package/dist/core/components/organisms/choiceList/ChoiceList.d.ts +5 -6
- package/dist/core/components/organisms/datePicker/DatePicker.d.ts +2 -0
- package/dist/core/components/organisms/dateRangePicker/DateRangePicker.d.ts +24 -0
- package/dist/core/components/organisms/grid/Cell.d.ts +1 -1
- package/dist/core/components/organisms/grid/Grid.d.ts +3 -3
- package/dist/core/components/organisms/grid/GridContext.d.ts +1 -1
- package/dist/core/components/organisms/inlineMessage/InlineMessage.d.ts +2 -2
- package/dist/core/components/organisms/table/Table.d.ts +2 -2
- package/dist/core/components/patterns/datePicker/datePickerWithPresets.story.d.ts +15 -0
- package/dist/core/components/patterns/dateRangePicker/withCustomPopover.story.d.ts +5 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.type.d.ts +1 -0
- package/dist/core/utils/docPage/generateImports.d.ts +1 -1
- package/dist/core/utils/overlayHelper.d.ts +1 -1
- package/dist/core/utils/types.d.ts +1 -1
- package/dist/index.esm.js +1039 -729
- package/dist/index.js +532 -371
- 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/dts.config.js +11 -2
- package/package.json +32 -27
- package/tsconfig.json +3 -16
- package/tsconfig.type.json +2 -1
- package/types/index.d.ts +2217 -0
- package/types/{innovaccer-design-system/tsconfig.json → tsconfig.json} +1 -1
- package/types/{innovaccer-design-system/tslint.json → tslint.json} +0 -0
- package/types/types-tests.tsx +936 -0
- package/.husky/prepare-commit-msg +0 -6
- package/core/components/atoms/button/__stories__/variants/state/Success.story.tsx +0 -99
- package/core/components/atoms/message/__stories__/default.story.tsx +0 -16
- package/core/components/atoms/toast/__stories__/DefaultToast.story.tsx +0 -16
- package/core/components/molecules/dropzone/__stories__/variants/DropzoneWithFileList.story.tsx +0 -176
- package/core/components/molecules/fileUploader/__stories__/variants/FileUploaderList.story.tsx +0 -80
- package/tslint.json +0 -30
- package/types/innovaccer-design-system/index.d.ts +0 -39
- package/types/innovaccer-design-system/innovaccer-design-system-tests.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* Generated on:
|
|
3
|
+
* Generated on: 1639051084834
|
|
4
4
|
* Package: @innovaccer/design-system
|
|
5
|
-
* Version: v2.
|
|
5
|
+
* Version: v2.7.0-0
|
|
6
6
|
* License: MIT
|
|
7
7
|
* Docs: https://innovaccer.github.io/design-system
|
|
8
8
|
*/
|
|
@@ -202,46 +202,58 @@
|
|
|
202
202
|
|
|
203
203
|
switch (format) {
|
|
204
204
|
case 'dd/mm/yyyy':
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
205
|
+
{
|
|
206
|
+
var p = val.split('/');
|
|
207
|
+
var date_1 = +p[0] || 1;
|
|
208
|
+
var month = +p[1] || 1;
|
|
209
|
+
var year = +p[2] || 1900;
|
|
210
|
+
return validate(date_1, month, year);
|
|
211
|
+
}
|
|
210
212
|
|
|
211
213
|
case 'mm/dd/yyyy':
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
214
|
+
{
|
|
215
|
+
var p = val.split('/');
|
|
216
|
+
var date_2 = +p[1] || 1;
|
|
217
|
+
var month = +p[0] || 1;
|
|
218
|
+
var year = +p[2] || 1900;
|
|
219
|
+
return validate(date_2, month, year);
|
|
220
|
+
}
|
|
217
221
|
|
|
218
222
|
case 'yyyy/mm/dd':
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
223
|
+
{
|
|
224
|
+
var p = val.split('/');
|
|
225
|
+
var date_3 = +p[2] || 1;
|
|
226
|
+
var month = +p[1] || 1;
|
|
227
|
+
var year = +p[0] || 1900;
|
|
228
|
+
return validate(date_3, month, year);
|
|
229
|
+
}
|
|
224
230
|
|
|
225
231
|
case 'dd-mm-yyyy':
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
232
|
+
{
|
|
233
|
+
var p = val.split('-');
|
|
234
|
+
var date_4 = +p[0] || 1;
|
|
235
|
+
var month = +p[1] || 1;
|
|
236
|
+
var year = +p[2] || 1900;
|
|
237
|
+
return validate(date_4, month, year);
|
|
238
|
+
}
|
|
231
239
|
|
|
232
240
|
case 'mm-dd-yyyy':
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
241
|
+
{
|
|
242
|
+
var p = val.split('-');
|
|
243
|
+
var date_5 = +p[1] || 1;
|
|
244
|
+
var month = +p[0] || 1;
|
|
245
|
+
var year = +p[2] || 1900;
|
|
246
|
+
return validate(date_5, month, year);
|
|
247
|
+
}
|
|
238
248
|
|
|
239
249
|
case 'yyyy-mm-dd':
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
250
|
+
{
|
|
251
|
+
var p = val.split('-');
|
|
252
|
+
var date_6 = +p[2] || 1;
|
|
253
|
+
var month = +p[1] || 1;
|
|
254
|
+
var year = +p[0] || 1900;
|
|
255
|
+
return validate(date_6, month, year);
|
|
256
|
+
}
|
|
245
257
|
|
|
246
258
|
default:
|
|
247
259
|
return false;
|
|
@@ -968,6 +980,42 @@
|
|
|
968
980
|
size: 'regular'
|
|
969
981
|
};
|
|
970
982
|
|
|
983
|
+
var isEnterKey = function isEnterKey(e) {
|
|
984
|
+
return e.key === 'Enter';
|
|
985
|
+
};
|
|
986
|
+
|
|
987
|
+
var isSpaceKey = function isSpaceKey(e) {
|
|
988
|
+
return e.key === 'Space';
|
|
989
|
+
};
|
|
990
|
+
|
|
991
|
+
var useAccessibilityProps = function useAccessibilityProps(_a) {
|
|
992
|
+
var onClick = _a.onClick,
|
|
993
|
+
_onKeyDown = _a.onKeyDown,
|
|
994
|
+
role = _a.role,
|
|
995
|
+
rest = __rest(_a, ["onClick", "onKeyDown", "role"]);
|
|
996
|
+
|
|
997
|
+
return __assign({}, onClick ? {
|
|
998
|
+
onClick: onClick,
|
|
999
|
+
role: role || 'button',
|
|
1000
|
+
tabIndex: 0,
|
|
1001
|
+
'aria-label': rest['aria-label'],
|
|
1002
|
+
onKeyDown: function onKeyDown(e) {
|
|
1003
|
+
if (_onKeyDown) {
|
|
1004
|
+
_onKeyDown(e);
|
|
1005
|
+
|
|
1006
|
+
return;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
if (isEnterKey(e) && onClick) {
|
|
1010
|
+
onClick(e);
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
} : {
|
|
1014
|
+
role: role,
|
|
1015
|
+
'aria-label': rest['aria-label']
|
|
1016
|
+
});
|
|
1017
|
+
};
|
|
1018
|
+
|
|
971
1019
|
var Icon = function Icon(props) {
|
|
972
1020
|
var _a;
|
|
973
1021
|
|
|
@@ -975,8 +1023,8 @@
|
|
|
975
1023
|
className = props.className,
|
|
976
1024
|
name = props.name,
|
|
977
1025
|
size = props.size,
|
|
978
|
-
onClick = props.onClick,
|
|
979
1026
|
children = props.children;
|
|
1027
|
+
var accessibilityProps = useAccessibilityProps(props);
|
|
980
1028
|
var baseProps = extractBaseProps(props);
|
|
981
1029
|
|
|
982
1030
|
var mapper = function mapper(val) {
|
|
@@ -1007,9 +1055,8 @@
|
|
|
1007
1055
|
|
|
1008
1056
|
return /*#__PURE__*/React__namespace.createElement("i", __assign({}, baseProps, {
|
|
1009
1057
|
className: iconClass,
|
|
1010
|
-
style: styles
|
|
1011
|
-
|
|
1012
|
-
}), type ? name + "_" + type : name);
|
|
1058
|
+
style: styles
|
|
1059
|
+
}, accessibilityProps), type ? name + "_" + type : name);
|
|
1013
1060
|
};
|
|
1014
1061
|
Icon.displayName = 'Icon';
|
|
1015
1062
|
Icon.defaultProps = {
|
|
@@ -1042,9 +1089,9 @@
|
|
|
1042
1089
|
onChange = props.onChange,
|
|
1043
1090
|
name = props.name,
|
|
1044
1091
|
value = props.value,
|
|
1045
|
-
className = props.className
|
|
1046
|
-
props.checked
|
|
1047
|
-
|
|
1092
|
+
className = props.className,
|
|
1093
|
+
checkedProp = props.checked,
|
|
1094
|
+
helpText = props.helpText,
|
|
1048
1095
|
rest = __rest(props, ["size", "tabIndex", "defaultChecked", "indeterminate", "label", "disabled", "onChange", "name", "value", "className", "checked", "helpText"]);
|
|
1049
1096
|
|
|
1050
1097
|
var ref = React__namespace.useRef(null);
|
|
@@ -1052,7 +1099,7 @@
|
|
|
1052
1099
|
return ref.current;
|
|
1053
1100
|
});
|
|
1054
1101
|
|
|
1055
|
-
var _h = React__namespace.useState(
|
|
1102
|
+
var _h = React__namespace.useState(checkedProp === undefined ? defaultChecked : checkedProp),
|
|
1056
1103
|
checked = _h[0],
|
|
1057
1104
|
setChecked = _h[1];
|
|
1058
1105
|
|
|
@@ -1060,10 +1107,10 @@
|
|
|
1060
1107
|
setIndeterminate(indeterminate);
|
|
1061
1108
|
}, [indeterminate]);
|
|
1062
1109
|
React__namespace.useEffect(function () {
|
|
1063
|
-
if (
|
|
1064
|
-
setChecked(
|
|
1110
|
+
if (checkedProp !== undefined) {
|
|
1111
|
+
setChecked(checkedProp);
|
|
1065
1112
|
}
|
|
1066
|
-
}, [
|
|
1113
|
+
}, [checkedProp]);
|
|
1067
1114
|
var CheckboxClass = classNames__default["default"]((_a = {}, _a['Checkbox'] = true, _a['Checkbox--disabled'] = disabled, _a), className);
|
|
1068
1115
|
var CheckboxOuterWrapper = classNames__default["default"]((_b = {}, _b['Checkbox-outerWrapper'] = true, _b["Checkbox-outerWrapper--" + size] = size, _b));
|
|
1069
1116
|
var CheckboxInputWrapper = classNames__default["default"]((_c = {}, _c['Checkbox-input'] = true, _c['Checkbox-input--checked'] = checked, _c['Checkbox-input--indeterminate'] = props.indeterminate, _c));
|
|
@@ -1075,7 +1122,7 @@
|
|
|
1075
1122
|
};
|
|
1076
1123
|
|
|
1077
1124
|
var onChangeHandler = function onChangeHandler(e) {
|
|
1078
|
-
if (
|
|
1125
|
+
if (checkedProp === undefined) {
|
|
1079
1126
|
setChecked(e.target.checked);
|
|
1080
1127
|
setIndeterminate(e.target.indeterminate);
|
|
1081
1128
|
}
|
|
@@ -1454,51 +1501,51 @@
|
|
|
1454
1501
|
|
|
1455
1502
|
switch (loadingType) {
|
|
1456
1503
|
case 'DEFAULT':
|
|
1457
|
-
return /*#__PURE__*/
|
|
1504
|
+
return /*#__PURE__*/React__namespace.createElement(PlaceholderParagraph, {
|
|
1458
1505
|
length: 'large',
|
|
1459
1506
|
"data-test": "DesignSystem-Dropdown--PlaceholderParagraph"
|
|
1460
1507
|
});
|
|
1461
1508
|
|
|
1462
1509
|
case 'WITH_ICON':
|
|
1463
|
-
return /*#__PURE__*/
|
|
1510
|
+
return /*#__PURE__*/React__namespace.createElement(Placeholder, {
|
|
1464
1511
|
withImage: true,
|
|
1465
1512
|
round: true,
|
|
1466
1513
|
"data-test": "DesignSystem-Dropdown--Placeholder"
|
|
1467
|
-
}, /*#__PURE__*/
|
|
1514
|
+
}, /*#__PURE__*/React__namespace.createElement(PlaceholderParagraph, {
|
|
1468
1515
|
length: "large"
|
|
1469
1516
|
}));
|
|
1470
1517
|
|
|
1471
1518
|
case 'WITH_META':
|
|
1472
|
-
return /*#__PURE__*/
|
|
1519
|
+
return /*#__PURE__*/React__namespace.createElement(Placeholder, {
|
|
1473
1520
|
withImage: false,
|
|
1474
1521
|
"data-test": "DesignSystem-Dropdown--Placeholder"
|
|
1475
|
-
}, /*#__PURE__*/
|
|
1522
|
+
}, /*#__PURE__*/React__namespace.createElement(PlaceholderParagraph, {
|
|
1476
1523
|
length: "large",
|
|
1477
1524
|
"data-test": "DesignSystem-Dropdown--PlaceholderParagraph"
|
|
1478
|
-
}), /*#__PURE__*/
|
|
1525
|
+
}), /*#__PURE__*/React__namespace.createElement(PlaceholderParagraph, {
|
|
1479
1526
|
length: "medium",
|
|
1480
1527
|
size: "xxs",
|
|
1481
1528
|
"data-test": "DesignSystem-Dropdown--PlaceholderParagraph"
|
|
1482
1529
|
}));
|
|
1483
1530
|
|
|
1484
1531
|
case 'WITH_CHECKBOX':
|
|
1485
|
-
return /*#__PURE__*/
|
|
1532
|
+
return /*#__PURE__*/React__namespace.createElement(Placeholder, {
|
|
1486
1533
|
withImage: true,
|
|
1487
1534
|
"data-test": "DesignSystem-Dropdown--Placeholder"
|
|
1488
|
-
}, /*#__PURE__*/
|
|
1535
|
+
}, /*#__PURE__*/React__namespace.createElement(PlaceholderParagraph, {
|
|
1489
1536
|
length: "large"
|
|
1490
1537
|
}));
|
|
1491
1538
|
|
|
1492
1539
|
case 'ICON_WITH_META':
|
|
1493
|
-
return /*#__PURE__*/
|
|
1540
|
+
return /*#__PURE__*/React__namespace.createElement(Placeholder, {
|
|
1494
1541
|
withImage: true,
|
|
1495
1542
|
round: true,
|
|
1496
1543
|
imageSize: 'medium',
|
|
1497
1544
|
"data-test": "DesignSystem-Dropdown--Placeholder"
|
|
1498
|
-
}, /*#__PURE__*/
|
|
1545
|
+
}, /*#__PURE__*/React__namespace.createElement(PlaceholderParagraph, {
|
|
1499
1546
|
length: "large",
|
|
1500
1547
|
"data-test": "DesignSystem-Dropdown--PlaceholderParagraph"
|
|
1501
|
-
}), /*#__PURE__*/
|
|
1548
|
+
}), /*#__PURE__*/React__namespace.createElement(PlaceholderParagraph, {
|
|
1502
1549
|
length: "medium",
|
|
1503
1550
|
size: "xxs",
|
|
1504
1551
|
"data-test": "DesignSystem-Dropdown--PlaceholderParagraph"
|
|
@@ -1519,20 +1566,20 @@
|
|
|
1519
1566
|
var _d = props.listOptions,
|
|
1520
1567
|
listOptions = _d === void 0 ? [] : _d,
|
|
1521
1568
|
inputRef = props.inputRef,
|
|
1522
|
-
|
|
1523
|
-
align =
|
|
1524
|
-
|
|
1525
|
-
optionType =
|
|
1526
|
-
|
|
1527
|
-
applyButtonLabel =
|
|
1528
|
-
|
|
1529
|
-
cancelButtonLabel =
|
|
1530
|
-
|
|
1531
|
-
truncateOption =
|
|
1532
|
-
|
|
1533
|
-
withSelectAll =
|
|
1534
|
-
|
|
1535
|
-
maxHeight =
|
|
1569
|
+
_e = props.align,
|
|
1570
|
+
align = _e === void 0 ? 'right' : _e,
|
|
1571
|
+
_f = props.optionType,
|
|
1572
|
+
optionType = _f === void 0 ? 'DEFAULT' : _f,
|
|
1573
|
+
_g = props.applyButtonLabel,
|
|
1574
|
+
applyButtonLabel = _g === void 0 ? 'Apply' : _g,
|
|
1575
|
+
_h = props.cancelButtonLabel,
|
|
1576
|
+
cancelButtonLabel = _h === void 0 ? 'Cancel' : _h,
|
|
1577
|
+
_j = props.truncateOption,
|
|
1578
|
+
truncateOption = _j === void 0 ? true : _j,
|
|
1579
|
+
_k = props.withSelectAll,
|
|
1580
|
+
withSelectAll = _k === void 0 ? true : _k,
|
|
1581
|
+
_l = props.maxHeight,
|
|
1582
|
+
maxHeight = _l === void 0 ? 200 : _l,
|
|
1536
1583
|
customTrigger = props.customTrigger,
|
|
1537
1584
|
selected = props.selected,
|
|
1538
1585
|
tempSelected = props.tempSelected,
|
|
@@ -1551,7 +1598,9 @@
|
|
|
1551
1598
|
applyOptions = props.applyOptions,
|
|
1552
1599
|
cancelOptions = props.cancelOptions,
|
|
1553
1600
|
toggleDropdown = props.toggleDropdown,
|
|
1554
|
-
className = props.className
|
|
1601
|
+
className = props.className,
|
|
1602
|
+
_m = props.searchPlaceholder,
|
|
1603
|
+
searchPlaceholder = _m === void 0 ? 'Search..' : _m;
|
|
1555
1604
|
var baseProps = extractBaseProps(props);
|
|
1556
1605
|
var dropdownRef = /*#__PURE__*/React__namespace.createRef();
|
|
1557
1606
|
var triggerRef = /*#__PURE__*/React__namespace.createRef();
|
|
@@ -1739,7 +1788,7 @@
|
|
|
1739
1788
|
name: "Dropdown-search",
|
|
1740
1789
|
icon: 'search',
|
|
1741
1790
|
value: searchTerm,
|
|
1742
|
-
placeholder:
|
|
1791
|
+
placeholder: searchPlaceholder,
|
|
1743
1792
|
autoFocus: true,
|
|
1744
1793
|
onChange: searchHandler,
|
|
1745
1794
|
onClear: searchClearHandler,
|
|
@@ -1770,7 +1819,7 @@
|
|
|
1770
1819
|
var label = selectAllLabel.trim() ? selectAllLabel.trim() : 'Select All';
|
|
1771
1820
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
1772
1821
|
className: SelectAllClass,
|
|
1773
|
-
onMouseEnter: function onMouseEnter(
|
|
1822
|
+
onMouseEnter: function onMouseEnter() {
|
|
1774
1823
|
return updateActiveOption(0, true);
|
|
1775
1824
|
}
|
|
1776
1825
|
}, /*#__PURE__*/React__namespace.createElement(Checkbox, {
|
|
@@ -1900,46 +1949,50 @@
|
|
|
1900
1949
|
break;
|
|
1901
1950
|
|
|
1902
1951
|
case 'Enter':
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1952
|
+
{
|
|
1953
|
+
var activeElement = document.activeElement;
|
|
1954
|
+
|
|
1955
|
+
if (dropdownOpen && (inputRef.current === activeElement || dropdownTriggerRef.current === activeElement)) {
|
|
1956
|
+
event.preventDefault();
|
|
1957
|
+
var classes = withCheckbox ? optionClass + " .Checkbox-input" : optionClass;
|
|
1958
|
+
var elements = document.querySelectorAll(classes);
|
|
1959
|
+
var element = elements[cursor];
|
|
1960
|
+
if (element) element.click();
|
|
1961
|
+
}
|
|
1912
1962
|
|
|
1913
|
-
|
|
1914
|
-
|
|
1963
|
+
if (!dropdownOpen) onToggleDropdown(!dropdownOpen);
|
|
1964
|
+
break;
|
|
1965
|
+
}
|
|
1915
1966
|
|
|
1916
1967
|
case 'Tab':
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1968
|
+
{
|
|
1969
|
+
if (!showApplyButton && dropdownOpen) {
|
|
1970
|
+
event.preventDefault();
|
|
1971
|
+
onToggleDropdown(false, 'onClick');
|
|
1972
|
+
return;
|
|
1973
|
+
}
|
|
1922
1974
|
|
|
1923
|
-
|
|
1924
|
-
|
|
1975
|
+
var currentElement = document.activeElement;
|
|
1976
|
+
var disabledApplyButton = (_a = dropdownApplyButtonRef.current) === null || _a === void 0 ? void 0 : _a.disabled;
|
|
1925
1977
|
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1978
|
+
if ((currentElement === dropdownCancelButtonRef.current && disabledApplyButton || currentElement === dropdownApplyButtonRef.current) && dropdownOpen) {
|
|
1979
|
+
event.preventDefault();
|
|
1980
|
+
onToggleDropdown(false, 'onClick');
|
|
1981
|
+
return;
|
|
1982
|
+
}
|
|
1931
1983
|
|
|
1932
|
-
|
|
1933
|
-
|
|
1984
|
+
if (showApplyButton && dropdownOpen) {
|
|
1985
|
+
event.preventDefault();
|
|
1934
1986
|
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1987
|
+
if (currentElement === dropdownCancelButtonRef.current) {
|
|
1988
|
+
(_b = dropdownApplyButtonRef.current) === null || _b === void 0 ? void 0 : _b.focus();
|
|
1989
|
+
} else {
|
|
1990
|
+
(_c = dropdownCancelButtonRef.current) === null || _c === void 0 ? void 0 : _c.focus();
|
|
1991
|
+
}
|
|
1939
1992
|
}
|
|
1940
|
-
}
|
|
1941
1993
|
|
|
1942
|
-
|
|
1994
|
+
break;
|
|
1995
|
+
}
|
|
1943
1996
|
}
|
|
1944
1997
|
};
|
|
1945
1998
|
|
|
@@ -3045,6 +3098,17 @@
|
|
|
3045
3098
|
};
|
|
3046
3099
|
};
|
|
3047
3100
|
|
|
3101
|
+
_this.yearMouseOverHandler = function (year, isCurrentYear, isDisabled, ev) {
|
|
3102
|
+
var onYearHover = _this.props.onYearHover;
|
|
3103
|
+
var yearData = {
|
|
3104
|
+
value: year,
|
|
3105
|
+
year: year,
|
|
3106
|
+
isCurrentYear: isCurrentYear,
|
|
3107
|
+
isDisabled: isDisabled
|
|
3108
|
+
};
|
|
3109
|
+
if (onYearHover) onYearHover(yearData, ev);
|
|
3110
|
+
};
|
|
3111
|
+
|
|
3048
3112
|
_this.selectMonth = function (month) {
|
|
3049
3113
|
return function () {
|
|
3050
3114
|
_this.updateState(_this.state.yearNav, month);
|
|
@@ -3055,7 +3119,28 @@
|
|
|
3055
3119
|
};
|
|
3056
3120
|
};
|
|
3057
3121
|
|
|
3122
|
+
_this.monthMouseOverHandler = function (month, isCurrentMonth, isDisabled, ev) {
|
|
3123
|
+
var months = config.months;
|
|
3124
|
+
var onMonthHover = _this.props.onMonthHover;
|
|
3125
|
+
var monthData = {
|
|
3126
|
+
value: months[month],
|
|
3127
|
+
month: months[month],
|
|
3128
|
+
year: _this.state.year,
|
|
3129
|
+
isCurrentMonth: isCurrentMonth,
|
|
3130
|
+
isDisabled: isDisabled
|
|
3131
|
+
};
|
|
3132
|
+
if (onMonthHover) onMonthHover(monthData, ev);
|
|
3133
|
+
};
|
|
3134
|
+
|
|
3058
3135
|
_this.selectDate = function (index, date, prevMonthDayRange, dayRange) {
|
|
3136
|
+
var d = _this.calculateDate(index, date, prevMonthDayRange, dayRange, false);
|
|
3137
|
+
|
|
3138
|
+
_this.setState({
|
|
3139
|
+
currDate: d
|
|
3140
|
+
});
|
|
3141
|
+
};
|
|
3142
|
+
|
|
3143
|
+
_this.calculateDate = function (index, date, prevMonthDayRange, dayRange, isDateHovered) {
|
|
3059
3144
|
var neighbouringMonthIndex;
|
|
3060
3145
|
var neighbouringMonthDate;
|
|
3061
3146
|
var type = '';
|
|
@@ -3077,15 +3162,15 @@
|
|
|
3077
3162
|
year = _a.year,
|
|
3078
3163
|
month = _a.month;
|
|
3079
3164
|
|
|
3080
|
-
|
|
3165
|
+
if (isDateHovered === false) {
|
|
3166
|
+
_this.updateState(year, month, neighbouringMonthDate);
|
|
3081
3167
|
|
|
3082
|
-
|
|
3168
|
+
_this.onNavIconClickHandler(type)();
|
|
3169
|
+
}
|
|
3083
3170
|
|
|
3084
3171
|
var d = _this.getDateValue(year, month, neighbouringMonthDate);
|
|
3085
3172
|
|
|
3086
|
-
|
|
3087
|
-
currDate: d
|
|
3088
|
-
});
|
|
3173
|
+
return d;
|
|
3089
3174
|
};
|
|
3090
3175
|
|
|
3091
3176
|
_this.onNavIconClickHandler = function (type) {
|
|
@@ -3329,7 +3414,8 @@
|
|
|
3329
3414
|
key: row + "-" + col,
|
|
3330
3415
|
"data-test": "DesignSystem-Calendar--yearValue",
|
|
3331
3416
|
className: valueClass,
|
|
3332
|
-
onClick: _this.selectYear(year)
|
|
3417
|
+
onClick: _this.selectYear(year),
|
|
3418
|
+
onMouseOver: _this.yearMouseOverHandler.bind(_this, year, isCurrentYear(), disabled)
|
|
3333
3419
|
}, /*#__PURE__*/React__namespace.createElement(Text, {
|
|
3334
3420
|
size: size === 'small' ? 'small' : 'regular',
|
|
3335
3421
|
appearance: active ? 'white' : disabled ? 'disabled' : isCurrentYear() ? 'link' : 'default'
|
|
@@ -3381,7 +3467,8 @@
|
|
|
3381
3467
|
key: row + "-" + col,
|
|
3382
3468
|
"data-test": "DesignSystem-Calendar--monthValue",
|
|
3383
3469
|
className: valueClass,
|
|
3384
|
-
onClick: _this.selectMonth(month)
|
|
3470
|
+
onClick: _this.selectMonth(month),
|
|
3471
|
+
onMouseOver: _this.monthMouseOverHandler.bind(_this, month, isCurrentMonth(), disabled)
|
|
3385
3472
|
}, /*#__PURE__*/React__namespace.createElement(Text, {
|
|
3386
3473
|
size: size === 'small' ? 'small' : 'regular',
|
|
3387
3474
|
appearance: active ? 'white' : disabled ? 'disabled' : isCurrentMonth() ? 'link' : 'default'
|
|
@@ -3438,7 +3525,8 @@
|
|
|
3438
3525
|
firstDayOfWeek = _a.firstDayOfWeek,
|
|
3439
3526
|
disabledBefore = _a.disabledBefore,
|
|
3440
3527
|
disabledAfter = _a.disabledAfter,
|
|
3441
|
-
monthsInView = _a.monthsInView
|
|
3528
|
+
monthsInView = _a.monthsInView,
|
|
3529
|
+
onDateHover = _a.onDateHover;
|
|
3442
3530
|
var _b = _this.state,
|
|
3443
3531
|
startDate = _b.startDate,
|
|
3444
3532
|
endDate = _b.endDate,
|
|
@@ -3462,11 +3550,7 @@
|
|
|
3462
3550
|
var dummyDays = Math.abs(dayDiff);
|
|
3463
3551
|
var noOfRows = Math.ceil((dayRange + dummyDays) / daysInRow);
|
|
3464
3552
|
|
|
3465
|
-
if (noOfRows === 6) {
|
|
3466
|
-
noOfRows = noOfRows;
|
|
3467
|
-
} else if (monthsInView > 1) {
|
|
3468
|
-
noOfRows = noOfRows;
|
|
3469
|
-
} else {
|
|
3553
|
+
if (noOfRows === 6) ; else if (monthsInView > 1) ; else {
|
|
3470
3554
|
noOfRows = noOfRows + 1;
|
|
3471
3555
|
}
|
|
3472
3556
|
|
|
@@ -3502,6 +3586,25 @@
|
|
|
3502
3586
|
};
|
|
3503
3587
|
};
|
|
3504
3588
|
|
|
3589
|
+
var onMouseEnterHandler = function onMouseEnterHandler(date, isToday, isDisabled, ev) {
|
|
3590
|
+
var d = _this.calculateDate(index, date, prevMonthDayRange, dayRange, true) || new Date();
|
|
3591
|
+
var months = config.months,
|
|
3592
|
+
days = config.days;
|
|
3593
|
+
var dayName = days.large[d.getDay()];
|
|
3594
|
+
var dateData = {
|
|
3595
|
+
value: d.getDate(),
|
|
3596
|
+
isToday: isToday,
|
|
3597
|
+
isDisabled: isDisabled,
|
|
3598
|
+
todayDate: _this.state.currDate,
|
|
3599
|
+
fullDate: d,
|
|
3600
|
+
date: d.getDate(),
|
|
3601
|
+
month: months[d.getMonth()],
|
|
3602
|
+
year: d.getFullYear(),
|
|
3603
|
+
dayName: dayName
|
|
3604
|
+
};
|
|
3605
|
+
if (onDateHover) onDateHover(dateData, ev);
|
|
3606
|
+
};
|
|
3607
|
+
|
|
3505
3608
|
return Array.from({
|
|
3506
3609
|
length: noOfRows
|
|
3507
3610
|
}, function (_y, row) {
|
|
@@ -3601,14 +3704,16 @@
|
|
|
3601
3704
|
"data-test": "DesignSystem-Calendar--dateValue",
|
|
3602
3705
|
className: valueClass,
|
|
3603
3706
|
onClick: onClickHandler(date),
|
|
3604
|
-
onMouseOver: onMouseOverHandler(date)
|
|
3707
|
+
onMouseOver: onMouseOverHandler(date),
|
|
3708
|
+
onMouseEnter: onMouseEnterHandler.bind(_this, date, today(), disabled)
|
|
3605
3709
|
}, date), isEventExist && _this.renderEventsIndicator(size, active)), (dummy && date > 0 && index === monthsInView - 1 || dummy && date <= 0 && index === 0) && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Text, {
|
|
3606
3710
|
appearance: active ? 'white' : disabled ? 'disabled' : today() ? 'link' : 'default',
|
|
3607
3711
|
size: size === 'small' ? 'small' : 'regular',
|
|
3608
3712
|
"data-test": "DesignSystem-Calendar--dateValue",
|
|
3609
3713
|
className: valueClass,
|
|
3610
3714
|
onClick: onClickHandler(date),
|
|
3611
|
-
onMouseOver: onMouseOverHandler(date)
|
|
3715
|
+
onMouseOver: onMouseOverHandler(date),
|
|
3716
|
+
onMouseEnter: onMouseEnterHandler.bind(_this, date, today(), disabled)
|
|
3612
3717
|
}, date <= 0 ? prevMonthDayRange + date : date - dayRange), isEventExist && _this.renderEventsIndicator(size, active)));
|
|
3613
3718
|
}));
|
|
3614
3719
|
});
|
|
@@ -3957,6 +4062,8 @@
|
|
|
3957
4062
|
};
|
|
3958
4063
|
|
|
3959
4064
|
var GenericChip = function GenericChip(props) {
|
|
4065
|
+
var _a, _b;
|
|
4066
|
+
|
|
3960
4067
|
var label = props.label,
|
|
3961
4068
|
icon = props.icon,
|
|
3962
4069
|
clearButton = props.clearButton,
|
|
@@ -3982,6 +4089,8 @@
|
|
|
3982
4089
|
if (onClick) onClick();
|
|
3983
4090
|
};
|
|
3984
4091
|
|
|
4092
|
+
var iconAppearance = classNames__default["default"]((_a = {}, _a['disabled'] = disabled && !selected, _a['info'] = selected, _a['subtle'] = !disabled && !selected && !clearButton && !icon, _a['default'] = !disabled && !selected && !clearButton && icon, _a));
|
|
4093
|
+
var textAppearance = classNames__default["default"]((_b = {}, _b['disabled'] = disabled && !selected, _b['link'] = selected, _b['default'] = !disabled && !selected, _b));
|
|
3985
4094
|
return /*#__PURE__*/React__namespace.createElement("div", __assign({
|
|
3986
4095
|
"data-test": "DesignSystem-GenericChip--GenericChipWrapper"
|
|
3987
4096
|
}, baseProps, {
|
|
@@ -3990,15 +4099,15 @@
|
|
|
3990
4099
|
}), icon && /*#__PURE__*/React__namespace.createElement(Icon, {
|
|
3991
4100
|
"data-test": "DesignSystem-GenericChip--Icon",
|
|
3992
4101
|
name: icon,
|
|
3993
|
-
appearance:
|
|
4102
|
+
appearance: iconAppearance,
|
|
3994
4103
|
className: iconClass('left')
|
|
3995
4104
|
}), /*#__PURE__*/React__namespace.createElement(Text, {
|
|
3996
4105
|
"data-test": "DesignSystem-GenericChip--Text",
|
|
3997
|
-
appearance:
|
|
4106
|
+
appearance: textAppearance
|
|
3998
4107
|
}, label), clearButton && /*#__PURE__*/React__namespace.createElement(Icon, {
|
|
3999
4108
|
"data-test": "DesignSystem-GenericChip--clearButton",
|
|
4000
4109
|
name: "clear",
|
|
4001
|
-
appearance:
|
|
4110
|
+
appearance: iconAppearance,
|
|
4002
4111
|
className: iconClass('right'),
|
|
4003
4112
|
onClick: onCloseHandler
|
|
4004
4113
|
}));
|
|
@@ -4030,7 +4139,7 @@
|
|
|
4030
4139
|
|
|
4031
4140
|
var chipClass = classNames__default["default"]((_a = {
|
|
4032
4141
|
Chip: true
|
|
4033
|
-
}, _a["Chip-" + type + "--disabled"] = disabled, _a["Chip--" + type] = type && !disabled, _a["Chip-" + type + "--selected"] = selected && !disabled, _a), className);
|
|
4142
|
+
}, _a["Chip-" + type + "--disabled"] = disabled, _a["Chip--" + type] = type && !disabled, _a["Chip-" + type + "--selected"] = selected && !disabled, _a["Chip-selection--selectedDisabled"] = type === 'selection' && selected && disabled, _a), className);
|
|
4034
4143
|
var clearbutton = type === 'action' ? false : clearButton;
|
|
4035
4144
|
var select = type === 'selection' && selected ? true : false;
|
|
4036
4145
|
return /*#__PURE__*/React__namespace.createElement(GenericChip, __assign({
|
|
@@ -4181,13 +4290,13 @@
|
|
|
4181
4290
|
};
|
|
4182
4291
|
|
|
4183
4292
|
var mask = date[inputFormat];
|
|
4184
|
-
return /*#__PURE__*/React__namespace.createElement(
|
|
4293
|
+
return /*#__PURE__*/React__namespace.createElement(X, __assign({
|
|
4185
4294
|
icon: "events",
|
|
4186
4295
|
placeholder: inputFormat
|
|
4187
4296
|
}, inputOptions, {
|
|
4188
4297
|
error: showError,
|
|
4189
4298
|
mask: mask,
|
|
4190
|
-
value: date$1 ? translateToString(inputFormat, date$1) : init ?
|
|
4299
|
+
value: date$1 ? translateToString(inputFormat, date$1) : init ? X.utils.getDefaultValue(mask, placeholderChar) : '',
|
|
4191
4300
|
onChange: onChangeHandler,
|
|
4192
4301
|
onBlur: onBlurHandler,
|
|
4193
4302
|
onClear: onClearHandler,
|
|
@@ -4324,7 +4433,11 @@
|
|
|
4324
4433
|
_a.onDateChange;
|
|
4325
4434
|
_a.closeOnSelect;
|
|
4326
4435
|
var size = _a.size,
|
|
4327
|
-
|
|
4436
|
+
_b = _a.showTodayDate,
|
|
4437
|
+
showTodayDate = _b === void 0 ? true : _b,
|
|
4438
|
+
_c = _a.children,
|
|
4439
|
+
children = _c === void 0 ? /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null) : _c,
|
|
4440
|
+
rest = __rest(_a, ["date", "open", "position", "inputFormat", "outputFormat", "inputOptions", "validators", "withInput", "disabledBefore", "disabledAfter", "onDateChange", "closeOnSelect", "size", "showTodayDate", "children"]);
|
|
4328
4441
|
|
|
4329
4442
|
var date = this.state.date;
|
|
4330
4443
|
var months = config.months;
|
|
@@ -4348,13 +4461,15 @@
|
|
|
4348
4461
|
return !isTodayDateDisabled;
|
|
4349
4462
|
};
|
|
4350
4463
|
|
|
4351
|
-
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement(
|
|
4464
|
+
return /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("div", {
|
|
4465
|
+
className: "d-flex"
|
|
4466
|
+
}, children, /*#__PURE__*/React__namespace.createElement(Calendar, __assign({}, rest, {
|
|
4352
4467
|
size: size,
|
|
4353
4468
|
date: currDate,
|
|
4354
4469
|
disabledBefore: dateDisabledBefore,
|
|
4355
4470
|
disabledAfter: dateDisabledAfter,
|
|
4356
4471
|
onDateChange: this.onDateChangeHandler
|
|
4357
|
-
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
4472
|
+
}))), showTodayDate && /*#__PURE__*/React__namespace.createElement("div", {
|
|
4358
4473
|
className: "d-flex justify-content-center pb-6",
|
|
4359
4474
|
"data-test": "DesignSystem-Select--TodaysDate-wrapper"
|
|
4360
4475
|
}, /*#__PURE__*/React__namespace.createElement(Chip, {
|
|
@@ -4473,12 +4588,12 @@
|
|
|
4473
4588
|
};
|
|
4474
4589
|
|
|
4475
4590
|
var mask = time[inputFormat];
|
|
4476
|
-
return /*#__PURE__*/React__namespace.createElement(
|
|
4591
|
+
return /*#__PURE__*/React__namespace.createElement(X, __assign({
|
|
4477
4592
|
placeholder: placeholders[inputFormat],
|
|
4478
4593
|
placeholderChar: placeholderChar
|
|
4479
4594
|
}, inputOptions, {
|
|
4480
4595
|
mask: mask,
|
|
4481
|
-
value: time$1 ? translateToTime(inputFormat, time$1) : init ?
|
|
4596
|
+
value: time$1 ? translateToTime(inputFormat, time$1) : init ? X.utils.getDefaultValue(mask, placeholderChar) : '',
|
|
4482
4597
|
validators: inputValidator,
|
|
4483
4598
|
onChange: onChangeHandler,
|
|
4484
4599
|
onClear: onClearHandler,
|
|
@@ -4592,7 +4707,8 @@
|
|
|
4592
4707
|
var _a;
|
|
4593
4708
|
|
|
4594
4709
|
return (_a = ref.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
4595
|
-
}
|
|
4710
|
+
},
|
|
4711
|
+
role: "presentation"
|
|
4596
4712
|
}, inlineLabel && /*#__PURE__*/React__namespace.createElement("div", {
|
|
4597
4713
|
className: "Input-inlineLabel"
|
|
4598
4714
|
}, /*#__PURE__*/React__namespace.createElement(Text, {
|
|
@@ -4623,12 +4739,17 @@
|
|
|
4623
4739
|
position: "top",
|
|
4624
4740
|
tooltip: info
|
|
4625
4741
|
}, trigger) : actionIcon && (value || defaultValue) ? actionIcon : onClear && (value || defaultValue) && /*#__PURE__*/React__namespace.createElement("div", {
|
|
4626
|
-
className: rightIconClass
|
|
4742
|
+
className: rightIconClass
|
|
4743
|
+
}, /*#__PURE__*/React__namespace.createElement(Icon, {
|
|
4744
|
+
"data-test": "DesignSystem-Input--closeIcon",
|
|
4627
4745
|
onClick: function onClick(e) {
|
|
4628
|
-
|
|
4746
|
+
var _a;
|
|
4747
|
+
|
|
4748
|
+
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.focus({
|
|
4749
|
+
preventScroll: true
|
|
4750
|
+
});
|
|
4751
|
+
onClear(e);
|
|
4629
4752
|
},
|
|
4630
|
-
"data-test": "DesignSystem-Input--closeIcon"
|
|
4631
|
-
}, /*#__PURE__*/React__namespace.createElement(Icon, {
|
|
4632
4753
|
name: 'close',
|
|
4633
4754
|
size: sizeMapping$1[size]
|
|
4634
4755
|
})));
|
|
@@ -4769,7 +4890,14 @@
|
|
|
4769
4890
|
var _a;
|
|
4770
4891
|
|
|
4771
4892
|
return (_a = ref.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
4772
|
-
}
|
|
4893
|
+
},
|
|
4894
|
+
onFocus: function onFocus() {
|
|
4895
|
+
var _a;
|
|
4896
|
+
|
|
4897
|
+
return (_a = ref.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
4898
|
+
},
|
|
4899
|
+
onKeyDown: function onKeyDown() {},
|
|
4900
|
+
role: "presentation"
|
|
4773
4901
|
}, icon && /*#__PURE__*/React__namespace.createElement(Icon, {
|
|
4774
4902
|
"data-test": "DesignSystem-MetricInput--icon",
|
|
4775
4903
|
name: icon,
|
|
@@ -4804,9 +4932,9 @@
|
|
|
4804
4932
|
size: size,
|
|
4805
4933
|
appearance: "subtle"
|
|
4806
4934
|
}, suffix), /*#__PURE__*/React__namespace.createElement("div", {
|
|
4807
|
-
className: "MetricInput-arrowIcons"
|
|
4808
|
-
tabIndex: 0
|
|
4935
|
+
className: "MetricInput-arrowIcons"
|
|
4809
4936
|
}, /*#__PURE__*/React__namespace.createElement(Icon, {
|
|
4937
|
+
tabIndex: -1,
|
|
4810
4938
|
className: getArrowClass('up'),
|
|
4811
4939
|
size: iconSize,
|
|
4812
4940
|
name: "keyboard_arrow_up",
|
|
@@ -4815,6 +4943,7 @@
|
|
|
4815
4943
|
},
|
|
4816
4944
|
"data-test": "DesignSystem-MetricInput--upIcon"
|
|
4817
4945
|
}), /*#__PURE__*/React__namespace.createElement(Icon, {
|
|
4946
|
+
tabIndex: -1,
|
|
4818
4947
|
className: getArrowClass('down'),
|
|
4819
4948
|
size: iconSize,
|
|
4820
4949
|
name: "keyboard_arrow_down",
|
|
@@ -4860,7 +4989,10 @@
|
|
|
4860
4989
|
className = props.className,
|
|
4861
4990
|
rest = __rest(props, ["mask", "value", "placeholderChar", "validators", "clearOnEmptyBlur", "defaultValue", "mask", "error", "caption", "required", "onChange", "onBlur", "onFocus", "onClear", "className"]);
|
|
4862
4991
|
|
|
4863
|
-
var
|
|
4992
|
+
var isEditable = React__namespace.useCallback(function (pos) {
|
|
4993
|
+
return _typeof(mask[pos]) === 'object';
|
|
4994
|
+
}, [mask]);
|
|
4995
|
+
var getNewCursorPosition = React__namespace.useCallback(function (type, position) {
|
|
4864
4996
|
if (type === 'right') {
|
|
4865
4997
|
for (var i = position; i < mask.length; i++) {
|
|
4866
4998
|
if (isEditable(i)) return i;
|
|
@@ -4878,17 +5010,15 @@
|
|
|
4878
5010
|
}
|
|
4879
5011
|
|
|
4880
5012
|
return position;
|
|
4881
|
-
};
|
|
4882
|
-
|
|
4883
|
-
var getDefaultSelection = function getDefaultSelection() {
|
|
5013
|
+
}, [mask, isEditable]);
|
|
5014
|
+
var getDefaultSelection = React__namespace.useCallback(function () {
|
|
4884
5015
|
var pos = getNewCursorPosition('right', 0);
|
|
4885
5016
|
return {
|
|
4886
5017
|
start: pos,
|
|
4887
5018
|
end: pos
|
|
4888
5019
|
};
|
|
4889
|
-
};
|
|
4890
|
-
|
|
4891
|
-
var getPlaceholderValue = function getPlaceholderValue(start, end) {
|
|
5020
|
+
}, [getNewCursorPosition]);
|
|
5021
|
+
var getPlaceholderValue = React__namespace.useCallback(function (start, end) {
|
|
4892
5022
|
if (start === void 0) {
|
|
4893
5023
|
start = 0;
|
|
4894
5024
|
}
|
|
@@ -4898,66 +5028,57 @@
|
|
|
4898
5028
|
}
|
|
4899
5029
|
|
|
4900
5030
|
return getDefaultValue(mask, placeholderChar).slice(start, end + 1);
|
|
4901
|
-
};
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
};
|
|
4910
|
-
|
|
5031
|
+
}, [mask, placeholderChar]);
|
|
5032
|
+
var defaultPlaceholderValue = React__namespace.useMemo(function () {
|
|
5033
|
+
return getPlaceholderValue();
|
|
5034
|
+
}, [getPlaceholderValue]);
|
|
5035
|
+
var defaultSelection = React__namespace.useMemo(function () {
|
|
5036
|
+
return getDefaultSelection();
|
|
5037
|
+
}, [getDefaultSelection]);
|
|
5038
|
+
var ref = React__namespace.useRef(null);
|
|
4911
5039
|
var deferId = React__namespace.useRef();
|
|
4912
|
-
var
|
|
5040
|
+
var selectionPos = React__namespace.useRef(defaultSelection);
|
|
5041
|
+
var newSelectionPos = React__namespace.useRef(0);
|
|
4913
5042
|
|
|
4914
5043
|
var _d = React__namespace.useState(defaultValue || valueProp || ''),
|
|
4915
5044
|
value = _d[0],
|
|
4916
5045
|
setValue = _d[1];
|
|
4917
5046
|
|
|
4918
|
-
var _e = React__namespace.useState(getDefaultSelection()),
|
|
4919
|
-
selection = _e[0],
|
|
4920
|
-
setSelection = _e[1];
|
|
4921
|
-
|
|
4922
|
-
var ref = React__namespace.useRef(null);
|
|
4923
5047
|
React__namespace.useImperativeHandle(forwardRef, function () {
|
|
4924
5048
|
return ref.current;
|
|
4925
5049
|
});
|
|
4926
5050
|
React__namespace.useEffect(function () {
|
|
4927
5051
|
setValue(valueProp || '');
|
|
4928
5052
|
}, [valueProp]);
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
var getCurrSelection = function getCurrSelection() {
|
|
5053
|
+
React__namespace.useEffect(function () {
|
|
5054
|
+
setCursorPosition(newSelectionPos.current);
|
|
5055
|
+
}, [value]);
|
|
5056
|
+
var getSelectionLength = React__namespace.useCallback(function (val) {
|
|
5057
|
+
return Math.abs(val.end - val.start);
|
|
5058
|
+
}, []);
|
|
5059
|
+
var getCurrSelection = React__namespace.useCallback(function () {
|
|
4938
5060
|
var _a, _b;
|
|
4939
5061
|
|
|
4940
5062
|
return {
|
|
4941
5063
|
start: ((_a = ref.current) === null || _a === void 0 ? void 0 : _a.selectionStart) || 0,
|
|
4942
5064
|
end: ((_b = ref.current) === null || _b === void 0 ? void 0 : _b.selectionEnd) || 0
|
|
4943
5065
|
};
|
|
4944
|
-
};
|
|
4945
|
-
|
|
4946
|
-
var setSelectionPos = function setSelectionPos(pos) {
|
|
5066
|
+
}, [ref.current]);
|
|
5067
|
+
var setSelectionPos = React__namespace.useCallback(function (pos) {
|
|
4947
5068
|
if (ref.current) {
|
|
4948
5069
|
var el = ref.current;
|
|
4949
5070
|
var start = Math.min(pos.start, pos.end);
|
|
4950
5071
|
var end = Math.max(pos.start, pos.end);
|
|
4951
5072
|
el.setSelectionRange(start, end);
|
|
4952
5073
|
}
|
|
4953
|
-
};
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
var insertAtIndex = function
|
|
5074
|
+
}, [ref.current]);
|
|
5075
|
+
var setCursorPosition = React__namespace.useCallback(function (val) {
|
|
5076
|
+
return setSelectionPos({
|
|
5077
|
+
start: val,
|
|
5078
|
+
end: val
|
|
5079
|
+
});
|
|
5080
|
+
}, [setSelectionPos]);
|
|
5081
|
+
var insertAtIndex = React__namespace.useCallback(function (currValue, index, iterator) {
|
|
4961
5082
|
if (iterator === void 0) {
|
|
4962
5083
|
iterator = 0;
|
|
4963
5084
|
}
|
|
@@ -4971,7 +5092,10 @@
|
|
|
4971
5092
|
}
|
|
4972
5093
|
|
|
4973
5094
|
if (iterator >= currValue.length) {
|
|
4974
|
-
|
|
5095
|
+
selectionPos.current = {
|
|
5096
|
+
start: index,
|
|
5097
|
+
end: index
|
|
5098
|
+
};
|
|
4975
5099
|
return newValue;
|
|
4976
5100
|
}
|
|
4977
5101
|
|
|
@@ -4991,12 +5115,15 @@
|
|
|
4991
5115
|
|
|
4992
5116
|
newValue += insertAtIndex(currValue, newIndex, newIterator);
|
|
4993
5117
|
return newValue;
|
|
4994
|
-
};
|
|
4995
|
-
|
|
4996
|
-
|
|
5118
|
+
}, [mask, placeholderChar, isEditable]);
|
|
5119
|
+
var updateSelection = React__namespace.useCallback(function () {
|
|
5120
|
+
selectionPos.current = getCurrSelection();
|
|
5121
|
+
deferId.current = window.requestAnimationFrame(updateSelection);
|
|
5122
|
+
}, [selectionPos.current, getCurrSelection]);
|
|
5123
|
+
var onChangeHandler = React__namespace.useCallback(function (e) {
|
|
4997
5124
|
var inputVal = e.currentTarget.value;
|
|
4998
5125
|
var currSelection = getCurrSelection();
|
|
4999
|
-
var start = Math.min(
|
|
5126
|
+
var start = Math.min(selectionPos.current.start, currSelection.start);
|
|
5000
5127
|
var end = currSelection.end;
|
|
5001
5128
|
var cursorPosition = start;
|
|
5002
5129
|
var enteredVal = '';
|
|
@@ -5007,8 +5134,8 @@
|
|
|
5007
5134
|
updatedVal = insertAtIndex(enteredVal, start);
|
|
5008
5135
|
insertedStringLength = updatedVal.length;
|
|
5009
5136
|
|
|
5010
|
-
if (currSelection.end >
|
|
5011
|
-
removedLength = insertedStringLength ? getSelectionLength(
|
|
5137
|
+
if (currSelection.end > selectionPos.current.end) {
|
|
5138
|
+
removedLength = insertedStringLength ? getSelectionLength(selectionPos.current) : 0;
|
|
5012
5139
|
} else if (inputVal.length < value.length) {
|
|
5013
5140
|
removedLength = value.length - inputVal.length;
|
|
5014
5141
|
}
|
|
@@ -5036,54 +5163,50 @@
|
|
|
5036
5163
|
}
|
|
5037
5164
|
|
|
5038
5165
|
var newValue = maskedVal.slice(0, mask.length).join('');
|
|
5039
|
-
|
|
5040
|
-
return setCursorPosition(cursorPosition);
|
|
5041
|
-
});
|
|
5166
|
+
newSelectionPos.current = cursorPosition;
|
|
5042
5167
|
|
|
5043
|
-
if (isValid(validators, newValue)
|
|
5168
|
+
if (newValue !== value && isValid(validators, newValue)) {
|
|
5044
5169
|
setValue(newValue);
|
|
5045
|
-
|
|
5170
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(e, newValue);
|
|
5171
|
+
} else {
|
|
5172
|
+
window.requestAnimationFrame(function () {
|
|
5173
|
+
return setCursorPosition(newSelectionPos.current);
|
|
5174
|
+
});
|
|
5046
5175
|
}
|
|
5047
|
-
};
|
|
5048
|
-
|
|
5049
|
-
var onBlurHandler = function onBlurHandler(e) {
|
|
5176
|
+
}, [selectionPos.current, validators, getCurrSelection, insertAtIndex, getSelectionLength, getPlaceholderValue, getNewCursorPosition, isEditable, setCursorPosition, setValue, onChange]);
|
|
5177
|
+
var onBlurHandler = React__namespace.useCallback(function (e) {
|
|
5050
5178
|
var inputVal = e.currentTarget.value;
|
|
5051
5179
|
|
|
5052
5180
|
if (clearOnEmptyBlur) {
|
|
5053
|
-
if (inputVal ===
|
|
5181
|
+
if (inputVal === defaultPlaceholderValue) {
|
|
5054
5182
|
setValue('');
|
|
5055
5183
|
inputVal = '';
|
|
5056
5184
|
}
|
|
5057
5185
|
}
|
|
5058
5186
|
|
|
5059
|
-
|
|
5187
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e, inputVal);
|
|
5060
5188
|
if (deferId.current) window.cancelAnimationFrame(deferId.current);
|
|
5061
|
-
};
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
setValue(
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
if (onClear) onClear(e);
|
|
5069
|
-
};
|
|
5070
|
-
|
|
5071
|
-
var onFocusHandler = function onFocusHandler(e) {
|
|
5189
|
+
}, [clearOnEmptyBlur, deferId.current, getPlaceholderValue, setValue, onBlur]);
|
|
5190
|
+
var onClearHandler = React__namespace.useCallback(function (e) {
|
|
5191
|
+
newSelectionPos.current = defaultSelection.start;
|
|
5192
|
+
setValue(defaultPlaceholderValue);
|
|
5193
|
+
onClear === null || onClear === void 0 ? void 0 : onClear(e);
|
|
5194
|
+
}, [setValue, getPlaceholderValue, setCursorPosition, getDefaultSelection, onClear]);
|
|
5195
|
+
var onFocusHandler = React__namespace.useCallback(function (e) {
|
|
5072
5196
|
deferId.current = window.requestAnimationFrame(updateSelection);
|
|
5073
5197
|
|
|
5074
5198
|
if (!value) {
|
|
5199
|
+
newSelectionPos.current = defaultSelection.start;
|
|
5075
5200
|
setValue(getPlaceholderValue());
|
|
5076
|
-
window.requestAnimationFrame(function () {
|
|
5077
|
-
return setSelectionPos(getDefaultSelection());
|
|
5078
|
-
});
|
|
5079
5201
|
}
|
|
5080
5202
|
|
|
5081
|
-
|
|
5082
|
-
};
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5203
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
|
|
5204
|
+
}, [deferId.current, value, updateSelection, setValue, setSelectionPos, onFocus]);
|
|
5205
|
+
var classes = React__namespace.useMemo(function () {
|
|
5206
|
+
return classNames__default["default"]({
|
|
5207
|
+
'd-flex flex-column flex-grow-1': true
|
|
5208
|
+
}, className);
|
|
5209
|
+
}, [className]);
|
|
5087
5210
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
5088
5211
|
className: classes,
|
|
5089
5212
|
"data-test": "DesignSystem-InputMask--Wrapper"
|
|
@@ -5107,6 +5230,7 @@
|
|
|
5107
5230
|
InputMask.utils = {
|
|
5108
5231
|
getDefaultValue: getDefaultValue
|
|
5109
5232
|
};
|
|
5233
|
+
var X = InputMask;
|
|
5110
5234
|
|
|
5111
5235
|
var Label = function Label(props) {
|
|
5112
5236
|
var _a;
|
|
@@ -5302,14 +5426,14 @@
|
|
|
5302
5426
|
switch (eventType) {
|
|
5303
5427
|
case 'edit':
|
|
5304
5428
|
setEditing(true);
|
|
5429
|
+
break;
|
|
5305
5430
|
|
|
5306
5431
|
case 'hover':
|
|
5307
5432
|
setShowComponent(true);
|
|
5308
|
-
|
|
5433
|
+
break;
|
|
5309
5434
|
|
|
5310
5435
|
case 'default':
|
|
5311
5436
|
setShowComponent(false);
|
|
5312
|
-
return;
|
|
5313
5437
|
}
|
|
5314
5438
|
};
|
|
5315
5439
|
|
|
@@ -5389,10 +5513,11 @@
|
|
|
5389
5513
|
var Message = function Message(props) {
|
|
5390
5514
|
var _a, _b, _c, _d;
|
|
5391
5515
|
|
|
5392
|
-
var
|
|
5393
|
-
actions = props.actions,
|
|
5516
|
+
var actions = props.actions,
|
|
5394
5517
|
title = props.title,
|
|
5395
5518
|
className = props.className;
|
|
5519
|
+
var appearance = props.appearance;
|
|
5520
|
+
appearance = appearance === 'default' ? 'info' : appearance;
|
|
5396
5521
|
var baseProps = extractBaseProps(props);
|
|
5397
5522
|
var MessageClass = classNames__default["default"]((_a = {}, _a['Message'] = true, _a["Message--" + appearance] = appearance, _a), className);
|
|
5398
5523
|
var IconClass = classNames__default["default"]((_b = {}, _b['Message-icon'] = true, _b["Message-icon--" + appearance] = appearance, _b['Message-icon--withTitle'] = title, _b));
|
|
@@ -5421,7 +5546,7 @@
|
|
|
5421
5546
|
"data-test": "DesignSystem-Message"
|
|
5422
5547
|
}, baseProps, {
|
|
5423
5548
|
className: MessageClass
|
|
5424
|
-
}),
|
|
5549
|
+
}), /*#__PURE__*/React__namespace.createElement(Icon, {
|
|
5425
5550
|
"data-test": "DesignSystem-Message--Icon",
|
|
5426
5551
|
name: IconMapping$2[appearance],
|
|
5427
5552
|
appearance: appearance,
|
|
@@ -5437,7 +5562,7 @@
|
|
|
5437
5562
|
};
|
|
5438
5563
|
Message.displayName = 'Message';
|
|
5439
5564
|
Message.defaultProps = {
|
|
5440
|
-
appearance: '
|
|
5565
|
+
appearance: 'info',
|
|
5441
5566
|
description: ''
|
|
5442
5567
|
};
|
|
5443
5568
|
|
|
@@ -5573,7 +5698,7 @@
|
|
|
5573
5698
|
values[index] = fillValue;
|
|
5574
5699
|
}
|
|
5575
5700
|
}
|
|
5576
|
-
function isElementOfType(element
|
|
5701
|
+
function isElementOfType(element) {
|
|
5577
5702
|
return element != null && element.type != null;
|
|
5578
5703
|
}
|
|
5579
5704
|
|
|
@@ -6227,7 +6352,7 @@
|
|
|
6227
6352
|
return;
|
|
6228
6353
|
}
|
|
6229
6354
|
|
|
6230
|
-
if (!
|
|
6355
|
+
if (!element.current.contains(event.target)) {
|
|
6231
6356
|
onOutsideClick(event);
|
|
6232
6357
|
}
|
|
6233
6358
|
}, []);
|
|
@@ -6598,8 +6723,10 @@
|
|
|
6598
6723
|
var SwitchWrapper = classNames__default["default"]((_b = {}, _b['Switch-wrapper'] = true, _b['Switch-wrapper--disabled'] = disabled, _b["Switch-wrapper--" + size] = size, _b['Switch-wrapper--checked'] = checked, _b['Switch-wrapper--checkedDisabled'] = checked && disabled, _b));
|
|
6599
6724
|
|
|
6600
6725
|
var onChangeHandler = function onChangeHandler(event) {
|
|
6601
|
-
if (
|
|
6602
|
-
|
|
6726
|
+
if (event.type == 'change' || isSpaceKey(event)) {
|
|
6727
|
+
if (checkedProp === undefined) setChecked(!checked);
|
|
6728
|
+
if (onChange) onChange(event, !checked);
|
|
6729
|
+
}
|
|
6603
6730
|
};
|
|
6604
6731
|
|
|
6605
6732
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
@@ -6613,7 +6740,8 @@
|
|
|
6613
6740
|
ref: ref,
|
|
6614
6741
|
name: name,
|
|
6615
6742
|
value: value,
|
|
6616
|
-
className: "Switch-input"
|
|
6743
|
+
className: "Switch-input",
|
|
6744
|
+
onKeyUp: onChangeHandler
|
|
6617
6745
|
})), /*#__PURE__*/React__namespace.createElement("span", {
|
|
6618
6746
|
className: SwitchWrapper
|
|
6619
6747
|
}));
|
|
@@ -6691,12 +6819,13 @@
|
|
|
6691
6819
|
var Toast = function Toast(props) {
|
|
6692
6820
|
var _a, _b, _c, _d;
|
|
6693
6821
|
|
|
6694
|
-
var
|
|
6695
|
-
title = props.title,
|
|
6822
|
+
var title = props.title,
|
|
6696
6823
|
message = props.message,
|
|
6697
6824
|
actions = props.actions,
|
|
6698
6825
|
onClose = props.onClose,
|
|
6699
6826
|
className = props.className;
|
|
6827
|
+
var appearance = props.appearance;
|
|
6828
|
+
appearance = appearance === 'default' ? 'info' : appearance;
|
|
6700
6829
|
var baseProps = extractBaseProps(props);
|
|
6701
6830
|
var wrapperClass = classNames__default["default"]((_a = {}, _a['Toast'] = true, _a['Toast--withMessage'] = message, _a["Toast--" + appearance] = appearance, _a), className);
|
|
6702
6831
|
var IconMapping = {
|
|
@@ -6755,7 +6884,7 @@
|
|
|
6755
6884
|
};
|
|
6756
6885
|
Toast.displayName = 'Toast';
|
|
6757
6886
|
Toast.defaultProps = {
|
|
6758
|
-
appearance: '
|
|
6887
|
+
appearance: 'info'
|
|
6759
6888
|
};
|
|
6760
6889
|
|
|
6761
6890
|
var PopperWrapper = function (_super) {
|
|
@@ -6771,13 +6900,8 @@
|
|
|
6771
6900
|
onToggle(newValue === undefined ? !open : newValue, type);
|
|
6772
6901
|
};
|
|
6773
6902
|
|
|
6774
|
-
_this.findDOMNode = function (ref) {
|
|
6775
|
-
return ReactDOM__namespace.findDOMNode(ref.current);
|
|
6776
|
-
};
|
|
6777
|
-
|
|
6778
6903
|
_this.doesEventContainsElement = function (event, ref) {
|
|
6779
|
-
var el =
|
|
6780
|
-
|
|
6904
|
+
var el = ref.current;
|
|
6781
6905
|
return el && el.contains(event.target);
|
|
6782
6906
|
};
|
|
6783
6907
|
|
|
@@ -6840,7 +6964,7 @@
|
|
|
6840
6964
|
this._throttleWait = false;
|
|
6841
6965
|
|
|
6842
6966
|
if (this.props.open) {
|
|
6843
|
-
var triggerElement = this.
|
|
6967
|
+
var triggerElement = this.triggerRef.current;
|
|
6844
6968
|
var zIndex = this.getZIndexForLayer(triggerElement);
|
|
6845
6969
|
this.setState({
|
|
6846
6970
|
zIndex: zIndex === undefined ? zIndex : zIndex + 1
|
|
@@ -7031,7 +7155,7 @@
|
|
|
7031
7155
|
return PopperWrapper;
|
|
7032
7156
|
}(React__namespace.Component);
|
|
7033
7157
|
|
|
7034
|
-
var propsList
|
|
7158
|
+
var propsList = ['appendToBody', 'trigger', 'hoverable', 'on', 'open', 'closeOnBackdropClick', 'offset', 'closeOnScroll'];
|
|
7035
7159
|
var Popover = function Popover(props) {
|
|
7036
7160
|
var _a;
|
|
7037
7161
|
|
|
@@ -7042,16 +7166,17 @@
|
|
|
7042
7166
|
onToggle = props.onToggle,
|
|
7043
7167
|
className = props.className,
|
|
7044
7168
|
hideOnReferenceEscape = props.hideOnReferenceEscape,
|
|
7045
|
-
|
|
7169
|
+
_b = props.boundaryElement,
|
|
7170
|
+
boundaryElement = _b === void 0 ? document.body : _b,
|
|
7046
7171
|
rest = __rest(props, ["position", "customStyle", "dark", "children", "onToggle", "className", "hideOnReferenceEscape", "boundaryElement"]);
|
|
7047
7172
|
|
|
7048
|
-
var
|
|
7049
|
-
open =
|
|
7050
|
-
setOpen =
|
|
7173
|
+
var _c = React__namespace.useState(!!props.open),
|
|
7174
|
+
open = _c[0],
|
|
7175
|
+
setOpen = _c[1];
|
|
7051
7176
|
|
|
7052
|
-
var
|
|
7053
|
-
init =
|
|
7054
|
-
setInit =
|
|
7177
|
+
var _d = React__namespace.useState(false),
|
|
7178
|
+
init = _d[0],
|
|
7179
|
+
setInit = _d[1];
|
|
7055
7180
|
|
|
7056
7181
|
React__namespace.useEffect(function () {
|
|
7057
7182
|
if (props.open !== undefined) setOpen(props.open);
|
|
@@ -7085,12 +7210,11 @@
|
|
|
7085
7210
|
}), PopoverWrapper);
|
|
7086
7211
|
};
|
|
7087
7212
|
Popover.displayName = 'Popover';
|
|
7088
|
-
Popover.defaultProps = Object.assign({}, filterProps(PopperWrapper.defaultProps, propsList
|
|
7213
|
+
Popover.defaultProps = Object.assign({}, filterProps(PopperWrapper.defaultProps, propsList, true), {
|
|
7089
7214
|
offset: 'large',
|
|
7090
7215
|
position: 'bottom',
|
|
7091
7216
|
hideOnReferenceEscape: true,
|
|
7092
|
-
customStyle: {}
|
|
7093
|
-
boundaryElement: document.body
|
|
7217
|
+
customStyle: {}
|
|
7094
7218
|
});
|
|
7095
7219
|
|
|
7096
7220
|
var keyCodes = {
|
|
@@ -7546,7 +7670,7 @@
|
|
|
7546
7670
|
}), list);
|
|
7547
7671
|
};
|
|
7548
7672
|
|
|
7549
|
-
var
|
|
7673
|
+
var tooltipPropsList = ['trigger', 'on', 'open', 'offset', 'onToggle', 'dark', 'customStyle', 'closeOnBackdropClick', 'hideOnReferenceEscape', 'closeOnScroll'];
|
|
7550
7674
|
var Tooltip = function Tooltip(props) {
|
|
7551
7675
|
var children = props.children,
|
|
7552
7676
|
tooltip = props.tooltip,
|
|
@@ -7564,7 +7688,7 @@
|
|
|
7564
7688
|
offset: 'medium'
|
|
7565
7689
|
}, rest), tooltipWrapper);
|
|
7566
7690
|
};
|
|
7567
|
-
Tooltip.defaultProps = Object.assign({}, filterProps(Popover.defaultProps,
|
|
7691
|
+
Tooltip.defaultProps = Object.assign({}, filterProps(Popover.defaultProps, tooltipPropsList), {
|
|
7568
7692
|
hoverable: false
|
|
7569
7693
|
});
|
|
7570
7694
|
|
|
@@ -8908,15 +9032,23 @@
|
|
|
8908
9032
|
|
|
8909
9033
|
switch (eventType) {
|
|
8910
9034
|
case 'edit':
|
|
8911
|
-
|
|
8912
|
-
|
|
9035
|
+
{
|
|
9036
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
9037
|
+
setEditing(true);
|
|
9038
|
+
setShowComponent(true);
|
|
9039
|
+
break;
|
|
9040
|
+
}
|
|
8913
9041
|
|
|
8914
9042
|
case 'hover':
|
|
8915
|
-
|
|
8916
|
-
|
|
9043
|
+
{
|
|
9044
|
+
setShowComponent(true);
|
|
9045
|
+
break;
|
|
9046
|
+
}
|
|
8917
9047
|
|
|
8918
9048
|
case 'default':
|
|
8919
|
-
|
|
9049
|
+
{
|
|
9050
|
+
setShowComponent(false);
|
|
9051
|
+
}
|
|
8920
9052
|
}
|
|
8921
9053
|
};
|
|
8922
9054
|
|
|
@@ -9066,14 +9198,21 @@
|
|
|
9066
9198
|
var onChangeHandler = function onChangeHandler(eventType) {
|
|
9067
9199
|
switch (eventType) {
|
|
9068
9200
|
case 'edit':
|
|
9069
|
-
|
|
9201
|
+
{
|
|
9202
|
+
setShowComponent(true);
|
|
9203
|
+
break;
|
|
9204
|
+
}
|
|
9070
9205
|
|
|
9071
9206
|
case 'hover':
|
|
9072
|
-
|
|
9207
|
+
{
|
|
9208
|
+
break;
|
|
9209
|
+
}
|
|
9073
9210
|
|
|
9074
9211
|
case 'default':
|
|
9075
|
-
|
|
9076
|
-
|
|
9212
|
+
{
|
|
9213
|
+
setShowComponent(false);
|
|
9214
|
+
break;
|
|
9215
|
+
}
|
|
9077
9216
|
}
|
|
9078
9217
|
};
|
|
9079
9218
|
|
|
@@ -9448,12 +9587,12 @@
|
|
|
9448
9587
|
}, startLabel && /*#__PURE__*/React__namespace.createElement(Label, {
|
|
9449
9588
|
required: startInputOptions.required,
|
|
9450
9589
|
withInput: true
|
|
9451
|
-
}, startLabel), /*#__PURE__*/React__namespace.createElement(
|
|
9590
|
+
}, startLabel), /*#__PURE__*/React__namespace.createElement(X, __assign({
|
|
9452
9591
|
icon: "events",
|
|
9453
9592
|
placeholder: inputFormat
|
|
9454
9593
|
}, startInputOptions, {
|
|
9455
9594
|
mask: mask,
|
|
9456
|
-
value: startDate ? translateToString(inputFormat, startDate) : init ?
|
|
9595
|
+
value: startDate ? translateToString(inputFormat, startDate) : init ? X.utils.getDefaultValue(mask, startPlaceholderChar) : '',
|
|
9457
9596
|
onChange: function onChange(e, val) {
|
|
9458
9597
|
onChangeHandler(e, val || '', 'start');
|
|
9459
9598
|
},
|
|
@@ -9477,12 +9616,12 @@
|
|
|
9477
9616
|
}, endLabel && /*#__PURE__*/React__namespace.createElement(Label, {
|
|
9478
9617
|
required: endInputOptions.required,
|
|
9479
9618
|
withInput: true
|
|
9480
|
-
}, endLabel), /*#__PURE__*/React__namespace.createElement(
|
|
9619
|
+
}, endLabel), /*#__PURE__*/React__namespace.createElement(X, __assign({
|
|
9481
9620
|
icon: "events",
|
|
9482
9621
|
placeholder: inputFormat
|
|
9483
9622
|
}, endInputOptions, {
|
|
9484
9623
|
mask: mask,
|
|
9485
|
-
value: endDate ? translateToString(inputFormat, endDate) : init ?
|
|
9624
|
+
value: endDate ? translateToString(inputFormat, endDate) : init ? X.utils.getDefaultValue(mask, endPlaceholderChar) : '',
|
|
9486
9625
|
onChange: function onChange(e, val) {
|
|
9487
9626
|
onChangeHandler(e, val || '', 'end');
|
|
9488
9627
|
},
|
|
@@ -9521,7 +9660,7 @@
|
|
|
9521
9660
|
var label = inputOptions.label;
|
|
9522
9661
|
var _a = inputOptions.placeholderChar,
|
|
9523
9662
|
placeholderChar = _a === void 0 ? '_' : _a;
|
|
9524
|
-
var defaultValue =
|
|
9663
|
+
var defaultValue = X.utils.getDefaultValue(mask, placeholderChar).split(' - ');
|
|
9525
9664
|
var sValue = startValue || defaultValue[0];
|
|
9526
9665
|
var eValue = endValue || defaultValue[1];
|
|
9527
9666
|
|
|
@@ -9611,7 +9750,7 @@
|
|
|
9611
9750
|
}, /*#__PURE__*/React__namespace.createElement(Column, null, label && /*#__PURE__*/React__namespace.createElement(Label, {
|
|
9612
9751
|
required: inputOptions.required,
|
|
9613
9752
|
withInput: true
|
|
9614
|
-
}, label), /*#__PURE__*/React__namespace.createElement(
|
|
9753
|
+
}, label), /*#__PURE__*/React__namespace.createElement(X, __assign({
|
|
9615
9754
|
icon: "events",
|
|
9616
9755
|
placeholder: inputFormat + " - " + inputFormat
|
|
9617
9756
|
}, inputOptions, {
|
|
@@ -10008,6 +10147,15 @@
|
|
|
10008
10147
|
return this.renderCalendar();
|
|
10009
10148
|
};
|
|
10010
10149
|
|
|
10150
|
+
DateRangePicker.utils = {
|
|
10151
|
+
getCurrentWeek: getCurrentWeek,
|
|
10152
|
+
getPreviousWeek: getPreviousWeek,
|
|
10153
|
+
getPreviousMonth: getPreviousMonth,
|
|
10154
|
+
getPrevious90Days: getPrevious90Days,
|
|
10155
|
+
getCustomDates: getCustomDates,
|
|
10156
|
+
getCurrentYear: getCurrentYear,
|
|
10157
|
+
getCurrentMonth: getCurrentMonth
|
|
10158
|
+
};
|
|
10011
10159
|
DateRangePicker.defaultProps = __assign(__assign({}, Calendar.defaultProps), {
|
|
10012
10160
|
children: /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null),
|
|
10013
10161
|
contentAlign: 'left',
|
|
@@ -10028,15 +10176,6 @@
|
|
|
10028
10176
|
});
|
|
10029
10177
|
return DateRangePicker;
|
|
10030
10178
|
}(React__namespace.Component);
|
|
10031
|
-
DateRangePicker.utils = {
|
|
10032
|
-
getCurrentWeek: getCurrentWeek,
|
|
10033
|
-
getPreviousWeek: getPreviousWeek,
|
|
10034
|
-
getPreviousMonth: getPreviousMonth,
|
|
10035
|
-
getPrevious90Days: getPrevious90Days,
|
|
10036
|
-
getCustomDates: getCustomDates,
|
|
10037
|
-
getCurrentYear: getCurrentYear,
|
|
10038
|
-
getCurrentMonth: getCurrentMonth
|
|
10039
|
-
};
|
|
10040
10179
|
|
|
10041
10180
|
var TabsWrapper = function TabsWrapper(props) {
|
|
10042
10181
|
var _a;
|
|
@@ -10724,7 +10863,7 @@
|
|
|
10724
10863
|
dispatch({
|
|
10725
10864
|
type: 'openDialog'
|
|
10726
10865
|
});
|
|
10727
|
-
inputRef.current.value =
|
|
10866
|
+
inputRef.current.value = '';
|
|
10728
10867
|
inputRef.current.click();
|
|
10729
10868
|
}
|
|
10730
10869
|
}, [dispatch]);
|
|
@@ -10735,7 +10874,7 @@
|
|
|
10735
10874
|
if (inputRef.current) {
|
|
10736
10875
|
var files = inputRef.current.files;
|
|
10737
10876
|
|
|
10738
|
-
if (!files.length) {
|
|
10877
|
+
if (!files || !files.length) {
|
|
10739
10878
|
dispatch({
|
|
10740
10879
|
type: 'closeDialog'
|
|
10741
10880
|
});
|
|
@@ -10778,7 +10917,7 @@
|
|
|
10778
10917
|
var dragTargetsRef = React.useRef([]);
|
|
10779
10918
|
|
|
10780
10919
|
var onDocumentDrop = function onDocumentDrop(event) {
|
|
10781
|
-
if (rootRef.current && rootRef.current.contains(event.target)) {
|
|
10920
|
+
if (event.target instanceof HTMLDivElement && rootRef.current && rootRef.current.contains(event.target)) {
|
|
10782
10921
|
return;
|
|
10783
10922
|
}
|
|
10784
10923
|
|
|
@@ -10899,11 +11038,12 @@
|
|
|
10899
11038
|
errors = errors.concat(customErrors);
|
|
10900
11039
|
}
|
|
10901
11040
|
|
|
11041
|
+
var filteredErrors = errors.filter(function (e) {
|
|
11042
|
+
return e;
|
|
11043
|
+
});
|
|
10902
11044
|
fileRejections.push({
|
|
10903
11045
|
file: file,
|
|
10904
|
-
errors:
|
|
10905
|
-
return e;
|
|
10906
|
-
})
|
|
11046
|
+
errors: filteredErrors
|
|
10907
11047
|
});
|
|
10908
11048
|
}
|
|
10909
11049
|
});
|
|
@@ -10932,16 +11072,8 @@
|
|
|
10932
11072
|
});
|
|
10933
11073
|
}, [multiple, accept, minSize, maxSize, getFilesFromEvent, onDrop, onDropAccepted, onDropRejected]);
|
|
10934
11074
|
|
|
10935
|
-
var composeHandler = function composeHandler(fn) {
|
|
10936
|
-
return disabled ? null : fn;
|
|
10937
|
-
};
|
|
10938
|
-
|
|
10939
|
-
var composeKeyboardHandler = function composeKeyboardHandler(_fn) {
|
|
10940
|
-
return null;
|
|
10941
|
-
};
|
|
10942
|
-
|
|
10943
11075
|
var composeDragHandler = function composeDragHandler(fn) {
|
|
10944
|
-
return
|
|
11076
|
+
return disabled ? null : fn;
|
|
10945
11077
|
};
|
|
10946
11078
|
|
|
10947
11079
|
var getRootProps = React.useMemo(function () {
|
|
@@ -10953,10 +11085,10 @@
|
|
|
10953
11085
|
}
|
|
10954
11086
|
|
|
10955
11087
|
var _c = _a.refKey,
|
|
10956
|
-
refKey = _c === void 0 ? 'ref' : _c
|
|
10957
|
-
|
|
10958
|
-
|
|
10959
|
-
|
|
11088
|
+
refKey = _c === void 0 ? 'ref' : _c;
|
|
11089
|
+
_a.onKeyDown;
|
|
11090
|
+
_a.onFocus;
|
|
11091
|
+
_a.onBlur;
|
|
10960
11092
|
_a.onClick;
|
|
10961
11093
|
var onDragEnterCallback = _a.onDragEnterCallback,
|
|
10962
11094
|
onDragOverCallback = _a.onDragOverCallback,
|
|
@@ -10965,9 +11097,6 @@
|
|
|
10965
11097
|
rest = __rest(_a, ["refKey", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnterCallback", "onDragOverCallback", "onDragLeaveCallback", "onDropCallback"]);
|
|
10966
11098
|
|
|
10967
11099
|
return __assign((_b = {
|
|
10968
|
-
onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),
|
|
10969
|
-
onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)),
|
|
10970
|
-
onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),
|
|
10971
11100
|
onDragEnter: composeDragHandler(composeEventHandlers(onDragEnterCallback, onDragEnterCb)),
|
|
10972
11101
|
onDragOver: composeDragHandler(composeEventHandlers(onDragOverCallback, onDragOverCb)),
|
|
10973
11102
|
onDragLeave: composeDragHandler(composeEventHandlers(onDragLeaveCallback, onDragLeaveCb)),
|
|
@@ -10999,8 +11128,8 @@
|
|
|
10999
11128
|
style: {
|
|
11000
11129
|
display: 'none'
|
|
11001
11130
|
},
|
|
11002
|
-
onChange:
|
|
11003
|
-
onClick:
|
|
11131
|
+
onChange: composeDragHandler(composeEventHandlers(onChange, onDropCb)),
|
|
11132
|
+
onClick: composeDragHandler(composeEventHandlers(onClick, onInputElementClick)),
|
|
11004
11133
|
autoComplete: 'off',
|
|
11005
11134
|
tabIndex: -1
|
|
11006
11135
|
}, _b[refKey] = inputRef, _b);
|
|
@@ -11033,7 +11162,7 @@
|
|
|
11033
11162
|
draggedFiles: draggedFiles,
|
|
11034
11163
|
fileError: fileError,
|
|
11035
11164
|
isFocused: isFocused && !disabled,
|
|
11036
|
-
open:
|
|
11165
|
+
open: composeDragHandler(openFileDialog)
|
|
11037
11166
|
});
|
|
11038
11167
|
};
|
|
11039
11168
|
DropzoneBase.displayName = 'DropzoneBase';
|
|
@@ -11110,42 +11239,42 @@
|
|
|
11110
11239
|
var WrapperClass = classNames__default["default"]((_c = {}, _c['DropzoneWrapper'] = true, _c["DropzoneWrapper--" + type] = true, _c));
|
|
11111
11240
|
|
|
11112
11241
|
var renderDropzone = function renderDropzone() {
|
|
11113
|
-
if (isDragReject) return /*#__PURE__*/
|
|
11242
|
+
if (isDragReject) return /*#__PURE__*/React__namespace.createElement(DropzoneError, {
|
|
11114
11243
|
type: type,
|
|
11115
11244
|
error: fileErrorMessages[fileError]
|
|
11116
11245
|
});
|
|
11117
|
-
if (isDragActive) return /*#__PURE__*/
|
|
11246
|
+
if (isDragActive) return /*#__PURE__*/React__namespace.createElement(DropzoneActive, {
|
|
11118
11247
|
type: type
|
|
11119
11248
|
});
|
|
11120
|
-
return /*#__PURE__*/
|
|
11249
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, type !== 'tight' && /*#__PURE__*/React__namespace.createElement(Icon, {
|
|
11121
11250
|
name: "backup",
|
|
11122
11251
|
size: 64,
|
|
11123
11252
|
className: IconClass
|
|
11124
|
-
}), /*#__PURE__*/
|
|
11253
|
+
}), /*#__PURE__*/React__namespace.createElement("div", {
|
|
11125
11254
|
className: WrapperClass,
|
|
11126
11255
|
"data-test": "DesignSystem-Dropzone-Wrapper"
|
|
11127
|
-
}, /*#__PURE__*/
|
|
11256
|
+
}, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(Text, {
|
|
11128
11257
|
size: "large",
|
|
11129
11258
|
weight: "strong",
|
|
11130
11259
|
className: "mr-2",
|
|
11131
11260
|
appearance: disabled ? 'disabled' : 'default'
|
|
11132
|
-
}, "Drag your files here or"), /*#__PURE__*/
|
|
11261
|
+
}, "Drag your files here or"), /*#__PURE__*/React__namespace.createElement("span", {
|
|
11133
11262
|
className: "cursor-pointer",
|
|
11134
11263
|
onClick: open
|
|
11135
|
-
}, /*#__PURE__*/
|
|
11264
|
+
}, /*#__PURE__*/React__namespace.createElement(Text, {
|
|
11136
11265
|
size: "large",
|
|
11137
11266
|
weight: "strong",
|
|
11138
11267
|
appearance: disabled ? 'disabled' : 'link'
|
|
11139
|
-
}, "browse files")), /*#__PURE__*/
|
|
11268
|
+
}, "browse files")), /*#__PURE__*/React__namespace.createElement("input", __assign({}, getInputProps()))), formatLabel && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
11140
11269
|
appearance: disabled ? 'disabled' : 'subtle'
|
|
11141
|
-
}, formatLabel), sizeLabel && /*#__PURE__*/
|
|
11270
|
+
}, formatLabel), sizeLabel && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
11142
11271
|
appearance: disabled ? 'disabled' : 'subtle'
|
|
11143
|
-
}, sizeLabel), sampleFileLink && /*#__PURE__*/
|
|
11272
|
+
}, sizeLabel), sampleFileLink && /*#__PURE__*/React__namespace.createElement("div", {
|
|
11144
11273
|
className: "mt-5"
|
|
11145
11274
|
}, sampleFileLink)));
|
|
11146
11275
|
};
|
|
11147
11276
|
|
|
11148
|
-
return /*#__PURE__*/
|
|
11277
|
+
return /*#__PURE__*/React__namespace.createElement("div", __assign({}, getRootProps(), baseProps, {
|
|
11149
11278
|
className: DropzoneClass,
|
|
11150
11279
|
"data-test": "DesignSystem-Dropzone"
|
|
11151
11280
|
}), renderDropzone());
|
|
@@ -11634,7 +11763,7 @@
|
|
|
11634
11763
|
showFilters: true
|
|
11635
11764
|
};
|
|
11636
11765
|
|
|
11637
|
-
var context = /*#__PURE__*/
|
|
11766
|
+
var context = /*#__PURE__*/React__namespace.createContext(__assign(__assign({}, defaultProps$1), {
|
|
11638
11767
|
ref: null
|
|
11639
11768
|
}));
|
|
11640
11769
|
var GridProvider = context.Provider;
|
|
@@ -11866,18 +11995,19 @@
|
|
|
11866
11995
|
|
|
11867
11996
|
var Cell = function Cell(props) {
|
|
11868
11997
|
var context$1 = React__namespace.useContext(context);
|
|
11869
|
-
var
|
|
11870
|
-
|
|
11871
|
-
|
|
11872
|
-
|
|
11873
|
-
|
|
11874
|
-
|
|
11875
|
-
|
|
11876
|
-
|
|
11877
|
-
|
|
11878
|
-
|
|
11879
|
-
|
|
11880
|
-
|
|
11998
|
+
var _a = props,
|
|
11999
|
+
isHead = _a.isHead,
|
|
12000
|
+
firstCell = _a.firstCell,
|
|
12001
|
+
schema = _a.schema,
|
|
12002
|
+
data = _a.data,
|
|
12003
|
+
rowIndex = _a.rowIndex,
|
|
12004
|
+
colIndex = _a.colIndex,
|
|
12005
|
+
expandedState = _a.expandedState,
|
|
12006
|
+
onSelectAll = _a.onSelectAll,
|
|
12007
|
+
onMenuChange = _a.onMenuChange,
|
|
12008
|
+
onFilterChange = _a.onFilterChange,
|
|
12009
|
+
updateColumnSchema = _a.updateColumnSchema,
|
|
12010
|
+
reorderColumn = _a.reorderColumn;
|
|
11881
12011
|
var draggable = context$1.draggable,
|
|
11882
12012
|
separator = context$1.separator,
|
|
11883
12013
|
nestedRows = context$1.nestedRows,
|
|
@@ -11886,15 +12016,15 @@
|
|
|
11886
12016
|
var name = schema.name,
|
|
11887
12017
|
hidden = schema.hidden,
|
|
11888
12018
|
pinned = schema.pinned,
|
|
11889
|
-
|
|
11890
|
-
cellType =
|
|
12019
|
+
_b = schema.cellType,
|
|
12020
|
+
cellType = _b === void 0 ? 'DEFAULT' : _b;
|
|
11891
12021
|
|
|
11892
|
-
var
|
|
11893
|
-
width =
|
|
11894
|
-
|
|
11895
|
-
minWidth =
|
|
11896
|
-
|
|
11897
|
-
maxWidth =
|
|
12022
|
+
var _c = getCellSize(cellType),
|
|
12023
|
+
width = _c.width,
|
|
12024
|
+
_d = _c.minWidth,
|
|
12025
|
+
minWidth = _d === void 0 ? 96 : _d,
|
|
12026
|
+
_e = _c.maxWidth,
|
|
12027
|
+
maxWidth = _e === void 0 ? 800 : _e;
|
|
11898
12028
|
|
|
11899
12029
|
var cellClass = classNames__default["default"]({
|
|
11900
12030
|
'Grid-cell': true,
|
|
@@ -11927,7 +12057,7 @@
|
|
|
11927
12057
|
name: name,
|
|
11928
12058
|
type: pinned || ''
|
|
11929
12059
|
};
|
|
11930
|
-
if (from.type === to.type) reorderColumn(from.name, to.name);
|
|
12060
|
+
if (from.type === to.type && reorderColumn) reorderColumn(from.name, to.name);
|
|
11931
12061
|
}
|
|
11932
12062
|
},
|
|
11933
12063
|
style: {
|
|
@@ -12380,10 +12510,10 @@
|
|
|
12380
12510
|
length = _this$props2.length,
|
|
12381
12511
|
buffer = _this$props2.buffer;
|
|
12382
12512
|
_this$props2.offset;
|
|
12383
|
-
_this$props2.
|
|
12513
|
+
_this$props2.renderItems;
|
|
12384
12514
|
_this$props2.minItemHeight;
|
|
12385
12515
|
var forwardRef = _this$props2.forwardRef,
|
|
12386
|
-
rest = _objectWithoutProperties(_this$props2, ["totalLength", "length", "buffer", "offset", "
|
|
12516
|
+
rest = _objectWithoutProperties(_this$props2, ["totalLength", "length", "buffer", "offset", "renderItems", "minItemHeight", "forwardRef"]);
|
|
12387
12517
|
|
|
12388
12518
|
var _this$state = this.state,
|
|
12389
12519
|
init = _this$state.init,
|
|
@@ -12427,6 +12557,7 @@
|
|
|
12427
12557
|
|
|
12428
12558
|
var index = /*#__PURE__*/React__namespace.forwardRef(function (props, ref) {
|
|
12429
12559
|
return /*#__PURE__*/React__namespace.createElement(VirtualScroll, _extends({
|
|
12560
|
+
key: props.totalLength,
|
|
12430
12561
|
forwardRef: ref
|
|
12431
12562
|
}, props));
|
|
12432
12563
|
});
|
|
@@ -13778,6 +13909,7 @@
|
|
|
13778
13909
|
}, headerAttr), headerChildren)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
13779
13910
|
className: "Table-grid"
|
|
13780
13911
|
}, /*#__PURE__*/React__namespace.createElement(Grid, __assign({}, this.state, {
|
|
13912
|
+
key: this.state.searchTerm,
|
|
13781
13913
|
updateData: this.updateData,
|
|
13782
13914
|
updateSchema: this.updateSchema,
|
|
13783
13915
|
updateSortingList: this.updateSortingList,
|
|
@@ -14332,54 +14464,62 @@
|
|
|
14332
14464
|
|
|
14333
14465
|
switch (e.key) {
|
|
14334
14466
|
case KEY_CODE.backspace:
|
|
14335
|
-
|
|
14467
|
+
{
|
|
14468
|
+
e.preventDefault();
|
|
14336
14469
|
|
|
14337
|
-
|
|
14470
|
+
var vals = __spreadArrays(values);
|
|
14338
14471
|
|
|
14339
|
-
|
|
14340
|
-
|
|
14341
|
-
|
|
14342
|
-
|
|
14343
|
-
|
|
14344
|
-
|
|
14345
|
-
|
|
14346
|
-
|
|
14347
|
-
|
|
14348
|
-
|
|
14472
|
+
if (values[index]) {
|
|
14473
|
+
vals[index] = '';
|
|
14474
|
+
setValues(vals);
|
|
14475
|
+
} else if (prev && prev.current) {
|
|
14476
|
+
vals[prevIndex] = '';
|
|
14477
|
+
prev.current.focus({
|
|
14478
|
+
preventScroll: true
|
|
14479
|
+
});
|
|
14480
|
+
setValues(vals);
|
|
14481
|
+
}
|
|
14349
14482
|
|
|
14350
|
-
|
|
14483
|
+
break;
|
|
14484
|
+
}
|
|
14351
14485
|
|
|
14352
14486
|
case KEY_CODE.left:
|
|
14353
|
-
|
|
14487
|
+
{
|
|
14488
|
+
e.preventDefault();
|
|
14354
14489
|
|
|
14355
|
-
|
|
14356
|
-
|
|
14357
|
-
|
|
14358
|
-
|
|
14359
|
-
|
|
14490
|
+
if (prev && prev.current) {
|
|
14491
|
+
prev.current.focus({
|
|
14492
|
+
preventScroll: true
|
|
14493
|
+
});
|
|
14494
|
+
}
|
|
14360
14495
|
|
|
14361
|
-
|
|
14496
|
+
break;
|
|
14497
|
+
}
|
|
14362
14498
|
|
|
14363
14499
|
case KEY_CODE.right:
|
|
14364
|
-
|
|
14500
|
+
{
|
|
14501
|
+
e.preventDefault();
|
|
14365
14502
|
|
|
14366
|
-
|
|
14367
|
-
|
|
14368
|
-
|
|
14369
|
-
|
|
14370
|
-
|
|
14503
|
+
if (nextRef && nextRef.current) {
|
|
14504
|
+
nextRef.current.focus({
|
|
14505
|
+
preventScroll: true
|
|
14506
|
+
});
|
|
14507
|
+
}
|
|
14371
14508
|
|
|
14372
|
-
|
|
14509
|
+
break;
|
|
14510
|
+
}
|
|
14373
14511
|
|
|
14374
14512
|
case KEY_CODE.up:
|
|
14375
14513
|
case KEY_CODE.down:
|
|
14376
14514
|
case KEY_CODE.e:
|
|
14377
14515
|
case KEY_CODE.E:
|
|
14378
|
-
|
|
14379
|
-
|
|
14380
|
-
|
|
14516
|
+
{
|
|
14517
|
+
if (type === 'number') {
|
|
14518
|
+
e.preventDefault();
|
|
14519
|
+
}
|
|
14381
14520
|
|
|
14382
|
-
|
|
14521
|
+
break;
|
|
14522
|
+
}
|
|
14383
14523
|
}
|
|
14384
14524
|
};
|
|
14385
14525
|
|
|
@@ -14438,10 +14578,10 @@
|
|
|
14438
14578
|
name: IconMapping[appearance],
|
|
14439
14579
|
appearance: appearance,
|
|
14440
14580
|
className: IconClass
|
|
14441
|
-
}), /*#__PURE__*/React__namespace.createElement(
|
|
14581
|
+
}), /*#__PURE__*/React__namespace.createElement(Text, {
|
|
14442
14582
|
"data-test": "DesignSystem-InlineMessage--Description",
|
|
14443
14583
|
className: DescriptionClass
|
|
14444
|
-
}, description))
|
|
14584
|
+
}, description));
|
|
14445
14585
|
};
|
|
14446
14586
|
InlineMessage.displayName = 'InlineMessage';
|
|
14447
14587
|
InlineMessage.defaultProps = {
|
|
@@ -14552,7 +14692,7 @@
|
|
|
14552
14692
|
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement("fieldset", {
|
|
14553
14693
|
className: ChoiceListClass,
|
|
14554
14694
|
"data-test": "DesignSystem-ChoiceList-Wrapper"
|
|
14555
|
-
}, title && title.trim() && /*#__PURE__*/React__namespace.createElement(Label, null, title.trim()),
|
|
14695
|
+
}, title && title.trim() && /*#__PURE__*/React__namespace.createElement(Label, null, title.trim()), allowMultiple ? /*#__PURE__*/React__namespace.createElement("div", {
|
|
14556
14696
|
className: "" + (alignment === 'horizontal' ? ChoiceHorizontalClass : ChoiceListVerticalClass)
|
|
14557
14697
|
}, renderCheckbox(choices, handleOnChange, disabled, size, alignment, selected)) : /*#__PURE__*/React__namespace.createElement("div", {
|
|
14558
14698
|
className: "" + (alignment === 'horizontal' ? ChoiceHorizontalClass : ChoiceListVerticalClass)
|
|
@@ -14566,7 +14706,27 @@
|
|
|
14566
14706
|
disabled: false
|
|
14567
14707
|
};
|
|
14568
14708
|
|
|
14569
|
-
var
|
|
14709
|
+
var Divider = function Divider(props) {
|
|
14710
|
+
var _a;
|
|
14711
|
+
|
|
14712
|
+
var vertical = props.vertical,
|
|
14713
|
+
appearance = props.appearance,
|
|
14714
|
+
className = props.className;
|
|
14715
|
+
var baseProps = extractBaseProps(props);
|
|
14716
|
+
var DividerClass = classNames__default["default"]((_a = {}, _a['Divider'] = true, _a['Divider--horizontal'] = !vertical, _a['Divider--vertical'] = vertical, _a['Divider--basic'] = appearance !== 'header', _a['Divider--header'] = !vertical && appearance === 'header', _a), className);
|
|
14717
|
+
return /*#__PURE__*/React__namespace.createElement("hr", __assign({
|
|
14718
|
+
"data-test": "DesignSystem-Divider"
|
|
14719
|
+
}, baseProps, {
|
|
14720
|
+
className: DividerClass
|
|
14721
|
+
}));
|
|
14722
|
+
};
|
|
14723
|
+
Divider.displayName = 'Divider';
|
|
14724
|
+
Divider.defaultProps = {
|
|
14725
|
+
appearance: 'basic',
|
|
14726
|
+
vertical: false
|
|
14727
|
+
};
|
|
14728
|
+
|
|
14729
|
+
var version = "2.7.0-0";
|
|
14570
14730
|
|
|
14571
14731
|
exports.Avatar = Avatar;
|
|
14572
14732
|
exports.AvatarGroup = AvatarGroup;
|
|
@@ -14592,6 +14752,7 @@
|
|
|
14592
14752
|
exports.DatePicker = DatePicker;
|
|
14593
14753
|
exports.DateRangePicker = DateRangePicker;
|
|
14594
14754
|
exports.Dialog = Dialog;
|
|
14755
|
+
exports.Divider = Divider;
|
|
14595
14756
|
exports.Dropdown = Dropdown;
|
|
14596
14757
|
exports.Dropzone = Dropzone;
|
|
14597
14758
|
exports.EditableChipInput = EditableChipInput;
|
|
@@ -14609,7 +14770,7 @@
|
|
|
14609
14770
|
exports.Icon = Icon;
|
|
14610
14771
|
exports.InlineMessage = InlineMessage;
|
|
14611
14772
|
exports.Input = Input;
|
|
14612
|
-
exports.InputMask =
|
|
14773
|
+
exports.InputMask = X;
|
|
14613
14774
|
exports.Label = Label;
|
|
14614
14775
|
exports.Legend = Legend;
|
|
14615
14776
|
exports.Link = Link;
|