@oneclick.dev/cms-core-modules 0.0.124 → 0.0.126

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.
Files changed (149) hide show
  1. package/dist/AppointmentListTable-CWzbwqR-.js +1 -0
  2. package/dist/AppointmentListTable-DoZuBstk.mjs +270 -0
  3. package/dist/ContentEditor-BlNbqkAz.js +324 -0
  4. package/dist/{ContentEditor-DX1bTQKs.mjs → ContentEditor-D754iLJS.mjs} +8074 -27026
  5. package/dist/{Detail-B7pe808q.mjs → Detail-BOxWQ1QQ.mjs} +2 -2
  6. package/dist/{Detail-B_Q7Qkuz.mjs → Detail-BfKW0uZE.mjs} +2 -2
  7. package/dist/Detail-DFVu2F38.mjs +11 -0
  8. package/dist/{Detail-t3tOcy3X.js → Detail-DJea_fCd.js} +1 -1
  9. package/dist/{Detail-CNiLIEh9.js → Detail-DPJacXfm.js} +1 -1
  10. package/dist/Detail-DSLZ7_bM.js +1 -0
  11. package/dist/{Detail-BESGmY7z.js → Detail-DUGThL9Y.js} +1 -1
  12. package/dist/{Detail-DNxAzeCs.mjs → Detail-D_LlEeHu.mjs} +2 -2
  13. package/dist/Overview-0hFXiuYo.js +1 -0
  14. package/dist/Overview-BTx5LF4J.js +1 -0
  15. package/dist/Overview-CCu2PHai.mjs +289 -0
  16. package/dist/Overview-D2u-leeO.js +1 -0
  17. package/dist/Overview-D_2wozCG.mjs +1733 -0
  18. package/dist/Overview-Dffo-zH4.mjs +11 -0
  19. package/dist/{TableCalculationWidget-CrqcLGfU.mjs → TableCalculationWidget-B_LFoOYm.mjs} +3 -3
  20. package/dist/{TableCalculationWidget-CkQPrVUd.js → TableCalculationWidget-CahOIcbk.js} +1 -1
  21. package/dist/TableDataWidget-BwqWFH4A.js +1 -0
  22. package/dist/TableDataWidget-RsVxcDsL.mjs +112 -0
  23. package/dist/TableOverviewCard-BPWCqo56.js +1 -0
  24. package/dist/{TableOverviewCard-Ci0d4o4w.mjs → TableOverviewCard-D667DDag.mjs} +113 -127
  25. package/dist/TableResultView.vue_vue_type_script_setup_true_lang-C3XiOXgb.js +1 -0
  26. package/dist/TableResultView.vue_vue_type_script_setup_true_lang-sp0TLio0.mjs +547 -0
  27. package/dist/{TableRowActionCard-BhdnnPaq.mjs → TableRowActionCard-BPYJ-Kjy.mjs} +95 -101
  28. package/dist/TableRowActionCard-Bnqj1YIe.js +1 -0
  29. package/dist/TableView-CwhZ9YN2.js +4 -0
  30. package/dist/TableView-DX9PKS8N.mjs +9673 -0
  31. package/dist/TemplateBuilder.vue_vue_type_script_setup_true_lang-BgDdzbLe.js +1 -0
  32. package/dist/TemplateBuilder.vue_vue_type_script_setup_true_lang-D85V4nrQ.mjs +2886 -0
  33. package/dist/cms-core-modules.css +1 -1
  34. package/dist/dateRangePresets-CaPVagHY.mjs +453 -0
  35. package/dist/dateRangePresets-gxQCiZ6c.js +1 -0
  36. package/dist/index-6hZ6MYY6.js +1 -0
  37. package/dist/index-BVmmicu3.mjs +14 -0
  38. package/dist/index-ChHD_1Cf.js +144 -0
  39. package/dist/index-CvV4nVWI.js +1 -0
  40. package/dist/index-DH2z0W_w.mjs +19012 -0
  41. package/dist/index-DZKzj48V.mjs +17 -0
  42. package/dist/index.cjs.js +1 -1
  43. package/dist/index.mjs +237 -103
  44. package/dist/orders-C_sz8J9b.js +1 -0
  45. package/dist/{orders-BfTLIm7U.mjs → orders-Cgdggzvx.mjs} +84 -84
  46. package/dist/server-handlers.cjs.js +1 -1
  47. package/dist/server-handlers.mjs +2055 -1123
  48. package/dist/src/appointments/chat-components/AppointmentListTable.vue.d.ts +3 -0
  49. package/dist/src/appointments/index.d.ts +93 -3
  50. package/dist/src/appointments/reservation-summary.d.ts +48 -0
  51. package/dist/src/appointments/server.d.ts +1 -0
  52. package/dist/src/appointments/tools.d.ts +93 -3
  53. package/dist/src/filezone/config.d.ts +31 -0
  54. package/dist/src/filezone/index.d.ts +43 -0
  55. package/dist/src/filezone/index.vue.d.ts +2 -0
  56. package/dist/src/filezone/metadata.d.ts +2 -0
  57. package/dist/src/filezone/pages/Overview.vue.d.ts +4 -0
  58. package/dist/src/filezone/permissions.d.ts +5 -0
  59. package/dist/src/filezone/routes.d.ts +5 -0
  60. package/dist/src/filezone/server.d.ts +36 -0
  61. package/dist/src/index.d.ts +2 -0
  62. package/dist/src/mailTemplates/builder-types.d.ts +40 -0
  63. package/dist/src/mailTemplates/components/BlockRenderer.vue.d.ts +24 -0
  64. package/dist/src/mailTemplates/components/DesignPanel.vue.d.ts +13 -0
  65. package/dist/src/mailTemplates/components/EmailCanvas.vue.d.ts +44 -0
  66. package/dist/src/mailTemplates/components/RichTextEditor.vue.d.ts +10 -0
  67. package/dist/src/mailTemplates/components/RightSidebar.vue.d.ts +18 -0
  68. package/dist/src/mailTemplates/components/SettingsPanel.vue.d.ts +15 -0
  69. package/dist/src/mailTemplates/components/TemplateBuilder.vue.d.ts +2 -0
  70. package/dist/src/mailTemplates/components/TemplateList.vue.d.ts +19 -1
  71. package/dist/src/mailTemplates/components/rich-text.d.ts +6 -0
  72. package/dist/src/mailTemplates/config.d.ts +10 -4
  73. package/dist/src/mailTemplates/defaults.d.ts +10 -0
  74. package/dist/src/mailTemplates/editor-state.d.ts +21 -0
  75. package/dist/src/mailTemplates/index.d.ts +11 -5
  76. package/dist/src/mailTemplates/index.vue.d.ts +2 -4
  77. package/dist/src/mailTemplates/metadata.d.ts +1 -1
  78. package/dist/src/mailTemplates/pages/Detail.vue.d.ts +1 -13
  79. package/dist/src/mailTemplates/pages/Overview.vue.d.ts +1 -13
  80. package/dist/src/mailTemplates/server.d.ts +23 -0
  81. package/dist/src/server-handlers.d.ts +4 -0
  82. package/dist/src/table/badge-filter-utils.d.ts +8 -0
  83. package/dist/src/table/chat-components/TableOverviewCard.vue.d.ts +2 -7
  84. package/dist/src/table/chat-components/TableResultView.vue.d.ts +3 -7
  85. package/dist/src/table/components/TableDisplayCell.vue.d.ts +8 -0
  86. package/dist/src/table/components/columns/BadgeColumnSettings.vue.d.ts +9 -0
  87. package/dist/src/table/components/columns/ColumnColorSelect.vue.d.ts +11 -0
  88. package/dist/src/table/components/columns/ColumnDisplaySettings.vue.d.ts +9 -0
  89. package/dist/src/table/components/columns/ColumnTypeSelect.vue.d.ts +11 -0
  90. package/dist/src/table/components/columns/ColumnValueSourceInput.vue.d.ts +15 -0
  91. package/dist/src/table/components/columns/DialogTableColumnItem.vue.d.ts +8 -11
  92. package/dist/src/table/components/columns/ProgressColumnSettings.vue.d.ts +8 -0
  93. package/dist/src/table/components/stats/StatDialog.vue.d.ts +6 -10
  94. package/dist/src/table/components/stats/Stats.vue.d.ts +9 -15
  95. package/dist/src/table/composables/useTableClock.d.ts +4 -0
  96. package/dist/src/table/display-utils.d.ts +35 -0
  97. package/dist/src/table/row-value.d.ts +1 -0
  98. package/dist/src/table/stat-utils.d.ts +9 -0
  99. package/dist/src/table/tool-utils.d.ts +1 -1
  100. package/dist/src/table/types.d.ts +54 -1
  101. package/dist/src/whatsappBusiness/analytics.d.ts +4 -0
  102. package/dist/src/whatsappBusiness/components/AccountPanel.vue.d.ts +2 -0
  103. package/dist/src/whatsappBusiness/components/InsightsPanel.vue.d.ts +5 -0
  104. package/dist/src/whatsappBusiness/components/TemplateDialog.vue.d.ts +14 -0
  105. package/dist/src/whatsappBusiness/components/TemplatesPanel.vue.d.ts +5 -0
  106. package/dist/src/whatsappBusiness/components/presentation.d.ts +4 -0
  107. package/dist/src/whatsappBusiness/config.d.ts +51 -0
  108. package/dist/src/whatsappBusiness/connection.d.ts +77 -0
  109. package/dist/src/whatsappBusiness/index.d.ts +63 -0
  110. package/dist/src/whatsappBusiness/index.vue.d.ts +5 -0
  111. package/dist/src/whatsappBusiness/metadata.d.ts +2 -0
  112. package/dist/src/whatsappBusiness/pages/Overview.vue.d.ts +2 -0
  113. package/dist/src/whatsappBusiness/permissions.d.ts +5 -0
  114. package/dist/src/whatsappBusiness/provider.d.ts +21 -0
  115. package/dist/src/whatsappBusiness/routes.d.ts +5 -0
  116. package/dist/src/whatsappBusiness/server.d.ts +14 -0
  117. package/dist/src/whatsappBusiness/templates.d.ts +94 -0
  118. package/dist/src/whatsappBusiness/types.d.ts +162 -0
  119. package/dist/{tool-sandbox-DoF1PsyS.js → tool-sandbox-BSkKdH7V.js} +1 -1
  120. package/dist/{tool-sandbox-DdkMLkDK.mjs → tool-sandbox-DU9b1B7v.mjs} +1 -1
  121. package/dist/{types-ibC3-e1N.mjs → types-B5MifmeF.mjs} +339 -273
  122. package/dist/types-D5dgTskW.js +1 -0
  123. package/dist/{useTableAgentTools-D5mzGf3A.js → useTableAgentTools-BrUot49I.js} +1 -1
  124. package/dist/{useTableAgentTools-DcN3kYRL.mjs → useTableAgentTools-r5InEI4p.mjs} +8 -8
  125. package/dist/{vee-validate-zod-BQElPD0m.js → vee-validate-zod-CWZwNTWE.js} +1 -1
  126. package/dist/{vee-validate-zod-CN16K2x9.mjs → vee-validate-zod-D0WaDgDZ.mjs} +1 -1
  127. package/package.json +2 -2
  128. package/src/appointments/tools.ts +52 -2
  129. package/dist/AppointmentListTable-DZJNmTMb.mjs +0 -177
  130. package/dist/AppointmentListTable-Dieu9US_.js +0 -1
  131. package/dist/ContentEditor-BcIUumah.js +0 -467
  132. package/dist/Detail-Byk781b4.mjs +0 -26
  133. package/dist/Detail-mvSGbnFU.js +0 -1
  134. package/dist/Overview-BDlBCUI_.js +0 -1
  135. package/dist/Overview-Su8ZUbMs.mjs +0 -26
  136. package/dist/TableDataWidget-7qvC3Egd.js +0 -1
  137. package/dist/TableDataWidget-DMTSoGRO.mjs +0 -121
  138. package/dist/TableOverviewCard-AFq-puJs.js +0 -1
  139. package/dist/TableResultView.vue_vue_type_script_setup_true_lang-CBn-Oxl9.mjs +0 -534
  140. package/dist/TableResultView.vue_vue_type_script_setup_true_lang-C_Lv-SmJ.js +0 -1
  141. package/dist/TableRowActionCard-IzB6tNN-.js +0 -1
  142. package/dist/TableView-6mdrL3zx.js +0 -4
  143. package/dist/TableView-Du5nOE6R.mjs +0 -8228
  144. package/dist/TemplateList.vue_vue_type_script_setup_true_lang-B_AtWnHa.js +0 -1
  145. package/dist/TemplateList.vue_vue_type_script_setup_true_lang-Cmovy7kk.mjs +0 -40
  146. package/dist/dateRangePresets-B-l5b_wR.mjs +0 -48
  147. package/dist/dateRangePresets-CPWqst_x.js +0 -1
  148. package/dist/orders-DUa2PVoa.js +0 -1
  149. package/dist/types-BMraG1kN.js +0 -1
