@7shifts/sous-chef 2.1.0 → 2.2.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/forms/MultiSelectField/MultiSelectField.d.ts +3 -1
- package/dist/forms/SelectField/SelectField.d.ts +3 -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/index.css +3 -0
- package/dist/index.js +111 -37
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +111 -38
- package/dist/index.modern.js.map +1 -1
- package/package.json +5 -4
|
@@ -15,7 +15,9 @@ declare type Props<T> = {
|
|
|
15
15
|
placeholder?: string;
|
|
16
16
|
disabled?: boolean;
|
|
17
17
|
closeOnSelect?: boolean;
|
|
18
|
+
/** 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
|
+
menuShouldScrollIntoView?: boolean;
|
|
18
20
|
};
|
|
19
21
|
/** Component to make possible choose from a predefined options. */
|
|
20
|
-
declare const MultiSelectField: <T extends unknown>({ name, id: inputId, value, options, onChange, onBlur, CustomOption: UserCustomOption, label, caption, error, placeholder, disabled, closeOnSelect }: Props<T>) => JSX.Element;
|
|
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;
|
|
21
23
|
export default MultiSelectField;
|
|
@@ -18,7 +18,9 @@ declare type Props<T> = {
|
|
|
18
18
|
/** Use a prefix for things like currency symbols (“$”, “¥”, “£”) or icons. */
|
|
19
19
|
prefix?: React.ReactNode;
|
|
20
20
|
asToolbarFilter?: boolean;
|
|
21
|
+
/** 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 `SelectField` inside a modal. */
|
|
22
|
+
menuShouldScrollIntoView?: boolean;
|
|
21
23
|
};
|
|
22
24
|
/** Component to make possible choose from a predefined options. */
|
|
23
|
-
declare const SelectField: <T extends unknown>({ name, id: inputId, value, options, onChange, onBlur, CustomOption: UserCustomOption, SelectedOptionPrefix, label, caption, error, placeholder, disabled, prefix, asToolbarFilter }: Props<T>) => JSX.Element;
|
|
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;
|
|
24
26
|
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';
|
package/dist/index.css
CHANGED
|
@@ -784,6 +784,7 @@ Please ask a designer if you have questions about which colours to use.
|
|
|
784
784
|
._azbIG {
|
|
785
785
|
width: 40px;
|
|
786
786
|
padding: 16px;
|
|
787
|
+
box-sizing: content-box;
|
|
787
788
|
}
|
|
788
789
|
/*********************************
|
|
789
790
|
For new colours, see _colors.scss.
|
|
@@ -830,6 +831,7 @@ Please ask a designer if you have questions about which colours to use.
|
|
|
830
831
|
|
|
831
832
|
._LoIvx {
|
|
832
833
|
width: 40px;
|
|
834
|
+
box-sizing: content-box;
|
|
833
835
|
}
|
|
834
836
|
|
|
835
837
|
._3VjFP {
|
|
@@ -1569,6 +1571,7 @@ Please ask a designer if you have questions about which colours to use.
|
|
|
1569
1571
|
._1Sc9D {
|
|
1570
1572
|
padding-top: 8px;
|
|
1571
1573
|
padding-bottom: 6px;
|
|
1574
|
+
width: 100%;
|
|
1572
1575
|
}
|
|
1573
1576
|
/*********************************
|
|
1574
1577
|
For new colours, see _colors.scss.
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,7 @@ var dateFnsFormat = _interopDefault(require('date-fns/format'));
|
|
|
12
12
|
var dateFnsParse = _interopDefault(require('date-fns/parse'));
|
|
13
13
|
var startOfDay = _interopDefault(require('date-fns/startOfDay'));
|
|
14
14
|
var eachDayOfInterval = _interopDefault(require('date-fns/eachDayOfInterval'));
|
|
15
|
+
var parseTime = _interopDefault(require('time-autocomplete/src/core/AMPMParser'));
|
|
15
16
|
var ReactModal = _interopDefault(require('react-modal'));
|
|
16
17
|
|
|
17
18
|
function _extends() {
|
|
@@ -1807,9 +1808,6 @@ var IconGrinBeam = function IconGrinBeam(props) {
|
|
|
1807
1808
|
"data-testid": "icon-grin-beam",
|
|
1808
1809
|
style: getIconStyles(props)
|
|
1809
1810
|
}, props), React__default.createElement("path", {
|
|
1810
|
-
fill: "#fff",
|
|
1811
|
-
d: "M0 0h20v20H0z"
|
|
1812
|
-
}), React__default.createElement("path", {
|
|
1813
1811
|
d: "M4.746 9.676a.335.335 0 0 0 .375-.145l.383-.664c.31-.535.774-.844 1.27-.844s.96.309 1.27.844l.383.664c.085.145.25.184.375.145a.314.314 0 0 0 .23-.324c-.133-1.645-1.298-2.79-2.258-2.79S4.65 7.707 4.516 9.352a.317.317 0 0 0 .23.324Zm6.452 0a.335.335 0 0 0 .375-.145l.383-.664c.31-.535.774-.844 1.27-.844s.96.309 1.27.844l.383.664c.085.145.25.184.375.145a.314.314 0 0 0 .23-.324c-.133-1.645-1.299-2.79-2.258-2.79-.96 0-2.125 1.145-2.258 2.79a.317.317 0 0 0 .23.324Zm3.766 2.855c-1.218.38-3.029.594-4.964.594-1.935 0-3.746-.215-4.964-.594a.662.662 0 0 0-.617.121.62.62 0 0 0-.213.579c.37 2.148 3.354 3.644 5.798 3.644s5.423-1.496 5.798-3.645a.624.624 0 0 0-.213-.578.66.66 0 0 0-.625-.12ZM10 15.625c-1.411 0-3.105-.637-3.972-1.574 2.319.422 5.63.422 7.948 0-.871.937-2.565 1.574-3.976 1.574ZM10 .312C4.476.313 0 4.649 0 10s4.476 9.688 10 9.688S20 15.351 20 10 15.524.312 10 .312Zm0 18.125c-4.802 0-8.71-3.785-8.71-8.437 0-4.652 3.908-8.438 8.71-8.438 4.802 0 8.71 3.786 8.71 8.438 0 4.652-3.908 8.438-8.71 8.438Z",
|
|
1814
1812
|
fill: "currentColor"
|
|
1815
1813
|
}));
|
|
@@ -3910,30 +3908,29 @@ var TextAreaField = function TextAreaField(_ref) {
|
|
|
3910
3908
|
|
|
3911
3909
|
var styles$j = {"text-field":"_20YOA","text-field--invalid":"_3kUSh","text-field--prefixed":"_3IU3Q","text-field--suffixed":"_QXJOD"};
|
|
3912
3910
|
|
|
3913
|
-
var
|
|
3911
|
+
var useTextField = function useTextField(_ref) {
|
|
3914
3912
|
var _classnames;
|
|
3915
3913
|
|
|
3916
3914
|
var autoComplete = _ref.autoComplete,
|
|
3917
3915
|
autoFocus = _ref.autoFocus,
|
|
3918
|
-
caption = _ref.caption,
|
|
3919
3916
|
defaultValue = _ref.defaultValue,
|
|
3920
3917
|
disabled = _ref.disabled,
|
|
3921
3918
|
error = _ref.error,
|
|
3922
|
-
|
|
3923
|
-
label = _ref.label,
|
|
3919
|
+
id = _ref.id,
|
|
3924
3920
|
maxLength = _ref.maxLength,
|
|
3925
3921
|
name = _ref.name,
|
|
3922
|
+
caption = _ref.caption,
|
|
3923
|
+
label = _ref.label,
|
|
3926
3924
|
onBlur = _ref.onBlur,
|
|
3927
3925
|
onChange = _ref.onChange,
|
|
3928
3926
|
onFocus = _ref.onFocus,
|
|
3929
3927
|
onKeyDown = _ref.onKeyDown,
|
|
3930
3928
|
placeholder = _ref.placeholder,
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
value = _ref.value;
|
|
3929
|
+
value = _ref.value,
|
|
3930
|
+
ref = _ref.ref;
|
|
3934
3931
|
var controllers = useFieldControllers({
|
|
3935
3932
|
error: error,
|
|
3936
|
-
id:
|
|
3933
|
+
id: id,
|
|
3937
3934
|
name: name,
|
|
3938
3935
|
onChange: onChange,
|
|
3939
3936
|
onBlur: onBlur,
|
|
@@ -3942,23 +3939,13 @@ var TextFieldElement = function TextFieldElement(_ref, ref) {
|
|
|
3942
3939
|
value: value
|
|
3943
3940
|
});
|
|
3944
3941
|
var hasError = !!controllers.error;
|
|
3945
|
-
var
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
label: label,
|
|
3949
|
-
id: controllers.id,
|
|
3950
|
-
name: name
|
|
3951
|
-
};
|
|
3952
|
-
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement(AffixContainer, {
|
|
3953
|
-
prefix: prefix,
|
|
3954
|
-
suffix: suffix
|
|
3955
|
-
}, React__default.createElement("input", {
|
|
3956
|
-
"aria-describedby": hasError ? controllers.id + "-error-message" : controllers.id + "-describer",
|
|
3957
|
-
"aria-invalid": hasError,
|
|
3942
|
+
var inputProps = {
|
|
3943
|
+
'aria-describedby': hasError ? controllers.id + "-error-message" : controllers.id + "-describer",
|
|
3944
|
+
'aria-invalid': hasError,
|
|
3958
3945
|
autoComplete: autoComplete,
|
|
3959
3946
|
autoFocus: autoFocus,
|
|
3960
3947
|
className: classnames(styles$j['text-field'], (_classnames = {}, _classnames[styles$j['text-field--invalid']] = hasError, _classnames)),
|
|
3961
|
-
|
|
3948
|
+
'data-testid': "text-field-" + name,
|
|
3962
3949
|
disabled: disabled,
|
|
3963
3950
|
defaultValue: defaultValue,
|
|
3964
3951
|
id: controllers.id,
|
|
@@ -3971,9 +3958,39 @@ var TextFieldElement = function TextFieldElement(_ref, ref) {
|
|
|
3971
3958
|
placeholder: placeholder,
|
|
3972
3959
|
ref: ref,
|
|
3973
3960
|
size: 1,
|
|
3974
|
-
type:
|
|
3961
|
+
type: 'text',
|
|
3975
3962
|
value: controllers.value
|
|
3976
|
-
}
|
|
3963
|
+
};
|
|
3964
|
+
var fieldProps = {
|
|
3965
|
+
caption: caption,
|
|
3966
|
+
error: controllers.error,
|
|
3967
|
+
label: label,
|
|
3968
|
+
id: inputProps.id,
|
|
3969
|
+
name: name
|
|
3970
|
+
};
|
|
3971
|
+
return {
|
|
3972
|
+
inputProps: inputProps,
|
|
3973
|
+
fieldProps: fieldProps
|
|
3974
|
+
};
|
|
3975
|
+
};
|
|
3976
|
+
|
|
3977
|
+
var _excluded$2 = ["prefix", "suffix"];
|
|
3978
|
+
|
|
3979
|
+
var TextFieldElement = function TextFieldElement(_ref, ref) {
|
|
3980
|
+
var prefix = _ref.prefix,
|
|
3981
|
+
suffix = _ref.suffix,
|
|
3982
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
3983
|
+
|
|
3984
|
+
var _useTextField = useTextField(_extends({}, props, {
|
|
3985
|
+
ref: ref
|
|
3986
|
+
})),
|
|
3987
|
+
inputProps = _useTextField.inputProps,
|
|
3988
|
+
fieldProps = _useTextField.fieldProps;
|
|
3989
|
+
|
|
3990
|
+
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement(AffixContainer, {
|
|
3991
|
+
prefix: prefix,
|
|
3992
|
+
suffix: suffix
|
|
3993
|
+
}, React__default.createElement("input", Object.assign({}, inputProps))));
|
|
3977
3994
|
};
|
|
3978
3995
|
|
|
3979
3996
|
var TextField = React.forwardRef(TextFieldElement);
|
|
@@ -4583,12 +4600,12 @@ var getSelectStyles = function getSelectStyles(_ref) {
|
|
|
4583
4600
|
};
|
|
4584
4601
|
};
|
|
4585
4602
|
|
|
4586
|
-
var _excluded$
|
|
4603
|
+
var _excluded$3 = ["children", "CustomComponent"];
|
|
4587
4604
|
|
|
4588
4605
|
function CustomOption(_ref) {
|
|
4589
4606
|
var children = _ref.children,
|
|
4590
4607
|
CustomComponent = _ref.CustomComponent,
|
|
4591
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4608
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
4592
4609
|
|
|
4593
4610
|
return React__default.createElement(Select.components.Option, Object.assign({}, props), React__default.createElement(CustomComponent, Object.assign({}, props), children));
|
|
4594
4611
|
}
|
|
@@ -4607,7 +4624,9 @@ var MultiSelectField = function MultiSelectField(_ref) {
|
|
|
4607
4624
|
placeholder = _ref.placeholder,
|
|
4608
4625
|
disabled = _ref.disabled,
|
|
4609
4626
|
_ref$closeOnSelect = _ref.closeOnSelect,
|
|
4610
|
-
closeOnSelect = _ref$closeOnSelect === void 0 ? false : _ref$closeOnSelect
|
|
4627
|
+
closeOnSelect = _ref$closeOnSelect === void 0 ? false : _ref$closeOnSelect,
|
|
4628
|
+
_ref$menuShouldScroll = _ref.menuShouldScrollIntoView,
|
|
4629
|
+
menuShouldScrollIntoView = _ref$menuShouldScroll === void 0 ? true : _ref$menuShouldScroll;
|
|
4611
4630
|
var controllers = useMultiSelectFieldControllers({
|
|
4612
4631
|
name: name,
|
|
4613
4632
|
id: inputId,
|
|
@@ -4645,6 +4664,18 @@ var MultiSelectField = function MultiSelectField(_ref) {
|
|
|
4645
4664
|
CustomComponent: UserCustomOption
|
|
4646
4665
|
}, props));
|
|
4647
4666
|
} : Select.components.Option
|
|
4667
|
+
},
|
|
4668
|
+
menuShouldScrollIntoView: menuShouldScrollIntoView,
|
|
4669
|
+
menuPlacement: menuShouldScrollIntoView ? 'bottom' : 'auto',
|
|
4670
|
+
menuPosition: menuShouldScrollIntoView ? 'absolute' : 'fixed',
|
|
4671
|
+
closeMenuOnScroll: function closeMenuOnScroll(e) {
|
|
4672
|
+
if (menuShouldScrollIntoView || !e.target) {
|
|
4673
|
+
return false;
|
|
4674
|
+
}
|
|
4675
|
+
|
|
4676
|
+
var target = e.target;
|
|
4677
|
+
var isScrollingTheMenu = typeof target.className === 'string' && target.className.includes('MenuList');
|
|
4678
|
+
return !isScrollingTheMenu;
|
|
4648
4679
|
}
|
|
4649
4680
|
}));
|
|
4650
4681
|
};
|
|
@@ -4703,14 +4734,14 @@ var useSelectFieldControllers = function useSelectFieldControllers(_ref) {
|
|
|
4703
4734
|
|
|
4704
4735
|
var styles$q = {"custom-control":"_1cDCR"};
|
|
4705
4736
|
|
|
4706
|
-
var _excluded$
|
|
4737
|
+
var _excluded$4 = ["children", "CustomPrefixComponent"];
|
|
4707
4738
|
|
|
4708
4739
|
function CustomControl(_ref) {
|
|
4709
4740
|
var _props$getValue;
|
|
4710
4741
|
|
|
4711
4742
|
var children = _ref.children,
|
|
4712
4743
|
CustomPrefixComponent = _ref.CustomPrefixComponent,
|
|
4713
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4744
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
4714
4745
|
|
|
4715
4746
|
var selectedOption = (_props$getValue = props.getValue()) === null || _props$getValue === void 0 ? void 0 : _props$getValue[0];
|
|
4716
4747
|
return React__default.createElement(Select.components.Control, Object.assign({}, props), CustomControl && selectedOption ? React__default.createElement("div", {
|
|
@@ -4727,12 +4758,12 @@ function CustomControl(_ref) {
|
|
|
4727
4758
|
}, props)), children)) : children);
|
|
4728
4759
|
}
|
|
4729
4760
|
|
|
4730
|
-
var _excluded$
|
|
4761
|
+
var _excluded$5 = ["children", "CustomComponent"];
|
|
4731
4762
|
|
|
4732
4763
|
function CustomOption$1(_ref) {
|
|
4733
4764
|
var children = _ref.children,
|
|
4734
4765
|
CustomComponent = _ref.CustomComponent,
|
|
4735
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4766
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
4736
4767
|
|
|
4737
4768
|
return React__default.createElement(Select.components.Option, Object.assign({}, props), React__default.createElement(CustomComponent, Object.assign({}, props), children));
|
|
4738
4769
|
}
|
|
@@ -4753,7 +4784,9 @@ var SelectField = function SelectField(_ref) {
|
|
|
4753
4784
|
disabled = _ref.disabled,
|
|
4754
4785
|
prefix = _ref.prefix,
|
|
4755
4786
|
_ref$asToolbarFilter = _ref.asToolbarFilter,
|
|
4756
|
-
asToolbarFilter = _ref$asToolbarFilter === void 0 ? false : _ref$asToolbarFilter
|
|
4787
|
+
asToolbarFilter = _ref$asToolbarFilter === void 0 ? false : _ref$asToolbarFilter,
|
|
4788
|
+
_ref$menuShouldScroll = _ref.menuShouldScrollIntoView,
|
|
4789
|
+
menuShouldScrollIntoView = _ref$menuShouldScroll === void 0 ? true : _ref$menuShouldScroll;
|
|
4757
4790
|
var controllers = useSelectFieldControllers({
|
|
4758
4791
|
name: name,
|
|
4759
4792
|
id: inputId,
|
|
@@ -4796,6 +4829,18 @@ var SelectField = function SelectField(_ref) {
|
|
|
4796
4829
|
CustomPrefixComponent: SelectedOptionPrefix
|
|
4797
4830
|
}, props));
|
|
4798
4831
|
} : Select.components.Control
|
|
4832
|
+
},
|
|
4833
|
+
menuShouldScrollIntoView: menuShouldScrollIntoView,
|
|
4834
|
+
menuPlacement: menuShouldScrollIntoView ? 'bottom' : 'auto',
|
|
4835
|
+
menuPosition: menuShouldScrollIntoView ? 'absolute' : 'fixed',
|
|
4836
|
+
closeMenuOnScroll: function closeMenuOnScroll(e) {
|
|
4837
|
+
if (menuShouldScrollIntoView || !e.target) {
|
|
4838
|
+
return false;
|
|
4839
|
+
}
|
|
4840
|
+
|
|
4841
|
+
var target = e.target;
|
|
4842
|
+
var isScrollingTheMenu = typeof target.className === 'string' && target.className.includes('MenuList');
|
|
4843
|
+
return !isScrollingTheMenu;
|
|
4799
4844
|
}
|
|
4800
4845
|
})));
|
|
4801
4846
|
};
|
|
@@ -5388,6 +5433,34 @@ var WeekField = function WeekField(_ref) {
|
|
|
5388
5433
|
})));
|
|
5389
5434
|
};
|
|
5390
5435
|
|
|
5436
|
+
var _excluded$6 = ["placeholder", "autoComplete"];
|
|
5437
|
+
|
|
5438
|
+
var TimeFieldElement = function TimeFieldElement(_ref, ref) {
|
|
5439
|
+
var _ref$placeholder = _ref.placeholder,
|
|
5440
|
+
placeholder = _ref$placeholder === void 0 ? '9am' : _ref$placeholder,
|
|
5441
|
+
_ref$autoComplete = _ref.autoComplete,
|
|
5442
|
+
autoComplete = _ref$autoComplete === void 0 ? 'off' : _ref$autoComplete,
|
|
5443
|
+
allOtherProps = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
5444
|
+
|
|
5445
|
+
var _useTextField = useTextField(_extends({}, allOtherProps, {
|
|
5446
|
+
placeholder: placeholder,
|
|
5447
|
+
autoComplete: autoComplete,
|
|
5448
|
+
ref: ref
|
|
5449
|
+
})),
|
|
5450
|
+
inputProps = _useTextField.inputProps,
|
|
5451
|
+
fieldProps = _useTextField.fieldProps;
|
|
5452
|
+
|
|
5453
|
+
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement("input", Object.assign({}, inputProps, {
|
|
5454
|
+
onBlur: function onBlur(e) {
|
|
5455
|
+
e.target.value = parseTime(e.target.value, 'g:i A');
|
|
5456
|
+
inputProps.onChange(e);
|
|
5457
|
+
inputProps.onBlur(e);
|
|
5458
|
+
}
|
|
5459
|
+
})));
|
|
5460
|
+
};
|
|
5461
|
+
|
|
5462
|
+
var TimeField = React.forwardRef(TimeFieldElement);
|
|
5463
|
+
|
|
5391
5464
|
var styles$u = {"caption":"_1QDLF","label":"_2wiMV","toggle":"_1ui8X","toggle__label":"_1YRJT","toggle__caption":"_1jEiW","toggle__switch":"_3tNyE"};
|
|
5392
5465
|
|
|
5393
5466
|
var Toggle = function Toggle(_ref) {
|
|
@@ -5561,7 +5634,7 @@ var FooterContainer = function FooterContainer(_ref2) {
|
|
|
5561
5634
|
|
|
5562
5635
|
var styles$z = {"badge":"_2f81N","badge--warning":"_2g1GI","badge--danger":"_2zLnM","badge--success":"_27QOo","badge--info":"_2gmsM"};
|
|
5563
5636
|
|
|
5564
|
-
var _excluded$
|
|
5637
|
+
var _excluded$7 = ["children", "theme", "title"];
|
|
5565
5638
|
|
|
5566
5639
|
var Badge = function Badge(_ref, forwardedRef) {
|
|
5567
5640
|
var _classnames;
|
|
@@ -5569,7 +5642,7 @@ var Badge = function Badge(_ref, forwardedRef) {
|
|
|
5569
5642
|
var children = _ref.children,
|
|
5570
5643
|
theme = _ref.theme,
|
|
5571
5644
|
title = _ref.title,
|
|
5572
|
-
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
5645
|
+
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
5573
5646
|
|
|
5574
5647
|
var internalRef = React.useRef(null);
|
|
5575
5648
|
var ref = forwardedRef || internalRef;
|
|
@@ -5852,6 +5925,7 @@ exports.Spinner = Spinner;
|
|
|
5852
5925
|
exports.Stack = Stack;
|
|
5853
5926
|
exports.TextAreaField = TextAreaField;
|
|
5854
5927
|
exports.TextField = TextField;
|
|
5928
|
+
exports.TimeField = TimeField;
|
|
5855
5929
|
exports.Toggle = Toggle;
|
|
5856
5930
|
exports.Tooltip = Tooltip$1;
|
|
5857
5931
|
exports.WeekField = WeekField;
|