@7shifts/sous-chef 2.1.2 → 2.3.1
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/forms/MultiSelectField/MultiSelectField.d.ts +5 -1
- package/dist/forms/SelectField/SelectField.d.ts +5 -1
- package/dist/forms/TextField/TextField.d.ts +1 -1
- package/dist/forms/TextField/useTextField.d.ts +38 -0
- package/dist/forms/TimeField/TimeField.d.ts +9 -0
- package/dist/forms/TimeField/index.d.ts +1 -0
- package/dist/forms/index.d.ts +2 -1
- package/dist/icons/components/IconGavel.d.ts +11 -0
- package/dist/icons/components/index.d.ts +1 -0
- package/dist/index.css +1 -0
- package/dist/index.js +120 -40
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +121 -43
- package/dist/index.modern.js.map +1 -1
- package/package.json +5 -4
|
@@ -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;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { RefType } from '../../utils/types';
|
|
3
|
+
import type { Props } from './TextField';
|
|
4
|
+
declare type UseTextFieldProps = Props & {
|
|
5
|
+
ref: RefType<HTMLInputElement>;
|
|
6
|
+
};
|
|
7
|
+
export declare const useTextField: ({ autoComplete, autoFocus, defaultValue, disabled, error, id, maxLength, name, caption, label, onBlur, onChange, onFocus, onKeyDown, placeholder, value, ref }: UseTextFieldProps) => {
|
|
8
|
+
inputProps: {
|
|
9
|
+
'aria-describedby': string;
|
|
10
|
+
'aria-invalid': boolean;
|
|
11
|
+
autoComplete: "on" | "off" | undefined;
|
|
12
|
+
autoFocus: boolean | undefined;
|
|
13
|
+
className: string;
|
|
14
|
+
'data-testid': string;
|
|
15
|
+
disabled: boolean | undefined;
|
|
16
|
+
defaultValue: string | undefined;
|
|
17
|
+
id: string;
|
|
18
|
+
maxLength: number | undefined;
|
|
19
|
+
name: string;
|
|
20
|
+
onBlur: (e: import("react").ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
21
|
+
onChange: (e: import("react").ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
22
|
+
onFocus: (e: import("react").FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
23
|
+
onKeyDown: (e: import("react").KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
24
|
+
placeholder: string | undefined;
|
|
25
|
+
ref: RefType<HTMLInputElement>;
|
|
26
|
+
size: number;
|
|
27
|
+
type: string;
|
|
28
|
+
value: string | undefined;
|
|
29
|
+
};
|
|
30
|
+
fieldProps: {
|
|
31
|
+
caption: import("react").ReactNode;
|
|
32
|
+
error: string | undefined;
|
|
33
|
+
label: import("react").ReactNode;
|
|
34
|
+
id: string;
|
|
35
|
+
name: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Props as TextFieldProps } from '../TextField/TextField';
|
|
3
|
+
/**
|
|
4
|
+
* `TimeField` are like `TextField` but it auto-format the value when the user leaves the field.
|
|
5
|
+
*
|
|
6
|
+
* At the end, it is just a string formatted nicely. **You are in charge of validating the value and parsing it back to a value that you can use on your application**.
|
|
7
|
+
*/
|
|
8
|
+
declare const TimeField: React.ForwardRefExoticComponent<Pick<TextFieldProps, "disabled" | "id" | "caption" | "label" | "error" | "onChange" | "name" | "value" | "onBlur" | "placeholder" | "autoFocus" | "onFocus" | "onKeyDown" | "defaultValue" | "autoComplete" | "maxLength"> & React.RefAttributes<HTMLInputElement>>;
|
|
9
|
+
export default TimeField;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './TimeField';
|
package/dist/forms/index.d.ts
CHANGED
|
@@ -12,7 +12,8 @@ import SelectField from './SelectField';
|
|
|
12
12
|
import DateField from './DateField';
|
|
13
13
|
import DateRangeField from './DateRangeField';
|
|
14
14
|
import WeekField from './WeekField';
|
|
15
|
-
|
|
15
|
+
import TimeField from './TimeField';
|
|
16
|
+
export { Form, FormRow, TextAreaField, TextField, CheckboxField, PillSelectField, RadioGroupField, RadioGroupOption, PasswordField, MultiSelectField, SelectField, DateField, DateRangeField, WeekField, TimeField, SIZE_25_PERCENT, SIZE_33_PERCENT, SIZE_50_PERCENT, SIZE_66_PERCENT, SIZE_75_PERCENT };
|
|
16
17
|
export type { PasswordCriteria } from './PasswordField/types';
|
|
17
18
|
export type { SelectOption, SelectOptions } from './SelectField/types';
|
|
18
19
|
export type { FormikType } from './Form/types';
|
|
@@ -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 IconGavel: {
|
|
8
|
+
(props: Props): JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
export default IconGavel;
|
|
@@ -56,6 +56,7 @@ export { default as IconFile } from './IconFile';
|
|
|
56
56
|
export { default as IconFlag } from './IconFlag';
|
|
57
57
|
export { default as IconFourDotsCircle } from './IconFourDotsCircle';
|
|
58
58
|
export { default as IconFourSquares } from './IconFourSquares';
|
|
59
|
+
export { default as IconGavel } from './IconGavel';
|
|
59
60
|
export { default as IconGift } from './IconGift';
|
|
60
61
|
export { default as IconGrinBeam } from './IconGrinBeam';
|
|
61
62
|
export { default as IconGripVertical } from './IconGripVertical';
|
package/dist/index.css
CHANGED
package/dist/index.js
CHANGED
|
@@ -7,11 +7,13 @@ 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'));
|
|
13
14
|
var startOfDay = _interopDefault(require('date-fns/startOfDay'));
|
|
14
15
|
var eachDayOfInterval = _interopDefault(require('date-fns/eachDayOfInterval'));
|
|
16
|
+
var parseTime = _interopDefault(require('time-autocomplete/src/core/AMPMParser'));
|
|
15
17
|
var ReactModal = _interopDefault(require('react-modal'));
|
|
16
18
|
|
|
17
19
|
function _extends() {
|
|
@@ -1784,6 +1786,21 @@ var IconFourSquares = function IconFourSquares(props) {
|
|
|
1784
1786
|
|
|
1785
1787
|
IconFourSquares.displayName = 'IconFourSquares';
|
|
1786
1788
|
|
|
1789
|
+
var IconGavel = function IconGavel(props) {
|
|
1790
|
+
return React__default.createElement("svg", Object.assign({
|
|
1791
|
+
viewBox: "0 0 60 60",
|
|
1792
|
+
fill: "none",
|
|
1793
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1794
|
+
"data-testid": "icon-gavel",
|
|
1795
|
+
style: getIconStyles(props)
|
|
1796
|
+
}, props), React__default.createElement("path", {
|
|
1797
|
+
d: "m58.698 21.863-2.418-2.42a4.442 4.442 0 0 0-5.476-.638l-9.61-9.609a4.442 4.442 0 0 0-.638-5.476l-2.418-2.418a4.438 4.438 0 0 0-6.28 0L18.551 14.605a4.446 4.446 0 0 0 0 6.28l2.42 2.42a4.448 4.448 0 0 0 5.475.637l3.48 3.48-6.891 6.89-.947-.946a5.095 5.095 0 0 0-7.198 0l-13.403 13.4a5.095 5.095 0 0 0 0 7.198l4.548 4.548a5.095 5.095 0 0 0 7.197 0l13.401-13.403a5.095 5.095 0 0 0 0-7.198l-.947-.947 6.891-6.89 3.48 3.479a4.449 4.449 0 0 0 .637 5.476l2.42 2.419a4.446 4.446 0 0 0 6.28 0l13.303-13.305a4.439 4.439 0 0 0 0-6.28ZM23.983 42.457l-13.401 13.4a1.34 1.34 0 0 1-1.894 0l-4.546-4.545a1.34 1.34 0 0 1 0-1.894l13.401-13.4a1.34 1.34 0 0 1 1.894 0l4.546 4.545a1.341 1.341 0 0 1 0 1.894Zm32.065-16.966L42.743 38.796a.69.69 0 0 1-.977 0l-2.42-2.42a.691.691 0 0 1 0-.976l1.932-1.93L26.53 18.721l-1.93 1.931a.692.692 0 0 1-.978 0l-2.419-2.419a.692.692 0 0 1 0-.977L34.51 3.952a.691.691 0 0 1 .977 0l2.419 2.42a.691.691 0 0 1 0 .976l-1.93 1.931L50.72 24.026l1.931-1.93a.69.69 0 0 1 .977 0l2.419 2.418a.692.692 0 0 1 0 .977Z",
|
|
1798
|
+
fill: "currentColor"
|
|
1799
|
+
}));
|
|
1800
|
+
};
|
|
1801
|
+
|
|
1802
|
+
IconGavel.displayName = 'IconGavel';
|
|
1803
|
+
|
|
1787
1804
|
var IconGift = function IconGift(props) {
|
|
1788
1805
|
return React__default.createElement("svg", Object.assign({
|
|
1789
1806
|
viewBox: "0 0 20 20",
|
|
@@ -3907,30 +3924,29 @@ var TextAreaField = function TextAreaField(_ref) {
|
|
|
3907
3924
|
|
|
3908
3925
|
var styles$j = {"text-field":"_20YOA","text-field--invalid":"_3kUSh","text-field--prefixed":"_3IU3Q","text-field--suffixed":"_QXJOD"};
|
|
3909
3926
|
|
|
3910
|
-
var
|
|
3927
|
+
var useTextField = function useTextField(_ref) {
|
|
3911
3928
|
var _classnames;
|
|
3912
3929
|
|
|
3913
3930
|
var autoComplete = _ref.autoComplete,
|
|
3914
3931
|
autoFocus = _ref.autoFocus,
|
|
3915
|
-
caption = _ref.caption,
|
|
3916
3932
|
defaultValue = _ref.defaultValue,
|
|
3917
3933
|
disabled = _ref.disabled,
|
|
3918
3934
|
error = _ref.error,
|
|
3919
|
-
|
|
3920
|
-
label = _ref.label,
|
|
3935
|
+
id = _ref.id,
|
|
3921
3936
|
maxLength = _ref.maxLength,
|
|
3922
3937
|
name = _ref.name,
|
|
3938
|
+
caption = _ref.caption,
|
|
3939
|
+
label = _ref.label,
|
|
3923
3940
|
onBlur = _ref.onBlur,
|
|
3924
3941
|
onChange = _ref.onChange,
|
|
3925
3942
|
onFocus = _ref.onFocus,
|
|
3926
3943
|
onKeyDown = _ref.onKeyDown,
|
|
3927
3944
|
placeholder = _ref.placeholder,
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
value = _ref.value;
|
|
3945
|
+
value = _ref.value,
|
|
3946
|
+
ref = _ref.ref;
|
|
3931
3947
|
var controllers = useFieldControllers({
|
|
3932
3948
|
error: error,
|
|
3933
|
-
id:
|
|
3949
|
+
id: id,
|
|
3934
3950
|
name: name,
|
|
3935
3951
|
onChange: onChange,
|
|
3936
3952
|
onBlur: onBlur,
|
|
@@ -3939,23 +3955,13 @@ var TextFieldElement = function TextFieldElement(_ref, ref) {
|
|
|
3939
3955
|
value: value
|
|
3940
3956
|
});
|
|
3941
3957
|
var hasError = !!controllers.error;
|
|
3942
|
-
var
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
label: label,
|
|
3946
|
-
id: controllers.id,
|
|
3947
|
-
name: name
|
|
3948
|
-
};
|
|
3949
|
-
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement(AffixContainer, {
|
|
3950
|
-
prefix: prefix,
|
|
3951
|
-
suffix: suffix
|
|
3952
|
-
}, React__default.createElement("input", {
|
|
3953
|
-
"aria-describedby": hasError ? controllers.id + "-error-message" : controllers.id + "-describer",
|
|
3954
|
-
"aria-invalid": hasError,
|
|
3958
|
+
var inputProps = {
|
|
3959
|
+
'aria-describedby': hasError ? controllers.id + "-error-message" : controllers.id + "-describer",
|
|
3960
|
+
'aria-invalid': hasError,
|
|
3955
3961
|
autoComplete: autoComplete,
|
|
3956
3962
|
autoFocus: autoFocus,
|
|
3957
3963
|
className: classnames(styles$j['text-field'], (_classnames = {}, _classnames[styles$j['text-field--invalid']] = hasError, _classnames)),
|
|
3958
|
-
|
|
3964
|
+
'data-testid': "text-field-" + name,
|
|
3959
3965
|
disabled: disabled,
|
|
3960
3966
|
defaultValue: defaultValue,
|
|
3961
3967
|
id: controllers.id,
|
|
@@ -3968,9 +3974,39 @@ var TextFieldElement = function TextFieldElement(_ref, ref) {
|
|
|
3968
3974
|
placeholder: placeholder,
|
|
3969
3975
|
ref: ref,
|
|
3970
3976
|
size: 1,
|
|
3971
|
-
type:
|
|
3977
|
+
type: 'text',
|
|
3972
3978
|
value: controllers.value
|
|
3973
|
-
}
|
|
3979
|
+
};
|
|
3980
|
+
var fieldProps = {
|
|
3981
|
+
caption: caption,
|
|
3982
|
+
error: controllers.error,
|
|
3983
|
+
label: label,
|
|
3984
|
+
id: inputProps.id,
|
|
3985
|
+
name: name
|
|
3986
|
+
};
|
|
3987
|
+
return {
|
|
3988
|
+
inputProps: inputProps,
|
|
3989
|
+
fieldProps: fieldProps
|
|
3990
|
+
};
|
|
3991
|
+
};
|
|
3992
|
+
|
|
3993
|
+
var _excluded$2 = ["prefix", "suffix"];
|
|
3994
|
+
|
|
3995
|
+
var TextFieldElement = function TextFieldElement(_ref, ref) {
|
|
3996
|
+
var prefix = _ref.prefix,
|
|
3997
|
+
suffix = _ref.suffix,
|
|
3998
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
3999
|
+
|
|
4000
|
+
var _useTextField = useTextField(_extends({}, props, {
|
|
4001
|
+
ref: ref
|
|
4002
|
+
})),
|
|
4003
|
+
inputProps = _useTextField.inputProps,
|
|
4004
|
+
fieldProps = _useTextField.fieldProps;
|
|
4005
|
+
|
|
4006
|
+
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement(AffixContainer, {
|
|
4007
|
+
prefix: prefix,
|
|
4008
|
+
suffix: suffix
|
|
4009
|
+
}, React__default.createElement("input", Object.assign({}, inputProps))));
|
|
3974
4010
|
};
|
|
3975
4011
|
|
|
3976
4012
|
var TextField = React.forwardRef(TextFieldElement);
|
|
@@ -4479,7 +4515,7 @@ var getSelectStyles = function getSelectStyles(_ref) {
|
|
|
4479
4515
|
return Object.assign({}, base, {
|
|
4480
4516
|
flex: '1',
|
|
4481
4517
|
fontFamily: FONT_FAMILY,
|
|
4482
|
-
minWidth: '
|
|
4518
|
+
minWidth: '110px',
|
|
4483
4519
|
backgroundColor: state.isDisabled && !asToolbarFilter ? GREY100 : WHITE,
|
|
4484
4520
|
position: 'initial'
|
|
4485
4521
|
});
|
|
@@ -4524,11 +4560,12 @@ var getSelectStyles = function getSelectStyles(_ref) {
|
|
|
4524
4560
|
return Object.assign({}, base, {
|
|
4525
4561
|
color: state.isDisabled ? GREY400 : null,
|
|
4526
4562
|
marginRight: 0,
|
|
4527
|
-
position: 'static',
|
|
4563
|
+
position: asToolbarFilter ? 'static' : 'absolute',
|
|
4528
4564
|
transform: 'initial',
|
|
4529
4565
|
overflow: 'hidden',
|
|
4530
4566
|
textOverflow: 'ellipsis',
|
|
4531
|
-
whiteSpace: 'nowrap'
|
|
4567
|
+
whiteSpace: 'nowrap',
|
|
4568
|
+
top: !asToolbarFilter && 'auto'
|
|
4532
4569
|
});
|
|
4533
4570
|
},
|
|
4534
4571
|
dropdownIndicator: function dropdownIndicator(base, state) {
|
|
@@ -4543,7 +4580,8 @@ var getSelectStyles = function getSelectStyles(_ref) {
|
|
|
4543
4580
|
color: state.isDisabled ? GREY400 : state.isSelected ? EGGPLANT700 : GREY500,
|
|
4544
4581
|
cursor: 'pointer',
|
|
4545
4582
|
fontFamily: FONT_FAMILY,
|
|
4546
|
-
fontSize: '14px'
|
|
4583
|
+
fontSize: '14px',
|
|
4584
|
+
wordBreak: 'break-word'
|
|
4547
4585
|
});
|
|
4548
4586
|
},
|
|
4549
4587
|
group: function group(base) {
|
|
@@ -4580,12 +4618,12 @@ var getSelectStyles = function getSelectStyles(_ref) {
|
|
|
4580
4618
|
};
|
|
4581
4619
|
};
|
|
4582
4620
|
|
|
4583
|
-
var _excluded$
|
|
4621
|
+
var _excluded$3 = ["children", "CustomComponent"];
|
|
4584
4622
|
|
|
4585
4623
|
function CustomOption(_ref) {
|
|
4586
4624
|
var children = _ref.children,
|
|
4587
4625
|
CustomComponent = _ref.CustomComponent,
|
|
4588
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4626
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
4589
4627
|
|
|
4590
4628
|
return React__default.createElement(Select.components.Option, Object.assign({}, props), React__default.createElement(CustomComponent, Object.assign({}, props), children));
|
|
4591
4629
|
}
|
|
@@ -4602,6 +4640,7 @@ var MultiSelectField = function MultiSelectField(_ref) {
|
|
|
4602
4640
|
caption = _ref.caption,
|
|
4603
4641
|
error = _ref.error,
|
|
4604
4642
|
placeholder = _ref.placeholder,
|
|
4643
|
+
noOptionsMessage = _ref.noOptionsMessage,
|
|
4605
4644
|
disabled = _ref.disabled,
|
|
4606
4645
|
_ref$closeOnSelect = _ref.closeOnSelect,
|
|
4607
4646
|
closeOnSelect = _ref$closeOnSelect === void 0 ? false : _ref$closeOnSelect,
|
|
@@ -4623,12 +4662,16 @@ var MultiSelectField = function MultiSelectField(_ref) {
|
|
|
4623
4662
|
caption: caption,
|
|
4624
4663
|
error: controllers.error
|
|
4625
4664
|
};
|
|
4665
|
+
var defaultNoOptionsMessage = noOptionsMessage && typeof noOptionsMessage === 'string' ? function () {
|
|
4666
|
+
return noOptionsMessage;
|
|
4667
|
+
} : undefined;
|
|
4626
4668
|
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement(Select__default, {
|
|
4627
4669
|
inputId: controllers.id,
|
|
4628
4670
|
options: options,
|
|
4629
4671
|
isDisabled: disabled,
|
|
4630
4672
|
value: controllers.value,
|
|
4631
4673
|
placeholder: placeholder,
|
|
4674
|
+
noOptionsMessage: typeof noOptionsMessage === 'function' ? noOptionsMessage : defaultNoOptionsMessage,
|
|
4632
4675
|
styles: getSelectStyles({
|
|
4633
4676
|
isInvalid: hasError,
|
|
4634
4677
|
wrapToNextLine: true
|
|
@@ -4654,7 +4697,8 @@ var MultiSelectField = function MultiSelectField(_ref) {
|
|
|
4654
4697
|
}
|
|
4655
4698
|
|
|
4656
4699
|
var target = e.target;
|
|
4657
|
-
var
|
|
4700
|
+
var firstOption = target.children[0];
|
|
4701
|
+
var isScrollingTheMenu = firstOption && typeof firstOption.id === 'string' && firstOption.id.includes('react-select');
|
|
4658
4702
|
return !isScrollingTheMenu;
|
|
4659
4703
|
}
|
|
4660
4704
|
}));
|
|
@@ -4714,14 +4758,14 @@ var useSelectFieldControllers = function useSelectFieldControllers(_ref) {
|
|
|
4714
4758
|
|
|
4715
4759
|
var styles$q = {"custom-control":"_1cDCR"};
|
|
4716
4760
|
|
|
4717
|
-
var _excluded$
|
|
4761
|
+
var _excluded$4 = ["children", "CustomPrefixComponent"];
|
|
4718
4762
|
|
|
4719
4763
|
function CustomControl(_ref) {
|
|
4720
4764
|
var _props$getValue;
|
|
4721
4765
|
|
|
4722
4766
|
var children = _ref.children,
|
|
4723
4767
|
CustomPrefixComponent = _ref.CustomPrefixComponent,
|
|
4724
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4768
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
4725
4769
|
|
|
4726
4770
|
var selectedOption = (_props$getValue = props.getValue()) === null || _props$getValue === void 0 ? void 0 : _props$getValue[0];
|
|
4727
4771
|
return React__default.createElement(Select.components.Control, Object.assign({}, props), CustomControl && selectedOption ? React__default.createElement("div", {
|
|
@@ -4738,12 +4782,12 @@ function CustomControl(_ref) {
|
|
|
4738
4782
|
}, props)), children)) : children);
|
|
4739
4783
|
}
|
|
4740
4784
|
|
|
4741
|
-
var _excluded$
|
|
4785
|
+
var _excluded$5 = ["children", "CustomComponent"];
|
|
4742
4786
|
|
|
4743
4787
|
function CustomOption$1(_ref) {
|
|
4744
4788
|
var children = _ref.children,
|
|
4745
4789
|
CustomComponent = _ref.CustomComponent,
|
|
4746
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4790
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
4747
4791
|
|
|
4748
4792
|
return React__default.createElement(Select.components.Option, Object.assign({}, props), React__default.createElement(CustomComponent, Object.assign({}, props), children));
|
|
4749
4793
|
}
|
|
@@ -4761,6 +4805,7 @@ var SelectField = function SelectField(_ref) {
|
|
|
4761
4805
|
caption = _ref.caption,
|
|
4762
4806
|
error = _ref.error,
|
|
4763
4807
|
placeholder = _ref.placeholder,
|
|
4808
|
+
noOptionsMessage = _ref.noOptionsMessage,
|
|
4764
4809
|
disabled = _ref.disabled,
|
|
4765
4810
|
prefix = _ref.prefix,
|
|
4766
4811
|
_ref$asToolbarFilter = _ref.asToolbarFilter,
|
|
@@ -4783,6 +4828,9 @@ var SelectField = function SelectField(_ref) {
|
|
|
4783
4828
|
caption: caption,
|
|
4784
4829
|
error: controllers.error
|
|
4785
4830
|
};
|
|
4831
|
+
var defaultNoOptionsMessage = noOptionsMessage && typeof noOptionsMessage === 'string' ? function () {
|
|
4832
|
+
return noOptionsMessage;
|
|
4833
|
+
} : undefined;
|
|
4786
4834
|
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement(AffixContainer, {
|
|
4787
4835
|
prefix: prefix
|
|
4788
4836
|
}, React__default.createElement(Select__default, {
|
|
@@ -4791,6 +4839,7 @@ var SelectField = function SelectField(_ref) {
|
|
|
4791
4839
|
isDisabled: disabled,
|
|
4792
4840
|
value: controllers.value,
|
|
4793
4841
|
placeholder: placeholder,
|
|
4842
|
+
noOptionsMessage: typeof noOptionsMessage === 'function' ? noOptionsMessage : defaultNoOptionsMessage,
|
|
4794
4843
|
styles: getSelectStyles({
|
|
4795
4844
|
isInvalid: hasError,
|
|
4796
4845
|
asToolbarFilter: asToolbarFilter
|
|
@@ -4819,7 +4868,8 @@ var SelectField = function SelectField(_ref) {
|
|
|
4819
4868
|
}
|
|
4820
4869
|
|
|
4821
4870
|
var target = e.target;
|
|
4822
|
-
var
|
|
4871
|
+
var firstOption = target.children[0];
|
|
4872
|
+
var isScrollingTheMenu = firstOption && typeof firstOption.id === 'string' && firstOption.id.includes('react-select');
|
|
4823
4873
|
return !isScrollingTheMenu;
|
|
4824
4874
|
}
|
|
4825
4875
|
})));
|
|
@@ -4845,7 +4895,7 @@ var useDateFieldControllers = function useDateFieldControllers(_ref) {
|
|
|
4845
4895
|
error: error,
|
|
4846
4896
|
value: value,
|
|
4847
4897
|
onChange: function onChange(newValue) {
|
|
4848
|
-
return _onChange && _onChange(newValue);
|
|
4898
|
+
return newValue && _onChange && _onChange(dateFns.startOfDay(newValue));
|
|
4849
4899
|
},
|
|
4850
4900
|
onBlur: function onBlur() {
|
|
4851
4901
|
return _onBlur && _onBlur();
|
|
@@ -4858,7 +4908,7 @@ var useDateFieldControllers = function useDateFieldControllers(_ref) {
|
|
|
4858
4908
|
error: error !== undefined ? controllers.error : formikState.error,
|
|
4859
4909
|
value: value !== undefined ? controllers.value : formikState.value,
|
|
4860
4910
|
onChange: _onChange ? controllers.onChange : function (newValue) {
|
|
4861
|
-
formik.setFieldValue(name, newValue === undefined ? null : newValue);
|
|
4911
|
+
formik.setFieldValue(name, newValue === undefined ? null : dateFns.startOfDay(newValue));
|
|
4862
4912
|
},
|
|
4863
4913
|
onBlur: _onBlur ? controllers.onBlur : function () {
|
|
4864
4914
|
return formik.setFieldTouched(name);
|
|
@@ -5413,6 +5463,34 @@ var WeekField = function WeekField(_ref) {
|
|
|
5413
5463
|
})));
|
|
5414
5464
|
};
|
|
5415
5465
|
|
|
5466
|
+
var _excluded$6 = ["placeholder", "autoComplete"];
|
|
5467
|
+
|
|
5468
|
+
var TimeFieldElement = function TimeFieldElement(_ref, ref) {
|
|
5469
|
+
var _ref$placeholder = _ref.placeholder,
|
|
5470
|
+
placeholder = _ref$placeholder === void 0 ? '9am' : _ref$placeholder,
|
|
5471
|
+
_ref$autoComplete = _ref.autoComplete,
|
|
5472
|
+
autoComplete = _ref$autoComplete === void 0 ? 'off' : _ref$autoComplete,
|
|
5473
|
+
allOtherProps = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
5474
|
+
|
|
5475
|
+
var _useTextField = useTextField(_extends({}, allOtherProps, {
|
|
5476
|
+
placeholder: placeholder,
|
|
5477
|
+
autoComplete: autoComplete,
|
|
5478
|
+
ref: ref
|
|
5479
|
+
})),
|
|
5480
|
+
inputProps = _useTextField.inputProps,
|
|
5481
|
+
fieldProps = _useTextField.fieldProps;
|
|
5482
|
+
|
|
5483
|
+
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement("input", Object.assign({}, inputProps, {
|
|
5484
|
+
onBlur: function onBlur(e) {
|
|
5485
|
+
e.target.value = parseTime(e.target.value, 'g:i A');
|
|
5486
|
+
inputProps.onChange(e);
|
|
5487
|
+
inputProps.onBlur(e);
|
|
5488
|
+
}
|
|
5489
|
+
})));
|
|
5490
|
+
};
|
|
5491
|
+
|
|
5492
|
+
var TimeField = React.forwardRef(TimeFieldElement);
|
|
5493
|
+
|
|
5416
5494
|
var styles$u = {"caption":"_1QDLF","label":"_2wiMV","toggle":"_1ui8X","toggle__label":"_1YRJT","toggle__caption":"_1jEiW","toggle__switch":"_3tNyE"};
|
|
5417
5495
|
|
|
5418
5496
|
var Toggle = function Toggle(_ref) {
|
|
@@ -5586,7 +5664,7 @@ var FooterContainer = function FooterContainer(_ref2) {
|
|
|
5586
5664
|
|
|
5587
5665
|
var styles$z = {"badge":"_2f81N","badge--warning":"_2g1GI","badge--danger":"_2zLnM","badge--success":"_27QOo","badge--info":"_2gmsM"};
|
|
5588
5666
|
|
|
5589
|
-
var _excluded$
|
|
5667
|
+
var _excluded$7 = ["children", "theme", "title"];
|
|
5590
5668
|
|
|
5591
5669
|
var Badge = function Badge(_ref, forwardedRef) {
|
|
5592
5670
|
var _classnames;
|
|
@@ -5594,7 +5672,7 @@ var Badge = function Badge(_ref, forwardedRef) {
|
|
|
5594
5672
|
var children = _ref.children,
|
|
5595
5673
|
theme = _ref.theme,
|
|
5596
5674
|
title = _ref.title,
|
|
5597
|
-
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
5675
|
+
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
5598
5676
|
|
|
5599
5677
|
var internalRef = React.useRef(null);
|
|
5600
5678
|
var ref = forwardedRef || internalRef;
|
|
@@ -5794,6 +5872,7 @@ exports.IconFilePdf = IconFilePdf;
|
|
|
5794
5872
|
exports.IconFlag = IconFlag;
|
|
5795
5873
|
exports.IconFourDotsCircle = IconFourDotsCircle;
|
|
5796
5874
|
exports.IconFourSquares = IconFourSquares;
|
|
5875
|
+
exports.IconGavel = IconGavel;
|
|
5797
5876
|
exports.IconGift = IconGift;
|
|
5798
5877
|
exports.IconGrinBeam = IconGrinBeam;
|
|
5799
5878
|
exports.IconGripVertical = IconGripVertical;
|
|
@@ -5877,6 +5956,7 @@ exports.Spinner = Spinner;
|
|
|
5877
5956
|
exports.Stack = Stack;
|
|
5878
5957
|
exports.TextAreaField = TextAreaField;
|
|
5879
5958
|
exports.TextField = TextField;
|
|
5959
|
+
exports.TimeField = TimeField;
|
|
5880
5960
|
exports.Toggle = Toggle;
|
|
5881
5961
|
exports.Tooltip = Tooltip$1;
|
|
5882
5962
|
exports.WeekField = WeekField;
|