@bigbinary/neeto-rules-frontend 2.7.5 → 2.7.7

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 (59) hide show
  1. package/app/javascript/src/translations/en.json +4 -1
  2. package/dist/.ready +1 -1
  3. package/dist/NeetoRulesBuilder.js +168 -101
  4. package/dist/NeetoRulesBuilder.js.map +1 -1
  5. package/dist/NeetoRulesForm.js +2 -2
  6. package/dist/cjs/NeetoRulesBuilder.js +187 -101
  7. package/dist/cjs/NeetoRulesBuilder.js.map +1 -1
  8. package/dist/cjs/NeetoRulesForm.js +2 -2
  9. package/dist/cjs/index.js +2 -2
  10. package/dist/cjs/v2/CannedResponsesPane.js +1 -0
  11. package/dist/cjs/v2/CannedResponsesPane.js.map +1 -1
  12. package/dist/cjs/v2/NeetoRules.js +1 -2
  13. package/dist/cjs/v2/NeetoRules.js.map +1 -1
  14. package/dist/cjs/v2/NeetoRulesBuilder.js +23 -23
  15. package/dist/cjs/v2/NeetoRulesBuilder.js.map +1 -1
  16. package/dist/cjs/v2/NeetoRulesForm.js +3 -3
  17. package/dist/cjs/v2/NeetoRulesForm.js.map +1 -1
  18. package/dist/cjs/v2/RulePreview.js +1 -0
  19. package/dist/cjs/v2/RulePreview.js.map +1 -1
  20. package/dist/cjs/v2/RulesReorder.js +1 -1
  21. package/dist/cjs/v2/index.js +3 -3
  22. package/dist/{index-BuQR-kg9.js → index-7Oqmz32n.js} +3 -3
  23. package/dist/index-7Oqmz32n.js.map +1 -0
  24. package/dist/{index-CJpBriWC.js → index-BL9TdE9q.js} +3 -3
  25. package/dist/index-BL9TdE9q.js.map +1 -0
  26. package/dist/{index-qw90tLi9.js → index-C9u2JDEa.js} +41 -8
  27. package/dist/index-C9u2JDEa.js.map +1 -0
  28. package/dist/{index-BEAX6XxM.js → index-Clmi6O_h.js} +3 -1
  29. package/dist/index-Clmi6O_h.js.map +1 -0
  30. package/dist/{index-Df_k2p4V.js → index-Co-qUEtS.js} +42 -7
  31. package/dist/index-Co-qUEtS.js.map +1 -0
  32. package/dist/{index-DS9tZpYh.js → index-DOwwMQ0G.js} +3 -1
  33. package/dist/index-DOwwMQ0G.js.map +1 -0
  34. package/dist/index.js +2 -2
  35. package/dist/keyboardShortcuts-DcvmDX_K.js +88 -0
  36. package/dist/{keyboardShortcuts-BvIE6AHg.js.map → keyboardShortcuts-DcvmDX_K.js.map} +1 -1
  37. package/dist/keyboardShortcuts-Dg7lUOmj.js +92 -0
  38. package/dist/{keyboardShortcuts-NxcrOxzv.js.map → keyboardShortcuts-Dg7lUOmj.js.map} +1 -1
  39. package/dist/v2/CannedResponsesPane.js +1 -0
  40. package/dist/v2/CannedResponsesPane.js.map +1 -1
  41. package/dist/v2/NeetoRules.js +1 -2
  42. package/dist/v2/NeetoRules.js.map +1 -1
  43. package/dist/v2/NeetoRulesBuilder.js +23 -23
  44. package/dist/v2/NeetoRulesBuilder.js.map +1 -1
  45. package/dist/v2/NeetoRulesForm.js +3 -3
  46. package/dist/v2/NeetoRulesForm.js.map +1 -1
  47. package/dist/v2/RulePreview.js +1 -0
  48. package/dist/v2/RulePreview.js.map +1 -1
  49. package/dist/v2/RulesReorder.js +1 -1
  50. package/dist/v2/index.js +3 -3
  51. package/package.json +1 -1
  52. package/dist/index-BEAX6XxM.js.map +0 -1
  53. package/dist/index-BuQR-kg9.js.map +0 -1
  54. package/dist/index-CJpBriWC.js.map +0 -1
  55. package/dist/index-DS9tZpYh.js.map +0 -1
  56. package/dist/index-Df_k2p4V.js.map +0 -1
  57. package/dist/index-qw90tLi9.js.map +0 -1
  58. package/dist/keyboardShortcuts-BvIE6AHg.js +0 -88
  59. package/dist/keyboardShortcuts-NxcrOxzv.js +0 -92
