solid-tom-ui 1.0.10 → 1.0.14
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/README.md +246 -246
- package/dist/README.md +246 -246
- package/dist/components/avatar/avatar.js.map +1 -1
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/carousel/carousel.js.map +1 -1
- package/dist/components/chat-bubble/chatBubble.js.map +1 -1
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/collapse/collapse.js.map +1 -1
- package/dist/components/context-menu/context-menu.js.map +1 -1
- package/dist/components/context-menu/context-menu.store.js.map +1 -1
- package/dist/components/divider/divider.js.map +1 -1
- package/dist/components/dropdown/dropdown.js.map +1 -1
- package/dist/components/dropdown/dropdown.store.js.map +1 -1
- package/dist/components/float-button/float-button.js.map +1 -1
- package/dist/components/hover-3d-image/hover-3d-image.js.map +1 -1
- package/dist/components/image-preview/image-preview.js.map +1 -1
- package/dist/components/input/input.js.map +1 -1
- package/dist/components/input/input.utils.js.map +1 -1
- package/dist/components/input/variants/input-color.js.map +1 -1
- package/dist/components/input/variants/input-date.js.map +1 -1
- package/dist/components/input/variants/input-number.d.ts.map +1 -1
- package/dist/components/input/variants/input-number.js +1 -1
- package/dist/components/input/variants/input-number.js.map +1 -1
- package/dist/components/input/variants/input-otp.js.map +1 -1
- package/dist/components/input/variants/input-password.js.map +1 -1
- package/dist/components/input/variants/input-radio.js.map +1 -1
- package/dist/components/input/variants/input-range.js.map +1 -1
- package/dist/components/input/variants/input-text.d.ts.map +1 -1
- package/dist/components/input/variants/input-text.js +1 -1
- package/dist/components/input/variants/input-text.js.map +1 -1
- package/dist/components/input/variants/input-textarea.js.map +1 -1
- package/dist/components/loading/loading.js.map +1 -1
- package/dist/components/mansory/mansory.js.map +1 -1
- package/dist/components/menu/menu.js.map +1 -1
- package/dist/components/menu/menu.types.d.ts +2 -3
- package/dist/components/menu/menu.types.d.ts.map +1 -1
- package/dist/components/modal/modal.js.map +1 -1
- package/dist/components/modal/modalContext.js.map +1 -1
- package/dist/components/pagination/pagination.js.map +1 -1
- package/dist/components/progress-bar/progress-bar.js.map +1 -1
- package/dist/components/qr-code/qr-code.js.map +1 -1
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/select-zone/select-zone.js.map +1 -1
- package/dist/components/skeleton/skeleton.js.map +1 -1
- package/dist/components/slider/slider.js.map +1 -1
- package/dist/components/splitter/splitter.js.map +1 -1
- package/dist/components/steps/steps.js.map +1 -1
- package/dist/components/swap/swap.js.map +1 -1
- package/dist/components/switch/switch.js.map +1 -1
- package/dist/components/tab/tab.js.map +1 -1
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/timeline/timeline.js.map +1 -1
- package/dist/components/toast/icons/ErrorIcon.js.map +1 -1
- package/dist/components/toast/icons/IconCircle.js.map +1 -1
- package/dist/components/toast/icons/InfoIcon.js.map +1 -1
- package/dist/components/toast/icons/LoaderIcon.js.map +1 -1
- package/dist/components/toast/icons/SuccessIcon.js.map +1 -1
- package/dist/components/toast/icons/WarningIcon.js.map +1 -1
- package/dist/components/toast/toast.js.map +1 -1
- package/dist/components/toast/toast.store.js.map +1 -1
- package/dist/components/tooltip/tooltip.js.map +1 -1
- package/dist/components/tour/tour.js.map +1 -1
- package/dist/components/upload/upload.js.map +1 -1
- package/dist/components/z-index/z-index.context.js.map +1 -1
- package/dist/components/z-index/z-index.js.map +1 -1
- package/dist/components/z-index/z-index.store.js.map +1 -1
- package/dist/components/z-index/z-index.types.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/skill/avatar.skill.md.txt +255 -255
- package/dist/skill/badge.skill.md.txt +223 -223
- package/dist/skill/breadcrumb.skill.md.txt +177 -177
- package/dist/skill/button.skill.md.txt +198 -198
- package/dist/skill/carousel.skill.md.txt +406 -406
- package/dist/skill/chat-bubble.skill.md.txt +342 -342
- package/dist/skill/checkbox.skill.md.txt +326 -326
- package/dist/skill/code-preview.skill.md.txt +240 -240
- package/dist/skill/collapse.skill.md.txt +329 -329
- package/dist/skill/context-menu.skill.md.txt +233 -233
- package/dist/skill/diff.skill.md.txt +244 -244
- package/dist/skill/divider.skill.md.txt +151 -151
- package/dist/skill/doc.skill.md.txt +191 -191
- package/dist/skill/drawer.skill.md.txt +157 -157
- package/dist/skill/dropdown.skill.md.txt +198 -198
- package/dist/skill/float-button.skill.md.txt +315 -315
- package/dist/skill/hover-3d-image.skill.md.txt +120 -120
- package/dist/skill/iframe.skill.md.txt +114 -114
- package/dist/skill/image-preview.skill.md.txt +162 -162
- package/dist/skill/indicator.skill.md.txt +60 -60
- package/dist/skill/input.skill.md.txt +489 -489
- package/dist/skill/loading.skill.md.txt +127 -127
- package/dist/skill/menu.skill.md.txt +476 -476
- package/dist/skill/modal.skill.md.txt +359 -359
- package/dist/skill/pagination.skill.md.txt +405 -405
- package/dist/skill/progress-bar.skill.md.txt +207 -207
- package/dist/skill/qr-code.skill.md.txt +136 -136
- package/dist/skill/rating.skill.md.txt +167 -167
- package/dist/skill/select-zone.skill.md.txt +93 -93
- package/dist/skill/select.skill.md.txt +663 -663
- package/dist/skill/skeleton.skill.md.txt +192 -192
- package/dist/skill/slider.skill.md.txt +404 -404
- package/dist/skill/splitter.skill.md.txt +411 -411
- package/dist/skill/steps.skill.md.txt +264 -264
- package/dist/skill/swap.skill.md.txt +139 -139
- package/dist/skill/switch.skill.md.txt +191 -191
- package/dist/skill/tab.skill.md.txt +484 -484
- package/dist/skill/table.example.header.md.txt +666 -666
- package/dist/skill/table.skill.md.txt +1407 -1407
- package/dist/skill/text-rotate.skill.md.txt +186 -186
- package/dist/skill/timeline.skill.md.txt +247 -247
- package/dist/skill/toast.skill.md.txt +531 -531
- package/dist/skill/tooltip.skill.md.txt +222 -222
- package/dist/skill/tour.skill.md.txt +156 -156
- package/dist/skill/upload.skill.md.txt +358 -358
- package/dist/utils/cn.js.map +1 -1
- package/dist/utils/element-tracker.js.map +1 -1
- package/dist/utils/helper.js.map +1 -1
- package/dist/utils/hoc.js.map +1 -1
- package/package.json +132 -133
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
## COMPONENT IDENTITY
|
|
2
|
-
- **Import**: `import { SelectZone, SelectZoneItem } from 'solid-tom-ui';`
|
|
3
|
-
- **Exports**: `SelectZone` (container), `SelectZoneItem` (item wrapper)
|
|
4
|
-
- **Framework**: SolidJS
|
|
5
|
-
- **Purpose**: Rubber band selection — drag to select multiple items simultaneously, like Notion/File Explorer
|
|
6
|
-
|
|
7
|
-
## Features
|
|
8
|
-
|
|
9
|
-
- Selection rectangle appears on drag (≥ 4px), disappears on release
|
|
10
|
-
- Supports all 4 drag directions (decreasing x/y included)
|
|
11
|
-
- Auto-scroll when mouse reaches viewport edge; speed scales with distance
|
|
12
|
-
- Hold Shift/Ctrl to add to existing selection without resetting
|
|
13
|
-
- Single click on empty area → deselect all
|
|
14
|
-
- Elements with `data-no-select` or `input/button/a` do not trigger drag
|
|
15
|
-
|
|
16
|
-
## API
|
|
17
|
-
|
|
18
|
-
### `<SelectZone>`
|
|
19
|
-
|
|
20
|
-
| Prop | Type | Default | Description |
|
|
21
|
-
|------|------|---------|-------------|
|
|
22
|
-
| `onSelect` | `(keys: Set<string>) => void` | — | Callback when selection changes |
|
|
23
|
-
| `additive` | `boolean` | `true` | Support Shift/Ctrl to add to selection |
|
|
24
|
-
| `scrollThreshold` | `number` | `40` | Distance from viewport edge (px) to activate auto-scroll |
|
|
25
|
-
| `scrollSpeed` | `number` | `12` | Max scroll speed (px/frame) |
|
|
26
|
-
| `disabled` | `boolean` | `false` | Disable SelectZone |
|
|
27
|
-
| `class` | `{ root?, overlay? }` | — | Override classes per slot |
|
|
28
|
-
|
|
29
|
-
### `<SelectZoneItem>`
|
|
30
|
-
|
|
31
|
-
| Prop | Type | Description |
|
|
32
|
-
|------|------|-------------|
|
|
33
|
-
| `itemKey` | `string` | **Required** — unique key to track the item |
|
|
34
|
-
| `children` | `(selected: () => boolean) => JSX.Element` | Render prop receiving `isSelected` accessor |
|
|
35
|
-
| `class` | `string` | Extra classes on the wrapper div |
|
|
36
|
-
|
|
37
|
-
## Basic usage
|
|
38
|
-
|
|
39
|
-
```tsx
|
|
40
|
-
import { SelectZone, SelectZoneItem } from 'solid-tom-ui';
|
|
41
|
-
|
|
42
|
-
const items = ['a', 'b', 'c', 'd'];
|
|
43
|
-
|
|
44
|
-
const MyComponent = () => {
|
|
45
|
-
const [selected, setSelected] = createSignal(new Set<string>());
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<SelectZone onSelect={setSelected}>
|
|
49
|
-
<div class="grid grid-cols-4 gap-2">
|
|
50
|
-
<For each={items}>
|
|
51
|
-
{item => (
|
|
52
|
-
<SelectZoneItem itemKey={item}>
|
|
53
|
-
{isSelected => (
|
|
54
|
-
<div class={isSelected() ? 'bg-primary/20' : 'bg-base-100'}>
|
|
55
|
-
{item}
|
|
56
|
-
</div>
|
|
57
|
-
)}
|
|
58
|
-
</SelectZoneItem>
|
|
59
|
-
)}
|
|
60
|
-
</For>
|
|
61
|
-
</div>
|
|
62
|
-
</SelectZone>
|
|
63
|
-
);
|
|
64
|
-
};
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## Excluding elements from drag
|
|
68
|
-
|
|
69
|
-
Add `data-no-select` to elements that should not trigger drag:
|
|
70
|
-
|
|
71
|
-
```tsx
|
|
72
|
-
<button data-no-select onClick={clearAll}>Deselect all</button>
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Override overlay style
|
|
76
|
-
|
|
77
|
-
```tsx
|
|
78
|
-
<SelectZone
|
|
79
|
-
class={{
|
|
80
|
-
root: 'p-4 border rounded-xl',
|
|
81
|
-
overlay: 'bg-blue-500/20 border-blue-500',
|
|
82
|
-
}}
|
|
83
|
-
>
|
|
84
|
-
...
|
|
85
|
-
</SelectZone>
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
## Technical notes
|
|
89
|
-
|
|
90
|
-
- Overlay uses `position: fixed` so it works correctly even when the container scrolls
|
|
91
|
-
- AABB intersection detection: O(n) — suitable for up to a few thousand items
|
|
92
|
-
- `startX/Y` is adjusted for scroll amount so the overlay stays accurate during auto-scroll
|
|
93
|
-
- `SelectZoneItem` wrapper div has `data-select-key` to distinguish item clicks from empty-area clicks
|
|
1
|
+
## COMPONENT IDENTITY
|
|
2
|
+
- **Import**: `import { SelectZone, SelectZoneItem } from 'solid-tom-ui';`
|
|
3
|
+
- **Exports**: `SelectZone` (container), `SelectZoneItem` (item wrapper)
|
|
4
|
+
- **Framework**: SolidJS
|
|
5
|
+
- **Purpose**: Rubber band selection — drag to select multiple items simultaneously, like Notion/File Explorer
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- Selection rectangle appears on drag (≥ 4px), disappears on release
|
|
10
|
+
- Supports all 4 drag directions (decreasing x/y included)
|
|
11
|
+
- Auto-scroll when mouse reaches viewport edge; speed scales with distance
|
|
12
|
+
- Hold Shift/Ctrl to add to existing selection without resetting
|
|
13
|
+
- Single click on empty area → deselect all
|
|
14
|
+
- Elements with `data-no-select` or `input/button/a` do not trigger drag
|
|
15
|
+
|
|
16
|
+
## API
|
|
17
|
+
|
|
18
|
+
### `<SelectZone>`
|
|
19
|
+
|
|
20
|
+
| Prop | Type | Default | Description |
|
|
21
|
+
|------|------|---------|-------------|
|
|
22
|
+
| `onSelect` | `(keys: Set<string>) => void` | — | Callback when selection changes |
|
|
23
|
+
| `additive` | `boolean` | `true` | Support Shift/Ctrl to add to selection |
|
|
24
|
+
| `scrollThreshold` | `number` | `40` | Distance from viewport edge (px) to activate auto-scroll |
|
|
25
|
+
| `scrollSpeed` | `number` | `12` | Max scroll speed (px/frame) |
|
|
26
|
+
| `disabled` | `boolean` | `false` | Disable SelectZone |
|
|
27
|
+
| `class` | `{ root?, overlay? }` | — | Override classes per slot |
|
|
28
|
+
|
|
29
|
+
### `<SelectZoneItem>`
|
|
30
|
+
|
|
31
|
+
| Prop | Type | Description |
|
|
32
|
+
|------|------|-------------|
|
|
33
|
+
| `itemKey` | `string` | **Required** — unique key to track the item |
|
|
34
|
+
| `children` | `(selected: () => boolean) => JSX.Element` | Render prop receiving `isSelected` accessor |
|
|
35
|
+
| `class` | `string` | Extra classes on the wrapper div |
|
|
36
|
+
|
|
37
|
+
## Basic usage
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
import { SelectZone, SelectZoneItem } from 'solid-tom-ui';
|
|
41
|
+
|
|
42
|
+
const items = ['a', 'b', 'c', 'd'];
|
|
43
|
+
|
|
44
|
+
const MyComponent = () => {
|
|
45
|
+
const [selected, setSelected] = createSignal(new Set<string>());
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<SelectZone onSelect={setSelected}>
|
|
49
|
+
<div class="grid grid-cols-4 gap-2">
|
|
50
|
+
<For each={items}>
|
|
51
|
+
{item => (
|
|
52
|
+
<SelectZoneItem itemKey={item}>
|
|
53
|
+
{isSelected => (
|
|
54
|
+
<div class={isSelected() ? 'bg-primary/20' : 'bg-base-100'}>
|
|
55
|
+
{item}
|
|
56
|
+
</div>
|
|
57
|
+
)}
|
|
58
|
+
</SelectZoneItem>
|
|
59
|
+
)}
|
|
60
|
+
</For>
|
|
61
|
+
</div>
|
|
62
|
+
</SelectZone>
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Excluding elements from drag
|
|
68
|
+
|
|
69
|
+
Add `data-no-select` to elements that should not trigger drag:
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
<button data-no-select onClick={clearAll}>Deselect all</button>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Override overlay style
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
<SelectZone
|
|
79
|
+
class={{
|
|
80
|
+
root: 'p-4 border rounded-xl',
|
|
81
|
+
overlay: 'bg-blue-500/20 border-blue-500',
|
|
82
|
+
}}
|
|
83
|
+
>
|
|
84
|
+
...
|
|
85
|
+
</SelectZone>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Technical notes
|
|
89
|
+
|
|
90
|
+
- Overlay uses `position: fixed` so it works correctly even when the container scrolls
|
|
91
|
+
- AABB intersection detection: O(n) — suitable for up to a few thousand items
|
|
92
|
+
- `startX/Y` is adjusted for scroll amount so the overlay stays accurate during auto-scroll
|
|
93
|
+
- `SelectZoneItem` wrapper div has `data-select-key` to distinguish item clicks from empty-area clicks
|