@7shifts/sous-chef 3.35.0-beta.4 → 3.35.0-beta.6

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/index.js CHANGED
@@ -174,11 +174,15 @@ var getPositionProps = function getPositionProps(_ref) {
174
174
  otherProps: otherProps
175
175
  };
176
176
  };
177
- var getDataProps = function getDataProps(props) {
177
+ var getDataProps = function getDataProps(props, removeDataPrefix) {
178
+ if (removeDataPrefix === void 0) {
179
+ removeDataPrefix = false;
180
+ }
178
181
  return Object.keys(props).reduce(function (acc, key) {
179
182
  if (key.startsWith('data')) {
180
183
  var _Object$assign;
181
- acc.dataProps = Object.assign((_Object$assign = {}, _Object$assign[kebabize(key)] = props[key], _Object$assign), acc.dataProps);
184
+ var newKey = removeDataPrefix ? key.replace('data', '') : key;
185
+ acc.dataProps = Object.assign((_Object$assign = {}, _Object$assign[kebabize(newKey)] = props[key], _Object$assign), acc.dataProps);
182
186
  } else {
183
187
  var _Object$assign2;
184
188
  acc.otherProps = Object.assign((_Object$assign2 = {}, _Object$assign2[key] = props[key], _Object$assign2), acc.otherProps);
@@ -6220,6 +6224,7 @@ var useModalContext = function useModalContext() {
6220
6224
  return context || {};
6221
6225
  };
6222
6226
 
6227
+ var _excluded$2w = ["children", "header", "subHeader", "onClose", "loading", "zIndex", "rootElementId", "width", "height", "maxWidth", "shouldReturnFocusAfterClose", "testId"];
6223
6228
  var Modal = function Modal(_ref) {
6224
6229
  var children = _ref.children,
6225
6230
  header = _ref.header,
@@ -6235,7 +6240,8 @@ var Modal = function Modal(_ref) {
6235
6240
  maxWidth = _ref.maxWidth,
6236
6241
  _ref$shouldReturnFocu = _ref.shouldReturnFocusAfterClose,
6237
6242
  shouldReturnFocusAfterClose = _ref$shouldReturnFocu === void 0 ? true : _ref$shouldReturnFocu,
6238
- testId = _ref.testId;
6243
+ testId = _ref.testId,
6244
+ otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2w);
6239
6245
  var style = {
6240
6246
  content: {
6241
6247
  width: width,
@@ -6246,9 +6252,12 @@ var Modal = function Modal(_ref) {
6246
6252
  zIndex: getZIndex(zIndex)
6247
6253
  }
6248
6254
  };
6255
+ var _getDataProps = getDataProps(otherProps, true),
6256
+ dataProps = _getDataProps.dataProps;
6257
+ console.log(dataProps);
6249
6258
  return React__default.createElement(ReactModal, {
6250
6259
  isOpen: true,
6251
- testId: testId,
6260
+ testId: testId + 'kkkkk',
6252
6261
  shouldCloseOnEsc: true,
6253
6262
  shouldCloseOnOverlayClick: false,
6254
6263
  shouldReturnFocusAfterClose: shouldReturnFocusAfterClose,
@@ -6266,7 +6275,8 @@ var Modal = function Modal(_ref) {
6266
6275
  base: styles$C['content'],
6267
6276
  afterOpen: styles$C['content--after-open'],
6268
6277
  beforeClose: styles$C['content--before-close']
6269
- }
6278
+ },
6279
+ data: dataProps
6270
6280
  }, React__default.createElement(ModalHeader, {
6271
6281
  header: header,
6272
6282
  subHeader: subHeader,
@@ -6629,7 +6639,7 @@ var useCheckBoxFieldControllers = function useCheckBoxFieldControllers(_ref) {
6629
6639
 
6630
6640
  var styles$H = {"check-box-field":"_2Rbk6","check-box-field__caption":"_1GW-E","check-box-field__custom-input":"_2W10t"};
6631
6641
 
6632
- var _excluded$2w = ["name", "id", "checked", "onChange", "onBlur", "label", "caption", "error", "disabled", "testId"];
6642
+ var _excluded$2x = ["name", "id", "checked", "onChange", "onBlur", "label", "caption", "error", "disabled", "testId"];
6633
6643
  var CheckboxField = function CheckboxField(_ref) {
6634
6644
  var name = _ref.name,
6635
6645
  inputId = _ref.id,
@@ -6641,7 +6651,7 @@ var CheckboxField = function CheckboxField(_ref) {
6641
6651
  error = _ref.error,
6642
6652
  disabled = _ref.disabled,
6643
6653
  testId = _ref.testId,
6644
- otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2w);
6654
+ otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2x);
6645
6655
  var controllers = useCheckBoxFieldControllers({
6646
6656
  name: name,
6647
6657
  id: inputId,
@@ -6710,7 +6720,7 @@ var useLocalStorage = function useLocalStorage(key, initialValue) {
6710
6720
 
6711
6721
  var styles$I = {"hint-modal":"_1b47y","hint-modal--after-open":"_2MB4p","hint-modal--before-close":"_3VYQo","hint-modal__overlay":"_3Enme","hint-modal__image":"_2Nn7v","hint-modal__body":"_bzN9e","hint-modal__close-button":"_3xbis"};
6712
6722
 
6713
- var _excluded$2x = ["header", "children", "mediaUrl", "onClose", "modalId", "primaryButton", "testId"];
6723
+ var _excluded$2y = ["header", "children", "mediaUrl", "onClose", "modalId", "primaryButton", "testId"];
6714
6724
  var HintModal = function HintModal(_ref) {
6715
6725
  var header = _ref.header,
6716
6726
  children = _ref.children,
@@ -6719,7 +6729,7 @@ var HintModal = function HintModal(_ref) {
6719
6729
  modalId = _ref.modalId,
6720
6730
  primaryButton = _ref.primaryButton,
6721
6731
  testId = _ref.testId,
6722
- positionProps = _objectWithoutPropertiesLoose(_ref, _excluded$2x);
6732
+ positionProps = _objectWithoutPropertiesLoose(_ref, _excluded$2y);
6723
6733
  var _useState = React.useState(false),
6724
6734
  doNotShowAgain = _useState[0],
6725
6735
  setDoNotShowAgain = _useState[1];
@@ -6943,7 +6953,7 @@ var DataTableEditableCellElement = function DataTableEditableCellElement(_ref, r
6943
6953
  };
6944
6954
  var DataTableEditableCell = React.forwardRef(DataTableEditableCellElement);
6945
6955
 
6946
- var _excluded$2y = ["children", "onClick", "isSelected", "actions", "hasDefaultPadding", "hasDefaultCell", "testId"];
6956
+ var _excluded$2z = ["children", "onClick", "isSelected", "actions", "hasDefaultPadding", "hasDefaultCell", "testId"];
6947
6957
  var DataTableRowComponent = function DataTableRowComponent(_ref, ref) {
6948
6958
  var _classnames;
6949
6959
  var children = _ref.children,
@@ -6955,7 +6965,7 @@ var DataTableRowComponent = function DataTableRowComponent(_ref, ref) {
6955
6965
  _ref$hasDefaultCell = _ref.hasDefaultCell,
6956
6966
  hasDefaultCell = _ref$hasDefaultCell === void 0 ? true : _ref$hasDefaultCell,
6957
6967
  testId = _ref.testId,
6958
- nativeDivProps = _objectWithoutPropertiesLoose(_ref, _excluded$2y);
6968
+ nativeDivProps = _objectWithoutPropertiesLoose(_ref, _excluded$2z);
6959
6969
  var _useDataTableContext = useDataTableContext(),
6960
6970
  showActionMenu = _useDataTableContext.showActionMenu;
6961
6971
  var styleNames = classnames(styles$z['item'], (_classnames = {}, _classnames[styles$z['clickable']] = onClick, _classnames[styles$z['selected']] = isSelected, _classnames));
@@ -7367,11 +7377,11 @@ var isReactSelectElement = function isReactSelectElement(element) {
7367
7377
 
7368
7378
  var styles$M = {"custom-control":"_1JTKu"};
7369
7379
 
7370
- var _excluded$2z = ["children"];
7380
+ var _excluded$2A = ["children"];
7371
7381
  function CustomControl(_ref) {
7372
7382
  var _props$getValue;
7373
7383
  var children = _ref.children,
7374
- props = _objectWithoutPropertiesLoose(_ref, _excluded$2z);
7384
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$2A);
7375
7385
  var SelectedOptionPrefix = props.selectProps.componentsProps.SelectedOptionPrefix;
7376
7386
  var selectedOption = (_props$getValue = props.getValue()) === null || _props$getValue === void 0 ? void 0 : _props$getValue[0];
7377
7387
  return React__default.createElement(Select.components.Control, _extends({}, props), SelectedOptionPrefix && selectedOption ? React__default.createElement("div", {
@@ -7388,10 +7398,10 @@ function CustomControl(_ref) {
7388
7398
  }, props)), children)) : children);
7389
7399
  }
7390
7400
 
7391
- var _excluded$2A = ["children"];
7401
+ var _excluded$2B = ["children"];
7392
7402
  function CustomOption(_ref) {
7393
7403
  var children = _ref.children,
7394
- props = _objectWithoutPropertiesLoose(_ref, _excluded$2A);
7404
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$2B);
7395
7405
  var UserCustomOption = props.selectProps.componentsProps.UserCustomOption;
7396
7406
  return React__default.createElement(Select.components.Option, _extends({}, props), React__default.createElement(UserCustomOption, _extends({}, props), children));
7397
7407
  }
@@ -7545,10 +7555,10 @@ var CustomContainer = function CustomContainer(props) {
7545
7555
 
7546
7556
  var styles$N = {"custom-menu-text-field":"_2bu6-","custom-menu-hr":"_1cgU7","custom-menu-div":"_1khlU"};
7547
7557
 
7548
- var _excluded$2B = ["children"];
7558
+ var _excluded$2C = ["children"];
7549
7559
  function CustomMenu(_ref) {
7550
7560
  var children = _ref.children,
7551
- props = _objectWithoutPropertiesLoose(_ref, _excluded$2B);
7561
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$2C);
7552
7562
  var _props$selectProps$co = props.selectProps.componentsProps,
7553
7563
  creatableButton = _props$selectProps$co.creatableButton,
7554
7564
  onMenuInputFocus = _props$selectProps$co.onMenuInputFocus,
@@ -8267,11 +8277,11 @@ var TextAreaField = function TextAreaField(_ref) {
8267
8277
  }, toolbar)));
8268
8278
  };
8269
8279
 
8270
- var _excluded$2C = ["prefix", "suffix"];
8280
+ var _excluded$2D = ["prefix", "suffix"];
8271
8281
  var TextFieldElement = function TextFieldElement(_ref, ref) {
8272
8282
  var prefix = _ref.prefix,
8273
8283
  suffix = _ref.suffix,
8274
- props = _objectWithoutPropertiesLoose(_ref, _excluded$2C);
8284
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$2D);
8275
8285
  var _useTextField = useTextField(_extends({}, props, {
8276
8286
  ref: ref
8277
8287
  })),
@@ -8859,12 +8869,12 @@ var MultiSelectField = function MultiSelectField(_ref) {
8859
8869
 
8860
8870
  var styles$11 = {"custom-list":"_12jq3"};
8861
8871
 
8862
- var _excluded$2D = ["children", "hasMoreOptions", "hasMoreOptionsFirstLoad"];
8872
+ var _excluded$2E = ["children", "hasMoreOptions", "hasMoreOptionsFirstLoad"];
8863
8873
  var CustomList = function CustomList(_ref) {
8864
8874
  var children = _ref.children,
8865
8875
  hasMoreOptions = _ref.hasMoreOptions,
8866
8876
  hasMoreOptionsFirstLoad = _ref.hasMoreOptionsFirstLoad,
8867
- props = _objectWithoutPropertiesLoose(_ref, _excluded$2D);
8877
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$2E);
8868
8878
  var showFooter = hasMoreOptions;
8869
8879
  if (props.selectProps.inputValue === '' && typeof hasMoreOptionsFirstLoad === 'boolean') {
8870
8880
  showFooter = hasMoreOptionsFirstLoad;
@@ -8876,10 +8886,10 @@ var CustomList = function CustomList(_ref) {
8876
8886
  }, getLocalizedString('main.START_TYPING_TO_SEE_MORE_OPTIONS')))));
8877
8887
  };
8878
8888
 
8879
- var _excluded$2E = ["loadOptions"];
8889
+ var _excluded$2F = ["loadOptions"];
8880
8890
  var AsyncSelectField = function AsyncSelectField(_ref) {
8881
8891
  var loadOptions = _ref.loadOptions,
8882
- props = _objectWithoutPropertiesLoose(_ref, _excluded$2E);
8892
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$2F);
8883
8893
  var _useState = React.useState(false),
8884
8894
  hasMoreOptions = _useState[0],
8885
8895
  setHasMoreOptions = _useState[1];
@@ -9689,7 +9699,7 @@ var TimeFieldDropdown = function TimeFieldDropdown(_ref) {
9689
9699
  })));
9690
9700
  };
9691
9701
 
9692
- var _excluded$2F = ["interval", "startTime", "prefix", "endField", "duration"];
9702
+ var _excluded$2G = ["interval", "startTime", "prefix", "endField", "duration"];
9693
9703
  var TimeFieldElement = function TimeFieldElement(_ref, forwardedRef) {
9694
9704
  var _ref$interval = _ref.interval,
9695
9705
  interval = _ref$interval === void 0 ? 15 : _ref$interval,
@@ -9698,7 +9708,7 @@ var TimeFieldElement = function TimeFieldElement(_ref, forwardedRef) {
9698
9708
  _ref$endField = _ref.endField,
9699
9709
  endField = _ref$endField === void 0 ? false : _ref$endField,
9700
9710
  duration = _ref.duration,
9701
- allOtherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2F);
9711
+ allOtherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2G);
9702
9712
  var internalRef = React.useRef(null);
9703
9713
  var ref = forwardedRef || internalRef;
9704
9714
  var _useState = React.useState(allOtherProps.defaultValue),
@@ -9882,13 +9892,13 @@ var styles$14 = {"currency-field__mask-display":"_2K8Ob"};
9882
9892
  var CURRENCY_DISPLAY_DEFAULT_MARGIN = 8;
9883
9893
  var CURRENCY_DISPLAY_MARGIN_BUFFER = 1;
9884
9894
 
9885
- var _excluded$2G = ["currencySymbol", "step"];
9895
+ var _excluded$2H = ["currencySymbol", "step"];
9886
9896
  var CurrencyFieldElement = function CurrencyFieldElement(_ref, forwardedRef) {
9887
9897
  var _ref$currencySymbol = _ref.currencySymbol,
9888
9898
  currencySymbol = _ref$currencySymbol === void 0 ? '$' : _ref$currencySymbol,
9889
9899
  _ref$step = _ref.step,
9890
9900
  step = _ref$step === void 0 ? 0.01 : _ref$step,
9891
- allOtherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2G);
9901
+ allOtherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2H);
9892
9902
  var _useState = React.useState(CURRENCY_DISPLAY_DEFAULT_MARGIN),
9893
9903
  displayPadding = _useState[0],
9894
9904
  setDisplayPadding = _useState[1];
@@ -9952,7 +9962,7 @@ var CurrencyFieldElement = function CurrencyFieldElement(_ref, forwardedRef) {
9952
9962
  };
9953
9963
  var CurrencyField = React.forwardRef(CurrencyFieldElement);
9954
9964
 
9955
- var _excluded$2H = ["max", "min", "precision", "stepSize", "prefix"];
9965
+ var _excluded$2I = ["max", "min", "precision", "stepSize", "prefix"];
9956
9966
  var PercentageElement = function PercentageElement(_ref, ref) {
9957
9967
  var _ref$max = _ref.max,
9958
9968
  max = _ref$max === void 0 ? 100 : _ref$max,
@@ -9963,7 +9973,7 @@ var PercentageElement = function PercentageElement(_ref, ref) {
9963
9973
  _ref$stepSize = _ref.stepSize,
9964
9974
  stepSize = _ref$stepSize === void 0 ? 1 : _ref$stepSize,
9965
9975
  prefix = _ref.prefix,
9966
- allOtherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2H);
9976
+ allOtherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2I);
9967
9977
  var _useTextField = useTextField(_extends({}, allOtherProps, {
9968
9978
  ref: ref
9969
9979
  })),
@@ -10942,12 +10952,12 @@ var CountrySelector = function CountrySelector(_ref) {
10942
10952
  }))));
