@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,716 @@
1
+ import { Component } from 'vue';
2
+ import { InjectionKey } from 'vue';
3
+ import { Plugin as Plugin_2 } from 'vue';
4
+ import { PublicProps } from 'vue';
5
+ import { ShallowUnwrapRef } from 'vue';
6
+ import { VNode } from 'vue';
7
+ import { VNodeChild } from 'vue';
8
+
9
+ declare const __VLS_export: <Row extends object>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
10
+ props: PublicProps & __VLS_PrettifyLocal<{
11
+ tableId: TableId;
12
+ columns: Array<ColumnDef<Row>>;
13
+ rows: Row[];
14
+ rowKey?: string;
15
+ /** Verilmezse tercihten (Display › Density), o da yoksa standard. */
16
+ density?: Density;
17
+ entityName?: Plural;
18
+ /** Tek harfli kısayollar (/, F, R). Oklar, Enter, Space, Esc ve Alt←/→ her zaman. */
19
+ shortcuts?: boolean;
20
+ /** client: tüm satırlar verilir, arama/sıralama/sayfalama yerelde. server: `@request` ile uygulama çeker. */
21
+ mode?: "client" | "server";
22
+ loading?: boolean;
23
+ error?: TableError;
24
+ /** Sunucu modu: sonraki sayfa var mı (Laravel `next_page_url !== null`). */
25
+ hasMore?: boolean;
26
+ /** Biliniyorsa toplam; istemci modunda otomatik. */
27
+ total?: number;
28
+ /** Sunucu modu: footer'da "Count total" → `@count`. */
29
+ countable?: boolean;
30
+ /** Her talepte `query.fields`'e eklenecek ek alanlar. */
31
+ fields?: string[];
32
+ /** Yeni görünen sütunun yolu son talepte yoksa `reason: 'columns'` talebi (400 ms birleştirme). */
33
+ requestOnColumnChange?: boolean;
34
+ /** auto: yapılandırılana göre yuvalar; minimal: yalnızca arama + `#toolbar-end`; false: toolbar yok. */
35
+ toolbar?: "auto" | "minimal" | false;
36
+ searchPlaceholder?: string;
37
+ /** Varsayılan 100; tercih varsa o. */
38
+ pageSize?: number;
39
+ pageSizes?: number[];
40
+ /** Saniye. Verilmezse More menüsünde Auto-refresh görünmez. */
41
+ autoRefresh?: number;
42
+ /** Kodla tanımlı görünümler (kind: 'system'); adapter'daki kişisel görünümlerle birleştirilir (04 §7). */
43
+ views?: View[];
44
+ /** Seçim sütunu; seçim sayfa kapsamlıdır (D19). */
45
+ selectable?: boolean;
46
+ /** Seçim çubuğu: yüzer (varsayılan) ya da toolbar'ın yerine. */
47
+ selectionBar?: "floating" | "toolbar";
48
+ bulkActions?: Array<BulkAction<Row>>;
49
+ /** Satır menüsü (⋯, sağ tık, ⇧F10): Open / Copy yerleşik + bunlar. */
50
+ rowActions?: Array<RowAction<Row>>;
51
+ /** Satır gövdesine tıklama (D6). Varsayılan 'none'. */
52
+ rowClick?: RowClickMode;
53
+ expand?: boolean | ExpandOptions<Row>;
54
+ /** Satır hatası (D35): metin/metin listesi → `--dt-r-bg` + ⋯ hücresinde uyarı ikonu + satırda tooltip. Harita uygulamanın. */
55
+ rowError?: (row: Row) => string | string[] | null | undefined;
56
+ /** More › Export (D46). Varsayılan açık; `false` gizler (ör. yetki). */
57
+ exportable?: boolean;
58
+ } & {
59
+ onCount?: ((request: CountRequest) => any) | undefined;
60
+ "onRow-click"?: ((payload: {
61
+ row: Row;
62
+ event: MouseEvent;
63
+ }) => any) | undefined;
64
+ "onRow-open"?: ((payload: {
65
+ row: Row;
66
+ href: string;
67
+ event: MouseEvent;
68
+ }) => any) | undefined;
69
+ onExport?: ((payload: {
70
+ format: "csv" | "xlsx";
71
+ query: QueryWithoutPage;
72
+ selection: Row[];
73
+ rows: Row[];
74
+ visibleColumns: string[];
75
+ }) => any) | undefined;
76
+ onImport?: (() => any) | undefined;
77
+ onPrint?: ((payload: {
78
+ query: QueryWithoutPage;
79
+ visibleColumns: string[];
80
+ }) => any) | undefined;
81
+ onRequest?: ((request: TableRequest) => any) | undefined;
82
+ "onSelection-change"?: ((rows: Row[]) => any) | undefined;
83
+ "onView-change"?: ((payload: {
84
+ id: string;
85
+ kind: View["kind"];
86
+ }) => any) | undefined;
87
+ }> & (typeof globalThis extends {
88
+ __VLS_PROPS_FALLBACK: infer P;
89
+ } ? P : {});
90
+ expose: (exposed: ShallowUnwrapRef<{
91
+ refresh: () => void;
92
+ clearSelection: () => {};
93
+ }>) => void;
94
+ attrs: any;
95
+ slots: {
96
+ empty?: () => unknown;
97
+ 'toolbar-end'?: (props: {
98
+ compact: boolean;
99
+ }) => unknown;
100
+ /** Satır detayı; veriyi slot bileşeni çeker (05 §7). */
101
+ expanded?: (props: {
102
+ row: Row;
103
+ close: () => void;
104
+ }) => unknown;
105
+ /** bulkActions yerine özel seçim çubuğu içeriği. */
106
+ 'selection-actions'?: (props: {
107
+ rows: Row[];
108
+ clear: () => void;
109
+ }) => unknown;
110
+ };
111
+ emit: ((evt: "count", request: CountRequest) => void) & ((evt: "row-click", payload: {
112
+ row: Row;
113
+ event: MouseEvent;
114
+ }) => void) & ((evt: "row-open", payload: {
115
+ row: Row;
116
+ href: string;
117
+ event: MouseEvent;
118
+ }) => void) & ((evt: "export", payload: {
119
+ format: "csv" | "xlsx";
120
+ query: QueryWithoutPage;
121
+ selection: Row[];
122
+ rows: Row[];
123
+ visibleColumns: string[];
124
+ }) => void) & ((evt: "import") => void) & ((evt: "print", payload: {
125
+ query: QueryWithoutPage;
126
+ visibleColumns: string[];
127
+ }) => void) & ((evt: "request", request: TableRequest) => void) & ((evt: "selection-change", rows: Row[]) => void) & ((evt: "view-change", payload: {
128
+ id: string;
129
+ kind: View["kind"];
130
+ }) => void);
131
+ }>) => VNode & {
132
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
133
+ };
134
+
135
+ declare type __VLS_PrettifyLocal<T> = (T extends any ? {
136
+ [K in keyof T]: T[K];
137
+ } : {
138
+ [K in keyof T as K]: T[K];
139
+ }) & {};
140
+
141
+ export declare interface BaseColumn<Row, V = unknown> {
142
+ /** Kararlı kimlik; `accessor` verilmezse değer bu yoldan okunur ('customer.title' → row.customer?.title). */
143
+ id: Path<Row> | string;
144
+ /** Header metni (uygulama i18n'den verir). */
145
+ header: string;
146
+ /** Dar alanlarda (telefon) kısa header. */
147
+ headerShort?: string;
148
+ /** Sütun açıklaması: header tooltip'inde ad altında ikinci satır, Columns dialog'unda ad altında; hücrede gösterilmez. */
149
+ description?: string;
150
+ /** Hesaplanan değer. Verilirse `fields` ile sunucudan istenecek alanlar bildirilir. */
151
+ accessor?: (row: Row) => V;
152
+ fields?: string[];
153
+ /** string → header'da soluk son ek ("pcs", "d"). Fonksiyon → hücrede, satır bazında. */
154
+ unit?: string | ((row: Row) => string);
155
+ align?: 'left' | 'right' | 'center';
156
+ /** px. Varsayılan tipe göre (05 · Sütun genişlikleri). Sabit sütunlar her zaman px. */
157
+ width?: number;
158
+ /** px. Varsayılan 80. */
159
+ minWidth?: number;
160
+ maxWidth?: number;
161
+ hidden?: boolean;
162
+ /** Gizlenemez. Birincil ve `required` sütun için otomatik true. */
163
+ alwaysVisible?: boolean;
164
+ /** Birincil hücre: gerçek <a href> (D6); her zaman sola sabit (D45). Tabloda en fazla bir tane. */
165
+ primary?: boolean;
166
+ /** Birincil hücre veya `id`/`ajax` tipi için kayıt linki. */
167
+ href?: (row: Row) => string | undefined;
168
+ /** İkinci satır (yalnızca Comfortable). */
169
+ secondary?: (row: Row) => string | null | undefined;
170
+ /** Boş değer metni. Varsayılan "—". */
171
+ emptyText?: string;
172
+ sortable?: boolean;
173
+ filterable?: boolean;
174
+ filter?: ColumnFilterOptions;
175
+ searchable?: boolean;
176
+ suggested?: boolean;
177
+ filterNoun?: Plural;
178
+ priority?: number;
179
+ cell?: CellRender<Row, V>;
180
+ actions?: Array<CellAction<Row>>;
181
+ editable?: boolean | ((row: Row, ctx: {
182
+ isNew: boolean;
183
+ }) => boolean);
184
+ editor?: CellEditor;
185
+ required?: boolean;
186
+ validate?: Validator<Row>;
187
+ warn?: Validator<Row>;
188
+ importAliases?: string[];
189
+ hint?: string;
190
+ }
191
+
192
+ /** Toplu aksiyon. Seçim sayfa kapsamlıdır (D19): `rows` o anda seçili, yüklü satırlardır. */
193
+ export declare interface BulkAction<Row = any> {
194
+ id: string;
195
+ label: string;
196
+ /** Bar düğmesinde tooltip, ⋯ menüsünde ikinci satır (gerekçe varsa o) (D36). */
197
+ description?: string;
198
+ icon?: Component;
199
+ /** Bar'da görünür; değilse ⋯ menüsünde. Bar'da en fazla 3. */
200
+ inBar?: boolean;
201
+ destructive?: boolean;
202
+ /** Yetkiye bağlı: false → bar'da ve menüde yok (D36). Duruma bağlı pasiflik için `disabled`. */
203
+ when?: (rows: Row[]) => boolean;
204
+ disabled?: (rows: Row[]) => boolean | string;
205
+ run: (rows: Row[]) => void | Promise<void>;
206
+ }
207
+
208
+ /** Hücre aksiyonu: paket sağ kenarda overlay olarak çizer (metin yerleşimi değişmez), ≤ 2 ikon + ⋯ menüsü. */
209
+ export declare interface CellAction<Row> {
210
+ id: string;
211
+ label: string;
212
+ icon: Component;
213
+ /** 'hover': hover ve focus-within'de görünür (varsayılan). 'always': her zaman. */
214
+ reveal?: 'hover' | 'always';
215
+ /** Değere bağlı aksiyon: false → gösterilmez. */
216
+ when?: (row: Row) => boolean;
217
+ disabled?: (row: Row) => boolean | string;
218
+ destructive?: boolean;
219
+ /** Alt menü (⋯ olarak çizilir). */
220
+ menu?: Array<Omit<CellAction<Row>, 'reveal' | 'menu'>>;
221
+ run?: (row: Row) => void | Promise<void>;
222
+ }
223
+
224
+ /** Özel hücre içeriğine verilen bağlam. `value` tipe göre daralır (int → number | null, select → string | number | null …). */
225
+ export declare interface CellContext<Row, V = unknown> {
226
+ row: Row;
227
+ value: V;
228
+ /** Tipin varsayılan biçimlendirmesi ("12,400", "Oct 24"); özel içerik bunu sarabilir. */
229
+ formatted: string;
230
+ column: {
231
+ id: string;
232
+ type: ColumnType;
233
+ };
234
+ density: Density;
235
+ }
236
+
237
+ /** Özel editör (DataSheet). Sözleşme: props { modelValue, row, column }, emit 'update:modelValue'; portallı içeriğin kökü `dt-sheet-layer` (07 §5). */
238
+ export declare type CellEditor = Component;
239
+
240
+ /**
241
+ * Özel hücre içeriği: yalnızca fonksiyon formu. Bileşen `h(Comp, props)` ile verilir.
242
+ * Tipin kabuğu (hizalama, kesme, boş değer, yoğunluk, hover) korunur; yalnızca içerik değişir.
243
+ */
244
+ export declare type CellRender<Row, V = unknown> = (ctx: CellContext<Row, V>) => VNodeChild;
245
+
246
+ export declare type ColumnDef<Row = any> = (BaseColumn<Row, number | null> & {
247
+ type: 'int';
248
+ }) | (BaseColumn<Row, number | null> & {
249
+ type: 'float';
250
+ decimalPlaces?: number;
251
+ }) | (BaseColumn<Row, number | null> & {
252
+ type: 'percentage';
253
+ display?: 'text' | 'bar';
254
+ decimalPlaces?: number;
255
+ }) | (BaseColumn<Row, number | null> & {
256
+ type: 'star';
257
+ max?: number;
258
+ }) | (BaseColumn<Row, number | null> & {
259
+ type: 'currency';
260
+ /** Sabit ISO kodu veya satırdan okuma. */
261
+ currency: string | ((row: Row) => string);
262
+ decimalPlaces?: number;
263
+ }) | (BaseColumn<Row, string | null> & {
264
+ type: 'string' | 'text' | 'uppercase' | 'lowercase' | 'email' | 'url' | 'id';
265
+ }) | (BaseColumn<Row, string | null> & {
266
+ type: 'phone';
267
+ }) | (BaseColumn<Row, string | null> & {
268
+ type: 'color';
269
+ display?: 'swatch' | 'fill';
270
+ palette?: string[];
271
+ }) | (BaseColumn<Row, boolean | null> & {
272
+ type: 'boolean';
273
+ falseTone?: 'neutral' | 'destructive';
274
+ }) | (BaseColumn<Row, string | number | null> & {
275
+ type: 'select';
276
+ options: OptionDef[];
277
+ optionEnabled?: OptionEnabled<Row>;
278
+ }) | (BaseColumn<Row, Array<string | number> | null> & {
279
+ type: 'multiselect';
280
+ options: OptionDef[];
281
+ optionEnabled?: OptionEnabled<Row>;
282
+ }) | (BaseColumn<Row, string | number | null> & {
283
+ type: 'ajax';
284
+ remote: RemoteOptions;
285
+ }) | (BaseColumn<Row, string | number | Array<string | number> | null> & {
286
+ type: 'user';
287
+ remote?: RemoteOptions<UserOption>;
288
+ options?: UserOption[];
289
+ /** Birden çok kişi (avatar yığını). */
290
+ multiple?: boolean;
291
+ }) | (BaseColumn<Row, IsoDate | Date | null> & {
292
+ type: 'date';
293
+ overdue?: boolean | ((row: Row) => boolean);
294
+ }) | (BaseColumn<Row, IsoDate | Date | null> & {
295
+ type: 'datetime';
296
+ relative?: boolean;
297
+ overdue?: boolean | ((row: Row) => boolean);
298
+ }) | (BaseColumn<Row, unknown> & {
299
+ type: 'object';
300
+ summary?: (value: unknown, row: Row) => string;
301
+ }) | (BaseColumn<Row, unknown[] | null> & {
302
+ type: 'array';
303
+ itemType?: 'string' | 'int' | 'float' | 'id';
304
+ });
305
+
306
+ export declare interface ColumnFilterOptions {
307
+ /** Tipin listesinden alt küme. */
308
+ operators?: FilterOp[];
309
+ defaultOperator?: FilterOp;
310
+ }
311
+
312
+ export declare interface ColumnLayout {
313
+ /** Görünür + gizli tüm sütunların sırası. */
314
+ order: string[];
315
+ /** Tanımlıysa beyaz liste: burada olmayan (sonradan eklenen) sütun gizlidir. */
316
+ visible: string[];
317
+ /** Yalnızca varsayılandan farklı genişlikler. */
318
+ widths: Record<string, number>;
319
+ pinned: {
320
+ left: string[];
321
+ right: string[];
322
+ };
323
+ }
324
+
325
+ /** 23 tip. `type` zorunludur; veriden çıkarsama yoktur. */
326
+ export declare type ColumnType = 'int' | 'float' | 'percentage' | 'star' | 'currency' | 'string' | 'text' | 'uppercase' | 'lowercase' | 'phone' | 'color' | 'email' | 'url' | 'id' | 'boolean' | 'select' | 'multiselect' | 'ajax' | 'user' | 'date' | 'datetime' | 'object' | 'array';
327
+
328
+ /** `countable` tablolarda "Count total" → `@count`; uygulama `total` prop'unu verir. */
329
+ export declare interface CountRequest {
330
+ query: QueryWithoutPage;
331
+ signal: AbortSignal;
332
+ }
333
+
334
+ export declare function createContext(options?: DataTableOptions): DataTableContext;
335
+
336
+ /** app.use(createDataTable({ locale: 'tr', viewsAdapter, preferences })) */
337
+ export declare function createDataTable(options?: DataTableOptions): Plugin_2;
338
+
339
+ export declare function createI18n(options?: {
340
+ locale?: string;
341
+ messages?: Partial<Messages>;
342
+ }): I18n;
343
+
344
+ export declare function createLocalStoragePreferences(options: {
345
+ scope: string;
346
+ }): PreferencesAdapter;
347
+
348
+ export declare function createLocalStorageViews(options: {
349
+ scope: string;
350
+ }): ViewsAdapter;
351
+
352
+ export declare const DATA_TABLE_KEY: InjectionKey<DataTableContext>;
353
+
354
+ /** useTemplateRef<DataSheetHandle>('sheet'). */
355
+ export declare interface DataSheetHandle {
356
+ status: Readonly<SheetStatus>;
357
+ /** Yönlendirici koruması için. */
358
+ isDirty: () => boolean;
359
+ /** `@save` ile aynı yük; uygulamanın kendi kaydetme düğmesi için. */
360
+ getChanges: () => SheetChanges;
361
+ /**
362
+ * Kayıt sonuçlarını işler (parça parça çağrılabilir): created/updated → işaretler kalkar, `row` verildiyse değerler onunla
363
+ * güncellenir; error → değişiklikler kalır, hatalar hücrelere yazılır. Undo/redo yığını temizlenir.
364
+ */
365
+ applyResult: (results: Array<SheetRowResult<unknown>>) => void;
366
+ /** Discard: tüm satırlar yüklendiği hale döner; yığın temizlenir. */
367
+ reset: () => void;
368
+ undo: () => void;
369
+ redo: () => void;
370
+ /** F8 ile aynı. */
371
+ goToNextError: () => void;
372
+ }
373
+
374
+ export declare const DataTable: typeof __VLS_export;
375
+
376
+ export declare interface DataTableContext {
377
+ locale: string;
378
+ i18n: I18n;
379
+ /** null → yalnızca `views` prop'undaki görünümler, kaydetme yok (01 · plugin). */
380
+ viewsAdapter: ViewsAdapter | null;
381
+ /** null → tercihler oturumluk; arayüz "kaydedildi" demez. */
382
+ preferences: PreferencesAdapter | null;
383
+ }
384
+
385
+ /** Uygulama genelinde bir kez: app.use(createDataTable({ … })) */
386
+ export declare interface DataTableOptions {
387
+ /** Varsayılan navigator.language. Sayı/tarih biçimi ve metin karşılaştırması bu locale ile. */
388
+ locale?: string;
389
+ messages?: Partial<Messages>;
390
+ /** Yoksa yalnızca `views` prop'undaki görünümler; kaydetme yok. */
391
+ viewsAdapter?: ViewsAdapter;
392
+ /** Yoksa tercihler oturumluk (kalıcı değil) ve arayüz bunu "kaydedildi" gibi sunmaz. */
393
+ preferences?: PreferencesAdapter;
394
+ }
395
+
396
+ export declare type DatePreset = 'today' | 'this_week' | 'next_7_days' | 'this_month' | 'last_30_days' | 'this_quarter' | 'overdue';
397
+
398
+ export declare type Density = 'comfortable' | 'standard' | 'compact';
399
+
400
+ export declare interface ExpandOptions<Row = any> {
401
+ /** Bu satırın detayı var mı? Yoksa chevron yerinde boşluk kalır. */
402
+ canExpand?: (row: Row) => boolean;
403
+ }
404
+
405
+ /** Operatöre göre ayrışan koşul. `currency` sütununda değer düz sayıdır; para birimi `currency` alanıyla gelir. */
406
+ export declare type FilterCondition = {
407
+ column: string;
408
+ op: 'is_empty' | 'is_not_empty';
409
+ } | {
410
+ column: string;
411
+ op: 'eq' | 'neq';
412
+ value: string | number | boolean;
413
+ } | {
414
+ column: string;
415
+ op: 'contains' | 'not_contains' | 'starts_with' | 'ends_with';
416
+ value: string;
417
+ } | {
418
+ column: string;
419
+ op: 'gt' | 'gte' | 'lt' | 'lte';
420
+ value: number;
421
+ currency?: string;
422
+ }
423
+ /** Uçlar dahil; tek taraflıysa biri null. */
424
+ | {
425
+ column: string;
426
+ op: 'between';
427
+ value: [number | null, number | null];
428
+ currency?: string;
429
+ } | {
430
+ column: string;
431
+ op: 'in' | 'not_in';
432
+ value: Array<string | number>;
433
+ } | {
434
+ column: string;
435
+ op: 'before' | 'after';
436
+ value: IsoDate | {
437
+ preset: 'today';
438
+ };
439
+ } | {
440
+ column: string;
441
+ op: 'within';
442
+ value: {
443
+ preset: DatePreset;
444
+ } | {
445
+ from: IsoDate;
446
+ to: IsoDate;
447
+ };
448
+ };
449
+
450
+ /** 18 operatör (04). Çok değerli hücrelerde (multiselect) `in` "şunlardan birini içerir" anlamındadır. */
451
+ export declare type FilterOp = 'is_empty' | 'is_not_empty' | 'eq' | 'neq' | 'contains' | 'not_contains' | 'starts_with' | 'ends_with' | 'gt' | 'gte' | 'lt' | 'lte' | 'between' | 'in' | 'not_in' | 'before' | 'after' | 'within';
452
+
453
+ export declare interface I18n {
454
+ readonly locale: string;
455
+ /** Anahtar yoksa anahtarın kendisini döndürür; geliştirme modunda bir kez uyarır. */
456
+ t: (key: string, params?: MessageParams) => string;
457
+ has: (key: string) => boolean;
458
+ }
459
+
460
+ /** ISO tarih ("2026-10-24") veya tarih-saat ("2026-10-24T09:42:00Z"). */
461
+ export declare type IsoDate = string;
462
+
463
+ /** `user` filtrelerinde oturumdaki kullanıcı. Sunucuda çözülür. */
464
+ export declare const ME: "@me";
465
+
466
+ /** `{name}` düz değer, `{entity.one}` nokta yolu (09 · kurallar). `count` çoğul seçimini de yönetir. */
467
+ export declare type MessageParams = Record<string, string | number | boolean | null | undefined | Record<string, string> | Plural>;
468
+
469
+ export declare type Messages = Record<string, MessageValue>;
470
+
471
+ /** Parametreli metinler fonksiyon olabilir. */
472
+ export declare type MessageValue = string | ((params: Record<string, string | number>) => string);
473
+
474
+ export declare interface OptionDef {
475
+ value: string | number;
476
+ label: string;
477
+ /** Hazır ton veya tema başına açık renk. Verilmezse 'gray'. */
478
+ tone?: Tone | {
479
+ light: string;
480
+ dark: string;
481
+ };
482
+ description?: string;
483
+ }
484
+
485
+ /**
486
+ * Satıra göre kapalı seçenek (DataSheet). `options` tam liste kalır (etiket, filtre, dışa aktarma); kapalı seçenekler
487
+ * editör listesinde görünmez, yapıştırma/doldurma ile gelirse "isn't an option" hatası — yalnızca **değişen** hücrede
488
+ * (mevcut değer kural değişince hata olmaz). Satırın taslak halini alır.
489
+ */
490
+ export declare type OptionEnabled<Row> = (option: OptionDef, row: Row) => boolean;
491
+
492
+ /** `parseFile` sonucu: biçimden bağımsız ham satırlar; başlık tespiti ve eşleme paketindir (07 §13). */
493
+ export declare interface ParsedWorkbook {
494
+ sheets: Array<{
495
+ name: string;
496
+ rows: unknown[][];
497
+ }>;
498
+ }
499
+
500
+ /** Nokta yolu: 'customer.title'. Gerçek koşullu tip Faz 2'de (api-draft: src/types/path.ts). */
501
+ export declare type Path<Row> = string & {
502
+ __row?: Row;
503
+ };
504
+
505
+ /** Çoğul biçimli metin: { one: 'status', other: 'statuses' } */
506
+ export declare interface Plural {
507
+ one: string;
508
+ other: string;
509
+ }
510
+
511
+ export declare interface Preferences {
512
+ density: Density;
513
+ verticalLines: boolean;
514
+ pageSize: number;
515
+ /** Kullanıcının "Set as default" seçtiği görünüm (system veya personal). */
516
+ defaultViewId: string | null;
517
+ }
518
+
519
+ export declare interface PreferencesAdapter {
520
+ get: (tableId: TableId) => Partial<Preferences> | Promise<Partial<Preferences>>;
521
+ set: (tableId: TableId, prefs: Partial<Preferences>) => void | Promise<void>;
522
+ }
523
+
524
+ /** İlerleme: boolean ya da sayaç ("Loading products… 6,200 of 10,000"). */
525
+ export declare type Progress = boolean | {
526
+ done: number;
527
+ total: number;
528
+ };
529
+
530
+ export declare type QueryWithoutPage = Omit<TableQuery, 'page'>;
531
+
532
+ /** `ajax` ve `user` sütunlarının seçenek kaynağı (sütunun kendi verisi; metin filtresi önerisi değildir). */
533
+ export declare interface RemoteOptions<O extends OptionDef = OptionDef> {
534
+ /** Yazdıkça arama. Varsayılan sayfa boyutu 20. */
535
+ search: (q: string, page: number, ctx: {
536
+ signal: AbortSignal;
537
+ }) => Promise<{
538
+ items: O[];
539
+ hasMore: boolean;
540
+ }>;
541
+ /** Kayıtlı filtre değerlerinin, yapıştırılan değerlerin ve hücre değerlerinin etiketlerini çözer. */
542
+ resolve: (values: Array<string | number>, ctx: {
543
+ signal: AbortSignal;
544
+ }) => Promise<O[]>;
545
+ pageSize?: number;
546
+ }
547
+
548
+ export declare type RequestReason = 'initial' | 'query' | 'page' | 'columns' | 'refresh';
549
+
550
+ export declare interface RowAction<Row = any> {
551
+ id: string;
552
+ label: string;
553
+ /** Menüde etiketin altında ikinci satır (gerekçe varsa o gösterilir); inline düğmede tooltip "Label — description" (D36). */
554
+ description?: string;
555
+ icon?: Component;
556
+ /** Gösterim için ("⌘↵"); paket kısayol bağlamaz, yalnızca Open yerleşiktir. */
557
+ shortcut?: string;
558
+ /** Yetkiye bağlı: false → ne menüde ne inline (D34). Duruma bağlı pasiflik için `disabled`. */
559
+ when?: (row: Row) => boolean;
560
+ /** ⋯'nın solunda 28 px ikon düğmesi olarak çizilir (`icon` zorunlu); çizildiği satırın menüsünde yer almaz. Satır başına ilk 2 (D36). */
561
+ inline?: boolean;
562
+ /** true veya gerekçe metni ("Already running") → pasif, gerekçe ikinci satırda. */
563
+ disabled?: (row: Row) => boolean | string;
564
+ destructive?: boolean;
565
+ /** Menüde üstündeki ayırıcı. */
566
+ separatorBefore?: boolean;
567
+ /** Onay, toast ve refresh uygulamanın işidir; paket sonucu beklemez (D20). */
568
+ run: (row: Row) => void | Promise<void>;
569
+ }
570
+
571
+ /** Satır gövdesine tıklama. Varsayılan 'none': metin seçilip kopyalanabilir, seçim ve açma yapmaz (D6). */
572
+ export declare type RowClickMode = 'none' | 'open' | 'expand';
573
+
574
+ export declare type RowKey = string | number;
575
+
576
+ /** `@save` yükündeki bir satır. */
577
+ export declare interface SheetChangeRow {
578
+ /** Paketin satıra verdiği geçici kimlik; `applyResult` bununla eşleşir. */
579
+ clientId: string;
580
+ /** Anahtar sütunun değeri (ör. SKU). */
581
+ key: string;
582
+ /**
583
+ * Değişen alanlar + `required` sütunlar + anahtar (sütun id'leriyle). Eklenen satırda boş değer gitmez. Sunucu anahtara
584
+ * göre upsert eder (D11, D47); paket kaydın sunucuda olup olmadığını bilmez.
585
+ */
586
+ values: Record<string, unknown>;
587
+ }
588
+
589
+ export declare interface SheetChanges {
590
+ /** Yalnızca yeni + değişmiş satırlar; hatalı satırlar ve listeden çıkarılanlar yoktur (D11, D12). */
591
+ rows: SheetChangeRow[];
592
+ }
593
+
594
+ export declare type SheetFilterMode = 'all' | 'changed' | 'errors';
595
+
596
+ export declare interface SheetRowResult<Row> {
597
+ clientId: string;
598
+ status: 'created' | 'updated' | 'error';
599
+ /** Sütun id → mesaj. Hücrede kırmızı gösterilir. */
600
+ fieldErrors?: Record<string, string>;
601
+ /** Belirli bir alana bağlanamayan hata: satır başında gösterilir. */
602
+ rowError?: string;
603
+ /** Sunucunun kaydettiği hali; verilirse satır bununla güncellenir. */
604
+ row?: Row;
605
+ }
606
+
607
+ export declare interface SheetStatus {
608
+ phase: 'loading' | 'ready' | 'saving' | 'saved' | 'partly-saved';
609
+ changedCells: number;
610
+ changedRows: number;
611
+ newRows: number;
612
+ errorRows: number;
613
+ warningRows: number;
614
+ }
615
+
616
+ export declare interface SortRule {
617
+ column: string;
618
+ dir: 'asc' | 'desc';
619
+ }
620
+
621
+ /** `true` genel hata; string mesaj; nesne: mesaj + hata kimliği ("Copy error ID"). */
622
+ export declare type TableError = boolean | string | {
623
+ message?: string;
624
+ id?: string;
625
+ };
626
+
627
+ /** Tablo örneğinin kalıcı kimliği: görünümler ve tercihler bununla saklanır (ör. "production-orders"). */
628
+ export declare type TableId = string;
629
+
630
+ export declare interface TableQuery {
631
+ search: string;
632
+ filters: FilterCondition[];
633
+ /** Öncelik sırasıyla, en fazla 3. */
634
+ sort: SortRule[];
635
+ /** Sayfa numarası 1'den başlar (Laravel simplePaginate ile aynı). */
636
+ page: {
637
+ number: number;
638
+ size: number;
639
+ };
640
+ /** Görünür sütun id'leri. */
641
+ columns: string[];
642
+ /** Sunucudan istenen alan yolları: görünür sütunların yolları + sütunların `fields`'i + tablonun `fields` prop'u. */
643
+ fields: string[];
644
+ }
645
+
646
+ /**
647
+ * `@request` olayının yükü. Paket veri çekmez: uygulama bu sorguyla kendi HTTP'sini atar ve
648
+ * `rows`, `hasMore`, `loading`, `error` prop'larını günceller. Her yeni talepte öncekinin `signal`'i abort edilir.
649
+ */
650
+ export declare interface TableRequest {
651
+ query: TableQuery;
652
+ reason: RequestReason;
653
+ signal: AbortSignal;
654
+ }
655
+
656
+ export declare type Tone = 'gray' | 'blue' | 'green' | 'amber' | 'red' | 'violet' | 'pink' | 'teal';
657
+
658
+ /** Bileşen içinden bağlam. Plugin kurulmamışsa varsayılanlar: navigator.language, paket metinleri, adapter yok. */
659
+ export declare function useDataTableContext(): DataTableContext;
660
+
661
+ export declare interface UserOption extends OptionDef {
662
+ avatarUrl?: string;
663
+ /** Avatar yoksa gösterilecek baş harfler; verilmezse label'dan üretilir. */
664
+ initials?: string;
665
+ }
666
+
667
+ export declare interface ValidationContext<Row> {
668
+ row: Row;
669
+ isNew: boolean;
670
+ original: unknown;
671
+ }
672
+
673
+ /** null/undefined/'' → geçerli; string → hata veya uyarı metni (i18n'lenmiş). */
674
+ export declare type Validator<Row> = (value: unknown, ctx: ValidationContext<Row>) => string | null | undefined;
675
+
676
+ /** Tek görünüm tipi (D4, D30). system: kodla tanımlı, değiştirilemez (Duplicate, Set as default). personal: yalnızca sahibine. */
677
+ export declare interface View {
678
+ id: string;
679
+ name: string;
680
+ kind: 'system' | 'personal';
681
+ state: ViewPatch;
682
+ /** Ekranın varsayılanı (system içinde en fazla bir tane). Kullanıcı varsayılanı tercihlerde (`defaultViewId`). */
683
+ default?: boolean;
684
+ updatedAt?: IsoDate;
685
+ /** Sunucu sürüm numarası (çakışma tespiti için, opsiyonel). */
686
+ v?: number;
687
+ }
688
+
689
+ /** Kısmi görünüm (system view tanımı ve adapter'dan gelen kayıtlar). Eksik alanlar tablonun varsayılanlarıyla tamamlanır. */
690
+ export declare interface ViewPatch {
691
+ filters?: FilterCondition[];
692
+ sort?: SortRule[];
693
+ columns?: Partial<ColumnLayout>;
694
+ }
695
+
696
+ export declare interface ViewsAdapter {
697
+ list: (tableId: TableId) => Promise<View[]>;
698
+ create: (tableId: TableId, input: {
699
+ name: string;
700
+ state: ViewState;
701
+ }) => Promise<View>;
702
+ update: (tableId: TableId, id: string, patch: {
703
+ name?: string;
704
+ state?: ViewState;
705
+ }) => Promise<View>;
706
+ remove: (tableId: TableId, id: string) => Promise<void>;
707
+ }
708
+
709
+ /** D5: görünüm = filtre + sıralama + sütun düzeni. Arama, yoğunluk, tema, sayfa yazılmaz. Kaydedilen tam snapshot. */
710
+ export declare interface ViewState {
711
+ filters: FilterCondition[];
712
+ sort: SortRule[];
713
+ columns: ColumnLayout;
714
+ }
715
+
716
+ export { }