intable 0.0.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/LICENSE +21 -0
- package/README.md +22 -0
- package/dist/chevron-right.js +8 -0
- package/dist/components/Columns.d.ts +3 -0
- package/dist/components/Columns.js +105 -0
- package/dist/components/DocTree.d.ts +4 -0
- package/dist/components/DocTree.js +40 -0
- package/dist/components/Menu.d.ts +1 -0
- package/dist/components/Menu.js +131 -0
- package/dist/components/Popover.d.ts +14 -0
- package/dist/components/Popover.js +49 -0
- package/dist/components/Render.d.ts +4 -0
- package/dist/components/Render.js +21 -0
- package/dist/components/Split.d.ts +15 -0
- package/dist/components/Split.js +88 -0
- package/dist/components/Tree.d.ts +37 -0
- package/dist/components/Tree.js +101 -0
- package/dist/components/utils.d.ts +3 -0
- package/dist/components/utils.js +10 -0
- package/dist/demo.d.ts +2 -0
- package/dist/demo.js +64 -0
- package/dist/hooks/index.d.ts +38 -0
- package/dist/hooks/index.js +182 -0
- package/dist/hooks/useDir.d.ts +11 -0
- package/dist/hooks/useDir.js +59 -0
- package/dist/hooks/useVirtualizer.d.ts +25 -0
- package/dist/hooks/useVirtualizer.js +92 -0
- package/dist/index.d.ts +116 -0
- package/dist/index.js +348 -0
- package/dist/intable.css +277 -0
- package/dist/loading.js +8 -0
- package/dist/plugins/CellChangeHighlightPlugin.d.ts +2 -0
- package/dist/plugins/CellChangeHighlightPlugin.js +4 -0
- package/dist/plugins/CellSelectionPlugin.d.ts +15 -0
- package/dist/plugins/CellSelectionPlugin.js +150 -0
- package/dist/plugins/CommandPlugin.d.ts +14 -0
- package/dist/plugins/CommandPlugin.js +9 -0
- package/dist/plugins/CopyPastePlugin.d.ts +14 -0
- package/dist/plugins/CopyPastePlugin.js +54 -0
- package/dist/plugins/DiffPlugin.d.ts +23 -0
- package/dist/plugins/DiffPlugin.js +68 -0
- package/dist/plugins/DragColumnPlugin.d.ts +2 -0
- package/dist/plugins/DragColumnPlugin.js +4 -0
- package/dist/plugins/EditablePlugin.d.ts +49 -0
- package/dist/plugins/EditablePlugin.js +191 -0
- package/dist/plugins/ExpandPlugin.d.ts +20 -0
- package/dist/plugins/ExpandPlugin.js +56 -0
- package/dist/plugins/HistoryPlugin.d.ts +10 -0
- package/dist/plugins/HistoryPlugin.js +35 -0
- package/dist/plugins/MenuPlugin.d.ts +18 -0
- package/dist/plugins/MenuPlugin.js +131 -0
- package/dist/plugins/RenderPlugin/components.d.ts +5 -0
- package/dist/plugins/RenderPlugin/components.js +105 -0
- package/dist/plugins/RenderPlugin/index.d.ts +30 -0
- package/dist/plugins/RenderPlugin/index.js +61 -0
- package/dist/plugins/ResizePlugin.d.ts +27 -0
- package/dist/plugins/ResizePlugin.js +103 -0
- package/dist/plugins/RowGroupPlugin.d.ts +17 -0
- package/dist/plugins/RowGroupPlugin.js +99 -0
- package/dist/plugins/RowSelectionPlugin.d.ts +32 -0
- package/dist/plugins/RowSelectionPlugin.js +69 -0
- package/dist/plugins/VirtualScrollPlugin.d.ts +15 -0
- package/dist/plugins/VirtualScrollPlugin.js +121 -0
- package/dist/plus.js +8 -0
- package/dist/types/auto-imports.d.js +0 -0
- package/dist/utils.d.ts +29 -0
- package/dist/utils.js +88 -0
- package/dist/vite.svg +1 -0
- package/dist/wc.d.ts +1 -0
- package/dist/wc.js +24 -0
- package/dist/web-component.d.ts +1 -0
- package/dist/web-component.js +2 -0
- package/dist/x.js +8 -0
- package/package.json +71 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Checkbox } from "./RenderPlugin/components.js";
|
|
2
|
+
import { solidComponent } from "../components/utils.js";
|
|
3
|
+
import { createComponent, insert, template } from "solid-js/web";
|
|
4
|
+
import { createMemo, createRenderEffect, mergeProps as mergeProps$1, on } from "solid-js";
|
|
5
|
+
import { createMutable, reconcile } from "solid-js/store";
|
|
6
|
+
import { keyBy } from "es-toolkit";
|
|
7
|
+
import { defaultsDeep } from "es-toolkit/compat";
|
|
8
|
+
var _tmpl$ = /* @__PURE__ */ template(`<label>`);
|
|
9
|
+
const RowSelectionPlugin = {
|
|
10
|
+
store: (store) => ({ rowSelectionCol: {
|
|
11
|
+
[store.internal]: 1,
|
|
12
|
+
id: Symbol("row-selection"),
|
|
13
|
+
fixed: "left",
|
|
14
|
+
class: "row-selection",
|
|
15
|
+
width: 45,
|
|
16
|
+
resizable: false,
|
|
17
|
+
render: solidComponent((o) => (() => {
|
|
18
|
+
var _el$ = _tmpl$();
|
|
19
|
+
insert(_el$, createComponent(Checkbox, {
|
|
20
|
+
style: "position: absolute",
|
|
21
|
+
get value() {
|
|
22
|
+
return store.commands.rowSelector.isSelected(o.data);
|
|
23
|
+
},
|
|
24
|
+
onChange: (v) => store.commands.rowSelector.select(o.data, v),
|
|
25
|
+
get disabled() {
|
|
26
|
+
return !store.props?.rowSelection?.selectable?.(o.data);
|
|
27
|
+
}
|
|
28
|
+
}));
|
|
29
|
+
return _el$;
|
|
30
|
+
})())
|
|
31
|
+
} }),
|
|
32
|
+
commands: (store) => ({ rowSelector: useSelector(mergeProps$1(() => ({
|
|
33
|
+
rowKey: store.props?.rowKey,
|
|
34
|
+
...store.props?.rowSelection
|
|
35
|
+
}))) }),
|
|
36
|
+
rewriteProps: {
|
|
37
|
+
rowSelection: ({ rowSelection }) => defaultsDeep(rowSelection, {
|
|
38
|
+
enable: false,
|
|
39
|
+
multiple: false,
|
|
40
|
+
selectable: () => true
|
|
41
|
+
}),
|
|
42
|
+
columns: ({ columns }, { store }) => store.props?.rowSelection?.enable ? [store.rowSelectionCol, ...columns] : columns
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
function useSelector(opt) {
|
|
46
|
+
const map = createMutable({});
|
|
47
|
+
const selected = createMemo(() => [...opt.value || []]);
|
|
48
|
+
const isSelected = (data) => !!map[id(data)];
|
|
49
|
+
const select = (data, bool = true) => {
|
|
50
|
+
if (!opt.selectable(data)) return;
|
|
51
|
+
if (opt.multiple) map[id(data)] = bool ? data : void 0;
|
|
52
|
+
else reconcile({ [id(data)]: bool ? data : void 0 })(map);
|
|
53
|
+
set(Object.values(map));
|
|
54
|
+
};
|
|
55
|
+
const clear = () => opt.onChange?.([]);
|
|
56
|
+
const set = (rows = []) => opt.onChange?.(rows);
|
|
57
|
+
const id = (data) => data[opt.rowKey];
|
|
58
|
+
createRenderEffect(on(selected, () => {
|
|
59
|
+
const keyed = keyBy(selected(), id);
|
|
60
|
+
reconcile(keyed)(map);
|
|
61
|
+
}));
|
|
62
|
+
return {
|
|
63
|
+
isSelected,
|
|
64
|
+
select,
|
|
65
|
+
clear,
|
|
66
|
+
set
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export { RowSelectionPlugin };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useVirtualizer } from '@/hooks/useVirtualizer';
|
|
2
|
+
import { type Plugin } from '..';
|
|
3
|
+
declare module '../index' {
|
|
4
|
+
interface TableProps {
|
|
5
|
+
virtual?: {
|
|
6
|
+
x?: Partial<Parameters<typeof useVirtualizer>[0]>;
|
|
7
|
+
y?: Partial<Parameters<typeof useVirtualizer>[0]>;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
interface TableStore {
|
|
11
|
+
virtualizerY: ReturnType<typeof useVirtualizer>;
|
|
12
|
+
virtualizerX: ReturnType<typeof useVirtualizer>;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export declare const VirtualScrollPlugin: Plugin;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { Ctx } from "../index.js";
|
|
2
|
+
import { useVirtualizer } from "../hooks/useVirtualizer.js";
|
|
3
|
+
import { createComponent, mergeProps } from "solid-js/web";
|
|
4
|
+
import { createEffect, createMemo, mergeProps as mergeProps$1, useContext } from "solid-js";
|
|
5
|
+
import { combineProps } from "@solid-primitives/props";
|
|
6
|
+
import { defaultsDeep } from "es-toolkit/compat";
|
|
7
|
+
import { defaultRangeExtractor } from "@tanstack/solid-virtual";
|
|
8
|
+
var $ML = Symbol();
|
|
9
|
+
const VirtualScrollPlugin = { rewriteProps: {
|
|
10
|
+
virtual: ({ virtual }) => defaultsDeep(virtual, {
|
|
11
|
+
x: {
|
|
12
|
+
batch: 3,
|
|
13
|
+
overscan: 2
|
|
14
|
+
},
|
|
15
|
+
y: {
|
|
16
|
+
batch: 5,
|
|
17
|
+
overscan: 5
|
|
18
|
+
}
|
|
19
|
+
}),
|
|
20
|
+
Table: ({ Table }, { store }) => (o) => {
|
|
21
|
+
let el;
|
|
22
|
+
const { props } = useContext(Ctx);
|
|
23
|
+
const virtualizerY = useVirtualizer(mergeProps$1(() => props.virtual?.y, {
|
|
24
|
+
getScrollElement: () => el,
|
|
25
|
+
get count() {
|
|
26
|
+
return props.data?.length || 0;
|
|
27
|
+
},
|
|
28
|
+
estimateSize: () => 32,
|
|
29
|
+
indexAttribute: "y"
|
|
30
|
+
}));
|
|
31
|
+
const virtualizerX = useVirtualizer(mergeProps$1(() => props.virtual?.x, {
|
|
32
|
+
horizontal: true,
|
|
33
|
+
getScrollElement: () => el,
|
|
34
|
+
get count() {
|
|
35
|
+
return props.columns?.length || 0;
|
|
36
|
+
},
|
|
37
|
+
estimateSize: (i) => props.columns?.[i].width ?? 40,
|
|
38
|
+
indexAttribute: "x",
|
|
39
|
+
rangeExtractor(range) {
|
|
40
|
+
return [...new Set([...props.columns?.map((e, i) => e.fixed ? i : void 0).filter((e) => e != null) || [], ...defaultRangeExtractor(range)])];
|
|
41
|
+
},
|
|
42
|
+
extras: () => props.columns?.map((e, i) => e.fixed ? i : void 0).filter((e) => e != null) || []
|
|
43
|
+
}));
|
|
44
|
+
store.virtualizerY = virtualizerY;
|
|
45
|
+
store.virtualizerX = virtualizerX;
|
|
46
|
+
store[$ML] = createMemo(() => {
|
|
47
|
+
const items = store.virtualizerX.getVirtualItems();
|
|
48
|
+
const ret = {};
|
|
49
|
+
for (let i = 1; i < items.length; i++) {
|
|
50
|
+
const item = items[i], prev = items[i - 1];
|
|
51
|
+
if (item.index - prev.index > 1) ret[item.index] = {
|
|
52
|
+
item,
|
|
53
|
+
offset: item.start - prev.end
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
return ret;
|
|
57
|
+
});
|
|
58
|
+
o = combineProps({
|
|
59
|
+
ref: (e) => el = e,
|
|
60
|
+
class: "virtual"
|
|
61
|
+
}, o);
|
|
62
|
+
createEffect(() => {
|
|
63
|
+
const { table, tbody } = store;
|
|
64
|
+
table.style.width = store.virtualizerX.getTotalSize() + "px";
|
|
65
|
+
table.style.height = store.virtualizerY.getTotalSize() + (store.thead?.offsetHeight || 0) + "px";
|
|
66
|
+
});
|
|
67
|
+
return createComponent(Table, o);
|
|
68
|
+
},
|
|
69
|
+
Thead: ({ Thead }, { store }) => (o) => {
|
|
70
|
+
o = combineProps({ get style() {
|
|
71
|
+
return `transform: translate(${store.virtualizerX.getVirtualItems()[0]?.start}px, 0px);`;
|
|
72
|
+
} }, o);
|
|
73
|
+
return createComponent(Thead, o);
|
|
74
|
+
},
|
|
75
|
+
Tbody: ({ Tbody }, { store }) => (o) => {
|
|
76
|
+
o = combineProps({ get style() {
|
|
77
|
+
return `transform: translate(${store.virtualizerX.getVirtualItems()[0]?.start}px, ${store.virtualizerY.getVirtualItems()[0]?.start}px)`;
|
|
78
|
+
} }, o);
|
|
79
|
+
return createComponent(Tbody, o);
|
|
80
|
+
},
|
|
81
|
+
Tr: ({ Tr }, { store }) => (o) => {
|
|
82
|
+
createEffect(() => store.trSizes[o.y] && store.virtualizerY.resizeItem(o.y, store.trSizes[o.y].height));
|
|
83
|
+
return createComponent(Tr, o);
|
|
84
|
+
},
|
|
85
|
+
Td: ({ Td }, { store }) => (o) => {
|
|
86
|
+
const ml = createMemo(() => store[$ML]()[o.x]);
|
|
87
|
+
const mo = combineProps({ get style() {
|
|
88
|
+
return `width: ${o.col.width || 80}px; margin-left: ${ml()?.offset ?? 0}px`;
|
|
89
|
+
} }, o);
|
|
90
|
+
return createComponent(Td, mo);
|
|
91
|
+
},
|
|
92
|
+
Th: ({ Th }, { store }) => (o) => {
|
|
93
|
+
createEffect(() => store.thSizes[o.x] && store.virtualizerX.resizeItem(o.x, store.thSizes[o.x].width));
|
|
94
|
+
const ml = createMemo(() => store[$ML]?.()[o.x]);
|
|
95
|
+
const mo = combineProps(() => ({ style: `width: ${o.col.width || 80}px; margin-left: ${ml()?.offset ?? 0}px` }), o);
|
|
96
|
+
return createComponent(Th, mo);
|
|
97
|
+
},
|
|
98
|
+
EachRows: ({ EachRows }, { store }) => (o) => {
|
|
99
|
+
const list = createMemo(() => store.virtualizerY.getVirtualItems().map((e) => o.each[e.index]));
|
|
100
|
+
return createComponent(EachRows, mergeProps(o, {
|
|
101
|
+
get each() {
|
|
102
|
+
return list();
|
|
103
|
+
},
|
|
104
|
+
children: (e, i) => {
|
|
105
|
+
return o.children(e, createMemo(() => store.virtualizerY.getVirtualItems()[i()]?.index));
|
|
106
|
+
}
|
|
107
|
+
}));
|
|
108
|
+
},
|
|
109
|
+
EachCells: ({ EachCells }, { store }) => (o) => {
|
|
110
|
+
const list = createMemo(() => store.virtualizerX.getVirtualItems().map((e) => o.each[e.index]));
|
|
111
|
+
return createComponent(EachCells, mergeProps(o, {
|
|
112
|
+
get each() {
|
|
113
|
+
return list();
|
|
114
|
+
},
|
|
115
|
+
children: (e, i) => {
|
|
116
|
+
return o.children(e, createMemo(() => store.virtualizerX.getVirtualItems()[i()]?.index));
|
|
117
|
+
}
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
120
|
+
} };
|
|
121
|
+
export { VirtualScrollPlugin };
|
package/dist/plus.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { spread, template } from "solid-js/web";
|
|
2
|
+
var _tmpl$ = /* @__PURE__ */ template(`<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M5 12h14m-7-7v14">`);
|
|
3
|
+
var plus_default = (props = {}) => (() => {
|
|
4
|
+
var _el$ = _tmpl$();
|
|
5
|
+
spread(_el$, props, true, true);
|
|
6
|
+
return _el$;
|
|
7
|
+
})();
|
|
8
|
+
export { plus_default as default };
|
|
File without changes
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare function file2base64(file: File): Promise<string>;
|
|
2
|
+
export declare function chooseFile(opts: {
|
|
3
|
+
accept?: string;
|
|
4
|
+
multiple?: false;
|
|
5
|
+
}): Promise<File>;
|
|
6
|
+
export declare function chooseFile(opts: {
|
|
7
|
+
accept?: string;
|
|
8
|
+
multiple: true;
|
|
9
|
+
}): Promise<File[]>;
|
|
10
|
+
export declare function chooseImage(): Promise<File>;
|
|
11
|
+
export declare function print(html: string): Promise<void>;
|
|
12
|
+
export declare function mergeRect(rect1: DOMRect, rect2: DOMRect): DOMRect;
|
|
13
|
+
export declare function getStyles(el?: ParentNode): string;
|
|
14
|
+
export declare const unFn: (fn: any, ...args: any[]) => any;
|
|
15
|
+
export declare const log: (...args: any[]) => any;
|
|
16
|
+
export declare const parseStyle: (s: any) => any;
|
|
17
|
+
export declare function findret<T, R>(arr: readonly T[], cb: (e: T, i: number) => R): R | undefined;
|
|
18
|
+
export declare function emptyObject(o: any): any;
|
|
19
|
+
type Fnable<T> = T | (() => T);
|
|
20
|
+
type Awatable<T> = T | Promise<T>;
|
|
21
|
+
type BaseType = string | number | boolean | null;
|
|
22
|
+
export declare function resolveOptions(opts: Fnable<Awatable<Record<string, any> | ({
|
|
23
|
+
label: any;
|
|
24
|
+
value: any;
|
|
25
|
+
} | BaseType)[]>>): {
|
|
26
|
+
label: any;
|
|
27
|
+
value: any;
|
|
28
|
+
}[];
|
|
29
|
+
export {};
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { useMemoAsync } from "./hooks/index.js";
|
|
2
|
+
import { delay, isFunction, isPlainObject, isPromise } from "es-toolkit";
|
|
3
|
+
function file2base64(file) {
|
|
4
|
+
return new Promise((resolve, reject) => {
|
|
5
|
+
const reader = new FileReader();
|
|
6
|
+
reader.readAsDataURL(file);
|
|
7
|
+
reader.onload = () => resolve(reader.result);
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
function chooseFile(opts) {
|
|
11
|
+
return new Promise((resolve, reject) => {
|
|
12
|
+
const input = document.createElement("input");
|
|
13
|
+
input.type = "file";
|
|
14
|
+
input.accept = opts?.accept;
|
|
15
|
+
input.multiple = opts?.multiple;
|
|
16
|
+
input.onchange = () => {
|
|
17
|
+
if (input.files && input.files.length > 0) resolve(input.multiple ? [...input.files] : input.files[0]);
|
|
18
|
+
};
|
|
19
|
+
input.oncancel = reject;
|
|
20
|
+
input.click();
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function chooseImage() {
|
|
24
|
+
return chooseFile({ accept: "image/*" });
|
|
25
|
+
}
|
|
26
|
+
async function print(html) {
|
|
27
|
+
const iframe = document.createElement("iframe");
|
|
28
|
+
iframe.srcdoc = `${[...document.querySelectorAll("style"), ...document.querySelectorAll("link[rel=\"stylesheet\"]")].map((e) => e.outerHTML).join("\n")}\n\n${html}`;
|
|
29
|
+
Object.assign(iframe.style, {
|
|
30
|
+
position: "fixed",
|
|
31
|
+
display: "none"
|
|
32
|
+
});
|
|
33
|
+
document.body.append(iframe);
|
|
34
|
+
await new Promise((resolve) => iframe.contentWindow.addEventListener("load", resolve, { once: true }));
|
|
35
|
+
await delay(300);
|
|
36
|
+
iframe.contentWindow.print();
|
|
37
|
+
iframe.remove();
|
|
38
|
+
}
|
|
39
|
+
function mergeRect(rect1, rect2) {
|
|
40
|
+
return DOMRect.fromRect({
|
|
41
|
+
x: Math.min(rect1.x, rect2.x),
|
|
42
|
+
y: Math.min(rect1.y, rect2.y),
|
|
43
|
+
width: Math.max(rect1.right, rect2.right) - Math.min(rect1.x, rect2.x),
|
|
44
|
+
height: Math.max(rect1.bottom, rect2.bottom) - Math.min(rect1.y, rect2.y)
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function getStyles(el = document) {
|
|
48
|
+
return [...el.querySelectorAll("style"), ...el.querySelectorAll("link[rel=\"stylesheet\"]")].map((e) => e.outerHTML).join("\n");
|
|
49
|
+
}
|
|
50
|
+
const unFn = (fn, ...args) => typeof fn == "function" ? fn(...args) : fn;
|
|
51
|
+
const log = (...args) => (console.log(...args), args[0]);
|
|
52
|
+
const parseStyle = (s) => s ? s.split(";").reduce((o, e) => ((([k, v]) => o[k.trim()] = v.trim())(e.split(":")), o), {}) : {};
|
|
53
|
+
function findret(arr, cb) {
|
|
54
|
+
for (let i = 0; i < arr.length; i++) {
|
|
55
|
+
const ret = cb(arr[i], i);
|
|
56
|
+
if (ret != null) return ret;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function emptyObject(o) {
|
|
60
|
+
for (const k of Object.keys(o)) delete o[k];
|
|
61
|
+
return o;
|
|
62
|
+
}
|
|
63
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
64
|
+
function resolveOptions(opts) {
|
|
65
|
+
let ret = opts;
|
|
66
|
+
if (isFunction(ret)) ret = ret();
|
|
67
|
+
if (isPromise(ret)) {
|
|
68
|
+
if (cache.has(ret)) return cache.get(ret)();
|
|
69
|
+
cache.set(ret, useMemoAsync(() => ret.then((e) => e.map((e$1) => resolveOptions(e$1)))));
|
|
70
|
+
return cache.get(ret)();
|
|
71
|
+
}
|
|
72
|
+
if (isPlainObject(ret)) ret = Object.entries(ret).map(([k, v]) => ({
|
|
73
|
+
value: k,
|
|
74
|
+
label: v,
|
|
75
|
+
...v
|
|
76
|
+
}));
|
|
77
|
+
return ret?.map((e) => resolveOpt(e)) || [];
|
|
78
|
+
}
|
|
79
|
+
function resolveOpt(opt) {
|
|
80
|
+
return isPlainObject(opt) ? opt : Array.isArray(opt) ? {
|
|
81
|
+
label: opt[0],
|
|
82
|
+
value: opt[1]
|
|
83
|
+
} : {
|
|
84
|
+
label: opt,
|
|
85
|
+
value: opt
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export { chooseFile, chooseImage, emptyObject, file2base64, findret, getStyles, log, mergeRect, parseStyle, print, resolveOptions, unFn };
|
package/dist/vite.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/dist/wc.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TableElement: CustomElementConstructor;
|
package/dist/wc.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Table } from "./index.js";
|
|
2
|
+
import { createComponent } from "solid-js/web";
|
|
3
|
+
import { batch, createEffect, createSignal, untrack } from "solid-js";
|
|
4
|
+
import { createMutable, reconcile } from "solid-js/store";
|
|
5
|
+
import { customElement, noShadowDOM } from "solid-element";
|
|
6
|
+
const TableElement = customElement("wc-table", {
|
|
7
|
+
options: {},
|
|
8
|
+
css: {
|
|
9
|
+
value: "",
|
|
10
|
+
attribute: "css",
|
|
11
|
+
notify: true,
|
|
12
|
+
reflect: false
|
|
13
|
+
},
|
|
14
|
+
theme: ""
|
|
15
|
+
}, (attrs, { element }) => {
|
|
16
|
+
noShadowDOM();
|
|
17
|
+
const props = createMutable(attrs.options);
|
|
18
|
+
createEffect(() => {
|
|
19
|
+
const { options } = attrs;
|
|
20
|
+
untrack(() => batch(() => reconcile(options)(props)));
|
|
21
|
+
});
|
|
22
|
+
return createComponent(Table, props);
|
|
23
|
+
});
|
|
24
|
+
export { TableElement };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './wc';
|
package/dist/x.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { spread, template } from "solid-js/web";
|
|
2
|
+
var _tmpl$ = /* @__PURE__ */ template(`<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M18 6L6 18M6 6l12 12">`);
|
|
3
|
+
var x_default = (props = {}) => (() => {
|
|
4
|
+
var _el$ = _tmpl$();
|
|
5
|
+
spread(_el$, props, true, true);
|
|
6
|
+
return _el$;
|
|
7
|
+
})();
|
|
8
|
+
export { x_default as default };
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "intable",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"module": "./dist/index.js",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": "./dist/index.js",
|
|
12
|
+
"./*": {
|
|
13
|
+
"import": "./dist/*.js",
|
|
14
|
+
"types": "./dist/*.d.ts"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@floating-ui/dom": "^1.7.4",
|
|
19
|
+
"@solid-primitives/bounds": "^0.1.3",
|
|
20
|
+
"@solid-primitives/deep": "^0.3.3",
|
|
21
|
+
"@solid-primitives/event-listener": "^2.4.3",
|
|
22
|
+
"@solid-primitives/history": "^0.2.2",
|
|
23
|
+
"@solid-primitives/keyboard": "^1.3.3",
|
|
24
|
+
"@solid-primitives/media": "^2.3.3",
|
|
25
|
+
"@solid-primitives/memo": "^1.4.3",
|
|
26
|
+
"@solid-primitives/mutation-observer": "^1.2.2",
|
|
27
|
+
"@solid-primitives/pointer": "^0.3.3",
|
|
28
|
+
"@solid-primitives/props": "^3.2.2",
|
|
29
|
+
"@solid-primitives/resize-observer": "^2.1.3",
|
|
30
|
+
"@solid-primitives/scroll": "^2.1.3",
|
|
31
|
+
"@solid-primitives/storage": "^4.3.3",
|
|
32
|
+
"@solid-primitives/utils": "^6.3.2",
|
|
33
|
+
"@tanstack/solid-virtual": "^3.13.12",
|
|
34
|
+
"diff": "^8.0.2",
|
|
35
|
+
"es-toolkit": "^1.39.10",
|
|
36
|
+
"floating-ui-solid": "^1.0.63",
|
|
37
|
+
"solid-element": "^1.9.1",
|
|
38
|
+
"solid-js": "^1.9.9",
|
|
39
|
+
"tinykeys": "^3.0.0",
|
|
40
|
+
"uuid": "^13.0.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@babel/plugin-syntax-typescript": "^7.27.1",
|
|
44
|
+
"@iconify-json/lucide": "^1.2.63",
|
|
45
|
+
"@iconify-json/solar": "^1.2.4",
|
|
46
|
+
"@iconify-json/vscode-icons": "^1.2.29",
|
|
47
|
+
"@unocss/transformer-directives": "^66.4.2",
|
|
48
|
+
"babel-plugin-solid-undestructure": "^1.1.0",
|
|
49
|
+
"rollup-plugin-visualizer": "^6.0.3",
|
|
50
|
+
"sass": "^1.90.0",
|
|
51
|
+
"tinyglobby": "^0.2.15",
|
|
52
|
+
"typescript": "~5.8.3",
|
|
53
|
+
"undestructure-macros": "^0.0.1",
|
|
54
|
+
"unocss": "^66.4.2",
|
|
55
|
+
"unplugin-auto-import": "^19.3.0",
|
|
56
|
+
"unplugin-icons": "^22.2.0",
|
|
57
|
+
"vite": "npm:rolldown-vite@7.1.12",
|
|
58
|
+
"vite-plugin-solid": "^2.11.8",
|
|
59
|
+
"vue": "^3.5.24"
|
|
60
|
+
},
|
|
61
|
+
"publishConfig": {
|
|
62
|
+
"access": "public",
|
|
63
|
+
"registry": "https://registry.npmjs.org/"
|
|
64
|
+
},
|
|
65
|
+
"scripts": {
|
|
66
|
+
"dev": "vite",
|
|
67
|
+
"build": "vite build",
|
|
68
|
+
"build:lib": "node scripts/build.js",
|
|
69
|
+
"preview": "vite preview"
|
|
70
|
+
}
|
|
71
|
+
}
|