@bigbinary/neeto-rules-frontend 2.2.0 → 2.3.0

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.
@@ -25,7 +25,6 @@ var ActionBlock = require('@bigbinary/neetoui/formik/ActionBlock');
25
25
  var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
26
26
  var Label = require('@bigbinary/neetoui/Label');
27
27
  var Select = require('@bigbinary/neetoui/Select');
28
- var dayjs = require('dayjs');
29
28
  var DatePicker = require('@bigbinary/neetoui/DatePicker');
30
29
  var i18next = require('i18next');
31
30
  var FormikEditor = require('@bigbinary/neeto-editor/FormikEditor');
@@ -86,7 +85,6 @@ var Textarea__default = /*#__PURE__*/_interopDefaultLegacy(Textarea);
86
85
  var ActionBlock__default = /*#__PURE__*/_interopDefaultLegacy(ActionBlock);
87
86
  var Label__default = /*#__PURE__*/_interopDefaultLegacy(Label);
88
87
  var Select__default = /*#__PURE__*/_interopDefaultLegacy(Select);
89
- var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
90
88
  var DatePicker__default = /*#__PURE__*/_interopDefaultLegacy(DatePicker);
91
89
  var FormikEditor__default = /*#__PURE__*/_interopDefaultLegacy(FormikEditor);
92
90
  var MultiEmailInput__default = /*#__PURE__*/_interopDefaultLegacy(MultiEmailInput);
@@ -593,7 +591,7 @@ var DateField$1 = function DateField(_ref) {
593
591
  return setFieldValue("".concat(name, ".value"),
594
592
  // This is the format being stored in database as of now, standard doesn't include this format
595
593
  // eslint-disable-next-line @bigbinary/neeto/use-standard-date-time-formats
596
- date ? dayjs__default["default"](date).format("YYYY-MM-DD") : "");
594
+ date ? utils.dayjs(date).format("YYYY-MM-DD") : "");
597
595
  }
598
596
  }), /*#__PURE__*/jsxRuntime.jsx(Check__default["default"], {
599
597
  className: "cursor-pointer",
@@ -2264,7 +2262,16 @@ var getActionsSchema = function getActionsSchema(element, customData) {
2264
2262
  if ([ACTION_TYPES.email, ACTION_TYPES.emailToIds, ACTION_TYPES.emailTo].includes(selectedAction === null || selectedAction === void 0 ? void 0 : selectedAction.type)) {
2265
2263
  return yup__namespace.object({
2266
2264
  subject: !selectedAction.hideSubject ? yup__namespace.string().required(i18next.t("neetoRules.validations.required.subject")) : schema,
2267
- emails: selectedAction.type === ACTION_TYPES.emailToIds ? yup__namespace.array().min(1, i18next.t("neetoRules.validations.required.emailId")).required(i18next.t("neetoRules.validations.required.emailId")).of(yup__namespace.string().email(i18next.t("neetoRules.validations.inValidEmail"))) : schema,
2265
+ emails: selectedAction.type === ACTION_TYPES.emailToIds ? yup__namespace.array().min(1, i18next.t("neetoRules.validations.required.emailId")).required(i18next.t("neetoRules.validations.required.emailId")).of(yup__namespace.string().email(i18next.t("neetoRules.validations.inValidEmail"))).when("test", {
2266
+ is: function is() {
2267
+ return selectedAction === null || selectedAction === void 0 ? void 0 : selectedAction.maxLimit;
2268
+ },
2269
+ then: function then(schema) {
2270
+ return schema.max(selectedAction.maxLimit, i18next.t("neetoRules.validations.maximumEmails", {
2271
+ max: selectedAction.maxLimit
2272
+ }));
2273
+ }
2274
+ }) : schema,
2268
2275
  body: yup__namespace.string().test("body", i18next.t("neetoRules.validations.required.body"), function (value) {
2269
2276
  return !utils$1.isEditorEmpty(value);
2270
2277
  }),
@@ -3652,7 +3659,7 @@ var DateField = function DateField(_ref) {
3652
3659
  setFieldValue("".concat(name, ".value"),
3653
3660
  // This is the format being stored in database as of now, standard doesn't include this format
3654
3661
  // eslint-disable-next-line @bigbinary/neeto/use-standard-date-time-formats
3655
- date ? dayjs__default["default"](date).format("YYYY-MM-DD") : "");
3662
+ date ? utils.dayjs(date).format("YYYY-MM-DD") : "");
3656
3663
  handleValidate();
3657
3664
  };
3658
3665
  return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {