dinocollab-core 1.0.2 → 1.0.4

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 (101) hide show
  1. package/dist/_virtual/_rollupPluginBabelHelpers.js +1 -487
  2. package/dist/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
  3. package/dist/api-context/alert-global.js +1 -165
  4. package/dist/api-context/alert-global.js.map +1 -1
  5. package/dist/api-context/drawer-global.js +1 -111
  6. package/dist/api-context/drawer-global.js.map +1 -1
  7. package/dist/api-context/global-modal.js +1 -94
  8. package/dist/api-context/global-modal.js.map +1 -1
  9. package/dist/api-context/popover-global.js +1 -109
  10. package/dist/api-context/popover-global.js.map +1 -1
  11. package/dist/api-context/popover.js +1 -93
  12. package/dist/api-context/popover.js.map +1 -1
  13. package/dist/api-context/ui.units.js +1 -22
  14. package/dist/api-context/ui.units.js.map +1 -1
  15. package/dist/components/breadcrumbs.js +1 -64
  16. package/dist/components/breadcrumbs.js.map +1 -1
  17. package/dist/components/copy-to-clipboard.js +1 -111
  18. package/dist/components/copy-to-clipboard.js.map +1 -1
  19. package/dist/components/help-tooltip.js +1 -103
  20. package/dist/components/help-tooltip.js.map +1 -1
  21. package/dist/components/image-with-fallback.js +1 -50
  22. package/dist/components/image-with-fallback.js.map +1 -1
  23. package/dist/components/text-editor.js +1 -117
  24. package/dist/components/text-editor.js.map +1 -1
  25. package/dist/components/text-editor.preview.js +1 -26
  26. package/dist/components/text-editor.preview.js.map +1 -1
  27. package/dist/form/create.autocomplete.chips.js +1 -227
  28. package/dist/form/create.autocomplete.chips.js.map +1 -1
  29. package/dist/form/create.date-expired.js +1 -210
  30. package/dist/form/create.date-expired.js.map +1 -1
  31. package/dist/form/create.date-picker.js +1 -127
  32. package/dist/form/create.date-picker.js.map +1 -1
  33. package/dist/form/create.form-base.js +1 -140
  34. package/dist/form/create.form-base.js.map +1 -1
  35. package/dist/form/create.form-comfirm.js +1 -130
  36. package/dist/form/create.form-comfirm.js.map +1 -1
  37. package/dist/form/create.form-grid-layout.js +1 -187
  38. package/dist/form/create.form-grid-layout.js.map +1 -1
  39. package/dist/form/create.form-grid-layout.units.js +1 -41
  40. package/dist/form/create.form-grid-layout.units.js.map +1 -1
  41. package/dist/form/create.input.file.js +1 -78
  42. package/dist/form/create.input.file.js.map +1 -1
  43. package/dist/form/create.input.js +1 -275
  44. package/dist/form/create.input.js.map +1 -1
  45. package/dist/form/create.select-simple.js +1 -113
  46. package/dist/form/create.select-simple.js.map +1 -1
  47. package/dist/form/create.select-with-api.js +1 -276
  48. package/dist/form/create.select-with-api.js.map +1 -1
  49. package/dist/form/create.text-editor.js +1 -180
  50. package/dist/form/create.text-editor.js.map +1 -1
  51. package/dist/form/dino-form.js +1 -40
  52. package/dist/form/dino-form.js.map +1 -1
  53. package/dist/form/helper.js +1 -156
  54. package/dist/form/helper.js.map +1 -1
  55. package/dist/form/modal-wrapper.js +1 -81
  56. package/dist/form/modal-wrapper.js.map +1 -1
  57. package/dist/form/validator.js +1 -189
  58. package/dist/form/validator.js.map +1 -1
  59. package/dist/hooks/index.js +1 -47
  60. package/dist/hooks/index.js.map +1 -1
  61. package/dist/index.js +1 -32
  62. package/dist/index.js.map +1 -1
  63. package/dist/redux/create.hoc-lazy.js +1 -70
  64. package/dist/redux/create.hoc-lazy.js.map +1 -1
  65. package/dist/redux/dino.js +1 -10
  66. package/dist/redux/dino.js.map +1 -1
  67. package/dist/redux/types.js +1 -8
  68. package/dist/redux/types.js.map +1 -1
  69. package/dist/redux/ui.error-page.js +1 -88
  70. package/dist/redux/ui.error-page.js.map +1 -1
  71. package/dist/redux/vector-404.webp.js +1 -3
  72. package/dist/redux/vector-404.webp.js.map +1 -1
  73. package/dist/table/context.js +1 -14
  74. package/dist/table/context.js.map +1 -1
  75. package/dist/table/create.action-row.js +1 -143
  76. package/dist/table/create.action-row.js.map +1 -1
  77. package/dist/table/create.table.js +1 -245
  78. package/dist/table/create.table.js.map +1 -1
  79. package/dist/table/custom.filter-operators.js +1 -88
  80. package/dist/table/custom.filter-operators.js.map +1 -1
  81. package/dist/table/dino.js +1 -135
  82. package/dist/table/dino.js.map +1 -1
  83. package/dist/table/helpers.js +1 -114
  84. package/dist/table/helpers.js.map +1 -1
  85. package/dist/table/model-filter.js +1 -22
  86. package/dist/table/model-filter.js.map +1 -1
  87. package/dist/table/toolbar-pannel.js +1 -142
  88. package/dist/table/toolbar-pannel.js.map +1 -1
  89. package/dist/table/ui.buttons.js +1 -66
  90. package/dist/table/ui.buttons.js.map +1 -1
  91. package/dist/table/ui.units.js +1 -247
  92. package/dist/table/ui.units.js.map +1 -1
  93. package/dist/utils/dayjs-config.js +1 -11
  94. package/dist/utils/dayjs-config.js.map +1 -1
  95. package/dist/utils/helpers.js +1 -198
  96. package/dist/utils/helpers.js.map +1 -1
  97. package/dist/utils/json-object.js +1 -37
  98. package/dist/utils/json-object.js.map +1 -1
  99. package/dist/utils/query-param.js +1 -171
  100. package/dist/utils/query-param.js.map +1 -1
  101. package/package.json +2 -2
