@7shifts/sous-chef 2.5.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/feedback/Spinner/Spinner.d.ts +1 -1
- package/dist/forms/DatePickerCalendar/DatePickerCalendar.d.ts +2 -0
- package/dist/forms/DateRangeField/DateRangeField.d.ts +3 -1
- package/dist/forms/DateRangeField/FromDate/FromDate.d.ts +3 -2
- package/dist/forms/DateRangeField/ToDate/ToDate.d.ts +3 -1
- package/dist/icons/components/IconUniversity.d.ts +11 -0
- package/dist/icons/components/index.d.ts +1 -0
- package/dist/index.css +10 -6
- package/dist/index.js +253 -26
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +253 -27
- package/dist/index.modern.js.map +1 -1
- package/dist/utils/date.d.ts +5 -0
- package/package.json +1 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { WeekStart, DateRange } from '../../utils/date';
|
|
2
|
+
import { WeekStart, DateRange, BlockedDays } from '../../utils/date';
|
|
3
3
|
declare type Props = {
|
|
4
4
|
name: string;
|
|
5
5
|
/** If not provided it will generate a random id so the label links properly with the text input */
|
|
6
6
|
id?: string;
|
|
7
7
|
value?: DateRange;
|
|
8
|
+
/** It disable some dates so the user can't click on them. Refer to this [doc](https://react-day-picker.js.org/api/types/matcher) to see what values you can use. */
|
|
9
|
+
disabledDays?: BlockedDays;
|
|
8
10
|
/** Reference this for valid formats: https://date-fns.org/v2.18.0/docs/format */
|
|
9
11
|
format?: string;
|
|
10
12
|
onChange?: (e: DateRange) => void;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { WeekStart } from '../../../utils/date';
|
|
1
|
+
import { WeekStart, BlockedDays } from '../../../utils/date';
|
|
2
2
|
declare type Props = {
|
|
3
3
|
name: string;
|
|
4
4
|
id: string;
|
|
5
5
|
format: string;
|
|
6
|
+
disabledDays?: BlockedDays;
|
|
6
7
|
start?: Date;
|
|
7
8
|
end?: Date;
|
|
8
9
|
placeholder: string;
|
|
@@ -12,5 +13,5 @@ declare type Props = {
|
|
|
12
13
|
onChange: (e: Date) => void;
|
|
13
14
|
onDayClick: () => void;
|
|
14
15
|
};
|
|
15
|
-
declare const FromDate: ({ name, id, format, start, end, placeholder, weekStart, disabled, readOnly, onChange, onDayClick }: Props) => JSX.Element;
|
|
16
|
+
declare const FromDate: ({ name, id, format, disabledDays, start, end, placeholder, weekStart, disabled, readOnly, onChange, onDayClick }: Props) => JSX.Element;
|
|
16
17
|
export default FromDate;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { WeekStart } from '../../../utils/date';
|
|
2
|
+
import { WeekStart, BlockedDays } from '../../../utils/date';
|
|
3
3
|
declare type Props = {
|
|
4
4
|
name: string;
|
|
5
5
|
format: string;
|
|
6
|
+
disabledDays?: BlockedDays;
|
|
6
7
|
start?: Date;
|
|
7
8
|
end?: Date;
|
|
8
9
|
placeholder: string;
|
|
@@ -10,6 +11,7 @@ declare type Props = {
|
|
|
10
11
|
disabled?: boolean;
|
|
11
12
|
readOnly: boolean;
|
|
12
13
|
onChange: (e: Date) => void;
|
|
14
|
+
onBlur: () => void;
|
|
13
15
|
};
|
|
14
16
|
declare const _default: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLInputElement>>;
|
|
15
17
|
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconSize } from '../types';
|
|
3
|
+
declare type Props = {
|
|
4
|
+
size?: IconSize;
|
|
5
|
+
color?: string;
|
|
6
|
+
} & React.SVGProps<SVGSVGElement>;
|
|
7
|
+
declare const IconUniversity: {
|
|
8
|
+
(props: Props): JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
export default IconUniversity;
|
|
@@ -109,6 +109,7 @@ export { default as IconTimes } from './IconTimes';
|
|
|
109
109
|
export { default as IconTrash } from './IconTrash';
|
|
110
110
|
export { default as IconUnderline } from './IconUnderline';
|
|
111
111
|
export { default as IconUndo } from './IconUndo';
|
|
112
|
+
export { default as IconUniversity } from './IconUniversity';
|
|
112
113
|
export { default as IconUserComputer } from './IconUserComputer';
|
|
113
114
|
export { default as IconUserLight } from './IconUserLight';
|
|
114
115
|
export { default as IconUserPlus } from './IconUserPlus';
|
package/dist/index.css
CHANGED
|
@@ -139,6 +139,10 @@ Please ask a designer if you have questions about which colours to use.
|
|
|
139
139
|
stroke: #fff;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
+
._e0OH1 {
|
|
143
|
+
stroke: url(#prideGradient);
|
|
144
|
+
}
|
|
145
|
+
|
|
142
146
|
@-webkit-keyframes _3ZqYM {
|
|
143
147
|
0% {
|
|
144
148
|
stroke-dashoffset: 187;
|
|
@@ -215,7 +219,7 @@ Please ask a designer if you have questions about which colours to use.
|
|
|
215
219
|
}
|
|
216
220
|
._1iXKZ {
|
|
217
221
|
background: #fff;
|
|
218
|
-
color: #
|
|
222
|
+
color: #555;
|
|
219
223
|
}
|
|
220
224
|
._2K2Xx {
|
|
221
225
|
font-weight: 600;
|
|
@@ -247,7 +251,7 @@ Please ask a designer if you have questions about which colours to use.
|
|
|
247
251
|
}
|
|
248
252
|
._2LAWl {
|
|
249
253
|
border-top-color: #fff;
|
|
250
|
-
color: #
|
|
254
|
+
color: #555;
|
|
251
255
|
}
|
|
252
256
|
/*********************************
|
|
253
257
|
For new colours, see _colors.scss.
|
|
@@ -823,7 +827,7 @@ Please ask a designer if you have questions about which colours to use.
|
|
|
823
827
|
font-weight: 600;
|
|
824
828
|
font-family: "Proxima Nova", sans-serif;
|
|
825
829
|
color: #555;
|
|
826
|
-
padding:
|
|
830
|
+
padding: 20px 17px 8px 17px;
|
|
827
831
|
}
|
|
828
832
|
|
|
829
833
|
._27x4v {
|
|
@@ -1785,7 +1789,7 @@ Please ask a designer if you have questions about which colours to use.
|
|
|
1785
1789
|
cursor: default;
|
|
1786
1790
|
}
|
|
1787
1791
|
|
|
1788
|
-
._276GV {
|
|
1792
|
+
._276GV:not(._3vJkw) {
|
|
1789
1793
|
color: #c1c1c1;
|
|
1790
1794
|
cursor: default;
|
|
1791
1795
|
}
|
|
@@ -2003,7 +2007,7 @@ Please ask a designer if you have questions about which colours to use.
|
|
|
2003
2007
|
cursor: default;
|
|
2004
2008
|
}
|
|
2005
2009
|
|
|
2006
|
-
._CRqyX {
|
|
2010
|
+
._CRqyX:not(._2pgnH) {
|
|
2007
2011
|
color: #c1c1c1;
|
|
2008
2012
|
cursor: default;
|
|
2009
2013
|
}
|
|
@@ -2331,7 +2335,7 @@ Please ask a designer if you have questions about which colours to use.
|
|
|
2331
2335
|
cursor: default;
|
|
2332
2336
|
}
|
|
2333
2337
|
|
|
2334
|
-
._1PIJa {
|
|
2338
|
+
._1PIJa:not(._1M4ZF) {
|
|
2335
2339
|
color: #c1c1c1;
|
|
2336
2340
|
cursor: default;
|
|
2337
2341
|
}
|
package/dist/index.js
CHANGED
|
@@ -163,7 +163,7 @@ var Inline = function Inline(props) {
|
|
|
163
163
|
}));
|
|
164
164
|
};
|
|
165
165
|
|
|
166
|
-
var styles$2 = {"spinner":"_2wtfD","rotator":"_2Jprn","spinner--block":"_Jmh8M","path":"_3zucL","dash":"_3ZqYM","path--mint":"_3XYKx","path--disabled":"_1pYbs","path--contrast":"_3ofDF"};
|
|
166
|
+
var styles$2 = {"spinner":"_2wtfD","rotator":"_2Jprn","spinner--block":"_Jmh8M","path":"_3zucL","dash":"_3ZqYM","path--mint":"_3XYKx","path--disabled":"_1pYbs","path--contrast":"_3ofDF","path--pride":"_e0OH1"};
|
|
167
167
|
|
|
168
168
|
var Spinner = function Spinner(_ref) {
|
|
169
169
|
var _classnames;
|
|
@@ -183,7 +183,75 @@ var Spinner = function Spinner(_ref) {
|
|
|
183
183
|
height: size,
|
|
184
184
|
viewBox: "0 0 66 66",
|
|
185
185
|
"data-testid": "spinner"
|
|
186
|
-
}, React__default.createElement("
|
|
186
|
+
}, React__default.createElement("defs", null, React__default.createElement("linearGradient", {
|
|
187
|
+
id: "prideGradient"
|
|
188
|
+
}, React__default.createElement("stop", {
|
|
189
|
+
offset: "0",
|
|
190
|
+
stopColor: "#000000"
|
|
191
|
+
}), React__default.createElement("stop", {
|
|
192
|
+
offset: "0.0500",
|
|
193
|
+
stopColor: "#000000"
|
|
194
|
+
}), React__default.createElement("stop", {
|
|
195
|
+
offset: "0.0501",
|
|
196
|
+
stopColor: "#ffafc7"
|
|
197
|
+
}), React__default.createElement("stop", {
|
|
198
|
+
offset: "0.15",
|
|
199
|
+
stopColor: "#ffafc7"
|
|
200
|
+
}), React__default.createElement("stop", {
|
|
201
|
+
offset: "0.1501",
|
|
202
|
+
stopColor: "#73d7ee"
|
|
203
|
+
}), React__default.createElement("stop", {
|
|
204
|
+
offset: "0.25",
|
|
205
|
+
stopColor: "#73d7ee"
|
|
206
|
+
}), React__default.createElement("stop", {
|
|
207
|
+
offset: "0.2501",
|
|
208
|
+
stopColor: "#613915"
|
|
209
|
+
}), React__default.createElement("stop", {
|
|
210
|
+
offset: "0.35",
|
|
211
|
+
stopColor: "#613915"
|
|
212
|
+
}), React__default.createElement("stop", {
|
|
213
|
+
offset: "0.3501",
|
|
214
|
+
stopColor: "#ffffff"
|
|
215
|
+
}), React__default.createElement("stop", {
|
|
216
|
+
offset: "0.45",
|
|
217
|
+
stopColor: "#ffffff"
|
|
218
|
+
}), React__default.createElement("stop", {
|
|
219
|
+
offset: "0.4501",
|
|
220
|
+
stopColor: "#e50000"
|
|
221
|
+
}), React__default.createElement("stop", {
|
|
222
|
+
offset: "0.55",
|
|
223
|
+
stopColor: "#e50000"
|
|
224
|
+
}), React__default.createElement("stop", {
|
|
225
|
+
offset: "0.5501",
|
|
226
|
+
stopColor: "#ff8d00"
|
|
227
|
+
}), React__default.createElement("stop", {
|
|
228
|
+
offset: "0.65",
|
|
229
|
+
stopColor: "#ff8d00"
|
|
230
|
+
}), React__default.createElement("stop", {
|
|
231
|
+
offset: "0.6501",
|
|
232
|
+
stopColor: "#ddee00"
|
|
233
|
+
}), React__default.createElement("stop", {
|
|
234
|
+
offset: "0.75",
|
|
235
|
+
stopColor: "#ddee00"
|
|
236
|
+
}), React__default.createElement("stop", {
|
|
237
|
+
offset: "0.7501",
|
|
238
|
+
stopColor: "#028121"
|
|
239
|
+
}), React__default.createElement("stop", {
|
|
240
|
+
offset: "0.85",
|
|
241
|
+
stopColor: "#028121"
|
|
242
|
+
}), React__default.createElement("stop", {
|
|
243
|
+
offset: "0.8501",
|
|
244
|
+
stopColor: "#004cff"
|
|
245
|
+
}), React__default.createElement("stop", {
|
|
246
|
+
offset: "0.95",
|
|
247
|
+
stopColor: "#004cff"
|
|
248
|
+
}), React__default.createElement("stop", {
|
|
249
|
+
offset: "0.9501",
|
|
250
|
+
stopColor: "#760088"
|
|
251
|
+
}), React__default.createElement("stop", {
|
|
252
|
+
offset: "1",
|
|
253
|
+
stopColor: "#760088"
|
|
254
|
+
}))), React__default.createElement("circle", {
|
|
187
255
|
className: classnames(styles$2['path'], styles$2["path--" + theme]),
|
|
188
256
|
fill: "none",
|
|
189
257
|
strokeWidth: "6",
|
|
@@ -2735,6 +2803,28 @@ var IconUndo = function IconUndo(props) {
|
|
|
2735
2803
|
|
|
2736
2804
|
IconUndo.displayName = 'IconUndo';
|
|
2737
2805
|
|
|
2806
|
+
var IconUniversity = function IconUniversity(props) {
|
|
2807
|
+
return React__default.createElement("svg", Object.assign({
|
|
2808
|
+
viewBox: "0 0 20 20",
|
|
2809
|
+
fill: "none",
|
|
2810
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2811
|
+
"data-testid": "icon-university",
|
|
2812
|
+
style: getIconStyles(props)
|
|
2813
|
+
}, props), React__default.createElement("g", {
|
|
2814
|
+
clipPath: "url(#icon-university_svg__a)"
|
|
2815
|
+
}, React__default.createElement("path", {
|
|
2816
|
+
d: "M19.375 17.5h-.625v-1.563a.937.937 0 0 0-.938-.937H16.25V8.125H15V15h-2.5V8.125h-1.25V15h-2.5V8.125H7.5V15H5V8.125H3.75V15H2.187a.937.937 0 0 0-.937.938V17.5H.625a.625.625 0 0 0-.625.625v.313a.313.313 0 0 0 .313.312h19.375a.313.313 0 0 0 .312-.313v-.312a.625.625 0 0 0-.625-.625ZM2.5 16.25h15v1.25h-15v-1.25ZM19.698 5.312l-9.105-3.966a1.875 1.875 0 0 0-1.186 0L.302 5.312A.469.469 0 0 0 0 5.752v.343c0 .259.21.468.469.468h.781v.47c0 .258.21.468.469.468H18.28c.26 0 .469-.21.469-.469v-.468h.781c.26 0 .469-.21.469-.47v-.342a.469.469 0 0 0-.302-.439ZM17.5 6.25h-15v-.531L9.842 2.52a.625.625 0 0 1 .316 0L17.5 5.72v.531Z",
|
|
2817
|
+
fill: "currentColor"
|
|
2818
|
+
})), React__default.createElement("defs", null, React__default.createElement("clipPath", {
|
|
2819
|
+
id: "icon-university_svg__a"
|
|
2820
|
+
}, React__default.createElement("path", {
|
|
2821
|
+
fill: "#fff",
|
|
2822
|
+
d: "M0 0h20v20H0z"
|
|
2823
|
+
}))));
|
|
2824
|
+
};
|
|
2825
|
+
|
|
2826
|
+
IconUniversity.displayName = 'IconUniversity';
|
|
2827
|
+
|
|
2738
2828
|
var IconUserComputer = function IconUserComputer(props) {
|
|
2739
2829
|
return React__default.createElement("svg", Object.assign({
|
|
2740
2830
|
viewBox: "0 0 20 20",
|
|
@@ -3609,7 +3699,7 @@ var useFieldControllers = function useFieldControllers(_ref) {
|
|
|
3609
3699
|
return formik.setFieldValue(name, e.target.value);
|
|
3610
3700
|
},
|
|
3611
3701
|
onBlur: _onBlur ? function (e) {
|
|
3612
|
-
|
|
3702
|
+
_onBlur && _onBlur(e.target.value);
|
|
3613
3703
|
currencyBlur();
|
|
3614
3704
|
} : function () {
|
|
3615
3705
|
formik.setFieldTouched(name);
|
|
@@ -5117,8 +5207,17 @@ var DatePickerCalendar = function DatePickerCalendar(_ref) {
|
|
|
5117
5207
|
children = _ref.children,
|
|
5118
5208
|
onBlur = _ref.onBlur,
|
|
5119
5209
|
onFocus = _ref.onFocus,
|
|
5120
|
-
tabIndex = _ref.tabIndex
|
|
5210
|
+
tabIndex = _ref.tabIndex,
|
|
5211
|
+
showCalendar = _ref.showCalendar,
|
|
5212
|
+
onClickOutside = _ref.onClickOutside;
|
|
5121
5213
|
var inputPosition = inputNode.getBoundingClientRect();
|
|
5214
|
+
var calendarRef = React.useRef(null);
|
|
5215
|
+
useOnClickOutside(calendarRef, onClickOutside);
|
|
5216
|
+
|
|
5217
|
+
if (!showCalendar) {
|
|
5218
|
+
return null;
|
|
5219
|
+
}
|
|
5220
|
+
|
|
5122
5221
|
return React__default.createElement(Portal, null, React__default.createElement("div", {
|
|
5123
5222
|
className: classNames.overlayWrapper,
|
|
5124
5223
|
onBlur: onBlur,
|
|
@@ -5128,7 +5227,8 @@ var DatePickerCalendar = function DatePickerCalendar(_ref) {
|
|
|
5128
5227
|
zIndex: 9999,
|
|
5129
5228
|
left: inputPosition.left,
|
|
5130
5229
|
top: inputPosition.top + window.scrollY + inputPosition.height + 3
|
|
5131
|
-
}
|
|
5230
|
+
},
|
|
5231
|
+
ref: calendarRef
|
|
5132
5232
|
}, React__default.createElement("div", {
|
|
5133
5233
|
className: classNames.overlay
|
|
5134
5234
|
}, children)));
|
|
@@ -5198,6 +5298,11 @@ var DateField = function DateField(_ref) {
|
|
|
5198
5298
|
_ref$readOnly = _ref.readOnly,
|
|
5199
5299
|
readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly;
|
|
5200
5300
|
var inputRef = React.useRef();
|
|
5301
|
+
|
|
5302
|
+
var _useState = React.useState(false),
|
|
5303
|
+
showCalendar = _useState[0],
|
|
5304
|
+
setShowCalendar = _useState[1];
|
|
5305
|
+
|
|
5201
5306
|
var controllers = useDateFieldControllers({
|
|
5202
5307
|
name: name,
|
|
5203
5308
|
id: inputId,
|
|
@@ -5239,10 +5344,17 @@ var DateField = function DateField(_ref) {
|
|
|
5239
5344
|
defaultValue: defaultValue,
|
|
5240
5345
|
value: controllers.value || '',
|
|
5241
5346
|
onDayChange: controllers.onChange,
|
|
5242
|
-
onDayPickerHide:
|
|
5347
|
+
onDayPickerHide: function onDayPickerHide() {
|
|
5348
|
+
controllers.onBlur();
|
|
5349
|
+
setShowCalendar(false);
|
|
5350
|
+
},
|
|
5243
5351
|
overlayComponent: function overlayComponent(props) {
|
|
5244
5352
|
return React__default.createElement(DatePickerCalendar, Object.assign({}, props, {
|
|
5245
|
-
inputNode: inputRef.current
|
|
5353
|
+
inputNode: inputRef.current,
|
|
5354
|
+
showCalendar: showCalendar,
|
|
5355
|
+
onClickOutside: function onClickOutside() {
|
|
5356
|
+
return setShowCalendar(false);
|
|
5357
|
+
}
|
|
5246
5358
|
}));
|
|
5247
5359
|
},
|
|
5248
5360
|
dayPickerProps: dayPickerProps,
|
|
@@ -5256,7 +5368,13 @@ var DateField = function DateField(_ref) {
|
|
|
5256
5368
|
autoComplete: 'off',
|
|
5257
5369
|
ref: inputRef,
|
|
5258
5370
|
readOnly: readOnly,
|
|
5259
|
-
disabled: disabled
|
|
5371
|
+
disabled: disabled,
|
|
5372
|
+
onFocus: function onFocus() {
|
|
5373
|
+
return setShowCalendar(true);
|
|
5374
|
+
}
|
|
5375
|
+
},
|
|
5376
|
+
onDayPickerShow: function onDayPickerShow() {
|
|
5377
|
+
return setShowCalendar(true);
|
|
5260
5378
|
}
|
|
5261
5379
|
})));
|
|
5262
5380
|
};
|
|
@@ -5294,7 +5412,7 @@ var useRangeFieldControllers = function useRangeFieldControllers(_ref) {
|
|
|
5294
5412
|
|
|
5295
5413
|
if (formik && formikState) {
|
|
5296
5414
|
return _extends({}, initialControllers, {
|
|
5297
|
-
error: error !== undefined ? initialControllers.error : formikState.error,
|
|
5415
|
+
error: error !== undefined ? initialControllers.error : getFormikError(formikState.error),
|
|
5298
5416
|
value: value !== undefined ? initialControllers.value : formikState.value,
|
|
5299
5417
|
onChange: _onChange ? initialControllers.onChange : function (newValue) {
|
|
5300
5418
|
formik.setFieldValue(name, newValue === undefined ? null : newValue);
|
|
@@ -5308,12 +5426,33 @@ var useRangeFieldControllers = function useRangeFieldControllers(_ref) {
|
|
|
5308
5426
|
return initialControllers;
|
|
5309
5427
|
};
|
|
5310
5428
|
|
|
5429
|
+
var getFormikError = function getFormikError(error) {
|
|
5430
|
+
if (!error) {
|
|
5431
|
+
return undefined;
|
|
5432
|
+
}
|
|
5433
|
+
|
|
5434
|
+
if (typeof error === 'string') {
|
|
5435
|
+
return error;
|
|
5436
|
+
}
|
|
5437
|
+
|
|
5438
|
+
if (error.start) {
|
|
5439
|
+
return error.start;
|
|
5440
|
+
}
|
|
5441
|
+
|
|
5442
|
+
if (error.end) {
|
|
5443
|
+
return error.end;
|
|
5444
|
+
}
|
|
5445
|
+
|
|
5446
|
+
return undefined;
|
|
5447
|
+
};
|
|
5448
|
+
|
|
5311
5449
|
var styles$s = {"container":"_1Ini2","wrapper":"_21VnL","interactionDisabled":"_wJ6Cb","DayPicker-Day":"_1c48y","navBar":"_3KwsN","todayButton":"_10CBO","navButtonInteractionDisabled":"_dHL-D","navButtonPrev":"_6kNi3","navButtonNext":"_13W_e","months":"_1FeSY","month":"_wU6A4","caption":"_AMbAo","weekdays":"_1LEst","weekdaysRow":"_2XECo","weekday":"_1C5ry","body":"_11F-Y","week":"_3MAFk","day":"_mG73F","disabled":"_2pgnH","selected":"_MtLaz","outside":"_CRqyX","footer":"_2KG9-","today":"_2JA2y","overlayWrapper":"_1JWbc","overlay":"_2tL6g","weekNumber":"_3u72O","text-field":"_25rf7","date-range-field":"_3qVhi","text-field--invalid":"_2M9Ud","text-field--prefixed":"_3TUb2","text-field--suffixed":"_foqL0","date-range-field--invalid":"_3df9R","date-range-field--disabled":"_2Nkht"};
|
|
5312
5450
|
|
|
5313
5451
|
var FromDate = function FromDate(_ref) {
|
|
5314
5452
|
var name = _ref.name,
|
|
5315
5453
|
id = _ref.id,
|
|
5316
5454
|
format = _ref.format,
|
|
5455
|
+
disabledDays = _ref.disabledDays,
|
|
5317
5456
|
start = _ref.start,
|
|
5318
5457
|
end = _ref.end,
|
|
5319
5458
|
placeholder = _ref.placeholder,
|
|
@@ -5321,12 +5460,29 @@ var FromDate = function FromDate(_ref) {
|
|
|
5321
5460
|
disabled = _ref.disabled,
|
|
5322
5461
|
readOnly = _ref.readOnly,
|
|
5323
5462
|
onChange = _ref.onChange,
|
|
5324
|
-
|
|
5463
|
+
_onDayClick = _ref.onDayClick;
|
|
5464
|
+
|
|
5465
|
+
var _useState = React.useState(false),
|
|
5466
|
+
showCalendar = _useState[0],
|
|
5467
|
+
setShowCalendar = _useState[1];
|
|
5468
|
+
|
|
5325
5469
|
var inputRef = React.useRef();
|
|
5326
5470
|
var modifiers = {
|
|
5327
5471
|
from: start,
|
|
5328
5472
|
to: end
|
|
5329
5473
|
};
|
|
5474
|
+
var disabledDaysChecks = end ? [{
|
|
5475
|
+
after: end
|
|
5476
|
+
}] : [];
|
|
5477
|
+
|
|
5478
|
+
if (disabledDays) {
|
|
5479
|
+
if (Array.isArray(disabledDays)) {
|
|
5480
|
+
disabledDaysChecks.push.apply(disabledDaysChecks, disabledDays);
|
|
5481
|
+
} else {
|
|
5482
|
+
disabledDaysChecks.push(disabledDays);
|
|
5483
|
+
}
|
|
5484
|
+
}
|
|
5485
|
+
|
|
5330
5486
|
var dayPickerProps = {
|
|
5331
5487
|
classNames: styles$s,
|
|
5332
5488
|
months: MONTH_NAMES,
|
|
@@ -5340,12 +5496,18 @@ var FromDate = function FromDate(_ref) {
|
|
|
5340
5496
|
from: start,
|
|
5341
5497
|
to: end
|
|
5342
5498
|
}],
|
|
5343
|
-
disabledDays:
|
|
5344
|
-
after: end
|
|
5345
|
-
},
|
|
5499
|
+
disabledDays: disabledDaysChecks,
|
|
5346
5500
|
toMonth: end,
|
|
5347
5501
|
modifiers: modifiers,
|
|
5348
|
-
onDayClick: onDayClick
|
|
5502
|
+
onDayClick: function onDayClick(_, activeModifiers) {
|
|
5503
|
+
var isDateDisabled = Object.keys(activeModifiers).find(function (modifier) {
|
|
5504
|
+
return modifier;
|
|
5505
|
+
});
|
|
5506
|
+
|
|
5507
|
+
if (!Boolean(isDateDisabled)) {
|
|
5508
|
+
_onDayClick();
|
|
5509
|
+
}
|
|
5510
|
+
}
|
|
5349
5511
|
};
|
|
5350
5512
|
return React__default.createElement(DayPickerInput, {
|
|
5351
5513
|
format: format,
|
|
@@ -5356,9 +5518,16 @@ var FromDate = function FromDate(_ref) {
|
|
|
5356
5518
|
parseDate: parseDate,
|
|
5357
5519
|
placeholder: placeholder,
|
|
5358
5520
|
onDayChange: onChange,
|
|
5521
|
+
onDayPickerHide: function onDayPickerHide() {
|
|
5522
|
+
return setShowCalendar(false);
|
|
5523
|
+
},
|
|
5359
5524
|
overlayComponent: function overlayComponent(props) {
|
|
5360
5525
|
return React__default.createElement(DatePickerCalendar, Object.assign({}, props, {
|
|
5361
|
-
inputNode: inputRef.current
|
|
5526
|
+
inputNode: inputRef.current,
|
|
5527
|
+
showCalendar: showCalendar,
|
|
5528
|
+
onClickOutside: function onClickOutside() {
|
|
5529
|
+
return setShowCalendar(false);
|
|
5530
|
+
}
|
|
5362
5531
|
}));
|
|
5363
5532
|
},
|
|
5364
5533
|
dayPickerProps: dayPickerProps,
|
|
@@ -5370,7 +5539,13 @@ var FromDate = function FromDate(_ref) {
|
|
|
5370
5539
|
readOnly: readOnly,
|
|
5371
5540
|
disabled: disabled,
|
|
5372
5541
|
'data-testid': "range-picker-field-from-" + name,
|
|
5373
|
-
type: 'text'
|
|
5542
|
+
type: 'text',
|
|
5543
|
+
onFocus: function onFocus() {
|
|
5544
|
+
return setShowCalendar(true);
|
|
5545
|
+
}
|
|
5546
|
+
},
|
|
5547
|
+
onDayPickerShow: function onDayPickerShow() {
|
|
5548
|
+
return setShowCalendar(true);
|
|
5374
5549
|
}
|
|
5375
5550
|
});
|
|
5376
5551
|
};
|
|
@@ -5378,17 +5553,36 @@ var FromDate = function FromDate(_ref) {
|
|
|
5378
5553
|
var ToDate = function ToDate(_ref, ref) {
|
|
5379
5554
|
var name = _ref.name,
|
|
5380
5555
|
format = _ref.format,
|
|
5556
|
+
disabledDays = _ref.disabledDays,
|
|
5381
5557
|
start = _ref.start,
|
|
5382
5558
|
end = _ref.end,
|
|
5383
5559
|
placeholder = _ref.placeholder,
|
|
5384
5560
|
weekStart = _ref.weekStart,
|
|
5385
5561
|
disabled = _ref.disabled,
|
|
5386
5562
|
readOnly = _ref.readOnly,
|
|
5387
|
-
onChange = _ref.onChange
|
|
5563
|
+
onChange = _ref.onChange,
|
|
5564
|
+
_onBlur = _ref.onBlur;
|
|
5565
|
+
|
|
5566
|
+
var _useState = React.useState(false),
|
|
5567
|
+
showCalendar = _useState[0],
|
|
5568
|
+
setShowCalendar = _useState[1];
|
|
5569
|
+
|
|
5388
5570
|
var modifiers = {
|
|
5389
5571
|
from: start,
|
|
5390
5572
|
to: end
|
|
5391
5573
|
};
|
|
5574
|
+
var disabledDaysChecks = start ? [{
|
|
5575
|
+
before: start
|
|
5576
|
+
}] : [];
|
|
5577
|
+
|
|
5578
|
+
if (disabledDays) {
|
|
5579
|
+
if (Array.isArray(disabledDays)) {
|
|
5580
|
+
disabledDaysChecks.push.apply(disabledDaysChecks, disabledDays);
|
|
5581
|
+
} else {
|
|
5582
|
+
disabledDaysChecks.push(disabledDays);
|
|
5583
|
+
}
|
|
5584
|
+
}
|
|
5585
|
+
|
|
5392
5586
|
var dayPickerProps = {
|
|
5393
5587
|
classNames: styles$s,
|
|
5394
5588
|
months: MONTH_NAMES,
|
|
@@ -5402,9 +5596,7 @@ var ToDate = function ToDate(_ref, ref) {
|
|
|
5402
5596
|
from: start,
|
|
5403
5597
|
to: end
|
|
5404
5598
|
}],
|
|
5405
|
-
disabledDays:
|
|
5406
|
-
before: start
|
|
5407
|
-
},
|
|
5599
|
+
disabledDays: disabledDaysChecks,
|
|
5408
5600
|
modifiers: modifiers,
|
|
5409
5601
|
month: end || start,
|
|
5410
5602
|
fromMonth: start
|
|
@@ -5418,9 +5610,16 @@ var ToDate = function ToDate(_ref, ref) {
|
|
|
5418
5610
|
parseDate: parseDate,
|
|
5419
5611
|
placeholder: placeholder,
|
|
5420
5612
|
onDayChange: onChange,
|
|
5613
|
+
onDayPickerHide: function onDayPickerHide() {
|
|
5614
|
+
return setShowCalendar(false);
|
|
5615
|
+
},
|
|
5421
5616
|
overlayComponent: function overlayComponent(props) {
|
|
5422
5617
|
return React__default.createElement(DatePickerCalendar, Object.assign({}, props, {
|
|
5423
|
-
inputNode: ref === null || ref === void 0 ? void 0 : ref.current
|
|
5618
|
+
inputNode: ref === null || ref === void 0 ? void 0 : ref.current,
|
|
5619
|
+
showCalendar: showCalendar,
|
|
5620
|
+
onClickOutside: function onClickOutside() {
|
|
5621
|
+
return setShowCalendar(false);
|
|
5622
|
+
}
|
|
5424
5623
|
}));
|
|
5425
5624
|
},
|
|
5426
5625
|
dayPickerProps: dayPickerProps,
|
|
@@ -5431,7 +5630,16 @@ var ToDate = function ToDate(_ref, ref) {
|
|
|
5431
5630
|
readOnly: readOnly,
|
|
5432
5631
|
disabled: disabled,
|
|
5433
5632
|
'data-testid': "range-picker-field-to-" + name,
|
|
5434
|
-
type: 'text'
|
|
5633
|
+
type: 'text',
|
|
5634
|
+
onFocus: function onFocus() {
|
|
5635
|
+
return setShowCalendar(true);
|
|
5636
|
+
},
|
|
5637
|
+
onBlur: function onBlur() {
|
|
5638
|
+
setTimeout(_onBlur, 200);
|
|
5639
|
+
}
|
|
5640
|
+
},
|
|
5641
|
+
onDayPickerShow: function onDayPickerShow() {
|
|
5642
|
+
return setShowCalendar(true);
|
|
5435
5643
|
}
|
|
5436
5644
|
});
|
|
5437
5645
|
};
|
|
@@ -5439,11 +5647,12 @@ var ToDate = function ToDate(_ref, ref) {
|
|
|
5439
5647
|
var ToDate$1 = React.forwardRef(ToDate);
|
|
5440
5648
|
|
|
5441
5649
|
var DateRangeField = function DateRangeField(_ref) {
|
|
5442
|
-
var _classnames
|
|
5650
|
+
var _classnames;
|
|
5443
5651
|
|
|
5444
5652
|
var name = _ref.name,
|
|
5445
5653
|
inputId = _ref.id,
|
|
5446
5654
|
value = _ref.value,
|
|
5655
|
+
disabledDays = _ref.disabledDays,
|
|
5447
5656
|
_ref$format = _ref.format,
|
|
5448
5657
|
format = _ref$format === void 0 ? 'MM/dd/yyyy' : _ref$format,
|
|
5449
5658
|
onChange = _ref.onChange,
|
|
@@ -5478,7 +5687,7 @@ var DateRangeField = function DateRangeField(_ref) {
|
|
|
5478
5687
|
start = _controllers$value.start,
|
|
5479
5688
|
end = _controllers$value.end;
|
|
5480
5689
|
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement("div", {
|
|
5481
|
-
className: classnames(styles$s['date-range-field'], (_classnames = {}, _classnames[styles$s['date-range-field--invalid']] = hasError, _classnames
|
|
5690
|
+
className: classnames(styles$s['date-range-field'], (_classnames = {}, _classnames[styles$s['date-range-field--invalid']] = hasError, _classnames[styles$s['date-range-field--disabled']] = disabled, _classnames))
|
|
5482
5691
|
}, React__default.createElement(IconCalendarAlt, {
|
|
5483
5692
|
size: "medium",
|
|
5484
5693
|
color: GREY400
|
|
@@ -5491,6 +5700,7 @@ var DateRangeField = function DateRangeField(_ref) {
|
|
|
5491
5700
|
placeholder: placeholder || format.toUpperCase(),
|
|
5492
5701
|
weekStart: weekStart,
|
|
5493
5702
|
disabled: disabled,
|
|
5703
|
+
disabledDays: disabledDays,
|
|
5494
5704
|
readOnly: readOnly,
|
|
5495
5705
|
onChange: function onChange(val) {
|
|
5496
5706
|
return controllers.onChange({
|
|
@@ -5514,7 +5724,9 @@ var DateRangeField = function DateRangeField(_ref) {
|
|
|
5514
5724
|
placeholder: placeholder || format.toUpperCase(),
|
|
5515
5725
|
weekStart: weekStart,
|
|
5516
5726
|
disabled: disabled,
|
|
5727
|
+
disabledDays: disabledDays,
|
|
5517
5728
|
readOnly: readOnly,
|
|
5729
|
+
onBlur: controllers.onBlur,
|
|
5518
5730
|
onChange: function onChange(val) {
|
|
5519
5731
|
return controllers.onChange({
|
|
5520
5732
|
start: start,
|
|
@@ -5554,6 +5766,10 @@ var WeekField = function WeekField(_ref) {
|
|
|
5554
5766
|
hoverDate = _useState[0],
|
|
5555
5767
|
setHoverDate = _useState[1];
|
|
5556
5768
|
|
|
5769
|
+
var _useState2 = React.useState(false),
|
|
5770
|
+
showCalendar = _useState2[0],
|
|
5771
|
+
setShowCalendar = _useState2[1];
|
|
5772
|
+
|
|
5557
5773
|
var inputRef = React.useRef();
|
|
5558
5774
|
var controllers = useDateFieldControllers({
|
|
5559
5775
|
name: name,
|
|
@@ -5636,7 +5852,11 @@ var WeekField = function WeekField(_ref) {
|
|
|
5636
5852
|
onDayPickerHide: controllers.onBlur,
|
|
5637
5853
|
overlayComponent: function overlayComponent(props) {
|
|
5638
5854
|
return React__default.createElement(DatePickerCalendar, Object.assign({}, props, {
|
|
5639
|
-
inputNode: inputRef.current
|
|
5855
|
+
inputNode: inputRef.current,
|
|
5856
|
+
showCalendar: showCalendar,
|
|
5857
|
+
onClickOutside: function onClickOutside() {
|
|
5858
|
+
return setShowCalendar(false);
|
|
5859
|
+
}
|
|
5640
5860
|
}));
|
|
5641
5861
|
},
|
|
5642
5862
|
dayPickerProps: dayPickerProps,
|
|
@@ -5650,7 +5870,13 @@ var WeekField = function WeekField(_ref) {
|
|
|
5650
5870
|
autoComplete: 'off',
|
|
5651
5871
|
ref: inputRef,
|
|
5652
5872
|
readOnly: readOnly,
|
|
5653
|
-
disabled: disabled
|
|
5873
|
+
disabled: disabled,
|
|
5874
|
+
onFocus: function onFocus() {
|
|
5875
|
+
return setShowCalendar(true);
|
|
5876
|
+
}
|
|
5877
|
+
},
|
|
5878
|
+
onDayPickerShow: function onDayPickerShow() {
|
|
5879
|
+
return setShowCalendar(true);
|
|
5654
5880
|
}
|
|
5655
5881
|
})));
|
|
5656
5882
|
};
|
|
@@ -6118,6 +6344,7 @@ exports.IconTimesOctagon = IconTimesOctagon;
|
|
|
6118
6344
|
exports.IconTrash = IconTrash;
|
|
6119
6345
|
exports.IconUnderline = IconUnderline;
|
|
6120
6346
|
exports.IconUndo = IconUndo;
|
|
6347
|
+
exports.IconUniversity = IconUniversity;
|
|
6121
6348
|
exports.IconUserComputer = IconUserComputer;
|
|
6122
6349
|
exports.IconUserLight = IconUserLight;
|
|
6123
6350
|
exports.IconUserPlus = IconUserPlus;
|