@ui-organized/svelte-table 0.0.0-stage → 6.0.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 +201 -0
- package/README.md +99 -2
- package/dist/DataTable/DataTable.svelte +62 -0
- package/dist/DataTable/DataTable.svelte.d.ts +29 -0
- package/dist/DataTable/DataTable.svelte.d.ts.map +1 -0
- package/dist/DataTable/DataTable.test.svelte.d.ts +2 -0
- package/dist/DataTable/DataTable.test.svelte.d.ts.map +1 -0
- package/dist/DataTable/DataTable.test.svelte.js +360 -0
- package/dist/DataTable/index.d.ts +2 -0
- package/dist/DataTable/index.d.ts.map +1 -0
- package/dist/DataTable/index.js +1 -0
- package/dist/components/Table/CellEditor.svelte +29 -0
- package/dist/components/Table/CellEditor.svelte.d.ts +8 -0
- package/dist/components/Table/CellEditor.svelte.d.ts.map +1 -0
- package/dist/components/Table/MoveButtons.svelte +60 -0
- package/dist/components/Table/MoveButtons.svelte.d.ts +8 -0
- package/dist/components/Table/MoveButtons.svelte.d.ts.map +1 -0
- package/dist/components/Table/ResizeHandle.svelte +82 -0
- package/dist/components/Table/ResizeHandle.svelte.d.ts +28 -0
- package/dist/components/Table/ResizeHandle.svelte.d.ts.map +1 -0
- package/dist/components/Table/Table.svelte +17 -0
- package/dist/components/Table/Table.svelte.d.ts +9 -0
- package/dist/components/Table/Table.svelte.d.ts.map +1 -0
- package/dist/components/Table/TableBody.svelte +78 -0
- package/dist/components/Table/TableBody.svelte.d.ts +30 -0
- package/dist/components/Table/TableBody.svelte.d.ts.map +1 -0
- package/dist/components/Table/TableCell.svelte +106 -0
- package/dist/components/Table/TableCell.svelte.d.ts +34 -0
- package/dist/components/Table/TableCell.svelte.d.ts.map +1 -0
- package/dist/components/Table/TableFooter.svelte +34 -0
- package/dist/components/Table/TableFooter.svelte.d.ts +9 -0
- package/dist/components/Table/TableFooter.svelte.d.ts.map +1 -0
- package/dist/components/Table/TableHeadCell.svelte +157 -0
- package/dist/components/Table/TableHeadCell.svelte.d.ts +29 -0
- package/dist/components/Table/TableHeadCell.svelte.d.ts.map +1 -0
- package/dist/components/Table/TableHeader.svelte +22 -0
- package/dist/components/Table/TableHeader.svelte.d.ts +7 -0
- package/dist/components/Table/TableHeader.svelte.d.ts.map +1 -0
- package/dist/components/Table/TableRow.svelte +84 -0
- package/dist/components/Table/TableRow.svelte.d.ts +32 -0
- package/dist/components/Table/TableRow.svelte.d.ts.map +1 -0
- package/dist/components/Table/TableViewport.svelte +69 -0
- package/dist/components/Table/TableViewport.svelte.d.ts +10 -0
- package/dist/components/Table/TableViewport.svelte.d.ts.map +1 -0
- package/dist/components/Table/index.d.ts +23 -0
- package/dist/components/Table/index.d.ts.map +1 -0
- package/dist/components/Table/index.js +22 -0
- package/dist/components/TableCards/TableCard.svelte +96 -0
- package/dist/components/TableCards/TableCard.svelte.d.ts +31 -0
- package/dist/components/TableCards/TableCard.svelte.d.ts.map +1 -0
- package/dist/components/TableCards/TableCards.svelte +61 -0
- package/dist/components/TableCards/TableCards.svelte.d.ts +7 -0
- package/dist/components/TableCards/TableCards.svelte.d.ts.map +1 -0
- package/dist/components/TableCards/index.d.ts +3 -0
- package/dist/components/TableCards/index.d.ts.map +1 -0
- package/dist/components/TableCards/index.js +2 -0
- package/dist/components/TableDetailSheet/TableDetailSheet.svelte +130 -0
- package/dist/components/TableDetailSheet/TableDetailSheet.svelte.d.ts +8 -0
- package/dist/components/TableDetailSheet/TableDetailSheet.svelte.d.ts.map +1 -0
- package/dist/components/TableDetailSheet/index.d.ts +2 -0
- package/dist/components/TableDetailSheet/index.d.ts.map +1 -0
- package/dist/components/TableDetailSheet/index.js +1 -0
- package/dist/components/TableFilters/TableFilterAdd.svelte +89 -0
- package/dist/components/TableFilters/TableFilterAdd.svelte.d.ts +15 -0
- package/dist/components/TableFilters/TableFilterAdd.svelte.d.ts.map +1 -0
- package/dist/components/TableFilters/TableFilterChip.svelte +164 -0
- package/dist/components/TableFilters/TableFilterChip.svelte.d.ts +9 -0
- package/dist/components/TableFilters/TableFilterChip.svelte.d.ts.map +1 -0
- package/dist/components/TableFilters/TableFilterEditor.svelte +40 -0
- package/dist/components/TableFilters/TableFilterEditor.svelte.d.ts +9 -0
- package/dist/components/TableFilters/TableFilterEditor.svelte.d.ts.map +1 -0
- package/dist/components/TableFilters/TableFilterValueEditor.svelte +209 -0
- package/dist/components/TableFilters/TableFilterValueEditor.svelte.d.ts +10 -0
- package/dist/components/TableFilters/TableFilterValueEditor.svelte.d.ts.map +1 -0
- package/dist/components/TableFilters/TableFilters.svelte +51 -0
- package/dist/components/TableFilters/TableFilters.svelte.d.ts +7 -0
- package/dist/components/TableFilters/TableFilters.svelte.d.ts.map +1 -0
- package/dist/components/TableFilters/index.d.ts +7 -0
- package/dist/components/TableFilters/index.d.ts.map +1 -0
- package/dist/components/TableFilters/index.js +6 -0
- package/dist/components/TableFilters/useAutoFocusField.d.ts +30 -0
- package/dist/components/TableFilters/useAutoFocusField.d.ts.map +1 -0
- package/dist/components/TableFilters/useAutoFocusField.js +59 -0
- package/dist/components/TablePagination/TablePagination.svelte +61 -0
- package/dist/components/TablePagination/TablePagination.svelte.d.ts +9 -0
- package/dist/components/TablePagination/TablePagination.svelte.d.ts.map +1 -0
- package/dist/components/TablePagination/index.d.ts +2 -0
- package/dist/components/TablePagination/index.d.ts.map +1 -0
- package/dist/components/TablePagination/index.js +1 -0
- package/dist/components/TableRowActions/TableRowActions.svelte +68 -0
- package/dist/components/TableRowActions/TableRowActions.svelte.d.ts +37 -0
- package/dist/components/TableRowActions/TableRowActions.svelte.d.ts.map +1 -0
- package/dist/components/TableRowActions/index.d.ts +2 -0
- package/dist/components/TableRowActions/index.d.ts.map +1 -0
- package/dist/components/TableRowActions/index.js +1 -0
- package/dist/components/TableSelectionBar/TableSelectionBar.svelte +88 -0
- package/dist/components/TableSelectionBar/TableSelectionBar.svelte.d.ts +30 -0
- package/dist/components/TableSelectionBar/TableSelectionBar.svelte.d.ts.map +1 -0
- package/dist/components/TableSelectionBar/index.d.ts +2 -0
- package/dist/components/TableSelectionBar/index.d.ts.map +1 -0
- package/dist/components/TableSelectionBar/index.js +1 -0
- package/dist/components/TableSelectionFooter/TableSelectionFooter.svelte +38 -0
- package/dist/components/TableSelectionFooter/TableSelectionFooter.svelte.d.ts +7 -0
- package/dist/components/TableSelectionFooter/TableSelectionFooter.svelte.d.ts.map +1 -0
- package/dist/components/TableSelectionFooter/index.d.ts +2 -0
- package/dist/components/TableSelectionFooter/index.d.ts.map +1 -0
- package/dist/components/TableSelectionFooter/index.js +1 -0
- package/dist/components/TableSheets/TableFilterSheet.svelte +150 -0
- package/dist/components/TableSheets/TableFilterSheet.svelte.d.ts +8 -0
- package/dist/components/TableSheets/TableFilterSheet.svelte.d.ts.map +1 -0
- package/dist/components/TableSheets/TableFilterSheetCondition.svelte +53 -0
- package/dist/components/TableSheets/TableFilterSheetCondition.svelte.d.ts +9 -0
- package/dist/components/TableSheets/TableFilterSheetCondition.svelte.d.ts.map +1 -0
- package/dist/components/TableSheets/TableSheetButton.svelte +44 -0
- package/dist/components/TableSheets/TableSheetButton.svelte.d.ts +15 -0
- package/dist/components/TableSheets/TableSheetButton.svelte.d.ts.map +1 -0
- package/dist/components/TableSheets/TableSortSheet.svelte +100 -0
- package/dist/components/TableSheets/TableSortSheet.svelte.d.ts +8 -0
- package/dist/components/TableSheets/TableSortSheet.svelte.d.ts.map +1 -0
- package/dist/components/TableSheets/index.d.ts +4 -0
- package/dist/components/TableSheets/index.d.ts.map +1 -0
- package/dist/components/TableSheets/index.js +3 -0
- package/dist/components/TableStates/TableEmpty.svelte +35 -0
- package/dist/components/TableStates/TableEmpty.svelte.d.ts +11 -0
- package/dist/components/TableStates/TableEmpty.svelte.d.ts.map +1 -0
- package/dist/components/TableStates/TableError.svelte +26 -0
- package/dist/components/TableStates/TableError.svelte.d.ts +10 -0
- package/dist/components/TableStates/TableError.svelte.d.ts.map +1 -0
- package/dist/components/TableStates/TableLoading.svelte +33 -0
- package/dist/components/TableStates/TableLoading.svelte.d.ts +8 -0
- package/dist/components/TableStates/TableLoading.svelte.d.ts.map +1 -0
- package/dist/components/TableStates/index.d.ts +4 -0
- package/dist/components/TableStates/index.d.ts.map +1 -0
- package/dist/components/TableStates/index.js +3 -0
- package/dist/components/TableSubBar/TableSubBar.svelte +34 -0
- package/dist/components/TableSubBar/TableSubBar.svelte.d.ts +7 -0
- package/dist/components/TableSubBar/TableSubBar.svelte.d.ts.map +1 -0
- package/dist/components/TableSubBar/index.d.ts +2 -0
- package/dist/components/TableSubBar/index.d.ts.map +1 -0
- package/dist/components/TableSubBar/index.js +1 -0
- package/dist/components/TableToolbar/TableActions.svelte +40 -0
- package/dist/components/TableToolbar/TableActions.svelte.d.ts +9 -0
- package/dist/components/TableToolbar/TableActions.svelte.d.ts.map +1 -0
- package/dist/components/TableToolbar/TableExportMenu.svelte +60 -0
- package/dist/components/TableToolbar/TableExportMenu.svelte.d.ts +8 -0
- package/dist/components/TableToolbar/TableExportMenu.svelte.d.ts.map +1 -0
- package/dist/components/TableToolbar/TableReorderToggle.svelte +27 -0
- package/dist/components/TableToolbar/TableReorderToggle.svelte.d.ts +7 -0
- package/dist/components/TableToolbar/TableReorderToggle.svelte.d.ts.map +1 -0
- package/dist/components/TableToolbar/TableScrollButtons.svelte +54 -0
- package/dist/components/TableToolbar/TableScrollButtons.svelte.d.ts +9 -0
- package/dist/components/TableToolbar/TableScrollButtons.svelte.d.ts.map +1 -0
- package/dist/components/TableToolbar/TableSearch.svelte +24 -0
- package/dist/components/TableToolbar/TableSearch.svelte.d.ts +9 -0
- package/dist/components/TableToolbar/TableSearch.svelte.d.ts.map +1 -0
- package/dist/components/TableToolbar/TableSortMenu.svelte +97 -0
- package/dist/components/TableToolbar/TableSortMenu.svelte.d.ts +8 -0
- package/dist/components/TableToolbar/TableSortMenu.svelte.d.ts.map +1 -0
- package/dist/components/TableToolbar/TableToolbar.svelte +113 -0
- package/dist/components/TableToolbar/TableToolbar.svelte.d.ts +9 -0
- package/dist/components/TableToolbar/TableToolbar.svelte.d.ts.map +1 -0
- package/dist/components/TableToolbar/TableViewOptions.svelte +69 -0
- package/dist/components/TableToolbar/TableViewOptions.svelte.d.ts +8 -0
- package/dist/components/TableToolbar/TableViewOptions.svelte.d.ts.map +1 -0
- package/dist/components/TableToolbar/index.d.ts +9 -0
- package/dist/components/TableToolbar/index.d.ts.map +1 -0
- package/dist/components/TableToolbar/index.js +8 -0
- package/dist/core/ActionsHeader.svelte +8 -0
- package/dist/core/ActionsHeader.svelte.d.ts +27 -0
- package/dist/core/ActionsHeader.svelte.d.ts.map +1 -0
- package/dist/core/SelectAllCell.svelte +21 -0
- package/dist/core/SelectAllCell.svelte.d.ts +19 -0
- package/dist/core/SelectAllCell.svelte.d.ts.map +1 -0
- package/dist/core/SelectCell.svelte +37 -0
- package/dist/core/SelectCell.svelte.d.ts +8 -0
- package/dist/core/SelectCell.svelte.d.ts.map +1 -0
- package/dist/core/createDataTable.svelte.d.ts +4 -0
- package/dist/core/createDataTable.svelte.d.ts.map +1 -0
- package/dist/core/createDataTable.svelte.js +1152 -0
- package/dist/core/createDataTable.test.svelte.d.ts +2 -0
- package/dist/core/createDataTable.test.svelte.d.ts.map +1 -0
- package/dist/core/createDataTable.test.svelte.js +156 -0
- package/dist/core/createDeferred.svelte.d.ts +38 -0
- package/dist/core/createDeferred.svelte.d.ts.map +1 -0
- package/dist/core/createDeferred.svelte.js +81 -0
- package/dist/core/elementRef.d.ts +17 -0
- package/dist/core/elementRef.d.ts.map +1 -0
- package/dist/core/elementRef.js +20 -0
- package/dist/core/props.d.ts +3 -0
- package/dist/core/props.d.ts.map +1 -0
- package/dist/core/props.js +46 -0
- package/dist/core/systemColumns.d.ts +16 -0
- package/dist/core/systemColumns.d.ts.map +1 -0
- package/dist/core/systemColumns.js +53 -0
- package/dist/core/tableContext.d.ts +7 -0
- package/dist/core/tableContext.d.ts.map +1 -0
- package/dist/core/tableContext.js +30 -0
- package/dist/core/trackStore.svelte.d.ts +24 -0
- package/dist/core/trackStore.svelte.d.ts.map +1 -0
- package/dist/core/trackStore.svelte.js +28 -0
- package/dist/core/types.d.ts +397 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/styles.css +895 -0
- package/package.json +77 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or Derivative
|
|
95
|
+
Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 arossi58
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,100 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @ui-organized/svelte-table
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The Svelte data table for the ui-organized design system, built on
|
|
4
|
+
[`@ui-organized/table-core`](../table-core) — the same framework-free engine the
|
|
5
|
+
React, Vue and Angular tables use. Same class names, same stylesheet, same token contract,
|
|
6
|
+
no fork of the logic.
|
|
7
|
+
|
|
8
|
+
## Stylesheets
|
|
9
|
+
|
|
10
|
+
The table's stylesheet goes after the component library's, once, at your app
|
|
11
|
+
entry. The snippets below import it inline for brevity; in an app, keep all of
|
|
12
|
+
these together in this order:
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import "@ui-organized/tokens/variables.css";
|
|
16
|
+
import "@ui-organized/svelte/styles";
|
|
17
|
+
import "@ui-organized/svelte-table/styles"; // after the component styles
|
|
18
|
+
import "./styles/theme.css"; // your theme, last
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Three layers
|
|
22
|
+
|
|
23
|
+
| Layer | What it is |
|
|
24
|
+
| ------------ | ------------------------------------------------------------ |
|
|
25
|
+
| 1 — headless | `createDataTable(() => options)` |
|
|
26
|
+
| 2 — parts | `TableHeader`, `TableRow`, `TableToolbar`, `TableFilters`, … |
|
|
27
|
+
| 3 — wrapper | `<DataTable>` — the whole table from a props object |
|
|
28
|
+
|
|
29
|
+
## Using it
|
|
30
|
+
|
|
31
|
+
```svelte
|
|
32
|
+
<script lang="ts">
|
|
33
|
+
import { DataTable, type TableColumn } from "@ui-organized/svelte-table";
|
|
34
|
+
import "@ui-organized/svelte-table/styles";
|
|
35
|
+
|
|
36
|
+
interface Member { id: string; name: string; role: string }
|
|
37
|
+
let { members }: { members: Member[] } = $props();
|
|
38
|
+
|
|
39
|
+
const columns: TableColumn<Member>[] = [
|
|
40
|
+
{ accessorKey: "name", header: "Name", meta: { primary: true, filter: true } },
|
|
41
|
+
{ accessorKey: "role", header: "Role", meta: { filter: { type: "enum" } } },
|
|
42
|
+
];
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<DataTable
|
|
46
|
+
data={members}
|
|
47
|
+
{columns}
|
|
48
|
+
label="Members"
|
|
49
|
+
getRowId={(row) => row.id}
|
|
50
|
+
selection="multiple"
|
|
51
|
+
/>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`createDataTable` takes its options as a **getter** — `createDataTable(() => props)`
|
|
55
|
+
— so every option is read inside a `$derived` and a reactive source keeps the
|
|
56
|
+
table in step.
|
|
57
|
+
|
|
58
|
+
Everything it returns is a getter over a rune, so a component writes `table.rows`
|
|
59
|
+
and the read is tracked. No `.value`, no wrapper type: the same property access
|
|
60
|
+
React has, with Svelte's reactivity behind it.
|
|
61
|
+
|
|
62
|
+
## What is Svelte's rather than React's
|
|
63
|
+
|
|
64
|
+
**`createDeferred`** stands in for React's `useDeferredValue`. The table splits
|
|
65
|
+
every expensive filter in two: the search string and the condition list update
|
|
66
|
+
urgently, so an input never lags a keystroke, while the row-model pass they drive
|
|
67
|
+
reads a deferred copy. Without the split, typing "ada" lands as "a". It is a
|
|
68
|
+
deliberate transcription of `@ui-organized/vue-table`'s answer rather than a
|
|
69
|
+
second design — two answers to one problem in one design system would be a defect
|
|
70
|
+
in itself.
|
|
71
|
+
|
|
72
|
+
**`trackStore`** binds core's framework-free stores with `$state` plus the
|
|
73
|
+
store's own subscription, which is exactly what `table-core`'s `state.ts`
|
|
74
|
+
predicted when it chose that store shape.
|
|
75
|
+
|
|
76
|
+
## One workaround, and why
|
|
77
|
+
|
|
78
|
+
`autoResetPageIndex` is turned off and replaced with an explicit effect. See the
|
|
79
|
+
comment in `core/createDataTable.svelte.ts`: `@tanstack/svelte-table@9.2.4` backs
|
|
80
|
+
its options store with `$state`, which deep-proxies, so `table.options.data` comes
|
|
81
|
+
back as a fresh proxy of the same array on every sync. The core row model
|
|
82
|
+
memoizes on that identity, rebuilds every time, and resets the page — which made
|
|
83
|
+
paging do nothing at all. Vue's adapter uses `shallowRef` and does not proxy, so
|
|
84
|
+
neither Vue nor React sees it. Remove both halves when the adapter stops
|
|
85
|
+
proxying.
|
|
86
|
+
|
|
87
|
+
## Scope
|
|
88
|
+
|
|
89
|
+
**Not in v1:** grouping and aggregation, expandable sub-rows, URL or
|
|
90
|
+
localStorage state persistence. Everything else the table does is listed under
|
|
91
|
+
[`@ui-organized/table-core`'s scope](../table-core#scope) — the behaviour lives
|
|
92
|
+
in the engine, so it is identical across all four adapters.
|
|
93
|
+
|
|
94
|
+
## Peer dependencies
|
|
95
|
+
|
|
96
|
+
`svelte >= 5.20`, `@ui-organized/svelte >= 0.1.0`.
|
|
97
|
+
|
|
98
|
+
## License
|
|
99
|
+
|
|
100
|
+
Apache-2.0
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Layer 3: the whole table from a props object.
|
|
3
|
+
|
|
4
|
+
It composes exactly the parts a consumer would compose by hand — which is the
|
|
5
|
+
test of whether layer 2 is real. Anything this does that the parts cannot is a
|
|
6
|
+
gap in the parts, not a feature of the wrapper.
|
|
7
|
+
-->
|
|
8
|
+
<script lang="ts" generics="T extends RowData">
|
|
9
|
+
import type { RowData } from "@ui-organized/table-core";
|
|
10
|
+
import { createDataTable } from "../core/createDataTable.svelte.js";
|
|
11
|
+
import { setTable } from "../core/tableContext.js";
|
|
12
|
+
import type { UseDataTableOptions } from "../core/types.js";
|
|
13
|
+
import {
|
|
14
|
+
Table,
|
|
15
|
+
TableBody,
|
|
16
|
+
TableFooter,
|
|
17
|
+
TableHeader,
|
|
18
|
+
TableViewport,
|
|
19
|
+
} from "../components/Table/index.js";
|
|
20
|
+
import { TableCards } from "../components/TableCards/index.js";
|
|
21
|
+
import { TableDetailSheet } from "../components/TableDetailSheet/index.js";
|
|
22
|
+
import { TablePagination } from "../components/TablePagination/index.js";
|
|
23
|
+
import { TableSelectionFooter } from "../components/TableSelectionFooter/index.js";
|
|
24
|
+
import { TableSubBar } from "../components/TableSubBar/index.js";
|
|
25
|
+
import { TableToolbar } from "../components/TableToolbar/index.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* `$props()` is reactive, so the whole object is handed to the composable as a
|
|
29
|
+
* **getter** and every option read inside a `$derived` follows it.
|
|
30
|
+
*
|
|
31
|
+
* Svelte needs no equivalent of Vue's `withDefaults(..., { sortable: undefined })`
|
|
32
|
+
* dance: `$props()` leaves an absent prop absent rather than casting a Boolean
|
|
33
|
+
* to `false`, so `?? true` in the composable means what it says. That bug cost
|
|
34
|
+
* the Vue port a table with no toolbar, no sorting, no search and no filters
|
|
35
|
+
* — silently, because the first frame looked correct.
|
|
36
|
+
*/
|
|
37
|
+
let props: UseDataTableOptions<T> & { class?: string } = $props();
|
|
38
|
+
|
|
39
|
+
const table = createDataTable<T>(() => props);
|
|
40
|
+
setTable(table);
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<Table class={props.class}>
|
|
44
|
+
<TableToolbar />
|
|
45
|
+
<TableSubBar />
|
|
46
|
+
|
|
47
|
+
{#if table.mode === "cards"}
|
|
48
|
+
<TableCards />
|
|
49
|
+
<!-- No viewport to ride in: the table view's footer lives inside
|
|
50
|
+
TableViewport, so only card mode places one here. -->
|
|
51
|
+
<TableSelectionFooter />
|
|
52
|
+
{:else}
|
|
53
|
+
<TableViewport>
|
|
54
|
+
<TableHeader />
|
|
55
|
+
<TableBody />
|
|
56
|
+
<TableFooter />
|
|
57
|
+
</TableViewport>
|
|
58
|
+
{/if}
|
|
59
|
+
|
|
60
|
+
{#if props.paginated}<TablePagination />{/if}
|
|
61
|
+
{#if props.detail}<TableDetailSheet />{/if}
|
|
62
|
+
</Table>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { RowData } from "@ui-organized/table-core";
|
|
2
|
+
import type { UseDataTableOptions } from "../core/types.js";
|
|
3
|
+
declare function $$render<T extends RowData>(): {
|
|
4
|
+
props: UseDataTableOptions<T> & {
|
|
5
|
+
class?: string;
|
|
6
|
+
};
|
|
7
|
+
exports: {};
|
|
8
|
+
bindings: "";
|
|
9
|
+
slots: {};
|
|
10
|
+
events: {};
|
|
11
|
+
};
|
|
12
|
+
declare class __sveltets_Render<T extends RowData> {
|
|
13
|
+
props(): ReturnType<typeof $$render<T>>['props'];
|
|
14
|
+
events(): ReturnType<typeof $$render<T>>['events'];
|
|
15
|
+
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
16
|
+
bindings(): "";
|
|
17
|
+
exports(): {};
|
|
18
|
+
}
|
|
19
|
+
interface $$IsomorphicComponent {
|
|
20
|
+
new <T extends RowData>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
21
|
+
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
22
|
+
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
23
|
+
<T extends RowData>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
24
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
25
|
+
}
|
|
26
|
+
declare const DataTable: $$IsomorphicComponent;
|
|
27
|
+
type DataTable<T extends RowData> = InstanceType<typeof DataTable<T>>;
|
|
28
|
+
export default DataTable;
|
|
29
|
+
//# sourceMappingURL=DataTable.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataTable.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/DataTable/DataTable.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAGxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAc5D,iBAAS,QAAQ,CAAC,CAAC,SAAS,OAAO;;gBAY4B,MAAM;;;;;;EAwCoD;AACzH,cAAM,iBAAiB,CAAC,CAAC,SAAS,OAAO;IACrC,KAAK,IAAI,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAChD,MAAM,IAAI,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IAClD,KAAK,IAAI,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAChD,QAAQ;IACR,OAAO;CACV;AAED,UAAU,qBAAqB;IAC3B,KAAK,CAAC,SAAS,OAAO,EAAE,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAA;KAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC5Y,CAAC,CAAC,SAAS,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC3I,YAAY,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;CACjE;AACD,QAAA,MAAM,SAAS,EAAE,qBAAmC,CAAC;AACnC,KAAK,SAAS,CAAC,CAAC,SAAS,OAAO,IAAI,YAAY,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACxE,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataTable.test.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/DataTable/DataTable.test.svelte.ts"],"names":[],"mappings":""}
|