@bigbinary/neeto-rules-frontend 2.9.0-beta1 → 2.9.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/dist/.ready +1 -1
- package/dist/cjs/v2/NeetoRulesBuilder.js +16 -9
- package/dist/cjs/v2/NeetoRulesBuilder.js.map +1 -1
- package/dist/cjs/v2/NeetoRulesForm.js +8 -4
- package/dist/cjs/v2/NeetoRulesForm.js.map +1 -1
- package/dist/cjs/v2/index.js +1 -1
- package/dist/{index-zvsaUL1M.js → index-C0MlXbjP.js} +17 -13
- package/dist/index-C0MlXbjP.js.map +1 -0
- package/dist/{index-djZiAHat.js → index-fOTfZZ-u.js} +17 -13
- package/dist/index-fOTfZZ-u.js.map +1 -0
- package/dist/v2/NeetoRulesBuilder.js +16 -9
- package/dist/v2/NeetoRulesBuilder.js.map +1 -1
- package/dist/v2/NeetoRulesForm.js +8 -4
- package/dist/v2/NeetoRulesForm.js.map +1 -1
- package/dist/v2/index.js +1 -1
- package/package.json +11 -11
- package/types.d.ts +4 -0
- package/dist/index-djZiAHat.js.map +0 -1
- package/dist/index-zvsaUL1M.js.map +0 -1
|
@@ -781,7 +781,8 @@ var CustomHeaders = function CustomHeaders(_ref) {
|
|
|
781
781
|
var name = _ref.name,
|
|
782
782
|
onFocus = _ref.onFocus,
|
|
783
783
|
_ref$helpPopoverProps = _ref.helpPopoverProps,
|
|
784
|
-
helpPopoverProps = _ref$helpPopoverProps === void 0 ? {} : _ref$helpPopoverProps
|
|
784
|
+
helpPopoverProps = _ref$helpPopoverProps === void 0 ? {} : _ref$helpPopoverProps,
|
|
785
|
+
dataTestid = _ref.dataTestid;
|
|
785
786
|
var _useFormikContext = formik.useFormikContext(),
|
|
786
787
|
values = _useFormikContext.values,
|
|
787
788
|
setFieldValue = _useFormikContext.setFieldValue;
|
|
@@ -801,8 +802,8 @@ var CustomHeaders = function CustomHeaders(_ref) {
|
|
|
801
802
|
children: [/*#__PURE__*/jsxRuntime.jsx(formik$1.Switch, _objectSpread$g({
|
|
802
803
|
label: label,
|
|
803
804
|
onFocus: onFocus,
|
|
804
|
-
"data-testid": "neeto-rules-api-fields-".concat(neetoCist.hyphenate(label), "-switch"),
|
|
805
805
|
name: switchName,
|
|
806
|
+
"data-testid": dataTestid || "neeto-rules-api-fields-".concat(neetoCist.hyphenate(label), "-switch"),
|
|
806
807
|
onCheckedChange: handleCheckedChange
|
|
807
808
|
}, withHelpPopover(helpPopoverProps))), isCustomHeadersEnabled && /*#__PURE__*/jsxRuntime.jsx(KeyValuePairsField, {
|
|
808
809
|
onFocus: onFocus,
|
|
@@ -1160,6 +1161,7 @@ var ApiFields = function ApiFields(_ref2) {
|
|
|
1160
1161
|
onFocus: setFieldActive
|
|
1161
1162
|
}), /*#__PURE__*/jsxRuntime.jsx(CustomHeaders, {
|
|
1162
1163
|
name: name,
|
|
1164
|
+
dataTestid: "neeto-rules-api-fields-include-headers-switch",
|
|
1163
1165
|
helpPopoverProps: customHeadersHelpPopoverProps,
|
|
1164
1166
|
onFocus: setFieldActive
|
|
1165
1167
|
}), /*#__PURE__*/jsxRuntime.jsx(JsonEditor, {
|
|
@@ -1202,13 +1204,13 @@ var Target$i = function Target(_ref) {
|
|
|
1202
1204
|
variant: "body1",
|
|
1203
1205
|
children: separator
|
|
1204
1206
|
}), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, {
|
|
1205
|
-
"data-testid": "custom-action-button-".concat(neetoCist.hyphenate(defaultLabel)),
|
|
1206
1207
|
label: defaultLabel.toLowerCase(),
|
|
1207
1208
|
variant: "link",
|
|
1208
1209
|
className: classNames("text-base text-foreground font-semibold underline", {
|
|
1209
1210
|
"text-primary": isFieldActive,
|
|
1210
1211
|
"text-destructive": isFieldInvalid && !isFieldActive
|
|
1211
1212
|
}),
|
|
1213
|
+
"data-testid": (selectedField === null || selectedField === void 0 ? void 0 : selectedField.dataTestid) || "custom-action-button-".concat(neetoCist.hyphenate(defaultLabel)),
|
|
1212
1214
|
onClick: handleOnClick
|
|
1213
1215
|
})]
|
|
1214
1216
|
});
|
|
@@ -2148,10 +2150,10 @@ var MultiSelectCheckbox$1 = function MultiSelectCheckbox(_ref2) {
|
|
|
2148
2150
|
return /*#__PURE__*/react.createElement(neetoAtoms.Checkbox, {
|
|
2149
2151
|
ref: ref,
|
|
2150
2152
|
checked: selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.includes(option.value),
|
|
2151
|
-
"data-testid": "".concat(utils.joinHyphenCase(option.label), "-checkbox"),
|
|
2152
2153
|
id: option.value,
|
|
2153
2154
|
key: option.value,
|
|
2154
2155
|
label: option.label,
|
|
2156
|
+
"data-testid": option.dataTestid || "".concat(utils.joinHyphenCase(option.label), "-checkbox"),
|
|
2155
2157
|
onChange: function onChange() {
|
|
2156
2158
|
return handleSelectOption(option.value);
|
|
2157
2159
|
},
|
|
@@ -2462,7 +2464,7 @@ var CUSTOM_COMPONENTS = {
|
|
|
2462
2464
|
ClearIndicator: ClearIndicator
|
|
2463
2465
|
};
|
|
2464
2466
|
|
|
2465
|
-
var _excluded$3 = ["value", "onChange", "error", "onBlur", "onFocus"];
|
|
2467
|
+
var _excluded$3 = ["value", "onChange", "error", "onBlur", "onFocus", "dataTestid"];
|
|
2466
2468
|
function ownKeys$8(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2467
2469
|
function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2468
2470
|
var MultiPhoneNumberInput = /*#__PURE__*/react.forwardRef(function (_ref, ref) {
|
|
@@ -2476,6 +2478,7 @@ var MultiPhoneNumberInput = /*#__PURE__*/react.forwardRef(function (_ref, ref) {
|
|
|
2476
2478
|
onBlur = _ref$onBlur === void 0 ? neetoCist.noop : _ref$onBlur,
|
|
2477
2479
|
_ref$onFocus = _ref.onFocus,
|
|
2478
2480
|
_onFocus = _ref$onFocus === void 0 ? neetoCist.noop : _ref$onFocus,
|
|
2481
|
+
dataTestid = _ref.dataTestid,
|
|
2479
2482
|
otherProps = _objectWithoutProperties(_ref, _excluded$3);
|
|
2480
2483
|
var _useTranslation = reactI18next.useTranslation(),
|
|
2481
2484
|
t = _useTranslation.t;
|
|
@@ -2522,7 +2525,7 @@ var MultiPhoneNumberInput = /*#__PURE__*/react.forwardRef(function (_ref, ref) {
|
|
|
2522
2525
|
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Label, {
|
|
2523
2526
|
required: true,
|
|
2524
2527
|
className: "neeto-ui-email-input__label",
|
|
2525
|
-
"data-testid": "".concat(dasherize(label), "-input-label"),
|
|
2528
|
+
"data-testid": "".concat(dataTestid || dasherize(label), "-input-label"),
|
|
2526
2529
|
children: label
|
|
2527
2530
|
})
|
|
2528
2531
|
}), /*#__PURE__*/jsxRuntime.jsx(CreatableSelect, _objectSpread$8({
|
|
@@ -2558,7 +2561,7 @@ var MultiPhoneNumberInput = /*#__PURE__*/react.forwardRef(function (_ref, ref) {
|
|
|
2558
2561
|
value: value
|
|
2559
2562
|
}, otherProps))), !!error && /*#__PURE__*/jsxRuntime.jsxs("p", {
|
|
2560
2563
|
className: "text-destructive text-xs",
|
|
2561
|
-
"data-testid": "".concat(dasherize(label), "-input-error"),
|
|
2564
|
+
"data-testid": "".concat(dataTestid || dasherize(label), "-input-error"),
|
|
2562
2565
|
children: [formatErrorMessage(error), isFilterPhoneNumbersLinkVisible && /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
2563
2566
|
className: "font-semibold cursor-pointer",
|
|
2564
2567
|
onClick: handleFilterPhoneNumbers,
|
|
@@ -2566,7 +2569,7 @@ var MultiPhoneNumberInput = /*#__PURE__*/react.forwardRef(function (_ref, ref) {
|
|
|
2566
2569
|
})]
|
|
2567
2570
|
}), /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
2568
2571
|
className: "text-muted-foreground text-xs",
|
|
2569
|
-
"data-testid": "".concat(dasherize(label), "-input-help"),
|
|
2572
|
+
"data-testid": "".concat(dataTestid || dasherize(label), "-input-help"),
|
|
2570
2573
|
children: t("neetoRules.helpTexts.phoneNumber")
|
|
2571
2574
|
})]
|
|
2572
2575
|
});
|
|
@@ -2594,6 +2597,7 @@ var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
|
2594
2597
|
children: /*#__PURE__*/jsxRuntime.jsx(MultiPhoneNumberInput, {
|
|
2595
2598
|
name: name,
|
|
2596
2599
|
onFocus: onFocus,
|
|
2600
|
+
dataTestid: "phone-numbers",
|
|
2597
2601
|
error: meta.touched ? meta.error : "",
|
|
2598
2602
|
label: t("neetoRules.common.phoneNumbers"),
|
|
2599
2603
|
placeholder: t("neetoRules.placeholders.phoneNumberField"),
|
|
@@ -3605,10 +3609,10 @@ var MultiSelectCheckbox = function MultiSelectCheckbox(_ref2) {
|
|
|
3605
3609
|
return /*#__PURE__*/react.createElement(neetoAtoms.Checkbox, _objectSpread$5({
|
|
3606
3610
|
ref: ref,
|
|
3607
3611
|
checked: selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.includes(option.value),
|
|
3608
|
-
"data-testid": "".concat(utils.joinHyphenCase(option.label), "-checkbox"),
|
|
3609
3612
|
id: option.value,
|
|
3610
3613
|
key: option.value,
|
|
3611
3614
|
label: option.label,
|
|
3615
|
+
"data-testid": option.dataTestid || "".concat(utils.joinHyphenCase(option.label), "-checkbox"),
|
|
3612
3616
|
onChange: function onChange() {
|
|
3613
3617
|
return handleMultiSelectOption(option.value);
|
|
3614
3618
|
},
|
|
@@ -4732,10 +4736,10 @@ var EventsPanel = function EventsPanel() {
|
|
|
4732
4736
|
ref: ref,
|
|
4733
4737
|
onFocus: setFieldActive
|
|
4734
4738
|
} : {}), {}, {
|
|
4735
|
-
"data-testid": "".concat(utils.joinHyphenCase(option.label), "-radio"),
|
|
4736
4739
|
key: option.value,
|
|
4737
4740
|
label: option.label,
|
|
4738
|
-
value: option.value
|
|
4741
|
+
value: option.value,
|
|
4742
|
+
"data-testid": option.dataTestid || "".concat(utils.joinHyphenCase(option.label), "-radio")
|
|
4739
4743
|
}));
|
|
4740
4744
|
})
|
|
4741
4745
|
}) : searchedOptions.map(function (option, index) {
|
|
@@ -4743,10 +4747,10 @@ var EventsPanel = function EventsPanel() {
|
|
|
4743
4747
|
ref: ref
|
|
4744
4748
|
} : {}), {}, {
|
|
4745
4749
|
checked: eventNames === null || eventNames === void 0 ? void 0 : eventNames.includes(option.value),
|
|
4746
|
-
"data-testid": "".concat(utils.joinHyphenCase(option.label), "-checkbox"),
|
|
4747
4750
|
id: option.value,
|
|
4748
4751
|
key: option.value,
|
|
4749
4752
|
label: option.label,
|
|
4753
|
+
"data-testid": option.dataTestid || "".concat(utils.joinHyphenCase(option.label), "-checkbox"),
|
|
4750
4754
|
onCheckedChange: function onCheckedChange() {
|
|
4751
4755
|
return handleMultiSelectOption(option);
|
|
4752
4756
|
},
|
|
@@ -5480,4 +5484,4 @@ exports.setEditorContent = setEditorContent;
|
|
|
5480
5484
|
exports.useHasFieldChanged = useHasFieldChanged;
|
|
5481
5485
|
exports.usePollRuleName = usePollRuleName;
|
|
5482
5486
|
exports.useResetSaveAsTemplateOnHide = useResetSaveAsTemplateOnHide;
|
|
5483
|
-
//# sourceMappingURL=index-
|
|
5487
|
+
//# sourceMappingURL=index-fOTfZZ-u.js.map
|