@commercetools-uikit/calendar-utils 12.2.2 → 12.2.6
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/dist/commercetools-uikit-calendar-utils.cjs.d.ts +1 -0
- package/dist/commercetools-uikit-calendar-utils.cjs.dev.js +302 -266
- package/dist/commercetools-uikit-calendar-utils.cjs.prod.js +247 -215
- package/dist/commercetools-uikit-calendar-utils.esm.js +262 -225
- package/dist/declarations/src/calendar-body/calendar-body.d.ts +47 -0
- package/dist/declarations/src/calendar-body/calendar-body.styles.d.ts +10 -0
- package/dist/declarations/src/calendar-body/index.d.ts +1 -0
- package/dist/declarations/src/calendar-content/calendar-content.d.ts +6 -0
- package/dist/declarations/src/calendar-content/index.d.ts +1 -0
- package/dist/declarations/src/calendar-day/calendar-day.d.ts +17 -0
- package/dist/declarations/src/calendar-day/index.d.ts +1 -0
- package/dist/declarations/src/calendar-header/calendar-header.d.ts +14 -0
- package/dist/declarations/src/calendar-header/index.d.ts +1 -0
- package/dist/declarations/src/calendar-header/messages.d.ts +28 -0
- package/dist/declarations/src/calendar-menu/calendar-menu.d.ts +13 -0
- package/dist/declarations/src/calendar-menu/index.d.ts +1 -0
- package/dist/declarations/src/calendar.d.ts +27 -0
- package/dist/declarations/src/index.d.ts +7 -0
- package/dist/declarations/src/version.d.ts +2 -0
- package/package.json +14 -18
|
@@ -10,15 +10,6 @@ var _Array$from = require('@babel/runtime-corejs3/core-js-stable/array/from');
|
|
|
10
10
|
var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
|
|
11
11
|
var _sortInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/sort');
|
|
12
12
|
var moment = require('moment');
|
|
13
|
-
var _extends = require('@babel/runtime-corejs3/helpers/extends');
|
|
14
|
-
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
15
|
-
var React = require('react');
|
|
16
|
-
require('prop-types');
|
|
17
|
-
var react = require('@emotion/react');
|
|
18
|
-
var icons = require('@commercetools-uikit/icons');
|
|
19
|
-
var Inline = require('@commercetools-uikit/spacings-inline');
|
|
20
|
-
var hooks = require('@commercetools-uikit/hooks');
|
|
21
|
-
var AccessibleButton = require('@commercetools-uikit/accessible-button');
|
|
22
13
|
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
23
14
|
var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
24
15
|
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
@@ -28,8 +19,17 @@ var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-
|
|
|
28
19
|
var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
|
|
29
20
|
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
30
21
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
22
|
+
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
23
|
+
require('prop-types');
|
|
24
|
+
var react$1 = require('react');
|
|
25
|
+
var react = require('@emotion/react');
|
|
26
|
+
var icons = require('@commercetools-uikit/icons');
|
|
27
|
+
var Inline = require('@commercetools-uikit/spacings-inline');
|
|
28
|
+
var hooks = require('@commercetools-uikit/hooks');
|
|
29
|
+
var AccessibleButton = require('@commercetools-uikit/accessible-button');
|
|
31
30
|
var designSystem = require('@commercetools-uikit/design-system');
|
|
32
31
|
var inputUtils = require('@commercetools-uikit/input-utils');
|
|
32
|
+
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
33
33
|
var _styled = require('@emotion/styled/base');
|
|
34
34
|
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
35
35
|
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
@@ -53,9 +53,6 @@ var _Array$from__default = /*#__PURE__*/_interopDefault(_Array$from);
|
|
|
53
53
|
var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray);
|
|
54
54
|
var _sortInstanceProperty__default = /*#__PURE__*/_interopDefault(_sortInstanceProperty);
|
|
55
55
|
var moment__default = /*#__PURE__*/_interopDefault(moment);
|
|
56
|
-
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
57
|
-
var Inline__default = /*#__PURE__*/_interopDefault(Inline);
|
|
58
|
-
var AccessibleButton__default = /*#__PURE__*/_interopDefault(AccessibleButton);
|
|
59
56
|
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
60
57
|
var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
|
|
61
58
|
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
|
|
@@ -64,6 +61,8 @@ var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachIns
|
|
|
64
61
|
var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors);
|
|
65
62
|
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
66
63
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
64
|
+
var Inline__default = /*#__PURE__*/_interopDefault(Inline);
|
|
65
|
+
var AccessibleButton__default = /*#__PURE__*/_interopDefault(AccessibleButton);
|
|
67
66
|
var _styled__default = /*#__PURE__*/_interopDefault(_styled);
|
|
68
67
|
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
|
|
69
68
|
var SecondaryIconButton__default = /*#__PURE__*/_interopDefault(SecondaryIconButton);
|
|
@@ -72,66 +71,66 @@ var Tooltip__default = /*#__PURE__*/_interopDefault(Tooltip);
|
|
|
72
71
|
var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construct);
|
|
73
72
|
|
|
74
73
|
var getDaysInMonth = function getDaysInMonth(day) {
|
|
75
|
-
return moment__default[
|
|
74
|
+
return moment__default["default"](day).daysInMonth();
|
|
76
75
|
};
|
|
77
76
|
var getDateInMonth = function getDateInMonth(day) {
|
|
78
|
-
return moment__default[
|
|
77
|
+
return moment__default["default"](day).date();
|
|
79
78
|
};
|
|
80
79
|
var getToday = function getToday() {
|
|
81
|
-
return moment__default[
|
|
80
|
+
return moment__default["default"]().format('YYYY-MM-DD');
|
|
82
81
|
};
|
|
83
82
|
var formatDate = function formatDate(day, locale) {
|
|
84
|
-
return day ? moment__default[
|
|
83
|
+
return day ? moment__default["default"](day, 'YYYY-MM-DD', locale).format('L') : '';
|
|
85
84
|
};
|
|
86
85
|
var changeMonth = function changeMonth(day, delta) {
|
|
87
|
-
return moment__default[
|
|
86
|
+
return moment__default["default"](day).add(delta, 'month').format('YYYY-MM-DD');
|
|
88
87
|
};
|
|
89
88
|
var getNextDay = function getNextDay(day) {
|
|
90
|
-
return moment__default[
|
|
89
|
+
return moment__default["default"](day).add(1, 'day').format('YYYY-MM-DD');
|
|
91
90
|
};
|
|
92
91
|
var getPreviousDay = function getPreviousDay(day) {
|
|
93
|
-
return moment__default[
|
|
92
|
+
return moment__default["default"](day).subtract(1, 'day').format('YYYY-MM-DD');
|
|
94
93
|
};
|
|
95
94
|
var getPaddingDayCount = function getPaddingDayCount(day, locale) {
|
|
96
|
-
var firstDayOfWeek = moment__default[
|
|
97
|
-
var firstDayOfMonth = moment__default[
|
|
95
|
+
var firstDayOfWeek = moment__default["default"].localeData(locale).firstDayOfWeek();
|
|
96
|
+
var firstDayOfMonth = moment__default["default"](day).startOf('month').day(); // ensure number is always positive
|
|
98
97
|
|
|
99
98
|
return (firstDayOfMonth - firstDayOfWeek + 7) % 7;
|
|
100
99
|
};
|
|
101
100
|
var getWeekdayNames = function getWeekdayNames(locale) {
|
|
102
101
|
var _context;
|
|
103
102
|
|
|
104
|
-
var weekDays = moment__default[
|
|
105
|
-
var firstDay = moment__default[
|
|
106
|
-
return _concatInstanceProperty__default[
|
|
103
|
+
var weekDays = moment__default["default"].localeData(locale).weekdaysMin();
|
|
104
|
+
var firstDay = moment__default["default"].localeData(locale).firstDayOfWeek();
|
|
105
|
+
return _concatInstanceProperty__default["default"](_context = []).call(_context, _toConsumableArray(_sliceInstanceProperty__default["default"](weekDays).call(weekDays, firstDay)), _toConsumableArray(_sliceInstanceProperty__default["default"](weekDays).call(weekDays, 0, firstDay)));
|
|
107
106
|
};
|
|
108
107
|
var getMonthCalendarLabel = function getMonthCalendarLabel(day, locale) {
|
|
109
|
-
return moment__default[
|
|
108
|
+
return moment__default["default"](day, 'YYYY-MM-DD', locale).format('MMMM');
|
|
110
109
|
};
|
|
111
110
|
var getYearCalendarLabel = function getYearCalendarLabel(day, locale) {
|
|
112
|
-
return moment__default[
|
|
111
|
+
return moment__default["default"](day, 'YYYY-MM-DD', locale).format('YYYY');
|
|
113
112
|
};
|
|
114
113
|
var isSameDay = function isSameDay(a, b) {
|
|
115
|
-
return moment__default[
|
|
114
|
+
return moment__default["default"](a).isSame(b, 'day');
|
|
116
115
|
};
|
|
117
116
|
var getCalendarDayLabel = function getCalendarDayLabel(day) {
|
|
118
|
-
return moment__default[
|
|
117
|
+
return moment__default["default"](day).format('D');
|
|
119
118
|
};
|
|
120
119
|
var isBetween = function isBetween(item, start, end) {
|
|
121
|
-
var itemDate = moment__default[
|
|
122
|
-
var startDate = moment__default[
|
|
123
|
-
var endDate = moment__default[
|
|
120
|
+
var itemDate = moment__default["default"](item);
|
|
121
|
+
var startDate = moment__default["default"](start);
|
|
122
|
+
var endDate = moment__default["default"](end);
|
|
124
123
|
return itemDate.isBetween(startDate, endDate) || itemDate.isBetween(endDate, startDate);
|
|
125
124
|
};
|
|
126
125
|
|
|
127
126
|
var changeDateInMonth = function changeDateInMonth(day, dayOfMonth) {
|
|
128
|
-
return moment__default[
|
|
127
|
+
return moment__default["default"](day).date(dayOfMonth).format('YYYY-MM-DD');
|
|
129
128
|
};
|
|
130
129
|
|
|
131
130
|
var createCalendarItems = function createCalendarItems(day) {
|
|
132
131
|
var _context2;
|
|
133
132
|
|
|
134
|
-
return _mapInstanceProperty__default[
|
|
133
|
+
return _mapInstanceProperty__default["default"](_context2 = _Array$from__default["default"]({
|
|
135
134
|
length: getDaysInMonth(day)
|
|
136
135
|
})).call(_context2, function (_, i) {
|
|
137
136
|
var dayOfMonth = i + 1;
|
|
@@ -141,7 +140,7 @@ var createCalendarItems = function createCalendarItems(day) {
|
|
|
141
140
|
};
|
|
142
141
|
var createItemRangeToString = function createItemRangeToString(locale) {
|
|
143
142
|
return function (item) {
|
|
144
|
-
return _Array$isArray__default[
|
|
143
|
+
return _Array$isArray__default["default"](item) ? _mapInstanceProperty__default["default"](item).call(item, function (i) {
|
|
145
144
|
return i ? formatDate(i, locale) : '';
|
|
146
145
|
}).join(' - ') : formatDate(item, locale);
|
|
147
146
|
};
|
|
@@ -154,20 +153,20 @@ var createItemToString = function createItemToString(locale) {
|
|
|
154
153
|
var formatRange = function formatRange(range, locale) {
|
|
155
154
|
var _context3;
|
|
156
155
|
|
|
157
|
-
return _mapInstanceProperty__default[
|
|
156
|
+
return _mapInstanceProperty__default["default"](_context3 = _sortInstanceProperty__default["default"](range).call(range)).call(_context3, function (item) {
|
|
158
157
|
return formatDate(item, locale);
|
|
159
158
|
}).join(' - ');
|
|
160
159
|
};
|
|
161
160
|
var parseInputToDate = function parseInputToDate(text, locale) {
|
|
162
|
-
var localeDate = moment__default[
|
|
161
|
+
var localeDate = moment__default["default"](text, moment__default["default"].localeData(locale).longDateFormat('L'), locale);
|
|
163
162
|
if (localeDate.isValid()) return localeDate.format('YYYY-MM-DD');
|
|
164
163
|
return '';
|
|
165
164
|
};
|
|
166
165
|
var getIsDateInRange = function getIsDateInRange(item, min, max) {
|
|
167
|
-
var itemDate = moment__default[
|
|
166
|
+
var itemDate = moment__default["default"](item);
|
|
168
167
|
|
|
169
168
|
if (min && max) {
|
|
170
|
-
return itemDate.isBetween(min, max, null, []);
|
|
169
|
+
return itemDate.isBetween(min, max, null, '[]');
|
|
171
170
|
}
|
|
172
171
|
|
|
173
172
|
if (min && !max) {
|
|
@@ -182,24 +181,25 @@ var getIsDateInRange = function getIsDateInRange(item, min, max) {
|
|
|
182
181
|
};
|
|
183
182
|
var getExampleDateStrings = function getExampleDateStrings() {
|
|
184
183
|
return {
|
|
185
|
-
currentDate: moment__default[
|
|
186
|
-
preselectedDate: moment__default[
|
|
187
|
-
minDate: moment__default[
|
|
188
|
-
maxDate: moment__default[
|
|
184
|
+
currentDate: moment__default["default"]().format('YYYY-MM-DD'),
|
|
185
|
+
preselectedDate: moment__default["default"]().add(3, 'days').format('YYYY-MM-DD'),
|
|
186
|
+
minDate: moment__default["default"]().format('YYYY-MM-DD'),
|
|
187
|
+
maxDate: moment__default["default"]().add(1, 'year').format('YYYY-MM-DD')
|
|
189
188
|
};
|
|
190
189
|
};
|
|
191
190
|
|
|
192
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default[
|
|
191
|
+
function ownKeys$3(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); if (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; }
|
|
193
192
|
|
|
194
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default[
|
|
193
|
+
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default["default"](_context = ownKeys$3(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default["default"]) { _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)); } else { var _context2; _forEachInstanceProperty__default["default"](_context2 = ownKeys$3(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } } return target; }
|
|
194
|
+
|
|
195
|
+
// NOTE: order is important here
|
|
195
196
|
// * a disabled-field currently does not display warning/error-states so it takes precedence
|
|
196
197
|
// * a readonly-field cannot be changed, but it might be relevant for validation, so error and warning are checked first
|
|
197
198
|
// how you can interact with the field is controlled separately by the props, this only influences visuals
|
|
199
|
+
var getClearSectionStyles = function getClearSectionStyles(theme) {
|
|
200
|
+
var vars = _objectSpread$3(_objectSpread$3({}, designSystem.customProperties), theme);
|
|
198
201
|
|
|
199
|
-
|
|
200
|
-
var vars = _objectSpread(_objectSpread({}, designSystem.customProperties), props.theme);
|
|
201
|
-
|
|
202
|
-
return /*#__PURE__*/react.css("align-items:center;box-sizing:border-box;display:flex;margin-right:", vars.spacingXs, ";cursor:pointer;transition:color ", vars.transitionStandard, ",border-color ", vars.transitionStandard, ";&:hover svg *{fill:", vars.colorWarning, ";}" + ("" ));
|
|
202
|
+
return /*#__PURE__*/react.css("align-items:center;box-sizing:border-box;display:flex;margin-right:", vars.spacingXs, ";cursor:pointer;transition:color ", vars.transitionStandard, ",border-color ", vars.transitionStandard, ";&:hover svg *{fill:", vars.colorWarning, ";}" + ("" ), "" );
|
|
203
203
|
};
|
|
204
204
|
|
|
205
205
|
var getIconBorderColor = function getIconBorderColor(vars, props, state) {
|
|
@@ -246,10 +246,10 @@ var getIconFontColor = function getIconFontColor(vars, props) {
|
|
|
246
246
|
return 'initial';
|
|
247
247
|
};
|
|
248
248
|
|
|
249
|
-
var getCalendarIconContainerStyles = function getCalendarIconContainerStyles(props, state) {
|
|
250
|
-
var vars = _objectSpread(_objectSpread({}, designSystem.customProperties),
|
|
249
|
+
var getCalendarIconContainerStyles = function getCalendarIconContainerStyles(props, state, theme) {
|
|
250
|
+
var vars = _objectSpread$3(_objectSpread$3({}, designSystem.customProperties), theme);
|
|
251
251
|
|
|
252
|
-
return /*#__PURE__*/react.css("align-items:center;box-sizing:border-box;background:none;border:0;border-left:1px solid ", vars.borderColorForInput, ";border-top-right-radius:", vars.borderRadiusForInput, ";border-bottom-right-radius:", vars.borderRadiusForInput, ";border-color:", getIconBorderColor(vars, props, state), ";color:", getIconFontColor(vars, props), ";cursor:", props.isDisabled ? 'not-allowed' : 'default', ";height:100%;display:flex;padding:", vars.spacingXs, ";outline:0;transition:color ", vars.transitionStandard, ",border-color ", vars.transitionStandard, ";&:active,&:hover:not(:disabled)&:not(:read-only),&:focus{border-color:", vars.borderColorForInputWhenFocused, ";}" + ("" ));
|
|
252
|
+
return /*#__PURE__*/react.css("align-items:center;box-sizing:border-box;background:none;border:0;border-left:1px solid ", vars.borderColorForInput, ";border-top-right-radius:", vars.borderRadiusForInput, ";border-bottom-right-radius:", vars.borderRadiusForInput, ";border-color:", getIconBorderColor(vars, props, state), ";color:", getIconFontColor(vars, props), ";cursor:", props.isDisabled ? 'not-allowed' : 'default', ";height:100%;display:flex;padding:", vars.spacingXs, ";outline:0;transition:color ", vars.transitionStandard, ",border-color ", vars.transitionStandard, ";&:active,&:hover:not(:disabled)&:not(:read-only),&:focus{border-color:", vars.borderColorForInputWhenFocused, ";}" + ("" ), "" );
|
|
253
253
|
};
|
|
254
254
|
|
|
255
255
|
var getInputBorderColor = function getInputBorderColor(vars, props, state) {
|
|
@@ -296,10 +296,10 @@ var getInputFontColor = function getInputFontColor(vars, props) {
|
|
|
296
296
|
return vars.fontColorForInput;
|
|
297
297
|
};
|
|
298
298
|
|
|
299
|
-
var getInputContainerStyles = function getInputContainerStyles(props, state) {
|
|
300
|
-
var vars = _objectSpread(_objectSpread({}, designSystem.customProperties),
|
|
299
|
+
var getInputContainerStyles = function getInputContainerStyles(props, state, theme) {
|
|
300
|
+
var vars = _objectSpread$3(_objectSpread$3({}, designSystem.customProperties), theme);
|
|
301
301
|
|
|
302
|
-
return /*#__PURE__*/react.css("appearance:none;background-color:", props.isDisabled ? vars.backgroundColorForInputWhenDisabled : vars.backgroundColorForInput, ";border:1px solid ", getInputBorderColor(vars, props, state), ";border-radius:", vars.borderRadiusForInput, ";box-sizing:border-box;color:", getInputFontColor(vars, props), ";cursor:", props.isDisabled ? 'not-allowed' : 'default', ";width:100%;height:", vars.sizeHeightInput, ";align-items:center;display:flex;font-size:", vars.fontSizeDefault, ";font-family:inherit;transition:border-color ", vars.transitionStandard, ",box-shadow ", vars.transitionStandard, ";&:focus-within{border-color:", vars.borderColorForInputWhenFocused, ";box-shadow:inset 0 0 0 2px ", vars.borderColorForInputWhenFocused, ";}&:focus,&:hover{border-color:", props.isDisabled || props.hasError || props.hasWarning || props.isReadOnly || (props.isOpen || state.isFocused) && !props.isReadOnly ? '' : vars.borderColorForInputWhenFocused, ";}" + ("" ));
|
|
302
|
+
return /*#__PURE__*/react.css("appearance:none;background-color:", props.isDisabled ? vars.backgroundColorForInputWhenDisabled : vars.backgroundColorForInput, ";border:1px solid ", getInputBorderColor(vars, props, state), ";border-radius:", vars.borderRadiusForInput, ";box-sizing:border-box;color:", getInputFontColor(vars, props), ";cursor:", props.isDisabled ? 'not-allowed' : 'default', ";width:100%;height:", vars.sizeHeightInput, ";align-items:center;display:flex;font-size:", vars.fontSizeDefault, ";font-family:inherit;transition:border-color ", vars.transitionStandard, ",box-shadow ", vars.transitionStandard, ";&:focus-within{border-color:", vars.borderColorForInputWhenFocused, ";box-shadow:inset 0 0 0 2px ", vars.borderColorForInputWhenFocused, ";}&:focus,&:hover{border-color:", props.isDisabled || props.hasError || props.hasWarning || props.isReadOnly || (props.isOpen || state.isFocused) && !props.isReadOnly ? '' : vars.borderColorForInputWhenFocused, ";}" + ("" ), "" );
|
|
303
303
|
};
|
|
304
304
|
|
|
305
305
|
var _ref$2 = {
|
|
@@ -307,100 +307,112 @@ var _ref$2 = {
|
|
|
307
307
|
styles: "border:none;background:none;&:focus{box-shadow:none;}"
|
|
308
308
|
} ;
|
|
309
309
|
|
|
310
|
-
var getDateTimeInputStyles = function getDateTimeInputStyles(props) {
|
|
311
|
-
var baseStyles = [inputUtils.getInputStyles(props), _ref$2];
|
|
310
|
+
var getDateTimeInputStyles = function getDateTimeInputStyles(props, theme) {
|
|
311
|
+
var baseStyles = [inputUtils.getInputStyles(props, theme), _ref$2];
|
|
312
312
|
return baseStyles;
|
|
313
313
|
};
|
|
314
314
|
|
|
315
|
+
function ownKeys$2(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); if (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; }
|
|
316
|
+
|
|
317
|
+
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default["default"](_context = ownKeys$2(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default["default"]) { _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)); } else { var _context2; _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; }
|
|
315
318
|
var ClearSection = function ClearSection(props) {
|
|
316
|
-
|
|
317
|
-
|
|
319
|
+
var theme = react.useTheme();
|
|
320
|
+
return jsxRuntime.jsx(AccessibleButton__default["default"], {
|
|
321
|
+
css: getClearSectionStyles(theme),
|
|
318
322
|
label: "clear",
|
|
319
323
|
onClick: props.onClear,
|
|
320
|
-
"aria-label": "clear"
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
324
|
+
"aria-label": "clear",
|
|
325
|
+
children: jsxRuntime.jsx(icons.CloseIcon, {
|
|
326
|
+
size: "medium",
|
|
327
|
+
color: "solid"
|
|
328
|
+
})
|
|
329
|
+
});
|
|
325
330
|
};
|
|
326
|
-
ClearSection.displayName = 'ClearSection';
|
|
327
331
|
ClearSection.propTypes = {};
|
|
332
|
+
ClearSection.displayName = 'ClearSection';
|
|
333
|
+
var defaultProps = {
|
|
334
|
+
isClearable: true
|
|
335
|
+
};
|
|
328
336
|
var CalendarBody = function CalendarBody(props) {
|
|
337
|
+
var _props$inputProps, _props$inputProps2, _props$toggleButtonPr, _props$toggleButtonPr2, _props$inputProps3;
|
|
338
|
+
|
|
329
339
|
var _useToggleState = hooks.useToggleState(false),
|
|
330
340
|
_useToggleState2 = _slicedToArray(_useToggleState, 2),
|
|
331
341
|
isFocused = _useToggleState2[0],
|
|
332
342
|
toggleIsFocused = _useToggleState2[1];
|
|
333
343
|
|
|
334
|
-
var
|
|
335
|
-
var
|
|
344
|
+
var theme = react.useTheme();
|
|
345
|
+
var onInputFocus = (_props$inputProps = props.inputProps) === null || _props$inputProps === void 0 ? void 0 : _props$inputProps.onFocus;
|
|
346
|
+
var handleInputFocus = react$1.useCallback(function (event) {
|
|
336
347
|
toggleIsFocused(true);
|
|
337
348
|
if (onInputFocus) onInputFocus(event);
|
|
338
349
|
}, [onInputFocus, toggleIsFocused]);
|
|
339
|
-
var onInputBlur = props.inputProps.onBlur;
|
|
340
|
-
var handleInputBlur =
|
|
350
|
+
var onInputBlur = (_props$inputProps2 = props.inputProps) === null || _props$inputProps2 === void 0 ? void 0 : _props$inputProps2.onBlur;
|
|
351
|
+
var handleInputBlur = react$1.useCallback(function (event) {
|
|
341
352
|
toggleIsFocused(false);
|
|
342
353
|
if (onInputBlur) onInputBlur(event);
|
|
343
354
|
}, [onInputBlur, toggleIsFocused]);
|
|
344
|
-
var onToggleFocus = props.toggleButtonProps.onFocus;
|
|
345
|
-
var handleToggleFocus =
|
|
355
|
+
var onToggleFocus = (_props$toggleButtonPr = props.toggleButtonProps) === null || _props$toggleButtonPr === void 0 ? void 0 : _props$toggleButtonPr.onFocus;
|
|
356
|
+
var handleToggleFocus = react$1.useCallback(function (event) {
|
|
346
357
|
toggleIsFocused(true);
|
|
347
358
|
if (onToggleFocus) onToggleFocus(event);
|
|
348
359
|
}, [onToggleFocus, toggleIsFocused]);
|
|
349
|
-
var onToggleBlur = props.toggleButtonProps.onBlur;
|
|
350
|
-
var handleToggleBlur =
|
|
360
|
+
var onToggleBlur = (_props$toggleButtonPr2 = props.toggleButtonProps) === null || _props$toggleButtonPr2 === void 0 ? void 0 : _props$toggleButtonPr2.onBlur;
|
|
361
|
+
var handleToggleBlur = react$1.useCallback(function (event) {
|
|
351
362
|
toggleIsFocused(false);
|
|
352
363
|
if (onToggleBlur) onToggleBlur(event);
|
|
353
364
|
}, [onToggleBlur, toggleIsFocused]);
|
|
354
365
|
var disabledOrReadOnly = props.isDisabled || props.isReadOnly;
|
|
355
|
-
return
|
|
356
|
-
alignItems: "center"
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
366
|
+
return jsxRuntime.jsx(Inline__default["default"], {
|
|
367
|
+
alignItems: "center",
|
|
368
|
+
children: jsxRuntime.jsxs("div", {
|
|
369
|
+
css: getInputContainerStyles(props, {
|
|
370
|
+
isFocused: isFocused
|
|
371
|
+
}, theme),
|
|
372
|
+
children: [jsxRuntime.jsx("input", _objectSpread$2(_objectSpread$2({
|
|
373
|
+
ref: props.inputRef
|
|
374
|
+
}, props.inputProps), {}, {
|
|
375
|
+
disabled: props.isDisabled,
|
|
376
|
+
readOnly: props.isReadOnly,
|
|
377
|
+
css: getDateTimeInputStyles(props, theme),
|
|
378
|
+
onFocus: handleInputFocus,
|
|
379
|
+
onBlur: handleInputBlur,
|
|
380
|
+
"aria-readonly": props.isReadOnly
|
|
381
|
+
})), !disabledOrReadOnly && props.hasSelection && props.isClearable && jsxRuntime.jsx(ClearSection, {
|
|
382
|
+
hasError: props.hasError,
|
|
383
|
+
hasWarning: props.hasWarning,
|
|
384
|
+
isFocused: isFocused,
|
|
385
|
+
isOpen: props.isOpen,
|
|
386
|
+
onClear: props.onClear
|
|
387
|
+
}), jsxRuntime.jsx("button", _objectSpread$2(_objectSpread$2({
|
|
388
|
+
type: "button",
|
|
389
|
+
css: getCalendarIconContainerStyles(props, {
|
|
390
|
+
isFocused: isFocused
|
|
391
|
+
}, theme)
|
|
392
|
+
}, props.toggleButtonProps), {}, {
|
|
393
|
+
onFocus: handleToggleFocus,
|
|
394
|
+
onBlur: handleToggleBlur,
|
|
395
|
+
disabled: disabledOrReadOnly,
|
|
396
|
+
onKeyDown: (_props$inputProps3 = props.inputProps) === null || _props$inputProps3 === void 0 ? void 0 : _props$inputProps3.onKeyDown
|
|
397
|
+
/* keyboard users don't need this button */
|
|
398
|
+
,
|
|
399
|
+
tabIndex: -1,
|
|
400
|
+
children: props.icon === 'clock' ? jsxRuntime.jsx(icons.ClockIcon, {
|
|
401
|
+
color: disabledOrReadOnly ? 'neutral60' : 'solid'
|
|
402
|
+
}) : jsxRuntime.jsx(icons.CalendarIcon, {
|
|
403
|
+
color: disabledOrReadOnly ? 'neutral60' : 'solid'
|
|
404
|
+
})
|
|
405
|
+
}))]
|
|
380
406
|
})
|
|
381
|
-
}
|
|
382
|
-
onFocus: handleToggleFocus,
|
|
383
|
-
onBlur: handleToggleBlur,
|
|
384
|
-
disabled: disabledOrReadOnly,
|
|
385
|
-
onKeyDown: props.inputProps.onKeyDown
|
|
386
|
-
/* keyboard users don't need this button */
|
|
387
|
-
,
|
|
388
|
-
tabIndex: -1
|
|
389
|
-
}), props.icon === 'clock' ? react.jsx(icons.ClockIcon, {
|
|
390
|
-
color: disabledOrReadOnly ? 'neutral60' : 'solid'
|
|
391
|
-
}) : react.jsx(icons.CalendarIcon, {
|
|
392
|
-
color: disabledOrReadOnly ? 'neutral60' : 'solid'
|
|
393
|
-
}))));
|
|
407
|
+
});
|
|
394
408
|
};
|
|
395
|
-
CalendarBody.displayName = 'CalendarBody';
|
|
396
409
|
CalendarBody.propTypes = {};
|
|
397
|
-
CalendarBody.
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
var calendarBody = react.withTheme(CalendarBody);
|
|
410
|
+
CalendarBody.displayName = 'CalendarBody';
|
|
411
|
+
CalendarBody.defaultProps = defaultProps;
|
|
412
|
+
var CalendarBody$1 = CalendarBody;
|
|
401
413
|
|
|
402
|
-
var CalendarContent = _styled__default[
|
|
403
|
-
target: "
|
|
414
|
+
var CalendarContent = _styled__default["default"]("ul", {
|
|
415
|
+
target: "e17zfb0v0"
|
|
404
416
|
} )({
|
|
405
417
|
name: "1en5ct5",
|
|
406
418
|
styles: "margin:0;padding:0 1%"
|
|
@@ -410,41 +422,45 @@ var CalendarContent$1 = CalendarContent;
|
|
|
410
422
|
|
|
411
423
|
var _excluded$1 = ["isHighlighted", "isSelected", "isRangeStart", "isRangeBetween", "isRangeEnd", "isToday"];
|
|
412
424
|
|
|
425
|
+
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); if (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; }
|
|
426
|
+
|
|
427
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context3; _forEachInstanceProperty__default["default"](_context3 = ownKeys$1(Object(source), true)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default["default"]) { _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)); } else { var _context4; _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; }
|
|
428
|
+
|
|
413
429
|
var getStyles = function getStyles(props) {
|
|
414
430
|
var _context, _context2;
|
|
415
431
|
|
|
416
432
|
var styles = [];
|
|
417
433
|
|
|
418
|
-
if (!_includesInstanceProperty__default[
|
|
419
|
-
styles.push( /*#__PURE__*/react.css("text-align:center;padding:", designSystem.customProperties.spacingS, " 0;cursor:default;border-radius:", designSystem.customProperties.borderRadius4, ";" + ("" )));
|
|
434
|
+
if (!_includesInstanceProperty__default["default"](_context = ['heading', 'spacing']).call(_context, props.type || '')) {
|
|
435
|
+
styles.push( /*#__PURE__*/react.css("text-align:center;padding:", designSystem.customProperties.spacingS, " 0;cursor:default;border-radius:", designSystem.customProperties.borderRadius4, ";" + ("" ), "" ));
|
|
420
436
|
}
|
|
421
437
|
|
|
422
|
-
if (_includesInstanceProperty__default[
|
|
423
|
-
styles.push( /*#__PURE__*/react.css("text-align:center;padding:", designSystem.customProperties.spacingS, " 0;cursor:default;color:", designSystem.customProperties.colorNeutral60, ";" + ("" )));
|
|
438
|
+
if (_includesInstanceProperty__default["default"](_context2 = ['heading', 'spacing']).call(_context2, props.type || '')) {
|
|
439
|
+
styles.push( /*#__PURE__*/react.css("text-align:center;padding:", designSystem.customProperties.spacingS, " 0;cursor:default;color:", designSystem.customProperties.colorNeutral60, ";" + ("" ), "" ));
|
|
424
440
|
}
|
|
425
441
|
|
|
426
442
|
if (props.isHighlighted) {
|
|
427
|
-
styles.push( /*#__PURE__*/react.css("background-color:", designSystem.customProperties.colorNeutral90, ";" + ("" )));
|
|
443
|
+
styles.push( /*#__PURE__*/react.css("background-color:", designSystem.customProperties.colorNeutral90, ";" + ("" ), "" ));
|
|
428
444
|
}
|
|
429
445
|
|
|
430
446
|
if (props.isSelected) {
|
|
431
|
-
styles.push( /*#__PURE__*/react.css("background-color:", designSystem.customProperties.colorPrimary, ";color:", designSystem.customProperties.colorSurface, ";" + ("" )));
|
|
447
|
+
styles.push( /*#__PURE__*/react.css("background-color:", designSystem.customProperties.colorPrimary, ";color:", designSystem.customProperties.colorSurface, ";" + ("" ), "" ));
|
|
432
448
|
}
|
|
433
449
|
|
|
434
450
|
if (props.isRangeStart || props.isRangeEnd) {
|
|
435
|
-
styles.push( /*#__PURE__*/react.css("background-color:", designSystem.customProperties.colorPrimary40, ";color:", designSystem.customProperties.colorSurface, ";" + ("" )));
|
|
451
|
+
styles.push( /*#__PURE__*/react.css("background-color:", designSystem.customProperties.colorPrimary40, ";color:", designSystem.customProperties.colorSurface, ";" + ("" ), "" ));
|
|
436
452
|
}
|
|
437
453
|
|
|
438
454
|
if (props.isRangeBetween) {
|
|
439
|
-
styles.push( /*#__PURE__*/react.css("background-color:", designSystem.customProperties.colorNeutral90, ";color:", designSystem.customProperties.fontColorForInput, ";" + ("" )));
|
|
455
|
+
styles.push( /*#__PURE__*/react.css("background-color:", designSystem.customProperties.colorNeutral90, ";color:", designSystem.customProperties.fontColorForInput, ";" + ("" ), "" ));
|
|
440
456
|
}
|
|
441
457
|
|
|
442
458
|
if (!props.isSelected && !props.isRangeStart && !props.isRangeEnd && props.isToday) {
|
|
443
|
-
styles.push( /*#__PURE__*/react.css("color:", designSystem.customProperties.colorInfo, ";font-weight:bold;" + ("" )));
|
|
459
|
+
styles.push( /*#__PURE__*/react.css("color:", designSystem.customProperties.colorInfo, ";font-weight:bold;" + ("" ), "" ));
|
|
444
460
|
}
|
|
445
461
|
|
|
446
462
|
if (props.disabled) {
|
|
447
|
-
styles.push( /*#__PURE__*/react.css("color:", designSystem.customProperties.fontColorForInputWhenDisabled, ";cursor:not-allowed;" + ("" )));
|
|
463
|
+
styles.push( /*#__PURE__*/react.css("color:", designSystem.customProperties.fontColorForInputWhenDisabled, ";cursor:not-allowed;" + ("" ), "" ));
|
|
448
464
|
}
|
|
449
465
|
|
|
450
466
|
return styles;
|
|
@@ -464,15 +480,16 @@ var CalendarDay = function CalendarDay(props) {
|
|
|
464
480
|
props.isToday;
|
|
465
481
|
var rest = _objectWithoutProperties(props, _excluded$1);
|
|
466
482
|
|
|
467
|
-
return
|
|
468
|
-
css: _ref$1
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
483
|
+
return jsxRuntime.jsx("li", {
|
|
484
|
+
css: _ref$1,
|
|
485
|
+
children: jsxRuntime.jsx("div", _objectSpread$1({
|
|
486
|
+
css: getStyles(props)
|
|
487
|
+
}, rest))
|
|
488
|
+
});
|
|
472
489
|
};
|
|
473
490
|
|
|
474
|
-
CalendarDay.displayName = 'CalendarDay';
|
|
475
491
|
CalendarDay.propTypes = {};
|
|
492
|
+
CalendarDay.displayName = 'CalendarDay';
|
|
476
493
|
var CalendarDay$1 = CalendarDay;
|
|
477
494
|
|
|
478
495
|
var messages = reactIntl.defineMessages({
|
|
@@ -503,8 +520,8 @@ var messages = reactIntl.defineMessages({
|
|
|
503
520
|
}
|
|
504
521
|
});
|
|
505
522
|
|
|
506
|
-
var WrapperComponent = _styled__default[
|
|
507
|
-
target: "
|
|
523
|
+
var WrapperComponent = _styled__default["default"]("div", {
|
|
524
|
+
target: "e1q1nv850"
|
|
508
525
|
} )({
|
|
509
526
|
name: "zjik7",
|
|
510
527
|
styles: "display:flex"
|
|
@@ -515,90 +532,104 @@ var CalendarHeader = function CalendarHeader(props) {
|
|
|
515
532
|
// we prevent all our defined onClicks inside of the CalendarHeader
|
|
516
533
|
// from blurring our input.
|
|
517
534
|
|
|
518
|
-
var onMouseDown =
|
|
535
|
+
var onMouseDown = react$1.useCallback(function (event) {
|
|
519
536
|
event.preventDefault();
|
|
520
537
|
}, []);
|
|
521
|
-
return
|
|
538
|
+
return jsxRuntime.jsxs("div", {
|
|
522
539
|
onMouseDown: onMouseDown,
|
|
523
|
-
css: /*#__PURE__*/react.css("display:flex;padding:10px 2% 6px;margin-bottom:", designSystem.customProperties.spacingXs, ";justify-content:space-between;border-bottom:1px solid ", designSystem.customProperties.colorNeutral90, ";" + ("" ))
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
540
|
+
css: /*#__PURE__*/react.css("display:flex;padding:10px 2% 6px;margin-bottom:", designSystem.customProperties.spacingXs, ";justify-content:space-between;border-bottom:1px solid ", designSystem.customProperties.colorNeutral90, ";" + ("" ), "" ),
|
|
541
|
+
children: [jsxRuntime.jsxs(Inline__default["default"], {
|
|
542
|
+
scale: "xs",
|
|
543
|
+
alignItems: "center",
|
|
544
|
+
children: [jsxRuntime.jsx(Tooltip__default["default"], {
|
|
545
|
+
title: intl.formatMessage(messages.previousMonthTooltip),
|
|
546
|
+
components: {
|
|
547
|
+
WrapperComponent: WrapperComponent
|
|
548
|
+
},
|
|
549
|
+
children: jsxRuntime.jsx(SecondaryIconButton__default["default"], {
|
|
550
|
+
label: "show prev month",
|
|
551
|
+
onClick: props.onPrevMonthClick,
|
|
552
|
+
icon: jsxRuntime.jsx(icons.AngleLeftIcon, {
|
|
553
|
+
size: "medium"
|
|
554
|
+
})
|
|
555
|
+
})
|
|
556
|
+
}), jsxRuntime.jsx(Tooltip__default["default"], {
|
|
557
|
+
title: intl.formatMessage(messages.todayTooltip),
|
|
558
|
+
components: {
|
|
559
|
+
WrapperComponent: WrapperComponent
|
|
560
|
+
},
|
|
561
|
+
children: jsxRuntime.jsx(SecondaryIconButton__default["default"], {
|
|
562
|
+
label: "show today",
|
|
563
|
+
onClick: props.onTodayClick,
|
|
564
|
+
icon: jsxRuntime.jsx(icons.CircleIcon, {
|
|
565
|
+
size: "medium"
|
|
566
|
+
})
|
|
567
|
+
})
|
|
568
|
+
}), jsxRuntime.jsx(Tooltip__default["default"], {
|
|
569
|
+
title: intl.formatMessage(messages.nextMonthTooltip),
|
|
570
|
+
components: {
|
|
571
|
+
WrapperComponent: WrapperComponent
|
|
572
|
+
},
|
|
573
|
+
children: jsxRuntime.jsx(SecondaryIconButton__default["default"], {
|
|
574
|
+
label: "show next month",
|
|
575
|
+
onClick: props.onNextMonthClick,
|
|
576
|
+
icon: jsxRuntime.jsx(icons.AngleRightIcon, {
|
|
577
|
+
size: "medium"
|
|
578
|
+
})
|
|
579
|
+
})
|
|
580
|
+
}), jsxRuntime.jsx(Text__default["default"].Body, {
|
|
581
|
+
as: "span",
|
|
582
|
+
isBold: true,
|
|
583
|
+
children: props.monthLabel
|
|
584
|
+
})]
|
|
585
|
+
}), jsxRuntime.jsxs(Inline__default["default"], {
|
|
586
|
+
scale: "xs",
|
|
587
|
+
alignItems: "center",
|
|
588
|
+
children: [jsxRuntime.jsx(Tooltip__default["default"], {
|
|
589
|
+
title: intl.formatMessage(messages.previousYearTooltip),
|
|
590
|
+
components: {
|
|
591
|
+
WrapperComponent: WrapperComponent
|
|
592
|
+
},
|
|
593
|
+
children: jsxRuntime.jsx(SecondaryIconButton__default["default"], {
|
|
594
|
+
label: "show prev year",
|
|
595
|
+
onClick: props.onPrevYearClick,
|
|
596
|
+
icon: jsxRuntime.jsx(icons.AngleLeftIcon, {
|
|
597
|
+
size: "medium"
|
|
598
|
+
})
|
|
599
|
+
})
|
|
600
|
+
}), jsxRuntime.jsx(Text__default["default"].Body, {
|
|
601
|
+
isBold: true,
|
|
602
|
+
children: props.yearLabel
|
|
603
|
+
}), jsxRuntime.jsx(Tooltip__default["default"], {
|
|
604
|
+
title: intl.formatMessage(messages.nextYearTooltip),
|
|
605
|
+
components: {
|
|
606
|
+
WrapperComponent: WrapperComponent
|
|
607
|
+
},
|
|
608
|
+
children: jsxRuntime.jsx(SecondaryIconButton__default["default"], {
|
|
609
|
+
label: "show next year",
|
|
610
|
+
onClick: props.onNextYearClick,
|
|
611
|
+
icon: jsxRuntime.jsx(icons.AngleRightIcon, {
|
|
612
|
+
size: "medium"
|
|
613
|
+
})
|
|
614
|
+
})
|
|
615
|
+
})]
|
|
616
|
+
})]
|
|
617
|
+
});
|
|
591
618
|
};
|
|
592
619
|
|
|
593
|
-
CalendarHeader.displayName = 'CalendarHeader';
|
|
594
620
|
CalendarHeader.propTypes = {};
|
|
621
|
+
CalendarHeader.displayName = 'CalendarHeader';
|
|
595
622
|
var CalendarHeader$1 = CalendarHeader;
|
|
596
623
|
|
|
597
624
|
var _excluded = ["hasFooter", "hasWarning", "hasError"];
|
|
598
625
|
|
|
599
|
-
function
|
|
626
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); if (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; }
|
|
627
|
+
|
|
628
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty__default["default"](_context = ownKeys(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors__default["default"]) { _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)); } else { var _context2; _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; }
|
|
629
|
+
|
|
630
|
+
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); }; }
|
|
600
631
|
|
|
601
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct__default[
|
|
632
|
+
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; } }
|
|
602
633
|
|
|
603
634
|
var _ref = {
|
|
604
635
|
name: "1yaiq4p",
|
|
@@ -625,22 +656,23 @@ var CalendarMenu = /*#__PURE__*/function (_Component) {
|
|
|
625
656
|
hasError = _this$props.hasError,
|
|
626
657
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
627
658
|
|
|
628
|
-
return
|
|
629
|
-
css: [/*#__PURE__*/react.css("overflow-y:scroll;color:", designSystem.customProperties.colorSolid, ";font-family:inherit;border:1px solid ", designSystem.customProperties.borderColorForInputWhenFocused, ";border-radius:", designSystem.customProperties.borderRadiusForInput, ";margin-top:", designSystem.customProperties.spacingXs, ";font-size:", designSystem.customProperties.fontSizeDefault, ";position:absolute;box-sizing:border-box;width:100%;background-color:", designSystem.customProperties.colorSurface, ";z-index:99999;" + ("" )), !hasFooter && _ref, hasError && /*#__PURE__*/react.css("border-color:", designSystem.customProperties.borderColorForInputWhenError, ";" + ("" )), hasWarning && /*#__PURE__*/react.css("border-color:", designSystem.customProperties.borderColorForInputWhenWarning, ";" + ("" )), "" ]
|
|
630
|
-
|
|
659
|
+
return jsxRuntime.jsxs("div", _objectSpread(_objectSpread({}, rest), {}, {
|
|
660
|
+
css: [/*#__PURE__*/react.css("overflow-y:scroll;color:", designSystem.customProperties.colorSolid, ";font-family:inherit;border:1px solid ", designSystem.customProperties.borderColorForInputWhenFocused, ";border-radius:", designSystem.customProperties.borderRadiusForInput, ";margin-top:", designSystem.customProperties.spacingXs, ";font-size:", designSystem.customProperties.fontSizeDefault, ";position:absolute;box-sizing:border-box;width:100%;background-color:", designSystem.customProperties.colorSurface, ";z-index:99999;" + ("" ), "" ), !hasFooter && _ref, hasError && /*#__PURE__*/react.css("border-color:", designSystem.customProperties.borderColorForInputWhenError, ";" + ("" ), "" ), hasWarning && /*#__PURE__*/react.css("border-color:", designSystem.customProperties.borderColorForInputWhenWarning, ";" + ("" ), "" ), "" , "" ],
|
|
661
|
+
children: [this.props.children, this.props.footer]
|
|
662
|
+
}));
|
|
631
663
|
}
|
|
632
664
|
}]);
|
|
633
665
|
|
|
634
666
|
return CalendarMenu;
|
|
635
|
-
}(
|
|
667
|
+
}(react$1.Component);
|
|
636
668
|
|
|
637
669
|
CalendarMenu.displayName = 'CalendarMenu';
|
|
638
670
|
CalendarMenu.propTypes = {};
|
|
639
671
|
|
|
640
|
-
// NOTE: This string will be replaced
|
|
641
|
-
var version =
|
|
672
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
673
|
+
var version = "12.2.6";
|
|
642
674
|
|
|
643
|
-
exports.CalendarBody =
|
|
675
|
+
exports.CalendarBody = CalendarBody$1;
|
|
644
676
|
exports.CalendarContent = CalendarContent$1;
|
|
645
677
|
exports.CalendarDay = CalendarDay$1;
|
|
646
678
|
exports.CalendarHeader = CalendarHeader$1;
|