@affino/datagrid-vue-app 0.1.39 → 0.1.41

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.
@@ -0,0 +1,150 @@
1
+ const b = "Advanced filter", n = Object.freeze({
2
+ contains: "Contains",
3
+ in: "In",
4
+ equals: "Equals",
5
+ "not-equals": "Not equals",
6
+ "starts-with": "Starts with",
7
+ "ends-with": "Ends with",
8
+ gt: ">",
9
+ gte: ">=",
10
+ lt: "<",
11
+ lte: "<=",
12
+ between: "between",
13
+ "is-empty": "is empty",
14
+ "not-empty": "is not empty",
15
+ "is-null": "is null",
16
+ "not-null": "is not null"
17
+ }), s = Object.freeze({
18
+ and: "AND",
19
+ or: "OR"
20
+ }), l = Object.freeze({
21
+ buttonLabel: b,
22
+ eyebrow: "Advanced filter",
23
+ title: "Build clause-based filter",
24
+ close: "Close",
25
+ appliedEyebrow: "Applied on table",
26
+ appliedTitle: "Current filters",
27
+ resetAllFilters: "Reset all filters",
28
+ noFiltersApplied: "No filters applied",
29
+ joinLabel: "Join",
30
+ joinAriaLabel: "Join operator",
31
+ columnLabel: "Column",
32
+ columnAriaLabel: "Column",
33
+ operatorLabel: "Operator",
34
+ operatorAriaLabel: "Condition operator",
35
+ valueLabel: "Value",
36
+ valuePlaceholder: "Value",
37
+ valueAriaLabel: "Condition value",
38
+ clearClause: "Clear",
39
+ removeClause: "Remove",
40
+ addClause: "Add clause",
41
+ cancel: "Cancel",
42
+ apply: "Apply",
43
+ activeSummaryPrefix: "Advanced",
44
+ activeSummaryFallback: "active",
45
+ valuesSummaryLabel: "values",
46
+ blankValueLabel: "(Blanks)",
47
+ betweenJoiner: "and",
48
+ notOperatorLabel: "NOT",
49
+ operators: n,
50
+ joins: s
51
+ });
52
+ function a(e, r) {
53
+ return typeof e == "string" && e.trim().length > 0 ? e.trim() : r;
54
+ }
55
+ function i(e) {
56
+ const r = { ...n };
57
+ for (const o of Object.keys(n))
58
+ r[o] = a(e?.[o], r[o]);
59
+ return Object.freeze(r);
60
+ }
61
+ function c(e) {
62
+ return Object.freeze({
63
+ and: a(e?.and, s.and),
64
+ or: a(e?.or, s.or)
65
+ });
66
+ }
67
+ function t(e, r) {
68
+ const o = a(r, a(e?.buttonLabel, b));
69
+ return Object.freeze({
70
+ buttonLabel: o,
71
+ eyebrow: a(e?.eyebrow, l.eyebrow),
72
+ title: a(e?.title, l.title),
73
+ close: a(e?.close, l.close),
74
+ appliedEyebrow: a(e?.appliedEyebrow, l.appliedEyebrow),
75
+ appliedTitle: a(e?.appliedTitle, l.appliedTitle),
76
+ resetAllFilters: a(e?.resetAllFilters, l.resetAllFilters),
77
+ noFiltersApplied: a(e?.noFiltersApplied, l.noFiltersApplied),
78
+ joinLabel: a(e?.joinLabel, l.joinLabel),
79
+ joinAriaLabel: a(e?.joinAriaLabel, l.joinAriaLabel),
80
+ columnLabel: a(e?.columnLabel, l.columnLabel),
81
+ columnAriaLabel: a(e?.columnAriaLabel, l.columnAriaLabel),
82
+ operatorLabel: a(e?.operatorLabel, l.operatorLabel),
83
+ operatorAriaLabel: a(e?.operatorAriaLabel, l.operatorAriaLabel),
84
+ valueLabel: a(e?.valueLabel, l.valueLabel),
85
+ valuePlaceholder: a(e?.valuePlaceholder, l.valuePlaceholder),
86
+ valueAriaLabel: a(e?.valueAriaLabel, l.valueAriaLabel),
87
+ clearClause: a(e?.clearClause, l.clearClause),
88
+ removeClause: a(e?.removeClause, l.removeClause),
89
+ addClause: a(e?.addClause, l.addClause),
90
+ cancel: a(e?.cancel, l.cancel),
91
+ apply: a(e?.apply, l.apply),
92
+ activeSummaryPrefix: a(e?.activeSummaryPrefix, l.activeSummaryPrefix),
93
+ activeSummaryFallback: a(e?.activeSummaryFallback, l.activeSummaryFallback),
94
+ valuesSummaryLabel: a(e?.valuesSummaryLabel, l.valuesSummaryLabel),
95
+ blankValueLabel: a(e?.blankValueLabel, l.blankValueLabel),
96
+ betweenJoiner: a(e?.betweenJoiner, l.betweenJoiner),
97
+ notOperatorLabel: a(e?.notOperatorLabel, l.notOperatorLabel),
98
+ operators: i(e?.operators),
99
+ joins: c(e?.joins)
100
+ });
101
+ }
102
+ function u(e, r) {
103
+ switch (r) {
104
+ case "startsWith":
105
+ return e.operators["starts-with"];
106
+ case "endsWith":
107
+ return e.operators["ends-with"];
108
+ case "notEquals":
109
+ return e.operators["not-equals"];
110
+ case "isEmpty":
111
+ return e.operators["is-empty"];
112
+ case "notEmpty":
113
+ return e.operators["not-empty"];
114
+ case "isNull":
115
+ return e.operators["is-null"];
116
+ case "notNull":
117
+ return e.operators["not-null"];
118
+ default:
119
+ return e.operators[r] ?? r;
120
+ }
121
+ }
122
+ function L(e) {
123
+ if (typeof e == "boolean") {
124
+ const o = t(void 0);
125
+ return {
126
+ enabled: e,
127
+ buttonLabel: o.buttonLabel,
128
+ labels: o
129
+ };
130
+ }
131
+ if (!e) {
132
+ const o = t(void 0);
133
+ return {
134
+ enabled: !1,
135
+ buttonLabel: o.buttonLabel,
136
+ labels: o
137
+ };
138
+ }
139
+ const r = t(e.labels, e.buttonLabel);
140
+ return {
141
+ enabled: e.enabled ?? !0,
142
+ buttonLabel: r.buttonLabel,
143
+ labels: r
144
+ };
145
+ }
146
+ export {
147
+ l as D,
148
+ u as a,
149
+ L as r
150
+ };