@zohodesk/components 1.0.0-alpha-239 → 1.0.0-alpha-242
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 +20 -6
- package/assets/Appearance/dark/mode/darkMode.module.css +2 -2
- package/assets/Appearance/default/mode/defaultMode.module.css +3 -3
- package/assets/Appearance/pureDark/mode/pureDarkMode.module.css +2 -2
- package/es/DateTime/DateTime.js +42 -21
- package/es/DateTime/DateWidget.module.css +0 -4
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +100 -75
- package/es/MultiSelect/AdvancedMultiSelect.js +75 -49
- package/es/MultiSelect/MultiSelect.js +80 -55
- package/es/MultiSelect/MultiSelect.module.css +6 -1
- package/es/MultiSelect/MultiSelectWithAvatar.js +77 -52
- package/es/PopOver/PopOver.js +10 -4
- package/es/Provider.js +5 -105
- package/es/ResponsiveDropBox/ResponsiveDropBox.js +74 -0
- package/es/ResponsiveDropBox/ResponsiveDropBox.module.css +6 -0
- package/es/Select/GroupSelect.js +99 -74
- package/es/Select/Select.js +95 -68
- package/es/Select/Select.module.css +6 -0
- package/es/Select/SelectWithAvatar.js +91 -66
- package/es/Select/SelectWithIcon.js +99 -74
- package/es/Tab/Tabs.js +68 -43
- package/es/Tab/Tabs.module.css +2 -1
- package/es/Tag/Tag.js +1 -1
- package/es/Tag/Tag.module.css +6 -2
- package/es/Tooltip/Tooltip.js +1 -1
- package/es/index.js +2 -1
- package/lib/DateTime/DateTime.js +42 -22
- package/lib/DateTime/DateWidget.module.css +0 -4
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +99 -77
- package/lib/MultiSelect/AdvancedMultiSelect.js +76 -50
- package/lib/MultiSelect/MultiSelect.js +81 -56
- package/lib/MultiSelect/MultiSelect.module.css +6 -1
- package/lib/MultiSelect/MultiSelectWithAvatar.js +78 -53
- package/lib/PopOver/PopOver.js +11 -4
- package/lib/Provider.js +6 -123
- package/lib/ResponsiveDropBox/ResponsiveDropBox.js +130 -0
- package/lib/ResponsiveDropBox/ResponsiveDropBox.module.css +6 -0
- package/lib/Select/GroupSelect.js +99 -76
- package/lib/Select/Select.js +102 -75
- package/lib/Select/Select.module.css +6 -0
- package/lib/Select/SelectWithAvatar.js +96 -71
- package/lib/Select/SelectWithIcon.js +97 -74
- package/lib/Tab/Tabs.js +67 -44
- package/lib/Tab/Tabs.module.css +2 -1
- package/lib/Tag/Tag.js +1 -1
- package/lib/Tag/Tag.module.css +6 -2
- package/lib/Tooltip/Tooltip.js +1 -1
- package/lib/index.js +10 -1
- package/package.json +3 -3
|
@@ -15,8 +15,6 @@ var _MultiSelect = require("./MultiSelect");
|
|
|
15
15
|
|
|
16
16
|
var _Popup = _interopRequireDefault(require("../Popup/Popup"));
|
|
17
17
|
|
|
18
|
-
var _DropBox = _interopRequireDefault(require("../DropBox/DropBox"));
|
|
19
|
-
|
|
20
18
|
var _TextBoxIcon = _interopRequireDefault(require("../TextBoxIcon/TextBoxIcon"));
|
|
21
19
|
|
|
22
20
|
var _Layout = require("../Layout");
|
|
@@ -35,6 +33,10 @@ var _CssProvider = _interopRequireDefault(require("../Provider/CssProvider"));
|
|
|
35
33
|
|
|
36
34
|
var _IdProvider = require("../Provider/IdProvider");
|
|
37
35
|
|
|
36
|
+
var _ResponsiveDropBox = _interopRequireDefault(require("../ResponsiveDropBox/ResponsiveDropBox"));
|
|
37
|
+
|
|
38
|
+
var _CustomResponsive = require("../Responsive/CustomResponsive");
|
|
39
|
+
|
|
38
40
|
var _Icon = _interopRequireDefault(require("@zohodesk/icons/lib/Icon"));
|
|
39
41
|
|
|
40
42
|
var _MultiSelectModule = _interopRequireDefault(require("./MultiSelect.module.css"));
|
|
@@ -103,9 +105,21 @@ var MultiSelectWithAvatarComponent = /*#__PURE__*/function (_MultiSelectComponen
|
|
|
103
105
|
disabledOptions: disabledOptions
|
|
104
106
|
});
|
|
105
107
|
}
|
|
108
|
+
}, {
|
|
109
|
+
key: "responsiveFunc",
|
|
110
|
+
value: function responsiveFunc(_ref) {
|
|
111
|
+
var mediaQueryOR = _ref.mediaQueryOR;
|
|
112
|
+
return {
|
|
113
|
+
tabletMode: mediaQueryOR([{
|
|
114
|
+
maxWidth: 700
|
|
115
|
+
}])
|
|
116
|
+
};
|
|
117
|
+
}
|
|
106
118
|
}, {
|
|
107
119
|
key: "render",
|
|
108
120
|
value: function render() {
|
|
121
|
+
var _this2 = this;
|
|
122
|
+
|
|
109
123
|
var _this$props = this.props,
|
|
110
124
|
isReadOnly = _this$props.isReadOnly,
|
|
111
125
|
needSelectAll = _this$props.needSelectAll,
|
|
@@ -238,57 +252,68 @@ var MultiSelectWithAvatarComponent = /*#__PURE__*/function (_MultiSelectComponen
|
|
|
238
252
|
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
239
253
|
name: "ZD-delete",
|
|
240
254
|
size: "15"
|
|
241
|
-
})) : null)))), popUpState ? /*#__PURE__*/_react["default"].createElement(
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
255
|
+
})) : null)))), popUpState ? /*#__PURE__*/_react["default"].createElement(_CustomResponsive.ResponsiveReceiver, {
|
|
256
|
+
query: this.responsiveFunc,
|
|
257
|
+
responsiveId: "Helmet"
|
|
258
|
+
}, function (_ref2) {
|
|
259
|
+
var tabletMode = _ref2.tabletMode;
|
|
260
|
+
return /*#__PURE__*/_react["default"].createElement(_ResponsiveDropBox["default"], {
|
|
261
|
+
animationStyle: animationStyle,
|
|
262
|
+
boxPosition: position || "".concat(defaultDropBoxPosition, "Center"),
|
|
263
|
+
getRef: getContainerRef,
|
|
264
|
+
isActive: isPopupReady,
|
|
265
|
+
isAnimate: isAnimate,
|
|
266
|
+
isArrow: false,
|
|
267
|
+
onClick: removeClose,
|
|
268
|
+
needResponsive: needResponsive,
|
|
269
|
+
isPadding: false,
|
|
270
|
+
isBoxPaddingNeed: isBoxPaddingNeed,
|
|
271
|
+
palette: palette,
|
|
272
|
+
htmlId: setAriaId,
|
|
273
|
+
a11y: {
|
|
274
|
+
ariaMultiselectable: true,
|
|
275
|
+
role: 'listbox'
|
|
276
|
+
},
|
|
277
|
+
isResponsivePadding: true,
|
|
278
|
+
alignBox: "row"
|
|
279
|
+
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
280
|
+
flexible: true
|
|
281
|
+
}, /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
|
282
|
+
customClass: "".concat(_MultiSelectModule["default"].box, " ").concat(_MultiSelectModule["default"]["".concat(palette, "Box")]),
|
|
283
|
+
onScroll: _this2.handleScroll
|
|
284
|
+
}, /*#__PURE__*/_react["default"].createElement(_Card.CardHeader, null, /*#__PURE__*/_react["default"].createElement(_MultiSelectHeader["default"], {
|
|
285
|
+
needSelectAll: needSelectAll,
|
|
286
|
+
onSelect: _this2.handleSelectAll,
|
|
287
|
+
selectAllText: selectAllText,
|
|
288
|
+
suggestions: suggestions,
|
|
289
|
+
dataId: dataId
|
|
290
|
+
})), /*#__PURE__*/_react["default"].createElement(_Card.CardContent, {
|
|
291
|
+
shrink: true,
|
|
292
|
+
customClass: !tabletMode && dropBoxSize ? _MultiSelectModule["default"][dropBoxSize] : '',
|
|
293
|
+
eleRef: _this2.suggestionContainerRef
|
|
294
|
+
}, suggestions.length ? /*#__PURE__*/_react["default"].createElement(_Suggestions["default"], {
|
|
295
|
+
suggestions: suggestions,
|
|
296
|
+
getRef: _this2.suggestionItemRef,
|
|
297
|
+
hoverOption: hoverOption,
|
|
298
|
+
onClick: _this2.handleSelectOption,
|
|
299
|
+
onMouseEnter: _this2.handleMouseEnter,
|
|
300
|
+
needBorder: false,
|
|
301
|
+
dataId: "".concat(dataId, "_Options"),
|
|
302
|
+
palette: palette,
|
|
303
|
+
a11y: {
|
|
304
|
+
role: 'option'
|
|
305
|
+
}
|
|
306
|
+
}) : /*#__PURE__*/_react["default"].createElement(_EmptyState["default"], {
|
|
307
|
+
isLoading: isFetchingOptions,
|
|
308
|
+
options: options,
|
|
309
|
+
searchString: searchStr,
|
|
310
|
+
suggestions: suggestions,
|
|
311
|
+
dataId: dataId,
|
|
312
|
+
palette: palette,
|
|
313
|
+
i18nKeys: i18nKeys,
|
|
314
|
+
htmlId: ariaErrorId
|
|
315
|
+
})))));
|
|
316
|
+
}) : null);
|
|
292
317
|
}
|
|
293
318
|
}]);
|
|
294
319
|
|
package/lib/PopOver/PopOver.js
CHANGED
|
@@ -13,7 +13,9 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
13
13
|
|
|
14
14
|
var _Popup = _interopRequireDefault(require("../Popup/Popup"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _Layout = require("../Layout");
|
|
17
|
+
|
|
18
|
+
var _ResponsiveDropBox = _interopRequireDefault(require("../ResponsiveDropBox/ResponsiveDropBox"));
|
|
17
19
|
|
|
18
20
|
var _PopOverModule = _interopRequireDefault(require("./PopOver.module.css"));
|
|
19
21
|
|
|
@@ -314,7 +316,7 @@ var PopOverContainer = /*#__PURE__*/function (_React$Component3) {
|
|
|
314
316
|
arrowBottom = _this$props6.arrowBottom,
|
|
315
317
|
animationStyle = _this$props6.animationStyle,
|
|
316
318
|
getRef = _this$props6.getRef;
|
|
317
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
319
|
+
return /*#__PURE__*/_react["default"].createElement(_ResponsiveDropBox["default"], {
|
|
318
320
|
animationStyle: animationStyle,
|
|
319
321
|
arrowBottom: arrowBottom,
|
|
320
322
|
arrowLeft: arrowLeft,
|
|
@@ -330,8 +332,13 @@ var PopOverContainer = /*#__PURE__*/function (_React$Component3) {
|
|
|
330
332
|
left: left,
|
|
331
333
|
right: right,
|
|
332
334
|
size: size,
|
|
333
|
-
top: top
|
|
334
|
-
|
|
335
|
+
top: top,
|
|
336
|
+
alignBox: "row"
|
|
337
|
+
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
338
|
+
flexible: true,
|
|
339
|
+
shrink: true,
|
|
340
|
+
scroll: "vertical"
|
|
341
|
+
}, children));
|
|
335
342
|
}
|
|
336
343
|
}]);
|
|
337
344
|
|
package/lib/Provider.js
CHANGED
|
@@ -13,6 +13,8 @@ var _AppContainer = _interopRequireDefault(require("./AppContainer/AppContainer"
|
|
|
13
13
|
|
|
14
14
|
var _Layout = require("./Layout");
|
|
15
15
|
|
|
16
|
+
var _ThemeTool = _interopRequireDefault(require("../../common/lib/ThemeTool/ThemeTool"));
|
|
17
|
+
|
|
16
18
|
require("../assets/Appearance/default/themes/blue/blueDefaultCTATheme.module.css");
|
|
17
19
|
|
|
18
20
|
require("../assets/Appearance/default/themes/green/greenDefaultCTATheme.module.css");
|
|
@@ -122,6 +124,7 @@ var Provider = /*#__PURE__*/function (_React$Component) {
|
|
|
122
124
|
themeName: 'blue'
|
|
123
125
|
};
|
|
124
126
|
_this.setTheme = _this.setTheme.bind(_assertThisInitialized(_this));
|
|
127
|
+
_this.setAppearance = _this.setAppearance.bind(_assertThisInitialized(_this));
|
|
125
128
|
return _this;
|
|
126
129
|
}
|
|
127
130
|
|
|
@@ -142,56 +145,9 @@ var Provider = /*#__PURE__*/function (_React$Component) {
|
|
|
142
145
|
}, {
|
|
143
146
|
key: "render",
|
|
144
147
|
value: function render() {
|
|
145
|
-
var _this2 = this;
|
|
146
|
-
|
|
147
148
|
var _this$state = this.state,
|
|
148
149
|
appearanceName = _this$state.appearanceName,
|
|
149
150
|
themeName = _this$state.themeName;
|
|
150
|
-
var themeClass = {
|
|
151
|
-
width: '20px',
|
|
152
|
-
height: '20px',
|
|
153
|
-
borderRadius: '3px',
|
|
154
|
-
display: 'flex',
|
|
155
|
-
border: '1px solid #ccc',
|
|
156
|
-
margin: '0 5px',
|
|
157
|
-
cursor: 'pointer',
|
|
158
|
-
backgroundColor: '#0a73eb'
|
|
159
|
-
};
|
|
160
|
-
var green = {
|
|
161
|
-
backgroundColor: '#26a942'
|
|
162
|
-
};
|
|
163
|
-
var red = {
|
|
164
|
-
backgroundColor: '#de3535'
|
|
165
|
-
};
|
|
166
|
-
var orange = {
|
|
167
|
-
backgroundColor: '#e57717'
|
|
168
|
-
};
|
|
169
|
-
var yellow = {
|
|
170
|
-
backgroundColor: '#e8b923'
|
|
171
|
-
};
|
|
172
|
-
var light = {
|
|
173
|
-
backgroundColor: '#fff'
|
|
174
|
-
};
|
|
175
|
-
var night = {
|
|
176
|
-
backgroundColor: '#232b38'
|
|
177
|
-
};
|
|
178
|
-
var dark = {
|
|
179
|
-
backgroundColor: '#212121'
|
|
180
|
-
};
|
|
181
|
-
var fixedPosition = {
|
|
182
|
-
position: 'fixed',
|
|
183
|
-
bottom: '0',
|
|
184
|
-
backgroundColor: '#272727',
|
|
185
|
-
padding: '10px',
|
|
186
|
-
borderRadius: '15px 15px 0 0',
|
|
187
|
-
minWidth: '100px',
|
|
188
|
-
textAlign: 'center',
|
|
189
|
-
boxShadow: '0 0 3px #000',
|
|
190
|
-
fontSize: '12px',
|
|
191
|
-
zIndex: '3',
|
|
192
|
-
display: 'flex',
|
|
193
|
-
alignItems: 'center'
|
|
194
|
-
};
|
|
195
151
|
return /*#__PURE__*/_react["default"].createElement(_LibraryContextInit["default"].Provider, {
|
|
196
152
|
value: {
|
|
197
153
|
isReducedMotion: false,
|
|
@@ -206,82 +162,9 @@ var Provider = /*#__PURE__*/function (_React$Component) {
|
|
|
206
162
|
}
|
|
207
163
|
}, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
208
164
|
scroll: "vertical"
|
|
209
|
-
}, this.props.children), /*#__PURE__*/_react["default"].createElement("
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
transform: 'translate(-20%)'
|
|
213
|
-
})
|
|
214
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
215
|
-
style: {
|
|
216
|
-
color: '#fff'
|
|
217
|
-
}
|
|
218
|
-
}, "Appearance:"), /*#__PURE__*/_react["default"].createElement("div", {
|
|
219
|
-
style: {
|
|
220
|
-
display: 'flex'
|
|
221
|
-
}
|
|
222
|
-
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
223
|
-
title: "Light Mode",
|
|
224
|
-
style: Object.assign({}, themeClass, light),
|
|
225
|
-
onClick: function onClick() {
|
|
226
|
-
return _this2.setAppearance('default');
|
|
227
|
-
}
|
|
228
|
-
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
229
|
-
title: "Night Mode",
|
|
230
|
-
style: Object.assign({}, themeClass, night),
|
|
231
|
-
onClick: function onClick() {
|
|
232
|
-
return _this2.setAppearance('dark');
|
|
233
|
-
}
|
|
234
|
-
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
235
|
-
title: "Dark Mode",
|
|
236
|
-
style: Object.assign({}, themeClass, dark),
|
|
237
|
-
onClick: function onClick() {
|
|
238
|
-
return _this2.setAppearance('pureDark');
|
|
239
|
-
}
|
|
240
|
-
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
241
|
-
style: Object.assign({}, fixedPosition, {
|
|
242
|
-
left: '80%',
|
|
243
|
-
transform: 'translate(-80%)'
|
|
244
|
-
})
|
|
245
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
246
|
-
style: {
|
|
247
|
-
color: '#fff'
|
|
248
|
-
}
|
|
249
|
-
}, "Themes:"), /*#__PURE__*/_react["default"].createElement("div", {
|
|
250
|
-
style: {
|
|
251
|
-
display: 'flex'
|
|
252
|
-
}
|
|
253
|
-
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
254
|
-
title: "Blue Theme",
|
|
255
|
-
style: themeClass,
|
|
256
|
-
onClick: function onClick() {
|
|
257
|
-
return _this2.setTheme('blue');
|
|
258
|
-
}
|
|
259
|
-
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
260
|
-
title: "Green Theme",
|
|
261
|
-
style: Object.assign({}, themeClass, green),
|
|
262
|
-
onClick: function onClick() {
|
|
263
|
-
return _this2.setTheme('green');
|
|
264
|
-
}
|
|
265
|
-
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
266
|
-
title: "Red Theme",
|
|
267
|
-
style: Object.assign({}, themeClass, red),
|
|
268
|
-
onClick: function onClick() {
|
|
269
|
-
return _this2.setTheme('red');
|
|
270
|
-
}
|
|
271
|
-
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
272
|
-
title: "Orange Theme",
|
|
273
|
-
style: Object.assign({}, themeClass, orange),
|
|
274
|
-
onClick: function onClick() {
|
|
275
|
-
return _this2.setTheme('orange');
|
|
276
|
-
}
|
|
277
|
-
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
278
|
-
title: "Yellow Theme",
|
|
279
|
-
style: Object.assign({}, themeClass, yellow),
|
|
280
|
-
onClick: function onClick() {
|
|
281
|
-
return _this2.setTheme('yellow');
|
|
282
|
-
}
|
|
283
|
-
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
284
|
-
"data-portal": "portal1"
|
|
165
|
+
}, this.props.children), /*#__PURE__*/_react["default"].createElement(_ThemeTool["default"], {
|
|
166
|
+
onThemeChange: this.setTheme,
|
|
167
|
+
onAppearanceChange: this.setAppearance
|
|
285
168
|
})));
|
|
286
169
|
}
|
|
287
170
|
}]);
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _DropBox = _interopRequireDefault(require("../DropBox/DropBox"));
|
|
15
|
+
|
|
16
|
+
var _Layout = require("../Layout");
|
|
17
|
+
|
|
18
|
+
var _CustomResponsive = require("../Responsive/CustomResponsive");
|
|
19
|
+
|
|
20
|
+
var _ResponsiveDropBoxModule = _interopRequireDefault(require("./ResponsiveDropBox.module.css"));
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
+
|
|
24
|
+
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); }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
function _extends() { _extends = Object.assign || 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
|
+
|
|
30
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
31
|
+
|
|
32
|
+
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); } }
|
|
33
|
+
|
|
34
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
35
|
+
|
|
36
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
37
|
+
|
|
38
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
39
|
+
|
|
40
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
41
|
+
|
|
42
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
43
|
+
|
|
44
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
45
|
+
|
|
46
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
47
|
+
|
|
48
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
49
|
+
|
|
50
|
+
var ResponsiveDropBox = /*#__PURE__*/function (_Component) {
|
|
51
|
+
_inherits(ResponsiveDropBox, _Component);
|
|
52
|
+
|
|
53
|
+
var _super = _createSuper(ResponsiveDropBox);
|
|
54
|
+
|
|
55
|
+
function ResponsiveDropBox(props) {
|
|
56
|
+
var _this;
|
|
57
|
+
|
|
58
|
+
_classCallCheck(this, ResponsiveDropBox);
|
|
59
|
+
|
|
60
|
+
_this = _super.call(this, props);
|
|
61
|
+
_this.responsiveFunc = _this.responsiveFunc.bind(_assertThisInitialized(_this));
|
|
62
|
+
return _this;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
_createClass(ResponsiveDropBox, [{
|
|
66
|
+
key: "responsiveFunc",
|
|
67
|
+
value: function responsiveFunc(_ref) {
|
|
68
|
+
var mediaQueryOR = _ref.mediaQueryOR;
|
|
69
|
+
return {
|
|
70
|
+
tabletMode: mediaQueryOR([{
|
|
71
|
+
maxWidth: 700
|
|
72
|
+
}])
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
}, {
|
|
76
|
+
key: "render",
|
|
77
|
+
value: function render() {
|
|
78
|
+
var _this$props = this.props,
|
|
79
|
+
children = _this$props.children,
|
|
80
|
+
_this$props$customCla = _this$props.customClass,
|
|
81
|
+
customClass = _this$props$customCla === void 0 ? {} : _this$props$customCla,
|
|
82
|
+
isResponsivePadding = _this$props.isResponsivePadding,
|
|
83
|
+
alignBox = _this$props.alignBox;
|
|
84
|
+
var _customClass$customDr = customClass.customDropBox,
|
|
85
|
+
customDropBox = _customClass$customDr === void 0 ? '' : _customClass$customDr,
|
|
86
|
+
_customClass$customMo = customClass.customMobileDropBox,
|
|
87
|
+
customMobileDropBox = _customClass$customMo === void 0 ? '' : _customClass$customMo,
|
|
88
|
+
_customClass$customDr2 = customClass.customDropBoxWrap,
|
|
89
|
+
customDropBoxWrap = _customClass$customDr2 === void 0 ? '' : _customClass$customDr2,
|
|
90
|
+
_customClass$customMo2 = customClass.customMobileDropBoxWrap,
|
|
91
|
+
customMobileDropBoxWrap = _customClass$customMo2 === void 0 ? '' : _customClass$customMo2,
|
|
92
|
+
_customClass$customRe = customClass.customResponsiveContainer,
|
|
93
|
+
customResponsiveContainer = _customClass$customRe === void 0 ? '' : _customClass$customRe;
|
|
94
|
+
var dropBoxClasses = {
|
|
95
|
+
customDropBox: "".concat(customDropBox),
|
|
96
|
+
customMobileDropBox: "".concat(customMobileDropBox),
|
|
97
|
+
customDropBoxWrap: "".concat(customDropBoxWrap),
|
|
98
|
+
customMobileDropBoxWrap: "".concat(customMobileDropBoxWrap),
|
|
99
|
+
customResponsiveContainer: "".concat(customResponsiveContainer)
|
|
100
|
+
};
|
|
101
|
+
return /*#__PURE__*/_react["default"].createElement(_DropBox["default"], _extends({}, this.props, {
|
|
102
|
+
customClass: dropBoxClasses
|
|
103
|
+
}), /*#__PURE__*/_react["default"].createElement(_CustomResponsive.ResponsiveReceiver, {
|
|
104
|
+
query: this.responsiveFunc,
|
|
105
|
+
responsiveId: "Helmet"
|
|
106
|
+
}, function (_ref2) {
|
|
107
|
+
var tabletMode = _ref2.tabletMode;
|
|
108
|
+
return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
109
|
+
alignBox: alignBox,
|
|
110
|
+
isCover: false,
|
|
111
|
+
className: "".concat(tabletMode ? _ResponsiveDropBoxModule["default"].dropBoxContainer : '', " ").concat(tabletMode && isResponsivePadding ? _ResponsiveDropBoxModule["default"].boxPadding : '', " ").concat(customResponsiveContainer)
|
|
112
|
+
}, children);
|
|
113
|
+
}));
|
|
114
|
+
}
|
|
115
|
+
}]);
|
|
116
|
+
|
|
117
|
+
return ResponsiveDropBox;
|
|
118
|
+
}(_react.Component);
|
|
119
|
+
|
|
120
|
+
exports["default"] = ResponsiveDropBox;
|
|
121
|
+
ResponsiveDropBox.propTypes = {
|
|
122
|
+
children: _propTypes["default"].element,
|
|
123
|
+
customClass: _propTypes["default"].object,
|
|
124
|
+
isResponsivePadding: _propTypes["default"].bool,
|
|
125
|
+
alignBox: _propTypes["default"].oneOf(['column', 'row'])
|
|
126
|
+
};
|
|
127
|
+
ResponsiveDropBox.defaultProps = {
|
|
128
|
+
isResponsivePadding: false,
|
|
129
|
+
alignBox: 'column'
|
|
130
|
+
};
|