@@ -16,7 +16,7 @@
16
16
  "automationName": "Automation name",
17
17
  "nameYourAutomation": "Name your automation",
18
18
  "activateThisAutomation": "Activate this automation",
19
- "nameSubtitle": "Name this automation. Leave blank to use the auto-generated name.",
19
+ "nameSubtitle": "Name this automation.",
20
20
  "valueWord": "value",
21
21
  "pickValue": "Pick {{field}}",
22
22
  "valueSubtitle": "Choose a value to match against.",
@@ -190,6 +190,8 @@
190
190
  "labels": {
191
191
  "active": "Active",
192
192
  "body": "Body",
193
+ "characterCount_one": "{{count}} character",
194
+ "characterCount_other": "{{count}} characters",
193
195
  "selectValues": "Select values",
194
196
  "selectValue": "Select value",
195
197
  "multipleValues": "Multiple values",
@@ -359,6 +361,7 @@
359
361
  "maximumPhoneNumbers": "Only up to {{max}} phone numbers are allowed",
360
362
  "maxDelay": "Delay can't be more than {{max}}",
361
363
  "minDelay": "Delay can't be less than {{min}}",
364
+ "maxLeadTime": "Time can't be more than {{max}}",
362
365
  "invalidJsonBody": "Body should be a valid JSON"
363
366
  },
