@medyat/react-data-table 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +206 -2
- package/dist/bottom-sheet-NHUT908D.js +1123 -0
- package/dist/bottom-sheet-NHUT908D.js.map +1 -0
- package/dist/columns-dialog-COcldc3X.js +419 -0
- package/dist/columns-dialog-COcldc3X.js.map +1 -0
- package/dist/date-editor-CJFd5YEo.js +378 -0
- package/dist/date-editor-CJFd5YEo.js.map +1 -0
- package/dist/filters-sheet-CWzMaMFo.js +298 -0
- package/dist/filters-sheet-CWzMaMFo.js.map +1 -0
- package/dist/index.d.ts +736 -0
- package/dist/index.js +4769 -0
- package/dist/index.js.map +1 -0
- package/dist/model-RkRyfM7C.js +288 -0
- package/dist/model-RkRyfM7C.js.map +1 -0
- package/dist/provider-CTTHEpE3.js +884 -0
- package/dist/provider-CTTHEpE3.js.map +1 -0
- package/dist/shadcn-bridge-hsl.css +24 -0
- package/dist/shadcn-bridge.css +25 -0
- package/dist/style.css +2 -0
- package/dist/switch-B8TN4kJ-.js +23 -0
- package/dist/switch-B8TN4kJ-.js.map +1 -0
- package/docs/backend-integration.md +596 -0
- package/package.json +95 -4
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
// src/core/filters/model.ts
|
|
2
|
+
var e = ["is_empty", "is_not_empty"], t = [
|
|
3
|
+
"eq",
|
|
4
|
+
"neq",
|
|
5
|
+
"gt",
|
|
6
|
+
"gte",
|
|
7
|
+
"lt",
|
|
8
|
+
"lte",
|
|
9
|
+
"between",
|
|
10
|
+
...e
|
|
11
|
+
], n = [
|
|
12
|
+
"contains",
|
|
13
|
+
"not_contains",
|
|
14
|
+
"eq",
|
|
15
|
+
"neq",
|
|
16
|
+
"starts_with",
|
|
17
|
+
"ends_with",
|
|
18
|
+
...e
|
|
19
|
+
], r = [
|
|
20
|
+
"in",
|
|
21
|
+
"not_in",
|
|
22
|
+
...e
|
|
23
|
+
], i = [
|
|
24
|
+
"within",
|
|
25
|
+
"eq",
|
|
26
|
+
"before",
|
|
27
|
+
"after",
|
|
28
|
+
...e
|
|
29
|
+
], a = [
|
|
30
|
+
"contains",
|
|
31
|
+
"eq",
|
|
32
|
+
"neq",
|
|
33
|
+
"starts_with",
|
|
34
|
+
...e
|
|
35
|
+
], o = {
|
|
36
|
+
int: t,
|
|
37
|
+
float: t,
|
|
38
|
+
percentage: [
|
|
39
|
+
"eq",
|
|
40
|
+
"gt",
|
|
41
|
+
"gte",
|
|
42
|
+
"lt",
|
|
43
|
+
"lte",
|
|
44
|
+
"between",
|
|
45
|
+
...e
|
|
46
|
+
],
|
|
47
|
+
star: [
|
|
48
|
+
"gte",
|
|
49
|
+
"lte",
|
|
50
|
+
"eq",
|
|
51
|
+
...e
|
|
52
|
+
],
|
|
53
|
+
currency: t,
|
|
54
|
+
string: n,
|
|
55
|
+
text: [
|
|
56
|
+
"contains",
|
|
57
|
+
"not_contains",
|
|
58
|
+
...e
|
|
59
|
+
],
|
|
60
|
+
uppercase: a,
|
|
61
|
+
lowercase: a,
|
|
62
|
+
phone: [
|
|
63
|
+
"contains",
|
|
64
|
+
"starts_with",
|
|
65
|
+
...e
|
|
66
|
+
],
|
|
67
|
+
color: r,
|
|
68
|
+
email: [
|
|
69
|
+
"contains",
|
|
70
|
+
"eq",
|
|
71
|
+
"ends_with",
|
|
72
|
+
...e
|
|
73
|
+
],
|
|
74
|
+
url: ["contains", ...e],
|
|
75
|
+
id: [
|
|
76
|
+
"in",
|
|
77
|
+
"contains",
|
|
78
|
+
...e
|
|
79
|
+
],
|
|
80
|
+
boolean: ["eq", ...e],
|
|
81
|
+
select: r,
|
|
82
|
+
multiselect: r,
|
|
83
|
+
ajax: r,
|
|
84
|
+
user: r,
|
|
85
|
+
date: i,
|
|
86
|
+
datetime: i,
|
|
87
|
+
object: [],
|
|
88
|
+
array: ["contains", ...e]
|
|
89
|
+
}, s = {
|
|
90
|
+
int: "between",
|
|
91
|
+
float: "between",
|
|
92
|
+
percentage: "between",
|
|
93
|
+
currency: "between",
|
|
94
|
+
star: "gte",
|
|
95
|
+
id: "contains",
|
|
96
|
+
boolean: "eq",
|
|
97
|
+
date: "within",
|
|
98
|
+
datetime: "within"
|
|
99
|
+
}, c = (e) => e.filter?.operators ?? o[e.type], l = (e) => e.filter?.defaultOperator ?? s[e.type] ?? c(e)[0] ?? "is_empty";
|
|
100
|
+
function u(e, t) {
|
|
101
|
+
return e === "is_empty" || e === "is_not_empty" ? "none" : e === "in" || e === "not_in" ? "list" : e === "between" ? "range" : e === "within" ? "dateRange" : e === "before" || e === "after" || t === "date" || t === "datetime" ? "date" : t === "boolean" ? "boolean" : e === "gt" || e === "gte" || e === "lt" || e === "lte" || t === "int" || t === "float" || t === "percentage" || t === "currency" || t === "star" ? "number" : "text";
|
|
102
|
+
}
|
|
103
|
+
function d(e, t) {
|
|
104
|
+
let n = u(e, t);
|
|
105
|
+
return n === "none" || n === "boolean" ? null : n === "list" ? t === "id" ? "text" : "options" : n === "text" ? "text" : n === "date" || n === "dateRange" ? "date" : t === "star" ? "star" : "number";
|
|
106
|
+
}
|
|
107
|
+
var f = (e) => !!e && typeof e == "object";
|
|
108
|
+
function p(e, t) {
|
|
109
|
+
let n = e.value;
|
|
110
|
+
switch (u(e.op, t)) {
|
|
111
|
+
case "none": return !0;
|
|
112
|
+
case "list": return Array.isArray(n) && n.length > 0;
|
|
113
|
+
case "range": return Array.isArray(n) && (n[0] !== null && n[0] !== void 0 || n[1] !== null && n[1] !== void 0);
|
|
114
|
+
case "text": return typeof n == "string" && n !== "";
|
|
115
|
+
case "number": return typeof n == "number" && Number.isFinite(n);
|
|
116
|
+
case "boolean": return typeof n == "boolean";
|
|
117
|
+
case "date": return typeof n == "string" && n !== "" || f(n) && n.preset === "today";
|
|
118
|
+
case "dateRange": return f(n) && (typeof n.preset == "string" || typeof n.from == "string" && typeof n.to == "string");
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function m(e) {
|
|
122
|
+
let t = {
|
|
123
|
+
column: e.column,
|
|
124
|
+
op: e.op
|
|
125
|
+
};
|
|
126
|
+
return e.value !== void 0 && u(e.op, "string") !== "none" && (t.value = e.value), e.currency && (t.currency = e.currency), t;
|
|
127
|
+
}
|
|
128
|
+
function h(e, t, n) {
|
|
129
|
+
let r = u(t, n), i = r !== "none" && r === u(e.op, n);
|
|
130
|
+
return {
|
|
131
|
+
...e,
|
|
132
|
+
op: t,
|
|
133
|
+
value: i ? e.value : void 0
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
function g(e, t, n, r = 1) {
|
|
137
|
+
return t === "in" || t === "not_in" ? e.t(`op.${t}`, { count: Math.max(1, r) }) : n === "star" && (t === "gte" || t === "lte") ? e.t(`op.star.${t}`) : e.t(`op.${t}`);
|
|
138
|
+
}
|
|
139
|
+
var _ = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, v = (e, t) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + t), y = (e) => {
|
|
140
|
+
try {
|
|
141
|
+
let t = new Intl.Locale(e);
|
|
142
|
+
return t.getWeekInfo?.().firstDay ?? t.weekInfo?.firstDay ?? 1;
|
|
143
|
+
} catch {
|
|
144
|
+
return 1;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
function b(e, t, n = /* @__PURE__ */ new Date()) {
|
|
148
|
+
let r = new Date(n.getFullYear(), n.getMonth(), n.getDate());
|
|
149
|
+
switch (e) {
|
|
150
|
+
case "today": return {
|
|
151
|
+
from: _(r),
|
|
152
|
+
to: _(r)
|
|
153
|
+
};
|
|
154
|
+
case "this_week": {
|
|
155
|
+
let e = v(r, -((r.getDay() - y(t) % 7 + 7) % 7));
|
|
156
|
+
return {
|
|
157
|
+
from: _(e),
|
|
158
|
+
to: _(v(e, 6))
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
case "next_7_days": return {
|
|
162
|
+
from: _(r),
|
|
163
|
+
to: _(v(r, 7))
|
|
164
|
+
};
|
|
165
|
+
case "this_month": return {
|
|
166
|
+
from: _(new Date(r.getFullYear(), r.getMonth(), 1)),
|
|
167
|
+
to: _(new Date(r.getFullYear(), r.getMonth() + 1, 0))
|
|
168
|
+
};
|
|
169
|
+
case "last_30_days": return {
|
|
170
|
+
from: _(v(r, -30)),
|
|
171
|
+
to: _(r)
|
|
172
|
+
};
|
|
173
|
+
case "this_quarter": {
|
|
174
|
+
let e = Math.floor(r.getMonth() / 3) * 3;
|
|
175
|
+
return {
|
|
176
|
+
from: _(new Date(r.getFullYear(), e, 1)),
|
|
177
|
+
to: _(new Date(r.getFullYear(), e + 3, 0))
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
case "overdue": return {
|
|
181
|
+
from: null,
|
|
182
|
+
to: _(v(r, -1))
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
var x = (e) => e instanceof Date ? _(e) : typeof e == "string" && e.length >= 10 ? e.slice(0, 10) : null, S = (e, t) => typeof e == "string" ? e.slice(0, 10) : _(t), C = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0, w = (e, t) => String(e).toLocaleLowerCase(t);
|
|
187
|
+
function T(e, t, n) {
|
|
188
|
+
let r = n.now ?? /* @__PURE__ */ new Date();
|
|
189
|
+
switch (e.op) {
|
|
190
|
+
case "is_empty": return C(t);
|
|
191
|
+
case "is_not_empty": return !C(t);
|
|
192
|
+
}
|
|
193
|
+
if (C(t)) return !1;
|
|
194
|
+
switch (e.op) {
|
|
195
|
+
case "eq":
|
|
196
|
+
case "neq": {
|
|
197
|
+
let r = x(t), i = typeof e.value == "string" && r && /^\d{4}-\d{2}-\d{2}/.test(e.value) ? r === e.value.slice(0, 10) : typeof t == "string" && typeof e.value == "string" ? w(t, n.locale) === w(e.value, n.locale) : t === e.value || String(t) === String(e.value);
|
|
198
|
+
return e.op === "eq" ? i : !i;
|
|
199
|
+
}
|
|
200
|
+
case "gt": return Number(t) > e.value;
|
|
201
|
+
case "gte": return Number(t) >= e.value;
|
|
202
|
+
case "lt": return Number(t) < e.value;
|
|
203
|
+
case "lte": return Number(t) <= e.value;
|
|
204
|
+
case "between": {
|
|
205
|
+
let n = Number(t), [r, i] = e.value;
|
|
206
|
+
return (r === null || n >= r) && (i === null || n <= i);
|
|
207
|
+
}
|
|
208
|
+
case "contains":
|
|
209
|
+
case "not_contains":
|
|
210
|
+
case "starts_with":
|
|
211
|
+
case "ends_with": {
|
|
212
|
+
let r = w(e.value, n.locale), i = (Array.isArray(t) ? t : [t]).some((t) => {
|
|
213
|
+
let i = w(t, n.locale);
|
|
214
|
+
return e.op === "starts_with" ? i.startsWith(r) : e.op === "ends_with" ? i.endsWith(r) : i.includes(r);
|
|
215
|
+
});
|
|
216
|
+
return e.op === "not_contains" ? !i : i;
|
|
217
|
+
}
|
|
218
|
+
case "in":
|
|
219
|
+
case "not_in": {
|
|
220
|
+
let n = new Set(e.value.map(String)), r = (Array.isArray(t) ? t : [t]).some((e) => n.has(String(e)));
|
|
221
|
+
return e.op === "in" ? r : !r;
|
|
222
|
+
}
|
|
223
|
+
case "before": return (x(t) ?? "") < S(e.value, r);
|
|
224
|
+
case "after": return (x(t) ?? "") > S(e.value, r);
|
|
225
|
+
case "within": {
|
|
226
|
+
let i = x(t);
|
|
227
|
+
if (!i) return !1;
|
|
228
|
+
let a = "preset" in e.value ? b(e.value.preset, n.locale, r) : e.value;
|
|
229
|
+
return (a.from === null || i >= a.from) && (a.to === null || i <= a.to);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
var E = (e, t) => Math.abs(t) >= 1e3 ? e.compact(t) : e.decimal(t, Number.isInteger(t) ? 0 : 2);
|
|
234
|
+
function D(e, t, n) {
|
|
235
|
+
let { i18n: r, fmt: i } = n, a = t.type, o = e.value, s = a === "percentage" ? "%" : e.currency ? ` ${e.currency}` : "", c = (e) => `${E(i, e)}${s}`;
|
|
236
|
+
switch (u(e.op, a)) {
|
|
237
|
+
case "none": return { text: "" };
|
|
238
|
+
case "boolean": return { text: r.t(o ? "common.yes" : "common.no") };
|
|
239
|
+
case "number": return { text: typeof o == "number" ? c(o) : "" };
|
|
240
|
+
case "text": return typeof o == "string" && o ? {
|
|
241
|
+
text: `“${o}”`,
|
|
242
|
+
full: o
|
|
243
|
+
} : { text: "" };
|
|
244
|
+
case "range": {
|
|
245
|
+
if (!Array.isArray(o)) return { text: "" };
|
|
246
|
+
let [e, t] = o;
|
|
247
|
+
return e != null && t != null ? { text: `${E(i, e)} – ${c(t)}` } : e == null ? t == null ? { text: "" } : { text: `≤ ${c(t)}` } : { text: `≥ ${c(e)}` };
|
|
248
|
+
}
|
|
249
|
+
case "date": return typeof o == "string" && o ? { text: i.date(o, n.today) } : f(o) && o.preset === "today" ? { text: r.t("date.today") } : { text: "" };
|
|
250
|
+
case "dateRange": {
|
|
251
|
+
if (!f(o)) return { text: "" };
|
|
252
|
+
if (typeof o.preset == "string") return { text: r.t(`date.${o.preset}`) };
|
|
253
|
+
let e = String(o.from), t = String(o.to), a = e.slice(0, 7) === t.slice(0, 7) ? String(Number(t.slice(8, 10))) : i.date(t, n.today);
|
|
254
|
+
return { text: `${i.date(e, n.today)} – ${a}` };
|
|
255
|
+
}
|
|
256
|
+
case "list": {
|
|
257
|
+
let e = Array.isArray(o) ? o : [];
|
|
258
|
+
if (e.length === 0) return { text: "" };
|
|
259
|
+
let i = e.map((e) => e === "@me" ? r.t("common.me") : n.labelOf(e));
|
|
260
|
+
if (a === "user") {
|
|
261
|
+
let t = e.map((e, t) => ({
|
|
262
|
+
value: e,
|
|
263
|
+
label: i[t]
|
|
264
|
+
}));
|
|
265
|
+
return {
|
|
266
|
+
text: e.length === 1 ? i[0] : r.t("chip.people", { count: e.length }),
|
|
267
|
+
full: i.join(", "),
|
|
268
|
+
people: t
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
if (e.length <= 2) return {
|
|
272
|
+
text: i.join(", "),
|
|
273
|
+
full: i.join(", ")
|
|
274
|
+
};
|
|
275
|
+
let s = t.filterNoun;
|
|
276
|
+
return {
|
|
277
|
+
text: s ? r.t("chip.noun", {
|
|
278
|
+
count: e.length,
|
|
279
|
+
noun: s
|
|
280
|
+
}) : r.t("chip.values", { count: e.length }),
|
|
281
|
+
full: i.join(", ")
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
export { _ as a, c, D as d, m as f, p as i, b as l, l as n, T as o, y as p, d as r, g as s, h as t, u };
|
|
287
|
+
|
|
288
|
+
//# sourceMappingURL=model-RkRyfM7C.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-RkRyfM7C.js","names":["ColumnDef","ColumnType","Plural","DatePreset","FilterCondition","FilterOp","I18n","Format","EMPTY","NUMBER","TEXT","LIST","DATE","CASED","OPERATORS","Record","int","float","percentage","star","currency","string","text","uppercase","lowercase","phone","color","email","url","id","boolean","select","multiselect","ajax","user","date","datetime","object","array","DEFAULT_OP","Partial","operatorsOf","def","filter","operators","type","defaultOperator","Shape","shapeOf","op","Editor","editorOf","s","Chip","column","value","DateValue","preset","DateRangeValue","from","to","isObj","v","isComplete","chip","Array","isArray","length","undefined","Number","isFinite","toCondition","out","changeOperator","shape","keep","opLabel","i18n","valueCount","t","count","Math","max","IsoRange","isoDay","d","Date","getFullYear","String","getMonth","padStart","getDate","addDays","n","weekStart","locale","l","Intl","Locale","getWeekInfo","firstDay","weekInfo","resolvePreset","now","diff","getDay","start","qm","floor","dayOf","slice","dateArg","isEmptyVal","lower","toLocaleLowerCase","matches","cond","cell","env","day","hit","test","min","needle","items","some","item","startsWith","endsWith","includes","wanted","Set","map","has","r","SummaryEnv","fmt","labelOf","today","Summary","full","people","label","shortNum","abs","compact","decimal","isInteger","summarize","unit","num","sameMonth","toText","values","labels","x","i","join","noun","filterNoun","EMPTY","NUMBER","TEXT","LIST","DATE","CASED","OPERATORS","DEFAULT_OP","operatorsOf","def","defaultOperator","shapeOf","op","type","editorOf","s","isObj","v","isComplete","chip","toCondition","out","changeOperator","shape","keep","opLabel","i18n","valueCount","isoDay","d","addDays","n","weekStart","l","locale","resolvePreset","t","now","preset","start","qm","dayOf","dateArg","isEmptyVal","lower","matches","env","cond","cell","day","hit","min","max","needle","item","wanted","r","shortNum","fmt","summarize","unit","num","from","to","toText","values","labels","x","people","i","noun"],"sources":["../src/core/filters/model.ts"],"sourcesContent":["// Filtre modeli (04 §1–3, 03 · Operatör anahtarları): tipe göre operatörler ve varsayılan, değer şekli (operatör değişiminde\n// koruma kuralı), eksik çip, hazır tarih aralıkları, istemci modu eşleme ve çip değer özeti. Framework'ten bağımsız; Vue paketindekiyle aynı.\nimport type { ColumnDef, ColumnType } from '../../types/columns'\nimport type { Plural } from '../../types/core'\nimport type { DatePreset, FilterCondition, FilterOp } from '../../types/query'\nimport type { I18n } from '../i18n'\nimport type { Format } from '../format'\n\nconst EMPTY: FilterOp[] = ['is_empty', 'is_not_empty']\nconst NUMBER: FilterOp[] = ['eq', 'neq', 'gt', 'gte', 'lt', 'lte', 'between', ...EMPTY]\nconst TEXT: FilterOp[] = ['contains', 'not_contains', 'eq', 'neq', 'starts_with', 'ends_with', ...EMPTY]\nconst LIST: FilterOp[] = ['in', 'not_in', ...EMPTY]\nconst DATE: FilterOp[] = ['within', 'eq', 'before', 'after', ...EMPTY]\nconst CASED: FilterOp[] = ['contains', 'eq', 'neq', 'starts_with', ...EMPTY]\n\n/** Tipe göre operatör listesi (03, brief §6.5); `filter.operators` alt küme seçebilir. */\nexport const OPERATORS: Record<ColumnType, FilterOp[]> = {\n int: NUMBER,\n float: NUMBER,\n percentage: ['eq', 'gt', 'gte', 'lt', 'lte', 'between', ...EMPTY],\n star: ['gte', 'lte', 'eq', ...EMPTY],\n currency: NUMBER,\n string: TEXT,\n text: ['contains', 'not_contains', ...EMPTY],\n uppercase: CASED,\n lowercase: CASED,\n phone: ['contains', 'starts_with', ...EMPTY],\n color: LIST,\n email: ['contains', 'eq', 'ends_with', ...EMPTY],\n url: ['contains', ...EMPTY],\n id: ['in', 'contains', ...EMPTY],\n boolean: ['eq', ...EMPTY],\n select: LIST,\n multiselect: LIST,\n ajax: LIST,\n user: LIST,\n date: DATE,\n datetime: DATE,\n object: [],\n array: ['contains', ...EMPTY],\n}\n\nconst DEFAULT_OP: Partial<Record<ColumnType, FilterOp>> = {\n int: 'between',\n float: 'between',\n percentage: 'between',\n currency: 'between',\n star: 'gte',\n // Vue'da `in`; kod çoğu zaman bir parçasıyla aranır (R14).\n id: 'contains',\n boolean: 'eq',\n date: 'within',\n datetime: 'within',\n}\n\nexport const operatorsOf = (def: ColumnDef): FilterOp[] => def.filter?.operators ?? OPERATORS[def.type]\nexport const defaultOperator = (def: ColumnDef): FilterOp =>\n def.filter?.defaultOperator ?? DEFAULT_OP[def.type] ?? operatorsOf(def)[0] ?? 'is_empty'\n\n/** Değerin şekli: operatör değişiminde değer yalnızca aynı şekilde korunur (04 §3 · Uygulama zamanı). */\nexport type Shape = 'none' | 'text' | 'number' | 'range' | 'list' | 'date' | 'dateRange' | 'boolean'\nexport function shapeOf(op: FilterOp, type: ColumnType): Shape {\n if (op === 'is_empty' || op === 'is_not_empty') return 'none'\n if (op === 'in' || op === 'not_in') return 'list'\n if (op === 'between') return 'range'\n if (op === 'within') return 'dateRange'\n if (op === 'before' || op === 'after' || type === 'date' || type === 'datetime') return 'date'\n if (type === 'boolean') return 'boolean'\n if (op === 'gt' || op === 'gte' || op === 'lt' || op === 'lte') return 'number'\n if (type === 'int' || type === 'float' || type === 'percentage' || type === 'currency' || type === 'star')\n return 'number'\n return 'text'\n}\n\n/** Ekrandaki çip: değeri henüz seçilmemiş olabilir (eksik çip sorguya girmez). */\n/** Çip editörü (FilterChip ve telefon Filters sayfası): liste şekli `id`'de metin (yapıştırılan liste), diğerlerinde seçenek listesi. */\nexport type Editor = 'options' | 'text' | 'number' | 'star' | 'date' | null\nexport function editorOf(op: FilterOp, type: ColumnType): Editor {\n const s = shapeOf(op, type)\n if (s === 'none' || s === 'boolean') return null\n if (s === 'list') return type === 'id' ? 'text' : 'options'\n if (s === 'text') return 'text'\n if (s === 'date' || s === 'dateRange') return 'date'\n return type === 'star' ? 'star' : 'number'\n}\n\nexport interface Chip {\n column: string\n op: FilterOp\n value?: unknown\n currency?: string\n}\n\nexport type DateValue = string | { preset: 'today' }\nexport type DateRangeValue = { preset: DatePreset } | { from: string; to: string }\n\nconst isObj = (v: unknown): v is Record<string, unknown> => !!v && typeof v === 'object'\n\nexport function isComplete(chip: Chip, type: ColumnType): boolean {\n const v = chip.value\n switch (shapeOf(chip.op, type)) {\n case 'none':\n return true\n case 'list':\n return Array.isArray(v) && v.length > 0\n case 'range':\n return Array.isArray(v) && ((v[0] !== null && v[0] !== undefined) || (v[1] !== null && v[1] !== undefined))\n case 'text':\n return typeof v === 'string' && v !== ''\n case 'number':\n return typeof v === 'number' && Number.isFinite(v)\n case 'boolean':\n return typeof v === 'boolean'\n case 'date':\n return (typeof v === 'string' && v !== '') || (isObj(v) && v.preset === 'today')\n case 'dateRange':\n return isObj(v) && (typeof v.preset === 'string' || (typeof v.from === 'string' && typeof v.to === 'string'))\n }\n}\n\nexport function toCondition(chip: Chip): FilterCondition {\n const out: Record<string, unknown> = { column: chip.column, op: chip.op }\n if (chip.value !== undefined && shapeOf(chip.op, 'string') !== 'none') out.value = chip.value\n if (chip.currency) out.currency = chip.currency\n return out as FilterCondition\n}\n\nexport function changeOperator(chip: Chip, op: FilterOp, type: ColumnType): Chip {\n const shape = shapeOf(op, type)\n const keep = shape !== 'none' && shape === shapeOf(chip.op, type)\n return { ...chip, op, value: keep ? chip.value : undefined }\n}\n\n/** Operatör etiketi (03): `in`/`not_in` değer sayısına göre tekil/çoğul; `star`'da gte/lte \"at least / at most\". */\nexport function opLabel(i18n: I18n, op: FilterOp, type: ColumnType, valueCount = 1): string {\n if (op === 'in' || op === 'not_in') return i18n.t(`op.${op}`, { count: Math.max(1, valueCount) })\n if (type === 'star' && (op === 'gte' || op === 'lte')) return i18n.t(`op.star.${op}`)\n return i18n.t(`op.${op}`)\n}\n\n/* ---------- tarih ---------- */\n\nexport interface IsoRange {\n from: string | null\n to: string | null\n}\nexport const isoDay = (d: Date): string =>\n `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`\nconst addDays = (d: Date, n: number): Date => new Date(d.getFullYear(), d.getMonth(), d.getDate() + n)\n/** Haftanın ilk günü (1 = Pazartesi … 7 = Pazar) yerel ayardan (`Intl.Locale` weekInfo); desteklenmeyen tarayıcıda Pazartesi. */\nexport const weekStart = (locale: string): number => {\n try {\n const l = new Intl.Locale(locale) as unknown as {\n getWeekInfo?: () => { firstDay: number }\n weekInfo?: { firstDay: number }\n }\n return l.getWeekInfo?.().firstDay ?? l.weekInfo?.firstDay ?? 1\n } catch {\n return 1\n }\n}\n\n/** Hazır aralık → ISO gün aralığı (uçlar dahil). Hafta başı yerel ayardan (tr/en-GB Pazartesi, en-US Pazar). Yerel takvim, saf Date. */\nexport function resolvePreset(preset: DatePreset, locale: string, now = new Date()): IsoRange {\n const t = new Date(now.getFullYear(), now.getMonth(), now.getDate())\n switch (preset) {\n case 'today':\n return { from: isoDay(t), to: isoDay(t) }\n case 'this_week': {\n const diff = (t.getDay() - (weekStart(locale) % 7) + 7) % 7\n const start = addDays(t, -diff)\n return { from: isoDay(start), to: isoDay(addDays(start, 6)) }\n }\n case 'next_7_days':\n return { from: isoDay(t), to: isoDay(addDays(t, 7)) }\n case 'this_month':\n return {\n from: isoDay(new Date(t.getFullYear(), t.getMonth(), 1)),\n to: isoDay(new Date(t.getFullYear(), t.getMonth() + 1, 0)),\n }\n case 'last_30_days':\n return { from: isoDay(addDays(t, -30)), to: isoDay(t) }\n case 'this_quarter': {\n const qm = Math.floor(t.getMonth() / 3) * 3\n return { from: isoDay(new Date(t.getFullYear(), qm, 1)), to: isoDay(new Date(t.getFullYear(), qm + 3, 0)) }\n }\n case 'overdue':\n return { from: null, to: isoDay(addDays(t, -1)) }\n }\n}\n\nconst dayOf = (v: unknown): string | null => {\n if (v instanceof Date) return isoDay(v)\n if (typeof v === 'string' && v.length >= 10) return v.slice(0, 10)\n return null\n}\nconst dateArg = (v: DateValue, now: Date): string => (typeof v === 'string' ? v.slice(0, 10) : isoDay(now))\n\n/* ---------- istemci modu eşleme ---------- */\n\nconst isEmptyVal = (v: unknown) => v === null || v === undefined || v === '' || (Array.isArray(v) && v.length === 0)\nconst lower = (v: unknown, locale: string) => String(v).toLocaleLowerCase(locale)\n\n/** Tek koşul, tek hücre değeri (04 §1 değer biçimleri). `'@me'` istemcide çözülemez: eşleşmez. */\nexport function matches(cond: FilterCondition, cell: unknown, env: { locale: string; now?: Date }): boolean {\n const now = env.now ?? new Date()\n switch (cond.op) {\n case 'is_empty':\n return isEmptyVal(cell)\n case 'is_not_empty':\n return !isEmptyVal(cell)\n }\n if (isEmptyVal(cell)) return false\n switch (cond.op) {\n case 'eq':\n case 'neq': {\n const day = dayOf(cell)\n const hit =\n typeof cond.value === 'string' && day && /^\\d{4}-\\d{2}-\\d{2}/.test(cond.value)\n ? day === cond.value.slice(0, 10)\n : typeof cell === 'string' && typeof cond.value === 'string'\n ? lower(cell, env.locale) === lower(cond.value, env.locale)\n : cell === cond.value || String(cell) === String(cond.value)\n return cond.op === 'eq' ? hit : !hit\n }\n case 'gt':\n return Number(cell) > cond.value\n case 'gte':\n return Number(cell) >= cond.value\n case 'lt':\n return Number(cell) < cond.value\n case 'lte':\n return Number(cell) <= cond.value\n case 'between': {\n const n = Number(cell)\n const [min, max] = cond.value\n return (min === null || n >= min) && (max === null || n <= max)\n }\n case 'contains':\n case 'not_contains':\n case 'starts_with':\n case 'ends_with': {\n const needle = lower(cond.value, env.locale)\n const items = Array.isArray(cell) ? cell : [cell]\n const hit = items.some((item) => {\n const s = lower(item, env.locale)\n return cond.op === 'starts_with'\n ? s.startsWith(needle)\n : cond.op === 'ends_with'\n ? s.endsWith(needle)\n : s.includes(needle)\n })\n return cond.op === 'not_contains' ? !hit : hit\n }\n case 'in':\n case 'not_in': {\n const wanted = new Set(cond.value.map(String))\n const items = Array.isArray(cell) ? cell : [cell]\n const hit = items.some((item) => wanted.has(String(item)))\n return cond.op === 'in' ? hit : !hit\n }\n case 'before':\n return (dayOf(cell) ?? '') < dateArg(cond.value, now)\n case 'after':\n return (dayOf(cell) ?? '') > dateArg(cond.value, now)\n case 'within': {\n const day = dayOf(cell)\n if (!day) return false\n const r = 'preset' in cond.value ? resolvePreset(cond.value.preset, env.locale, now) : cond.value\n return (r.from === null || day >= r.from) && (r.to === null || day <= r.to)\n }\n }\n}\n\n/* ---------- çip özeti (04 §3 · Değer özeti) ---------- */\n\nexport interface SummaryEnv {\n i18n: I18n\n fmt: Format\n /** Seçenek/kişi değeri → etiket (select, user, ajax). */\n labelOf: (value: string | number) => string\n today?: Date\n}\nexport interface Summary {\n /** Çipte görünen metin; boş operatörlerde ''. */\n text: string\n /** Tooltip'teki tam metin (kısaltıldıysa). */\n full?: string\n /** Kişi filtrelerinde avatar yığını için. */\n people?: Array<{ value: string | number; label: string }>\n}\n\nconst shortNum = (fmt: Format, n: number) =>\n Math.abs(n) >= 1000 ? fmt.compact(n) : fmt.decimal(n, Number.isInteger(n) ? 0 : 2)\n\nexport function summarize(chip: Chip, def: ColumnDef, env: SummaryEnv): Summary {\n const { i18n, fmt } = env\n const type = def.type\n const v = chip.value\n const unit = type === 'percentage' ? '%' : chip.currency ? ` ${chip.currency}` : ''\n const num = (n: number) => `${shortNum(fmt, n)}${unit}`\n switch (shapeOf(chip.op, type)) {\n case 'none':\n return { text: '' }\n case 'boolean':\n return { text: i18n.t(v ? 'common.yes' : 'common.no') }\n case 'number':\n return { text: typeof v === 'number' ? num(v) : '' }\n case 'text':\n return typeof v === 'string' && v ? { text: `“${v}”`, full: v } : { text: '' }\n case 'range': {\n if (!Array.isArray(v)) return { text: '' }\n const [min, max] = v as [number | null, number | null]\n if (min !== null && min !== undefined && max !== null && max !== undefined)\n return { text: `${shortNum(fmt, min)} – ${num(max)}` }\n if (min !== null && min !== undefined) return { text: `≥ ${num(min)}` }\n if (max !== null && max !== undefined) return { text: `≤ ${num(max)}` }\n return { text: '' }\n }\n case 'date': {\n if (typeof v === 'string' && v) return { text: fmt.date(v, env.today) }\n if (isObj(v) && v.preset === 'today') return { text: i18n.t('date.today') }\n return { text: '' }\n }\n case 'dateRange': {\n if (!isObj(v)) return { text: '' }\n if (typeof v.preset === 'string') return { text: i18n.t(`date.${v.preset}`) }\n const from = String(v.from)\n const to = String(v.to)\n const sameMonth = from.slice(0, 7) === to.slice(0, 7)\n const toText = sameMonth ? String(Number(to.slice(8, 10))) : fmt.date(to, env.today)\n return { text: `${fmt.date(from, env.today)} – ${toText}` }\n }\n case 'list': {\n const values = Array.isArray(v) ? (v as Array<string | number>) : []\n if (values.length === 0) return { text: '' }\n const labels = values.map((x) => (x === '@me' ? i18n.t('common.me') : env.labelOf(x)))\n if (type === 'user') {\n const people = values.map((value, i) => ({ value, label: labels[i]! }))\n return {\n text: values.length === 1 ? labels[0]! : i18n.t('chip.people', { count: values.length }),\n full: labels.join(', '),\n people,\n }\n }\n if (values.length <= 2) return { text: labels.join(', '), full: labels.join(', ') }\n const noun = def.filterNoun as Plural | undefined\n return {\n text: noun\n ? i18n.t('chip.noun', { count: values.length, noun })\n : i18n.t('chip.values', { count: values.length }),\n full: labels.join(', '),\n }\n }\n }\n}\n"],"mappings":";AAQA,IAAMQ,IAAoB,CAAC,YAAY,cAAc,GAC/CC,IAAqB;CAAC;CAAM;CAAO;CAAM;CAAO;CAAM;CAAO;CAAW,GAAGD;AAAK,GAChFE,IAAmB;CAAC;CAAY;CAAgB;CAAM;CAAO;CAAe;CAAa,GAAGF;AAAK,GACjGG,IAAmB;CAAC;CAAM;CAAU,GAAGH;AAAK,GAC5CI,IAAmB;CAAC;CAAU;CAAM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