@7shifts/sous-chef 3.32.0 → 3.33.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/SelectField/SelectField.d.ts +1 -0
- package/dist/forms/SelectField/useSelectField.d.ts +1 -1
- package/dist/index.js +16 -4
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +16 -4
- package/dist/index.modern.js.map +1 -1
- package/dist/utils/date.d.ts +2 -2
- package/package.json +1 -1
|
@@ -35,6 +35,7 @@ export type Props<T> = {
|
|
|
35
35
|
onCreate?: (option: string) => void;
|
|
36
36
|
/** This is to allow disable the seach functionality. Use it just in some edge-cases, for example in touch devices when the user clicks on the field it opens a virtual keyboard to search, sometimes that virtual keyboard taks much space then passing `isSearchable={false}` prevents opening it. */
|
|
37
37
|
isSearchable?: boolean;
|
|
38
|
+
autoFocus?: boolean;
|
|
38
39
|
};
|
|
39
40
|
/** Component to make possible choose from a predefined options. */
|
|
40
41
|
declare const SelectField: <T extends unknown>(props: Props<T>) => React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { Props } from './SelectField';
|
|
3
|
-
export declare const useSelectField: <T extends unknown>({ asToolbarFilter, caption, disabled, error, id, isClearable, label, menuShouldScrollIntoView: menuShouldScrollIntoViewProp, name, noOptionsMessage, options, onBlur, onChange, placeholder, value, defaultValue, CustomOption: UserCustomOption, SelectedOptionPrefix, testId, creatableButton, onCreate, isSearchable }: Props<T>) => {
|
|
3
|
+
export declare const useSelectField: <T extends unknown>({ asToolbarFilter, caption, disabled, error, id, isClearable, label, menuShouldScrollIntoView: menuShouldScrollIntoViewProp, name, noOptionsMessage, options, onBlur, onChange, placeholder, value, defaultValue, CustomOption: UserCustomOption, SelectedOptionPrefix, testId, creatableButton, onCreate, isSearchable, autoFocus }: Props<T>) => {
|
|
4
4
|
selectProps: {
|
|
5
5
|
[x: string]: any;
|
|
6
6
|
[x: number]: any;
|
package/dist/index.js
CHANGED
|
@@ -6394,8 +6394,14 @@ function createWeekRange(date, weekStart) {
|
|
|
6394
6394
|
end: getEndOfWeek(date, weekStart)
|
|
6395
6395
|
};
|
|
6396
6396
|
}
|
|
6397
|
-
var
|
|
6398
|
-
var
|
|
6397
|
+
var getDays = function getDays() {
|
|
6398
|
+
var DAYS = [getLocalizedString('time.sunday'), getLocalizedString('time.monday'), getLocalizedString('time.tuesday'), getLocalizedString('time.wednesday'), getLocalizedString('time.thursday'), getLocalizedString('time.friday'), getLocalizedString('time.saturday')];
|
|
6399
|
+
return DAYS;
|
|
6400
|
+
};
|
|
6401
|
+
var getMonths = function getMonths() {
|
|
6402
|
+
var MONTH_NAMES = [getLocalizedString('time.january'), getLocalizedString('time.february'), getLocalizedString('time.march'), getLocalizedString('time.april'), getLocalizedString('time.may'), getLocalizedString('time.june'), getLocalizedString('time.july'), getLocalizedString('time.august'), getLocalizedString('time.september'), getLocalizedString('time.october'), getLocalizedString('time.november'), getLocalizedString('time.december')];
|
|
6403
|
+
return MONTH_NAMES;
|
|
6404
|
+
};
|
|
6399
6405
|
|
|
6400
6406
|
var CALENDAR_MODE = {
|
|
6401
6407
|
DAY: 'day',
|
|
@@ -6503,6 +6509,7 @@ var Calendar = function Calendar(_ref) {
|
|
|
6503
6509
|
var anchorPosition = anchorNode.getBoundingClientRect();
|
|
6504
6510
|
var calendarPosition = calculateCalendarPosition(position, anchorPosition, calendarRef === null || calendarRef === void 0 ? void 0 : calendarRef.getBoundingClientRect());
|
|
6505
6511
|
var styleOverrides = mode === CALENDAR_MODE.WEEK ? weekOverridesStyles : dayOverridesStyles;
|
|
6512
|
+
var MONTH_NAMES = getMonths();
|
|
6506
6513
|
var defaultProps = {
|
|
6507
6514
|
classNames: _extends({}, originalStylers, styleOverrides),
|
|
6508
6515
|
onDayClick: function onDayClick(day, activeModifiers) {
|
|
@@ -6529,6 +6536,7 @@ var Calendar = function Calendar(_ref) {
|
|
|
6529
6536
|
}
|
|
6530
6537
|
}
|
|
6531
6538
|
};
|
|
6539
|
+
var DAYS = getDays();
|
|
6532
6540
|
return React__default.createElement(Portal, null, React__default.createElement("div", {
|
|
6533
6541
|
className: styles$G['calendar']
|
|
6534
6542
|
}, React__default.createElement("div", {
|
|
@@ -7648,7 +7656,8 @@ var useSelectField = function useSelectField(_ref) {
|
|
|
7648
7656
|
creatableButton = _ref.creatableButton,
|
|
7649
7657
|
onCreate = _ref.onCreate,
|
|
7650
7658
|
_ref$isSearchable = _ref.isSearchable,
|
|
7651
|
-
isSearchable = _ref$isSearchable === void 0 ? true : _ref$isSearchable
|
|
7659
|
+
isSearchable = _ref$isSearchable === void 0 ? true : _ref$isSearchable,
|
|
7660
|
+
autoFocus = _ref.autoFocus;
|
|
7652
7661
|
var menuShouldScrollIntoView = useShouldScrollMenuIntoView(menuShouldScrollIntoViewProp);
|
|
7653
7662
|
var _useState = React.useState(false),
|
|
7654
7663
|
isMenuInputFocus = _useState[0],
|
|
@@ -7709,7 +7718,8 @@ var useSelectField = function useSelectField(_ref) {
|
|
|
7709
7718
|
value: controllers.value,
|
|
7710
7719
|
defaultValue: defaultValue,
|
|
7711
7720
|
menuIsOpen: isMenuInputFocus || undefined,
|
|
7712
|
-
isSearchable: isSearchable
|
|
7721
|
+
isSearchable: isSearchable,
|
|
7722
|
+
autoFocus: autoFocus
|
|
7713
7723
|
};
|
|
7714
7724
|
var fieldProps = {
|
|
7715
7725
|
caption: caption,
|
|
@@ -9189,6 +9199,8 @@ var DateRangeCalendar = function DateRangeCalendar(_ref) {
|
|
|
9189
9199
|
fromMonth: start
|
|
9190
9200
|
};
|
|
9191
9201
|
var datePickerProps = mode === 'start-date' ? startDateProps : endDateProps;
|
|
9202
|
+
var DAYS = getDays();
|
|
9203
|
+
var MONTH_NAMES = getMonths();
|
|
9192
9204
|
return React__default.createElement(Portal, null, React__default.createElement("div", {
|
|
9193
9205
|
className: styles$G['calendar']
|
|
9194
9206
|
}, React__default.createElement("div", {
|