intable 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 huodoushigemi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/__uno.css CHANGED
@@ -1 +1 @@
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%;}:root, :host {--spacing: 0.25rem;--colors-gray-DEFAULT: oklch(70.7% 0.022 261.325);--text-sm-fontSize: 0.875rem;--text-sm-lineHeight: 1.25rem;--radius-sm: 0.25rem;--colors-blue-DEFAULT: oklch(70.7% 0.165 254.624);--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);}/* 1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) 2. Remove default margins and padding 3. Reset all borders.*/*,::after,::before,::backdrop,::file-selector-button { box-sizing: border-box; /* 1 */ margin: 0; /* 2 */ padding: 0; /* 2 */ border: 0 solid; /* 3 */}/* 1. Use a consistent sensible line-height in all browsers. 2. Prevent adjustments of font size after orientation changes in iOS. 3. Use a more readable tab size. 4. Use the user's configured `sans` font-family by default. 5. Use the user's configured `sans` font-feature-settings by default. 6. Use the user's configured `sans` font-variation-settings by default. 7. Disable tap highlights on iOS.*/html,:host { line-height: 1.5; /* 1 */ -webkit-text-size-adjust: 100%; /* 2 */ tab-size: 4; /* 3 */ 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' ); /* 4 */ font-feature-settings: var(--default-font-featureSettings, normal); /* 5 */ font-variation-settings: var(--default-font-variationSettings, normal); /* 6 */ -webkit-tap-highlight-color: transparent; /* 7 */}/* 1. Add the correct height in Firefox. 2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) 3. Reset the default border style to a 1px solid border.*/hr { height: 0; /* 1 */ color: inherit; /* 2 */ border-top-width: 1px; /* 3 */}/* Add the correct text decoration in Chrome, Edge, and Safari.*/abbr:where([title]) { -webkit-text-decoration: underline dotted; text-decoration: underline dotted;}/* Remove the default font size and weight for headings.*/h1,h2,h3,h4,h5,h6 { font-size: inherit; font-weight: inherit;}/* Reset links to optimize for opt-in styling instead of opt-out.*/a { color: inherit; -webkit-text-decoration: inherit; text-decoration: inherit;}/* Add the correct font weight in Edge and Safari.*/b,strong { font-weight: bolder;}/* 1. Use the user's configured `mono` font-family by default. 2. Use the user's configured `mono` font-feature-settings by default. 3. Use the user's configured `mono` font-variation-settings by default. 4. Correct the odd `em` font sizing in all browsers.*/code,kbd,samp,pre { font-family: var( --default-monoFont-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace ); /* 1 */ font-feature-settings: var(--default-monoFont-featureSettings, normal); /* 2 */ font-variation-settings: var(--default-monoFont-variationSettings, normal); /* 3 */ font-size: 1em; /* 4 */}/* Add the correct font size in all browsers.*/small { font-size: 80%;}/* Prevent `sub` and `sup` elements from affecting the line height in all browsers.*/sub,sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline;}sub { bottom: -0.25em;}sup { top: -0.5em;}/* 1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) 2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) 3. Remove gaps between table borders by default.*/table { text-indent: 0; /* 1 */ border-color: inherit; /* 2 */ border-collapse: collapse; /* 3 */}/* Use the modern Firefox focus style for all focusable elements.*/:-moz-focusring { outline: auto;}/* Add the correct vertical alignment in Chrome and Firefox.*/progress { vertical-align: baseline;}/* Add the correct display in Chrome and Safari.*/summary { display: list-item;}/* Make lists unstyled by default.*/ol,ul,menu { list-style: none;}/* 1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14) 2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210) This can trigger a poorly considered lint error in some tools but is included by design.*/img,svg,video,canvas,audio,iframe,embed,object { display: block; /* 1 */ vertical-align: middle; /* 2 */}/* Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)*/img,video { max-width: 100%; height: auto;}/* 1. Inherit font styles in all browsers. 2. Remove border radius in all browsers. 3. Remove background color in all browsers. 4. Ensure consistent opacity for disabled states in all browsers.*/button,input,select,optgroup,textarea,::file-selector-button { font: inherit; /* 1 */ font-feature-settings: inherit; /* 1 */ font-variation-settings: inherit; /* 1 */ letter-spacing: inherit; /* 1 */ color: inherit; /* 1 */ border-radius: 0; /* 2 */ background-color: transparent; /* 3 */ opacity: 1; /* 4 */}/* Restore default font weight.*/:where(select:is([multiple], [size])) optgroup { font-weight: bolder;}/* Restore indentation.*/:where(select:is([multiple], [size])) optgroup option { padding-inline-start: 20px;}/* Restore space after button.*/::file-selector-button { margin-inline-end: 4px;}/* Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)*/::placeholder { opacity: 1;}/* Set the default placeholder color to a semi-transparent version of the current text color in browsers that do not crash when using `color-mix(…)` with `currentcolor`. (https://github.com/tailwindlabs/tailwindcss/issues/17194)*/@supports (not (-webkit-appearance: -apple-pay-button)) /* Not Safari */ or (contain-intrinsic-size: 1px) /* Safari 17+ */ { ::placeholder { color: color-mix(in oklab, currentcolor 50%, transparent); }}/* Prevent resizing textareas horizontally by default.*/textarea { resize: vertical;}/* Remove the inner padding in Chrome and Safari on macOS.*/::-webkit-search-decoration { -webkit-appearance: none;}/* 1. Ensure date/time inputs have the same height when empty in iOS Safari. 2. Ensure text alignment can be changed on date/time inputs in iOS Safari.*/::-webkit-date-and-time-value { min-height: 1lh; /* 1 */ text-align: inherit; /* 2 */}/* Prevent height from changing on date/time inputs in macOS Safari when the input is set to `display: block`.*/::-webkit-datetime-edit { display: inline-flex;}/* Remove excess padding from pseudo-elements in date/time inputs to ensure consistent height across browsers.*/::-webkit-datetime-edit-fields-wrapper { padding: 0;}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field { padding-block: 0;}/* Center dropdown marker shown on inputs with paired `<datalist>`s in Chrome. (https://github.com/tailwindlabs/tailwindcss/issues/18499)*/::-webkit-calendar-picker-indicator { line-height: 1;}/* Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)*/:-moz-ui-invalid { box-shadow: none;}/* Correct the inability to style the border radius in iOS Safari.*/button,input:where([type='button'], [type='reset'], [type='submit']),::file-selector-button { appearance: button;}/* Correct the cursor style of increment and decrement buttons in Safari.*/::-webkit-inner-spin-button,::-webkit-outer-spin-button { height: auto;}/* Make elements with the HTML hidden attribute stay hidden by default.*/[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:0.875rem;}.lh-\[1\]{--un-leading:1;line-height:1;}.m9{margin:calc(var(--spacing) * 9);}.mx-1{margin-inline:calc(var(--spacing) * 1);}.mx-3\!{margin-inline:calc(var(--spacing) * 3) !important;}.my-1{margin-block:calc(var(--spacing) * 1);}.ml{margin-left:calc(var(--spacing) * 4);}.ml-\.5{margin-left:calc(var(--spacing) * 0.5);}.ml-1{margin-left:calc(var(--spacing) * 1);}.mr--1{margin-right:calc(var(--spacing) * -1);}.mr-1{margin-right:calc(var(--spacing) * 1);}.mr-2{margin-right:calc(var(--spacing) * 2);}.mr-2\.5{margin-right:calc(var(--spacing) * 2.5);}.p-1{padding:calc(var(--spacing) * 1);}.px,.px-4{padding-inline:calc(var(--spacing) * 4);}.px-2{padding-inline:calc(var(--spacing) * 2);}.py-1{padding-block:calc(var(--spacing) * 1);}.py-2{padding-block:calc(var(--spacing) * 2);}.pl-1{padding-left:calc(var(--spacing) * 1);}.pr-4{padding-right:calc(var(--spacing) * 4);}.ps{padding-inline-start:calc(var(--spacing) * 4);}.outline-0{outline-style:var(--un-outline-style);outline-width:0px;}.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) /* oklch(70.7% 0.165 254.624) */;}.b{border-width:1px;}.rd-2{border-radius:0.5rem;}.rd-sm{border-radius:var(--radius-sm);}.bg-\#dafaea{background-color:color-mix(in oklab, #dafaea var(--un-bg-opacity), transparent) /* #dafaea */;}.bg-\#ffe8e8{background-color:color-mix(in oklab, #ffe8e8 var(--un-bg-opacity), transparent) /* #ffe8e8 */;}.bg-\#fff{background-color:color-mix(in oklab, #fff var(--un-bg-opacity), transparent) /* #fff */;}.bg-gray\/20{background-color:color-mix(in srgb, var(--colors-gray-DEFAULT) 20%, transparent) /* oklch(70.7% 0.022 261.325) */;}.op-75{opacity:75%;}.op40{opacity:40%;}.flex{display:flex;}.flex-shrink-0{flex-shrink:0;}.flex-row{flex-direction:row;}.flex-wrap{flex-wrap:wrap;}.gap-2{gap:calc(var(--spacing) * 2);}.size-4\!{width:calc(var(--spacing) * 4) !important;height:calc(var(--spacing) * 4) !important;}.size-full{width:100%;height:100%;}.h-a\!{height:auto !important;}.h-full{height:100%;}.max-h-100{max-height:calc(var(--spacing) * 100);}.min-h-40{min-height:calc(var(--spacing) * 40);}.min-h-a\!{min-height:auto !important;}.after\:h-1::after{height:calc(var(--spacing) * 1);}.after\:w-1::after{width:calc(var(--spacing) * 1);}.block{display:block;}.cursor-s-resize{cursor:s-resize;}.cursor-w-resize{cursor:w-resize;}.resize-none{resize:none;}.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;}.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;}@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) /* oklch(70.7% 0.165 254.624) */;}.bg-gray\/20{background-color:color-mix(in oklab, var(--colors-gray-DEFAULT) 20%, transparent) /* oklch(70.7% 0.022 261.325) */;}}
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: 0.25rem;--colors-gray-DEFAULT: oklch(70.7% 0.022 261.325);--text-sm-fontSize: 0.875rem;--text-sm-lineHeight: 1.25rem;--radius-sm: 0.25rem;--colors-blue-DEFAULT: oklch(70.7% 0.165 254.624);--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);}/* 1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) 2. Remove default margins and padding 3. Reset all borders.*/*,::after,::before,::backdrop,::file-selector-button { box-sizing: border-box; /* 1 */ margin: 0; /* 2 */ padding: 0; /* 2 */ border: 0 solid; /* 3 */}/* 1. Use a consistent sensible line-height in all browsers. 2. Prevent adjustments of font size after orientation changes in iOS. 3. Use a more readable tab size. 4. Use the user's configured `sans` font-family by default. 5. Use the user's configured `sans` font-feature-settings by default. 6. Use the user's configured `sans` font-variation-settings by default. 7. Disable tap highlights on iOS.*/html,:host { line-height: 1.5; /* 1 */ -webkit-text-size-adjust: 100%; /* 2 */ tab-size: 4; /* 3 */ 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' ); /* 4 */ font-feature-settings: var(--default-font-featureSettings, normal); /* 5 */ font-variation-settings: var(--default-font-variationSettings, normal); /* 6 */ -webkit-tap-highlight-color: transparent; /* 7 */}/* 1. Add the correct height in Firefox. 2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) 3. Reset the default border style to a 1px solid border.*/hr { height: 0; /* 1 */ color: inherit; /* 2 */ border-top-width: 1px; /* 3 */}/* Add the correct text decoration in Chrome, Edge, and Safari.*/abbr:where([title]) { -webkit-text-decoration: underline dotted; text-decoration: underline dotted;}/* Remove the default font size and weight for headings.*/h1,h2,h3,h4,h5,h6 { font-size: inherit; font-weight: inherit;}/* Reset links to optimize for opt-in styling instead of opt-out.*/a { color: inherit; -webkit-text-decoration: inherit; text-decoration: inherit;}/* Add the correct font weight in Edge and Safari.*/b,strong { font-weight: bolder;}/* 1. Use the user's configured `mono` font-family by default. 2. Use the user's configured `mono` font-feature-settings by default. 3. Use the user's configured `mono` font-variation-settings by default. 4. Correct the odd `em` font sizing in all browsers.*/code,kbd,samp,pre { font-family: var( --default-monoFont-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace ); /* 1 */ font-feature-settings: var(--default-monoFont-featureSettings, normal); /* 2 */ font-variation-settings: var(--default-monoFont-variationSettings, normal); /* 3 */ font-size: 1em; /* 4 */}/* Add the correct font size in all browsers.*/small { font-size: 80%;}/* Prevent `sub` and `sup` elements from affecting the line height in all browsers.*/sub,sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline;}sub { bottom: -0.25em;}sup { top: -0.5em;}/* 1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) 2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) 3. Remove gaps between table borders by default.*/table { text-indent: 0; /* 1 */ border-color: inherit; /* 2 */ border-collapse: collapse; /* 3 */}/* Use the modern Firefox focus style for all focusable elements.*/:-moz-focusring { outline: auto;}/* Add the correct vertical alignment in Chrome and Firefox.*/progress { vertical-align: baseline;}/* Add the correct display in Chrome and Safari.*/summary { display: list-item;}/* Make lists unstyled by default.*/ol,ul,menu { list-style: none;}/* 1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14) 2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210) This can trigger a poorly considered lint error in some tools but is included by design.*/img,svg,video,canvas,audio,iframe,embed,object { display: block; /* 1 */ vertical-align: middle; /* 2 */}/* Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)*/img,video { max-width: 100%; height: auto;}/* 1. Inherit font styles in all browsers. 2. Remove border radius in all browsers. 3. Remove background color in all browsers. 4. Ensure consistent opacity for disabled states in all browsers.*/button,input,select,optgroup,textarea,::file-selector-button { font: inherit; /* 1 */ font-feature-settings: inherit; /* 1 */ font-variation-settings: inherit; /* 1 */ letter-spacing: inherit; /* 1 */ color: inherit; /* 1 */ border-radius: 0; /* 2 */ background-color: transparent; /* 3 */ opacity: 1; /* 4 */}/* Restore default font weight.*/:where(select:is([multiple], [size])) optgroup { font-weight: bolder;}/* Restore indentation.*/:where(select:is([multiple], [size])) optgroup option { padding-inline-start: 20px;}/* Restore space after button.*/::file-selector-button { margin-inline-end: 4px;}/* Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)*/::placeholder { opacity: 1;}/* Set the default placeholder color to a semi-transparent version of the current text color in browsers that do not crash when using `color-mix(…)` with `currentcolor`. (https://github.com/tailwindlabs/tailwindcss/issues/17194)*/@supports (not (-webkit-appearance: -apple-pay-button)) /* Not Safari */ or (contain-intrinsic-size: 1px) /* Safari 17+ */ { ::placeholder { color: color-mix(in oklab, currentcolor 50%, transparent); }}/* Prevent resizing textareas horizontally by default.*/textarea { resize: vertical;}/* Remove the inner padding in Chrome and Safari on macOS.*/::-webkit-search-decoration { -webkit-appearance: none;}/* 1. Ensure date/time inputs have the same height when empty in iOS Safari. 2. Ensure text alignment can be changed on date/time inputs in iOS Safari.*/::-webkit-date-and-time-value { min-height: 1lh; /* 1 */ text-align: inherit; /* 2 */}/* Prevent height from changing on date/time inputs in macOS Safari when the input is set to `display: block`.*/::-webkit-datetime-edit { display: inline-flex;}/* Remove excess padding from pseudo-elements in date/time inputs to ensure consistent height across browsers.*/::-webkit-datetime-edit-fields-wrapper { padding: 0;}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field { padding-block: 0;}/* Center dropdown marker shown on inputs with paired `<datalist>`s in Chrome. (https://github.com/tailwindlabs/tailwindcss/issues/18499)*/::-webkit-calendar-picker-indicator { line-height: 1;}/* Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)*/:-moz-ui-invalid { box-shadow: none;}/* Correct the inability to style the border radius in iOS Safari.*/button,input:where([type='button'], [type='reset'], [type='submit']),::file-selector-button { appearance: button;}/* Correct the cursor style of increment and decrement buttons in Safari.*/::-webkit-inner-spin-button,::-webkit-outer-spin-button { height: auto;}/* Make elements with the HTML hidden attribute stay hidden by default.*/[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:0.875rem;}.lh-\[1\]{--un-leading:1;line-height:1;}.m9{margin:calc(var(--spacing) * 9);}.mx-1{margin-inline:calc(var(--spacing) * 1);}.mx-3\!{margin-inline:calc(var(--spacing) * 3) !important;}.my-1{margin-block:calc(var(--spacing) * 1);}.ml{margin-left:calc(var(--spacing) * 4);}.ml-\.5{margin-left:calc(var(--spacing) * 0.5);}.ml-1{margin-left:calc(var(--spacing) * 1);}.mr--1{margin-right:calc(var(--spacing) * -1);}.mr-1{margin-right:calc(var(--spacing) * 1);}.mr-2{margin-right:calc(var(--spacing) * 2);}.mr-2\.5{margin-right:calc(var(--spacing) * 2.5);}.p-1{padding:calc(var(--spacing) * 1);}.px,.px-4{padding-inline:calc(var(--spacing) * 4);}.px-2{padding-inline:calc(var(--spacing) * 2);}.py-1{padding-block:calc(var(--spacing) * 1);}.py-2{padding-block:calc(var(--spacing) * 2);}.pl-1{padding-left:calc(var(--spacing) * 1);}.pr-4{padding-right:calc(var(--spacing) * 4);}.ps{padding-inline-start:calc(var(--spacing) * 4);}.outline-0{outline-style:var(--un-outline-style);outline-width:0px;}.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) /* oklch(70.7% 0.165 254.624) */;}.b{border-width:1px;}.rd-2{border-radius:0.5rem;}.rd-sm{border-radius:var(--radius-sm);}.bg-\#dafaea{background-color:color-mix(in oklab, #dafaea var(--un-bg-opacity), transparent) /* #dafaea */;}.bg-\#ffe8e8{background-color:color-mix(in oklab, #ffe8e8 var(--un-bg-opacity), transparent) /* #ffe8e8 */;}.bg-\#fff{background-color:color-mix(in oklab, #fff var(--un-bg-opacity), transparent) /* #fff */;}.bg-gray\/20{background-color:color-mix(in srgb, var(--colors-gray-DEFAULT) 20%, transparent) /* oklch(70.7% 0.022 261.325) */;}.op-75{opacity:75%;}.op40{opacity:40%;}.flex{display:flex;}.flex-shrink-0{flex-shrink:0;}.flex-col{flex-direction:column;}.flex-wrap{flex-wrap:wrap;}.gap-2{gap:calc(var(--spacing) * 2);}.size-4\!{width:calc(var(--spacing) * 4) !important;height:calc(var(--spacing) * 4) !important;}.size-full{width:100%;height:100%;}.h-1\!{height:calc(var(--spacing) * 1) !important;}.h-a\!{height:auto !important;}.h-full{height:100%;}.max-h-100{max-height:calc(var(--spacing) * 100);}.min-h-40{min-height:calc(var(--spacing) * 40);}.min-h-a\!{min-height:auto !important;}.w-10px\!{width:10px !important;}.after\:h-1::after{height:calc(var(--spacing) * 1);}.after\:w-1::after{width:calc(var(--spacing) * 1);}.inline{display:inline;}.block{display:block;}.cursor-s-resize{cursor:s-resize;}.cursor-w-resize{cursor:w-resize;}.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:calc(var(--spacing) * 0);}.left-0{left:calc(var(--spacing) * 0);}.right-0{right:calc(var(--spacing) * 0);}.top-0{top:calc(var(--spacing) * 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) /* oklch(70.7% 0.165 254.624) */;}.bg-gray\/20{background-color:color-mix(in oklab, var(--colors-gray-DEFAULT) 20%, transparent) /* oklch(70.7% 0.022 261.325) */;}}
@@ -1,6 +1,7 @@
1
1
  import { type Signal } from 'solid-js';
2
2
  import { type Many, type MaybeAccessor } from '@solid-primitives/utils';
3
- interface UseDragOptions {
3
+ interface UseMoveOptions {
4
+ preventDefault?: boolean;
4
5
  start?(e: PointerEvent, move: (cb: MoveCB) => void, end: (cb: EndCb) => void): void;
5
6
  }
6
7
  type MoveCB = (e: PointerEvent, o: {
@@ -10,7 +11,7 @@ type MoveCB = (e: PointerEvent, o: {
10
11
  oy: number;
11
12
  }) => void;
12
13
  type EndCb = (e: PointerEvent) => void;
13
- export declare function usePointerDrag(el: MaybeAccessor<HTMLElement | undefined>, options: UseDragOptions): void;
14
+ export declare function usePointerDrag(el: MaybeAccessor<HTMLElement | undefined>, options: UseMoveOptions): void;
14
15
  export declare function model(el: any, value: () => [() => string, (v: string) => any]): void;
15
16
  export declare function toSignle<T extends Record<string, any>>(state: T, k: keyof T): ((v: any) => any)[];
16
17
  export declare function useDark(): [get: import("solid-js").Accessor<boolean>, set: import("solid-js").Setter<boolean>, init: string | Promise<string>];
@@ -1,8 +1,8 @@
1
1
  import { unFn } from "../utils.js";
2
- import { $PROXY, createComputed, createEffect, createMemo, createRenderEffect, createRoot, createSignal, on, onCleanup, untrack } from "solid-js";
2
+ import { $PROXY, createComputed, createEffect, createMemo, createRenderEffect, createRoot, createSignal, mergeProps, on, onCleanup, untrack } from "solid-js";
3
3
  import { $RAW, createMutable } from "solid-js/store";
4
4
  import { isFunction, isPromise, mapValues } from "es-toolkit";
5
- import { createEventListener } from "@solid-primitives/event-listener";
5
+ import { createEventListener, createEventListenerMap } from "@solid-primitives/event-listener";
6
6
  import { createPointerListeners } from "@solid-primitives/pointer";
7
7
  import { access } from "@solid-primitives/utils";
8
8
  import { makePersisted, storageSync } from "@solid-primitives/storage";
@@ -10,11 +10,12 @@ import { createMutationObserver } from "@solid-primitives/mutation-observer";
10
10
  import { castArray } from "es-toolkit/compat";
11
11
  import { createKeybindingsHandler } from "tinykeys";
12
12
  function usePointerDrag(el, options) {
13
+ options = mergeProps({ preventDefault: true }, options);
13
14
  createPointerListeners({
14
15
  target: el,
15
16
  passive: false,
16
17
  onDown(e) {
17
- e.preventDefault();
18
+ options.preventDefault && e.preventDefault();
18
19
  const [sx, sy] = [e.x, e.y];
19
20
  let move;
20
21
  let end;
@@ -38,6 +39,7 @@ function usePointerDrag(el, options) {
38
39
  end = void 0;
39
40
  }
40
41
  });
42
+ createEventListenerMap(document, { drop: dispose });
41
43
  });
42
44
  }
43
45
  });
