@zohodesk/components 1.0.0-temp-168 → 1.0.0-temp-170
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/.cli/PropLessFiles.html +1 -1
- package/.cli/PropValidationExcludeFilesArray.js +7 -3
- package/.cli/propValidation_report.html +1 -1
- package/README.md +1335 -1277
- package/assets/Appearance/dark/mode/Component_DarkMode.module.css +1 -0
- package/assets/Appearance/light/mode/Component_LightMode.module.css +1 -0
- package/assets/Appearance/light/themes/blue/blue_CTA_LightModifyCategory.module.css +180 -180
- package/assets/Appearance/light/themes/blue/blue_CTA_LightTheme.module.css +12 -12
- package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +1 -0
- package/coverage/Button/Button.js.html +1 -1
- package/coverage/Button/css/Button.module.css.html +1 -1
- package/coverage/Button/css/cssJSLogic.js.html +1 -1
- package/coverage/Button/css/index.html +1 -1
- package/coverage/Button/index.html +1 -1
- package/coverage/Button/props/defaultProps.js.html +3 -6
- package/coverage/Button/props/index.html +1 -1
- package/coverage/Button/props/propTypes.js.html +9 -3
- package/coverage/Buttongroup/Buttongroup.js.html +1 -1
- package/coverage/Buttongroup/Buttongroup.module.css.html +1 -1
- package/coverage/Buttongroup/index.html +1 -1
- package/coverage/Buttongroup/props/defaultProps.js.html +1 -1
- package/coverage/Buttongroup/props/index.html +1 -1
- package/coverage/Buttongroup/props/propTypes.js.html +1 -1
- package/coverage/coverage-final.json +10 -10
- package/coverage/coverage-summary.json +10 -10
- package/coverage/index.html +1 -1
- package/coverage/utils/dummyFunction.js.html +1 -1
- package/coverage/utils/index.html +1 -1
- package/es/AppContainer/AppContainer.js +3 -0
- package/es/AppContainer/AppContainer.module.css +18 -18
- package/es/Avatar/Avatar.js +9 -9
- package/es/Avatar/Avatar.module.css +175 -175
- package/es/AvatarTeam/AvatarTeam.js +7 -7
- package/es/AvatarTeam/AvatarTeam.module.css +189 -189
- package/es/Button/Button.js +4 -4
- package/es/Button/__tests__/__snapshots__/Button.spec.js.snap +440 -468
- package/es/Button/css/Button.module.css +525 -525
- package/es/Button/props/defaultProps.js +1 -2
- package/es/Button/props/propTypes.js +3 -1
- package/es/Buttongroup/Buttongroup.js +1 -1
- package/es/Buttongroup/Buttongroup.module.css +105 -105
- package/es/Buttongroup/__tests__/__snapshots__/Buttongroup.spec.js.snap +191 -191
- package/es/Card/Card.js +4 -4
- package/es/Card/Card.module.css +20 -20
- package/es/CheckBox/CheckBox.js +0 -0
- package/es/CheckBox/CheckBox.module.css +157 -157
- package/es/DateTime/CalendarView.js +0 -0
- package/es/DateTime/DateTime.js +0 -0
- package/es/DateTime/DateTime.module.css +237 -235
- package/es/DateTime/DateWidget.js +2 -1
- package/es/DateTime/DateWidget.module.css +38 -38
- package/es/DateTime/YearView.js +0 -0
- package/es/DateTime/YearView.module.css +98 -98
- package/es/DateTime/common.js +0 -0
- package/es/DateTime/dateFormatUtils/dayChange.js +2 -1
- package/es/DateTime/dateFormatUtils/index.js +1 -1
- package/es/DateTime/dateFormatUtils/monthChange.js +2 -1
- package/es/DateTime/dateFormatUtils/timeChange.js +4 -4
- package/es/DateTime/dateFormatUtils/yearChange.js +2 -1
- package/es/DateTime/index.js +0 -0
- package/es/DateTime/objectUtils.js +0 -0
- package/es/DateTime/typeChecker.js +0 -0
- package/es/DateTime/validator.js +0 -0
- package/es/DropBox/DropBox.js +10 -10
- package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +434 -434
- package/es/DropBox/DropBoxPositionMapping.json +144 -144
- package/es/DropBox/css/DropBox.module.css +58 -58
- package/es/DropDown/DropDown.js +1 -7
- package/es/DropDown/DropDown.module.css +5 -5
- package/es/DropDown/DropDownHeading.js +0 -0
- package/es/DropDown/DropDownHeading.module.css +53 -53
- package/es/DropDown/DropDownItem.js +0 -0
- package/es/DropDown/DropDownItem.module.css +94 -94
- package/es/DropDown/DropDownSearch.js +0 -0
- package/es/DropDown/DropDownSearch.module.css +14 -14
- package/es/DropDown/DropDownSeparator.js +0 -0
- package/es/DropDown/DropDownSeparator.module.css +7 -7
- package/es/Heading/Heading.module.css +4 -4
- package/es/Label/Label.js +2 -2
- package/es/Label/Label.module.css +52 -52
- package/es/Label/LabelColors.module.css +20 -20
- package/es/Layout/Box.js +0 -0
- package/es/Layout/Container.js +0 -0
- package/es/Layout/Layout.module.css +335 -335
- package/es/Layout/utils.js +0 -0
- package/es/ListItem/ListItem.js +0 -0
- package/es/ListItem/ListItem.module.css +216 -216
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +12 -10
- package/es/MultiSelect/AdvancedMultiSelect.js +4 -4
- package/es/MultiSelect/MobileHeader/MobileHeader.js +50 -0
- package/es/MultiSelect/MobileHeader/MobileHeader.module.css +16 -0
- package/es/MultiSelect/MobileHeader/props/defaultProps.js +7 -0
- package/es/MultiSelect/MobileHeader/props/propTypes.js +7 -0
- package/es/MultiSelect/MultiSelect.js +117 -96
- package/es/MultiSelect/MultiSelect.module.css +204 -207
- package/es/MultiSelect/MultiSelectHeader.js +1 -2
- package/es/MultiSelect/MultiSelectWithAvatar.js +15 -112
- package/es/MultiSelect/SelectedOptions.module.css +15 -15
- package/es/MultiSelect/props/defaultProps.js +3 -1
- package/es/MultiSelect/props/propTypes.js +147 -193
- package/es/PopOver/PopOver.module.css +8 -8
- package/es/Popup/Popup.js +0 -0
- package/es/Popup/PositionMapping.json +73 -73
- package/es/Radio/Radio.js +0 -0
- package/es/Radio/Radio.module.css +112 -112
- package/es/Responsive/CustomResponsive.js +0 -0
- package/es/Responsive/RefWrapper.js +2 -1
- package/es/ResponsiveDropBox/ResponsiveDropBox.module.css +6 -6
- package/es/Ribbon/Ribbon.js +0 -0
- package/es/Ribbon/Ribbon.module.css +454 -454
- package/es/RippleEffect/RippleEffect.module.css +92 -92
- package/es/Select/GroupSelect.js +3 -5
- package/es/Select/Select.js +2 -5
- package/es/Select/Select.module.css +108 -108
- package/es/Select/SelectWithAvatar.js +2 -1
- package/es/Select/SelectWithIcon.js +5 -2
- package/es/Select/props/propTypes.js +3 -1
- package/es/Stencils/Stencils.js +0 -0
- package/es/Stencils/Stencils.module.css +96 -96
- package/es/Switch/Switch.js +0 -0
- package/es/Switch/Switch.module.css +127 -127
- package/es/Tab/Tab.module.css +100 -100
- package/es/Tab/TabContent.module.css +4 -4
- package/es/Tab/Tabs.js +17 -17
- package/es/Tab/Tabs.module.css +136 -136
- package/es/Tag/Tag.js +8 -8
- package/es/Tag/Tag.module.css +254 -254
- package/es/TextBox/TextBox.js +3 -3
- package/es/TextBox/TextBox.module.css +158 -158
- package/es/TextBoxIcon/TextBoxIcon.js +0 -0
- package/es/TextBoxIcon/TextBoxIcon.module.css +79 -79
- package/es/Textarea/Textarea.js +0 -0
- package/es/Textarea/Textarea.module.css +139 -139
- package/es/Tooltip/Tooltip.module.css +140 -140
- package/es/common/a11y.module.css +3 -3
- package/es/common/animation.module.css +624 -624
- package/es/common/avatarsizes.module.css +48 -48
- package/es/common/basic.module.css +33 -33
- package/es/common/basicReset.module.css +40 -40
- package/es/common/boxShadow.module.css +33 -33
- package/es/common/common.module.css +524 -524
- package/es/common/customscroll.module.css +91 -91
- package/es/common/reset.module.css +13 -13
- package/es/common/transition.module.css +146 -146
- package/es/deprecated/PortalLayer/props/propTypes.js +3 -1
- package/es/index.js +2 -1
- package/es/semantic/Button/semanticButton.module.css +9 -9
- package/es/utils/Common.js +3 -0
- package/es/utils/dropDownUtils.js +0 -0
- package/es/v1/Accordion/Accordion.js +66 -0
- package/es/v1/Accordion/AccordionItem.js +57 -0
- package/es/v1/Accordion/index.js +2 -0
- package/es/v1/Animation/Animation.js +127 -0
- package/es/v1/AppContainer/AppContainer.js +120 -0
- package/es/v1/Avatar/Avatar.js +139 -0
- package/es/v1/AvatarTeam/AvatarTeam.js +70 -0
- package/es/v1/Button/Button.js +68 -0
- package/es/v1/Buttongroup/Buttongroup.js +31 -0
- package/es/v1/Card/Card.js +237 -0
- package/es/v1/Card/index.js +4 -0
- package/es/v1/CheckBox/CheckBox.js +155 -0
- package/es/v1/DateTime/CalendarView.js +218 -0
- package/es/v1/DateTime/DateTime.js +783 -0
- package/es/v1/DateTime/DateTimePopupFooter.js +47 -0
- package/es/v1/DateTime/DateTimePopupHeader.js +105 -0
- package/es/v1/DateTime/DateWidget.js +1098 -0
- package/es/v1/DateTime/DaysRow.js +31 -0
- package/es/v1/DateTime/Time.js +166 -0
- package/es/v1/DateTime/YearView.js +264 -0
- package/es/v1/DateTime/index.js +1 -0
- package/es/v1/DropBox/DropBox.js +91 -0
- package/es/v1/DropBox/DropBoxElement/DropBoxElement.js +132 -0
- package/es/v1/DropDown/DropDown.js +52 -0
- package/es/v1/DropDown/DropDownHeading.js +36 -0
- package/es/v1/DropDown/DropDownItem.js +56 -0
- package/es/v1/DropDown/DropDownSearch.js +55 -0
- package/es/v1/DropDown/DropDownSeparator.js +12 -0
- package/es/v1/Heading/Heading.js +32 -0
- package/es/v1/Label/Label.js +40 -0
- package/es/v1/Layout/Box.js +115 -0
- package/es/v1/Layout/Container.js +132 -0
- package/es/v1/Layout/index.js +2 -0
- package/es/v1/ListItem/ListContainer.js +102 -0
- package/es/v1/ListItem/ListItem.js +124 -0
- package/es/v1/ListItem/ListItemWithAvatar.js +145 -0
- package/es/v1/ListItem/ListItemWithCheckBox.js +104 -0
- package/es/v1/ListItem/ListItemWithIcon.js +127 -0
- package/es/v1/ListItem/ListItemWithRadio.js +105 -0
- package/es/v1/ListItem/index.js +6 -0
- package/es/v1/Modal/Modal.js +154 -0
- package/es/v1/MultiSelect/AdvancedGroupMultiSelect.js +1079 -0
- package/es/v1/MultiSelect/AdvancedMultiSelect.js +568 -0
- package/es/v1/MultiSelect/EmptyState.js +64 -0
- package/es/v1/MultiSelect/MobileHeader/MobileHeader.js +50 -0
- package/es/v1/MultiSelect/MultiSelect.js +1121 -0
- package/es/v1/MultiSelect/MultiSelectHeader.js +32 -0
- package/es/v1/MultiSelect/MultiSelectWithAvatar.js +217 -0
- package/es/v1/MultiSelect/SelectedOptions.js +82 -0
- package/es/v1/MultiSelect/Suggestions.js +142 -0
- package/es/v1/MultiSelect/index.js +4 -0
- package/es/v1/PopOver/PopOver.js +176 -0
- package/es/v1/Popup/Popup.js +645 -0
- package/es/v1/Provider/AvatarSize.js +13 -0
- package/es/v1/Provider/Config.js +18 -0
- package/es/v1/Provider/CssProvider.js +16 -0
- package/es/v1/Provider/IdProvider.js +66 -0
- package/es/v1/Provider/LibraryContext.js +37 -0
- package/es/v1/Provider/LibraryContextInit.js +3 -0
- package/es/v1/Provider/NumberGenerator/NumberGenerator.js +136 -0
- package/es/v1/Provider/ZindexProvider.js +57 -0
- package/es/v1/Provider/index.js +4 -0
- package/es/v1/Radio/Radio.js +115 -0
- package/es/v1/Responsive/CustomResponsive.js +195 -0
- package/es/v1/Responsive/RefWrapper.js +39 -0
- package/es/v1/Responsive/ResizeComponent.js +197 -0
- package/es/v1/Responsive/ResizeObserver.js +140 -0
- package/es/v1/Responsive/Responsive.js +194 -0
- package/es/v1/Responsive/index.js +9 -0
- package/es/v1/ResponsiveDropBox/ResponsiveDropBox.js +58 -0
- package/es/v1/Ribbon/Ribbon.js +33 -0
- package/es/v1/RippleEffect/RippleEffect.js +24 -0
- package/es/v1/Select/GroupSelect.js +800 -0
- package/es/v1/Select/Select.js +966 -0
- package/es/v1/Select/SelectWithAvatar.js +344 -0
- package/es/v1/Select/SelectWithIcon.js +535 -0
- package/es/v1/Select/index.js +4 -0
- package/es/v1/Stencils/Stencils.js +26 -0
- package/es/v1/Switch/Switch.js +94 -0
- package/es/v1/Tab/Tab.js +108 -0
- package/es/v1/Tab/TabContent.js +30 -0
- package/es/v1/Tab/TabContentWrapper.js +29 -0
- package/es/v1/Tab/TabWrapper.js +57 -0
- package/es/v1/Tab/Tabs.js +612 -0
- package/es/v1/Tab/index.js +5 -0
- package/es/v1/Tag/Tag.js +134 -0
- package/es/v1/TextBox/TextBox.js +154 -0
- package/es/v1/TextBoxIcon/TextBoxIcon.js +158 -0
- package/es/v1/Textarea/Textarea.js +102 -0
- package/es/v1/Tooltip/Tooltip.js +518 -0
- package/es/v1/Typography/Typography.js +38 -0
- package/es/v1/Typography/css/Typography.module.css +376 -0
- package/es/v1/Typography/css/cssJSLogic.js +46 -0
- package/es/v1/Typography/css/letterSpacingMap.js +12 -0
- package/es/v1/Typography/props/defaultProps.js +8 -0
- package/es/v1/Typography/props/propTypes.js +24 -0
- package/es/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +69 -0
- package/es/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +100 -0
- package/es/v1/semantic/Button/Button.js +53 -0
- package/es/v1/semantic/index.js +1 -0
- package/install.md +10 -10
- package/lib/AppContainer/AppContainer.js +5 -0
- package/lib/AppContainer/AppContainer.module.css +18 -18
- package/lib/Avatar/Avatar.js +9 -9
- package/lib/Avatar/Avatar.module.css +175 -175
- package/lib/AvatarTeam/AvatarTeam.js +7 -7
- package/lib/AvatarTeam/AvatarTeam.module.css +189 -189
- package/lib/Button/Button.js +4 -4
- package/lib/Button/__tests__/__snapshots__/Button.spec.js.snap +440 -468
- package/lib/Button/css/Button.module.css +525 -525
- package/lib/Button/props/defaultProps.js +1 -2
- package/lib/Button/props/propTypes.js +3 -1
- package/lib/Buttongroup/Buttongroup.js +1 -1
- package/lib/Buttongroup/Buttongroup.module.css +105 -105
- package/lib/Buttongroup/__tests__/__snapshots__/Buttongroup.spec.js.snap +191 -191
- package/lib/Card/Card.js +4 -4
- package/lib/Card/Card.module.css +20 -20
- package/lib/CheckBox/CheckBox.js +0 -0
- package/lib/CheckBox/CheckBox.module.css +157 -157
- package/lib/DateTime/CalendarView.js +0 -0
- package/lib/DateTime/DateTime.js +0 -0
- package/lib/DateTime/DateTime.module.css +237 -235
- package/lib/DateTime/DateWidget.js +2 -1
- package/lib/DateTime/DateWidget.module.css +38 -38
- package/lib/DateTime/YearView.js +0 -0
- package/lib/DateTime/YearView.module.css +98 -98
- package/lib/DateTime/common.js +0 -0
- package/lib/DateTime/dateFormatUtils/dayChange.js +3 -1
- package/lib/DateTime/dateFormatUtils/index.js +1 -1
- package/lib/DateTime/dateFormatUtils/monthChange.js +3 -1
- package/lib/DateTime/dateFormatUtils/timeChange.js +3 -3
- package/lib/DateTime/dateFormatUtils/yearChange.js +3 -1
- package/lib/DateTime/index.js +0 -0
- package/lib/DateTime/objectUtils.js +0 -0
- package/lib/DateTime/typeChecker.js +0 -0
- package/lib/DateTime/validator.js +0 -0
- package/lib/DropBox/DropBox.js +15 -15
- package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +434 -434
- package/lib/DropBox/DropBoxPositionMapping.json +144 -144
- package/lib/DropBox/css/DropBox.module.css +58 -58
- package/lib/DropDown/DropDown.js +1 -6
- package/lib/DropDown/DropDown.module.css +5 -5
- package/lib/DropDown/DropDownHeading.js +0 -0
- package/lib/DropDown/DropDownHeading.module.css +53 -53
- package/lib/DropDown/DropDownItem.js +0 -0
- package/lib/DropDown/DropDownItem.module.css +94 -94
- package/lib/DropDown/DropDownSearch.js +0 -0
- package/lib/DropDown/DropDownSearch.module.css +14 -14
- package/lib/DropDown/DropDownSeparator.js +0 -0
- package/lib/DropDown/DropDownSeparator.module.css +7 -7
- package/lib/Heading/Heading.module.css +4 -4
- package/lib/Label/Label.js +0 -0
- package/lib/Label/Label.module.css +52 -52
- package/lib/Label/LabelColors.module.css +20 -20
- package/lib/Layout/Box.js +0 -0
- package/lib/Layout/Container.js +0 -0
- package/lib/Layout/Layout.module.css +335 -335
- package/lib/Layout/utils.js +0 -0
- package/lib/ListItem/ListItem.js +0 -0
- package/lib/ListItem/ListItem.module.css +216 -216
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +12 -11
- package/lib/MultiSelect/AdvancedMultiSelect.js +4 -4
- package/lib/MultiSelect/MobileHeader/MobileHeader.js +62 -0
- package/lib/MultiSelect/MobileHeader/MobileHeader.module.css +16 -0
- package/lib/MultiSelect/MobileHeader/props/defaultProps.js +14 -0
- package/lib/MultiSelect/MobileHeader/props/propTypes.js +18 -0
- package/lib/MultiSelect/MultiSelect.js +121 -101
- package/lib/MultiSelect/MultiSelect.module.css +204 -207
- package/lib/MultiSelect/MultiSelectHeader.js +1 -2
- package/lib/MultiSelect/MultiSelectWithAvatar.js +18 -113
- package/lib/MultiSelect/SelectedOptions.module.css +15 -15
- package/lib/MultiSelect/props/defaultProps.js +3 -1
- package/lib/MultiSelect/props/propTypes.js +161 -197
- package/lib/PopOver/PopOver.module.css +8 -8
- package/lib/Popup/Popup.js +0 -0
- package/lib/Popup/PositionMapping.json +73 -73
- package/lib/Radio/Radio.js +0 -0
- package/lib/Radio/Radio.module.css +112 -112
- package/lib/Responsive/CustomResponsive.js +0 -0
- package/lib/Responsive/RefWrapper.js +2 -1
- package/lib/ResponsiveDropBox/ResponsiveDropBox.module.css +6 -6
- package/lib/Ribbon/Ribbon.js +0 -0
- package/lib/Ribbon/Ribbon.module.css +454 -454
- package/lib/RippleEffect/RippleEffect.module.css +92 -92
- package/lib/Select/GroupSelect.js +2 -2
- package/lib/Select/Select.js +1 -2
- package/lib/Select/Select.module.css +108 -108
- package/lib/Select/SelectWithAvatar.js +2 -1
- package/lib/Select/SelectWithIcon.js +5 -3
- package/lib/Select/props/propTypes.js +12 -2
- package/lib/Stencils/Stencils.js +0 -0
- package/lib/Stencils/Stencils.module.css +96 -96
- package/lib/Switch/Switch.js +0 -0
- package/lib/Switch/Switch.module.css +127 -127
- package/lib/Tab/Tab.module.css +100 -100
- package/lib/Tab/TabContent.module.css +4 -4
- package/lib/Tab/Tabs.js +11 -11
- package/lib/Tab/Tabs.module.css +136 -136
- package/lib/Tag/Tag.js +8 -8
- package/lib/Tag/Tag.module.css +254 -254
- package/lib/TextBox/TextBox.js +10 -10
- package/lib/TextBox/TextBox.module.css +158 -158
- package/lib/TextBoxIcon/TextBoxIcon.js +0 -0
- package/lib/TextBoxIcon/TextBoxIcon.module.css +79 -79
- package/lib/Textarea/Textarea.js +0 -0
- package/lib/Textarea/Textarea.module.css +139 -139
- package/lib/Tooltip/Tooltip.module.css +140 -140
- package/lib/common/a11y.module.css +3 -3
- package/lib/common/animation.module.css +624 -624
- package/lib/common/avatarsizes.module.css +48 -48
- package/lib/common/basic.module.css +33 -33
- package/lib/common/basicReset.module.css +40 -40
- package/lib/common/boxShadow.module.css +33 -33
- package/lib/common/common.module.css +524 -524
- package/lib/common/customscroll.module.css +91 -91
- package/lib/common/reset.module.css +13 -13
- package/lib/common/transition.module.css +146 -146
- package/lib/deprecated/PortalLayer/props/propTypes.js +3 -1
- package/lib/index.js +10 -1
- package/lib/semantic/Button/semanticButton.module.css +9 -9
- package/lib/utils/Common.js +5 -0
- package/lib/utils/dropDownUtils.js +0 -0
- package/lib/v1/Accordion/Accordion.js +98 -0
- package/lib/v1/Accordion/AccordionItem.js +68 -0
- package/lib/v1/Accordion/index.js +23 -0
- package/lib/v1/Animation/Animation.js +143 -0
- package/lib/v1/AppContainer/AppContainer.js +158 -0
- package/lib/v1/Avatar/Avatar.js +190 -0
- package/lib/v1/AvatarTeam/AvatarTeam.js +81 -0
- package/lib/v1/Button/Button.js +82 -0
- package/lib/v1/Buttongroup/Buttongroup.js +44 -0
- package/lib/v1/Card/Card.js +269 -0
- package/lib/v1/Card/index.js +37 -0
- package/lib/v1/CheckBox/CheckBox.js +166 -0
- package/lib/v1/DateTime/CalendarView.js +285 -0
- package/lib/v1/DateTime/DateTime.js +872 -0
- package/lib/v1/DateTime/DateTimePopupFooter.js +96 -0
- package/lib/v1/DateTime/DateTimePopupHeader.js +166 -0
- package/lib/v1/DateTime/DateWidget.js +1125 -0
- package/lib/v1/DateTime/DaysRow.js +80 -0
- package/lib/v1/DateTime/Time.js +254 -0
- package/lib/v1/DateTime/YearView.js +325 -0
- package/lib/v1/DateTime/index.js +15 -0
- package/lib/v1/DropBox/DropBox.js +119 -0
- package/lib/v1/DropBox/DropBoxElement/DropBoxElement.js +145 -0
- package/lib/v1/DropDown/DropDown.js +74 -0
- package/lib/v1/DropDown/DropDownHeading.js +47 -0
- package/lib/v1/DropDown/DropDownItem.js +75 -0
- package/lib/v1/DropDown/DropDownSearch.js +74 -0
- package/lib/v1/DropDown/DropDownSeparator.js +24 -0
- package/lib/v1/Heading/Heading.js +49 -0
- package/lib/v1/Label/Label.js +51 -0
- package/lib/v1/Layout/Box.js +128 -0
- package/lib/v1/Layout/Container.js +145 -0
- package/lib/v1/Layout/index.js +23 -0
- package/lib/v1/ListItem/ListContainer.js +120 -0
- package/lib/v1/ListItem/ListItem.js +138 -0
- package/lib/v1/ListItem/ListItemWithAvatar.js +162 -0
- package/lib/v1/ListItem/ListItemWithCheckBox.js +125 -0
- package/lib/v1/ListItem/ListItemWithIcon.js +143 -0
- package/lib/v1/ListItem/ListItemWithRadio.js +126 -0
- package/lib/v1/ListItem/index.js +55 -0
- package/lib/v1/Modal/Modal.js +212 -0
- package/lib/v1/MultiSelect/AdvancedGroupMultiSelect.js +1167 -0
- package/lib/v1/MultiSelect/AdvancedMultiSelect.js +634 -0
- package/lib/v1/MultiSelect/EmptyState.js +112 -0
- package/lib/v1/MultiSelect/MobileHeader/MobileHeader.js +62 -0
- package/lib/v1/MultiSelect/MultiSelect.js +1203 -0
- package/lib/v1/MultiSelect/MultiSelectHeader.js +78 -0
- package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +272 -0
- package/lib/v1/MultiSelect/SelectedOptions.js +126 -0
- package/lib/v1/MultiSelect/Suggestions.js +195 -0
- package/lib/v1/MultiSelect/index.js +39 -0
- package/lib/v1/PopOver/PopOver.js +197 -0
- package/lib/v1/Popup/Popup.js +715 -0
- package/lib/v1/Provider/AvatarSize.js +24 -0
- package/lib/v1/Provider/Config.js +27 -0
- package/lib/v1/Provider/CssProvider.js +27 -0
- package/lib/v1/Provider/IdProvider.js +79 -0
- package/lib/v1/Provider/LibraryContext.js +76 -0
- package/lib/v1/Provider/LibraryContextInit.js +15 -0
- package/lib/v1/Provider/NumberGenerator/NumberGenerator.js +174 -0
- package/lib/v1/Provider/ZindexProvider.js +69 -0
- package/lib/v1/Provider/index.js +81 -0
- package/lib/v1/Radio/Radio.js +126 -0
- package/lib/v1/Responsive/CustomResponsive.js +242 -0
- package/lib/v1/Responsive/RefWrapper.js +57 -0
- package/lib/v1/Responsive/ResizeComponent.js +268 -0
- package/lib/v1/Responsive/ResizeObserver.js +168 -0
- package/lib/v1/Responsive/Responsive.js +274 -0
- package/lib/v1/Responsive/index.js +55 -0
- package/lib/v1/ResponsiveDropBox/ResponsiveDropBox.js +79 -0
- package/lib/v1/Ribbon/Ribbon.js +44 -0
- package/lib/v1/RippleEffect/RippleEffect.js +39 -0
- package/lib/v1/Select/GroupSelect.js +876 -0
- package/lib/v1/Select/Select.js +1012 -0
- package/lib/v1/Select/SelectWithAvatar.js +394 -0
- package/lib/v1/Select/SelectWithIcon.js +597 -0
- package/lib/v1/Select/index.js +39 -0
- package/lib/v1/Stencils/Stencils.js +43 -0
- package/lib/v1/Switch/Switch.js +108 -0
- package/lib/v1/Tab/Tab.js +132 -0
- package/lib/v1/Tab/TabContent.js +42 -0
- package/lib/v1/Tab/TabContentWrapper.js +42 -0
- package/lib/v1/Tab/TabWrapper.js +89 -0
- package/lib/v1/Tab/Tabs.js +680 -0
- package/lib/v1/Tab/index.js +47 -0
- package/lib/v1/Tag/Tag.js +154 -0
- package/lib/v1/TextBox/TextBox.js +168 -0
- package/lib/v1/TextBoxIcon/TextBoxIcon.js +196 -0
- package/lib/v1/Textarea/Textarea.js +118 -0
- package/lib/v1/Tooltip/Tooltip.js +586 -0
- package/lib/v1/Typography/Typography.js +56 -0
- package/lib/v1/Typography/css/Typography.module.css +376 -0
- package/lib/v1/Typography/css/cssJSLogic.js +41 -0
- package/lib/v1/Typography/css/letterSpacingMap.js +20 -0
- package/lib/v1/Typography/props/defaultProps.js +15 -0
- package/lib/v1/Typography/props/propTypes.js +35 -0
- package/lib/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +90 -0
- package/lib/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +126 -0
- package/lib/v1/semantic/Button/Button.js +63 -0
- package/lib/v1/semantic/index.js +15 -0
- package/package.json +93 -93
- package/postPublish.js +8 -8
- package/prePublish.js +70 -70
- package/react-cli.config.js +23 -23
- package/result.json +1 -1
- package/unittest/index.html +1 -1
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _ResizeObserver = _interopRequireDefault(require("./ResizeObserver"));
|
|
15
|
+
|
|
16
|
+
var _Common = require("../../utils/Common");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
|
|
20
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
21
|
+
|
|
22
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
23
|
+
|
|
24
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
25
|
+
|
|
26
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
27
|
+
|
|
28
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
29
|
+
|
|
30
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
31
|
+
|
|
32
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
33
|
+
|
|
34
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
35
|
+
|
|
36
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
37
|
+
|
|
38
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
39
|
+
|
|
40
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
41
|
+
|
|
42
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
43
|
+
|
|
44
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
45
|
+
|
|
46
|
+
var ResizeComponent = /*#__PURE__*/function (_React$Component) {
|
|
47
|
+
_inherits(ResizeComponent, _React$Component);
|
|
48
|
+
|
|
49
|
+
var _super = _createSuper(ResizeComponent);
|
|
50
|
+
|
|
51
|
+
function ResizeComponent(props) {
|
|
52
|
+
var _this;
|
|
53
|
+
|
|
54
|
+
_classCallCheck(this, ResizeComponent);
|
|
55
|
+
|
|
56
|
+
_this = _super.call(this, props);
|
|
57
|
+
_this.noSpaceForChildren = false;
|
|
58
|
+
_this.childrenCurrentList = [];
|
|
59
|
+
_this.widthCheck = (0, _Common.debounce)(_this.widthCheck.bind(_assertThisInitialized(_this)), 10); // this.widthCheck = this.widthCheck.bind(this);
|
|
60
|
+
|
|
61
|
+
_this.onResize = _this.onResize.bind(_assertThisInitialized(_this));
|
|
62
|
+
_this.onResizeMutation = _this.onResizeMutation.bind(_assertThisInitialized(_this));
|
|
63
|
+
_this.tabsObserver = new _ResizeObserver["default"](_this.onResize);
|
|
64
|
+
_this.tabObserver = new MutationObserver(_this.onResizeMutation);
|
|
65
|
+
_this.reset = _this.reset.bind(_assertThisInitialized(_this));
|
|
66
|
+
_this.constructChildren = _this.constructChildren.bind(_assertThisInitialized(_this));
|
|
67
|
+
_this.querySelector = _this.querySelector.bind(_assertThisInitialized(_this));
|
|
68
|
+
return _this;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
_createClass(ResizeComponent, [{
|
|
72
|
+
key: "querySelector",
|
|
73
|
+
value: function querySelector() {
|
|
74
|
+
if (this.props.wrapperDivRef && this.props.wrapperDivRef.current) {
|
|
75
|
+
return this.props.wrapperDivRef.current.querySelectorAll('[data-responsive="true"]');
|
|
76
|
+
} else {
|
|
77
|
+
return [];
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}, {
|
|
81
|
+
key: "onResizeMutation",
|
|
82
|
+
value: function onResizeMutation(mutations) {
|
|
83
|
+
var _this2 = this;
|
|
84
|
+
|
|
85
|
+
// console.log(mutations);
|
|
86
|
+
var childrenList = this.props.childrenList;
|
|
87
|
+
|
|
88
|
+
var _iterator = _createForOfIteratorHelper(mutations),
|
|
89
|
+
_step;
|
|
90
|
+
|
|
91
|
+
try {
|
|
92
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
93
|
+
var mutation = _step.value;
|
|
94
|
+
|
|
95
|
+
if (mutation.type === 'childList') {
|
|
96
|
+
if (mutation.addedNodes.length) {
|
|
97
|
+
var newAdded = false;
|
|
98
|
+
mutation.addedNodes.forEach(function (mut) {
|
|
99
|
+
// Here we can listen for icon nodes. Confirm with bk
|
|
100
|
+
if (mut.attributes && mut.attributes['data-responsive'] && (childrenList.length !== _this2.querySelector().length || _this2.childrenCurrentList.length !== _this2.querySelector().length)) {
|
|
101
|
+
newAdded = true;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
if (newAdded) {
|
|
106
|
+
//console.log('A child node has been added ', mutation);
|
|
107
|
+
this.onResize();
|
|
108
|
+
}
|
|
109
|
+
} else if (mutation.removedNodes.length) {// ?? removed nodes ku check pannanum ah ??
|
|
110
|
+
// console.log('A child node has been removed ', mutation);
|
|
111
|
+
}
|
|
112
|
+
} else if (mutation.type === 'attributes') {//console.log('The ' + mutation.attributeName + ' attribute was modified.', mutation);
|
|
113
|
+
} else if (mutation.type === 'characterData') {// To Call While Changing InnerText, Remove Below line If Required. But It might affect Performance.
|
|
114
|
+
// this.onResize();
|
|
115
|
+
}
|
|
116
|
+
} // mutations.forEach(mutation => {
|
|
117
|
+
// if (mutation.target === foo &&
|
|
118
|
+
// mutation.attributeName === 'style' &&
|
|
119
|
+
// oldWidth !== foo.style.width) {
|
|
120
|
+
// foo.textContent = 'Width changed from ' +
|
|
121
|
+
// oldWidth + ' to ' + foo.style.width;
|
|
122
|
+
// oldWidth = foo.style.width;
|
|
123
|
+
// }
|
|
124
|
+
// });
|
|
125
|
+
|
|
126
|
+
} catch (err) {
|
|
127
|
+
_iterator.e(err);
|
|
128
|
+
} finally {
|
|
129
|
+
_iterator.f();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}, {
|
|
133
|
+
key: "componentDidMount",
|
|
134
|
+
value: function componentDidMount() {
|
|
135
|
+
if (this.props.wrapperDivRef && this.props.wrapperDivRef.current) {
|
|
136
|
+
this.tabsObserver.observe(this.props.wrapperDivRef.current);
|
|
137
|
+
this.tabObserver.observe(this.props.wrapperDivRef.current, {
|
|
138
|
+
characterData: true,
|
|
139
|
+
attributes: true,
|
|
140
|
+
childList: true,
|
|
141
|
+
subtree: true,
|
|
142
|
+
attributeFilter: ['data-responsive']
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}, {
|
|
147
|
+
key: "componentWillUnmount",
|
|
148
|
+
value: function componentWillUnmount() {
|
|
149
|
+
this.reset();
|
|
150
|
+
}
|
|
151
|
+
}, {
|
|
152
|
+
key: "reset",
|
|
153
|
+
value: function reset() {
|
|
154
|
+
this.childrenCurrentList = [];
|
|
155
|
+
this.tabsObserver.disconnect();
|
|
156
|
+
this.tabObserver && this.tabObserver.disconnect();
|
|
157
|
+
}
|
|
158
|
+
}, {
|
|
159
|
+
key: "componentDidUpdate",
|
|
160
|
+
value: function componentDidUpdate(prevProps) {
|
|
161
|
+
if (this.childrenCurrentList.length === 0) {
|
|
162
|
+
this.childrenCurrentList = this.querySelector();
|
|
163
|
+
this.widthCheck();
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (this.props.resizeId !== prevProps.resizeId) {
|
|
167
|
+
// Completely reset the observers and set new observer if id is changed
|
|
168
|
+
this.reset();
|
|
169
|
+
|
|
170
|
+
if (this.props.wrapperDivRef && this.props.wrapperDivRef.current) {
|
|
171
|
+
this.tabsObserver.observe(this.props.wrapperDivRef.current);
|
|
172
|
+
this.tabObserver.observe(this.props.wrapperDivRef.current, {
|
|
173
|
+
characterData: true,
|
|
174
|
+
attributes: true,
|
|
175
|
+
childList: true,
|
|
176
|
+
subtree: true,
|
|
177
|
+
attributeFilter: ['data-responsive']
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}, {
|
|
183
|
+
key: "onResize",
|
|
184
|
+
value: function onResize() {
|
|
185
|
+
// if (this.childrenCurrentList.length !== 0) {
|
|
186
|
+
this.childrenCurrentList = [];
|
|
187
|
+
this.constructChildren(0, false); //}
|
|
188
|
+
} // shouldComponentUpdate() {
|
|
189
|
+
// return this.childrenCurrentList.length === 0
|
|
190
|
+
// }
|
|
191
|
+
|
|
192
|
+
}, {
|
|
193
|
+
key: "widthCheck",
|
|
194
|
+
value: function widthCheck() {
|
|
195
|
+
var wrapperDivRef = this.props.wrapperDivRef.current;
|
|
196
|
+
var moreDivRef = this.props.moreDivRef.current;
|
|
197
|
+
|
|
198
|
+
if (wrapperDivRef && this.childrenCurrentList.length > 0) {
|
|
199
|
+
var childrenWidthList = this.childrenCurrentList; // this.childrenCurrentList = childrenWidthList;
|
|
200
|
+
|
|
201
|
+
var moreWidth = (0, _Common.getElementSpace)(moreDivRef).neededSpace; //console.log(moreWidth,'moreWidth');
|
|
202
|
+
|
|
203
|
+
var totalWidth = (0, _Common.getElementSpace)(wrapperDivRef).availableInsideSpace - moreWidth;
|
|
204
|
+
var _childrenTotalWidth = 0;
|
|
205
|
+
var dataCount = 0;
|
|
206
|
+
this.noSpaceForChildren = false;
|
|
207
|
+
|
|
208
|
+
if (totalWidth <= moreWidth) {
|
|
209
|
+
this.noSpaceForChildren = true;
|
|
210
|
+
} else {
|
|
211
|
+
for (var i = 0; i < childrenWidthList.length; i++) {
|
|
212
|
+
var currentWidth = (0, _Common.getElementSpace)(childrenWidthList[i]).neededSpace;
|
|
213
|
+
_childrenTotalWidth += currentWidth; // console.log(_childrenTotalWidth, currentWidth, totalWidth)
|
|
214
|
+
|
|
215
|
+
if (i === childrenWidthList.length - 1 && moreWidth >= currentWidth) {
|
|
216
|
+
totalWidth += moreWidth;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
if (totalWidth <= _childrenTotalWidth) {
|
|
220
|
+
dataCount = i;
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
this.constructChildren(dataCount, true);
|
|
227
|
+
} else {
|
|
228
|
+
this.constructChildren(0, false);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}, {
|
|
232
|
+
key: "constructChildren",
|
|
233
|
+
value: function constructChildren() {
|
|
234
|
+
var dataCount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
235
|
+
var responsive = arguments.length > 1 ? arguments[1] : undefined;
|
|
236
|
+
var _this$props = this.props,
|
|
237
|
+
childrenList = _this$props.childrenList,
|
|
238
|
+
getData = _this$props.getData; // If the data count is zero we assume that we can render all the items - data count will be zero only when we want to calculate the whole list width
|
|
239
|
+
|
|
240
|
+
dataCount = dataCount || childrenList && childrenList.length;
|
|
241
|
+
getData({
|
|
242
|
+
responsiveHook: responsive,
|
|
243
|
+
validListCount: this.noSpaceForChildren ? 0 : dataCount
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
}, {
|
|
247
|
+
key: "render",
|
|
248
|
+
value: function render() {
|
|
249
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, this.props.children);
|
|
250
|
+
}
|
|
251
|
+
}]);
|
|
252
|
+
|
|
253
|
+
return ResizeComponent;
|
|
254
|
+
}(_react["default"].Component);
|
|
255
|
+
|
|
256
|
+
exports["default"] = ResizeComponent;
|
|
257
|
+
ResizeComponent.propTypes = {
|
|
258
|
+
children: _propTypes["default"].node,
|
|
259
|
+
getData: _propTypes["default"].func,
|
|
260
|
+
resizeId: _propTypes["default"].number,
|
|
261
|
+
childrenList: _propTypes["default"].array,
|
|
262
|
+
wrapperDivRef: _propTypes["default"].any,
|
|
263
|
+
moreDivRef: _propTypes["default"].any
|
|
264
|
+
};
|
|
265
|
+
ResizeComponent.defaultProps = {
|
|
266
|
+
getData: function getData() {},
|
|
267
|
+
resizeId: null
|
|
268
|
+
};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
|
+
|
|
10
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
11
|
+
|
|
12
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
|
+
|
|
14
|
+
var hasResizeObserver = !!window.ResizeObserver;
|
|
15
|
+
var mutationObserverOptions = {
|
|
16
|
+
//NOTE: we donot consider child Count
|
|
17
|
+
// childList: true,
|
|
18
|
+
attributes: true
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
function getSize(element) {
|
|
22
|
+
var offsetHeight = element.offsetHeight,
|
|
23
|
+
offsetWidth = element.offsetWidth; // const { height, width } = element.getBoundingClientRect();
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
height: offsetHeight,
|
|
27
|
+
width: offsetWidth
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function dispatch() {
|
|
32
|
+
var resizeResponsive = new Event('resizeResponsive');
|
|
33
|
+
window.dispatchEvent(resizeResponsive);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (!hasResizeObserver) {
|
|
37
|
+
var interval = null;
|
|
38
|
+
window.addEventListener('resize', function () {
|
|
39
|
+
clearTimeout(interval);
|
|
40
|
+
interval = setTimeout(dispatch, 100);
|
|
41
|
+
});
|
|
42
|
+
} // NOTE: this is not full polyfill , we just wrote what types of changes wlli
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
var ResizeObserverPolyfill = /*#__PURE__*/function () {
|
|
46
|
+
function ResizeObserverPolyfill(onResize) {
|
|
47
|
+
_classCallCheck(this, ResizeObserverPolyfill);
|
|
48
|
+
|
|
49
|
+
// method finding
|
|
50
|
+
this.transitionEndHandler = this.transitionEndHandler.bind(this);
|
|
51
|
+
this.resizeHandlerDispatch = this.resizeHandlerDispatch.bind(this);
|
|
52
|
+
this.resizeHandler = this.resizeHandler.bind(this);
|
|
53
|
+
this.replaceResizeHandler = this.replaceResizeHandler.bind(this);
|
|
54
|
+
this.debounce = this.debounce.bind(this);
|
|
55
|
+
this.onResize = onResize;
|
|
56
|
+
this.targetNode = null;
|
|
57
|
+
this.size = {
|
|
58
|
+
height: 0,
|
|
59
|
+
width: 0
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
if (hasResizeObserver) {
|
|
63
|
+
this.resizeObserverInstance = new window.ResizeObserver(this.resizeHandlerDispatch);
|
|
64
|
+
} else {
|
|
65
|
+
this.mutationObserverInstance = new window.MutationObserver(this.resizeHandlerDispatch);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
_createClass(ResizeObserverPolyfill, [{
|
|
70
|
+
key: "replaceResizeHandler",
|
|
71
|
+
value: function replaceResizeHandler(onResize) {
|
|
72
|
+
this.onResize = onResize;
|
|
73
|
+
}
|
|
74
|
+
}, {
|
|
75
|
+
key: "resizeHandler",
|
|
76
|
+
value: function resizeHandler() {
|
|
77
|
+
if (!this.targetNode) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
var currentSize = getSize(this.targetNode); // if (this.size && shallowCompare(currentSize, this.size)) {
|
|
82
|
+
|
|
83
|
+
if (this.size && currentSize.height === this.size.height && currentSize.width === this.size.width) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
this.size = currentSize;
|
|
88
|
+
this.onResize(this.size, this.targetNode);
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
}, {
|
|
92
|
+
key: "resizeHandlerDispatch",
|
|
93
|
+
value: function resizeHandlerDispatch() {
|
|
94
|
+
if (!this.resizeHandler() || hasResizeObserver) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
dispatch();
|
|
99
|
+
}
|
|
100
|
+
}, {
|
|
101
|
+
key: "debounce",
|
|
102
|
+
value: function debounce() {
|
|
103
|
+
clearTimeout(this.interval);
|
|
104
|
+
this.interval = setTimeout(this.resizeHandler, 100);
|
|
105
|
+
}
|
|
106
|
+
}, {
|
|
107
|
+
key: "transitionEndHandler",
|
|
108
|
+
value: function transitionEndHandler(event) {
|
|
109
|
+
if (event.propertyName.indexOf('color') === -1) {
|
|
110
|
+
this.resizeHandlerDispatch();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}, {
|
|
114
|
+
key: "addEventListeners",
|
|
115
|
+
value: function addEventListeners(targetNode) {
|
|
116
|
+
targetNode.addEventListener('transitionend', this.transitionEndHandler);
|
|
117
|
+
window.addEventListener('resizeResponsive', this.debounce);
|
|
118
|
+
targetNode.addEventListener('animationend', this.resizeHandlerDispatch);
|
|
119
|
+
targetNode.addEventListener('webkitAnimationEnd', this.resizeHandlerDispatch);
|
|
120
|
+
}
|
|
121
|
+
}, {
|
|
122
|
+
key: "removeEventListeners",
|
|
123
|
+
value: function removeEventListeners(targetNode) {
|
|
124
|
+
targetNode.removeEventListener('transitionend', this.transitionEndHandler);
|
|
125
|
+
window.removeEventListener('resizeResponsive', this.debounce);
|
|
126
|
+
targetNode.removeEventListener('animationend', this.resizeHandlerDispatch);
|
|
127
|
+
targetNode.removeEventListener('webkitAnimationEnd', this.resizeHandlerDispatch);
|
|
128
|
+
}
|
|
129
|
+
}, {
|
|
130
|
+
key: "observe",
|
|
131
|
+
value: function observe(targetNode) {
|
|
132
|
+
this.targetNode = targetNode;
|
|
133
|
+
|
|
134
|
+
if (hasResizeObserver) {
|
|
135
|
+
this.resizeObserverInstance.observe(targetNode);
|
|
136
|
+
} else {
|
|
137
|
+
this.addEventListeners(targetNode);
|
|
138
|
+
this.mutationObserverInstance.observe(targetNode, mutationObserverOptions);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}, {
|
|
142
|
+
key: "replaceObservationElement",
|
|
143
|
+
value: function replaceObservationElement(targetNode) {
|
|
144
|
+
if (this.targetNode === targetNode) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
this.targetNode && this.disconnect();
|
|
149
|
+
targetNode && this.observe(targetNode);
|
|
150
|
+
targetNode && this.resizeHandlerDispatch();
|
|
151
|
+
}
|
|
152
|
+
}, {
|
|
153
|
+
key: "disconnect",
|
|
154
|
+
value: function disconnect() {
|
|
155
|
+
this.targetNode && this.removeEventListeners(this.targetNode);
|
|
156
|
+
hasResizeObserver ? this.resizeObserverInstance.disconnect() : this.mutationObserverInstance.disconnect();
|
|
157
|
+
this.targetNode = null;
|
|
158
|
+
this.size = {
|
|
159
|
+
height: 0,
|
|
160
|
+
width: 0
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
}]);
|
|
164
|
+
|
|
165
|
+
return ResizeObserverPolyfill;
|
|
166
|
+
}();
|
|
167
|
+
|
|
168
|
+
exports["default"] = ResizeObserverPolyfill;
|