364
367
  "conditionVerbs": {
package/dist/.ready CHANGED
@@ -1 +1 @@
1
- Built at 2026-07-21T23:50:34.710Z
1
+ Built at 2026-07-22T05:19:20.890Z
@@ -1,6 +1,6 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import _objectDestructuringEmpty from '@babel/runtime/helpers/objectDestructuringEmpty';
3
- import { f as flatten } from './keyboardShortcuts-BvIE6AHg.js';
3
+ import { f as flatten } from './keyboardShortcuts-DcvmDX_K.js';
4
4
  import { useShallow } from 'zustand/shallow';
5
5
  import { useState, createElement, Fragment as Fragment$1, useCallback, useMemo, useRef, useEffect } from 'react';
6
6
  import classNames from 'classnames';
@@ -11,7 +11,7 @@ import Header from '@bigbinary/neeto-molecules/Header';
11
11
  import Spinner from '@bigbinary/neetoui/Spinner';
12
12
  import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
13
13
  import { useTranslation } from 'react-i18next';
14
- import { E as EditorAction, o as Panel, r as ErrorCallout, s as SmsFields, t as PhoneNumberField, l as formatData, u as usePollRuleName, T as TouchErrors, n as ScrollToErrorField, p as getValidationSchema, q as DEFAULT_INITIAL_VALUE, m as buildPayload } from './index-qw90tLi9.js';
14
+ import { E as EditorAction, o as Panel, r as ErrorCallout, s as SmsFields, M as MIN_DELAY_VALUE, t as MAX_DELAY_VALUE, v as PhoneNumberField, l as formatData, u as usePollRuleName, T as TouchErrors, n as ScrollToErrorField, p as getValidationSchema, q as DEFAULT_INITIAL_VALUE, m as buildPayload } from './index-C9u2JDEa.js';
15
15
  import { u as useCustomDataStore } from './useCustomDataStore-BtKYtLVc.js';
16
16
  import { u as useUtilityStore } from './useUtilityStore-CCUYS1mS.js';
17
17
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
@@ -23,6 +23,7 @@ import Delete from '@bigbinary/neeto-icons/Delete';
23
23
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
24
24
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
25
25
  import { t } from 'i18next';
26
+ import * as yup from 'yup';
26
27
  import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
27
28
  import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
28
29
  import Search from '@bigbinary/neeto-icons/Search';
@@ -46,7 +47,6 @@ import './useAutomationRulesApi-C9I3wUZ8.js';
46
47
  import '@tanstack/react-query';
47
48
  import 'axios';
48
49
  import './index-9h4B7JZZ.js';
49
- import 'yup';
50
50
  import '@bigbinary/neetoui/formik/Radio';
51
51
  import '@bigbinary/neetoui/managers';
52
52
  import '@bigbinary/neeto-icons/Close';
@@ -102,6 +102,22 @@ var TIME_UNITS = [{
102
102
  /* eslint-enable @bigbinary/neeto/neetocommons-tips */
103
103
 
104
104
  var LEAD_TIME_UNITS = TIME_UNITS;
105
+
106
+ // Mirrors the classic form's three-digit input cap; 999 days equals the
107
+ // backend's maximum lead time.
108
+ var MAX_LEAD_TIME_VALUE = 999;
109
+ var STEPPER_DELTA = {
110
+ INCREMENT: 1,
111
+ DECREMENT: -1
112
+ };
113
+ var STEPPER_MIN_VALUE = 1;
114
+ var DEFAULT_DELAY_VALUE = 10;
115
+
116
+ // Matches the token flash animation duration in sentence-builder.css.
117
+ var FLASH_DURATION_MS = 2200;
118
+
119
+ // Keeps an element out of the keyboard tab order (HTML tabindex sentinel).
120
+ var SKIP_TAB_INDEX = -1;
105
121
  var CONDITION_VERBS = {
106
122
  IS: "is",
107
123
  IS_NOT: "is_not",
@@ -563,6 +579,25 @@ var partsToMinutes = function partsToMinutes(_ref19) {
563
579
  (Number(value) || 0) * (UNIT_MINUTES[unit] || 1)
564
580
  );
565
581
  };
582
+ var leadTimeExceedsMax = function leadTimeExceedsMax(minutes) {
583
+ return minutesToParts(minutes).value > MAX_LEAD_TIME_VALUE;
584
+ };
585
+ var leadTimeValidationSchema = function leadTimeValidationSchema(schema) {
586
+ var _schema$triggers2;
587
+ var fieldKey = schema === null || schema === void 0 || (_schema$triggers2 = schema.triggers) === null || _schema$triggers2 === void 0 || (_schema$triggers2 = _schema$triggers2.leadTime) === null || _schema$triggers2 === void 0 ? void 0 : _schema$triggers2.fieldKey;
588
+ if (!fieldKey) return yup.object();
589
+ return yup.object().shape(_defineProperty({}, fieldKey, yup.object().shape({
590
+ // yup 0.32 can only concat schemas of the same type, and the host's
591
+ // generic field schema for the lead time key is a string schema.
592
+ value: yup.string().test("max-lead-time", function () {
593
+ return t("neetoRules.validations.maxLeadTime", {
594
+ max: MAX_LEAD_TIME_VALUE
595
+ });
596
+ }, function (minutes) {
597
+ return !leadTimeExceedsMax(minutes);
598
+ })
599
+ })));
600
+ };
566
601
  var leadTimeLabel = function leadTimeLabel(minutes) {
567
602
  var _minutesToParts = minutesToParts(minutes),
568
603
  value = _minutesToParts.value,
@@ -603,15 +638,15 @@ var asArray = function asArray(maybeArray) {
603
638
  return Array.isArray(maybeArray) ? maybeArray : [];
604
639
  };
605
640
  var fieldKeysFromSchema = function fieldKeysFromSchema() {
606
- var _schema$triggers2, _schema$actor2, _schema$conditions3, _schema$actions3, _schema$delay, _schema$triggers3, _schema$scope2;
641
+ var _schema$triggers3, _schema$actor2, _schema$conditions3, _schema$actions3, _schema$delay, _schema$triggers4, _schema$scope2;
607
642
  var schema = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
608
643
  return {
609
- triggers: ((_schema$triggers2 = schema.triggers) === null || _schema$triggers2 === void 0 ? void 0 : _schema$triggers2.fieldKey) || "events",
644
+ triggers: ((_schema$triggers3 = schema.triggers) === null || _schema$triggers3 === void 0 ? void 0 : _schema$triggers3.fieldKey) || "events",
610
645
  performer: ((_schema$actor2 = schema.actor) === null || _schema$actor2 === void 0 ? void 0 : _schema$actor2.fieldKey) || "performer",
611
646
  conditions: ((_schema$conditions3 = schema.conditions) === null || _schema$conditions3 === void 0 ? void 0 : _schema$conditions3.fieldKey) || "conditions",
612
647
  actions: ((_schema$actions3 = schema.actions) === null || _schema$actions3 === void 0 ? void 0 : _schema$actions3.fieldKey) || "actions",
613
648
  delay: ((_schema$delay = schema.delay) === null || _schema$delay === void 0 ? void 0 : _schema$delay.fieldKey) || "execution_delay",
614
- leadTime: (_schema$triggers3 = schema.triggers) === null || _schema$triggers3 === void 0 || (_schema$triggers3 = _schema$triggers3.leadTime) === null || _schema$triggers3 === void 0 ? void 0 : _schema$triggers3.fieldKey,
649
+ leadTime: (_schema$triggers4 = schema.triggers) === null || _schema$triggers4 === void 0 || (_schema$triggers4 = _schema$triggers4.leadTime) === null || _schema$triggers4 === void 0 ? void 0 : _schema$triggers4.fieldKey,
615
650
  scope: ((_schema$scope2 = schema.scope) === null || _schema$scope2 === void 0 ? void 0 : _schema$scope2.fieldKey) || "meetingIds",
616
651
  status: "status",
617
652
  name: "name"
@@ -1637,6 +1672,10 @@ var WhenBlock = function WhenBlock(_ref) {
1637
1672
  type: BUILDER_ANCHORS.TRIGGER_LEAD_TIME,
1638
1673
  index: index
1639
1674
  }),
1675
+ invalid: isInvalid({
1676
+ type: BUILDER_ANCHORS.TRIGGER_LEAD_TIME,
1677
+ index: index
1678
+ }),
1640
1679
  onClick: handleToken && function () {
1641
1680
  return handleToken({
1642
1681
  type: BUILDER_ANCHORS.TRIGGER_LEAD_TIME,
@@ -2682,7 +2721,7 @@ var applyPreview = function applyPreview(_ref19) {
2682
2721
  function ownKeys$3(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; }
2683
2722
  function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2684
2723
  var Canvas = function Canvas(_ref) {
2685
- var _schema$scope, _schema$scope2, _schema$conditions, _schema$triggers, _schema$delay, _schema$meta$showName, _schema$meta;
2724
+ var _schema$scope, _schema$conditions, _schema$triggers, _schema$delay, _schema$meta$showName, _schema$meta;
2686
2725
  var schema = _ref.schema;
2687
2726
  var _useTranslation = useTranslation(),
2688
2727
  t = _useTranslation.t;
@@ -2748,7 +2787,7 @@ var Canvas = function Canvas(_ref) {
2748
2787
  setFlashing(true);
2749
2788
  var timer = setTimeout(function () {
2750
2789
  return setFlashing(false);
2751
- }, 2200);
2790
+ }, FLASH_DURATION_MS);
2752
2791
  return function () {
2753
2792
  return clearTimeout(timer);
2754
2793
  };
@@ -2802,6 +2841,10 @@ var Canvas = function Canvas(_ref) {
2802
2841
  prefix: "".concat(actorKey, ".value")
2803
2842
  });
2804
2843
  }
2844
+ case BUILDER_ANCHORS.TRIGGER_LEAD_TIME:
2845
+ return hasErrorAt({
2846
+ prefix: "".concat(fieldKeys.leadTime, ".value")
2847
+ });
2805
2848
  case BUILDER_ANCHORS.COND_FIELD:
2806
2849
  return hasErrorAt({
2807
2850
  prefix: "".concat(fieldKeys.conditions, ".value.").concat(index, ".field")
@@ -2896,8 +2939,6 @@ var Canvas = function Canvas(_ref) {
2896
2939
  return (action === null || action === void 0 ? void 0 : action.channel) || (action === null || action === void 0 ? void 0 : action.name);
2897
2940
  });
2898
2941
  var isScopeEnabled = (schema === null || schema === void 0 || (_schema$scope = schema.scope) === null || _schema$scope === void 0 ? void 0 : _schema$scope.enabled) && isTriggerSet && hasAction;
2899
- var isScopeComplete = !(schema !== null && schema !== void 0 && (_schema$scope2 = schema.scope) !== null && _schema$scope2 !== void 0 && _schema$scope2.enabled) || isNotEmpty(rule.scope || []);
2900
- var isComplete = isRuleComplete(rule) && isScopeComplete;
2901
2942
  var handleRemoveScope = function handleRemoveScope(index) {
2902
2943
  closePaneIfTargeting({
2903
2944
  anchors: [BUILDER_ANCHORS.SCOPE_PHONE_FIELD],
@@ -3029,24 +3070,22 @@ var Canvas = function Canvas(_ref) {
3029
3070
  onRemoveScope: handleRemoveScope,
3030
3071
  onToken: openPane
3031
3072
  })]
3032
- }), isComplete && /*#__PURE__*/jsxs(Fragment$1, {
3033
- children: [/*#__PURE__*/jsx(Connector, {
3034
- active: true
3035
- }), /*#__PURE__*/jsx(MetaBlock, {
3036
- rule: rule,
3037
- isInvalid: isInvalid({
3073
+ }), /*#__PURE__*/jsx(Connector, {
3074
+ active: true
3075
+ }), /*#__PURE__*/jsx(MetaBlock, {
3076
+ rule: rule,
3077
+ isInvalid: isInvalid({
3078
+ type: BUILDER_ANCHORS.META_NAME
3079
+ }),
3080
+ showName: (_schema$meta$showName = schema === null || schema === void 0 || (_schema$meta = schema.meta) === null || _schema$meta === void 0 ? void 0 : _schema$meta.showName) !== null && _schema$meta$showName !== void 0 ? _schema$meta$showName : true,
3081
+ onEditName: function onEditName() {
3082
+ return openPane({
3038
3083
  type: BUILDER_ANCHORS.META_NAME
3039
- }),
3040
- showName: (_schema$meta$showName = schema === null || schema === void 0 || (_schema$meta = schema.meta) === null || _schema$meta === void 0 ? void 0 : _schema$meta.showName) !== null && _schema$meta$showName !== void 0 ? _schema$meta$showName : true,
3041
- onEditName: function onEditName() {
3042
- return openPane({
3043
- type: BUILDER_ANCHORS.META_NAME
3044
- });
3045
- },
3046
- onToggleActive: function onToggleActive(event) {
3047
- return setActive(event.target.checked);
3048
- }
3049
- })]
3084
+ });
3085
+ },
3086
+ onToggleActive: function onToggleActive(event) {
3087
+ return setActive(event.target.checked);
3088
+ }
3050
3089
  })]
3051
3090
  })
3052
3091
  });
@@ -3506,19 +3545,14 @@ var ConfigPane = function ConfigPane(_ref) {
3506
3545
  message: disabledReason,
3507
3546
  selectedField: flatOption
3508
3547
  })
3509
- }), isSms ? /*#__PURE__*/jsxs(Fragment, {
3510
- children: [/*#__PURE__*/jsx(SmsFields, {
3511
- action: action,
3512
- index: index,
3513
- name: name,
3514
- shouldAutoFocus: true,
3515
- selectedField: flatOption,
3516
- showPhoneNumberInput: false
3517
- }), /*#__PURE__*/jsx(Typography, {
3518
- className: "neeto-ui-text-gray-500 mt-2",
3519
- style: "body3",
3520
- children: t("neetoRules.builder.config.smsSegmentHint")
3521
- })]
3548
+ }), isSms ? /*#__PURE__*/jsx(SmsFields, {
3549
+ action: action,
3550
+ index: index,
3551
+ name: name,
3552
+ shouldAutoFocus: true,
3553
+ hint: t("neetoRules.builder.config.smsSegmentHint"),
3554
+ selectedField: flatOption,
3555
+ showPhoneNumberInput: false
3522
3556
  }) : (_hostRenderConfig = hostRenderConfig === null || hostRenderConfig === void 0 ? void 0 : hostRenderConfig({
3523
3557
  name: name,
3524
3558
  action: action,
@@ -3549,7 +3583,9 @@ var DelayPane = function DelayPane(_ref) {
3549
3583
  var _useRuleModel = useRuleModel(schema),
3550
3584
  fieldKeys = _useRuleModel.fieldKeys;
3551
3585
  var _useFormikContext = useFormikContext(),
3552
- setFieldValue = _useFormikContext.setFieldValue;
3586
+ setFieldValue = _useFormikContext.setFieldValue,
3587
+ setFieldTouched = _useFormikContext.setFieldTouched,
3588
+ getFieldMeta = _useFormikContext.getFieldMeta;
3553
3589
  var bodyRef = useRef(null);
3554
3590
  var name = fieldKeys.delay;
3555
3591
  var _useField = useField("".concat(name, ".value")),
@@ -3558,12 +3594,18 @@ var DelayPane = function DelayPane(_ref) {
3558
3594
  var units = normalizeOptions((_schema$delay = schema.delay) === null || _schema$delay === void 0 ? void 0 : _schema$delay.units);
3559
3595
  var unitOptions = isNotEmpty(units) ? units : DEFAULT_DELAY_UNITS;
3560
3596
  usePaneValidation("".concat(name, ".value"));
3597
+ useEffect(function () {
3598
+ if ((value === null || value === void 0 ? void 0 : value.value) === undefined) return;
3599
+ if (getFieldMeta("".concat(name, ".value.value")).touched) return;
3600
+ setFieldTouched("".concat(name, ".value.value"), true, false);
3601
+ // eslint-disable-next-line react-hooks/exhaustive-deps
3602
+ }, [value === null || value === void 0 ? void 0 : value.value]);
3561
3603
  useEffect(function () {
3562
3604
  if (isEmpty(value || {})) {
3563
3605
  var _unitOptions$0$value, _unitOptions$;
3564
3606
  setFieldValue("".concat(name, ".value"), {
3565
- value: 10,
3566
- unit: (_unitOptions$0$value = (_unitOptions$ = unitOptions[0]) === null || _unitOptions$ === void 0 ? void 0 : _unitOptions$.value) !== null && _unitOptions$0$value !== void 0 ? _unitOptions$0$value : "minutes"
3607
+ value: DEFAULT_DELAY_VALUE,
3608
+ unit: (_unitOptions$0$value = (_unitOptions$ = unitOptions[0]) === null || _unitOptions$ === void 0 ? void 0 : _unitOptions$.value) !== null && _unitOptions$0$value !== void 0 ? _unitOptions$0$value : DEFAULT_DELAY_UNITS[0].value
3567
3609
  });
3568
3610
  }
3569
3611
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -3602,8 +3644,8 @@ var DelayPane = function DelayPane(_ref) {
3602
3644
  className: "flex items-start gap-x-2",
3603
3645
  children: [/*#__PURE__*/jsx(Input$1, {
3604
3646
  className: "w-44",
3605
- max: 999,
3606
- min: 1,
3647
+ max: MAX_DELAY_VALUE,
3648
+ min: MIN_DELAY_VALUE,
3607
3649
  name: "".concat(name, ".value.value"),
3608
3650
  placeholder: t("neetoRules.placeholders.enterDelay"),
3609
3651
  size: "large",
@@ -3647,9 +3689,10 @@ var NumberStepper = function NumberStepper(_ref) {
3647
3689
  onChange = _ref.onChange,
3648
3690
  label = _ref.label,
3649
3691
  _ref$min = _ref.min,
3650
- min = _ref$min === void 0 ? 1 : _ref$min,
3692
+ min = _ref$min === void 0 ? STEPPER_MIN_VALUE : _ref$min,
3651
3693
  max = _ref.max,
3652
- required = _ref.required;
3694
+ required = _ref.required,
3695
+ error = _ref.error;
3653
3696
  var _useTranslation = useTranslation(),
3654
3697
  t = _useTranslation.t;
3655
3698
  var _useState = useState(null),
@@ -3674,15 +3717,38 @@ var NumberStepper = function NumberStepper(_ref) {
3674
3717
  max: max
3675
3718
  }));
3676
3719
  };
3677
- return /*#__PURE__*/jsxs("div", {
3720
+ return /*#__PURE__*/jsx("div", {
3678
3721
  className: "mb-stepper",
3679
- children: [/*#__PURE__*/jsx(Input, {
3722
+ children: /*#__PURE__*/jsx(Input, {
3723
+ error: error,
3680
3724
  label: label,
3681
3725
  min: min,
3682
3726
  required: required,
3683
3727
  autoFocus: true,
3684
3728
  type: "number",
3685
3729
  value: display,
3730
+ suffix: /*#__PURE__*/jsxs("div", {
3731
+ className: "mb-stepper-controls",
3732
+ children: [/*#__PURE__*/jsx("button", {
3733
+ "aria-label": t("neetoRules.builder.aria.increase"),
3734
+ className: "mb-stepper-btn",
3735
+ tabIndex: SKIP_TAB_INDEX,
3736
+ type: "button",
3737
+ onClick: function onClick() {
3738
+ return step(STEPPER_DELTA.INCREMENT);
3739
+ },
3740
+ children: /*#__PURE__*/jsx(Up, {})
3741
+ }), /*#__PURE__*/jsx("button", {
3742
+ "aria-label": t("neetoRules.builder.aria.decrease"),
3743
+ className: "mb-stepper-btn",
3744
+ tabIndex: SKIP_TAB_INDEX,
3745
+ type: "button",
3746
+ onClick: function onClick() {
3747
+ return step(STEPPER_DELTA.DECREMENT);
3748
+ },
3749
+ children: /*#__PURE__*/jsx(Down, {})
3750
+ })]
3751
+ }),
3686
3752
  onBlur: function onBlur() {
3687
3753
  return setDraft(null);
3688
3754
  },
@@ -3692,28 +3758,7 @@ var NumberStepper = function NumberStepper(_ref) {
3692
3758
  onFocus: function onFocus(event) {
3693
3759
  return event.target.select();
3694
3760
  }
3695
- }), /*#__PURE__*/jsxs("div", {
3696
- className: "mb-stepper-controls",
3697
- children: [/*#__PURE__*/jsx("button", {
3698
- "aria-label": t("neetoRules.builder.aria.increase"),
3699
- className: "mb-stepper-btn",
3700
- tabIndex: -1,
3701
- type: "button",
3702
- onClick: function onClick() {
3703
- return step(1);
3704
- },
3705
- children: /*#__PURE__*/jsx(Up, {})
3706
- }), /*#__PURE__*/jsx("button", {
3707
- "aria-label": t("neetoRules.builder.aria.decrease"),
3708
- className: "mb-stepper-btn",
3709
- tabIndex: -1,
3710
- type: "button",
3711
- onClick: function onClick() {
3712
- return step(-1);
3713
- },
3714
- children: /*#__PURE__*/jsx(Down, {})
3715
- })]
3716
- })]
3761
+ })
3717
3762
  });
3718
3763
  };
3719
3764
 
@@ -3722,7 +3767,9 @@ var LeadTimePane = function LeadTimePane(_ref) {
3722
3767
  var _useTranslation = useTranslation(),
3723
3768
  t = _useTranslation.t;
3724
3769
  var _useFormikContext = useFormikContext(),
3725
- setFieldValue = _useFormikContext.setFieldValue;
3770
+ setFieldValue = _useFormikContext.setFieldValue,
3771
+ setFieldTouched = _useFormikContext.setFieldTouched,
3772
+ getFieldMeta = _useFormikContext.getFieldMeta;
3726
3773
  var _useRuleModel = useRuleModel(schema),
3727
3774
  rule = _useRuleModel.rule,
3728
3775
  fieldKeys = _useRuleModel.fieldKeys;
@@ -3730,6 +3777,11 @@ var LeadTimePane = function LeadTimePane(_ref) {
3730
3777
  amount = _minutesToParts.value,
3731
3778
  unit = _minutesToParts.unit;
3732
3779
  var path = "".concat(fieldKeys.leadTime, ".value");
3780
+ var _useField = useField(path),
3781
+ _useField2 = _slicedToArray(_useField, 2),
3782
+ _useField2$ = _useField2[1],
3783
+ error = _useField2$.error,
3784
+ touched = _useField2$.touched;
3733
3785
  var update = function update(_ref2) {
3734
3786
  var value = _ref2.value,
3735
3787
  nextUnit = _ref2.unit;
@@ -3738,6 +3790,13 @@ var LeadTimePane = function LeadTimePane(_ref) {
3738
3790
  unit: nextUnit
3739
3791
  }));
3740
3792
  };
3793
+ usePaneValidation(path);
3794
+ useEffect(function () {
3795
+ if (rule.leadTime === undefined) return;
3796
+ if (getFieldMeta(path).touched) return;
3797
+ setFieldTouched(path, true, false);
3798
+ // eslint-disable-next-line react-hooks/exhaustive-deps
3799
+ }, [rule.leadTime]);
3741
3800
  return /*#__PURE__*/jsxs(Fragment, {
3742
3801
  children: [/*#__PURE__*/jsx(Panel.Header, {
3743
3802
  children: /*#__PURE__*/jsxs("div", {
@@ -3753,34 +3812,42 @@ var LeadTimePane = function LeadTimePane(_ref) {
3753
3812
  })
3754
3813
  }), /*#__PURE__*/jsx(Panel.Body, {
3755
3814
  children: /*#__PURE__*/jsxs("div", {
3756
- className: "flex items-end gap-x-3",
3757
- children: [/*#__PURE__*/jsx("div", {
3758
- className: "flex-1",
3759
- children: /*#__PURE__*/jsx(NumberStepper, {
3760
- label: t("neetoRules.builder.before"),
3761
- value: amount,
3762
- onChange: function onChange(value) {
3763
- return update({
3764
- value: value === "" ? 0 : value,
3765
- unit: unit
3766
- });
3767
- }
3768
- })
3769
- }), /*#__PURE__*/jsx("div", {
3770
- className: "w-32 shrink-0",
3771
- children: /*#__PURE__*/jsx(Select$1, {
3772
- isSearchable: false,
3773
- options: LEAD_TIME_UNITS,
3774
- value: findBy({
3775
- value: unit
3776
- }, LEAD_TIME_UNITS) || null,
3777
- onChange: function onChange(option) {
3778
- return update({
3779
- value: amount,
3780
- unit: option === null || option === void 0 ? void 0 : option.value
3781
- });
3782
- }
3783
- })
3815
+ className: "flex flex-col gap-y-1.5",
3816
+ children: [/*#__PURE__*/jsx(Typography, {
3817
+ className: "neeto-ui-text-gray-800",
3818
+ style: "body2",
3819
+ weight: "medium",
3820
+ children: t("neetoRules.builder.before")
3821
+ }), /*#__PURE__*/jsxs("div", {
3822
+ className: "flex items-start gap-x-3",
3823
+ children: [/*#__PURE__*/jsx("div", {
3824
+ className: "flex-1",
3825
+ children: /*#__PURE__*/jsx(NumberStepper, {
3826
+ error: touched ? error : "",
3827
+ value: amount,
3828
+ onChange: function onChange(value) {
3829
+ return update({
3830
+ value: value === "" ? 0 : value,
3831
+ unit: unit
3832
+ });
3833
+ }
3834
+ })
3835
+ }), /*#__PURE__*/jsx("div", {
3836
+ className: "w-32 shrink-0",
3837
+ children: /*#__PURE__*/jsx(Select$1, {
3838
+ isSearchable: false,
3839
+ options: LEAD_TIME_UNITS,
3840
+ value: findBy({
3841
+ value: unit
3842
+ }, LEAD_TIME_UNITS) || null,
3843
+ onChange: function onChange(option) {
3844
+ return update({
3845
+ value: amount,
3846
+ unit: option === null || option === void 0 ? void 0 : option.value
3847
+ });
3848
+ }
3849
+ })
3850
+ })]
3784
3851
  })]
3785
3852
  })
3786
3853
  })]
@@ -4575,7 +4642,7 @@ var Form = function Form(_ref) {
4575
4642
  data: data,
4576
4643
  customData: customData,
4577
4644
  isNameGenerationDisabled: isNameRequired
4578
- }),
4645
+ }).concat(leadTimeValidationSchema(schema)),
4579
4646
  onSubmit: submitForm,
4580
4647
  children: function children() {
4581
4648
  return /*#__PURE__*/jsxs("div", {