@cnamts/synapse 1.0.4 → 1.0.5
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/DateFilter-BQpRKTju.js +98 -0
- package/dist/NumberFilter-BykSKt2D.js +121 -0
- package/dist/PeriodFilter-Cks6NygV.js +112 -0
- package/dist/SelectFilter-DEL5dHd_.js +136 -0
- package/dist/TextFilter-0RAFj7Oe.js +114 -0
- package/dist/design-system-v3.js +1 -1
- package/dist/design-system-v3.umd.cjs +253 -253
- package/dist/{main-BzyNNvHX.js → main-Co2P_lBt.js} +10181 -9958
- package/dist/{design-system-v3.css → style.css} +1 -1
- package/package.json +2 -2
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/tests/__snapshots__/AmeliproHeaderBrandSection.spec.ts.snap +1 -1
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/tests/__snapshots__/AmeliproHeaderBar.spec.ts.snap +1 -1
- package/src/components/Amelipro/AmeliproHeader/tests/__snapshots__/AmeliproHeader.spec.ts.snap +1 -1
- package/src/components/Amelipro/AmeliproMenu/tests/__snapshots__/AmeliproMenu.spec.ts.snap +1 -1
- package/src/components/Amelipro/AmeliproPageLayout/tests/__snapshots__/AmeliproPageLayout.spec.ts.snap +1 -1
- package/dist/DateFilter-yrwJv_2R.js +0 -95
- package/dist/NumberFilter-BQXtywZI.js +0 -117
- package/dist/PeriodFilter-BYXVSzr5.js +0 -108
- package/dist/SelectFilter-CJV_mlN3.js +0 -133
- package/dist/TextFilter-DN0ejYIs.js +0 -110
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { defineComponent as b, computed as D, createBlock as k, openBlock as p } from "vue";
|
|
2
|
+
import { u as C, D as F, _ as V } from "./main-Co2P_lBt.js";
|
|
3
|
+
const v = /* @__PURE__ */ b({
|
|
4
|
+
__name: "DateFilter",
|
|
5
|
+
props: {
|
|
6
|
+
header: {
|
|
7
|
+
type: Object,
|
|
8
|
+
required: !0
|
|
9
|
+
},
|
|
10
|
+
filters: {
|
|
11
|
+
type: Array,
|
|
12
|
+
default: () => []
|
|
13
|
+
},
|
|
14
|
+
filterValue: {
|
|
15
|
+
type: [String, Date, Object, null],
|
|
16
|
+
default: null
|
|
17
|
+
},
|
|
18
|
+
inputConfig: {
|
|
19
|
+
type: Object,
|
|
20
|
+
default: () => ({})
|
|
21
|
+
},
|
|
22
|
+
disableErrorHandling: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: !1
|
|
25
|
+
},
|
|
26
|
+
variant: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: "outlined"
|
|
29
|
+
},
|
|
30
|
+
hideDetails: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !0
|
|
33
|
+
},
|
|
34
|
+
density: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: "compact"
|
|
37
|
+
},
|
|
38
|
+
backgroundColor: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: "white"
|
|
41
|
+
},
|
|
42
|
+
clearable: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: !0
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
emits: ["update:filters"],
|
|
48
|
+
setup(e, { emit: g }) {
|
|
49
|
+
const { parseDate: y } = C(), t = e, u = g;
|
|
50
|
+
function s() {
|
|
51
|
+
return String(t.header.key || t.header.value || (t.header.title ? `filter_${t.header.title}` : `filter_${Date.now()}`));
|
|
52
|
+
}
|
|
53
|
+
const f = D({
|
|
54
|
+
get: () => t.filterValue,
|
|
55
|
+
set: (a) => {
|
|
56
|
+
const i = s();
|
|
57
|
+
if (!i) return;
|
|
58
|
+
if (a === null) {
|
|
59
|
+
const r = t.filters.filter((o) => o.key !== i);
|
|
60
|
+
u("update:filters", r);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const l = t.filters.findIndex((r) => r.key === i), n = [...t.filters];
|
|
64
|
+
let d = a;
|
|
65
|
+
typeof a == "string" && a.trim() !== "" && y(a, t.header.dateFormat || "DD/MM/YYYY") && (d = a), l >= 0 ? n[l].value = d : n.push({
|
|
66
|
+
key: i,
|
|
67
|
+
value: d,
|
|
68
|
+
type: "date"
|
|
69
|
+
}), u("update:filters", n);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
function m() {
|
|
73
|
+
const a = s(), i = t.filters.filter((l) => l.key !== a);
|
|
74
|
+
u("update:filters", i);
|
|
75
|
+
}
|
|
76
|
+
return (a, i) => {
|
|
77
|
+
var l, n, d, r, o, c;
|
|
78
|
+
return p(), k(F, {
|
|
79
|
+
modelValue: f.value,
|
|
80
|
+
"onUpdate:modelValue": i[0] || (i[0] = (h) => f.value = h),
|
|
81
|
+
label: e.header.title,
|
|
82
|
+
clearable: ((l = e.inputConfig) == null ? void 0 : l.clearable) ?? e.clearable,
|
|
83
|
+
density: ((n = e.inputConfig) == null ? void 0 : n.density) ?? e.density,
|
|
84
|
+
"hide-details": ((d = e.inputConfig) == null ? void 0 : d.hideDetails) ?? e.hideDetails,
|
|
85
|
+
"hide-messages": e.header.hideMessages,
|
|
86
|
+
variant: ((r = e.inputConfig) == null ? void 0 : r.variant) ?? e.variant,
|
|
87
|
+
"disable-error-handling": ((o = e.inputConfig) == null ? void 0 : o.disableErrorHandling) ?? e.disableErrorHandling,
|
|
88
|
+
"bg-color": ((c = e.inputConfig) == null ? void 0 : c.backgroundColor) ?? e.backgroundColor,
|
|
89
|
+
format: e.header.dateFormat,
|
|
90
|
+
class: "filter-input",
|
|
91
|
+
"onClick:clear": m
|
|
92
|
+
}, null, 8, ["modelValue", "label", "clearable", "density", "hide-details", "hide-messages", "variant", "disable-error-handling", "bg-color", "format"]);
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
}), B = /* @__PURE__ */ V(v, [["__scopeId", "data-v-8226471a"]]);
|
|
96
|
+
export {
|
|
97
|
+
B as default
|
|
98
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { defineComponent as k, ref as h, watch as x, computed as T, createElementBlock as V, openBlock as F, createVNode as w } from "vue";
|
|
2
|
+
import { a as S, _ as D } from "./main-Co2P_lBt.js";
|
|
3
|
+
const E = { class: "number-filter-container" }, B = /* @__PURE__ */ k({
|
|
4
|
+
__name: "NumberFilter",
|
|
5
|
+
props: {
|
|
6
|
+
header: {
|
|
7
|
+
type: Object,
|
|
8
|
+
required: !0
|
|
9
|
+
},
|
|
10
|
+
filters: {
|
|
11
|
+
type: Array,
|
|
12
|
+
default: () => []
|
|
13
|
+
},
|
|
14
|
+
filterValue: {
|
|
15
|
+
type: [Number, String],
|
|
16
|
+
default: ""
|
|
17
|
+
},
|
|
18
|
+
inputConfig: {
|
|
19
|
+
type: Object,
|
|
20
|
+
default: () => ({})
|
|
21
|
+
},
|
|
22
|
+
disableErrorHandling: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: !1
|
|
25
|
+
},
|
|
26
|
+
variant: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: "outlined"
|
|
29
|
+
},
|
|
30
|
+
hideDetails: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !0
|
|
33
|
+
},
|
|
34
|
+
density: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: "compact"
|
|
37
|
+
},
|
|
38
|
+
backgroundColor: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: "white"
|
|
41
|
+
},
|
|
42
|
+
clearable: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: !0
|
|
45
|
+
},
|
|
46
|
+
debounceTime: {
|
|
47
|
+
type: Number,
|
|
48
|
+
default: 300
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
emits: ["update:filters"],
|
|
52
|
+
setup(l, { emit: y }) {
|
|
53
|
+
const e = l, s = y, d = h(e.filterValue || ""), u = h(null);
|
|
54
|
+
x(() => e.filters, (t) => {
|
|
55
|
+
t.length === 0 && (u.value !== null && (clearTimeout(u.value), u.value = null), d.value = "");
|
|
56
|
+
});
|
|
57
|
+
function c() {
|
|
58
|
+
return !e.header || !e.header.key && !e.header.value && !e.header.title ? `filter_${Date.now()}` : String(e.header.key || e.header.value || (e.header.title ? `filter_${e.header.title}` : `filter_${Date.now()}`));
|
|
59
|
+
}
|
|
60
|
+
function p(t) {
|
|
61
|
+
const a = /^([=<>]{1,2})?(.*)$/.exec(t);
|
|
62
|
+
if (!a) return "";
|
|
63
|
+
const i = a[1] || "";
|
|
64
|
+
let r = a[2] || "";
|
|
65
|
+
return r = r.replace(/[^0-9.,]/g, ""), i + r;
|
|
66
|
+
}
|
|
67
|
+
const f = T({
|
|
68
|
+
get: () => d.value,
|
|
69
|
+
set: (t) => {
|
|
70
|
+
var o;
|
|
71
|
+
const n = t != null ? String(t) : "", a = p(n);
|
|
72
|
+
d.value = a, u.value !== null && clearTimeout(u.value);
|
|
73
|
+
const i = ((o = e.inputConfig) == null ? void 0 : o.debounceTime) ?? e.debounceTime;
|
|
74
|
+
i === 0 || void 0 ? g(a) : u.value = window.setTimeout(() => {
|
|
75
|
+
g(a);
|
|
76
|
+
}, i);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
function g(t) {
|
|
80
|
+
const n = c();
|
|
81
|
+
if (!e.header || Object.keys(e.header).length, t === "" || t === "0") {
|
|
82
|
+
s("update:filters", e.filters.filter((o) => o.key !== n));
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const a = e.filters.findIndex((o) => o.key === n), i = [...e.filters], r = /^[=<>]{1,2}/.test(t);
|
|
86
|
+
a >= 0 ? i[a].value = r ? t : parseFloat(t.replace(",", ".")) : i.push({
|
|
87
|
+
key: n,
|
|
88
|
+
value: r ? t : parseFloat(t.replace(",", ".")),
|
|
89
|
+
type: "number"
|
|
90
|
+
}), s("update:filters", i);
|
|
91
|
+
}
|
|
92
|
+
function v() {
|
|
93
|
+
d.value = "";
|
|
94
|
+
const t = c();
|
|
95
|
+
s("update:filters", e.filters.filter((n) => n.key !== t));
|
|
96
|
+
}
|
|
97
|
+
return (t, n) => {
|
|
98
|
+
var a, i, r, o, m, b;
|
|
99
|
+
return F(), V("div", E, [
|
|
100
|
+
w(S, {
|
|
101
|
+
modelValue: f.value,
|
|
102
|
+
"onUpdate:modelValue": n[0] || (n[0] = (C) => f.value = C),
|
|
103
|
+
label: l.header.title,
|
|
104
|
+
type: "text",
|
|
105
|
+
clearable: ((a = l.inputConfig) == null ? void 0 : a.clearable) ?? l.clearable,
|
|
106
|
+
density: ((i = l.inputConfig) == null ? void 0 : i.density) ?? l.density,
|
|
107
|
+
"hide-details": ((r = l.inputConfig) == null ? void 0 : r.hideDetails) ?? l.hideDetails,
|
|
108
|
+
"hide-messages": l.header.hideMessages,
|
|
109
|
+
"disable-error-handling": ((o = l.inputConfig) == null ? void 0 : o.disableErrorHandling) ?? l.disableErrorHandling,
|
|
110
|
+
variant: ((m = l.inputConfig) == null ? void 0 : m.variant) ?? l.variant,
|
|
111
|
+
"bg-color": ((b = l.inputConfig) == null ? void 0 : b.backgroundColor) ?? l.backgroundColor,
|
|
112
|
+
class: "filter-input",
|
|
113
|
+
"onClick:clear": v
|
|
114
|
+
}, null, 8, ["modelValue", "label", "clearable", "density", "hide-details", "hide-messages", "disable-error-handling", "variant", "bg-color"])
|
|
115
|
+
]);
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
}), O = /* @__PURE__ */ D(B, [["__scopeId", "data-v-7a98936f"]]);
|
|
119
|
+
export {
|
|
120
|
+
O as default
|
|
121
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { defineComponent as b, computed as h, createBlock as p, openBlock as k } from "vue";
|
|
2
|
+
import { P as C, _ as F } from "./main-Co2P_lBt.js";
|
|
3
|
+
const V = /* @__PURE__ */ b({
|
|
4
|
+
__name: "PeriodFilter",
|
|
5
|
+
props: {
|
|
6
|
+
header: {
|
|
7
|
+
type: Object,
|
|
8
|
+
required: !0
|
|
9
|
+
},
|
|
10
|
+
filters: {
|
|
11
|
+
type: Array,
|
|
12
|
+
default: () => []
|
|
13
|
+
},
|
|
14
|
+
filterValue: {
|
|
15
|
+
type: Object,
|
|
16
|
+
default: () => ({ from: null, to: null })
|
|
17
|
+
},
|
|
18
|
+
inputConfig: {
|
|
19
|
+
type: Object,
|
|
20
|
+
default: () => ({})
|
|
21
|
+
},
|
|
22
|
+
disableErrorHandling: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: !1
|
|
25
|
+
},
|
|
26
|
+
variant: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: "outlined"
|
|
29
|
+
},
|
|
30
|
+
hideDetails: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !0
|
|
33
|
+
},
|
|
34
|
+
density: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: "compact"
|
|
37
|
+
},
|
|
38
|
+
backgroundColor: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: "white"
|
|
41
|
+
},
|
|
42
|
+
clearable: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: !0
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
emits: ["update:filters"],
|
|
48
|
+
setup(e, { emit: y }) {
|
|
49
|
+
const l = e, o = y;
|
|
50
|
+
function u() {
|
|
51
|
+
var r, t, i;
|
|
52
|
+
return String(((r = l.header) == null ? void 0 : r.key) || ((t = l.header) == null ? void 0 : t.value) || ((i = l.header) != null && i.title ? `filter_${l.header.title}` : `filter_${Date.now()}`));
|
|
53
|
+
}
|
|
54
|
+
const f = h({
|
|
55
|
+
get: () => l.filterValue,
|
|
56
|
+
set: (r) => {
|
|
57
|
+
try {
|
|
58
|
+
const t = u();
|
|
59
|
+
if (!t) return;
|
|
60
|
+
if (!r) {
|
|
61
|
+
const i = l.filters.filter((a) => a.key !== t);
|
|
62
|
+
o("update:filters", i);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (typeof r == "object" && r.from === null && r.to === null) {
|
|
66
|
+
const i = l.filters.filter((a) => a.key !== t);
|
|
67
|
+
o("update:filters", i);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (typeof r == "object") {
|
|
71
|
+
const i = {
|
|
72
|
+
from: r.from,
|
|
73
|
+
to: r.to
|
|
74
|
+
}, a = l.filters.findIndex((d) => d.key === t), n = [...l.filters];
|
|
75
|
+
a >= 0 ? n[a].value = i : n.push({
|
|
76
|
+
key: t,
|
|
77
|
+
value: i,
|
|
78
|
+
type: "period"
|
|
79
|
+
}), o("update:filters", n);
|
|
80
|
+
}
|
|
81
|
+
} catch (t) {
|
|
82
|
+
console.error("Erreur dans la mise à jour du filtre de période:", t);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
function g() {
|
|
87
|
+
const r = u(), t = l.filters.filter((i) => i.key !== r);
|
|
88
|
+
o("update:filters", t);
|
|
89
|
+
}
|
|
90
|
+
return (r, t) => {
|
|
91
|
+
var i, a, n, d, s, c;
|
|
92
|
+
return k(), p(C, {
|
|
93
|
+
modelValue: f.value,
|
|
94
|
+
"onUpdate:modelValue": t[0] || (t[0] = (m) => f.value = m),
|
|
95
|
+
label: e.header.title,
|
|
96
|
+
clearable: ((i = e.inputConfig) == null ? void 0 : i.clearable) ?? e.clearable,
|
|
97
|
+
density: ((a = e.inputConfig) == null ? void 0 : a.density) ?? e.density,
|
|
98
|
+
"hide-details": ((n = e.inputConfig) == null ? void 0 : n.hideDetails) ?? e.hideDetails,
|
|
99
|
+
"hide-messages": e.header.hideMessages,
|
|
100
|
+
variant: ((d = e.inputConfig) == null ? void 0 : d.variant) ?? e.variant,
|
|
101
|
+
"disable-error-handling": ((s = e.inputConfig) == null ? void 0 : s.disableErrorHandling) ?? e.disableErrorHandling,
|
|
102
|
+
"bg-color": ((c = e.inputConfig) == null ? void 0 : c.backgroundColor) ?? e.backgroundColor,
|
|
103
|
+
format: e.header.dateFormat,
|
|
104
|
+
class: "filter-input",
|
|
105
|
+
"onClick:clear": g
|
|
106
|
+
}, null, 8, ["modelValue", "label", "clearable", "density", "hide-details", "hide-messages", "variant", "disable-error-handling", "bg-color", "format"]);
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
}), x = /* @__PURE__ */ F(V, [["__scopeId", "data-v-63126e87"]]);
|
|
110
|
+
export {
|
|
111
|
+
x as default
|
|
112
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { defineComponent as C, computed as p, ref as F, createElementBlock as S, openBlock as A, createVNode as B } from "vue";
|
|
2
|
+
import { S as E, _ as D } from "./main-Co2P_lBt.js";
|
|
3
|
+
const n = {
|
|
4
|
+
defaultOption: "- choisir -",
|
|
5
|
+
emptyValue: "(vide)"
|
|
6
|
+
}, h = {}, I = { class: "select-filter-wrapper" }, N = /* @__PURE__ */ C({
|
|
7
|
+
__name: "SelectFilter",
|
|
8
|
+
props: {
|
|
9
|
+
header: {
|
|
10
|
+
type: Object,
|
|
11
|
+
required: !0
|
|
12
|
+
},
|
|
13
|
+
filters: {
|
|
14
|
+
type: Array,
|
|
15
|
+
default: () => []
|
|
16
|
+
},
|
|
17
|
+
filterValue: {
|
|
18
|
+
type: [String, Number, Object, Array, void 0, null],
|
|
19
|
+
default: null
|
|
20
|
+
},
|
|
21
|
+
inputConfig: {
|
|
22
|
+
type: Object,
|
|
23
|
+
default: () => ({})
|
|
24
|
+
},
|
|
25
|
+
disableErrorHandling: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: !1
|
|
28
|
+
},
|
|
29
|
+
variant: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: "outlined"
|
|
32
|
+
},
|
|
33
|
+
hideDetails: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: !0
|
|
36
|
+
},
|
|
37
|
+
density: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: "compact"
|
|
40
|
+
},
|
|
41
|
+
backgroundColor: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: "white"
|
|
44
|
+
},
|
|
45
|
+
clearable: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: !0
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
emits: ["update:filters"],
|
|
51
|
+
setup(i, { emit: m }) {
|
|
52
|
+
const e = i, o = m;
|
|
53
|
+
function y() {
|
|
54
|
+
return String(e.header.key || e.header.value || (e.header.title ? `filter_${e.header.title}` : `filter_${Date.now()}`));
|
|
55
|
+
}
|
|
56
|
+
const v = p(() => {
|
|
57
|
+
if (!e.header.filterOptions || !Array.isArray(e.header.filterOptions))
|
|
58
|
+
return [{ text: n.defaultOption, value: n.defaultOption }];
|
|
59
|
+
const l = [{ text: n.defaultOption, value: n.defaultOption }];
|
|
60
|
+
return e.header.filterOptions.forEach((t) => {
|
|
61
|
+
t.text === void 0 || t.text === null || t.text === "" ? l.push({ text: n.emptyValue, value: t.value }) : l.push(t);
|
|
62
|
+
}), l;
|
|
63
|
+
}), f = p({
|
|
64
|
+
get: () => e.filterValue === null ? e.header.multiple ? [] : n.defaultOption : e.filterValue,
|
|
65
|
+
set: (l) => {
|
|
66
|
+
const t = y();
|
|
67
|
+
if (!t) return;
|
|
68
|
+
if (e.header.multiple) {
|
|
69
|
+
if (!l || Array.isArray(l) && l.length === 0) {
|
|
70
|
+
const d = e.filters.filter((c) => c.key !== t);
|
|
71
|
+
o("update:filters", d);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const r = e.filters.findIndex((d) => d.key === t), a = [...e.filters];
|
|
75
|
+
r >= 0 ? a[r].value = l : a.push({
|
|
76
|
+
key: t,
|
|
77
|
+
value: l,
|
|
78
|
+
type: "select"
|
|
79
|
+
}), o("update:filters", a);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (l == null || l === n.defaultOption) {
|
|
83
|
+
const r = e.filters.filter((a) => a.key !== t);
|
|
84
|
+
o("update:filters", r);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const u = e.filters.findIndex((r) => r.key === t), s = [...e.filters];
|
|
88
|
+
u >= 0 ? s[u].value = l : s.push({
|
|
89
|
+
key: t,
|
|
90
|
+
value: l,
|
|
91
|
+
type: "select"
|
|
92
|
+
}), o("update:filters", s);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
function b() {
|
|
96
|
+
const l = y(), t = e.filters.filter((u) => u.key !== l);
|
|
97
|
+
o("update:filters", t);
|
|
98
|
+
}
|
|
99
|
+
const g = F(!1);
|
|
100
|
+
function O() {
|
|
101
|
+
g.value = !0;
|
|
102
|
+
}
|
|
103
|
+
function x() {
|
|
104
|
+
g.value = !1;
|
|
105
|
+
}
|
|
106
|
+
const k = p(() => (h == null ? void 0 : h.NODE_ENV) === "test" ? !0 : e.header.multiple ? Array.isArray(f.value) && f.value.length > 0 : f.value !== n.defaultOption);
|
|
107
|
+
return (l, t) => {
|
|
108
|
+
var u, s, r, a, d;
|
|
109
|
+
return A(), S("div", I, [
|
|
110
|
+
B(E, {
|
|
111
|
+
modelValue: f.value,
|
|
112
|
+
"onUpdate:modelValue": t[0] || (t[0] = (c) => f.value = c),
|
|
113
|
+
label: e.header.title || "",
|
|
114
|
+
items: v.value,
|
|
115
|
+
clearable: k.value,
|
|
116
|
+
density: ((u = i.inputConfig) == null ? void 0 : u.density) ?? i.density,
|
|
117
|
+
"hide-details": ((s = i.inputConfig) == null ? void 0 : s.hideDetails) ?? i.hideDetails,
|
|
118
|
+
"hide-messages": !0,
|
|
119
|
+
variant: ((r = i.inputConfig) == null ? void 0 : r.variant) ?? i.variant,
|
|
120
|
+
"bg-color": ((a = i.inputConfig) == null ? void 0 : a.backgroundColor) ?? i.backgroundColor,
|
|
121
|
+
"disable-error-handling": ((d = i.inputConfig) == null ? void 0 : d.disableErrorHandling) ?? i.disableErrorHandling,
|
|
122
|
+
multiple: e.header.multiple,
|
|
123
|
+
chips: e.header.chips,
|
|
124
|
+
class: "filter-input",
|
|
125
|
+
"aria-label": e.header.title || "Filtre",
|
|
126
|
+
"onClick:clear": b,
|
|
127
|
+
onFocus: O,
|
|
128
|
+
onBlur: x
|
|
129
|
+
}, null, 8, ["modelValue", "label", "items", "clearable", "density", "hide-details", "variant", "bg-color", "disable-error-handling", "multiple", "chips", "aria-label"])
|
|
130
|
+
]);
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
}), q = /* @__PURE__ */ D(N, [["__scopeId", "data-v-5d317118"]]);
|
|
134
|
+
export {
|
|
135
|
+
q as default
|
|
136
|
+
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { defineComponent as C, ref as b, watch as k, computed as T, createElementBlock as x, openBlock as w, createVNode as F } from "vue";
|
|
2
|
+
import { a as V, _ as E } from "./main-Co2P_lBt.js";
|
|
3
|
+
const S = { class: "text-filter-container" }, B = /* @__PURE__ */ C({
|
|
4
|
+
__name: "TextFilter",
|
|
5
|
+
props: {
|
|
6
|
+
header: {
|
|
7
|
+
type: Object,
|
|
8
|
+
required: !0
|
|
9
|
+
},
|
|
10
|
+
filters: {
|
|
11
|
+
type: Array,
|
|
12
|
+
default: () => []
|
|
13
|
+
},
|
|
14
|
+
filterValue: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: void 0
|
|
17
|
+
},
|
|
18
|
+
inputConfig: {
|
|
19
|
+
type: Object,
|
|
20
|
+
default: () => ({})
|
|
21
|
+
},
|
|
22
|
+
disableErrorHandling: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: !1
|
|
25
|
+
},
|
|
26
|
+
variant: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: "outlined"
|
|
29
|
+
},
|
|
30
|
+
hideDetails: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !0
|
|
33
|
+
},
|
|
34
|
+
density: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: "compact"
|
|
37
|
+
},
|
|
38
|
+
backgroundColor: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: "white"
|
|
41
|
+
},
|
|
42
|
+
clearable: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: !0
|
|
45
|
+
},
|
|
46
|
+
debounceTime: {
|
|
47
|
+
type: Number,
|
|
48
|
+
default: 300
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
emits: ["update:filters"],
|
|
52
|
+
setup(e, { emit: h }) {
|
|
53
|
+
const t = e, s = h, u = b(t.filterValue || ""), r = b(null);
|
|
54
|
+
k(() => t.filters, (i) => {
|
|
55
|
+
i.length === 0 && (r.value !== null && (clearTimeout(r.value), r.value = null), u.value = "");
|
|
56
|
+
});
|
|
57
|
+
function f() {
|
|
58
|
+
return String(t.header.key || t.header.value || (t.header.title ? `filter_${t.header.title}` : `filter_${Date.now()}`));
|
|
59
|
+
}
|
|
60
|
+
const c = T({
|
|
61
|
+
get: () => u.value,
|
|
62
|
+
set: (i) => {
|
|
63
|
+
var n;
|
|
64
|
+
u.value = i, r.value !== null && clearTimeout(r.value);
|
|
65
|
+
const l = ((n = t.inputConfig) == null ? void 0 : n.debounceTime) ?? t.debounceTime;
|
|
66
|
+
l === 0 || void 0 ? g(i) : r.value = window.setTimeout(() => {
|
|
67
|
+
g(i);
|
|
68
|
+
}, l);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
function g(i) {
|
|
72
|
+
const l = f();
|
|
73
|
+
if (!l) return;
|
|
74
|
+
if (i === "") {
|
|
75
|
+
const d = t.filters.filter((o) => o.key !== l);
|
|
76
|
+
s("update:filters", d);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const a = t.filters.findIndex((d) => d.key === l), n = [...t.filters];
|
|
80
|
+
a >= 0 ? n[a].value = i : n.push({
|
|
81
|
+
key: l,
|
|
82
|
+
value: i,
|
|
83
|
+
type: "text"
|
|
84
|
+
}), s("update:filters", n);
|
|
85
|
+
}
|
|
86
|
+
function v() {
|
|
87
|
+
u.value = "";
|
|
88
|
+
const i = f(), l = t.filters.filter((a) => a.key !== i);
|
|
89
|
+
s("update:filters", l);
|
|
90
|
+
}
|
|
91
|
+
return (i, l) => {
|
|
92
|
+
var a, n, d, o, m, y;
|
|
93
|
+
return w(), x("div", S, [
|
|
94
|
+
F(V, {
|
|
95
|
+
modelValue: c.value,
|
|
96
|
+
"onUpdate:modelValue": l[0] || (l[0] = (p) => c.value = p),
|
|
97
|
+
label: e.header.title,
|
|
98
|
+
clearable: ((a = e.inputConfig) == null ? void 0 : a.clearable) ?? e.clearable,
|
|
99
|
+
density: ((n = e.inputConfig) == null ? void 0 : n.density) ?? e.density,
|
|
100
|
+
"hide-details": ((d = e.inputConfig) == null ? void 0 : d.hideDetails) ?? e.hideDetails,
|
|
101
|
+
"hide-messages": e.header.hideMessages,
|
|
102
|
+
"disable-error-handling": ((o = e.inputConfig) == null ? void 0 : o.disableErrorHandling) ?? e.disableErrorHandling,
|
|
103
|
+
variant: ((m = e.inputConfig) == null ? void 0 : m.variant) ?? e.variant,
|
|
104
|
+
"bg-color": ((y = e.inputConfig) == null ? void 0 : y.backgroundColor) ?? e.backgroundColor,
|
|
105
|
+
class: "filter-input",
|
|
106
|
+
"onClick:clear": v
|
|
107
|
+
}, null, 8, ["modelValue", "label", "clearable", "density", "hide-details", "hide-messages", "disable-error-handling", "variant", "bg-color"])
|
|
108
|
+
]);
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
}), I = /* @__PURE__ */ E(B, [["__scopeId", "data-v-6f62b12e"]]);
|
|
112
|
+
export {
|
|
113
|
+
I as default
|
|
114
|
+
};
|
package/dist/design-system-v3.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Z as i, ak as o, al as r, am as t, ao as l, an as n, ap as d, aq as p, ar as b, as as m, at as c, au as A, av as u, aw as F, ax as S, ay as B, az as g, aA as y, aB as T, aC as D, aD as C, aE as L, aF as M, aG as k, aH as N, aI as f, aJ as P, aK as H, aL as I, aM as h, aN as x, aO as E, aP as R, aQ as v, aR as V, aS as U, aT as G, B as w, p as q, $ as K, a0 as W, C as z, a9 as _, aa as j, ab as O, ac as X, q as Y, a1 as J, a2 as Q, a3 as Z, D as $, t as aa, ad as ea, r as sa, b6 as ia, ah as oa, E as ra, a4 as ta, a5 as la, v as na, X as da, Y as pa, F as ba, s as ma, H as ca, b as Aa, c as ua, d as Fa, e as Sa, f as Ba, g as ga, l as ya, h as Ta, i as Da, b1 as Ca, L as La, bs as Ma, a6 as ka, a7 as Na, ai as fa, b0 as Pa, N as Ha, aj as Ia, ae as ha, b5 as xa, k as Ea, Q as Ra, w as va, P as Va, y as Ua, z as Ga, af as wa, A as qa, G as Ka, aV as Wa, m as za, n as _a, aU as ja, j as Oa, ag as Xa, I as Ya, J as Ja, a8 as Qa, K as Za, o as $a, S as ae, R as ee, V as se, M as ie, a as oe, W as re, T as te, O as le, aW as ne, aX as de, U as pe, bt as be, b2 as me, b3 as ce, bu as Ae, bE as ue, bG as Fe, b8 as Se, bF as Be, bv as ge, x as ye, bz as Te, bA as De, bB as Ce, ba as Le, b9 as Me, bq as ke, bD as Ne, bb as fe, bp as Pe, bo as He, bc as Ie, bd as he, b4 as xe, be as Ee, bj as Re, bi as ve, bf as Ve, bh as Ue, bg as Ge, bl as we, bk as qe, bn as Ke, bm as We, bC as ze, bw as _e, bx as je, by as Oe, br as Xe, u as Ye, aY as Je, aZ as Qe, a_ as Ze, b7 as $e, a$ as as } from "./main-
|
|
1
|
+
import { Z as i, ak as o, al as r, am as t, ao as l, an as n, ap as d, aq as p, ar as b, as as m, at as c, au as A, av as u, aw as F, ax as S, ay as B, az as g, aA as y, aB as T, aC as D, aD as C, aE as L, aF as M, aG as k, aH as N, aI as f, aJ as P, aK as H, aL as I, aM as h, aN as x, aO as E, aP as R, aQ as v, aR as V, aS as U, aT as G, B as w, p as q, $ as K, a0 as W, C as z, a9 as _, aa as j, ab as O, ac as X, q as Y, a1 as J, a2 as Q, a3 as Z, D as $, t as aa, ad as ea, r as sa, b6 as ia, ah as oa, E as ra, a4 as ta, a5 as la, v as na, X as da, Y as pa, F as ba, s as ma, H as ca, b as Aa, c as ua, d as Fa, e as Sa, f as Ba, g as ga, l as ya, h as Ta, i as Da, b1 as Ca, L as La, bs as Ma, a6 as ka, a7 as Na, ai as fa, b0 as Pa, N as Ha, aj as Ia, ae as ha, b5 as xa, k as Ea, Q as Ra, w as va, P as Va, y as Ua, z as Ga, af as wa, A as qa, G as Ka, aV as Wa, m as za, n as _a, aU as ja, j as Oa, ag as Xa, I as Ya, J as Ja, a8 as Qa, K as Za, o as $a, S as ae, R as ee, V as se, M as ie, a as oe, W as re, T as te, O as le, aW as ne, aX as de, U as pe, bt as be, b2 as me, b3 as ce, bu as Ae, bE as ue, bG as Fe, b8 as Se, bF as Be, bv as ge, x as ye, bz as Te, bA as De, bB as Ce, ba as Le, b9 as Me, bq as ke, bD as Ne, bb as fe, bp as Pe, bo as He, bc as Ie, bd as he, b4 as xe, be as Ee, bj as Re, bi as ve, bf as Ve, bh as Ue, bg as Ge, bl as we, bk as qe, bn as Ke, bm as We, bC as ze, bw as _e, bx as je, by as Oe, br as Xe, u as Ye, aY as Je, aZ as Qe, a_ as Ze, b7 as $e, a$ as as } from "./main-Co2P_lBt.js";
|
|
2
2
|
import "vue";
|
|
3
3
|
export {
|
|
4
4
|
i as Accordion,
|