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
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
4
|
+
"target": "ES2022",
|
|
5
|
+
"useDefineForClassFields": true,
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
8
|
+
"types": ["vite/client"],
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
|
|
11
|
+
"paths": {
|
|
12
|
+
"@/*": ["./src/*"]
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
/* Bundler mode */
|
|
16
|
+
"moduleResolution": "bundler",
|
|
17
|
+
"allowImportingTsExtensions": true,
|
|
18
|
+
"verbatimModuleSyntax": true,
|
|
19
|
+
"moduleDetection": "force",
|
|
20
|
+
"noEmit": true,
|
|
21
|
+
"jsx": "preserve",
|
|
22
|
+
"jsxImportSource": "solid-js",
|
|
23
|
+
|
|
24
|
+
/* Linting */
|
|
25
|
+
"strict": true,
|
|
26
|
+
"noUnusedLocals": true,
|
|
27
|
+
"noImplicitAny": false,
|
|
28
|
+
"noUnusedParameters": true,
|
|
29
|
+
"erasableSyntaxOnly": true,
|
|
30
|
+
"noFallthroughCasesInSwitch": true,
|
|
31
|
+
"noUncheckedSideEffectImports": true
|
|
32
|
+
},
|
|
33
|
+
"include": ["src", "packages"]
|
|
34
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
4
|
+
"target": "ES2023",
|
|
5
|
+
"lib": ["ES2023"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"types": [],
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
|
|
10
|
+
/* Bundler mode */
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"allowImportingTsExtensions": true,
|
|
13
|
+
"verbatimModuleSyntax": true,
|
|
14
|
+
"moduleDetection": "force",
|
|
15
|
+
"noEmit": true,
|
|
16
|
+
|
|
17
|
+
/* Linting */
|
|
18
|
+
"strict": true,
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": true,
|
|
21
|
+
"erasableSyntaxOnly": true,
|
|
22
|
+
"noFallthroughCasesInSwitch": true,
|
|
23
|
+
"noUncheckedSideEffectImports": true
|
|
24
|
+
},
|
|
25
|
+
"include": ["vite.config.ts", "scripts"]
|
|
26
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { defineConfig, type Plugin } from 'vite'
|
|
2
|
+
import solid from 'vite-plugin-solid'
|
|
3
|
+
import path from 'path'
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
base: './',
|
|
7
|
+
build: {
|
|
8
|
+
outDir: 'docs',
|
|
9
|
+
assetsDir: './',
|
|
10
|
+
},
|
|
11
|
+
resolve: {
|
|
12
|
+
alias: { '@': path.resolve(__dirname, 'src') }
|
|
13
|
+
},
|
|
14
|
+
plugins: [
|
|
15
|
+
(await import('babel-plugin-solid-undestructure')).undestructurePlugin('ts'),
|
|
16
|
+
(await import('babel-plugin-solid-undestructure')).undestructurePlugin('vanilla-js'),
|
|
17
|
+
{ load: (id) => id.includes('undestructure-macros') ? '' : null },
|
|
18
|
+
|
|
19
|
+
solid(),
|
|
20
|
+
|
|
21
|
+
(await import('vite-plugin-pages')).default({
|
|
22
|
+
resolver: 'solid',
|
|
23
|
+
dirs: 'src/pages',
|
|
24
|
+
extendRoute: (route: any) => route,
|
|
25
|
+
generate: { dts: 'src/types/pages.d.ts' },
|
|
26
|
+
}),
|
|
27
|
+
|
|
28
|
+
(await import('unocss/vite')).default({
|
|
29
|
+
presets: [
|
|
30
|
+
// (await import('@ameinhardt/unocss-preset-daisy')).presetDaisy({ base: true, utils: true, logs: true, styled: true }),
|
|
31
|
+
(await import('unocss/preset-wind4')).default({ dark: 'media' }),
|
|
32
|
+
{
|
|
33
|
+
name: "@preset-rem-to-px",
|
|
34
|
+
postprocess: (util) => {
|
|
35
|
+
util.entries.forEach((i) => {
|
|
36
|
+
const value = i[1];
|
|
37
|
+
if (typeof value === "string" && value.includes('var(--spacing)')) i[1] = value.replaceAll('var(--spacing)', '4px')
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
transformers: [
|
|
43
|
+
(await import('@unocss/transformer-directives')).default(),
|
|
44
|
+
(await import('unocss')).transformerVariantGroup(),
|
|
45
|
+
],
|
|
46
|
+
shortcuts: {
|
|
47
|
+
aic: 'items-center',
|
|
48
|
+
},
|
|
49
|
+
// theme: (await import('daisyui/functions/variables.js')).default
|
|
50
|
+
}),
|
|
51
|
+
{
|
|
52
|
+
enforce: 'post',
|
|
53
|
+
transform: (code, id) => /__uno.css(.*?raw)$/.test(id) ? `export default \`${code.replaceAll('\\', '\\\\')}\`` : void 0
|
|
54
|
+
} as Plugin,
|
|
55
|
+
|
|
56
|
+
(await import('unplugin-auto-import/vite')).default({
|
|
57
|
+
dts: './src/types/auto-imports.d.ts',
|
|
58
|
+
resolvers: [(await import('unplugin-icons/resolver')).default({ extension: 'jsx', customCollections: ['my'] })]
|
|
59
|
+
}),
|
|
60
|
+
(await import('unplugin-icons/vite')).default({
|
|
61
|
+
autoInstall: true,
|
|
62
|
+
compiler: 'solid',
|
|
63
|
+
customCollections: {
|
|
64
|
+
my: (await import('unplugin-icons/loaders')).FileSystemIconLoader('src/assets')
|
|
65
|
+
}
|
|
66
|
+
}),
|
|
67
|
+
|
|
68
|
+
(await import('rollup-plugin-visualizer')).visualizer()
|
|
69
|
+
],
|
|
70
|
+
})
|
package/dist/__uno.css
DELETED
|
@@ -1 +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)}}
|
package/dist/chevron-right.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=\"m9 18l6-6l-6-6\">"), chevron_right_default = (n = {}) => (() => {
|
|
3
|
-
var r = _tmpl$();
|
|
4
|
-
return spread(r, n, !0, !0), r;
|
|
5
|
-
})();
|
|
6
|
-
export { chevron_right_default as default };
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { usePointerDrag } from "../hooks/index.js";
|
|
2
|
-
import { addEventListener, createComponent, delegateEvents, effect, insert, memo, mergeProps, render, spread, style, template, use } from "solid-js/web";
|
|
3
|
-
import { createEffect, createMemo, createSignal, mergeProps as mergeProps$1, onCleanup, onMount, splitProps } from "solid-js";
|
|
4
|
-
import { clamp, sum } from "es-toolkit";
|
|
5
|
-
import { createMutationObserver } from "@solid-primitives/mutation-observer";
|
|
6
|
-
import { createElementBounds } from "@solid-primitives/bounds";
|
|
7
|
-
var _tmpl$ = /* @__PURE__ */ template("<div style=position:absolute;z-index:1>"), _tmpl$2 = /* @__PURE__ */ template("<div>"), _tmpl$3 = /* @__PURE__ */ template("<div class=col-hand contenteditable=false>"), _tmpl$4 = /* @__PURE__ */ template("<div class=dot>");
|
|
8
|
-
const Columns = (e) => {
|
|
9
|
-
let [p, h] = splitProps(mergeProps$1({ gap: 0 }, e), ["children"]), g, [v, S] = createSignal([]), C = createMemo(() => v().length), D = () => S([...g.querySelectorAll("& > [tiptap-is=\"column\"]")]);
|
|
10
|
-
onMount(() => D()), createMutationObserver(() => g, { childList: !0 }, () => {
|
|
11
|
-
D(), O.parentElement || g.insertBefore(O, g.firstChild);
|
|
12
|
-
});
|
|
13
|
-
let O = _tmpl$(), k = createElementBounds(() => O, { trackScroll: !1 });
|
|
14
|
-
return createEffect(() => {
|
|
15
|
-
g.insertBefore(O, g.firstChild), onCleanup(() => O.remove());
|
|
16
|
-
}), createEffect(() => {
|
|
17
|
-
v().forEach((e, p) => {
|
|
18
|
-
if (p == v().length - 1) return;
|
|
19
|
-
let g = render(() => createComponent(Hand, {
|
|
20
|
-
index: p,
|
|
21
|
-
get gap() {
|
|
22
|
-
return h.gap;
|
|
23
|
-
},
|
|
24
|
-
reference: e,
|
|
25
|
-
bounds2: k,
|
|
26
|
-
get onAdd() {
|
|
27
|
-
return h.onAdd;
|
|
28
|
-
}
|
|
29
|
-
}), O);
|
|
30
|
-
onCleanup(g);
|
|
31
|
-
});
|
|
32
|
-
let e = g.offsetWidth, p = (C() - 1) * h.gap, _ = (e - p) / C();
|
|
33
|
-
v().forEach((e) => e.style.width ||= `${_}px`);
|
|
34
|
-
let y = v().map((e) => e.offsetWidth), x = sum(y) + p, S = p / C();
|
|
35
|
-
v().forEach((e, p) => e.style.width = `calc(${(y[p] + S) / x * 100}% - ${S}px)`);
|
|
36
|
-
}), (() => {
|
|
37
|
-
var p = _tmpl$2(), m = g;
|
|
38
|
-
return typeof m == "function" ? use(m, p) : g = p, spread(p, mergeProps({ get style() {
|
|
39
|
-
return `display: flex; gap: ${h.gap}px;`;
|
|
40
|
-
} }, h, { get cols() {
|
|
41
|
-
return C();
|
|
42
|
-
} }), !1, !0), insert(p, () => e.children), p;
|
|
43
|
-
})();
|
|
44
|
-
};
|
|
45
|
-
var Hand = (m) => {
|
|
46
|
-
let h = createElementBounds(m.reference, { trackScroll: !1 }), y = createMemo(() => `
|
|
47
|
-
position: absolute;
|
|
48
|
-
width: ${m.gap}px;
|
|
49
|
-
height: ${h.height}px;
|
|
50
|
-
transform: translate(${h.right - m.bounds2.left}px, ${h.top - m.bounds2.top}px);
|
|
51
|
-
`), b;
|
|
52
|
-
return usePointerDrag(() => b, { start(e, p) {
|
|
53
|
-
let h = m.reference, g = h.parentElement, _ = g.offsetWidth, [v, y] = [+g.getAttribute("cols"), +g.getAttribute("gap")], [b, x] = [h, h.nextElementSibling], [S, C] = [b?.offsetWidth || 0, x?.offsetWidth || 0], w = _ * .05, T = S + C - w, E = (v - 1) * y / v;
|
|
54
|
-
p((e, { ox: p }) => {
|
|
55
|
-
b && (b.style.width = `calc(${(clamp(S + p, w, T) + E) / _ * 100}% - ${E}px)`), x && (x.style.width = `calc(${(clamp(C - p, w, T) + E) / _ * 100}% - ${E}px)`);
|
|
56
|
-
});
|
|
57
|
-
} }), (() => {
|
|
58
|
-
var e = _tmpl$3(), h = m.ref;
|
|
59
|
-
typeof h == "function" ? use(h, e) : m.ref = e;
|
|
60
|
-
var x = b;
|
|
61
|
-
return typeof x == "function" ? use(x, e) : b = e, insert(e, (() => {
|
|
62
|
-
var e = memo(() => !!m.onAdd);
|
|
63
|
-
return () => e() && (() => {
|
|
64
|
-
var e = _tmpl$4();
|
|
65
|
-
return addEventListener(e, "pointerdown", { handleEvent: (e) => e.stopPropagation() }), e.$$click = () => m.onAdd(m.index), e;
|
|
66
|
-
})();
|
|
67
|
-
})()), effect((p) => style(e, y(), p)), e;
|
|
68
|
-
})();
|
|
69
|
-
};
|
|
70
|
-
delegateEvents(["click"]);
|
|
71
|
-
export { Columns };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { useMemoAsync } from "../hooks/index.js";
|
|
2
|
-
import { Tree } from "./Tree.js";
|
|
3
|
-
import { createComponent, insert, spread, template } from "solid-js/web";
|
|
4
|
-
import { createEffect, createMemo, createSignal, splitProps } from "solid-js";
|
|
5
|
-
import { delay } from "es-toolkit";
|
|
6
|
-
var _tmpl$ = /* @__PURE__ */ template("<div class=doc-tree>");
|
|
7
|
-
function DocTree(d) {
|
|
8
|
-
let [f, p] = splitProps(d, ["editor"]), [m, h] = createSignal(0);
|
|
9
|
-
createEffect(() => f.editor.on("update", () => h((e) => ++e)));
|
|
10
|
-
let g = useMemoAsync(() => (m(), delay(300).then(() => f.editor.getJSON())), {}), _ = createMemo(() => function e(s, c = [], l = []) {
|
|
11
|
-
if (s.type === "heading") {
|
|
12
|
-
let e = c.length;
|
|
13
|
-
for (; e-- && !(c[e].level < s.attrs.level););
|
|
14
|
-
let u = {
|
|
15
|
-
label: s.content?.map((e) => e.text).join(""),
|
|
16
|
-
level: s.attrs.level
|
|
17
|
-
};
|
|
18
|
-
c.push(u), e > -1 ? (c[e].children ??= []).push(u) : l.push(u);
|
|
19
|
-
} else s.content?.forEach((s) => e(s, c, l));
|
|
20
|
-
return l;
|
|
21
|
-
}(g()));
|
|
22
|
-
return (() => {
|
|
23
|
-
var e = _tmpl$();
|
|
24
|
-
return spread(e, p, !1, !0), insert(e, createComponent(Tree, {
|
|
25
|
-
get data() {
|
|
26
|
-
return _();
|
|
27
|
-
},
|
|
28
|
-
class: "min-h-40 max-h-100 overflow-auto"
|
|
29
|
-
})), e;
|
|
30
|
-
})();
|
|
31
|
-
}
|
|
32
|
-
export { DocTree };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function Menu(props: any): import("solid-js").JSX.Element;
|
package/dist/components/Menu.js
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { unFn } from "../utils.js";
|
|
2
|
-
import { useSignle2 } from "../hooks/index.js";
|
|
3
|
-
import { createRender } from "./Render.js";
|
|
4
|
-
import { VDir } from "../hooks/useDir.js";
|
|
5
|
-
import { Popover } from "./Popover.js";
|
|
6
|
-
import loading_default from "../loading.js";
|
|
7
|
-
import { className, createComponent, effect, insert, memo, mergeProps, spread, template, use } from "solid-js/web";
|
|
8
|
-
import { children, createContext, createEffect, createMemo, createSignal, onMount, splitProps, useContext } from "solid-js";
|
|
9
|
-
import { createMutable } from "solid-js/store";
|
|
10
|
-
import { combineProps } from "@solid-primitives/props";
|
|
11
|
-
import { delay } from "es-toolkit";
|
|
12
|
-
import { pointerHover } from "@solid-primitives/pointer";
|
|
13
|
-
import { isEmpty } from "es-toolkit/compat";
|
|
14
|
-
import { autoUpdate, createFloating, offset } from "floating-ui-solid";
|
|
15
|
-
var _tmpl$ = /* @__PURE__ */ template("<div><div>"), _tmpl$2 = /* @__PURE__ */ template("<div>"), _tmpl$3 = /* @__PURE__ */ template("<div class=\"px-4 py-2 op40\">无内容");
|
|
16
|
-
function Menu(k) {
|
|
17
|
-
let P = createContext({ deep: 0 }), F = createRender({
|
|
18
|
-
is: (D) => {
|
|
19
|
-
let O = useContext(P), [A, j] = splitProps(D, [
|
|
20
|
-
"children",
|
|
21
|
-
"label",
|
|
22
|
-
"icon",
|
|
23
|
-
"isActive",
|
|
24
|
-
"cb",
|
|
25
|
-
"menu",
|
|
26
|
-
"popover"
|
|
27
|
-
]), M = createMemo(() => k.x && O.deep == 1), N, [F, L] = createSignal(), [R, z] = useSignle2(!1, { before: () => delay(100) }), B = createMemo(() => F() ? createFloating({
|
|
28
|
-
strategy: "fixed",
|
|
29
|
-
placement: M() ? "bottom-start" : "right-start",
|
|
30
|
-
...A.menu,
|
|
31
|
-
elements: {
|
|
32
|
-
reference: () => N,
|
|
33
|
-
floating: F
|
|
34
|
-
},
|
|
35
|
-
whileElementsMounted(i, E, D) {
|
|
36
|
-
return autoUpdate(i, E, D, {
|
|
37
|
-
ancestorResize: !0,
|
|
38
|
-
elementResize: !0,
|
|
39
|
-
layoutShift: !0,
|
|
40
|
-
ancestorScroll: !0
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}).floatingStyles : void 0);
|
|
44
|
-
createEffect(() => {
|
|
45
|
-
F() && Object.assign(F().style, B()?.() ?? {});
|
|
46
|
-
});
|
|
47
|
-
let V = createMutable({ loading: !1 });
|
|
48
|
-
async function H() {
|
|
49
|
-
if (V.loading) return;
|
|
50
|
-
let i = A.cb?.();
|
|
51
|
-
if (i instanceof Promise) try {
|
|
52
|
-
await i, V.loading = !0;
|
|
53
|
-
} finally {
|
|
54
|
-
V.loading = !1, k.onAction?.(A);
|
|
55
|
-
}
|
|
56
|
-
else k.onAction?.(A);
|
|
57
|
-
}
|
|
58
|
-
return onMount(() => {
|
|
59
|
-
createComponent(Popover, mergeProps({
|
|
60
|
-
strategy: "fixed",
|
|
61
|
-
reference: N,
|
|
62
|
-
portal: N
|
|
63
|
-
}, () => D.popover, { get middleware() {
|
|
64
|
-
return [offset({ mainAxis: 4 })];
|
|
65
|
-
} }));
|
|
66
|
-
}), children(() => A.children), (() => {
|
|
67
|
-
var E = _tmpl$(), D = E.firstChild;
|
|
68
|
-
use(pointerHover, E, () => z);
|
|
69
|
-
var O = N;
|
|
70
|
-
return typeof O == "function" ? use(O, E) : N = E, spread(E, mergeProps(() => combineProps({ class: `li flex aic rd-2 ${M() ? "my-1 p-1" : "mx-1 pl-1 pr-4 py-1"} ${unFn(A.isActive) && "active"}` }, j), { "on:click": H }), !1, !0), insert(D, (() => {
|
|
71
|
-
var i = memo(() => !!V.loading);
|
|
72
|
-
return () => i() ? createComponent(loading_default, {}) : A.icon;
|
|
73
|
-
})()), insert(E, () => A.label, null), insert(E, (() => {
|
|
74
|
-
var i = memo(() => !!(R() && A.children));
|
|
75
|
-
return () => i() && createComponent(I, {
|
|
76
|
-
ref: L,
|
|
77
|
-
class: "z-1",
|
|
78
|
-
get children() {
|
|
79
|
-
return A.children;
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
})(), null), effect(() => className(D, `flex aic ${M() ? "" : k.density == "comfortable" ? "ml-1 mr-2.5" : "ml-.5 mr-1"} `)), E;
|
|
83
|
-
})();
|
|
84
|
-
},
|
|
85
|
-
processProps: (i) => {
|
|
86
|
-
let E = 0;
|
|
87
|
-
return Array.isArray(i.children) && i.children.forEach((i) => !i.is && typeof i == "object" && (i["data-index"] = E++)), i;
|
|
88
|
-
}
|
|
89
|
-
}), I = (i) => {
|
|
90
|
-
let E = useContext(P), D = createMutable({ deep: E.deep + 1 });
|
|
91
|
-
return createComponent(P.Provider, {
|
|
92
|
-
value: D,
|
|
93
|
-
get children() {
|
|
94
|
-
var E = _tmpl$2();
|
|
95
|
-
return use(VDir, E, () => i.usedir), spread(E, mergeProps(() => combineProps({ class: `${k.x && D.deep == 1 ? "tt-menu-x flex" : "tt-menu max-h-100"} overflow-auto` }, i), { "on:click": (i) => i.stopPropagation() }), !1, !0), insert(E, () => ((i) => isEmpty(i) ? _tmpl$3() : i)(i.children)), E;
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
};
|
|
99
|
-
return createComponent(F, mergeProps(() => combineProps({}, k), {
|
|
100
|
-
is: I,
|
|
101
|
-
items: null,
|
|
102
|
-
get children() {
|
|
103
|
-
return k.items;
|
|
104
|
-
}
|
|
105
|
-
}));
|
|
106
|
-
}
|
|
107
|
-
export { Menu };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type JSX } from 'solid-js';
|
|
2
|
-
import { type createFloatingProps, type ReferenceType } from 'floating-ui-solid';
|
|
3
|
-
import type { AutoUpdateOptions } from '@floating-ui/dom';
|
|
4
|
-
export declare function Popover(attrs: FloatingProps): JSX.Element;
|
|
5
|
-
type FloatingProps = {
|
|
6
|
-
reference: ReferenceType;
|
|
7
|
-
floating?: JSX.Element | (() => JSX.Element);
|
|
8
|
-
portal?: HTMLElement;
|
|
9
|
-
trigger?: 'click' | 'hover';
|
|
10
|
-
} & createFloatingProps;
|
|
11
|
-
export declare function Floating(attrs: FloatingProps & {
|
|
12
|
-
update?: Partial<AutoUpdateOptions>;
|
|
13
|
-
}): JSX.Element;
|
|
14
|
-
export {};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { useClicked, useHover, useMemoAsync } from "../hooks/index.js";
|
|
2
|
-
import { Portal, createComponent, memo, mergeProps } from "solid-js/web";
|
|
3
|
-
import { children, createEffect, createMemo, splitProps } from "solid-js";
|
|
4
|
-
import { delay } from "es-toolkit";
|
|
5
|
-
import { autoUpdate, createFloating } from "floating-ui-solid";
|
|
6
|
-
function Popover(s) {
|
|
7
|
-
let [c, u] = splitProps(s, ["reference", "floating"]), d = (s.trigger == "click" ? useClicked : useHover)(() => [m(), h()].filter((e) => e)), p = useMemoAsync(() => s.trigger == "click" ? d() : d() ? delay(100).then(() => !0) : delay(200).then(() => !1)), m = children(() => s.reference), h = children(() => p() ? s.floating : void 0);
|
|
8
|
-
return createComponent(Floating, mergeProps(u, {
|
|
9
|
-
reference: m,
|
|
10
|
-
floating: h
|
|
11
|
-
}));
|
|
12
|
-
}
|
|
13
|
-
function Floating(e) {
|
|
14
|
-
let [a, o] = splitProps(e, ["reference", "floating"]), l = children(() => e.reference), f = children(() => e.floating), h = createMemo(() => f() ? createFloating({
|
|
15
|
-
whileElementsMounted(a, o, s) {
|
|
16
|
-
return autoUpdate(a, o, s, {
|
|
17
|
-
ancestorResize: !0,
|
|
18
|
-
elementResize: !0,
|
|
19
|
-
layoutShift: !0,
|
|
20
|
-
ancestorScroll: !0,
|
|
21
|
-
...e.update
|
|
22
|
-
});
|
|
23
|
-
},
|
|
24
|
-
...o,
|
|
25
|
-
elements: {
|
|
26
|
-
reference: l,
|
|
27
|
-
floating: f
|
|
28
|
-
}
|
|
29
|
-
}).floatingStyles : void 0);
|
|
30
|
-
return createEffect(() => {
|
|
31
|
-
f() && Object.assign(f().style, h()?.() ?? {});
|
|
32
|
-
}), [memo(l), memo(() => memo(() => !!(o.portal && f()))() ? createComponent(Portal, {
|
|
33
|
-
get mount() {
|
|
34
|
-
return o.portal;
|
|
35
|
-
},
|
|
36
|
-
get children() {
|
|
37
|
-
return f();
|
|
38
|
-
}
|
|
39
|
-
}) : f())];
|
|
40
|
-
}
|
|
41
|
-
export { Floating, Popover };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Dynamic, createComponent, memo, mergeProps } from "solid-js/web";
|
|
2
|
-
import { splitProps } from "solid-js";
|
|
3
|
-
var unFn = (e, ...a) => typeof e == "function" ? e(...a) : e;
|
|
4
|
-
function createRender({ is: o, processProps: s = (e) => e } = {}) {
|
|
5
|
-
let c = (c) => {
|
|
6
|
-
let [u, d] = splitProps(s?.(c), [
|
|
7
|
-
"is",
|
|
8
|
-
"vIf",
|
|
9
|
-
"children"
|
|
10
|
-
]);
|
|
11
|
-
return memo(() => memo(() => !!(!("vIf" in u) || unFn(u.vIf)))() && createComponent(Dynamic, mergeProps({ get component() {
|
|
12
|
-
return u.is ?? o;
|
|
13
|
-
} }, d, { get children() {
|
|
14
|
-
return l(u.children);
|
|
15
|
-
} })));
|
|
16
|
-
}, l = (e) => Array.isArray(e) ? e.map((e) => typeof e == "object" ? c(e) : e) : e;
|
|
17
|
-
return c;
|
|
18
|
-
}
|
|
19
|
-
const Render = createRender({ is: "div" });
|
|
20
|
-
export { Render, createRender };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type JSXElement } from 'solid-js';
|
|
2
|
-
type SplitProps = {
|
|
3
|
-
container?: Element;
|
|
4
|
-
cells: () => Element[];
|
|
5
|
-
handle?: (i: number) => JSXElement;
|
|
6
|
-
size?: number;
|
|
7
|
-
dir?: 'x' | 'y';
|
|
8
|
-
leading?: boolean;
|
|
9
|
-
trailing?: boolean;
|
|
10
|
-
};
|
|
11
|
-
export declare const Split: (props: SplitProps & {
|
|
12
|
-
children?: JSXElement;
|
|
13
|
-
}) => import("solid-js").JSX.Element;
|
|
14
|
-
export declare const useSplit: (props: SplitProps) => void;
|
|
15
|
-
export {};
|
package/dist/components/Split.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { unFn } from "../utils.js";
|
|
2
|
-
import { Portal, createComponent, effect, insert, memo, spread, style, template, use } from "solid-js/web";
|
|
3
|
-
import { For, children, createEffect, mapArray, mergeProps as mergeProps$1, onMount } from "solid-js";
|
|
4
|
-
import { createElementBounds } from "@solid-primitives/bounds";
|
|
5
|
-
var _tmpl$ = /* @__PURE__ */ template("<div class=relative>"), _tmpl$2 = /* @__PURE__ */ template("<div class=\"absolute z-1\">");
|
|
6
|
-
const Split = (e) => {
|
|
7
|
-
let d, f = children(() => e.children);
|
|
8
|
-
return onMount(() => {
|
|
9
|
-
useSplit({
|
|
10
|
-
...e,
|
|
11
|
-
container: d,
|
|
12
|
-
cells: () => e.cells ? e.cells() : f()
|
|
13
|
-
});
|
|
14
|
-
}), (() => {
|
|
15
|
-
var p = _tmpl$(), m = d;
|
|
16
|
-
return typeof m == "function" ? use(m, p) : d = p, spread(p, e, !1, !0), insert(p, f), p;
|
|
17
|
-
})();
|
|
18
|
-
}, useSplit = (h) => {
|
|
19
|
-
h = mergeProps$1({
|
|
20
|
-
dir: "x",
|
|
21
|
-
size: 4
|
|
22
|
-
}, h);
|
|
23
|
-
let g, _ = mapArray(() => h.cells(), (e) => createElementBounds(e)), v = createElementBounds(() => g);
|
|
24
|
-
createEffect(() => g.style.position = "absolute");
|
|
25
|
-
let y = (e, d) => h.dir == "x" ? `transform: translate(${(d ? e.left + e.width : e.left) - h.size / 2}px, ${e.top}px); width: ${h.size}px; height: ${e.height}px;` : `transform: translate(${e.left}px, ${(d ? e.top + e.height : e.top) - h.size / 2}px); width: ${e.width}px; height: ${h.size}px;`, b = (e) => (() => {
|
|
26
|
-
var d = _tmpl$2();
|
|
27
|
-
return insert(d, () => h.handle?.(e.i)), effect((f) => style(d, y({
|
|
28
|
-
...e.e,
|
|
29
|
-
left: e.e.left - v.left,
|
|
30
|
-
top: e.e.top - v.top
|
|
31
|
-
}, e.bool), f)), d;
|
|
32
|
-
})();
|
|
33
|
-
createComponent(Portal, {
|
|
34
|
-
ref(e) {
|
|
35
|
-
var d = g;
|
|
36
|
-
typeof d == "function" ? d(e) : g = e;
|
|
37
|
-
},
|
|
38
|
-
get mount() {
|
|
39
|
-
return h.container || document.body;
|
|
40
|
-
},
|
|
41
|
-
get children() {
|
|
42
|
-
return [
|
|
43
|
-
createComponent(For, {
|
|
44
|
-
get each() {
|
|
45
|
-
return _().slice(0, -1);
|
|
46
|
-
},
|
|
47
|
-
children: (d, p) => createComponent(b, {
|
|
48
|
-
get e() {
|
|
49
|
-
return unFn(d);
|
|
50
|
-
},
|
|
51
|
-
bool: 1,
|
|
52
|
-
get i() {
|
|
53
|
-
return unFn(p);
|
|
54
|
-
}
|
|
55
|
-
})
|
|
56
|
-
}),
|
|
57
|
-
memo(() => memo(() => !!(_().length && h.leading))() && createComponent(b, {
|
|
58
|
-
get e() {
|
|
59
|
-
return _()[0];
|
|
60
|
-
},
|
|
61
|
-
i: -1
|
|
62
|
-
})),
|
|
63
|
-
memo(() => memo(() => !!(_().length && h.trailing))() && createComponent(b, {
|
|
64
|
-
get e() {
|
|
65
|
-
return _()[_().length - 1];
|
|
66
|
-
},
|
|
67
|
-
bool: 1,
|
|
68
|
-
get i() {
|
|
69
|
-
return _().length - 1;
|
|
70
|
-
}
|
|
71
|
-
}))
|
|
72
|
-
];
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
};
|
|
76
|
-
export { Split, useSplit };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export declare abstract class $Node {
|
|
2
|
-
data: any;
|
|
3
|
-
constructor(data: any);
|
|
4
|
-
get label(): any;
|
|
5
|
-
abstract getChildren(): $Node[] | undefined;
|
|
6
|
-
children: $Node[] | undefined;
|
|
7
|
-
$children: import("solid-js").Accessor<$Node[]>;
|
|
8
|
-
parent: $Node | undefined;
|
|
9
|
-
$parent: import("solid-js").Signal<unknown>;
|
|
10
|
-
deep: number;
|
|
11
|
-
$deep: import("solid-js").Accessor<number>;
|
|
12
|
-
index: number;
|
|
13
|
-
$index: import("solid-js").Accessor<number>;
|
|
14
|
-
prev: $Node | undefined;
|
|
15
|
-
$prev: import("solid-js").Accessor<$Node>;
|
|
16
|
-
next: $Node | undefined;
|
|
17
|
-
$next: import("solid-js").Accessor<$Node>;
|
|
18
|
-
root: $Node;
|
|
19
|
-
$root: any;
|
|
20
|
-
path: $Node[];
|
|
21
|
-
$path: import("solid-js").Accessor<$Node[]>;
|
|
22
|
-
get descendants(): $Node[];
|
|
23
|
-
contains(node: $Node): boolean;
|
|
24
|
-
remove(): void;
|
|
25
|
-
}
|
|
26
|
-
export declare class $TreeItem extends $Node {
|
|
27
|
-
get is(): any;
|
|
28
|
-
get props(): any;
|
|
29
|
-
get id(): any;
|
|
30
|
-
getChildren(): any;
|
|
31
|
-
}
|
|
32
|
-
export declare function Tree(_: {
|
|
33
|
-
data: any;
|
|
34
|
-
Node: {
|
|
35
|
-
new (data: any): $TreeItem;
|
|
36
|
-
};
|
|
37
|
-
}): import("solid-js").JSX.Element;
|