iglooform 2.5.49 → 2.5.50

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.
@@ -42,21 +42,18 @@ import emptyIcon from '../radio/style/empty.svg';
42
42
  import './style/index.less'; // add disabled attributes to checkbox options based on mutually exclusion config
43
43
 
44
44
  var addDisabledAttr = function addDisabledAttr(options, mutuallyExclusions, checkedValues) {
45
- if (!mutuallyExclusions || !checkedValues) return options;
46
- checkedValues = Array.isArray(checkedValues) ? checkedValues : [checkedValues];
45
+ if (!mutuallyExclusions || !Object.keys(mutuallyExclusions).length || !(checkedValues === null || checkedValues === void 0 ? void 0 : checkedValues.length)) return options;
47
46
  return options.map(function (_ref) {
48
- var _checkedValues;
49
-
50
47
  var value = _ref.value,
51
48
  rest = _objectWithoutProperties(_ref, _excluded);
52
49
 
53
50
  return _objectSpread(_objectSpread({}, rest), {}, {
54
51
  value: value,
55
- disabled: !!value && !!((_checkedValues = checkedValues) === null || _checkedValues === void 0 ? void 0 : _checkedValues.some(function (v) {
52
+ disabled: !!(value && (checkedValues === null || checkedValues === void 0 ? void 0 : checkedValues.some(function (v) {
56
53
  var _mutuallyExclusions$S, _mutuallyExclusions$v;
57
54
 
58
- return ((_mutuallyExclusions$S = mutuallyExclusions[String(v)]) === null || _mutuallyExclusions$S === void 0 ? void 0 : _mutuallyExclusions$S.includes(String(value))) || ((_mutuallyExclusions$v = mutuallyExclusions[value]) === null || _mutuallyExclusions$v === void 0 ? void 0 : _mutuallyExclusions$v.includes(String(v)));
59
- }))
55
+ return v !== value && (((_mutuallyExclusions$S = mutuallyExclusions[String(v)]) === null || _mutuallyExclusions$S === void 0 ? void 0 : _mutuallyExclusions$S.includes(String(value))) || ((_mutuallyExclusions$v = mutuallyExclusions[value]) === null || _mutuallyExclusions$v === void 0 ? void 0 : _mutuallyExclusions$v.includes(String(v))));
56
+ })))
60
57
  });
61
58
  });
62
59
  };
@@ -73,4 +73,4 @@ export declare const calcSelectValue: (selectValue?: FormItemSelectValue[] | und
73
73
  disabled: boolean | undefined;
74
74
  };
75
75
  export declare const calcShouldRender: (dependencies?: NamePath[], asserts?: FormItemAssert[], shouldRender?: ((form?: FormInstance<any> | undefined) => boolean) | undefined, form?: FormInstance<any> | undefined) => boolean;
76
- export declare const getRuleValidation: (url: string, rule: string | string[], values?: any, lang?: string | undefined) => Promise<any>;
76
+ export declare const getRuleValidation: (url: string, rule: string | string[], values?: any, lang?: string) => Promise<any>;
@@ -560,16 +560,20 @@ export var calcShouldRender = function calcShouldRender() {
560
560
  return true;
561
561
  };
562
562
  export var getRuleValidation = /*#__PURE__*/function () {
563
- var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(url, rule, values, lang) {
564
- var _lang, _lang$split;
565
-
566
- var res, json, _ref4, conclusion, details;
563
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(url, rule, values) {
564
+ var lang,
565
+ res,
566
+ json,
567
+ _ref4,
568
+ conclusion,
569
+ details,
570
+ _args = arguments;
567
571
 
568
572
  return regeneratorRuntime.wrap(function _callee$(_context) {
569
573
  while (1) {
570
574
  switch (_context.prev = _context.next) {
571
575
  case 0:
572
- lang = ((_lang = lang) === null || _lang === void 0 ? void 0 : (_lang$split = _lang.split('-')) === null || _lang$split === void 0 ? void 0 : _lang$split[0]) || 'en';
576
+ lang = _args.length > 3 && _args[3] !== undefined ? _args[3] : 'en-US';
573
577
  _context.next = 3;
574
578
  return fetch("".concat(url, "?lang=").concat(lang), {
575
579
  method: 'post',
@@ -624,7 +628,7 @@ export var getRuleValidation = /*#__PURE__*/function () {
624
628
  }, _callee);
625
629
  }));
626
630
 
627
- return function getRuleValidation(_x, _x2, _x3, _x4) {
631
+ return function getRuleValidation(_x, _x2, _x3) {
628
632
  return _ref3.apply(this, arguments);
629
633
  };
630
634
  }();
@@ -67,21 +67,18 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
67
67
 
68
68
  // add disabled attributes to checkbox options based on mutually exclusion config
69
69
  var addDisabledAttr = function addDisabledAttr(options, mutuallyExclusions, checkedValues) {
70
- if (!mutuallyExclusions || !checkedValues) return options;
71
- checkedValues = Array.isArray(checkedValues) ? checkedValues : [checkedValues];
70
+ if (!mutuallyExclusions || !Object.keys(mutuallyExclusions).length || !(checkedValues === null || checkedValues === void 0 ? void 0 : checkedValues.length)) return options;
72
71
  return options.map(function (_ref) {
73
- var _checkedValues;
74
-
75
72
  var value = _ref.value,
76
73
  rest = _objectWithoutProperties(_ref, _excluded);
77
74
 
78
75
  return _objectSpread(_objectSpread({}, rest), {}, {
79
76
  value: value,
80
- disabled: !!value && !!((_checkedValues = checkedValues) === null || _checkedValues === void 0 ? void 0 : _checkedValues.some(function (v) {
77
+ disabled: !!(value && (checkedValues === null || checkedValues === void 0 ? void 0 : checkedValues.some(function (v) {
81
78
  var _mutuallyExclusions$S, _mutuallyExclusions$v;
82
79
 
83
- return ((_mutuallyExclusions$S = mutuallyExclusions[String(v)]) === null || _mutuallyExclusions$S === void 0 ? void 0 : _mutuallyExclusions$S.includes(String(value))) || ((_mutuallyExclusions$v = mutuallyExclusions[value]) === null || _mutuallyExclusions$v === void 0 ? void 0 : _mutuallyExclusions$v.includes(String(v)));
84
- }))
80
+ return v !== value && (((_mutuallyExclusions$S = mutuallyExclusions[String(v)]) === null || _mutuallyExclusions$S === void 0 ? void 0 : _mutuallyExclusions$S.includes(String(value))) || ((_mutuallyExclusions$v = mutuallyExclusions[value]) === null || _mutuallyExclusions$v === void 0 ? void 0 : _mutuallyExclusions$v.includes(String(v))));
81
+ })))
85
82
  });
86
83
  });
87
84
  };
@@ -73,4 +73,4 @@ export declare const calcSelectValue: (selectValue?: FormItemSelectValue[] | und
73
73
  disabled: boolean | undefined;
74
74
  };
75
75
  export declare const calcShouldRender: (dependencies?: NamePath[], asserts?: FormItemAssert[], shouldRender?: ((form?: FormInstance<any> | undefined) => boolean) | undefined, form?: FormInstance<any> | undefined) => boolean;
76
- export declare const getRuleValidation: (url: string, rule: string | string[], values?: any, lang?: string | undefined) => Promise<any>;
76
+ export declare const getRuleValidation: (url: string, rule: string | string[], values?: any, lang?: string) => Promise<any>;
@@ -594,16 +594,20 @@ var calcShouldRender = function calcShouldRender() {
594
594
  exports.calcShouldRender = calcShouldRender;
595
595
 
596
596
  var getRuleValidation = /*#__PURE__*/function () {
597
- var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(url, rule, values, lang) {
598
- var _lang, _lang$split;
599
-
600
- var res, json, _ref4, conclusion, details;
597
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(url, rule, values) {
598
+ var lang,
599
+ res,
600
+ json,
601
+ _ref4,
602
+ conclusion,
603
+ details,
604
+ _args = arguments;
601
605
 
602
606
  return regeneratorRuntime.wrap(function _callee$(_context) {
603
607
  while (1) {
604
608
  switch (_context.prev = _context.next) {
605
609
  case 0:
606
- lang = ((_lang = lang) === null || _lang === void 0 ? void 0 : (_lang$split = _lang.split('-')) === null || _lang$split === void 0 ? void 0 : _lang$split[0]) || 'en';
610
+ lang = _args.length > 3 && _args[3] !== undefined ? _args[3] : 'en-US';
607
611
  _context.next = 3;
608
612
  return fetch("".concat(url, "?lang=").concat(lang), {
609
613
  method: 'post',
@@ -658,7 +662,7 @@ var getRuleValidation = /*#__PURE__*/function () {
658
662
  }, _callee);
659
663
  }));
660
664
 
661
- return function getRuleValidation(_x, _x2, _x3, _x4) {
665
+ return function getRuleValidation(_x, _x2, _x3) {
662
666
  return _ref3.apply(this, arguments);
663
667
  };
664
668
  }();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iglooform",
3
- "version": "2.5.49",
3
+ "version": "2.5.50",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "build-dev": "dumi build",