@@ -0,0 +1,18 @@
1
+ import { type MaybeAccessor } from '@solid-primitives/utils';
2
+ type Awaitable<T> = T | Promise<T>;
3
+ interface UseSortOption {
4
+ enable?: boolean;
5
+ guideLine: any;
6
+ draggable: (el: HTMLElement) => Awaitable<boolean>;
7
+ dragover: (el: HTMLElement) => boolean;
8
+ children: (el: HTMLElement) => HTMLElement[];
9
+ dragend: () => void;
10
+ }
11
+ export declare const useSort: (el: MaybeAccessor<HTMLElement | undefined>, opt: UseSortOption) => {
12
+ style: any;
13
+ drag: any;
14
+ over: any;
15
+ rel: any;
16
+ type: string;
17
+ };
18
+ export {};
@@ -0,0 +1,106 @@
1
+ import { findAsync } from "../utils.js";
2
+ import { Portal, createComponent, memo, mergeProps, spread, template } from "solid-js/web";
3
+ import { createMutable, reconcile } from "solid-js/store";
4
+ import { createEventListenerMap } from "@solid-primitives/event-listener";
5
+ import { access } from "@solid-primitives/utils";
6
+ var _tmpl$ = /* @__PURE__ */ template(`<div>`);
7
+ const useSort = (el, opt) => {
8
+ opt = mergeProps({ enable: true }, opt);
9
+ let count = 0;
10
+ createEventListenerMap(() => opt.enable ? access(el) : void 0, {
11
+ async pointerdown(e) {
12
+ const _c = count;
13
+ const drag = await findAsync(e.composedPath(), (e$1) => e$1 instanceof HTMLElement && opt.draggable(e$1));
14
+ if (_c != count) return;
15
+ if (!drag) return;
16
+ e.stopPropagation();
17
+ state.drag = drag;
18
+ state.drag?.setAttribute("draggable", "true");
19
+ },
20
+ pointerup() {
21
+ count++;
22
+ dragend();
23
+ },
24
+ pointermove() {
25
+ count++;
26
+ },
27
+ dragstart(e) {
28
+ e.dataTransfer.setDragImage(document.createElement("img"), 0, 0);
29
+ },
30
+ dragover(e) {
31
+ if (!state.drag) return;
32
+ const over = state.over = e.composedPath().filter((e$1) => e$1 instanceof HTMLElement).find((e$1) => opt.dragover(e$1)) ?? state.over;
33
+ if (!over) return;
34
+ e.preventDefault();
35
+ e.stopPropagation();
36
+ const children = opt.children(over);
37
+ if (children) {
38
+ let i = 0, d = Infinity, s = "";
39
+ children.forEach((el$1, ii) => {
40
+ const display = getComputedStyle(el$1).display;
41
+ const __ = ["table-cell", "inline"].some((e$1) => display.includes(e$1));
42
+ const rect = el$1.getBoundingClientRect();
43
+ if (__) {
44
+ let dd = Math.sqrt((e.clientX - rect.x) ** 2 + (e.clientY - rect.y + rect.height / 2) ** 2);
45
+ if (dd < d) i = ii, d = dd, s = "l";
46
+ dd = Math.sqrt((e.clientX - rect.right) ** 2 + (e.clientY - rect.y + rect.height / 2) ** 2);
47
+ if (dd < d) i = ii, d = dd, s = "r";
48
+ } else {
49
+ let dd = Math.sqrt((e.clientY - rect.y) ** 2 + (e.clientX - rect.x + rect.width / 2) ** 2);
50
+ if (dd < d) i = ii, d = dd, s = "t";
51
+ dd = Math.sqrt((e.clientY - rect.bottom) ** 2 + (e.clientX - rect.x + rect.width / 2) ** 2);
52
+ if (dd < d) i = ii, d = dd, s = "b";
53
+ }
54
+ });
55
+ const rect1 = children[i].getBoundingClientRect();
56
+ const x = s == "l" || s == "r", y = s == "t" || s == "b";
57
+ const size = 3;
58
+ state.style = {
59
+ width: `${y ? rect1.width : size}px`,
60
+ height: `${y ? size : rect1.height}px`,
61
+ translate: `${y ? rect1.x : (s == "l" ? rect1.x : rect1.right) - size / 2}px ${x ? rect1.y : (s == "t" ? rect1.y : rect1.bottom) - size / 2}px`
62
+ };
63
+ state.rel = children[i];
64
+ state.type = s == "l" || s == "t" ? "before" : "after";
65
+ } else {
66
+ const rect1 = over.getBoundingClientRect();
67
+ state.style = {
68
+ width: rect1.width,
69
+ height: rect1.height,
70
+ translate: `${rect1.x}px ${rect1.y}px`
71
+ };
72
+ state.rel = over;
73
+ state.type = "inner";
74
+ }
75
+ },
76
+ dragend() {
77
+ dragend();
78
+ }
79
+ });
80
+ function dragend() {
81
+ state.drag?.removeAttribute("draggable");
82
+ if (state.drag && state.rel) opt.dragend?.();
83
+ reconcile({})(state);
84
+ }
85
+ const state = createMutable({
86
+ style: void 0,
87
+ drag: void 0,
88
+ over: void 0,
89
+ rel: void 0,
90
+ type: ""
91
+ });
92
+ memo(() => memo(() => !!state.style)() && createComponent(Portal, {
93
+ get mount() {
94
+ return access(el);
95
+ },
96
+ get children() {
97
+ var _el$ = _tmpl$();
98
+ spread(_el$, mergeProps(() => opt.guideLine, { get style() {
99
+ return state.style;
100
+ } }), false, false);
101
+ return _el$;
102
+ }
103
+ }));
104
+ return state;
105
+ };
106
+ export { useSort };
package/dist/index.d.ts CHANGED
@@ -9,8 +9,10 @@ import './plugins/MenuPlugin';
9
9
  import './plugins/CommandPlugin';
10
10
  import './plugins/RowSelectionPlugin';
11
11
  import './plugins/ResizePlugin';
12
+ import './plugins/DragPlugin';
12
13
  export declare const Ctx: import("solid-js").Context<{
13
14
  props: TableProps2;
15
+ store: TableStore;
14
16
  }>;
15
17
  type Requireds<T, K extends keyof T> = Pri<Omit<T, K> & Required<Pick<T, K>>>;
