@entropic-bond/crud-panel 4.4.6 → 4.4.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.
|
@@ -15,41 +15,36 @@ var e = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
15
15
|
get subscribersCount() {
|
|
16
16
|
return this.subscribers.size;
|
|
17
17
|
}
|
|
18
|
-
}, n =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return (n[e[t + 0]] + n[e[t + 1]] + n[e[t + 2]] + n[e[t + 3]] + "-" + n[e[t + 4]] + n[e[t + 5]] + "-" + n[e[t + 6]] + n[e[t + 7]] + "-" + n[e[t + 8]] + n[e[t + 9]] + "-" + n[e[t + 10]] + n[e[t + 11]] + n[e[t + 12]] + n[e[t + 13]] + n[e[t + 14]] + n[e[t + 15]]).toLowerCase();
|
|
18
|
+
}, n = /* @__PURE__ */ new Uint8Array(16);
|
|
19
|
+
function r() {
|
|
20
|
+
return crypto.getRandomValues(n);
|
|
22
21
|
}
|
|
23
|
-
var i
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return
|
|
22
|
+
var i = [];
|
|
23
|
+
for (let e = 0; e < 256; ++e) i.push((e + 256).toString(16).slice(1));
|
|
24
|
+
function a(e, t = 0) {
|
|
25
|
+
return (i[e[t + 0]] + i[e[t + 1]] + i[e[t + 2]] + i[e[t + 3]] + "-" + i[e[t + 4]] + i[e[t + 5]] + "-" + i[e[t + 6]] + i[e[t + 7]] + "-" + i[e[t + 8]] + i[e[t + 9]] + "-" + i[e[t + 10]] + i[e[t + 11]] + i[e[t + 12]] + i[e[t + 13]] + i[e[t + 14]] + i[e[t + 15]]).toLowerCase();
|
|
26
|
+
}
|
|
27
|
+
function o(e, t, n) {
|
|
28
|
+
return !t && !e && crypto.randomUUID ? crypto.randomUUID() : s(e, t, n);
|
|
30
29
|
}
|
|
31
|
-
|
|
32
|
-
function c(e, t, n) {
|
|
30
|
+
function s(e, t, n) {
|
|
33
31
|
e ||= {};
|
|
34
|
-
let i = e.random ?? e.rng?.() ??
|
|
32
|
+
let i = e.random ?? e.rng?.() ?? r();
|
|
35
33
|
if (i.length < 16) throw Error("Random bytes length must be >= 16");
|
|
36
34
|
if (i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, t) {
|
|
37
35
|
if (n ||= 0, n < 0 || n + 16 > t.length) throw RangeError(`UUID byte range ${n}:${n + 15} is out of buffer bounds`);
|
|
38
36
|
for (let e = 0; e < 16; ++e) t[n + e] = i[e];
|
|
39
37
|
return t;
|
|
40
38
|
}
|
|
41
|
-
return
|
|
39
|
+
return a(i);
|
|
42
40
|
}
|
|
43
|
-
function
|
|
44
|
-
return s.randomUUID && !t && !e ? s.randomUUID() : c(e, t, n);
|
|
45
|
-
}
|
|
46
|
-
function u(e, t, n, r) {
|
|
41
|
+
function c(e, t, n, r) {
|
|
47
42
|
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
48
43
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
49
44
|
else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
|
|
50
45
|
return i > 3 && a && Object.defineProperty(t, n, a), a;
|
|
51
46
|
}
|
|
52
|
-
var
|
|
47
|
+
var l = class e {
|
|
53
48
|
static registerFactory(e, t, n, r = !1) {
|
|
54
49
|
this._factoryMap[e] = {
|
|
55
50
|
factory: t,
|
|
@@ -79,7 +74,7 @@ var d = class e {
|
|
|
79
74
|
if (t instanceof e ? t = t.className : typeof t == "string" || (t = new t().className), !this._factoryMap[t]) throw Error(`You should register class ${t} prior to use.`);
|
|
80
75
|
return this._factoryMap[t].annotation;
|
|
81
76
|
}
|
|
82
|
-
constructor(e =
|
|
77
|
+
constructor(e = o()) {
|
|
83
78
|
this._id = e;
|
|
84
79
|
}
|
|
85
80
|
get className() {
|
|
@@ -232,11 +227,11 @@ var d = class e {
|
|
|
232
227
|
this._factoryMap = {};
|
|
233
228
|
}
|
|
234
229
|
};
|
|
235
|
-
|
|
236
|
-
function
|
|
237
|
-
return
|
|
230
|
+
c([u], l.prototype, "_id", void 0);
|
|
231
|
+
function u(e, t) {
|
|
232
|
+
return d()(e, t);
|
|
238
233
|
}
|
|
239
|
-
function
|
|
234
|
+
function d(e) {
|
|
240
235
|
return function(t, n) {
|
|
241
236
|
Object.getOwnPropertyDescriptor(t, "_persistentProperties") || (t._persistentProperties ? t._persistentProperties = [...t._persistentProperties] : t._persistentProperties = []);
|
|
242
237
|
let r = t._persistentProperties.find((e) => e.name === n);
|
|
@@ -247,12 +242,12 @@ function p(e) {
|
|
|
247
242
|
});
|
|
248
243
|
};
|
|
249
244
|
}
|
|
250
|
-
function
|
|
245
|
+
function f(e, t) {
|
|
251
246
|
return (n) => {
|
|
252
|
-
|
|
247
|
+
l.registerFactory(e, n, t), n.prototype.__className = e;
|
|
253
248
|
};
|
|
254
249
|
}
|
|
255
|
-
var
|
|
250
|
+
var p = class e {
|
|
256
251
|
static {
|
|
257
252
|
this.error = {
|
|
258
253
|
persistentNeedForSubCollection: "The document parameter for a sub-collection should be a Persistent instace",
|
|
@@ -261,15 +256,15 @@ var h = class e {
|
|
|
261
256
|
}
|
|
262
257
|
constructor(t, n, r) {
|
|
263
258
|
if (r) {
|
|
264
|
-
if (!(n instanceof
|
|
259
|
+
if (!(n instanceof l)) throw Error(e.error.persistentNeedForSubCollection);
|
|
265
260
|
this.collectionName = `${n.className}/${n.id}/${r}`;
|
|
266
|
-
} else this.collectionName = n instanceof
|
|
261
|
+
} else this.collectionName = n instanceof l ? n.className : n;
|
|
267
262
|
this._stream = t;
|
|
268
263
|
}
|
|
269
264
|
findById(e, t) {
|
|
270
265
|
return new Promise((n, r) => {
|
|
271
266
|
this._stream.findById(e, this.collectionName).then((e) => {
|
|
272
|
-
e ? (t ? t.fromObject(e) : t =
|
|
267
|
+
e ? (t ? t.fromObject(e) : t = l.createInstance(e), n(t)) : n(void 0);
|
|
273
268
|
}).catch((e) => r(e));
|
|
274
269
|
});
|
|
275
270
|
}
|
|
@@ -285,11 +280,11 @@ var h = class e {
|
|
|
285
280
|
});
|
|
286
281
|
}
|
|
287
282
|
find() {
|
|
288
|
-
return new
|
|
283
|
+
return new m(this);
|
|
289
284
|
}
|
|
290
285
|
query(e = {}, t) {
|
|
291
286
|
if (t) {
|
|
292
|
-
let n = t instanceof
|
|
287
|
+
let n = t instanceof l ? t.className : t;
|
|
293
288
|
e.operations ||= [], e.operations.push({
|
|
294
289
|
property: "__className",
|
|
295
290
|
operator: "==",
|
|
@@ -305,32 +300,32 @@ var h = class e {
|
|
|
305
300
|
return this.mapToInstance(() => this._stream.next(e));
|
|
306
301
|
}
|
|
307
302
|
onDocumentChange(e, t) {
|
|
308
|
-
return this._stream.onDocumentChange(this.collectionName, e, (e) => t(
|
|
303
|
+
return this._stream.onDocumentChange(this.collectionName, e, (e) => t(_.toPersistentDocumentChange(e)));
|
|
309
304
|
}
|
|
310
305
|
onCollectionChange(e, t) {
|
|
311
|
-
return this._stream.onCollectionChange(this.preprocessQueryObject(e.getQueryObject()), this.collectionName, (e) => t(e.map((e) =>
|
|
306
|
+
return this._stream.onCollectionChange(this.preprocessQueryObject(e.getQueryObject()), this.collectionName, (e) => t(e.map((e) => _.toPersistentDocumentChange(e))));
|
|
312
307
|
}
|
|
313
308
|
onCollectionTemplateChange(e, t) {
|
|
314
|
-
return this._stream.onDocumentTemplateChange(e, (e) => t(
|
|
309
|
+
return this._stream.onDocumentTemplateChange(e, (e) => t(_.toPersistentDocumentChange(e)));
|
|
315
310
|
}
|
|
316
311
|
mapToInstance(e) {
|
|
317
312
|
return new Promise((t, n) => {
|
|
318
|
-
e().then((e) => t(e.map((e) =>
|
|
313
|
+
e().then((e) => t(e.map((e) => l.createInstance(e)))).catch((e) => n(e));
|
|
319
314
|
});
|
|
320
315
|
}
|
|
321
316
|
preprocessQueryObject(e) {
|
|
322
317
|
if (Object.values(e).length === 0) return e;
|
|
323
318
|
let t = e.operations?.map((e) => {
|
|
324
319
|
let t = e.value[0] ?? e.value;
|
|
325
|
-
return
|
|
326
|
-
property:
|
|
320
|
+
return _.isArrayOperator(e.operator) && t instanceof l ? {
|
|
321
|
+
property: l.searchableArrayNameFor(e.property),
|
|
327
322
|
operator: e.operator,
|
|
328
323
|
value: Array.isArray(e.value) ? e.value.map((e) => e.id) : t.id,
|
|
329
324
|
aggregate: e.aggregate
|
|
330
325
|
} : {
|
|
331
326
|
property: e.property,
|
|
332
327
|
operator: e.operator,
|
|
333
|
-
value: e.value instanceof
|
|
328
|
+
value: e.value instanceof l ? { id: e.value.id } : e.value,
|
|
334
329
|
aggregate: e.aggregate
|
|
335
330
|
};
|
|
336
331
|
}) ?? [];
|
|
@@ -339,12 +334,12 @@ var h = class e {
|
|
|
339
334
|
operations: t
|
|
340
335
|
};
|
|
341
336
|
}
|
|
342
|
-
},
|
|
337
|
+
}, m = class {
|
|
343
338
|
constructor(e) {
|
|
344
339
|
this.queryObject = { operations: [] }, this.model = e;
|
|
345
340
|
}
|
|
346
341
|
where(e, t, n, r) {
|
|
347
|
-
if (this.queryObject.operations?.at(-1)?.aggregate && !r) throw Error(
|
|
342
|
+
if (this.queryObject.operations?.at(-1)?.aggregate && !r) throw Error(p.error.invalidQueryOrder);
|
|
348
343
|
return this.queryObject.operations?.push({
|
|
349
344
|
property: e,
|
|
350
345
|
operator: t,
|
|
@@ -353,7 +348,7 @@ var h = class e {
|
|
|
353
348
|
}), this;
|
|
354
349
|
}
|
|
355
350
|
whereDeepProp(e, t, n, r) {
|
|
356
|
-
if (this.queryObject.operations?.at(-1)?.aggregate && !r) throw Error(
|
|
351
|
+
if (this.queryObject.operations?.at(-1)?.aggregate && !r) throw Error(p.error.invalidQueryOrder);
|
|
357
352
|
let i = e.split("."), a = {}, o = i.length > 1 ? a : n;
|
|
358
353
|
return i.slice(1).forEach((e, t) => {
|
|
359
354
|
a[e] = t < i.length - 2 ? {} : n, a = a[e];
|
|
@@ -377,7 +372,7 @@ var h = class e {
|
|
|
377
372
|
return this.whereDeepProp(e, t, n, !0);
|
|
378
373
|
}
|
|
379
374
|
instanceOf(e) {
|
|
380
|
-
let t = e instanceof
|
|
375
|
+
let t = e instanceof l ? e.className : e;
|
|
381
376
|
return this.queryObject.operations?.push({
|
|
382
377
|
property: "__className",
|
|
383
378
|
operator: "==",
|
|
@@ -411,7 +406,7 @@ var h = class e {
|
|
|
411
406
|
getQueryModel() {
|
|
412
407
|
return this.model;
|
|
413
408
|
}
|
|
414
|
-
},
|
|
409
|
+
}, h = class e {
|
|
415
410
|
constructor() {}
|
|
416
411
|
static {
|
|
417
412
|
this.error = { shouldBeRegistered: "You should register a data source before using the data Store." };
|
|
@@ -424,11 +419,11 @@ var h = class e {
|
|
|
424
419
|
}
|
|
425
420
|
static getModel(t) {
|
|
426
421
|
if (!e._dataSource) throw Error(this.error.shouldBeRegistered);
|
|
427
|
-
return new
|
|
422
|
+
return new p(e._dataSource, t);
|
|
428
423
|
}
|
|
429
424
|
static getModelForSubCollection(t, n) {
|
|
430
425
|
if (!e._dataSource) throw Error(this.error.shouldBeRegistered);
|
|
431
|
-
return new
|
|
426
|
+
return new p(e._dataSource, t, n);
|
|
432
427
|
}
|
|
433
428
|
static async populate(e) {
|
|
434
429
|
if (!e) return;
|
|
@@ -443,17 +438,17 @@ var h = class e {
|
|
|
443
438
|
static isPopulated(e) {
|
|
444
439
|
return Array.isArray(e) ? e.reduce((e, t) => e && t.__documentReference === void 0, !0) : e.__documentReference === void 0;
|
|
445
440
|
}
|
|
446
|
-
},
|
|
441
|
+
}, g = class e {
|
|
447
442
|
constructor(e) {
|
|
448
443
|
this._resolveCollectionPaths = () => {
|
|
449
444
|
throw Error("The method collectionsMatchingTemplate has not been implemented in the concrete data source");
|
|
450
445
|
}, this._disabledChangeListeners = /* @__PURE__ */ new Set(), this._collectionsToWatch = {}, e && (this._beforeUpdateDocument = e.beforeUpdateDocument, this._afterUpdateDocument = e.afterUpdateDocument, this._afterDocumentChange = e.afterDocumentChange, this._beforeDocumentChange = e.beforeDocumentChange, this._beforeQueryOwnerCollection = e.beforeQueryOwnerCollection), this.installUpdaters();
|
|
451
446
|
}
|
|
452
447
|
installUpdaters() {
|
|
453
|
-
let e =
|
|
448
|
+
let e = l.getSystemRegisteredReferencesWithCachedProps();
|
|
454
449
|
this._collectionsToWatch = {}, Object.entries(e).forEach(([e, t]) => {
|
|
455
450
|
t.forEach((t) => {
|
|
456
|
-
t.typeName && (Array.isArray(t.typeName) ? t.typeName : [t?.typeName ?? e]).map((e) =>
|
|
451
|
+
t.typeName && (Array.isArray(t.typeName) ? t.typeName : [t?.typeName ?? e]).map((e) => l.collectionPath(l.createInstance(e), t)).forEach((e) => {
|
|
457
452
|
this._collectionsToWatch[e] || (this._collectionsToWatch[e] = []), this._collectionsToWatch[e].find((e) => e.name === t.name && e.ownerClassName() === t.ownerClassName()) || this._collectionsToWatch[e].push(t);
|
|
458
453
|
});
|
|
459
454
|
});
|
|
@@ -485,13 +480,13 @@ var h = class e {
|
|
|
485
480
|
return n ? this.onDocumentChange(t, n) : Promise.resolve();
|
|
486
481
|
}
|
|
487
482
|
async onDocumentChange(t, n) {
|
|
488
|
-
let r =
|
|
483
|
+
let r = _.toPersistentDocumentChange(t);
|
|
489
484
|
this._beforeDocumentChange?.(r, n);
|
|
490
485
|
let i = {};
|
|
491
486
|
t.type !== "update" || !r.before || r.after?.id && this._disabledChangeListeners.has(r.after?.id) || (await Promise.all(n.map(async (t) => {
|
|
492
|
-
let n = e.ownerCollectionPath(
|
|
487
|
+
let n = e.ownerCollectionPath(l.createInstance(t.ownerClassName()), t, r.params), a = await this._resolveCollectionPaths(n);
|
|
493
488
|
await Promise.all(a.map(async (e) => {
|
|
494
|
-
let n =
|
|
489
|
+
let n = h.getModel(e), a = n.find(), o = !1;
|
|
495
490
|
t.cachedProps?.forEach((e) => {
|
|
496
491
|
r.before[e] !== r.after[e] && (o = !0);
|
|
497
492
|
}), o && (a = t.searchableArray ? a.where(t.name, "contains", r.before) : a.where(t.name, "==", r.before)), a = this._beforeQueryOwnerCollection?.(a) ?? a;
|
|
@@ -525,20 +520,20 @@ var h = class e {
|
|
|
525
520
|
let r;
|
|
526
521
|
return r = typeof t.ownerCollection == "function" ? t.ownerCollection(e, t, n) : t.ownerCollection ?? e.className, r;
|
|
527
522
|
}
|
|
528
|
-
},
|
|
523
|
+
}, _ = class e {
|
|
529
524
|
constructor() {
|
|
530
525
|
this._cachedPropsUpdater = void 0;
|
|
531
526
|
}
|
|
532
527
|
installCachedPropsUpdater(e) {
|
|
533
|
-
return this._cachedPropsUpdater = new
|
|
528
|
+
return this._cachedPropsUpdater = new g(e), this._cachedPropsUpdater.resolveCollectionPaths = this.resolveCollectionPaths.bind(this), this._cachedPropsUpdater;
|
|
534
529
|
}
|
|
535
530
|
get cachedPropsUpdater() {
|
|
536
531
|
return this._cachedPropsUpdater;
|
|
537
532
|
}
|
|
538
533
|
static toPropertyPathOperations(t) {
|
|
539
534
|
return t ? t.map((t) => {
|
|
540
|
-
if (e.isArrayOperator(t.operator) && t.value[0] instanceof
|
|
541
|
-
property:
|
|
535
|
+
if (e.isArrayOperator(t.operator) && t.value[0] instanceof l) return {
|
|
536
|
+
property: l.searchableArrayNameFor(t.property),
|
|
542
537
|
operator: t.operator,
|
|
543
538
|
value: t.value.map((e) => e.id),
|
|
544
539
|
aggregate: t.aggregate
|
|
@@ -558,8 +553,8 @@ var h = class e {
|
|
|
558
553
|
static toPersistentDocumentChange(e) {
|
|
559
554
|
return {
|
|
560
555
|
...e,
|
|
561
|
-
before: e.before &&
|
|
562
|
-
after: e.after &&
|
|
556
|
+
before: e.before && l.createInstance(e.before),
|
|
557
|
+
after: e.after && l.createInstance(e.after)
|
|
563
558
|
};
|
|
564
559
|
}
|
|
565
560
|
static toPropertyPathValue(e) {
|
|
@@ -596,7 +591,7 @@ var h = class e {
|
|
|
596
591
|
}
|
|
597
592
|
return i;
|
|
598
593
|
}
|
|
599
|
-
},
|
|
594
|
+
}, v = class e {
|
|
600
595
|
static registerCloudStorage(t, n) {
|
|
601
596
|
e._cloudStorageFactoryMap[t] = n;
|
|
602
597
|
}
|
|
@@ -619,12 +614,12 @@ var h = class e {
|
|
|
619
614
|
this._cloudStorageFactoryMap = {};
|
|
620
615
|
}
|
|
621
616
|
};
|
|
622
|
-
function
|
|
623
|
-
return
|
|
617
|
+
function y(e, t) {
|
|
618
|
+
return v.registerCloudStorage(e, t), (t) => {
|
|
624
619
|
t.prototype.__className = e;
|
|
625
620
|
};
|
|
626
621
|
}
|
|
627
|
-
var
|
|
622
|
+
var b = class extends v {
|
|
628
623
|
constructor(e = "") {
|
|
629
624
|
super(), this._simulateDelay = 0, this._pendingPromises = [], this.mockFileSystem = {}, this._pathToMockFiles = e;
|
|
630
625
|
}
|
|
@@ -659,17 +654,15 @@ var S = class extends b {
|
|
|
659
654
|
return delete this.mockFileSystem[e], this.resolveWithDelay();
|
|
660
655
|
}
|
|
661
656
|
};
|
|
662
|
-
|
|
663
|
-
var
|
|
664
|
-
return e[e.stored = 0] = "stored", e[e.pendingDataSet = 1] = "pendingDataSet", e[e.deleted = 2] = "deleted", e;
|
|
665
|
-
}({}), w = class extends d {
|
|
657
|
+
b = c([y("MockCloudStorage", () => new b())], b);
|
|
658
|
+
var x = class extends l {
|
|
666
659
|
constructor(...e) {
|
|
667
660
|
super(...e), this._onChange = new t();
|
|
668
661
|
}
|
|
669
662
|
async save({ data: e, fileName: t, progress: n, cloudStorageProvider: r } = {}) {
|
|
670
663
|
let i = e || this._pendingData;
|
|
671
|
-
i && (this._reference && await this.delete(), this.provider = r ||
|
|
672
|
-
event:
|
|
664
|
+
i && (this._reference && await this.delete(), this.provider = r || v.defaultCloudStorage, this._originalFileName = t || (i instanceof File ? i.name : void 0), this._reference = await this.provider.save(this.id, i, n), this._url = await this.provider.getUrl(this._reference), this._pendingData = void 0, this._onChange.notify({
|
|
665
|
+
event: 0,
|
|
673
666
|
storedFile: this
|
|
674
667
|
}));
|
|
675
668
|
}
|
|
@@ -679,7 +672,7 @@ var C = /* @__PURE__ */ function(e) {
|
|
|
679
672
|
async delete() {
|
|
680
673
|
if (!this._reference) throw Error("Cannot delete a not stored file");
|
|
681
674
|
await this.provider.delete(this._reference), this._reference = void 0, this._url = void 0, this._onChange.notify({
|
|
682
|
-
event:
|
|
675
|
+
event: 2,
|
|
683
676
|
storedFile: this
|
|
684
677
|
});
|
|
685
678
|
}
|
|
@@ -688,9 +681,9 @@ var C = /* @__PURE__ */ function(e) {
|
|
|
688
681
|
}
|
|
689
682
|
get provider() {
|
|
690
683
|
if (!this._provider) try {
|
|
691
|
-
this._provider =
|
|
684
|
+
this._provider = v.createInstance(this._cloudStorageProviderName);
|
|
692
685
|
} catch {
|
|
693
|
-
this._provider =
|
|
686
|
+
this._provider = v.defaultCloudStorage;
|
|
694
687
|
}
|
|
695
688
|
return this._provider;
|
|
696
689
|
}
|
|
@@ -702,7 +695,7 @@ var C = /* @__PURE__ */ function(e) {
|
|
|
702
695
|
}
|
|
703
696
|
setDataToStore(e) {
|
|
704
697
|
return this._pendingData = e, this._originalFileName = e instanceof File ? e.name : void 0, this._mimeType = e instanceof Blob ? e.type : void 0, this._onChange.notify({
|
|
705
|
-
event:
|
|
698
|
+
event: 1,
|
|
706
699
|
pendingData: e,
|
|
707
700
|
storedFile: this
|
|
708
701
|
}), this;
|
|
@@ -714,9 +707,9 @@ var C = /* @__PURE__ */ function(e) {
|
|
|
714
707
|
return this._onChange.subscribe(e);
|
|
715
708
|
}
|
|
716
709
|
};
|
|
717
|
-
|
|
718
|
-
var
|
|
719
|
-
(class e extends
|
|
710
|
+
c([u], x.prototype, "_reference", void 0), c([u], x.prototype, "_url", void 0), c([u], x.prototype, "_cloudStorageProviderName", void 0), c([u], x.prototype, "_originalFileName", void 0), c([u], x.prototype, "_mimeType", void 0), x = c([f("StoredFile")], x);
|
|
711
|
+
var S = class {};
|
|
712
|
+
(class e extends S {
|
|
720
713
|
static {
|
|
721
714
|
this.error = { shouldBeRegistered: "You should register an auth service before using Auth." };
|
|
722
715
|
}
|
|
@@ -789,14 +782,14 @@ var T = class {};
|
|
|
789
782
|
};
|
|
790
783
|
}
|
|
791
784
|
processParam(e) {
|
|
792
|
-
if (e != null) return e instanceof
|
|
785
|
+
if (e != null) return e instanceof l ? e.toObject() : Array.isArray(e) ? e.map((e) => this.processParam(e)) : typeof e == "object" ? Object.entries(e).reduce((e, [t, n]) => (e[t] = this.processParam(n), e), {}) : e;
|
|
793
786
|
}
|
|
794
787
|
processResult(e) {
|
|
795
|
-
if (e != null) return e.__className ?
|
|
788
|
+
if (e != null) return e.__className ? l.createInstance(e) : Array.isArray(e) ? e.map((e) => this.processResult(e)) : typeof e == "object" ? Object.entries(e).reduce((e, [t, n]) => (e[t] = this.processResult(n), e), {}) : e;
|
|
796
789
|
}
|
|
797
790
|
};
|
|
798
|
-
var
|
|
799
|
-
(class e extends
|
|
791
|
+
var C = class {};
|
|
792
|
+
(class e extends C {
|
|
800
793
|
static {
|
|
801
794
|
this.error = { shouldBeRegistered: "You should register a Server Auth service before using the Server Auth." };
|
|
802
795
|
}
|
|
@@ -826,14 +819,14 @@ var E = class {};
|
|
|
826
819
|
this._instance = void 0;
|
|
827
820
|
}
|
|
828
821
|
});
|
|
829
|
-
function
|
|
822
|
+
function w(e, t = "-") {
|
|
830
823
|
if (!e) return "";
|
|
831
824
|
let n = e.slice(1).replace(/( |[A-Z])/g, (e) => e === " " ? "-" : t + e[0].toLowerCase());
|
|
832
825
|
return e[0].toLocaleLowerCase() + n.replace(/--/g, "-");
|
|
833
826
|
}
|
|
834
827
|
//#endregion
|
|
835
828
|
//#region src/progress-controller.ts
|
|
836
|
-
var
|
|
829
|
+
var T = class {
|
|
837
830
|
constructor() {
|
|
838
831
|
this._debug = !1, this._stages = {}, this._onProgress = new t();
|
|
839
832
|
}
|
|
@@ -862,12 +855,12 @@ var O = class {
|
|
|
862
855
|
get debug() {
|
|
863
856
|
return this._debug;
|
|
864
857
|
}
|
|
865
|
-
},
|
|
858
|
+
}, E = class e {
|
|
866
859
|
static {
|
|
867
860
|
this.errorMessages = { missedDocument: "No document to save" };
|
|
868
861
|
}
|
|
869
862
|
constructor(e) {
|
|
870
|
-
this.progressController = new
|
|
863
|
+
this.progressController = new T(), this.onChangeHdl = new t(), this.onErrorHdl = new t(), this.validator = {}, this.setDocument(e || this.createDocument());
|
|
871
864
|
}
|
|
872
865
|
allRequiredPropertiesFilled() {
|
|
873
866
|
return this.nonFilledRequiredProperties.length <= 0 && this.validateGlobal();
|
|
@@ -1010,7 +1003,7 @@ var O = class {
|
|
|
1010
1003
|
get throwOnError() {
|
|
1011
1004
|
return this.onErrorHdl.subscribersCount === 0;
|
|
1012
1005
|
}
|
|
1013
|
-
},
|
|
1006
|
+
}, D = /* @__PURE__ */ e(((e) => {
|
|
1014
1007
|
var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), a = Symbol.for("react.profiler"), o = Symbol.for("react.consumer"), s = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), u = Symbol.for("react.memo"), d = Symbol.for("react.lazy"), f = Symbol.for("react.activity"), p = Symbol.iterator;
|
|
1015
1008
|
function m(e) {
|
|
1016
1009
|
return typeof e != "object" || !e ? null : (e = p && e[p] || e["@@iterator"], typeof e == "function" ? e : null);
|
|
@@ -1296,7 +1289,7 @@ var O = class {
|
|
|
1296
1289
|
}, e.useTransition = function() {
|
|
1297
1290
|
return w.H.useTransition();
|
|
1298
1291
|
}, e.version = "19.2.7";
|
|
1299
|
-
})),
|
|
1292
|
+
})), O = /* @__PURE__ */ e(((e, t) => {
|
|
1300
1293
|
process.env.NODE_ENV !== "production" && (function() {
|
|
1301
1294
|
function n(e, t) {
|
|
1302
1295
|
Object.defineProperty(a.prototype, e, { get: function() {
|
|
@@ -1911,9 +1904,9 @@ var O = class {
|
|
|
1911
1904
|
return O().useTransition();
|
|
1912
1905
|
}, e.version = "19.2.7", typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
1913
1906
|
})();
|
|
1914
|
-
})),
|
|
1915
|
-
process.env.NODE_ENV === "production" ? t.exports =
|
|
1916
|
-
})),
|
|
1907
|
+
})), k = /* @__PURE__ */ e(((e, t) => {
|
|
1908
|
+
process.env.NODE_ENV === "production" ? t.exports = D() : t.exports = O();
|
|
1909
|
+
})), A = /* @__PURE__ */ e(((e) => {
|
|
1917
1910
|
var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
|
|
1918
1911
|
function r(e, n, r) {
|
|
1919
1912
|
var i = null;
|
|
@@ -1928,7 +1921,7 @@ var O = class {
|
|
|
1928
1921
|
};
|
|
1929
1922
|
}
|
|
1930
1923
|
e.Fragment = n, e.jsx = r, e.jsxs = r;
|
|
1931
|
-
})),
|
|
1924
|
+
})), j = /* @__PURE__ */ e(((e) => {
|
|
1932
1925
|
process.env.NODE_ENV !== "production" && (function() {
|
|
1933
1926
|
function t(e) {
|
|
1934
1927
|
if (e == null) return null;
|
|
@@ -1985,14 +1978,14 @@ var O = class {
|
|
|
1985
1978
|
}
|
|
1986
1979
|
}
|
|
1987
1980
|
function a() {
|
|
1988
|
-
var e =
|
|
1981
|
+
var e = A.A;
|
|
1989
1982
|
return e === null ? null : e.getOwner();
|
|
1990
1983
|
}
|
|
1991
1984
|
function o() {
|
|
1992
1985
|
return Error("react-stack-top-frame");
|
|
1993
1986
|
}
|
|
1994
1987
|
function s(e) {
|
|
1995
|
-
if (
|
|
1988
|
+
if (j.call(e, "key")) {
|
|
1996
1989
|
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
1997
1990
|
if (t && t.isReactWarning) return !1;
|
|
1998
1991
|
}
|
|
@@ -2049,12 +2042,12 @@ var O = class {
|
|
|
2049
2042
|
}
|
|
2050
2043
|
function d(e, n, i, o, l, d) {
|
|
2051
2044
|
var p = n.children;
|
|
2052
|
-
if (p !== void 0) if (o) if (
|
|
2045
|
+
if (p !== void 0) if (o) if (M(p)) {
|
|
2053
2046
|
for (o = 0; o < p.length; o++) f(p[o]);
|
|
2054
2047
|
Object.freeze && Object.freeze(p);
|
|
2055
2048
|
} else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
2056
2049
|
else f(p);
|
|
2057
|
-
if (
|
|
2050
|
+
if (j.call(n, "key")) {
|
|
2058
2051
|
p = t(e);
|
|
2059
2052
|
var m = Object.keys(n).filter(function(e) {
|
|
2060
2053
|
return e !== "key";
|
|
@@ -2071,7 +2064,7 @@ var O = class {
|
|
|
2071
2064
|
function p(e) {
|
|
2072
2065
|
return typeof e == "object" && !!e && e.$$typeof === h;
|
|
2073
2066
|
}
|
|
2074
|
-
var m =
|
|
2067
|
+
var m = k(), h = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), _ = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), b = Symbol.for("react.consumer"), x = Symbol.for("react.context"), S = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), w = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), D = Symbol.for("react.activity"), O = Symbol.for("react.client.reference"), A = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, j = Object.prototype.hasOwnProperty, M = Array.isArray, N = console.createTask ? console.createTask : function() {
|
|
2075
2068
|
return null;
|
|
2076
2069
|
};
|
|
2077
2070
|
m = { react_stack_bottom_frame: function(e) {
|
|
@@ -2079,16 +2072,16 @@ var O = class {
|
|
|
2079
2072
|
} };
|
|
2080
2073
|
var P, F = {}, I = m.react_stack_bottom_frame.bind(m, o)(), L = N(i(o)), R = {};
|
|
2081
2074
|
e.Fragment = _, e.jsx = function(e, t, n) {
|
|
2082
|
-
var r = 1e4 >
|
|
2075
|
+
var r = 1e4 > A.recentlyCreatedOwnerStacks++;
|
|
2083
2076
|
return d(e, t, n, !1, r ? Error("react-stack-top-frame") : I, r ? N(i(e)) : L);
|
|
2084
2077
|
}, e.jsxs = function(e, t, n) {
|
|
2085
|
-
var r = 1e4 >
|
|
2078
|
+
var r = 1e4 > A.recentlyCreatedOwnerStacks++;
|
|
2086
2079
|
return d(e, t, n, !0, r ? Error("react-stack-top-frame") : I, r ? N(i(e)) : L);
|
|
2087
2080
|
};
|
|
2088
2081
|
})();
|
|
2089
|
-
})),
|
|
2090
|
-
process.env.NODE_ENV === "production" ? t.exports =
|
|
2091
|
-
})),
|
|
2082
|
+
})), M = /* @__PURE__ */ e(((e, t) => {
|
|
2083
|
+
process.env.NODE_ENV === "production" ? t.exports = A() : t.exports = j();
|
|
2084
|
+
})), N = k(), P = M(), F = class extends N.Component {
|
|
2092
2085
|
constructor(e) {
|
|
2093
2086
|
super(e), this.unfilteredDocuments = [], this.state = {
|
|
2094
2087
|
documents: [],
|
|
@@ -2123,7 +2116,7 @@ var O = class {
|
|
|
2123
2116
|
onSubmit: (e) => this.storeDocument(e),
|
|
2124
2117
|
onCancel: a ? () => this.setState({ mode: 0 }) : () => this.newDocument()
|
|
2125
2118
|
};
|
|
2126
|
-
return typeof t[0] == "function" ? (0,
|
|
2119
|
+
return typeof t[0] == "function" ? (0, N.cloneElement)(t[0](o), { key: r.document.id }) : (0, N.cloneElement)(t[0], {
|
|
2127
2120
|
key: r.document.id,
|
|
2128
2121
|
...o
|
|
2129
2122
|
});
|
|
@@ -2134,47 +2127,47 @@ var O = class {
|
|
|
2134
2127
|
onSelect: (e) => this.editDocument(e),
|
|
2135
2128
|
onDelete: (e) => n.setDocument(e).deleteDocument()
|
|
2136
2129
|
};
|
|
2137
|
-
return typeof t[1] == "function" ? (0,
|
|
2130
|
+
return typeof t[1] == "function" ? (0, N.cloneElement)(t[1](r), { key: e.id }) : (0, N.cloneElement)(t[1], {
|
|
2138
2131
|
key: e.id,
|
|
2139
2132
|
...r
|
|
2140
2133
|
});
|
|
2141
2134
|
}
|
|
2142
2135
|
render() {
|
|
2143
|
-
let { mode: e, documents: t } = this.state, { className: n, cardAddButton: r, controller: i } = this.props, a =
|
|
2136
|
+
let { mode: e, documents: t } = this.state, { className: n, cardAddButton: r, controller: i } = this.props, a = w(i.document?.className), o = this.props.labels || {}, s = this.props.layout || "itemsAlways";
|
|
2144
2137
|
typeof o == "function" && (o = o(i));
|
|
2145
2138
|
let { addNewDocumentLabel: c, singularDocumentInCollectionCaption: l, documentsInCollectionCaption: u, noDocumentsFoundLabel: d } = o;
|
|
2146
|
-
return /* @__PURE__ */ (0,
|
|
2139
|
+
return /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
2147
2140
|
className: `crud-panel ${a} ${n || ""}`,
|
|
2148
2141
|
children: [
|
|
2149
|
-
e === 0 && s !== "formAndItems" && !r && /* @__PURE__ */ (0,
|
|
2142
|
+
e === 0 && s !== "formAndItems" && !r && /* @__PURE__ */ (0, P.jsx)("div", {
|
|
2150
2143
|
className: "header",
|
|
2151
|
-
children: this.props.header ? typeof this.props.header == "function" ? this.props.header(i, () => this.newDocument(), o) : this.props.header : /* @__PURE__ */ (0,
|
|
2144
|
+
children: this.props.header ? typeof this.props.header == "function" ? this.props.header(i, () => this.newDocument(), o) : this.props.header : /* @__PURE__ */ (0, P.jsx)("button", {
|
|
2152
2145
|
onClick: () => this.newDocument(),
|
|
2153
2146
|
children: c
|
|
2154
2147
|
})
|
|
2155
2148
|
}),
|
|
2156
|
-
(s === "formAndItems" || e === 1 || e === 2) && /* @__PURE__ */ (0,
|
|
2149
|
+
(s === "formAndItems" || e === 1 || e === 2) && /* @__PURE__ */ (0, P.jsx)("div", {
|
|
2157
2150
|
className: "content-panel",
|
|
2158
2151
|
children: this.invokeContentViewChild(o)
|
|
2159
2152
|
}),
|
|
2160
|
-
(s === "itemsAlways" || s === "formAndItems" || e === 0) && /* @__PURE__ */ (0,
|
|
2153
|
+
(s === "itemsAlways" || s === "formAndItems" || e === 0) && /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
2161
2154
|
className: "collection-panel",
|
|
2162
|
-
children: [t?.length > 0 && /* @__PURE__ */ (0,
|
|
2155
|
+
children: [t?.length > 0 && /* @__PURE__ */ (0, P.jsx)("h3", { children: t.length > 1 ? u : l || u }), /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
2163
2156
|
className: "documents",
|
|
2164
|
-
children: [r && /* @__PURE__ */ (0,
|
|
2157
|
+
children: [r && /* @__PURE__ */ (0, P.jsxs)("div", {
|
|
2165
2158
|
className: "crud-card card-add-button clickable",
|
|
2166
2159
|
onClick: () => this.newDocument(),
|
|
2167
|
-
children: [/* @__PURE__ */ (0,
|
|
2160
|
+
children: [/* @__PURE__ */ (0, P.jsx)("div", {
|
|
2168
2161
|
className: "button-element",
|
|
2169
2162
|
children: r
|
|
2170
|
-
}), /* @__PURE__ */ (0,
|
|
2163
|
+
}), /* @__PURE__ */ (0, P.jsx)("div", {
|
|
2171
2164
|
className: "add-label",
|
|
2172
2165
|
children: c
|
|
2173
2166
|
})]
|
|
2174
|
-
}), t?.length ? t.map((e) => this.invokeDetailViewChild(e)) : /* @__PURE__ */ (0,
|
|
2167
|
+
}), t?.length ? t.map((e) => this.invokeDetailViewChild(e)) : /* @__PURE__ */ (0, P.jsx)("p", { children: d })]
|
|
2175
2168
|
})]
|
|
2176
2169
|
}),
|
|
2177
|
-
/* @__PURE__ */ (0,
|
|
2170
|
+
/* @__PURE__ */ (0, P.jsx)("div", {
|
|
2178
2171
|
className: "footer",
|
|
2179
2172
|
children: this.props.footer && typeof this.props.footer == "function" ? this.props.footer(i, () => this.newDocument(), o) : this.props.footer
|
|
2180
2173
|
})
|
|
@@ -2183,6 +2176,6 @@ var O = class {
|
|
|
2183
2176
|
}
|
|
2184
2177
|
};
|
|
2185
2178
|
//#endregion
|
|
2186
|
-
export {
|
|
2179
|
+
export { E as CrudController, F as CrudPanel };
|
|
2187
2180
|
|
|
2188
2181
|
//# sourceMappingURL=entropic-bond-crud-panel.js.map
|