@@ -0,0 +1,453 @@
1
+ import { inject as I, ref as B, onMounted as Y, onUnmounted as L, provide as z, defineComponent as U, computed as $, openBlock as y, createElementBlock as h, normalizeClass as k, toDisplayString as w, normalizeStyle as Z, createCommentVNode as T, createElementVNode as _ } from "vue";
2
+ const P = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
3
+ function D(e, t) {
4
+ if (!e || typeof t != "string" || !t) return;
5
+ const r = t.split(".");
6
+ if (!r.some((n) => P.has(n)))
7
+ return Object.prototype.hasOwnProperty.call(e, t) ? e[t] : r.reduce((n, a) => n?.[a], e);
8
+ }
9
+ const O = [
10
+ "equals",
11
+ "not-equals",
12
+ "greater-than",
13
+ "greater-than-or-equal",
14
+ "less-than",
15
+ "less-than-or-equal"
16
+ ], se = {
17
+ equals: "Equals",
18
+ "not-equals": "Does not equal",
19
+ "greater-than": "Is greater than",
20
+ "greater-than-or-equal": "Is greater than or equal to",
21
+ "less-than": "Is less than",
22
+ "less-than-or-equal": "Is less than or equal to"
23
+ }, le = (e) => e?.type === "number-range" || e?.type === "number-comparison" ? e.type : "multi-select", f = (e) => {
24
+ if (typeof e == "number")
25
+ return Number.isFinite(e) ? e : null;
26
+ if (typeof e != "string" || e.trim() === "")
27
+ return null;
28
+ const t = Number(e.trim());
29
+ return Number.isFinite(t) ? t : null;
30
+ }, de = (e, t) => {
31
+ const r = f(e);
32
+ return r !== null && r > 0 ? r : t;
33
+ }, ue = (e, t, r) => Math.min(Math.max(e, t), r), pe = (e, t, r) => {
34
+ const n = Math.max(
35
+ `${r}`.split(".")[1]?.length ?? 0,
36
+ `${t}`.split(".")[1]?.length ?? 0
37
+ ), a = t + Math.round((e - t) / r) * r;
38
+ return Number(a.toFixed(Math.min(n, 12)));
39
+ }, j = (e) => {
40
+ const t = Array.isArray(e.operators) ? e.operators.filter((r) => O.includes(r)) : [];
41
+ return t.length ? t : [...O];
42
+ }, ce = (e) => {
43
+ const t = j(e);
44
+ return t.includes(e.defaultOperator) ? e.defaultOperator : t[0];
45
+ }, me = (e, t, r = !0) => {
46
+ const n = f(e);
47
+ if (n === null) return !1;
48
+ const a = t.min === null || (r ? n >= t.min : n > t.min), o = t.max === null || (r ? n <= t.max : n < t.max);
49
+ return a && o;
50
+ }, fe = (e, t) => {
51
+ const r = f(e);
52
+ if (r === null || !Number.isFinite(t.value)) return !1;
53
+ switch (t.operator) {
54
+ case "equals":
55
+ return r === t.value;
56
+ case "not-equals":
57
+ return r !== t.value;
58
+ case "greater-than":
59
+ return r > t.value;
60
+ case "greater-than-or-equal":
61
+ return r >= t.value;
62
+ case "less-than":
63
+ return r < t.value;
64
+ case "less-than-or-equal":
65
+ return r <= t.value;
66
+ default:
67
+ return !1;
68
+ }
69
+ }, ge = (e, t, r = 20) => {
70
+ try {
71
+ return new Intl.NumberFormat(t || void 0, {
72
+ maximumFractionDigits: r
73
+ }).format(e);
74
+ } catch {
75
+ return new Intl.NumberFormat(void 0, {
76
+ maximumFractionDigits: r
77
+ }).format(e);
78
+ }
79
+ }, ye = (e) => {
80
+ if (!(typeof e != "string" || !e.trim()))
81
+ try {
82
+ return new Intl.NumberFormat(e.trim()).format(0), e.trim();
83
+ } catch {
84
+ return;
85
+ }
86
+ }, E = {
87
+ neutral: { badge: "bg-muted text-muted-foreground", bar: "bg-slate-500" },
88
+ blue: { badge: "bg-blue-100 text-blue-800 dark:bg-blue-500/15 dark:text-blue-300", bar: "bg-blue-500" },
89
+ green: { badge: "bg-emerald-100 text-emerald-800 dark:bg-emerald-500/15 dark:text-emerald-300", bar: "bg-emerald-500" },
90
+ amber: { badge: "bg-amber-100 text-amber-900 dark:bg-amber-500/15 dark:text-amber-300", bar: "bg-amber-500" },
91
+ red: { badge: "bg-red-100 text-red-800 dark:bg-red-500/15 dark:text-red-300", bar: "bg-red-500" },
92
+ purple: { badge: "bg-purple-100 text-purple-800 dark:bg-purple-500/15 dark:text-purple-300", bar: "bg-purple-500" }
93
+ }, M = 864e5, K = { minutes: 6e4, hours: 36e5, days: M };
94
+ function N(e) {
95
+ return (Array.isArray(e.badge?.options) ? e.badge.options : []).filter((t) => t && typeof t.value == "string" && typeof t.label == "string");
96
+ }
97
+ function S(e) {
98
+ return (Array.isArray(e.thresholds) ? e.thresholds : []).filter((t) => t && typeof t.at == "number" && Number.isFinite(t.at));
99
+ }
100
+ function he(e) {
101
+ return e.type === "progress" ? `progress:${e.id || e.property}` : String(e.property || e.id || "");
102
+ }
103
+ function x(e, t = "neutral") {
104
+ return typeof e == "string" && Object.prototype.hasOwnProperty.call(E, e) ? e : t;
105
+ }
106
+ function V(e, t) {
107
+ let r = e.dateDisplay?.locale || t.locale || void 0, n = e.dateDisplay?.timeZone || t.timeZone || void 0;
108
+ try {
109
+ r && new Intl.DateTimeFormat(r);
110
+ } catch {
111
+ r = void 0;
112
+ }
113
+ try {
114
+ n && new Intl.DateTimeFormat(r, { timeZone: n });
115
+ } catch {
116
+ n = void 0;
117
+ }
118
+ return { locale: r, timeZone: n };
119
+ }
120
+ function F(e) {
121
+ if (typeof e != "string" || !/^\d{4}-\d{2}-\d{2}$/.test(e)) return null;
122
+ const t = /* @__PURE__ */ new Date(`${e}T00:00:00.000Z`);
123
+ return Number.isFinite(t.getTime()) && t.toISOString().slice(0, 10) === e ? t.getTime() : null;
124
+ }
125
+ function b(e) {
126
+ if (e == null || e === "" || typeof e == "boolean") return null;
127
+ if (e instanceof Date) return Number.isFinite(e.getTime()) ? e.getTime() : null;
128
+ if (typeof e == "object") {
129
+ const r = e, n = r.seconds ?? r._seconds;
130
+ if (typeof n != "number" || !Number.isFinite(n)) return null;
131
+ const a = n * 1e3 + (r.nanoseconds ?? r._nanoseconds ?? 0) / 1e6;
132
+ return Number.isFinite(new Date(a).getTime()) ? a : null;
133
+ }
134
+ if (typeof e != "string" && typeof e != "number") return null;
135
+ if (typeof e == "string" && /^\d{4}-\d{2}-\d{2}$/.test(e)) return F(e);
136
+ if (typeof e == "string" && /^\d{4}-\d{2}-\d{2}T/.test(e) && F(e.slice(0, 10)) === null) return null;
137
+ const t = new Date(e).getTime();
138
+ return Number.isFinite(t) ? t : null;
139
+ }
140
+ function A(e, t) {
141
+ const r = new Intl.DateTimeFormat("en-US", { timeZone: t, year: "numeric", month: "2-digit", day: "2-digit" }).formatToParts(e), n = (a) => r.find((o) => o.type === a)?.value;
142
+ return Date.UTC(Number(n("year")), Number(n("month")) - 1, Number(n("day")));
143
+ }
144
+ function W(e) {
145
+ return new Intl.DateTimeFormat(e).resolvedOptions().locale.toLowerCase().startsWith("nl");
146
+ }
147
+ function m(e, t) {
148
+ const r = Math.floor(Math.abs(e) / 6e4);
149
+ return r < 1 ? "<1 min" : [["day", Math.floor(r / 1440)], ["hour", Math.floor(r % 1440 / 60)], ["minute", r % 60]].filter(([, a]) => a > 0).slice(0, 2).map(([a, o]) => new Intl.NumberFormat(t, { style: "unit", unit: a, unitDisplay: "narrow" }).format(o)).join(" ");
150
+ }
151
+ function G(e, t, r) {
152
+ const n = e - t;
153
+ if (Math.abs(n) < 6e4) return new Intl.RelativeTimeFormat(r, { numeric: "auto" }).format(0, "second");
154
+ const a = new Intl.DateTimeFormat(r).resolvedOptions().locale.toLowerCase(), o = m(n, r);
155
+ if (a.startsWith("nl")) return n < 0 ? `${o} geleden` : `over ${o}`;
156
+ if (a.startsWith("en")) return n < 0 ? `${o} ago` : `in ${o}`;
157
+ const [s, i] = Math.abs(n) >= M ? ["day", M] : Math.abs(n) >= 36e5 ? ["hour", 36e5] : ["minute", 6e4];
158
+ return new Intl.RelativeTimeFormat(r, { numeric: "auto" }).format(Math.trunc(n / i), s);
159
+ }
160
+ function v(e, t) {
161
+ if (!t) return;
162
+ if (t.kind === "fixed") return t.value;
163
+ const r = D(e, t.property || "");
164
+ return t.kind === "array-count" ? Array.isArray(r) ? r.length : void 0 : t.kind === "field" ? r : void 0;
165
+ }
166
+ const q = (e) => `__table_count__${e}`;
167
+ function be(e, t) {
168
+ const r = [];
169
+ for (const n of t) {
170
+ if (n.type !== "progress") {
171
+ n.property && r.push([n.property, D(e, n.property)]);
172
+ continue;
173
+ }
174
+ const a = n.progress, o = a?.mode === "time" ? ["start", a.endMode === "deadline" ? "deadline" : "duration"] : ["current", "target"];
175
+ for (const s of o) {
176
+ const i = a?.[s];
177
+ !i?.property || i.kind === "fixed" || r.push([i.kind === "array-count" ? q(i.property) : i.property, v(e, i)]);
178
+ }
179
+ a?.mode === "time" && a.completedAt && r.push([a.completedAt, D(e, a.completedAt)]);
180
+ }
181
+ return Object.fromEntries(r);
182
+ }
183
+ function ve(e) {
184
+ const t = { id: e.id, property: e.property || "", label: e.label || e.property || "", type: e.type || "text", visible: e.visible !== !1 };
185
+ if (e.type === "number" && typeof e.numberDisplay?.prefix == "string" && (t.numberDisplay = { prefix: e.numberDisplay.prefix }), e.type === "text" && typeof e.textDisplay?.prefix == "string" && (t.textDisplay = { prefix: e.textDisplay.prefix }), e.dateDisplay && (t.dateDisplay = { relative: e.dateDisplay.relative === !0, locale: e.dateDisplay.locale, timeZone: e.dateDisplay.timeZone }), e.type === "badge" && (t.badge = { options: N(e).map((r) => ({ id: r.id, value: r.value, label: r.label, color: x(r.color) })) }), e.type === "progress" && e.progress) {
186
+ const r = e.progress;
187
+ t.progress = { mode: r.mode, endMode: r.endMode, durationUnit: r.durationUnit, completedAt: r.completedAt, display: r.display, showBar: r.showBar, color: r.color, thresholdMetric: r.thresholdMetric, thresholds: S(r).map((a) => ({ at: a.at, color: a.color })), completedColor: r.completedColor, overdueColor: r.overdueColor, sortBy: r.sortBy };
188
+ const n = r.mode === "time" ? ["start", r.endMode === "deadline" ? "deadline" : "duration"] : ["current", "target"];
189
+ for (const a of n) {
190
+ const o = r[a];
191
+ o && (t.progress[a] = o.kind === "array-count" ? { kind: "field", property: q(o.property || "") } : o.kind === "fixed" ? { kind: "fixed", value: o.value } : { kind: "field", property: o.property });
192
+ }
193
+ }
194
+ return t;
195
+ }
196
+ function R(e, t, r = Date.now()) {
197
+ if (!t || !["numeric", "time"].includes(t.mode) || !Number.isFinite(r)) return null;
198
+ if (t.mode === "numeric") {
199
+ const p = f(v(e, t.current)), d = f(v(e, t.target));
200
+ if (p === null || d === null || d < 0) return null;
201
+ const g = d > 0 ? p / d * 100 : null;
202
+ return { current: p, target: d, percent: g !== null && Number.isFinite(g) ? g : null, remaining: d - p, deadline: null, state: "active" };
203
+ }
204
+ const n = b(v(e, t.start)), a = f(v(e, t.duration)), o = t.endMode === "deadline" ? b(v(e, t.deadline)) : n !== null && a !== null && a > 0 ? n + a * K[t.durationUnit || "hours"] : null, s = t.completedAt ? D(e, t.completedAt) : void 0, i = b(s);
205
+ if (n === null || o === null || !Number.isFinite(o) || o <= n || s != null && s !== "" && i === null || i !== null && i < n) return null;
206
+ const l = i ?? r, u = i !== null ? i <= o ? "completed" : "completed-late" : r < n ? "upcoming" : r >= o ? "overdue" : "active";
207
+ return { current: Math.max(0, l - n), target: o - n, percent: (l - n) / (o - n) * 100, remaining: o - l, deadline: o, state: u };
208
+ }
209
+ function H(e, t) {
210
+ if (t.state === "completed") return x(e.completedColor, "green");
211
+ if (t.state === "overdue" || t.state === "completed-late") return x(e.overdueColor, "red");
212
+ if (t.state === "upcoming") return "neutral";
213
+ const r = e.mode === "time" && e.thresholdMetric === "remaining", n = r ? t.remaining / 6e4 : t.percent;
214
+ if (n === null) return "neutral";
215
+ const o = S(e).sort((s, i) => r ? s.at - i.at : i.at - s.at).find((s) => r ? n <= s.at : n >= s.at);
216
+ return x(o?.color, x(e.color, "blue"));
217
+ }
218
+ function xe(e, t, r = Date.now()) {
219
+ if (t.type === "progress") {
220
+ const a = R(e, t.progress, r);
221
+ if (!a) return null;
222
+ switch (t.progress?.sortBy) {
223
+ case "current":
224
+ return a.current;
225
+ case "remaining":
226
+ return t.progress?.mode === "time" ? a.remaining / 6e4 : a.remaining;
227
+ case "deadline":
228
+ return a.deadline;
229
+ default:
230
+ return a.percent;
231
+ }
232
+ }
233
+ const n = D(e, t.property || "");
234
+ return t.type === "array-counter" ? Array.isArray(n) ? n.length : n == null ? 0 : null : n;
235
+ }
236
+ function J(e, t, r = (n) => String(n)) {
237
+ return e == null || typeof e == "string" && !e.trim() ? "" : `${typeof t.textDisplay?.prefix == "string" ? t.textDisplay.prefix : ""}${r(e)}`;
238
+ }
239
+ function Q(e, t, r = (n) => n.toFixed(2).replace(".00", "")) {
240
+ if (e == null || typeof e == "string" && !e.trim()) return "";
241
+ const n = f(e);
242
+ return n === null ? String(e) : `${typeof t.numberDisplay?.prefix == "string" ? t.numberDisplay.prefix : ""}${r(n)}`;
243
+ }
244
+ function X(e, t, r = {}) {
245
+ const n = r.now ?? Date.now(), { locale: a, timeZone: o } = V(t, r), s = D(e, t.property || "");
246
+ if (t.type === "number") return { kind: "plain", text: Q(s, t) };
247
+ if (t.type === "text") return { kind: "plain", text: J(s, t) };
248
+ if (t.type === "date" || t.type === "datetime") {
249
+ const i = b(s);
250
+ if (i === null) return { kind: "date", text: "—" };
251
+ const l = typeof s == "string" && F(s) !== null, u = { timeZone: l ? "UTC" : o };
252
+ t.dateDisplay?.relative && Object.assign(u, { dateStyle: "medium", ...t.type === "datetime" ? { timeStyle: "short" } : {} });
253
+ const p = new Date(i), d = t.type === "datetime" ? p.toLocaleString(a, u) : p.toLocaleDateString(a, u), g = t.dateDisplay?.relative ? t.type === "date" || l ? new Intl.RelativeTimeFormat(a, { numeric: "auto" }).format(Math.round(((l ? i : A(i, o)) - A(n, o)) / M), "day") : G(i, n, a) : void 0;
254
+ return { kind: "date", text: d, secondary: g };
255
+ }
256
+ if (t.type === "badge") {
257
+ if (s == null || s === "") return { kind: "badge", text: "—", color: "neutral" };
258
+ const i = typeof s == "object" ? "—" : String(s), l = N(t).find((u) => String(u.value) === i);
259
+ return { kind: "badge", text: l?.label || i, color: x(l?.color) };
260
+ }
261
+ if (t.type === "progress") {
262
+ const i = t.progress, l = R(e, i, n);
263
+ if (!i || !l) return { kind: "progress", text: "—", state: "unavailable", color: "neutral", showBar: i?.showBar !== !1 };
264
+ const u = W(a), p = (g) => new Intl.NumberFormat(a, { maximumFractionDigits: 2 }).format(g);
265
+ let d;
266
+ return i.mode === "numeric" ? d = i.display === "percentage" ? l.percent === null ? "—" : `${p(l.percent)}%` : `${p(l.current)} / ${p(l.target)}` : l.state === "completed" ? d = u ? "Op tijd afgerond" : "Completed on time" : l.state === "completed-late" ? d = u ? "Te laat afgerond" : "Completed late" : l.state === "upcoming" ? d = u ? `start over ${m(l.remaining - l.target, a)}` : `starts in ${m(l.remaining - l.target, a)}` : l.state === "overdue" ? d = u ? `${m(l.remaining, a)} over tijd` : `${m(l.remaining, a)} overdue` : i.display === "percentage" ? d = `${p(l.percent ?? 0)}%` : i.display === "elapsed" ? d = u ? `${m(l.current, a)} verstreken` : `${m(l.current, a)} elapsed` : d = u ? `nog ${m(l.remaining, a)}` : `${m(l.remaining, a)} remaining`, { kind: "progress", text: d, percent: l.percent === null ? void 0 : l.state === "completed" || l.state === "completed-late" ? 100 : Math.min(100, Math.max(0, l.percent)), showBar: i.showBar !== !1, color: H(i, l), state: l.percent === null ? "unavailable" : l.state, secondary: l.percent === null ? u ? "Geen positief doel" : "No positive target" : void 0 };
267
+ }
268
+ return { kind: "plain", text: s == null ? "—" : String(s) };
269
+ }
270
+ function De(e) {
271
+ if (e.type === "date" || e.type === "datetime") {
272
+ try {
273
+ e.dateDisplay?.locale && new Intl.DateTimeFormat(e.dateDisplay.locale);
274
+ } catch {
275
+ return "Enter a valid locale, such as nl-BE or en-GB.";
276
+ }
277
+ try {
278
+ e.dateDisplay?.timeZone && new Intl.DateTimeFormat(void 0, { timeZone: e.dateDisplay.timeZone });
279
+ } catch {
280
+ return "Enter a valid time zone, such as Europe/Brussels.";
281
+ }
282
+ }
283
+ if (e.type === "badge") {
284
+ const o = N(e);
285
+ if (e.badge?.options && (!Array.isArray(e.badge.options) || o.length !== e.badge.options.length)) return "Check the badge options and enter a value and label for each.";
286
+ if (o.some((s) => !s.value.trim() || !s.label.trim())) return "Every badge needs a value and a label.";
287
+ if (new Set(o.map((s) => s.value)).size !== o.length) return "Badge values must be unique.";
288
+ }
289
+ if (e.type !== "progress") return null;
290
+ const t = e.progress;
291
+ if (!t || !["numeric", "time"].includes(t.mode)) return "Choose a progress mode.";
292
+ const r = (o, s, i = !1) => !o || !["field", "fixed", "array-count"].includes(o.kind) ? `Choose a source for ${s}.` : i && o.kind === "array-count" ? `${s} must be a date field or a fixed date.` : o.kind !== "fixed" ? o.property?.trim() ? null : `Choose a field for ${s}.` : (i ? b(o.value) : f(o.value)) === null ? `Enter a valid ${i ? "date" : "number"} for ${s}.` : null, n = t.mode === "numeric" ? ["current", "target"] : ["start", t.endMode === "deadline" ? "deadline" : "duration"];
293
+ for (const o of n) {
294
+ const s = r(t[o], o, o === "start" || o === "deadline");
295
+ if (s) return s;
296
+ }
297
+ if (t.mode === "numeric" && t.target?.kind === "fixed" && Number(t.target.value) <= 0) return "The fixed target must be greater than zero.";
298
+ if (t.mode === "time" && t.endMode !== "deadline" && t.duration?.kind === "fixed" && Number(t.duration.value) <= 0) return "The duration must be greater than zero.";
299
+ if (t.mode === "time" && t.endMode === "deadline" && t.start?.kind === "fixed" && t.deadline?.kind === "fixed" && (b(t.deadline.value) ?? 0) <= (b(t.start.value) ?? 0)) return "The deadline must be after the start.";
300
+ const a = S(t);
301
+ return t.thresholds && (!Array.isArray(t.thresholds) || a.length !== t.thresholds.length) ? "Enter a valid number for every color threshold." : a.some((o) => o.at < 0) ? "Color thresholds must be zero or greater." : new Set(a.map((o) => o.at)).size !== a.length ? "Use a different value for each color threshold." : null;
302
+ }
303
+ const C = /* @__PURE__ */ Symbol("table-display-clock");
304
+ function we() {
305
+ const e = I(C, void 0);
306
+ if (e) return e;
307
+ const t = B(Date.now());
308
+ let r;
309
+ const n = () => {
310
+ r !== void 0 && clearInterval(r), r = void 0;
311
+ }, a = () => {
312
+ n(), !document.hidden && (t.value = Date.now(), r = setInterval(() => {
313
+ t.value = Date.now();
314
+ }, 3e4));
315
+ };
316
+ return Y(() => {
317
+ a(), document.addEventListener("visibilitychange", a);
318
+ }), L(() => {
319
+ n(), document.removeEventListener("visibilitychange", a);
320
+ }), z(C, t), t;
321
+ }
322
+ function ee() {
323
+ return I(C, () => B(Date.now()), !0);
324
+ }
325
+ const te = {
326
+ key: 1,
327
+ class: "w-40 max-w-full min-w-0 space-y-1.5 tabular-nums"
328
+ }, re = ["role", "aria-label", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext"], ne = {
329
+ key: 1,
330
+ class: "text-xs text-muted-foreground"
331
+ }, ae = {
332
+ key: 2,
333
+ class: "min-w-0 tabular-nums"
334
+ }, oe = {
335
+ key: 0,
336
+ class: "text-xs text-muted-foreground leading-relaxed"
337
+ }, ke = /* @__PURE__ */ U({
338
+ __name: "TableDisplayCell",
339
+ props: {
340
+ row: {},
341
+ column: {},
342
+ now: {}
343
+ },
344
+ setup(e) {
345
+ const t = e, r = ee(), n = $(() => X(t.row, t.column, { now: t.now ?? r.value })), a = $(() => E[n.value.color || "neutral"]);
346
+ return (o, s) => n.value.kind === "badge" ? (y(), h("span", {
347
+ key: 0,
348
+ class: k(["inline-flex max-w-full items-center rounded-full px-2.5 py-0.5 text-xs font-medium break-words", a.value.badge])
349
+ }, w(n.value.text), 3)) : n.value.kind === "progress" ? (y(), h("div", te, [
350
+ n.value.showBar ? (y(), h("div", {
351
+ key: 0,
352
+ class: "h-1.5 w-full overflow-hidden rounded-full bg-muted",
353
+ role: n.value.percent === void 0 ? void 0 : "progressbar",
354
+ "aria-label": e.column.label,
355
+ "aria-valuemin": n.value.percent === void 0 ? void 0 : 0,
356
+ "aria-valuemax": n.value.percent === void 0 ? void 0 : 100,
357
+ "aria-valuenow": n.value.percent === void 0 ? void 0 : Math.round(n.value.percent),
358
+ "aria-valuetext": n.value.text
359
+ }, [
360
+ n.value.percent !== void 0 ? (y(), h("div", {
361
+ key: 0,
362
+ class: k(["h-full rounded-full", a.value.bar]),
363
+ style: Z({ width: `${n.value.percent}%` })
364
+ }, null, 6)) : T("", !0)
365
+ ], 8, re)) : T("", !0),
366
+ _("p", {
367
+ class: k(["text-sm leading-snug", n.value.state === "unavailable" ? "text-muted-foreground" : ""])
368
+ }, w(n.value.text), 3),
369
+ n.value.secondary ? (y(), h("p", ne, w(n.value.secondary), 1)) : T("", !0)
370
+ ])) : (y(), h("div", ae, [
371
+ _("div", {
372
+ class: k(e.column.type === "text" ? "whitespace-pre-wrap break-words" : "whitespace-nowrap")
373
+ }, w(n.value.text), 3),
374
+ n.value.secondary ? (y(), h("div", oe, w(n.value.secondary), 1)) : T("", !0)
375
+ ]));
376
+ }
377
+ });
378
+ function c(e) {
379
+ return new Date(e.getTime() - e.getTimezoneOffset() * 6e4).toISOString().slice(0, 10);
380
+ }
381
+ function Te() {
382
+ const e = /* @__PURE__ */ new Date(), t = c(e);
383
+ return {
384
+ // PAST
385
+ today: [t],
386
+ yesterday: [c(new Date(e.getFullYear(), e.getMonth(), e.getDate() - 1))],
387
+ last7days: [
388
+ c(new Date(e.getFullYear(), e.getMonth(), e.getDate() - 6)),
389
+ t
390
+ ],
391
+ lastMonth: [
392
+ c(new Date(e.getFullYear(), e.getMonth() - 1, e.getDate())),
393
+ t
394
+ ],
395
+ last6months: [
396
+ c(new Date(e.getFullYear(), e.getMonth() - 6, e.getDate())),
397
+ t
398
+ ],
399
+ lastYear: [
400
+ c(new Date(e.getFullYear() - 1, e.getMonth(), e.getDate())),
401
+ t
402
+ ],
403
+ // FUTURE
404
+ tomorrow: [c(new Date(e.getFullYear(), e.getMonth(), e.getDate() + 1))],
405
+ next7days: [
406
+ t,
407
+ c(new Date(e.getFullYear(), e.getMonth(), e.getDate() + 6))
408
+ ],
409
+ nextMonth: [
410
+ t,
411
+ c(new Date(e.getFullYear(), e.getMonth() + 1, e.getDate()))
412
+ ],
413
+ next6months: [
414
+ t,
415
+ c(new Date(e.getFullYear(), e.getMonth() + 6, e.getDate()))
416
+ ],
417
+ nextYear: [
418
+ t,
419
+ c(new Date(e.getFullYear() + 1, e.getMonth(), e.getDate()))
420
+ ]
421
+ };
422
+ }
423
+ export {
424
+ E as D,
425
+ O as N,
426
+ ke as _,
427
+ Te as a,
428
+ xe as b,
429
+ we as c,
430
+ J as d,
431
+ X as e,
432
+ Q as f,
433
+ he as g,
434
+ le as h,
435
+ f as i,
436
+ j,
437
+ ce as k,
438
+ fe as l,
439
+ me as m,
440
+ se as n,
441
+ N as o,
442
+ be as p,
443
+ ye as q,
444
+ D as r,
445
+ ve as s,
446
+ b as t,
447
+ ee as u,
448
+ De as v,
449
+ de as w,
450
+ ge as x,
451
+ ue as y,
452
+ pe as z
453
+ };
@@ -0,0 +1 @@
1
+ "use strict";const l=require("vue"),I=new Set(["__proto__","constructor","prototype"]);function h(e,t){if(!e||typeof t!="string"||!t)return;const r=t.split(".");if(!r.some(n=>I.has(n)))return Object.prototype.hasOwnProperty.call(e,t)?e[t]:r.reduce((n,a)=>n?.[a],e)}const w=["equals","not-equals","greater-than","greater-than-or-equal","less-than","less-than-or-equal"],R={equals:"Equals","not-equals":"Does not equal","greater-than":"Is greater than","greater-than-or-equal":"Is greater than or equal to","less-than":"Is less than","less-than-or-equal":"Is less than or equal to"},L=e=>e?.type==="number-range"||e?.type==="number-comparison"?e.type:"multi-select",g=e=>{if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e!="string"||e.trim()==="")return null;const t=Number(e.trim());return Number.isFinite(t)?t:null},q=(e,t)=>{const r=g(e);return r!==null&&r>0?r:t},P=(e,t,r)=>Math.min(Math.max(e,t),r),Y=(e,t,r)=>{const n=Math.max(`${r}`.split(".")[1]?.length??0,`${t}`.split(".")[1]?.length??0),a=t+Math.round((e-t)/r)*r;return Number(a.toFixed(Math.min(n,12)))},F=e=>{const t=Array.isArray(e.operators)?e.operators.filter(r=>w.includes(r)):[];return t.length?t:[...w]},z=e=>{const t=F(e);return t.includes(e.defaultOperator)?e.defaultOperator:t[0]},U=(e,t,r=!0)=>{const n=g(e);if(n===null)return!1;const a=t.min===null||(r?n>=t.min:n>t.min),o=t.max===null||(r?n<=t.max:n<t.max);return a&&o},Z=(e,t)=>{const r=g(e);if(r===null||!Number.isFinite(t.value))return!1;switch(t.operator){case"equals":return r===t.value;case"not-equals":return r!==t.value;case"greater-than":return r>t.value;case"greater-than-or-equal":return r>=t.value;case"less-than":return r<t.value;case"less-than-or-equal":return r<=t.value;default:return!1}},j=(e,t,r=20)=>{try{return new Intl.NumberFormat(t||void 0,{maximumFractionDigits:r}).format(e)}catch{return new Intl.NumberFormat(void 0,{maximumFractionDigits:r}).format(e)}},V=e=>{if(!(typeof e!="string"||!e.trim()))try{return new Intl.NumberFormat(e.trim()).format(0),e.trim()}catch{return}},N={neutral:{badge:"bg-muted text-muted-foreground",bar:"bg-slate-500"},blue:{badge:"bg-blue-100 text-blue-800 dark:bg-blue-500/15 dark:text-blue-300",bar:"bg-blue-500"},green:{badge:"bg-emerald-100 text-emerald-800 dark:bg-emerald-500/15 dark:text-emerald-300",bar:"bg-emerald-500"},amber:{badge:"bg-amber-100 text-amber-900 dark:bg-amber-500/15 dark:text-amber-300",bar:"bg-amber-500"},red:{badge:"bg-red-100 text-red-800 dark:bg-red-500/15 dark:text-red-300",bar:"bg-red-500"},purple:{badge:"bg-purple-100 text-purple-800 dark:bg-purple-500/15 dark:text-purple-300",bar:"bg-purple-500"}},D=864e5,K={minutes:6e4,hours:36e5,days:D};function k(e){return(Array.isArray(e.badge?.options)?e.badge.options:[]).filter(t=>t&&typeof t.value=="string"&&typeof t.label=="string")}function M(e){return(Array.isArray(e.thresholds)?e.thresholds:[]).filter(t=>t&&typeof t.at=="number"&&Number.isFinite(t.at))}function W(e){return e.type==="progress"?`progress:${e.id||e.property}`:String(e.property||e.id||"")}function x(e,t="neutral"){return typeof e=="string"&&Object.prototype.hasOwnProperty.call(N,e)?e:t}function G(e,t){let r=e.dateDisplay?.locale||t.locale||void 0,n=e.dateDisplay?.timeZone||t.timeZone||void 0;try{r&&new Intl.DateTimeFormat(r)}catch{r=void 0}try{n&&new Intl.DateTimeFormat(r,{timeZone:n})}catch{n=void 0}return{locale:r,timeZone:n}}function T(e){if(typeof e!="string"||!/^\d{4}-\d{2}-\d{2}$/.test(e))return null;const t=new Date(`${e}T00:00:00.000Z`);return Number.isFinite(t.getTime())&&t.toISOString().slice(0,10)===e?t.getTime():null}function y(e){if(e==null||e===""||typeof e=="boolean")return null;if(e instanceof Date)return Number.isFinite(e.getTime())?e.getTime():null;if(typeof e=="object"){const r=e,n=r.seconds??r._seconds;if(typeof n!="number"||!Number.isFinite(n))return null;const a=n*1e3+(r.nanoseconds??r._nanoseconds??0)/1e6;return Number.isFinite(new Date(a).getTime())?a:null}if(typeof e!="string"&&typeof e!="number")return null;if(typeof e=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e))return T(e);if(typeof e=="string"&&/^\d{4}-\d{2}-\d{2}T/.test(e)&&T(e.slice(0,10))===null)return null;const t=new Date(e).getTime();return Number.isFinite(t)?t:null}function S(e,t){const r=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(e),n=a=>r.find(o=>o.type===a)?.value;return Date.UTC(Number(n("year")),Number(n("month"))-1,Number(n("day")))}function H(e){return new Intl.DateTimeFormat(e).resolvedOptions().locale.toLowerCase().startsWith("nl")}function f(e,t){const r=Math.floor(Math.abs(e)/6e4);return r<1?"<1 min":[["day",Math.floor(r/1440)],["hour",Math.floor(r%1440/60)],["minute",r%60]].filter(([,a])=>a>0).slice(0,2).map(([a,o])=>new Intl.NumberFormat(t,{style:"unit",unit:a,unitDisplay:"narrow"}).format(o)).join(" ")}function J(e,t,r){const n=e-t;if(Math.abs(n)<6e4)return new Intl.RelativeTimeFormat(r,{numeric:"auto"}).format(0,"second");const a=new Intl.DateTimeFormat(r).resolvedOptions().locale.toLowerCase(),o=f(n,r);if(a.startsWith("nl"))return n<0?`${o} geleden`:`over ${o}`;if(a.startsWith("en"))return n<0?`${o} ago`:`in ${o}`;const[s,i]=Math.abs(n)>=D?["day",D]:Math.abs(n)>=36e5?["hour",36e5]:["minute",6e4];return new Intl.RelativeTimeFormat(r,{numeric:"auto"}).format(Math.trunc(n/i),s)}function v(e,t){if(!t)return;if(t.kind==="fixed")return t.value;const r=h(e,t.property||"");return t.kind==="array-count"?Array.isArray(r)?r.length:void 0:t.kind==="field"?r:void 0}const O=e=>`__table_count__${e}`;function Q(e,t){const r=[];for(const n of t){if(n.type!=="progress"){n.property&&r.push([n.property,h(e,n.property)]);continue}const a=n.progress,o=a?.mode==="time"?["start",a.endMode==="deadline"?"deadline":"duration"]:["current","target"];for(const s of o){const i=a?.[s];!i?.property||i.kind==="fixed"||r.push([i.kind==="array-count"?O(i.property):i.property,v(e,i)])}a?.mode==="time"&&a.completedAt&&r.push([a.completedAt,h(e,a.completedAt)])}return Object.fromEntries(r)}function X(e){const t={id:e.id,property:e.property||"",label:e.label||e.property||"",type:e.type||"text",visible:e.visible!==!1};if(e.type==="number"&&typeof e.numberDisplay?.prefix=="string"&&(t.numberDisplay={prefix:e.numberDisplay.prefix}),e.type==="text"&&typeof e.textDisplay?.prefix=="string"&&(t.textDisplay={prefix:e.textDisplay.prefix}),e.dateDisplay&&(t.dateDisplay={relative:e.dateDisplay.relative===!0,locale:e.dateDisplay.locale,timeZone:e.dateDisplay.timeZone}),e.type==="badge"&&(t.badge={options:k(e).map(r=>({id:r.id,value:r.value,label:r.label,color:x(r.color)}))}),e.type==="progress"&&e.progress){const r=e.progress;t.progress={mode:r.mode,endMode:r.endMode,durationUnit:r.durationUnit,completedAt:r.completedAt,display:r.display,showBar:r.showBar,color:r.color,thresholdMetric:r.thresholdMetric,thresholds:M(r).map(a=>({at:a.at,color:a.color})),completedColor:r.completedColor,overdueColor:r.overdueColor,sortBy:r.sortBy};const n=r.mode==="time"?["start",r.endMode==="deadline"?"deadline":"duration"]:["current","target"];for(const a of n){const o=r[a];o&&(t.progress[a]=o.kind==="array-count"?{kind:"field",property:O(o.property||"")}:o.kind==="fixed"?{kind:"fixed",value:o.value}:{kind:"field",property:o.property})}}return t}function _(e,t,r=Date.now()){if(!t||!["numeric","time"].includes(t.mode)||!Number.isFinite(r))return null;if(t.mode==="numeric"){const p=g(v(e,t.current)),d=g(v(e,t.target));if(p===null||d===null||d<0)return null;const b=d>0?p/d*100:null;return{current:p,target:d,percent:b!==null&&Number.isFinite(b)?b:null,remaining:d-p,deadline:null,state:"active"}}const n=y(v(e,t.start)),a=g(v(e,t.duration)),o=t.endMode==="deadline"?y(v(e,t.deadline)):n!==null&&a!==null&&a>0?n+a*K[t.durationUnit||"hours"]:null,s=t.completedAt?h(e,t.completedAt):void 0,i=y(s);if(n===null||o===null||!Number.isFinite(o)||o<=n||s!=null&&s!==""&&i===null||i!==null&&i<n)return null;const u=i??r,c=i!==null?i<=o?"completed":"completed-late":r<n?"upcoming":r>=o?"overdue":"active";return{current:Math.max(0,u-n),target:o-n,percent:(u-n)/(o-n)*100,remaining:o-u,deadline:o,state:c}}function ee(e,t){if(t.state==="completed")return x(e.completedColor,"green");if(t.state==="overdue"||t.state==="completed-late")return x(e.overdueColor,"red");if(t.state==="upcoming")return"neutral";const r=e.mode==="time"&&e.thresholdMetric==="remaining",n=r?t.remaining/6e4:t.percent;if(n===null)return"neutral";const o=M(e).sort((s,i)=>r?s.at-i.at:i.at-s.at).find(s=>r?n<=s.at:n>=s.at);return x(o?.color,x(e.color,"blue"))}function te(e,t,r=Date.now()){if(t.type==="progress"){const a=_(e,t.progress,r);if(!a)return null;switch(t.progress?.sortBy){case"current":return a.current;case"remaining":return t.progress?.mode==="time"?a.remaining/6e4:a.remaining;case"deadline":return a.deadline;default:return a.percent}}const n=h(e,t.property||"");return t.type==="array-counter"?Array.isArray(n)?n.length:n==null?0:null:n}function B(e,t,r=n=>String(n)){return e==null||typeof e=="string"&&!e.trim()?"":`${typeof t.textDisplay?.prefix=="string"?t.textDisplay.prefix:""}${r(e)}`}function A(e,t,r=n=>n.toFixed(2).replace(".00","")){if(e==null||typeof e=="string"&&!e.trim())return"";const n=g(e);return n===null?String(e):`${typeof t.numberDisplay?.prefix=="string"?t.numberDisplay.prefix:""}${r(n)}`}function E(e,t,r={}){const n=r.now??Date.now(),{locale:a,timeZone:o}=G(t,r),s=h(e,t.property||"");if(t.type==="number")return{kind:"plain",text:A(s,t)};if(t.type==="text")return{kind:"plain",text:B(s,t)};if(t.type==="date"||t.type==="datetime"){const i=y(s);if(i===null)return{kind:"date",text:"—"};const u=typeof s=="string"&&T(s)!==null,c={timeZone:u?"UTC":o};t.dateDisplay?.relative&&Object.assign(c,{dateStyle:"medium",...t.type==="datetime"?{timeStyle:"short"}:{}});const p=new Date(i),d=t.type==="datetime"?p.toLocaleString(a,c):p.toLocaleDateString(a,c),b=t.dateDisplay?.relative?t.type==="date"||u?new Intl.RelativeTimeFormat(a,{numeric:"auto"}).format(Math.round(((u?i:S(i,o))-S(n,o))/D),"day"):J(i,n,a):void 0;return{kind:"date",text:d,secondary:b}}if(t.type==="badge"){if(s==null||s==="")return{kind:"badge",text:"—",color:"neutral"};const i=typeof s=="object"?"—":String(s),u=k(t).find(c=>String(c.value)===i);return{kind:"badge",text:u?.label||i,color:x(u?.color)}}if(t.type==="progress"){const i=t.progress,u=_(e,i,n);if(!i||!u)return{kind:"progress",text:"—",state:"unavailable",color:"neutral",showBar:i?.showBar!==!1};const c=H(a),p=b=>new Intl.NumberFormat(a,{maximumFractionDigits:2}).format(b);let d;return i.mode==="numeric"?d=i.display==="percentage"?u.percent===null?"—":`${p(u.percent)}%`:`${p(u.current)} / ${p(u.target)}`:u.state==="completed"?d=c?"Op tijd afgerond":"Completed on time":u.state==="completed-late"?d=c?"Te laat afgerond":"Completed late":u.state==="upcoming"?d=c?`start over ${f(u.remaining-u.target,a)}`:`starts in ${f(u.remaining-u.target,a)}`:u.state==="overdue"?d=c?`${f(u.remaining,a)} over tijd`:`${f(u.remaining,a)} overdue`:i.display==="percentage"?d=`${p(u.percent??0)}%`:i.display==="elapsed"?d=c?`${f(u.current,a)} verstreken`:`${f(u.current,a)} elapsed`:d=c?`nog ${f(u.remaining,a)}`:`${f(u.remaining,a)} remaining`,{kind:"progress",text:d,percent:u.percent===null?void 0:u.state==="completed"||u.state==="completed-late"?100:Math.min(100,Math.max(0,u.percent)),showBar:i.showBar!==!1,color:ee(i,u),state:u.percent===null?"unavailable":u.state,secondary:u.percent===null?c?"Geen positief doel":"No positive target":void 0}}return{kind:"plain",text:s==null?"—":String(s)}}function re(e){if(e.type==="date"||e.type==="datetime"){try{e.dateDisplay?.locale&&new Intl.DateTimeFormat(e.dateDisplay.locale)}catch{return"Enter a valid locale, such as nl-BE or en-GB."}try{e.dateDisplay?.timeZone&&new Intl.DateTimeFormat(void 0,{timeZone:e.dateDisplay.timeZone})}catch{return"Enter a valid time zone, such as Europe/Brussels."}}if(e.type==="badge"){const o=k(e);if(e.badge?.options&&(!Array.isArray(e.badge.options)||o.length!==e.badge.options.length))return"Check the badge options and enter a value and label for each.";if(o.some(s=>!s.value.trim()||!s.label.trim()))return"Every badge needs a value and a label.";if(new Set(o.map(s=>s.value)).size!==o.length)return"Badge values must be unique."}if(e.type!=="progress")return null;const t=e.progress;if(!t||!["numeric","time"].includes(t.mode))return"Choose a progress mode.";const r=(o,s,i=!1)=>!o||!["field","fixed","array-count"].includes(o.kind)?`Choose a source for ${s}.`:i&&o.kind==="array-count"?`${s} must be a date field or a fixed date.`:o.kind!=="fixed"?o.property?.trim()?null:`Choose a field for ${s}.`:(i?y(o.value):g(o.value))===null?`Enter a valid ${i?"date":"number"} for ${s}.`:null,n=t.mode==="numeric"?["current","target"]:["start",t.endMode==="deadline"?"deadline":"duration"];for(const o of n){const s=r(t[o],o,o==="start"||o==="deadline");if(s)return s}if(t.mode==="numeric"&&t.target?.kind==="fixed"&&Number(t.target.value)<=0)return"The fixed target must be greater than zero.";if(t.mode==="time"&&t.endMode!=="deadline"&&t.duration?.kind==="fixed"&&Number(t.duration.value)<=0)return"The duration must be greater than zero.";if(t.mode==="time"&&t.endMode==="deadline"&&t.start?.kind==="fixed"&&t.deadline?.kind==="fixed"&&(y(t.deadline.value)??0)<=(y(t.start.value)??0))return"The deadline must be after the start.";const a=M(t);return t.thresholds&&(!Array.isArray(t.thresholds)||a.length!==t.thresholds.length)?"Enter a valid number for every color threshold.":a.some(o=>o.at<0)?"Color thresholds must be zero or greater.":new Set(a.map(o=>o.at)).size!==a.length?"Use a different value for each color threshold.":null}const C=Symbol("table-display-clock");function ne(){const e=l.inject(C,void 0);if(e)return e;const t=l.ref(Date.now());let r;const n=()=>{r!==void 0&&clearInterval(r),r=void 0},a=()=>{n(),!document.hidden&&(t.value=Date.now(),r=setInterval(()=>{t.value=Date.now()},3e4))};return l.onMounted(()=>{a(),document.addEventListener("visibilitychange",a)}),l.onUnmounted(()=>{n(),document.removeEventListener("visibilitychange",a)}),l.provide(C,t),t}function $(){return l.inject(C,()=>l.ref(Date.now()),!0)}const ae={key:1,class:"w-40 max-w-full min-w-0 space-y-1.5 tabular-nums"},oe=["role","aria-label","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext"],ie={key:1,class:"text-xs text-muted-foreground"},le={key:2,class:"min-w-0 tabular-nums"},se={key:0,class:"text-xs text-muted-foreground leading-relaxed"},ue=l.defineComponent({__name:"TableDisplayCell",props:{row:{},column:{},now:{}},setup(e){const t=e,r=$(),n=l.computed(()=>E(t.row,t.column,{now:t.now??r.value})),a=l.computed(()=>N[n.value.color||"neutral"]);return(o,s)=>n.value.kind==="badge"?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(["inline-flex max-w-full items-center rounded-full px-2.5 py-0.5 text-xs font-medium break-words",a.value.badge])},l.toDisplayString(n.value.text),3)):n.value.kind==="progress"?(l.openBlock(),l.createElementBlock("div",ae,[n.value.showBar?(l.openBlock(),l.createElementBlock("div",{key:0,class:"h-1.5 w-full overflow-hidden rounded-full bg-muted",role:n.value.percent===void 0?void 0:"progressbar","aria-label":e.column.label,"aria-valuemin":n.value.percent===void 0?void 0:0,"aria-valuemax":n.value.percent===void 0?void 0:100,"aria-valuenow":n.value.percent===void 0?void 0:Math.round(n.value.percent),"aria-valuetext":n.value.text},[n.value.percent!==void 0?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["h-full rounded-full",a.value.bar]),style:l.normalizeStyle({width:`${n.value.percent}%`})},null,6)):l.createCommentVNode("",!0)],8,oe)):l.createCommentVNode("",!0),l.createElementVNode("p",{class:l.normalizeClass(["text-sm leading-snug",n.value.state==="unavailable"?"text-muted-foreground":""])},l.toDisplayString(n.value.text),3),n.value.secondary?(l.openBlock(),l.createElementBlock("p",ie,l.toDisplayString(n.value.secondary),1)):l.createCommentVNode("",!0)])):(l.openBlock(),l.createElementBlock("div",le,[l.createElementVNode("div",{class:l.normalizeClass(e.column.type==="text"?"whitespace-pre-wrap break-words":"whitespace-nowrap")},l.toDisplayString(n.value.text),3),n.value.secondary?(l.openBlock(),l.createElementBlock("div",se,l.toDisplayString(n.value.secondary),1)):l.createCommentVNode("",!0)]))}});function m(e){return new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(0,10)}function de(){const e=new Date,t=m(e);return{today:[t],yesterday:[m(new Date(e.getFullYear(),e.getMonth(),e.getDate()-1))],last7days:[m(new Date(e.getFullYear(),e.getMonth(),e.getDate()-6)),t],lastMonth:[m(new Date(e.getFullYear(),e.getMonth()-1,e.getDate())),t],last6months:[m(new Date(e.getFullYear(),e.getMonth()-6,e.getDate())),t],lastYear:[m(new Date(e.getFullYear()-1,e.getMonth(),e.getDate())),t],tomorrow:[m(new Date(e.getFullYear(),e.getMonth(),e.getDate()+1))],next7days:[t,m(new Date(e.getFullYear(),e.getMonth(),e.getDate()+6))],nextMonth:[t,m(new Date(e.getFullYear(),e.getMonth()+1,e.getDate()))],next6months:[t,m(new Date(e.getFullYear(),e.getMonth()+6,e.getDate()))],nextYear:[t,m(new Date(e.getFullYear()+1,e.getMonth(),e.getDate()))]}}exports.DISPLAY_COLOR_CLASSES=N;exports.NUMBER_COMPARISON_OPERATORS=w;exports.NUMBER_COMPARISON_OPERATOR_LABELS=R;exports._sfc_main=ue;exports.clampNumber=P;exports.formatFilterNumber=j;exports.formatTableNumber=A;exports.formatTableText=B;exports.getColumnCellValue=te;exports.getComparisonOperators=F;exports.getDateRangePresets=de;exports.getDefaultComparisonOperator=z;exports.getTableBadgeOptions=k;exports.getTableColumnId=W;exports.getTableFilterType=L;exports.matchesNumberComparison=Z;exports.matchesNumberRange=U;exports.normalizeNumberLocale=V;exports.parseFiniteNumber=g;exports.positiveNumberOr=q;exports.projectTableRow=Q;exports.provideTableClock=ne;exports.resolveProperty=h;exports.resolveTableCell=E;exports.snapNumberToStep=Y;exports.snapshotTableColumn=X;exports.tableTimestamp=y;exports.useTableClock=$;exports.validateColumnDisplay=re;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("@oneclick.dev/cms-kit"),t={class:"relative flex min-h-0 w-full flex-1 @container"},c=e.defineComponent({__name:"index",setup(r){const{pageComponent:n}=o.useModuleRoute();return(l,s)=>(e.openBlock(),e.createElementBlock("div",t,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(n))))]))}});exports.default=c;
@@ -0,0 +1,14 @@
1
+ import { defineComponent as n, openBlock as e, createElementBlock as t, createBlock as r, resolveDynamicComponent as c, unref as l } from "vue";
2
+ import { useModuleRoute as a } from "@oneclick.dev/cms-kit";
3
+ const m = { class: "relative flex min-h-0 w-full flex-1 @container" }, u = /* @__PURE__ */ n({
4
+ __name: "index",
5
+ setup(s) {
6
+ const { pageComponent: o } = a();
7
+ return (i, p) => (e(), t("div", m, [
8
+ (e(), r(c(l(o))))
9
+ ]));
10
+ }
11
+ });
12
+ export {
13
+ u as default
14
+ };