@@ -1,488 +1,2 @@
1
- function _arrayLikeToArray(r, a) {
2
- (null == a || a > r.length) && (a = r.length);
3
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
4
- return n;
5
- }
6
- function _arrayWithHoles(r) {
7
- if (Array.isArray(r)) return r;
8
- }
9
- function _arrayWithoutHoles(r) {
10
- if (Array.isArray(r)) return _arrayLikeToArray(r);
11
- }
12
- function _assertThisInitialized(e) {
13
- if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
14
- return e;
15
- }
16
- function asyncGeneratorStep(n, t, e, r, o, a, c) {
17
- try {
18
- var i = n[a](c),
19
- u = i.value;
20
- } catch (n) {
21
- return void e(n);
22
- }
23
- i.done ? t(u) : Promise.resolve(u).then(r, o);
24
- }
25
- function _asyncToGenerator(n) {
26
- return function () {
27
- var t = this,
28
- e = arguments;
29
- return new Promise(function (r, o) {
30
- var a = n.apply(t, e);
31
- function _next(n) {
32
- asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
33
- }
34
- function _throw(n) {
35
- asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
36
- }
37
- _next(void 0);
38
- });
39
- };
40
- }
41
- function _callSuper(t, o, e) {
42
- return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
43
- }
44
- function _classCallCheck(a, n) {
45
- if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
46
- }
47
- function _defineProperties(e, r) {
48
- for (var t = 0; t < r.length; t++) {
49
- var o = r[t];
50
- o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey(o.key), o);
51
- }
52
- }
53
- function _createClass(e, r, t) {
54
- return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
55
- writable: false
56
- }), e;
57
- }
58
- function _defineProperty(e, r, t) {
59
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
60
- value: t,
61
- enumerable: true,
62
- configurable: true,
63
- writable: true
64
- }) : e[r] = t, e;
65
- }
66
- function _getPrototypeOf(t) {
67
- return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
68
- return t.__proto__ || Object.getPrototypeOf(t);
69
- }, _getPrototypeOf(t);
70
- }
71
- function _inherits(t, e) {
72
- if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
73
- t.prototype = Object.create(e && e.prototype, {
74
- constructor: {
75
- value: t,
76
- writable: true,
77
- configurable: true
78
- }
79
- }), Object.defineProperty(t, "prototype", {
80
- writable: false
81
- }), e && _setPrototypeOf(t, e);
82
- }
83
- function _isNativeReflectConstruct() {
84
- try {
85
- var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
86
- } catch (t) {}
87
- return (_isNativeReflectConstruct = function () {
88
- return !!t;
89
- })();
90
- }
91
- function _iterableToArray(r) {
92
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
93
- }
94
- function _iterableToArrayLimit(r, l) {
95
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
96
- if (null != t) {
97
- var e,
98
- n,
99
- i,
100
- u,
101
- a = [],
102
- f = true,
103
- o = false;
104
- try {
105
- if (i = (t = t.call(r)).next, 0 === l) {
106
- if (Object(t) !== t) return;
107
- f = !1;
108
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
109
- } catch (r) {
110
- o = true, n = r;
111
- } finally {
112
- try {
113
- if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
114
- } finally {
115
- if (o) throw n;
116
- }
117
- }
118
- return a;
119
- }
120
- }
121
- function _nonIterableRest() {
122
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
123
- }
124
- function _nonIterableSpread() {
125
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
126
- }
127
- function ownKeys(e, r) {
128
- var t = Object.keys(e);
129
- if (Object.getOwnPropertySymbols) {
130
- var o = Object.getOwnPropertySymbols(e);
131
- r && (o = o.filter(function (r) {
132
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
133
- })), t.push.apply(t, o);
134
- }
135
- return t;
136
- }
137
- function _objectSpread2(e) {
138
- for (var r = 1; r < arguments.length; r++) {
139
- var t = null != arguments[r] ? arguments[r] : {};
140
- r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
141
- _defineProperty(e, r, t[r]);
142
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
143
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
144
- });
145
- }
146
- return e;
147
- }
148
- function _objectWithoutProperties(e, t) {
149
- if (null == e) return {};
150
- var o,
151
- r,
152
- i = _objectWithoutPropertiesLoose(e, t);
153
- if (Object.getOwnPropertySymbols) {
154
- var n = Object.getOwnPropertySymbols(e);
155
- for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
156
- }
157
- return i;
158
- }
159
- function _objectWithoutPropertiesLoose(r, e) {
160
- if (null == r) return {};
161
- var t = {};
162
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
163
- if (-1 !== e.indexOf(n)) continue;
164
- t[n] = r[n];
165
- }
166
- return t;
167
- }
168
- function _possibleConstructorReturn(t, e) {
169
- if (e && ("object" == typeof e || "function" == typeof e)) return e;
170
- if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
171
- return _assertThisInitialized(t);
172
- }
173
- function _regeneratorRuntime() {
174
- _regeneratorRuntime = function () {
175
- return r;
176
- };
177
- var t,
178
- r = {},
179
- e = Object.prototype,
180
- n = e.hasOwnProperty,
181
- o = "function" == typeof Symbol ? Symbol : {},
182
- i = o.iterator || "@@iterator",
183
- a = o.asyncIterator || "@@asyncIterator",
184
- u = o.toStringTag || "@@toStringTag";
185
- function c(t, r, e, n) {
186
- return Object.defineProperty(t, r, {
187
- value: e,
188
- enumerable: !n,
189
- configurable: !n,
190
- writable: !n
191
- });
192
- }
193
- try {
194
- c({}, "");
195
- } catch (t) {
196
- c = function (t, r, e) {
197
- return t[r] = e;
198
- };
199
- }
200
- function h(r, e, n, o) {
201
- var i = e && e.prototype instanceof Generator ? e : Generator,
202
- a = Object.create(i.prototype);
203
- return c(a, "_invoke", function (r, e, n) {
204
- var o = 1;
205
- return function (i, a) {
206
- if (3 === o) throw Error("Generator is already running");
207
- if (4 === o) {
208
- if ("throw" === i) throw a;
209
- return {
210
- value: t,
211
- done: true
212
- };
213
- }
214
- for (n.method = i, n.arg = a;;) {
215
- var u = n.delegate;
216
- if (u) {
217
- var c = d(u, n);
218
- if (c) {
219
- if (c === f) continue;
220
- return c;
221
- }
222
- }
223
- if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
224
- if (1 === o) throw o = 4, n.arg;
225
- n.dispatchException(n.arg);
226
- } else "return" === n.method && n.abrupt("return", n.arg);
227
- o = 3;
228
- var h = s(r, e, n);
229
- if ("normal" === h.type) {
230
- if (o = n.done ? 4 : 2, h.arg === f) continue;
231
- return {
232
- value: h.arg,
233
- done: n.done
234
- };
235
- }
236
- "throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg);
237
- }
238
- };
239
- }(r, n, new Context(o || [])), true), a;
240
- }
241
- function s(t, r, e) {
242
- try {
243
- return {
244
- type: "normal",
245
- arg: t.call(r, e)
246
- };
247
- } catch (t) {
248
- return {
249
- type: "throw",
250
- arg: t
251
- };
252
- }
253
- }
254
- r.wrap = h;
255
- var f = {};
256
- function Generator() {}
257
- function GeneratorFunction() {}
258
- function GeneratorFunctionPrototype() {}
259
- var l = {};
260
- c(l, i, function () {
261
- return this;
262
- });
263
- var p = Object.getPrototypeOf,
264
- y = p && p(p(x([])));
265
- y && y !== e && n.call(y, i) && (l = y);
266
- var v = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(l);
267
- function g(t) {
268
- ["next", "throw", "return"].forEach(function (r) {
269
- c(t, r, function (t) {
270
- return this._invoke(r, t);
271
- });
272
- });
273
- }
274
- function AsyncIterator(t, r) {
275
- function e(o, i, a, u) {
276
- var c = s(t[o], t, i);
277
- if ("throw" !== c.type) {
278
- var h = c.arg,
279
- f = h.value;
280
- return f && "object" == typeof f && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) {
281
- e("next", t, a, u);
282
- }, function (t) {
283
- e("throw", t, a, u);
284
- }) : r.resolve(f).then(function (t) {
285
- h.value = t, a(h);
286
- }, function (t) {
287
- return e("throw", t, a, u);
288
- });
289
- }
290
- u(c.arg);
291
- }
292
- var o;
293
- c(this, "_invoke", function (t, n) {
294
- function i() {
295
- return new r(function (r, o) {
296
- e(t, n, r, o);
297
- });
298
- }
299
- return o = o ? o.then(i, i) : i();
300
- }, true);
301
- }
302
- function d(r, e) {
303
- var n = e.method,
304
- o = r.i[n];
305
- if (o === t) return e.delegate = null, "throw" === n && r.i.return && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f;
306
- var i = s(o, r.i, e.arg);
307
- if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f;
308
- var a = i.arg;
309
- return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f);
310
- }
311
- function w(t) {
312
- this.tryEntries.push(t);
313
- }
314
- function m(r) {
315
- var e = r[4] || {};
316
- e.type = "normal", e.arg = t, r[4] = e;
317
- }
318
- function Context(t) {
319
- this.tryEntries = [[-1]], t.forEach(w, this), this.reset(true);
320
- }
321
- function x(r) {
322
- if (null != r) {
323
- var e = r[i];
324
- if (e) return e.call(r);
325
- if ("function" == typeof r.next) return r;
326
- if (!isNaN(r.length)) {
327
- var o = -1,
328
- a = function e() {
329
- for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = false, e;
330
- return e.value = t, e.done = true, e;
331
- };
332
- return a.next = a;
333
- }
334
- }
335
- throw new TypeError(typeof r + " is not iterable");
336
- }
337
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = c(GeneratorFunctionPrototype, u, "GeneratorFunction"), r.isGeneratorFunction = function (t) {
338
- var r = "function" == typeof t && t.constructor;
339
- return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name));
340
- }, r.mark = function (t) {
341
- return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = Object.create(v), t;
342
- }, r.awrap = function (t) {
343
- return {
344
- __await: t
345
- };
346
- }, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () {
347
- return this;
348
- }), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) {
349
- void 0 === i && (i = Promise);
350
- var a = new AsyncIterator(h(t, e, n, o), i);
351
- return r.isGeneratorFunction(e) ? a : a.next().then(function (t) {
352
- return t.done ? t.value : a.next();
353
- });
354
- }, g(v), c(v, u, "Generator"), c(v, i, function () {
355
- return this;
356
- }), c(v, "toString", function () {
357
- return "[object Generator]";
358
- }), r.keys = function (t) {
359
- var r = Object(t),
360
- e = [];
361
- for (var n in r) e.unshift(n);
362
- return function t() {
363
- for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = false, t;
364
- return t.done = true, t;
365
- };
366
- }, r.values = x, Context.prototype = {
367
- constructor: Context,
368
- reset: function (r) {
369
- if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = false, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = t);
370
- },
371
- stop: function () {
372
- this.done = true;
373
- var t = this.tryEntries[0][4];
374
- if ("throw" === t.type) throw t.arg;
375
- return this.rval;
376
- },
377
- dispatchException: function (r) {
378
- if (this.done) throw r;
379
- var e = this;
380
- function n(t) {
381
- a.type = "throw", a.arg = r, e.next = t;
382
- }
383
- for (var o = e.tryEntries.length - 1; o >= 0; --o) {
384
- var i = this.tryEntries[o],
385
- a = i[4],
386
- u = this.prev,
387
- c = i[1],
388
- h = i[2];
389
- if (-1 === i[0]) return n("end"), false;
390
- if (!c && !h) throw Error("try statement without catch or finally");
391
- if (null != i[0] && i[0] <= u) {
392
- if (u < c) return this.method = "next", this.arg = t, n(c), true;
393
- if (u < h) return n(h), false;
394
- }
395
- }
396
- },
397
- abrupt: function (t, r) {
398
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
399
- var n = this.tryEntries[e];
400
- if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) {
401
- var o = n;
402
- break;
403
- }
404
- }
405
- o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null);
406
- var i = o ? o[4] : {};
407
- return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i);
408
- },
409
- complete: function (t, r) {
410
- if ("throw" === t.type) throw t.arg;
411
- 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 && r && (this.next = r), f;
412
- },
413
- finish: function (t) {
414
- for (var r = this.tryEntries.length - 1; r >= 0; --r) {
415
- var e = this.tryEntries[r];
416
- if (e[2] === t) return this.complete(e[4], e[3]), m(e), f;
417
- }
418
- },
419
- catch: function (t) {
420
- for (var r = this.tryEntries.length - 1; r >= 0; --r) {
421
- var e = this.tryEntries[r];
422
- if (e[0] === t) {
423
- var n = e[4];
424
- if ("throw" === n.type) {
425
- var o = n.arg;
426
- m(e);
427
- }
428
- return o;
429
- }
430
- }
431
- throw Error("illegal catch attempt");
432
- },
433
- delegateYield: function (r, e, n) {
434
- return this.delegate = {
435
- i: x(r),
436
- r: e,
437
- n: n
438
- }, "next" === this.method && (this.arg = t), f;
439
- }
440
- }, r;
441
- }
442
- function _setPrototypeOf(t, e) {
443
- return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
444
- return t.__proto__ = e, t;
445
- }, _setPrototypeOf(t, e);
446
- }
447
- function _slicedToArray(r, e) {
448
- return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
449
- }
450
- function _toArray(r) {
451
- return _arrayWithHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableRest();
452
- }
453
- function _toConsumableArray(r) {
454
- return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
455
- }
456
- function _toPrimitive(t, r) {
457
- if ("object" != typeof t || !t) return t;
458
- var e = t[Symbol.toPrimitive];
459
- if (void 0 !== e) {
460
- var i = e.call(t, r);
461
- if ("object" != typeof i) return i;
462
- throw new TypeError("@@toPrimitive must return a primitive value.");
463
- }
464
- return ("string" === r ? String : Number)(t);
465
- }
466
- function _toPropertyKey(t) {
467
- var i = _toPrimitive(t, "string");
468
- return "symbol" == typeof i ? i : i + "";
469
- }
470
- function _typeof(o) {
471
- "@babel/helpers - typeof";
472
-
473
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
474
- return typeof o;
475
- } : function (o) {
476
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
477
- }, _typeof(o);
478
- }
479
- function _unsupportedIterableToArray(r, a) {
480
- if (r) {
481
- if ("string" == typeof r) return _arrayLikeToArray(r, a);
482
- var t = {}.toString.call(r).slice(8, -1);
483
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
484
- }
485
- }
486
-
487
- export { _arrayLikeToArray as arrayLikeToArray, _arrayWithHoles as arrayWithHoles, _arrayWithoutHoles as arrayWithoutHoles, _assertThisInitialized as assertThisInitialized, _asyncToGenerator as asyncToGenerator, _callSuper as callSuper, _classCallCheck as classCallCheck, _createClass as createClass, _defineProperty as defineProperty, _getPrototypeOf as getPrototypeOf, _inherits as inherits, _isNativeReflectConstruct as isNativeReflectConstruct, _iterableToArray as iterableToArray, _iterableToArrayLimit as iterableToArrayLimit, _nonIterableRest as nonIterableRest, _nonIterableSpread as nonIterableSpread, _objectSpread2 as objectSpread2, _objectWithoutProperties as objectWithoutProperties, _objectWithoutPropertiesLoose as objectWithoutPropertiesLoose, _possibleConstructorReturn as possibleConstructorReturn, _regeneratorRuntime as regeneratorRuntime, _setPrototypeOf as setPrototypeOf, _slicedToArray as slicedToArray, _toArray as toArray, _toConsumableArray as toConsumableArray, _toPrimitive as toPrimitive, _toPropertyKey as toPropertyKey, _typeof as typeof, _unsupportedIterableToArray as unsupportedIterableToArray };
1
+ function t(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function r(t){if(Array.isArray(t))return t}function e(r){if(Array.isArray(r))return t(r)}function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function o(t,r,e,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void e(t)}u.done?r(c):Promise.resolve(c).then(n,o)}function i(t){return function(){var r=this,e=arguments;return new Promise((function(n,i){var a=t.apply(r,e);function u(t){o(a,n,i,u,c,"next",t)}function c(t){o(a,n,i,u,c,"throw",t)}u(void 0)}))}}function a(t,r,e){return r=l(r),j(t,h()?Reflect.construct(r,e||[],l(t).constructor):r.apply(t,e))}function u(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function c(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,A(n.key),n)}}function f(t,r,e){return r&&c(t.prototype,r),e&&c(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t,r,e){return(r=A(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}function y(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&E(t,r)}function h(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(h=function(){return!!t})()}function p(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function b(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,u=[],c=!0,f=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;c=!1}else for(;!(c=(n=i.call(e)).done)&&(u.push(n.value),u.length!==r);c=!0);}catch(t){f=!0,o=t}finally{try{if(!c&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(f)throw o}}return u}}function v(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function m(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?g(Object(e),!0).forEach((function(r){s(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):g(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}function w(t,r){if(null==t)return{};var e,n,o=O(t,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)e=i[n],-1===r.indexOf(e)&&{}.propertyIsEnumerable.call(t,e)&&(o[e]=t[e])}return o}function O(t,r){if(null==t)return{};var e={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==r.indexOf(n))continue;e[n]=t[n]}return e}function j(t,r){if(r&&("object"==typeof r||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return n(t)}function P(){P=function(){return r};var t,r={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,r,e,n){return Object.defineProperty(t,r,{value:e,enumerable:!n,configurable:!n,writable:!n})}try{c({},"")}catch(t){c=function(t,r,e){return t[r]=e}}function f(r,e,n,o){var i=e&&e.prototype instanceof y?e:y,a=Object.create(i.prototype);return c(a,"_invoke",function(r,e,n){var o=1;return function(i,a){if(3===o)throw Error("Generator is already running");if(4===o){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=O(u,n);if(c){if(c===l)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===o)throw o=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=3;var f=s(r,e,n);if("normal"===f.type){if(o=n.done?4:2,f.arg===l)continue;return{value:f.arg,done:n.done}}"throw"===f.type&&(o=4,n.method="throw",n.arg=f.arg)}}}(r,n,new S(o||[])),!0),a}function s(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}r.wrap=f;var l={};function y(){}function h(){}function p(){}var b={};c(b,i,(function(){return this}));var v=Object.getPrototypeOf,d=v&&v(v(x([])));d&&d!==e&&n.call(d,i)&&(b=d);var g=p.prototype=y.prototype=Object.create(b);function m(t){["next","throw","return"].forEach((function(r){c(t,r,(function(t){return this._invoke(r,t)}))}))}function w(t,r){function e(o,i,a,u){var c=s(t[o],t,i);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==typeof l&&n.call(l,"__await")?r.resolve(l.__await).then((function(t){e("next",t,a,u)}),(function(t){e("throw",t,a,u)})):r.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return e("throw",t,a,u)}))}u(c.arg)}var o;c(this,"_invoke",(function(t,n){function i(){return new r((function(r,o){e(t,n,r,o)}))}return o=o?o.then(i,i):i()}),!0)}function O(r,e){var n=e.method,o=r.i[n];if(o===t)return e.delegate=null,"throw"===n&&r.i.return&&(e.method="return",e.arg=t,O(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),l;var i=s(o,r.i,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,l;var a=i.arg;return a?a.done?(e[r.r]=a.value,e.next=r.n,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,l):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function j(t){this.tryEntries.push(t)}function E(r){var e=r[4]||{};e.type="normal",e.arg=t,r[4]=e}function S(t){this.tryEntries=[[-1]],t.forEach(j,this),this.reset(!0)}function x(r){if(null!=r){var e=r[i];if(e)return e.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function e(){for(;++o<r.length;)if(n.call(r,o))return e.value=r[o],e.done=!1,e;return e.value=t,e.done=!0,e};return a.next=a}}throw new TypeError(typeof r+" is not iterable")}return h.prototype=p,c(g,"constructor",p),c(p,"constructor",h),h.displayName=c(p,u,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===h||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},r.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,a,(function(){return this})),r.AsyncIterator=w,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new w(f(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,u,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),e=[];for(var n in r)e.unshift(n);return function t(){for(;e.length;)if((n=e.pop())in r)return t.value=n,t.done=!1,t;return t.done=!0,t}},r.values=x,S.prototype={constructor:S,reset:function(r){if(this.prev=this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!r)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function n(t){a.type="throw",a.arg=r,e.next=t}for(var o=e.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i[4],u=this.prev,c=i[1],f=i[2];if(-1===i[0])return n("end"),!1;if(!c&&!f)throw Error("try statement without catch or finally");if(null!=i[0]&&i[0]<=u){if(u<c)return this.method="next",this.arg=t,n(c),!0;if(u<f)return n(f),!1}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var o=n;break}}o&&("break"===t||"continue"===t)&&o[0]<=r&&r<=o[2]&&(o=null);var i=o?o[4]:{};return i.type=t,i.arg=r,o?(this.method="next",this.next=o[2],l):this.complete(i)},complete:function(t,r){if("throw"===t.type)throw t.arg;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&&r&&(this.next=r),l},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e[2]===t)return this.complete(e[4],e[3]),E(e),l}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e[0]===t){var n=e[4];if("throw"===n.type){var o=n.arg;E(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={i:x(r),r:e,n:n},"next"===this.method&&(this.arg=t),l}},r}function E(t,r){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},E(t,r)}function S(t,e){return r(t)||b(t,e)||k(t,e)||v()}function x(t){return r(t)||p(t)||k(t)||v()}function _(t){return e(t)||p(t)||k(t)||d()}function T(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function A(t){var r=T(t,"string");return"symbol"==typeof r?r:r+""}function I(t){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I(t)}function k(r,e){if(r){if("string"==typeof r)return t(r,e);var n={}.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(r,e):void 0}}export{t as arrayLikeToArray,r as arrayWithHoles,e as arrayWithoutHoles,n as assertThisInitialized,i as asyncToGenerator,a as callSuper,u as classCallCheck,f as createClass,s as defineProperty,l as getPrototypeOf,y as inherits,h as isNativeReflectConstruct,p as iterableToArray,b as iterableToArrayLimit,v as nonIterableRest,d as nonIterableSpread,m as objectSpread2,w as objectWithoutProperties,O as objectWithoutPropertiesLoose,j as possibleConstructorReturn,P as regeneratorRuntime,E as setPrototypeOf,S as slicedToArray,x as toArray,_ as toConsumableArray,T as toPrimitive,A as toPropertyKey,I as typeof,k as unsupportedIterableToArray};
488
2
  //# sourceMappingURL=_rollupPluginBabelHelpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_rollupPluginBabelHelpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"_rollupPluginBabelHelpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,166 +1,2 @@
1
- import { slicedToArray as _slicedToArray, toConsumableArray as _toConsumableArray, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
2
- import { jsx, jsxs } from 'react/jsx-runtime';
3
- import React, { useState, useCallback, useEffect } from 'react';
4
- import { styled, Box, Stack, Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions, Button } from '@mui/material';
5
- import MuiAlert from '@mui/material/Alert';
6
-
7
- var Alert = /*#__PURE__*/React.forwardRef(function Alert(props, ref) {
8
- return jsx(MuiAlert, _objectSpread2(_objectSpread2({
9
- elevation: 6,
10
- ref: ref,
11
- variant: 'standard'
12
- }, props), {}, {
13
- style: {
14
- minWidth: '300px'
15
- }
16
- }));
17
- });
18
- var ApiAlertContext = {};
19
- var RenderArea = function RenderArea(messages, onClose) {
20
- return messages.map(function (x, i) {
21
- return jsx(Message, {
22
- data: x,
23
- IsOpen: true,
24
- handleClose: onClose,
25
- autoDurationHide: x.duration
26
- }, x.id + i);
27
- });
28
- };
29
- function AlertGlobal() {
30
- var _useState = useState([]),
31
- _useState2 = _slicedToArray(_useState, 2),
32
- Messages = _useState2[0],
33
- setMessages = _useState2[1];
34
- var _PushMessage = useCallback(function (data) {
35
- setMessages(function (st) {
36
- return [].concat(_toConsumableArray(st), [data]);
37
- });
38
- }, []);
39
- var _HandleClose = useCallback(function (data) {
40
- var index = Messages.findIndex(function (x) {
41
- return x.id === data.id;
42
- });
43
- Messages.splice(index, 1);
44
- setMessages(_toConsumableArray(Messages));
45
- }, [Messages]);
46
- useEffect(function () {
47
- ApiAlertContext.ApiAlert = _objectSpread2(_objectSpread2({}, ApiAlertContext.ApiAlert ? ApiAlertContext.ApiAlert : {}), {}, {
48
- PushMessage: _PushMessage,
49
- PushError: function PushError(data, options) {
50
- this.PushMessage({
51
- id: new Date().getTime().toString(),
52
- text: data,
53
- type: 'error',
54
- duration: (options === null || options === void 0 ? void 0 : options.duration) || 15000
55
- });
56
- },
57
- PushInfo: function PushInfo(data, options) {
58
- this.PushMessage({
59
- id: new Date().getTime().toString(),
60
- text: data,
61
- type: 'info',
62
- duration: (options === null || options === void 0 ? void 0 : options.duration) || 6000
63
- });
64
- },
65
- PushWarning: function PushWarning(data, options) {
66
- this.PushMessage({
67
- id: new Date().getTime().toString(),
68
- text: data,
69
- type: 'warning',
70
- duration: (options === null || options === void 0 ? void 0 : options.duration) || 6000
71
- });
72
- },
73
- PushSuccess: function PushSuccess(data, options) {
74
- this.PushMessage({
75
- id: new Date().getTime().toString(),
76
- text: data,
77
- type: 'success',
78
- duration: (options === null || options === void 0 ? void 0 : options.duration) || 3000
79
- });
80
- }
81
- });
82
- }, [_PushMessage]);
83
- return jsx(Wrap, {
84
- children: jsx(Stack, {
85
- spacing: 2,
86
- sx: {
87
- maxWidth: '300px'
88
- },
89
- children: RenderArea(Messages, _HandleClose)
90
- })
91
- });
92
- }
93
- var Message = function Message(props) {
94
- var _handleClose = useCallback(function () {
95
- return props.handleClose(props.data);
96
- }, [props]);
97
- useEffect(function () {
98
- var Timer = null;
99
- if (props.autoDurationHide) {
100
- Timer = setTimeout(function () {
101
- props.handleClose(props.data);
102
- }, props.autoDurationHide);
103
- }
104
- return function () {
105
- clearTimeout(Timer);
106
- };
107
- }, [props]);
108
- return jsx(Alert, {
109
- onClose: _handleClose,
110
- severity: props.data.type,
111
- children: props.data.text
112
- });
113
- };
114
- var Wrap = styled(Box)({
115
- position: 'fixed',
116
- top: 'calc(var(--height-header) + 20px)',
117
- right: '50px',
118
- zIndex: 2000,
119
- display: 'flex',
120
- justifyContent: 'flex-start',
121
- alignItems: 'center'
122
- });
123
- var AlertDialog = function AlertDialog(props) {
124
- var _React$useState = React.useState(props.IsOpen),
125
- _React$useState2 = _slicedToArray(_React$useState, 2),
126
- Open = _React$useState2[0],
127
- setOpen = _React$useState2[1];
128
- React.useEffect(function () {
129
- setOpen(props.IsOpen);
130
- }, [props.IsOpen]);
131
- var _handleClose = React.useCallback(function () {
132
- setOpen(false);
133
- props.onClose && props.onClose();
134
- }, [props]);
135
- return jsx("div", {
136
- children: jsxs(Dialog, {
137
- open: Open,
138
- onClose: _handleClose,
139
- "aria-labelledby": 'alert-dialog-title',
140
- "aria-describedby": 'alert-dialog-description',
141
- children: [jsx(DialogTitle, {
142
- id: 'alert-dialog-title',
143
- children: props.Title
144
- }), jsx(DialogContent, {
145
- children: jsx(DialogContentText, {
146
- id: 'alert-dialog-description',
147
- children: props.Message
148
- })
149
- }), jsxs(DialogActions, {
150
- children: [jsx(Button, {
151
- onClick: props.onAccept,
152
- autoFocus: true,
153
- color: 'info',
154
- children: "Ok"
155
- }), jsx(Button, {
156
- onClick: _handleClose,
157
- color: 'error',
158
- children: "Cancel"
159
- })]
160
- })]
161
- })
162
- });
163
- };
164
-
165
- export { AlertDialog, ApiAlertContext, AlertGlobal as default };
1
+ import{slicedToArray as e,toConsumableArray as t,objectSpread2 as i}from"../_virtual/_rollupPluginBabelHelpers.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";import o,{useState as a,useCallback as l,useEffect as u}from"react";import{styled as s,Box as d,Stack as c,Dialog as f,DialogTitle as p,DialogContent as h,DialogContentText as m,DialogActions as g,Button as v}from"@mui/material";import x from"@mui/material/Alert";var y=o.forwardRef((function(e,t){return n(x,i(i({elevation:6,ref:t,variant:"standard"},e),{},{style:{minWidth:"300px"}}))})),C={};function A(){var r,o,s=a([]),d=e(s,2),f=d[0],p=d[1],h=l((function(e){p((function(i){return[].concat(t(i),[e])}))}),[]),m=l((function(e){var i=f.findIndex((function(t){return t.id===e.id}));f.splice(i,1),p(t(f))}),[f]);return u((function(){C.ApiAlert=i(i({},C.ApiAlert?C.ApiAlert:{}),{},{PushMessage:h,PushError:function(e,t){this.PushMessage({id:(new Date).getTime().toString(),text:e,type:"error",duration:(null==t?void 0:t.duration)||15e3})},PushInfo:function(e,t){this.PushMessage({id:(new Date).getTime().toString(),text:e,type:"info",duration:(null==t?void 0:t.duration)||6e3})},PushWarning:function(e,t){this.PushMessage({id:(new Date).getTime().toString(),text:e,type:"warning",duration:(null==t?void 0:t.duration)||6e3})},PushSuccess:function(e,t){this.PushMessage({id:(new Date).getTime().toString(),text:e,type:"success",duration:(null==t?void 0:t.duration)||3e3})}})}),[h]),n(b,{children:n(c,{spacing:2,sx:{maxWidth:"300px"},children:(r=f,o=m,r.map((function(e,t){return n(P,{data:e,IsOpen:!0,handleClose:o,autoDurationHide:e.duration},e.id+t)})))})})}var P=function(e){var t=l((function(){return e.handleClose(e.data)}),[e]);return u((function(){var t=null;return e.autoDurationHide&&(t=setTimeout((function(){e.handleClose(e.data)}),e.autoDurationHide)),function(){clearTimeout(t)}}),[e]),n(y,{onClose:t,severity:e.data.type,children:e.data.text})},b=s(d)({position:"fixed",top:"calc(var(--height-header) + 20px)",right:"50px",zIndex:2e3,display:"flex",justifyContent:"flex-start",alignItems:"center"}),I=function(t){var i=o.useState(t.IsOpen),a=e(i,2),l=a[0],u=a[1];o.useEffect((function(){u(t.IsOpen)}),[t.IsOpen]);var s=o.useCallback((function(){u(!1),t.onClose&&t.onClose()}),[t]);return n("div",{children:r(f,{open:l,onClose:s,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[n(p,{id:"alert-dialog-title",children:t.Title}),n(h,{children:n(m,{id:"alert-dialog-description",children:t.Message})}),r(g,{children:[n(v,{onClick:t.onAccept,autoFocus:!0,color:"info",children:"Ok"}),n(v,{onClick:s,color:"error",children:"Cancel"})]})]})})};export{I as AlertDialog,C as ApiAlertContext,A as default};
166
2
  //# sourceMappingURL=alert-global.js.map