intable 0.0.33 → 0.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +10 -464
- package/dist/__uno.css +1 -1
- package/dist/components/Filter.js +1 -3
- package/dist/components/Popover.d.ts +2 -2
- package/dist/components/Popover.js +28 -17
- package/dist/components/Tooltip.d.ts +19 -0
- package/dist/components/Tooltip.js +26 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -4
- package/dist/plugins/AutoFillPlugin.js +6 -5
- package/dist/plugins/TooltipPlugin.d.ts +13 -0
- package/dist/plugins/TooltipPlugin.js +40 -0
- package/dist/style.css +2 -2
- package/dist/theme/antd.scss +41 -41
- package/dist/theme/dark.scss +46 -46
- package/dist/theme/element-plus.scss +38 -38
- package/dist/theme/github.scss +80 -80
- package/dist/theme/material.scss +73 -73
- package/dist/theme/shadcn.scss +66 -66
- package/dist/theme/stripe.scss +57 -57
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 huodoushigemi
|
|
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.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 huodoushigemi
|
|
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
CHANGED
|
@@ -1,464 +1,10 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: intable
|
|
3
|
-
description: A high-performance, plugin-based Excel-like table component for SolidJS with virtual scroll, cell editing, validation, copy/paste, row grouping, tree data, column/row drag, merge cells, diff view, and multi-framework support (Vue, React).
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# intable
|
|
7
|
-
|
|
8
|
-
##
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- 单元格多选、复制、粘贴
|
|
12
|
-
- 单元格编辑、数据校验
|
|
13
|
-
- 列宽、行高可调整
|
|
14
|
-
- 列、行可拖拽
|
|
15
|
-
- 虚拟滚动
|
|
16
|
-
- 数据分组
|
|
17
|
-
- 行展开
|
|
18
|
-
- 树嵌套
|
|
19
|
-
- 插件易扩展
|
|
20
|
-
- 多框架支持(Vue、React)
|
|
21
|
-
- 多 UI库支持(Antd、ElementPlus)
|
|
22
|
-
|
|
23
|
-
## 快速开始
|
|
24
|
-
|
|
25
|
-
<details>
|
|
26
|
-
<summary>solid-js</summary>
|
|
27
|
-
|
|
28
|
-
**安装**
|
|
29
|
-
|
|
30
|
-
```sh
|
|
31
|
-
pnpm add intable
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
**使用**
|
|
35
|
-
|
|
36
|
-
```jsx
|
|
37
|
-
import Intable from 'intable'
|
|
38
|
-
|
|
39
|
-
const App = () => {
|
|
40
|
-
const columns = [
|
|
41
|
-
{ id: 'name', name: '名称' },
|
|
42
|
-
{ id: 'date', name: '日期' },
|
|
43
|
-
{ id: 'address', name: '地址' },
|
|
44
|
-
]
|
|
45
|
-
|
|
46
|
-
const data = [
|
|
47
|
-
{ date: '2016-05-03', name: 'Tom', address: 'No. 189, Grove St, Los Angeles' },
|
|
48
|
-
{ date: '2016-05-02', name: 'Tom', address: 'No. 189, Grove St, Los Angeles' },
|
|
49
|
-
{ date: '2016-05-04', name: 'Tom', address: 'No. 189, Grove St, Los Angeles' },
|
|
50
|
-
{ date: '2016-05-01', name: 'Tom', address: 'No. 189, Grove St, Los Angeles' },
|
|
51
|
-
]
|
|
52
|
-
|
|
53
|
-
return <Intable data={data} columns={columns} />
|
|
54
|
-
}
|
|
55
|
-
```
|
|
56
|
-
</details>
|
|
57
|
-
|
|
58
|
-
<details>
|
|
59
|
-
<summary>vue</summary>
|
|
60
|
-
|
|
61
|
-
**安装**
|
|
62
|
-
|
|
63
|
-
```sh
|
|
64
|
-
pnpm add @intable/vue
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
**使用**
|
|
68
|
-
|
|
69
|
-
```html
|
|
70
|
-
<template>
|
|
71
|
-
<Intable :data="data" :columns="columns" />
|
|
72
|
-
</template>
|
|
73
|
-
|
|
74
|
-
<script setup>
|
|
75
|
-
import Intable from '@intable/vue'
|
|
76
|
-
|
|
77
|
-
const columns = [
|
|
78
|
-
{ id: 'name', name: '名称' },
|
|
79
|
-
{ id: 'date', name: '日期' },
|
|
80
|
-
{ id: 'address', name: '地址' },
|
|
81
|
-
]
|
|
82
|
-
|
|
83
|
-
const data = [
|
|
84
|
-
{ date: '2016-05-03', name: 'Tom', address: 'No. 189, Grove St, Los Angeles' },
|
|
85
|
-
{ date: '2016-05-02', name: 'Tom', address: 'No. 189, Grove St, Los Angeles' },
|
|
86
|
-
{ date: '2016-05-04', name: 'Tom', address: 'No. 189, Grove St, Los Angeles' },
|
|
87
|
-
{ date: '2016-05-01', name: 'Tom', address: 'No. 189, Grove St, Los Angeles' },
|
|
88
|
-
]
|
|
89
|
-
</script>
|
|
90
|
-
```
|
|
91
|
-
</details>
|
|
92
|
-
|
|
93
|
-
<details>
|
|
94
|
-
<summary>react</summary>
|
|
95
|
-
|
|
96
|
-
**安装**
|
|
97
|
-
|
|
98
|
-
```sh
|
|
99
|
-
pnpm add @intable/react
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
**使用**
|
|
103
|
-
|
|
104
|
-
```jsx
|
|
105
|
-
import Intable from '@intable/react'
|
|
106
|
-
|
|
107
|
-
const App = () => {
|
|
108
|
-
const columns = [
|
|
109
|
-
{ id: 'name', name: '名称' },
|
|
110
|
-
{ id: 'date', name: '日期' },
|
|
111
|
-
{ id: 'address', name: '地址' },
|
|
112
|
-
]
|
|
113
|
-
|
|
114
|
-
const data = [
|
|
115
|
-
{ date: '2016-05-03', name: 'Tom', address: 'No. 189, Grove St, Los Angeles' },
|
|
116
|
-
{ date: '2016-05-02', name: 'Tom', address: 'No. 189, Grove St, Los Angeles' },
|
|
117
|
-
{ date: '2016-05-04', name: 'Tom', address: 'No. 189, Grove St, Los Angeles' },
|
|
118
|
-
{ date: '2016-05-01', name: 'Tom', address: 'No. 189, Grove St, Los Angeles' },
|
|
119
|
-
]
|
|
120
|
-
|
|
121
|
-
return <Intable data={data} columns={columns} />
|
|
122
|
-
}
|
|
123
|
-
```
|
|
124
|
-
</details>
|
|
125
|
-
|
|
126
|
-
## Props
|
|
127
|
-
|
|
128
|
-
| 属性名 | 描述 | 类型 | 默认值 |
|
|
129
|
-
| ------------ | ------------ | ------------------------------- | ------- |
|
|
130
|
-
| data | 数据 | any[] | |
|
|
131
|
-
| columns | 展示列 | Column[] | |
|
|
132
|
-
| rowKey | 行唯一键字段 | string | `'id'` |
|
|
133
|
-
| index | 显示序号 | boolean | false |
|
|
134
|
-
| border | 显示纵向边框 | boolean | false |
|
|
135
|
-
| stickyHeader | 表头吸顶 | boolean | false |
|
|
136
|
-
| size | 尺寸 | `'large' \| 'default' \| 'small'` | — |
|
|
137
|
-
| plugins | 插件列表 | Plugin[] | `[]` |
|
|
138
|
-
|
|
139
|
-
## Column
|
|
140
|
-
|
|
141
|
-
| 属性名 | 描述 | 类型 |
|
|
142
|
-
| -------- | ---------------------- | ----------------------------- |
|
|
143
|
-
| id | 字段名,对应数据 key | string \| symbol |
|
|
144
|
-
| name | 表头显示名称 | string |
|
|
145
|
-
| width | 列宽(px) | number |
|
|
146
|
-
| fixed | 固定列 | `'left' \| 'right'` |
|
|
147
|
-
| render | 自定义渲染器 | `string \| Render` |
|
|
148
|
-
| enum | 枚举映射 | `Record<string,any> \| {label?,value}[]` |
|
|
149
|
-
| editable | 是否可编辑 | boolean |
|
|
150
|
-
| editor | 编辑器类型或自定义实现 | `string \| Editor` |
|
|
151
|
-
| resizable| 是否允许调整列宽 | boolean |
|
|
152
|
-
|
|
153
|
-
## 插件
|
|
154
|
-
|
|
155
|
-
其他插件通过 `plugins` 属性传入,需从对应路径手动引入。
|
|
156
|
-
|
|
157
|
-
---
|
|
158
|
-
|
|
159
|
-
### VirtualScrollPlugin — 虚拟滚动
|
|
160
|
-
|
|
161
|
-
大数据量下只渲染可见行列,显著提升性能。
|
|
162
|
-
|
|
163
|
-
```jsx
|
|
164
|
-
import { VirtualScrollPlugin } from 'intable/plugins/VirtualScrollPlugin'
|
|
165
|
-
|
|
166
|
-
<Intable
|
|
167
|
-
plugins={[VirtualScrollPlugin]}
|
|
168
|
-
virtual={{
|
|
169
|
-
y: { estimateSize: () => 40, overscan: 10 }, // 行虚拟化参数
|
|
170
|
-
x: { overscan: 5 }, // 列虚拟化参数
|
|
171
|
-
}}
|
|
172
|
-
/>
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
---
|
|
176
|
-
|
|
177
|
-
### EditablePlugin — 单元格编辑
|
|
178
|
-
|
|
179
|
-
在 Column 上设置 `editable: true` 开启单元格编辑,双击或输入字符进入编辑状态。
|
|
180
|
-
|
|
181
|
-
```jsx
|
|
182
|
-
const columns = [
|
|
183
|
-
{ id: 'name', name: '姓名', editable: true },
|
|
184
|
-
{ id: 'age', name: '年龄', editable: true, editor: 'number' },
|
|
185
|
-
{ id: 'type', name: '类型', editable: true, editor: 'select', enum: { 1: 'A', 2: 'B' } },
|
|
186
|
-
{ id: 'date', name: '日期', editable: true, editor: 'date' },
|
|
187
|
-
]
|
|
188
|
-
|
|
189
|
-
<Intable columns={columns} onDataChange={setData} />
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
内置编辑器类型:`text`(默认)、`number`、`select`、`date`、`time`、`datetime`、`switch`、`checkbox`、`rate`、`color`、`file`。
|
|
193
|
-
|
|
194
|
-
搭配 UI 库插件可直接使用对应组件:
|
|
195
|
-
- **Antd**:`import { AntdPlugin } from '@intable/react/plugins/antd'`
|
|
196
|
-
- **Element Plus**:`import { ElementPlusPlugin } from '@intable/vue/plugins/element-plus'`
|
|
197
|
-
|
|
198
|
-
---
|
|
199
|
-
|
|
200
|
-
### RowSelectionPlugin — 行选择
|
|
201
|
-
|
|
202
|
-
```jsx
|
|
203
|
-
<Intable
|
|
204
|
-
rowSelection={{
|
|
205
|
-
enable: true,
|
|
206
|
-
multiple: true, // 多选,默认 true
|
|
207
|
-
value: selectedRows, // 受控选中值
|
|
208
|
-
selectable: row => row.age > 18, // 可选条件
|
|
209
|
-
onChange: rows => setSelected(rows),
|
|
210
|
-
}}
|
|
211
|
-
/>
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
---
|
|
215
|
-
|
|
216
|
-
### ExpandPlugin — 行展开
|
|
217
|
-
|
|
218
|
-
点击行首箭头展开自定义内容区域。
|
|
219
|
-
|
|
220
|
-
```jsx
|
|
221
|
-
<Intable
|
|
222
|
-
expand={{
|
|
223
|
-
enable: true,
|
|
224
|
-
render: ({ data, y }) => <div>详情:{data.name}</div>,
|
|
225
|
-
}}
|
|
226
|
-
/>
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
---
|
|
230
|
-
|
|
231
|
-
### RowGroupPlugin — 行分组
|
|
232
|
-
|
|
233
|
-
按指定字段对行进行分级树形分组,支持展开/折叠。
|
|
234
|
-
|
|
235
|
-
```jsx
|
|
236
|
-
<Intable
|
|
237
|
-
rowGroup={{ fields: ['type', 'subType'] }}
|
|
238
|
-
/>
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
---
|
|
242
|
-
|
|
243
|
-
### TreePlugin — 树形数据
|
|
244
|
-
|
|
245
|
-
渲染嵌套 `children` 字段的树状数据,支持展开/折叠,自动缩进。
|
|
246
|
-
|
|
247
|
-
```jsx
|
|
248
|
-
const data = [
|
|
249
|
-
{ id: 1, name: '总部', children: [
|
|
250
|
-
{ id: 2, name: '研发部' },
|
|
251
|
-
{ id: 3, name: '产品部', children: [
|
|
252
|
-
{ id: 4, name: '设计组' },
|
|
253
|
-
]},
|
|
254
|
-
]},
|
|
255
|
-
]
|
|
256
|
-
|
|
257
|
-
<Intable
|
|
258
|
-
tree={{ children: 'children' }} // 子节点字段名,默认 'children'
|
|
259
|
-
data={data}
|
|
260
|
-
columns={[{ id: 'name', name: '名称' }]}
|
|
261
|
-
/>
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
---
|
|
265
|
-
|
|
266
|
-
### ResizePlugin — 调整列宽 / 行高
|
|
267
|
-
|
|
268
|
-
拖动表头右侧边框调整列宽,拖动行底部边框调整行高。
|
|
269
|
-
|
|
270
|
-
```jsx
|
|
271
|
-
<Intable
|
|
272
|
-
resizable={{
|
|
273
|
-
col: { enable: true, min: 60, max: 600 },
|
|
274
|
-
row: { enable: true, min: 28, max: 200 },
|
|
275
|
-
}}
|
|
276
|
-
onColumnsChange={cols => setColumns(cols)}
|
|
277
|
-
/>
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
也可在单列上单独控制:
|
|
281
|
-
|
|
282
|
-
```js
|
|
283
|
-
{ id: 'name', name: '姓名', resizable: false } // 禁止该列拖拽
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
---
|
|
287
|
-
|
|
288
|
-
### DragPlugin — 列 / 行拖拽排序
|
|
289
|
-
|
|
290
|
-
长按后拖拽列标题或行首单元格可重新排序。
|
|
291
|
-
|
|
292
|
-
```jsx
|
|
293
|
-
<Intable
|
|
294
|
-
colDrag={true} // 开启列拖拽
|
|
295
|
-
rowDrag={true} // 开启行拖拽
|
|
296
|
-
onColumnsChange={cols => setColumns(cols)}
|
|
297
|
-
/>
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
---
|
|
301
|
-
|
|
302
|
-
### HistoryPlugin — 撤销 / 重做
|
|
303
|
-
|
|
304
|
-
记录数据变更历史,支持 `Ctrl+Z` / `Ctrl+Y`。
|
|
305
|
-
|
|
306
|
-
```jsx
|
|
307
|
-
import { HistoryPlugin } from 'intable/plugins/HistoryPlugin'
|
|
308
|
-
|
|
309
|
-
<Intable plugins={[HistoryPlugin]} />
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
通过命令调用:
|
|
313
|
-
```js
|
|
314
|
-
store.history.undo()
|
|
315
|
-
store.history.redo()
|
|
316
|
-
```
|
|
317
|
-
|
|
318
|
-
---
|
|
319
|
-
|
|
320
|
-
### DiffPlugin — 数据差异对比
|
|
321
|
-
|
|
322
|
-
将当前数据与快照进行比较,高亮新增/删除/修改行,支持提交。
|
|
323
|
-
|
|
324
|
-
```jsx
|
|
325
|
-
import { DiffPlugin } from 'intable/plugins/DiffPlugin'
|
|
326
|
-
|
|
327
|
-
<Intable
|
|
328
|
-
plugins={[DiffPlugin]}
|
|
329
|
-
diff={{
|
|
330
|
-
added: true, // 高亮新增行,默认 true
|
|
331
|
-
removed: true, // 高亮删除行,默认 true
|
|
332
|
-
changed: true, // 高亮修改行,默认 true
|
|
333
|
-
onCommit: ({ added, removed, changed }) => save(data),
|
|
334
|
-
}}
|
|
335
|
-
/>
|
|
336
|
-
```
|
|
337
|
-
|
|
338
|
-
`Ctrl+S` 触发提交,或通过命令:
|
|
339
|
-
```js
|
|
340
|
-
store.commands.diffCommit()
|
|
341
|
-
```
|
|
342
|
-
|
|
343
|
-
---
|
|
344
|
-
|
|
345
|
-
### CellMergePlugin — 单元格合并
|
|
346
|
-
|
|
347
|
-
通过 `merge` 回调或 Column 的 `mergeRow` 快捷属性合并相邻单元格。
|
|
348
|
-
|
|
349
|
-
```jsx
|
|
350
|
-
// 方式一:全局 merge 回调
|
|
351
|
-
<Intable
|
|
352
|
-
merge={(row, col, y, x) => {
|
|
353
|
-
if (col.id === 'name') {
|
|
354
|
-
let rowspan = 1
|
|
355
|
-
while (data[y + rowspan]?.name === row.name) rowspan++
|
|
356
|
-
return rowspan > 1 ? { rowspan } : null
|
|
357
|
-
}
|
|
358
|
-
}}
|
|
359
|
-
/>
|
|
360
|
-
|
|
361
|
-
// 方式二:列级 mergeRow 快捷属性(自动合并相邻等值行)
|
|
362
|
-
const columns = [
|
|
363
|
-
{ id: 'type', name: '类型', mergeRow: true },
|
|
364
|
-
{ id: 'name', name: '名称' },
|
|
365
|
-
]
|
|
366
|
-
<Intable columns={columns} />
|
|
367
|
-
```
|
|
368
|
-
|
|
369
|
-
---
|
|
370
|
-
|
|
371
|
-
### CellSelectionPlugin — 单元格多选
|
|
372
|
-
|
|
373
|
-
鼠标拖拽或 `Shift+点击` 选择矩形区域,箭头键移动焦点。
|
|
374
|
-
|
|
375
|
-
---
|
|
376
|
-
|
|
377
|
-
### CopyPastePlugin — 复制粘贴
|
|
378
|
-
|
|
379
|
-
`Ctrl+C` 复制选中区域为 TSV 格式,`Ctrl+V` 粘贴。
|
|
380
|
-
|
|
381
|
-
---
|
|
382
|
-
|
|
383
|
-
### FilterPlugin — 列筛选(**内置**)
|
|
384
|
-
|
|
385
|
-
在 Column 上设置 `filterable: true` 开启筛选,点击表头图标弹出筛选面板。
|
|
386
|
-
|
|
387
|
-
```jsx
|
|
388
|
-
const columns = [
|
|
389
|
-
{ id: 'name', name: '姓名', type: 'text', filterable: true },
|
|
390
|
-
{ id: 'dept', name: '部门', type: 'enum', filterable: true, enum: { eng: '工程', design: '设计' } },
|
|
391
|
-
{ id: 'age', name: '年龄', type: 'number', filterable: true },
|
|
392
|
-
]
|
|
393
|
-
|
|
394
|
-
// 客户端实时过滤
|
|
395
|
-
<Intable columns={columns} data={data} filter={{ autoMatch: true }} />
|
|
396
|
-
|
|
397
|
-
// 服务端过滤
|
|
398
|
-
<Intable
|
|
399
|
-
filter={{
|
|
400
|
-
autoMatch: false,
|
|
401
|
-
onChange: filters => fetchData(filters),
|
|
402
|
-
}}
|
|
403
|
-
/>
|
|
404
|
-
```
|
|
405
|
-
|
|
406
|
-
每列 `type` 决定可用操作符:`text`、`number`、`date`、`enum`、`checkbox`。
|
|
407
|
-
|
|
408
|
-
---
|
|
409
|
-
|
|
410
|
-
### AggregatePlugin — 汇总行(**内置**)
|
|
411
|
-
|
|
412
|
-
在列上设置 `aggregate` 字段,表格底部自动显示汇总行。
|
|
413
|
-
|
|
414
|
-
```jsx
|
|
415
|
-
const columns = [
|
|
416
|
-
{ id: 'name', name: '姓名', width: 140 },
|
|
417
|
-
{ id: 'age', name: '年龄', width: 80, aggregate: 'avg' },
|
|
418
|
-
{ id: 'salary', name: '薪资', width: 110, aggregate: 'sum' },
|
|
419
|
-
{ id: 'bonus', name: '奖金', width: 100, aggregate: values => values.reduce((s, v) => s + v, 0) },
|
|
420
|
-
]
|
|
421
|
-
|
|
422
|
-
<Intable
|
|
423
|
-
columns={columns} data={data}
|
|
424
|
-
aggregate={{
|
|
425
|
-
label: '合计',
|
|
426
|
-
formatter: (val, type) => type === 'sum' ? `$${Number(val).toLocaleString()}` : val,
|
|
427
|
-
}}
|
|
428
|
-
/>
|
|
429
|
-
```
|
|
430
|
-
|
|
431
|
-
`aggregate` 列字段:`'sum'` | `'avg'` | `'min'` | `'max'` | `'count'` | `(values, col, data) => any`。
|
|
432
|
-
|
|
433
|
-
---
|
|
434
|
-
|
|
435
|
-
### AutoFillPlugin — Excel 填充手柄(**内置,默认关闭**)
|
|
436
|
-
|
|
437
|
-
选中单元格后,选区右下角出现小方块手柄,拖拽即可向四个方向填充。双击手柄可自动向下填充至相邻列最后一个非空行。
|
|
438
|
-
|
|
439
|
-
```jsx
|
|
440
|
-
// 传入 autoFill={true} 开启,需要 onDataChange 接收写入操作
|
|
441
|
-
<Intable data={data} onDataChange={setData} columns={columns} autoFill={true} />
|
|
442
|
-
```
|
|
443
|
-
|
|
444
|
-
填充规则:数字等差、日期递增、其他循环复制;单个数字默认步长为 1。
|
|
445
|
-
|
|
446
|
-
---
|
|
447
|
-
|
|
448
|
-
### ImportExportPlugin — Excel 导入 / 导出(**内置**)
|
|
449
|
-
|
|
450
|
-
需要安装依赖:`pnpm add xlsx`
|
|
451
|
-
|
|
452
|
-
```jsx
|
|
453
|
-
let store
|
|
454
|
-
|
|
455
|
-
const handleExport = () => store.commands.exportExcel() // 下载 data.xlsx
|
|
456
|
-
const handleImport = async () => {
|
|
457
|
-
const rows = await store.commands.readExcel()
|
|
458
|
-
setData(rows)
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
<Intable store={s => store = s} columns={columns} data={data} />
|
|
462
|
-
```
|
|
463
|
-
|
|
464
|
-
导出自动过滤内部列(如序号、勾选列);导入通过列名自动匹配数据。
|
|
1
|
+
---
|
|
2
|
+
name: intable
|
|
3
|
+
description: A high-performance, plugin-based Excel-like table component for SolidJS with virtual scroll, cell editing, validation, copy/paste, row grouping, tree data, column/row drag, merge cells, diff view, and multi-framework support (Vue, React).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# intable
|
|
7
|
+
|
|
8
|
+
## [🚀 在线体验 Demo](https://huodoushigemi.github.io/intable)
|
|
9
|
+
|
|
10
|
+
## [📃 文档 Docs](https://github.com/huodoushigemi/intable/blob/main/.github/instructions/intable-scenarios.instructions.md)
|
package/dist/__uno.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--un-bg-opacity:100%;--un-leading:initial;--un-content:"";--un-translate-x:initial;--un-translate-y:initial;--un-translate-z:initial;--un-text-opacity:100%;--un-border-opacity:100%;--un-space-y-reverse:initial;--un-space-x-reverse:initial;--un-outline-style:solid;--un-outline-opacity:100%}}@property --un-text-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@property --un-leading{syntax:"*";inherits:false}@property --un-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --un-outline-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@property --un-border-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@property --un-bg-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@property --un-inset-ring-color{syntax:"*";inherits:false}@property --un-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-inset-shadow-color{syntax:"*";inherits:false}@property --un-ring-color{syntax:"*";inherits:false}@property --un-ring-inset{syntax:"*";inherits:false}@property --un-ring-offset-color{syntax:"*";inherits:false}@property --un-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --un-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-shadow-color{syntax:"*";inherits:false}@property --un-translate-x{syntax:"*";inherits:false;initial-value:0}@property --un-translate-y{syntax:"*";inherits:false;initial-value:0}@property --un-translate-z{syntax:"*";inherits:false;initial-value:0}@property --un-numeric-figure{syntax:"*";inherits:false}@property --un-numeric-fraction{syntax:"*";inherits:false}@property --un-numeric-spacing{syntax:"*";inherits:false}@property --un-ordinal{syntax:"*";inherits:false}@property --un-slashed-zero{syntax:"*";inherits:false}@property --un-space-y-reverse{syntax:"*";inherits:false;initial-value:0}:root,:host{--spacing:.25rem;--radius-DEFAULT:.25rem;--colors-gray-DEFAULT:#99a1af;--text-sm-fontSize:.875rem;--text-sm-lineHeight:1.25rem;--default-transition-timingFunction:cubic-bezier(.4,0,.2,1);--default-transition-duration:.15s;--radius-md:.375rem;--radius-xl:.75rem;--fontWeight-medium:500;--fontWeight-semibold:600;--tracking-wide:.025em;--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--radius-sm:.25rem;--colors-blue-DEFAULT:#54a2ff;--colors-red-DEFAULT:#ff6568;--text-2xl-fontSize:1.5rem;--text-2xl-lineHeight:2rem;--text-xs-fontSize:.75rem;--text-xs-lineHeight:1rem;--colors-green-DEFAULT:#05df72;--colors-black:#000;--font-sans:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--default-font-family:var(--font-sans);--default-monoFont-family:var(--font-mono)}@supports (color:lab(0% 0 0)){:root,:host{--colors-gray-DEFAULT:lab(65.9269% -.832677 -8.17474);--colors-blue-DEFAULT:lab(65.0361% -1.42065 -56.9802);--colors-red-DEFAULT:lab(63.7053% 60.745 31.3109);--colors-green-DEFAULT:lab(78.503% -64.9264 39.7492)}}*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-featureSettings,normal);font-variation-settings:var(--default-font-variationSettings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-monoFont-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-monoFont-featureSettings,normal);font-variation-settings:var(--default-monoFont-variationSettings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden~=until-found])){display:none!important}.container{width:100%}.aic{align-items:center}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.text-2xl{font-size:var(--text-2xl-fontSize);line-height:var(--un-leading,var(--text-2xl-lineHeight))}.text-3{font-size:.75rem}.text-3\.5{font-size:.875rem}.text-4{font-size:1rem}.text-sm{font-size:var(--text-sm-fontSize);line-height:var(--un-leading,var(--text-sm-lineHeight))}.text-xs{font-size:var(--text-xs-fontSize);line-height:var(--un-leading,var(--text-xs-lineHeight))}.c-\[--c-primary\]{color:color-mix(in oklab,var(--c-primary)var(--un-text-opacity),transparent)}.c-\#1e3a8a{color:color-mix(in oklab,#1e3a8a var(--un-text-opacity),transparent)}.c-\#7c2d12{color:color-mix(in oklab,#7c2d12 var(--un-text-opacity),transparent)}.c-blue{color:color-mix(in srgb,var(--colors-blue-DEFAULT)var(--un-text-opacity),transparent)}.c-gray\/70{color:color-mix(in srgb,var(--colors-gray-DEFAULT)70%,transparent)}.c-red\/75{color:color-mix(in srgb,var(--colors-red-DEFAULT)75%,transparent)}.leading-5{--un-leading:calc(4px*5);line-height:20px}.lh-\[1\]{--un-leading:1;line-height:1}.tracking-wide{--un-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.font-medium{--un-font-weight:var(--fontWeight-medium);font-weight:var(--fontWeight-medium)}.font-mono{font-family:var(--font-mono)}.font-semibold{--un-font-weight:var(--fontWeight-semibold);font-weight:var(--fontWeight-semibold)}.m9{margin:36px}.mx-1{margin-inline:4px}.mx-3\!{margin-inline:12px!important}.my-1{margin-block:4px}.ml{margin-left:16px}.ml-\.5{margin-left:2px}.ml-1{margin-left:4px}.mr--1{margin-right:-4px}.mr-1{margin-right:4px}.mr-2{margin-right:8px}.mr-2\.5{margin-right:10px}.mt-1{margin-top:4px}.p-1{padding:4px}.p-4\!{padding:16px!important}.px,.px-4{padding-inline:16px}.px-1\.5{padding-inline:6px}.px-2{padding-inline:8px}.px-3{padding-inline:12px}.py-1{padding-block:4px}.py-1\.5{padding-block:6px}.py-2{padding-block:8px}.pl-1{padding-left:4px}.pl-4{padding-left:16px}.pr-4{padding-right:16px}.ps{padding-inline-start:16px}.outline-0{outline-style:var(--un-outline-style);outline-width:0}.outline-2{outline-style:var(--un-outline-style);outline-width:2px}.outline-blue{outline-color:color-mix(in srgb,var(--colors-blue-DEFAULT)var(--un-outline-opacity),transparent)}.outline-none{--un-outline-style:none;outline-style:none}.b,.b-1,.border{border-width:1px}.b-2px{border-width:2px}.b-r-0{border-right-width:0}.b-\[--table-bg\]{border-color:color-mix(in oklab,var(--table-bg)var(--un-border-opacity),transparent)}.b-\#00000000\!{border-color:color-mix(in oklab,#0000 var(--un-border-opacity),transparent)!important}.b-\#4f7ff0{border-color:color-mix(in oklab,#4f7ff0 var(--un-border-opacity),transparent)}.b-\#f59e0b{border-color:color-mix(in oklab,#f59e0b var(--un-border-opacity),transparent)}.rd-1{border-radius:.25rem}.rd-1\.5{border-radius:.375rem}.rd-2{border-radius:.5rem}.rd-sm{border-radius:var(--radius-sm)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rd-l-4{border-top-left-radius:1rem;border-bottom-left-radius:1rem}.b-dashed{--un-border-style:dashed;border-style:dashed}.b-solid{--un-border-style:solid;border-style:solid}.bg-\[--c-primary\]{background-color:color-mix(in oklab,var(--c-primary)var(--un-bg-opacity),transparent)}.bg-\[--table-header-bg\]{background-color:color-mix(in oklab,var(--table-header-bg)var(--un-bg-opacity),transparent)}.bg-\#dbe6ff\/75{background-color:#dbe6ffbf;background-color:lab(91.0303% -.143617 -13.4803/.75)}.bg-\#fff{background-color:color-mix(in oklab,#fff var(--un-bg-opacity),transparent)}.bg-\#fff3d6\/85{background-color:#fff3d6d9;background-color:lab(96.236% .744313 15.5662/.85)}.bg-blue\/20\!{background-color:color-mix(in srgb,var(--colors-blue-DEFAULT)20%,transparent)!important}.bg-gray\/20{background-color:color-mix(in srgb,var(--colors-gray-DEFAULT)20%,transparent)}.bg-green\!{background-color:color-mix(in srgb,var(--colors-green-DEFAULT)var(--un-bg-opacity),transparent)!important}.bg-red\!{background-color:color-mix(in srgb,var(--colors-red-DEFAULT)var(--un-bg-opacity),transparent)!important}.bg-transparent{background-color:#0000}.hover\:bg-\[--li-hover-bg\]:hover{background-color:color-mix(in oklab,var(--li-hover-bg)var(--un-bg-opacity),transparent)}.hover\:bg-black\/8:hover{background-color:color-mix(in srgb,var(--colors-black)8%,transparent)}.op-0{opacity:0}.op-15{opacity:.15}.op-60{opacity:.6}.op-75{opacity:.75}.op40{opacity:.4}.opacity-50{opacity:.5}.group:hover .group-hover\:op-100{opacity:1}.hover\:underline:hover{text-decoration-line:underline}.flex{display:flex}.flex-1{flex:1}.flex-none{flex:none}.flex-shrink{flex-shrink:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.gap-1{gap:4px}.gap-1\.5{gap:6px}.gap-2{gap:8px}.grid{display:grid}.size-3\.5{width:14px;height:14px}.size-4\!{width:16px!important;height:16px!important}.size-full{width:100%;height:100%}.h-1\!{height:4px!important}.h-2\.5{height:10px}.h-3\.5{height:14px}.h-6{height:24px}.h-6\.5{height:26px}.h-a\!{height:auto!important}.h-full{height:100%}.max-h-100{max-height:400px}.max-h-60{max-height:240px}.max-h-inherit{max-height:inherit}.min-h-16{min-height:64px}.min-h-40{min-height:160px}.min-h-a\!{min-height:auto!important}.min-w-24{min-width:96px}.min-w-44{min-width:176px}.min-w-52{min-width:208px}.w-10{width:40px}.w-10px\!{width:10px!important}.w-2\.5{width:10px}.w-3\.5{width:14px}.w-6\.5{width:26px}.w-a\!{width:auto!important}.w-full{width:100%}.after\:h-1:after{height:4px}.after\:w-1:after{width:4px}.inline{display:inline}.block{display:block}.inline-block{display:inline-block}.contents{display:contents}.hidden{display:none}.visible{visibility:visible}.collapse{visibility:collapse}.cursor-pointer{cursor:pointer}.cursor-crosshair{cursor:crosshair}.cursor-s-resize{cursor:s-resize}.cursor-w-resize{cursor:w-resize}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.resize{resize:both}.resize-none{resize:none}.select-none{-webkit-user-select:none;user-select:none}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.uppercase{text-transform:uppercase}.shadow-inner{--un-shadow:inset 0 2px 4px 0 var(--un-shadow-color,#0000000d);box-shadow:var(--un-inset-shadow),var(--un-inset-ring-shadow),var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-sm{--un-shadow:0 1px 3px 0 var(--un-shadow-color,#0000001a),0 1px 2px -1px var(--un-shadow-color,#0000001a);box-shadow:var(--un-inset-shadow),var(--un-inset-ring-shadow),var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-xl{--un-shadow:0 20px 25px -5px var(--un-shadow-color,#0000001a),0 8px 10px -6px var(--un-shadow-color,#0000001a);box-shadow:var(--un-inset-shadow),var(--un-inset-ring-shadow),var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.translate-x--1\/2{--un-translate-x:-50%;translate:var(--un-translate-x)var(--un-translate-y)}.translate-x-1\/2{--un-translate-x:50%;translate:var(--un-translate-x)var(--un-translate-y)}.translate-y--1\/2{--un-translate-y:-50%;translate:var(--un-translate-x)var(--un-translate-y)}.transform{transform:var(--un-rotate-x)var(--un-rotate-y)var(--un-rotate-z)var(--un-skew-x)var(--un-skew-y)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,--un-gradient-from,--un-gradient-via,--un-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter;transition-timing-function:var(--un-ease,var(--default-transition-timingFunction));transition-duration:var(--un-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--un-ease,var(--default-transition-timingFunction));transition-duration:var(--un-duration,var(--default-transition-duration))}.items-start{align-items:flex-start}.items-center{align-items:center}.box-border{box-sizing:border-box}.inset-0{inset:0}.bottom-0{bottom:0}.left--0,.left-0{left:0}.right-0{right:0}.top-0{top:0}.top-1\/2{top:50%}.justify-end\!{justify-content:flex-end!important}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.z--1{z-index:-1}.z-1{z-index:1}.z-2{z-index:2}.z-9{z-index:9}.overflow-auto{overflow:auto}.of-y-auto{overflow-y:auto}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin{animation:1s linear infinite spin}.filter{filter:var(--un-blur,)var(--un-brightness,)var(--un-contrast,)var(--un-grayscale,)var(--un-hue-rotate,)var(--un-invert,)var(--un-saturate,)var(--un-sepia,)var(--un-drop-shadow,)}.table{display:table}.table-cell{display:table-cell}.tabular-nums{--un-numeric-spacing:tabular-nums;font-variant-numeric:var(--un-ordinal,)var(--un-slashed-zero,)var(--un-numeric-figure,)var(--un-numeric-spacing,)var(--un-numeric-fraction,)}:where(.space-y-5>:not(:last-child)){--un-space-y-reverse:0;margin-block-start:calc(calc(4px*5)*var(--un-space-y-reverse));margin-block-end:calc(calc(4px*5)*calc(1 - var(--un-space-y-reverse)))}@supports (color:color-mix(in lab, red, red)){.c-blue{color:color-mix(in oklab,var(--colors-blue-DEFAULT)var(--un-text-opacity),transparent)}.c-gray\/70{color:color-mix(in oklab,var(--colors-gray-DEFAULT)70%,transparent)}.c-red\/75{color:color-mix(in oklab,var(--colors-red-DEFAULT)75%,transparent)}.outline-blue{outline-color:color-mix(in oklab,var(--colors-blue-DEFAULT)var(--un-outline-opacity),transparent)}.bg-blue\/20\!{background-color:color-mix(in oklab,var(--colors-blue-DEFAULT)20%,transparent)!important}.bg-gray\/20{background-color:color-mix(in oklab,var(--colors-gray-DEFAULT)20%,transparent)}.bg-green\!{background-color:color-mix(in oklab,var(--colors-green-DEFAULT)var(--un-bg-opacity),transparent)!important}.bg-red\!{background-color:color-mix(in oklab,var(--colors-red-DEFAULT)var(--un-bg-opacity),transparent)!important}.hover\:bg-black\/8:hover{background-color:color-mix(in oklab,var(--colors-black)8%,transparent)}}
|
|
1
|
+
@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--un-bg-opacity:100%;--un-leading:initial;--un-content:"";--un-translate-x:initial;--un-translate-y:initial;--un-translate-z:initial;--un-text-opacity:100%;--un-border-opacity:100%;--un-space-y-reverse:initial;--un-space-x-reverse:initial;--un-outline-style:solid;--un-outline-opacity:100%}}@property --un-text-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@property --un-leading{syntax:"*";inherits:false}@property --un-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --un-outline-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@property --un-border-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@property --un-bg-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@property --un-inset-ring-color{syntax:"*";inherits:false}@property --un-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-inset-shadow-color{syntax:"*";inherits:false}@property --un-ring-color{syntax:"*";inherits:false}@property --un-ring-inset{syntax:"*";inherits:false}@property --un-ring-offset-color{syntax:"*";inherits:false}@property --un-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --un-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-shadow-color{syntax:"*";inherits:false}@property --un-translate-x{syntax:"*";inherits:false;initial-value:0}@property --un-translate-y{syntax:"*";inherits:false;initial-value:0}@property --un-translate-z{syntax:"*";inherits:false;initial-value:0}@property --un-numeric-figure{syntax:"*";inherits:false}@property --un-numeric-fraction{syntax:"*";inherits:false}@property --un-numeric-spacing{syntax:"*";inherits:false}@property --un-ordinal{syntax:"*";inherits:false}@property --un-slashed-zero{syntax:"*";inherits:false}@property --un-space-y-reverse{syntax:"*";inherits:false;initial-value:0}:root,:host{--spacing:.25rem;--radius-DEFAULT:.25rem;--colors-gray-DEFAULT:#99a1af;--leading-snug:1.375;--colors-gray-800:#1e2939;--colors-white:#fff;--colors-gray-100:#f3f4f6;--colors-gray-900:#101828;--text-sm-fontSize:.875rem;--text-sm-lineHeight:1.25rem;--text-xs-fontSize:.75rem;--text-xs-lineHeight:1rem;--default-transition-timingFunction:cubic-bezier(.4,0,.2,1);--default-transition-duration:.15s;--radius-md:.375rem;--radius-xl:.75rem;--fontWeight-medium:500;--fontWeight-semibold:600;--tracking-wide:.025em;--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--radius-sm:.25rem;--colors-blue-DEFAULT:#54a2ff;--colors-red-DEFAULT:#ff6568;--text-2xl-fontSize:1.5rem;--text-2xl-lineHeight:2rem;--colors-green-DEFAULT:#05df72;--colors-black:#000;--font-sans:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--default-font-family:var(--font-sans);--default-monoFont-family:var(--font-mono)}@supports (color:lab(0% 0 0)){:root,:host{--colors-gray-DEFAULT:lab(65.9269% -.832707 -8.17474);--colors-gray-800:lab(16.1051% -1.18239 -11.7533);--colors-gray-100:lab(96.1596% -.082314 -1.13575);--colors-gray-900:lab(8.11897% .811279 -12.254);--colors-blue-DEFAULT:lab(65.0361% -1.42062 -56.9803);--colors-red-DEFAULT:lab(63.7053% 60.7449 31.3109);--colors-green-DEFAULT:lab(78.503% -64.9265 39.7492)}}*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-featureSettings,normal);font-variation-settings:var(--default-font-variationSettings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-monoFont-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-monoFont-featureSettings,normal);font-variation-settings:var(--default-monoFont-variationSettings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden~=until-found])){display:none!important}.container{width:100%}.aic{align-items:center}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.text-2xl{font-size:var(--text-2xl-fontSize);line-height:var(--un-leading,var(--text-2xl-lineHeight))}.text-3{font-size:.75rem}.text-3\.5{font-size:.875rem}.text-4{font-size:1rem}.text-sm{font-size:var(--text-sm-fontSize);line-height:var(--un-leading,var(--text-sm-lineHeight))}.text-xs{font-size:var(--text-xs-fontSize);line-height:var(--un-leading,var(--text-xs-lineHeight))}.c-\[--c-primary\]{color:color-mix(in oklab,var(--c-primary)var(--un-text-opacity),transparent)}.c-\#1e3a8a{color:color-mix(in oklab,#1e3a8a var(--un-text-opacity),transparent)}.c-\#7c2d12{color:color-mix(in oklab,#7c2d12 var(--un-text-opacity),transparent)}.c-blue{color:color-mix(in srgb,var(--colors-blue-DEFAULT)var(--un-text-opacity),transparent)}.c-gray\/70{color:color-mix(in srgb,var(--colors-gray-DEFAULT)70%,transparent)}.c-red\/75{color:color-mix(in srgb,var(--colors-red-DEFAULT)75%,transparent)}.leading-5{--un-leading:calc(4px*5);line-height:20px}.lh-\[1\]{--un-leading:1;line-height:1}.tracking-wide{--un-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.font-medium{--un-font-weight:var(--fontWeight-medium);font-weight:var(--fontWeight-medium)}.font-mono{font-family:var(--font-mono)}.font-semibold{--un-font-weight:var(--fontWeight-semibold);font-weight:var(--fontWeight-semibold)}.m9{margin:36px}.mx-1{margin-inline:4px}.mx-3\!{margin-inline:12px!important}.my-1{margin-block:4px}.ml{margin-left:16px}.ml-\.5{margin-left:2px}.ml-1{margin-left:4px}.mr--1{margin-right:-4px}.mr-1{margin-right:4px}.mr-2{margin-right:8px}.mr-2\.5{margin-right:10px}.mt-1{margin-top:4px}.p-1{padding:4px}.p-4\!{padding:16px!important}.px,.px-4{padding-inline:16px}.px-1\.5{padding-inline:6px}.px-2{padding-inline:8px}.px-3{padding-inline:12px}.py-1{padding-block:4px}.py-1\.5{padding-block:6px}.py-2{padding-block:8px}.pl-1{padding-left:4px}.pl-4{padding-left:16px}.pr-4{padding-right:16px}.ps{padding-inline-start:16px}.outline-0{outline-style:var(--un-outline-style);outline-width:0}.outline-2{outline-style:var(--un-outline-style);outline-width:2px}.outline-blue{outline-color:color-mix(in srgb,var(--colors-blue-DEFAULT)var(--un-outline-opacity),transparent)}.outline-none{--un-outline-style:none;outline-style:none}.b,.b-1,.border{border-width:1px}.b-2px{border-width:2px}.b-r-0{border-right-width:0}.b-\[--table-bg\]{border-color:color-mix(in oklab,var(--table-bg)var(--un-border-opacity),transparent)}.b-\#00000000\!{border-color:color-mix(in oklab,#0000 var(--un-border-opacity),transparent)!important}.b-\#4f7ff0{border-color:color-mix(in oklab,#4f7ff0 var(--un-border-opacity),transparent)}.b-\#f59e0b{border-color:color-mix(in oklab,#f59e0b var(--un-border-opacity),transparent)}.rd-1{border-radius:.25rem}.rd-1\.5{border-radius:.375rem}.rd-2{border-radius:.5rem}.rd-sm{border-radius:var(--radius-sm)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rd-l-4{border-top-left-radius:1rem;border-bottom-left-radius:1rem}.b-dashed{--un-border-style:dashed;border-style:dashed}.b-solid{--un-border-style:solid;border-style:solid}.bg-\[--c-primary\]{background-color:color-mix(in oklab,var(--c-primary)var(--un-bg-opacity),transparent)}.bg-\[--table-header-bg\]{background-color:color-mix(in oklab,var(--table-header-bg)var(--un-bg-opacity),transparent)}.bg-\#dbe6ff\/75{background-color:#dbe6ffbf;background-color:lab(91.0303% -.143617 -13.4803/.75)}.bg-\#fff{background-color:color-mix(in oklab,#fff var(--un-bg-opacity),transparent)}.bg-\#fff3d6\/85{background-color:#fff3d6d9;background-color:lab(96.236% .744224 15.5662/.85)}.bg-blue\/20\!{background-color:color-mix(in srgb,var(--colors-blue-DEFAULT)20%,transparent)!important}.bg-gray\/20{background-color:color-mix(in srgb,var(--colors-gray-DEFAULT)20%,transparent)}.bg-green\!{background-color:color-mix(in srgb,var(--colors-green-DEFAULT)var(--un-bg-opacity),transparent)!important}.bg-red\!{background-color:color-mix(in srgb,var(--colors-red-DEFAULT)var(--un-bg-opacity),transparent)!important}.bg-transparent{background-color:#0000}.hover\:bg-\[--li-hover-bg\]:hover{background-color:color-mix(in oklab,var(--li-hover-bg)var(--un-bg-opacity),transparent)}.hover\:bg-black\/8:hover{background-color:color-mix(in srgb,var(--colors-black)8%,transparent)}.op-0{opacity:0}.op-15{opacity:.15}.op-60{opacity:.6}.op-75{opacity:.75}.op40{opacity:.4}.opacity-50{opacity:.5}.group:hover .group-hover\:op-100{opacity:1}.hover\:underline:hover{text-decoration-line:underline}.flex{display:flex}.flex-1{flex:1}.flex-none{flex:none}.flex-shrink{flex-shrink:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.gap-1{gap:4px}.gap-1\.5{gap:6px}.gap-2{gap:8px}.grid{display:grid}.size-3\.5{width:14px;height:14px}.size-4\!{width:16px!important;height:16px!important}.size-full{width:100%;height:100%}.h-1\!{height:4px!important}.h-2\.5{height:10px}.h-3\.5{height:14px}.h-6{height:24px}.h-6\.5{height:26px}.h-a\!{height:auto!important}.h-full{height:100%}.max-h-100{max-height:400px}.max-h-60{max-height:240px}.max-h-inherit{max-height:inherit}.min-h-16{min-height:64px}.min-h-40{min-height:160px}.min-h-a\!{min-height:auto!important}.min-w-24{min-width:96px}.min-w-44{min-width:176px}.min-w-52{min-width:208px}.w-10{width:40px}.w-10px\!{width:10px!important}.w-2\.5{width:10px}.w-3\.5{width:14px}.w-6\.5{width:26px}.w-a\!{width:auto!important}.w-full{width:100%}.after\:h-1:after{height:4px}.after\:w-1:after{width:4px}.inline{display:inline}.block{display:block}.inline-block{display:inline-block}.contents{display:contents}.hidden{display:none}.visible{visibility:visible}.collapse{visibility:collapse}.cursor-pointer{cursor:pointer}.cursor-crosshair{cursor:crosshair}.cursor-s-resize{cursor:s-resize}.cursor-w-resize{cursor:w-resize}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.resize{resize:both}.resize-none{resize:none}.select-none{-webkit-user-select:none;user-select:none}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.uppercase{text-transform:uppercase}.shadow-inner{--un-shadow:inset 0 2px 4px 0 var(--un-shadow-color,#0000000d);box-shadow:var(--un-inset-shadow),var(--un-inset-ring-shadow),var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-sm{--un-shadow:0 1px 3px 0 var(--un-shadow-color,#0000001a),0 1px 2px -1px var(--un-shadow-color,#0000001a);box-shadow:var(--un-inset-shadow),var(--un-inset-ring-shadow),var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-xl{--un-shadow:0 20px 25px -5px var(--un-shadow-color,#0000001a),0 8px 10px -6px var(--un-shadow-color,#0000001a);box-shadow:var(--un-inset-shadow),var(--un-inset-ring-shadow),var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.translate-x--1\/2{--un-translate-x:-50%;translate:var(--un-translate-x)var(--un-translate-y)}.translate-x-1\/2{--un-translate-x:50%;translate:var(--un-translate-x)var(--un-translate-y)}.translate-y--1\/2{--un-translate-y:-50%;translate:var(--un-translate-x)var(--un-translate-y)}.transform{transform:var(--un-rotate-x)var(--un-rotate-y)var(--un-rotate-z)var(--un-skew-x)var(--un-skew-y)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,--un-gradient-from,--un-gradient-via,--un-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter;transition-timing-function:var(--un-ease,var(--default-transition-timingFunction));transition-duration:var(--un-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--un-ease,var(--default-transition-timingFunction));transition-duration:var(--un-duration,var(--default-transition-duration))}.items-start{align-items:flex-start}.items-center{align-items:center}.box-border{box-sizing:border-box}.inset-0{inset:0}.bottom-0{bottom:0}.left--0,.left-0{left:0}.right-0{right:0}.top-0{top:0}.top-1\/2{top:50%}.justify-end\!{justify-content:flex-end!important}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.z--1{z-index:-1}.z-1{z-index:1}.z-2{z-index:2}.z-9{z-index:9}.overflow-auto{overflow:auto}.of-y-auto{overflow-y:auto}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin{animation:1s linear infinite spin}.filter{filter:var(--un-blur,)var(--un-brightness,)var(--un-contrast,)var(--un-grayscale,)var(--un-hue-rotate,)var(--un-invert,)var(--un-saturate,)var(--un-sepia,)var(--un-drop-shadow,)}.table{display:table}.table-cell{display:table-cell}.tabular-nums{--un-numeric-spacing:tabular-nums;font-variant-numeric:var(--un-ordinal,)var(--un-slashed-zero,)var(--un-numeric-figure,)var(--un-numeric-spacing,)var(--un-numeric-fraction,)}:where(.space-y-5>:not(:last-child)){--un-space-y-reverse:0;margin-block-start:calc(calc(4px*5)*var(--un-space-y-reverse));margin-block-end:calc(calc(4px*5)*calc(1 - var(--un-space-y-reverse)))}@supports (color:color-mix(in lab, red, red)){.c-blue{color:color-mix(in oklab,var(--colors-blue-DEFAULT)var(--un-text-opacity),transparent)}.c-gray\/70{color:color-mix(in oklab,var(--colors-gray-DEFAULT)70%,transparent)}.c-red\/75{color:color-mix(in oklab,var(--colors-red-DEFAULT)75%,transparent)}.outline-blue{outline-color:color-mix(in oklab,var(--colors-blue-DEFAULT)var(--un-outline-opacity),transparent)}.bg-blue\/20\!{background-color:color-mix(in oklab,var(--colors-blue-DEFAULT)20%,transparent)!important}.bg-gray\/20{background-color:color-mix(in oklab,var(--colors-gray-DEFAULT)20%,transparent)}.bg-green\!{background-color:color-mix(in oklab,var(--colors-green-DEFAULT)var(--un-bg-opacity),transparent)!important}.bg-red\!{background-color:color-mix(in oklab,var(--colors-red-DEFAULT)var(--un-bg-opacity),transparent)!important}.hover\:bg-black\/8:hover{background-color:color-mix(in oklab,var(--colors-black)8%,transparent)}}
|
|
@@ -84,9 +84,7 @@ const Filter = (y) => {
|
|
|
84
84
|
get value() {
|
|
85
85
|
return S() ?? newRule(y.col);
|
|
86
86
|
},
|
|
87
|
-
onChange: (e) =>
|
|
88
|
-
y.setTree(isEqual(e, newRule(y.col)) ? void 0 : e);
|
|
89
|
-
},
|
|
87
|
+
onChange: (e) => y.setTree(isEqual(e, newRule(y.col)) ? void 0 : e),
|
|
90
88
|
newRule: () => newRule(y.col),
|
|
91
89
|
hideFields: !0
|
|
92
90
|
})), e;
|
|
@@ -2,9 +2,10 @@ import { type Accessor, type JSX } from 'solid-js';
|
|
|
2
2
|
import { type createFloatingProps, type ReferenceType } from 'floating-ui-solid';
|
|
3
3
|
import type { AutoUpdateOptions } from '@floating-ui/dom';
|
|
4
4
|
export declare function Popover(attrs: FloatingProps): JSX.Element;
|
|
5
|
-
type FloatingProps = {
|
|
5
|
+
export type FloatingProps = {
|
|
6
6
|
reference: Accessor<ReferenceType | JSX.Element>;
|
|
7
7
|
floating?: Accessor<JSX.Element>;
|
|
8
|
+
target?: Accessor<JSX.Element>;
|
|
8
9
|
portal?: HTMLElement;
|
|
9
10
|
trigger?: 'click' | 'hover';
|
|
10
11
|
} & createFloatingProps;
|
|
@@ -14,4 +15,3 @@ export declare function Floating(props: FloatingProps & {
|
|
|
14
15
|
export declare const useFloating: (attrs: FloatingProps & {
|
|
15
16
|
update?: Partial<AutoUpdateOptions>;
|
|
16
17
|
}) => void;
|
|
17
|
-
export {};
|