@zohodesk/components 1.0.0-temp-199.18 → 1.0.0-temp-242.1
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 +31 -1
- package/es/AppContainer/AppContainer.js +1 -0
- package/es/AppContainer/AppContainer.module.css +3 -2
- package/es/Button/css/Button.module.css +13 -4
- package/es/ColorSelect/ColorSingleSelect.js +0 -1
- package/es/ColorSelect/__tests__/ColorMultiSelect.spec.js +15 -3
- package/es/ColorSelect/__tests__/ColorSingleSelect.spec.js +15 -3
- package/es/ColorSelect/__tests__/__snapshots__/ColorMultiSelect.spec.js.snap +2 -2
- package/es/ColorSelect/__tests__/__snapshots__/ColorSingleSelect.spec.js.snap +8 -8
- package/es/ColorSelect/_shared/ColorIndicator/ColorIndicator.js +7 -3
- package/es/ColorSelect/_shared/ColorIndicator/__tests__/ColorIndicator.spec.js +17 -4
- package/es/ColorSelect/_shared/ColorIndicator/__tests__/__snapshots__/ColorIndicator.spec.js.snap +3 -3
- package/es/ColorSelect/_shared/ColorIndicator/props/propTypes.js +1 -1
- package/es/ColorSelect/_shared/ColoredTag/props/propTypes.js +1 -0
- package/es/ColorSelect/_shared/helpers/renderHelpers.js +14 -10
- package/es/ColorSelect/props/propTypes.js +1 -0
- package/es/DateTime/DateTime.module.css +12 -9
- package/es/DateTime/YearView.module.css +1 -1
- package/es/DropBox/DropBoxElement/DropBoxElement.js +1 -1
- package/es/DropBox/utils/isMobilePopover.js +3 -14
- package/es/Heading/Heading.module.css +1 -1
- package/es/Label/Label.module.css +8 -8
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +2 -6
- package/es/MultiSelect/MultiSelect.js +2 -2
- package/es/MultiSelect/MultiSelect.module.css +1 -1
- package/es/MultiSelect/Suggestions.js +2 -7
- package/es/MultiSelect/props/defaultProps.js +0 -2
- package/es/MultiSelect/props/propTypes.js +3 -11
- package/es/Popup/Popup.js +21 -1045
- package/es/Select/GroupSelect.js +1 -1
- package/es/Select/SelectWithAvatar.js +3 -3
- package/es/Select/SelectWithIcon.js +3 -10
- package/es/Select/props/defaultProps.js +2 -4
- package/es/Select/props/propTypes.js +3 -11
- package/es/Tab/Tabs.module.css +1 -1
- package/es/TextBox/TextBox.module.css +4 -4
- package/es/TextBoxIcon/TextBoxIcon.module.css +0 -6
- package/es/Textarea/Textarea.module.css +1 -1
- package/es/Tooltip/Tooltip.module.css +1 -1
- package/es/Typography/Typography.js +9 -2
- package/es/Typography/__tests__/Typography.spec.js +427 -0
- package/es/Typography/__tests__/__snapshots__/Typography.spec.js.snap +506 -0
- package/es/Typography/css/Typography.module.css +4 -4
- package/es/Typography/props/defaultProps.js +2 -1
- package/es/Typography/props/propTypes.js +24 -5
- package/es/Typography/utils/textHighlighter.js +139 -0
- package/es/common/basic.module.css +39 -6
- package/es/common/basicReset.module.css +2 -2
- package/es/common/common.module.css +6 -6
- package/es/shared/ArrowIcon/ArrowIcon.js +6 -3
- package/es/shared/ArrowIcon/ArrowIcon.module.css +9 -0
- package/es/shared/ArrowIcon/__tests__/ArrowIcon.spec.js +24 -0
- package/es/shared/ArrowIcon/__tests__/__snapshots__/ArrowIcon.spec.js.snap +70 -7
- package/es/shared/ArrowIcon/props/defaultProps.js +2 -0
- package/es/shared/ArrowIcon/props/propTypes.js +3 -1
- package/es/shared/InputFieldLine/InputFieldLine.module.css +1 -1
- package/es/utils/Common.js +1 -1
- package/es/utils/dropDownUtils.js +3 -3
- package/es/v1/Popup/Popup.js +1 -1
- package/es/v1/Tab/v1Tabs.module.css +1 -1
- package/es/v1/Typography/css/v1_Typography.module.css +4 -4
- package/lib/AppContainer/AppContainer.js +2 -0
- package/lib/AppContainer/AppContainer.module.css +3 -2
- package/lib/Button/css/Button.module.css +13 -4
- package/lib/ColorSelect/ColorSingleSelect.js +1 -2
- package/lib/ColorSelect/__tests__/ColorMultiSelect.spec.js +15 -3
- package/lib/ColorSelect/__tests__/ColorSingleSelect.spec.js +15 -3
- package/lib/ColorSelect/__tests__/__snapshots__/ColorMultiSelect.spec.js.snap +2 -2
- package/lib/ColorSelect/__tests__/__snapshots__/ColorSingleSelect.spec.js.snap +8 -8
- package/lib/ColorSelect/_shared/ColorIndicator/ColorIndicator.js +10 -4
- package/lib/ColorSelect/_shared/ColorIndicator/__tests__/ColorIndicator.spec.js +17 -4
- package/lib/ColorSelect/_shared/ColorIndicator/__tests__/__snapshots__/ColorIndicator.spec.js.snap +3 -3
- package/lib/ColorSelect/_shared/ColorIndicator/props/propTypes.js +1 -1
- package/lib/ColorSelect/_shared/ColoredTag/props/propTypes.js +1 -0
- package/lib/ColorSelect/_shared/helpers/renderHelpers.js +19 -13
- package/lib/ColorSelect/props/propTypes.js +1 -0
- package/lib/DateTime/DateTime.module.css +12 -9
- package/lib/DateTime/YearView.module.css +1 -1
- package/lib/DropBox/DropBoxElement/DropBoxElement.js +5 -5
- package/lib/DropBox/utils/isMobilePopover.js +4 -14
- package/lib/Heading/Heading.module.css +1 -1
- package/lib/Label/Label.module.css +8 -8
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +3 -8
- package/lib/MultiSelect/MultiSelect.js +2 -2
- package/lib/MultiSelect/MultiSelect.module.css +1 -1
- package/lib/MultiSelect/Suggestions.js +2 -6
- package/lib/MultiSelect/props/defaultProps.js +0 -2
- package/lib/MultiSelect/props/propTypes.js +5 -13
- package/lib/Popup/Popup.js +25 -1152
- package/lib/Select/GroupSelect.js +1 -2
- package/lib/Select/SelectWithAvatar.js +3 -4
- package/lib/Select/SelectWithIcon.js +3 -10
- package/lib/Select/props/defaultProps.js +3 -5
- package/lib/Select/props/propTypes.js +3 -11
- package/lib/Tab/Tabs.module.css +1 -1
- package/lib/TextBox/TextBox.module.css +4 -4
- package/lib/TextBoxIcon/TextBoxIcon.module.css +0 -6
- package/lib/Textarea/Textarea.module.css +1 -1
- package/lib/Tooltip/Tooltip.module.css +1 -1
- package/lib/Typography/Typography.js +9 -2
- package/lib/Typography/__tests__/Typography.spec.js +436 -0
- package/lib/Typography/__tests__/__snapshots__/Typography.spec.js.snap +506 -0
- package/lib/Typography/css/Typography.module.css +4 -4
- package/lib/Typography/props/defaultProps.js +2 -1
- package/lib/Typography/props/propTypes.js +31 -6
- package/lib/Typography/utils/textHighlighter.js +160 -0
- package/lib/common/basic.module.css +39 -6
- package/lib/common/basicReset.module.css +2 -2
- package/lib/common/common.module.css +6 -6
- package/lib/shared/ArrowIcon/ArrowIcon.js +6 -3
- package/lib/shared/ArrowIcon/ArrowIcon.module.css +9 -0
- package/lib/shared/ArrowIcon/__tests__/ArrowIcon.spec.js +34 -10
- package/lib/shared/ArrowIcon/__tests__/__snapshots__/ArrowIcon.spec.js.snap +70 -7
- package/lib/shared/ArrowIcon/props/defaultProps.js +2 -0
- package/lib/shared/ArrowIcon/props/propTypes.js +3 -1
- package/lib/shared/InputFieldLine/InputFieldLine.module.css +1 -1
- package/lib/utils/Common.js +1 -1
- package/lib/utils/dropDownUtils.js +3 -3
- package/lib/v1/Popup/Popup.js +1 -1
- package/lib/v1/Tab/v1Tabs.module.css +1 -1
- package/lib/v1/Typography/css/v1_Typography.module.css +4 -4
- package/package.json +6 -6
- package/es/DropBox/DropBoxPositionMapping.js +0 -142
- package/es/Popup/PositionMapping.js +0 -72
- package/es/Popup/Registry.js +0 -36
- package/es/Popup/intersectionObserver.js +0 -49
- package/es/Popup/viewPort.js +0 -373
- package/lib/DropBox/DropBoxPositionMapping.js +0 -149
- package/lib/Popup/PositionMapping.js +0 -81
- package/lib/Popup/Registry.js +0 -46
- package/lib/Popup/intersectionObserver.js +0 -72
- package/lib/Popup/viewPort.js +0 -367
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.highlightText = highlightText;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _cssJSLogic2 = _interopRequireDefault(require("../css/cssJSLogic"));
|
|
11
|
+
|
|
12
|
+
var _utils = require("@zohodesk/utils");
|
|
13
|
+
|
|
14
|
+
var _TypographyModule = _interopRequireDefault(require("./../css/Typography.module.css"));
|
|
15
|
+
|
|
16
|
+
var _Common = require("../../utils/Common");
|
|
17
|
+
|
|
18
|
+
var _excluded = ["customStyle"];
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
+
|
|
22
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
23
|
+
|
|
24
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
25
|
+
|
|
26
|
+
function highlightText(config) {
|
|
27
|
+
var sourceText = config.text,
|
|
28
|
+
highlightData = config.data,
|
|
29
|
+
_config$styleConfigur = config.styleConfiguration,
|
|
30
|
+
highlightStyleConfig = _config$styleConfigur === void 0 ? _Common.DUMMY_OBJECT : _config$styleConfigur,
|
|
31
|
+
_config$shouldExclude = config.shouldExcludeIndices,
|
|
32
|
+
shouldExcludeIndices = _config$shouldExclude === void 0 ? false : _config$shouldExclude,
|
|
33
|
+
_config$isCaseSensiti = config.isCaseSensitive,
|
|
34
|
+
enableCaseSensitiveMatch = _config$isCaseSensiti === void 0 ? false : _config$isCaseSensiti,
|
|
35
|
+
_config$isWholeWord = config.isWholeWord,
|
|
36
|
+
matchWholeWordOnly = _config$isWholeWord === void 0 ? false : _config$isWholeWord,
|
|
37
|
+
_config$tagName = config.tagName,
|
|
38
|
+
wrapperTagName = _config$tagName === void 0 ? 'span' : _config$tagName,
|
|
39
|
+
customRenderer = config.renderHighlight;
|
|
40
|
+
|
|
41
|
+
if (!sourceText || !(highlightData !== null && highlightData !== void 0 && highlightData.length)) {
|
|
42
|
+
return sourceText;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
var cssClassCache = new Map();
|
|
46
|
+
var normalizedHighlightTerms = highlightData.map(function (highlightItem) {
|
|
47
|
+
var searchTerm = typeof highlightItem === 'string' ? highlightItem : highlightItem === null || highlightItem === void 0 ? void 0 : highlightItem.text;
|
|
48
|
+
if (!searchTerm) return null;
|
|
49
|
+
var itemConfiguration = typeof highlightItem === 'string' ? _Common.DUMMY_OBJECT : highlightItem;
|
|
50
|
+
var hasStyleConfigrationFromItem = itemConfiguration.styleConfiguration !== undefined;
|
|
51
|
+
var hasRenderHighlightFromItem = itemConfiguration.renderHighlight !== undefined;
|
|
52
|
+
var finalStyleConfig = itemConfiguration.styleConfiguration !== undefined ? itemConfiguration.styleConfiguration : highlightStyleConfig;
|
|
53
|
+
|
|
54
|
+
var customStyle = finalStyleConfig.customStyle,
|
|
55
|
+
restStyleConfig = _objectWithoutProperties(finalStyleConfig, _excluded);
|
|
56
|
+
|
|
57
|
+
var cacheKey = JSON.stringify(restStyleConfig);
|
|
58
|
+
var typographyClass;
|
|
59
|
+
|
|
60
|
+
if (Object.keys(restStyleConfig).length !== 0) {
|
|
61
|
+
if (cssClassCache.has(cacheKey)) {
|
|
62
|
+
typographyClass = cssClassCache.get(cacheKey);
|
|
63
|
+
} else {
|
|
64
|
+
var _cssJSLogic = (0, _cssJSLogic2["default"])({
|
|
65
|
+
props: restStyleConfig,
|
|
66
|
+
style: _TypographyModule["default"]
|
|
67
|
+
}),
|
|
68
|
+
computedClass = _cssJSLogic.typographyClass;
|
|
69
|
+
|
|
70
|
+
typographyClass = computedClass;
|
|
71
|
+
cssClassCache.set(cacheKey, typographyClass);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return {
|
|
76
|
+
searchTerm: searchTerm,
|
|
77
|
+
targetIndices: itemConfiguration.index !== undefined ? itemConfiguration.index : _Common.DUMMY_ARRAY,
|
|
78
|
+
shouldExcludeIndices: itemConfiguration.shouldExcludeIndices !== undefined ? itemConfiguration.shouldExcludeIndices : shouldExcludeIndices,
|
|
79
|
+
isCaseSensitive: itemConfiguration.isCaseSensitive !== undefined ? itemConfiguration.isCaseSensitive : enableCaseSensitiveMatch,
|
|
80
|
+
matchWholeWordOnly: itemConfiguration.isWholeWord !== undefined ? itemConfiguration.isWholeWord : matchWholeWordOnly,
|
|
81
|
+
wrapperTagName: itemConfiguration.tagName !== undefined ? itemConfiguration.tagName : wrapperTagName,
|
|
82
|
+
customStyle: customStyle,
|
|
83
|
+
customRenderer: itemConfiguration.renderHighlight !== undefined ? itemConfiguration.renderHighlight : customRenderer,
|
|
84
|
+
highlightClasses: typographyClass,
|
|
85
|
+
hasStyleConfigrationFromItem: hasStyleConfigrationFromItem,
|
|
86
|
+
hasRenderHighlightFromItem: hasRenderHighlightFromItem
|
|
87
|
+
};
|
|
88
|
+
}).filter(function (highlightConfig) {
|
|
89
|
+
return highlightConfig && highlightConfig.searchTerm.trim();
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
if (!normalizedHighlightTerms.length) {
|
|
93
|
+
return sourceText;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
var regexPatterns = normalizedHighlightTerms.map(function (highlightConfig) {
|
|
97
|
+
// Escape special regex characters in the searchTerm so it can be safely used in a RegExp
|
|
98
|
+
var escapedTerm = highlightConfig.searchTerm.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // If matchWholeWordOnly is true, wrap the term with word boundaries (\b) to match whole words only
|
|
99
|
+
|
|
100
|
+
return highlightConfig.matchWholeWordOnly ? "\\b".concat(escapedTerm, "\\b") : escapedTerm;
|
|
101
|
+
});
|
|
102
|
+
var combinedRegexPattern = regexPatterns.join('|');
|
|
103
|
+
var textSegments = sourceText.split(new RegExp("(".concat(combinedRegexPattern, ")"), 'gi'));
|
|
104
|
+
var occurrenceCountByTerm = {};
|
|
105
|
+
return textSegments.map(function (textSegment, segmentIndex) {
|
|
106
|
+
var matchingHighlightConfig = normalizedHighlightTerms.find(function (highlightConfig) {
|
|
107
|
+
var segmentToCompare = highlightConfig.isCaseSensitive ? textSegment : textSegment.toLowerCase();
|
|
108
|
+
var termToCompare = highlightConfig.isCaseSensitive ? highlightConfig.searchTerm : highlightConfig.searchTerm.toLowerCase();
|
|
109
|
+
return segmentToCompare === termToCompare;
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
if (!matchingHighlightConfig) {
|
|
113
|
+
return textSegment;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
var termKey = matchingHighlightConfig.searchTerm;
|
|
117
|
+
occurrenceCountByTerm[termKey] = (occurrenceCountByTerm[termKey] || 0) + 1;
|
|
118
|
+
var currentOccurrenceIndex = occurrenceCountByTerm[termKey];
|
|
119
|
+
var targetIndices = matchingHighlightConfig.targetIndices,
|
|
120
|
+
shouldExcludeIndices = matchingHighlightConfig.shouldExcludeIndices;
|
|
121
|
+
var isIndicesArray = Array.isArray(targetIndices);
|
|
122
|
+
var shouldApplyHighlight;
|
|
123
|
+
|
|
124
|
+
if (isIndicesArray) {
|
|
125
|
+
shouldApplyHighlight = (targetIndices.length === 0 || targetIndices.includes(currentOccurrenceIndex)) !== shouldExcludeIndices;
|
|
126
|
+
} else {
|
|
127
|
+
shouldApplyHighlight = (targetIndices === 0 || targetIndices === currentOccurrenceIndex) !== shouldExcludeIndices;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (!shouldApplyHighlight) {
|
|
131
|
+
return textSegment;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
var customStyle = matchingHighlightConfig.customStyle,
|
|
135
|
+
highlightClasses = matchingHighlightConfig.highlightClasses,
|
|
136
|
+
customRenderer = matchingHighlightConfig.customRenderer,
|
|
137
|
+
hasStyleConfigrationFromItem = matchingHighlightConfig.hasStyleConfigrationFromItem,
|
|
138
|
+
hasRenderHighlightFromItem = matchingHighlightConfig.hasRenderHighlightFromItem,
|
|
139
|
+
WrapperTag = matchingHighlightConfig.wrapperTagName;
|
|
140
|
+
var shouldUseCustomRenderer = false;
|
|
141
|
+
|
|
142
|
+
if (customRenderer) {
|
|
143
|
+
if (hasRenderHighlightFromItem) {
|
|
144
|
+
shouldUseCustomRenderer = true;
|
|
145
|
+
} else if (!hasStyleConfigrationFromItem && customRenderer) {
|
|
146
|
+
shouldUseCustomRenderer = true;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (shouldUseCustomRenderer && (0, _utils.isRenderable)(customRenderer)) {
|
|
151
|
+
return (0, _utils.renderNode)(customRenderer, textSegment);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return /*#__PURE__*/_react["default"].createElement(WrapperTag, {
|
|
155
|
+
key: "".concat(textSegment, "_").concat(currentOccurrenceIndex),
|
|
156
|
+
style: customStyle,
|
|
157
|
+
className: highlightClasses
|
|
158
|
+
}, textSegment);
|
|
159
|
+
});
|
|
160
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
@font-face {
|
|
2
|
-
font-family:
|
|
3
|
-
src: url('https://static.zohocdn.com/webfonts/
|
|
4
|
-
font-weight:
|
|
2
|
+
font-family: Light;
|
|
3
|
+
src: url('https://static.zohocdn.com/webfonts/lato2light/font.woff2') format('woff2');
|
|
4
|
+
font-weight: 300;
|
|
5
5
|
font-style: normal;
|
|
6
6
|
font-display: swap;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
@font-face {
|
|
10
|
-
font-family:
|
|
11
|
-
src: url('https://static.zohocdn.com/webfonts/
|
|
12
|
-
font-weight:
|
|
10
|
+
font-family: Regular;
|
|
11
|
+
src: url('https://static.zohocdn.com/webfonts/lato2regular/font.woff2') format('woff2');
|
|
12
|
+
font-weight: 400;
|
|
13
13
|
font-style: normal;
|
|
14
14
|
font-display: swap;
|
|
15
15
|
}
|
|
@@ -29,3 +29,36 @@
|
|
|
29
29
|
font-style: normal;
|
|
30
30
|
font-display: swap;
|
|
31
31
|
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@font-face {
|
|
35
|
+
font-family: ZDLato;
|
|
36
|
+
src: url('https://static.zohocdn.com/webfonts/lato2light/font.woff2') format('woff2');
|
|
37
|
+
font-weight: 100 300;
|
|
38
|
+
font-style: normal;
|
|
39
|
+
font-display: swap;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@font-face {
|
|
43
|
+
font-family: ZDLato;
|
|
44
|
+
src: url('https://static.zohocdn.com/webfonts/lato2regular/font.woff2') format('woff2');
|
|
45
|
+
font-weight: 400;
|
|
46
|
+
font-style: normal;
|
|
47
|
+
font-display: swap;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@font-face {
|
|
51
|
+
font-family: ZDLato;
|
|
52
|
+
src: url('https://static.zohocdn.com/webfonts/lato2semibold/font.woff2') format('woff2');
|
|
53
|
+
font-weight: 500 600;
|
|
54
|
+
font-style: normal;
|
|
55
|
+
font-display: swap;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@font-face {
|
|
59
|
+
font-family: ZDLato;
|
|
60
|
+
src: url('https://static.zohocdn.com/webfonts/lato2bold/font.woff2') format('woff2');
|
|
61
|
+
font-weight: 700 900;
|
|
62
|
+
font-style: normal;
|
|
63
|
+
font-display: swap;
|
|
64
|
+
}
|
|
@@ -27,7 +27,7 @@ html {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
textarea {
|
|
30
|
-
font-
|
|
30
|
+
font-weight: var(--zd-fw-normal);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
label, input[type='button'], input[type='submit'], input[type='file'], button {
|
|
@@ -37,4 +37,4 @@ label, input[type='button'], input[type='submit'], input[type='file'], button {
|
|
|
37
37
|
/*Moz Required Box shadow Isssue*/
|
|
38
38
|
input[required]:-moz-ui-invalid {
|
|
39
39
|
box-shadow: none;
|
|
40
|
-
}
|
|
40
|
+
}
|
|
@@ -303,22 +303,22 @@
|
|
|
303
303
|
resize: vertical;
|
|
304
304
|
}
|
|
305
305
|
|
|
306
|
-
/*font-
|
|
306
|
+
/*font-weight*/
|
|
307
307
|
.regular {
|
|
308
|
-
font-
|
|
308
|
+
font-weight: var(--zd-fw-normal);
|
|
309
309
|
}
|
|
310
310
|
|
|
311
311
|
.light {
|
|
312
|
-
font-
|
|
312
|
+
font-weight: var(--zd-fw-light);
|
|
313
313
|
}
|
|
314
314
|
|
|
315
315
|
.semibold {
|
|
316
|
-
font-
|
|
316
|
+
font-weight: var(--zd-fw-semibold);
|
|
317
317
|
composes: ftsmooth;
|
|
318
318
|
}
|
|
319
319
|
|
|
320
320
|
.bold {
|
|
321
|
-
font-
|
|
321
|
+
font-weight: var(--zd-fw-bold);
|
|
322
322
|
composes: ftsmooth;
|
|
323
323
|
}
|
|
324
324
|
|
|
@@ -501,7 +501,7 @@
|
|
|
501
501
|
}
|
|
502
502
|
.lineClamp {
|
|
503
503
|
composes: wbreak clamp;
|
|
504
|
-
-webkit-line-clamp: var(--line-clamp,
|
|
504
|
+
-webkit-line-clamp: var(--line-clamp,2);
|
|
505
505
|
}
|
|
506
506
|
|
|
507
507
|
.offSelection {
|
|
@@ -26,10 +26,12 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
26
26
|
var ArrowIcon = function ArrowIcon(props) {
|
|
27
27
|
var dataId = props.dataId,
|
|
28
28
|
isRotated = props.isRotated,
|
|
29
|
+
isActive = props.isActive,
|
|
29
30
|
customClass = props.customClass,
|
|
30
31
|
customProps = props.customProps,
|
|
31
32
|
tagAttributes = props.tagAttributes,
|
|
32
33
|
a11yAttributes = props.a11yAttributes,
|
|
34
|
+
iconSize = props.iconSize,
|
|
33
35
|
isDisabled = props.isDisabled,
|
|
34
36
|
isReadOnly = props.isReadOnly,
|
|
35
37
|
renderCustomToggleIndicator = props.renderCustomToggleIndicator;
|
|
@@ -38,7 +40,8 @@ var ArrowIcon = function ArrowIcon(props) {
|
|
|
38
40
|
_customClass$containe = customClass.containerClass,
|
|
39
41
|
containerClass = _customClass$containe === void 0 ? '' : _customClass$containe;
|
|
40
42
|
return (0, _utils.isRenderable)(renderCustomToggleIndicator) ? (0, _utils.renderNode)(renderCustomToggleIndicator, {
|
|
41
|
-
|
|
43
|
+
isRotated: isRotated,
|
|
44
|
+
isActive: isActive,
|
|
42
45
|
isReadOnly: isReadOnly,
|
|
43
46
|
isDisabled: isDisabled
|
|
44
47
|
}) : /*#__PURE__*/_react["default"].createElement(_Layout.Container, _extends({
|
|
@@ -48,10 +51,10 @@ var ArrowIcon = function ArrowIcon(props) {
|
|
|
48
51
|
"aria-hidden": true
|
|
49
52
|
}, tagAttributes, a11yAttributes, customProps, {
|
|
50
53
|
dataId: "".concat(dataId, "_downIcon"),
|
|
51
|
-
className: "".concat(_ArrowIconModule["default"].arrowIcon, " ").concat(isRotated ? _ArrowIconModule["default"].rotated : '', " ").concat(containerClass)
|
|
54
|
+
className: "".concat(_ArrowIconModule["default"].arrowIcon, " ").concat(isRotated ? _ArrowIconModule["default"].rotated : '', " ").concat(isActive ? _ArrowIconModule["default"].active : '', " ").concat(isDisabled ? _ArrowIconModule["default"].disabled : '', " ").concat(isReadOnly ? _ArrowIconModule["default"].readonly : '', " ").concat(containerClass)
|
|
52
55
|
}), /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
53
56
|
name: "ZD-down",
|
|
54
|
-
size:
|
|
57
|
+
size: iconSize,
|
|
55
58
|
iconClass: iconClass
|
|
56
59
|
}));
|
|
57
60
|
};
|
|
@@ -28,7 +28,16 @@
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.rotated,
|
|
31
|
+
.active,
|
|
31
32
|
.arrowContainer:hover .arrowIcon,
|
|
32
33
|
.transparentContainer:hover .arrowIcon {
|
|
33
34
|
--local-arrowIcon-color: var(--zdt_arrowicon_hover_icon);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.disabled {
|
|
38
|
+
composes: disabled from '../../common/common.module.css';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.readonly {
|
|
42
|
+
composes: curdefault from '../../common/common.module.css';
|
|
34
43
|
}
|
|
@@ -31,52 +31,76 @@ describe('ArrowIcon', function () {
|
|
|
31
31
|
|
|
32
32
|
expect(asFragment()).toMatchSnapshot();
|
|
33
33
|
});
|
|
34
|
-
test('Should be render
|
|
34
|
+
test('Should be render isActive is true', function () {
|
|
35
35
|
var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ArrowIcon["default"], {
|
|
36
|
+
isActive: true
|
|
37
|
+
})),
|
|
38
|
+
asFragment = _render4.asFragment;
|
|
39
|
+
|
|
40
|
+
expect(asFragment()).toMatchSnapshot();
|
|
41
|
+
});
|
|
42
|
+
test('Should be render isDisabled is true', function () {
|
|
43
|
+
var _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ArrowIcon["default"], {
|
|
44
|
+
isDisabled: true
|
|
45
|
+
})),
|
|
46
|
+
asFragment = _render5.asFragment;
|
|
47
|
+
|
|
48
|
+
expect(asFragment()).toMatchSnapshot();
|
|
49
|
+
});
|
|
50
|
+
test('Should be render isReadOnly is true', function () {
|
|
51
|
+
var _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ArrowIcon["default"], {
|
|
52
|
+
isReadOnly: true
|
|
53
|
+
})),
|
|
54
|
+
asFragment = _render6.asFragment;
|
|
55
|
+
|
|
56
|
+
expect(asFragment()).toMatchSnapshot();
|
|
57
|
+
});
|
|
58
|
+
test('Should be render with customClass', function () {
|
|
59
|
+
var _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ArrowIcon["default"], {
|
|
36
60
|
customClass: {
|
|
37
61
|
iconClass: 'arrowIcon_iconClass',
|
|
38
62
|
containerClass: 'arrowIcon_containerClass'
|
|
39
63
|
}
|
|
40
64
|
})),
|
|
41
|
-
asFragment =
|
|
65
|
+
asFragment = _render7.asFragment;
|
|
42
66
|
|
|
43
67
|
expect(asFragment()).toMatchSnapshot();
|
|
44
68
|
});
|
|
45
69
|
test('Should be render with a11yAttributes', function () {
|
|
46
|
-
var
|
|
70
|
+
var _render8 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ArrowIcon["default"], {
|
|
47
71
|
a11yAttributes: {
|
|
48
72
|
'data-a11y-focus': true
|
|
49
73
|
}
|
|
50
74
|
})),
|
|
51
|
-
asFragment =
|
|
75
|
+
asFragment = _render8.asFragment;
|
|
52
76
|
|
|
53
77
|
expect(asFragment()).toMatchSnapshot();
|
|
54
78
|
});
|
|
55
79
|
test('Should be render with tagAttributes', function () {
|
|
56
|
-
var
|
|
80
|
+
var _render9 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ArrowIcon["default"], {
|
|
57
81
|
tagAttributes: {
|
|
58
82
|
title: 'hello here is title'
|
|
59
83
|
}
|
|
60
84
|
})),
|
|
61
|
-
asFragment =
|
|
85
|
+
asFragment = _render9.asFragment;
|
|
62
86
|
|
|
63
87
|
expect(asFragment()).toMatchSnapshot();
|
|
64
88
|
});
|
|
65
89
|
test('Should be render with customProps', function () {
|
|
66
|
-
var
|
|
90
|
+
var _render10 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ArrowIcon["default"], {
|
|
67
91
|
customProps: {
|
|
68
92
|
testId: 'hereIsTestId'
|
|
69
93
|
}
|
|
70
94
|
})),
|
|
71
|
-
asFragment =
|
|
95
|
+
asFragment = _render10.asFragment;
|
|
72
96
|
|
|
73
97
|
expect(asFragment()).toMatchSnapshot();
|
|
74
98
|
});
|
|
75
99
|
test('Should be render with renderCustomToggleIndicator', function () {
|
|
76
|
-
var
|
|
100
|
+
var _render11 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ArrowIcon["default"], {
|
|
77
101
|
renderCustomToggleIndicator: /*#__PURE__*/_react["default"].createElement("div", null, "Indicator")
|
|
78
102
|
})),
|
|
79
|
-
asFragment =
|
|
103
|
+
asFragment = _render11.asFragment;
|
|
80
104
|
|
|
81
105
|
expect(asFragment()).toMatchSnapshot();
|
|
82
106
|
});
|
|
@@ -1,10 +1,73 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
+
exports[`ArrowIcon Should be render isActive is true 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
aria-hidden="true"
|
|
7
|
+
class="arrowIcon active inflex coldir both"
|
|
8
|
+
data-id="undefined_downIcon"
|
|
9
|
+
data-selector-id="container"
|
|
10
|
+
data-test-id="undefined_downIcon"
|
|
11
|
+
>
|
|
12
|
+
<i
|
|
13
|
+
aria-hidden="true"
|
|
14
|
+
class="zd_font_icons basic icon-down "
|
|
15
|
+
data-id="fontIcon"
|
|
16
|
+
data-selector-id="fontIcon"
|
|
17
|
+
data-test-id="fontIcon"
|
|
18
|
+
style="--zd-iconfont-size: var(--zd_font_size7);"
|
|
19
|
+
/>
|
|
20
|
+
</div>
|
|
21
|
+
</DocumentFragment>
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
exports[`ArrowIcon Should be render isDisabled is true 1`] = `
|
|
25
|
+
<DocumentFragment>
|
|
26
|
+
<div
|
|
27
|
+
aria-hidden="true"
|
|
28
|
+
class="arrowIcon disabled inflex coldir both"
|
|
29
|
+
data-id="undefined_downIcon"
|
|
30
|
+
data-selector-id="container"
|
|
31
|
+
data-test-id="undefined_downIcon"
|
|
32
|
+
>
|
|
33
|
+
<i
|
|
34
|
+
aria-hidden="true"
|
|
35
|
+
class="zd_font_icons basic icon-down "
|
|
36
|
+
data-id="fontIcon"
|
|
37
|
+
data-selector-id="fontIcon"
|
|
38
|
+
data-test-id="fontIcon"
|
|
39
|
+
style="--zd-iconfont-size: var(--zd_font_size7);"
|
|
40
|
+
/>
|
|
41
|
+
</div>
|
|
42
|
+
</DocumentFragment>
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
exports[`ArrowIcon Should be render isReadOnly is true 1`] = `
|
|
46
|
+
<DocumentFragment>
|
|
47
|
+
<div
|
|
48
|
+
aria-hidden="true"
|
|
49
|
+
class="arrowIcon readonly inflex coldir both"
|
|
50
|
+
data-id="undefined_downIcon"
|
|
51
|
+
data-selector-id="container"
|
|
52
|
+
data-test-id="undefined_downIcon"
|
|
53
|
+
>
|
|
54
|
+
<i
|
|
55
|
+
aria-hidden="true"
|
|
56
|
+
class="zd_font_icons basic icon-down "
|
|
57
|
+
data-id="fontIcon"
|
|
58
|
+
data-selector-id="fontIcon"
|
|
59
|
+
data-test-id="fontIcon"
|
|
60
|
+
style="--zd-iconfont-size: var(--zd_font_size7);"
|
|
61
|
+
/>
|
|
62
|
+
</div>
|
|
63
|
+
</DocumentFragment>
|
|
64
|
+
`;
|
|
65
|
+
|
|
3
66
|
exports[`ArrowIcon Should be render isRotated is true 1`] = `
|
|
4
67
|
<DocumentFragment>
|
|
5
68
|
<div
|
|
6
69
|
aria-hidden="true"
|
|
7
|
-
class="arrowIcon rotated
|
|
70
|
+
class="arrowIcon rotated inflex coldir both"
|
|
8
71
|
data-id="undefined_downIcon"
|
|
9
72
|
data-selector-id="container"
|
|
10
73
|
data-test-id="undefined_downIcon"
|
|
@@ -25,7 +88,7 @@ exports[`ArrowIcon Should be render with a11yAttributes 1`] = `
|
|
|
25
88
|
<DocumentFragment>
|
|
26
89
|
<div
|
|
27
90
|
aria-hidden="true"
|
|
28
|
-
class="arrowIcon
|
|
91
|
+
class="arrowIcon inflex coldir both"
|
|
29
92
|
data-a11y-focus="true"
|
|
30
93
|
data-id="undefined_downIcon"
|
|
31
94
|
data-selector-id="container"
|
|
@@ -47,7 +110,7 @@ exports[`ArrowIcon Should be render with customClass 1`] = `
|
|
|
47
110
|
<DocumentFragment>
|
|
48
111
|
<div
|
|
49
112
|
aria-hidden="true"
|
|
50
|
-
class="arrowIcon
|
|
113
|
+
class="arrowIcon arrowIcon_containerClass inflex coldir both"
|
|
51
114
|
data-id="undefined_downIcon"
|
|
52
115
|
data-selector-id="container"
|
|
53
116
|
data-test-id="undefined_downIcon"
|
|
@@ -68,7 +131,7 @@ exports[`ArrowIcon Should be render with customProps 1`] = `
|
|
|
68
131
|
<DocumentFragment>
|
|
69
132
|
<div
|
|
70
133
|
aria-hidden="true"
|
|
71
|
-
class="arrowIcon
|
|
134
|
+
class="arrowIcon inflex coldir both"
|
|
72
135
|
data-id="undefined_downIcon"
|
|
73
136
|
data-selector-id="container"
|
|
74
137
|
data-test-id="hereIsTestId"
|
|
@@ -89,7 +152,7 @@ exports[`ArrowIcon Should be render with dataId 1`] = `
|
|
|
89
152
|
<DocumentFragment>
|
|
90
153
|
<div
|
|
91
154
|
aria-hidden="true"
|
|
92
|
-
class="arrowIcon
|
|
155
|
+
class="arrowIcon inflex coldir both"
|
|
93
156
|
data-id="ArrowIcon-test-dataId_downIcon"
|
|
94
157
|
data-selector-id="container"
|
|
95
158
|
data-test-id="ArrowIcon-test-dataId_downIcon"
|
|
@@ -118,7 +181,7 @@ exports[`ArrowIcon Should be render with tagAttributes 1`] = `
|
|
|
118
181
|
<DocumentFragment>
|
|
119
182
|
<div
|
|
120
183
|
aria-hidden="true"
|
|
121
|
-
class="arrowIcon
|
|
184
|
+
class="arrowIcon inflex coldir both"
|
|
122
185
|
data-id="undefined_downIcon"
|
|
123
186
|
data-selector-id="container"
|
|
124
187
|
data-test-id="undefined_downIcon"
|
|
@@ -140,7 +203,7 @@ exports[`ArrowIcon rendering the defult props 1`] = `
|
|
|
140
203
|
<DocumentFragment>
|
|
141
204
|
<div
|
|
142
205
|
aria-hidden="true"
|
|
143
|
-
class="arrowIcon
|
|
206
|
+
class="arrowIcon inflex coldir both"
|
|
144
207
|
data-id="undefined_downIcon"
|
|
145
208
|
data-selector-id="container"
|
|
146
209
|
data-test-id="undefined_downIcon"
|
|
@@ -21,6 +21,8 @@ var _default = {
|
|
|
21
21
|
a11yAttributes: _propTypes["default"].object,
|
|
22
22
|
renderCustomToggleIndicator: _propTypes["default"].oneOfType([_propTypes["default"].node, _propTypes["default"].func]),
|
|
23
23
|
isDisabled: _propTypes["default"].bool,
|
|
24
|
-
isReadOnly: _propTypes["default"].bool
|
|
24
|
+
isReadOnly: _propTypes["default"].bool,
|
|
25
|
+
isActive: _propTypes["default"].bool,
|
|
26
|
+
iconSize: _propTypes["default"].string
|
|
25
27
|
};
|
|
26
28
|
exports["default"] = _default;
|
package/lib/utils/Common.js
CHANGED
|
@@ -38,7 +38,7 @@ exports.stopAllEventPropagation = exports.scrollTo = void 0;
|
|
|
38
38
|
exports.stopPropagation = stopPropagation;
|
|
39
39
|
exports.throttle = void 0;
|
|
40
40
|
|
|
41
|
-
var _viewPort = _interopRequireDefault(require("
|
|
41
|
+
var _viewPort = _interopRequireDefault(require("@zohodesk/dotkit/es/react/components/Popup/utils/viewPort.js"));
|
|
42
42
|
|
|
43
43
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
44
44
|
|
|
@@ -296,7 +296,7 @@ var makeFormatOptions = function makeFormatOptions() {
|
|
|
296
296
|
var value = _typeof(option) === 'object' ? option[impTextField || textField] : allowValueFallback ? option : '';
|
|
297
297
|
var secondaryValue = _typeof(option) === 'object' ? option[impSecondaryField || secondaryField] : '';
|
|
298
298
|
var photoURL = _typeof(option) === 'object' ? option[impImageField || imageField] : '';
|
|
299
|
-
var
|
|
299
|
+
var colorConfig = (0, _selectn["default"])('colorConfig', option); // grouping options (group select/MultiSelect)
|
|
300
300
|
|
|
301
301
|
id = !(0, _Common.getIsEmptyValue)(id) ? optionIdGrouping(id, prefixText) : '';
|
|
302
302
|
var additionalSearchFieldData = searchFields.reduce(function (value, item) {
|
|
@@ -337,8 +337,8 @@ var makeFormatOptions = function makeFormatOptions() {
|
|
|
337
337
|
optionDetails.listItemProps = listStyle || listItemProps;
|
|
338
338
|
}
|
|
339
339
|
|
|
340
|
-
if (
|
|
341
|
-
optionDetails.
|
|
340
|
+
if (colorConfig) {
|
|
341
|
+
optionDetails.colorConfig = colorConfig;
|
|
342
342
|
}
|
|
343
343
|
|
|
344
344
|
if (listStyleCustomProps || listItemCustomProps) {
|
package/lib/v1/Popup/Popup.js
CHANGED
|
@@ -15,7 +15,7 @@ var _hoistNonReactStatics = _interopRequireDefault(require("hoist-non-react-stat
|
|
|
15
15
|
|
|
16
16
|
var _Common = require("../../utils/Common.js");
|
|
17
17
|
|
|
18
|
-
var _viewPort = _interopRequireDefault(require("
|
|
18
|
+
var _viewPort = _interopRequireDefault(require("@zohodesk/dotkit/es/react/components/Popup/utils/viewPort.js"));
|
|
19
19
|
|
|
20
20
|
var _PositionMapping = require("../../Popup/PositionMapping.js");
|
|
21
21
|
|
|
@@ -19,17 +19,17 @@
|
|
|
19
19
|
display: initial;
|
|
20
20
|
}
|
|
21
21
|
.font_regular {
|
|
22
|
-
font-
|
|
22
|
+
font-weight: var(--zd-fw-normal);
|
|
23
23
|
}
|
|
24
24
|
.font_light {
|
|
25
|
-
font-
|
|
25
|
+
font-weight: var(--zd-fw-light);
|
|
26
26
|
}
|
|
27
27
|
.font_semibold {
|
|
28
|
-
font-
|
|
28
|
+
font-weight: var(--zd-fw-semibold);
|
|
29
29
|
composes: ftsmooth from '../../../common/common.module.css';
|
|
30
30
|
}
|
|
31
31
|
.font_bold {
|
|
32
|
-
font-
|
|
32
|
+
font-weight: var(--zd-fw-bold);
|
|
33
33
|
composes: ftsmooth from '../../../common/common.module.css';
|
|
34
34
|
}
|
|
35
35
|
.fontStyles_normal{
|