@bigbinary/neeto-rules-frontend 2.3.0 → 2.3.1
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/README.md +9 -0
- package/dist/NeetoRules.js +2 -10
- package/dist/NeetoRules.js.map +1 -1
- package/dist/NeetoRulesForm.js +27 -10
- package/dist/NeetoRulesForm.js.map +1 -1
- package/dist/RulePreview.js +7 -4
- package/dist/RulePreview.js.map +1 -1
- package/dist/cjs/NeetoRules.js +19 -27
- package/dist/cjs/NeetoRules.js.map +1 -1
- package/dist/cjs/NeetoRulesForm.js +136 -119
- package/dist/cjs/NeetoRulesForm.js.map +1 -1
- package/dist/cjs/RulePreview.js +10 -7
- package/dist/cjs/RulePreview.js.map +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/index.js +2 -2
- package/dist/{toConsumableArray-9f1f441a.js → toConsumableArray-71e2b184.js} +4 -4
- package/dist/{toConsumableArray-9f1f441a.js.map → toConsumableArray-71e2b184.js.map} +1 -1
- package/dist/{toConsumableArray-1215bc07.js → toConsumableArray-ee25f277.js} +2 -2
- package/dist/{toConsumableArray-1215bc07.js.map → toConsumableArray-ee25f277.js.map} +1 -1
- package/dist/{slicedToArray-2af6bc03.js → utils-249a1c9a.js} +23 -2
- package/dist/utils-249a1c9a.js.map +1 -0
- package/dist/{slicedToArray-cc928132.js → utils-ca50bfc9.js} +24 -1
- package/dist/utils-ca50bfc9.js.map +1 -0
- package/package.json +15 -15
- package/dist/slicedToArray-2af6bc03.js.map +0 -1
- package/dist/slicedToArray-cc928132.js.map +0 -1
package/dist/NeetoRulesForm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as _defineProperty, a as _slicedToArray, b as _arrayWithHoles,
|
|
2
|
-
import { _ as _objectWithoutProperties, b as _iterableToArray, a as _toConsumableArray, g as getDefaultExportFromCjs } from './toConsumableArray-
|
|
1
|
+
import { _ as _defineProperty, a as _slicedToArray, g as getSeparator, b as _arrayWithHoles, d as _unsupportedIterableToArray, e as _nonIterableRest, f as _typeof$1 } from './utils-249a1c9a.js';
|
|
2
|
+
import { _ as _objectWithoutProperties, b as _iterableToArray, a as _toConsumableArray, g as getDefaultExportFromCjs } from './toConsumableArray-ee25f277.js';
|
|
3
3
|
import { useEffect, useState, useRef, forwardRef, useMemo, memo, createElement, Fragment as Fragment$1 } from 'react';
|
|
4
4
|
import { useFormikContext, useField, FieldArray, ErrorMessage, Formik, Form as Form$1 } from 'formik';
|
|
5
5
|
import { isNotEmpty, isPresent, renameKeys, findBy, noop, nullSafe, toLabelAndValue, removeBy } from '@bigbinary/neeto-cist';
|
|
@@ -686,7 +686,7 @@ var getSlackChannelErrors = function getSlackChannelErrors(_ref2) {
|
|
|
686
686
|
var Menu$9 = Dropdown$1.Menu,
|
|
687
687
|
MenuItem$9 = Dropdown$1.MenuItem;
|
|
688
688
|
var DropdownField$1 = function DropdownField(_ref) {
|
|
689
|
-
var _actions$value$index$, _actions$value$index, _errors$actions, _touched$actions,
|
|
689
|
+
var _actions$value$index$, _actions$value$index, _errors$actions, _touched$actions, _defaultSelectedOptio;
|
|
690
690
|
var dropdownOptions = _ref.dropdownOptions,
|
|
691
691
|
name = _ref.name,
|
|
692
692
|
index = _ref.index,
|
|
@@ -717,7 +717,10 @@ var DropdownField$1 = function DropdownField(_ref) {
|
|
|
717
717
|
var defaultValue = ((_actions$value$index$ = actions.value[index].metadata) === null || _actions$value$index$ === void 0 ? void 0 : _actions$value$index$.value) || ((_actions$value$index = actions.value[index]) === null || _actions$value$index === void 0 ? void 0 : _actions$value$index.value);
|
|
718
718
|
var searchedOptions = getSearchedOptions$3(dropdownOptions, searchTerm);
|
|
719
719
|
var isValueSelected = defaultSelectedOption.label === defaultLabel && errors.actions && isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0 || (_errors$actions = _errors$actions.value) === null || _errors$actions === void 0 ? void 0 : _errors$actions[index]) && isNotNil((_touched$actions = touched.actions) === null || _touched$actions === void 0 || (_touched$actions = _touched$actions.value) === null || _touched$actions === void 0 ? void 0 : _touched$actions[index]);
|
|
720
|
-
var separator = (
|
|
720
|
+
var separator = getSeparator({
|
|
721
|
+
defaultSeparator: t("neetoRules.common.to"),
|
|
722
|
+
selectedField: selectedField
|
|
723
|
+
});
|
|
721
724
|
var handleClose = function handleClose() {
|
|
722
725
|
setIsActive(false);
|
|
723
726
|
setSearchTerm("");
|
|
@@ -886,12 +889,14 @@ var EmailIdFields = function EmailIdFields(_ref) {
|
|
|
886
889
|
};
|
|
887
890
|
|
|
888
891
|
var EmailFields = function EmailFields(_ref) {
|
|
889
|
-
var _errors$actions, _touched$actions,
|
|
892
|
+
var _errors$actions, _touched$actions, _action$metadata;
|
|
890
893
|
var _ref$isEmailIdField = _ref.isEmailIdField,
|
|
891
894
|
isEmailIdField = _ref$isEmailIdField === void 0 ? false : _ref$isEmailIdField,
|
|
892
895
|
name = _ref.name,
|
|
893
896
|
action = _ref.action,
|
|
894
897
|
selectedField = _ref.selectedField,
|
|
898
|
+
_ref$separatorIndex = _ref.separatorIndex,
|
|
899
|
+
separatorIndex = _ref$separatorIndex === void 0 ? 0 : _ref$separatorIndex,
|
|
895
900
|
_ref$emails = _ref.emails,
|
|
896
901
|
emails = _ref$emails === void 0 ? [] : _ref$emails,
|
|
897
902
|
index = _ref.index;
|
|
@@ -911,7 +916,11 @@ var EmailFields = function EmailFields(_ref) {
|
|
|
911
916
|
return setShowPane(false);
|
|
912
917
|
});
|
|
913
918
|
var isValid = errors.actions && isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0 || (_errors$actions = _errors$actions.value) === null || _errors$actions === void 0 ? void 0 : _errors$actions[index]) && isNotNil((_touched$actions = touched.actions) === null || _touched$actions === void 0 || (_touched$actions = _touched$actions.value) === null || _touched$actions === void 0 ? void 0 : _touched$actions[index]);
|
|
914
|
-
var separator = (
|
|
919
|
+
var separator = getSeparator({
|
|
920
|
+
defaultSeparator: t("neetoRules.common.as"),
|
|
921
|
+
index: separatorIndex,
|
|
922
|
+
selectedField: selectedField
|
|
923
|
+
});
|
|
915
924
|
var defaultLabel = (selectedField === null || selectedField === void 0 ? void 0 : selectedField.emailPlaceholder) || t("neetoRules.common.email");
|
|
916
925
|
var templates = selectedField === null || selectedField === void 0 ? void 0 : selectedField.templates;
|
|
917
926
|
var isTemplateSelectionEnabled = isPresent(templates);
|
|
@@ -1791,12 +1800,14 @@ var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
|
1791
1800
|
};
|
|
1792
1801
|
|
|
1793
1802
|
var SmsFields = function SmsFields(_ref) {
|
|
1794
|
-
var _errors$actions, _touched$actions,
|
|
1803
|
+
var _errors$actions, _touched$actions, _action$metadata;
|
|
1795
1804
|
var name = _ref.name,
|
|
1796
1805
|
action = _ref.action,
|
|
1797
1806
|
selectedField = _ref.selectedField,
|
|
1798
1807
|
_ref$phoneNumbers = _ref.phoneNumbers,
|
|
1799
1808
|
phoneNumbers = _ref$phoneNumbers === void 0 ? [] : _ref$phoneNumbers,
|
|
1809
|
+
_ref$separatorIndex = _ref.separatorIndex,
|
|
1810
|
+
separatorIndex = _ref$separatorIndex === void 0 ? 0 : _ref$separatorIndex,
|
|
1800
1811
|
_ref$showPhoneNumberI = _ref.showPhoneNumberInput,
|
|
1801
1812
|
showPhoneNumberInput = _ref$showPhoneNumberI === void 0 ? false : _ref$showPhoneNumberI,
|
|
1802
1813
|
index = _ref.index;
|
|
@@ -1816,7 +1827,11 @@ var SmsFields = function SmsFields(_ref) {
|
|
|
1816
1827
|
return setShowPane(false);
|
|
1817
1828
|
});
|
|
1818
1829
|
var isValid = errors.actions && isNotNil((_errors$actions = errors.actions) === null || _errors$actions === void 0 || (_errors$actions = _errors$actions.value) === null || _errors$actions === void 0 ? void 0 : _errors$actions[index]) && isNotNil((_touched$actions = touched.actions) === null || _touched$actions === void 0 || (_touched$actions = _touched$actions.value) === null || _touched$actions === void 0 ? void 0 : _touched$actions[index]);
|
|
1819
|
-
var separator = (
|
|
1830
|
+
var separator = getSeparator({
|
|
1831
|
+
defaultSeparator: t("neetoRules.common.as"),
|
|
1832
|
+
index: separatorIndex,
|
|
1833
|
+
selectedField: selectedField
|
|
1834
|
+
});
|
|
1820
1835
|
var defaultLabel = (selectedField === null || selectedField === void 0 ? void 0 : selectedField.smsPlaceholder) || t("neetoRules.common.sms");
|
|
1821
1836
|
var templates = selectedField === null || selectedField === void 0 ? void 0 : selectedField.templates;
|
|
1822
1837
|
var isTemplateSelectionEnabled = isPresent(templates);
|
|
@@ -1940,7 +1955,8 @@ var ActionSubItems = function ActionSubItems(_ref) {
|
|
|
1940
1955
|
index: index,
|
|
1941
1956
|
name: name,
|
|
1942
1957
|
selectedField: selectedField,
|
|
1943
|
-
key: name
|
|
1958
|
+
key: name,
|
|
1959
|
+
separatorIndex: 1
|
|
1944
1960
|
})]
|
|
1945
1961
|
});
|
|
1946
1962
|
}
|
|
@@ -1978,7 +1994,8 @@ var ActionSubItems = function ActionSubItems(_ref) {
|
|
|
1978
1994
|
index: index,
|
|
1979
1995
|
name: name,
|
|
1980
1996
|
selectedField: selectedField,
|
|
1981
|
-
key: name
|
|
1997
|
+
key: name,
|
|
1998
|
+
separatorIndex: 1
|
|
1982
1999
|
})]
|
|
1983
2000
|
});
|
|
1984
2001
|
}
|