@7shifts/sous-chef 2.2.0 → 2.3.2

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.
@@ -3,10 +3,11 @@ import classnames from 'classnames';
3
3
  import ReactDOM from 'react-dom';
4
4
  import Select, { components } from 'react-select';
5
5
  import DayPickerInput from 'react-day-picker/DayPickerInput';
6
+ import { isDate, startOfDay } from 'date-fns';
6
7
  import { DateUtils } from 'react-day-picker';
7
8
  import dateFnsFormat from 'date-fns/format';
8
9
  import dateFnsParse from 'date-fns/parse';
9
- import startOfDay from 'date-fns/startOfDay';
10
+ import startOfDay$1 from 'date-fns/startOfDay';
10
11
  import eachDayOfInterval from 'date-fns/eachDayOfInterval';
11
12
  import parseTime from 'time-autocomplete/src/core/AMPMParser';
12
13
  import ReactModal from 'react-modal';
@@ -1781,6 +1782,21 @@ var IconFourSquares = function IconFourSquares(props) {
1781
1782
 
1782
1783
  IconFourSquares.displayName = 'IconFourSquares';
1783
1784
 
1785
+ var IconGavel = function IconGavel(props) {
1786
+ return React__default.createElement("svg", Object.assign({
1787
+ viewBox: "0 0 60 60",
1788
+ fill: "none",
1789
+ xmlns: "http://www.w3.org/2000/svg",
1790
+ "data-testid": "icon-gavel",
1791
+ style: getIconStyles(props)
1792
+ }, props), React__default.createElement("path", {
1793
+ 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",
1794
+ fill: "currentColor"
1795
+ }));
1796
+ };
1797
+
1798
+ IconGavel.displayName = 'IconGavel';
1799
+
1784
1800
  var IconGift = function IconGift(props) {
1785
1801
  return React__default.createElement("svg", Object.assign({
1786
1802
  viewBox: "0 0 20 20",
@@ -4495,7 +4511,7 @@ var getSelectStyles = function getSelectStyles(_ref) {
4495
4511
  return Object.assign({}, base, {
4496
4512
  flex: '1',
4497
4513
  fontFamily: FONT_FAMILY,
4498
- minWidth: '64px',
4514
+ minWidth: '110px',
4499
4515
  backgroundColor: state.isDisabled && !asToolbarFilter ? GREY100 : WHITE,
4500
4516
  position: 'initial'
4501
4517
  });
@@ -4540,11 +4556,12 @@ var getSelectStyles = function getSelectStyles(_ref) {
4540
4556
  return Object.assign({}, base, {
4541
4557
  color: state.isDisabled ? GREY400 : null,
4542
4558
  marginRight: 0,
4543
- position: 'static',
4559
+ position: asToolbarFilter ? 'static' : 'absolute',
4544
4560
  transform: 'initial',
4545
4561
  overflow: 'hidden',
4546
4562
  textOverflow: 'ellipsis',
4547
- whiteSpace: 'nowrap'
4563
+ whiteSpace: 'nowrap',
4564
+ top: !asToolbarFilter && 'auto'
4548
4565
  });
4549
4566
  },
4550
4567
  dropdownIndicator: function dropdownIndicator(base, state) {
@@ -4559,7 +4576,8 @@ var getSelectStyles = function getSelectStyles(_ref) {
4559
4576
  color: state.isDisabled ? GREY400 : state.isSelected ? EGGPLANT700 : GREY500,
4560
4577
  cursor: 'pointer',
4561
4578
  fontFamily: FONT_FAMILY,
4562
- fontSize: '14px'
4579
+ fontSize: '14px',
4580
+ wordBreak: 'break-word'
4563
4581
  });
4564
4582
  },
4565
4583
  group: function group(base) {
@@ -4618,6 +4636,7 @@ var MultiSelectField = function MultiSelectField(_ref) {
4618
4636
  caption = _ref.caption,
4619
4637
  error = _ref.error,
4620
4638
  placeholder = _ref.placeholder,
4639
+ noOptionsMessage = _ref.noOptionsMessage,
4621
4640
  disabled = _ref.disabled,
4622
4641
  _ref$closeOnSelect = _ref.closeOnSelect,
4623
4642
  closeOnSelect = _ref$closeOnSelect === void 0 ? false : _ref$closeOnSelect,
@@ -4639,12 +4658,16 @@ var MultiSelectField = function MultiSelectField(_ref) {
4639
4658
  caption: caption,
4640
4659
  error: controllers.error
4641
4660
  };
4661
+ var defaultNoOptionsMessage = noOptionsMessage && typeof noOptionsMessage === 'string' ? function () {
4662
+ return noOptionsMessage;
4663
+ } : undefined;
4642
4664
  return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement(Select, {
4643
4665
  inputId: controllers.id,
4644
4666
  options: options,
4645
4667
  isDisabled: disabled,
4646
4668
  value: controllers.value,
4647
4669
  placeholder: placeholder,
4670
+ noOptionsMessage: typeof noOptionsMessage === 'function' ? noOptionsMessage : defaultNoOptionsMessage,
4648
4671
  styles: getSelectStyles({
4649
4672
  isInvalid: hasError,
4650
4673
  wrapToNextLine: true
@@ -4670,7 +4693,8 @@ var MultiSelectField = function MultiSelectField(_ref) {
4670
4693
  }
4671
4694
 
4672
4695
  var target = e.target;
4673
- var isScrollingTheMenu = typeof target.className === 'string' && target.className.includes('MenuList');
4696
+ var firstOption = target.children[0];
4697
+ var isScrollingTheMenu = firstOption && typeof firstOption.id === 'string' && firstOption.id.includes('react-select');
4674
4698
  return !isScrollingTheMenu;
4675
4699
  }
4676
4700
  }));
@@ -4777,6 +4801,7 @@ var SelectField = function SelectField(_ref) {
4777
4801
  caption = _ref.caption,
4778
4802
  error = _ref.error,
4779
4803
  placeholder = _ref.placeholder,
4804
+ noOptionsMessage = _ref.noOptionsMessage,
4780
4805
  disabled = _ref.disabled,
4781
4806
  prefix = _ref.prefix,
4782
4807
  _ref$asToolbarFilter = _ref.asToolbarFilter,
@@ -4799,6 +4824,9 @@ var SelectField = function SelectField(_ref) {
4799
4824
  caption: caption,
4800
4825
  error: controllers.error
4801
4826
  };
4827
+ var defaultNoOptionsMessage = noOptionsMessage && typeof noOptionsMessage === 'string' ? function () {
4828
+ return noOptionsMessage;
4829
+ } : undefined;
4802
4830
  return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement(AffixContainer, {
4803
4831
  prefix: prefix
4804
4832
  }, React__default.createElement(Select, {
@@ -4807,6 +4835,7 @@ var SelectField = function SelectField(_ref) {
4807
4835
  isDisabled: disabled,
4808
4836
  value: controllers.value,
4809
4837
  placeholder: placeholder,
4838
+ noOptionsMessage: typeof noOptionsMessage === 'function' ? noOptionsMessage : defaultNoOptionsMessage,
4810
4839
  styles: getSelectStyles({
4811
4840
  isInvalid: hasError,
4812
4841
  asToolbarFilter: asToolbarFilter
@@ -4835,7 +4864,8 @@ var SelectField = function SelectField(_ref) {
4835
4864
  }
4836
4865
 
4837
4866
  var target = e.target;
4838
- var isScrollingTheMenu = typeof target.className === 'string' && target.className.includes('MenuList');
4867
+ var firstOption = target.children[0];
4868
+ var isScrollingTheMenu = firstOption && typeof firstOption.id === 'string' && firstOption.id.includes('react-select');
4839
4869
  return !isScrollingTheMenu;
4840
4870
  }
4841
4871
  })));
@@ -4861,7 +4891,7 @@ var useDateFieldControllers = function useDateFieldControllers(_ref) {
4861
4891
  error: error,
4862
4892
  value: value,
4863
4893
  onChange: function onChange(newValue) {
4864
- return _onChange && _onChange(newValue);
4894
+ return _onChange && _onChange(isDate(newValue) ? startOfDay(newValue) : newValue);
4865
4895
  },
4866
4896
  onBlur: function onBlur() {
4867
4897
  return _onBlur && _onBlur();
@@ -4874,7 +4904,7 @@ var useDateFieldControllers = function useDateFieldControllers(_ref) {
4874
4904
  error: error !== undefined ? controllers.error : formikState.error,
4875
4905
  value: value !== undefined ? controllers.value : formikState.value,
4876
4906
  onChange: _onChange ? controllers.onChange : function (newValue) {
4877
- formik.setFieldValue(name, newValue === undefined ? null : newValue);
4907
+ formik.setFieldValue(name, newValue === undefined ? null : startOfDay(newValue));
4878
4908
  },
4879
4909
  onBlur: _onBlur ? controllers.onBlur : function () {
4880
4910
  return formik.setFieldTouched(name);
@@ -4929,7 +4959,7 @@ function formatDate(date, format, locale) {
4929
4959
  });
4930
4960
  }
4931
4961
  function setToMidnight(date) {
4932
- return date && startOfDay(date);
4962
+ return date && startOfDay$1(date);
4933
4963
  }
4934
4964
  function getStartOfWeek(date, weekIndex) {
4935
4965
  var d = new Date(date);
@@ -5769,5 +5799,5 @@ var Avatar = function Avatar(_ref) {
5769
5799
  }, badge));
5770
5800
  };
5771
5801
 
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 };
5802
+ 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, IconGavel, 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 };
5773
5803
  //# sourceMappingURL=index.modern.js.map