@amsom-habitat/ui 2.20.5 → 2.20.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.
package/dist/ui.js CHANGED
@@ -1,16 +1,2039 @@
1
- import { a as s, l as o, f as e, h as A, A as l, d as t, j as r, k as i, n as d, i as n, m as p, e as S, A as g } from "./index-BXzu--j9.js";
1
+ import { FontAwesomeIcon as D } from "@fortawesome/vue-fontawesome";
2
+ import { library as M } from "@fortawesome/fontawesome-svg-core";
3
+ import { faTimes as Q, faCheck as W, faCamera as X, faTrash as R, faArrowRight as $, faArrowLeft as ee, faEye as q, faEyeSlash as K, faArrowDownWideShort as te, faArrowUpShortWide as se, faPlus as le, faAnglesLeft as ie, faAngleLeft as ne, faAngleRight as oe, faAnglesRight as ae, faCloudArrowDown as re, faTriangleExclamation as de, faCloudArrowUp as ue, faPaperclip as ce, faFileCirclePlus as me } from "@fortawesome/free-solid-svg-icons";
4
+ import { resolveComponent as x, createBlock as k, openBlock as n, Teleport as fe, createElementVNode as o, createElementBlock as r, createCommentVNode as g, normalizeStyle as _, normalizeClass as f, withModifiers as w, renderSlot as I, toDisplayString as p, Fragment as y, renderList as v, createTextVNode as A, useCssVars as ge, createVNode as b, withCtx as z, withDirectives as N, vModelCheckbox as E, vShow as he } from "vue";
5
+ import { isImage as j, resizeImage as G, handleFile as J, base64ToBlob as pe, openFileBlob as ye, downloadBlob as be, imageToPDF as Se, openFileBase64 as xe, isPdf as ke } from "@amsom-habitat/file-utils";
6
+ import { VueDraggableNext as we } from "vue-draggable-next";
7
+ import P from "moment-timezone";
8
+ import { unixToDateString as Ce } from "@amsom-habitat/date-utils";
9
+ import ve from "pdf-merger-js";
10
+ const C = (s, e) => {
11
+ const t = s.__vccOpts || s;
12
+ for (const [c, i] of e)
13
+ t[c] = i;
14
+ return t;
15
+ };
16
+ M.add(Q);
17
+ const _e = {
18
+ name: "AmsomModalComponent",
19
+ components: {
20
+ FontAwesomeIcon: D
21
+ },
22
+ props: {
23
+ closeOption: {
24
+ type: Boolean,
25
+ default: !1
26
+ },
27
+ size: {
28
+ type: String,
29
+ default: "md",
30
+ validator(s) {
31
+ return ["xxs", "xs", "sm", "md", "lg", "xl"].includes(s);
32
+ }
33
+ },
34
+ position: {
35
+ type: String,
36
+ default: "center",
37
+ validator(s) {
38
+ return ["top", "center", "bottom"].includes(s);
39
+ }
40
+ },
41
+ title: {
42
+ type: String,
43
+ default: ""
44
+ },
45
+ reducible: {
46
+ type: Boolean,
47
+ default: !1
48
+ },
49
+ classTitle: {
50
+ type: String,
51
+ default: "h4 text-center"
52
+ }
53
+ },
54
+ emits: ["close"],
55
+ data() {
56
+ return {
57
+ alreadyHidden: !1,
58
+ modalId: this.$options.modalManager.generateModalId(),
59
+ reduced: !1,
60
+ mouseDownOnBackdrop: !1
61
+ };
62
+ },
63
+ // Gestionnaire global des modales ouvertes
64
+ // Utilise un array pour maintenir l'ordre d'ouverture et fermer la bonne modal avec ESC
65
+ modalManager: {
66
+ openModals: [],
67
+ baseZIndex: 1e4,
68
+ // Z-index de base pour les modals - au-dessus de Bootstrap (max ~1090) et Overlay
69
+ zIndexIncrement: 10,
70
+ // Incrément de z-index entre chaque modal
71
+ modalCounter: 0,
72
+ // Compteur pour générer des IDs uniques
73
+ // Configuration des tailles de modal
74
+ sizes: {
75
+ xxs: "col-12 col-md-3",
76
+ xs: "col-12 col-md-4",
77
+ sm: "col-12 col-md-6",
78
+ md: "col-12 col-md-8",
79
+ lg: "col-12 col-md-10",
80
+ xl: "col-12"
81
+ },
82
+ generateModalId() {
83
+ return `modal-${Date.now()}-${++this.modalCounter}`;
84
+ },
85
+ register(s) {
86
+ this.openModals.push(s);
87
+ },
88
+ unregister(s) {
89
+ const e = this.openModals.indexOf(s);
90
+ e > -1 && this.openModals.splice(e, 1);
91
+ },
92
+ getTopModal() {
93
+ return this.openModals[this.openModals.length - 1];
94
+ },
95
+ clear() {
96
+ this.openModals.length = 0;
97
+ }
98
+ },
99
+ computed: {
100
+ // Z-index dynamique basé sur l'ordre d'ouverture
101
+ modalZIndex() {
102
+ const s = this.$options.modalManager.openModals.indexOf(this.modalId);
103
+ return this.$options.modalManager.baseZIndex + (s >= 0 ? s * this.$options.modalManager.zIndexIncrement : 0);
104
+ },
105
+ // Dimension de la modal
106
+ modalSize() {
107
+ return this.$options.modalManager.sizes[this.size] || this.$options.modalManager.sizes.md;
108
+ },
109
+ // Alignement vertical de la modal
110
+ alignmentClass() {
111
+ return {
112
+ top: "flex-start",
113
+ center: "center",
114
+ bottom: "flex-end"
115
+ }[this.position] || "center";
116
+ }
117
+ },
118
+ mounted() {
119
+ this.$options.modalManager.register(this.modalId), this.$options.modalManager.openModals.length === 1 && this.lockBodyScroll(), this.closeOption && document.addEventListener("keydown", this.closeEsc);
120
+ },
121
+ beforeUnmount() {
122
+ this.$options.modalManager.unregister(this.modalId), this.$options.modalManager.openModals.length === 0 && this.unlockBodyScroll(), this.closeOption && document.removeEventListener("keydown", this.closeEsc);
123
+ },
124
+ methods: {
125
+ lockBodyScroll() {
126
+ if (window.getComputedStyle(document.body).overflow === "hidden") {
127
+ this.alreadyHidden = !0;
128
+ return;
129
+ }
130
+ document.body.style.overflow = "hidden";
131
+ },
132
+ unlockBodyScroll() {
133
+ this.alreadyHidden || (document.body.style.overflow = "");
134
+ },
135
+ // Gestion du mousedown sur le backdrop pour tracker où commence le clic
136
+ handleBackdropMouseDown(s) {
137
+ s.target === s.currentTarget && (this.mouseDownOnBackdrop = !0);
138
+ },
139
+ // Gestion du mousedown sur la modal pour tracker le début
140
+ handleModalMouseDown() {
141
+ this.mouseDownOnBackdrop = !1;
142
+ },
143
+ // Gestion du mouseup sur la modal pour empêcher la fermeture
144
+ handleModalMouseUp() {
145
+ this.mouseDownOnBackdrop = !1;
146
+ },
147
+ // Gestion du clic sur le backdrop (arrière-plan)
148
+ handleBackdropClick(s) {
149
+ s.target === s.currentTarget && this.mouseDownOnBackdrop && this.closeOption && this.$emit("close"), this.mouseDownOnBackdrop = !1;
150
+ },
151
+ // Fermeture de la modal avec la touche echap
152
+ closeEsc(s) {
153
+ s.key === "Escape" && this.$options.modalManager.getTopModal() === this.modalId && this.$emit("close");
154
+ }
155
+ }
156
+ }, Pe = ["id"], Ie = { class: "amsom-modal-body mt-2" }, De = {
157
+ key: 0,
158
+ class: "position-fixed bottom-0 end-0 mb-3 me-3"
159
+ }, Me = {
160
+ key: 0,
161
+ class: "position-fixed bottom-0 end-0 mb-3 me-3"
162
+ };
163
+ function Be(s, e, t, c, i, l) {
164
+ const u = x("font-awesome-icon");
165
+ return n(), k(fe, { to: "body" }, [
166
+ o("div", {
167
+ class: f(["p-2 m-0 bg-black bg-opacity-25 position-fixed overflow-y-auto", { "d-none": i.reduced }]),
168
+ style: _({
169
+ zIndex: l.modalZIndex,
170
+ inset: 0
171
+ }),
172
+ onMousedown: e[7] || (e[7] = (...d) => l.handleBackdropMouseDown && l.handleBackdropMouseDown(...d)),
173
+ onClick: e[8] || (e[8] = (...d) => l.handleBackdropClick && l.handleBackdropClick(...d))
174
+ }, [
175
+ o("div", {
176
+ class: "d-flex justify-content-center",
177
+ style: _({
178
+ minHeight: "100%",
179
+ alignItems: l.alignmentClass,
180
+ paddingTop: t.position === "center" ? "2rem" : "1rem",
181
+ paddingBottom: t.position === "center" ? "2rem" : "1rem"
182
+ }),
183
+ onMousedown: e[4] || (e[4] = (...d) => l.handleBackdropMouseDown && l.handleBackdropMouseDown(...d)),
184
+ onClick: e[5] || (e[5] = (...d) => l.handleBackdropClick && l.handleBackdropClick(...d))
185
+ }, [
186
+ o("div", {
187
+ id: i.modalId,
188
+ class: f(["container-fluid bg-white rounded-4 p-3 position-relative d-flex flex-column", l.modalSize]),
189
+ style: {
190
+ minHeight: "auto",
191
+ maxHeight: "none"
192
+ },
193
+ onClick: e[1] || (e[1] = w(() => {
194
+ }, ["stop"])),
195
+ onMousedown: e[2] || (e[2] = (...d) => l.handleModalMouseDown && l.handleModalMouseDown(...d)),
196
+ onMouseup: e[3] || (e[3] = (...d) => l.handleModalMouseUp && l.handleModalMouseUp(...d))
197
+ }, [
198
+ t.closeOption ? (n(), k(u, {
199
+ key: 0,
200
+ icon: "fa-solid fa-times",
201
+ role: "button",
202
+ class: "position-absolute top-0 end-0 m-3 translate-middle-y",
203
+ size: "lg",
204
+ onClick: e[0] || (e[0] = (d) => s.$emit("close"))
205
+ })) : g("", !0),
206
+ o("div", Ie, [
207
+ I(s.$slots, "title", {}, () => [
208
+ t.title ? (n(), r("div", {
209
+ key: 0,
210
+ class: f(t.classTitle)
211
+ }, p(t.title), 3)) : g("", !0)
212
+ ]),
213
+ I(s.$slots, "default", {}, () => [
214
+ e[10] || (e[10] = o("p", null, " Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante. ", -1))
215
+ ])
216
+ ])
217
+ ], 42, Pe)
218
+ ], 36),
219
+ t.reducible ? (n(), r("div", De, [
220
+ o("button", {
221
+ class: "btn btn-primary",
222
+ onClick: e[6] || (e[6] = (d) => i.reduced = !i.reduced)
223
+ }, " Réduire la fenêtre ")
224
+ ])) : g("", !0)
225
+ ], 38),
226
+ t.reducible && i.reduced ? (n(), r("div", Me, [
227
+ o("button", {
228
+ class: "btn btn-primary",
229
+ onClick: e[9] || (e[9] = (d) => i.reduced = !i.reduced)
230
+ }, " Restaurer la fenêtre ")
231
+ ])) : g("", !0)
232
+ ]);
233
+ }
234
+ const Ae = /* @__PURE__ */ C(_e, [["render", Be]]), Te = {
235
+ name: "AmsomCard",
236
+ props: {
237
+ //string or null
238
+ title: {
239
+ type: String,
240
+ default: null
241
+ },
242
+ bgImage: {
243
+ type: String,
244
+ default: null
245
+ },
246
+ bgOpacity: {
247
+ type: Number,
248
+ default: 0.25,
249
+ validator: (s) => s >= 0 && s <= 1
250
+ },
251
+ bubbleTitle: {
252
+ type: Boolean,
253
+ default: !1
254
+ },
255
+ bubbleTitleClass: {
256
+ type: String,
257
+ default: "bg-primary text-white"
258
+ },
259
+ noBody: {
260
+ type: Boolean,
261
+ default: !1
262
+ },
263
+ header: {
264
+ type: Boolean,
265
+ default: !1
266
+ },
267
+ headerClass: {
268
+ type: String,
269
+ default: ""
270
+ },
271
+ cardClass: {
272
+ type: String,
273
+ default: ""
274
+ },
275
+ cardStyle: {
276
+ type: String,
277
+ default: ""
278
+ },
279
+ footer: {
280
+ type: Boolean,
281
+ default: !1
282
+ },
283
+ footerClass: {
284
+ type: String,
285
+ default: ""
286
+ }
287
+ }
288
+ }, ze = { class: "position-relative" }, Fe = {
289
+ key: 0,
290
+ class: "card-title"
291
+ }, Le = ["src"];
292
+ function Ne(s, e, t, c, i, l) {
293
+ return n(), r("div", ze, [
294
+ t.header ? (n(), r("div", {
295
+ key: 0,
296
+ class: f(["card card-header", t.headerClass])
297
+ }, [
298
+ I(s.$slots, "header")
299
+ ], 2)) : g("", !0),
300
+ o("div", {
301
+ class: f(["card position-relative h-100", [
302
+ {
303
+ "rounded-top-0": t.header,
304
+ "rounded-bottom-0": t.footer
305
+ },
306
+ t.cardClass
307
+ ]])
308
+ }, [
309
+ o("div", {
310
+ class: "position-relative overflow-y-auto h-100",
311
+ style: _(t.cardStyle)
312
+ }, [
313
+ o("div", {
314
+ class: f([
315
+ {
316
+ "card-body": !t.noBody
317
+ }
318
+ ]),
319
+ style: { position: "relative", "z-index": "1" }
320
+ }, [
321
+ I(s.$slots, "title", {}, () => [
322
+ t.title && !t.bubbleTitle ? (n(), r("h4", Fe, p(t.title), 1)) : g("", !0)
323
+ ]),
324
+ I(s.$slots, "default")
325
+ ], 2)
326
+ ], 4),
327
+ t.bgImage ? (n(), r("img", {
328
+ key: 0,
329
+ src: t.bgImage,
330
+ class: f(["img img-fluid bg-white object-fit-cover h-100 w-100 position-absolute top-0 start-0", [
331
+ {
332
+ "rounded-top-0": t.header,
333
+ "rounded-bottom-0": t.footer
334
+ }
335
+ ]]),
336
+ alt: "Image de fond du widget",
337
+ style: _({
338
+ opacity: t.bgOpacity,
339
+ zIndex: 0,
340
+ borderRadius: "inherit"
341
+ })
342
+ }, null, 14, Le)) : g("", !0)
343
+ ], 2),
344
+ t.title && t.bubbleTitle ? (n(), r("span", {
345
+ key: 1,
346
+ id: "bubble-title",
347
+ class: f(["position-absolute top-0 start-0 translate-middle-y rounded-pill shadow px-1", t.bubbleTitleClass]),
348
+ style: { "z-index": "2" }
349
+ }, p(t.title), 3)) : g("", !0),
350
+ t.footer ? (n(), r("div", {
351
+ key: 2,
352
+ class: f(["card card-footer", t.footerClass])
353
+ }, [
354
+ I(s.$slots, "footer")
355
+ ], 2)) : g("", !0)
356
+ ]);
357
+ }
358
+ const je = /* @__PURE__ */ C(Te, [["render", Ne]]), qe = {
359
+ name: "AmsomOverlay",
360
+ props: {
361
+ loading: {
362
+ type: Boolean,
363
+ default: !1,
364
+ required: !0
365
+ },
366
+ opacity: {
367
+ type: Number,
368
+ default: 60,
369
+ required: !1,
370
+ validator: (s) => s >= 0 && s <= 100
371
+ }
372
+ }
373
+ }, Ve = { class: "position-relative" };
374
+ function Ee(s, e, t, c, i, l) {
375
+ return n(), r("div", Ve, [
376
+ t.loading ? (n(), r("div", {
377
+ key: 0,
378
+ class: "position-absolute w-100 h-100 d-flex align-items-center justify-content-center rounded",
379
+ style: _({
380
+ backgroundColor: "rgba(193, 193, 193," + t.opacity / 100 + ")",
381
+ boxShadow: "inset 0 0 0 10px rgba(193, 193, 193, 0.5)",
382
+ zIndex: 1090
383
+ })
384
+ }, [...e[0] || (e[0] = [
385
+ o("div", {
386
+ class: "spinner-border text-primary position-sticky sticky-top",
387
+ role: "status"
388
+ }, [
389
+ o("span", { class: "sr-only visually-hidden" }, "Chargement...")
390
+ ], -1)
391
+ ])], 4)) : g("", !0),
392
+ I(s.$slots, "default", {}, () => [
393
+ e[1] || (e[1] = o("p", null, " Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante. ", -1))
394
+ ])
395
+ ]);
396
+ }
397
+ const Z = /* @__PURE__ */ C(qe, [["render", Ee]]);
398
+ M.add(W);
399
+ const He = {
400
+ name: "WorkflowAssuranceBlock",
401
+ components: {
402
+ FontAwesomeIcon: D
403
+ },
404
+ props: {
405
+ steps: {
406
+ type: Array,
407
+ required: !0,
408
+ default: () => [
409
+ {
410
+ numero: 1,
411
+ texte: "Step 1"
412
+ },
413
+ {
414
+ numero: 2,
415
+ texte: "Step 2"
416
+ },
417
+ {
418
+ numero: 3,
419
+ texte: "Step 3"
420
+ }
421
+ ]
422
+ },
423
+ currentStep: {
424
+ type: Number,
425
+ required: !1,
426
+ default: 1
427
+ },
428
+ size: {
429
+ type: String,
430
+ required: !1,
431
+ default: "md"
432
+ },
433
+ checkPassedStep: {
434
+ type: Boolean,
435
+ required: !1,
436
+ default: !0
437
+ },
438
+ passedStepBgColor: {
439
+ type: String,
440
+ required: !1,
441
+ default: "success"
442
+ },
443
+ currentStepBgColor: {
444
+ type: String,
445
+ required: !1,
446
+ default: "primary"
447
+ },
448
+ futureStepBgColor: {
449
+ type: String,
450
+ required: !1,
451
+ default: "secondary"
452
+ },
453
+ passedStepCss: {
454
+ type: String,
455
+ required: !1,
456
+ default: "text-white"
457
+ },
458
+ currentStepCss: {
459
+ type: String,
460
+ required: !1,
461
+ default: "text-white fw-bold"
462
+ },
463
+ futureStepCss: {
464
+ type: String,
465
+ required: !1,
466
+ default: "text-white"
467
+ },
468
+ passedStepTextCss: {
469
+ type: String,
470
+ required: !1,
471
+ default: "white"
472
+ },
473
+ currentStepTextCss: {
474
+ type: String,
475
+ required: !1,
476
+ default: "white"
477
+ },
478
+ futureStepTextCss: {
479
+ type: String,
480
+ required: !1,
481
+ default: "white"
482
+ },
483
+ hideText: {
484
+ type: Boolean,
485
+ required: !1,
486
+ default: !1
487
+ }
488
+ },
489
+ emits: ["clickStep"],
490
+ computed: {
491
+ fontSize() {
492
+ return this.bubbleSize / 2;
493
+ },
494
+ bubbleSize() {
495
+ switch (this.size) {
496
+ case "sm":
497
+ return 2;
498
+ case "lg":
499
+ return 4;
500
+ default:
501
+ return 3;
502
+ }
503
+ }
504
+ }
505
+ }, Oe = { class: "d-flex flex-column align-items-center" }, Ye = ["onClick"], Ue = {
506
+ key: 0,
507
+ class: "line h-100",
508
+ style: { height: "30px", "min-height": "30px" }
509
+ };
510
+ function We(s, e, t, c, i, l) {
511
+ const u = x("font-awesome-icon");
512
+ return n(!0), r(y, null, v(t.steps, (d, m) => (n(), r("div", {
513
+ key: d.numero,
514
+ class: "d-flex mb-1"
515
+ }, [
516
+ o("div", Oe, [
517
+ o("div", {
518
+ style: _({
519
+ width: l.bubbleSize + "rem",
520
+ minHeight: l.bubbleSize + "rem",
521
+ height: l.bubbleSize + "rem",
522
+ lineHeight: l.bubbleSize + "rem",
523
+ fontSize: l.fontSize + "rem"
524
+ }),
525
+ class: f(["d-inline-block rounded-circle text-center mb-1", [
526
+ "bg-" + (m + 1 < t.currentStep ? t.passedStepBgColor : m + 1 === t.currentStep ? t.currentStepBgColor : t.futureStepBgColor),
527
+ m + 1 < t.currentStep ? t.passedStepCss : m + 1 === t.currentStep ? t.currentStepCss : t.futureStepCss
528
+ ]]),
529
+ onClick: (a) => s.$emit("clickStep", d.numero)
530
+ }, [
531
+ m + 1 < t.currentStep && t.checkPassedStep ? (n(), k(u, {
532
+ key: 0,
533
+ icon: ["fas", "check"]
534
+ })) : (n(), r(y, { key: 1 }, [
535
+ A(p(d.numero), 1)
536
+ ], 64))
537
+ ], 14, Ye),
538
+ m < t.steps.length - 1 ? (n(), r("div", Ue)) : g("", !0)
539
+ ]),
540
+ t.hideText ? g("", !0) : (n(), r("span", {
541
+ key: 0,
542
+ class: f(["ms-1", [m + 1 < t.currentStep ? t.passedStepTextCss : m + 1 === t.currentStep ? t.currentStepTextCss : t.futureStepTextCss]]),
543
+ style: _({
544
+ minHeight: l.bubbleSize + "rem",
545
+ lineHeight: l.bubbleSize + "rem"
546
+ })
547
+ }, [
548
+ I(s.$slots, "stepContent", { step: d }, () => [
549
+ A(p(d.texte), 1)
550
+ ], !0)
551
+ ], 6))
552
+ ]))), 128);
553
+ }
554
+ const Vs = /* @__PURE__ */ C(He, [["render", We], ["__scopeId", "data-v-5eab4376"]]);
555
+ M.add(W);
556
+ const V = {
557
+ name: "AmsomHorizontalStepper",
558
+ components: {
559
+ FontAwesomeIcon: D
560
+ },
561
+ props: {
562
+ currentStep: {
563
+ type: Number,
564
+ required: !0,
565
+ default: 1
566
+ },
567
+ steps: {
568
+ type: Array,
569
+ required: !0,
570
+ default: () => [
571
+ {
572
+ numero: 1,
573
+ texte: "Step 1"
574
+ },
575
+ {
576
+ numero: 2,
577
+ texte: "Step 2"
578
+ },
579
+ {
580
+ numero: 3,
581
+ texte: "Step 3"
582
+ }
583
+ ]
584
+ },
585
+ size: {
586
+ type: String,
587
+ required: !1,
588
+ default: "md",
589
+ validator: function(s) {
590
+ return ["sm", "md", "lg"].indexOf(s) !== -1;
591
+ }
592
+ },
593
+ checkPassedStep: {
594
+ type: Boolean,
595
+ required: !1,
596
+ default: !0
597
+ },
598
+ passedStepBgColor: {
599
+ type: String,
600
+ required: !1,
601
+ default: "success"
602
+ },
603
+ currentStepBgColor: {
604
+ type: String,
605
+ required: !1,
606
+ default: "primary"
607
+ },
608
+ futureStepBgColor: {
609
+ type: String,
610
+ required: !1,
611
+ default: "secondary"
612
+ },
613
+ passedStepCss: {
614
+ type: String,
615
+ required: !1,
616
+ default: "text-white"
617
+ },
618
+ currentStepCss: {
619
+ type: String,
620
+ required: !1,
621
+ default: "text-white fw-bold"
622
+ },
623
+ futureStepCss: {
624
+ type: String,
625
+ required: !1,
626
+ default: "text-white"
627
+ },
628
+ passedStepTextCss: {
629
+ type: String,
630
+ required: !1,
631
+ default: ""
632
+ },
633
+ currentStepTextCss: {
634
+ type: String,
635
+ required: !1,
636
+ default: "fw-bold"
637
+ },
638
+ futureStepTextCss: {
639
+ type: String,
640
+ required: !1,
641
+ default: ""
642
+ },
643
+ hideText: {
644
+ type: Boolean,
645
+ required: !1,
646
+ default: !1
647
+ }
648
+ },
649
+ emits: ["clickStep"],
650
+ computed: {
651
+ fontSizeText() {
652
+ return this.bubbleSize / 2.5;
653
+ },
654
+ fontSizeStep() {
655
+ return this.bubbleSize / 2;
656
+ },
657
+ bubbleSize() {
658
+ switch (this.size) {
659
+ case "sm":
660
+ return 2;
661
+ case "lg":
662
+ return 4;
663
+ default:
664
+ return 3;
665
+ }
666
+ },
667
+ passedStepBgColorCss() {
668
+ return "var(--bs-" + this.passedStepBgColor + ")";
669
+ },
670
+ futureStepBgColorCss() {
671
+ return "var(--bs-" + this.futureStepBgColor + ")";
672
+ },
673
+ currentStepBgColorCss() {
674
+ return "var(--bs-" + this.currentStepBgColor + ")";
675
+ },
676
+ lineTopCss() {
677
+ return "calc(" + this.bubbleSize + "/ 2)";
678
+ }
679
+ }
680
+ }, H = () => {
681
+ ge((s) => ({
682
+ v31536048: s.futureStepBgColorCss,
683
+ dac29eac: s.bubbleSize + "rem",
684
+ a3a0806e: s.passedStepBgColorCss,
685
+ de0182ca: s.fontSizeStep + "rem"
686
+ }));
687
+ }, O = V.setup;
688
+ V.setup = O ? (s, e) => (H(), O(s, e)) : H;
689
+ const Re = { class: "d-flex justify-content-between" }, Ke = ["role", "onClick"];
690
+ function Ge(s, e, t, c, i, l) {
691
+ const u = x("font-awesome-icon");
692
+ return n(), r("div", Re, [
693
+ (n(!0), r(y, null, v(t.steps, (d, m) => (n(), r("div", {
694
+ key: d.numero,
695
+ role: d.numero < t.currentStep ? "button" : "none",
696
+ class: f(["stepper-item", [
697
+ {
698
+ active: d.numero === t.currentStep,
699
+ completed: d.numero < t.currentStep
700
+ }
701
+ ]]),
702
+ onClick: (a) => s.$emit("clickStep", d.numero)
703
+ }, [
704
+ o("div", {
705
+ class: f(["step-counter", [
706
+ "bg-" + (m + 1 < t.currentStep ? t.passedStepBgColor : m + 1 === t.currentStep ? t.currentStepBgColor : t.futureStepBgColor),
707
+ m + 1 < t.currentStep ? t.passedStepCss : m + 1 === t.currentStep ? t.currentStepCss : t.futureStepCss
708
+ ]]),
709
+ style: _({ fontSize: l.fontSizeStep + "rem" })
710
+ }, [
711
+ m + 1 < t.currentStep && t.checkPassedStep ? (n(), k(u, {
712
+ key: 0,
713
+ icon: ["fas", "check"]
714
+ })) : (n(), r(y, { key: 1 }, [
715
+ A(p(d.numero), 1)
716
+ ], 64))
717
+ ], 6),
718
+ t.hideText ? g("", !0) : (n(), r("div", {
719
+ key: 0,
720
+ class: f(["step-name", [m + 1 < t.currentStep ? t.passedStepTextCss : m + 1 === t.currentStep ? t.currentStepTextCss : t.futureStepTextCss]]),
721
+ style: _({ fontSize: l.fontSizeText + "rem" })
722
+ }, p(d.texte), 7))
723
+ ], 10, Ke))), 128))
724
+ ]);
725
+ }
726
+ const Es = /* @__PURE__ */ C(V, [["render", Ge]]);
727
+ M.add(X, R, $, ee);
728
+ const Je = {
729
+ name: "PhotoComponent",
730
+ components: {
731
+ AmsomModal: Ae,
732
+ FontAwesomeIcon: D
733
+ },
734
+ props: {
735
+ images: {
736
+ type: Array,
737
+ default: () => []
738
+ },
739
+ imageSizeWidth: {
740
+ type: String,
741
+ default: "50px"
742
+ },
743
+ imageSizeHeight: {
744
+ type: String,
745
+ default: "50px"
746
+ },
747
+ imagesLimit: {
748
+ type: Number,
749
+ default: -1
750
+ },
751
+ capture: {
752
+ type: String,
753
+ default: "file"
754
+ }
755
+ },
756
+ emits: ["update:images"],
757
+ data() {
758
+ return {
759
+ showModal: !1,
760
+ selectedPhotoIndex: 0
761
+ };
762
+ },
763
+ computed: {
764
+ canAddImage() {
765
+ return this.imagesLimit === -1 ? !0 : this.imagesLimit !== -1 && this.images.length < this.imagesLimit;
766
+ }
767
+ },
768
+ methods: {
769
+ triggerFileInput() {
770
+ this.$refs.fileInput.click();
771
+ },
772
+ openPhoto(s) {
773
+ this.selectedPhotoIndex = this.images.findIndex((e) => e === s), this.showModal = !0;
774
+ },
775
+ closeModal() {
776
+ this.showModal = !1;
777
+ },
778
+ changeIndex(s) {
779
+ s === 0 ? this.selectedPhotoIndex = this.selectedPhotoIndex === 0 ? 0 : this.selectedPhotoIndex - 1 : this.selectedPhotoIndex = this.selectedPhotoIndex === this.images.length - 1 ? 0 : this.selectedPhotoIndex + 1;
780
+ },
781
+ deleteImage() {
782
+ this.$emit(
783
+ "update:images",
784
+ this.images.filter((s, e) => e !== this.selectedPhotoIndex)
785
+ ), this.images.length - 1 === 0 ? this.closeModal() : this.changeIndex(0);
786
+ },
787
+ getDataFiles(s) {
788
+ let e = s.target.files;
789
+ if (e) {
790
+ this.imagesLimit !== -1 && (e = Array.from(e), e = e.slice(0, this.imagesLimit));
791
+ for (let t of e)
792
+ j(t) && G({ file: t, maxWidth: this.maxWidth, maxHeigth: this.maxHeigth }).then((c) => {
793
+ J(pe(c), t.type.split("/")[1]).then((i) => {
794
+ i.nomFichier = t.name, this.$emit("update:images", [...this.images, i]);
795
+ });
796
+ });
797
+ }
798
+ }
799
+ }
800
+ }, Ze = { class: "border border-1 border-grey rounded-4 p-2 d-flex align-items-center" }, Qe = ["disabled"], Xe = ["capture"], $e = {
801
+ key: 0,
802
+ class: "d-flex overflow-x-auto w-100"
803
+ }, et = ["onClick"], tt = ["src", "alt"], st = {
804
+ key: 1,
805
+ class: "fs-7"
806
+ }, lt = { class: "row w-100 mx-auto" }, it = { class: "col-12 mb-3" }, nt = ["src", "alt"], ot = { class: "col-12 d-flex justify-content-center" };
807
+ function at(s, e, t, c, i, l) {
808
+ const u = x("font-awesome-icon"), d = x("amsom-modal");
809
+ return n(), r("div", Ze, [
810
+ o("button", {
811
+ type: "button",
812
+ class: "btn rounded-4 me-1 d-flex justify-content-center align-items-center",
813
+ style: _({
814
+ width: t.imageSizeWidth,
815
+ minWidth: t.imageSizeWidth,
816
+ height: t.imageSizeHeight,
817
+ minHeight: t.imageSizeHeight,
818
+ backgroundColor: "#a4a228"
819
+ }),
820
+ disabled: !l.canAddImage,
821
+ onClick: e[2] || (e[2] = (...m) => l.triggerFileInput && l.triggerFileInput(...m))
822
+ }, [
823
+ b(u, {
824
+ icon: "fa-solid fa-camera",
825
+ size: "lg",
826
+ class: "text-white"
827
+ }),
828
+ t.capture === "file" ? (n(), r("input", {
829
+ key: 0,
830
+ id: "file",
831
+ ref: "fileInput",
832
+ type: "file",
833
+ class: "form-control",
834
+ accept: "image/*",
835
+ style: { display: "none" },
836
+ multiple: "",
837
+ onInput: e[0] || (e[0] = (...m) => l.getDataFiles && l.getDataFiles(...m))
838
+ }, null, 544)) : (n(), r("input", {
839
+ key: 1,
840
+ id: "file",
841
+ ref: "fileInput",
842
+ type: "file",
843
+ class: "form-control",
844
+ style: { display: "none" },
845
+ accept: "image/*",
846
+ multiple: "",
847
+ capture: t.capture,
848
+ onInput: e[1] || (e[1] = (...m) => l.getDataFiles && l.getDataFiles(...m))
849
+ }, null, 40, Xe))
850
+ ], 12, Qe),
851
+ t.images.length > 0 ? (n(), r("div", $e, [
852
+ (n(!0), r(y, null, v(t.images, (m) => (n(), r("button", {
853
+ key: m,
854
+ type: "button",
855
+ class: "btn p-0 mx-1 rounded-1",
856
+ style: _({
857
+ minWidth: t.imageSizeWidth,
858
+ width: t.imageSizeWidth,
859
+ minHeight: t.imageSizeHeight,
860
+ height: t.imageSizeHeight
861
+ }),
862
+ onClick: (a) => l.openPhoto(m)
863
+ }, [
864
+ o("img", {
865
+ src: "data:" + (m == null ? void 0 : m.type) + ";base64," + (m == null ? void 0 : m.file),
866
+ class: "h-100 w-100 rounded-1",
867
+ alt: m == null ? void 0 : m.nomFichier
868
+ }, null, 8, tt)
869
+ ], 12, et))), 128))
870
+ ])) : (n(), r("div", st, " Ajouter une image ")),
871
+ i.showModal ? (n(), k(d, {
872
+ key: 2,
873
+ size: "sm",
874
+ "close-option": "",
875
+ onClose: l.closeModal
876
+ }, {
877
+ default: z(() => {
878
+ var m, a, h;
879
+ return [
880
+ o("div", lt, [
881
+ o("div", it, [
882
+ o("img", {
883
+ src: "data:" + ((m = t.images[i.selectedPhotoIndex]) == null ? void 0 : m.type) + ";base64," + ((a = t.images[i.selectedPhotoIndex]) == null ? void 0 : a.file),
884
+ alt: (h = t.images[i.selectedPhotoIndex]) == null ? void 0 : h.nomFichier,
885
+ class: "h-100 w-100"
886
+ }, null, 8, nt)
887
+ ]),
888
+ o("div", ot, [
889
+ o("button", {
890
+ type: "button",
891
+ class: "btn btn-primary mx-1",
892
+ onClick: e[3] || (e[3] = (S) => l.changeIndex(0))
893
+ }, [
894
+ b(u, {
895
+ icon: "fa-arrow-left",
896
+ size: "lg"
897
+ })
898
+ ]),
899
+ o("button", {
900
+ type: "button",
901
+ class: "btn btn-primary mx-1",
902
+ onClick: e[4] || (e[4] = (S) => l.changeIndex(1))
903
+ }, [
904
+ b(u, {
905
+ icon: "fa-arrow-right",
906
+ size: "lg"
907
+ })
908
+ ]),
909
+ o("button", {
910
+ type: "button",
911
+ class: "btn btn-danger ms-auto",
912
+ onClick: e[5] || (e[5] = (...S) => l.deleteImage && l.deleteImage(...S))
913
+ }, [
914
+ b(u, {
915
+ icon: "fa-trash",
916
+ size: "lg"
917
+ })
918
+ ])
919
+ ])
920
+ ])
921
+ ];
922
+ }),
923
+ _: 1
924
+ }, 8, ["onClose"])) : g("", !0)
925
+ ]);
926
+ }
927
+ const Hs = /* @__PURE__ */ C(Je, [["render", at]]);
928
+ function rt(s, e, t = !1, c = !1) {
929
+ return s && s.sort((i, l) => {
930
+ const u = new RegExp("(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)?$");
931
+ if (u.test(i[e]) && u.test(l[e]))
932
+ switch (i[e].replace(/\d+/g, (h) => +h + 1e5).localeCompare(l[e].replace(/\d+/g, (h) => +h + 1e5))) {
933
+ case 1:
934
+ return t ? 1 : -1;
935
+ case -1:
936
+ return t ? -1 : 1;
937
+ case 0:
938
+ return 0;
939
+ default:
940
+ return 0;
941
+ }
942
+ if (!isNaN(i[e]) && !isNaN(l[e]))
943
+ return t ? parseFloat(i[e]) - parseFloat(l[e]) : parseFloat(l[e]) - parseFloat(i[e]);
944
+ if (!i[e] && l[e])
945
+ return t ? c ? 1 : -1 : c ? -1 : 1;
946
+ if (i[e] && !l[e])
947
+ return t ? c ? -1 : 1 : c ? 1 : -1;
948
+ if (!i[e] && !l[e])
949
+ return 0;
950
+ if (P(i[e], "DD/MM/YYYY").isValid() || P(l[e], "DD/MM/YYYY").isValid())
951
+ return t ? P(i[e], "DD/MM/YYYY").unix() - P(l[e], "DD/MM/YYYY").unix() : P(l[e], "DD/MM/YYYY").unix() - P(i[e], "DD/MM/YYYY").unix();
952
+ let d = (typeof i[e] == "string" || typeof l[e] == "string") && i[e] ? i[e].toString().toLowerCase() : i[e], m = (typeof i[e] == "string" || typeof l[e] == "string") && l[e] ? l[e].toString().toLowerCase() : l[e];
953
+ return d > m ? t ? 1 : -1 : m > d ? t ? -1 : 1 : 0;
954
+ });
955
+ }
956
+ function L(s, e = !0) {
957
+ if (!s) return null;
958
+ let t = s.toString().normalize("NFD").replace(/[\u0300-\u036f]/g, "");
959
+ return e ? t.toLowerCase() : t;
960
+ }
961
+ function Y(s, e = "DD/MM/YYYY") {
962
+ return P.unix(s).isValid() ? P.unix(s).format(e) : s;
963
+ }
964
+ function U(s, e) {
965
+ let t = F(s);
966
+ if (!t)
967
+ t = {
968
+ columns: e
969
+ };
970
+ else if (!t.columns)
971
+ t.columns = e;
972
+ else {
973
+ let c = e.filter(function(l) {
974
+ return !t.columns.some(function(u) {
975
+ return u.id === l.id;
976
+ });
977
+ });
978
+ t.columns = t.columns.concat(c);
979
+ let i = t.columns.filter(function(l) {
980
+ return !e.some(function(u) {
981
+ return l.id === u.id;
982
+ });
983
+ });
984
+ t.columns = t.columns.filter(function(l) {
985
+ return !i.some(function(u) {
986
+ return l.id === u.id;
987
+ });
988
+ }), t.columns.filter((l) => {
989
+ for (let u of e)
990
+ u.id === l.id && u.libelle !== l.libelle && (l.libelle = u.libelle);
991
+ });
992
+ }
993
+ T(s, t);
994
+ }
995
+ function dt(s, e, t = null) {
996
+ let c = F(s);
997
+ c ? t && !c[t] && (c[t] = e) : t ? (c = {}, c[t] = e) : c = e, T(s, c);
998
+ }
999
+ function F(s) {
1000
+ return JSON.parse(window.localStorage.getItem(s));
1001
+ }
1002
+ function T(s, e, t = null) {
1003
+ let c = F(s);
1004
+ return t ? c[t] = e : c = e, window.localStorage.setItem(s, JSON.stringify(c));
1005
+ }
1006
+ M.add(q, K, te, se, R, le);
1007
+ const ut = {
1008
+ name: "TableDraggableComponent",
1009
+ components: { VueDraggableNext: we, FontAwesomeIcon: D },
1010
+ props: {
1011
+ defaultColumns: {
1012
+ type: Array,
1013
+ require: !0,
1014
+ default: null
1015
+ },
1016
+ localStorageItemName: {
1017
+ type: String,
1018
+ default: null
1019
+ },
1020
+ tdItemsList: {
1021
+ type: [Array, Object],
1022
+ require: !0,
1023
+ default: null
1024
+ },
1025
+ search: {
1026
+ type: String,
1027
+ default: null
1028
+ },
1029
+ pickedDate: {
1030
+ type: Array,
1031
+ default: null
1032
+ },
1033
+ columnNameDateFilter: {
1034
+ type: Array,
1035
+ default: null
1036
+ },
1037
+ maxItemPerPage: {
1038
+ type: Number,
1039
+ default: 10
1040
+ },
1041
+ clickable: {
1042
+ type: Boolean,
1043
+ default: !1
1044
+ },
1045
+ showModifyColumnsBtn: {
1046
+ type: Boolean,
1047
+ default: !1
1048
+ },
1049
+ ghostClass: {
1050
+ type: String,
1051
+ default: "bg-success"
1052
+ },
1053
+ lineEditMode: {
1054
+ type: Boolean,
1055
+ default: !1
1056
+ }
1057
+ },
1058
+ emits: ["changeSubject", "updateSelectedItems", "lineEditModeAddNewLine", "lineEditModeDeleteLine"],
1059
+ data() {
1060
+ return {
1061
+ checkAllCheckBox: !1,
1062
+ sortKey: null,
1063
+ sortAsc: !1,
1064
+ currentPage: 1,
1065
+ selectedItems: [],
1066
+ currentHeaderSort: null,
1067
+ headerEditMode: !1,
1068
+ totalPages: null,
1069
+ // Default values
1070
+ columns: this.copyDefaultColumns(),
1071
+ maxItemsPerPage: this.getDefaultMaxItemPerPage(),
1072
+ forceTableUpdateIndex: 0
1073
+ };
1074
+ },
1075
+ computed: {
1076
+ currentDisplayPagination() {
1077
+ let s = [];
1078
+ return this.totalPages <= 1 ? s : (this.currentPage === 1 ? s = [1, 2, 3] : this.currentPage === this.totalPages ? s = [this.totalPages - 2, this.totalPages - 1, this.totalPages] : s = [this.currentPage - 1, this.currentPage, this.currentPage + 1], s.filter((e) => e >= 1 && e <= this.totalPages));
1079
+ },
1080
+ items() {
1081
+ return this.tdItemsList ? this.tdItemsList : [];
1082
+ },
1083
+ filtereditems() {
1084
+ if (!this.items) return this.items;
1085
+ let s = L(this.search), e, t;
1086
+ return this.pickedDate && this.pickedDate[0] && this.pickedDate[1] && (e = P(this.pickedDate[0]).set({ hour: 0, minute: 0 }).unix(), t = P(this.pickedDate[1]).set({ hour: 23, minute: 59 }).unix()), this.items.filter((c) => {
1087
+ let i = this.filterBy(c, s);
1088
+ if (e && t && this.columnNameDateFilter && this.columnNameDateFilter.length > 0 && this.columnNameDateFilter.some((u) => {
1089
+ const d = this.columns.find((m) => m.id === u);
1090
+ return d && d.show === !0;
1091
+ })) {
1092
+ let u = this.columnNameDateFilter.some((d) => {
1093
+ const m = this.columns.find((a) => a.id === d);
1094
+ if (c[d] && m.show === !0) {
1095
+ let a = parseInt(c[d]);
1096
+ return a >= e && a <= t;
1097
+ }
1098
+ return !1;
1099
+ });
1100
+ return i && u;
1101
+ }
1102
+ return i;
1103
+ });
1104
+ },
1105
+ showeditems() {
1106
+ const s = this.filtereditems.slice((this.currentPage - 1) * this.maxItemsPerPage, this.currentPage * this.maxItemsPerPage);
1107
+ return !this.sortKey || !this.filtereditems ? s : rt(s, this.sortKey, this.sortAsc);
1108
+ }
1109
+ },
1110
+ watch: {
1111
+ headerEditMode(s) {
1112
+ s ? this.maxItemsPerPage = 5 : this.maxItemsPerPage = this.getDefaultMaxItemPerPage();
1113
+ },
1114
+ filtereditems: function(s) {
1115
+ this.currentPage = 1, this.totalPages = this.newTotalPage(s.length);
1116
+ },
1117
+ maxItemPerPage: function(s) {
1118
+ this.maxItemsPerPage = s, this.localStorageItemName !== null && T(this.localStorageItemName, s, "maxItemPerPage"), this.currentPage = 1, this.totalPages = this.newTotalPage(this.filtereditems.length);
1119
+ },
1120
+ columns: function(s) {
1121
+ this.localStorageItemName !== null && T(this.localStorageItemName, s, "columns"), this.forceTableUpdateIndex += 1;
1122
+ },
1123
+ showeditems: function() {
1124
+ this.checkAllCheckBox = this.showeditems.every((s) => this.selectedItems.includes(s.id));
1125
+ }
1126
+ },
1127
+ mounted() {
1128
+ if (this.localStorageItemName !== null) {
1129
+ U(this.localStorageItemName, this.columns), dt(this.localStorageItemName, this.maxItemPerPage, "maxItemPerPage");
1130
+ let s = F(this.localStorageItemName);
1131
+ this.maxItemsPerPage = s.maxItemPerPage, this.columns = s.columns;
1132
+ }
1133
+ this.totalPages = this.newTotalPage(this.filtereditems.length);
1134
+ },
1135
+ methods: {
1136
+ unixToDateString: Y,
1137
+ newTotalPage(s) {
1138
+ return Math.ceil(s / this.maxItemsPerPage);
1139
+ },
1140
+ lineStateClass(s) {
1141
+ return s === "add" ? "addLineState text-success" : s === "delete" ? "deleteLineState text-danger" : s === "update" ? "updateLineState text-warning" : "";
1142
+ },
1143
+ checkItem(s) {
1144
+ this.selectedItems.includes(s) ? this.selectedItems = this.selectedItems.filter((e) => e !== s) : this.selectedItems.push(s), this.checkAllCheckBox ? this.checkAllCheckBox = !1 : this.showeditems.every((e) => this.selectedItems.includes(e.id)) && (this.checkAllCheckBox = !0), this.$emit("updateSelectedItems", this.selectedItems);
1145
+ },
1146
+ toggleAllCheckBox() {
1147
+ const s = this.showeditems.map((e) => e.id);
1148
+ this.checkAllCheckBox ? (this.selectedItems = this.selectedItems.filter((e) => !s.includes(e)), this.checkAllCheckBox = !1) : (this.selectedItems = [.../* @__PURE__ */ new Set([...this.selectedItems, ...s])], this.checkAllCheckBox = !0), this.$emit("updateSelectedItems", this.selectedItems);
1149
+ },
1150
+ updateCurrentSort(s) {
1151
+ this.currentHeaderSort && (this.currentHeaderSort.isSorted = !1), s.isSorted = !0, this.currentHeaderSort = s, this.updateSortitems(s.id);
1152
+ },
1153
+ checkMove(s) {
1154
+ return s.draggedContext.index !== 0 && s.relatedContext.index !== 0;
1155
+ },
1156
+ filterBy(s, e) {
1157
+ for (const t of this.columns) {
1158
+ if (t.show && s[t.id] && L(s[t.id]).includes(e))
1159
+ return !0;
1160
+ if (t.show && t.id.startsWith("date") && s[t.id] && L(Y(s[t.id])).includes(e))
1161
+ return !0;
1162
+ }
1163
+ return !e;
1164
+ },
1165
+ getDefaultMaxItemPerPage() {
1166
+ return this.maxItemPerPage;
1167
+ },
1168
+ copyDefaultColumns() {
1169
+ return JSON.parse(JSON.stringify(this.defaultColumns));
1170
+ },
1171
+ updateSortitems(s) {
1172
+ if (!this.items) return this.items;
1173
+ this.sortKey === s ? this.sortAsc = !this.sortAsc : this.sortAsc = !0, this.sortKey = s, this.$forceUpdate();
1174
+ },
1175
+ selectSubject(s) {
1176
+ this.$emit("changeSubject", s);
1177
+ },
1178
+ saveTablePreferences() {
1179
+ this.localStorageItemName !== null && T(this.localStorageItemName, this.columns, "columns"), this.headerEditMode = !1;
1180
+ },
1181
+ resetTablePreferences() {
1182
+ this.columns = this.copyDefaultColumns(), this.localStorageItemName !== null && U(this.localStorageItemName, this.columns), this.headerEditMode = !1;
1183
+ },
1184
+ editTablePreferences() {
1185
+ this.headerEditMode = !0;
1186
+ }
1187
+ }
1188
+ }, ct = {
1189
+ key: 0,
1190
+ class: "my-3 text-center"
1191
+ }, mt = { class: "row mb-3 overflow-x-auto" }, ft = { class: "col-12" }, gt = {
1192
+ key: 1,
1193
+ class: "bg-secondary",
1194
+ scope: "col"
1195
+ }, ht = {
1196
+ key: 0,
1197
+ class: "position-absolute start-50 translate-middle",
1198
+ style: { top: "25px" }
1199
+ }, pt = { class: "d-inline-flex text-nowrap" }, yt = { class: "my-auto" }, bt = {
1200
+ key: 0,
1201
+ class: "ms-2 float-end"
1202
+ }, St = { key: 0 }, xt = ["colspan"], kt = ["onClick"], wt = ["onClick"], Ct = ["id", "value"], vt = ["onClick"], _t = { class: "row mb-2" }, Pt = {
1203
+ key: 0,
1204
+ class: "col"
1205
+ }, It = { class: "m-0 pagination pagination-sm" }, Dt = { class: "page-item hoverable" }, Mt = { class: "page-item hoverable" }, Bt = ["onClick"], At = { class: "page-item hoverable" }, Tt = { class: "page-item hoverable" }, zt = {
1206
+ key: 1,
1207
+ class: "col d-flex justify-content-end"
1208
+ }, Ft = { class: "d-flex mb-1" }, Lt = {
1209
+ key: 0,
1210
+ class: "d-flex"
1211
+ };
1212
+ function Nt(s, e, t, c, i, l) {
1213
+ var m;
1214
+ const u = x("font-awesome-icon"), d = x("vue-draggable-next");
1215
+ return n(), r(y, null, [
1216
+ t.lineEditMode ? (n(), r("div", ct, [
1217
+ o("button", {
1218
+ type: "button",
1219
+ class: "btn btn-success rounded-5 m-0 p-0",
1220
+ style: { height: "45px", width: "45px" },
1221
+ onClick: e[0] || (e[0] = (a) => s.$emit("lineEditModeAddNewLine"))
1222
+ }, [
1223
+ b(u, {
1224
+ icon: "fa-solid fa-plus",
1225
+ size: "xl"
1226
+ })
1227
+ ])
1228
+ ])) : g("", !0),
1229
+ o("div", mt, [
1230
+ o("div", ft, [
1231
+ (n(), r("table", {
1232
+ id: "table-draggable",
1233
+ key: i.forceTableUpdateIndex,
1234
+ class: "table table-striped table-hover table-responsive overflow-hidden table-bordered align-middle border-1 border-top border-bottom",
1235
+ style: { "border-radius": "10px !important", "border-collapse": "separate", "border-spacing": "0" }
1236
+ }, [
1237
+ o("thead", null, [
1238
+ b(d, {
1239
+ modelValue: i.columns,
1240
+ "onUpdate:modelValue": e[4] || (e[4] = (a) => i.columns = a),
1241
+ "ghost-class": t.ghostClass,
1242
+ "drag-class": t.ghostClass,
1243
+ tag: "tr",
1244
+ move: l.checkMove,
1245
+ group: "columns"
1246
+ }, {
1247
+ default: z(() => [
1248
+ (n(!0), r(y, null, v(i.columns, (a) => (n(), r(y, {
1249
+ key: a.id
1250
+ }, [
1251
+ a.id === "checkBox" ? (n(), r("th", {
1252
+ key: 0,
1253
+ class: "text-center bg-secondary",
1254
+ scope: "col",
1255
+ onClick: e[3] || (e[3] = w((...h) => l.toggleAllCheckBox && l.toggleAllCheckBox(...h), ["stop"]))
1256
+ }, [
1257
+ N(o("input", {
1258
+ id: "checkBoxSelectAll",
1259
+ "onUpdate:modelValue": e[1] || (e[1] = (h) => i.checkAllCheckBox = h),
1260
+ class: "form-check-input",
1261
+ type: "checkbox",
1262
+ onClick: e[2] || (e[2] = w((...h) => l.toggleAllCheckBox && l.toggleAllCheckBox(...h), ["stop"]))
1263
+ }, null, 512), [
1264
+ [E, i.checkAllCheckBox]
1265
+ ])
1266
+ ])) : a.id === "deleteButton" && t.lineEditMode ? (n(), r("th", gt)) : a.show || i.headerEditMode ? (n(), r("th", {
1267
+ key: 2,
1268
+ scope: "col",
1269
+ class: f(["text-white bg-secondary hoverable position-relative text-center", [
1270
+ {
1271
+ "table-danger": !a.show,
1272
+ "pt-5": i.headerEditMode
1273
+ }
1274
+ ]])
1275
+ }, [
1276
+ i.headerEditMode ? (n(), r("div", ht, [
1277
+ a.show ? (n(), k(u, {
1278
+ key: 0,
1279
+ icon: "fa-solid fa-eye",
1280
+ class: "fa-xl",
1281
+ onClick: (h) => a.show = !1
1282
+ }, null, 8, ["onClick"])) : (n(), k(u, {
1283
+ key: 1,
1284
+ icon: "fa-solid fa-eye-slash",
1285
+ class: "fa-xl",
1286
+ onClick: (h) => a.show = !0
1287
+ }, null, 8, ["onClick"]))
1288
+ ])) : g("", !0),
1289
+ o("div", pt, [
1290
+ o("span", yt, p(a.libelle), 1),
1291
+ a.isSortable ? (n(), r("div", bt, [
1292
+ b(u, {
1293
+ icon: i.sortKey !== a.id || i.sortKey === a.id && !i.sortAsc ? "fa-solid fa-arrow-down-wide-short" : "fa-solid fa-arrow-up-short-wide",
1294
+ onClick: (h) => l.updateCurrentSort(a)
1295
+ }, null, 8, ["icon", "onClick"])
1296
+ ])) : g("", !0)
1297
+ ])
1298
+ ], 2)) : g("", !0)
1299
+ ], 64))), 128))
1300
+ ]),
1301
+ _: 1
1302
+ }, 8, ["modelValue", "ghost-class", "drag-class", "move"])
1303
+ ]),
1304
+ o("tbody", null, [
1305
+ ((m = l.showeditems) == null ? void 0 : m.length) === 0 ? (n(), r("tr", St, [
1306
+ o("th", {
1307
+ colspan: i.columns.length,
1308
+ class: "text-center"
1309
+ }, [...e[14] || (e[14] = [
1310
+ o("span", { class: "text-danger fs-5" }, "Aucune valeur", -1)
1311
+ ])], 8, xt)
1312
+ ])) : (n(!0), r(y, { key: 1 }, v(l.showeditems, (a, h) => (n(), r("tr", {
1313
+ key: a.id,
1314
+ class: f({ hoverable: t.clickable }),
1315
+ onClick: (S) => t.clickable ? l.selectSubject(a) : null
1316
+ }, [
1317
+ (n(!0), r(y, null, v(i.columns, (S) => (n(), r(y, {
1318
+ key: S.id
1319
+ }, [
1320
+ S.id === "checkBox" ? (n(), r("td", {
1321
+ key: 0,
1322
+ class: f(["text-center", [a.lineState ? l.lineStateClass(a.lineState) : ""]]),
1323
+ onClick: w((B) => l.checkItem(a.id), ["stop"])
1324
+ }, [
1325
+ N(o("input", {
1326
+ id: `checkbox-${h}`,
1327
+ "onUpdate:modelValue": e[5] || (e[5] = (B) => i.selectedItems = B),
1328
+ type: "checkbox",
1329
+ class: "form-check-input hoverable",
1330
+ value: a.id,
1331
+ onClick: e[6] || (e[6] = w(() => {
1332
+ }, ["stop"]))
1333
+ }, null, 8, Ct), [
1334
+ [E, i.selectedItems]
1335
+ ])
1336
+ ], 10, wt)) : S.id === "deleteButton" && t.lineEditMode ? (n(), r("td", {
1337
+ key: 1,
1338
+ class: f([[a.lineState ? l.lineStateClass(a.lineState) : ""], "text-center py-0"])
1339
+ }, [
1340
+ o("button", {
1341
+ type: "button",
1342
+ class: "btn btn-danger",
1343
+ onClick: (B) => s.$emit("lineEditModeDeleteLine", a.id)
1344
+ }, [
1345
+ b(u, {
1346
+ icon: "fa-solid fa-trash",
1347
+ size: "lg"
1348
+ })
1349
+ ], 8, vt)
1350
+ ], 2)) : S.show || i.headerEditMode ? (n(), r("td", {
1351
+ key: 2,
1352
+ class: f([[S.show ? "" : "table-danger", S.isSorted ? "bg-gray-200" : "", a.lineState ? l.lineStateClass(a.lineState) : ""], "text-center text-nowrap"])
1353
+ }, [
1354
+ I(s.$slots, "tableBodyTd", {
1355
+ header: S,
1356
+ item: a
1357
+ }, void 0, !0)
1358
+ ], 2)) : g("", !0)
1359
+ ], 64))), 128))
1360
+ ], 10, kt))), 128))
1361
+ ])
1362
+ ]))
1363
+ ])
1364
+ ]),
1365
+ o("div", _t, [
1366
+ i.totalPages && i.totalPages > 1 ? (n(), r("div", Pt, [
1367
+ o("ul", It, [
1368
+ o("li", Dt, [
1369
+ o("a", {
1370
+ class: f(["page-link", { disabled: i.currentPage === 1 }]),
1371
+ onClick: e[7] || (e[7] = (a) => i.currentPage = 1)
1372
+ }, " « ", 2)
1373
+ ]),
1374
+ o("li", Mt, [
1375
+ o("a", {
1376
+ class: f(["page-link", { disabled: i.currentPage === 1 }]),
1377
+ onClick: e[8] || (e[8] = (a) => i.currentPage -= 1)
1378
+ }, " < ", 2)
1379
+ ]),
1380
+ (n(!0), r(y, null, v(l.currentDisplayPagination, (a) => (n(), r("li", {
1381
+ key: a,
1382
+ class: f(["page-item hoverable", { active: i.currentPage === a }])
1383
+ }, [
1384
+ o("a", {
1385
+ class: "page-link",
1386
+ onClick: (h) => i.currentPage = a
1387
+ }, p(a), 9, Bt)
1388
+ ], 2))), 128)),
1389
+ o("li", At, [
1390
+ o("a", {
1391
+ class: f(["page-link", { disabled: i.currentPage === i.totalPages }]),
1392
+ onClick: e[9] || (e[9] = (a) => i.currentPage += 1)
1393
+ }, " > ", 2)
1394
+ ]),
1395
+ o("li", Tt, [
1396
+ o("a", {
1397
+ class: f(["page-link", { disabled: i.currentPage === i.totalPages }]),
1398
+ onClick: e[10] || (e[10] = (a) => i.currentPage = i.totalPages)
1399
+ }, " » ", 2)
1400
+ ])
1401
+ ])
1402
+ ])) : g("", !0),
1403
+ t.showModifyColumnsBtn ? (n(), r("div", zt, [
1404
+ o("div", Ft, [
1405
+ i.headerEditMode ? (n(), r("div", Lt, [
1406
+ o("button", {
1407
+ id: "btn-save-table",
1408
+ class: "btn btn-sm btn-success d-flex justify-content-center align-items-center ms-auto me-2",
1409
+ type: "button",
1410
+ onClick: e[11] || (e[11] = (...a) => l.saveTablePreferences && l.saveTablePreferences(...a))
1411
+ }, " Sauvegarder "),
1412
+ o("button", {
1413
+ id: "btn-reset-table",
1414
+ class: "btn btn-sm btn-outline-danger d-flex justify-content-center align-items-center",
1415
+ type: "button",
1416
+ onClick: e[12] || (e[12] = (...a) => l.resetTablePreferences && l.resetTablePreferences(...a))
1417
+ }, " Réinitialiser le tableau ")
1418
+ ])) : (n(), r("button", {
1419
+ key: 1,
1420
+ id: "btn-edit-table",
1421
+ class: "btn btn-sm btn-outline-secondary d-flex justify-content-center align-items-center fs-7 p-1 rounded-3",
1422
+ type: "button",
1423
+ onClick: e[13] || (e[13] = (...a) => l.editTablePreferences && l.editTablePreferences(...a))
1424
+ }, " Modifier colonnes "))
1425
+ ])
1426
+ ])) : g("", !0)
1427
+ ])
1428
+ ], 64);
1429
+ }
1430
+ const Os = /* @__PURE__ */ C(ut, [["render", Nt], ["__scopeId", "data-v-6b16b420"]]);
1431
+ M.add(ie, ne, oe, ae);
1432
+ const jt = {
1433
+ name: "AmsomPagination",
1434
+ components: {
1435
+ FontAwesomeIcon: D
1436
+ },
1437
+ props: {
1438
+ modelValue: {
1439
+ type: Number,
1440
+ required: !0
1441
+ },
1442
+ totalPages: {
1443
+ type: Number,
1444
+ required: !0
1445
+ },
1446
+ totalDisplayPages: {
1447
+ type: Number,
1448
+ default: 5
1449
+ }
1450
+ },
1451
+ emits: ["update:modelValue"],
1452
+ methods: {
1453
+ goNextPage() {
1454
+ this.goToPage(this.modelValue + 1);
1455
+ },
1456
+ goPreviousPage() {
1457
+ this.goToPage(this.modelValue - 1);
1458
+ },
1459
+ goFirstPage() {
1460
+ this.goToPage(1);
1461
+ },
1462
+ goLastPage() {
1463
+ this.goToPage(this.totalPages);
1464
+ },
1465
+ goToPage(s) {
1466
+ this.$emit("update:modelValue", s);
1467
+ }
1468
+ },
1469
+ computed: {
1470
+ toDisplayPagination() {
1471
+ let s = [];
1472
+ if (this.totalPages <= this.totalDisplayPages)
1473
+ s = this.totalPages;
1474
+ else {
1475
+ let e, t;
1476
+ this.totalDisplayPages % 2 === 0 ? (e = this.modelValue - Math.floor(this.totalDisplayPages / 2) + 1, t = this.modelValue + Math.floor(this.totalDisplayPages / 2)) : (e = this.modelValue - Math.floor(this.totalDisplayPages / 2), t = this.modelValue + Math.floor(this.totalDisplayPages / 2)), e < 1 && (e = 1, t = this.totalDisplayPages), t > this.totalPages && (t = this.totalPages, e = this.totalPages - this.totalDisplayPages + 1);
1477
+ for (let c = e; c <= t; c++)
1478
+ s.push(c);
1479
+ }
1480
+ return s;
1481
+ }
1482
+ }
1483
+ }, qt = {
1484
+ key: 0,
1485
+ class: "w-100 user-select-none"
1486
+ }, Vt = { class: "pagination pagination mb-0" }, Et = { class: "page-item" }, Ht = { class: "page-item" }, Ot = ["onClick"], Yt = { class: "page-item" }, Ut = { class: "page-item" };
1487
+ function Wt(s, e, t, c, i, l) {
1488
+ const u = x("font-awesome-icon");
1489
+ return t.totalPages && t.totalPages > 1 ? (n(), r("div", qt, [
1490
+ o("ul", Vt, [
1491
+ o("li", Et, [
1492
+ o("span", {
1493
+ role: "button",
1494
+ class: f(["page-link", { disabled: t.modelValue === 1 }]),
1495
+ onClick: e[0] || (e[0] = (...d) => l.goFirstPage && l.goFirstPage(...d))
1496
+ }, [
1497
+ b(u, { icon: "fa-angles-left" })
1498
+ ], 2)
1499
+ ]),
1500
+ o("li", Ht, [
1501
+ o("span", {
1502
+ role: "button",
1503
+ class: f(["page-link", { disabled: t.modelValue === 1 }]),
1504
+ onClick: e[1] || (e[1] = (...d) => l.goPreviousPage && l.goPreviousPage(...d))
1505
+ }, [
1506
+ b(u, { icon: "fa-angle-left" })
1507
+ ], 2)
1508
+ ]),
1509
+ (n(!0), r(y, null, v(l.toDisplayPagination, (d) => (n(), r("li", {
1510
+ key: d,
1511
+ class: f(["page-item", { active: t.modelValue === d }])
1512
+ }, [
1513
+ o("span", {
1514
+ role: "button",
1515
+ class: "page-link",
1516
+ onClick: (m) => l.goToPage(d)
1517
+ }, p(d), 9, Ot)
1518
+ ], 2))), 128)),
1519
+ o("li", Yt, [
1520
+ o("span", {
1521
+ role: "button",
1522
+ class: f(["page-link", { disabled: t.modelValue === t.totalPages }]),
1523
+ onClick: e[2] || (e[2] = (...d) => l.goNextPage && l.goNextPage(...d))
1524
+ }, [
1525
+ b(u, { icon: "fa-angle-right" })
1526
+ ], 2)
1527
+ ]),
1528
+ o("li", Ut, [
1529
+ o("span", {
1530
+ role: "button",
1531
+ class: f(["page-link", { disabled: t.modelValue === t.totalPages }]),
1532
+ onClick: e[3] || (e[3] = (...d) => l.goLastPage && l.goLastPage(...d))
1533
+ }, [
1534
+ b(u, { icon: "fa-angles-right" })
1535
+ ], 2)
1536
+ ])
1537
+ ])
1538
+ ])) : g("", !0);
1539
+ }
1540
+ const Ys = /* @__PURE__ */ C(jt, [["render", Wt]]), Rt = {
1541
+ name: "AmsomSkeleton",
1542
+ props: {
1543
+ /**
1544
+ * @type {Array}
1545
+ * @description Nombre et taille (col-*) des placeholders
1546
+ * @default [8, 10, 12]
1547
+ */
1548
+ config: {
1549
+ type: Array,
1550
+ default: () => [8, 10, 12]
1551
+ },
1552
+ rowClass: {
1553
+ type: String,
1554
+ default: ""
1555
+ },
1556
+ loaderClass: {
1557
+ type: String,
1558
+ default: "text-gray rounded-2"
1559
+ }
1560
+ }
1561
+ };
1562
+ function Kt(s, e, t, c, i, l) {
1563
+ return n(), r("div", {
1564
+ class: f(["container row placeholder-wave", t.rowClass])
1565
+ }, [
1566
+ (n(!0), r(y, null, v(t.config, (u, d) => (n(), r("div", {
1567
+ key: d,
1568
+ class: f(["placeholder mt-1", [t.loaderClass, "col-" + u]])
1569
+ }, null, 2))), 128))
1570
+ ], 2);
1571
+ }
1572
+ const Gt = /* @__PURE__ */ C(Rt, [["render", Kt]]);
1573
+ M.add(re, q);
1574
+ const Jt = {
1575
+ name: "AmsomDocumentList",
1576
+ components: {
1577
+ AmsomSkeleton: Gt,
1578
+ AmsomOverlay: Z,
1579
+ AmsomCard: je,
1580
+ FontAwesomeIcon: D
1581
+ },
1582
+ props: {
1583
+ title: {
1584
+ type: String,
1585
+ default: "Mes documents"
1586
+ },
1587
+ loading: {
1588
+ type: Boolean,
1589
+ default: !1
1590
+ },
1591
+ documentList: {
1592
+ type: Array,
1593
+ required: !0,
1594
+ validator: (s) => s.every((e) => e.categorie && e.dateFichier)
1595
+ },
1596
+ anonym: {
1597
+ type: Boolean,
1598
+ default: !1
1599
+ },
1600
+ getDocumentBlob: {
1601
+ type: Function,
1602
+ required: !0
1603
+ },
1604
+ clickAction: {
1605
+ type: String,
1606
+ default: "download",
1607
+ validator: (s) => ["download", "view"].includes(s)
1608
+ }
1609
+ },
1610
+ data() {
1611
+ return {
1612
+ processing: !1
1613
+ };
1614
+ },
1615
+ methods: {
1616
+ unixToDateString: Ce,
1617
+ handleClick(s, e) {
1618
+ this.clickAction === "download" ? this.downloadFile(s, e) : this.viewFile(s);
1619
+ },
1620
+ async downloadFile(s, e) {
1621
+ this.processing = !0;
1622
+ let t = this.anonym ? "Document " + (e + 1) : (s == null ? void 0 : s.titre) ?? "Document", c = await this.getDocumentBlob(s);
1623
+ be(c, t), this.processing = !1;
1624
+ },
1625
+ async viewFile(s) {
1626
+ this.processing = !0;
1627
+ let e = await this.getDocumentBlob(s);
1628
+ ye(e), this.processing = !1;
1629
+ }
1630
+ }
1631
+ }, Zt = { key: 0 }, Qt = { class: "d-flex justify-content-between text-primary" }, Xt = { class: "mb-0" }, $t = { class: "mb-0" }, es = ["onClick"], ts = {
1632
+ role: "button",
1633
+ class: "d-flex justify-content-between align-items-center p-2 px-3 text-secondary"
1634
+ }, ss = { key: 0 }, ls = { key: 1 };
1635
+ function is(s, e, t, c, i, l) {
1636
+ const u = x("amsom-skeleton"), d = x("font-awesome-icon"), m = x("amsom-card"), a = x("amsom-overlay");
1637
+ return n(), k(a, { loading: i.processing }, {
1638
+ default: z(() => [
1639
+ b(m, null, {
1640
+ default: z(() => {
1641
+ var h;
1642
+ return [
1643
+ o("h5", null, p(t.title), 1),
1644
+ t.loading ? (n(), r(y, { key: 0 }, [
1645
+ b(u, {
1646
+ config: [3, 3],
1647
+ "row-class": "justify-content-between"
1648
+ }),
1649
+ b(u, { config: [12] })
1650
+ ], 64)) : (n(), r(y, { key: 1 }, [
1651
+ (h = t.documentList) != null && h.length ? (n(!0), r(y, { key: 1 }, v(t.documentList, (S, B) => (n(), r("div", {
1652
+ key: B,
1653
+ class: "document-item pt-2"
1654
+ }, [
1655
+ o("div", Qt, [
1656
+ o("p", Xt, p(S.categorie), 1),
1657
+ o("p", $t, p(l.unixToDateString(S.dateFichier)), 1)
1658
+ ]),
1659
+ o("div", {
1660
+ class: "bg-primary bg-opacity-25 mt-0 rounded-3",
1661
+ onClick: (Ms) => l.handleClick(S, B)
1662
+ }, [
1663
+ o("div", ts, [
1664
+ t.anonym ? (n(), r("strong", ls, "Document " + p(B + 1), 1)) : (n(), r("strong", ss, p(S.titre), 1)),
1665
+ t.clickAction === "download" ? (n(), k(d, {
1666
+ key: 2,
1667
+ icon: "fa-solid fa-cloud-arrow-down"
1668
+ })) : t.clickAction === "view" ? (n(), k(d, {
1669
+ key: 3,
1670
+ icon: "fa-solid fa-eye"
1671
+ })) : g("", !0)
1672
+ ])
1673
+ ], 8, es)
1674
+ ]))), 128)) : (n(), r("div", Zt, [...e[0] || (e[0] = [
1675
+ o("p", null, "Aucun document", -1)
1676
+ ])]))
1677
+ ], 64))
1678
+ ];
1679
+ }),
1680
+ _: 1
1681
+ })
1682
+ ]),
1683
+ _: 1
1684
+ }, 8, ["loading"]);
1685
+ }
1686
+ const Us = /* @__PURE__ */ C(Jt, [["render", is]]);
1687
+ M.add(de, q, K, ue, ce, me);
1688
+ const ns = window.File_native ?? window.File, os = {
1689
+ name: "AmsomUploadFile",
1690
+ components: { FontAwesomeIcon: D, AmsomOverlay: Z },
1691
+ props: ["name", "pjName", "fileName", "subText", "title", "required", "label", "modelValue", "gedFile", "readStatus", "readOnly", "rejectStatus", "clickFileHandler"],
1692
+ /*
1693
+ * name: Nom technique de la pj
1694
+ * pjName: Nom de la Pj à afficher pour l'utilisateur
1695
+ * fileName : Nom du fichier
1696
+ * subText: indication complémentaire pour l'utilisateur
1697
+ * title : Titre qui s'affiche au dessus de la pj lorsqu'elle est renseignée
1698
+ * required: Indique si la pj est obligatoire
1699
+ * label: Label du champ
1700
+ */
1701
+ data() {
1702
+ return {
1703
+ fileToUpload: [],
1704
+ fileLoading: !1,
1705
+ finalFile: null,
1706
+ fileDragged: !1
1707
+ };
1708
+ },
1709
+ computed: {},
1710
+ watch: {
1711
+ gedFile: function() {
1712
+ this.handleGedFile();
1713
+ },
1714
+ fileName: function(s) {
1715
+ this.finalFile !== null && (this.finalFile.name = s, this.emitFile());
1716
+ }
1717
+ },
1718
+ mounted() {
1719
+ var s;
1720
+ (s = this.modelValue) != null && s.file ? this.finalFile = this.modelValue : this.gedFile && this.handleGedFile();
1721
+ },
1722
+ //todo a voir avec antoine
1723
+ // unmounted() {
1724
+ // this.deletePj()
1725
+ // },
1726
+ methods: {
1727
+ clickAddPj() {
1728
+ document.getElementById("fileUpload-" + this.name).click();
1729
+ },
1730
+ handleGedFile() {
1731
+ this.fileToUpload = [this.gedFile], this.uploadImage();
1732
+ },
1733
+ async addPj(s) {
1734
+ this.fileDragged = !1;
1735
+ const e = s.dataTransfer ? [...s.dataTransfer.files] : [...s.target.files];
1736
+ let t = !0;
1737
+ for (let c of e)
1738
+ if (!await j(c) && !await ke(c)) {
1739
+ t = !1;
1740
+ break;
1741
+ }
1742
+ if (!t) {
1743
+ alert("Les documents doivent être de type PDF et/ou des images"), document.getElementById("input-pj-" + this.name).value = null;
1744
+ return;
1745
+ }
1746
+ this.fileToUpload.push(...e), this.uploadImage();
1747
+ },
1748
+ clickFile(s) {
1749
+ this.clickFileHandler ? this.clickFileHandler(s) : this.openFile(s);
1750
+ },
1751
+ openFile(s) {
1752
+ if (!s) {
1753
+ alert("Aucun fichier");
1754
+ return;
1755
+ }
1756
+ xe(s);
1757
+ },
1758
+ async uploadImage() {
1759
+ this.$emit("fileLoading", !0), this.fileLoading = !0;
1760
+ let s = new ve(), e = this.fileToUpload;
1761
+ for (let l of e)
1762
+ if (await j(l)) {
1763
+ let u = await G({
1764
+ file: l,
1765
+ maxWidth: 795,
1766
+ maxHeigth: 1125
1767
+ }), d = Se(u);
1768
+ await s.add(d);
1769
+ } else
1770
+ await s.add(l);
1771
+ let t = await s.saveAsBlob(), c = new ns([t], "doc.pdf", {
1772
+ type: "application/pdf"
1773
+ }), i = await J(c, "pdf");
1774
+ i.name = this.fileName, this.finalFile = i, this.emitFile(), this.$emit("fileLoading", !1), this.fileLoading = !1;
1775
+ },
1776
+ emitFile() {
1777
+ this.$emit("update:modelValue", this.finalFile);
1778
+ },
1779
+ deletePj() {
1780
+ this.finalFile = null, this.emitFile(), this.$emit("deleteFile"), this.fileToUpload = [];
1781
+ }
1782
+ }
1783
+ }, as = { class: "position-relative" }, rs = ["id"], ds = ["id", "for"], us = { class: "" }, cs = { class: "flex-grow-1" }, ms = { class: "fs-6 fw-bold" }, fs = {
1784
+ class: "text-primary form-text fst-italic",
1785
+ style: { "font-size": "smaller" }
1786
+ }, gs = ["id", "required", "name"], hs = {
1787
+ key: 1,
1788
+ class: "w-100"
1789
+ }, ps = {
1790
+ key: 0,
1791
+ class: "text-decoration-underline"
1792
+ }, ys = { class: "p-2 d-flex align-items-center" }, bs = {
1793
+ key: 3,
1794
+ class: "text-muted"
1795
+ }, Ss = {
1796
+ key: 0,
1797
+ class: "me-2"
1798
+ }, xs = ["id"], ks = ["id"], ws = { key: 1 }, Cs = ["id"];
1799
+ function vs(s, e, t, c, i, l) {
1800
+ const u = x("font-awesome-icon"), d = x("amsom-overlay");
1801
+ return n(), k(d, { loading: i.fileLoading }, {
1802
+ default: z(() => {
1803
+ var m;
1804
+ return [
1805
+ o("div", as, [
1806
+ (m = i.finalFile) != null && m.file ? (n(), r("div", hs, [
1807
+ t.title ? (n(), r("h5", ps, p(t.title), 1)) : g("", !0),
1808
+ o("div", ys, [
1809
+ o("div", {
1810
+ role: "button",
1811
+ class: "hoverable flex-grow-1",
1812
+ onClick: e[8] || (e[8] = (a) => l.clickFile(i.finalFile.file))
1813
+ }, [
1814
+ t.rejectStatus ? (n(), k(u, {
1815
+ key: 0,
1816
+ icon: "fa-solid fa-exclamation-triangle",
1817
+ class: "text-danger me-1"
1818
+ })) : g("", !0),
1819
+ t.readStatus === "read" ? (n(), k(u, {
1820
+ key: 1,
1821
+ icon: "fa-solid fa-eye",
1822
+ class: "text-amsom-green me-1"
1823
+ })) : g("", !0),
1824
+ t.readStatus === "unread" ? (n(), k(u, {
1825
+ key: 2,
1826
+ icon: "fa-solid fa-eye-slash",
1827
+ class: "text-warning me-1"
1828
+ })) : g("", !0),
1829
+ b(u, { icon: "fa-solid fa-solid fa-paperclip" }),
1830
+ A(" " + p(t.pjName), 1),
1831
+ i.fileToUpload.length > 1 ? (n(), r("small", bs, " (" + p(i.fileToUpload.length) + " Fichiers)", 1)) : g("", !0)
1832
+ ]),
1833
+ t.readOnly ? g("", !0) : N((n(), r("div", Ss, [
1834
+ o("input", {
1835
+ id: "fileUpload-" + t.name,
1836
+ type: "file",
1837
+ style: { opacity: "0", position: "absolute", top: "0", "z-index": "-1" },
1838
+ accept: "image/png, image/jpeg, application/pdf",
1839
+ hidden: "",
1840
+ multiple: "",
1841
+ onChange: e[9] || (e[9] = (...a) => l.addPj && l.addPj(...a))
1842
+ }, null, 40, xs),
1843
+ o("button", {
1844
+ id: "add-field-" + t.name,
1845
+ type: "button",
1846
+ class: "btn btn-primary rounded-5 fs-7 py-0 me-1",
1847
+ onClick: e[10] || (e[10] = (...a) => l.clickAddPj && l.clickAddPj(...a))
1848
+ }, [
1849
+ b(u, {
1850
+ icon: "fa-solid fa-file-circle-plus",
1851
+ class: "me-1"
1852
+ }),
1853
+ e[14] || (e[14] = o("span", null, [
1854
+ A(" Ajouter"),
1855
+ o("span", { class: "d-none d-md-block" }, " un document")
1856
+ ], -1))
1857
+ ], 8, ks)
1858
+ ], 512)), [
1859
+ [he, i.fileToUpload.length > 0]
1860
+ ]),
1861
+ t.readOnly ? g("", !0) : (n(), r("div", ws, [
1862
+ o("button", {
1863
+ id: "delete-all-pj-" + t.name,
1864
+ type: "button",
1865
+ class: "btn btn-link text-danger hoverable text-decoration-underline p-0",
1866
+ onClick: e[11] || (e[11] = (...a) => l.deletePj && l.deletePj(...a))
1867
+ }, " Supprimer ", 8, Cs)
1868
+ ]))
1869
+ ])
1870
+ ])) : (n(), r("div", {
1871
+ key: 0,
1872
+ id: "input-group-pj-" + t.name,
1873
+ role: "group"
1874
+ }, [
1875
+ o("label", {
1876
+ id: "label-pj-" + t.name,
1877
+ for: "input-pj-" + t.name,
1878
+ role: "button",
1879
+ class: f(["m-0 px-1 py-2 d-block text-center text-secondary rounded-4 border-2 pj-label", { "border border-solid shadow": i.fileDragged }]),
1880
+ style: { "border-color": "var(--bs-gray-400)", "border-style": "dashed" },
1881
+ onDrop: e[1] || (e[1] = w((...a) => l.addPj && l.addPj(...a), ["prevent", "stop"])),
1882
+ onDrag: e[2] || (e[2] = w(() => {
1883
+ }, ["prevent", "stop"])),
1884
+ onDragstart: e[3] || (e[3] = w((a) => i.fileDragged = !0, ["prevent", "stop"])),
1885
+ onDragend: e[4] || (e[4] = w((a) => i.fileDragged = !1, ["prevent", "stop"])),
1886
+ onDragover: e[5] || (e[5] = w((a) => i.fileDragged = !0, ["prevent", "stop"])),
1887
+ onDragenter: e[6] || (e[6] = w((a) => i.fileDragged = !0, ["prevent", "stop"])),
1888
+ onDragleave: e[7] || (e[7] = w((a) => i.fileDragged = !1, ["prevent", "stop"]))
1889
+ }, [
1890
+ o("div", us, [
1891
+ b(u, {
1892
+ icon: ["fas", "cloud-arrow-up"],
1893
+ size: "3x",
1894
+ "beat-fade": i.fileDragged
1895
+ }, null, 8, ["beat-fade"])
1896
+ ]),
1897
+ o("div", cs, [
1898
+ o("div", ms, p(t.label ?? t.pjName), 1),
1899
+ o("small", fs, p(t.subText), 1),
1900
+ e[12] || (e[12] = o("hr", { class: "mx-auto w-50 m-0 mb-1" }, null, -1)),
1901
+ e[13] || (e[13] = o("small", {
1902
+ class: "d-block text-muted",
1903
+ style: { "font-size": "0.8em" }
1904
+ }, [
1905
+ o("u", null, "Glissez"),
1906
+ A(" vos fichiers ici ou "),
1907
+ o("u", null, "cliquez"),
1908
+ A(" pour les sélectionner ")
1909
+ ], -1))
1910
+ ]),
1911
+ o("input", {
1912
+ id: "input-pj-" + t.name,
1913
+ class: "form-control",
1914
+ type: "file",
1915
+ style: { opacity: "0", position: "absolute", top: "0", "z-index": "-1" },
1916
+ accept: "image/png, image/jpeg, application/pdf",
1917
+ multiple: "",
1918
+ required: t.required,
1919
+ name: "pj" + t.name,
1920
+ onChange: e[0] || (e[0] = (...a) => l.addPj && l.addPj(...a))
1921
+ }, null, 40, gs)
1922
+ ], 42, ds)
1923
+ ], 8, rs))
1924
+ ])
1925
+ ];
1926
+ }),
1927
+ _: 1
1928
+ }, 8, ["loading"]);
1929
+ }
1930
+ const Ws = /* @__PURE__ */ C(os, [["render", vs]]), _s = {
1931
+ name: "SliderSwitch",
1932
+ props: {
1933
+ listSection: {
1934
+ type: Array,
1935
+ default: () => [
1936
+ { id: 1, name: "Slider 1" },
1937
+ { id: 2, name: "Slider 2" },
1938
+ { id: 3, name: "Slider 3" }
1939
+ ]
1940
+ },
1941
+ containerClass: {
1942
+ type: String,
1943
+ default: "bg-secondary-subtle"
1944
+ },
1945
+ itemClass: {
1946
+ type: String,
1947
+ default: "fs-6"
1948
+ },
1949
+ bubbleClass: {
1950
+ type: String,
1951
+ default: "bg-light"
1952
+ },
1953
+ modelValue: {
1954
+ type: Number,
1955
+ default: 1
1956
+ },
1957
+ disabled: {
1958
+ type: Boolean,
1959
+ default: !1
1960
+ }
1961
+ },
1962
+ emits: ["update:modelValue"],
1963
+ mounted() {
1964
+ this.updateSliderPosition(), window.addEventListener("resize", this.handleResize);
1965
+ },
1966
+ beforeUnmount() {
1967
+ window.removeEventListener("resize", this.handleResize);
1968
+ },
1969
+ methods: {
1970
+ updateSliderPosition() {
1971
+ this.$nextTick(() => {
1972
+ const s = this.$el.querySelector(`#switch-section-${this.modelValue}`);
1973
+ if (!s) {
1974
+ const t = this.$el.querySelector("#switch-section-1");
1975
+ if (!t) return;
1976
+ const c = this.$el.querySelector(".slider");
1977
+ if (!c) return;
1978
+ c.style.width = `${t.offsetWidth}px`, c.style.height = `${t.offsetHeight}px`, c.style.left = `${t.offsetLeft}px`;
1979
+ return;
1980
+ }
1981
+ const e = this.$el.querySelector(".slider");
1982
+ e && (e.style.width = `${s.offsetWidth}px`, e.style.height = `${s.offsetHeight}px`, e.style.left = `${s.offsetLeft}px`);
1983
+ });
1984
+ },
1985
+ handleResize() {
1986
+ this.updateSliderPosition();
1987
+ },
1988
+ switchSection(s) {
1989
+ if (this.disabled) return;
1990
+ this.$emit("update:modelValue", s);
1991
+ const e = this.$el.querySelector(".slider"), t = this.$el.querySelector(`#switch-section-${s}`);
1992
+ e.style.width = t.clientWidth + "px", e.style.left = t.offsetLeft + "px";
1993
+ }
1994
+ }
1995
+ }, Ps = {
1996
+ class: "d-flex align-items-center justify-content-center mb-2 w-100 p-0",
1997
+ style: { "border-radius": "1em" }
1998
+ }, Is = ["id", "onClick"];
1999
+ function Ds(s, e, t, c, i, l) {
2000
+ return n(), r("div", Ps, [
2001
+ o("ul", {
2002
+ id: "switch-section",
2003
+ class: f(["d-flex justify-content-center rounded-5 p-2 m-0 position-relative w-100", [t.containerClass, { disabled: t.disabled }]])
2004
+ }, [
2005
+ (n(!0), r(y, null, v(t.listSection, (u) => (n(), r("li", {
2006
+ id: "switch-section-" + u.id,
2007
+ key: u.id,
2008
+ class: f(["rounded-5 px-4 py-2 w-100 text-center", [
2009
+ t.itemClass,
2010
+ {
2011
+ hoverable: !t.disabled,
2012
+ "cursor-not-allowed": t.disabled
2013
+ }
2014
+ ]]),
2015
+ role: "button",
2016
+ onClick: (d) => l.switchSection(u.id)
2017
+ }, p(u.name), 11, Is))), 128)),
2018
+ o("span", {
2019
+ class: f(["slider position-absolute", t.bubbleClass])
2020
+ }, null, 2)
2021
+ ], 2)
2022
+ ]);
2023
+ }
2024
+ const Rs = /* @__PURE__ */ C(_s, [["render", Ds], ["__scopeId", "data-v-02559b82"]]);
2
2025
  export {
3
- s as AmsomCard,
4
- o as AmsomDocumentList,
5
- e as AmsomHorizontalStepper,
6
- A as AmsomImage,
7
- l as AmsomModal,
8
- t as AmsomOverlay,
9
- r as AmsomPagination,
10
- i as AmsomSkeleton,
11
- d as AmsomSliderSwitch,
12
- n as AmsomTableDraggable,
13
- p as AmsomUploadFile,
14
- S as AmsomVerticalStepper,
15
- g as default
2026
+ je as AmsomCard,
2027
+ Us as AmsomDocumentList,
2028
+ Es as AmsomHorizontalStepper,
2029
+ Hs as AmsomImage,
2030
+ Ae as AmsomModal,
2031
+ Z as AmsomOverlay,
2032
+ Ys as AmsomPagination,
2033
+ Gt as AmsomSkeleton,
2034
+ Rs as AmsomSliderSwitch,
2035
+ Os as AmsomTableDraggable,
2036
+ Ws as AmsomUploadFile,
2037
+ Vs as AmsomVerticalStepper,
2038
+ Ae as default
16
2039
  };