intable 0.0.6 → 0.0.8
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/.github/copilot-instructions.md +102 -0
- package/README.md +16 -263
- package/docs/index-BaMALNy6.css +1 -0
- package/docs/index-CDN48t9E.js +3 -0
- package/docs/index-Cc4RNkLY.css +1 -0
- package/docs/index-MRnbkYmU.js +3 -0
- package/docs/index.html +15 -0
- package/docs/vite.svg +1 -0
- package/index.html +13 -0
- package/package.json +35 -38
- package/packages/intable/README.md +379 -0
- package/packages/intable/package.json +51 -0
- package/packages/intable/src/assets/ClearFormat.svg +3 -0
- package/packages/intable/src/assets/Forms.svg +4 -0
- package/packages/intable/src/assets/MergeCell.svg +4 -0
- package/packages/intable/src/assets/SplitCell.svg +4 -0
- package/packages/intable/src/assets/gap.svg +3 -0
- package/packages/intable/src/assets/loading.svg +12 -0
- package/packages/intable/src/assets/paint.svg +9 -0
- package/packages/intable/src/assets/solid.svg +1 -0
- package/packages/intable/src/components/Columns.tsx +86 -0
- package/packages/intable/src/components/DocTree.tsx +36 -0
- package/packages/intable/src/components/Menu.tsx +109 -0
- package/packages/intable/src/components/Popover.tsx +55 -0
- package/packages/intable/src/components/RecycleList.tsx +99 -0
- package/packages/intable/src/components/Render.tsx +26 -0
- package/packages/intable/src/components/Split.tsx +56 -0
- package/packages/intable/src/components/Tree.tsx +115 -0
- package/packages/intable/src/components/utils.tsx +12 -0
- package/packages/intable/src/hooks/index.ts +200 -0
- package/packages/intable/src/hooks/useDir.ts +78 -0
- package/packages/intable/src/hooks/useSelector.ts +91 -0
- package/packages/intable/src/hooks/useSort.tsx +118 -0
- package/packages/intable/src/hooks/useVirtualizer.ts +180 -0
- package/packages/intable/src/index.tsx +489 -0
- package/packages/intable/src/plugins/CellChangeHighlightPlugin.tsx +5 -0
- package/packages/intable/src/plugins/CellMergePlugin.tsx +153 -0
- package/packages/intable/src/plugins/CellSelectionPlugin.tsx +175 -0
- package/packages/intable/src/plugins/CommandPlugin.tsx +74 -0
- package/packages/intable/src/plugins/CopyPastePlugin.tsx +99 -0
- package/packages/intable/src/plugins/DiffPlugin.tsx +120 -0
- package/packages/intable/src/plugins/DragPlugin.tsx +81 -0
- package/packages/intable/src/plugins/EditablePlugin.tsx +252 -0
- package/packages/intable/src/plugins/ExpandPlugin.tsx +80 -0
- package/packages/intable/src/plugins/HeaderGroup.tsx +289 -0
- package/packages/intable/src/plugins/HistoryPlugin.tsx +49 -0
- package/packages/intable/src/plugins/MenuPlugin.tsx +195 -0
- package/packages/intable/src/plugins/RenderPlugin/components.tsx +51 -0
- package/packages/intable/src/plugins/RenderPlugin/index.tsx +81 -0
- package/packages/intable/src/plugins/ResizePlugin.tsx +122 -0
- package/packages/intable/src/plugins/RowGroupPlugin.tsx +122 -0
- package/packages/intable/src/plugins/RowSelectionPlugin.tsx +65 -0
- package/packages/intable/src/plugins/TreePlugin.tsx +212 -0
- package/packages/intable/src/plugins/VirtualScrollPlugin.tsx +190 -0
- package/packages/intable/src/plugins/ZodValidatorPlugin.tsx +61 -0
- package/packages/intable/src/style.scss +244 -0
- package/{dist → packages/intable/src}/theme/antd.scss +14 -5
- package/packages/intable/src/theme/dark.scss +46 -0
- package/{dist → packages/intable/src}/theme/element-plus.scss +6 -5
- package/packages/intable/src/theme/github.scss +80 -0
- package/packages/intable/src/theme/material.scss +73 -0
- package/packages/intable/src/theme/shadcn.scss +66 -0
- package/packages/intable/src/theme/stripe.scss +57 -0
- package/packages/intable/src/tree.ts +13 -0
- package/packages/intable/src/types/auto-imports.d.ts +13 -0
- package/packages/intable/src/utils.ts +122 -0
- package/packages/intable/src/wc.tsx +35 -0
- package/packages/intable/src/web-component.ts +1 -0
- package/packages/react/package.json +36 -0
- package/packages/react/src/index.ts +44 -0
- package/packages/react/src/plugins/antd.ts +94 -0
- package/packages/react/src/style.scss +12 -0
- package/packages/react/src/types/auto-imports.d.ts +10 -0
- package/packages/vue/package.json +34 -0
- package/packages/vue/src/index.ts +63 -0
- package/packages/vue/src/plugins/element-plus.ts +69 -0
- package/packages/vue/src/style.scss +12 -0
- package/packages/vue/src/types/auto-imports.d.ts +10 -0
- package/pnpm-workspace.yaml +2 -0
- package/public/vite.svg +1 -0
- package/scripts/build.js +184 -0
- package/scripts/publish.js +95 -0
- package/src/assets/ClearFormat.svg +3 -0
- package/src/assets/Forms.svg +4 -0
- package/src/assets/MergeCell.svg +4 -0
- package/src/assets/SplitCell.svg +4 -0
- package/src/assets/gap.svg +3 -0
- package/src/assets/loading.svg +12 -0
- package/src/assets/paint.svg +9 -0
- package/src/assets/solid.svg +1 -0
- package/src/demo-vue.ts +54 -0
- package/src/index.scss +105 -0
- package/src/index.tsx +20 -0
- package/src/pages/demo/BasicDemo.tsx +19 -0
- package/src/pages/demo/CellMergeDemo.tsx +41 -0
- package/src/pages/demo/CellSelectionDemo.tsx +24 -0
- package/src/pages/demo/CompositeDemo.tsx +60 -0
- package/src/pages/demo/CopyPasteDemo.tsx +26 -0
- package/src/pages/demo/DiffDemo.tsx +33 -0
- package/src/pages/demo/DragDemo.tsx +25 -0
- package/src/pages/demo/EditableDemo.tsx +58 -0
- package/src/pages/demo/ExpandDemo.tsx +32 -0
- package/src/pages/demo/HeaderGroupDemo.tsx +36 -0
- package/src/pages/demo/HistoryDemo.tsx +28 -0
- package/src/pages/demo/ReactDemo.tsx +59 -0
- package/src/pages/demo/ResizeDemo.tsx +24 -0
- package/src/pages/demo/RowGroupDemo.tsx +43 -0
- package/src/pages/demo/RowSelectionDemo.tsx +27 -0
- package/src/pages/demo/TreeDemo.tsx +45 -0
- package/src/pages/demo/VirtualScrollDemo.tsx +21 -0
- package/src/pages/demo/helpers.tsx +39 -0
- package/src/pages/demo/index.tsx +180 -0
- package/src/pages/index.tsx +2 -0
- package/src/pages/website.scss +37 -0
- package/src/pages/website.tsx +651 -0
- package/src/styles/index.scss +172 -0
- package/src/types/auto-imports.d.ts +13 -0
- package/stats.html +4949 -0
- package/tsconfig.app.json +34 -0
- package/tsconfig.json +7 -0
- package/tsconfig.node.json +26 -0
- package/vite.config.ts +70 -0
- package/dist/__uno.css +0 -1
- package/dist/chevron-right.js +0 -6
- package/dist/components/Columns.d.ts +0 -3
- package/dist/components/Columns.js +0 -71
- package/dist/components/DocTree.d.ts +0 -4
- package/dist/components/DocTree.js +0 -32
- package/dist/components/Menu.d.ts +0 -1
- package/dist/components/Menu.js +0 -107
- package/dist/components/Popover.d.ts +0 -14
- package/dist/components/Popover.js +0 -41
- package/dist/components/Render.d.ts +0 -4
- package/dist/components/Render.js +0 -20
- package/dist/components/Split.d.ts +0 -15
- package/dist/components/Split.js +0 -76
- package/dist/components/Tree.d.ts +0 -37
- package/dist/components/Tree.js +0 -82
- package/dist/components/utils.d.ts +0 -3
- package/dist/components/utils.js +0 -8
- package/dist/hooks/index.d.ts +0 -40
- package/dist/hooks/index.js +0 -157
- package/dist/hooks/useDir.d.ts +0 -11
- package/dist/hooks/useDir.js +0 -42
- package/dist/hooks/useSelector.d.ts +0 -16
- package/dist/hooks/useSelector.js +0 -35
- package/dist/hooks/useSort.d.ts +0 -18
- package/dist/hooks/useSort.js +0 -83
- package/dist/hooks/useVirtualizer.d.ts +0 -25
- package/dist/hooks/useVirtualizer.js +0 -67
- package/dist/index.d.ts +0 -130
- package/dist/index.js +0 -347
- package/dist/loading.js +0 -6
- package/dist/plugins/CellChangeHighlightPlugin.d.ts +0 -2
- package/dist/plugins/CellChangeHighlightPlugin.js +0 -4
- package/dist/plugins/CellMergePlugin.d.ts +0 -12
- package/dist/plugins/CellMergePlugin.js +0 -2
- package/dist/plugins/CellSelectionPlugin.d.ts +0 -15
- package/dist/plugins/CellSelectionPlugin.js +0 -115
- package/dist/plugins/CommandPlugin.d.ts +0 -14
- package/dist/plugins/CommandPlugin.js +0 -12
- package/dist/plugins/CopyPastePlugin.d.ts +0 -14
- package/dist/plugins/CopyPastePlugin.js +0 -42
- package/dist/plugins/DiffPlugin.d.ts +0 -23
- package/dist/plugins/DiffPlugin.js +0 -56
- package/dist/plugins/DragPlugin.d.ts +0 -14
- package/dist/plugins/DragPlugin.js +0 -47
- package/dist/plugins/EditablePlugin.d.ts +0 -48
- package/dist/plugins/EditablePlugin.js +0 -141
- package/dist/plugins/ExpandPlugin.d.ts +0 -18
- package/dist/plugins/ExpandPlugin.js +0 -50
- package/dist/plugins/HistoryPlugin.d.ts +0 -10
- package/dist/plugins/HistoryPlugin.js +0 -30
- package/dist/plugins/MenuPlugin.d.ts +0 -18
- package/dist/plugins/MenuPlugin.js +0 -107
- package/dist/plugins/RenderPlugin/components.d.ts +0 -5
- package/dist/plugins/RenderPlugin/components.js +0 -87
- package/dist/plugins/RenderPlugin/index.d.ts +0 -30
- package/dist/plugins/RenderPlugin/index.js +0 -49
- package/dist/plugins/ResizePlugin.d.ts +0 -27
- package/dist/plugins/ResizePlugin.js +0 -81
- package/dist/plugins/RowGroupPlugin.d.ts +0 -17
- package/dist/plugins/RowGroupPlugin.js +0 -83
- package/dist/plugins/RowSelectionPlugin.d.ts +0 -20
- package/dist/plugins/RowSelectionPlugin.js +0 -42
- package/dist/plugins/VirtualScrollPlugin.d.ts +0 -15
- package/dist/plugins/VirtualScrollPlugin.js +0 -96
- package/dist/plus.js +0 -6
- package/dist/style.css +0 -3
- package/dist/types/auto-imports.d.js +0 -0
- package/dist/utils.d.ts +0 -30
- package/dist/utils.js +0 -70
- package/dist/wc.d.ts +0 -1
- package/dist/wc.js +0 -21
- package/dist/web-component.d.ts +0 -1
- package/dist/web-component.js +0 -2
- package/dist/x.js +0 -6
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import plus_default from "../../plus.js";
|
|
2
|
-
import x_default from "../../x.js";
|
|
3
|
-
import { createComponent, insert, memo, mergeProps, spread, template } from "solid-js/web";
|
|
4
|
-
import { For, splitProps } from "solid-js";
|
|
5
|
-
import { combineProps } from "@solid-primitives/props";
|
|
6
|
-
var _tmpl$ = /* @__PURE__ */ template("<input type=checkbox>"), _tmpl$2 = /* @__PURE__ */ template("<div>");
|
|
7
|
-
const Checkbox = (e) => {
|
|
8
|
-
let f;
|
|
9
|
-
return [e, f] = splitProps(e, ["value", "onChange"]), f = combineProps({ get class() {
|
|
10
|
-
return `you-checkbox ${e.value && "checked"}`;
|
|
11
|
-
} }, f), (() => {
|
|
12
|
-
var p = _tmpl$();
|
|
13
|
-
return p.addEventListener("change", (f) => e.onChange?.(f.currentTarget.checked)), spread(p, mergeProps({ get checked() {
|
|
14
|
-
return e.value || !1;
|
|
15
|
-
} }, f), !1, !1), p;
|
|
16
|
-
})();
|
|
17
|
-
}, Files = (e) => {
|
|
18
|
-
let f;
|
|
19
|
-
return [e, f] = splitProps(e, []), createComponent(Tags, f);
|
|
20
|
-
}, Tags = (f) => {
|
|
21
|
-
let h;
|
|
22
|
-
[f, h] = splitProps(f, [
|
|
23
|
-
"value",
|
|
24
|
-
"children",
|
|
25
|
-
"disabled",
|
|
26
|
-
"onChange",
|
|
27
|
-
"onAdd"
|
|
28
|
-
]), h = combineProps({ class: "flex flex-wrap items-center gap-2 h-full" }, h);
|
|
29
|
-
let g = (e) => Array.isArray(e) ? e : e == null ? [] : [e];
|
|
30
|
-
return (() => {
|
|
31
|
-
var _ = _tmpl$2();
|
|
32
|
-
return spread(_, h, !1, !0), insert(_, createComponent(For, {
|
|
33
|
-
get each() {
|
|
34
|
-
return g(f.value);
|
|
35
|
-
},
|
|
36
|
-
children: (e) => createComponent(Tag, {
|
|
37
|
-
get style() {
|
|
38
|
-
return `background: ${e.color}`;
|
|
39
|
-
},
|
|
40
|
-
get disabled() {
|
|
41
|
-
return f.disabled;
|
|
42
|
-
},
|
|
43
|
-
onDel: () => f.onChange(g(f.value).filter((f) => f != e)),
|
|
44
|
-
get children() {
|
|
45
|
-
return memo(() => !!f.children)() ? f.children(e) : e?.text ?? e?.label ?? e?.name ?? e;
|
|
46
|
-
}
|
|
47
|
-
})
|
|
48
|
-
}), null), insert(_, (() => {
|
|
49
|
-
var m = memo(() => !f.disabled);
|
|
50
|
-
return () => m() && createComponent(Tag, {
|
|
51
|
-
disabled: !0,
|
|
52
|
-
get onClick() {
|
|
53
|
-
return f.onAdd;
|
|
54
|
-
},
|
|
55
|
-
get children() {
|
|
56
|
-
return createComponent(plus_default, {});
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
})(), null), _;
|
|
60
|
-
})();
|
|
61
|
-
}, Tag = (e) => {
|
|
62
|
-
let h;
|
|
63
|
-
return [e, h] = splitProps(e, [
|
|
64
|
-
"disabled",
|
|
65
|
-
"children",
|
|
66
|
-
"onDel"
|
|
67
|
-
]), h = combineProps({ class: "flex items-center px-2 py-1 rd-sm bg-gray/20 text-3.5 lh-[1]" }, h), (() => {
|
|
68
|
-
var g = _tmpl$2();
|
|
69
|
-
return spread(g, h, !1, !0), insert(g, () => e.children, null), insert(g, (() => {
|
|
70
|
-
var m = memo(() => !e.disabled);
|
|
71
|
-
return () => m() && createComponent(x_default, {
|
|
72
|
-
class: "icon-clickable flex-shrink-0 size-4! ml-1 mr--1 op-75",
|
|
73
|
-
get onClick() {
|
|
74
|
-
return e.onDel;
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
})(), null), g;
|
|
78
|
-
})();
|
|
79
|
-
}, evaluateFormula = (e, f) => {
|
|
80
|
-
try {
|
|
81
|
-
let p = { data: f };
|
|
82
|
-
return Function(...Object.keys(p), "return " + e)(...Object.values(p));
|
|
83
|
-
} catch {
|
|
84
|
-
return "公式错误";
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
export { Checkbox, Files, Tag, Tags, evaluateFormula };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { type JSX } from 'solid-js';
|
|
2
|
-
import { type Plugin, type TD } from '../..';
|
|
3
|
-
declare module '../../index' {
|
|
4
|
-
interface TableProps {
|
|
5
|
-
}
|
|
6
|
-
interface TableColumn {
|
|
7
|
-
render?: Render;
|
|
8
|
-
enum?: Record<string, any> | {
|
|
9
|
-
label?: string;
|
|
10
|
-
value: any;
|
|
11
|
-
}[];
|
|
12
|
-
}
|
|
13
|
-
interface TableStore {
|
|
14
|
-
renders: {
|
|
15
|
-
[key: string]: Render;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
export type RenderProps = Parameters<TD>[0] & {
|
|
20
|
-
onChange: (v: any) => void;
|
|
21
|
-
};
|
|
22
|
-
export type Render = (props: RenderProps) => JSX.Element | any;
|
|
23
|
-
export declare const RenderPlugin: Plugin;
|
|
24
|
-
export declare const renders: {
|
|
25
|
-
text: Render;
|
|
26
|
-
number: Render;
|
|
27
|
-
date: Render;
|
|
28
|
-
checkbox: Render;
|
|
29
|
-
file: Render;
|
|
30
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { resolveOptions } from "../../utils.js";
|
|
2
|
-
import { Checkbox, Files } from "./components.js";
|
|
3
|
-
import { renderComponent, solidComponent } from "../../components/utils.js";
|
|
4
|
-
import { createComponent, insert, memo, mergeProps, template } from "solid-js/web";
|
|
5
|
-
import { mergeProps as mergeProps$1 } from "solid-js";
|
|
6
|
-
var _tmpl$ = /* @__PURE__ */ template("<div class=\"flex items-center h-full\">");
|
|
7
|
-
const RenderPlugin = {
|
|
8
|
-
name: "render",
|
|
9
|
-
priority: -Infinity,
|
|
10
|
-
store: () => ({ renders: { ...renders } }),
|
|
11
|
-
rewriteProps: { Td: ({ Td: e }, { store: p }) => (m) => createComponent(e, mergeProps(m, { get children() {
|
|
12
|
-
return (() => {
|
|
13
|
-
let e = ((e) => typeof e == "string" ? p.renders[e] : e)(m.col.render) || text;
|
|
14
|
-
return renderComponent(e, mergeProps$1(m, { onChange: (e) => p.commands.rowChange({
|
|
15
|
-
...m.data,
|
|
16
|
-
[m.col.id]: e
|
|
17
|
-
}, m.y) }), p.props.renderer);
|
|
18
|
-
})();
|
|
19
|
-
} })) }
|
|
20
|
-
};
|
|
21
|
-
var text = (p) => memo(() => ((m) => p.col.enum ? resolveOptions(p.col.enum).find((e) => e.value == m)?.label ?? m : m)(p.data[p.col.id]));
|
|
22
|
-
const renders = {
|
|
23
|
-
text,
|
|
24
|
-
number: text,
|
|
25
|
-
date: text,
|
|
26
|
-
checkbox: (e) => (() => {
|
|
27
|
-
var m = _tmpl$();
|
|
28
|
-
return insert(m, createComponent(Checkbox, {
|
|
29
|
-
class: "",
|
|
30
|
-
get value() {
|
|
31
|
-
return e.data[e.col.id];
|
|
32
|
-
},
|
|
33
|
-
get onChange() {
|
|
34
|
-
return e.onChange;
|
|
35
|
-
}
|
|
36
|
-
})), m;
|
|
37
|
-
})(),
|
|
38
|
-
file: (e) => createComponent(Files, {
|
|
39
|
-
get value() {
|
|
40
|
-
return e.data[e.col.id];
|
|
41
|
-
},
|
|
42
|
-
get onChange() {
|
|
43
|
-
return e.onChange;
|
|
44
|
-
},
|
|
45
|
-
disabled: !0
|
|
46
|
-
})
|
|
47
|
-
};
|
|
48
|
-
for (let e in renders) renders[e] = solidComponent(renders[e]);
|
|
49
|
-
export { RenderPlugin, renders };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { type Plugin } from "../index";
|
|
2
|
-
declare module '../index' {
|
|
3
|
-
interface TableProps {
|
|
4
|
-
resizable?: {
|
|
5
|
-
col?: Partial<{
|
|
6
|
-
enable: boolean;
|
|
7
|
-
min: number;
|
|
8
|
-
max: number;
|
|
9
|
-
}>;
|
|
10
|
-
row?: Partial<{
|
|
11
|
-
enable: boolean;
|
|
12
|
-
min: number;
|
|
13
|
-
max: number;
|
|
14
|
-
}>;
|
|
15
|
-
};
|
|
16
|
-
onColumnsChange?: (columns: TableColumn[]) => void;
|
|
17
|
-
}
|
|
18
|
-
interface TableColumn {
|
|
19
|
-
resizable?: boolean;
|
|
20
|
-
onWidthChange?: (width: number) => void;
|
|
21
|
-
}
|
|
22
|
-
interface TableStore {
|
|
23
|
-
}
|
|
24
|
-
interface Commands {
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
export declare const ResizePlugin: Plugin;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { unFn } from "../utils.js";
|
|
2
|
-
import { usePointerDrag } from "../hooks/index.js";
|
|
3
|
-
import { Ctx } from "../index.js";
|
|
4
|
-
import { className, createComponent, effect, memo, mergeProps, template, use } from "solid-js/web";
|
|
5
|
-
import { batch, untrack, useContext } from "solid-js";
|
|
6
|
-
import { reconcile } from "solid-js/store";
|
|
7
|
-
import { combineProps } from "@solid-primitives/props";
|
|
8
|
-
import { clamp } from "es-toolkit";
|
|
9
|
-
import { createEventListener } from "@solid-primitives/event-listener";
|
|
10
|
-
import { defaultsDeep } from "es-toolkit/compat";
|
|
11
|
-
var _tmpl$ = /* @__PURE__ */ template("<div>"), COL = Symbol("col_size"), ROW = Symbol("row_size"), ColHandle = (e) => {
|
|
12
|
-
let { props: g, store: v } = useContext(Ctx), y;
|
|
13
|
-
return usePointerDrag(() => y, { start(p, m, h) {
|
|
14
|
-
p.stopPropagation();
|
|
15
|
-
let _ = e.x, { min: b, max: x } = g.resizable.col, S = y.parentElement, C = S.offsetWidth;
|
|
16
|
-
m((p, { ox: m }) => v[COL][e.x] = clamp(C + m, b, x)), h(() => {
|
|
17
|
-
let e = g.columns[_], p = [...v.rawProps.columns || []], m = p.indexOf(e[v.raw] ?? e);
|
|
18
|
-
m > -1 && (p[m] = {
|
|
19
|
-
...p[m],
|
|
20
|
-
width: S.offsetWidth
|
|
21
|
-
}, g.onColumnsChange?.(p)), e.onWidthChange?.(S.offsetWidth);
|
|
22
|
-
});
|
|
23
|
-
} }), (() => {
|
|
24
|
-
var p = _tmpl$(), m = y;
|
|
25
|
-
return typeof m == "function" ? use(m, p) : y = p, effect(() => className(p, `in-cell__resize-handle absolute top-0 right-0 flex justify-center w-10px! ${e.x == g.columns.length - 1 ? "justify-end!" : "w-10px! translate-x-1/2"} after:w-1 cursor-w-resize z-1`)), p;
|
|
26
|
-
})();
|
|
27
|
-
}, RowHandle = (e) => {
|
|
28
|
-
let { props: g, store: v } = useContext(Ctx), y;
|
|
29
|
-
return usePointerDrag(() => y, { start(p, m, h) {
|
|
30
|
-
p.stopPropagation();
|
|
31
|
-
let _ = e.y, { min: b, max: x } = g.resizable.row, S = y.parentElement.offsetHeight;
|
|
32
|
-
m((p, { oy: m }) => v[ROW][e.y] = clamp(S + m, b, x)), h(() => {
|
|
33
|
-
let e = g.data[_];
|
|
34
|
-
[...v.rawProps.data || []].indexOf(e[v.raw] ?? e);
|
|
35
|
-
});
|
|
36
|
-
} }), createEventListener(() => y, "dblclick", () => e.data[COL] = void 0), (() => {
|
|
37
|
-
var p = _tmpl$(), m = y;
|
|
38
|
-
return typeof m == "function" ? use(m, p) : y = p, effect(() => className(p, `in-cell__resize-handle absolute bottom-0 left-0 flex flex-col justify-center h-1! ${e.y == g.data.length - 1 ? "justify-end!" : ""} after:h-1 cursor-s-resize z-1`)), p;
|
|
39
|
-
})();
|
|
40
|
-
};
|
|
41
|
-
const ResizePlugin = {
|
|
42
|
-
name: "resize",
|
|
43
|
-
store: () => ({
|
|
44
|
-
[COL]: [],
|
|
45
|
-
[ROW]: []
|
|
46
|
-
}),
|
|
47
|
-
rewriteProps: {
|
|
48
|
-
resizable: ({ resizable: e }) => defaultsDeep(e, {
|
|
49
|
-
col: {
|
|
50
|
-
enable: !0,
|
|
51
|
-
min: 45,
|
|
52
|
-
max: 800
|
|
53
|
-
},
|
|
54
|
-
row: {
|
|
55
|
-
enable: !1,
|
|
56
|
-
min: 20,
|
|
57
|
-
max: 400
|
|
58
|
-
}
|
|
59
|
-
}),
|
|
60
|
-
columns: ({ columns: e }, { store: p }) => (e = e.map((e, m) => ({
|
|
61
|
-
...e,
|
|
62
|
-
[p.raw]: e[p.raw] ?? e
|
|
63
|
-
})), e = e.map((e) => e.resizable === void 0 ? {
|
|
64
|
-
...e,
|
|
65
|
-
resizable: p.props?.resizable?.col.enable,
|
|
66
|
-
[p.raw]: e[p.raw] ?? e
|
|
67
|
-
} : e), e = e.map((e, m) => p[COL][m] ? {
|
|
68
|
-
...e,
|
|
69
|
-
width: p[COL][m],
|
|
70
|
-
[p.raw]: e[p.raw] ?? e
|
|
71
|
-
} : e), untrack(() => batch(() => reconcile(e, { key: p.raw })(p.__resize__cols ??= [])))),
|
|
72
|
-
Th: ({ Th: e }, { store: p }) => (p) => (p = combineProps({ class: "relative" }, p), createComponent(e, mergeProps(p, { get children() {
|
|
73
|
-
return [memo(() => p.children), memo(() => memo(() => !!p.col.resizable)() && createComponent(ColHandle, p))];
|
|
74
|
-
} }))),
|
|
75
|
-
Td: ({ Td: e }, { store: p }) => p.props?.resizable?.row.enable ? (m) => (m = combineProps({ class: "relative" }, m), createComponent(e, mergeProps(m, { get children() {
|
|
76
|
-
return [memo(() => m.children), memo(() => memo(() => !!(m.x == 0 && p.props?.resizable?.row.enable))() && createComponent(RowHandle, m))];
|
|
77
|
-
} }))) : e,
|
|
78
|
-
cellStyle: ({ cellStyle: p }, { store: m }) => (h) => `${unFn(p, h)};` + (m[ROW][h.y] ? `height: ${m[ROW][h.y]}px` : "")
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
export { ResizePlugin };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type Plugin } from '..';
|
|
2
|
-
declare module '../index' {
|
|
3
|
-
interface TableProps {
|
|
4
|
-
rowGroup?: {
|
|
5
|
-
fields?: string[];
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
interface TableStore {
|
|
9
|
-
rowGroup: {
|
|
10
|
-
expands: string[][];
|
|
11
|
-
isExpand: (data: any) => boolean;
|
|
12
|
-
expand: (data: any, r?: any) => void;
|
|
13
|
-
toggleExpand: (data: any) => void;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export declare const RowGroupPlugin: Plugin;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import chevron_right_default from "../chevron-right.js";
|
|
2
|
-
import { Ctx } from "../index.js";
|
|
3
|
-
import { createComponent, delegateEvents, effect, insert, memo, mergeProps, style, template } from "solid-js/web";
|
|
4
|
-
import { batch, createMemo, useContext } from "solid-js";
|
|
5
|
-
import { groupBy, isEqual, remove, zipObject } from "es-toolkit";
|
|
6
|
-
import { findLast } from "es-toolkit/compat";
|
|
7
|
-
var _tmpl$ = /* @__PURE__ */ template("<div class=\"flex items-center\">");
|
|
8
|
-
const RowGroupPlugin = {
|
|
9
|
-
priority: -Infinity,
|
|
10
|
-
store: (e) => ({ rowGroup: {
|
|
11
|
-
expands: [],
|
|
12
|
-
isExpand: (u) => e.rowGroup.expands.some((e) => isEqual(e, u[GROUP].path)),
|
|
13
|
-
expand: (u, d) => batch(() => d ? u[GROUP].path2.forEach((u) => e.rowGroup.isExpand(u) || e.rowGroup.expands.push(u[GROUP].path)) : e.rowGroup.isExpand(u) || e.rowGroup.expands.push(u[GROUP].path)),
|
|
14
|
-
toggleExpand: (u) => e.rowGroup.isExpand(u) ? remove(e.rowGroup.expands, (e) => isEqual(e, u[GROUP].path)) : e.rowGroup.expand(u)
|
|
15
|
-
} }),
|
|
16
|
-
commands: (e, { addRows: u }) => ({ addRows(d, f, p) {
|
|
17
|
-
let { data: m, rowGroup: h, rowKey: g } = e.props;
|
|
18
|
-
if (h?.fields?.length) {
|
|
19
|
-
let h = findLast(m, (e) => e[GROUP], d);
|
|
20
|
-
if (h && m[d][GROUP]) {
|
|
21
|
-
let u = function e(u) {
|
|
22
|
-
return u[GROUP]?.children[0]?.[GROUP] ? e(u[GROUP].children[0]) : u;
|
|
23
|
-
}(h);
|
|
24
|
-
e.rowGroup.expand(u, !0);
|
|
25
|
-
let f = u[GROUP].children[0];
|
|
26
|
-
d = e.props.data.indexOf(f), p = !0;
|
|
27
|
-
}
|
|
28
|
-
u?.(d, f, p);
|
|
29
|
-
} else u?.(...arguments);
|
|
30
|
-
} }),
|
|
31
|
-
rewriteProps: {
|
|
32
|
-
data: ({ data: e }, { store: u }) => u.props?.rowGroup?.fields?.length ? expandData(e, u) : e,
|
|
33
|
-
newRow: ({ newRow: e }, { store: u }) => function(d) {
|
|
34
|
-
let f = e(...arguments), { data: p, rowGroup: m } = u.props;
|
|
35
|
-
if (m?.fields?.length) {
|
|
36
|
-
let e = findLast(p, (e) => e[GROUP], d);
|
|
37
|
-
if (e) {
|
|
38
|
-
let u = function e(u) {
|
|
39
|
-
return u[GROUP]?.children[0]?.[GROUP] ? e(u[GROUP].children[0]) : u;
|
|
40
|
-
}(e), d = zipObject(m.fields, u[GROUP].path);
|
|
41
|
-
Object.assign(f, d);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return f;
|
|
45
|
-
},
|
|
46
|
-
Td: ({ Td: f }, { store: v }) => (y) => {
|
|
47
|
-
if (!y.data?.[GROUP]) return createComponent(f, y);
|
|
48
|
-
let { props: b } = useContext(Ctx), x = createMemo(() => v.rowGroup.isExpand(y.data));
|
|
49
|
-
return createComponent(f, mergeProps(y, { get children() {
|
|
50
|
-
return memo(() => b.columns?.findIndex((e) => !e[v.internal]) == y.x)() ? (() => {
|
|
51
|
-
var u = _tmpl$();
|
|
52
|
-
return u.$$dblclick = () => v.rowGroup.toggleExpand(y.data), insert(u, createComponent(chevron_right_default, {
|
|
53
|
-
class: "icon-clickable mr-2",
|
|
54
|
-
get style() {
|
|
55
|
-
return `transform: rotate(${x() ? 90 : 0}deg); opacity: .6`;
|
|
56
|
-
},
|
|
57
|
-
onClick: () => v.rowGroup.toggleExpand(y.data)
|
|
58
|
-
}), null), insert(u, () => y.data[GROUP].value, null), effect((e) => style(u, `padding-left: ${(y.data[GROUP].path.length - 1) * 16}px`, e)), u;
|
|
59
|
-
})() : y.children;
|
|
60
|
-
} }));
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
var GROUP = Symbol("row-group"), expandData = (e, u, d = []) => {
|
|
65
|
-
let f = u.props.rowGroup.fields, p = u.props.columns.find((e) => !e[u.internal]);
|
|
66
|
-
if (!p || f.length == d.length) return e;
|
|
67
|
-
let m = d[d.length - 1]?.[GROUP].path || [], h = groupBy(e, (e) => e[f[m.length]]);
|
|
68
|
-
return Object.keys(h).flatMap((e) => {
|
|
69
|
-
let f = {
|
|
70
|
-
[p.id]: e,
|
|
71
|
-
[u.internal]: 1
|
|
72
|
-
}, g = [...d, f];
|
|
73
|
-
f[GROUP] = {
|
|
74
|
-
path: [...m, e],
|
|
75
|
-
value: e,
|
|
76
|
-
path2: g
|
|
77
|
-
}, f[GROUP].children = expandData(h[e], u, g);
|
|
78
|
-
let _ = u.rowGroup.isExpand(f) ? f[GROUP].children : [];
|
|
79
|
-
return [f, ..._];
|
|
80
|
-
});
|
|
81
|
-
};
|
|
82
|
-
delegateEvents(["dblclick"]);
|
|
83
|
-
export { RowGroupPlugin };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type Plugin } from '..';
|
|
2
|
-
import { useSelector } from '../hooks/useSelector';
|
|
3
|
-
declare module '../index' {
|
|
4
|
-
interface TableProps {
|
|
5
|
-
rowSelection?: {
|
|
6
|
-
enable?: boolean;
|
|
7
|
-
multiple?: boolean;
|
|
8
|
-
value?: any;
|
|
9
|
-
selectable?: (row: any) => boolean;
|
|
10
|
-
onChange?: (selected: any) => void;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
interface TableStore {
|
|
14
|
-
rowSelectionCol: TableColumn;
|
|
15
|
-
}
|
|
16
|
-
interface Commands {
|
|
17
|
-
rowSelector: ReturnType<typeof useSelector>;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
export declare const RowSelectionPlugin: Plugin;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Checkbox } from "./RenderPlugin/components.js";
|
|
2
|
-
import { solidComponent } from "../components/utils.js";
|
|
3
|
-
import { useSelector } from "../hooks/useSelector.js";
|
|
4
|
-
import { createComponent, insert, template } from "solid-js/web";
|
|
5
|
-
import { mergeProps as mergeProps$1 } from "solid-js";
|
|
6
|
-
import { defaultsDeep } from "es-toolkit/compat";
|
|
7
|
-
var _tmpl$ = /* @__PURE__ */ template("<label>");
|
|
8
|
-
const RowSelectionPlugin = {
|
|
9
|
-
name: "row-selection",
|
|
10
|
-
priority: -Infinity,
|
|
11
|
-
store: (c) => ({ rowSelectionCol: {
|
|
12
|
-
[c.internal]: 1,
|
|
13
|
-
id: Symbol("row-selection"),
|
|
14
|
-
fixed: "left",
|
|
15
|
-
class: "row-selection",
|
|
16
|
-
width: 45,
|
|
17
|
-
resizable: !1,
|
|
18
|
-
render: solidComponent((s) => (() => {
|
|
19
|
-
var l = _tmpl$();
|
|
20
|
-
return insert(l, createComponent(Checkbox, {
|
|
21
|
-
style: "position: absolute",
|
|
22
|
-
get value() {
|
|
23
|
-
return c.commands.rowSelector.has(s.data);
|
|
24
|
-
},
|
|
25
|
-
onChange: (e) => e ? c.commands.rowSelector.add(s.data) : c.commands.rowSelector.del(s.data),
|
|
26
|
-
get disabled() {
|
|
27
|
-
return !c.props?.rowSelection?.selectable?.(s.data);
|
|
28
|
-
}
|
|
29
|
-
})), l;
|
|
30
|
-
})())
|
|
31
|
-
} }),
|
|
32
|
-
commands: (e) => ({ rowSelector: useSelector(mergeProps$1(() => ({ ...e.props?.rowSelection }))) }),
|
|
33
|
-
rewriteProps: {
|
|
34
|
-
rowSelection: ({ rowSelection: e }) => defaultsDeep(e, {
|
|
35
|
-
enable: !1,
|
|
36
|
-
multiple: !1,
|
|
37
|
-
selectable: () => !0
|
|
38
|
-
}),
|
|
39
|
-
columns: ({ columns: e }, { store: s }) => s.props?.rowSelection?.enable ? [s.rowSelectionCol, ...e] : e
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
export { RowSelectionPlugin };
|
|
@@ -1,15 +0,0 @@
|
|
|
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;
|
|
@@ -1,96 +0,0 @@
|
|
|
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: e }) => defaultsDeep(e, {
|
|
11
|
-
x: {
|
|
12
|
-
batch: 3,
|
|
13
|
-
overscan: 2
|
|
14
|
-
},
|
|
15
|
-
y: {
|
|
16
|
-
batch: 5,
|
|
17
|
-
overscan: 5
|
|
18
|
-
}
|
|
19
|
-
}),
|
|
20
|
-
Table: ({ Table: s }, { store: d }) => (f) => {
|
|
21
|
-
let p, { props: m } = useContext(Ctx), h = useVirtualizer(mergeProps$1(() => m.virtual?.y, {
|
|
22
|
-
getScrollElement: () => p,
|
|
23
|
-
get count() {
|
|
24
|
-
return m.data?.length || 0;
|
|
25
|
-
},
|
|
26
|
-
estimateSize: () => 32,
|
|
27
|
-
indexAttribute: "y"
|
|
28
|
-
})), g = useVirtualizer(mergeProps$1(() => m.virtual?.x, {
|
|
29
|
-
horizontal: !0,
|
|
30
|
-
getScrollElement: () => p,
|
|
31
|
-
get count() {
|
|
32
|
-
return m.columns?.length || 0;
|
|
33
|
-
},
|
|
34
|
-
estimateSize: (e) => m.columns?.[e].width ?? 40,
|
|
35
|
-
indexAttribute: "x",
|
|
36
|
-
rangeExtractor(e) {
|
|
37
|
-
return [...new Set([...m.columns?.map((e, a) => e.fixed ? a : void 0).filter((e) => e != null) || [], ...defaultRangeExtractor(e)])];
|
|
38
|
-
},
|
|
39
|
-
extras: () => m.columns?.map((e, a) => e.fixed ? a : void 0).filter((e) => e != null) || []
|
|
40
|
-
}));
|
|
41
|
-
return d.virtualizerY = h, d.virtualizerX = g, d[$ML] = createMemo(() => {
|
|
42
|
-
let e = d.virtualizerX.getVirtualItems(), a = {};
|
|
43
|
-
for (let o = 1; o < e.length; o++) {
|
|
44
|
-
let s = e[o], c = e[o - 1];
|
|
45
|
-
s.index - c.index > 1 && (a[s.index] = {
|
|
46
|
-
item: s,
|
|
47
|
-
offset: s.start - c.end
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
return a;
|
|
51
|
-
}), f = combineProps({
|
|
52
|
-
ref: (e) => p = e,
|
|
53
|
-
class: "virtual"
|
|
54
|
-
}, f), createEffect(() => {
|
|
55
|
-
let { table: e, tbody: a } = d;
|
|
56
|
-
e.style.width = d.virtualizerX.getTotalSize() + "px", e.style.height = d.virtualizerY.getTotalSize() + (d.thead?.offsetHeight || 0) + "px";
|
|
57
|
-
}), createComponent(s, f);
|
|
58
|
-
},
|
|
59
|
-
Thead: ({ Thead: e }, { store: a }) => (s) => (s = combineProps({ get style() {
|
|
60
|
-
return `transform: translate(${a.virtualizerX.getVirtualItems()[0]?.start}px, 0px);`;
|
|
61
|
-
} }, s), createComponent(e, s)),
|
|
62
|
-
Tbody: ({ Tbody: e }, { store: a }) => (s) => (s = combineProps({ get style() {
|
|
63
|
-
return `transform: translate(${a.virtualizerX.getVirtualItems()[0]?.start}px, ${a.virtualizerY.getVirtualItems()[0]?.start}px)`;
|
|
64
|
-
} }, s), createComponent(e, s)),
|
|
65
|
-
Tr: ({ Tr: e }, { store: a }) => (s) => (createEffect(() => a.trSizes[s.y] && a.virtualizerY.resizeItem(s.y, a.trSizes[s.y].height)), createComponent(e, s)),
|
|
66
|
-
Td: ({ Td: e }, { store: a }) => (s) => {
|
|
67
|
-
let c = createMemo(() => a[$ML]()[s.x]), l = combineProps({ get style() {
|
|
68
|
-
return `width: ${s.col.width || 80}px; margin-left: ${c()?.offset ?? 0}px`;
|
|
69
|
-
} }, s);
|
|
70
|
-
return createComponent(e, l);
|
|
71
|
-
},
|
|
72
|
-
Th: ({ Th: e }, { store: a }) => (s) => {
|
|
73
|
-
createEffect(() => a.thSizes[s.x] && a.virtualizerX.resizeItem(s.x, a.thSizes[s.x].width));
|
|
74
|
-
let l = createMemo(() => a[$ML]?.()[s.x]), u = combineProps(() => ({ style: `width: ${s.col.width || 80}px; margin-left: ${l()?.offset ?? 0}px` }), s);
|
|
75
|
-
return createComponent(e, u);
|
|
76
|
-
},
|
|
77
|
-
EachRows: ({ EachRows: e }, { store: a }) => (c) => {
|
|
78
|
-
let l = createMemo(() => a.virtualizerY.getVirtualItems().map((e) => c.each[e.index]));
|
|
79
|
-
return createComponent(e, mergeProps(c, {
|
|
80
|
-
get each() {
|
|
81
|
-
return l();
|
|
82
|
-
},
|
|
83
|
-
children: (e, o) => c.children(e, createMemo(() => a.virtualizerY.getVirtualItems()[o()]?.index))
|
|
84
|
-
}));
|
|
85
|
-
},
|
|
86
|
-
EachCells: ({ EachCells: e }, { store: a }) => (c) => {
|
|
87
|
-
let l = createMemo(() => a.virtualizerX.getVirtualItems().map((e) => c.each[e.index]));
|
|
88
|
-
return createComponent(e, mergeProps(c, {
|
|
89
|
-
get each() {
|
|
90
|
-
return l();
|
|
91
|
-
},
|
|
92
|
-
children: (e, o) => c.children(e, createMemo(() => a.virtualizerX.getVirtualItems()[o()]?.index))
|
|
93
|
-
}));
|
|
94
|
-
}
|
|
95
|
-
} };
|
|
96
|
-
export { VirtualScrollPlugin };
|
package/dist/plus.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
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\">"), plus_default = (n = {}) => (() => {
|
|
3
|
-
var r = _tmpl$();
|
|
4
|
-
return spread(r, n, !0, !0), r;
|
|
5
|
-
})();
|
|
6
|
-
export { plus_default as default };
|
package/dist/style.css
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
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-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%;--un-leading:initial}}@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-bg-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@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}:root,:host{--spacing:.25rem;--colors-gray-DEFAULT:#99a1af;--text-sm-fontSize:.875rem;--text-sm-lineHeight:1.25rem;--radius-sm:.25rem;--colors-blue-DEFAULT:#54a2ff;--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";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--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-blue-DEFAULT:lab(65.0361% -1.42062 -56.9803)}}*,: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-3\.5{font-size:.875rem}.lh-\[1\]{--un-leading:1;line-height:1}.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}.p-1{padding:4px}.px,.px-4{padding-inline:16px}.px-2{padding-inline:8px}.py-1{padding-block:4px}.py-2{padding-block:8px}.pl-1{padding-left:4px}.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)}.b{border-width:1px}.rd-2{border-radius:.5rem}.rd-sm{border-radius:var(--radius-sm)}.bg-\#dafaea{background-color:color-mix(in oklab,#dafaea var(--un-bg-opacity),transparent)}.bg-\#ffe8e8{background-color:color-mix(in oklab,#ffe8e8 var(--un-bg-opacity),transparent)}.bg-\#fff{background-color:color-mix(in oklab,#fff var(--un-bg-opacity),transparent)}.bg-gray\/20{background-color:color-mix(in srgb,var(--colors-gray-DEFAULT)20%,transparent)}.op-75{opacity:.75}.op40{opacity:.4}.flex{display:flex}.flex-shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.gap-2{gap:8px}.size-4\!{width:16px!important;height:16px!important}.size-full{width:100%;height:100%}.h-1\!{height:4px!important}.h-a\!{height:auto!important}.h-full{height:100%}.max-h-100{max-height:400px}.min-h-40{min-height:160px}.min-h-a\!{min-height:auto!important}.w-10px\!{width:10px!important}.after\:h-1:after{height:4px}.after\:w-1:after{width:4px}.inline{display:inline}.block{display:block}.cursor-s-resize{cursor:s-resize}.cursor-w-resize{cursor:w-resize}.resize{resize:both}.resize-none{resize:none}.select-none{-webkit-user-select:none;user-select:none}.translate-x-1\/2{--un-translate-x: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)}.items-center{align-items:center}.box-border{box-sizing:border-box}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.justify-end\!{justify-content:flex-end!important}.justify-center{justify-content:center}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.z-1{z-index:1}.z-9{z-index:9}.overflow-auto{overflow:auto}.table{display:table}.table-cell{display:table-cell}@supports (color:color-mix(in lab, red, red)){.outline-blue{outline-color:color-mix(in oklab,var(--colors-blue-DEFAULT)var(--un-outline-opacity),transparent)}.bg-gray\/20{background-color:color-mix(in oklab,var(--colors-gray-DEFAULT)20%,transparent)}}
|
|
2
|
-
|
|
3
|
-
.data-table{--bg:#fff;--c-primary:#51a2ff;--menu-bg:#fff;--li-hover-bg:#99a1af33;--table-b:1px solid var(--table-b-c);--table-b-c:#ebeef5;--table-c:#606266;--table-bg:#fff;--table-header-c:#909399;--table-header-bg:var(--table-bg);--table-row-hover-bg:#f5f7fa;--select-area-bg:#5292f71a;color:color-mix(in oklab,var(--table-c)var(--un-text-opacity),transparent);border-color:color-mix(in oklab,var(--table-b-c)var(--un-border-opacity),transparent);font-size:14px;position:relative}@property --un-text-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@property --un-border-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}.data-table--table{color:color-mix(in oklab,var(--table-c)var(--un-text-opacity),transparent);outline-style:var(--un-outline-style);border-collapse:collapse;table-layout:fixed;border-collapse:separate;border-spacing:0;border-width:0;outline-width:0;width:max-content}@property --un-outline-style{syntax:"*";inherits:false;initial-value:solid}.data-table thead{color:color-mix(in oklab,var(--table-header-c)var(--un-text-opacity),transparent)}.data-table tr:hover>td{background-color:color-mix(in oklab,var(--table-row-hover-bg)var(--un-bg-opacity),transparent)}@property --un-bg-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}.data-table th{background-color:color-mix(in oklab,var(--table-header-bg)var(--un-bg-opacity),transparent)}.data-table td{background-color:color-mix(in oklab,var(--table-bg)var(--un-bg-opacity),transparent)}.data-table td,.data-table th{vertical-align:middle;outline-style:var(--un-outline-style);border-width:0;border-color:color-mix(in oklab,var(--table-b-c)var(--un-border-opacity),transparent);--un-border-style:solid;box-sizing:border-box;text-align:inherit;background-image:linear-gradient(var(--table-b-c),var(--table-b-c));background-position:100% 100%,100% 0;background-repeat:no-repeat;background-size:100% 1px,1px 100%;border-style:solid;outline-width:0;padding-block:2px;padding-inline:8px}.data-table td:empty:after{content:"ㅤ"!important}.data-table--border{border-width:1px}.data-table--border th,.data-table--border td{background-image:linear-gradient(var(--table-b-c),var(--table-b-c)),linear-gradient(var(--table-b-c),var(--table-b-c))}.data-table--scroll-view{overflow:auto}.data-table__layers{pointer-events:none;z-index:1;position:absolute;top:0;left:0}.data-table__layers>*{position:absolute}.range-selected{position:relative}.range-selected>.area{border-width:0;border-color:color-mix(in oklab,var(--c-primary)var(--un-border-opacity),transparent);--un-border-style:solid;background-color:color-mix(in oklab,var(--select-area-bg)var(--un-bg-opacity),transparent);pointer-events:none;border-style:solid;position:absolute;inset:0}.range-selected-l>.area{border-left-width:1.5px}.range-selected-r>.area{border-right-width:1.5px}.range-selected-t>.area{border-top-width:1.5px}.range-selected-b>.area{border-bottom-width:1.5px}.row-range-highlight,.col-range-highlight{position:relative}.row-range-highlight>.area,.col-range-highlight>.area{border-width:0;border-color:color-mix(in oklab,var(--c-primary)var(--un-border-opacity),transparent);--un-border-style:solid;background-color:color-mix(in oklab,var(--c-primary)10%,transparent);pointer-events:none;border-style:solid;position:absolute;inset:0}.row-range-highlight.index>.area{border-right-width:1px}.col-range-highlight>.area{border-bottom-width:1px}.sticky-header{background-color:color-mix(in oklab,#fff var(--un-bg-opacity),transparent);z-index:9;position:sticky;top:0}.sticky-header:after{pointer-events:none;--un-content:"";content:var(--un-content);width:100%;height:10px;position:absolute;top:100%;box-shadow:inset 0 10px 10px -10px #00000026}@property --un-content{syntax:"*";inherits:false;initial-value:""}.fixed-left,.fixed-right{background-color:color-mix(in oklab,#fff var(--un-bg-opacity),transparent);z-index:1;position:sticky!important}.fixed-left:after,.fixed-right:after{pointer-events:none;--un-content:"";content:var(--un-content);width:10px;height:100%;position:absolute;top:0}.is-scroll-right .fixed-left:after,.is-scroll-mid .fixed-left:after{left:100%;box-shadow:inset 10px 0 10px -10px #00000026}.is-scroll-left .fixed-right:after,.is-scroll-mid .fixed-right:after{right:100%;box-shadow:inset -10px 0 10px -10px #00000026}.copied .range-selected:before{border-style:dashed}.data-table.virtual{width:fit-content;display:block;overflow:auto}.data-table.virtual thead{width:fit-content;display:block}.data-table.virtual thead>tr{display:flex}.data-table.virtual thead>tr>th{flex:none;display:block}.data-table.virtual tbody{width:fit-content;display:block}.data-table.virtual tbody>tr{display:flex}.data-table.virtual tbody>tr>td{flex:none;display:block}.row-selection{width:40px;position:relative}.row-selection>label{justify-content:center;align-items:center;width:100%;height:100%;display:flex;position:absolute;inset:0}.icon-clickable{box-sizing:border-box;border-radius:.25rem;justify-content:center;align-items:center;width:20px;height:20px;padding:2px;display:flex}.icon-clickable:hover{background-color:color-mix(in srgb,var(--colors-gray-DEFAULT)30%,transparent)}@supports (color:color-mix(in lab, red, red)){.icon-clickable:hover{background-color:color-mix(in oklab,var(--colors-gray-DEFAULT)30%,transparent)}}.icon-clickable>svg{width:100%;height:100%}input[type=checkbox].you-checkbox{color:color-mix(in oklab,#2196f3 var(--un-text-opacity),transparent);appearance:none;outline-offset:0px;--un-border-style:solid;border:2px solid;border-radius:.25rem;width:16px;height:16px;margin:4px;position:relative}input[type=checkbox].you-checkbox:focus{outline-style:var(--un-outline-style);--un-outline-style:solid;outline:4px solid oklab(65.8156% -.0610626 -.157539/.4)}@property --un-outline-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}input[type=checkbox].you-checkbox:checked{background-color:currentColor}input[type=checkbox].you-checkbox.checked:after{color:color-mix(in oklab,#fff var(--un-text-opacity),transparent);--un-content:"✓";content:var(--un-content);--un-translate-x:-50%;--un-translate-y:-50%;translate:var(--un-translate-x)var(--un-translate-y);z-index:1;font-size:.75rem;position:absolute;top:50%;left:50%}@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}.in-cell-edit-wrapper{z-index:1;position:absolute;inset:0;box-shadow:0 0 10px -2px #00000050}.in-cell__resize-handle{width:100%;height:100%;position:absolute}.in-cell__resize-handle:hover:after{background-color:color-mix(in oklab,var(--c-primary)40%,transparent)}.in-cell__resize-handle:active:after{background-color:color-mix(in oklab,var(--c-primary)var(--un-bg-opacity),transparent)}.in-cell__resize-handle:after{--un-content:"";content:var(--un-content)}.li{cursor:pointer;position:relative}.li:hover,.li.hover{background-color:color-mix(in oklab,var(--li-hover-bg)var(--un-bg-opacity),transparent)}.li:active:before,.li.selected:before,.li.active:before{content:"";border-radius:inherit;background-color:color-mix(in srgb,var(--colors-gray-DEFAULT)15%,transparent);position:absolute;inset:0}@supports (color:color-mix(in lab, red, red)){.li:active:before,.li.selected:before,.li.active:before{background-color:color-mix(in oklab,var(--colors-gray-DEFAULT)15%,transparent)}}.li.disabled,.li[disabled]{opacity:.4}.tt-menu{font-size:var(--text-sm-fontSize);line-height:var(--un-leading,var(--text-sm-lineHeight));border-width:1px;border-color:color-mix(in srgb,var(--colors-gray-DEFAULT)30%,transparent);--un-border-style:solid;background-color:color-mix(in oklab,var(--menu-bg)var(--un-bg-opacity),transparent);cursor:default;--un-shadow:0 10px 15px -3px var(--un-shadow-color,#0000001a),0 4px 6px -4px 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);border-style:solid;border-radius:.5rem;padding-block:4px}@supports (color:color-mix(in lab, red, red)){.tt-menu{border-color:color-mix(in oklab,var(--colors-gray-DEFAULT)30%,transparent)}}@property --un-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-shadow-color{syntax:"*";inherits:false}@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-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-inset-ring-color{syntax:"*";inherits:false}@property --un-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-ring-inset{syntax:"*";inherits:false}@property --un-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --un-ring-offset-color{syntax:"*";inherits:false}@property --un-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}:where(.tt-menu>: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)))}@property --un-space-y-reverse{syntax:"*";inherits:false;initial-value:0}.tt-menu-x{font-size:var(--text-sm-fontSize);line-height:var(--un-leading,var(--text-sm-lineHeight));border-width:1px;border-color:color-mix(in srgb,var(--colors-gray-DEFAULT)30%,transparent);--un-border-style:solid;background-color:color-mix(in oklab,var(--menu-bg)var(--un-bg-opacity),transparent);cursor:default;--un-shadow:0 10px 15px -3px var(--un-shadow-color,#0000001a),0 4px 6px -4px 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);border-style:solid;border-radius:.5rem;padding-inline:4px}@supports (color:color-mix(in lab, red, red)){.tt-menu-x{border-color:color-mix(in oklab,var(--colors-gray-DEFAULT)30%,transparent)}}:where(.tt-menu-x>:not(:last-child)){--un-space-x-reverse:0;margin-inline-start:calc(calc(4px*.5)*var(--un-space-x-reverse));margin-inline-end:calc(calc(4px*.5)*calc(1 - var(--un-space-x-reverse)))}@property --un-space-x-reverse{syntax:"*";inherits:false;initial-value:0}.tt-menu-x>.hr{background-color:color-mix(in srgb,var(--colors-gray-DEFAULT)30%,transparent);width:1px;margin-block:6px}@supports (color:color-mix(in lab, red, red)){.tt-menu-x>.hr{background-color:color-mix(in oklab,var(--colors-gray-DEFAULT)30%,transparent)}}.col__guide-line,.row__guide-line{background-color:color-mix(in oklab,var(--c-primary)var(--un-bg-opacity),transparent);pointer-events:none;z-index:9;position:fixed;top:0;left:0}th[draggable=true],td[draggable=true]{cursor:move}
|
|
File without changes
|
package/dist/utils.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
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
|
-
export declare function findAsync<T>(arr: T[], cb: (e: T, i: number) => Promise<boolean> | boolean): Promise<T>;
|
|
20
|
-
type Fnable<T> = T | (() => T);
|
|
21
|
-
type Awatable<T> = T | Promise<T>;
|
|
22
|
-
type BaseType = string | number | boolean | null;
|
|
23
|
-
export declare function resolveOptions(opts: Fnable<Awatable<Record<string, any> | ({
|
|
24
|
-
label: any;
|
|
25
|
-
value: any;
|
|
26
|
-
} | BaseType)[]>>): {
|
|
27
|
-
label: any;
|
|
28
|
-
value: any;
|
|
29
|
-
}[];
|
|
30
|
-
export {};
|