arthub-table 0.0.3

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.
Files changed (123) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/LICENSE +21 -0
  3. package/README.md +257 -0
  4. package/dist/arthub-table.common.js +2 -0
  5. package/dist/arthub-table.common.js.map +1 -0
  6. package/dist/arthub-table.css +1 -0
  7. package/dist/arthub-table.umd.js +2 -0
  8. package/dist/arthub-table.umd.js.map +1 -0
  9. package/dist/arthub-table.umd.min.js +2 -0
  10. package/dist/arthub-table.umd.min.js.map +1 -0
  11. package/dist/demo.html +1 -0
  12. package/dist/img/ah-icon_audio_pause.55c06fbf.svg +3 -0
  13. package/dist/img/ah-icon_closeshape.82e52181.svg +3 -0
  14. package/dist/img/icon_attachment.724d33ba.svg +3 -0
  15. package/dist/img/icon_default.9ef1a394.svg +5 -0
  16. package/dist/img/icon_edit.9966e699.svg +3 -0
  17. package/dist/img/icon_error_dark.2a057cdd.svg +17 -0
  18. package/dist/img/icon_error_light.ac6763e9.svg +17 -0
  19. package/dist/img/icon_failure_dark.f68723a7.svg +25 -0
  20. package/dist/img/icon_failure_light.489a7167.svg +25 -0
  21. package/dist/img/icon_folder.ea3efcce.svg +11 -0
  22. package/dist/img/icon_netdisc.d8bbe2e0.svg +4 -0
  23. package/dist/img/icon_singlearrowright.6adcd336.svg +4 -0
  24. package/dist/img/icon_totalNum.23a86d16.svg +3 -0
  25. package/dist/img/icon_transform_dark.033764ea.svg +26 -0
  26. package/dist/img/icon_transform_light.fa9fbcbd.svg +26 -0
  27. package/dist/img/img_3d.39b27128.svg +14 -0
  28. package/dist/img/img_aep.a898e3e7.svg +8 -0
  29. package/dist/img/img_ai.61f08a0a.svg +8 -0
  30. package/dist/img/img_audio.e4ada65c.svg +5 -0
  31. package/dist/img/img_enf.ad88f95d.svg +28 -0
  32. package/dist/img/img_excel.56663d85.svg +30 -0
  33. package/dist/img/img_exe.5e3fc198.svg +27 -0
  34. package/dist/img/img_img.ac2e0d0c.svg +8 -0
  35. package/dist/img/img_mcp.393ef169.svg +28 -0
  36. package/dist/img/img_pdf.f4da9922.svg +7 -0
  37. package/dist/img/img_ppt.d172780f.svg +26 -0
  38. package/dist/img/img_pxcook.7e9fce57.svg +18 -0
  39. package/dist/img/img_rarzip7z.e3b1de82.svg +28 -0
  40. package/dist/img/img_sketch.d49a9bd4.svg +32 -0
  41. package/dist/img/img_video.b6ac6198.svg +7 -0
  42. package/dist/img/img_word.0c1d3c88.svg +31 -0
  43. package/dist/img/img_x2d.6acc94f6.svg +28 -0
  44. package/dist/img/img_xd.cc23d09a.svg +28 -0
  45. package/dist/img/matrix-icon_finish.617f5d3e.svg +3 -0
  46. package/dist/img/matrix-icon_inprogress.3781156a.svg +3 -0
  47. package/dist/img/matrix-icon_supervise.edae43f0.svg +3 -0
  48. package/dist/types/assets/icon/iconBase64.d.ts +3 -0
  49. package/dist/types/components/Icon/index.d.ts +2 -0
  50. package/dist/types/components/clickoutside.d.ts +3 -0
  51. package/dist/types/core/Body.d.ts +142 -0
  52. package/dist/types/core/Cell.d.ts +94 -0
  53. package/dist/types/core/Clipboard.d.ts +16 -0
  54. package/dist/types/core/ColumnHeader.d.ts +24 -0
  55. package/dist/types/core/Context.d.ts +24 -0
  56. package/dist/types/core/DataGrid.d.ts +749 -0
  57. package/dist/types/core/EdgeScroller.d.ts +75 -0
  58. package/dist/types/core/Editor.d.ts +33 -0
  59. package/dist/types/core/Events.d.ts +25 -0
  60. package/dist/types/core/Footer.d.ts +37 -0
  61. package/dist/types/core/GifAnimationManager.d.ts +69 -0
  62. package/dist/types/core/GifOverlay.d.ts +33 -0
  63. package/dist/types/core/GroupRow.d.ts +80 -0
  64. package/dist/types/core/Header.d.ts +40 -0
  65. package/dist/types/core/History.d.ts +27 -0
  66. package/dist/types/core/ImageManager.d.ts +94 -0
  67. package/dist/types/core/NestedGrid.d.ts +177 -0
  68. package/dist/types/core/Paint.d.ts +101 -0
  69. package/dist/types/core/PerformanceMonitor.d.ts +96 -0
  70. package/dist/types/core/Row.d.ts +31 -0
  71. package/dist/types/core/RowHeader.d.ts +22 -0
  72. package/dist/types/core/Scroller.d.ts +33 -0
  73. package/dist/types/core/Selector.d.ts +9 -0
  74. package/dist/types/core/StyleManager.d.ts +108 -0
  75. package/dist/types/core/Tooltip.d.ts +28 -0
  76. package/dist/types/core/Validator.d.ts +26 -0
  77. package/dist/types/core/config.d.ts +5 -0
  78. package/dist/types/core/constants.d.ts +39 -0
  79. package/dist/types/core/element.d.ts +36 -0
  80. package/dist/types/core/extension-type-mapping.d.ts +5 -0
  81. package/dist/types/core/footer/utils.d.ts +7 -0
  82. package/dist/types/core/types.d.ts +399 -0
  83. package/dist/types/core/util.d.ts +17 -0
  84. package/dist/types/core/viewers/BooleanViewer.d.ts +46 -0
  85. package/dist/types/core/viewers/DatetimeViewer.d.ts +33 -0
  86. package/dist/types/core/viewers/DeliverableReviewViewer.d.ts +87 -0
  87. package/dist/types/core/viewers/FileStorageSpecViewer.d.ts +37 -0
  88. package/dist/types/core/viewers/FileViewer.d.ts +118 -0
  89. package/dist/types/core/viewers/GroupHeaderViewer.d.ts +73 -0
  90. package/dist/types/core/viewers/HyperlinkTextViewer.d.ts +80 -0
  91. package/dist/types/core/viewers/ImageViewer.d.ts +31 -0
  92. package/dist/types/core/viewers/ItfsPathViewer.d.ts +58 -0
  93. package/dist/types/core/viewers/ModuleViewer.d.ts +53 -0
  94. package/dist/types/core/viewers/NestedGridViewer.d.ts +47 -0
  95. package/dist/types/core/viewers/PersonViewer.d.ts +61 -0
  96. package/dist/types/core/viewers/PivotViewer.d.ts +43 -0
  97. package/dist/types/core/viewers/PriorityTextViewer.d.ts +35 -0
  98. package/dist/types/core/viewers/ProgressViewer.d.ts +68 -0
  99. package/dist/types/core/viewers/PunchTimingViewer.d.ts +42 -0
  100. package/dist/types/core/viewers/PunchViewer.d.ts +116 -0
  101. package/dist/types/core/viewers/RichTextViewer.d.ts +83 -0
  102. package/dist/types/core/viewers/SelectViewer.d.ts +57 -0
  103. package/dist/types/core/viewers/SeparatorRowViewer.d.ts +25 -0
  104. package/dist/types/core/viewers/StatusTextViewer.d.ts +40 -0
  105. package/dist/types/core/viewers/StatusViewer.d.ts +53 -0
  106. package/dist/types/core/viewers/TableActionButtonViewer.d.ts +77 -0
  107. package/dist/types/core/viewers/TaskNodeViewer.d.ts +106 -0
  108. package/dist/types/core/viewers/TextViewer.d.ts +37 -0
  109. package/dist/types/core/viewers/TextViewerWithSwitcher.d.ts +112 -0
  110. package/dist/types/core/viewers/ThemeViewer.d.ts +36 -0
  111. package/dist/types/core/viewers/TreeDropdownViewer.d.ts +55 -0
  112. package/dist/types/core/viewers/UpstreamViewer.d.ts +79 -0
  113. package/dist/types/core/viewers/ViewerRegistry.d.ts +76 -0
  114. package/dist/types/core/viewers/WfStateViewer.d.ts +76 -0
  115. package/dist/types/core/viewers/WorkflowViewer.d.ts +37 -0
  116. package/dist/types/core/viewers/index.d.ts +114 -0
  117. package/dist/types/core/viewers/types.d.ts +1097 -0
  118. package/dist/types/index.d.ts +37 -0
  119. package/dist/types/testing/SnapshotManager.d.ts +55 -0
  120. package/dist/types/testing/TestHooks.d.ts +275 -0
  121. package/dist/types/testing/index.d.ts +3 -0
  122. package/dist/types/testing/installTestHooks.d.ts +16 -0
  123. package/package.json +126 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,36 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [1.0.0] - 2026-02-13
