@bigbinary/neeto-rules-frontend 2.8.10 → 2.8.11-beta1

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.
Files changed (32) hide show
  1. package/dist/.ready +1 -1
  2. package/dist/NeetoRulesBuilder.js +40 -15
  3. package/dist/NeetoRulesBuilder.js.map +1 -1
  4. package/dist/NeetoRulesForm.js +2 -2
  5. package/dist/cjs/NeetoRulesBuilder.js +40 -15
  6. package/dist/cjs/NeetoRulesBuilder.js.map +1 -1
  7. package/dist/cjs/NeetoRulesForm.js +2 -2
  8. package/dist/cjs/index.js +2 -2
  9. package/dist/cjs/v2/NeetoRulesBuilder.js +39 -14
  10. package/dist/cjs/v2/NeetoRulesBuilder.js.map +1 -1
  11. package/dist/cjs/v2/NeetoRulesForm.js +2 -2
  12. package/dist/cjs/v2/index.js +2 -2
  13. package/dist/{index-ql13coG-.js → index-HxpDd_fD.js} +2 -2
  14. package/dist/{index-ql13coG-.js.map → index-HxpDd_fD.js.map} +1 -1
  15. package/dist/{index-D-pmcUGT.js → index-YOuCSbmi.js} +2 -2
  16. package/dist/{index-D-pmcUGT.js.map → index-YOuCSbmi.js.map} +1 -1
  17. package/dist/{index-CpWEW_Rn.js → index-djZiAHat.js} +2 -2
  18. package/dist/{index-CpWEW_Rn.js.map → index-djZiAHat.js.map} +1 -1
  19. package/dist/{index-XiWPZpLF.js → index-zvsaUL1M.js} +2 -2
  20. package/dist/{index-XiWPZpLF.js.map → index-zvsaUL1M.js.map} +1 -1
  21. package/dist/index.js +2 -2
  22. package/dist/keyboardShortcuts-CMYWaUJh.js +96 -0
  23. package/dist/{keyboardShortcuts-BGpApRKG.js.map → keyboardShortcuts-CMYWaUJh.js.map} +1 -1
  24. package/dist/keyboardShortcuts-cmT662QR.js +92 -0
  25. package/dist/{keyboardShortcuts-B-6CQw6N.js.map → keyboardShortcuts-cmT662QR.js.map} +1 -1
  26. package/dist/v2/NeetoRulesBuilder.js +39 -14
  27. package/dist/v2/NeetoRulesBuilder.js.map +1 -1
  28. package/dist/v2/NeetoRulesForm.js +2 -2
  29. package/dist/v2/index.js +2 -2
  30. package/package.json +1 -1
  31. package/dist/keyboardShortcuts-B-6CQw6N.js +0 -92
  32. package/dist/keyboardShortcuts-BGpApRKG.js +0 -96
@@ -2,7 +2,7 @@
2
2
 
3
3
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
4
4
  var _objectDestructuringEmpty = require('@babel/runtime/helpers/objectDestructuringEmpty');
5
- require('../keyboardShortcuts-BGpApRKG.js');
5
+ require('../keyboardShortcuts-CMYWaUJh.js');
6
6
  var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
7
7
  var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
8
8
  var shallow = require('zustand/shallow');
@@ -17,7 +17,7 @@ var useUtilityStore = require('../useUtilityStore-C_U20IMX.js');
17
17
  var classNames = require('classnames');
18
18
  var Typography = require('@bigbinary/neetoui/Typography');
19
19
  var ramda = require('ramda');
20
- var index = require('../index-ql13coG-.js');
20
+ var index = require('../index-HxpDd_fD.js');
21
21
  var useCustomDataStore = require('../useCustomDataStore-DxFx8aCf.js');
22
22
  var jsxRuntime = require('react/jsx-runtime');
23
23
  var utils = require('@bigbinary/neeto-commons-frontend/utils');
package/dist/cjs/index.js CHANGED
@@ -54,9 +54,9 @@ require('@hello-pangea/dnd');
54
54
  require('@bigbinary/neeto-icons/Drag');
55
55
  require('react-router-dom');
56
56
  require('@babel/runtime/helpers/objectDestructuringEmpty');
