@m4l/testing 1.2.1-beta-docs-autocomplete-async-with-add-mf-sync.0 → 1.2.1-beta-docs-autocomplete-async-with-add-mf-sync.1

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.
@@ -1,1888 +0,0 @@
1
- import { isDeepStrictEqual as g, inspect as $ } from "node:util";
2
- import { jsx as u, jsxs as q } from "react/jsx-runtime";
3
- import { vi as t } from "vitest";
4
- import { q as Q, l as x, r as B, w as ee, v as te, u as re } from "./userPreferences-CoM3U5-X.js";
5
- import "date-fns";
6
- import "history";
7
- import y from "react";
8
- const k = "__rhfOnSubmitRef", ne = {
9
- square: {
10
- large: {
11
- width: 800,
12
- height: 800
13
- },
14
- medium: {
15
- width: 600,
16
- height: 600
17
- }
18
- }
19
- }, oe = {
20
- date: 180,
21
- smallId: 50,
22
- smallName: 130,
23
- mediumId: 130,
24
- mediumName: 180,
25
- mediumNumber: 120,
26
- mediumChip: 100,
27
- mediumDescription: 280,
28
- smallDescription: 160
29
- }, U = {
30
- database: "test-db",
31
- domain_token: "test-token",
32
- domainToken: "test-token",
33
- environment_assets: "test-env",
34
- host: "http://test-host.com",
35
- host_api_local: "http://test-api-local.com",
36
- hostApiLocal: "http://test-api-local.com",
37
- host_api_remote: "http://test-api.com",
38
- hostApiRemote: "http://test-api.com",
39
- hostRemote: "test-host.com",
40
- hostApiIcons: "http://test-api.com/main/icons",
41
- host_static_assets: "http://test-assets.com",
42
- isLocalhost: !1
43
- }, ie = {
44
- ...U,
45
- environment_assets: "env",
46
- host: "https://app.example.com",
47
- host_api_local: "https://api.example.com/local",
48
- hostApiLocal: "https://api.example.com/local",
49
- host_api_remote: "https://api.example.com",
50
- hostApiRemote: "https://api.example.com",
51
- hostApiIcons: "https://static.example.com/icons",
52
- hostRemote: "api.example.com",
53
- host_static_assets: "https://static.example.com"
54
- }, ae = {
55
- value: "5",
56
- unit: "m"
57
- }, Xe = {
58
- noSignal: 0,
59
- reliable: 1,
60
- acceptable: 2
61
- }, Qe = {
62
- off: 0,
63
- moving: 1,
64
- maxSpeed: 2
65
- }, D = /* @__PURE__ */ Symbol("expected-function-value");
66
- function se(e) {
67
- return e?.type === "nested";
68
- }
69
- function ce(e) {
70
- return e?.type === "date";
71
- }
72
- function de(e) {
73
- return e?.type === "boolean";
74
- }
75
- function ue(e) {
76
- return e?.type === "price";
77
- }
78
- function fe(e) {
79
- return e?.type === "points";
80
- }
81
- function le(e) {
82
- return e?.type === "number";
83
- }
84
- function pe(e) {
85
- return e?.type === "interactiveCheck";
86
- }
87
- function me(e) {
88
- return e?.type === "setCheck";
89
- }
90
- function ye(e) {
91
- return e?.type === "uncertainty";
92
- }
93
- function ge(e) {
94
- return e?.type === "concatenated";
95
- }
96
- function ve(e) {
97
- return e?.type === "chipStatus";
98
- }
99
- function he(e) {
100
- return e?.type === "tags";
101
- }
102
- function Se(e) {
103
- return e?.type === "icon";
104
- }
105
- function Me(e) {
106
- return e?.type === "color";
107
- }
108
- function Pe(e) {
109
- return e?.type === "image";
110
- }
111
- function O(e) {
112
- return typeof e == "string" ? JSON.stringify(e) : typeof e == "symbol" ? e.toString() : $(e, {
113
- depth: 4,
114
- breakLength: 1 / 0,
115
- compact: !0,
116
- sorted: !0
117
- });
118
- }
119
- function A(e, n, o, r, a) {
120
- e.push(
121
- `${n} ${o}: expected ${O(r)}, got ${O(a)}`
122
- );
123
- }
124
- function R(e, n, o) {
125
- e.push(`${n} ${o}: expected a function, got undefined`);
126
- }
127
- function L(e, n, o) {
128
- e.push(
129
- `${n} ${o}: expected undefined, got ${O("function")}`
130
- );
131
- }
132
- function Ae(e, n, o, r) {
133
- if (!o) {
134
- e.push(`${n} testProps: expected an object, got undefined`);
135
- return;
136
- }
137
- const a = Object.keys(o).sort(), i = Object.keys(r).sort();
138
- g(a, i) || e.push(
139
- `${n} testProps keys: expected ${O(i)}, got ${O(a)}`
140
- ), i.forEach((s) => {
141
- const c = r[s], d = o[s];
142
- if (c === D) {
143
- typeof d != "function" && A(
144
- e,
145
- n,
146
- `testProps.${s}`,
147
- "[function]",
148
- d
149
- );
150
- return;
151
- }
152
- g(d, c) || A(
153
- e,
154
- n,
155
- `testProps.${s}`,
156
- c,
157
- d
158
- );
159
- });
160
- }
161
- function be(e) {
162
- return se(e) ? {
163
- expectedTestProps: {
164
- fieldValue: e.fieldValue,
165
- defaultValue: e.defaultValue,
166
- Component: e.Component
167
- },
168
- requiresFormatter: !0,
169
- requiresFilter: !0,
170
- requiresSort: !0
171
- } : ce(e) ? {
172
- expectedTestProps: {
173
- fieldValue: e.fieldValue,
174
- presentationType: e.presentationType
175
- },
176
- requiresFormatter: !0,
177
- requiresFilter: !0,
178
- requiresSort: !0
179
- } : de(e) ? {
180
- expectedTestProps: {
181
- fieldValue: e.fieldValue,
182
- presentationType: e.presentationType
183
- },
184
- requiresFormatter: !0,
185
- requiresFilter: !0,
186
- requiresSort: !0
187
- } : ue(e) ? {
188
- expectedTestProps: {
189
- fieldValue: e.fieldValue
190
- },
191
- requiresFormatter: !0,
192
- requiresFilter: !0,
193
- requiresSort: !0
194
- } : fe(e) ? {
195
- expectedTestProps: {
196
- fieldValue: e.fieldValue,
197
- fieldUnit: e.fieldUnit
198
- },
199
- requiresFormatter: !0,
200
- requiresFilter: !0,
201
- requiresSort: !0
202
- } : le(e) ? {
203
- expectedTestProps: {
204
- fieldValue: e.fieldValue,
205
- // Only assert fractionDigits when the hook call declares it, so the
206
- // exact testProps key match works whether or not the caller passes it.
207
- ...e.fractionDigits !== void 0 ? { fractionDigits: e.fractionDigits } : {}
208
- },
209
- requiresFormatter: !0,
210
- requiresFilter: !0,
211
- requiresSort: !0
212
- } : pe(e) ? {
213
- requiresFormatter: !0,
214
- requiresFilter: !0,
215
- requiresSort: !0
216
- } : me(e) ? {
217
- expectedTestProps: {
218
- field: e.field,
219
- disabledGetter: D,
220
- rowKeyGetter: D,
221
- useHook: D
222
- },
223
- requiresFormatter: !0,
224
- requiresFilter: !1,
225
- requiresSort: !1
226
- } : ye(e) ? {
227
- expectedTestProps: {
228
- fieldValue: e.fieldValue,
229
- fieldUnit: e.fieldUnit,
230
- fieldSymbol: e.fieldSymbol
231
- },
232
- requiresFormatter: !0,
233
- requiresFilter: !0,
234
- requiresSort: !0
235
- } : ge(e) ? {
236
- expectedTestProps: {
237
- fieldValue: e.fieldValue,
238
- fieldSeparator: e.fieldSeparator
239
- },
240
- requiresFormatter: !0,
241
- requiresFilter: !0,
242
- requiresSort: !0
243
- } : ve(e) ? {
244
- expectedTestProps: {
245
- fieldLabel: typeof e.fieldLabel == "function" ? D : e.fieldLabel,
246
- fieldStatus: e.fieldStatus,
247
- statusesColors: e.statusesColors,
248
- fallbackColor: e.fallbackColor
249
- },
250
- requiresFormatter: !0,
251
- requiresFilter: !0,
252
- requiresSort: !0
253
- } : he(e) ? {
254
- expectedTestProps: {
255
- fieldValue: e.fieldValue
256
- },
257
- requiresFormatter: !0,
258
- requiresFilter: !0,
259
- requiresSort: !0
260
- } : Se(e) ? {
261
- expectedTestProps: {
262
- getIconProps: D
263
- },
264
- requiresFormatter: !0,
265
- requiresFilter: !1,
266
- requiresSort: !1
267
- } : Me(e) ? {
268
- expectedTestProps: {
269
- fieldValue: e.fieldValue
270
- },
271
- requiresFormatter: !0,
272
- requiresFilter: !1,
273
- requiresSort: !1
274
- } : Pe(e) ? {
275
- expectedTestProps: {
276
- fieldValue: e.fieldValue,
277
- fieldText: e.fieldText,
278
- cover: e.cover,
279
- width: e.width,
280
- height: e.height
281
- },
282
- requiresFormatter: !0,
283
- requiresFilter: !1,
284
- requiresSort: !1
285
- } : Te(e);
286
- }
287
- function Te(e) {
288
- return {
289
- expectedTestProps: {
290
- unsupportedHookCall: O(e)
291
- },
292
- requiresFormatter: !0,
293
- requiresFilter: !0,
294
- requiresSort: !0
295
- };
296
- }
297
- function et(e, n) {
298
- const o = [];
299
- return e.length !== n.length && o.push(
300
- `[columns] length: expected ${n.length}, got ${e.length}`
301
- ), n.forEach((r, a) => {
302
- const i = e[a], s = `[col ${a + 1} ${JSON.stringify(r.key)}]`;
303
- if (!i) {
304
- o.push(`${s} missing column at index ${a}`);
305
- return;
306
- }
307
- if (i.key !== r.key && A(o, s, "key", r.key, i.key), i.name !== r.name && A(o, s, "name", r.name, i.name), i.type !== r.type && A(o, s, "type", r.type, i.type), g(i.align, r.align) || A(
308
- o,
309
- s,
310
- "align",
311
- r.align,
312
- i.align
313
- ), g(i.width, r.width) || A(
314
- o,
315
- s,
316
- "width",
317
- r.width,
318
- i.width
319
- ), g(i.visible, r.visible) || A(
320
- o,
321
- s,
322
- "visible",
323
- r.visible,
324
- i.visible
325
- ), r.fixed !== void 0 && !g(i.fixed, r.fixed) && A(
326
- o,
327
- s,
328
- "fixed",
329
- r.fixed,
330
- i.fixed
331
- ), r.hookCall) {
332
- const c = be(r.hookCall);
333
- c.expectedTestProps && Ae(
334
- o,
335
- s,
336
- i.testProps,
337
- c.expectedTestProps
338
- ), i.formatter === void 0 && R(o, s, "formatter"), c.requiresFilter && i.customFilter === void 0 && R(o, s, "customFilter"), c.requiresSort && i.customSort === void 0 && R(o, s, "customSort");
339
- return;
340
- }
341
- i.formatter !== void 0 && L(o, s, "formatter"), i.customFilter !== void 0 && L(o, s, "customFilter"), i.customSort !== void 0 && L(o, s, "customSort");
342
- }), o;
343
- }
344
- function p(e) {
345
- return t.fn(
346
- ({ children: n, ...o }) => y.createElement("div", { "data-testid": e, ...o }, n)
347
- );
348
- }
349
- function S(e, n) {
350
- return t.fn(() => y.createElement("div", { "data-testid": e }, n));
351
- }
352
- function Ce(e = "paper-form") {
353
- return t.fn(
354
- ({ children: n, title: o }) => y.createElement(
355
- "div",
356
- {
357
- "data-testid": e,
358
- "data-title": String(o)
359
- },
360
- n
361
- )
362
- );
363
- }
364
- function v(e) {
365
- return t.fn(
366
- ({ children: n }) => y.createElement("div", { "data-testid": e }, n)
367
- );
368
- }
369
- function De(e = "helmet-page") {
370
- return t.fn(
371
- ({ children: n, subtitle: o, title: r, titlePrefix: a }) => y.createElement(
372
- "div",
373
- {
374
- "data-testid": e,
375
- "data-title": String(r ?? ""),
376
- "data-title-prefix": String(a ?? ""),
377
- "data-subtitle": String(o ?? "")
378
- },
379
- n
380
- )
381
- );
382
- }
383
- function T(e) {
384
- return t.fn(
385
- ({ name: n }) => y.createElement("div", {
386
- "data-testid": `${e}-${String(n)}`
387
- })
388
- );
389
- }
390
- function Oe(e = "property") {
391
- return t.fn(
392
- ({ property: n }) => y.createElement("div", {
393
- "data-testid": `${e}-${String(n)}`
394
- })
395
- );
396
- }
397
- function Ee(e = "data-src") {
398
- return t.fn(
399
- ({ src: n }) => y.createElement("span", {
400
- [e]: String(n)
401
- })
402
- );
403
- }
404
- function Fe(e = "divider") {
405
- return t.fn(
406
- ({ customVariant: n, orientation: o }) => y.createElement("div", {
407
- "data-testid": e,
408
- "data-orientation": String(o ?? ""),
409
- "data-variant": String(n ?? "")
410
- })
411
- );
412
- }
413
- function ke(e = "nav-link") {
414
- return t.fn(
415
- ({ children: n, reloadDocument: o, text: r, to: a, ...i }) => y.createElement(
416
- "a",
417
- {
418
- "data-testid": e,
419
- href: String(a ?? ""),
420
- "data-reload-document": String(o ?? ""),
421
- ...i
422
- },
423
- n ?? r ?? ""
424
- )
425
- );
426
- }
427
- function Ie(e = "window-base") {
428
- return t.fn(
429
- ({ children: n, onClose: o, title: r }) => y.createElement(
430
- "section",
431
- {
432
- "data-testid": e,
433
- "data-title": String(r ?? "")
434
- },
435
- y.createElement(
436
- "button",
437
- {
438
- type: "button",
439
- onClick: o
440
- },
441
- "Close"
442
- ),
443
- n
444
- )
445
- );
446
- }
447
- function _e({
448
- testId: e,
449
- disabledProp: n = "disabled",
450
- handlerProp: o = "onClick",
451
- labelProp: r = "label"
452
- }) {
453
- return t.fn(
454
- (a) => y.createElement(
455
- "button",
456
- {
457
- "data-testid": e,
458
- disabled: !!a[n],
459
- onClick: a[o]
460
- },
461
- String(a[r])
462
- )
463
- );
464
- }
465
- function tt(e, n = `${e}-fallback`) {
466
- return t.fn(
467
- (o) => function() {
468
- return y.createElement(
469
- y.Suspense,
470
- {
471
- fallback: y.createElement("div", {
472
- "data-testid": n
473
- })
474
- },
475
- y.createElement(
476
- "div",
477
- { "data-testid": e },
478
- y.createElement(o)
479
- )
480
- );
481
- }
482
- );
483
- }
484
- function C() {
485
- return t.fn((e) => ({
486
- formatter: t.fn(),
487
- customFilter: t.fn(),
488
- customSort: t.fn(),
489
- getIconProps: e.getIconProps,
490
- testProps: e
491
- }));
492
- }
493
- function w(e) {
494
- return typeof e == "string" ? JSON.stringify(e) : $(e, {
495
- depth: 4,
496
- breakLength: 1 / 0,
497
- compact: !0,
498
- sorted: !0
499
- });
500
- }
501
- function P(e, n, o, r, a) {
502
- e.push(
503
- `${n} ${o}: expected ${w(r)}, got ${w(a)}`
504
- );
505
- }
506
- function rt(e, n) {
507
- const o = [];
508
- return Array.isArray(e) ? (e.length !== n.length && o.push(
509
- `[fields] length: expected ${n.length}, got ${e.length}`
510
- ), n.forEach((r, a) => {
511
- const i = e[a], s = `[field ${a + 1} ${JSON.stringify(r.name)}]`;
512
- if (!i) {
513
- o.push(`${s} missing field at index ${a}`);
514
- return;
515
- }
516
- if (i.name !== r.name && P(
517
- o,
518
- s,
519
- "name",
520
- r.name,
521
- i.name
522
- ), g(i.dictionaryId, r.dictionaryId) || P(
523
- o,
524
- s,
525
- "dictionaryId",
526
- r.dictionaryId,
527
- i.dictionaryId
528
- ), i.type !== r.type && P(
529
- o,
530
- s,
531
- "type",
532
- r.type,
533
- i.type
534
- ), g(i.multiple, r.multiple) || P(
535
- o,
536
- s,
537
- "multiple",
538
- r.multiple,
539
- i.multiple
540
- ), g(i.presence, r.presence) || P(
541
- o,
542
- s,
543
- "presence",
544
- r.presence,
545
- i.presence
546
- ), r.defaultOperator !== void 0 && !g(i.defaultOperator, r.defaultOperator) && P(
547
- o,
548
- s,
549
- "defaultOperator",
550
- r.defaultOperator,
551
- i.defaultOperator
552
- ), r.restritcOperatorsTo !== void 0 && !g(
553
- i.restritcOperatorsTo,
554
- r.restritcOperatorsTo
555
- ) && P(
556
- o,
557
- s,
558
- "restritcOperatorsTo",
559
- r.restritcOperatorsTo,
560
- i.restritcOperatorsTo
561
- ), r.defaultOperand1 !== void 0 && !g(i.defaultOperand1, r.defaultOperand1) && P(
562
- o,
563
- s,
564
- "defaultOperand1",
565
- r.defaultOperand1,
566
- i.defaultOperand1
567
- ), r.urlIcon !== void 0 && !g(i.urlIcon, r.urlIcon) && P(
568
- o,
569
- s,
570
- "urlIcon",
571
- r.urlIcon,
572
- i.urlIcon
573
- ), r.type === "selectAsync") {
574
- if (!i.selectAsyncOptions) {
575
- o.push(
576
- `${s} selectAsyncOptions: expected to be defined, got undefined`
577
- );
578
- return;
579
- }
580
- r.selectAsyncOptions && !g(
581
- i.selectAsyncOptions,
582
- r.selectAsyncOptions
583
- ) && P(
584
- o,
585
- s,
586
- "selectAsyncOptions",
587
- r.selectAsyncOptions,
588
- i.selectAsyncOptions
589
- );
590
- }
591
- }), o) : (o.push(
592
- `[fields] type: expected "array", got ${w(typeof e)}`
593
- ), o);
594
- }
595
- function Re(e = k) {
596
- return globalThis[e];
597
- }
598
- function Le(e) {
599
- return e === void 0 ? "" : JSON.stringify(e);
600
- }
601
- function V(e) {
602
- return typeof e == "string" ? JSON.stringify(e) : $(e, {
603
- depth: 4,
604
- breakLength: 1 / 0,
605
- compact: !0,
606
- sorted: !0
607
- });
608
- }
609
- function E(e, n, o, r, a) {
610
- e.push(
611
- `${n} ${o}: expected ${V(r)}, got ${V(a)}`
612
- );
613
- }
614
- function nt(e, n) {
615
- const o = [];
616
- return Array.isArray(e) ? (e.length !== n.length && o.push(
617
- `[fields] length: expected ${n.length}, got ${e.length}`
618
- ), n.forEach((r, a) => {
619
- const i = e[a], s = `[field ${a + 1} ${JSON.stringify(r.name)}]`;
620
- if (!i) {
621
- o.push(`${s} missing field at index ${a}`);
622
- return;
623
- }
624
- i.name !== r.name && E(
625
- o,
626
- s,
627
- "name",
628
- r.name,
629
- i.name
630
- ), g(i.dictionaryId, r.dictionaryId) || E(
631
- o,
632
- s,
633
- "dictionaryId",
634
- r.dictionaryId,
635
- i.dictionaryId
636
- ), i.type !== r.type && E(
637
- o,
638
- s,
639
- "type",
640
- r.type,
641
- i.type
642
- ), g(i.presence, r.presence) || E(
643
- o,
644
- s,
645
- "presence",
646
- r.presence,
647
- i.presence
648
- ), r.urlIcon !== void 0 && !g(i.urlIcon, r.urlIcon) && E(
649
- o,
650
- s,
651
- "urlIcon",
652
- r.urlIcon,
653
- i.urlIcon
654
- );
655
- }), o) : (o.push(
656
- `[fields] type: expected "array", got ${V(typeof e)}`
657
- ), o);
658
- }
659
- function we() {
660
- return {
661
- hashLayers: {},
662
- mapActions: {
663
- getMap: () => null,
664
- smartMoveToPoint: t.fn(),
665
- setDataLayer: t.fn(),
666
- addLayer: t.fn(),
667
- removeLayer: t.fn()
668
- }
669
- };
670
- }
671
- function H(e) {
672
- return typeof e == "function" || e && typeof e == "object" && "$$typeof" in e ? "callable" : "value";
673
- }
674
- function ot(e, n) {
675
- return Object.keys(e).filter((o) => !(o in n));
676
- }
677
- function it(e, n) {
678
- const o = [];
679
- for (const r of Object.keys(e)) {
680
- if (!(r in n))
681
- continue;
682
- const a = H(n[r]), i = H(e[r]);
683
- a !== i && o.push(`"${r}": real is ${a}, mock is ${i}`);
684
- }
685
- return o;
686
- }
687
- function Ve(e) {
688
- return e.flatMap((n) => {
689
- if (typeof n == "string")
690
- return [n];
691
- if (n && typeof n == "object") {
692
- const o = n;
693
- return [o.stack, o.message].filter(
694
- (r) => typeof r == "string"
695
- );
696
- }
697
- return [];
698
- });
699
- }
700
- function at({
701
- patterns: e
702
- }) {
703
- const n = console.error;
704
- beforeEach(() => {
705
- console.error = (...o) => {
706
- Ve(o).some(
707
- (a) => e.some((i) => i.test(a))
708
- ) || n.call(console, ...o);
709
- };
710
- }), afterEach(() => {
711
- console.error = n;
712
- });
713
- }
714
- function st(e = k) {
715
- globalThis[e] = {
716
- current: null
717
- };
718
- }
719
- function $e({
720
- baseModule: e = {},
721
- moduleOverrides: n = {}
722
- } = {}) {
723
- const o = t.fn(
724
- ({ ariaLabel: r, className: a, disabled: i, icon: s, onClick: c, src: d }) => {
725
- const l = typeof d == "string" ? d : typeof s == "string" ? s : "";
726
- return /* @__PURE__ */ u(
727
- "span",
728
- {
729
- "data-testid": "base-icon",
730
- className: a,
731
- "data-disabled": String(!!i),
732
- "data-src": l,
733
- "aria-hidden": r ? void 0 : !0,
734
- "aria-label": r,
735
- onClick: i ? void 0 : c
736
- }
737
- );
738
- }
739
- );
740
- return {
741
- ...e,
742
- // ButtonBase is consumed at module-load time as a styled() target by
743
- // @m4l/components (e.g. DateRangeCalendarPickerSlots), so the base mock
744
- // must always expose it even when tests never render it directly.
745
- ButtonBase: t.fn(
746
- ({ children: r, className: a, disabled: i, onClick: s }) => /* @__PURE__ */ u(
747
- "button",
748
- {
749
- "data-testid": "base-button-base",
750
- className: a,
751
- disabled: i,
752
- onClick: s,
753
- type: "button",
754
- children: r
755
- }
756
- )
757
- ),
758
- Icon: o,
759
- Tooltip: t.fn(
760
- ({ children: r, className: a, placement: i, size: s, title: c }) => /* @__PURE__ */ u(
761
- "div",
762
- {
763
- "data-testid": "base-tooltip",
764
- className: a,
765
- "data-has-node-title": String(c !== void 0 && typeof c != "string"),
766
- "data-placement": String(i ?? ""),
767
- "data-size": String(s ?? ""),
768
- "data-title": typeof c == "string" ? c : "",
769
- children: r
770
- }
771
- )
772
- ),
773
- Typography: t.fn(
774
- ({ children: r, className: a, dataTestid: i }) => /* @__PURE__ */ u(
775
- "span",
776
- {
777
- "data-testid": typeof i == "string" && i.length > 0 ? i : "base-typography",
778
- className: a,
779
- children: r
780
- }
781
- )
782
- ),
783
- ...n
784
- };
785
- }
786
- function ct({
787
- baseModule: e = {},
788
- moduleOverrides: n = {}
789
- } = {}) {
790
- return $e({
791
- baseModule: e,
792
- moduleOverrides: n
793
- });
794
- }
795
- function W({
796
- baseModule: e = {},
797
- moduleOverrides: n = {},
798
- submitRefGlobalKey: o = k
799
- } = {}) {
800
- const r = e.createValidationPartialObject, a = e.createValidationFullObject, i = e.createValidationSchema, s = e.getStepsAndValidationSchema;
801
- return {
802
- ...e,
803
- Accordion: p("accordion"),
804
- ContainerFlow: S("container-flow"),
805
- ActionsGroup: p("actions-group"),
806
- Divider: Fe(),
807
- ChipStatusFormatter: t.fn(({ label: c }) => /* @__PURE__ */ u("div", { "data-testid": "chip-status-formatter", children: c ?? "" })),
808
- BooleanFormatter: t.fn(({ value: c }) => /* @__PURE__ */ u("div", { "data-testid": "boolean-formatter", children: `${c ?? ""}` })),
809
- DateFormatter: t.fn(({ value: c }) => `${c ?? ""}`),
810
- NumberFormatter: t.fn(
811
- ({ obProps: c, fieldValue: d }) => `${c?.[d] ?? ""}`
812
- ),
813
- getTypographyStyles: t.fn(() => ({})),
814
- getComponentClasses: t.fn(
815
- (c, d) => (Array.isArray(d) ? d : Object.keys(d)).reduce(
816
- (m, M) => ({
817
- ...m,
818
- [M]: M
819
- }),
820
- {}
821
- )
822
- ),
823
- Chip: t.fn(
824
- ({
825
- label: c,
826
- startIcon: d,
827
- color: l
828
- }) => /* @__PURE__ */ u(
829
- "div",
830
- {
831
- "data-testid": "chip",
832
- "data-label": c ?? "",
833
- "data-start-icon": d ?? "",
834
- "data-color": l ?? ""
835
- }
836
- )
837
- ),
838
- Image: t.fn(
839
- ({
840
- src: c,
841
- alt: d
842
- }) => /* @__PURE__ */ u("img", { "data-testid": "mock-image", src: c ?? "", alt: d ?? "" })
843
- ),
844
- RHFormProvider: t.fn(
845
- ({
846
- children: c,
847
- onSubmit: d,
848
- statusLoad: l
849
- }) => {
850
- const m = Re(o);
851
- return m && d && (m.current = d), /* @__PURE__ */ u(
852
- "div",
853
- {
854
- "data-testid": "rhf-provider",
855
- "data-status-load": String(l ?? ""),
856
- children: c
857
- }
858
- );
859
- }
860
- ),
861
- createValidationPartialObject: t.fn(
862
- (...c) => r ? r(...c) : {}
863
- ),
864
- createValidationFullObject: t.fn(
865
- (...c) => a ? a(...c) : c[0]
866
- ),
867
- createValidationSchema: t.fn(
868
- (...c) => i ? i(...c) : {}
869
- ),
870
- getObjectLogsComponentsDictionary: t.fn(() => []),
871
- getNoItemSelectedComponentsDictionary: t.fn(() => []),
872
- getFormattersComponentsDictionary: t.fn(() => []),
873
- getDynamicSortComponentsDictionary: t.fn(() => []),
874
- getDynamicFilterComponentsDictionary: t.fn(() => []),
875
- getDataGridComponentsDictionary: t.fn(() => []),
876
- getCheckableListComponentsDictionary: t.fn(() => []),
877
- getRHFAutocompleteComponentsDictionary: t.fn(() => []),
878
- getStepperComponentsDictionary: t.fn(() => []),
879
- LinearProgress: t.fn(
880
- ({
881
- "data-testid": c
882
- }) => /* @__PURE__ */ u("div", { "data-testid": c ?? "linear-progress" })
883
- ),
884
- DataGrid: t.fn(({ children: c }) => /* @__PURE__ */ u("div", { "data-testid": "data-grid", children: c })),
885
- Stack: v("stack"),
886
- Button: t.fn(
887
- ({ children: c, disabled: d, label: l, onClick: m, "data-testid": M }) => /* @__PURE__ */ u(
888
- "button",
889
- {
890
- "data-testid": typeof M == "string" ? M : "button",
891
- disabled: !!d,
892
- onClick: m,
893
- children: String(l ?? c ?? "")
894
- }
895
- )
896
- ),
897
- WindowConfirm: v("window-confirm"),
898
- WindowBase: Ie(),
899
- Card: v("card"),
900
- Typography: v("typography"),
901
- NavLink: ke(),
902
- Tooltip: t.fn(
903
- ({
904
- children: c,
905
- title: d
906
- }) => /* @__PURE__ */ u(
907
- "div",
908
- {
909
- "data-testid": "tooltip",
910
- "data-title": typeof d == "string" ? d : void 0,
911
- children: c
912
- }
913
- )
914
- ),
915
- NoItemSelected: t.fn(
916
- ({ title: c, message: d }) => /* @__PURE__ */ q("div", { "data-testid": "no-item-selected", children: [
917
- /* @__PURE__ */ u("div", { "data-testid": "no-item-title", children: c }),
918
- /* @__PURE__ */ u("div", { "data-testid": "no-item-message", children: d })
919
- ] })
920
- ),
921
- DATAGRID_SEMANTIC_WIDTHS: oe,
922
- IconButton: t.fn(
923
- ({ children: c, className: d, disabled: l, onClick: m }) => /* @__PURE__ */ u(
924
- "button",
925
- {
926
- "data-testid": "icon-button",
927
- className: typeof d == "string" ? d : void 0,
928
- disabled: !!l,
929
- onClick: m,
930
- children: c
931
- }
932
- )
933
- ),
934
- Icon: Ee(),
935
- ReactJsonViewer: t.fn(({ data: c }) => /* @__PURE__ */ u("div", { "data-testid": "react-json-view", children: Le(c) })),
936
- TabsNavigator: S("tabs-navigator", "TabsNavigator"),
937
- DistanceToNowFormatter: t.fn(
938
- ({
939
- value: c
940
- }) => /* @__PURE__ */ u("span", { "data-testid": "distance-to-now-formatter", children: c ?? "" })
941
- ),
942
- useDistanceToNowFormatter: t.fn(() => ae),
943
- Tabs: v("tabs"),
944
- Tab: t.fn(({ children: c, label: d, ...l }) => /* @__PURE__ */ u(
945
- "button",
946
- {
947
- "data-testid": "tab",
948
- "data-label": String(d ?? ""),
949
- ...l,
950
- children: c
951
- }
952
- )),
953
- PropagateLoaderSpinner: S(
954
- "propagate-loader-spinner"
955
- ),
956
- createToaster: t.fn(() => Q()),
957
- deepShallow: t.fn(Object.is),
958
- getRawFiltersForNetwork: t.fn(() => []),
959
- getRawSortsForNetwork: t.fn(() => []),
960
- useColumnBoolean: C(),
961
- useColumnChipStatus: C(),
962
- useColumnDate: C(),
963
- useColumnIcon: C(),
964
- useColumnNestedValue: C(),
965
- useColumnNumber: C(),
966
- getDataGridRowsFromSet: t.fn(
967
- (c, d, l) => d.filter((m) => c.has(l(m)))
968
- ),
969
- PaperForm: Ce(),
970
- PropertyValue: Oe(),
971
- RHFColorPicker: T("rhf-color"),
972
- RHFCheckbox: T("rhf-checkbox"),
973
- RHFHelperError: T("rhf-helper"),
974
- RHFSelect: T("rhf-select"),
975
- RHFTextField: T("rhf-field"),
976
- RHFNumberInput: T("rhf-number"),
977
- RHFRadioGroup: t.fn(({ name: c }) => /* @__PURE__ */ u("div", { "data-testid": `rhf-radio-group-${String(c ?? "")}` })),
978
- RHFCheckableList: t.fn(({ name: c }) => /* @__PURE__ */ u(
979
- "div",
980
- {
981
- "data-testid": `rhf-checkable-list-${String(c ?? "")}`,
982
- "data-name": String(c ?? "")
983
- }
984
- )),
985
- Step: v("step"),
986
- Stepper: v("stepper"),
987
- StepperContent: v("stepper-content"),
988
- StepperFooter: v("stepper-footer"),
989
- StepperFooterLeftActions: v(
990
- "stepper-footer-left-actions"
991
- ),
992
- StepperFooterRightActions: v(
993
- "stepper-footer-right-actions"
994
- ),
995
- StepperNextButton: S("stepper-next"),
996
- StepperPrevButton: S("stepper-prev"),
997
- StepperSubmitButton: S("stepper-submit"),
998
- StepperCancelButton: _e({
999
- testId: "stepper-cancel-button",
1000
- handlerProp: "onClose",
1001
- labelProp: "children"
1002
- }),
1003
- useFormReadyForUpdate: t.fn(() => !0),
1004
- getStepsAndValidationSchema: t.fn(
1005
- (c) => s ? s(c) : {
1006
- steps: c.steps,
1007
- validationSchema: c.validationSchema
1008
- }
1009
- ),
1010
- ...n
1011
- };
1012
- }
1013
- function dt({
1014
- baseModule: e = {},
1015
- moduleOverrides: n = {},
1016
- submitRefGlobalKey: o = k
1017
- } = {}) {
1018
- return {
1019
- ...W({ baseModule: e, submitRefGlobalKey: o }),
1020
- SideBar: p("mock-side-bar"),
1021
- AppBar: p("mock-app-bar"),
1022
- ModalProvider: p("mock-modal-provider"),
1023
- PopupsProvider: p("mock-popups-provider"),
1024
- AreasProvider: p("mock-areas-provider"),
1025
- Loadable: t.fn((r) => r),
1026
- MFLoader: t.fn(
1027
- ({
1028
- moduleId: r,
1029
- debugPort: a
1030
- }) => /* @__PURE__ */ u(
1031
- "div",
1032
- {
1033
- "data-testid": "mock-mf-loader",
1034
- "data-module-id": r ?? "",
1035
- "data-debug-port": `${a ?? ""}`
1036
- }
1037
- )
1038
- ),
1039
- SplitLayout: t.fn(
1040
- ({
1041
- firstPart: r,
1042
- secondPart: a
1043
- }) => /* @__PURE__ */ q("div", { "data-testid": "split-layout", children: [
1044
- r,
1045
- a
1046
- ] })
1047
- ),
1048
- WINDOW_SIZES: ne,
1049
- createDynamicMFStore: t.fn(
1050
- ({
1051
- dynamicMFParameters: r
1052
- }) => ({
1053
- dynamicMFParameters: r
1054
- })
1055
- ),
1056
- getMFLoaderComponentsDictionary: t.fn(() => []),
1057
- getLoadingErrorComponentsDictionary: t.fn(() => []),
1058
- AreasAdmin: S("mock-areas-admin"),
1059
- LanguagePopover: S("mock-language-popover"),
1060
- AccountPopover: S("mock-account-popover"),
1061
- HelmetPage: De(),
1062
- useDataGridPersistence: t.fn(),
1063
- // Shared export-datagrid hooks; export tests restore real impl via vi.importActual.
1064
- useExportColumns: t.fn(),
1065
- useVisibleColumnNames: t.fn(),
1066
- useWatchTyped: t.fn(
1067
- ({ name: r }) => r === "color" ? "#64748B" : !1
1068
- ),
1069
- RowKey: void 0,
1070
- useWindowToolsMF: t.fn(() => ({
1071
- getCookie: t.fn(),
1072
- getWindowId: t.fn(() => "test-window-id"),
1073
- setCookie: t.fn()
1074
- })),
1075
- useSizeContainer: t.fn(() => ({ containerWidth: 1200, containerHeight: 800 })),
1076
- useDynamicFilterAndSort: t.fn(
1077
- ({
1078
- onChangeFilterSort: r,
1079
- rightActions: a
1080
- }) => ({
1081
- leftActions: /* @__PURE__ */ u("div", { children: "LeftActions" }),
1082
- visibleCustomHeader: !1,
1083
- customHeaderComponent: /* @__PURE__ */ u("div", { children: "CustomHeaderComponent" }),
1084
- rightActions: a,
1085
- onChangeFilterSort: r
1086
- })
1087
- ),
1088
- useModal: t.fn(),
1089
- MFIsolationApp: v("mock-mf-isolation-app"),
1090
- AreasViewer: S("mock-areas-viewer"),
1091
- ...n
1092
- };
1093
- }
1094
- function ut({
1095
- dynamicMFParameters: e = { objectId: 99 }
1096
- } = {}) {
1097
- return {
1098
- useDynamicMFParametersStore: t.fn(
1099
- (n) => n({ dynamicMFParameters: e })
1100
- ),
1101
- FormContainer: t.fn(({ children: n }) => n),
1102
- ActionsContainer: t.fn(({ children: n }) => n),
1103
- ActionFormCancel: t.fn(() => null),
1104
- ActionFormIntro: t.fn(() => null),
1105
- RHFAutocompleteAsync: t.fn(() => null),
1106
- RHFRadioGroup: t.fn(() => null)
1107
- };
1108
- }
1109
- function ft() {
1110
- return {
1111
- MF_ACTION_REQUEST_PARAM: "mfActionRequest",
1112
- completeMFAction: t.fn(),
1113
- isMFActionRequest: t.fn(() => !1)
1114
- };
1115
- }
1116
- function lt({
1117
- baseModule: e = {},
1118
- baseStoreState: n,
1119
- environmentData: o,
1120
- hostToolsData: r,
1121
- moduleLabel: a = "Test Module",
1122
- getLabel: i = (m) => m,
1123
- userPreferencesData: s,
1124
- moduleOverrides: c = {},
1125
- authState: d = {
1126
- isAuthenticated: !1,
1127
- isInitialized: !0
1128
- },
1129
- flagsStoreState: l
1130
- } = {}) {
1131
- const m = x({
1132
- ...U,
1133
- ...o
1134
- }), M = r ?? B(), h = ee(
1135
- s
1136
- ), b = te(s), K = n ?? {}, z = l ?? {
1137
- flagsActions: {
1138
- addFlag: t.fn()
1139
- }
1140
- }, Y = d ? {
1141
- isAuthenticated: d.isAuthenticated,
1142
- isInitialized: d.isInitialized,
1143
- user: d.user ?? null,
1144
- login: d.login ?? t.fn(),
1145
- logout: d.logout ?? t.fn(async () => {
1146
- })
1147
- } : {
1148
- isAuthenticated: !1,
1149
- isInitialized: !0,
1150
- user: null,
1151
- login: t.fn(),
1152
- logout: t.fn(async () => {
1153
- })
1154
- };
1155
- return {
1156
- ...e,
1157
- BaseProvider: t.fn(({ children: f }) => /* @__PURE__ */ u("div", { "data-testid": "base-provider", children: f })),
1158
- AuthProvider: p("auth-provider"),
1159
- EnvironmentProvider: p("environment-provider"),
1160
- FlagsProvider: p("flags-provider"),
1161
- HostToolsProvider: p("host-tools-provider"),
1162
- NetworkProvider: p("network-provider"),
1163
- UserPreferencesProvider: p("user-preferences-provider"),
1164
- useBaseStore: t.fn(
1165
- (f) => f(K)
1166
- ),
1167
- useAuth: t.fn(() => Y),
1168
- DomainCountryProvider: p("domain-country-provider"),
1169
- ModuleDictionaryProvider: p("module-dictionary-provider"),
1170
- ModuleSkeletonProvider: p("module-skeleton-provider"),
1171
- CommonFlags: {
1172
- FLAG_DOMAIN_LOADED: "FLAG_DOMAIN_LOADED",
1173
- FLAG_DICTIONARY_LOADED: "FLAG_DICTIONARY_LOADED",
1174
- FLAG_PRIVILEGES_LOADED: "FLAG_PRIVILEGES_LOADED"
1175
- },
1176
- EmitEvents: {
1177
- EMMIT_EVENT_HOST_EMERGE_WINDOW: "EMMIT_EVENT_HOST_EMERGE_WINDOW"
1178
- },
1179
- getPropertyByString: t.fn(
1180
- (f, I, _) => {
1181
- if (f == null)
1182
- return _;
1183
- try {
1184
- return I.split(".").reduce(
1185
- (Z, X) => Z?.[X],
1186
- f
1187
- ) ?? _;
1188
- } catch {
1189
- return _;
1190
- }
1191
- }
1192
- ),
1193
- useEnvironment: t.fn(() => m),
1194
- useDomainCountry: t.fn(() => ({
1195
- id: 1,
1196
- currency: "USD",
1197
- currency_decimal_digits: 2,
1198
- decimal_symbol: ".",
1199
- thousands_symbol: ","
1200
- })),
1201
- useFlagsPresent: t.fn().mockReturnValue(!0),
1202
- useFlagsStore: t.fn(
1203
- (f) => f(z)
1204
- ),
1205
- useHostTools: t.fn(() => M),
1206
- useModuleDictionary: t.fn(() => ({
1207
- getLabel: t.fn(i),
1208
- getModuleLabel: t.fn(() => a)
1209
- })),
1210
- useModulePrivileges: t.fn(),
1211
- useModuleSkeleton: t.fn(() => !1),
1212
- useLocalStorage: t.fn(
1213
- (f, I) => [I, t.fn()]
1214
- ),
1215
- useNetwork: t.fn(),
1216
- DEFAULT_USER_PREFERENCES: re,
1217
- normalizeUserPreferences: t.fn((f) => ({
1218
- decimalSymbol: typeof f?.decimalSymbol == "string" ? f.decimalSymbol : h.decimalSymbol,
1219
- thousandsSymbol: typeof f?.thousandsSymbol == "string" ? f.thousandsSymbol : h.thousandsSymbol,
1220
- dateFormat: typeof f?.dateFormat == "string" ? f.dateFormat : typeof f?.dateFormat?.format == "string" ? (f?.dateFormat).format : h.dateFormat,
1221
- timeFormat: typeof f?.timeFormat == "string" ? f.timeFormat : typeof f?.timeFormat?.format == "string" ? (f?.timeFormat).format : h.timeFormat,
1222
- timeZone: f?.timeZone !== void 0 ? f.timeZone : h.timeZone,
1223
- locale: typeof f?.locale == "string" ? f.locale : typeof f?.locale?.id == "string" ? (f?.locale).id : h.locale,
1224
- magnitudesSystemId: typeof f?.magnitudesSystemId == "number" ? f.magnitudesSystemId : typeof f?.magnitudesSystem?.id == "number" ? (f?.magnitudesSystem).id : h.magnitudesSystemId,
1225
- properties: Array.isArray(f?.properties) ? f.properties : h.properties,
1226
- currency: typeof f?.currency == "string" ? f.currency : h.currency,
1227
- currencyDecimalDigits: typeof f?.currencyDecimalDigits == "number" ? f.currencyDecimalDigits : h.currencyDecimalDigits
1228
- })),
1229
- useUserPreferences: t.fn(() => ({
1230
- ...b,
1231
- changeUserPreferences: t.fn(
1232
- b.changeUserPreferences
1233
- ),
1234
- convertMagnitude: t.fn(
1235
- b.convertMagnitude
1236
- ),
1237
- formatNumber: t.fn(
1238
- b.formatNumber
1239
- ),
1240
- getMagnitudeProperty: t.fn(
1241
- b.getMagnitudeProperty
1242
- )
1243
- })),
1244
- voidFunction: t.fn(),
1245
- ...c
1246
- };
1247
- }
1248
- function pt({
1249
- baseModule: e = {},
1250
- moduleOverrides: n = {}
1251
- } = {}) {
1252
- return {
1253
- ...e,
1254
- getContrastTextColor: t.fn(() => "#000000"),
1255
- useIsMobile: t.fn(() => !1),
1256
- usePaginate: t.fn(() => ({
1257
- pagerState: {
1258
- page: 1,
1259
- rowsPerPage: 10,
1260
- totalRows: 0
1261
- },
1262
- rows: [],
1263
- onPageChange: t.fn(),
1264
- onRowsPerPageChange: t.fn(),
1265
- Refresh: t.fn()
1266
- })),
1267
- useInfinitePaginate: t.fn(() => ({
1268
- rows: [],
1269
- setRows: t.fn(),
1270
- totalRecords: 0,
1271
- loading: !1,
1272
- Refresh: t.fn(),
1273
- clearRows: t.fn(),
1274
- rowsPerPage: 25,
1275
- infiniteScrollOptions: {
1276
- hasMore: !1,
1277
- isLoadingMore: !1,
1278
- loadMoreError: !1,
1279
- onLoadMore: t.fn(),
1280
- resetKey: 0,
1281
- totalRecords: 0,
1282
- rowsPerPage: 25,
1283
- onRowsPerPageChange: t.fn()
1284
- }
1285
- })),
1286
- useRows: t.fn(() => ({
1287
- rows: [],
1288
- refresh: t.fn()
1289
- })),
1290
- getLocaleFromNetwork: t.fn(),
1291
- useLocales: t.fn(() => ({
1292
- currentLocale: {
1293
- localeString: "en"
1294
- }
1295
- })),
1296
- useThemeSettingsStore: t.fn(
1297
- (o) => o({
1298
- settingsActions: {
1299
- handleOpen: t.fn()
1300
- }
1301
- })
1302
- ),
1303
- FormatterProvider: p("formatter-provider"),
1304
- HostThemeProvider: p("host-theme-provider"),
1305
- LocalesProvider: p("locales-provider"),
1306
- ThemeSettingsProvider: p("theme-settings-provider"),
1307
- DeviceTypeProvider: p("device-type-provider"),
1308
- ...n
1309
- };
1310
- }
1311
- function mt({
1312
- baseModule: e = {},
1313
- moduleOverrides: n = {}
1314
- } = {}) {
1315
- return {
1316
- ...e,
1317
- EnvironmentType: {
1318
- DEVELOPMENT: "development",
1319
- PRODUCTION: "production",
1320
- STAGING: "staging"
1321
- },
1322
- MasterDetailLayout: t.fn(({ children: o, ...r }) => /* @__PURE__ */ u("div", { "data-testid": "master-detail-layout", ...r, children: o })),
1323
- MFHostApp: t.fn(({ children: o }) => o),
1324
- ModuleDetailTabs: t.fn(
1325
- ({
1326
- tabs: o
1327
- }) => /* @__PURE__ */ u("div", { children: o.map((r) => /* @__PURE__ */ u("div", { children: typeof r.tabContent == "function" ? r.tabContent() : r.tabContent }, r.value)) })
1328
- ),
1329
- ModuleLayout: t.fn(({ children: o }) => /* @__PURE__ */ u("div", { "data-testid": "module-layout", children: o })),
1330
- MFNoAuthApp: p("mock-mf-no-auth-app"),
1331
- NoAuthModuleLayout: t.fn(() => /* @__PURE__ */ u("div", { "data-testid": "no-auth-layout" })),
1332
- createAppMF: t.fn(),
1333
- getMasterDetailLayoutComponentsDictionary: t.fn(() => []),
1334
- useModule: t.fn(),
1335
- useMasterDetail: t.fn(() => ({
1336
- onChangeMasterSelection: t.fn(),
1337
- onClickViewDetail: t.fn()
1338
- })),
1339
- useDynamicAccordions: t.fn(() => ({
1340
- configDynamicAccordions: t.fn(() => ({
1341
- detailInventory: t.fn(() => ({}))
1342
- }))
1343
- })),
1344
- useNetworkActionConfirm: t.fn(() => ({
1345
- onAction: t.fn()
1346
- })),
1347
- ...n
1348
- };
1349
- }
1350
- function yt({
1351
- createComponentFieldImplementation: e
1352
- } = {}) {
1353
- return {
1354
- useDynamicPaperForm: t.fn(),
1355
- useFormAddEdit: t.fn(),
1356
- createComponentField: t.fn(
1357
- e ?? ((n) => n)
1358
- )
1359
- };
1360
- }
1361
- function gt({
1362
- baseModule: e = {},
1363
- domEventData: n,
1364
- moduleOverrides: o = {},
1365
- scaleControlFactory: r
1366
- } = {}) {
1367
- const a = e, i = a.default ?? a, s = i.DomEvent ?? {}, c = i.control ?? {};
1368
- return {
1369
- ...a,
1370
- default: {
1371
- ...i,
1372
- DomEvent: {
1373
- ...s,
1374
- disableClickPropagation: n?.disableClickPropagation ?? t.fn(),
1375
- disableScrollPropagation: n?.disableScrollPropagation ?? t.fn()
1376
- },
1377
- control: {
1378
- ...c,
1379
- scale: r !== void 0 ? t.fn(() => r()) : c.scale ?? t.fn()
1380
- }
1381
- },
1382
- ...o
1383
- };
1384
- }
1385
- function vt({
1386
- baseModule: e = {},
1387
- dataGridPersistenceData: n,
1388
- dynamicFilterAndSortData: o,
1389
- modalData: r,
1390
- moduleOverrides: a = {},
1391
- popupsStoreData: i,
1392
- windowToolsData: s
1393
- } = {}) {
1394
- const c = n ?? {
1395
- defaultUserColumns: void 0,
1396
- onChangeUserColumns: t.fn()
1397
- }, d = o ?? {
1398
- customHeaderComponent: null,
1399
- externalFilterSettings: void 0,
1400
- externalSortSettings: void 0,
1401
- leftActions: null,
1402
- rightActions: null,
1403
- visibleCustomHeader: !1
1404
- }, l = r ?? {
1405
- closeModal: t.fn(),
1406
- openModal: t.fn()
1407
- }, m = i ?? {
1408
- popupActions: {
1409
- close: t.fn(),
1410
- hide: t.fn(),
1411
- show: t.fn()
1412
- },
1413
- popupsActions: {
1414
- addPopup: t.fn()
1415
- }
1416
- }, M = s ?? {
1417
- getCookie: t.fn(),
1418
- getWindowId: t.fn(() => "test-window-id"),
1419
- setCookie: t.fn(),
1420
- startProgress: t.fn(),
1421
- stopProgress: t.fn()
1422
- };
1423
- return {
1424
- ...W({ baseModule: e }),
1425
- PopupsProvider: v("mock-popups-provider"),
1426
- useDataGridPersistence: t.fn(() => c),
1427
- useDynamicFilterAndSort: t.fn(() => d),
1428
- useModal: t.fn(() => l),
1429
- usePopupsStore: t.fn(
1430
- (h) => h(m)
1431
- ),
1432
- useWatchTyped: t.fn(() => {
1433
- }),
1434
- useWindowToolsMF: t.fn(() => M),
1435
- ...a
1436
- };
1437
- }
1438
- function ht({
1439
- baseModule: e = {},
1440
- environmentData: n,
1441
- getLabel: o = (d, l) => l ? `label:${d}:${l}` : `label:${d}`,
1442
- hostToolsData: r,
1443
- moduleOverrides: a = {},
1444
- moduleLabel: i = "Test Module",
1445
- modulePrivilegesData: s,
1446
- networkData: c
1447
- } = {}) {
1448
- const d = x({
1449
- ...ie,
1450
- ...n
1451
- }), l = r ?? B(), m = s ?? {
1452
- hasPrivilege: t.fn(() => !0)
1453
- }, M = c ?? {
1454
- networkOperation: t.fn()
1455
- };
1456
- return {
1457
- ...e,
1458
- useLocalStorageWithListener: t.fn(
1459
- (h, b) => [b, t.fn()]
1460
- ),
1461
- useEnvironment: t.fn(() => d),
1462
- useHostTools: t.fn(() => l),
1463
- useModuleDictionary: t.fn(() => ({
1464
- getLabel: t.fn(o),
1465
- getModuleLabel: t.fn(() => i)
1466
- })),
1467
- useModulePrivileges: t.fn(() => m),
1468
- useModuleSkeleton: t.fn(() => !1),
1469
- useNetwork: t.fn(() => M),
1470
- ...a
1471
- };
1472
- }
1473
- function St({
1474
- baseModule: e = {},
1475
- mapStoreState: n,
1476
- moduleOverrides: o = {}
1477
- } = {}) {
1478
- const r = {
1479
- ...we(),
1480
- ...n
1481
- };
1482
- return {
1483
- ...e,
1484
- LAT_LON_FIXED_DIGITS: 6,
1485
- createPixelPathDecimationFilter: t.fn(() => t.fn()),
1486
- courseToCartesianAngle: t.fn((a) => a),
1487
- getCourseDirection: t.fn(
1488
- (a, i, s = 5) => i >= 0 + s && i < 90 - s ? a("LABEL_NORTH_EAST") : i >= 90 - s && i < 90 + s ? a("LABEL_NORTH") : i >= 90 + s && i < 180 - s ? a("LABEL_NORTH_WEST") : i >= 180 - s && i < 180 + s ? a("LABEL_WEST") : i >= 180 + s && i < 270 - s ? a("LABEL_SOUTH_WEST") : i >= 270 - s && i < 270 + s ? a("LABEL_SOUTH") : i >= 270 + s && i < 360 - s ? a("LABEL_SOUTH_EAST") : a("LABEL_EAST")
1489
- ),
1490
- IndicatorValueAndMagnitude: t.fn(
1491
- ({
1492
- value: a,
1493
- magnitude: i,
1494
- minWidth: s
1495
- }) => /* @__PURE__ */ u(
1496
- "div",
1497
- {
1498
- "data-testid": "mock-indicator-value-and-magnitude",
1499
- "data-value": String(a),
1500
- "data-magnitude": i ?? "",
1501
- "data-min-width": s ?? ""
1502
- }
1503
- )
1504
- ),
1505
- getMapComponentsDictionary: t.fn(() => []),
1506
- getDeviceComponentsDictionary: t.fn(() => []),
1507
- getCourseFormatterComponentsDictionary: t.fn(() => []),
1508
- getIndicatorCSQComponentsDictionary: t.fn(() => []),
1509
- getGpsMapToolsComponentsDictionary: t.fn(() => []),
1510
- getDevicesPickerComponentsDictionary: t.fn(() => []),
1511
- getCheckableDevicesPickerComponentsDictionary: t.fn(() => []),
1512
- /**
1513
- * Catalog of components that can be rendered in place of
1514
- * `RHFAutocompleteAsync`. A suite that builds filter fields only needs the
1515
- * entry to resolve; the rendered picker itself is a placeholder.
1516
- */
1517
- RHF_AUTOCOMPLETE_ASYNC_RENDER_AS_REGISTRY: {
1518
- devices: T("rhf-devices-picker")
1519
- },
1520
- /**
1521
- * Device label contract mirrored from `@m4l/gclick`: alias first, name
1522
- * when there is none.
1523
- */
1524
- resolveDeviceTitle: t.fn(
1525
- (a) => a?.alias?.trim() || a?.name?.trim() || ""
1526
- ),
1527
- GpsMap: S("mock-gps-map", "GpsMap"),
1528
- IndicatorValueStatus: S(
1529
- "mock-indicator-value-status",
1530
- "IndicatorValueStatus"
1531
- ),
1532
- MapProvider: t.fn(({ children: a }) => /* @__PURE__ */ u("div", { "data-testid": "map-provider", children: a })),
1533
- getHdopPresentation: t.fn(
1534
- ({ hdop: a }) => a < 0 ? { precisionMeters: void 0, status: "UNKNOWN", color: "warning" } : a === 0 ? { precisionMeters: 0, status: "EXCELLENT", color: "success" } : a < 3 ? { precisionMeters: 2.5, status: "GOOD", color: "primary" } : { precisionMeters: 10, status: "POOR", color: "error" }
1535
- ),
1536
- useDeviceStatus: t.fn(() => ({
1537
- label: "Test status",
1538
- palletColor: "primary",
1539
- iconKey: "online"
1540
- })),
1541
- useMapStore: t.fn(
1542
- (a) => a(r)
1543
- ),
1544
- ...o
1545
- };
1546
- }
1547
- function Mt() {
1548
- const e = { scopeKey: "test-scope", refreshKey: void 0 }, n = {
1549
- scopeKey: "test-scope",
1550
- publishResourceChange: t.fn(async (r) => r.operationId ?? "operation-test"),
1551
- reportFailure: t.fn()
1552
- }, o = t.fn(async () => ({ status: "cancelled" }));
1553
- return {
1554
- PERSONS_RESOURCE: "rt_persons",
1555
- PROTOCOL_PERSON_REPORT_METHODS_RESOURCE: "rt_protocol_person_report_methods",
1556
- useResourceInvalidation: t.fn(() => e),
1557
- useResourceMutation: t.fn(() => n),
1558
- useEntityReferenceAdd: t.fn(() => o)
1559
- };
1560
- }
1561
- const He = "#1E96DC", Ne = /* @__PURE__ */ new Set(["state", "updatedAt", "value"]);
1562
- var G = /* @__PURE__ */ ((e) => (e[e.off = 0] = "off", e[e.moving = 1] = "moving", e[e.stopped = 2] = "stopped", e[e.stoppedRalenti = 3] = "stoppedRalenti", e[e.stoppedExcesiveRalenti = 4] = "stoppedExcesiveRalenti", e[e.towing = 5] = "towing", e[e.powerSaving = 6] = "powerSaving", e[e.maxSpeed = 7] = "maxSpeed", e[e.notDetectable = 250] = "notDetectable", e))(G || {}), J = /* @__PURE__ */ ((e) => (e[e.reliable = 0] = "reliable", e[e.acceptable = 1] = "acceptable", e[e.noSignal = 2] = "noSignal", e))(J || {});
1563
- function F(e) {
1564
- if (typeof e != "object" || e === null || Array.isArray(e))
1565
- return !1;
1566
- const n = Object.getPrototypeOf(e);
1567
- return n === Object.prototype || n === null;
1568
- }
1569
- function N(e) {
1570
- return F(e) ? Object.keys(e).some((n) => Ne.has(n)) : !1;
1571
- }
1572
- function qe(e, n) {
1573
- const o = e.updatedAt, r = n.updatedAt;
1574
- if (typeof o != "string" || typeof r != "string")
1575
- return !1;
1576
- const a = new Date(o).getTime(), i = new Date(r).getTime();
1577
- return !Number.isFinite(a) || !Number.isFinite(i) ? !1 : i < a;
1578
- }
1579
- function xe(e, n) {
1580
- try {
1581
- return e == null ? n : typeof e == "object" ? e?.value ?? n : e;
1582
- } catch {
1583
- return n;
1584
- }
1585
- }
1586
- function Be(e, n = (/* @__PURE__ */ new Date()).toISOString()) {
1587
- try {
1588
- if (typeof e == "object")
1589
- return e?.updatedAt ?? n;
1590
- } catch {
1591
- return n;
1592
- }
1593
- return n;
1594
- }
1595
- function j(e, n) {
1596
- if (n !== void 0) {
1597
- if (N(e) && N(n))
1598
- return qe(e, n) ? { ...e } : {
1599
- ...e,
1600
- ...n
1601
- };
1602
- if (Array.isArray(n))
1603
- return n;
1604
- if (F(e) && F(n)) {
1605
- let o = n, r = !1;
1606
- return Object.entries(n).forEach(([a, i]) => {
1607
- const s = j(
1608
- e[a],
1609
- i
1610
- );
1611
- s === i && s !== void 0 || (r || (o = { ...n }, r = !0), s === void 0 ? delete o[a] : o[a] = s);
1612
- }), o;
1613
- }
1614
- return n;
1615
- }
1616
- }
1617
- function Ue(e, n) {
1618
- const o = j(
1619
- e,
1620
- n
1621
- );
1622
- return F(o) ? o : n;
1623
- }
1624
- function Pt({
1625
- baseModule: e = {},
1626
- moduleOverrides: n = {},
1627
- surface: o = "root"
1628
- } = {}) {
1629
- const r = {
1630
- BASE_SVG_COLOR: He,
1631
- GNSSEnumMotionStatus: G,
1632
- GNSSEnumSignal: J
1633
- }, a = {
1634
- getVptValueWithGuard: t.fn(xe),
1635
- getVptUpdatedAtWithGuard: t.fn(Be),
1636
- mergeDevicePayloadWithUpdatedAtGuard: t.fn(
1637
- Ue
1638
- )
1639
- };
1640
- return {
1641
- ...e,
1642
- ...o === "payload" ? a : r,
1643
- ...n
1644
- };
1645
- }
1646
- function At({
1647
- baseModule: e = {},
1648
- moduleOverrides: n = {}
1649
- } = {}) {
1650
- return {
1651
- ...e,
1652
- getContrastTextColor: t.fn(() => "#000000"),
1653
- useIsMobile: t.fn(() => !1),
1654
- usePaginate: t.fn(() => ({
1655
- pagerState: {
1656
- page: 1,
1657
- rowsPerPage: 10,
1658
- totalRecords: 0
1659
- },
1660
- rows: [],
1661
- onPageChange: t.fn(),
1662
- onRowsPerPageChange: t.fn(),
1663
- Refresh: t.fn()
1664
- })),
1665
- useRows: t.fn(() => ({
1666
- rows: [],
1667
- refresh: t.fn()
1668
- })),
1669
- ...n
1670
- };
1671
- }
1672
- function bt({
1673
- baseModule: e = {},
1674
- moduleOverrides: n = {}
1675
- } = {}) {
1676
- return {
1677
- ...e,
1678
- DynamicTabs: S("dynamic-tabs"),
1679
- MasterDetailLayout: v(
1680
- "master-detail-layout"
1681
- ),
1682
- ModuleDetailTabs: t.fn(
1683
- ({
1684
- tabs: o
1685
- }) => /* @__PURE__ */ u("div", { "data-testid": "module-detail-tabs", children: o?.map((r) => /* @__PURE__ */ u("div", { children: typeof r.tabContent == "function" ? r.tabContent() : r.tabContent }, r.value)) })
1686
- ),
1687
- ModuleLayout: v("module-layout"),
1688
- useFormAddEdit: t.fn(() => ({
1689
- formValues: {},
1690
- statusLoad: "idle"
1691
- })),
1692
- useMasterDetail: t.fn(() => ({
1693
- onChangeMasterSelection: t.fn(),
1694
- onClickViewDetail: t.fn(),
1695
- refreshMaster: t.fn(),
1696
- setRefreshMaster: t.fn()
1697
- })),
1698
- useModule: t.fn(() => ({
1699
- setDynamicActions: t.fn()
1700
- })),
1701
- useNetworkActionConfirm: t.fn(() => ({
1702
- onAction: t.fn()
1703
- })),
1704
- MFHostApp: t.fn(({ children: o }) => o),
1705
- ...n
1706
- };
1707
- }
1708
- function Tt({
1709
- baseModule: e = {},
1710
- moduleOverrides: n = {},
1711
- useFormContextData: o = {}
1712
- } = {}) {
1713
- return {
1714
- ...e,
1715
- useFormContext: t.fn(() => ({
1716
- control: {},
1717
- getValues: t.fn(),
1718
- reset: t.fn(),
1719
- setValue: t.fn(),
1720
- trigger: t.fn(),
1721
- watch: t.fn(),
1722
- formState: {
1723
- dirtyFields: {},
1724
- errors: {}
1725
- },
1726
- ...o
1727
- })),
1728
- ...n
1729
- };
1730
- }
1731
- function Ct() {
1732
- return {
1733
- Resizable: t.fn(({ children: e }) => /* @__PURE__ */ u("div", { "data-testid": "resizable", children: e }))
1734
- };
1735
- }
1736
- function Dt({
1737
- baseModule: e = {},
1738
- moduleOverrides: n = {},
1739
- useMapData: o,
1740
- useMapImplementation: r
1741
- } = {}) {
1742
- return {
1743
- ...e,
1744
- Circle: t.fn(
1745
- ({
1746
- center: a,
1747
- radius: i,
1748
- eventHandlers: s,
1749
- ...c
1750
- }) => /* @__PURE__ */ u(
1751
- "div",
1752
- {
1753
- "data-testid": "circle",
1754
- "data-center": JSON.stringify(a ?? null),
1755
- "data-radius": String(i ?? ""),
1756
- "data-event-handlers": JSON.stringify(s ?? {}),
1757
- "data-props": JSON.stringify(c)
1758
- }
1759
- )
1760
- ),
1761
- GeoJSON: t.fn(
1762
- ({
1763
- data: a,
1764
- eventHandlers: i,
1765
- ...s
1766
- }) => /* @__PURE__ */ u(
1767
- "div",
1768
- {
1769
- "data-testid": "geojson",
1770
- "data-geojson": JSON.stringify(a ?? null),
1771
- "data-event-handlers": JSON.stringify(i ?? {}),
1772
- "data-props": JSON.stringify(s)
1773
- }
1774
- )
1775
- ),
1776
- LayerGroup: t.fn(({ children: a }) => /* @__PURE__ */ u("div", { "data-testid": "layer-group", children: a })),
1777
- Polyline: t.fn(
1778
- ({
1779
- positions: a,
1780
- eventHandlers: i,
1781
- ...s
1782
- }) => /* @__PURE__ */ u(
1783
- "div",
1784
- {
1785
- "data-testid": "polyline",
1786
- "data-positions": JSON.stringify(a ?? []),
1787
- "data-event-handlers": JSON.stringify(i ?? {}),
1788
- "data-props": JSON.stringify(s)
1789
- }
1790
- )
1791
- ),
1792
- Polygon: t.fn(
1793
- ({
1794
- positions: a,
1795
- eventHandlers: i,
1796
- ...s
1797
- }) => /* @__PURE__ */ u(
1798
- "div",
1799
- {
1800
- "data-testid": "polygon",
1801
- "data-positions": JSON.stringify(a ?? []),
1802
- "data-event-handlers": JSON.stringify(i ?? {}),
1803
- "data-props": JSON.stringify(s)
1804
- }
1805
- )
1806
- ),
1807
- Marker: t.fn(
1808
- ({
1809
- children: a,
1810
- position: i,
1811
- icon: s,
1812
- eventHandlers: c,
1813
- ...d
1814
- }) => /* @__PURE__ */ u(
1815
- "div",
1816
- {
1817
- "data-testid": "marker",
1818
- "data-position": JSON.stringify(i),
1819
- "data-icon": JSON.stringify(s),
1820
- "data-event-handlers": JSON.stringify(c ?? {}),
1821
- "data-props": JSON.stringify(d),
1822
- children: a
1823
- }
1824
- )
1825
- ),
1826
- Popup: t.fn(({ children: a }) => /* @__PURE__ */ u("div", { "data-testid": "popup", children: a })),
1827
- useMap: t.fn(
1828
- () => r ? r() : o
1829
- ),
1830
- ...n
1831
- };
1832
- }
1833
- export {
1834
- Dt as $,
1835
- H as A,
1836
- ot as B,
1837
- it as C,
1838
- k as D,
1839
- at as E,
1840
- st as F,
1841
- ct as G,
1842
- dt as H,
1843
- ut as I,
1844
- ft as J,
1845
- lt as K,
1846
- pt as L,
1847
- ne as M,
1848
- mt as N,
1849
- yt as O,
1850
- W as P,
1851
- gt as Q,
1852
- $e as R,
1853
- vt as S,
1854
- ht as T,
1855
- St as U,
1856
- Mt as V,
1857
- Pt as W,
1858
- At as X,
1859
- bt as Y,
1860
- Tt as Z,
1861
- Ct as _,
1862
- oe as a,
1863
- ie as b,
1864
- ae as c,
1865
- U as d,
1866
- Qe as e,
1867
- et as f,
1868
- Xe as g,
1869
- p as h,
1870
- S as i,
1871
- Ce as j,
1872
- v as k,
1873
- De as l,
1874
- T as m,
1875
- Oe as n,
1876
- Ee as o,
1877
- Fe as p,
1878
- ke as q,
1879
- Ie as r,
1880
- _e as s,
1881
- tt as t,
1882
- C as u,
1883
- rt as v,
1884
- Re as w,
1885
- Le as x,
1886
- nt as y,
1887
- we as z
1888
- };