@7shifts/sous-chef 2.1.2 → 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/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 +1 -0
- package/dist/index.js +81 -32
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +81 -33
- package/dist/index.modern.js.map +1 -1
- package/package.json +5 -4
package/dist/index.modern.js
CHANGED
|
@@ -8,6 +8,7 @@ import dateFnsFormat from 'date-fns/format';
|
|
|
8
8
|
import dateFnsParse from 'date-fns/parse';
|
|
9
9
|
import startOfDay from 'date-fns/startOfDay';
|
|
10
10
|
import eachDayOfInterval from 'date-fns/eachDayOfInterval';
|
|
11
|
+
import parseTime from 'time-autocomplete/src/core/AMPMParser';
|
|
11
12
|
import ReactModal from 'react-modal';
|
|
12
13
|
|
|
13
14
|
function _extends() {
|
|
@@ -3903,30 +3904,29 @@ var TextAreaField = function TextAreaField(_ref) {
|
|
|
3903
3904
|
|
|
3904
3905
|
var styles$j = {"text-field":"_20YOA","text-field--invalid":"_3kUSh","text-field--prefixed":"_3IU3Q","text-field--suffixed":"_QXJOD"};
|
|
3905
3906
|
|
|
3906
|
-
var
|
|
3907
|
+
var useTextField = function useTextField(_ref) {
|
|
3907
3908
|
var _classnames;
|
|
3908
3909
|
|
|
3909
3910
|
var autoComplete = _ref.autoComplete,
|
|
3910
3911
|
autoFocus = _ref.autoFocus,
|
|
3911
|
-
caption = _ref.caption,
|
|
3912
3912
|
defaultValue = _ref.defaultValue,
|
|
3913
3913
|
disabled = _ref.disabled,
|
|
3914
3914
|
error = _ref.error,
|
|
3915
|
-
|
|
3916
|
-
label = _ref.label,
|
|
3915
|
+
id = _ref.id,
|
|
3917
3916
|
maxLength = _ref.maxLength,
|
|
3918
3917
|
name = _ref.name,
|
|
3918
|
+
caption = _ref.caption,
|
|
3919
|
+
label = _ref.label,
|
|
3919
3920
|
onBlur = _ref.onBlur,
|
|
3920
3921
|
onChange = _ref.onChange,
|
|
3921
3922
|
onFocus = _ref.onFocus,
|
|
3922
3923
|
onKeyDown = _ref.onKeyDown,
|
|
3923
3924
|
placeholder = _ref.placeholder,
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
value = _ref.value;
|
|
3925
|
+
value = _ref.value,
|
|
3926
|
+
ref = _ref.ref;
|
|
3927
3927
|
var controllers = useFieldControllers({
|
|
3928
3928
|
error: error,
|
|
3929
|
-
id:
|
|
3929
|
+
id: id,
|
|
3930
3930
|
name: name,
|
|
3931
3931
|
onChange: onChange,
|
|
3932
3932
|
onBlur: onBlur,
|
|
@@ -3935,23 +3935,13 @@ var TextFieldElement = function TextFieldElement(_ref, ref) {
|
|
|
3935
3935
|
value: value
|
|
3936
3936
|
});
|
|
3937
3937
|
var hasError = !!controllers.error;
|
|
3938
|
-
var
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
label: label,
|
|
3942
|
-
id: controllers.id,
|
|
3943
|
-
name: name
|
|
3944
|
-
};
|
|
3945
|
-
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement(AffixContainer, {
|
|
3946
|
-
prefix: prefix,
|
|
3947
|
-
suffix: suffix
|
|
3948
|
-
}, React__default.createElement("input", {
|
|
3949
|
-
"aria-describedby": hasError ? controllers.id + "-error-message" : controllers.id + "-describer",
|
|
3950
|
-
"aria-invalid": hasError,
|
|
3938
|
+
var inputProps = {
|
|
3939
|
+
'aria-describedby': hasError ? controllers.id + "-error-message" : controllers.id + "-describer",
|
|
3940
|
+
'aria-invalid': hasError,
|
|
3951
3941
|
autoComplete: autoComplete,
|
|
3952
3942
|
autoFocus: autoFocus,
|
|
3953
3943
|
className: classnames(styles$j['text-field'], (_classnames = {}, _classnames[styles$j['text-field--invalid']] = hasError, _classnames)),
|
|
3954
|
-
|
|
3944
|
+
'data-testid': "text-field-" + name,
|
|
3955
3945
|
disabled: disabled,
|
|
3956
3946
|
defaultValue: defaultValue,
|
|
3957
3947
|
id: controllers.id,
|
|
@@ -3964,9 +3954,39 @@ var TextFieldElement = function TextFieldElement(_ref, ref) {
|
|
|
3964
3954
|
placeholder: placeholder,
|
|
3965
3955
|
ref: ref,
|
|
3966
3956
|
size: 1,
|
|
3967
|
-
type:
|
|
3957
|
+
type: 'text',
|
|
3968
3958
|
value: controllers.value
|
|
3969
|
-
}
|
|
3959
|
+
};
|
|
3960
|
+
var fieldProps = {
|
|
3961
|
+
caption: caption,
|
|
3962
|
+
error: controllers.error,
|
|
3963
|
+
label: label,
|
|
3964
|
+
id: inputProps.id,
|
|
3965
|
+
name: name
|
|
3966
|
+
};
|
|
3967
|
+
return {
|
|
3968
|
+
inputProps: inputProps,
|
|
3969
|
+
fieldProps: fieldProps
|
|
3970
|
+
};
|
|
3971
|
+
};
|
|
3972
|
+
|
|
3973
|
+
var _excluded$2 = ["prefix", "suffix"];
|
|
3974
|
+
|
|
3975
|
+
var TextFieldElement = function TextFieldElement(_ref, ref) {
|
|
3976
|
+
var prefix = _ref.prefix,
|
|
3977
|
+
suffix = _ref.suffix,
|
|
3978
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
3979
|
+
|
|
3980
|
+
var _useTextField = useTextField(_extends({}, props, {
|
|
3981
|
+
ref: ref
|
|
3982
|
+
})),
|
|
3983
|
+
inputProps = _useTextField.inputProps,
|
|
3984
|
+
fieldProps = _useTextField.fieldProps;
|
|
3985
|
+
|
|
3986
|
+
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement(AffixContainer, {
|
|
3987
|
+
prefix: prefix,
|
|
3988
|
+
suffix: suffix
|
|
3989
|
+
}, React__default.createElement("input", Object.assign({}, inputProps))));
|
|
3970
3990
|
};
|
|
3971
3991
|
|
|
3972
3992
|
var TextField = forwardRef(TextFieldElement);
|
|
@@ -4576,12 +4596,12 @@ var getSelectStyles = function getSelectStyles(_ref) {
|
|
|
4576
4596
|
};
|
|
4577
4597
|
};
|
|
4578
4598
|
|
|
4579
|
-
var _excluded$
|
|
4599
|
+
var _excluded$3 = ["children", "CustomComponent"];
|
|
4580
4600
|
|
|
4581
4601
|
function CustomOption(_ref) {
|
|
4582
4602
|
var children = _ref.children,
|
|
4583
4603
|
CustomComponent = _ref.CustomComponent,
|
|
4584
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4604
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
4585
4605
|
|
|
4586
4606
|
return React__default.createElement(components.Option, Object.assign({}, props), React__default.createElement(CustomComponent, Object.assign({}, props), children));
|
|
4587
4607
|
}
|
|
@@ -4710,14 +4730,14 @@ var useSelectFieldControllers = function useSelectFieldControllers(_ref) {
|
|
|
4710
4730
|
|
|
4711
4731
|
var styles$q = {"custom-control":"_1cDCR"};
|
|
4712
4732
|
|
|
4713
|
-
var _excluded$
|
|
4733
|
+
var _excluded$4 = ["children", "CustomPrefixComponent"];
|
|
4714
4734
|
|
|
4715
4735
|
function CustomControl(_ref) {
|
|
4716
4736
|
var _props$getValue;
|
|
4717
4737
|
|
|
4718
4738
|
var children = _ref.children,
|
|
4719
4739
|
CustomPrefixComponent = _ref.CustomPrefixComponent,
|
|
4720
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4740
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
4721
4741
|
|
|
4722
4742
|
var selectedOption = (_props$getValue = props.getValue()) === null || _props$getValue === void 0 ? void 0 : _props$getValue[0];
|
|
4723
4743
|
return React__default.createElement(components.Control, Object.assign({}, props), CustomControl && selectedOption ? React__default.createElement("div", {
|
|
@@ -4734,12 +4754,12 @@ function CustomControl(_ref) {
|
|
|
4734
4754
|
}, props)), children)) : children);
|
|
4735
4755
|
}
|
|
4736
4756
|
|
|
4737
|
-
var _excluded$
|
|
4757
|
+
var _excluded$5 = ["children", "CustomComponent"];
|
|
4738
4758
|
|
|
4739
4759
|
function CustomOption$1(_ref) {
|
|
4740
4760
|
var children = _ref.children,
|
|
4741
4761
|
CustomComponent = _ref.CustomComponent,
|
|
4742
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4762
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
4743
4763
|
|
|
4744
4764
|
return React__default.createElement(components.Option, Object.assign({}, props), React__default.createElement(CustomComponent, Object.assign({}, props), children));
|
|
4745
4765
|
}
|
|
@@ -5409,6 +5429,34 @@ var WeekField = function WeekField(_ref) {
|
|
|
5409
5429
|
})));
|
|
5410
5430
|
};
|
|
5411
5431
|
|
|
5432
|
+
var _excluded$6 = ["placeholder", "autoComplete"];
|
|
5433
|
+
|
|
5434
|
+
var TimeFieldElement = function TimeFieldElement(_ref, ref) {
|
|
5435
|
+
var _ref$placeholder = _ref.placeholder,
|
|
5436
|
+
placeholder = _ref$placeholder === void 0 ? '9am' : _ref$placeholder,
|
|
5437
|
+
_ref$autoComplete = _ref.autoComplete,
|
|
5438
|
+
autoComplete = _ref$autoComplete === void 0 ? 'off' : _ref$autoComplete,
|
|
5439
|
+
allOtherProps = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
5440
|
+
|
|
5441
|
+
var _useTextField = useTextField(_extends({}, allOtherProps, {
|
|
5442
|
+
placeholder: placeholder,
|
|
5443
|
+
autoComplete: autoComplete,
|
|
5444
|
+
ref: ref
|
|
5445
|
+
})),
|
|
5446
|
+
inputProps = _useTextField.inputProps,
|
|
5447
|
+
fieldProps = _useTextField.fieldProps;
|
|
5448
|
+
|
|
5449
|
+
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement("input", Object.assign({}, inputProps, {
|
|
5450
|
+
onBlur: function onBlur(e) {
|
|
5451
|
+
e.target.value = parseTime(e.target.value, 'g:i A');
|
|
5452
|
+
inputProps.onChange(e);
|
|
5453
|
+
inputProps.onBlur(e);
|
|
5454
|
+
}
|
|
5455
|
+
})));
|
|
5456
|
+
};
|
|
5457
|
+
|
|
5458
|
+
var TimeField = forwardRef(TimeFieldElement);
|
|
5459
|
+
|
|
5412
5460
|
var styles$u = {"caption":"_1QDLF","label":"_2wiMV","toggle":"_1ui8X","toggle__label":"_1YRJT","toggle__caption":"_1jEiW","toggle__switch":"_3tNyE"};
|
|
5413
5461
|
|
|
5414
5462
|
var Toggle = function Toggle(_ref) {
|
|
@@ -5582,7 +5630,7 @@ var FooterContainer = function FooterContainer(_ref2) {
|
|
|
5582
5630
|
|
|
5583
5631
|
var styles$z = {"badge":"_2f81N","badge--warning":"_2g1GI","badge--danger":"_2zLnM","badge--success":"_27QOo","badge--info":"_2gmsM"};
|
|
5584
5632
|
|
|
5585
|
-
var _excluded$
|
|
5633
|
+
var _excluded$7 = ["children", "theme", "title"];
|
|
5586
5634
|
|
|
5587
5635
|
var Badge = function Badge(_ref, forwardedRef) {
|
|
5588
5636
|
var _classnames;
|
|
@@ -5590,7 +5638,7 @@ var Badge = function Badge(_ref, forwardedRef) {
|
|
|
5590
5638
|
var children = _ref.children,
|
|
5591
5639
|
theme = _ref.theme,
|
|
5592
5640
|
title = _ref.title,
|
|
5593
|
-
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
5641
|
+
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
5594
5642
|
|
|
5595
5643
|
var internalRef = useRef(null);
|
|
5596
5644
|
var ref = forwardedRef || internalRef;
|
|
@@ -5721,5 +5769,5 @@ var Avatar = function Avatar(_ref) {
|
|
|
5721
5769
|
}, badge));
|
|
5722
5770
|
};
|
|
5723
5771
|
|
|
5724
|
-
export { Avatar, Badge$1 as Badge, Button$1 as Button, CheckboxField, DataTable, DataTableCell, DataTableEditableCell, DataTableRow, DateField, DateRangeField, Form, FormRow, IconAnalytics, IconArrowDown, IconArrowLeft, IconArrowRight, IconArrowToTop, IconArrowUp, IconAward, IconBalanceScale, IconBalanceScaleLeft, IconBan, IconBarsH, IconBarsV, IconBell, IconBold, IconBolt, IconBook, IconBriefcase, IconBullseyeArrow, IconCalculator, IconCalendar, IconCalendarAlt, IconCalendarCheck, IconCalendarDay, IconCalendarExclamation, IconCalendarTomorrow, IconCamera, IconCameraSlash, IconCashRegister, IconChartBar, IconCheck, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconClipboardList, IconClock, IconCog, IconComment, IconCommentLines, IconCopy, IconCreditCard, IconCreditCardPlus, IconDownload, IconEdit, IconEllipsisV, IconEnvelope, IconExclaimation, IconExclaimationTriangle, IconExpand, IconExternalLink, IconEye, IconEyeSlash, IconFile, IconFilePdf, IconFlag, IconFourDotsCircle, IconFourSquares, IconGift, IconGrinBeam, IconGripVertical, IconHandshake, IconImage, IconInfoCircle, IconIslandTropical, IconItalic, IconLaptopSearch, IconLink, IconList, IconListOI as IconListOi, IconLock, IconMagicSolid, IconMapMarker, IconMegaphone, IconMinus, IconMinusCircle, IconMoneyBill, IconNotesMedical, IconOvertime, IconPaperPlane, IconPaperPlaneClock, IconPaperclip, IconPencil, IconPercentage, IconPhone, IconPlug, IconPlus, IconPrint, IconQuestionCircle, IconRepeat, IconSearch, IconSignOut, IconSitemap, IconSlidersH, IconSort, IconStar, IconStickyNoteLines, IconStopwatch, IconStrikethrough, IconSync, IconSyncExclaimation, IconTachometer, IconTimes, IconTimesOctagon, IconTrash, IconUnderline, IconUndo, IconUserComputer, IconUserLight, IconUserPlus, IconUserSlash, IconUserSolid, IconUserTag, IconUserTie, IconUsers, IconVideo, IconVolume, IconVolumeMute, IconWrench, Inline, Modal, ModalBody, ModalFooter, MultiSelectField, PaginationControls, PasswordField, PillSelectField, RadioGroupField, RadioGroupOption, ResourceTable, ResourceTableRow, SIZE_25_PERCENT, SIZE_33_PERCENT, SIZE_50_PERCENT, SIZE_66_PERCENT, SIZE_75_PERCENT, SelectField, Spinner, Stack, TextAreaField, TextField, Toggle, Tooltip$1 as Tooltip, WeekField };
|
|
5772
|
+
export { Avatar, Badge$1 as Badge, Button$1 as Button, CheckboxField, DataTable, DataTableCell, DataTableEditableCell, DataTableRow, DateField, DateRangeField, Form, FormRow, IconAnalytics, IconArrowDown, IconArrowLeft, IconArrowRight, IconArrowToTop, IconArrowUp, IconAward, IconBalanceScale, IconBalanceScaleLeft, IconBan, IconBarsH, IconBarsV, IconBell, IconBold, IconBolt, IconBook, IconBriefcase, IconBullseyeArrow, IconCalculator, IconCalendar, IconCalendarAlt, IconCalendarCheck, IconCalendarDay, IconCalendarExclamation, IconCalendarTomorrow, IconCamera, IconCameraSlash, IconCashRegister, IconChartBar, IconCheck, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconClipboardList, IconClock, IconCog, IconComment, IconCommentLines, IconCopy, IconCreditCard, IconCreditCardPlus, IconDownload, IconEdit, IconEllipsisV, IconEnvelope, IconExclaimation, IconExclaimationTriangle, IconExpand, IconExternalLink, IconEye, IconEyeSlash, IconFile, IconFilePdf, IconFlag, IconFourDotsCircle, IconFourSquares, IconGift, IconGrinBeam, IconGripVertical, IconHandshake, IconImage, IconInfoCircle, IconIslandTropical, IconItalic, IconLaptopSearch, IconLink, IconList, IconListOI as IconListOi, IconLock, IconMagicSolid, IconMapMarker, IconMegaphone, IconMinus, IconMinusCircle, IconMoneyBill, IconNotesMedical, IconOvertime, IconPaperPlane, IconPaperPlaneClock, IconPaperclip, IconPencil, IconPercentage, IconPhone, IconPlug, IconPlus, IconPrint, IconQuestionCircle, IconRepeat, IconSearch, IconSignOut, IconSitemap, IconSlidersH, IconSort, IconStar, IconStickyNoteLines, IconStopwatch, IconStrikethrough, IconSync, IconSyncExclaimation, IconTachometer, IconTimes, IconTimesOctagon, IconTrash, IconUnderline, IconUndo, IconUserComputer, IconUserLight, IconUserPlus, IconUserSlash, IconUserSolid, IconUserTag, IconUserTie, IconUsers, IconVideo, IconVolume, IconVolumeMute, IconWrench, Inline, Modal, ModalBody, ModalFooter, MultiSelectField, PaginationControls, PasswordField, PillSelectField, RadioGroupField, RadioGroupOption, ResourceTable, ResourceTableRow, SIZE_25_PERCENT, SIZE_33_PERCENT, SIZE_50_PERCENT, SIZE_66_PERCENT, SIZE_75_PERCENT, SelectField, Spinner, Stack, TextAreaField, TextField, TimeField, Toggle, Tooltip$1 as Tooltip, WeekField };
|
|
5725
5773
|
//# sourceMappingURL=index.modern.js.map
|