@commercetools-uikit/calendar-utils 15.15.1 → 16.1.0
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.
|
@@ -76,8 +76,9 @@ const getNextDay = day => moment__default["default"](day).add(1, 'day').format('
|
|
|
76
76
|
const getPreviousDay = day => moment__default["default"](day).subtract(1, 'day').format('YYYY-MM-DD');
|
|
77
77
|
const getPaddingDayCount = (day, locale) => {
|
|
78
78
|
const firstDayOfWeek = moment__default["default"].localeData(locale).firstDayOfWeek();
|
|
79
|
-
const firstDayOfMonth = moment__default["default"](day).startOf('month').day();
|
|
79
|
+
const firstDayOfMonth = moment__default["default"](day).startOf('month').day();
|
|
80
80
|
|
|
81
|
+
// ensure number is always positive
|
|
81
82
|
return (firstDayOfMonth - firstDayOfWeek + 7) % 7;
|
|
82
83
|
};
|
|
83
84
|
const getWeekdayNames = locale => {
|
|
@@ -95,12 +96,9 @@ const isBetween = (item, start, end) => {
|
|
|
95
96
|
const endDate = moment__default["default"](end);
|
|
96
97
|
return itemDate.isBetween(startDate, endDate) || itemDate.isBetween(endDate, startDate);
|
|
97
98
|
};
|
|
98
|
-
|
|
99
99
|
const changeDateInMonth = (day, dayOfMonth) => moment__default["default"](day).date(dayOfMonth).format('YYYY-MM-DD');
|
|
100
|
-
|
|
101
100
|
const createCalendarItems = day => {
|
|
102
101
|
var _context;
|
|
103
|
-
|
|
104
102
|
return _mapInstanceProperty__default["default"](_context = _Array$from__default["default"]({
|
|
105
103
|
length: getDaysInMonth(day)
|
|
106
104
|
})).call(_context, (_, i) => {
|
|
@@ -113,7 +111,6 @@ const createItemRangeToString = locale => item => _Array$isArray__default["defau
|
|
|
113
111
|
const createItemToString = locale => item => item ? formatDate(item, locale) : '';
|
|
114
112
|
const formatRange = (range, locale) => {
|
|
115
113
|
var _context2;
|
|
116
|
-
|
|
117
114
|
return _mapInstanceProperty__default["default"](_context2 = _sortInstanceProperty__default["default"](range).call(range)).call(_context2, item => formatDate(item, locale)).join(' - ');
|
|
118
115
|
};
|
|
119
116
|
const parseInputToDate = (text, locale) => {
|
|
@@ -123,19 +120,15 @@ const parseInputToDate = (text, locale) => {
|
|
|
123
120
|
};
|
|
124
121
|
const getIsDateInRange = (item, min, max) => {
|
|
125
122
|
const itemDate = moment__default["default"](item);
|
|
126
|
-
|
|
127
123
|
if (min && max) {
|
|
128
124
|
return itemDate.isBetween(min, max, null, '[]');
|
|
129
125
|
}
|
|
130
|
-
|
|
131
126
|
if (min && !max) {
|
|
132
127
|
return itemDate.isSameOrAfter(min);
|
|
133
128
|
}
|
|
134
|
-
|
|
135
129
|
if (!min && max) {
|
|
136
130
|
return itemDate.isSameOrBefore(max);
|
|
137
131
|
}
|
|
138
|
-
|
|
139
132
|
return true;
|
|
140
133
|
};
|
|
141
134
|
const getExampleDateStrings = () => ({
|
|
@@ -152,127 +145,97 @@ const getExampleDateStrings = () => ({
|
|
|
152
145
|
const getClearSectionStyles = () => {
|
|
153
146
|
return /*#__PURE__*/react.css("align-items:center;box-sizing:border-box;display:flex;margin-right:", designSystem.designTokens.spacing10, ";cursor:pointer;transition:color ", designSystem.designTokens.transitionStandard, ",border-color ", designSystem.designTokens.transitionStandard, ";& svg *:not([fill='none']){fill:", designSystem.designTokens.iconColorForDatetimeInputIcon, ";}&:hover svg *{fill:", designSystem.designTokens.iconColorForDatetimeInputIconWhenHovered, ";}" + ("" ), "" );
|
|
154
147
|
};
|
|
155
|
-
|
|
156
148
|
const getIconBorderColor = (props, state) => {
|
|
157
149
|
if (props.isDisabled) {
|
|
158
150
|
return designSystem.designTokens.borderColorForInputWhenDisabled;
|
|
159
151
|
}
|
|
160
|
-
|
|
161
152
|
if (props.hasError) {
|
|
162
153
|
return designSystem.designTokens.borderColorForInputWhenError;
|
|
163
154
|
}
|
|
164
|
-
|
|
165
155
|
if (props.hasWarning) {
|
|
166
156
|
return designSystem.designTokens.borderColorForInputWhenWarning;
|
|
167
157
|
}
|
|
168
|
-
|
|
169
158
|
if (props.isReadOnly) {
|
|
170
159
|
return designSystem.designTokens.borderColorForInputWhenReadonly;
|
|
171
160
|
}
|
|
172
|
-
|
|
173
161
|
if (props.isOpen || state.isFocused) {
|
|
174
162
|
return designSystem.designTokens.borderColorForInputWhenFocused;
|
|
175
163
|
}
|
|
176
|
-
|
|
177
164
|
return designSystem.designTokens.borderColorForInput;
|
|
178
165
|
};
|
|
179
|
-
|
|
180
166
|
const getIconFontColor = props => {
|
|
181
167
|
if (props.isDisabled) {
|
|
182
168
|
return designSystem.designTokens.fontColorForInputWhenDisabled;
|
|
183
169
|
}
|
|
184
|
-
|
|
185
170
|
if (props.hasError) {
|
|
186
171
|
return designSystem.designTokens.fontColorForInputWhenError;
|
|
187
172
|
}
|
|
188
|
-
|
|
189
173
|
if (props.hasWarning) {
|
|
190
174
|
return designSystem.designTokens.fontColorForInputWhenWarning;
|
|
191
175
|
}
|
|
192
|
-
|
|
193
176
|
if (props.isReadOnly) {
|
|
194
177
|
return designSystem.designTokens.fontColorForInputWhenReadonly;
|
|
195
178
|
}
|
|
196
|
-
|
|
197
179
|
return 'initial';
|
|
198
180
|
};
|
|
199
|
-
|
|
200
181
|
const getCalendarIconContainerStyles = (props, state, isNewTheme) => {
|
|
201
182
|
return [/*#__PURE__*/react.css("align-items:center;box-sizing:border-box;background:none;border:0;border-top-right-radius:", designSystem.designTokens.borderRadiusForInput, ";border-bottom-right-radius:", designSystem.designTokens.borderRadiusForInput, ";border-color:", getIconBorderColor(props, state), ";color:", getIconFontColor(props), ";cursor:", props.isDisabled ? 'not-allowed' : 'default', ";height:100%;display:flex;padding:", designSystem.designTokens.spacing10, ";outline:0;transition:color ", designSystem.designTokens.transitionStandard, ",border-color ", designSystem.designTokens.transitionStandard, ";&:active,&:hover:not(:disabled)&:not(:read-only),&:focus{border-color:", designSystem.designTokens.borderColorForInputWhenFocused, ";}" + ("" ), "" ), !isNewTheme && /*#__PURE__*/react.css("border-left:1px solid ", getIconBorderColor(props, state), ";" + ("" ), "" )];
|
|
202
183
|
};
|
|
203
|
-
|
|
204
184
|
const getInputBorderColor = (props, state) => {
|
|
205
185
|
if (props.isDisabled) {
|
|
206
186
|
return designSystem.designTokens.borderColorForInputWhenDisabled;
|
|
207
187
|
}
|
|
208
|
-
|
|
209
188
|
if (props.hasError) {
|
|
210
189
|
return designSystem.designTokens.borderColorForInputWhenError;
|
|
211
190
|
}
|
|
212
|
-
|
|
213
191
|
if (props.hasWarning) {
|
|
214
192
|
return designSystem.designTokens.borderColorForInputWhenWarning;
|
|
215
193
|
}
|
|
216
|
-
|
|
217
194
|
if (props.isReadOnly) {
|
|
218
195
|
return designSystem.designTokens.borderColorForInputWhenReadonly;
|
|
219
196
|
}
|
|
220
|
-
|
|
221
197
|
if ((props.isOpen || state.isFocused) && !props.isReadOnly) {
|
|
222
198
|
return designSystem.designTokens.borderColorForInputWhenFocused;
|
|
223
199
|
}
|
|
224
|
-
|
|
225
200
|
return designSystem.designTokens.borderColorForInput;
|
|
226
201
|
};
|
|
227
|
-
|
|
228
202
|
const getInputFontColor = props => {
|
|
229
203
|
if (props.isDisabled) {
|
|
230
204
|
return designSystem.designTokens.fontColorForInputWhenDisabled;
|
|
231
205
|
}
|
|
232
|
-
|
|
233
206
|
if (props.hasError) {
|
|
234
207
|
return designSystem.designTokens.fontColorForInputWhenError;
|
|
235
208
|
}
|
|
236
|
-
|
|
237
209
|
if (props.hasWarning) {
|
|
238
210
|
return designSystem.designTokens.fontColorForInputWhenWarning;
|
|
239
211
|
}
|
|
240
|
-
|
|
241
212
|
if (props.isReadOnly) {
|
|
242
213
|
return designSystem.designTokens.fontColorForInputWhenReadonly;
|
|
243
214
|
}
|
|
244
|
-
|
|
245
215
|
return designSystem.designTokens.fontColorForInput;
|
|
246
216
|
};
|
|
247
|
-
|
|
248
217
|
const getInputContainerBackgroundColor = props => {
|
|
249
218
|
if (props.isDisabled) {
|
|
250
219
|
return designSystem.designTokens.backgroundColorForInputWhenDisabled;
|
|
251
220
|
}
|
|
252
|
-
|
|
253
221
|
if (props.isReadOnly) {
|
|
254
222
|
return designSystem.designTokens.backgroundColorForInputWhenReadonly;
|
|
255
223
|
}
|
|
256
|
-
|
|
257
224
|
return designSystem.designTokens.backgroundColorForInput;
|
|
258
225
|
};
|
|
259
|
-
|
|
260
226
|
const getInputContainerStyles = (props, state, isNewTheme) => {
|
|
261
227
|
return [/*#__PURE__*/react.css("appearance:none;background-color:", getInputContainerBackgroundColor(props), ";border:1px solid ", getInputBorderColor(props, state), ";border-radius:", designSystem.designTokens.borderRadiusForInput, ";box-sizing:border-box;color:", getInputFontColor(props), ";cursor:", props.isDisabled ? 'not-allowed' : 'default', ";width:100%;height:", designSystem.designTokens.heightForInput, ";align-items:center;display:flex;font-size:", designSystem.designTokens.fontSizeForInput, ";font-family:inherit;min-width:", designSystem.designTokens.constraint5, ";transition:border-color ", designSystem.designTokens.transitionStandard, ",box-shadow ", designSystem.designTokens.transitionStandard, ";&:hover:not(:focus){background-color:", !props.isDisabled && !props.isReadOnly ? designSystem.designTokens.backgroundColorForInputWhenHovered : null, ";}&:focus{border-color:", props.isDisabled || props.hasError || props.hasWarning || props.isReadOnly || (props.isOpen || state.isFocused) && !props.isReadOnly ? '' : designSystem.designTokens.borderColorForInputWhenFocused, ";}" + ("" ), "" ), !props.isReadOnly && /*#__PURE__*/react.css("&:focus-within{border-color:", designSystem.designTokens.borderColorForInputWhenFocused, ";box-shadow:", designSystem.designTokens.boxShadowForDatetimeInputWhenHovered, " ", designSystem.designTokens.borderColorForInputWhenFocused, ";&:hover{background-color:", designSystem.designTokens.colorSurface, ";}}" + ("" ), "" ), !isNewTheme && /*#__PURE__*/react.css("&:hover,&:hover>button,&:focus>button{border-color:", props.isDisabled || props.hasError || props.hasWarning || props.isReadOnly || (props.isOpen || state.isFocused) && !props.isReadOnly ? '' : designSystem.designTokens.borderColorForInputWhenFocused, ";}" + ("" ), "" ), isNewTheme && (props.hasError || props.hasWarning) && /*#__PURE__*/react.css("box-shadow:", designSystem.designTokens.boxShadowForDatetimeInputWhenHovered, ";" + ("" ), "" )];
|
|
262
228
|
};
|
|
263
|
-
|
|
264
229
|
var _ref$2 = {
|
|
265
230
|
name: "1wj7icd",
|
|
266
231
|
styles: "border:none;background:none!important;&,&:focus:not(:read-only){box-shadow:none;}"
|
|
267
232
|
} ;
|
|
268
|
-
|
|
269
233
|
const getDateTimeInputStyles = props => {
|
|
270
234
|
const baseStyles = [inputUtils.getInputStyles(props), _ref$2];
|
|
271
235
|
return baseStyles;
|
|
272
236
|
};
|
|
273
237
|
|
|
274
238
|
function ownKeys$2(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
275
|
-
|
|
276
239
|
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$2(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$2(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
277
240
|
const ClearSection = props => {
|
|
278
241
|
return jsxRuntime.jsx(AccessibleButton__default["default"], {
|
|
@@ -292,15 +255,12 @@ const defaultProps = {
|
|
|
292
255
|
};
|
|
293
256
|
const CalendarBody = props => {
|
|
294
257
|
var _props$inputProps, _props$inputProps2, _props$toggleButtonPr, _props$toggleButtonPr2, _props$inputProps3;
|
|
295
|
-
|
|
296
258
|
const _useToggleState = hooks.useToggleState(false),
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
259
|
+
_useToggleState2 = _slicedToArray(_useToggleState, 2),
|
|
260
|
+
isFocused = _useToggleState2[0],
|
|
261
|
+
toggleIsFocused = _useToggleState2[1];
|
|
301
262
|
const _useTheme = designSystem.useTheme(),
|
|
302
|
-
|
|
303
|
-
|
|
263
|
+
isNewTheme = _useTheme.isNewTheme;
|
|
304
264
|
const onInputFocus = (_props$inputProps = props.inputProps) === null || _props$inputProps === void 0 ? void 0 : _props$inputProps.onFocus;
|
|
305
265
|
const handleInputFocus = react$1.useCallback(event => {
|
|
306
266
|
toggleIsFocused(true);
|
|
@@ -353,8 +313,7 @@ const CalendarBody = props => {
|
|
|
353
313
|
onBlur: handleToggleBlur,
|
|
354
314
|
disabled: disabledOrReadOnly,
|
|
355
315
|
onKeyDown: (_props$inputProps3 = props.inputProps) === null || _props$inputProps3 === void 0 ? void 0 : _props$inputProps3.onKeyDown
|
|
356
|
-
/* keyboard users don't need this button
|
|
357
|
-
,
|
|
316
|
+
/* keyboard users don't need this button */,
|
|
358
317
|
tabIndex: -1,
|
|
359
318
|
children: props.icon === 'clock' ? jsxRuntime.jsx(icons.ClockIcon, {
|
|
360
319
|
color: disabledOrReadOnly || isNewTheme ? 'neutral60' : 'solid'
|
|
@@ -376,69 +335,52 @@ const CalendarContent = /*#__PURE__*/_styled__default["default"]("ul", {
|
|
|
376
335
|
name: "1en5ct5",
|
|
377
336
|
styles: "margin:0;padding:0 1%"
|
|
378
337
|
} );
|
|
379
|
-
|
|
380
338
|
var CalendarContent$1 = CalendarContent;
|
|
381
339
|
|
|
382
340
|
const _excluded$1 = ["isHighlighted", "isSelected", "isRangeStart", "isRangeBetween", "isRangeEnd", "isToday"];
|
|
383
|
-
|
|
384
341
|
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
385
|
-
|
|
386
342
|
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$1(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$1(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
387
|
-
|
|
388
343
|
const getStyles = props => {
|
|
389
344
|
var _context, _context2;
|
|
390
|
-
|
|
391
345
|
const styles = [];
|
|
392
|
-
|
|
393
346
|
if (!_includesInstanceProperty__default["default"](_context = ['heading', 'spacing']).call(_context, props.type || '')) {
|
|
394
347
|
styles.push( /*#__PURE__*/react.css("text-align:center;padding:", designSystem.designTokens.spacing20, " 0;cursor:default;border-radius:", designSystem.designTokens.borderRadius4, ";" + ("" ), "" ));
|
|
395
348
|
}
|
|
396
|
-
|
|
397
349
|
if (_includesInstanceProperty__default["default"](_context2 = ['heading', 'spacing']).call(_context2, props.type || '')) {
|
|
398
350
|
styles.push( /*#__PURE__*/react.css("text-align:center;padding:", designSystem.designTokens.spacing20, " 0;cursor:default;color:", designSystem.designTokens.colorNeutral60, ";" + ("" ), "" ));
|
|
399
351
|
}
|
|
400
|
-
|
|
401
352
|
if (props.isHighlighted) {
|
|
402
353
|
styles.push( /*#__PURE__*/react.css("background-color:", designSystem.designTokens.colorNeutral90, ";" + ("" ), "" ));
|
|
403
354
|
}
|
|
404
|
-
|
|
405
355
|
if (props.isSelected) {
|
|
406
356
|
styles.push( /*#__PURE__*/react.css("background-color:", designSystem.designTokens.colorPrimary, ";color:", designSystem.designTokens.colorSurface, ";" + ("" ), "" ));
|
|
407
357
|
}
|
|
408
|
-
|
|
409
358
|
if (props.isRangeStart || props.isRangeEnd) {
|
|
410
359
|
styles.push( /*#__PURE__*/react.css("background-color:", designSystem.designTokens.colorPrimary40, ";color:", designSystem.designTokens.colorSurface, ";" + ("" ), "" ));
|
|
411
360
|
}
|
|
412
|
-
|
|
413
361
|
if (props.isRangeBetween) {
|
|
414
362
|
styles.push( /*#__PURE__*/react.css("background-color:", designSystem.designTokens.colorNeutral90, ";color:", designSystem.designTokens.fontColorForInput, ";" + ("" ), "" ));
|
|
415
363
|
}
|
|
416
|
-
|
|
417
364
|
if (!props.isSelected && !props.isRangeStart && !props.isRangeEnd && props.isToday) {
|
|
418
365
|
styles.push( /*#__PURE__*/react.css("color:", designSystem.designTokens.colorInfo, ";font-weight:bold;" + ("" ), "" ));
|
|
419
366
|
}
|
|
420
|
-
|
|
421
367
|
if (props.disabled) {
|
|
422
368
|
styles.push( /*#__PURE__*/react.css("color:", designSystem.designTokens.fontColorForInputWhenDisabled, ";cursor:not-allowed;" + ("" ), "" ));
|
|
423
369
|
}
|
|
424
|
-
|
|
425
370
|
return styles;
|
|
426
371
|
};
|
|
427
|
-
|
|
428
372
|
var _ref$1 = {
|
|
429
373
|
name: "9xt9sg",
|
|
430
374
|
styles: "list-style-type:none;display:inline-block;margin:2px 1%;width:12%"
|
|
431
375
|
} ;
|
|
432
|
-
|
|
433
376
|
const CalendarDay = props => {
|
|
434
377
|
props.isHighlighted;
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
378
|
+
props.isSelected;
|
|
379
|
+
props.isRangeStart;
|
|
380
|
+
props.isRangeBetween;
|
|
381
|
+
props.isRangeEnd;
|
|
382
|
+
props.isToday;
|
|
383
|
+
const rest = _objectWithoutProperties(props, _excluded$1);
|
|
442
384
|
return jsxRuntime.jsx("li", {
|
|
443
385
|
css: _ref$1,
|
|
444
386
|
children: jsxRuntime.jsx("div", _objectSpread$1({
|
|
@@ -446,7 +388,6 @@ const CalendarDay = props => {
|
|
|
446
388
|
}, rest))
|
|
447
389
|
});
|
|
448
390
|
};
|
|
449
|
-
|
|
450
391
|
CalendarDay.propTypes = {};
|
|
451
392
|
CalendarDay.displayName = 'CalendarDay';
|
|
452
393
|
var CalendarDay$1 = CalendarDay;
|
|
@@ -485,12 +426,12 @@ const WrapperComponent = /*#__PURE__*/_styled__default["default"]("div", {
|
|
|
485
426
|
name: "zjik7",
|
|
486
427
|
styles: "display:flex"
|
|
487
428
|
} );
|
|
488
|
-
|
|
489
429
|
const CalendarHeader = props => {
|
|
490
|
-
const intl = reactIntl.useIntl();
|
|
430
|
+
const intl = reactIntl.useIntl();
|
|
431
|
+
// https://codepen.io/mudassir0909/pen/eIHqB
|
|
432
|
+
|
|
491
433
|
// we prevent all our defined onClicks inside of the CalendarHeader
|
|
492
434
|
// from blurring our input.
|
|
493
|
-
|
|
494
435
|
const onMouseDown = react$1.useCallback(event => {
|
|
495
436
|
event.preventDefault();
|
|
496
437
|
}, []);
|
|
@@ -570,61 +511,47 @@ const CalendarHeader = props => {
|
|
|
570
511
|
})]
|
|
571
512
|
});
|
|
572
513
|
};
|
|
573
|
-
|
|
574
514
|
CalendarHeader.propTypes = {};
|
|
575
515
|
CalendarHeader.displayName = 'CalendarHeader';
|
|
576
516
|
var CalendarHeader$1 = CalendarHeader;
|
|
577
517
|
|
|
578
518
|
const _excluded = ["hasFooter", "hasWarning", "hasError"];
|
|
579
|
-
|
|
580
519
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
581
|
-
|
|
582
520
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
583
|
-
|
|
584
521
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
585
|
-
|
|
586
522
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
587
|
-
|
|
588
523
|
var _ref = {
|
|
589
524
|
name: "1yaiq4p",
|
|
590
525
|
styles: "padding-bottom:10px"
|
|
591
526
|
} ;
|
|
592
|
-
|
|
593
527
|
let CalendarMenu = /*#__PURE__*/function (_Component) {
|
|
594
528
|
_inherits(CalendarMenu, _Component);
|
|
595
|
-
|
|
596
529
|
var _super = _createSuper(CalendarMenu);
|
|
597
|
-
|
|
598
530
|
function CalendarMenu() {
|
|
599
531
|
_classCallCheck(this, CalendarMenu);
|
|
600
|
-
|
|
601
532
|
return _super.apply(this, arguments);
|
|
602
533
|
}
|
|
603
|
-
|
|
604
534
|
_createClass(CalendarMenu, [{
|
|
605
535
|
key: "render",
|
|
606
536
|
value: function render() {
|
|
607
537
|
const _this$props = this.props,
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
538
|
+
hasFooter = _this$props.hasFooter,
|
|
539
|
+
hasWarning = _this$props.hasWarning,
|
|
540
|
+
hasError = _this$props.hasError,
|
|
541
|
+
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
613
542
|
return jsxRuntime.jsxs("div", _objectSpread(_objectSpread({}, rest), {}, {
|
|
614
543
|
css: [/*#__PURE__*/react.css("overflow-y:scroll;color:", designSystem.designTokens.colorSolid, ";font-family:inherit;border:", designSystem.designTokens.borderForCalendarMenuWhenFocused, ";box-shadow:", designSystem.designTokens.boxShadowForCalendarMenuWhenFocused, ";border-radius:", designSystem.designTokens.borderRadiusForInput, ";margin-top:", designSystem.designTokens.spacing10, ";font-size:", designSystem.designTokens.fontSizeDefault, ";position:absolute;box-sizing:border-box;width:100%;background-color:", designSystem.designTokens.colorSurface, ";min-width:", designSystem.designTokens.constraint5, ";z-index:99999;" + ("" ), "" ), !hasFooter && _ref, hasError && /*#__PURE__*/react.css("border-color:", designSystem.designTokens.borderColorForInputWhenError, ";" + ("" ), "" ), hasWarning && /*#__PURE__*/react.css("border-color:", designSystem.designTokens.borderColorForInputWhenWarning, ";" + ("" ), "" ), "" , "" ],
|
|
615
544
|
children: [this.props.children, this.props.footer]
|
|
616
545
|
}));
|
|
617
546
|
}
|
|
618
547
|
}]);
|
|
619
|
-
|
|
620
548
|
return CalendarMenu;
|
|
621
549
|
}(react$1.Component);
|
|
622
|
-
|
|
623
550
|
CalendarMenu.displayName = 'CalendarMenu';
|
|
624
551
|
CalendarMenu.propTypes = {};
|
|
625
552
|
|
|
626
553
|
// NOTE: This string will be replaced on build time with the package version.
|
|
627
|
-
var version = "
|
|
554
|
+
var version = "16.1.0";
|
|
628
555
|
|
|
629
556
|
exports.CalendarBody = CalendarBody$1;
|
|
630
557
|
exports.CalendarContent = CalendarContent$1;
|