57
- require('../keyboardShortcuts-BGpApRKG.js');
57
+ require('../keyboardShortcuts-CMYWaUJh.js');
58
58
  require('classnames');
59
- require('../index-ql13coG-.js');
59
+ require('../index-HxpDd_fD.js');
60
60
  require('@babel/runtime/helpers/typeof');
61
61
  require('yup');
62
62
  require('@bigbinary/neeto-icons/Search');
@@ -2,7 +2,7 @@
2
2
 
3
3
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
4
4
  var _objectDestructuringEmpty = require('@babel/runtime/helpers/objectDestructuringEmpty');
5
- var keyboardShortcuts = require('../../keyboardShortcuts-BGpApRKG.js');
5
+ var keyboardShortcuts = require('../../keyboardShortcuts-CMYWaUJh.js');
6
6
  var shallow = require('zustand/shallow');
7
7
  var react = require('react');
8
8
  var classNames = require('classnames');
@@ -13,7 +13,7 @@ var neetoCist = require('@bigbinary/neeto-cist');
13
13
  var Container = require('@bigbinary/neeto-molecules/v2/Container');
14
14
  var Header = require('@bigbinary/neeto-molecules/v2/Header');
15
15
  var reactI18next = require('react-i18next');
16
- var index = require('../../index-CpWEW_Rn.js');
16
+ var index = require('../../index-djZiAHat.js');
17
17
  var useCustomDataStore = require('../../useCustomDataStore-DPmWkEhs.js');
18
18
  var useUtilityStore = require('../../useUtilityStore-gtPhFvpI.js');
19
19
  var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
@@ -4613,6 +4613,8 @@ var OptionsPane = function OptionsPane(_ref) {
4613
4613
  stepKey = _ref.stepKey,
4614
4614
  _ref$belowContent = _ref.belowContent,
4615
4615
  belowContent = _ref$belowContent === void 0 ? null : _ref$belowContent,
4616
+ _ref$renderOptionCont = _ref.renderOptionContent,
4617
+ renderOptionContent = _ref$renderOptionCont === void 0 ? null : _ref$renderOptionCont,
4616
4618
  _ref$configPending = _ref.configPending,
4617
4619
  configPending = _ref$configPending === void 0 ? false : _ref$configPending,
4618
4620
  _ref$validate = _ref.validate,
@@ -4835,6 +4837,26 @@ var OptionsPane = function OptionsPane(_ref) {
4835
4837
  children: category
4836
4838
  });
4837
4839
  };
4840
+ var renderOptionRow = function renderOptionRow(option) {
4841
+ var item = /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.RadioGroup.Item, _objectSpread$3(_objectSpread$3({
4842
+ disabled: option.disabled,
4843
+ label: optionLabel(option),
4844
+ labelProps: previewHandlers(option.value, option.disabled),
4845
+ value: option.value
4846
+ }, option.icon || option.disabledReason ? {
4847
+ "data-testid": option.value
4848
+ } : {}), previewHandlers(option.value, option.disabled)), option.value);
4849
+ var content = renderOptionContent === null || renderOptionContent === void 0 ? void 0 : renderOptionContent({
4850
+ option: option,
4851
+ isSelected: isSelected(option.value)
4852
+ });
4853
+ if (!content) return [item];
4854
+ return [item, /*#__PURE__*/jsxRuntime.jsx("div", {
4855
+ className: "mb-pane-option-content",
4856
+ "data-testid": "".concat(option.value, "-option-content"),
4857
+ children: content
4858
+ }, "".concat(option.value, "-content"))];
4859
+ };
4838
4860
  var renderBody = function renderBody() {
4839
4861
  var _selectedValues$;
4840
4862
  if (ramda.isEmpty(filtered)) {
@@ -4880,16 +4902,7 @@ var OptionsPane = function OptionsPane(_ref) {
4880
4902
  return [category ? /*#__PURE__*/jsxRuntime.jsx("div", {
4881
4903
  className: "mb-pane-group",
4882
4904
  children: category
4883
- }, "group-".concat(category)) : null].concat(_toConsumableArray(items.map(function (option) {
4884
- return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.RadioGroup.Item, _objectSpread$3(_objectSpread$3({
4885
- disabled: option.disabled,
4886
- label: optionLabel(option),
4887
- labelProps: previewHandlers(option.value, option.disabled),
4888
- value: option.value
4889
- }, option.icon || option.disabledReason ? {
4890
- "data-testid": option.value
4891
- } : {}), previewHandlers(option.value, option.disabled)), option.value);
4892
- })));
4905
+ }, "group-".concat(category)) : null].concat(_toConsumableArray(items.flatMap(renderOptionRow)));
4893
4906
  }).filter(Boolean)
