@zohodesk/components 1.0.0-temp-40 → 1.0.0-temp-41
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/README.md +33 -20
- package/es/AppContainer/AppContainer.js +3 -6
- package/es/Appearance/dark/themes/blue/blueDarkCTATheme.module.css +33 -33
- package/es/Appearance/dark/themes/blue/blueDarkComponentTheme.module.css +41 -47
- package/es/Appearance/dark/themes/green/greenDarkCTATheme.module.css +32 -32
- package/es/Appearance/dark/themes/green/greenDarkComponentTheme.module.css +40 -46
- package/es/Appearance/dark/themes/orange/orangeDarkCTATheme.module.css +32 -32
- package/es/Appearance/dark/themes/orange/orangeDarkComponentTheme.module.css +40 -46
- package/es/Appearance/dark/themes/red/redDarkCTATheme.module.css +32 -32
- package/es/Appearance/dark/themes/red/redDarkComponentTheme.module.css +40 -46
- package/es/Appearance/dark/themes/yellow/yellowDarkCTATheme.module.css +32 -32
- package/es/Appearance/dark/themes/yellow/yellowDarkComponentTheme.module.css +40 -46
- package/es/Appearance/default/mode/defaultMode.module.css +1 -1
- package/es/Appearance/default/themes/blue/blueDefaultCTATheme.module.css +33 -33
- package/es/Appearance/default/themes/blue/blueDefaultComponentTheme.module.css +41 -47
- package/es/Appearance/default/themes/green/greenDefaultCTATheme.module.css +32 -32
- package/es/Appearance/default/themes/green/greenDefaultComponentTheme.module.css +40 -46
- package/es/Appearance/default/themes/orange/orangeDefaultCTATheme.module.css +32 -32
- package/es/Appearance/default/themes/orange/orangeDefaultComponentTheme.module.css +40 -46
- package/es/Appearance/default/themes/red/redDefaultCTATheme.module.css +32 -32
- package/es/Appearance/default/themes/red/redDefaultComponentTheme.module.css +40 -46
- package/es/Appearance/default/themes/yellow/yellowDefaultCTATheme.module.css +32 -32
- package/es/Appearance/default/themes/yellow/yellowDefaultComponentTheme.module.css +40 -46
- package/es/Avatar/Avatar.js +1 -2
- package/es/Avatar/__tests__/Avatar.spec.js +1 -0
- package/es/AvatarTeam/__tests__/AvatarTeam.spec.js +1 -0
- package/es/Button/__tests__/Button.spec.js +1 -0
- package/es/Buttongroup/__test__/Buttongroup.spec.js +1 -0
- package/es/DateTime/DateTime.js +3 -6
- package/es/DateTime/DateWidget.js +2 -5
- package/es/DateTime/DateWidget.module.css +0 -4
- package/es/DateTime/YearView.js +5 -6
- package/es/DateTime/common.js +2 -9
- package/es/DateTime/dateFormatUtils/dateFormat.js +57 -76
- package/es/DateTime/dateFormatUtils/index.js +7 -12
- package/es/DateTime/dateFormatUtils/timeChange.js +3 -4
- package/es/DateTime/dateFormatUtils/yearChange.js +3 -4
- package/es/DateTime/validator.js +1 -0
- package/es/Label/__tests__/Label.spec.js +2 -0
- package/es/Layout/utils.js +1 -2
- package/es/ListItem/ListItem.js +2 -0
- package/es/ListItem/ListItemWithIcon.js +2 -0
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +10 -15
- package/es/MultiSelect/AdvancedMultiSelect.js +7 -6
- package/es/MultiSelect/AdvancedMultiSelect.module.css +8 -8
- package/es/MultiSelect/MultiSelect.js +10 -15
- package/es/MultiSelect/MultiSelect.module.css +8 -13
- package/es/MultiSelect/MultiSelectWithAvatar.js +6 -3
- package/es/MultiSelect/SelectedOptions.js +3 -2
- package/es/MultiSelect/docs/AdvancedGroupMultiSelect__default.docs.js +1 -2
- package/es/Popup/Popup.js +8 -14
- package/es/Popup/viewPort.js +9 -14
- package/es/Provider/Config.js +2 -1
- package/es/Provider/IdProvider.js +4 -5
- package/es/Provider/LibraryContext.js +5 -6
- package/es/Provider/NumberGenerator/NumberGenerator.js +15 -17
- package/es/Provider/ZindexProvider.js +4 -5
- package/es/Radio/Radio.js +1 -2
- package/es/Radio/Radio.module.css +2 -2
- package/es/Responsive/CustomResponsive.js +8 -11
- package/es/Responsive/ResizeComponent.js +1 -3
- package/es/Responsive/Responsive.js +9 -12
- package/es/Responsive/docs/Responsive__Custom.docs.js +44 -49
- package/es/Responsive/docs/Responsive__default.docs.js +74 -77
- package/es/Responsive/sizeObservers.js +1 -5
- package/es/Ribbon/__tests__/Ribbon.spec.js +1 -0
- package/es/RippleEffect/RippleEffect.js +7 -4
- package/es/RippleEffect/RippleEffect.module.css +3 -0
- package/es/Select/GroupSelect.js +1 -2
- package/es/Select/Select.js +1 -2
- package/es/Select/Select.module.css +1 -1
- package/es/Select/SelectWithAvatar.js +7 -4
- package/es/Select/docs/Select__default.docs.js +1 -2
- package/es/Stencils/__tests__/Stencils.spec.js +1 -0
- package/es/Tab/Tab.js +26 -27
- package/es/Tab/TabContent.js +14 -17
- package/es/Tab/TabContentWrapper.js +14 -17
- package/es/Tab/TabWrapper.js +14 -15
- package/es/Tab/Tabs.js +15 -4
- package/es/Tab/docs/Tab__default.docs.js +1 -0
- package/es/Tag/Tag.js +10 -4
- package/es/Tag/Tag.module.css +14 -11
- package/es/Tag/docs/Tag__default.docs.js +70 -0
- package/es/TextBox/__tests__/TextBox.spec.js +1 -0
- package/es/TextBoxIcon/TextBoxIcon.js +1 -1
- package/es/TextBoxIcon/TextBoxIcon.module.css +5 -2
- package/es/TextBoxIcon/__tests__/TextBoxIcon.spec.js +1 -0
- package/es/Textarea/__tests__/Textarea.spec.js +1 -0
- package/es/Tooltip/Tooltip.js +1 -0
- package/es/a11y/FocusScope/FocusScope.js +4 -10
- package/es/beta/FocusRing/FocusRing.js +1 -4
- package/es/utils/Common.js +11 -31
- package/es/utils/datetime/common.js +3 -6
- package/es/utils/dropDownUtils.js +5 -6
- package/es/utils/getInitial.js +1 -3
- package/lib/AppContainer/AppContainer.js +4 -6
- package/lib/Appearance/dark/themes/blue/blueDarkCTATheme.module.css +33 -33
- package/lib/Appearance/dark/themes/blue/blueDarkComponentTheme.module.css +41 -47
- package/lib/Appearance/dark/themes/green/greenDarkCTATheme.module.css +32 -32
- package/lib/Appearance/dark/themes/green/greenDarkComponentTheme.module.css +40 -46
- package/lib/Appearance/dark/themes/orange/orangeDarkCTATheme.module.css +32 -32
- package/lib/Appearance/dark/themes/orange/orangeDarkComponentTheme.module.css +40 -46
- package/lib/Appearance/dark/themes/red/redDarkCTATheme.module.css +32 -32
- package/lib/Appearance/dark/themes/red/redDarkComponentTheme.module.css +40 -46
- package/lib/Appearance/dark/themes/yellow/yellowDarkCTATheme.module.css +32 -32
- package/lib/Appearance/dark/themes/yellow/yellowDarkComponentTheme.module.css +40 -46
- package/lib/Appearance/default/mode/defaultMode.module.css +1 -1
- package/lib/Appearance/default/themes/blue/blueDefaultCTATheme.module.css +33 -33
- package/lib/Appearance/default/themes/blue/blueDefaultComponentTheme.module.css +41 -47
- package/lib/Appearance/default/themes/green/greenDefaultCTATheme.module.css +32 -32
- package/lib/Appearance/default/themes/green/greenDefaultComponentTheme.module.css +40 -46
- package/lib/Appearance/default/themes/orange/orangeDefaultCTATheme.module.css +32 -32
- package/lib/Appearance/default/themes/orange/orangeDefaultComponentTheme.module.css +40 -46
- package/lib/Appearance/default/themes/red/redDefaultCTATheme.module.css +32 -32
- package/lib/Appearance/default/themes/red/redDefaultComponentTheme.module.css +40 -46
- package/lib/Appearance/default/themes/yellow/yellowDefaultCTATheme.module.css +32 -32
- package/lib/Appearance/default/themes/yellow/yellowDefaultComponentTheme.module.css +40 -46
- package/lib/Card/Card.js +1 -1
- package/lib/Card/index.js +6 -6
- package/lib/DateTime/CalendarView.js +1 -1
- package/lib/DateTime/DateWidget.module.css +0 -4
- package/lib/DateTime/constants.js +1 -1
- package/lib/DateTime/dateFormatUtils/dateFormat.js +2 -2
- package/lib/DateTime/dateFormatUtils/index.js +13 -13
- package/lib/DateTime/objectUtils.js +1 -1
- package/lib/DropDown/DropDown.js +1 -1
- package/lib/Layout/Box.js +1 -1
- package/lib/Layout/Container.js +1 -1
- package/lib/Layout/index.js +4 -4
- package/lib/Layout/utils.js +2 -2
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +7 -4
- package/lib/MultiSelect/AdvancedMultiSelect.js +6 -3
- package/lib/MultiSelect/AdvancedMultiSelect.module.css +8 -8
- package/lib/MultiSelect/MultiSelect.js +7 -4
- package/lib/MultiSelect/MultiSelect.module.css +8 -13
- package/lib/MultiSelect/MultiSelectWithAvatar.js +6 -3
- package/lib/MultiSelect/SelectedOptions.js +3 -2
- package/lib/PopOver/PopOver.js +1 -1
- package/lib/Provider/Config.js +2 -1
- package/lib/Provider/IdProvider.js +3 -3
- package/lib/Provider/NumberGenerator/NumberGenerator.js +1 -1
- package/lib/Provider/ZindexProvider.js +1 -1
- package/lib/Radio/Radio.js +1 -3
- package/lib/Radio/Radio.module.css +2 -2
- package/lib/Responsive/CustomResponsive.js +1 -1
- package/lib/Responsive/Responsive.js +2 -3
- package/lib/Responsive/sizeObservers.js +2 -3
- package/lib/Responsive/utils/index.js +2 -3
- package/lib/RippleEffect/RippleEffect.js +7 -4
- package/lib/RippleEffect/RippleEffect.module.css +3 -0
- package/lib/Select/Select.module.css +1 -1
- package/lib/Select/SelectWithAvatar.js +7 -4
- package/lib/Tab/Tabs.js +13 -2
- package/lib/Tab/index.js +10 -10
- package/lib/Tag/Tag.js +10 -4
- package/lib/Tag/Tag.module.css +14 -11
- package/lib/Tag/docs/Tag__default.docs.js +70 -0
- package/lib/TextBoxIcon/TextBoxIcon.js +1 -1
- package/lib/TextBoxIcon/TextBoxIcon.module.css +5 -2
- package/lib/a11y/FocusScope/FocusScope.js +1 -1
- package/lib/index.js +308 -308
- package/lib/utils/Common.js +16 -20
- package/lib/utils/datetime/common.js +9 -9
- package/lib/utils/dropDownUtils.js +1 -1
- package/package.json +7 -3
- package/preprocess/componentThemeColors.js +119 -0
- package/preprocess/ctaThemeColors.js +95 -0
- package/preprocess/index.js +2 -0
- package/preprocess/json/componentVariableJson.js +259 -0
- package/preprocess/json/ctaVariableJson.js +337 -0
|
@@ -2,14 +2,9 @@
|
|
|
2
2
|
position: relative;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
.disabled {
|
|
6
|
-
|
|
5
|
+
.disabled, .readOnly {
|
|
6
|
+
cursor: not-allowed;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
.readOnly {
|
|
10
|
-
composes: readonly from '../common/common.module.css';
|
|
11
|
-
}
|
|
12
|
-
|
|
13
8
|
.container {
|
|
14
9
|
max-height: var(--zd_size120);
|
|
15
10
|
composes: oflowy from '../common/common.module.css';
|
|
@@ -22,28 +17,28 @@
|
|
|
22
17
|
.borderColor_transparent {
|
|
23
18
|
border-bottom-color: var(--zdt_multiselect_transparent_border);
|
|
24
19
|
}
|
|
25
|
-
.borderColor_transparent:hover {
|
|
20
|
+
.effect .borderColor_transparent:hover {
|
|
26
21
|
border-bottom-color: var(--zdt_multiselect_transparent_hover_border);
|
|
27
22
|
}
|
|
28
|
-
.borderColor_transparent.active {
|
|
23
|
+
.effect .borderColor_transparent.active {
|
|
29
24
|
border-bottom-color: var(--zdt_multiselect_transparent_active_border);
|
|
30
25
|
}
|
|
31
26
|
.borderColor_default {
|
|
32
27
|
border-bottom-color: var(--zdt_multiselect_default_border);
|
|
33
28
|
}
|
|
34
|
-
.borderColor_default:hover {
|
|
29
|
+
.effect .borderColor_default:hover {
|
|
35
30
|
border-bottom-color: var(--zdt_multiselect_default_hover_border);
|
|
36
31
|
}
|
|
37
|
-
.borderColor_default.active {
|
|
32
|
+
.effect .borderColor_default.active {
|
|
38
33
|
border-bottom-color: var(--zdt_multiselect_default_active_border);
|
|
39
34
|
}
|
|
40
35
|
.borderColor_dark {
|
|
41
36
|
border-bottom-color: var(--zdt_multiselect_dark_border);
|
|
42
37
|
}
|
|
43
|
-
.borderColor_dark:hover {
|
|
38
|
+
.effect .borderColor_dark:hover {
|
|
44
39
|
border-bottom-color: var(--zdt_multiselect_dark_hover_border);
|
|
45
40
|
}
|
|
46
|
-
.borderColor_dark.active {
|
|
41
|
+
.effect .borderColor_dark.active {
|
|
47
42
|
border-bottom-color: var(--zdt_multiselect_dark_active_border);
|
|
48
43
|
}
|
|
49
44
|
|
|
@@ -87,7 +87,8 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
87
87
|
a11y,
|
|
88
88
|
children,
|
|
89
89
|
customChildrenClass,
|
|
90
|
-
isBoxPaddingNeed
|
|
90
|
+
isBoxPaddingNeed,
|
|
91
|
+
needEffect
|
|
91
92
|
} = this.props;
|
|
92
93
|
const {
|
|
93
94
|
clearText = 'Clear all'
|
|
@@ -115,7 +116,7 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
115
116
|
const popUpState = !isReadOnly && !isDisabled && !disableAction && isPopupOpen;
|
|
116
117
|
const isShowClearIcon = !isReadOnly && !isDisabled && !disableAction && selectedOptions.length > 1;
|
|
117
118
|
return /*#__PURE__*/React.createElement("div", {
|
|
118
|
-
className: ` ${style.wrapper} ${isDisabled ? style.disabled : ''} ${isReadOnly ? style.readOnly : ''} ${disableAction ? CssProvider('isBlock') : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''}`,
|
|
119
|
+
className: ` ${style.wrapper} ${isDisabled ? style.disabled : ''} ${isReadOnly ? style.readOnly : ''} ${disableAction ? CssProvider('isBlock') : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''}`,
|
|
119
120
|
"data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
|
|
120
121
|
"data-title": isDisabled ? title : '',
|
|
121
122
|
onClick: this.handleInputFocus
|
|
@@ -288,6 +289,7 @@ MultiSelectWithAvatarComponent.propTypes = {
|
|
|
288
289
|
palette: PropTypes.oneOf(['default', 'dark']),
|
|
289
290
|
htmlId: PropTypes.string,
|
|
290
291
|
isBoxPaddingNeed: PropTypes.bool,
|
|
292
|
+
needEffect: PropTypes.bool,
|
|
291
293
|
|
|
292
294
|
/**** Popup props ****/
|
|
293
295
|
isPopupOpen: PropTypes.bool,
|
|
@@ -337,7 +339,8 @@ MultiSelectWithAvatarComponent.defaultProps = {
|
|
|
337
339
|
a11y: {},
|
|
338
340
|
palette: 'default',
|
|
339
341
|
isBoxPaddingNeed: true,
|
|
340
|
-
isSearchClearOnSelect: true
|
|
342
|
+
isSearchClearOnSelect: true,
|
|
343
|
+
needEffect: true
|
|
341
344
|
};
|
|
342
345
|
MultiSelectWithAvatarComponent.displayName = 'MultiSelectWithAvatar';
|
|
343
346
|
const MultiSelectWithAvatar = Popup(MultiSelectWithAvatarComponent);
|
|
@@ -37,13 +37,14 @@ export default class SelectedOptions extends React.PureComponent {
|
|
|
37
37
|
} = option;
|
|
38
38
|
const commonProps = {
|
|
39
39
|
disabled: isDisabled,
|
|
40
|
-
onRemove: isDisabled ? null : onRemove,
|
|
40
|
+
onRemove: isDisabled || isReadOnly ? null : onRemove,
|
|
41
41
|
text: value,
|
|
42
42
|
palette: isDarkPalette,
|
|
43
43
|
onSelectTag: isReadOnly ? null : onSelect,
|
|
44
44
|
getRef: getRef,
|
|
45
45
|
initial: value,
|
|
46
|
-
id: id
|
|
46
|
+
id: id,
|
|
47
|
+
isReadOnly: isReadOnly
|
|
47
48
|
};
|
|
48
49
|
|
|
49
50
|
if (optionType === 'avatar') {
|
|
@@ -39,8 +39,7 @@ export default class AdvancedGroupMultiSelect__default extends React.Component {
|
|
|
39
39
|
return Promise.resolve();
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
handleSelectOptions() {
|
|
43
|
-
let selectedGroupOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
42
|
+
handleSelectOptions(selectedGroupOptions = []) {
|
|
44
43
|
this.setState({
|
|
45
44
|
selectedGroupOptions
|
|
46
45
|
});
|
package/es/Popup/Popup.js
CHANGED
|
@@ -40,17 +40,13 @@ const defaultState = {
|
|
|
40
40
|
|
|
41
41
|
/* eslint-disable react/prop-types */
|
|
42
42
|
|
|
43
|
-
const Popup = function (Component
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
scrollDebounceTime: popupScrollDebounceTime = 0,
|
|
51
|
-
closeOnScroll: closeOnScrollPopup = false
|
|
52
|
-
} = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
53
|
-
|
|
43
|
+
const Popup = function (Component, group = 'global', needResizeHandling = true, {
|
|
44
|
+
isAbsolutePositioningNeeded: isAbsolutePopup = true,
|
|
45
|
+
isArrow: needPopupArrow = false,
|
|
46
|
+
customOrder: customPositionOrder = [],
|
|
47
|
+
scrollDebounceTime: popupScrollDebounceTime = 0,
|
|
48
|
+
closeOnScroll: closeOnScrollPopup = false
|
|
49
|
+
} = {}) {
|
|
54
50
|
class Popup extends React.Component {
|
|
55
51
|
constructor(props) {
|
|
56
52
|
super(props);
|
|
@@ -416,9 +412,7 @@ const Popup = function (Component) {
|
|
|
416
412
|
e && e.nativeEvent && e.nativeEvent.stopImmediatePropagation && e.nativeEvent.stopImmediatePropagation();
|
|
417
413
|
}
|
|
418
414
|
|
|
419
|
-
handlePopupPosition() {
|
|
420
|
-
let defaultPosition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'bottomCenter';
|
|
421
|
-
let isResizeHandling = arguments.length > 1 ? arguments[1] : undefined;
|
|
415
|
+
handlePopupPosition(defaultPosition = 'bottomCenter', isResizeHandling) {
|
|
422
416
|
// isResizeHandling --->>> Window resize and dropBox resize
|
|
423
417
|
const {
|
|
424
418
|
direction
|
package/es/Popup/viewPort.js
CHANGED
|
@@ -77,12 +77,10 @@ let viewPort = {
|
|
|
77
77
|
getViewPortEle: el => {
|
|
78
78
|
return el.closest('[data-viewport-container=true]') ? el.closest('[data-viewport-container=true]') : document.documentElement;
|
|
79
79
|
},
|
|
80
|
-
possibilities:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
} = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
85
|
-
|
|
80
|
+
possibilities: (el, relativeBox, customFrame, {
|
|
81
|
+
needArrow,
|
|
82
|
+
isAbsolute
|
|
83
|
+
} = {}) => {
|
|
86
84
|
if (!el) {
|
|
87
85
|
return;
|
|
88
86
|
}
|
|
@@ -303,14 +301,11 @@ let viewPort = {
|
|
|
303
301
|
bottom: relativeBoxGap.center.bottom - rectGap.bottom
|
|
304
302
|
};
|
|
305
303
|
},
|
|
306
|
-
betterView:
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
isAbsolute,
|
|
312
|
-
customOrder = []
|
|
313
|
-
} = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
304
|
+
betterView: (popup, relativeBox, defaultView = '', customFrame, {
|
|
305
|
+
needArrow,
|
|
306
|
+
isAbsolute,
|
|
307
|
+
customOrder = []
|
|
308
|
+
} = {}) => {
|
|
314
309
|
let customScrollFrame = isAbsolute ? customFrame : '';
|
|
315
310
|
let viewPortPossibilities = viewPort.possibilities(popup, relativeBox, customScrollFrame, {
|
|
316
311
|
needArrow,
|
package/es/Provider/Config.js
CHANGED
|
@@ -30,11 +30,10 @@ function getDeletedIndexes() {
|
|
|
30
30
|
return deletedIndexes;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
function callback(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} = _ref;
|
|
33
|
+
function callback({
|
|
34
|
+
globalId,
|
|
35
|
+
deletedIndexes
|
|
36
|
+
}) {
|
|
38
37
|
setGlobalId(globalId);
|
|
39
38
|
setDeletedIndexes(deletedIndexes);
|
|
40
39
|
}
|
|
@@ -3,12 +3,11 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import LibraryContextInit from './LibraryContextInit';
|
|
4
4
|
import { getLibraryConfig } from './Config';
|
|
5
5
|
|
|
6
|
-
const LibraryContextProvider =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} = _ref;
|
|
6
|
+
const LibraryContextProvider = ({
|
|
7
|
+
isReducedMotion = getLibraryConfig('isReducedMotion'),
|
|
8
|
+
direction = getLibraryConfig('direction'),
|
|
9
|
+
children
|
|
10
|
+
}) => {
|
|
12
11
|
const [value, setValue] = useState({
|
|
13
12
|
isReducedMotion,
|
|
14
13
|
direction
|
|
@@ -50,14 +50,13 @@ export function decreaseGlobalIds(numbers, deletedIndexes, globalId) {
|
|
|
50
50
|
deletedIndexes
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
export function useNumberGenerator(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
} = _ref;
|
|
53
|
+
export function useNumberGenerator({
|
|
54
|
+
getGlobalId,
|
|
55
|
+
prefix,
|
|
56
|
+
getGlobalPrefix,
|
|
57
|
+
getDeletedIndexes,
|
|
58
|
+
callback
|
|
59
|
+
}) {
|
|
61
60
|
let presentValues = useRef([]),
|
|
62
61
|
presentIndex = useRef(0);
|
|
63
62
|
prefix = typeof prefix === 'undefined' ? '' : `${prefix}_`;
|
|
@@ -84,15 +83,14 @@ export function useNumberGenerator(_ref) {
|
|
|
84
83
|
presentIndex.current = -1;
|
|
85
84
|
return getNextId;
|
|
86
85
|
}
|
|
87
|
-
export function getNumberGenerators(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
} = _ref2;
|
|
86
|
+
export function getNumberGenerators({
|
|
87
|
+
Component,
|
|
88
|
+
prefix,
|
|
89
|
+
getGlobalPrefix,
|
|
90
|
+
getGlobalId,
|
|
91
|
+
getDeletedIndexes,
|
|
92
|
+
callback
|
|
93
|
+
}) {
|
|
96
94
|
let presentIndex = 0,
|
|
97
95
|
presentValues = [],
|
|
98
96
|
{
|
|
@@ -27,11 +27,10 @@ function getDeletedIndexes() {
|
|
|
27
27
|
return deletedIndexes;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
function callback(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
} = _ref;
|
|
30
|
+
function callback({
|
|
31
|
+
globalId,
|
|
32
|
+
deletedIndexes
|
|
33
|
+
}) {
|
|
35
34
|
setInitialZIndex(globalId);
|
|
36
35
|
setDeletedIndexes(deletedIndexes);
|
|
37
36
|
}
|
package/es/Radio/Radio.js
CHANGED
|
@@ -3,7 +3,6 @@ import React from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import Label from '../Label/Label';
|
|
5
5
|
import { Container, Box } from '../Layout';
|
|
6
|
-
import CssProvider from '../Provider/CssProvider';
|
|
7
6
|
import style from './Radio.module.css';
|
|
8
7
|
export default class Radio extends React.Component {
|
|
9
8
|
constructor(props) {
|
|
@@ -45,7 +44,7 @@ export default class Radio extends React.Component {
|
|
|
45
44
|
customRadio = '',
|
|
46
45
|
customLabel = ''
|
|
47
46
|
} = customClass;
|
|
48
|
-
let accessMode = isReadOnly ? style.readonly : disabled ?
|
|
47
|
+
let accessMode = isReadOnly ? style.readonly : disabled ? style.disabled : style.pointer;
|
|
49
48
|
let toolTip = disabled ? disabledTitle : title ? title : null;
|
|
50
49
|
let {
|
|
51
50
|
ariaHidden,
|
|
@@ -98,9 +98,7 @@ ResponsiveSender.propTypes = {
|
|
|
98
98
|
domRefKey: PropTypes.string,
|
|
99
99
|
responsiveId: PropTypes.string
|
|
100
100
|
};
|
|
101
|
-
export function useResponsiveReceiver() {
|
|
102
|
-
let responsiveId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultResponsiveId;
|
|
103
|
-
let query = arguments.length > 1 ? arguments[1] : undefined;
|
|
101
|
+
export function useResponsiveReceiver(responsiveId = defaultResponsiveId, query) {
|
|
104
102
|
const [, forceUpdate] = useState();
|
|
105
103
|
const totalContextData = useContext(ResponsiveContext);
|
|
106
104
|
const validSizeContextData = totalContextData[validSizeResponsiveId];
|
|
@@ -172,14 +170,13 @@ export function useResponsiveReceiver() {
|
|
|
172
170
|
updateLatestData();
|
|
173
171
|
return data.current;
|
|
174
172
|
}
|
|
175
|
-
export function ResponsiveReceiver(
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
} = _ref;
|
|
173
|
+
export function ResponsiveReceiver({
|
|
174
|
+
children,
|
|
175
|
+
responsiveId,
|
|
176
|
+
query,
|
|
177
|
+
eleRef,
|
|
178
|
+
domRefKey
|
|
179
|
+
}) {
|
|
183
180
|
const data = useResponsiveReceiver(responsiveId, query);
|
|
184
181
|
const child = children(data);
|
|
185
182
|
return eleRef ? /*#__PURE__*/React.createElement(DOMRefWrapper, {
|
|
@@ -163,9 +163,7 @@ export default class ResizeComponent extends React.Component {
|
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
constructChildren() {
|
|
167
|
-
let dataCount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
168
|
-
let responsive = arguments.length > 1 ? arguments[1] : undefined;
|
|
166
|
+
constructChildren(dataCount = 0, responsive) {
|
|
169
167
|
const {
|
|
170
168
|
childrenList,
|
|
171
169
|
getData
|
|
@@ -102,8 +102,7 @@ ResponsiveSender.propTypes = {
|
|
|
102
102
|
responsiveId: PropTypes.string // matcher: PropTypes.func
|
|
103
103
|
|
|
104
104
|
};
|
|
105
|
-
export function useResponsiveReceiver() {
|
|
106
|
-
let responsiveId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultResponsiveId;
|
|
105
|
+
export function useResponsiveReceiver(responsiveId = defaultResponsiveId) {
|
|
107
106
|
const [_, forceUpdate] = useState();
|
|
108
107
|
let totalContextData = useContext(ResponsiveContext);
|
|
109
108
|
let contextData = totalContextData[responsiveId] || totalContextData[defaultResponsiveId]; // NOTE: this for fallback of if responsive receiver id wrong
|
|
@@ -150,8 +149,7 @@ export function useResponsiveReceiver() {
|
|
|
150
149
|
return value1 <= width && value2 >= width || breakPoint1 === breakPoint || breakPoint2 === breakPoint;
|
|
151
150
|
},
|
|
152
151
|
|
|
153
|
-
deviceOnly() {
|
|
154
|
-
let breakPoints = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
152
|
+
deviceOnly(breakPoints = []) {
|
|
155
153
|
return breakPoints.includes(breakPoint);
|
|
156
154
|
},
|
|
157
155
|
|
|
@@ -176,14 +174,13 @@ export function useResponsiveReceiver() {
|
|
|
176
174
|
// ) : null;
|
|
177
175
|
// }
|
|
178
176
|
|
|
179
|
-
export function ResponsiveReceiver(
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
} = _ref;
|
|
177
|
+
export function ResponsiveReceiver({
|
|
178
|
+
children,
|
|
179
|
+
responsiveId,
|
|
180
|
+
hiddenSizes,
|
|
181
|
+
eleRef,
|
|
182
|
+
domRefKey
|
|
183
|
+
}) {
|
|
187
184
|
const data = useResponsiveReceiver(responsiveId);
|
|
188
185
|
const {
|
|
189
186
|
breakPoint
|
|
@@ -5,10 +5,9 @@ import Radio from '../../Radio/Radio'; // eslint-disable-next-line css-modules/n
|
|
|
5
5
|
|
|
6
6
|
import style from './style.module.css'; // eslint-disable-next-line react/prop-types
|
|
7
7
|
|
|
8
|
-
function WindowSizeBar(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} = _ref;
|
|
8
|
+
function WindowSizeBar({
|
|
9
|
+
isTouchDevice
|
|
10
|
+
}) {
|
|
12
11
|
let [{
|
|
13
12
|
windowWidth,
|
|
14
13
|
windowHeight
|
|
@@ -45,12 +44,11 @@ export default class Responsive__Custom extends React.Component {
|
|
|
45
44
|
this.switchToOr = this.handleMethodChange.bind(this, 'orFunction');
|
|
46
45
|
}
|
|
47
46
|
|
|
48
|
-
customQuery(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
} = _ref2;
|
|
47
|
+
customQuery({
|
|
48
|
+
mediaQueryOR,
|
|
49
|
+
mediaQueryAND,
|
|
50
|
+
isTouchDevice
|
|
51
|
+
}) {
|
|
54
52
|
const {
|
|
55
53
|
method
|
|
56
54
|
} = this.state;
|
|
@@ -154,45 +152,42 @@ export default class Responsive__Custom extends React.Component {
|
|
|
154
152
|
} = this.state;
|
|
155
153
|
return /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(ResponsiveSender, null, /*#__PURE__*/React.createElement(ResponsiveReceiver, {
|
|
156
154
|
query: this.customQuery
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
className: ` ${style.box} ${isQureyMatched ? style.selected : ''} `
|
|
194
|
-
}, "minWidth: 700, maxWidth: 800 || minHeight: 700, maxHeight: 800"))));
|
|
195
|
-
})));
|
|
155
|
+
}, ({
|
|
156
|
+
isQureyMatched,
|
|
157
|
+
isTouchDevice
|
|
158
|
+
}) => /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(WindowSizeBar, {
|
|
159
|
+
isTouchDevice: isTouchDevice
|
|
160
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
161
|
+
flexible: true,
|
|
162
|
+
scroll: "vertical"
|
|
163
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
164
|
+
isCover: false,
|
|
165
|
+
alignBox: "row",
|
|
166
|
+
align: "vertical",
|
|
167
|
+
wrap: "wrap"
|
|
168
|
+
}, /*#__PURE__*/React.createElement(Radio, {
|
|
169
|
+
text: "AND Function",
|
|
170
|
+
onChange: this.switchToAnd,
|
|
171
|
+
name: "AndFunction",
|
|
172
|
+
checked: method === 'AndFunction'
|
|
173
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
174
|
+
style: {
|
|
175
|
+
margin: '20px'
|
|
176
|
+
}
|
|
177
|
+
}, /*#__PURE__*/React.createElement(Radio, {
|
|
178
|
+
text: "OR Function",
|
|
179
|
+
onChange: this.switchToOr,
|
|
180
|
+
name: "orFunction",
|
|
181
|
+
checked: method === 'orFunction'
|
|
182
|
+
}))), /*#__PURE__*/React.createElement(Container, {
|
|
183
|
+
isCover: false,
|
|
184
|
+
alignBox: "row",
|
|
185
|
+
align: "both",
|
|
186
|
+
wrap: "wrap"
|
|
187
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
188
|
+
shrink: true,
|
|
189
|
+
className: ` ${style.box} ${isQureyMatched ? style.selected : ''} `
|
|
190
|
+
}, "minWidth: 700, maxWidth: 800 || minHeight: 700, maxHeight: 800")))))));
|
|
196
191
|
}
|
|
197
192
|
|
|
198
193
|
}
|