16
18
  type Pri<T> = {
@@ -27,6 +29,7 @@ export interface Plugin {
27
29
  store?: (store: TableStore) => Partial<TableStore> | void;
28
30
  rewriteProps?: ProcessProps;
29
31
  layers?: Component<TableStore>[];
32
+ onMount?: (store: TableStore) => void;
30
33
  }
31
34
  export interface TableProps {
32
35
  columns?: TableColumn[];
@@ -51,11 +54,13 @@ export interface TableProps {
51
54
  }>;
52
55
  EachRows?: typeof For;
53
56
  EachCells?: typeof For<TableColumn[], JSX.Element>;
54
- cellClass?: ((props: Omit<TDProps, 'y'> & {
57
+ cellClass?: ((props: Omit<TDProps, 'y' | 'data'> & {
55
58
  y?: number;
59
+ data?: any;
56
60
  }) => string) | string;
57
- cellStyle?: ((props: Omit<TDProps, 'y'> & {
61
+ cellStyle?: ((props: Omit<TDProps, 'y' | 'data'> & {
58
62
  y?: number;
63
+ data?: any;
59
64
  }) => string) | string;
60
65
  renderer?: (comp: (props: any) => JSX.Element) => ((props: any) => JSX.Element);
61
66
  plugins?: Plugin[];
@@ -107,6 +112,7 @@ export interface TableStore extends Obj {
107
112
  height: number;
108
113
  }>[];
109
114
  internal: symbol;
115
+ raw: symbol;
110
116
  props?: TableProps2;
111
117
  rawProps: TableProps;
112
118
  plugins: Plugin[];
package/dist/index.js CHANGED
@@ -11,15 +11,19 @@ import { MenuPlugin } from "./plugins/MenuPlugin.js";
11
11
  import { CommandPlugin } from "./plugins/CommandPlugin.js";
12
12
  import { RowSelectionPlugin } from "./plugins/RowSelectionPlugin.js";
13
13
  import { ResizePlugin } from "./plugins/ResizePlugin.js";
14
- import { createComponent, insert, mergeProps, spread, template, use } from "solid-js/web";
15
- import { For, createComputed, createContext, createEffect, createMemo, createSignal, getOwner, mapArray, mergeProps as mergeProps$1, on, onCleanup, runWithOwner, useContext } from "solid-js";
14
+ import { DragPlugin } from "./plugins/DragPlugin.js";
15
+ import { createComponent, insert, memo, mergeProps, spread, template, use } from "solid-js/web";
16
+ import { For, batch, createComputed, createContext, createEffect, createMemo, createSignal, getOwner, mapArray, mergeProps as mergeProps$1, on, onCleanup, onMount, runWithOwner, untrack, useContext } from "solid-js";
16
17
  import { createMutable, reconcile } from "solid-js/store";
17
18
  import { combineProps } from "@solid-primitives/props";
18
19
  import { difference, mapValues, sumBy } from "es-toolkit";
19
- import { createElementSize } from "@solid-primitives/resize-observer";
20
+ import { createElementSize, createResizeObserver } from "@solid-primitives/resize-observer";
20
21
  import { createScrollPosition } from "@solid-primitives/scroll";
21
22
  var _tmpl$ = /* @__PURE__ */ template(`<table>`), _tmpl$2 = /* @__PURE__ */ template(`<thead>`), _tmpl$3 = /* @__PURE__ */ template(`<tbody>`), _tmpl$4 = /* @__PURE__ */ template(`<tr>`), _tmpl$5 = /* @__PURE__ */ template(`<th>`), _tmpl$6 = /* @__PURE__ */ template(`<td>`), _tmpl$7 = /* @__PURE__ */ template(`<div><div class=data-table__layers></div><table class=data-table--table>`);
22
- const Ctx = createContext({ props: {} });
23
+ const Ctx = createContext({
24
+ props: {},
25
+ store: {}
26
+ });
23
27
  const Intable = (props) => {
24
28
  props = mergeProps$1({ rowKey: "id" }, props);
25
29
  const plugins = createMemo(() => [
@@ -51,7 +55,13 @@ const Intable = (props) => {
51
55
  }));
52
56
  const mProps = toReactive(() => pluginsProps()[pluginsProps().length - 1][0]());
53
57
  store.props = mProps;
54
- const ctx = createMutable({ props: mProps });
58
+ onMount(() => {
59
+ createEffect(mapArray(plugins, (e) => e.onMount?.(store)));
60
+ });
61
+ const ctx = createMutable({
62
+ props: mProps,
63
+ store
64
+ });
55
65
  window.store = store;
56
66
  window.ctx = ctx;
57
67
  return createComponent(Ctx.Provider, {
@@ -163,7 +173,8 @@ function BasePlugin() {
163
173
  thSizes: [],
164
174
  trs: [],
165
175
  trSizes: [],
166
- internal: Symbol("internal")
176
+ internal: Symbol("internal"),
177
+ raw: Symbol("raw")
167
178
  }),
168
179
  rewriteProps: {
169
180
  data: ({ data = [] }) => data,
@@ -270,7 +281,7 @@ var IndexPlugin = {
270
281
  width: 40,
271
282
  style: "text-align: center",
272
283
  class: "index",
273
- render: solidComponent((o) => o.y + 1)
284
+ render: solidComponent((o) => memo(() => o.y + 1))
274
285
  } }),
275
286
  rewriteProps: { columns: (props, { store }) => store.props?.index ? [store.$index, ...props.columns || []] : props.columns }
276
287
  };
@@ -290,23 +301,28 @@ var FixedColumnPlugin = { rewriteProps: {
290
301
  cellClass: ({ cellClass }) => (o) => (unFn(cellClass, o) || "") + (o.col.fixed ? ` fixed-${o.col.fixed}` : ""),
291
302
  cellStyle: ({ cellStyle }, { store }) => (o) => (unFn(cellStyle, o) || "") + (o.col.fixed ? `; ${o.col.fixed}: ${sumBy(store.thSizes.slice(o.col.fixed == "left" ? 0 : o.x + 1, o.col.fixed == "left" ? o.x : Infinity), (size) => size?.width || 0)}px` : "")
292
303
  } };
293
- var FitColWidthPlugin = { rewriteProps: {
294
- Table: (prev, { store }) => (o) => {
295
- const size1 = createElementSize(() => store.scroll_el);
296
- createEffect(on(() => [size1.width, prev.columns], async () => {
297
- const w = store.scroll_el.clientWidth;
298
- store._fit_col_width__cols_temp = null;
299
- await Promise.resolve();
300
- const gap = (w - store.table.offsetWidth) / store.props.columns.filter((e) => !e.width).length;
301
- store._fit_col_width__cols_temp = prev.columns.map((e, i) => ({ width: e.width ?? Math.max((store.thSizes[i]?.width || 0) + gap, 80) }));
302
- }));
303
- return createComponent(prev.Table, o);
304
- },
305
- columns: ({ columns }, { store }) => reconcile(columns.map((e, i) => ({
306
- ...e,
307
- ...store._fit_col_width__cols_temp?.[i]
308
- })))(store._fit_col_width__cols ??= [])
309
- } };
304
+ var FitColWidthPlugin = {
305
+ priority: -Infinity,
306
+ rewriteProps: {
307
+ Table: (prev, { store }) => (o) => {
308
+ const size = createMutable({ width: 0 });
309
+ createResizeObserver(() => store.scroll_el, (_, el, e) => size.width = e.contentBoxSize[0].inlineSize);
310
+ createEffect(on(() => [size.width, prev.columns.map((e) => e.width)], async () => {
311
+ if (!size.width) return;
312
+ store.__fit_col_width__cols_temp = null;
313
+ await Promise.resolve();
314
+ const gap = (size.width - store.table.getBoundingClientRect().width) / store.props.columns.filter((e) => !e.width).length;
315
+ store.__fit_col_width__cols_temp = store.props.columns.map((e, i) => e.width ? null : { width: Math.max((store.ths[i]?.getBoundingClientRect().width || 0) + gap, 80) });
316
+ }));
317
+ return createComponent(prev.Table, o);
318
+ },
319
+ columns: ({ columns }, { store }) => (columns = columns.map((e, i) => ({
320
+ ...e,
321
+ ...store.__fit_col_width__cols_temp?.[i],
322
+ [store.raw]: e[store.raw] ?? e
323
+ })), untrack(() => batch(() => reconcile(columns, { key: store.raw })(store.__fit_col_width__cols ??= []))))
324
+ }
325
+ };
310
326
  const ScrollPlugin = {
311
327
  priority: Infinity,
312
328
  rewriteProps: { Table: (prev, { store }) => (o) => {
@@ -347,6 +363,7 @@ const defaultsPlugins = [
347
363
  StickyHeaderPlugin,
348
364
  FixedColumnPlugin,
349
365
  ResizePlugin,
366
+ DragPlugin,
350
367
  ClipboardPlugin,
351
368
  EditablePlugin,
352
369
  FitColWidthPlugin
@@ -0,0 +1,14 @@
1
+ import { type Plugin } from "../index";
2
+ declare module '../index' {
3
+ interface TableProps {
4
+ colDrag: boolean;
5
+ rowDrag: boolean;
6
+ }
7
+ interface TableColumn {
8
+ }
9
+ interface TableStore {
10
+ }
11
+ interface Commands {
12
+ }
13
+ }
14
+ export declare const CellMergePlugin: Plugin;
@@ -0,0 +1,2 @@
1
+ const CellMergePlugin = { rewriteProps: {} };
2
+ export { CellMergePlugin };
@@ -16,44 +16,6 @@ const CellSelectionPlugin = {
16
16
  return store.props.data.slice(y1, y2 + 1);
17
17
  } }),
18
18
  rewriteProps: {
19
- Th: ({ Th }, { store }) => (o) => {
20
- const clazz = createMemo(() => {
21
- const { start, end } = store.selected;
22
- return inrange(o.x, ...[start[0], end[0]].sort((a, b) => a - b)) ? "col-range-highlight" : "";
23
- });
24
- const mo = combineProps(o, { get class() {
25
- return clazz();
26
- } });
27
- return createComponent(Th, mergeProps(mo, { get children() {
28
- return [memo(() => mo.children), memo(() => memo(() => !!clazz())() && _tmpl$())];
29
- } }));
30
- },
31
- Td: ({ Td }, { store }) => (o) => {
32
- const clazz = createMemo(() => {
33
- let clazz$1 = "";
34
- const { xs, ys } = store.cellSelectionRect();
35
- const inx = inrange(o.x, xs[0], xs[1]);
36
- const iny = inrange(o.y, ys[0], ys[1]);
37
- if (inx && iny) {
38
- clazz$1 += "range-selected ";
39
- if (o.x == xs[0]) clazz$1 += "range-selected-l ";
40
- if (o.x == xs[1]) clazz$1 += "range-selected-r ";
41
- if (o.y == ys[0]) clazz$1 += "range-selected-t ";
42
- if (o.y == ys[1]) clazz$1 += "range-selected-b ";
43
- }
44
- if (o.x == 0 && iny) clazz$1 += "row-range-highlight ";
45
- return clazz$1;
46
- });
47
- const mo = combineProps(o, {
48
- get class() {
49
- return clazz();
50
- },
51
- tabindex: -1
52
- });
53
- return createComponent(Td, mergeProps(mo, { get children() {
54
- return [memo(() => mo.children), memo(() => memo(() => !!clazz())() && _tmpl$())];
55
- } }));
56
- },
57
19
  Table: ({ Table }, { store }) => (o) => {
58
20
  const { props } = useContext(Ctx);
59
21
  store.cellSelectionRect ??= createMemo(() => {
@@ -65,53 +27,56 @@ const CellSelectionPlugin = {
65
27
  ys
66
28
  };
67
29
  });
68
- usePointerDrag(() => store.table, { start(e, move, end) {
69
- batch(() => {
70
- const findCell = (e$1) => e$1.composedPath().find((e$2) => e$2.tagName == "TH" || e$2.tagName == "TD");
71
- const getXY = (cell$1) => [cell$1.getAttribute("x"), cell$1.getAttribute("y")];
72
- const cell = findCell(e);
73
- if (!cell) return;
74
- if (e.buttons != 1 && cell.classList.contains("range-selected")) return;
75
- if (cell.tagName == "TH") {
76
- const [x, y] = getXY(cell);
77
- if (x == null) return;
78
- store.selected.start = [+x, 0];
79
- store.selected.end = [+x, Infinity];
80
- move((e$1) => {
81
- const cell$1 = findCell(e$1);
82
- if (!cell$1) return;
83
- const [x$1, y$1] = getXY(cell$1);
84
- if (x$1 == null) return;
85
- store.selected.end = [+x$1, Infinity];
86
- });
87
- }
88
- if (cell.classList.contains("index")) {
89
- const [x, y] = getXY(cell);
90
- if (x == null || y == null) return;
91
- store.selected.start = [0, +y];
92
- store.selected.end = [Infinity, +y];
93
- move((e$1) => {
94
- const cell$1 = findCell(e$1);
95
- if (!cell$1) return;
96
- const [x$1, y$1] = getXY(cell$1);
97
- if (x$1 == null || y$1 == null) return;
98
- store.selected.end = [Infinity, +y$1];
99
- });
100
- } else if (cell.tagName == "TD") {
101
- const [x, y] = getXY(cell);
102
- if (x == null || y == null) return;
103
- store.selected.start = [+x, +y];
104
- store.selected.end = [...store.selected.start];
105
- move((e$1) => {
106
- const cell$1 = findCell(e$1);
107
- if (!cell$1) return;
108
- const [x$1, y$1] = getXY(cell$1);
109
- if (x$1 == null || y$1 == null) return;
110
- store.selected.end = [+x$1, +y$1];
111
- });
112
- }
113
- });
114
- } });
30
+ usePointerDrag(() => store.table, {
31
+ preventDefault: false,
32
+ start(e, move, end) {
33
+ batch(() => {
34
+ const findCell = (e$1) => e$1.composedPath().find((e$2) => e$2.tagName == "TH" || e$2.tagName == "TD");
35
+ const getXY = (cell$1) => [cell$1.getAttribute("x"), cell$1.getAttribute("y")];
36
+ const cell = findCell(e);
37
+ if (!cell) return;
38
+ if (e.buttons != 1 && cell.classList.contains("range-selected")) return;
39
+ if (cell.tagName == "TH") {
40
+ const [x, y] = getXY(cell);
41
+ if (x == null) return;
42
+ store.selected.start = [+x, 0];
43
+ store.selected.end = [+x, Infinity];
44
+ move((e$1) => {
45
+ const cell$1 = findCell(e$1);
46
+ if (!cell$1) return;
47
+ const [x$1, y$1] = getXY(cell$1);
48
+ if (x$1 == null) return;
49
+ store.selected.end = [+x$1, Infinity];
50
+ });
51
+ }
52
+ if (cell.classList.contains("index")) {
53
+ const [x, y] = getXY(cell);
54
+ if (x == null || y == null) return;
55
+ store.selected.start = [0, +y];
56
+ store.selected.end = [Infinity, +y];
57
+ move((e$1) => {
58
+ const cell$1 = findCell(e$1);
59
+ if (!cell$1) return;
60
+ const [x$1, y$1] = getXY(cell$1);
61
+ if (x$1 == null || y$1 == null) return;
62
+ store.selected.end = [Infinity, +y$1];
63
+ });
64
+ } else if (cell.tagName == "TD") {
65
+ const [x, y] = getXY(cell);
66
+ if (x == null || y == null) return;
67
+ store.selected.start = [+x, +y];
68
+ store.selected.end = [...store.selected.start];
69
+ move((e$1) => {
70
+ const cell$1 = findCell(e$1);
71
+ if (!cell$1) return;
72
+ const [x$1, y$1] = getXY(cell$1);
73
+ if (x$1 == null || y$1 == null) return;
74
+ store.selected.end = [+x$1, +y$1];
75
+ });
76
+ }
77
+ });
78
+ }
79
+ });
115
80
  useTinykeys(() => store.table, {
116
81
  "ArrowLeft": () => {
117
82
  const { start, end } = store.selected;
@@ -143,7 +108,46 @@ const CellSelectionPlugin = {
143
108
  cell?.scrollIntoViewIfNeeded(false);
144
109
  cell?.focus();
145
110
  };
111
+ o = combineProps({ class: "select-none" }, o);
146
112
  return createComponent(Table, o);
113
+ },
114
+ Th: ({ Th }, { store }) => (o) => {
115
+ const clazz = createMemo(() => {
116
+ const { start, end } = store.selected;
117
+ return inrange(o.x, ...[start[0], end[0]].sort((a, b) => a - b)) ? "col-range-highlight" : "";
118
+ });
119
+ const mo = combineProps(o, { get class() {
120
+ return clazz();
121
+ } });
122
+ return createComponent(Th, mergeProps(mo, { get children() {
123
+ return [memo(() => mo.children), memo(() => memo(() => !!clazz())() && _tmpl$())];
124
+ } }));
125
+ },
126
+ Td: ({ Td }, { store }) => (o) => {
127
+ const clazz = createMemo(() => {
128
+ let clazz$1 = "";
129
+ const { xs, ys } = store.cellSelectionRect();
130
+ const inx = inrange(o.x, xs[0], xs[1]);
131
+ const iny = inrange(o.y, ys[0], ys[1]);
132
+ if (inx && iny) {
133
+ clazz$1 += "range-selected ";
134
+ if (o.x == xs[0]) clazz$1 += "range-selected-l ";
135
+ if (o.x == xs[1]) clazz$1 += "range-selected-r ";
136
+ if (o.y == ys[0]) clazz$1 += "range-selected-t ";
137
+ if (o.y == ys[1]) clazz$1 += "range-selected-b ";
138
+ }
139
+ if (o.x == 0 && iny) clazz$1 += "row-range-highlight ";
140
+ return clazz$1;
141
+ });
142
+ const mo = combineProps(o, {
143
+ get class() {
144
+ return clazz();
145
+ },
146
+ tabindex: -1
147
+ });
148
+ return createComponent(Td, mergeProps(mo, { get children() {
149
+ return [memo(() => mo.children), memo(() => memo(() => !!clazz())() && _tmpl$())];
150
+ } }));
147
151
  }
148
152
  }
149
153
  };
@@ -0,0 +1,14 @@
1
+ import { type Plugin } from "../index";
2
+ declare module '../index' {
3
+ interface TableProps {
4
+ colDrag: boolean;
5
+ rowDrag: boolean;
6
+ }
7
+ interface TableColumn {
8
+ }
9
+ interface TableStore {
10
+ }
11
+ interface Commands {
12
+ }
13
+ }
14
+ export declare const DragPlugin: Plugin;
@@ -0,0 +1,63 @@
1
+ import { useSort } from "../hooks/useSort.js";
2
+ import { delay } from "es-toolkit";
3
+ import { isMatch } from "es-toolkit/compat";
4
+ const DragPlugin = {
5
+ rewriteProps: {
6
+ colDrag: ({ colDrag = false }) => colDrag,
7
+ rowDrag: ({ rowDrag = false }) => rowDrag
8
+ },
9
+ onMount(store) {
10
+ const colDrag = useSort(() => store.scroll_el, {
11
+ get enable() {
12
+ return store.props?.colDrag;
13
+ },
14
+ guideLine: { class: "col__guide-line" },
15
+ draggable: (el) => ((x, y) => el.tagName == "TH" && isMatch(store.selected, { start: [x, 0] }) && !store.props?.columns[x][store.internal] && store.thead.contains(el) && delay(300).then(() => true))(+el.getAttribute("x"), +el.getAttribute("y")),
16
+ dragover: (el) => el.tagName == "THEAD",
17
+ children: (el) => [...colDrag.drag.parentElement.children].filter((e) => !store.props?.columns[e.getAttribute("x")][store.internal]),
18
+ dragend: onColDragend
19
+ });
20
+ const rowDrag = useSort(() => store.scroll_el, {
21
+ get enable() {
22
+ return store.props?.rowDrag;
23
+ },
24
+ guideLine: { class: "row__guide-line" },
25
+ draggable: (el) => ((x, y) => el.tagName == "TD" && isMatch(store.selected, { start: [0, y] }) && x == 0 && !store.props?.data[y][store.internal] && store.tbody.contains(el) && delay(300).then(() => true))(+el.getAttribute("x"), +el.getAttribute("y")),
26
+ dragover: (el) => el.tagName == "TBODY",
27
+ children: (el) => [...rowDrag.over.children].filter((e) => !store.props.data[e.getAttribute("y")][store.internal]),
28
+ dragend: onRowDragend
29
+ });
30
+ async function onColDragend() {
31
+ if (colDrag.drag == colDrag.rel) return;
32
+ const [cols, rawCols] = [store.props.columns, [...store.rawProps.columns || []]];
33
+ const col1 = ((col) => col[store.raw] ?? col)(cols[colDrag.drag.getAttribute("x")]);
34
+ const col2 = ((col) => col[store.raw] ?? col)(cols[colDrag.rel.getAttribute("x")]);
35
+ const i1 = rawCols.indexOf(col1);
36
+ const i2 = rawCols.indexOf(col2);
37
+ if (i1 < 0 || i2 < 0) return;
38
+ rawCols[i1].fixed = rawCols[i2].fixed;
39
+ rawCols.splice(i2 - (i1 > i2 ? 0 : 1) + (colDrag.type == "before" ? 0 : 1), 0, rawCols.splice(i1, 1)[0]);
40
+ store.props.onColumnsChange?.(rawCols);
41
+ await Promise.resolve();
42
+ const i = store.props.columns.findIndex((e) => e == col1 || e[store.raw] == col1);
43
+ if (i < 0) return;
44
+ store.selected.start[0] = store.selected.end[0] = i;
45
+ }
46
+ async function onRowDragend() {
47
+ if (rowDrag.drag == rowDrag.rel) return;
48
+ const [data, rawData] = [store.props.data, [...store.rawProps.data || []]];
49
+ const data1 = ((row) => row[store.raw] ?? row)(data[rowDrag.drag.getAttribute("y")]);
50
+ const data2 = ((row) => row[store.raw] ?? row)(data[rowDrag.rel.getAttribute("y")]);
51
+ const i1 = rawData.indexOf(data1);
52
+ const i2 = rawData.indexOf(data2);
53
+ if (i1 < 0 || i2 < 0) return;
54
+ rawData.splice(i2 - (i1 > i2 ? 0 : 1) + (rowDrag.type == "before" ? 0 : 1), 0, rawData.splice(i1, 1)[0]);
55
+ store.props.onDataChange?.(rawData);
56
+ await Promise.resolve();
57
+ const i = store.props.data.findIndex((e) => e == data1 || e[store.raw] == data1);
58
+ if (i < 0) return;
59
+ store.selected.start[1] = store.selected.end[1] = i;
60
+ }
61
+ }
62
+ };
63
+ export { DragPlugin };
@@ -2,12 +2,12 @@ import { type Plugin } from "../index";
2
2
  declare module '../index' {
3
3
  interface TableProps {
4
4
  resizable?: {
5
- col: Partial<{
5
+ col?: Partial<{
6
6
  enable: boolean;
7
7
  min: number;
8
8
  max: number;
9
9
  }>;
10
- row: Partial<{
10
+ row?: Partial<{
11
11
  enable: boolean;
12
12
  min: number;
13
13
  max: number;
@@ -1,103 +1,116 @@
1
+ import { unFn } from "../utils.js";
1
2
  import { usePointerDrag } from "../hooks/index.js";
2
- import { useSplit } from "../components/Split.js";
3
3
  import { Ctx } from "../index.js";
4
- import { createComponent, template, use } from "solid-js/web";
5
- import { createMemo, onMount, useContext } from "solid-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";
6
7
  import { combineProps } from "@solid-primitives/props";
7
8
  import { clamp } from "es-toolkit";
9
+ import { createEventListener } from "@solid-primitives/event-listener";
8
10
  import { defaultsDeep } from "es-toolkit/compat";
9
- var _tmpl$ = /* @__PURE__ */ template(`<div class="in-cell__resize-handle flex justify-center after:w-1 cursor-w-resize">`), _tmpl$2 = /* @__PURE__ */ template(`<div class="in-cell__resize-handle flex flex-row items-center after:h-1 cursor-s-resize">`);
10
- const ResizePlugin = { rewriteProps: {
11
- resizable: ({ resizable }) => defaultsDeep(resizable, {
12
- col: {
13
- enable: true,
14
- min: 45,
15
- max: 800
16
- },
17
- row: {
18
- enable: false,
19
- min: 20,
20
- max: 400
21
- }
22
- }),
23
- columns: ({ columns }, { store }) => columns.map((e) => defaultsDeep(e, { resizable: store.props?.resizable?.col.enable })),
24
- Thead: ({ Thead }, { store }) => (o) => {
25
- let theadEl;
26
- const { props } = useContext(Ctx);
27
- const ths = createMemo(() => store.ths.filter((e) => e != null));
28
- onMount(() => {
29
- useSplit({
30
- container: theadEl,
31
- cells: ths,
32
- size: 10,
33
- trailing: true,
34
- dir: "x",
35
- handle: (i) => createComponent(Handle, { i })
36
- });
11
+ var _tmpl$ = /* @__PURE__ */ template(`<div>`);
12
+ var COL = Symbol("col_size");
13
+ var ROW = Symbol("row_size");
14
+ var ColHandle = (o) => {
15
+ const { props, store } = useContext(Ctx);
16
+ let el;
17
+ usePointerDrag(() => el, { start(e, move, end) {
18
+ e.stopPropagation();
19
+ const i = o.x;
20
+ const { min, max } = props.resizable.col;
21
+ const th = el.parentElement;
22
+ const sw = th.offsetWidth;
23
+ move((e$1, { ox }) => store[COL][o.x] = clamp(sw + ox, min, max));
24
+ end(() => {
25
+ const col = props.columns[i];
26
+ const cols = [...store.rawProps.columns || []];
27
+ const index = cols.indexOf(col[store.raw] ?? col);
28
+ if (index > -1) {
29
+ cols[index] = {
30
+ ...cols[index],
31
+ width: th.offsetWidth
32
+ };
33
+ props.onColumnsChange?.(cols);
34
+ }
35
+ col.onWidthChange?.(th.offsetWidth);
37
36
  });
38
- const Handle = (_props) => {
39
- let el;
40
- usePointerDrag(() => el, { start(e, move, end) {
41
- const { min, max } = props.resizable.col;
42
- const th = ths()[_props.i];
43
- const sw = th.offsetWidth;
44
- move((e$1, o$1) => th.style.width = `${clamp(sw + o$1.ox, min, max)}px`);
45
- end(() => {
46
- const col = props.columns[_props.i];
47
- const cols = [...store.rawProps.columns || []];
48
- const index = cols?.findIndex((e$1) => e$1.id == col.id);
49
- if (index > -1) {
50
- cols[index] = {
51
- ...cols[index],
52
- width: th.offsetWidth
53
- };
54
- props.onColumnsChange?.(cols);
55
- }
56
- col.onWidthChange?.(th.offsetWidth);
57
- });
58
- } });
59
- return (() => {
60
- var _el$ = _tmpl$();
61
- var _ref$ = el;
62
- typeof _ref$ === "function" ? use(_ref$, _el$) : el = _el$;
63
- return _el$;
64
- })();
65
- };
66
- o = combineProps({ ref: (e) => theadEl = e }, o);
67
- return createComponent(Thead, o);
68
- },
69
- Tbody: ({ Tbody }, { store }) => (o) => {
70
- let el;
71
- const { props } = useContext(Ctx);
72
- const tds = createMemo(() => store.trs.filter((e) => e != null).map((e) => e.firstElementChild));
73
- onMount(() => {
74
- useSplit({
75
- container: el,
76
- cells: tds,
77
- size: 8,
78
- trailing: true,
79
- dir: "y",
80
- handle: (i) => createComponent(Handle, { i })
81
- });
37
+ } });
38
+ return (() => {
39
+ var _el$ = _tmpl$();
40
+ var _ref$ = el;
41
+ typeof _ref$ === "function" ? use(_ref$, _el$) : el = _el$;
42
+ effect(() => className(_el$, `in-cell__resize-handle absolute top-0 right-0 flex justify-center w-10px! ${o.x == props.columns.length - 1 ? "justify-end!" : "w-10px! translate-x-1/2"} after:w-1 cursor-w-resize z-1`));
43
+ return _el$;
44
+ })();
45
+ };
46
+ var RowHandle = (o) => {
47
+ const { props, store } = useContext(Ctx);
48
+ let el;
49
+ usePointerDrag(() => el, { start(e, move, end) {
50
+ e.stopPropagation();
51
+ const i = o.y;
52
+ const { min, max } = props.resizable.row;
53
+ const sh = el.parentElement.offsetHeight;
54
+ move((e$1, { oy }) => store[ROW][o.y] = clamp(sh + oy, min, max));
55
+ end(() => {
56
+ const row = props.data[i];
57
+ if ([...store.rawProps.data || []].indexOf(row[store.raw] ?? row) > -1) {}
82
58
  });
83
- const Handle = (_props2) => {
84
- let el$1;
85
- usePointerDrag(() => el$1, { start(e, move, end) {
86
- const { min, max } = props.resizable.row;
87
- const tr = tds()[_props2.i];
88
- const sw = tr.offsetHeight;
89
- move((e$1, o$1) => tr.style.height = `${clamp(sw + o$1.oy, min, max)}px`);
90
- end(() => {});
91
- } });
92
- return (() => {
93
- var _el$2 = _tmpl$2();
94
- var _ref$2 = el$1;
95
- typeof _ref$2 === "function" ? use(_ref$2, _el$2) : el$1 = _el$2;
96
- return _el$2;
97
- })();
98
- };
99
- o = combineProps({ ref: (e) => el = e }, o);
100
- return createComponent(Tbody, o);
59
+ } });
60
+ createEventListener(() => el, "dblclick", () => o.data[COL] = void 0);
61
+ return (() => {
62
+ var _el$2 = _tmpl$();
63
+ var _ref$2 = el;
64
+ typeof _ref$2 === "function" ? use(_ref$2, _el$2) : el = _el$2;
65
+ effect(() => className(_el$2, `in-cell__resize-handle absolute bottom-0 left-0 flex flex-col justify-center h-1! ${o.y == props.data.length - 1 ? "justify-end!" : ""} after:h-1 cursor-s-resize z-1`));
66
+ return _el$2;
67
+ })();
68
+ };
69
+ const ResizePlugin = {
70
+ store: () => ({
71
+ [COL]: [],
72
+ [ROW]: []
73
+ }),
74
+ rewriteProps: {
75
+ resizable: ({ resizable }) => defaultsDeep(resizable, {
76
+ col: {
77
+ enable: true,
78
+ min: 45,
79
+ max: 800
80
+ },
81
+ row: {
82
+ enable: false,
83
+ min: 20,
84
+ max: 400
85
+ }
86
+ }),
87
+ columns: ({ columns }, { store }) => (columns = columns.map((e, i) => ({
88
+ ...e,
89
+ [store.raw]: e[store.raw] ?? e
90
+ })), columns = columns.map((e) => e.resizable === void 0 ? {
91
+ ...e,
92
+ resizable: store.props?.resizable?.col.enable,
93
+ [store.raw]: e[store.raw] ?? e
94
+ } : e), columns = columns.map((e, i) => store[COL][i] ? {
95
+ ...e,
96
+ width: store[COL][i],
97
+ [store.raw]: e[store.raw] ?? e
98
+ } : e), untrack(() => batch(() => reconcile(columns, { key: store.raw })(store.__resize__cols ??= [])))),
99
+ Th: ({ Th }, { store }) => (o) => {
100
+ o = combineProps({ class: "relative" }, o);
101
+ return createComponent(Th, mergeProps(o, { get children() {
102
+ return [memo(() => o.children), memo(() => memo(() => !!o.col.resizable)() && createComponent(ColHandle, o))];
103
+ } }));
104
+ },
105
+ Td: ({ Td }, { store }) => !store.props?.resizable?.row.enable ? Td : (o) => {
106
+ o = combineProps({ class: "relative" }, o);
107
+ return createComponent(Td, mergeProps(o, { get children() {
108
+ return [memo(() => o.children), memo(() => memo(() => !!(o.x == 0 && store.props?.resizable?.row.enable))() && createComponent(RowHandle, o))];
109
+ } }));
110
+ },
111
+ cellStyle: ({ cellStyle }, { store }) => (o) => {
112
+ return `${unFn(cellStyle, o)};` + (store[ROW][o.y] ? `height: ${store[ROW][o.y]}px` : "");
113
+ }
101
114
  }
102
- } };
115
+ };
103
116
  export { ResizePlugin };
package/dist/style.css CHANGED
@@ -1,4 +1,4 @@
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%;}:root, :host {--spacing: 0.25rem;--colors-gray-DEFAULT: oklch(70.7% 0.022 261.325);--text-sm-fontSize: 0.875rem;--text-sm-lineHeight: 1.25rem;--radius-sm: 0.25rem;--colors-blue-DEFAULT: oklch(70.7% 0.165 254.624);--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);}/* 1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) 2. Remove default margins and padding 3. Reset all borders.*/*,::after,::before,::backdrop,::file-selector-button { box-sizing: border-box; /* 1 */ margin: 0; /* 2 */ padding: 0; /* 2 */ border: 0 solid; /* 3 */}/* 1. Use a consistent sensible line-height in all browsers. 2. Prevent adjustments of font size after orientation changes in iOS. 3. Use a more readable tab size. 4. Use the user's configured `sans` font-family by default. 5. Use the user's configured `sans` font-feature-settings by default. 6. Use the user's configured `sans` font-variation-settings by default. 7. Disable tap highlights on iOS.*/html,:host { line-height: 1.5; /* 1 */ -webkit-text-size-adjust: 100%; /* 2 */ tab-size: 4; /* 3 */ 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' ); /* 4 */ font-feature-settings: var(--default-font-featureSettings, normal); /* 5 */ font-variation-settings: var(--default-font-variationSettings, normal); /* 6 */ -webkit-tap-highlight-color: transparent; /* 7 */}/* 1. Add the correct height in Firefox. 2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) 3. Reset the default border style to a 1px solid border.*/hr { height: 0; /* 1 */ color: inherit; /* 2 */ border-top-width: 1px; /* 3 */}/* Add the correct text decoration in Chrome, Edge, and Safari.*/abbr:where([title]) { -webkit-text-decoration: underline dotted; text-decoration: underline dotted;}/* Remove the default font size and weight for headings.*/h1,h2,h3,h4,h5,h6 { font-size: inherit; font-weight: inherit;}/* Reset links to optimize for opt-in styling instead of opt-out.*/a { color: inherit; -webkit-text-decoration: inherit; text-decoration: inherit;}/* Add the correct font weight in Edge and Safari.*/b,strong { font-weight: bolder;}/* 1. Use the user's configured `mono` font-family by default. 2. Use the user's configured `mono` font-feature-settings by default. 3. Use the user's configured `mono` font-variation-settings by default. 4. Correct the odd `em` font sizing in all browsers.*/code,kbd,samp,pre { font-family: var( --default-monoFont-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace ); /* 1 */ font-feature-settings: var(--default-monoFont-featureSettings, normal); /* 2 */ font-variation-settings: var(--default-monoFont-variationSettings, normal); /* 3 */ font-size: 1em; /* 4 */}/* Add the correct font size in all browsers.*/small { font-size: 80%;}/* Prevent `sub` and `sup` elements from affecting the line height in all browsers.*/sub,sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline;}sub { bottom: -0.25em;}sup { top: -0.5em;}/* 1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) 2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) 3. Remove gaps between table borders by default.*/table { text-indent: 0; /* 1 */ border-color: inherit; /* 2 */ border-collapse: collapse; /* 3 */}/* Use the modern Firefox focus style for all focusable elements.*/:-moz-focusring { outline: auto;}/* Add the correct vertical alignment in Chrome and Firefox.*/progress { vertical-align: baseline;}/* Add the correct display in Chrome and Safari.*/summary { display: list-item;}/* Make lists unstyled by default.*/ol,ul,menu { list-style: none;}/* 1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14) 2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210) This can trigger a poorly considered lint error in some tools but is included by design.*/img,svg,video,canvas,audio,iframe,embed,object { display: block; /* 1 */ vertical-align: middle; /* 2 */}/* Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)*/img,video { max-width: 100%; height: auto;}/* 1. Inherit font styles in all browsers. 2. Remove border radius in all browsers. 3. Remove background color in all browsers. 4. Ensure consistent opacity for disabled states in all browsers.*/button,input,select,optgroup,textarea,::file-selector-button { font: inherit; /* 1 */ font-feature-settings: inherit; /* 1 */ font-variation-settings: inherit; /* 1 */ letter-spacing: inherit; /* 1 */ color: inherit; /* 1 */ border-radius: 0; /* 2 */ background-color: transparent; /* 3 */ opacity: 1; /* 4 */}/* Restore default font weight.*/:where(select:is([multiple], [size])) optgroup { font-weight: bolder;}/* Restore indentation.*/:where(select:is([multiple], [size])) optgroup option { padding-inline-start: 20px;}/* Restore space after button.*/::file-selector-button { margin-inline-end: 4px;}/* Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)*/::placeholder { opacity: 1;}/* Set the default placeholder color to a semi-transparent version of the current text color in browsers that do not crash when using `color-mix(…)` with `currentcolor`. (https://github.com/tailwindlabs/tailwindcss/issues/17194)*/@supports (not (-webkit-appearance: -apple-pay-button)) /* Not Safari */ or (contain-intrinsic-size: 1px) /* Safari 17+ */ { ::placeholder { color: color-mix(in oklab, currentcolor 50%, transparent); }}/* Prevent resizing textareas horizontally by default.*/textarea { resize: vertical;}/* Remove the inner padding in Chrome and Safari on macOS.*/::-webkit-search-decoration { -webkit-appearance: none;}/* 1. Ensure date/time inputs have the same height when empty in iOS Safari. 2. Ensure text alignment can be changed on date/time inputs in iOS Safari.*/::-webkit-date-and-time-value { min-height: 1lh; /* 1 */ text-align: inherit; /* 2 */}/* Prevent height from changing on date/time inputs in macOS Safari when the input is set to `display: block`.*/::-webkit-datetime-edit { display: inline-flex;}/* Remove excess padding from pseudo-elements in date/time inputs to ensure consistent height across browsers.*/::-webkit-datetime-edit-fields-wrapper { padding: 0;}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field { padding-block: 0;}/* Center dropdown marker shown on inputs with paired `<datalist>`s in Chrome. (https://github.com/tailwindlabs/tailwindcss/issues/18499)*/::-webkit-calendar-picker-indicator { line-height: 1;}/* Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)*/:-moz-ui-invalid { box-shadow: none;}/* Correct the inability to style the border radius in iOS Safari.*/button,input:where([type='button'], [type='reset'], [type='submit']),::file-selector-button { appearance: button;}/* Correct the cursor style of increment and decrement buttons in Safari.*/::-webkit-inner-spin-button,::-webkit-outer-spin-button { height: auto;}/* Make elements with the HTML hidden attribute stay hidden by default.*/[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:0.875rem;}.lh-\[1\]{--un-leading:1;line-height:1;}.m9{margin:calc(var(--spacing) * 9);}.mx-1{margin-inline:calc(var(--spacing) * 1);}.mx-3\!{margin-inline:calc(var(--spacing) * 3) !important;}.my-1{margin-block:calc(var(--spacing) * 1);}.ml{margin-left:calc(var(--spacing) * 4);}.ml-\.5{margin-left:calc(var(--spacing) * 0.5);}.ml-1{margin-left:calc(var(--spacing) * 1);}.mr--1{margin-right:calc(var(--spacing) * -1);}.mr-1{margin-right:calc(var(--spacing) * 1);}.mr-2{margin-right:calc(var(--spacing) * 2);}.mr-2\.5{margin-right:calc(var(--spacing) * 2.5);}.p-1{padding:calc(var(--spacing) * 1);}.px,.px-4{padding-inline:calc(var(--spacing) * 4);}.px-2{padding-inline:calc(var(--spacing) * 2);}.py-1{padding-block:calc(var(--spacing) * 1);}.py-2{padding-block:calc(var(--spacing) * 2);}.pl-1{padding-left:calc(var(--spacing) * 1);}.pr-4{padding-right:calc(var(--spacing) * 4);}.ps{padding-inline-start:calc(var(--spacing) * 4);}.outline-0{outline-style:var(--un-outline-style);outline-width:0px;}.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) /* oklch(70.7% 0.165 254.624) */;}.b{border-width:1px;}.rd-2{border-radius:0.5rem;}.rd-sm{border-radius:var(--radius-sm);}.bg-\#dafaea{background-color:color-mix(in oklab, #dafaea var(--un-bg-opacity), transparent) /* #dafaea */;}.bg-\#ffe8e8{background-color:color-mix(in oklab, #ffe8e8 var(--un-bg-opacity), transparent) /* #ffe8e8 */;}.bg-\#fff{background-color:color-mix(in oklab, #fff var(--un-bg-opacity), transparent) /* #fff */;}.bg-gray\/20{background-color:color-mix(in srgb, var(--colors-gray-DEFAULT) 20%, transparent) /* oklch(70.7% 0.022 261.325) */;}.op-75{opacity:75%;}.op40{opacity:40%;}.flex{display:flex;}.flex-shrink-0{flex-shrink:0;}.flex-row{flex-direction:row;}.flex-wrap{flex-wrap:wrap;}.gap-2{gap:calc(var(--spacing) * 2);}.size-4\!{width:calc(var(--spacing) * 4) !important;height:calc(var(--spacing) * 4) !important;}.size-full{width:100%;height:100%;}.h-a\!{height:auto !important;}.h-full{height:100%;}.max-h-100{max-height:calc(var(--spacing) * 100);}.min-h-40{min-height:calc(var(--spacing) * 40);}.min-h-a\!{min-height:auto !important;}.after\:h-1::after{height:calc(var(--spacing) * 1);}.after\:w-1::after{width:calc(var(--spacing) * 1);}.block{display:block;}.cursor-s-resize{cursor:s-resize;}.cursor-w-resize{cursor:w-resize;}.resize-none{resize:none;}.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;}.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;}@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) /* oklch(70.7% 0.165 254.624) */;}.bg-gray\/20{background-color:color-mix(in oklab, var(--colors-gray-DEFAULT) 20%, transparent) /* oklch(70.7% 0.022 261.325) */;}}
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: 0.25rem;--colors-gray-DEFAULT: oklch(70.7% 0.022 261.325);--text-sm-fontSize: 0.875rem;--text-sm-lineHeight: 1.25rem;--radius-sm: 0.25rem;--colors-blue-DEFAULT: oklch(70.7% 0.165 254.624);--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);}/* 1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) 2. Remove default margins and padding 3. Reset all borders.*/*,::after,::before,::backdrop,::file-selector-button { box-sizing: border-box; /* 1 */ margin: 0; /* 2 */ padding: 0; /* 2 */ border: 0 solid; /* 3 */}/* 1. Use a consistent sensible line-height in all browsers. 2. Prevent adjustments of font size after orientation changes in iOS. 3. Use a more readable tab size. 4. Use the user's configured `sans` font-family by default. 5. Use the user's configured `sans` font-feature-settings by default. 6. Use the user's configured `sans` font-variation-settings by default. 7. Disable tap highlights on iOS.*/html,:host { line-height: 1.5; /* 1 */ -webkit-text-size-adjust: 100%; /* 2 */ tab-size: 4; /* 3 */ 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' ); /* 4 */ font-feature-settings: var(--default-font-featureSettings, normal); /* 5 */ font-variation-settings: var(--default-font-variationSettings, normal); /* 6 */ -webkit-tap-highlight-color: transparent; /* 7 */}/* 1. Add the correct height in Firefox. 2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) 3. Reset the default border style to a 1px solid border.*/hr { height: 0; /* 1 */ color: inherit; /* 2 */ border-top-width: 1px; /* 3 */}/* Add the correct text decoration in Chrome, Edge, and Safari.*/abbr:where([title]) { -webkit-text-decoration: underline dotted; text-decoration: underline dotted;}/* Remove the default font size and weight for headings.*/h1,h2,h3,h4,h5,h6 { font-size: inherit; font-weight: inherit;}/* Reset links to optimize for opt-in styling instead of opt-out.*/a { color: inherit; -webkit-text-decoration: inherit; text-decoration: inherit;}/* Add the correct font weight in Edge and Safari.*/b,strong { font-weight: bolder;}/* 1. Use the user's configured `mono` font-family by default. 2. Use the user's configured `mono` font-feature-settings by default. 3. Use the user's configured `mono` font-variation-settings by default. 4. Correct the odd `em` font sizing in all browsers.*/code,kbd,samp,pre { font-family: var( --default-monoFont-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace ); /* 1 */ font-feature-settings: var(--default-monoFont-featureSettings, normal); /* 2 */ font-variation-settings: var(--default-monoFont-variationSettings, normal); /* 3 */ font-size: 1em; /* 4 */}/* Add the correct font size in all browsers.*/small { font-size: 80%;}/* Prevent `sub` and `sup` elements from affecting the line height in all browsers.*/sub,sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline;}sub { bottom: -0.25em;}sup { top: -0.5em;}/* 1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) 2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) 3. Remove gaps between table borders by default.*/table { text-indent: 0; /* 1 */ border-color: inherit; /* 2 */ border-collapse: collapse; /* 3 */}/* Use the modern Firefox focus style for all focusable elements.*/:-moz-focusring { outline: auto;}/* Add the correct vertical alignment in Chrome and Firefox.*/progress { vertical-align: baseline;}/* Add the correct display in Chrome and Safari.*/summary { display: list-item;}/* Make lists unstyled by default.*/ol,ul,menu { list-style: none;}/* 1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14) 2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210) This can trigger a poorly considered lint error in some tools but is included by design.*/img,svg,video,canvas,audio,iframe,embed,object { display: block; /* 1 */ vertical-align: middle; /* 2 */}/* Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)*/img,video { max-width: 100%; height: auto;}/* 1. Inherit font styles in all browsers. 2. Remove border radius in all browsers. 3. Remove background color in all browsers. 4. Ensure consistent opacity for disabled states in all browsers.*/button,input,select,optgroup,textarea,::file-selector-button { font: inherit; /* 1 */ font-feature-settings: inherit; /* 1 */ font-variation-settings: inherit; /* 1 */ letter-spacing: inherit; /* 1 */ color: inherit; /* 1 */ border-radius: 0; /* 2 */ background-color: transparent; /* 3 */ opacity: 1; /* 4 */}/* Restore default font weight.*/:where(select:is([multiple], [size])) optgroup { font-weight: bolder;}/* Restore indentation.*/:where(select:is([multiple], [size])) optgroup option { padding-inline-start: 20px;}/* Restore space after button.*/::file-selector-button { margin-inline-end: 4px;}/* Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)*/::placeholder { opacity: 1;}/* Set the default placeholder color to a semi-transparent version of the current text color in browsers that do not crash when using `color-mix(…)` with `currentcolor`. (https://github.com/tailwindlabs/tailwindcss/issues/17194)*/@supports (not (-webkit-appearance: -apple-pay-button)) /* Not Safari */ or (contain-intrinsic-size: 1px) /* Safari 17+ */ { ::placeholder { color: color-mix(in oklab, currentcolor 50%, transparent); }}/* Prevent resizing textareas horizontally by default.*/textarea { resize: vertical;}/* Remove the inner padding in Chrome and Safari on macOS.*/::-webkit-search-decoration { -webkit-appearance: none;}/* 1. Ensure date/time inputs have the same height when empty in iOS Safari. 2. Ensure text alignment can be changed on date/time inputs in iOS Safari.*/::-webkit-date-and-time-value { min-height: 1lh; /* 1 */ text-align: inherit; /* 2 */}/* Prevent height from changing on date/time inputs in macOS Safari when the input is set to `display: block`.*/::-webkit-datetime-edit { display: inline-flex;}/* Remove excess padding from pseudo-elements in date/time inputs to ensure consistent height across browsers.*/::-webkit-datetime-edit-fields-wrapper { padding: 0;}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field { padding-block: 0;}/* Center dropdown marker shown on inputs with paired `<datalist>`s in Chrome. (https://github.com/tailwindlabs/tailwindcss/issues/18499)*/::-webkit-calendar-picker-indicator { line-height: 1;}/* Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)*/:-moz-ui-invalid { box-shadow: none;}/* Correct the inability to style the border radius in iOS Safari.*/button,input:where([type='button'], [type='reset'], [type='submit']),::file-selector-button { appearance: button;}/* Correct the cursor style of increment and decrement buttons in Safari.*/::-webkit-inner-spin-button,::-webkit-outer-spin-button { height: auto;}/* Make elements with the HTML hidden attribute stay hidden by default.*/[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:0.875rem;}.lh-\[1\]{--un-leading:1;line-height:1;}.m9{margin:calc(var(--spacing) * 9);}.mx-1{margin-inline:calc(var(--spacing) * 1);}.mx-3\!{margin-inline:calc(var(--spacing) * 3) !important;}.my-1{margin-block:calc(var(--spacing) * 1);}.ml{margin-left:calc(var(--spacing) * 4);}.ml-\.5{margin-left:calc(var(--spacing) * 0.5);}.ml-1{margin-left:calc(var(--spacing) * 1);}.mr--1{margin-right:calc(var(--spacing) * -1);}.mr-1{margin-right:calc(var(--spacing) * 1);}.mr-2{margin-right:calc(var(--spacing) * 2);}.mr-2\.5{margin-right:calc(var(--spacing) * 2.5);}.p-1{padding:calc(var(--spacing) * 1);}.px,.px-4{padding-inline:calc(var(--spacing) * 4);}.px-2{padding-inline:calc(var(--spacing) * 2);}.py-1{padding-block:calc(var(--spacing) * 1);}.py-2{padding-block:calc(var(--spacing) * 2);}.pl-1{padding-left:calc(var(--spacing) * 1);}.pr-4{padding-right:calc(var(--spacing) * 4);}.ps{padding-inline-start:calc(var(--spacing) * 4);}.outline-0{outline-style:var(--un-outline-style);outline-width:0px;}.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) /* oklch(70.7% 0.165 254.624) */;}.b{border-width:1px;}.rd-2{border-radius:0.5rem;}.rd-sm{border-radius:var(--radius-sm);}.bg-\#dafaea{background-color:color-mix(in oklab, #dafaea var(--un-bg-opacity), transparent) /* #dafaea */;}.bg-\#ffe8e8{background-color:color-mix(in oklab, #ffe8e8 var(--un-bg-opacity), transparent) /* #ffe8e8 */;}.bg-\#fff{background-color:color-mix(in oklab, #fff var(--un-bg-opacity), transparent) /* #fff */;}.bg-gray\/20{background-color:color-mix(in srgb, var(--colors-gray-DEFAULT) 20%, transparent) /* oklch(70.7% 0.022 261.325) */;}.op-75{opacity:75%;}.op40{opacity:40%;}.flex{display:flex;}.flex-shrink-0{flex-shrink:0;}.flex-col{flex-direction:column;}.flex-wrap{flex-wrap:wrap;}.gap-2{gap:calc(var(--spacing) * 2);}.size-4\!{width:calc(var(--spacing) * 4) !important;height:calc(var(--spacing) * 4) !important;}.size-full{width:100%;height:100%;}.h-1\!{height:calc(var(--spacing) * 1) !important;}.h-a\!{height:auto !important;}.h-full{height:100%;}.max-h-100{max-height:calc(var(--spacing) * 100);}.min-h-40{min-height:calc(var(--spacing) * 40);}.min-h-a\!{min-height:auto !important;}.w-10px\!{width:10px !important;}.after\:h-1::after{height:calc(var(--spacing) * 1);}.after\:w-1::after{width:calc(var(--spacing) * 1);}.inline{display:inline;}.block{display:block;}.cursor-s-resize{cursor:s-resize;}.cursor-w-resize{cursor:w-resize;}.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:calc(var(--spacing) * 0);}.left-0{left:calc(var(--spacing) * 0);}.right-0{right:calc(var(--spacing) * 0);}.top-0{top:calc(var(--spacing) * 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) /* oklch(70.7% 0.165 254.624) */;}.bg-gray\/20{background-color:color-mix(in oklab, var(--colors-gray-DEFAULT) 20%, transparent) /* oklch(70.7% 0.022 261.325) */;}}
2
2
  @charset "UTF-8";
3
3
  :root {
4
4
  --c-primary: #51a2ff;
@@ -153,7 +153,7 @@ input[type=checkbox].you-checkbox.checked::after {
153
153
  }
154
154
 
155
155
  .in-cell__resize-handle {
156
- width:100%;height:100%;
156
+ width:100%;height:100%;position:absolute;
157
157
  }.in-cell__resize-handle:hover::after{background-color:color-mix(in oklab, var(--c-primary) 40%, transparent) /* var(--c-primary) */;}@property --un-bg-opacity{syntax:"<percentage>";inherits:false;initial-value:100%;syntax:"<percentage>";inherits:false;initial-value:100%;}.in-cell__resize-handle:active::after{background-color:color-mix(in oklab, var(--c-primary) var(--un-bg-opacity), transparent) /* var(--c-primary) */;}
158
158
  .in-cell__resize-handle::after {
159
159
  --un-content:'';content:var(--un-content);
@@ -182,4 +182,12 @@ input[type=checkbox].you-checkbox.checked::after {
182
182
  }@property --un-border-opacity{syntax:"<percentage>";inherits:false;initial-value:100%;}@supports (color: color-mix(in lab, red, red)){.tt-menu-x{border-color:color-mix(in oklab, var(--colors-gray-DEFAULT) 30%, transparent) /* oklch(70.7% 0.022 261.325) */;}}@property --un-bg-opacity{syntax:"<percentage>";inherits:false;initial-value:100%;}@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:0px;}@property --un-ring-offset-color{syntax:"*";inherits:false;}@property --un-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000;}.tt-menu-x{:where(&>:not(:last-child)){--un-space-x-reverse:0;margin-inline-start: calc(calc(var(--spacing) * 0.5) * var(--un-space-x-reverse));margin-inline-end: calc(calc(var(--spacing) * 0.5) * calc(1 - var(--un-space-x-reverse)));}}@property --un-space-x-reverse{syntax:"*";inherits:false;initial-value:0;}
183
183
  .tt-menu-x > .hr {
184
184
  margin-block:calc(var(--spacing) * 1.5);background-color:color-mix(in srgb, var(--colors-gray-DEFAULT) 30%, transparent) /* oklch(70.7% 0.022 261.325) */;width:1px;
185
- }@property --un-bg-opacity{syntax:"<percentage>";inherits:false;initial-value:100%;}@supports (color: color-mix(in lab, red, red)){.tt-menu-x > .hr{background-color:color-mix(in oklab, var(--colors-gray-DEFAULT) 30%, transparent) /* oklch(70.7% 0.022 261.325) */;}}
185
+ }@property --un-bg-opacity{syntax:"<percentage>";inherits:false;initial-value:100%;}@supports (color: color-mix(in lab, red, red)){.tt-menu-x > .hr{background-color:color-mix(in oklab, var(--colors-gray-DEFAULT) 30%, transparent) /* oklch(70.7% 0.022 261.325) */;}}
186
+
187
+ .col__guide-line, .row__guide-line {
188
+ background-color:color-mix(in oklab, var(--c-primary) var(--un-bg-opacity), transparent) /* var(--c-primary) */;pointer-events:none;top:calc(var(--spacing) * 0);left:calc(var(--spacing) * 0);position:fixed;z-index:9;
189
+ }@property --un-bg-opacity{syntax:"<percentage>";inherits:false;initial-value:100%;}
190
+
191
+ th[draggable=true], td[draggable=true] {
192
+ cursor:move;
193
+ }
package/dist/utils.d.ts CHANGED
@@ -16,6 +16,7 @@ export declare const log: (...args: any[]) => any;
16
16
  export declare const parseStyle: (s: any) => any;
17
17
  export declare function findret<T, R>(arr: readonly T[], cb: (e: T, i: number) => R): R | undefined;
18
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>;
19
20
  type Fnable<T> = T | (() => T);
20
21
  type Awatable<T> = T | Promise<T>;
21
22
  type BaseType = string | number | boolean | null;
package/dist/utils.js CHANGED
@@ -60,6 +60,9 @@ function emptyObject(o) {
60
60
  for (const k of Object.keys(o)) delete o[k];
61
61
  return o;
62
62
  }
63
+ async function findAsync(arr, cb) {
64
+ for (let i = 0; i < arr.length; i++) if (await cb(arr[i], i)) return arr[i];
65
+ }
63
66
  var cache = /* @__PURE__ */ new WeakMap();
64
67
  function resolveOptions(opts) {
65
68
  let ret = opts;
@@ -85,4 +88,4 @@ function resolveOpt(opt) {
85
88
  value: opt
86
89
  };
87
90
  }
88
- export { chooseFile, chooseImage, emptyObject, file2base64, findret, getStyles, log, mergeRect, parseStyle, print, resolveOptions, unFn };
91
+ export { chooseFile, chooseImage, emptyObject, file2base64, findAsync, findret, getStyles, log, mergeRect, parseStyle, print, resolveOptions, unFn };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intable",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "files": [
@@ -46,4 +46,4 @@
46
46
  "devDependencies": {
47
47
  "diff": "^8.0.2"
48
48
  }
49
- }
49
+ }