11
+
12
+ ### Added
13
+
14
+ - Initial release of canvas-table as an NPM package
15
+ - High-performance canvas-based table rendering engine
16
+ - Vue 3 component (`DataGrid`) with full TypeScript support
17
+ - **Cell Viewers**: 20+ built-in cell viewer types
18
+ - Text, Select, Image, Person, Progress, Datetime, Boolean, Status
19
+ - GroupHeader, SeparatorRow, NestedGrid, Punch, Hyperlink, File
20
+ - TaskNode, Module, TextWithSwitcher, Upstream, TableActionButton
21
+ - **Viewer Registry**: Centralized viewer registration and management system
22
+ - **Grouped Tables**: Multi-level grouping with collapsible group headers
23
+ - **Nested Grids**: Support for nested table within cells
24
+ - **Virtual Scrolling**: Efficient rendering for large datasets
25
+ - **Column Features**: Resizing, reordering, fixed columns, multi-level headers
26
+ - **Row Features**: Row selection, drag reorder, row height customization
27
+ - **Cell Features**: Cell editing, validation, clipboard (copy/paste/clear), autofill
28
+ - **Theming**: Light/dark theme support with custom style registration
29
+ - **Striped Rows**: Optional row striping for visual clarity
30
+ - **Loading State**: Cell-level loading indicators with timeout support
31
+ - **GIF Support**: Animated GIF rendering in cells
32
+ - **Image Management**: Async image loading with caching
33
+ - **Keyboard Navigation**: Full keyboard support for cell navigation
34
+ - **Event System**: Rich event API for cell clicks, edits, selections, etc.
35
+ - Complete TypeScript type definitions for all public APIs
36
+ - Comprehensive export of types, viewers, utilities, and constants
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 canvas-table contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,257 @@
1
+ # canvas-table
2
+
3
+ > High-performance canvas-based table/grid component for Vue 3 with TypeScript support.
4
+
5
+ ## Features
6
+
7
+ - 🚀 **Canvas Rendering**: High-performance rendering engine using HTML5 Canvas
8
+ - 📊 **Virtual Scrolling**: Efficiently handles large datasets with smooth scrolling
9
+ - 🎨 **20+ Built-in Cell Viewers**: Text, Select, Image, Person, Progress, Status, DateTime, Boolean, and more
10
+ - 🔌 **Extensible Viewer System**: Register custom cell viewers through the Viewer Registry
11
+ - 📦 **Grouped Tables**: Multi-level collapsible group headers
12
+ - 📐 **Nested Grids**: Support for nested table within cells
13
+ - 📋 **Clipboard**: Copy, paste, and clear cell content
14
+ - ✏️ **Cell Editing**: Inline editing with validation support
15
+ - 🔒 **Fixed Columns**: Pin columns to left or right
16
+ - 📏 **Resizable Columns**: Drag to resize column widths
17
+ - 🔄 **Drag & Drop**: Reorder rows and columns via drag and drop
18
+ - 🎯 **Cell Selection**: Single and multi-cell selection with keyboard navigation
19
+ - ✅ **Validation**: Built-in cell validation with custom rules
20
+ - 🌗 **Theming**: Light/dark theme support with custom style registration
21
+ - 📱 **TypeScript**: Full TypeScript type definitions
22
+
23
+ ## Installation
24
+
25
+ ```bash
26
+ npm install canvas-table
27
+ ```
28
+
29
+ ## Quick Start
30
+
31
+ ```vue
32
+ <template>
33
+ <DataGrid
34
+ :columns="columns"
35
+ :data="data"
36
+ :width="800"
37
+ :height="400"
38
+ @after-edit-cell="handleEdit"
39
+ />
40
+ </template>
41
+
42
+ <script setup lang="ts">
43
+ import { ref } from "vue";
44
+ import { DataGrid } from "canvas-table";
45
+ import type { ColumnConfig } from "canvas-table";
46
+
47
+ const columns = ref<ColumnConfig[]>([
48
+ { title: "Name", key: "name", width: 200, type: "text" },
49
+ { title: "Age", key: "age", width: 100, type: "number" },
50
+ { title: "Email", key: "email", width: 300, type: "text" },
51
+ ]);
52
+
53
+ const data = ref([
54
+ { id: 1, name: "Alice", age: 28, email: "alice@example.com" },
55
+ { id: 2, name: "Bob", age: 32, email: "bob@example.com" },
56
+ ]);
57
+
58
+ const handleEdit = (editData: any) => {
59
+ console.log("Cell edited:", editData);
60
+ };
61
+ </script>
62
+ ```
63
+
64
+ ## Using Cell Viewers
65
+
66
+ Cell viewers provide rich data rendering within cells:
67
+
68
+ ```vue
69
+ <script setup lang="ts">
70
+ import { DataGrid, registerDefaultViewers } from "canvas-table";
71
+ import type { ColumnConfig } from "canvas-table";
72
+
73
+ // Register all built-in viewers (call once at app startup)
74
+ registerDefaultViewers();
75
+
76
+ const columns = ref<ColumnConfig[]>([
77
+ { title: "Task", key: "task", width: 200, type: "text", useViewer: true },
78
+ {
79
+ title: "Status",
80
+ key: "status",
81
+ width: 120,
82
+ type: "status",
83
+ useViewer: true,
84
+ options: [
85
+ { label: "To Do", value: "todo", color: "#909399" },
86
+ { label: "Done", value: "done", color: "#67C23A" },
87
+ ],
88
+ },
89
+ {
90
+ title: "Progress",
91
+ key: "progress",
92
+ width: 180,
93
+ type: "progress",
94
+ useViewer: true,
95
+ },
96
+ {
97
+ title: "Assignee",
98
+ key: "assignee",
99
+ width: 150,
100
+ type: "person",
101
+ useViewer: true,
102
+ },
103
+ ]);
104
+ </script>
105
+ ```
106
+
107
+ ### Available Viewer Types
108
+
109
+ | Type | Description | Data Type |
110
+ | --------------------- | ------------------------- | ----------------------------- |
111
+ | `text` | Plain text display | `TextViewerData` |
112
+ | `select` | Dropdown select with tags | `SelectViewerData` |
113
+ | `image` | Image display | `ImageViewerData` |
114
+ | `person` | User avatar and name | `PersonViewerData` |
115
+ | `progress` | Progress bar (draggable) | `ProgressViewerData` |
116
+ | `datetime` | Date/time display | `DatetimeViewerData` |
117
+ | `boolean` | Checkbox toggle | `BooleanViewerData` |
118
+ | `status` | Status badge | `StatusViewerData` |
119
+ | `hyperlink` | Clickable link | `HyperlinkTextViewerData` |
120
+ | `file` | File preview | `FileViewerData` |
121
+ | `module` | Module tags | `ModuleViewerData` |
122
+ | `table-action-button` | Action buttons | `TableActionButtonViewerData` |
123
+ | `nested` | Nested grid | `NestedGridViewerData` |
124
+ | `group-header` | Group header row | `GroupHeaderViewerData` |
125
+
126
+ ## API
127
+
128
+ ### DataGrid Props
129
+
130
+ | Prop | Type | Default | Description |
131
+ | ---------------- | ---------------- | ----------------- | --------------------------- |
132
+ | `rowKey` | `string` | `'id'` | Row unique identifier field |
133
+ | `width` | `number` | - | Table width in pixels |
134
+ | `height` | `number` | - | Table height in pixels |
135
+ | `columns` | `ColumnConfig[]` | `[]` | Column definitions |
136
+ | `data` | `any[]` | `[]` | Table data array |
137
+ | `datePattern` | `string` | `'absolute_date'` | Date display type |
138
+ | `customAutofill` | `Function` | - | Custom autofill handler |
139
+
140
+ ### DataGrid Events
141
+
142
+ | Event | Payload | Description |
143
+ | ------------------------ | ------------------------------------------ | ------------------------------- |
144
+ | `after-edit-cell` | `data` | Fired after a cell is edited |
145
+ | `after-autofill` | `data` | Fired after autofill |
146
+ | `after-paste` | `data` | Fired after paste |
147
+ | `after-clear` | `data` | Fired after clear |
148
+ | `on-load` | - | Fired when grid is loaded |
149
+ | `on-cell-text-click` | `rowData, colId` | Fired when cell text is clicked |
150
+ | `on-group-toggle` | `groupRow, expanded` | Fired when group is toggled |
151
+ | `on-row-drag-reorder` | `draggedRows, targetIndex` | Fired after row drag reorder |
152
+ | `on-column-drag-reorder` | `draggedColIds, targetColId, insertBefore` | Fired after column reorder |
153
+
154
+ ### DataGrid Methods (via ref)
155
+
156
+ | Method | Description |
157
+ | ------------------------------ | ------------------------------ |
158
+ | `reload()` | Resize and redraw |
159
+ | `loadData(data)` | Load new data |
160
+ | `getData()` | Get current data |
161
+ | `getCheckedRows()` | Get checked rows |
162
+ | `getChangedRows()` | Get changed rows |
163
+ | `validate(callback)` | Validate all cells |
164
+ | `setTheme(theme)` | Set theme ('light' or 'dark') |
165
+ | `setStriped(enabled)` | Enable/disable striped rows |
166
+ | `showLoading(rowIds, colKeys)` | Show loading on specific cells |
167
+ | `hideLoading(rowIds, colKeys)` | Hide loading on specific cells |
168
+ | `setSelectedRows(rowIds)` | Set selected rows |
169
+
170
+ ## TypeScript Types
171
+
172
+ canvas-table exports comprehensive TypeScript types:
173
+
174
+ ```typescript
175
+ import type {
176
+ ColumnConfig,
177
+ CellData,
178
+ RowData,
179
+ HeaderConfig,
180
+ // Viewer types
181
+ CellViewer,
182
+ CellViewerData,
183
+ TextViewerData,
184
+ SelectViewerData,
185
+ ProgressViewerData,
186
+ // Group types
187
+ GroupRowData,
188
+ GroupedTableRowData,
189
+ } from "canvas-table";
190
+ ```
191
+
192
+ ## Local Development (with AssetMatrix)
193
+
194
+ ### Using webpack alias
195
+
196
+ 1. Create `.env.local` in AssetMatrix project root:
197
+
198
+ ```env
199
+ USE_LOCAL_CANVAS_TABLE=true
200
+ LOCAL_CANVAS_TABLE_PATH=../canvas-table
201
+ ```
202
+
203
+ 2. Start canvas-table dev server:
204
+
205
+ ```bash
206
+ cd canvas-table
207
+ npm run serve
208
+ ```
209
+
210
+ 3. Start AssetMatrix with local canvas-table:
211
+
212
+ ```bash
213
+ cd AssetMatrix
214
+ npm run dev:local-canvas
215
+ ```
216
+
217
+ ### Using npm link
218
+
219
+ ```bash
220
+ # In canvas-table directory
221
+ npm link
222
+
223
+ # In AssetMatrix directory
224
+ npm link canvas-table
225
+ ```
226
+
227
+ ## Building
228
+
229
+ ```bash
230
+ # Build library (CommonJS + UMD + types)
231
+ npm run build
232
+
233
+ # Build demo site
234
+ npm run build:demo
235
+
236
+ # Build only type declarations
237
+ npm run build:types
238
+ ```
239
+
240
+ ## Publishing
241
+
242
+ ```bash
243
+ # Bump version and publish
244
+ npm version patch # or minor, or major
245
+ npm publish
246
+ ```
247
+
248
+ Or push a version tag to trigger CI/CD:
249
+
250
+ ```bash
251
+ git tag v1.0.1
252
+ git push origin v1.0.1
253
+ ```
254
+
255
+ ## License
256
+
257
+ [MIT](LICENSE)