@medyat/vue-data-table 0.0.0-stage → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,224 @@
1
+ import { W as e } from "./query-CGNWUi2E.js";
2
+ import { Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, normalizeClass as u, openBlock as d, ref as f, renderList as p, toDisplayString as m, unref as h, withCtx as g } from "vue";
3
+ import { PhCaretLeft as _, PhCaretRight as v, PhCheck as y } from "@phosphor-icons/vue";
4
+ import { CalendarCell as ee, CalendarCellTrigger as te, CalendarGrid as ne, CalendarGridBody as re, CalendarGridHead as ie, CalendarGridRow as b, CalendarHeadCell as x, CalendarHeader as S, CalendarHeading as ae, CalendarNext as C, CalendarPrev as oe, CalendarRoot as se, RangeCalendarCell as ce, RangeCalendarCellTrigger as le, RangeCalendarGrid as ue, RangeCalendarGridBody as de, RangeCalendarGridHead as w, RangeCalendarGridRow as T, RangeCalendarHeadCell as E, RangeCalendarHeader as D, RangeCalendarHeading as O, RangeCalendarNext as k, RangeCalendarPrev as A, RangeCalendarRoot as j } from "reka-ui";
5
+ import { getDayOfWeek as M, getLocalTimeZone as N, parseDate as P, startOfWeek as F, today as I } from "@internationalized/date";
6
+ //#region src/core/editors/DateEditor.vue?vue&type=script&setup=true&lang.ts
7
+ var L = { class: "dt-editor-date" }, R = { class: "dt-date-presets" }, z = ["onClick"], B = /* @__PURE__ */ l({
8
+ __name: "DateEditor",
9
+ props: {
10
+ op: {},
11
+ modelValue: {}
12
+ },
13
+ emits: ["update:modelValue", "done"],
14
+ setup(l, { emit: B }) {
15
+ let V = l, H = B, { i18n: U, locale: W } = e(), fe = [
16
+ "today",
17
+ "this_week",
18
+ "next_7_days",
19
+ "this_month",
20
+ "last_30_days",
21
+ "this_quarter",
22
+ "overdue"
23
+ ], pe = N(), G = I(pe), K = M(F(G, W), "en-US"), q = n(() => V.op === "within"), J = (e) => e && typeof e == "object" ? e : null, Y = n(() => J(V.modelValue)?.preset), X = f(!1), Z = (e) => {
24
+ try {
25
+ return typeof e == "string" && e ? P(e.slice(0, 10)) : void 0;
26
+ } catch {
27
+ return;
28
+ }
29
+ }, Q = n(() => {
30
+ let e = J(V.modelValue);
31
+ return {
32
+ start: Z(e?.from),
33
+ end: Z(e?.to)
34
+ };
35
+ }), $ = n(() => Z(V.modelValue)), me = (e) => {
36
+ X.value = !1, H("update:modelValue", { preset: e }), H("done");
37
+ }, he = (e) => {
38
+ e?.start && e.end && (H("update:modelValue", {
39
+ from: e.start.toString(),
40
+ to: e.end.toString()
41
+ }), H("done"));
42
+ }, ge = (e) => {
43
+ e && (H("update:modelValue", e.toString()), H("done"));
44
+ }, _e = () => {
45
+ H("update:modelValue", { preset: "today" }), H("done");
46
+ };
47
+ return (e, n) => (d(), a("div", L, [o("div", R, [q.value ? (d(), a(t, { key: 0 }, [
48
+ (d(), a(t, null, p(fe, (e) => o("button", {
49
+ key: e,
50
+ type: "button",
51
+ class: u(["dt-pop-item dt-date-preset", { "is-on": Y.value === e }]),
52
+ onClick: (t) => me(e)
53
+ }, [s(m(h(U).t(`date.${e}`)) + " ", 1), Y.value === e ? (d(), r(h(y), {
54
+ key: 0,
55
+ size: 14,
56
+ class: "dt-pop-end",
57
+ "aria-hidden": "true"
58
+ })) : i("", !0)], 10, z)), 64)),
59
+ n[2] ||= o("div", { class: "dt-pop-sep" }, null, -1),
60
+ o("button", {
61
+ type: "button",
62
+ class: u(["dt-pop-item dt-date-preset", { "is-on": X.value || !Y.value && Q.value.start }]),
63
+ onClick: n[0] ||= (e) => X.value = !0
64
+ }, m(h(U).t("date.customRange")), 3)
65
+ ], 64)) : (d(), a("button", {
66
+ key: 1,
67
+ type: "button",
68
+ class: u(["dt-pop-item dt-date-preset", { "is-on": Y.value === "today" }]),
69
+ onClick: _e
70
+ }, [s(m(h(U).t("date.today")) + " ", 1), Y.value === "today" ? (d(), r(h(y), {
71
+ key: 0,
72
+ size: 14,
73
+ class: "dt-pop-end",
74
+ "aria-hidden": "true"
75
+ })) : i("", !0)], 2))]), q.value ? (d(), r(h(j), {
76
+ key: 0,
77
+ class: "dt-calendar",
78
+ "model-value": Q.value.start && Q.value.end ? {
79
+ start: Q.value.start,
80
+ end: Q.value.end
81
+ } : void 0,
82
+ locale: h(W),
83
+ "week-starts-on": h(K),
84
+ placeholder: Q.value.start ?? h(G),
85
+ "onUpdate:modelValue": he
86
+ }, {
87
+ default: g(({ weekDays: e, grid: n }) => [c(h(D), { class: "dt-cal-head" }, {
88
+ default: g(() => [
89
+ c(h(A), { class: "dt-icon-btn-sm" }, {
90
+ default: g(() => [c(h(_), {
91
+ size: 16,
92
+ "aria-hidden": "true"
93
+ })]),
94
+ _: 1
95
+ }),
96
+ c(h(O), { class: "dt-cal-title" }),
97
+ c(h(k), { class: "dt-icon-btn-sm" }, {
98
+ default: g(() => [c(h(v), {
99
+ size: 16,
100
+ "aria-hidden": "true"
101
+ })]),
102
+ _: 1
103
+ })
104
+ ]),
105
+ _: 1
106
+ }), (d(!0), a(t, null, p(n, (n) => (d(), r(h(ue), {
107
+ key: n.value.toString(),
108
+ class: "dt-cal-grid"
109
+ }, {
110
+ default: g(() => [c(h(w), null, {
111
+ default: g(() => [c(h(T), null, {
112
+ default: g(() => [(d(!0), a(t, null, p(e, (e) => (d(), r(h(E), {
113
+ key: e,
114
+ class: "dt-cal-dow"
115
+ }, {
116
+ default: g(() => [s(m(e), 1)]),
117
+ _: 2
118
+ }, 1024))), 128))]),
119
+ _: 2
120
+ }, 1024)]),
121
+ _: 2
122
+ }, 1024), c(h(de), null, {
123
+ default: g(() => [(d(!0), a(t, null, p(n.rows, (e, i) => (d(), r(h(T), { key: i }, {
124
+ default: g(() => [(d(!0), a(t, null, p(e, (e) => (d(), r(h(ce), {
125
+ key: e.toString(),
126
+ date: e,
127
+ class: "dt-cal-cell"
128
+ }, {
129
+ default: g(() => [c(h(le), {
130
+ day: e,
131
+ month: n.value,
132
+ class: "dt-cal-day"
133
+ }, null, 8, ["day", "month"])]),
134
+ _: 2
135
+ }, 1032, ["date"]))), 128))]),
136
+ _: 2
137
+ }, 1024))), 128))]),
138
+ _: 2
139
+ }, 1024)]),
140
+ _: 2
141
+ }, 1024))), 128))]),
142
+ _: 1
143
+ }, 8, [
144
+ "model-value",
145
+ "locale",
146
+ "week-starts-on",
147
+ "placeholder"
148
+ ])) : (d(), r(h(se), {
149
+ key: 1,
150
+ class: "dt-calendar",
151
+ "model-value": $.value,
152
+ locale: h(W),
153
+ "week-starts-on": h(K),
154
+ placeholder: $.value ?? h(G),
155
+ "onUpdate:modelValue": n[1] ||= (e) => ge(e)
156
+ }, {
157
+ default: g(({ weekDays: e, grid: n }) => [c(h(S), { class: "dt-cal-head" }, {
158
+ default: g(() => [
159
+ c(h(oe), { class: "dt-icon-btn-sm" }, {
160
+ default: g(() => [c(h(_), {
161
+ size: 16,
162
+ "aria-hidden": "true"
163
+ })]),
164
+ _: 1
165
+ }),
166
+ c(h(ae), { class: "dt-cal-title" }),
167
+ c(h(C), { class: "dt-icon-btn-sm" }, {
168
+ default: g(() => [c(h(v), {
169
+ size: 16,
170
+ "aria-hidden": "true"
171
+ })]),
172
+ _: 1
173
+ })
174
+ ]),
175
+ _: 1
176
+ }), (d(!0), a(t, null, p(n, (n) => (d(), r(h(ne), {
177
+ key: n.value.toString(),
178
+ class: "dt-cal-grid"
179
+ }, {
180
+ default: g(() => [c(h(ie), null, {
181
+ default: g(() => [c(h(b), null, {
182
+ default: g(() => [(d(!0), a(t, null, p(e, (e) => (d(), r(h(x), {
183
+ key: e,
184
+ class: "dt-cal-dow"
185
+ }, {
186
+ default: g(() => [s(m(e), 1)]),
187
+ _: 2
188
+ }, 1024))), 128))]),
189
+ _: 2
190
+ }, 1024)]),
191
+ _: 2
192
+ }, 1024), c(h(re), null, {
193
+ default: g(() => [(d(!0), a(t, null, p(n.rows, (e, i) => (d(), r(h(b), { key: i }, {
194
+ default: g(() => [(d(!0), a(t, null, p(e, (e) => (d(), r(h(ee), {
195
+ key: e.toString(),
196
+ date: e,
197
+ class: "dt-cal-cell"
198
+ }, {
199
+ default: g(() => [c(h(te), {
200
+ day: e,
201
+ month: n.value,
202
+ class: "dt-cal-day"
203
+ }, null, 8, ["day", "month"])]),
204
+ _: 2
205
+ }, 1032, ["date"]))), 128))]),
206
+ _: 2
207
+ }, 1024))), 128))]),
208
+ _: 2
209
+ }, 1024)]),
210
+ _: 2
211
+ }, 1024))), 128))]),
212
+ _: 1
213
+ }, 8, [
214
+ "model-value",
215
+ "locale",
216
+ "week-starts-on",
217
+ "placeholder"
218
+ ]))]));
219
+ }
220
+ });
221
+ //#endregion
222
+ export { B as default };
223
+
224
+ //# sourceMappingURL=DateEditor-C2zzyoPQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateEditor-C2zzyoPQ.js","names":["_openBlock","_createElementBlock","_createElementVNode","_Fragment","_renderList","_normalizeClass","_createTextVNode","_toDisplayString","_unref","_createBlock","_createCommentVNode","_withCtx","_createVNode","_sfc_main","useDataTableContext","_hoisted_1","_hoisted_2","_hoisted_3","DateEditor_default","defineComponent","__emit","props","__props","emit","PRESETS","tz","getLocalTimeZone","now","today","weekStartsOn","getDayOfWeek","startOfWeek","locale","isRange","computed","obj","v","preset","custom","ref","safe","s","parseDate","rangeValue","o","single","pickPreset","p","onRange","r","onSingle","d","pickToday","openBlock","createElementBlock","createElementVNode","Fragment","renderList","normalizeClass","createTextVNode","toDisplayString","unref","i18n","createBlock","PhCheck","createCommentVNode","_cache","RangeCalendarRoot","withCtx","createVNode","RangeCalendarHeader","RangeCalendarPrev","PhCaretLeft","RangeCalendarHeading","RangeCalendarNext","PhCaretRight","grid","RangeCalendarGrid","month","RangeCalendarGridHead","RangeCalendarGridRow","weekDays","RangeCalendarHeadCell","day","RangeCalendarGridBody","week","RangeCalendarCell","RangeCalendarCellTrigger","CalendarRoot","CalendarHeader","CalendarPrev","CalendarHeading","CalendarNext","CalendarGrid","CalendarGridHead","CalendarGridRow","CalendarHeadCell","CalendarGridBody","CalendarCell","CalendarCellTrigger"],"sources":["../src/core/editors/DateEditor.vue","../src/core/editors/DateEditor.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// Tarih editörü (04 §3, T2-04): `within` → solda hazır aralıklar + Custom range, sağda aralık takvimi; `eq/before/after` →\n// Today + tek takvim. Hazır aralık tıklanınca uygulanır ve kapanır; özel aralıkta ikinci uç seçilince. Hafta başı yerel ayardan.\nimport { getDayOfWeek, getLocalTimeZone, parseDate, startOfWeek, today, type DateValue } from '@internationalized/date'\nimport { PhCaretLeft, PhCaretRight, PhCheck } from '@phosphor-icons/vue'\nimport {\n CalendarCell,\n CalendarCellTrigger,\n CalendarGrid,\n CalendarGridBody,\n CalendarGridHead,\n CalendarGridRow,\n CalendarHeadCell,\n CalendarHeader,\n CalendarHeading,\n CalendarNext,\n CalendarPrev,\n CalendarRoot,\n RangeCalendarCell,\n RangeCalendarCellTrigger,\n RangeCalendarGrid,\n RangeCalendarGridBody,\n RangeCalendarGridHead,\n RangeCalendarGridRow,\n RangeCalendarHeadCell,\n RangeCalendarHeader,\n RangeCalendarHeading,\n RangeCalendarNext,\n RangeCalendarPrev,\n RangeCalendarRoot,\n} from 'reka-ui'\nimport { computed, ref } from 'vue'\nimport type { DatePreset, FilterOp } from '../../types/query'\nimport { useDataTableContext } from '../plugin'\n\nconst props = defineProps<{ op: FilterOp; modelValue: unknown }>()\nconst emit = defineEmits<{ 'update:modelValue': [value: unknown]; done: [] }>()\nconst { i18n, locale } = useDataTableContext()\n\nconst PRESETS: DatePreset[] = [\n 'today',\n 'this_week',\n 'next_7_days',\n 'this_month',\n 'last_30_days',\n 'this_quarter',\n 'overdue',\n]\nconst tz = getLocalTimeZone()\nconst now = today(tz)\nconst weekStartsOn = getDayOfWeek(startOfWeek(now, locale), 'en-US') as 0 | 1 | 2 | 3 | 4 | 5 | 6\nconst isRange = computed(() => props.op === 'within')\nconst obj = (v: unknown): Record<string, unknown> | null =>\n v && typeof v === 'object' ? (v as Record<string, unknown>) : null\nconst preset = computed(() => obj(props.modelValue)?.preset as string | undefined)\nconst custom = ref(false)\n\nconst safe = (s: unknown): DateValue | undefined => {\n try {\n return typeof s === 'string' && s ? parseDate(s.slice(0, 10)) : undefined\n } catch {\n return undefined\n }\n}\nconst rangeValue = computed(() => {\n const o = obj(props.modelValue)\n return { start: safe(o?.from), end: safe(o?.to) }\n})\nconst single = computed(() => safe(props.modelValue))\n\nconst pickPreset = (p: DatePreset) => {\n custom.value = false\n emit('update:modelValue', { preset: p })\n emit('done')\n}\nconst onRange = (r: { start: DateValue | undefined; end: DateValue | undefined } | null) => {\n if (!r?.start || !r.end) return\n emit('update:modelValue', { from: r.start.toString(), to: r.end.toString() })\n emit('done')\n}\nconst onSingle = (d: DateValue | undefined) => {\n if (!d) return\n emit('update:modelValue', d.toString())\n emit('done')\n}\nconst pickToday = () => {\n emit('update:modelValue', { preset: 'today' })\n emit('done')\n}\n</script>\n\n<template>\n <div class=\"dt-editor-date\">\n <div class=\"dt-date-presets\">\n <template v-if=\"isRange\">\n <button\n v-for=\"p in PRESETS\"\n :key=\"p\"\n type=\"button\"\n class=\"dt-pop-item dt-date-preset\"\n :class=\"{ 'is-on': preset === p }\"\n @click=\"pickPreset(p)\"\n >\n {{ i18n.t(`date.${p}`) }}\n <PhCheck v-if=\"preset === p\" :size=\"14\" class=\"dt-pop-end\" aria-hidden=\"true\" />\n </button>\n <div class=\"dt-pop-sep\" />\n <button\n type=\"button\"\n class=\"dt-pop-item dt-date-preset\"\n :class=\"{ 'is-on': custom || (!preset && rangeValue.start) }\"\n @click=\"custom = true\"\n >\n {{ i18n.t('date.customRange') }}\n </button>\n </template>\n <template v-else>\n <button\n type=\"button\"\n class=\"dt-pop-item dt-date-preset\"\n :class=\"{ 'is-on': preset === 'today' }\"\n @click=\"pickToday\"\n >\n {{ i18n.t('date.today') }}\n <PhCheck v-if=\"preset === 'today'\" :size=\"14\" class=\"dt-pop-end\" aria-hidden=\"true\" />\n </button>\n </template>\n </div>\n <RangeCalendarRoot\n v-if=\"isRange\"\n v-slot=\"{ weekDays, grid }\"\n class=\"dt-calendar\"\n :model-value=\"rangeValue.start && rangeValue.end ? { start: rangeValue.start, end: rangeValue.end } : undefined\"\n :locale=\"locale\"\n :week-starts-on=\"weekStartsOn\"\n :placeholder=\"rangeValue.start ?? now\"\n @update:model-value=\"onRange\"\n >\n <RangeCalendarHeader class=\"dt-cal-head\">\n <RangeCalendarPrev class=\"dt-icon-btn-sm\"><PhCaretLeft :size=\"16\" aria-hidden=\"true\" /></RangeCalendarPrev>\n <RangeCalendarHeading class=\"dt-cal-title\" />\n <RangeCalendarNext class=\"dt-icon-btn-sm\"><PhCaretRight :size=\"16\" aria-hidden=\"true\" /></RangeCalendarNext>\n </RangeCalendarHeader>\n <RangeCalendarGrid v-for=\"month in grid\" :key=\"month.value.toString()\" class=\"dt-cal-grid\">\n <RangeCalendarGridHead>\n <RangeCalendarGridRow>\n <RangeCalendarHeadCell v-for=\"day in weekDays\" :key=\"day\" class=\"dt-cal-dow\">\n {{ day }}\n </RangeCalendarHeadCell>\n </RangeCalendarGridRow>\n </RangeCalendarGridHead>\n <RangeCalendarGridBody>\n <RangeCalendarGridRow v-for=\"(week, i) in month.rows\" :key=\"i\">\n <RangeCalendarCell v-for=\"d in week\" :key=\"d.toString()\" :date=\"d\" class=\"dt-cal-cell\">\n <RangeCalendarCellTrigger :day=\"d\" :month=\"month.value\" class=\"dt-cal-day\" />\n </RangeCalendarCell>\n </RangeCalendarGridRow>\n </RangeCalendarGridBody>\n </RangeCalendarGrid>\n </RangeCalendarRoot>\n <CalendarRoot\n v-else\n v-slot=\"{ weekDays, grid }\"\n class=\"dt-calendar\"\n :model-value=\"single\"\n :locale=\"locale\"\n :week-starts-on=\"weekStartsOn\"\n :placeholder=\"single ?? now\"\n @update:model-value=\"(d) => onSingle(d as DateValue | undefined)\"\n >\n <CalendarHeader class=\"dt-cal-head\">\n <CalendarPrev class=\"dt-icon-btn-sm\"><PhCaretLeft :size=\"16\" aria-hidden=\"true\" /></CalendarPrev>\n <CalendarHeading class=\"dt-cal-title\" />\n <CalendarNext class=\"dt-icon-btn-sm\"><PhCaretRight :size=\"16\" aria-hidden=\"true\" /></CalendarNext>\n </CalendarHeader>\n <CalendarGrid v-for=\"month in grid\" :key=\"month.value.toString()\" class=\"dt-cal-grid\">\n <CalendarGridHead>\n <CalendarGridRow>\n <CalendarHeadCell v-for=\"day in weekDays\" :key=\"day\" class=\"dt-cal-dow\">{{ day }}</CalendarHeadCell>\n </CalendarGridRow>\n </CalendarGridHead>\n <CalendarGridBody>\n <CalendarGridRow v-for=\"(week, i) in month.rows\" :key=\"i\">\n <CalendarCell v-for=\"d in week\" :key=\"d.toString()\" :date=\"d\" class=\"dt-cal-cell\">\n <CalendarCellTrigger :day=\"d\" :month=\"month.value\" class=\"dt-cal-day\" />\n </CalendarCell>\n </CalendarGridRow>\n </CalendarGridBody>\n </CalendarGrid>\n </CalendarRoot>\n </div>\n</template>\n","<script setup lang=\"ts\">\n// Tarih editörü (04 §3, T2-04): `within` → solda hazır aralıklar + Custom range, sağda aralık takvimi; `eq/before/after` →\n// Today + tek takvim. Hazır aralık tıklanınca uygulanır ve kapanır; özel aralıkta ikinci uç seçilince. Hafta başı yerel ayardan.\nimport { getDayOfWeek, getLocalTimeZone, parseDate, startOfWeek, today, type DateValue } from '@internationalized/date'\nimport { PhCaretLeft, PhCaretRight, PhCheck } from '@phosphor-icons/vue'\nimport {\n CalendarCell,\n CalendarCellTrigger,\n CalendarGrid,\n CalendarGridBody,\n CalendarGridHead,\n CalendarGridRow,\n CalendarHeadCell,\n CalendarHeader,\n CalendarHeading,\n CalendarNext,\n CalendarPrev,\n CalendarRoot,\n RangeCalendarCell,\n RangeCalendarCellTrigger,\n RangeCalendarGrid,\n RangeCalendarGridBody,\n RangeCalendarGridHead,\n RangeCalendarGridRow,\n RangeCalendarHeadCell,\n RangeCalendarHeader,\n RangeCalendarHeading,\n RangeCalendarNext,\n RangeCalendarPrev,\n RangeCalendarRoot,\n} from 'reka-ui'\nimport { computed, ref } from 'vue'\nimport type { DatePreset, FilterOp } from '../../types/query'\nimport { useDataTableContext } from '../plugin'\n\nconst props = defineProps<{ op: FilterOp; modelValue: unknown }>()\nconst emit = defineEmits<{ 'update:modelValue': [value: unknown]; done: [] }>()\nconst { i18n, locale } = useDataTableContext()\n\nconst PRESETS: DatePreset[] = [\n 'today',\n 'this_week',\n 'next_7_days',\n 'this_month',\n 'last_30_days',\n 'this_quarter',\n 'overdue',\n]\nconst tz = getLocalTimeZone()\nconst now = today(tz)\nconst weekStartsOn = getDayOfWeek(startOfWeek(now, locale), 'en-US') as 0 | 1 | 2 | 3 | 4 | 5 | 6\nconst isRange = computed(() => props.op === 'within')\nconst obj = (v: unknown): Record<string, unknown> | null =>\n v && typeof v === 'object' ? (v as Record<string, unknown>) : null\nconst preset = computed(() => obj(props.modelValue)?.preset as string | undefined)\nconst custom = ref(false)\n\nconst safe = (s: unknown): DateValue | undefined => {\n try {\n return typeof s === 'string' && s ? parseDate(s.slice(0, 10)) : undefined\n } catch {\n return undefined\n }\n}\nconst rangeValue = computed(() => {\n const o = obj(props.modelValue)\n return { start: safe(o?.from), end: safe(o?.to) }\n})\nconst single = computed(() => safe(props.modelValue))\n\nconst pickPreset = (p: DatePreset) => {\n custom.value = false\n emit('update:modelValue', { preset: p })\n emit('done')\n}\nconst onRange = (r: { start: DateValue | undefined; end: DateValue | undefined } | null) => {\n if (!r?.start || !r.end) return\n emit('update:modelValue', { from: r.start.toString(), to: r.end.toString() })\n emit('done')\n}\nconst onSingle = (d: DateValue | undefined) => {\n if (!d) return\n emit('update:modelValue', d.toString())\n emit('done')\n}\nconst pickToday = () => {\n emit('update:modelValue', { preset: 'today' })\n emit('done')\n}\n</script>\n\n<template>\n <div class=\"dt-editor-date\">\n <div class=\"dt-date-presets\">\n <template v-if=\"isRange\">\n <button\n v-for=\"p in PRESETS\"\n :key=\"p\"\n type=\"button\"\n class=\"dt-pop-item dt-date-preset\"\n :class=\"{ 'is-on': preset === p }\"\n @click=\"pickPreset(p)\"\n >\n {{ i18n.t(`date.${p}`) }}\n <PhCheck v-if=\"preset === p\" :size=\"14\" class=\"dt-pop-end\" aria-hidden=\"true\" />\n </button>\n <div class=\"dt-pop-sep\" />\n <button\n type=\"button\"\n class=\"dt-pop-item dt-date-preset\"\n :class=\"{ 'is-on': custom || (!preset && rangeValue.start) }\"\n @click=\"custom = true\"\n >\n {{ i18n.t('date.customRange') }}\n </button>\n </template>\n <template v-else>\n <button\n type=\"button\"\n class=\"dt-pop-item dt-date-preset\"\n :class=\"{ 'is-on': preset === 'today' }\"\n @click=\"pickToday\"\n >\n {{ i18n.t('date.today') }}\n <PhCheck v-if=\"preset === 'today'\" :size=\"14\" class=\"dt-pop-end\" aria-hidden=\"true\" />\n </button>\n </template>\n </div>\n <RangeCalendarRoot\n v-if=\"isRange\"\n v-slot=\"{ weekDays, grid }\"\n class=\"dt-calendar\"\n :model-value=\"rangeValue.start && rangeValue.end ? { start: rangeValue.start, end: rangeValue.end } : undefined\"\n :locale=\"locale\"\n :week-starts-on=\"weekStartsOn\"\n :placeholder=\"rangeValue.start ?? now\"\n @update:model-value=\"onRange\"\n >\n <RangeCalendarHeader class=\"dt-cal-head\">\n <RangeCalendarPrev class=\"dt-icon-btn-sm\"><PhCaretLeft :size=\"16\" aria-hidden=\"true\" /></RangeCalendarPrev>\n <RangeCalendarHeading class=\"dt-cal-title\" />\n <RangeCalendarNext class=\"dt-icon-btn-sm\"><PhCaretRight :size=\"16\" aria-hidden=\"true\" /></RangeCalendarNext>\n </RangeCalendarHeader>\n <RangeCalendarGrid v-for=\"month in grid\" :key=\"month.value.toString()\" class=\"dt-cal-grid\">\n <RangeCalendarGridHead>\n <RangeCalendarGridRow>\n <RangeCalendarHeadCell v-for=\"day in weekDays\" :key=\"day\" class=\"dt-cal-dow\">\n {{ day }}\n </RangeCalendarHeadCell>\n </RangeCalendarGridRow>\n </RangeCalendarGridHead>\n <RangeCalendarGridBody>\n <RangeCalendarGridRow v-for=\"(week, i) in month.rows\" :key=\"i\">\n <RangeCalendarCell v-for=\"d in week\" :key=\"d.toString()\" :date=\"d\" class=\"dt-cal-cell\">\n <RangeCalendarCellTrigger :day=\"d\" :month=\"month.value\" class=\"dt-cal-day\" />\n </RangeCalendarCell>\n </RangeCalendarGridRow>\n </RangeCalendarGridBody>\n </RangeCalendarGrid>\n </RangeCalendarRoot>\n <CalendarRoot\n v-else\n v-slot=\"{ weekDays, grid }\"\n class=\"dt-calendar\"\n :model-value=\"single\"\n :locale=\"locale\"\n :week-starts-on=\"weekStartsOn\"\n :placeholder=\"single ?? now\"\n @update:model-value=\"(d) => onSingle(d as DateValue | undefined)\"\n >\n <CalendarHeader class=\"dt-cal-head\">\n <CalendarPrev class=\"dt-icon-btn-sm\"><PhCaretLeft :size=\"16\" aria-hidden=\"true\" /></CalendarPrev>\n <CalendarHeading class=\"dt-cal-title\" />\n <CalendarNext class=\"dt-icon-btn-sm\"><PhCaretRight :size=\"16\" aria-hidden=\"true\" /></CalendarNext>\n </CalendarHeader>\n <CalendarGrid v-for=\"month in grid\" :key=\"month.value.toString()\" class=\"dt-cal-grid\">\n <CalendarGridHead>\n <CalendarGridRow>\n <CalendarHeadCell v-for=\"day in weekDays\" :key=\"day\" class=\"dt-cal-dow\">{{ day }}</CalendarHeadCell>\n </CalendarGridRow>\n </CalendarGridHead>\n <CalendarGridBody>\n <CalendarGridRow v-for=\"(week, i) in month.rows\" :key=\"i\">\n <CalendarCell v-for=\"d in week\" :key=\"d.toString()\" :date=\"d\" class=\"dt-cal-cell\">\n <CalendarCellTrigger :day=\"d\" :month=\"month.value\" class=\"dt-cal-day\" />\n </CalendarCell>\n </CalendarGridRow>\n </CalendarGridBody>\n </CalendarGrid>\n </CalendarRoot>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;EAm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D;QAAI,OAAO2B,EAAM;QAAO,OAAM"}
@@ -0,0 +1,284 @@
1
+ import { D as e, E as t, M as n, O as r, T as ee, W as te, X as i, j as ne } from "./query-CGNWUi2E.js";
2
+ import { a as re, i as ie, n as ae, r as oe, t as se } from "./TextEditor-CHLM6u-l.js";
3
+ import { t as ce } from "./Layer-Di-tPd8b.js";
4
+ import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createSlots as le, createTextVNode as d, createVNode as f, defineAsyncComponent as ue, defineComponent as p, openBlock as m, ref as h, renderList as g, resolveDynamicComponent as de, toDisplayString as _, unref as v, vModelText as fe, withCtx as y, withDirectives as pe } from "vue";
5
+ import { PhArrowDown as me, PhArrowUp as he, PhCaretDown as b, PhCaretLeft as ge, PhCaretRight as _e, PhMagnifyingGlass as ve, PhPlus as ye, PhX as be } from "@phosphor-icons/vue";
6
+ import { ToggleGroupItem as x, ToggleGroupRoot as xe } from "reka-ui";
7
+ //#region src/core/filters/FiltersSheet.vue?vue&type=script&setup=true&lang.ts
8
+ var Se = ["aria-label"], Ce = ["disabled"], we = ["onClick"], Te = { class: "dt-bsheet-field" }, S = { class: "dt-bsheet-value is-strong" }, C = ["aria-label", "onClick"], w = { class: "dt-bsheet-label" }, T = ["onClick"], E = { class: "dt-bsheet-field" }, D = { class: "dt-bsheet-value" }, O = { class: "dt-bsheet-label" }, Ee = { class: "dt-bsheet-row is-sort" }, k = { class: "dt-select dt-bsheet-select" }, De = ["value", "aria-label"], Oe = { value: "" }, ke = ["value"], Ae = { class: "dt-input has-icon dt-bsheet-search" }, je = { class: "dt-input-icon" }, Me = ["placeholder", "aria-label"], Ne = ["onClick"], Pe = {
9
+ key: 0,
10
+ class: "dt-options-empty"
11
+ }, Fe = {
12
+ key: 2,
13
+ class: "dt-bsheet-editor"
14
+ }, Ie = { class: "dt-select dt-bsheet-select" }, Le = ["value", "aria-label"], Re = ["value"], A = /* @__PURE__ */ p({
15
+ __name: "FiltersSheet",
16
+ props: {
17
+ columns: {},
18
+ chips: {},
19
+ sort: {},
20
+ rows: {},
21
+ labels: {},
22
+ summaryOf: { type: Function },
23
+ currenciesOf: { type: Function }
24
+ },
25
+ emits: ["apply"],
26
+ setup(p, { expose: A, emit: ze }) {
27
+ let Be = ue(() => import("./DateEditor-C2zzyoPQ.js")), j = p, Ve = ze, { i18n: M } = te(), N = h(!1), P = h([]), F = h(null), I = h("main"), L = h(null), R = h(""), z = (e) => j.columns.find((t) => t.id === e), B = (e) => z(e)?.header ?? e, V = o(() => j.columns.filter((e) => e.filterable ?? i[e.type].filterable)), He = o(() => j.columns.filter((e) => e.sortable ?? i[e.type].sortable)), H = (e) => P.value.some((t) => t.column === e), U = o(() => V.value.filter((e) => e.suggested && !H(e.id))), W = o(() => V.value.filter((e) => !H(e.id) && (!R.value || e.header.toLocaleLowerCase().includes(R.value.toLocaleLowerCase()))));
28
+ A({ show: (e) => {
29
+ P.value = j.chips.map((e) => ({ ...e })), F.value = j.sort[0] ?? null, I.value = "main", L.value = null, R.value = "", N.value = !0, e && G(e);
30
+ } });
31
+ let G = (e) => {
32
+ let n = z(e);
33
+ if (!n) return;
34
+ let r = P.value.find((t) => t.column === e);
35
+ n.type === "boolean" ? P.value = r ? P.value.map((e) => e === r ? {
36
+ ...e,
37
+ value: e.value !== !0
38
+ } : e) : [...P.value, {
39
+ column: e,
40
+ op: t(n),
41
+ value: !0
42
+ }] : (r || (P.value = [...P.value, {
43
+ column: e,
44
+ op: t(n)
45
+ }]), L.value = e, I.value = "editor");
46
+ }, K = o(() => P.value.find((e) => e.column === L.value) ?? null), q = o(() => L.value ? z(L.value) : void 0), J = o(() => K.value && q.value ? e(K.value.op, q.value.type) : null), Ue = o(() => q.value ? n(q.value) : []), We = o(() => Array.isArray(K.value?.value) ? K.value.value.length : 1), Y = (e) => P.value = P.value.map((t) => t.column === L.value ? {
47
+ ...t,
48
+ ...e
49
+ } : t), X = (e) => {
50
+ let t = q.value;
51
+ Y({
52
+ value: e,
53
+ currency: t.type === "currency" ? K.value?.currency ?? j.currenciesOf(t)[0] : K.value?.currency
54
+ });
55
+ }, Z = (e) => P.value = P.value.map((t) => t.column === L.value ? ee(t, e, q.value.type) : t), Ge = () => Z(K.value?.op === "is_empty" ? "in" : "is_empty"), Q = (e) => P.value = P.value.filter((t) => t.column !== e), $ = () => {
56
+ let e = K.value;
57
+ e && q.value && !r(e, q.value.type) && Q(e.column), L.value = null, I.value = "main";
58
+ }, Ke = (e) => F.value = e ? {
59
+ column: e,
60
+ dir: F.value?.dir ?? "asc"
61
+ } : null, qe = (e) => {
62
+ (e === "asc" || e === "desc") && F.value && (F.value = {
63
+ ...F.value,
64
+ dir: e
65
+ });
66
+ }, Je = () => {
67
+ Ve("apply", P.value.filter((e) => r(e, z(e.column).type)), F.value ? [F.value] : []), N.value = !1;
68
+ }, Ye = o(() => I.value === "main" ? M.t("mobile.filters") : I.value === "picker" ? M.t("filter.addFilter") : q.value?.header ?? "");
69
+ return (e, t) => (m(), s(ce, {
70
+ open: N.value,
71
+ "onUpdate:open": t[7] ||= (e) => N.value = e,
72
+ sheet: "",
73
+ "content-class": "dt-filters-sheet",
74
+ title: Ye.value
75
+ }, le({
76
+ "head-end": y(() => [I.value === "main" ? (m(), l("button", {
77
+ key: 0,
78
+ type: "button",
79
+ class: "dt-bsheet-action",
80
+ onClick: t[0] ||= (e) => P.value = []
81
+ }, _(v(M).t("filter.clearAll")), 1)) : I.value === "editor" ? (m(), l("button", {
82
+ key: 1,
83
+ type: "button",
84
+ class: "dt-bsheet-action",
85
+ disabled: K.value?.value === void 0,
86
+ onClick: t[1] ||= (e) => Y({ value: void 0 })
87
+ }, _(v(M).t("common.clear")), 9, Ce)) : c("", !0)]),
88
+ foot: y(() => [I.value === "editor" ? (m(), l("button", {
89
+ key: 0,
90
+ type: "button",
91
+ class: "dt-bsheet-primary",
92
+ onClick: $
93
+ }, _(v(M).t("common.done")), 1)) : (m(), l("button", {
94
+ key: 1,
95
+ type: "button",
96
+ class: "dt-bsheet-primary",
97
+ onClick: Je
98
+ }, _(v(M).t("mobile.showResults")), 1))]),
99
+ default: y(() => [I.value === "main" ? (m(), l(a, { key: 0 }, [
100
+ (m(!0), l(a, null, g(P.value, (e) => (m(), l("div", {
101
+ key: e.column,
102
+ class: "dt-bsheet-row is-split"
103
+ }, [u("button", {
104
+ type: "button",
105
+ class: "dt-bsheet-row-main",
106
+ onClick: (t) => G(e.column)
107
+ }, [u("span", Te, _(B(e.column)), 1), u("span", S, _(p.summaryOf(e).text), 1)], 8, we), u("button", {
108
+ type: "button",
109
+ class: "dt-bsheet-x",
110
+ "aria-label": v(M).t("filter.removeAria", { column: B(e.column) }),
111
+ onClick: (t) => Q(e.column)
112
+ }, [f(v(be), {
113
+ size: 16,
114
+ "aria-hidden": "true"
115
+ })], 8, C)]))), 128)),
116
+ U.value.length ? (m(), l(a, { key: 0 }, [u("div", w, _(v(M).t("picker.suggested")), 1), (m(!0), l(a, null, g(U.value, (e) => (m(), l("button", {
117
+ key: e.id,
118
+ type: "button",
119
+ class: "dt-bsheet-row",
120
+ onClick: (t) => G(e.id)
121
+ }, [
122
+ u("span", E, _(e.header), 1),
123
+ u("span", D, _(v(M).t("common.any")), 1),
124
+ f(v(_e), {
125
+ size: 16,
126
+ "aria-hidden": "true"
127
+ })
128
+ ], 8, T))), 128))], 64)) : c("", !0),
129
+ u("button", {
130
+ type: "button",
131
+ class: "dt-bsheet-row is-accent",
132
+ onClick: t[2] ||= (e) => I.value = "picker"
133
+ }, [f(v(ye), {
134
+ size: 18,
135
+ "aria-hidden": "true"
136
+ }), d(" " + _(v(M).t("filter.addFilter")), 1)]),
137
+ t[8] ||= u("div", { class: "dt-bsheet-sep" }, null, -1),
138
+ u("div", O, _(v(M).t("mobile.sort")), 1),
139
+ u("div", Ee, [u("label", k, [u("select", {
140
+ value: F.value?.column ?? "",
141
+ "aria-label": v(M).t("mobile.sort"),
142
+ onChange: t[3] ||= (e) => Ke(e.target.value)
143
+ }, [u("option", Oe, _(v(M).t("common.empty")), 1), (m(!0), l(a, null, g(He.value, (e) => (m(), l("option", {
144
+ key: e.id,
145
+ value: e.id
146
+ }, _(e.header), 9, ke))), 128))], 40, De), f(v(b), {
147
+ size: 14,
148
+ "aria-hidden": "true"
149
+ })]), f(v(xe), {
150
+ class: "dt-seg dt-bsheet-dir",
151
+ type: "single",
152
+ "model-value": F.value?.dir ?? "",
153
+ disabled: !F.value,
154
+ "onUpdate:modelValue": qe
155
+ }, {
156
+ default: y(() => [f(v(x), {
157
+ class: "dt-seg-item",
158
+ value: "asc",
159
+ "aria-label": v(M).t("header.sortAsc")
160
+ }, {
161
+ default: y(() => [f(v(he), {
162
+ size: 16,
163
+ "aria-hidden": "true"
164
+ })]),
165
+ _: 1
166
+ }, 8, ["aria-label"]), f(v(x), {
167
+ class: "dt-seg-item",
168
+ value: "desc",
169
+ "aria-label": v(M).t("header.sortDesc")
170
+ }, {
171
+ default: y(() => [f(v(me), {
172
+ size: 16,
173
+ "aria-hidden": "true"
174
+ })]),
175
+ _: 1
176
+ }, 8, ["aria-label"])]),
177
+ _: 1
178
+ }, 8, ["model-value", "disabled"])])
179
+ ], 64)) : I.value === "picker" ? (m(), l(a, { key: 1 }, [
180
+ u("label", Ae, [u("span", je, [f(v(ve), {
181
+ size: 16,
182
+ "aria-hidden": "true"
183
+ })]), pe(u("input", {
184
+ "onUpdate:modelValue": t[4] ||= (e) => R.value = e,
185
+ type: "search",
186
+ placeholder: v(M).t("picker.search"),
187
+ "aria-label": v(M).t("picker.search")
188
+ }, null, 8, Me), [[fe, R.value]])]),
189
+ (m(!0), l(a, null, g(W.value, (e) => (m(), l("button", {
190
+ key: e.id,
191
+ type: "button",
192
+ class: "dt-bsheet-row",
193
+ onClick: (t) => G(e.id)
194
+ }, [(m(), s(de(v(re)[e.type]), {
195
+ size: 16,
196
+ class: "dt-bsheet-icon",
197
+ "aria-hidden": "true"
198
+ })), d(" " + _(e.header), 1)], 8, Ne))), 128)),
199
+ W.value.length ? c("", !0) : (m(), l("div", Pe, _(v(M).t("picker.noMatch")), 1))
200
+ ], 64)) : K.value && q.value ? (m(), l("div", Fe, [u("label", Ie, [u("select", {
201
+ value: K.value.op,
202
+ "aria-label": v(M).t("mobile.operator"),
203
+ onChange: t[5] ||= (e) => Z(e.target.value)
204
+ }, [(m(!0), l(a, null, g(Ue.value, (e) => (m(), l("option", {
205
+ key: e,
206
+ value: e
207
+ }, _(v(ne)(v(M), e, q.value.type, We.value)), 9, Re))), 128))], 40, Le), f(v(b), {
208
+ size: 14,
209
+ "aria-hidden": "true"
210
+ })]), J.value === "options" ? (m(), s(oe, {
211
+ key: 0,
212
+ column: q.value,
213
+ op: K.value.op,
214
+ "model-value": Array.isArray(K.value.value) ? K.value.value : [],
215
+ rows: p.rows,
216
+ labels: p.labels,
217
+ "onUpdate:modelValue": X,
218
+ onUnassigned: Ge
219
+ }, null, 8, [
220
+ "column",
221
+ "op",
222
+ "model-value",
223
+ "rows",
224
+ "labels"
225
+ ])) : J.value === "text" ? (m(), s(se, {
226
+ key: 1,
227
+ column: q.value,
228
+ op: K.value.op,
229
+ "model-value": K.value.value,
230
+ "onUpdate:modelValue": X,
231
+ onDone: $
232
+ }, null, 8, [
233
+ "column",
234
+ "op",
235
+ "model-value"
236
+ ])) : J.value === "number" ? (m(), s(ie, {
237
+ key: 2,
238
+ column: q.value,
239
+ op: K.value.op,
240
+ "model-value": K.value.value,
241
+ currency: K.value.currency,
242
+ currencies: p.currenciesOf(q.value),
243
+ "onUpdate:modelValue": X,
244
+ "onUpdate:currency": t[6] ||= (e) => Y({ currency: e }),
245
+ onDone: $
246
+ }, null, 8, [
247
+ "column",
248
+ "op",
249
+ "model-value",
250
+ "currency",
251
+ "currencies"
252
+ ])) : J.value === "star" ? (m(), s(ae, {
253
+ key: 3,
254
+ column: q.value,
255
+ "model-value": K.value.value,
256
+ "onUpdate:modelValue": X,
257
+ onDone: $
258
+ }, null, 8, ["column", "model-value"])) : J.value === "date" ? (m(), s(v(Be), {
259
+ key: 4,
260
+ op: K.value.op,
261
+ "model-value": K.value.value,
262
+ "onUpdate:modelValue": X,
263
+ onDone: $
264
+ }, null, 8, ["op", "model-value"])) : c("", !0)])) : c("", !0)]),
265
+ _: 2
266
+ }, [I.value === "main" ? void 0 : {
267
+ name: "head-start",
268
+ fn: y(() => [u("button", {
269
+ type: "button",
270
+ class: "dt-bsheet-back",
271
+ "aria-label": v(M).t("mobile.backToFilters"),
272
+ onClick: $
273
+ }, [f(v(ge), {
274
+ size: 20,
275
+ "aria-hidden": "true"
276
+ })], 8, Se)]),
277
+ key: "0"
278
+ }]), 1032, ["open", "title"]));
279
+ }
280
+ });
281
+ //#endregion
282
+ export { A as default };
283
+
284
+ //# sourceMappingURL=FiltersSheet-C3zOlbkN.js.map