ui-sdk-table-vue 0.2.0 → 0.2.2
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/docs/README.md +10 -0
- package/docs/cell-editing.md +3 -4
- package/docs/cells-and-slots.md +3 -2
- package/docs/controller-and-view.md +3 -1
- package/docs/excel-formulas.md +4 -2
- package/docs/export.md +3 -3
- package/docs/fill.md +2 -3
- package/docs/formats.md +2 -6
- package/docs/groups-and-totals.md +3 -5
- package/docs/history.md +4 -5
- package/docs/llms.txt +12 -0
- package/docs/pages-and-server-mode.md +3 -4
- package/docs/range-copy-and-paste.md +3 -4
- package/docs/reference-columns.md +179 -0
- package/docs/reference-controller.md +133 -0
- package/docs/reference-export.md +59 -0
- package/docs/reference-formulas.md +39 -0
- package/docs/reference-messages.md +55 -0
- package/docs/reference-table.md +246 -0
- package/docs/reference-view.md +110 -0
- package/docs/row-numbers-and-letters.md +3 -5
- package/docs/rows.md +3 -5
- package/docs/selection-and-keyboard.md +1 -5
- package/docs/sheet-formulas.md +15 -10
- package/docs/sheet-options.md +2 -6
- package/docs/sort-filter-and-search.md +3 -4
- package/package.json +2 -2
- package/src/index.ts +12 -0
- package/src/table.ts +41 -0
|
@@ -232,10 +232,9 @@ Press Northway. The colors list counts only the shoes of Northway. Press Black t
|
|
|
232
232
|
|
|
233
233
|
## Names
|
|
234
234
|
|
|
235
|
-
- **
|
|
236
|
-
- **Events:** `sort-change`, `filter-change`.
|
|
237
|
-
- **Controller:** `sortBy`, `toggleSort`, `setSearch`, `inputSearch`, `flushSearch`, `setColumnFilter`, `clearFilters`, `clearColumnFilters`, `getFacets`.
|
|
238
|
-
- **Exports:** `useTableSearch`, `createDebounce`, `sliderBounds`, `isEmptyFilter`, and the types `SortRule`, `FilterState`, `FilterKind`, `FilterMatcher`, `MultiSortMode`, `ColumnFacets`, `ColumnFacetValue`, `FacetOptions`, `TableSearch`.
|
|
235
|
+
- **Exports:** `useTableSearch`, `createDebounce`, `sliderBounds`, `isEmptyFilter`, and the types `FilterKind`, `FilterMatcher`, `MultiSortMode`.
|
|
239
236
|
- **Attributes:** `aria-sort`, `data-sorted` and `data-sort-index` on a header cell.
|
|
240
237
|
|
|
238
|
+
Every option, event, slot, controller method and view field of this page is in the reference: [Table](./reference-table.md), [Controller](./reference-controller.md) and [View](./reference-view.md).
|
|
239
|
+
|
|
241
240
|
See the [Sort tiles](https://falldownthesystem.github.io/ui-sdk-table/?page=sink&only=sort) and the [Filter tiles](https://falldownthesystem.github.io/ui-sdk-table/?page=sink&only=filter) of the sink.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ui-sdk-table-vue",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Vue parts for the ui-sdk-table primitive: slots, v-model and controllers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data-grid",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"ui-sdk-table-core": "0.2.
|
|
40
|
+
"ui-sdk-table-core": "0.2.2"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/jsdom": "^30.0.0",
|
package/src/index.ts
CHANGED
|
@@ -91,6 +91,18 @@ export type {
|
|
|
91
91
|
TableTotalsSource,
|
|
92
92
|
FilterKind,
|
|
93
93
|
FormatName,
|
|
94
|
+
FormatOptions,
|
|
95
|
+
CommonFormatOptions,
|
|
96
|
+
NumberFormatOptions,
|
|
97
|
+
CurrencyFormatOptions,
|
|
98
|
+
PercentageFormatOptions,
|
|
99
|
+
DateFormatOptions,
|
|
100
|
+
RelativeTimeFormatOptions,
|
|
101
|
+
UrlFormatOptions,
|
|
102
|
+
EmailFormatOptions,
|
|
103
|
+
BooleanFormatOptions,
|
|
104
|
+
TruncateFormatOptions,
|
|
105
|
+
PeriodFormatOptions,
|
|
94
106
|
ExportData,
|
|
95
107
|
ExportOptions,
|
|
96
108
|
ColumnPin,
|
package/src/table.ts
CHANGED
|
@@ -421,15 +421,19 @@ export type TableEmits = {
|
|
|
421
421
|
}
|
|
422
422
|
|
|
423
423
|
export type HeaderSlotProps<Row> = {
|
|
424
|
+
/** The definition of the column. */
|
|
424
425
|
column: ColumnDef<Row>
|
|
425
426
|
/** The header text: `column.header`, or the column id. */
|
|
426
427
|
label: string
|
|
427
428
|
/** False for a header group, which holds columns and no cells. */
|
|
428
429
|
leaf: boolean
|
|
430
|
+
/** The direction of the column in the sort, `'asc'` or `'desc'`, or `undefined` when it does not sort. */
|
|
429
431
|
sort: SortDirection | undefined
|
|
430
432
|
/** The place of the column in the sort, from 1. With several columns in the sort, the first one sorts first. */
|
|
431
433
|
sortIndex: number | undefined
|
|
434
|
+
/** Sorts by the column as a press on the header does. Pass the event: with `multiSort`, its keys decide whether the column joins the sort. */
|
|
432
435
|
toggleSort: (event?: Event) => void
|
|
436
|
+
/** The edge that the column is pinned to, or `undefined`. */
|
|
433
437
|
pin: 'start' | 'end' | undefined
|
|
434
438
|
/**
|
|
435
439
|
* Selects the cells of the column, for a control in its header. With
|
|
@@ -442,9 +446,13 @@ export type HeaderSlotProps<Row> = {
|
|
|
442
446
|
}
|
|
443
447
|
|
|
444
448
|
export type CellSlotProps<Row> = {
|
|
449
|
+
/** The row object of the data, as the owner passed it. */
|
|
445
450
|
row: Row
|
|
451
|
+
/** The node of the row in the row model: its id, its parent and its children. */
|
|
446
452
|
node: DataRow<Row>
|
|
453
|
+
/** The definition of the column. */
|
|
447
454
|
column: ColumnDef<Row>
|
|
455
|
+
/** The value of the cell: `value` of the column, else the property that `key` names. */
|
|
448
456
|
value: unknown
|
|
449
457
|
/** The value as text, with the format of the cell, else of its column. */
|
|
450
458
|
text: string
|
|
@@ -455,14 +463,19 @@ export type CellSlotProps<Row> = {
|
|
|
455
463
|
* `data-bold`, `data-italic`, `data-color` and `data-fill`.
|
|
456
464
|
*/
|
|
457
465
|
format: CellFormat | undefined
|
|
466
|
+
/** Whether the row is selected. */
|
|
458
467
|
selected: boolean
|
|
468
|
+
/** Whether the row is open: its child rows or its detail row show. */
|
|
459
469
|
expanded: boolean
|
|
470
|
+
/** Whether the row can open: it has child rows or a detail row. */
|
|
460
471
|
expandable: boolean
|
|
461
472
|
/** Tree and group levels above this row, from 0. */
|
|
462
473
|
level: number
|
|
463
474
|
/** The edge that the row is pinned to. */
|
|
464
475
|
pinned: RowPin | undefined
|
|
476
|
+
/** Selects the row or takes it out of the selection, for a checkbox in the cell. */
|
|
465
477
|
toggleSelected: (event?: Event) => void
|
|
478
|
+
/** Opens or closes the row, for a button in the cell. */
|
|
466
479
|
toggleExpanded: (event?: Event) => void
|
|
467
480
|
/**
|
|
468
481
|
* With formulas: the formula of the cell as a person reads it, and the
|
|
@@ -473,9 +486,13 @@ export type CellSlotProps<Row> = {
|
|
|
473
486
|
}
|
|
474
487
|
|
|
475
488
|
export type EditorSlotProps<Row> = {
|
|
489
|
+
/** The row object of the data, as the owner passed it. */
|
|
476
490
|
row: Row
|
|
491
|
+
/** The node of the row in the row model: its id, its parent and its children. */
|
|
477
492
|
node: DataRow<Row>
|
|
493
|
+
/** The definition of the column. */
|
|
478
494
|
column: ColumnDef<Row>
|
|
495
|
+
/** The value of the cell now. */
|
|
479
496
|
value: unknown
|
|
480
497
|
/** The value as plain text, without a format: 0.25 for a cell that shows 25 %. `save` takes a value. */
|
|
481
498
|
text: string
|
|
@@ -505,8 +522,11 @@ export type EditorSlotProps<Row> = {
|
|
|
505
522
|
}
|
|
506
523
|
|
|
507
524
|
export type RowHeaderSlotProps<Row> = {
|
|
525
|
+
/** The row object of the data, as the owner passed it. */
|
|
508
526
|
row: Row
|
|
527
|
+
/** The node of the row in the row model: its id, its parent and its children. */
|
|
509
528
|
node: DataRow<Row>
|
|
529
|
+
/** The definition of the column with `rowHeader`. */
|
|
510
530
|
column: ColumnDef<Row>
|
|
511
531
|
/** The number of the row, from 1: its place among the rows that the table shows, counted over the pages. */
|
|
512
532
|
number: number
|
|
@@ -519,6 +539,7 @@ export type RowHeaderSlotProps<Row> = {
|
|
|
519
539
|
}
|
|
520
540
|
|
|
521
541
|
export type LetterSlotProps<Row> = {
|
|
542
|
+
/** The definition of the column under the letter. */
|
|
522
543
|
column: ColumnDef<Row>
|
|
523
544
|
/** The letter of the column: its place among the columns in view. `undefined` for a column that leads the table. */
|
|
524
545
|
letter: string | undefined
|
|
@@ -535,18 +556,24 @@ export type LetterSlotProps<Row> = {
|
|
|
535
556
|
}
|
|
536
557
|
|
|
537
558
|
export type DetailSlotProps<Row> = {
|
|
559
|
+
/** The row object of the data, as the owner passed it. */
|
|
538
560
|
row: Row
|
|
561
|
+
/** The node of the row in the row model: its id, its parent and its children. */
|
|
539
562
|
node: DataRow<Row>
|
|
540
563
|
/** Closes the detail row. */
|
|
541
564
|
toggleExpanded: (event?: Event) => void
|
|
542
565
|
}
|
|
543
566
|
|
|
544
567
|
export type GroupSlotProps<Row> = {
|
|
568
|
+
/** The group: its id, the column and the value that make it, and its rows. */
|
|
545
569
|
group: GroupRow<Row>
|
|
570
|
+
/** The column that makes the group. */
|
|
546
571
|
column: ColumnDef<Row> | undefined
|
|
547
572
|
/** The value of the group as text, with the format of its column. */
|
|
548
573
|
text: string
|
|
574
|
+
/** Whether the group is open. */
|
|
549
575
|
expanded: boolean
|
|
576
|
+
/** The groups above this one, from 0. */
|
|
550
577
|
level: number
|
|
551
578
|
/** Column totals of the rows in the group. */
|
|
552
579
|
totals: Record<string, unknown>
|
|
@@ -562,11 +589,14 @@ export type GroupSlotProps<Row> = {
|
|
|
562
589
|
* total of one of these columns has no cell of its own.
|
|
563
590
|
*/
|
|
564
591
|
covered: readonly ColumnDef<Row>[]
|
|
592
|
+
/** Opens or closes the group, for a button in the cell. */
|
|
565
593
|
toggleExpanded: (event?: Event) => void
|
|
566
594
|
}
|
|
567
595
|
|
|
568
596
|
export type GroupTotalSlotProps<Row> = {
|
|
597
|
+
/** The group of the row. */
|
|
569
598
|
group: GroupRow<Row>
|
|
599
|
+
/** The column of the cell. */
|
|
570
600
|
column: ColumnDef<Row>
|
|
571
601
|
/** The total of the column over the rows of the group. `undefined` for a column without an `aggregate`. */
|
|
572
602
|
value: unknown
|
|
@@ -576,14 +606,20 @@ export type GroupTotalSlotProps<Row> = {
|
|
|
576
606
|
totals: Record<string, unknown>
|
|
577
607
|
/** The function of the total: one of the built-in names, `custom` for a function of the column, or `undefined` without a total. */
|
|
578
608
|
aggregate: AggregateName | 'custom' | undefined
|
|
609
|
+
/** Whether the group is open. */
|
|
579
610
|
expanded: boolean
|
|
611
|
+
/** The groups above this one, from 0. */
|
|
580
612
|
level: number
|
|
613
|
+
/** The groups from the outermost one down to this group. */
|
|
581
614
|
path: readonly GroupPathEntry<Row>[]
|
|
582
615
|
}
|
|
583
616
|
|
|
584
617
|
export type FootSlotProps<Row> = {
|
|
618
|
+
/** The column of the cell. */
|
|
585
619
|
column: ColumnDef<Row>
|
|
620
|
+
/** The total of the column, or `undefined` for a column without an `aggregate`. */
|
|
586
621
|
value: unknown
|
|
622
|
+
/** The total as text, with the format of the column, or an empty text. */
|
|
587
623
|
text: string
|
|
588
624
|
/** The totals of every column that has one, by column id. */
|
|
589
625
|
totals: Record<string, unknown>
|
|
@@ -615,12 +651,17 @@ export type TableSlots<Row> = {
|
|
|
615
651
|
*/
|
|
616
652
|
[name: `edit-${string}`]: (props: EditorSlotProps<Row>) => VNodeChild
|
|
617
653
|
} & {
|
|
654
|
+
/** The editor of a cell, in place of the text field of the table. The control must take focus itself. */
|
|
618
655
|
editor?: (props: EditorSlotProps<Row>) => VNodeChild
|
|
656
|
+
/** One header cell, for every column without a `header-{column id}` slot. */
|
|
619
657
|
header?: (props: HeaderSlotProps<Row>) => VNodeChild
|
|
658
|
+
/** One body cell, for every column without a `col-{column id}` slot. */
|
|
620
659
|
cell?: (props: CellSlotProps<Row>) => VNodeChild
|
|
660
|
+
/** One total in the footer, for every column without a `foot-{column id}` slot. */
|
|
621
661
|
foot?: (props: FootSlotProps<Row>) => VNodeChild
|
|
622
662
|
/** The label cell of a group row. */
|
|
623
663
|
group?: (props: GroupSlotProps<Row>) => VNodeChild
|
|
664
|
+
/** The cell of a group row under one column, for every column without a `group-total-{column id}` slot. */
|
|
624
665
|
'group-total'?: (props: GroupTotalSlotProps<Row>) => VNodeChild
|
|
625
666
|
/** The cell with the number of a row, in a column with `rowHeader`. */
|
|
626
667
|
'row-header'?: (props: RowHeaderSlotProps<Row>) => VNodeChild
|