@zohodesk/components 1.0.0-temp-227 → 1.0.0-temp-228
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/propValidation_report.html +1 -1
- package/README.md +31 -20
- package/assets/Appearance/dark/mode/Component_v2_DarkMode.module.css +11 -0
- package/assets/Appearance/light/mode/Component_v2_LightMode.module.css +11 -0
- package/assets/Appearance/pureDark/mode/Component_v2_PureDarkMode.module.css +11 -0
- package/es/Accordion/Accordion.js +2 -2
- package/es/Accordion/AccordionItem.js +4 -4
- package/es/Accordion/__tests__/Accordion.spec.js +1 -1
- package/es/Accordion/__tests__/AccordionItem.spec.js +1 -1
- package/es/Accordion/index.js +2 -2
- package/es/Animation/Animation.js +3 -3
- package/es/Animation/__tests__/Animation.spec.js +1 -1
- package/es/Animation/utils.js +1 -1
- package/es/AppContainer/AppContainer.js +13 -14
- package/es/AppContainer/__tests__/AppContainer.spec.js +1 -1
- package/es/Avatar/Avatar.js +5 -5
- package/es/Avatar/__tests__/Avatar.spec.js +1 -1
- package/es/AvatarTeam/AvatarTeam.js +4 -4
- package/es/AvatarTeam/__tests__/AvatarTeam.spec.js +1 -1
- package/es/AvatarTeam/props/propTypes.js +1 -1
- package/es/Button/Button.js +4 -4
- package/es/Button/__tests__/Button.spec.js +2 -135
- package/es/Button/index.js +2 -2
- package/es/Button/props/defaultProps.js +1 -1
- package/es/Buttongroup/Buttongroup.js +3 -3
- package/es/Buttongroup/__tests__/Buttongroup.spec.js +1 -1
- package/es/Card/Card.js +5 -5
- package/es/Card/__tests__/Card.spec.js +1 -1
- package/es/Card/index.js +4 -4
- package/es/CheckBox/CheckBox.js +6 -6
- package/es/CheckBox/__tests__/CheckBox.spec.js +1 -1
- package/es/DateTime/CalendarView.js +6 -6
- package/es/DateTime/DateTime.js +15 -15
- package/es/DateTime/DateTimePopupFooter.js +5 -5
- package/es/DateTime/DateTimePopupHeader.js +4 -4
- package/es/DateTime/DateWidget.js +17 -17
- package/es/DateTime/DaysRow.js +3 -3
- package/es/DateTime/Time.js +5 -5
- package/es/DateTime/YearView.js +6 -6
- package/es/DateTime/__tests__/CalendarView.spec.js +1 -1
- package/es/DateTime/__tests__/DateTime.spec.js +1 -1
- package/es/DateTime/__tests__/DateTimePopupFooter.spec.js +1 -1
- package/es/DateTime/__tests__/DateTimePopupHeader.spec.js +1 -1
- package/es/DateTime/__tests__/DateWidget.spec.js +1 -1
- package/es/DateTime/__tests__/DaysRow.spec.js +1 -1
- package/es/DateTime/__tests__/Time.spec.js +1 -1
- package/es/DateTime/__tests__/YearView.spec.js +3 -2
- package/es/DateTime/__tests__/__snapshots__/YearView.spec.js.snap +61 -0
- package/es/DateTime/dateFormatUtils/dateFormat.js +4 -4
- package/es/DateTime/dateFormatUtils/dayChange.js +2 -2
- package/es/DateTime/dateFormatUtils/index.js +3 -3
- package/es/DateTime/dateFormatUtils/monthChange.js +2 -2
- package/es/DateTime/dateFormatUtils/timeChange.js +2 -2
- package/es/DateTime/dateFormatUtils/yearChange.js +2 -2
- package/es/DateTime/index.js +1 -1
- package/es/DateTime/props/propTypes.js +1 -1
- package/es/DateTime/validator.js +2 -2
- package/es/DropBox/DropBox.js +9 -9
- package/es/DropBox/DropBoxElement/DropBoxElement.js +6 -6
- package/es/DropBox/DropBoxElement/__tests__/DropBoxElement.spec.js +1 -1
- package/es/DropBox/DropBoxElement/css/cssJSLogic.js +1 -1
- package/es/DropBox/DropBoxElement/useDropboxPosCalc.js +1 -1
- package/es/DropBox/__tests__/DropBox.spec.js +1 -1
- package/es/DropBox/css/cssJSLogic.js +1 -1
- package/es/DropBox/props/defaultProps.js +1 -1
- package/es/DropBox/props/propTypes.js +1 -1
- package/es/DropBox/utils/isMobilePopover.js +1 -1
- package/es/DropDown/DropDown.js +4 -4
- package/es/DropDown/DropDownHeading.js +3 -3
- package/es/DropDown/DropDownItem.js +3 -3
- package/es/DropDown/DropDownSearch.js +4 -4
- package/es/DropDown/DropDownSeparator.js +2 -2
- package/es/DropDown/__tests__/DropDown.spec.js +1 -1
- package/es/DropDown/__tests__/DropDownHeading.spec.js +1 -1
- package/es/DropDown/__tests__/DropDownItem.spec.js +1 -1
- package/es/DropDown/__tests__/DropDownSearch.spec.js +1 -1
- package/es/DropDown/__tests__/DropDownSeparator.spec.js +1 -1
- package/es/DropDown/index.js +7 -7
- package/es/DropDown/props/propTypes.js +1 -1
- package/es/Heading/Heading.js +4 -4
- package/es/Heading/__tests__/Heading.spec.js +1 -1
- package/es/Label/Label.js +4 -4
- package/es/Label/__tests__/Label.spec.js +1 -1
- package/es/Layout/Box.js +4 -4
- package/es/Layout/Container.js +4 -4
- package/es/Layout/__tests__/Box.spec.js +1 -1
- package/es/Layout/__tests__/Container.spec.js +1 -1
- package/es/Layout/index.js +2 -2
- package/es/ListItem/ListContainer.js +6 -6
- package/es/ListItem/ListItem.js +5 -5
- package/es/ListItem/ListItemWithAvatar.js +7 -7
- package/es/ListItem/ListItemWithCheckBox.js +6 -6
- package/es/ListItem/ListItemWithIcon.js +5 -5
- package/es/ListItem/ListItemWithRadio.js +6 -6
- package/es/ListItem/__tests__/ListContainer.spec.js +1 -1
- package/es/ListItem/__tests__/ListItem.spec.js +1 -1
- package/es/ListItem/__tests__/ListItemWithAvatar.spec.js +1 -1
- package/es/ListItem/__tests__/ListItemWithCheckBox.spec.js +1 -1
- package/es/ListItem/__tests__/ListItemWithIcon.spec.js +1 -1
- package/es/ListItem/__tests__/ListItemWithRadio.spec.js +1 -1
- package/es/ListItem/index.js +6 -6
- package/es/ListItem/props/propTypes.js +2 -2
- package/es/Modal/Modal.js +3 -3
- package/es/Modal/__tests__/Modal.spec.js +1 -1
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +17 -17
- package/es/MultiSelect/AdvancedMultiSelect.js +17 -17
- package/es/MultiSelect/EmptyState.js +3 -3
- package/es/MultiSelect/MobileHeader/MobileHeader.js +5 -5
- package/es/MultiSelect/MobileHeader/__tests__/MobileHeader.spec.js +1 -1
- package/es/MultiSelect/MultiSelect.js +22 -35
- package/es/MultiSelect/MultiSelectHeader.js +4 -4
- package/es/MultiSelect/MultiSelectWithAvatar.js +16 -16
- package/es/MultiSelect/SelectedOptions.js +5 -5
- package/es/MultiSelect/Suggestions.js +6 -6
- package/es/MultiSelect/__tests__/AdvancedGroupMultiSelect.spec.js +1 -1
- package/es/MultiSelect/__tests__/AdvancedMultiSelect.spec.js +2 -9
- package/es/MultiSelect/__tests__/EmptyState.spec.js +1 -1
- package/es/MultiSelect/__tests__/MultiSelect.spec.js +1 -1
- package/es/MultiSelect/__tests__/MultiSelectHeader.spec.js +1 -1
- package/es/MultiSelect/__tests__/MultiSelectWithAvatar.spec.js +1 -1
- package/es/MultiSelect/__tests__/SelectedOptions.spec.js +1 -1
- package/es/MultiSelect/__tests__/Suggestions.spec.js +1 -1
- package/es/MultiSelect/index.js +4 -4
- package/es/MultiSelect/props/defaultProps.js +1 -1
- package/es/MultiSelect/props/propTypes.js +1 -3
- package/es/PopOver/PopOver.js +6 -6
- package/es/PopOver/__tests__/PopOver.spec.js +1 -1
- package/es/PopOver/index.js +3 -3
- package/es/Popup/Popup.js +7 -7
- package/es/Provider/AvatarSize.js +1 -1
- package/es/Provider/CssProvider.js +1 -1
- package/es/Provider/IdProvider.js +3 -3
- package/es/Provider/LibraryContext.js +5 -3
- package/es/Provider/ZindexProvider.js +2 -2
- package/es/Provider/index.js +4 -4
- package/es/Radio/Radio.js +6 -6
- package/es/Radio/__tests__/Radio.spec.js +1 -1
- package/es/Responsive/CustomResponsive.js +7 -7
- package/es/Responsive/ResizeComponent.js +2 -2
- package/es/Responsive/Responsive.js +6 -6
- package/es/Responsive/index.js +3 -3
- package/es/Responsive/utils/index.js +1 -1
- package/es/Responsive/windowResizeObserver.js +1 -1
- package/es/ResponsiveDropBox/ResponsiveDropBox.js +6 -6
- package/es/ResponsiveDropBox/__tests__/ResponsiveDropBox.spec.js +1 -1
- package/es/ResponsiveDropBox/props/propTypes.js +1 -1
- package/es/Ribbon/Ribbon.js +3 -3
- package/es/Ribbon/__tests__/Ribbon.spec.js +1 -1
- package/es/RippleEffect/RippleEffect.js +4 -4
- package/es/RippleEffect/__tests__/RippleEffect.spec.js +1 -1
- package/es/Select/GroupSelect.js +16 -16
- package/es/Select/Select.js +21 -30
- package/es/Select/SelectWithAvatar.js +17 -17
- package/es/Select/SelectWithIcon.js +13 -13
- package/es/Select/__tests__/GroupSelect.spec.js +1 -1
- package/es/Select/__tests__/Select.spec.js +5 -1131
- package/es/Select/__tests__/SelectWithAvatar.spec.js +1 -1
- package/es/Select/__tests__/SelectWithIcon.spec.js +1 -1
- package/es/Select/__tests__/__snapshots__/Select.spec.js.snap +1 -9621
- package/es/Select/index.js +4 -4
- package/es/Select/props/defaultProps.js +1 -1
- package/es/Select/props/propTypes.js +1 -3
- package/es/Stencils/Stencils.js +15 -8
- package/es/Stencils/Stencils.module.css +7 -11
- package/es/Stencils/__tests__/Stencils.spec.js +2 -10
- package/es/Stencils/__tests__/__snapshots__/Stencils.spec.js.snap +11 -27
- package/es/Stencils/props/defaultProps.js +1 -2
- package/es/Stencils/props/propTypes.js +2 -3
- package/es/Switch/Switch.js +5 -5
- package/es/Switch/__tests__/Switch.spec.js +1 -1
- package/es/Tab/Tab.js +6 -7
- package/es/Tab/TabContent.js +4 -4
- package/es/Tab/TabContentWrapper.js +3 -3
- package/es/Tab/TabWrapper.js +4 -5
- package/es/Tab/Tabs.js +23 -23
- package/es/Tab/__tests__/Tab.spec.js +1 -1
- package/es/Tab/__tests__/TabContent.spec.js +1 -1
- package/es/Tab/__tests__/TabContentWrapper.spec.js +1 -1
- package/es/Tab/__tests__/TabWrapper.spec.js +1 -1
- package/es/Tab/__tests__/Tabs.spec.js +1 -1
- package/es/Tab/index.js +5 -5
- package/es/Tab/props/propTypes.js +2 -2
- package/es/Tag/Tag.js +7 -7
- package/es/Tag/__tests__/Tag.spec.js +2 -9
- package/es/Tag/props/propTypes.js +1 -1
- package/es/TextBox/TextBox.js +3 -3
- package/es/TextBox/__tests__/TextBox.spec.js +1 -1
- package/es/TextBoxIcon/TextBoxIcon.js +8 -12
- package/es/TextBoxIcon/__tests__/TextBoxIcon.spec.js +1 -1
- package/es/TextBoxIcon/props/propTypes.js +2 -3
- package/es/Textarea/Textarea.js +3 -3
- package/es/Textarea/__tests__/Textarea.spec.js +1 -1
- package/es/Tooltip/Tooltip.js +6 -6
- package/es/Typography/Typography.js +4 -4
- package/es/Typography/css/cssJSLogic.js +1 -1
- package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +3 -3
- package/es/VelocityAnimation/VelocityAnimation/__tests__/VelocityAnimation.spec.js +1 -1
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +6 -43
- package/es/VelocityAnimation/VelocityAnimationGroup/__tests__/VelocityAnimationGroup.spec.js +1 -1
- package/es/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +1 -4
- package/es/VelocityAnimation/index.js +2 -2
- package/es/components-v2/Switch/Switch.js +151 -0
- package/es/components-v2/Switch/contants/index.js +12 -0
- package/es/components-v2/Switch/css/Switch_v2.module.css +140 -0
- package/es/components-v2/Switch/css/cssJSLogic.js +48 -0
- package/es/components-v2/Switch/props/defaultProps.js +12 -0
- package/es/components-v2/Switch/props/propTypes.js +32 -0
- package/es/components-v2/Switch/useSwitch.js +29 -0
- package/es/css.js +37 -37
- package/es/deprecated/PortalLayer/PortalLayer.js +3 -3
- package/es/index.js +39 -39
- package/es/semantic/Button/Button.js +3 -3
- package/es/semantic/Button/__tests__/Button.spec.js +1 -1
- package/es/semantic/index.js +1 -1
- package/es/utils/Common.js +2 -2
- package/es/utils/ContextOptimizer.js +1 -1
- package/es/utils/cssUtils.js +1 -1
- package/es/utils/datetime/common.js +1 -1
- package/es/utils/dropDownUtils.js +1 -1
- package/es/utils/index.js +1 -1
- package/es/v1/Accordion/Accordion.js +2 -2
- package/es/v1/Accordion/AccordionItem.js +4 -4
- package/es/v1/Accordion/index.js +2 -2
- package/es/v1/Animation/Animation.js +3 -3
- package/es/v1/Animation/utils.js +1 -1
- package/es/v1/AppContainer/AppContainer.js +8 -8
- package/es/v1/Avatar/Avatar.js +5 -5
- package/es/v1/AvatarTeam/AvatarTeam.js +4 -4
- package/es/v1/Button/Button.js +4 -4
- package/es/v1/Button/props/defaultProps.js +1 -1
- package/es/v1/Buttongroup/Buttongroup.js +3 -3
- package/es/v1/Card/Card.js +5 -5
- package/es/v1/Card/index.js +4 -4
- package/es/v1/CheckBox/CheckBox.js +6 -6
- package/es/v1/DateTime/CalendarView.js +7 -7
- package/es/v1/DateTime/DateTime.js +15 -15
- package/es/v1/DateTime/DateTimePopupFooter.js +5 -5
- package/es/v1/DateTime/DateTimePopupHeader.js +4 -4
- package/es/v1/DateTime/DateWidget.js +17 -17
- package/es/v1/DateTime/DaysRow.js +3 -3
- package/es/v1/DateTime/Time.js +5 -5
- package/es/v1/DateTime/YearView.js +6 -6
- package/es/v1/DateTime/index.js +1 -1
- package/es/v1/DateTime/props/propTypes.js +1 -1
- package/es/v1/DropBox/DropBox.js +9 -9
- package/es/v1/DropBox/DropBoxElement/DropBoxElement.js +6 -6
- package/es/v1/DropBox/props/defaultProps.js +1 -1
- package/es/v1/DropBox/props/propTypes.js +1 -1
- package/es/v1/DropBox/utils/isMobilePopover.js +1 -1
- package/es/v1/DropDown/DropDown.js +4 -4
- package/es/v1/DropDown/DropDownHeading.js +3 -3
- package/es/v1/DropDown/DropDownItem.js +3 -3
- package/es/v1/DropDown/DropDownSearch.js +4 -4
- package/es/v1/DropDown/DropDownSeparator.js +2 -2
- package/es/v1/DropDown/props/propTypes.js +1 -1
- package/es/v1/Heading/Heading.js +4 -4
- package/es/v1/Label/Label.js +4 -4
- package/es/v1/Layout/Box.js +4 -4
- package/es/v1/Layout/Container.js +4 -4
- package/es/v1/Layout/index.js +2 -2
- package/es/v1/ListItem/ListContainer.js +6 -6
- package/es/v1/ListItem/ListItem.js +5 -5
- package/es/v1/ListItem/ListItemWithAvatar.js +7 -7
- package/es/v1/ListItem/ListItemWithCheckBox.js +6 -6
- package/es/v1/ListItem/ListItemWithIcon.js +5 -5
- package/es/v1/ListItem/ListItemWithRadio.js +6 -6
- package/es/v1/ListItem/index.js +6 -6
- package/es/v1/Modal/Modal.js +3 -3
- package/es/v1/MultiSelect/AdvancedGroupMultiSelect.js +17 -17
- package/es/v1/MultiSelect/AdvancedMultiSelect.js +17 -17
- package/es/v1/MultiSelect/EmptyState.js +3 -3
- package/es/v1/MultiSelect/MobileHeader/MobileHeader.js +5 -5
- package/es/v1/MultiSelect/MultiSelect.js +19 -19
- package/es/v1/MultiSelect/MultiSelectHeader.js +4 -4
- package/es/v1/MultiSelect/MultiSelectWithAvatar.js +16 -16
- package/es/v1/MultiSelect/SelectedOptions.js +5 -5
- package/es/v1/MultiSelect/Suggestions.js +6 -6
- package/es/v1/MultiSelect/index.js +4 -4
- package/es/v1/MultiSelect/props/defaultProps.js +1 -1
- package/es/v1/PopOver/PopOver.js +6 -6
- package/es/v1/Popup/Popup.js +3 -3
- package/es/v1/Radio/Radio.js +5 -5
- package/es/v1/ResponsiveDropBox/ResponsiveDropBox.js +6 -6
- package/es/v1/ResponsiveDropBox/props/propTypes.js +1 -1
- package/es/v1/Ribbon/Ribbon.js +3 -3
- package/es/v1/RippleEffect/RippleEffect.js +4 -4
- package/es/v1/Select/GroupSelect.js +16 -16
- package/es/v1/Select/Select.js +15 -15
- package/es/v1/Select/SelectWithAvatar.js +17 -17
- package/es/v1/Select/SelectWithIcon.js +13 -13
- package/es/v1/Select/index.js +4 -4
- package/es/v1/Select/props/defaultProps.js +1 -1
- package/es/v1/Stencils/Stencils.js +3 -3
- package/es/v1/Switch/Switch.js +5 -5
- package/es/v1/Tab/Tab.js +5 -5
- package/es/v1/Tab/TabContent.js +4 -4
- package/es/v1/Tab/TabContentWrapper.js +3 -3
- package/es/v1/Tab/TabWrapper.js +3 -3
- package/es/v1/Tab/Tabs.js +13 -13
- package/es/v1/Tab/index.js +5 -5
- package/es/v1/Tag/Tag.js +7 -7
- package/es/v1/TextBox/TextBox.js +3 -3
- package/es/v1/TextBoxIcon/TextBoxIcon.js +6 -6
- package/es/v1/TextBoxIcon/props/propTypes.js +1 -1
- package/es/v1/Textarea/Textarea.js +3 -3
- package/es/v1/Tooltip/Tooltip.js +6 -6
- package/es/v1/Typography/Typography.js +4 -4
- package/es/v1/Typography/css/cssJSLogic.js +1 -1
- package/es/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +3 -3
- package/es/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +3 -3
- package/es/v1/semantic/Button/Button.js +3 -3
- package/es/v1/semantic/index.js +1 -1
- package/lib/AppContainer/AppContainer.js +6 -7
- package/lib/Button/__tests__/Button.spec.js +0 -140
- package/lib/DateTime/__tests__/YearView.spec.js +2 -1
- package/lib/DateTime/__tests__/__snapshots__/YearView.spec.js.snap +61 -0
- package/lib/MultiSelect/MultiSelect.js +3 -16
- package/lib/MultiSelect/__tests__/AdvancedMultiSelect.spec.js +0 -8
- package/lib/MultiSelect/props/propTypes.js +1 -3
- package/lib/Provider/IdProvider.js +0 -1
- package/lib/Provider/LibraryContext.js +3 -1
- package/lib/Select/Select.js +7 -16
- package/lib/Select/__tests__/Select.spec.js +3 -1364
- package/lib/Select/__tests__/__snapshots__/Select.spec.js.snap +1 -9621
- package/lib/Select/props/propTypes.js +1 -3
- package/lib/Stencils/Stencils.js +12 -5
- package/lib/Stencils/Stencils.module.css +7 -11
- package/lib/Stencils/__tests__/Stencils.spec.js +3 -11
- package/lib/Stencils/__tests__/__snapshots__/Stencils.spec.js.snap +11 -27
- package/lib/Stencils/props/defaultProps.js +1 -2
- package/lib/Stencils/props/propTypes.js +2 -3
- package/lib/Tab/Tab.js +1 -3
- package/lib/Tab/TabWrapper.js +1 -3
- package/lib/Tab/Tabs.js +10 -11
- package/lib/Tab/props/propTypes.js +2 -2
- package/lib/Tag/__tests__/Tag.spec.js +2 -10
- package/lib/TextBoxIcon/TextBoxIcon.js +2 -6
- package/lib/TextBoxIcon/props/propTypes.js +1 -2
- package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +26 -80
- package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +1 -4
- package/lib/components-v2/Switch/Switch.js +169 -0
- package/lib/components-v2/Switch/contants/index.js +20 -0
- package/lib/components-v2/Switch/css/Switch_v2.module.css +140 -0
- package/lib/components-v2/Switch/css/cssJSLogic.js +37 -0
- package/lib/components-v2/Switch/props/defaultProps.js +19 -0
- package/lib/components-v2/Switch/props/propTypes.js +43 -0
- package/lib/components-v2/Switch/useSwitch.js +52 -0
- package/lib/utils/Common.js +1 -1
- package/package.json +4 -3
- package/react-cli.config.js +2 -2
- package/result.json +1 -0
- package/es/Tab/__tests__/TabLayout.spec.js +0 -34
- package/es/Tab/__tests__/__snapshots__/TabLayout.spec.js.snap +0 -341
- package/es/Tab/utils/tabConfigs.js +0 -18
- package/lib/Tab/__tests__/TabLayout.spec.js +0 -41
- package/lib/Tab/__tests__/__snapshots__/TabLayout.spec.js.snap +0 -341
- package/lib/Tab/utils/tabConfigs.js +0 -27
|
@@ -110,9 +110,7 @@ var Select_propTypes = {
|
|
|
110
110
|
targetOffset: _propTypes["default"].object,
|
|
111
111
|
isRestrictScroll: _propTypes["default"].bool,
|
|
112
112
|
dropBoxPortalId: _propTypes["default"].string,
|
|
113
|
-
allowValueFallback: _propTypes["default"].bool
|
|
114
|
-
renderCustomToggleIndicator: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].node]),
|
|
115
|
-
renderCustomSearchClearComponent: _propTypes["default"].func
|
|
113
|
+
allowValueFallback: _propTypes["default"].bool
|
|
116
114
|
};
|
|
117
115
|
exports.Select_propTypes = Select_propTypes;
|
|
118
116
|
var GroupSelect_propTypes = {
|
package/lib/Stencils/Stencils.js
CHANGED
|
@@ -55,11 +55,11 @@ var Stencils = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
55
55
|
shape = _this$props.shape,
|
|
56
56
|
size = _this$props.size,
|
|
57
57
|
palette = _this$props.palette,
|
|
58
|
-
customClass = _this$props.customClass
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
customClass = _this$props.customClass;
|
|
59
|
+
size = shape === 'rect' ? _StencilsModule["default"][size] : _StencilsModule["default"]["c".concat(size)];
|
|
60
|
+
shape = shape === 'rect' ? _StencilsModule["default"].rectangular : _StencilsModule["default"].circle;
|
|
61
61
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
62
|
-
className: "".concat(_StencilsModule["default"].container, " ").concat(
|
|
62
|
+
className: "".concat(_StencilsModule["default"].container, " ").concat(shape, " ").concat(size, " ").concat(_StencilsModule["default"][palette], " ").concat(customClass)
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
}]);
|
|
@@ -69,4 +69,11 @@ var Stencils = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
69
69
|
|
|
70
70
|
exports["default"] = Stencils;
|
|
71
71
|
Stencils.propTypes = _propTypes.propTypes;
|
|
72
|
-
Stencils.defaultProps = _defaultProps.defaultProps;
|
|
72
|
+
Stencils.defaultProps = _defaultProps.defaultProps; // if (__DOCS__) {
|
|
73
|
+
// Stencils.docs = {
|
|
74
|
+
// componentGroup: 'Atom',
|
|
75
|
+
// folderName: 'Style Guide',
|
|
76
|
+
// description: ' ',
|
|
77
|
+
// external: true
|
|
78
|
+
// };
|
|
79
|
+
// }
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
.stencil {
|
|
14
14
|
background-size: 800px 1px;
|
|
15
15
|
}
|
|
16
|
-
[dir=ltr] .
|
|
16
|
+
[dir=ltr] .stencil {
|
|
17
17
|
animation-name: placeHolderShimmer-ltr ;
|
|
18
18
|
animation-fill-mode: forwards;
|
|
19
19
|
animation-iteration-count: infinite;
|
|
20
20
|
animation-duration: var(--zd_transition10);
|
|
21
21
|
animation-timing-function: linear;
|
|
22
22
|
}
|
|
23
|
-
[dir=rtl] .
|
|
23
|
+
[dir=rtl] .stencil {
|
|
24
24
|
animation-name: placeHolderShimmer-rtl ;
|
|
25
25
|
animation-fill-mode: forwards;
|
|
26
26
|
animation-iteration-count: infinite;
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
.
|
|
49
|
+
.rectangular {
|
|
50
50
|
composes: stencil;
|
|
51
51
|
--stencil_height: var(--zd_size9);
|
|
52
52
|
--stencil_border_radius: 5px;
|
|
@@ -81,20 +81,16 @@
|
|
|
81
81
|
composes: stencil;
|
|
82
82
|
--stencil_border_radius: 50%;
|
|
83
83
|
}
|
|
84
|
-
.
|
|
85
|
-
composes: stencil;
|
|
86
|
-
--stencil_border_radius: 4px;
|
|
87
|
-
}
|
|
88
|
-
.size_large {
|
|
84
|
+
.clarge {
|
|
89
85
|
--stencil_width: var(--zd_size42);
|
|
90
86
|
--stencil_height: var(--zd_size42);
|
|
91
87
|
}
|
|
92
|
-
.
|
|
93
|
-
.
|
|
88
|
+
.cmedium,
|
|
89
|
+
.cdefault {
|
|
94
90
|
--stencil_width: var(--zd_size30);
|
|
95
91
|
--stencil_height: var(--zd_size30);
|
|
96
92
|
}
|
|
97
|
-
.
|
|
93
|
+
.csmall {
|
|
98
94
|
--stencil_width: var(--zd_size20);
|
|
99
95
|
--stencil_height: var(--zd_size20);
|
|
100
96
|
}
|
|
@@ -24,7 +24,7 @@ describe('Stencils', function () {
|
|
|
24
24
|
|
|
25
25
|
expect(asFragment()).toMatchSnapshot();
|
|
26
26
|
});
|
|
27
|
-
var shape = ['rect', 'circle'
|
|
27
|
+
var shape = ['rect', 'circle'];
|
|
28
28
|
test.each(shape)('rendering the shape of- %s', function (shape) {
|
|
29
29
|
var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Stencils["default"], {
|
|
30
30
|
shape: shape
|
|
@@ -42,19 +42,11 @@ describe('Stencils', function () {
|
|
|
42
42
|
|
|
43
43
|
expect(asFragment()).toMatchSnapshot();
|
|
44
44
|
});
|
|
45
|
-
test('rendering without animation', function () {
|
|
46
|
-
var _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Stencils["default"], {
|
|
47
|
-
isAnimated: false
|
|
48
|
-
})),
|
|
49
|
-
asFragment = _render5.asFragment;
|
|
50
|
-
|
|
51
|
-
expect(asFragment()).toMatchSnapshot();
|
|
52
|
-
});
|
|
53
45
|
test('rendering the customClass', function () {
|
|
54
|
-
var
|
|
46
|
+
var _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Stencils["default"], {
|
|
55
47
|
customClass: "StencilsCustomClass"
|
|
56
48
|
})),
|
|
57
|
-
asFragment =
|
|
49
|
+
asFragment = _render5.asFragment;
|
|
58
50
|
|
|
59
51
|
expect(asFragment()).toMatchSnapshot();
|
|
60
52
|
});
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`Stencils rendering the customClass 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<div
|
|
6
|
-
class="container
|
|
6
|
+
class="container rectangular medium primary StencilsCustomClass"
|
|
7
7
|
/>
|
|
8
8
|
</DocumentFragment>
|
|
9
9
|
`;
|
|
@@ -11,7 +11,7 @@ exports[`Stencils rendering the customClass 1`] = `
|
|
|
11
11
|
exports[`Stencils rendering the defult props 1`] = `
|
|
12
12
|
<DocumentFragment>
|
|
13
13
|
<div
|
|
14
|
-
class="container
|
|
14
|
+
class="container rectangular medium primary "
|
|
15
15
|
/>
|
|
16
16
|
</DocumentFragment>
|
|
17
17
|
`;
|
|
@@ -19,7 +19,7 @@ exports[`Stencils rendering the defult props 1`] = `
|
|
|
19
19
|
exports[`Stencils rendering the palette of- dark 1`] = `
|
|
20
20
|
<DocumentFragment>
|
|
21
21
|
<div
|
|
22
|
-
class="container
|
|
22
|
+
class="container rectangular medium dark "
|
|
23
23
|
/>
|
|
24
24
|
</DocumentFragment>
|
|
25
25
|
`;
|
|
@@ -27,7 +27,7 @@ exports[`Stencils rendering the palette of- dark 1`] = `
|
|
|
27
27
|
exports[`Stencils rendering the palette of- primary 1`] = `
|
|
28
28
|
<DocumentFragment>
|
|
29
29
|
<div
|
|
30
|
-
class="container
|
|
30
|
+
class="container rectangular medium primary "
|
|
31
31
|
/>
|
|
32
32
|
</DocumentFragment>
|
|
33
33
|
`;
|
|
@@ -35,7 +35,7 @@ exports[`Stencils rendering the palette of- primary 1`] = `
|
|
|
35
35
|
exports[`Stencils rendering the palette of- secondary 1`] = `
|
|
36
36
|
<DocumentFragment>
|
|
37
37
|
<div
|
|
38
|
-
class="container
|
|
38
|
+
class="container rectangular medium secondary "
|
|
39
39
|
/>
|
|
40
40
|
</DocumentFragment>
|
|
41
41
|
`;
|
|
@@ -43,7 +43,7 @@ exports[`Stencils rendering the palette of- secondary 1`] = `
|
|
|
43
43
|
exports[`Stencils rendering the shape of- circle 1`] = `
|
|
44
44
|
<DocumentFragment>
|
|
45
45
|
<div
|
|
46
|
-
class="container
|
|
46
|
+
class="container circle cmedium primary "
|
|
47
47
|
/>
|
|
48
48
|
</DocumentFragment>
|
|
49
49
|
`;
|
|
@@ -51,15 +51,7 @@ exports[`Stencils rendering the shape of- circle 1`] = `
|
|
|
51
51
|
exports[`Stencils rendering the shape of- rect 1`] = `
|
|
52
52
|
<DocumentFragment>
|
|
53
53
|
<div
|
|
54
|
-
class="container
|
|
55
|
-
/>
|
|
56
|
-
</DocumentFragment>
|
|
57
|
-
`;
|
|
58
|
-
|
|
59
|
-
exports[`Stencils rendering the shape of- square 1`] = `
|
|
60
|
-
<DocumentFragment>
|
|
61
|
-
<div
|
|
62
|
-
class="container animate square size_medium primary "
|
|
54
|
+
class="container rectangular medium primary "
|
|
63
55
|
/>
|
|
64
56
|
</DocumentFragment>
|
|
65
57
|
`;
|
|
@@ -67,7 +59,7 @@ exports[`Stencils rendering the shape of- square 1`] = `
|
|
|
67
59
|
exports[`Stencils rendering the size of- default 1`] = `
|
|
68
60
|
<DocumentFragment>
|
|
69
61
|
<div
|
|
70
|
-
class="container
|
|
62
|
+
class="container rectangular default primary "
|
|
71
63
|
/>
|
|
72
64
|
</DocumentFragment>
|
|
73
65
|
`;
|
|
@@ -75,7 +67,7 @@ exports[`Stencils rendering the size of- default 1`] = `
|
|
|
75
67
|
exports[`Stencils rendering the size of- large 1`] = `
|
|
76
68
|
<DocumentFragment>
|
|
77
69
|
<div
|
|
78
|
-
class="container
|
|
70
|
+
class="container rectangular large primary "
|
|
79
71
|
/>
|
|
80
72
|
</DocumentFragment>
|
|
81
73
|
`;
|
|
@@ -83,7 +75,7 @@ exports[`Stencils rendering the size of- large 1`] = `
|
|
|
83
75
|
exports[`Stencils rendering the size of- medium 1`] = `
|
|
84
76
|
<DocumentFragment>
|
|
85
77
|
<div
|
|
86
|
-
class="container
|
|
78
|
+
class="container rectangular medium primary "
|
|
87
79
|
/>
|
|
88
80
|
</DocumentFragment>
|
|
89
81
|
`;
|
|
@@ -91,15 +83,7 @@ exports[`Stencils rendering the size of- medium 1`] = `
|
|
|
91
83
|
exports[`Stencils rendering the size of- small 1`] = `
|
|
92
84
|
<DocumentFragment>
|
|
93
85
|
<div
|
|
94
|
-
class="container
|
|
95
|
-
/>
|
|
96
|
-
</DocumentFragment>
|
|
97
|
-
`;
|
|
98
|
-
|
|
99
|
-
exports[`Stencils rendering without animation 1`] = `
|
|
100
|
-
<DocumentFragment>
|
|
101
|
-
<div
|
|
102
|
-
class="container rect medium primary "
|
|
86
|
+
class="container rectangular small primary "
|
|
103
87
|
/>
|
|
104
88
|
</DocumentFragment>
|
|
105
89
|
`;
|
|
@@ -11,9 +11,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
11
11
|
|
|
12
12
|
var propTypes = {
|
|
13
13
|
palette: _propTypes["default"].oneOf(['primary', 'secondary', 'dark']),
|
|
14
|
-
shape: _propTypes["default"].oneOf(['rect', 'circle'
|
|
14
|
+
shape: _propTypes["default"].oneOf(['rect', 'circle']),
|
|
15
15
|
size: _propTypes["default"].oneOf(['small', 'medium', 'large', 'default']),
|
|
16
|
-
customClass: _propTypes["default"].string
|
|
17
|
-
isAnimated: _propTypes["default"].bool
|
|
16
|
+
customClass: _propTypes["default"].string
|
|
18
17
|
};
|
|
19
18
|
exports.propTypes = propTypes;
|
package/lib/Tab/Tab.js
CHANGED
|
@@ -17,8 +17,6 @@ var _Layout = require("../Layout");
|
|
|
17
17
|
|
|
18
18
|
var _Common = require("../utils/Common");
|
|
19
19
|
|
|
20
|
-
var _tabConfigs = require("./utils/tabConfigs");
|
|
21
|
-
|
|
22
20
|
var _TabModule = _interopRequireDefault(require("./Tab.module.css"));
|
|
23
21
|
|
|
24
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -92,7 +90,7 @@ function Tab(_ref) {
|
|
|
92
90
|
var activeWithAppearance = (0, _Common.cs)([_TabModule["default"][styleContent.active], needBorder && !isAnimate && _TabModule["default"]["".concat(styleContent.active, "_border")]]);
|
|
93
91
|
var activeClasses = (0, _Common.cs)([needAppearance && activeWithAppearance, activeClass]);
|
|
94
92
|
var inActiveClasses = needAppearance && (0, _Common.cs)([_TabModule["default"][styleContent.tab], tabTypes[type] && _TabModule["default"]["".concat("".concat(type, "Hover"))]]);
|
|
95
|
-
var tabClass = (0, _Common.cs)([_TabModule["default"].tab,
|
|
93
|
+
var tabClass = (0, _Common.cs)([_TabModule["default"].tab, align === 'vertical' ? _TabModule["default"].vertical : _TabModule["default"].horizontal, isDisabled && _TabModule["default"].disabled, needBorder && !isAnimate && needAppearance && _TabModule["default"].border, isActive ? activeClasses : inActiveClasses, className]);
|
|
96
94
|
return /*#__PURE__*/_react["default"].createElement(_Layout.Box, _extends({
|
|
97
95
|
tourId: tourId,
|
|
98
96
|
tagName: isLink ? 'a' : 'div',
|
package/lib/Tab/TabWrapper.js
CHANGED
|
@@ -15,8 +15,6 @@ var _propTypes = require("./props/propTypes");
|
|
|
15
15
|
|
|
16
16
|
var _Layout = require("../Layout");
|
|
17
17
|
|
|
18
|
-
var _tabConfigs = require("./utils/tabConfigs");
|
|
19
|
-
|
|
20
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
19
|
|
|
22
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -63,7 +61,7 @@ function TabWrapper(_ref) {
|
|
|
63
61
|
onSelect && onSelect(id);
|
|
64
62
|
}, [hookToDisableInternalState, onSelect]);
|
|
65
63
|
return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
66
|
-
alignBox:
|
|
64
|
+
alignBox: align === 'vertical' ? 'column' : 'row',
|
|
67
65
|
dataId: dataId,
|
|
68
66
|
dataSelectorId: dataSelectorId
|
|
69
67
|
}, _react["default"].Children.map(children, function (child) {
|
package/lib/Tab/Tabs.js
CHANGED
|
@@ -37,8 +37,6 @@ var _ResponsiveDropBox = _interopRequireDefault(require("../ResponsiveDropBox/Re
|
|
|
37
37
|
|
|
38
38
|
var _CustomResponsive = require("../Responsive/CustomResponsive");
|
|
39
39
|
|
|
40
|
-
var _tabConfigs = require("./utils/tabConfigs");
|
|
41
|
-
|
|
42
40
|
var _semanticButtonModule = _interopRequireDefault(require("../semantic/Button/semanticButton.module.css"));
|
|
43
41
|
|
|
44
42
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -178,14 +176,14 @@ var Tabs = /*#__PURE__*/function (_React$Component) {
|
|
|
178
176
|
if (totalDimension && this[selectedTab]) {
|
|
179
177
|
var align = this.props.align;
|
|
180
178
|
var newDim = "".concat((0, _Common.remConvert)(totalDimension), "rem");
|
|
181
|
-
|
|
179
|
+
align === 'vertical' ? this[selectedTab].style.maxWidth = newDim : this[selectedTab].style.maxHeight = newDim;
|
|
182
180
|
}
|
|
183
181
|
}
|
|
184
182
|
}, {
|
|
185
183
|
key: "getHighlightDim",
|
|
186
184
|
value: function getHighlightDim() {
|
|
187
185
|
var align = this.props.align;
|
|
188
|
-
return
|
|
186
|
+
return align === 'vertical' ? this.highlight.offsetLeft : this.highlight.offsetTop;
|
|
189
187
|
}
|
|
190
188
|
}, {
|
|
191
189
|
key: "componentDidUpdate",
|
|
@@ -262,12 +260,12 @@ var Tabs = /*#__PURE__*/function (_React$Component) {
|
|
|
262
260
|
if (tabActive) {
|
|
263
261
|
var position, dimension;
|
|
264
262
|
|
|
265
|
-
if (
|
|
263
|
+
if (align === 'vertical') {
|
|
266
264
|
position = tabActive.offsetLeft;
|
|
267
265
|
dimension = tabActive.offsetWidth;
|
|
268
266
|
node.style.transform = "translateX(".concat((0, _Common.remConvert)(position - highlightInitialDimension), "rem)");
|
|
269
267
|
node.style.width = "".concat((0, _Common.remConvert)(dimension), "rem");
|
|
270
|
-
} else if (
|
|
268
|
+
} else if (align === 'horizontal') {
|
|
271
269
|
position = tabActive.offsetTop;
|
|
272
270
|
dimension = tabActive.offsetHeight;
|
|
273
271
|
node.style.transform = "translateY(".concat((0, _Common.remConvert)(position - highlightInitialDimension), "rem)");
|
|
@@ -473,7 +471,8 @@ var Tabs = /*#__PURE__*/function (_React$Component) {
|
|
|
473
471
|
align = _this$props8.align,
|
|
474
472
|
removeClose = _this$props8.removeClose;
|
|
475
473
|
removeClose && removeClose(e);
|
|
476
|
-
|
|
474
|
+
var popupPosition = align === 'vertical' ? 'bottomLeft' : 'rightTop';
|
|
475
|
+
boxPosition = boxPosition ? boxPosition : popupPosition;
|
|
477
476
|
togglePopup(e, boxPosition);
|
|
478
477
|
}
|
|
479
478
|
}, {
|
|
@@ -593,7 +592,7 @@ var Tabs = /*#__PURE__*/function (_React$Component) {
|
|
|
593
592
|
MoreButtonProps = _customProps$MoreButt === void 0 ? {} : _customProps$MoreButt,
|
|
594
593
|
_customProps$TextBoxI = customProps.TextBoxIconProps,
|
|
595
594
|
TextBoxIconProps = _customProps$TextBoxI === void 0 ? {} : _customProps$TextBoxI;
|
|
596
|
-
var popupClass =
|
|
595
|
+
var popupClass = align === 'vertical' ? _TabsModule["default"][position] ? _TabsModule["default"][position] : '' : '';
|
|
597
596
|
var moreTabsListItems = this.handleFilterSuggestions({
|
|
598
597
|
moreTabs: moreTabs
|
|
599
598
|
});
|
|
@@ -754,17 +753,17 @@ var Tabs = /*#__PURE__*/function (_React$Component) {
|
|
|
754
753
|
className: containerClass,
|
|
755
754
|
dataSelectorId: dataSelectorId
|
|
756
755
|
}, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
757
|
-
alignBox:
|
|
756
|
+
alignBox: align === 'vertical' ? 'row' : 'column',
|
|
758
757
|
className: tabsClass,
|
|
759
758
|
style: style
|
|
760
759
|
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
761
760
|
eleRef: this.getTabsRef,
|
|
762
761
|
flexible: true
|
|
763
762
|
}, renderVirtualTabs && /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
764
|
-
alignBox:
|
|
763
|
+
alignBox: align === 'vertical' ? 'row' : 'column',
|
|
765
764
|
className: _TabsModule["default"].hidden
|
|
766
765
|
}, this.renderTabs(children, [], true)), /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
767
|
-
alignBox:
|
|
766
|
+
alignBox: align === 'vertical' ? 'row' : 'column'
|
|
768
767
|
}, this.renderTabs(mainTabs, moreTabs, false))), otherTabs.length ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, null, otherTabs) : null, isAnimate && needTabBorder && needAppearance && /*#__PURE__*/_react["default"].createElement("div", {
|
|
769
768
|
className: hlClass,
|
|
770
769
|
ref: this.getHighlightRef,
|
|
@@ -11,7 +11,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
11
11
|
|
|
12
12
|
var Tab_propTypes = {
|
|
13
13
|
activeClass: _propTypes["default"].string,
|
|
14
|
-
align: _propTypes["default"].
|
|
14
|
+
align: _propTypes["default"].string,
|
|
15
15
|
children: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].string]),
|
|
16
16
|
className: _propTypes["default"].string,
|
|
17
17
|
dataId: _propTypes["default"].string,
|
|
@@ -115,7 +115,7 @@ var Tabs_propTypes = {
|
|
|
115
115
|
};
|
|
116
116
|
exports.Tabs_propTypes = Tabs_propTypes;
|
|
117
117
|
var TabWrapper_propTypes = {
|
|
118
|
-
align: _propTypes["default"].oneOf(['vertical', 'horizontal'
|
|
118
|
+
align: _propTypes["default"].oneOf(['vertical', 'horizontal']),
|
|
119
119
|
children: _propTypes["default"].node,
|
|
120
120
|
dataId: _propTypes["default"].string,
|
|
121
121
|
defaultTab: _propTypes["default"].string,
|
|
@@ -2,20 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
var _react = _interopRequireDefault(require("react"));
|
|
4
4
|
|
|
5
|
-
var _react2 = require("@testing-library/react");
|
|
6
|
-
|
|
7
|
-
var _IdProvider = require("../../Provider/IdProvider");
|
|
8
|
-
|
|
9
5
|
var _Tag = _interopRequireDefault(require("../Tag"));
|
|
10
6
|
|
|
7
|
+
var _react2 = require("@testing-library/react");
|
|
8
|
+
|
|
11
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
12
10
|
|
|
13
|
-
beforeEach(function () {
|
|
14
|
-
(0, _IdProvider.setGlobalId)(0);
|
|
15
|
-
});
|
|
16
|
-
afterEach(function () {
|
|
17
|
-
(0, _react2.cleanup)();
|
|
18
|
-
});
|
|
19
11
|
describe('Tag component', function () {
|
|
20
12
|
var size = ['small', 'medium'];
|
|
21
13
|
var palette = ['default', 'danger', 'secondary', 'pureDotted', 'primaryDotted', 'dark', 'pureDarkDotted', 'darkPrimaryDotted', 'defaultLink'];
|
|
@@ -158,8 +158,7 @@ var TextBoxIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
158
158
|
isScrollPrevent = _this$props2.isScrollPrevent,
|
|
159
159
|
customProps = _this$props2.customProps,
|
|
160
160
|
needInputFocusOnWrapperClick = _this$props2.needInputFocusOnWrapperClick,
|
|
161
|
-
renderRightPlaceholderNode = _this$props2.renderRightPlaceholderNode
|
|
162
|
-
renderCustomClearComponent = _this$props2.renderCustomClearComponent;
|
|
161
|
+
renderRightPlaceholderNode = _this$props2.renderRightPlaceholderNode;
|
|
163
162
|
var isActive = this.state.isActive;
|
|
164
163
|
var _customClass$customTB = customClass.customTBoxWrap,
|
|
165
164
|
customTBoxWrap = _customClass$customTB === void 0 ? '' : _customClass$customTB,
|
|
@@ -214,10 +213,7 @@ var TextBoxIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
214
213
|
className: "".concat(_TextBoxIconModule["default"].iconContainer, " ").concat(customTBoxIcon)
|
|
215
214
|
}, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
216
215
|
alignBox: "row"
|
|
217
|
-
}, value && onClear && value.length > 1 && !isDisabled && !isReadOnly || showClearIcon ?
|
|
218
|
-
clearText: clearText,
|
|
219
|
-
handleClear: this.handleClear
|
|
220
|
-
}) : /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
216
|
+
}, value && onClear && value.length > 1 && !isDisabled && !isReadOnly || showClearIcon ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
221
217
|
className: "".concat(_semanticButtonModule["default"].buttonReset, " ").concat(_TextBoxIconModule["default"].icon),
|
|
222
218
|
onClick: this.handleClear,
|
|
223
219
|
dataId: "".concat(dataId, "_ClearIcon"),
|
|
@@ -67,8 +67,7 @@ var propTypes = _objectSpread(_objectSpread({}, _propTypes2.propTypes), {}, {
|
|
|
67
67
|
customProps: _propTypes["default"].shape({
|
|
68
68
|
TextBoxProps: _propTypes["default"].object
|
|
69
69
|
}),
|
|
70
|
-
renderRightPlaceholderNode: _propTypes["default"].node
|
|
71
|
-
renderCustomClearComponent: _propTypes["default"].func
|
|
70
|
+
renderRightPlaceholderNode: _propTypes["default"].node
|
|
72
71
|
});
|
|
73
72
|
|
|
74
73
|
exports.propTypes = propTypes;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
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
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -27,20 +29,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
27
29
|
|
|
28
30
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
29
31
|
|
|
30
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
31
|
-
|
|
32
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
33
|
-
|
|
34
|
-
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); }
|
|
35
|
-
|
|
36
|
-
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; }
|
|
37
|
-
|
|
38
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
39
|
-
|
|
40
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
|
-
|
|
42
|
-
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); }
|
|
43
|
-
|
|
44
32
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
45
33
|
|
|
46
34
|
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); } }
|
|
@@ -75,75 +63,35 @@ var VelocityAnimationGroup = /*#__PURE__*/function (_React$Component) {
|
|
|
75
63
|
var _super = _createSuper(VelocityAnimationGroup);
|
|
76
64
|
|
|
77
65
|
function VelocityAnimationGroup(props) {
|
|
78
|
-
var _this;
|
|
79
|
-
|
|
80
66
|
_classCallCheck(this, VelocityAnimationGroup);
|
|
81
67
|
|
|
82
|
-
|
|
83
|
-
_this.handleEnterComplete = _this.handleEnterComplete.bind(_assertThisInitialized(_this));
|
|
84
|
-
_this.handleExitComplete = _this.handleExitComplete.bind(_assertThisInitialized(_this));
|
|
85
|
-
return _this;
|
|
68
|
+
return _super.call(this, props);
|
|
86
69
|
}
|
|
87
70
|
|
|
88
71
|
_createClass(VelocityAnimationGroup, [{
|
|
89
|
-
key: "handleEnterComplete",
|
|
90
|
-
value: function handleEnterComplete(elements) {
|
|
91
|
-
var _this$props = this.props,
|
|
92
|
-
onEnterComplete = _this$props.onEnterComplete,
|
|
93
|
-
postEnterStyles = _this$props.postEnterStyles;
|
|
94
|
-
|
|
95
|
-
if (typeof onEnterComplete === 'function') {
|
|
96
|
-
onEnterComplete(elements);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (postEnterStyles && _typeof(postEnterStyles) === 'object') {
|
|
100
|
-
elements.forEach(function (rootElement) {
|
|
101
|
-
Object.entries(postEnterStyles).forEach(function (_ref) {
|
|
102
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
103
|
-
cssProperty = _ref2[0],
|
|
104
|
-
cssValue = _ref2[1];
|
|
105
|
-
|
|
106
|
-
rootElement.style[cssProperty] = cssValue;
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}, {
|
|
112
|
-
key: "handleExitComplete",
|
|
113
|
-
value: function handleExitComplete(elements) {
|
|
114
|
-
var onExitComplete = this.props.onExitComplete;
|
|
115
|
-
|
|
116
|
-
if (typeof onExitComplete === 'function') {
|
|
117
|
-
onExitComplete(elements);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}, {
|
|
121
72
|
key: "render",
|
|
122
73
|
value: function render() {
|
|
123
|
-
var _this$
|
|
124
|
-
children = _this$
|
|
125
|
-
enterName = _this$
|
|
126
|
-
exitName = _this$
|
|
127
|
-
enterDuration = _this$
|
|
128
|
-
exitDuration = _this$
|
|
129
|
-
isActive = _this$
|
|
130
|
-
component = _this$
|
|
131
|
-
runOnMount = _this$
|
|
132
|
-
enterShowStyle = _this$
|
|
133
|
-
enterHideStyle = _this$
|
|
134
|
-
exitDelay = _this$
|
|
135
|
-
isFlex = _this$
|
|
136
|
-
enterDelay = _this$
|
|
137
|
-
isCustomized = _this$
|
|
138
|
-
name = _this$
|
|
139
|
-
needUIPack = _this$
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
var _ref3 = this.context || {},
|
|
145
|
-
direction = _ref3.direction,
|
|
146
|
-
isReducedMotion = _ref3.isReducedMotion;
|
|
74
|
+
var _this$props = this.props,
|
|
75
|
+
children = _this$props.children,
|
|
76
|
+
enterName = _this$props.enterName,
|
|
77
|
+
exitName = _this$props.exitName,
|
|
78
|
+
enterDuration = _this$props.enterDuration,
|
|
79
|
+
exitDuration = _this$props.exitDuration,
|
|
80
|
+
isActive = _this$props.isActive,
|
|
81
|
+
component = _this$props.component,
|
|
82
|
+
runOnMount = _this$props.runOnMount,
|
|
83
|
+
enterShowStyle = _this$props.enterShowStyle,
|
|
84
|
+
enterHideStyle = _this$props.enterHideStyle,
|
|
85
|
+
exitDelay = _this$props.exitDelay,
|
|
86
|
+
isFlex = _this$props.isFlex,
|
|
87
|
+
enterDelay = _this$props.enterDelay,
|
|
88
|
+
isCustomized = _this$props.isCustomized,
|
|
89
|
+
name = _this$props.name,
|
|
90
|
+
needUIPack = _this$props.needUIPack;
|
|
91
|
+
|
|
92
|
+
var _ref = this.context || {},
|
|
93
|
+
direction = _ref.direction,
|
|
94
|
+
isReducedMotion = _ref.isReducedMotion;
|
|
147
95
|
|
|
148
96
|
var childProps = clearProps(this.props);
|
|
149
97
|
var enterAnimationObj = {
|
|
@@ -180,15 +128,13 @@ var VelocityAnimationGroup = /*#__PURE__*/function (_React$Component) {
|
|
|
180
128
|
animation: isCustomized ? enterAnimationObj[name] : needUIPack ? "transition.".concat(enterName, "In") : enterName,
|
|
181
129
|
duration: !isReducedMotion ? enterDuration : 0,
|
|
182
130
|
delay: enterDelay ? enterDelay : 0,
|
|
183
|
-
display: isFlex ? 'flex' : ''
|
|
184
|
-
complete: onEnterComplete || postEnterStyles ? this.handleEnterComplete : undefined
|
|
131
|
+
display: isFlex ? 'flex' : ''
|
|
185
132
|
};
|
|
186
133
|
var exitAnimation = {
|
|
187
134
|
animation: isCustomized ? exitAnimationObj[name] : needUIPack ? "transition.".concat(exitName ? exitName : enterName, "Out") : exitName ? exitName : enterName,
|
|
188
135
|
duration: !isReducedMotion ? exitDuration : 0,
|
|
189
136
|
delay: exitDelay ? exitDelay : 0,
|
|
190
|
-
display: 'none'
|
|
191
|
-
complete: onExitComplete ? this.handleExitComplete : undefined
|
|
137
|
+
display: 'none'
|
|
192
138
|
};
|
|
193
139
|
return /*#__PURE__*/_react["default"].createElement(_velocityReact.VelocityTransitionGroup, _extends({
|
|
194
140
|
enter: enterAnimation,
|
|
@@ -25,9 +25,6 @@ var propTypes = {
|
|
|
25
25
|
isFlex: _propTypes["default"].bool,
|
|
26
26
|
name: _propTypes["default"].oneOf(['fade', 'slideDown', 'flyDown', 'slideRight', 'shrink', 'expand', 'slideLeft']),
|
|
27
27
|
needUIPack: _propTypes["default"].bool,
|
|
28
|
-
runOnMount: _propTypes["default"].bool
|
|
29
|
-
onEnterComplete: _propTypes["default"].func,
|
|
30
|
-
onExitComplete: _propTypes["default"].func,
|
|
31
|
-
postEnterStyles: _propTypes["default"].object
|
|
28
|
+
runOnMount: _propTypes["default"].bool
|
|
32
29
|
};
|
|
33
30
|
exports.propTypes = propTypes;
|