4894
4907
  });
4895
4908
  };
@@ -4994,7 +5007,7 @@ var RecipientField = function RecipientField(_ref) {
4994
5007
  };
4995
5008
 
4996
5009
  var RecipientPane = function RecipientPane(_ref) {
4997
- var _schema$actions, _schema$actions$actio, _action$recipient, _schema$actions2, _schema$actions2$acti, _schema$actions3, _schema$actions3$rend, _schema$actions4, _schema$actions4$opti, _schema$actions5, _schema$actions5$opti, _schema$actions6, _schema$actions7, _schema$actions$rende, _schema$actions8, _schema$actions8$rend, _action$metadata, _schema$actions9;
5010
+ var _schema$actions, _schema$actions$actio, _action$recipient, _schema$actions2, _schema$actions2$acti, _schema$actions3, _schema$actions3$rend, _schema$actions4, _schema$actions4$opti, _schema$actions5, _schema$actions5$opti, _schema$actions6, _schema$actions7, _schema$actions$rende, _schema$actions8, _schema$actions8$rend, _action$metadata, _schema$actions9, _schema$actions0;
4998
5011
  var schema = _ref.schema,
4999
5012
  index$1 = _ref.index,
5000
5013
  _ref$configPending = _ref.configPending,
@@ -5055,6 +5068,17 @@ var RecipientPane = function RecipientPane(_ref) {
5055
5068
  name: "".concat(name, ".").concat(RECIPIENT_STORAGE_FIELDS.phoneNumbers),
5056
5069
  phoneNumbers: (_action$metadata = action.metadata) === null || _action$metadata === void 0 ? void 0 : _action$metadata.phoneNumbers
5057
5070
  }) : null;
5071
+ var renderOptionContent = (_schema$actions9 = schema.actions) !== null && _schema$actions9 !== void 0 && _schema$actions9.renderRecipientOptionContent ? function (_ref2) {
5072
+ var option = _ref2.option,
5073
+ isSelected = _ref2.isSelected;
5074
+ return schema.actions.renderRecipientOptionContent({
5075
+ channel: channel,
5076
+ recipient: option.value,
5077
+ name: name,
5078
+ action: action,
5079
+ isSelected: isSelected
5080
+ });
5081
+ } : null;
5058
5082
  var belowField = phoneField || recipientField;
5059
5083
  var belowContent = belowField ? /*#__PURE__*/jsxRuntime.jsx("div", {
5060
5084
  className: "mt-5",
@@ -5077,6 +5101,7 @@ var RecipientPane = function RecipientPane(_ref) {
5077
5101
  belowContent: belowContent,
5078
5102
  configPending: configPending,
5079
5103
  index: index$1,
5104
+ renderOptionContent: renderOptionContent,
5080
5105
  schema: schema,
5081
5106
  validate: validate,
5082
5107
  anchor: BUILDER_ANCHORS.ACTION_RECIPIENT
@@ -5084,7 +5109,7 @@ var RecipientPane = function RecipientPane(_ref) {
5084
5109
  }
5085
5110
 
5086
5111
  // eslint-disable-next-line security/detect-object-injection
5087
- var meta = ((_schema$actions9 = schema.actions) === null || _schema$actions9 === void 0 || (_schema$actions9 = _schema$actions9.channelMeta) === null || _schema$actions9 === void 0 ? void 0 : _schema$actions9[channel]) || {};
5112
+ var meta = ((_schema$actions0 = schema.actions) === null || _schema$actions0 === void 0 || (_schema$actions0 = _schema$actions0.channelMeta) === null || _schema$actions0 === void 0 ? void 0 : _schema$actions0[channel]) || {};
5088
5113
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
5089
5114
  children: [/*#__PURE__*/jsxRuntime.jsx(index.Panel.Header, {
5090
5115
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {