tntd 2.8.45 → 2.8.46

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 (185) hide show
  1. package/es/alert/alert.js +153 -0
  2. package/es/alert/alert.js.map +1 -0
  3. package/es/alert/alert.less +128 -0
  4. package/es/cascader/cascader.js +84 -0
  5. package/es/cascader/cascader.js.map +1 -0
  6. package/es/cascader/cascader.less +16 -0
  7. package/es/checkbox/check.png +0 -0
  8. package/es/checkbox/checkbox.js +100 -0
  9. package/es/checkbox/checkbox.js.map +1 -0
  10. package/es/checkbox/checkbox.less +69 -0
  11. package/es/date-picker/DatePicker.js +163 -0
  12. package/es/date-picker/DatePicker.js.map +1 -0
  13. package/es/date-picker/index.less +294 -0
  14. package/es/input-number/inputNumber.js +89 -0
  15. package/es/input-number/inputNumber.js.map +1 -0
  16. package/es/input-number/inputNumber.less +12 -0
  17. package/es/modal/index.less +36 -0
  18. package/es/modal/modal.js +5 -3
  19. package/es/modal/modal.js.map +1 -1
  20. package/es/modal/modal.less +16 -0
  21. package/es/popconfirm/index.less +32 -0
  22. package/es/popconfirm/popconfirm.js +96 -0
  23. package/es/popconfirm/popconfirm.js.map +1 -0
  24. package/es/popover/index.less +57 -0
  25. package/es/popover/popover.js +90 -0
  26. package/es/popover/popover.js.map +1 -0
  27. package/es/progress/progress.js +185 -0
  28. package/es/progress/progress.js.map +1 -0
  29. package/es/progress/progress.less +82 -0
  30. package/es/query-form/Field/Composition/FieldPopover.js +466 -0
  31. package/es/query-form/Field/Composition/FieldPopover.js.map +1 -0
  32. package/es/query-form/Field/Composition/FieldPopover.less +41 -0
  33. package/es/query-form/Field/Composition/Select.js +260 -0
  34. package/es/query-form/Field/Composition/Select.js.map +1 -0
  35. package/es/query-form/Field/Composition/SelectInput.js +112 -0
  36. package/es/query-form/Field/Composition/SelectInput.js.map +1 -0
  37. package/es/query-form/Field/Composition/ValueTag.js +241 -0
  38. package/es/query-form/Field/Composition/ValueTag.js.map +1 -0
  39. package/es/query-form/Field/Composition/index.js +448 -0
  40. package/es/query-form/Field/Composition/index.js.map +1 -0
  41. package/es/query-form/Field/Composition/index.less +167 -0
  42. package/es/query-form/Field/Composition/utils.js +173 -0
  43. package/es/query-form/Field/Composition/utils.js.map +1 -0
  44. package/es/query-form-backup/Field/Composition/FieldPopover.less +35 -0
  45. package/es/query-form-backup/Field/Composition/index.less +114 -0
  46. package/es/query-form-backup/index.less +90 -0
  47. package/es/query-form-v2/index.less +133 -0
  48. package/es/radio/radio.js +110 -0
  49. package/es/radio/radio.js.map +1 -0
  50. package/es/radio/radio.less +43 -0
  51. package/es/spin/spin.js +79 -0
  52. package/es/spin/spin.js.map +1 -0
  53. package/es/spin/spin.less +9 -0
  54. package/es/steps/assets/background_left.svg +12 -0
  55. package/es/steps/assets/background_right.svg +12 -0
  56. package/es/steps/assets/horizontal_line.svg +3 -0
  57. package/es/steps/assets/vertical_line.svg +3 -0
  58. package/es/steps/stepStyle/icon.less +51 -0
  59. package/es/steps/stepStyle/progress-dot.less +10 -0
  60. package/es/steps/stepStyle/variables.less +8 -0
  61. package/es/steps/stepStyle/vertical.less +41 -0
  62. package/es/switch/index.less +45 -0
  63. package/es/tabs/tabs.less +125 -0
  64. package/es/time-picker/TimePicker.js +90 -0
  65. package/es/time-picker/TimePicker.js.map +1 -0
  66. package/es/time-picker/index.less +38 -0
  67. package/es/tntd-action/Action.js +219 -0
  68. package/es/tntd-action/Action.js.map +1 -0
  69. package/es/tntd-action/index.less +61 -0
  70. package/es/tntd-select/index.less +7 -0
  71. package/lib/alert/alert.d.ts +12 -0
  72. package/lib/alert/alert.d.ts.map +1 -0
  73. package/lib/alert/alert.js +153 -0
  74. package/lib/alert/alert.js.map +1 -0
  75. package/lib/alert/alert.less +128 -0
  76. package/lib/cascader/cascader.d.ts +10 -0
  77. package/lib/cascader/cascader.d.ts.map +1 -0
  78. package/lib/cascader/cascader.js +84 -0
  79. package/lib/cascader/cascader.js.map +1 -0
  80. package/lib/cascader/cascader.less +16 -0
  81. package/lib/checkbox/check.png +0 -0
  82. package/lib/checkbox/checkbox.d.ts +16 -0
  83. package/lib/checkbox/checkbox.d.ts.map +1 -0
  84. package/lib/checkbox/checkbox.js +100 -0
  85. package/lib/checkbox/checkbox.js.map +1 -0
  86. package/lib/checkbox/checkbox.less +69 -0
  87. package/lib/date-picker/DatePicker.d.ts +21 -0
  88. package/lib/date-picker/DatePicker.d.ts.map +1 -0
  89. package/lib/date-picker/DatePicker.js +163 -0
  90. package/lib/date-picker/DatePicker.js.map +1 -0
  91. package/lib/date-picker/index.less +294 -0
  92. package/lib/input-number/inputNumber.d.ts +10 -0
  93. package/lib/input-number/inputNumber.d.ts.map +1 -0
  94. package/lib/input-number/inputNumber.js +89 -0
  95. package/lib/input-number/inputNumber.js.map +1 -0
  96. package/lib/input-number/inputNumber.less +12 -0
  97. package/lib/modal/index.less +36 -0
  98. package/lib/modal/modal.d.ts +1 -0
  99. package/lib/modal/modal.d.ts.map +1 -1
  100. package/lib/modal/modal.js +5 -3
  101. package/lib/modal/modal.js.map +1 -1
  102. package/lib/modal/modal.less +16 -0
  103. package/lib/popconfirm/index.less +32 -0
  104. package/lib/popconfirm/popconfirm.d.ts +8 -0
  105. package/lib/popconfirm/popconfirm.d.ts.map +1 -0
  106. package/lib/popconfirm/popconfirm.js +96 -0
  107. package/lib/popconfirm/popconfirm.js.map +1 -0
  108. package/lib/popover/index.less +57 -0
  109. package/lib/popover/popover.d.ts +14 -0
  110. package/lib/popover/popover.d.ts.map +1 -0
  111. package/lib/popover/popover.js +90 -0
  112. package/lib/popover/popover.js.map +1 -0
  113. package/lib/progress/progress.d.ts +12 -0
  114. package/lib/progress/progress.d.ts.map +1 -0
  115. package/lib/progress/progress.js +185 -0
  116. package/lib/progress/progress.js.map +1 -0
  117. package/lib/progress/progress.less +82 -0
  118. package/lib/query-form/Field/Composition/FieldPopover.d.ts +19 -0
  119. package/lib/query-form/Field/Composition/FieldPopover.d.ts.map +1 -0
  120. package/lib/query-form/Field/Composition/FieldPopover.js +466 -0
  121. package/lib/query-form/Field/Composition/FieldPopover.js.map +1 -0
  122. package/lib/query-form/Field/Composition/FieldPopover.less +41 -0
  123. package/lib/query-form/Field/Composition/Select.d.ts +4 -0
  124. package/lib/query-form/Field/Composition/Select.d.ts.map +1 -0
  125. package/lib/query-form/Field/Composition/Select.js +260 -0
  126. package/lib/query-form/Field/Composition/Select.js.map +1 -0
  127. package/lib/query-form/Field/Composition/SelectInput.d.ts +3 -0
  128. package/lib/query-form/Field/Composition/SelectInput.d.ts.map +1 -0
  129. package/lib/query-form/Field/Composition/SelectInput.js +112 -0
  130. package/lib/query-form/Field/Composition/SelectInput.js.map +1 -0
  131. package/lib/query-form/Field/Composition/ValueTag.d.ts +13 -0
  132. package/lib/query-form/Field/Composition/ValueTag.d.ts.map +1 -0
  133. package/lib/query-form/Field/Composition/ValueTag.js +241 -0
  134. package/lib/query-form/Field/Composition/ValueTag.js.map +1 -0
  135. package/lib/query-form/Field/Composition/index.d.ts +15 -0
  136. package/lib/query-form/Field/Composition/index.d.ts.map +1 -0
  137. package/lib/query-form/Field/Composition/index.js +448 -0
  138. package/lib/query-form/Field/Composition/index.js.map +1 -0
  139. package/lib/query-form/Field/Composition/index.less +167 -0
  140. package/lib/query-form/Field/Composition/utils.d.ts +21 -0
  141. package/lib/query-form/Field/Composition/utils.d.ts.map +1 -0
  142. package/lib/query-form/Field/Composition/utils.js +173 -0
  143. package/lib/query-form/Field/Composition/utils.js.map +1 -0
  144. package/lib/query-form-backup/Field/Composition/FieldPopover.less +35 -0
  145. package/lib/query-form-backup/Field/Composition/index.less +114 -0
  146. package/lib/query-form-backup/index.less +90 -0
  147. package/lib/query-form-v2/index.less +133 -0
  148. package/lib/radio/radio.d.ts +17 -0
  149. package/lib/radio/radio.d.ts.map +1 -0
  150. package/lib/radio/radio.js +110 -0
  151. package/lib/radio/radio.js.map +1 -0
  152. package/lib/radio/radio.less +43 -0
  153. package/lib/spin/spin.d.ts +9 -0
  154. package/lib/spin/spin.d.ts.map +1 -0
  155. package/lib/spin/spin.js +79 -0
  156. package/lib/spin/spin.js.map +1 -0
  157. package/lib/spin/spin.less +9 -0
  158. package/lib/steps/assets/background_left.svg +12 -0
  159. package/lib/steps/assets/background_right.svg +12 -0
  160. package/lib/steps/assets/horizontal_line.svg +3 -0
  161. package/lib/steps/assets/vertical_line.svg +3 -0
  162. package/lib/steps/stepStyle/icon.less +51 -0
  163. package/lib/steps/stepStyle/progress-dot.less +10 -0
  164. package/lib/steps/stepStyle/variables.less +8 -0
  165. package/lib/steps/stepStyle/vertical.less +41 -0
  166. package/lib/switch/index.less +45 -0
  167. package/lib/tabs/tabs.less +125 -0
  168. package/lib/time-picker/TimePicker.d.ts +9 -0
  169. package/lib/time-picker/TimePicker.d.ts.map +1 -0
  170. package/lib/time-picker/TimePicker.js +90 -0
  171. package/lib/time-picker/TimePicker.js.map +1 -0
  172. package/lib/time-picker/index.less +38 -0
  173. package/lib/tntd-action/Action.d.ts +6 -0
  174. package/lib/tntd-action/Action.d.ts.map +1 -0
  175. package/lib/tntd-action/Action.js +219 -0
  176. package/lib/tntd-action/Action.js.map +1 -0
  177. package/lib/tntd-action/index.less +61 -0
  178. package/lib/tntd-select/index.less +7 -0
  179. package/package.json +2 -2
  180. package/es/array-input/utils.js +0 -414
  181. package/es/array-input/utils.js.map +0 -1
  182. package/lib/array-input/utils.d.ts +0 -2
  183. package/lib/array-input/utils.d.ts.map +0 -1
  184. package/lib/array-input/utils.js +0 -414
  185. package/lib/array-input/utils.js.map +0 -1
@@ -1,414 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(o) {
4
- "@babel/helpers - typeof";
5
-
6
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
7
- return typeof o;
8
- } : function (o) {
9
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
10
- }, _typeof(o);
11
- }
12
- Object.defineProperty(exports, "__esModule", {
13
- value: true
14
- });
15
- exports.validateRules = validateRules;
16
- var _isObject2 = _interopRequireDefault(require("lodash/isObject"));
17
- var _isNil2 = _interopRequireDefault(require("lodash/isNil"));
18
- var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
19
- function _interopRequireDefault(obj) {
20
- return obj && obj.__esModule ? obj : {
21
- "default": obj
22
- };
23
- }
24
- function _regeneratorRuntime() {
25
- "use strict";
26
-
27
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
28
- _regeneratorRuntime = function _regeneratorRuntime() {
29
- return e;
30
- };
31
- var t,
32
- e = {},
33
- r = Object.prototype,
34
- n = r.hasOwnProperty,
35
- o = Object.defineProperty || function (t, e, r) {
36
- t[e] = r.value;
37
- },
38
- i = "function" == typeof Symbol ? Symbol : {},
39
- a = i.iterator || "@@iterator",
40
- c = i.asyncIterator || "@@asyncIterator",
41
- u = i.toStringTag || "@@toStringTag";
42
- function define(t, e, r) {
43
- return Object.defineProperty(t, e, {
44
- value: r,
45
- enumerable: !0,
46
- configurable: !0,
47
- writable: !0
48
- }), t[e];
49
- }
50
- try {
51
- define({}, "");
52
- } catch (t) {
53
- define = function define(t, e, r) {
54
- return t[e] = r;
55
- };
56
- }
57
- function wrap(t, e, r, n) {
58
- var i = e && e.prototype instanceof Generator ? e : Generator,
59
- a = Object.create(i.prototype),
60
- c = new Context(n || []);
61
- return o(a, "_invoke", {
62
- value: makeInvokeMethod(t, r, c)
63
- }), a;
64
- }
65
- function tryCatch(t, e, r) {
66
- try {
67
- return {
68
- type: "normal",
69
- arg: t.call(e, r)
70
- };
71
- } catch (t) {
72
- return {
73
- type: "throw",
74
- arg: t
75
- };
76
- }
77
- }
78
- e.wrap = wrap;
79
- var h = "suspendedStart",
80
- l = "suspendedYield",
81
- f = "executing",
82
- s = "completed",
83
- y = {};
84
- function Generator() {}
85
- function GeneratorFunction() {}
86
- function GeneratorFunctionPrototype() {}
87
- var p = {};
88
- define(p, a, function () {
89
- return this;
90
- });
91
- var d = Object.getPrototypeOf,
92
- v = d && d(d(values([])));
93
- v && v !== r && n.call(v, a) && (p = v);
94
- var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
95
- function defineIteratorMethods(t) {
96
- ["next", "throw", "return"].forEach(function (e) {
97
- define(t, e, function (t) {
98
- return this._invoke(e, t);
99
- });
100
- });
101
- }
102
- function AsyncIterator(t, e) {
103
- function invoke(r, o, i, a) {
104
- var c = tryCatch(t[r], t, o);
105
- if ("throw" !== c.type) {
106
- var u = c.arg,
107
- h = u.value;
108
- return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
109
- invoke("next", t, i, a);
110
- }, function (t) {
111
- invoke("throw", t, i, a);
112
- }) : e.resolve(h).then(function (t) {
113
- u.value = t, i(u);
114
- }, function (t) {
115
- return invoke("throw", t, i, a);
116
- });
117
- }
118
- a(c.arg);
119
- }
120
- var r;
121
- o(this, "_invoke", {
122
- value: function value(t, n) {
123
- function callInvokeWithMethodAndArg() {
124
- return new e(function (e, r) {
125
- invoke(t, n, e, r);
126
- });
127
- }
128
- return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
129
- }
130
- });
131
- }
132
- function makeInvokeMethod(e, r, n) {
133
- var o = h;
134
- return function (i, a) {
135
- if (o === f) throw Error("Generator is already running");
136
- if (o === s) {
137
- if ("throw" === i) throw a;
138
- return {
139
- value: t,
140
- done: !0
141
- };
142
- }
143
- for (n.method = i, n.arg = a;;) {
144
- var c = n.delegate;
145
- if (c) {
146
- var u = maybeInvokeDelegate(c, n);
147
- if (u) {
148
- if (u === y) continue;
149
- return u;
150
- }
151
- }
152
- if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
153
- if (o === h) throw o = s, n.arg;
154
- n.dispatchException(n.arg);
155
- } else "return" === n.method && n.abrupt("return", n.arg);
156
- o = f;
157
- var p = tryCatch(e, r, n);
158
- if ("normal" === p.type) {
159
- if (o = n.done ? s : l, p.arg === y) continue;
160
- return {
161
- value: p.arg,
162
- done: n.done
163
- };
164
- }
165
- "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
166
- }
167
- };
168
- }
169
- function maybeInvokeDelegate(e, r) {
170
- var n = r.method,
171
- o = e.iterator[n];
172
- if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
173
- var i = tryCatch(o, e.iterator, r.arg);
174
- if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
175
- var a = i.arg;
176
- return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
177
- }
178
- function pushTryEntry(t) {
179
- var e = {
180
- tryLoc: t[0]
181
- };
182
- 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
183
- }
184
- function resetTryEntry(t) {
185
- var e = t.completion || {};
186
- e.type = "normal", delete e.arg, t.completion = e;
187
- }
188
- function Context(t) {
189
- this.tryEntries = [{
190
- tryLoc: "root"
191
- }], t.forEach(pushTryEntry, this), this.reset(!0);
192
- }
193
- function values(e) {
194
- if (e || "" === e) {
195
- var r = e[a];
196
- if (r) return r.call(e);
197
- if ("function" == typeof e.next) return e;
198
- if (!isNaN(e.length)) {
199
- var o = -1,
200
- i = function next() {
201
- for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
202
- return next.value = t, next.done = !0, next;
203
- };
204
- return i.next = i;
205
- }
206
- }
207
- throw new TypeError(_typeof(e) + " is not iterable");
208
- }
209
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
210
- value: GeneratorFunctionPrototype,
211
- configurable: !0
212
- }), o(GeneratorFunctionPrototype, "constructor", {
213
- value: GeneratorFunction,
214
- configurable: !0
215
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
216
- var e = "function" == typeof t && t.constructor;
217
- return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
218
- }, e.mark = function (t) {
219
- return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
220
- }, e.awrap = function (t) {
221
- return {
222
- __await: t
223
- };
224
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
225
- return this;
226
- }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
227
- void 0 === i && (i = Promise);
228
- var a = new AsyncIterator(wrap(t, r, n, o), i);
229
- return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
230
- return t.done ? t.value : a.next();
231
- });
232
- }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
233
- return this;
234
- }), define(g, "toString", function () {
235
- return "[object Generator]";
236
- }), e.keys = function (t) {
237
- var e = Object(t),
238
- r = [];
239
- for (var n in e) r.push(n);
240
- return r.reverse(), function next() {
241
- for (; r.length;) {
242
- var t = r.pop();
243
- if (t in e) return next.value = t, next.done = !1, next;
244
- }
245
- return next.done = !0, next;
246
- };
247
- }, e.values = values, Context.prototype = {
248
- constructor: Context,
249
- reset: function reset(e) {
250
- if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
251
- },
252
- stop: function stop() {
253
- this.done = !0;
254
- var t = this.tryEntries[0].completion;
255
- if ("throw" === t.type) throw t.arg;
256
- return this.rval;
257
- },
258
- dispatchException: function dispatchException(e) {
259
- if (this.done) throw e;
260
- var r = this;
261
- function handle(n, o) {
262
- return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
263
- }
264
- for (var o = this.tryEntries.length - 1; o >= 0; --o) {
265
- var i = this.tryEntries[o],
266
- a = i.completion;
267
- if ("root" === i.tryLoc) return handle("end");
268
- if (i.tryLoc <= this.prev) {
269
- var c = n.call(i, "catchLoc"),
270
- u = n.call(i, "finallyLoc");
271
- if (c && u) {
272
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
273
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
274
- } else if (c) {
275
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
276
- } else {
277
- if (!u) throw Error("try statement without catch or finally");
278
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
279
- }
280
- }
281
- }
282
- },
283
- abrupt: function abrupt(t, e) {
284
- for (var r = this.tryEntries.length - 1; r >= 0; --r) {
285
- var o = this.tryEntries[r];
286
- if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
287
- var i = o;
288
- break;
289
- }
290
- }
291
- i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
292
- var a = i ? i.completion : {};
293
- return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
294
- },
295
- complete: function complete(t, e) {
296
- if ("throw" === t.type) throw t.arg;
297
- return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
298
- },
299
- finish: function finish(t) {
300
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
301
- var r = this.tryEntries[e];
302
- if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
303
- }
304
- },
305
- "catch": function _catch(t) {
306
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
307
- var r = this.tryEntries[e];
308
- if (r.tryLoc === t) {
309
- var n = r.completion;
310
- if ("throw" === n.type) {
311
- var o = n.arg;
312
- resetTryEntry(r);
313
- }
314
- return o;
315
- }
316
- }
317
- throw Error("illegal catch attempt");
318
- },
319
- delegateYield: function delegateYield(e, r, n) {
320
- return this.delegate = {
321
- iterator: values(e),
322
- resultName: r,
323
- nextLoc: n
324
- }, "next" === this.method && (this.arg = t), y;
325
- }
326
- }, e;
327
- }
328
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
329
- try {
330
- var info = gen[key](arg);
331
- var value = info.value;
332
- } catch (error) {
333
- reject(error);
334
- return;
335
- }
336
- if (info.done) {
337
- resolve(value);
338
- } else {
339
- Promise.resolve(value).then(_next, _throw);
340
- }
341
- }
342
- function _asyncToGenerator(fn) {
343
- return function () {
344
- var self = this,
345
- args = arguments;
346
- return new Promise(function (resolve, reject) {
347
- var gen = fn.apply(self, args);
348
- function _next(value) {
349
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
350
- }
351
- function _throw(err) {
352
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
353
- }
354
- _next(undefined);
355
- });
356
- };
357
- }
358
- function validateRules(rules, value) {
359
- return new Promise( /*#__PURE__*/function () {
360
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resolve) {
361
- var i, rule, meg;
362
- return _regeneratorRuntime().wrap(function _callee$(_context) {
363
- while (1) switch (_context.prev = _context.next) {
364
- case 0:
365
- i = 0;
366
- case 1:
367
- if (!(i < rules.length)) {
368
- _context.next = 17;
369
- break;
370
- }
371
- rule = rules[i];
372
- if (!((0, _isObject2["default"])(rule) && rule.required)) {
373
- _context.next = 8;
374
- break;
375
- }
376
- if (!((0, _isNil2["default"])(value) || value === '')) {
377
- _context.next = 6;
378
- break;
379
- }
380
- return _context.abrupt("return", resolve(rule.message));
381
- case 6:
382
- _context.next = 14;
383
- break;
384
- case 8:
385
- if (!(0, _isFunction2["default"])(rule)) {
386
- _context.next = 14;
387
- break;
388
- }
389
- _context.next = 11;
390
- return rule(value);
391
- case 11:
392
- meg = _context.sent;
393
- if (!meg) {
394
- _context.next = 14;
395
- break;
396
- }
397
- return _context.abrupt("return", resolve(meg));
398
- case 14:
399
- i++;
400
- _context.next = 1;
401
- break;
402
- case 17:
403
- resolve(false);
404
- case 18:
405
- case "end":
406
- return _context.stop();
407
- }
408
- }, _callee);
409
- }));
410
- return function (_x) {
411
- return _ref.apply(this, arguments);
412
- };
413
- }());
414
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/array-input/utils.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAEpD,MAAM,UAAU,aAAa,CAAC,KAAK,EAAE,KAAK;IACxC,OAAO,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACrC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;YACrB,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACnC,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,EAAE,EAAE;oBAChC,OAAO,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;iBAC7B;aACF;iBAAM,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE;gBAC3B,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,CAAA;gBAC7B,IAAI,GAAG,EAAE;oBACP,OAAO,OAAO,CAAC,GAAG,CAAC,CAAA;iBACpB;aACF;SACF;QACD,OAAO,CAAC,KAAK,CAAC,CAAA;IAChB,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { isFunction, isNil, isObject } from 'lodash'\n\nexport function validateRules(rules, value) {\n return new Promise(async (resolve) => {\n for (let i = 0; i < rules.length; i++) {\n const rule = rules[i]\n if (isObject(rule) && rule.required) {\n if (isNil(value) || value === '') {\n return resolve(rule.message)\n }\n } else if (isFunction(rule)) {\n const meg = await rule(value)\n if (meg) {\n return resolve(meg)\n }\n }\n }\n resolve(false)\n })\n}\n"]}
@@ -1,2 +0,0 @@
1
- export function validateRules(rules: any, value: any): Promise<any>;
2
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/array-input/utils.js"],"names":[],"mappings":"AAEA,oEAiBC"}