@7shifts/sous-chef 2.3.0 → 2.3.3
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/core/DataTable/DataTable.d.ts +1 -1
- package/dist/core/DataTable/DataTableContext.d.ts +1 -1
- package/dist/forms/Form/types.d.ts +3 -18
- package/dist/forms/MultiSelectField/MultiSelectField.d.ts +5 -1
- package/dist/forms/SelectField/SelectField.d.ts +5 -1
- package/dist/index.css +30 -8
- package/dist/index.js +50 -46
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +52 -48
- package/dist/index.modern.js.map +1 -1
- package/dist/overlay/Tooltip/Tooltip.d.ts +1 -0
- package/dist/utils/formik.d.ts +1 -0
- package/package.json +2 -2
|
@@ -4,7 +4,7 @@ declare type Props<T> = {
|
|
|
4
4
|
/** Each element represents a row and each key of the object represents a column */
|
|
5
5
|
items: Item<T>[];
|
|
6
6
|
/** For each column element, the `name` property should match the key on `items` */
|
|
7
|
-
columns
|
|
7
|
+
columns?: Column[];
|
|
8
8
|
/** A custom component for customizing how the each item is rendered. It pass as props: `item`, `index`, `columnSizes` and `columns` */
|
|
9
9
|
itemComponent?: React.ComponentType<CustomComponent<T>>;
|
|
10
10
|
maxHeight?: number;
|
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export declare type FormikType =
|
|
4
|
-
handleSubmit: (e: Object) => void;
|
|
5
|
-
setFieldValue: (_: string, __: string | boolean | SelectOption<any> | SelectOption<any>[] | Date | DateRange | null) => void;
|
|
6
|
-
setFieldTouched: (e: string) => void;
|
|
7
|
-
values: {
|
|
8
|
-
[key: string]: any;
|
|
9
|
-
};
|
|
10
|
-
touched: {
|
|
11
|
-
[key: string]: boolean;
|
|
12
|
-
};
|
|
13
|
-
errors: {
|
|
14
|
-
[key: string]: string;
|
|
15
|
-
};
|
|
16
|
-
isValid: boolean;
|
|
17
|
-
dirty: boolean;
|
|
18
|
-
};
|
|
1
|
+
import { FormikState, FormikHelpers, FormikHandlers } from 'formik';
|
|
2
|
+
/** The FormValues are `any` here as in Sous Chef we don't care about the shape of the form. We just need to link form fields with the formik state */
|
|
3
|
+
export declare type FormikType = FormikState<any> & FormikHelpers<any> & FormikHandlers;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SelectOption, SelectOptions } from '../SelectField/types';
|
|
3
|
+
declare type NoOptionsMessageFunction = (input: {
|
|
4
|
+
inputValue: string;
|
|
5
|
+
}) => string | null;
|
|
3
6
|
declare type Props<T> = {
|
|
4
7
|
name: string;
|
|
5
8
|
/** If not provided it will generate a random id so the label links properly with the text input */
|
|
@@ -13,11 +16,12 @@ declare type Props<T> = {
|
|
|
13
16
|
caption?: React.ReactNode;
|
|
14
17
|
error?: string;
|
|
15
18
|
placeholder?: string;
|
|
19
|
+
noOptionsMessage?: string | NoOptionsMessageFunction;
|
|
16
20
|
disabled?: boolean;
|
|
17
21
|
closeOnSelect?: boolean;
|
|
18
22
|
/** When the user opens the menu, if this prop is `true`, it will scroll the page into to the menu view (if its content falls under a scroll). It is recomended to disable this behaviour when using the `MultiSelectField` inside a modal. */
|
|
19
23
|
menuShouldScrollIntoView?: boolean;
|
|
20
24
|
};
|
|
21
25
|
/** Component to make possible choose from a predefined options. */
|
|
22
|
-
declare const MultiSelectField: <T extends unknown>({ name, id: inputId, value, options, onChange, onBlur, CustomOption: UserCustomOption, label, caption, error, placeholder, disabled, closeOnSelect, menuShouldScrollIntoView }: Props<T>) => JSX.Element;
|
|
26
|
+
declare const MultiSelectField: <T extends unknown>({ name, id: inputId, value, options, onChange, onBlur, CustomOption: UserCustomOption, label, caption, error, placeholder, noOptionsMessage, disabled, closeOnSelect, menuShouldScrollIntoView }: Props<T>) => JSX.Element;
|
|
23
27
|
export default MultiSelectField;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SelectOption, SelectOptions } from './types';
|
|
3
|
+
declare type NoOptionsMessageFunction = (input: {
|
|
4
|
+
inputValue: string;
|
|
5
|
+
}) => string | null;
|
|
3
6
|
declare type Props<T> = {
|
|
4
7
|
name: string;
|
|
5
8
|
/** If not provided it will generate a random id so the label links properly with the text input */
|
|
@@ -14,6 +17,7 @@ declare type Props<T> = {
|
|
|
14
17
|
caption?: React.ReactNode;
|
|
15
18
|
error?: string;
|
|
16
19
|
placeholder?: string;
|
|
20
|
+
noOptionsMessage?: string | NoOptionsMessageFunction;
|
|
17
21
|
disabled?: boolean;
|
|
18
22
|
/** Use a prefix for things like currency symbols (“$”, “¥”, “£”) or icons. */
|
|
19
23
|
prefix?: React.ReactNode;
|
|
@@ -22,5 +26,5 @@ declare type Props<T> = {
|
|
|
22
26
|
menuShouldScrollIntoView?: boolean;
|
|
23
27
|
};
|
|
24
28
|
/** Component to make possible choose from a predefined options. */
|
|
25
|
-
declare const SelectField: <T extends unknown>({ name, id: inputId, value, options, onChange, onBlur, CustomOption: UserCustomOption, SelectedOptionPrefix, label, caption, error, placeholder, disabled, prefix, asToolbarFilter, menuShouldScrollIntoView }: Props<T>) => JSX.Element;
|
|
29
|
+
declare const SelectField: <T extends unknown>({ name, id: inputId, value, options, onChange, onBlur, CustomOption: UserCustomOption, SelectedOptionPrefix, label, caption, error, placeholder, noOptionsMessage, disabled, prefix, asToolbarFilter, menuShouldScrollIntoView }: Props<T>) => JSX.Element;
|
|
26
30
|
export default SelectField;
|
package/dist/index.css
CHANGED
|
@@ -598,7 +598,7 @@ Please ask a designer if you have questions about which colours to use.
|
|
|
598
598
|
border: 1px solid #fff;
|
|
599
599
|
border-bottom: 1px solid #e0e0e0;
|
|
600
600
|
}
|
|
601
|
-
._3DlpO:last-child {
|
|
601
|
+
._3DlpO:last-child:not(._NS-B9) {
|
|
602
602
|
border-bottom: 1px solid #fff;
|
|
603
603
|
}
|
|
604
604
|
|
|
@@ -621,11 +621,20 @@ Please ask a designer if you have questions about which colours to use.
|
|
|
621
621
|
box-shadow: 0 0 8px #a7b7ea;
|
|
622
622
|
}
|
|
623
623
|
._NS-B9:first-child {
|
|
624
|
-
border-radius: 8px
|
|
624
|
+
border-top-left-radius: 8px;
|
|
625
|
+
border-top-right-radius: 8px;
|
|
626
|
+
}
|
|
627
|
+
._NS-B9:first-child:not(:last-child) {
|
|
628
|
+
border-bottom-left-radius: 0;
|
|
629
|
+
border-bottom-right-radius: 0;
|
|
625
630
|
}
|
|
626
631
|
._NS-B9:last-child {
|
|
627
|
-
border-radius:
|
|
628
|
-
border-bottom:
|
|
632
|
+
border-bottom-left-radius: 8px;
|
|
633
|
+
border-bottom-right-radius: 8px;
|
|
634
|
+
}
|
|
635
|
+
._NS-B9:last-child:not(:first-child) {
|
|
636
|
+
border-top-left-radius: 0;
|
|
637
|
+
border-top-right-radius: 0;
|
|
629
638
|
}
|
|
630
639
|
|
|
631
640
|
._3ENNn {
|
|
@@ -664,6 +673,7 @@ Please ask a designer if you have questions about which colours to use.
|
|
|
664
673
|
._3-nHz {
|
|
665
674
|
display: flex;
|
|
666
675
|
align-items: center;
|
|
676
|
+
line-height: 21px;
|
|
667
677
|
}
|
|
668
678
|
._2Rh0i {
|
|
669
679
|
cursor: pointer;
|
|
@@ -682,6 +692,7 @@ Please ask a designer if you have questions about which colours to use.
|
|
|
682
692
|
._W7CnY {
|
|
683
693
|
display: inline-block;
|
|
684
694
|
padding: 0 8px;
|
|
695
|
+
line-height: 1em;
|
|
685
696
|
}
|
|
686
697
|
|
|
687
698
|
._2ygIH {
|
|
@@ -734,7 +745,7 @@ Please ask a designer if you have questions about which colours to use.
|
|
|
734
745
|
._1d8Ci {
|
|
735
746
|
display: flex;
|
|
736
747
|
}
|
|
737
|
-
._1d8Ci:not(:last-child) {
|
|
748
|
+
._1d8Ci:not(:last-child):not(._3tb7U) {
|
|
738
749
|
border-bottom: 1px solid #e0e0e0;
|
|
739
750
|
}
|
|
740
751
|
|
|
@@ -757,11 +768,20 @@ Please ask a designer if you have questions about which colours to use.
|
|
|
757
768
|
box-shadow: 0 0 8px #a7b7ea;
|
|
758
769
|
}
|
|
759
770
|
._3tb7U:first-child {
|
|
760
|
-
border-radius: 8px
|
|
771
|
+
border-top-left-radius: 8px;
|
|
772
|
+
border-top-right-radius: 8px;
|
|
773
|
+
}
|
|
774
|
+
._3tb7U:first-child:not(:last-child) {
|
|
775
|
+
border-bottom-left-radius: 0;
|
|
776
|
+
border-bottom-right-radius: 0;
|
|
761
777
|
}
|
|
762
778
|
._3tb7U:last-child {
|
|
763
|
-
border-radius:
|
|
764
|
-
border-bottom:
|
|
779
|
+
border-bottom-left-radius: 8px;
|
|
780
|
+
border-bottom-right-radius: 8px;
|
|
781
|
+
}
|
|
782
|
+
._3tb7U:last-child:not(:first-child) {
|
|
783
|
+
border-top-left-radius: 0;
|
|
784
|
+
border-top-right-radius: 0;
|
|
765
785
|
}
|
|
766
786
|
|
|
767
787
|
._OTcMc {
|
|
@@ -809,6 +829,7 @@ Please ask a designer if you have questions about which colours to use.
|
|
|
809
829
|
._27x4v {
|
|
810
830
|
display: flex;
|
|
811
831
|
align-items: center;
|
|
832
|
+
line-height: 21px;
|
|
812
833
|
}
|
|
813
834
|
._27x4v:not(._27x4v:first-child) {
|
|
814
835
|
padding-left: 16px;
|
|
@@ -837,6 +858,7 @@ Please ask a designer if you have questions about which colours to use.
|
|
|
837
858
|
._3VjFP {
|
|
838
859
|
display: inline-block;
|
|
839
860
|
padding: 0 8px;
|
|
861
|
+
line-height: 1em;
|
|
840
862
|
}
|
|
841
863
|
|
|
842
864
|
._1bTmd {
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ var ReactDOM = _interopDefault(require('react-dom'));
|
|
|
7
7
|
var Select = require('react-select');
|
|
8
8
|
var Select__default = _interopDefault(Select);
|
|
9
9
|
var DayPickerInput = _interopDefault(require('react-day-picker/DayPickerInput'));
|
|
10
|
+
var dateFns = require('date-fns');
|
|
10
11
|
var reactDayPicker = require('react-day-picker');
|
|
11
12
|
var dateFnsFormat = _interopDefault(require('date-fns/format'));
|
|
12
13
|
var dateFnsParse = _interopDefault(require('date-fns/parse'));
|
|
@@ -392,7 +393,9 @@ var TooltipOverlay = function TooltipOverlay(_ref) {
|
|
|
392
393
|
}, []);
|
|
393
394
|
var tooltipRectPosition = tooltipRef === null || tooltipRef === void 0 ? void 0 : (_tooltipRef$current = tooltipRef.current) === null || _tooltipRef$current === void 0 ? void 0 : _tooltipRef$current.getBoundingClientRect();
|
|
394
395
|
var position = calculatePosition(placement, anchorPosition, tooltipRectPosition);
|
|
395
|
-
return React__default.createElement(Portal, null, React__default.createElement("div",
|
|
396
|
+
return React__default.createElement(Portal, null, React__default.createElement("div", {
|
|
397
|
+
role: "tooltip"
|
|
398
|
+
}, React__default.createElement("div", {
|
|
396
399
|
ref: tooltipRef,
|
|
397
400
|
style: _extends({}, position.overlay, {
|
|
398
401
|
zIndex: Z_INDEX_LAYERS.TOOLTIP
|
|
@@ -428,6 +431,7 @@ var Tooltip = function Tooltip(_ref, forwardedRef) {
|
|
|
428
431
|
header = _ref.header,
|
|
429
432
|
extraClass = _ref.extraClass,
|
|
430
433
|
onClose = _ref.onClose,
|
|
434
|
+
onVisibleChange = _ref.onVisibleChange,
|
|
431
435
|
children = _ref.children;
|
|
432
436
|
var checkIsMounted = useIsMounted();
|
|
433
437
|
var internalRef = React.useRef(null);
|
|
@@ -446,6 +450,10 @@ var Tooltip = function Tooltip(_ref, forwardedRef) {
|
|
|
446
450
|
if (!shouldShow) {
|
|
447
451
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
448
452
|
}
|
|
453
|
+
|
|
454
|
+
if (onVisibleChange) {
|
|
455
|
+
onVisibleChange(shouldShow);
|
|
456
|
+
}
|
|
449
457
|
};
|
|
450
458
|
|
|
451
459
|
var onAnchorFocusIn = function onAnchorFocusIn() {
|
|
@@ -2860,7 +2868,7 @@ var IconWrench = function IconWrench(props) {
|
|
|
2860
2868
|
|
|
2861
2869
|
IconWrench.displayName = 'IconWrench';
|
|
2862
2870
|
|
|
2863
|
-
var styles$6 = {"item":"_3DlpO","
|
|
2871
|
+
var styles$6 = {"item":"_3DlpO","selected":"_NS-B9","clickable":"_2jPpF","item-column":"_3ENNn","actions":"_1FTaE"};
|
|
2864
2872
|
|
|
2865
2873
|
var ResourceTableRow = function ResourceTableRow(_ref) {
|
|
2866
2874
|
var _classnames;
|
|
@@ -3177,7 +3185,7 @@ var useDataTableContext = function useDataTableContext() {
|
|
|
3177
3185
|
return context;
|
|
3178
3186
|
};
|
|
3179
3187
|
|
|
3180
|
-
var styles$9 = {"item":"_1d8Ci","
|
|
3188
|
+
var styles$9 = {"item":"_1d8Ci","selected":"_3tb7U","clickable":"_thFcO","item-column":"_OTcMc","item-column--default-padding":"_lNHQ8","item-column--right-align":"_13YLe","item-column--vertical-border":"_1rrRr","actions":"_azbIG"};
|
|
3181
3189
|
|
|
3182
3190
|
var DataTableRow = function DataTableRow(_ref) {
|
|
3183
3191
|
var _classnames;
|
|
@@ -3365,7 +3373,7 @@ var DataTable = function DataTable(_ref) {
|
|
|
3365
3373
|
numberOfRows: numberOfRows,
|
|
3366
3374
|
hasVerticalBorders: hasVerticalBorders
|
|
3367
3375
|
}
|
|
3368
|
-
}, React__default.createElement("div", null, React__default.createElement(DataTableHeader, {
|
|
3376
|
+
}, React__default.createElement("div", null, columns && React__default.createElement(DataTableHeader, {
|
|
3369
3377
|
columns: columns,
|
|
3370
3378
|
onSort: onSort,
|
|
3371
3379
|
showActionMenu: showActionMenu
|
|
@@ -3425,7 +3433,7 @@ var DataTableCell = function DataTableCell(_ref) {
|
|
|
3425
3433
|
var _useDataTableContext = useDataTableContext(),
|
|
3426
3434
|
columns = _useDataTableContext.columns;
|
|
3427
3435
|
|
|
3428
|
-
var column = (_columns$columnIndex = columns[columnIndex]) != null ? _columns$columnIndex : null;
|
|
3436
|
+
var column = (_columns$columnIndex = columns === null || columns === void 0 ? void 0 : columns[columnIndex]) != null ? _columns$columnIndex : null;
|
|
3429
3437
|
var isRightAligned = column ? column.isRightAligned : false;
|
|
3430
3438
|
return React__default.createElement("div", {
|
|
3431
3439
|
className: classnames((_classnames = {}, _classnames[styles$b['data-table-cell--right-aligned']] = isRightAligned, _classnames), styles$b['data-table-cell'])
|
|
@@ -3452,49 +3460,33 @@ var getFormikState = function getFormikState(name, formik) {
|
|
|
3452
3460
|
return null;
|
|
3453
3461
|
}
|
|
3454
3462
|
|
|
3455
|
-
|
|
3456
|
-
return {
|
|
3457
|
-
error: formik.touched[name] ? formik.errors[name] : undefined,
|
|
3458
|
-
value: formik.values[name]
|
|
3459
|
-
};
|
|
3460
|
-
}
|
|
3463
|
+
var formikPath = getFormikArrayPath(name);
|
|
3461
3464
|
|
|
3462
|
-
|
|
3465
|
+
if (formikPath.length === 0) {
|
|
3466
|
+
return null;
|
|
3467
|
+
}
|
|
3463
3468
|
|
|
3464
|
-
|
|
3465
|
-
var
|
|
3469
|
+
var formikLatestLevel = formikPath.reduce(function (acc, path) {
|
|
3470
|
+
var _acc$touched, _acc$error, _acc$value;
|
|
3466
3471
|
|
|
3467
|
-
var arrayName = formikArray.arrayName,
|
|
3468
|
-
itemIndex = formikArray.itemIndex,
|
|
3469
|
-
fieldName = formikArray.fieldName;
|
|
3470
3472
|
return {
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
+
touched: (_acc$touched = acc.touched) === null || _acc$touched === void 0 ? void 0 : _acc$touched[path],
|
|
3474
|
+
error: (_acc$error = acc.error) === null || _acc$error === void 0 ? void 0 : _acc$error[path],
|
|
3475
|
+
value: (_acc$value = acc.value) === null || _acc$value === void 0 ? void 0 : _acc$value[path]
|
|
3473
3476
|
};
|
|
3474
|
-
}
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
var getFormikArrayPath = function getFormikArrayPath(name) {
|
|
3480
|
-
if (!name.includes('[')) {
|
|
3481
|
-
return false;
|
|
3482
|
-
}
|
|
3483
|
-
|
|
3484
|
-
var _name$split = name.split('['),
|
|
3485
|
-
arrayName = _name$split[0],
|
|
3486
|
-
missingSplit = _name$split[1];
|
|
3487
|
-
|
|
3488
|
-
var _missingSplit$split = missingSplit.split('].'),
|
|
3489
|
-
itemIndex = _missingSplit$split[0],
|
|
3490
|
-
fieldName = _missingSplit$split[1];
|
|
3491
|
-
|
|
3477
|
+
}, {
|
|
3478
|
+
touched: formik.touched,
|
|
3479
|
+
error: formik.errors,
|
|
3480
|
+
value: formik.values
|
|
3481
|
+
});
|
|
3492
3482
|
return {
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
fieldName: fieldName
|
|
3483
|
+
error: formikLatestLevel.touched ? formikLatestLevel.error : undefined,
|
|
3484
|
+
value: formikLatestLevel.value
|
|
3496
3485
|
};
|
|
3497
3486
|
};
|
|
3487
|
+
var getFormikArrayPath = function getFormikArrayPath(name) {
|
|
3488
|
+
return name.split(/[^a-zA-Z0-9]/).filter(Boolean);
|
|
3489
|
+
};
|
|
3498
3490
|
|
|
3499
3491
|
var useFieldControllers = function useFieldControllers(_ref) {
|
|
3500
3492
|
var name = _ref.name,
|
|
@@ -3694,9 +3686,9 @@ var DataTableEditableCell = function DataTableEditableCell(_ref) {
|
|
|
3694
3686
|
columns = _useDataTableContext.columns,
|
|
3695
3687
|
numberOfRows = _useDataTableContext.numberOfRows;
|
|
3696
3688
|
|
|
3697
|
-
var column = (_columns$columnIndex = columns[columnIndex]) != null ? _columns$columnIndex : null;
|
|
3689
|
+
var column = (_columns$columnIndex = columns === null || columns === void 0 ? void 0 : columns[columnIndex]) != null ? _columns$columnIndex : null;
|
|
3698
3690
|
var isRightAligned = column ? column.isRightAligned : false;
|
|
3699
|
-
var numberOfColumns = columns === null || columns === void 0 ? void 0 : columns.length;
|
|
3691
|
+
var numberOfColumns = (columns === null || columns === void 0 ? void 0 : columns.length) || 0;
|
|
3700
3692
|
var isTopLeftCell = columnIndex === 0 && rowIndex === 0;
|
|
3701
3693
|
var isTopRightCell = columnIndex === numberOfColumns - 1 && rowIndex === 0;
|
|
3702
3694
|
var isBottomLeftCell = columnIndex === 0 && rowIndex === numberOfRows - 1;
|
|
@@ -4639,6 +4631,7 @@ var MultiSelectField = function MultiSelectField(_ref) {
|
|
|
4639
4631
|
caption = _ref.caption,
|
|
4640
4632
|
error = _ref.error,
|
|
4641
4633
|
placeholder = _ref.placeholder,
|
|
4634
|
+
noOptionsMessage = _ref.noOptionsMessage,
|
|
4642
4635
|
disabled = _ref.disabled,
|
|
4643
4636
|
_ref$closeOnSelect = _ref.closeOnSelect,
|
|
4644
4637
|
closeOnSelect = _ref$closeOnSelect === void 0 ? false : _ref$closeOnSelect,
|
|
@@ -4660,12 +4653,16 @@ var MultiSelectField = function MultiSelectField(_ref) {
|
|
|
4660
4653
|
caption: caption,
|
|
4661
4654
|
error: controllers.error
|
|
4662
4655
|
};
|
|
4656
|
+
var defaultNoOptionsMessage = noOptionsMessage && typeof noOptionsMessage === 'string' ? function () {
|
|
4657
|
+
return noOptionsMessage;
|
|
4658
|
+
} : undefined;
|
|
4663
4659
|
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement(Select__default, {
|
|
4664
4660
|
inputId: controllers.id,
|
|
4665
4661
|
options: options,
|
|
4666
4662
|
isDisabled: disabled,
|
|
4667
4663
|
value: controllers.value,
|
|
4668
4664
|
placeholder: placeholder,
|
|
4665
|
+
noOptionsMessage: typeof noOptionsMessage === 'function' ? noOptionsMessage : defaultNoOptionsMessage,
|
|
4669
4666
|
styles: getSelectStyles({
|
|
4670
4667
|
isInvalid: hasError,
|
|
4671
4668
|
wrapToNextLine: true
|
|
@@ -4691,7 +4688,8 @@ var MultiSelectField = function MultiSelectField(_ref) {
|
|
|
4691
4688
|
}
|
|
4692
4689
|
|
|
4693
4690
|
var target = e.target;
|
|
4694
|
-
var
|
|
4691
|
+
var firstOption = target.children[0];
|
|
4692
|
+
var isScrollingTheMenu = firstOption && typeof firstOption.id === 'string' && firstOption.id.includes('react-select');
|
|
4695
4693
|
return !isScrollingTheMenu;
|
|
4696
4694
|
}
|
|
4697
4695
|
}));
|
|
@@ -4798,6 +4796,7 @@ var SelectField = function SelectField(_ref) {
|
|
|
4798
4796
|
caption = _ref.caption,
|
|
4799
4797
|
error = _ref.error,
|
|
4800
4798
|
placeholder = _ref.placeholder,
|
|
4799
|
+
noOptionsMessage = _ref.noOptionsMessage,
|
|
4801
4800
|
disabled = _ref.disabled,
|
|
4802
4801
|
prefix = _ref.prefix,
|
|
4803
4802
|
_ref$asToolbarFilter = _ref.asToolbarFilter,
|
|
@@ -4820,6 +4819,9 @@ var SelectField = function SelectField(_ref) {
|
|
|
4820
4819
|
caption: caption,
|
|
4821
4820
|
error: controllers.error
|
|
4822
4821
|
};
|
|
4822
|
+
var defaultNoOptionsMessage = noOptionsMessage && typeof noOptionsMessage === 'string' ? function () {
|
|
4823
|
+
return noOptionsMessage;
|
|
4824
|
+
} : undefined;
|
|
4823
4825
|
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement(AffixContainer, {
|
|
4824
4826
|
prefix: prefix
|
|
4825
4827
|
}, React__default.createElement(Select__default, {
|
|
@@ -4828,6 +4830,7 @@ var SelectField = function SelectField(_ref) {
|
|
|
4828
4830
|
isDisabled: disabled,
|
|
4829
4831
|
value: controllers.value,
|
|
4830
4832
|
placeholder: placeholder,
|
|
4833
|
+
noOptionsMessage: typeof noOptionsMessage === 'function' ? noOptionsMessage : defaultNoOptionsMessage,
|
|
4831
4834
|
styles: getSelectStyles({
|
|
4832
4835
|
isInvalid: hasError,
|
|
4833
4836
|
asToolbarFilter: asToolbarFilter
|
|
@@ -4856,7 +4859,8 @@ var SelectField = function SelectField(_ref) {
|
|
|
4856
4859
|
}
|
|
4857
4860
|
|
|
4858
4861
|
var target = e.target;
|
|
4859
|
-
var
|
|
4862
|
+
var firstOption = target.children[0];
|
|
4863
|
+
var isScrollingTheMenu = firstOption && typeof firstOption.id === 'string' && firstOption.id.includes('react-select');
|
|
4860
4864
|
return !isScrollingTheMenu;
|
|
4861
4865
|
}
|
|
4862
4866
|
})));
|
|
@@ -4882,7 +4886,7 @@ var useDateFieldControllers = function useDateFieldControllers(_ref) {
|
|
|
4882
4886
|
error: error,
|
|
4883
4887
|
value: value,
|
|
4884
4888
|
onChange: function onChange(newValue) {
|
|
4885
|
-
return _onChange && _onChange(newValue);
|
|
4889
|
+
return _onChange && _onChange(dateFns.isDate(newValue) ? dateFns.startOfDay(newValue) : newValue);
|
|
4886
4890
|
},
|
|
4887
4891
|
onBlur: function onBlur() {
|
|
4888
4892
|
return _onBlur && _onBlur();
|
|
@@ -4895,7 +4899,7 @@ var useDateFieldControllers = function useDateFieldControllers(_ref) {
|
|
|
4895
4899
|
error: error !== undefined ? controllers.error : formikState.error,
|
|
4896
4900
|
value: value !== undefined ? controllers.value : formikState.value,
|
|
4897
4901
|
onChange: _onChange ? controllers.onChange : function (newValue) {
|
|
4898
|
-
formik.setFieldValue(name, newValue === undefined ? null : newValue);
|
|
4902
|
+
formik.setFieldValue(name, newValue === undefined ? null : dateFns.startOfDay(newValue));
|
|
4899
4903
|
},
|
|
4900
4904
|
onBlur: _onBlur ? controllers.onBlur : function () {
|
|
4901
4905
|
return formik.setFieldTouched(name);
|