10943
10953
  };
10944
10954
 
10945
- var _excluded$2I = ["disabledCountry"];
10955
+ var _excluded$2J = ["disabledCountry"];
10946
10956
  var PhoneField = function PhoneField(_ref) {
10947
10957
  var _classNames;
10948
10958
  var _ref$disabledCountry = _ref.disabledCountry,
10949
10959
  disabledCountry = _ref$disabledCountry === void 0 ? false : _ref$disabledCountry,
10950
- props = _objectWithoutPropertiesLoose(_ref, _excluded$2I);
10960
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$2J);
10951
10961
  var inputRef = React.useRef(null);
10952
10962
  var _usePhoneField = usePhoneField(_extends({}, props, {
10953
10963
  ref: inputRef
@@ -11032,14 +11042,14 @@ var PhoneField = function PhoneField(_ref) {
11032
11042
 
11033
11043
  var styles$17 = {"badge":"_1QLaK","badge--warning":"_qsFWw","badge--danger":"_359Cc","badge--success":"_2AOEK","badge--info":"_1mLjf"};
11034
11044
 
11035
- var _excluded$2J = ["children", "theme", "title", "testId"];
11045
+ var _excluded$2K = ["children", "theme", "title", "testId"];
11036
11046
  var Badge = function Badge(_ref, forwardedRef) {
11037
11047
  var _classnames;
11038
11048
  var children = _ref.children,
11039
11049
  theme = _ref.theme,
11040
11050
  title = _ref.title,
11041
11051
  testId = _ref.testId,
11042
- otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2J);
11052
+ otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2K);
11043
11053
  var internalRef = React.useRef(null);
11044
11054
  var ref = forwardedRef || internalRef;
11045
11055
  React.useLayoutEffect(function () {