@7shifts/sous-chef 3.24.0 → 3.25.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/controls/ToolbarSelect/ToolbarSelect.d.ts +3 -3
- package/dist/forms/AsyncSelectField/AsyncSelectField.d.ts +1 -1
- package/dist/forms/MultiSelectField/MultiSelectField.d.ts +20 -20
- package/dist/forms/SelectField/SelectField.d.ts +39 -2
- package/dist/forms/SelectField/types.d.ts +0 -37
- package/dist/forms/SelectField/useSelectField.d.ts +2 -2
- package/dist/forms/hooks/useSelectFieldControllers.d.ts +6 -6
- package/dist/index.js +78 -22
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +78 -22
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -7851,7 +7851,7 @@ function CustomMenu(_ref) {
|
|
|
7851
7851
|
}, getLocalizedString('default.CREATE'))))));
|
|
7852
7852
|
}
|
|
7853
7853
|
|
|
7854
|
-
var useSelectField = function useSelectField(_ref
|
|
7854
|
+
var useSelectField = function useSelectField(_ref) {
|
|
7855
7855
|
var _ref$asToolbarFilter = _ref.asToolbarFilter,
|
|
7856
7856
|
asToolbarFilter = _ref$asToolbarFilter === void 0 ? false : _ref$asToolbarFilter,
|
|
7857
7857
|
caption = _ref.caption,
|
|
@@ -7879,10 +7879,6 @@ var useSelectField = function useSelectField(_ref, isMultiSelect) {
|
|
|
7879
7879
|
_ref$isSearchable = _ref.isSearchable,
|
|
7880
7880
|
isSearchable = _ref$isSearchable === void 0 ? true : _ref$isSearchable;
|
|
7881
7881
|
|
|
7882
|
-
if (isMultiSelect === void 0) {
|
|
7883
|
-
isMultiSelect = false;
|
|
7884
|
-
}
|
|
7885
|
-
|
|
7886
7882
|
var _useState = useState(false),
|
|
7887
7883
|
isMenuInputFocus = _useState[0],
|
|
7888
7884
|
setIsMenuInputFocus = _useState[1];
|
|
@@ -7940,14 +7936,12 @@ var useSelectField = function useSelectField(_ref, isMultiSelect) {
|
|
|
7940
7936
|
placeholder: placeholder,
|
|
7941
7937
|
styles: getSelectStyles({
|
|
7942
7938
|
isInvalid: hasError,
|
|
7943
|
-
asToolbarFilter: asToolbarFilter
|
|
7944
|
-
wrapToNextLine: isMultiSelect ? true : undefined
|
|
7939
|
+
asToolbarFilter: asToolbarFilter
|
|
7945
7940
|
}),
|
|
7946
7941
|
value: controllers.value,
|
|
7947
7942
|
defaultValue: defaultValue,
|
|
7948
7943
|
menuIsOpen: isMenuInputFocus || undefined,
|
|
7949
|
-
isSearchable: isSearchable
|
|
7950
|
-
isMulti: isMultiSelect
|
|
7944
|
+
isSearchable: isSearchable
|
|
7951
7945
|
};
|
|
7952
7946
|
var fieldProps = {
|
|
7953
7947
|
caption: caption,
|
|
@@ -9042,20 +9036,82 @@ var PasswordField = function PasswordField(_ref) {
|
|
|
9042
9036
|
}))));
|
|
9043
9037
|
};
|
|
9044
9038
|
|
|
9045
|
-
var MultiSelectField = function MultiSelectField(
|
|
9046
|
-
var
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
|
|
9052
|
-
|
|
9053
|
-
|
|
9054
|
-
|
|
9039
|
+
var MultiSelectField = function MultiSelectField(_ref) {
|
|
9040
|
+
var name = _ref.name,
|
|
9041
|
+
inputId = _ref.id,
|
|
9042
|
+
value = _ref.value,
|
|
9043
|
+
options = _ref.options,
|
|
9044
|
+
onChange = _ref.onChange,
|
|
9045
|
+
onBlur = _ref.onBlur,
|
|
9046
|
+
UserCustomOption = _ref.CustomOption,
|
|
9047
|
+
label = _ref.label,
|
|
9048
|
+
caption = _ref.caption,
|
|
9049
|
+
error = _ref.error,
|
|
9050
|
+
placeholder = _ref.placeholder,
|
|
9051
|
+
noOptionsMessage = _ref.noOptionsMessage,
|
|
9052
|
+
disabled = _ref.disabled,
|
|
9053
|
+
_ref$closeOnSelect = _ref.closeOnSelect,
|
|
9054
|
+
closeOnSelect = _ref$closeOnSelect === void 0 ? false : _ref$closeOnSelect,
|
|
9055
|
+
_ref$menuShouldScroll = _ref.menuShouldScrollIntoView,
|
|
9056
|
+
menuShouldScrollIntoView = _ref$menuShouldScroll === void 0 ? true : _ref$menuShouldScroll,
|
|
9057
|
+
testId = _ref.testId,
|
|
9058
|
+
_ref$isSearchable = _ref.isSearchable,
|
|
9059
|
+
isSearchable = _ref$isSearchable === void 0 ? true : _ref$isSearchable;
|
|
9060
|
+
var controllers = useMultiSelectFieldControllers({
|
|
9061
|
+
name: name,
|
|
9062
|
+
id: inputId,
|
|
9063
|
+
value: value,
|
|
9064
|
+
onChange: onChange,
|
|
9065
|
+
onBlur: onBlur,
|
|
9066
|
+
error: error
|
|
9067
|
+
});
|
|
9068
|
+
var hasError = !!controllers.error;
|
|
9069
|
+
var fieldProps = {
|
|
9070
|
+
name: name,
|
|
9071
|
+
id: controllers.id,
|
|
9072
|
+
label: label,
|
|
9073
|
+
caption: caption,
|
|
9074
|
+
error: controllers.error
|
|
9075
|
+
};
|
|
9076
|
+
var defaultNoOptionsMessage = noOptionsMessage && typeof noOptionsMessage === 'string' ? function () {
|
|
9077
|
+
return noOptionsMessage;
|
|
9078
|
+
} : undefined;
|
|
9079
|
+
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement(Select, {
|
|
9080
|
+
inputId: controllers.id,
|
|
9081
|
+
options: options,
|
|
9082
|
+
isDisabled: disabled,
|
|
9083
|
+
value: controllers.value,
|
|
9084
|
+
placeholder: placeholder,
|
|
9085
|
+
noOptionsMessage: typeof noOptionsMessage === 'function' ? noOptionsMessage : defaultNoOptionsMessage,
|
|
9086
|
+
styles: getSelectStyles({
|
|
9087
|
+
isInvalid: hasError,
|
|
9088
|
+
wrapToNextLine: true
|
|
9089
|
+
}),
|
|
9090
|
+
menuPortalTarget: document.body,
|
|
9091
|
+
onChange: controllers.onChange,
|
|
9092
|
+
onBlur: controllers.onBlur,
|
|
9093
|
+
isMulti: true,
|
|
9094
|
+
closeMenuOnSelect: closeOnSelect,
|
|
9095
|
+
componentsProps: {
|
|
9096
|
+
testId: testId,
|
|
9097
|
+
UserCustomOption: UserCustomOption
|
|
9098
|
+
},
|
|
9099
|
+
components: {
|
|
9100
|
+
SelectContainer: CustomContainer,
|
|
9101
|
+
Option: UserCustomOption ? CustomOption : components.Option
|
|
9102
|
+
},
|
|
9103
|
+
menuShouldScrollIntoView: menuShouldScrollIntoView,
|
|
9104
|
+
menuPlacement: menuShouldScrollIntoView ? 'bottom' : 'auto',
|
|
9105
|
+
menuPosition: menuShouldScrollIntoView ? 'absolute' : 'fixed',
|
|
9106
|
+
closeMenuOnScroll: function closeMenuOnScroll(e) {
|
|
9107
|
+
if (menuShouldScrollIntoView || !e.target) {
|
|
9108
|
+
return false;
|
|
9109
|
+
}
|
|
9055
9110
|
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9111
|
+
return !isScrollingTheSelectMenu(e.target);
|
|
9112
|
+
},
|
|
9113
|
+
isSearchable: isSearchable
|
|
9114
|
+
}));
|
|
9059
9115
|
};
|
|
9060
9116
|
|
|
9061
9117
|
var styles$_ = {"custom-list":"_uC4zU"};
|