@warkypublic/svelix 0.1.46 → 0.2.1
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 +93 -33
- package/dist/components/BetterMenu/BetterMenu.svelte +21 -37
- package/dist/components/BetterMenu/BetterMenuAsyncButton.svelte +21 -31
- package/dist/components/BetterMenu/BetterMenuPreview.svelte +27 -29
- package/dist/components/BetterMenu/MenuRenderer.svelte +40 -51
- package/dist/components/Boxer/Boxer.svelte +492 -602
- package/dist/components/Boxer/BoxerTarget.svelte +6 -46
- package/dist/components/Boxer/BoxerTarget.svelte.d.ts +1 -0
- package/dist/components/Boxer/types.d.ts +0 -1
- package/dist/components/Button.svelte +19 -43
- package/dist/components/ButtonPreview.svelte +2 -11
- package/dist/components/CardGrid/CardGrid.svelte +489 -614
- package/dist/components/CardGrid/CardGrid.svelte.d.ts +4 -0
- package/dist/components/CardGrid/CardGridFilterPanel.svelte +111 -90
- package/dist/components/CardGrid/DefaultCard.svelte +86 -97
- package/dist/components/CardGrid/DefaultCard.svelte.d.ts +1 -0
- package/dist/components/CardGrid/ImageCardStory.svelte +87 -36
- package/dist/components/CardGrid/cardGrid.d.ts +24 -0
- package/dist/components/CardGrid/cardGrid.js +20 -0
- package/dist/components/ContentEditor/CollaboraInsertTextDemo.svelte +5 -10
- package/dist/components/ContentEditor/ContentEditor.svelte +24 -50
- package/dist/components/ContentEditor/subcomponents/AudioPlayer.svelte +17 -17
- package/dist/components/ContentEditor/subcomponents/CollaboraEditor.svelte +244 -309
- package/dist/components/ContentEditor/subcomponents/EmailViewer.svelte +2 -3
- package/dist/components/ContentEditor/subcomponents/ImageViewer.svelte +14 -15
- package/dist/components/ContentEditor/subcomponents/MarkdownViewer.svelte +74 -90
- package/dist/components/ContentEditor/subcomponents/MonacoEditor.svelte +75 -103
- package/dist/components/ContentEditor/subcomponents/Office365Editor.svelte +234 -297
- package/dist/components/ContentEditor/subcomponents/PdfViewer.svelte +14 -20
- package/dist/components/ContentEditor/subcomponents/TextEditor.svelte +122 -150
- package/dist/components/ContentEditor/subcomponents/UnknownFile.svelte +105 -126
- package/dist/components/ContentEditor/subcomponents/VideoPlayer.svelte +17 -17
- package/dist/components/ContentEditor/subcomponents/ZipViewer.svelte +2 -3
- package/dist/components/ErrorBoundary/ErrorBoundary.svelte +41 -58
- package/dist/components/ErrorBoundary/ErrorBoundaryPreview.svelte +8 -16
- package/dist/components/Former/Former.svelte +306 -424
- package/dist/components/Former/FormerButtonArea.svelte +17 -68
- package/dist/components/Former/FormerDrawer.svelte +16 -80
- package/dist/components/Former/FormerDrawerPreview.svelte +99 -89
- package/dist/components/Former/FormerModal.svelte +16 -74
- package/dist/components/Former/FormerModalPreview.svelte +99 -89
- package/dist/components/Former/FormerPreview.svelte +76 -78
- package/dist/components/Former/FormerRestApiPreview.svelte +55 -48
- package/dist/components/Former/formerOverlayHelpers.svelte.d.ts +11 -0
- package/dist/components/Former/formerOverlayHelpers.svelte.js +38 -0
- package/dist/components/Former/index.d.ts +1 -0
- package/dist/components/Former/index.js +1 -0
- package/dist/components/FormerControllers/ButtonCtrl.svelte +13 -49
- package/dist/components/FormerControllers/CtrlFieldShell.svelte +15 -0
- package/dist/components/FormerControllers/CtrlFieldShell.svelte.d.ts +12 -0
- package/dist/components/FormerControllers/DateTimeCtrl/DateTimeCtrl.svelte +285 -457
- package/dist/components/FormerControllers/DateTimeCtrl/DateTimeCtrlCalendar.svelte +95 -136
- package/dist/components/FormerControllers/DateTimeCtrl/DateTimeCtrlPickerPanel.svelte +3 -62
- package/dist/components/FormerControllers/DateTimeCtrl/DateTimeCtrlTimeFields.svelte +143 -217
- package/dist/components/FormerControllers/IconButtonCtrl.svelte +13 -47
- package/dist/components/FormerControllers/InlineWrapper.svelte +12 -41
- package/dist/components/FormerControllers/InlineWrapperPreview.svelte +4 -26
- package/dist/components/FormerControllers/NativeSelectCtrl.svelte +7 -39
- package/dist/components/FormerControllers/NumberInputCtrl.svelte +21 -43
- package/dist/components/FormerControllers/PasswordInputCtrl.svelte +8 -33
- package/dist/components/FormerControllers/SwitchCtrl.svelte +4 -20
- package/dist/components/FormerControllers/TextAreaCtrl.svelte +7 -34
- package/dist/components/FormerControllers/TextInputCtrl.svelte +7 -34
- package/dist/components/FormerControllers/ctrlLoading.svelte.d.ts +8 -0
- package/dist/components/FormerControllers/ctrlLoading.svelte.js +43 -0
- package/dist/components/FormerControllers/index.d.ts +2 -0
- package/dist/components/FormerControllers/index.js +2 -0
- package/dist/components/FormerControllers/utils.d.ts +1 -0
- package/dist/components/FormerControllers/utils.js +3 -0
- package/dist/components/GlobalStateStore/GlobalStateStoreProvider.svelte +73 -120
- package/dist/components/Gridler/components/Gridler.svelte +344 -442
- package/dist/components/Gridler/components/GridlerCanvas.svelte +720 -1115
- package/dist/components/Gridler/components/GridlerEditor.svelte +2 -15
- package/dist/components/Gridler/components/GridlerFull.svelte +521 -841
- package/dist/components/Gridler/components/GridlerFull.svelte.d.ts +1 -1
- package/dist/components/Gridler/components/GridlerFullWithFormerPreview.svelte +194 -147
- package/dist/components/Gridler/components/GridlerSearch.svelte +7 -16
- package/dist/components/Gridler/components/GridlerSearchToggle.svelte +7 -19
- package/dist/components/Gridler/types.d.ts +1 -1
- package/dist/components/Gridler/utils/serverPaging.d.ts +1 -0
- package/dist/components/Gridler/utils/serverPaging.js +7 -0
- package/dist/components/Icons/IconAdd.svelte +1 -3
- package/dist/components/Icons/IconAlertCircle.svelte +1 -3
- package/dist/components/Icons/IconAlertTriangle.svelte +1 -3
- package/dist/components/Icons/IconCamera.svelte +1 -3
- package/dist/components/Icons/IconClose.svelte +1 -3
- package/dist/components/Icons/IconEdit.svelte +1 -3
- package/dist/components/Icons/IconFilter.svelte +1 -3
- package/dist/components/Icons/IconSearch.svelte +1 -3
- package/dist/components/Icons/IconSort.svelte +1 -3
- package/dist/components/Icons/IconTrash.svelte +1 -3
- package/dist/components/Portal/Portal.svelte +14 -38
- package/dist/components/Screenshot/Screenshot.svelte +7 -13
- package/dist/components/Svark/Svark.svelte +680 -852
- package/dist/components/Svark/SvarkContextMenu.svelte +44 -63
- package/dist/components/Svark/SvarkInfiniteLoader.svelte +2 -6
- package/dist/components/Svark/SvarkPager.svelte +2 -28
- package/dist/components/Svark/SvarkSelectionDemo.svelte +4 -8
- package/dist/components/Svark/SvarkTopBar.svelte +9 -74
- package/dist/components/SvarkGrid/SvarkGrid.svelte +877 -1123
- package/dist/components/SvarkGrid/components/SvarkColumnFilterForm.svelte +45 -58
- package/dist/components/SvarkGrid/components/SvarkContextMenu.svelte +44 -63
- package/dist/components/SvarkGrid/components/SvarkHeaderFilterCell.svelte +41 -75
- package/dist/components/SvarkGrid/components/SvarkInfiniteLoader.svelte +2 -6
- package/dist/components/SvarkGrid/components/SvarkPager.svelte +2 -28
- package/dist/components/SvarkGrid/components/SvarkSearchPopover.svelte +8 -16
- package/dist/components/SvarkGrid/components/SvarkTopBar.svelte +6 -62
- package/dist/components/SvarkGrid/internal/SvarkGridView.svelte +345 -507
- package/dist/components/VTree/VTree.svelte +454 -431
- package/dist/components/VTree/VTree.utils.d.ts +23 -0
- package/dist/components/VTree/VTree.utils.js +73 -0
- package/dist/components/VTree/VTreeContextMenu.svelte +21 -33
- package/dist/components/VTree/VTreeControlledSelectionDemo.svelte +20 -0
- package/dist/components/VTree/VTreeControlledSelectionDemo.svelte.d.ts +18 -0
- package/dist/components/VTree/VTreeCustomizationDemo.svelte +23 -0
- package/dist/components/VTree/VTreeCustomizationDemo.svelte.d.ts +18 -0
- package/dist/components/VTree/VTreeEventsDemo.svelte +48 -58
- package/dist/components/VTree/VTreeInteractionDemo.svelte +29 -0
- package/dist/components/VTree/VTreeInteractionDemo.svelte.d.ts +18 -0
- package/dist/components/VTree/VTreeMultiSelectDemo.svelte +27 -0
- package/dist/components/VTree/VTreeMultiSelectDemo.svelte.d.ts +18 -0
- package/dist/components/VTree/VTreeRow.svelte +77 -115
- package/dist/components/VTree/VTreeRow.svelte.d.ts +34 -18
- package/dist/components/VTree/VTreeSearch.svelte +6 -13
- package/dist/components/VTree/VTreeVirtualViewport.svelte +54 -143
- package/dist/components/VTree/VTreeVirtualViewport.svelte.d.ts +35 -18
- package/dist/components/VTree/types.d.ts +39 -1
- package/llm/COMPONENT_GUIDE.md +25 -0
- package/package.json +51 -50
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Snippet } from "svelte";
|
|
2
2
|
import type { GridlerCell, GridlerColumn, GridlerContextMenuItem, GridlerProps, Item } from "../types";
|
|
3
|
-
export interface Props extends Omit<Partial<GridlerProps>, "columns" | "rows" | "getCellContent" | "searchValue" | "onSearchValueChange" | "onVisibleRangeChange" | "onCellDblClick" | "onRowClick" | "onRowContextMenu"> {
|
|
3
|
+
export interface Props extends Omit<Partial<GridlerProps>, "columns" | "rows" | "getCellContent" | "searchValue" | "onSearchValueChange" | "onVisibleRangeChange" | "onCellDblClick" | "onRowClick" | "onRowContextMenu" | "onColumnsChange"> {
|
|
4
4
|
columns: GridlerColumn[];
|
|
5
5
|
/**
|
|
6
6
|
* Optional row data. When provided (and `getCellContent` is omitted), the default
|
|
@@ -1,150 +1,197 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
1
|
+
<script lang="ts">import GridlerFull from "./GridlerFull.svelte";
|
|
2
|
+
import FormerDrawer from "../../Former/FormerDrawer.svelte";
|
|
3
|
+
import TextInputCtrl from "../../FormerControllers/TextInputCtrl.svelte";
|
|
4
|
+
import NumberInputCtrl from "../../FormerControllers/NumberInputCtrl.svelte";
|
|
5
|
+
import NativeSelectCtrl from "../../FormerControllers/NativeSelectCtrl.svelte";
|
|
6
|
+
import IconEdit from "../../Icons/IconEdit.svelte";
|
|
7
|
+
import IconTrash from "../../Icons/IconTrash.svelte";
|
|
8
|
+
import { iconAddSvg, iconEditSvg, iconTrashSvg } from "../../Icons/strings";
|
|
9
|
+
const DEPARTMENTS = [
|
|
10
|
+
"Engineering",
|
|
11
|
+
"Marketing",
|
|
12
|
+
"Sales",
|
|
13
|
+
"HR",
|
|
14
|
+
"Finance",
|
|
15
|
+
"Operations"
|
|
16
|
+
];
|
|
17
|
+
const STATUSES = [
|
|
18
|
+
"Active",
|
|
19
|
+
"Pending",
|
|
20
|
+
"Inactive"
|
|
21
|
+
];
|
|
22
|
+
const FIRST = [
|
|
23
|
+
"Alice",
|
|
24
|
+
"Bob",
|
|
25
|
+
"Carol",
|
|
26
|
+
"David",
|
|
27
|
+
"Eve",
|
|
28
|
+
"Frank",
|
|
29
|
+
"Grace",
|
|
30
|
+
"Henry"
|
|
31
|
+
];
|
|
32
|
+
const LAST = [
|
|
33
|
+
"Smith",
|
|
34
|
+
"Johnson",
|
|
35
|
+
"Williams",
|
|
36
|
+
"Brown",
|
|
37
|
+
"Jones",
|
|
38
|
+
"Garcia"
|
|
39
|
+
];
|
|
40
|
+
function makeRow(i) {
|
|
41
|
+
const first = FIRST[i % FIRST.length];
|
|
42
|
+
const last = LAST[Math.floor(i / FIRST.length) % LAST.length];
|
|
43
|
+
return {
|
|
44
|
+
id: i + 1,
|
|
45
|
+
name: `${first} ${last}`,
|
|
46
|
+
email: `${first.toLowerCase()}.${last.toLowerCase()}@example.com`,
|
|
47
|
+
department: DEPARTMENTS[i % DEPARTMENTS.length],
|
|
48
|
+
salary: 4e4 + i % 60 * 1e3,
|
|
49
|
+
status: STATUSES[i % STATUSES.length]
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
const columns = [
|
|
53
|
+
{
|
|
54
|
+
id: "id",
|
|
55
|
+
title: "ID",
|
|
56
|
+
width: 70
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: "name",
|
|
60
|
+
title: "Name",
|
|
61
|
+
width: 180
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: "email",
|
|
65
|
+
title: "Email",
|
|
66
|
+
width: 220
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: "department",
|
|
70
|
+
title: "Department",
|
|
71
|
+
width: 150
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: "salary",
|
|
75
|
+
title: "Salary",
|
|
76
|
+
width: 110
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: "status",
|
|
80
|
+
title: "Status",
|
|
81
|
+
width: 110
|
|
82
|
+
}
|
|
83
|
+
];
|
|
84
|
+
const departmentOptions = DEPARTMENTS.map((d) => ({
|
|
85
|
+
label: d,
|
|
86
|
+
value: d
|
|
87
|
+
}));
|
|
88
|
+
const statusOptions = STATUSES.map((s) => ({
|
|
89
|
+
label: s,
|
|
90
|
+
value: s
|
|
91
|
+
}));
|
|
92
|
+
let nextId = 51;
|
|
93
|
+
let rows = $state(Array.from({ length: 50 }, (_, i) => makeRow(i)));
|
|
94
|
+
// ── Drawer state ─────────────────────────────────────────────────────────────
|
|
95
|
+
let drawerOpen = $state(false);
|
|
96
|
+
let formMode = $state("update");
|
|
97
|
+
let formValues = $state(undefined);
|
|
98
|
+
let lastSaved = $state(undefined);
|
|
99
|
+
function openForm(mode, row) {
|
|
100
|
+
formMode = mode;
|
|
101
|
+
formValues = row ? { ...row } : {
|
|
102
|
+
id: 0,
|
|
103
|
+
name: "",
|
|
104
|
+
email: "",
|
|
105
|
+
department: "",
|
|
106
|
+
salary: 5e4,
|
|
107
|
+
status: "Active"
|
|
108
|
+
};
|
|
109
|
+
drawerOpen = true;
|
|
110
|
+
}
|
|
111
|
+
const drawerTitle = $derived(formMode === "insert" ? "Add Employee" : formMode === "delete" ? "Delete Employee" : "Edit Employee");
|
|
112
|
+
// ── Selection tracking ────────────────────────────────────────────────────────
|
|
113
|
+
let selectedItems = $state([]);
|
|
114
|
+
function firstSelected() {
|
|
115
|
+
const item = selectedItems[0];
|
|
116
|
+
return item ? item : undefined;
|
|
117
|
+
}
|
|
118
|
+
// ── Burger menu items ─────────────────────────────────────────────────────────
|
|
119
|
+
const menuItems = [
|
|
120
|
+
{
|
|
121
|
+
id: "add",
|
|
122
|
+
label: "Add",
|
|
123
|
+
icon: iconAddSvg,
|
|
124
|
+
kind: "item",
|
|
125
|
+
onselect: () => openForm("insert")
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
id: "sep1",
|
|
129
|
+
label: "",
|
|
130
|
+
kind: "separator"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
id: "edit",
|
|
134
|
+
label: "Edit Selected",
|
|
135
|
+
icon: iconEditSvg,
|
|
136
|
+
kind: "item",
|
|
137
|
+
onselect: () => {
|
|
138
|
+
const row = firstSelected();
|
|
139
|
+
if (row) openForm("update", row);
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
id: "delete",
|
|
144
|
+
label: "Delete Selected",
|
|
145
|
+
icon: iconTrashSvg,
|
|
146
|
+
kind: "item",
|
|
147
|
+
onselect: () => {
|
|
148
|
+
const row = firstSelected();
|
|
149
|
+
if (row) openForm("delete", row);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
];
|
|
153
|
+
// ── Context menu (right-click on row) ─────────────────────────────────────────
|
|
154
|
+
let ctxVisible = $state(false);
|
|
155
|
+
let ctxX = $state(0);
|
|
156
|
+
let ctxY = $state(0);
|
|
157
|
+
let ctxRow = $state(undefined);
|
|
158
|
+
let wrapperEl = $state(null);
|
|
159
|
+
let lastMousePos = {
|
|
160
|
+
x: 0,
|
|
161
|
+
y: 0
|
|
162
|
+
};
|
|
163
|
+
// Capture phase fires before the canvas handler, so lastMousePos is fresh when
|
|
164
|
+
// onRowContextMenu calls showContextMenu.
|
|
165
|
+
$effect(() => {
|
|
166
|
+
if (!wrapperEl) return;
|
|
167
|
+
const handler = (e) => {
|
|
168
|
+
lastMousePos = {
|
|
169
|
+
x: e.clientX,
|
|
170
|
+
y: e.clientY
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
wrapperEl.addEventListener("contextmenu", handler, true);
|
|
174
|
+
return () => wrapperEl?.removeEventListener("contextmenu", handler, true);
|
|
175
|
+
});
|
|
176
|
+
function showContextMenu(rowData) {
|
|
177
|
+
if (!rowData) return;
|
|
178
|
+
ctxRow = rowData;
|
|
179
|
+
ctxX = lastMousePos.x;
|
|
180
|
+
ctxY = lastMousePos.y;
|
|
181
|
+
ctxVisible = true;
|
|
182
|
+
const close = () => {
|
|
183
|
+
ctxVisible = false;
|
|
184
|
+
document.removeEventListener("click", close, true);
|
|
185
|
+
document.removeEventListener("keydown", closeOnEsc, true);
|
|
186
|
+
};
|
|
187
|
+
const closeOnEsc = (e) => {
|
|
188
|
+
if (e.key === "Escape") close();
|
|
189
|
+
};
|
|
190
|
+
setTimeout(() => {
|
|
191
|
+
document.addEventListener("click", close, true);
|
|
192
|
+
document.addEventListener("keydown", closeOnEsc, true);
|
|
193
|
+
}, 0);
|
|
194
|
+
}
|
|
148
195
|
</script>
|
|
149
196
|
|
|
150
197
|
<div class="p-4 space-y-2" bind:this={wrapperEl}>
|
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
<script lang="ts"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const { value, onValueChange, onClose }: Props = $props();
|
|
11
|
-
|
|
12
|
-
let inputRef: HTMLInputElement | undefined;
|
|
13
|
-
|
|
14
|
-
export function focus() {
|
|
15
|
-
inputRef?.focus();
|
|
16
|
-
}
|
|
1
|
+
<script lang="ts">// @ts-nocheck
|
|
2
|
+
import IconClose from "../../Icons/IconClose.svelte";
|
|
3
|
+
const { value, onValueChange, onClose } = $props();
|
|
4
|
+
let inputRef;
|
|
5
|
+
export function focus() {
|
|
6
|
+
inputRef?.focus();
|
|
7
|
+
}
|
|
17
8
|
</script>
|
|
18
9
|
|
|
19
10
|
<div class="gridler-search" role="search">
|
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
onToggle: () => void;
|
|
9
|
-
onValueChange: (v: string) => void;
|
|
10
|
-
onClose: () => void;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const { show, value, onToggle, onValueChange, onClose }: Props = $props();
|
|
14
|
-
|
|
15
|
-
let search: GridlerSearch | undefined = $state();
|
|
16
|
-
|
|
17
|
-
$effect(() => {
|
|
18
|
-
if (show) search?.focus();
|
|
19
|
-
});
|
|
1
|
+
<script lang="ts">import GridlerSearch from "./GridlerSearch.svelte";
|
|
2
|
+
import IconSearch from "../../Icons/IconSearch.svelte";
|
|
3
|
+
const { show, value, onToggle, onValueChange, onClose } = $props();
|
|
4
|
+
let search = $state();
|
|
5
|
+
$effect(() => {
|
|
6
|
+
if (show) search?.focus();
|
|
7
|
+
});
|
|
20
8
|
</script>
|
|
21
9
|
|
|
22
10
|
<button
|
|
@@ -124,7 +124,7 @@ export interface ScrollState {
|
|
|
124
124
|
* selectedItems, onSelectedItemsChange,
|
|
125
125
|
* dataSource, dataSourceOptions, data, onDataChange, settings
|
|
126
126
|
*/
|
|
127
|
-
export interface GridlerProps extends GridCommonProps<Record<string, unknown
|
|
127
|
+
export interface GridlerProps extends Omit<GridCommonProps<Record<string, unknown>>, 'onCellDblClick' | 'onColumnsChange'> {
|
|
128
128
|
/** Override with the more specific GridlerColumn type. */
|
|
129
129
|
columns: GridlerColumn[];
|
|
130
130
|
/** Total number of data rows. */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getServerRenderableRows(loadedRows: number, reportedTotal: number, allLoaded: boolean): number;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
interface Props { size?: number; class?: string; }
|
|
3
|
-
const { size = 16, class: cls = '' }: Props = $props();
|
|
1
|
+
<script lang="ts">const { size = 16, class: cls = "" } = $props();
|
|
4
2
|
</script>
|
|
5
3
|
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class={cls} aria-hidden="true">
|
|
6
4
|
<circle cx="12" cy="12" r="9"/>
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
interface Props { size?: number; class?: string; }
|
|
3
|
-
const { size = 16, class: cls = '' }: Props = $props();
|
|
1
|
+
<script lang="ts">const { size = 16, class: cls = "" } = $props();
|
|
4
2
|
</script>
|
|
5
3
|
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class={cls} aria-hidden="true">
|
|
6
4
|
<circle cx="12" cy="12" r="10"/>
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
interface Props { size?: number; class?: string; }
|
|
3
|
-
const { size = 16, class: cls = '' }: Props = $props();
|
|
1
|
+
<script lang="ts">const { size = 16, class: cls = "" } = $props();
|
|
4
2
|
</script>
|
|
5
3
|
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class={cls} aria-hidden="true">
|
|
6
4
|
<path d="m10.29 3.86-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.71-3.14l-8-14a2 2 0 0 0-3.42 0z"/>
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
interface Props { size?: number; class?: string; }
|
|
3
|
-
const { size = 16, class: cls = '' }: Props = $props();
|
|
1
|
+
<script lang="ts">const { size = 16, class: cls = "" } = $props();
|
|
4
2
|
</script>
|
|
5
3
|
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class={cls} aria-hidden="true">
|
|
6
4
|
<path d="M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z"/>
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
interface Props { size?: number; class?: string; }
|
|
3
|
-
const { size = 16, class: cls = '' }: Props = $props();
|
|
1
|
+
<script lang="ts">const { size = 16, class: cls = "" } = $props();
|
|
4
2
|
</script>
|
|
5
3
|
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class={cls} aria-hidden="true">
|
|
6
4
|
<path d="M18 6 6 18M6 6l12 12"/>
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
interface Props { size?: number; class?: string; }
|
|
3
|
-
const { size = 16, class: cls = '' }: Props = $props();
|
|
1
|
+
<script lang="ts">const { size = 16, class: cls = "" } = $props();
|
|
4
2
|
</script>
|
|
5
3
|
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class={cls} aria-hidden="true">
|
|
6
4
|
<path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/>
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
interface Props { size?: number; class?: string; }
|
|
3
|
-
const { size = 16, class: cls = '' }: Props = $props();
|
|
1
|
+
<script lang="ts">const { size = 16, class: cls = "" } = $props();
|
|
4
2
|
</script>
|
|
5
3
|
<svg width={size} height={size} viewBox="0 0 24 24" fill="currentColor" class={cls} aria-hidden="true">
|
|
6
4
|
<path d="M3 5a1 1 0 0 1 1-1h16a1 1 0 0 1 .8 1.6L14 13.5V19a1 1 0 0 1-1.45.9l-3-1.5A1 1 0 0 1 9 17.5v-4L3.2 5.6A1 1 0 0 1 3 5Z"/>
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
interface Props { size?: number; class?: string; }
|
|
3
|
-
const { size = 16, class: cls = '' }: Props = $props();
|
|
1
|
+
<script lang="ts">const { size = 16, class: cls = "" } = $props();
|
|
4
2
|
</script>
|
|
5
3
|
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class={cls} aria-hidden="true">
|
|
6
4
|
<circle cx="11" cy="11" r="7"/>
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
interface Props { direction: 'asc' | 'desc'; size?: number; class?: string; }
|
|
3
|
-
const { direction, size = 16, class: cls = '' }: Props = $props();
|
|
1
|
+
<script lang="ts">const { direction, size = 16, class: cls = "" } = $props();
|
|
4
2
|
</script>
|
|
5
3
|
<svg width={size} height={size} viewBox="0 0 24 24" fill="currentColor" class={cls} aria-hidden="true">
|
|
6
4
|
{#if direction === 'asc'}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
interface Props { size?: number; class?: string; }
|
|
3
|
-
const { size = 16, class: cls = '' }: Props = $props();
|
|
1
|
+
<script lang="ts">const { size = 16, class: cls = "" } = $props();
|
|
4
2
|
</script>
|
|
5
3
|
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class={cls} aria-hidden="true">
|
|
6
4
|
<path d="M3 6h18"/>
|
|
@@ -1,43 +1,19 @@
|
|
|
1
|
-
<script lang="ts" module>
|
|
2
|
-
import type { PropsWithChildren } from "../../utils/PropsWithChildren";
|
|
3
|
-
|
|
4
|
-
export interface PortalRootProps extends Required<PropsWithChildren> {
|
|
5
|
-
/**
|
|
6
|
-
* If true, the portal functionality is disabled and children are rendered in place.
|
|
7
|
-
*
|
|
8
|
-
* @default false
|
|
9
|
-
*/
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* The HTML element to which the portal content will be appended.
|
|
13
|
-
*
|
|
14
|
-
* @default document.body
|
|
15
|
-
*/
|
|
16
|
-
target?: HTMLElement;
|
|
17
|
-
}
|
|
1
|
+
<script lang="ts" module>export {};
|
|
18
2
|
</script>
|
|
19
3
|
|
|
20
|
-
<script lang="ts">
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
const instance = mount(children, {
|
|
36
|
-
target: target,
|
|
37
|
-
context: context,
|
|
38
|
-
});
|
|
39
|
-
return () => unmount(instance);
|
|
40
|
-
});
|
|
4
|
+
<script lang="ts">import { getAllContexts, mount, unmount } from "svelte";
|
|
5
|
+
const context = getAllContexts();
|
|
6
|
+
const { children, disabled = false, target = typeof window === "undefined" ? undefined : document.body } = $props();
|
|
7
|
+
$effect(() => {
|
|
8
|
+
if (disabled || !target) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const instance = mount(children, {
|
|
12
|
+
target,
|
|
13
|
+
context
|
|
14
|
+
});
|
|
15
|
+
return () => unmount(instance);
|
|
16
|
+
});
|
|
41
17
|
</script>
|
|
42
18
|
|
|
43
19
|
{#if disabled || !target}
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
screenshot = await CaptureScreen();
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const truncatedScreenshot = $derived(
|
|
12
|
-
screenshot ? `${screenshot.substring(0, 100)}...` : "",
|
|
13
|
-
);
|
|
1
|
+
<script lang="ts">import { CaptureScreen } from "./Screenshot.util";
|
|
2
|
+
import IconCamera from "../Icons/IconCamera.svelte";
|
|
3
|
+
let screenshot = $state("");
|
|
4
|
+
const capture = async () => {
|
|
5
|
+
screenshot = await CaptureScreen();
|
|
6
|
+
};
|
|
7
|
+
const truncatedScreenshot = $derived(screenshot ? `${screenshot.substring(0, 100)}...` : "");
|
|
14
8
|
</script>
|
|
15
9
|
|
|
16
10
|
<div class="p-4">
|