@thecb/components 10.8.0-beta.0 → 10.8.0-beta.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.
package/dist/index.cjs.js CHANGED
@@ -27106,6 +27106,7 @@ var FormInput = function FormInput(_ref15) {
27106
27106
  _ref15$isRequired = _ref15.isRequired,
27107
27107
  isRequired = _ref15$isRequired === void 0 ? false : _ref15$isRequired,
27108
27108
  props = _objectWithoutProperties(_ref15, _excluded2);
27109
+ debugger;
27109
27110
  var _useState = React.useState(false),
27110
27111
  _useState2 = _slicedToArray(_useState, 2),
27111
27112
  showPassword = _useState2[0],
@@ -28589,23 +28590,23 @@ var fallbackValues$w = {
28589
28590
  };
28590
28591
 
28591
28592
  /**
28592
- * Search accepts a redux-freeform field and actions to use
28593
+ * Search requires a redux-freeform field and actions to use
28593
28594
  * for its `FormInput` state, as well as a dataset and the keys you wish
28594
28595
  * to include in your search.
28595
28596
  *
28596
28597
  * The `dataset` expected is a one-dimensional array of objects.
28597
28598
  * Properties within the objects are included in the traversal
28598
- * when they are present in the ``valuesToSearchFor` prop.
28599
+ * when they are present in the `valuesToSearchFor` prop.
28599
28600
  *
28600
28601
  * This component expects implementations of `onSearchCallback` and `onClearCallback`
28601
28602
  * in the consuming application. For example, if you want to filter a table based on
28602
- * this search, this would trigger the adjustment of your table data's state in your
28603
- * consuming application.
28603
+ * this, your callbacks should trigger the adjustment of your table data's state in your
28604
+ * application implementing Search.
28604
28605
  */
28605
28606
 
28606
28607
  var Search = function Search(_ref) {
28607
- var actions = _ref.actions,
28608
- fields = _ref.fields,
28608
+ var field = _ref.field,
28609
+ fieldActions = _ref.fieldActions,
28609
28610
  dataset = _ref.dataset,
28610
28611
  valuesToSearchFor = _ref.valuesToSearchFor,
28611
28612
  onSearchCallback = _ref.onSearchCallback,
@@ -28617,12 +28618,11 @@ var Search = function Search(_ref) {
28617
28618
  searchOnKeypress = _ref$searchOnKeypress === void 0 ? false : _ref$searchOnKeypress,
28618
28619
  _ref$searchContainerW = _ref.searchContainerWidth,
28619
28620
  searchContainerWidth = _ref$searchContainerW === void 0 ? null : _ref$searchContainerW,
28620
- _ref$searchFieldName = _ref.searchFieldName,
28621
- searchFieldName = _ref$searchFieldName === void 0 ? "searchTerm" : _ref$searchFieldName,
28622
- autocompleteValue = _ref.autocompleteValue,
28623
28621
  ariaControlsId = _ref.ariaControlsId,
28624
28622
  themeValues = _ref.themeValues;
28625
- var searchTerm = fields[searchFieldName].rawValue;
28623
+ console.log("🚀 ~ field:", field);
28624
+ console.log("🚀 ~ fieldActions:", fieldActions);
28625
+ var searchTerm = field.rawValue;
28626
28626
  var getFilteredDataset = function getFilteredDataset() {
28627
28627
  if (!searchTerm) return dataset;
28628
28628
  return dataset.filter(function (item) {
@@ -28644,13 +28644,12 @@ var Search = function Search(_ref) {
28644
28644
  id: "searchInput",
28645
28645
  role: "search",
28646
28646
  "aria-controls": ariaControlsId,
28647
- autocompleteValue: autocompleteValue,
28648
28647
  extraStyles: "border-radius: 2px 0 0 2px;",
28649
28648
  onKeyDown: function onKeyDown(e) {
28650
28649
  return searchOnKeypress || e.key === "Enter" ? handleSubmit() : noop;
28651
28650
  },
28652
- field: fields[searchFieldName],
28653
- fieldActions: actions.fields[searchFieldName],
28651
+ field: field,
28652
+ fieldActions: fieldActions,
28654
28653
  placeholder: placeholder,
28655
28654
  errorMessages: {},
28656
28655
  disabled: disabled
@@ -28664,7 +28663,7 @@ var Search = function Search(_ref) {
28664
28663
  text: "Clear Search",
28665
28664
  "aria-label": "Clear Search",
28666
28665
  action: function action() {
28667
- actions.fields[searchFieldName].set("");
28666
+ fieldActions.set("");
28668
28667
  onClearCallback();
28669
28668
  }
28670
28669
  }))), /*#__PURE__*/React__default.createElement(ButtonWithAction, {
@@ -46247,6 +46246,8 @@ var CloseButton = function CloseButton(_ref) {
46247
46246
  buttonExtraStyles = _ref$buttonExtraStyle === void 0 ? "" : _ref$buttonExtraStyle,
46248
46247
  _ref$closeButtonText = _ref.closeButtonText,
46249
46248
  closeButtonText = _ref$closeButtonText === void 0 ? "" : _ref$closeButtonText,
46249
+ _ref$closeButtonVaria = _ref.closeButtonVariant,
46250
+ closeButtonVariant = _ref$closeButtonVaria === void 0 ? "primary" : _ref$closeButtonVaria,
46250
46251
  _ref$hideModal = _ref.hideModal,
46251
46252
  hideModal = _ref$hideModal === void 0 ? noop : _ref$hideModal,
46252
46253
  _ref$isMobile = _ref.isMobile,
@@ -46263,7 +46264,7 @@ var CloseButton = function CloseButton(_ref) {
46263
46264
  role: "button",
46264
46265
  text: closeButtonText,
46265
46266
  textExtraStyles: "".concat(fontSize),
46266
- variant: "primary"
46267
+ variant: closeButtonVariant
46267
46268
  });
46268
46269
  };
46269
46270
 
@@ -46359,6 +46360,8 @@ var Modal$2 = function Modal(_ref) {
46359
46360
  children = _ref$children === void 0 ? [] : _ref$children,
46360
46361
  _ref$closeButtonText = _ref.closeButtonText,
46361
46362
  closeButtonText = _ref$closeButtonText === void 0 ? "Close" : _ref$closeButtonText,
46363
+ _ref$closeButtonVaria = _ref.closeButtonVariant,
46364
+ closeButtonVariant = _ref$closeButtonVaria === void 0 ? "primary" : _ref$closeButtonVaria,
46362
46365
  _ref$continueAction = _ref.continueAction,
46363
46366
  continueAction = _ref$continueAction === void 0 ? noop : _ref$continueAction,
46364
46367
  _ref$continueButtonTe = _ref.continueButtonText,
@@ -46513,6 +46516,7 @@ var Modal$2 = function Modal(_ref) {
46513
46516
  }), hasCloseButton && /*#__PURE__*/React__default.createElement(CloseButton, {
46514
46517
  buttonExtraStyles: buttonExtraStyles,
46515
46518
  closeButtonText: closeButtonText,
46519
+ closeButtonVariant: closeButtonVariant,
46516
46520
  hideModal: hideModal,
46517
46521
  isMobile: isMobile,
46518
46522
  key: "close"