@commercetools-uikit/calendar-utils 12.2.1 → 12.2.5
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 +336 -296
- package/dist/commercetools-uikit-calendar-utils.cjs.prod.js +273 -237
- package/dist/commercetools-uikit-calendar-utils.esm.js +289 -248
- 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 +23 -20
|
@@ -10,23 +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 _styled = require('@emotion/styled/base');
|
|
14
|
-
var _extends = require('@babel/runtime-corejs3/helpers/extends');
|
|
15
|
-
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
16
|
-
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
17
|
-
var React = require('react');
|
|
18
|
-
require('prop-types');
|
|
19
|
-
var react = require('@emotion/react');
|
|
20
|
-
var designSystem = require('@commercetools-uikit/design-system');
|
|
21
|
-
var reactIntl = require('react-intl');
|
|
22
|
-
var SecondaryIconButton = require('@commercetools-uikit/secondary-icon-button');
|
|
23
|
-
var icons = require('@commercetools-uikit/icons');
|
|
24
|
-
var Text = require('@commercetools-uikit/text');
|
|
25
|
-
var Inline = require('@commercetools-uikit/spacings-inline');
|
|
26
|
-
var Tooltip = require('@commercetools-uikit/tooltip');
|
|
27
|
-
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
28
|
-
var hooks = require('@commercetools-uikit/hooks');
|
|
29
|
-
var AccessibleButton = require('@commercetools-uikit/accessible-button');
|
|
30
13
|
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
31
14
|
var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
32
15
|
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
@@ -36,7 +19,24 @@ var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-
|
|
|
36
19
|
var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
|
|
37
20
|
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
38
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');
|
|
30
|
+
var designSystem = require('@commercetools-uikit/design-system');
|
|
39
31
|
var inputUtils = require('@commercetools-uikit/input-utils');
|
|
32
|
+
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
33
|
+
var _styled = require('@emotion/styled/base');
|
|
34
|
+
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
35
|
+
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
36
|
+
var reactIntl = require('react-intl');
|
|
37
|
+
var SecondaryIconButton = require('@commercetools-uikit/secondary-icon-button');
|
|
38
|
+
var Text = require('@commercetools-uikit/text');
|
|
39
|
+
var Tooltip = require('@commercetools-uikit/tooltip');
|
|
40
40
|
var _Reflect$construct = require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
|
|
41
41
|
var _classCallCheck = require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
42
42
|
var _createClass = require('@babel/runtime-corejs3/helpers/createClass');
|
|
@@ -53,14 +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 _styled__default = /*#__PURE__*/_interopDefault(_styled);
|
|
57
|
-
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
|
|
58
|
-
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
59
|
-
var SecondaryIconButton__default = /*#__PURE__*/_interopDefault(SecondaryIconButton);
|
|
60
|
-
var Text__default = /*#__PURE__*/_interopDefault(Text);
|
|
61
|
-
var Inline__default = /*#__PURE__*/_interopDefault(Inline);
|
|
62
|
-
var Tooltip__default = /*#__PURE__*/_interopDefault(Tooltip);
|
|
63
|
-
var AccessibleButton__default = /*#__PURE__*/_interopDefault(AccessibleButton);
|
|
64
56
|
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
65
57
|
var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
|
|
66
58
|
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
|
|
@@ -69,69 +61,76 @@ var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachIns
|
|
|
69
61
|
var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors);
|
|
70
62
|
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
71
63
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
64
|
+
var Inline__default = /*#__PURE__*/_interopDefault(Inline);
|
|
65
|
+
var AccessibleButton__default = /*#__PURE__*/_interopDefault(AccessibleButton);
|
|
66
|
+
var _styled__default = /*#__PURE__*/_interopDefault(_styled);
|
|
67
|
+
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
|
|
68
|
+
var SecondaryIconButton__default = /*#__PURE__*/_interopDefault(SecondaryIconButton);
|
|
69
|
+
var Text__default = /*#__PURE__*/_interopDefault(Text);
|
|
70
|
+
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; }
|
|
192
|
+
|
|
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; }
|
|
193
194
|
|
|
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,153 +296,171 @@ 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
|
-
var _ref = {
|
|
305
|
+
var _ref$2 = {
|
|
306
306
|
name: "15hjx30",
|
|
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];
|
|
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%"
|
|
407
419
|
} );
|
|
408
420
|
|
|
409
|
-
var
|
|
421
|
+
var CalendarContent$1 = CalendarContent;
|
|
422
|
+
|
|
423
|
+
var _excluded$1 = ["isHighlighted", "isSelected", "isRangeStart", "isRangeBetween", "isRangeEnd", "isToday"];
|
|
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; }
|
|
410
428
|
|
|
411
429
|
var getStyles = function getStyles(props) {
|
|
412
430
|
var _context, _context2;
|
|
413
431
|
|
|
414
432
|
var styles = [];
|
|
415
433
|
|
|
416
|
-
if (!_includesInstanceProperty__default[
|
|
417
|
-
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, ";" + ("" ), "" ));
|
|
418
436
|
}
|
|
419
437
|
|
|
420
|
-
if (_includesInstanceProperty__default[
|
|
421
|
-
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, ";" + ("" ), "" ));
|
|
422
440
|
}
|
|
423
441
|
|
|
424
442
|
if (props.isHighlighted) {
|
|
425
|
-
styles.push( /*#__PURE__*/react.css("background-color:", designSystem.customProperties.colorNeutral90, ";" + ("" )));
|
|
443
|
+
styles.push( /*#__PURE__*/react.css("background-color:", designSystem.customProperties.colorNeutral90, ";" + ("" ), "" ));
|
|
426
444
|
}
|
|
427
445
|
|
|
428
446
|
if (props.isSelected) {
|
|
429
|
-
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, ";" + ("" ), "" ));
|
|
430
448
|
}
|
|
431
449
|
|
|
432
450
|
if (props.isRangeStart || props.isRangeEnd) {
|
|
433
|
-
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, ";" + ("" ), "" ));
|
|
434
452
|
}
|
|
435
453
|
|
|
436
454
|
if (props.isRangeBetween) {
|
|
437
|
-
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, ";" + ("" ), "" ));
|
|
438
456
|
}
|
|
439
457
|
|
|
440
458
|
if (!props.isSelected && !props.isRangeStart && !props.isRangeEnd && props.isToday) {
|
|
441
|
-
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;" + ("" ), "" ));
|
|
442
460
|
}
|
|
443
461
|
|
|
444
462
|
if (props.disabled) {
|
|
445
|
-
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;" + ("" ), "" ));
|
|
446
464
|
}
|
|
447
465
|
|
|
448
466
|
return styles;
|
|
@@ -460,17 +478,19 @@ var CalendarDay = function CalendarDay(props) {
|
|
|
460
478
|
props.isRangeBetween;
|
|
461
479
|
props.isRangeEnd;
|
|
462
480
|
props.isToday;
|
|
463
|
-
var rest = _objectWithoutProperties(props, _excluded);
|
|
481
|
+
var rest = _objectWithoutProperties(props, _excluded$1);
|
|
464
482
|
|
|
465
|
-
return
|
|
466
|
-
css: _ref$1
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
483
|
+
return jsxRuntime.jsx("li", {
|
|
484
|
+
css: _ref$1,
|
|
485
|
+
children: jsxRuntime.jsx("div", _objectSpread$1({
|
|
486
|
+
css: getStyles(props)
|
|
487
|
+
}, rest))
|
|
488
|
+
});
|
|
470
489
|
};
|
|
471
490
|
|
|
472
|
-
CalendarDay.displayName = 'CalendarDay';
|
|
473
491
|
CalendarDay.propTypes = {};
|
|
492
|
+
CalendarDay.displayName = 'CalendarDay';
|
|
493
|
+
var CalendarDay$1 = CalendarDay;
|
|
474
494
|
|
|
475
495
|
var messages = reactIntl.defineMessages({
|
|
476
496
|
todayTooltip: {
|
|
@@ -500,8 +520,8 @@ var messages = reactIntl.defineMessages({
|
|
|
500
520
|
}
|
|
501
521
|
});
|
|
502
522
|
|
|
503
|
-
var WrapperComponent = _styled__default[
|
|
504
|
-
target: "
|
|
523
|
+
var WrapperComponent = _styled__default["default"]("div", {
|
|
524
|
+
target: "e1q1nv850"
|
|
505
525
|
} )({
|
|
506
526
|
name: "zjik7",
|
|
507
527
|
styles: "display:flex"
|
|
@@ -512,91 +532,106 @@ var CalendarHeader = function CalendarHeader(props) {
|
|
|
512
532
|
// we prevent all our defined onClicks inside of the CalendarHeader
|
|
513
533
|
// from blurring our input.
|
|
514
534
|
|
|
515
|
-
var onMouseDown =
|
|
535
|
+
var onMouseDown = react$1.useCallback(function (event) {
|
|
516
536
|
event.preventDefault();
|
|
517
537
|
}, []);
|
|
518
|
-
return
|
|
538
|
+
return jsxRuntime.jsxs("div", {
|
|
519
539
|
onMouseDown: onMouseDown,
|
|
520
|
-
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, ";" + ("" ))
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
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
|
-
|
|
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
|
+
});
|
|
588
618
|
};
|
|
589
619
|
|
|
590
|
-
CalendarHeader.displayName = 'CalendarHeader';
|
|
591
620
|
CalendarHeader.propTypes = {};
|
|
621
|
+
CalendarHeader.displayName = 'CalendarHeader';
|
|
622
|
+
var CalendarHeader$1 = CalendarHeader;
|
|
592
623
|
|
|
593
|
-
var _excluded
|
|
624
|
+
var _excluded = ["hasFooter", "hasWarning", "hasError"];
|
|
594
625
|
|
|
595
|
-
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; }
|
|
596
627
|
|
|
597
|
-
function
|
|
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; }
|
|
598
629
|
|
|
599
|
-
var
|
|
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); }; }
|
|
631
|
+
|
|
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; } }
|
|
633
|
+
|
|
634
|
+
var _ref = {
|
|
600
635
|
name: "1yaiq4p",
|
|
601
636
|
styles: "padding-bottom:10px"
|
|
602
637
|
} ;
|
|
@@ -619,27 +654,28 @@ var CalendarMenu = /*#__PURE__*/function (_Component) {
|
|
|
619
654
|
hasFooter = _this$props.hasFooter,
|
|
620
655
|
hasWarning = _this$props.hasWarning,
|
|
621
656
|
hasError = _this$props.hasError,
|
|
622
|
-
rest = _objectWithoutProperties(_this$props, _excluded
|
|
657
|
+
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
623
658
|
|
|
624
|
-
return
|
|
625
|
-
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
|
|
626
|
-
|
|
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
|
+
}));
|
|
627
663
|
}
|
|
628
664
|
}]);
|
|
629
665
|
|
|
630
666
|
return CalendarMenu;
|
|
631
|
-
}(
|
|
667
|
+
}(react$1.Component);
|
|
632
668
|
|
|
633
669
|
CalendarMenu.displayName = 'CalendarMenu';
|
|
634
670
|
CalendarMenu.propTypes = {};
|
|
635
671
|
|
|
636
|
-
// NOTE: This string will be replaced
|
|
637
|
-
var version =
|
|
672
|
+
// NOTE: This string will be replaced on build time with the package version.
|
|
673
|
+
var version = "12.2.5";
|
|
638
674
|
|
|
639
|
-
exports.CalendarBody =
|
|
640
|
-
exports.CalendarContent = CalendarContent;
|
|
641
|
-
exports.CalendarDay = CalendarDay;
|
|
642
|
-
exports.CalendarHeader = CalendarHeader;
|
|
675
|
+
exports.CalendarBody = CalendarBody$1;
|
|
676
|
+
exports.CalendarContent = CalendarContent$1;
|
|
677
|
+
exports.CalendarDay = CalendarDay$1;
|
|
678
|
+
exports.CalendarHeader = CalendarHeader$1;
|
|
643
679
|
exports.CalendarMenu = CalendarMenu;
|
|
644
680
|
exports.changeMonth = changeMonth;
|
|
645
681
|
exports.createCalendarItems = createCalendarItems;
|