intable 0.0.27 → 0.0.29

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/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-leading:initial;--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%}}@property --un-text-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@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-border-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@property --un-bg-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@property --un-inset-ring-color{syntax:"*";inherits:false}@property --un-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@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-inset{syntax:"*";inherits:false}@property --un-ring-offset-color{syntax:"*";inherits:false}@property --un-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --un-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-shadow-color{syntax:"*";inherits:false}@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}@property --un-space-y-reverse{syntax:"*";inherits:false;initial-value:0}:root,:host{--spacing:.25rem;--radius-DEFAULT:.25rem;--colors-gray-DEFAULT:#99a1af;--text-sm-fontSize:.875rem;--text-sm-lineHeight:1.25rem;--radius-md:.375rem;--default-transition-timingFunction:cubic-bezier(.4,0,.2,1);--default-transition-duration:.15s;--radius-xl:.75rem;--fontWeight-medium:500;--radius-sm:.25rem;--colors-blue-DEFAULT:#54a2ff;--colors-red-DEFAULT:#ff6568;--text-2xl-fontSize:1.5rem;--text-2xl-lineHeight:2rem;--text-xs-fontSize:.75rem;--text-xs-lineHeight:1rem;--colors-green-DEFAULT:#05df72;--colors-black:#000;--font-sans:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--default-font-family:var(--font-sans);--default-monoFont-family:var(--font-mono)}@supports (color:lab(0% 0 0)){:root,:host{--colors-gray-DEFAULT:lab(65.9269% -.832677 -8.17474);--colors-blue-DEFAULT:lab(65.0361% -1.42065 -56.9802);--colors-red-DEFAULT:lab(63.7053% 60.745 31.3109);--colors-green-DEFAULT:lab(78.503% -64.9264 39.7492)}}*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-featureSettings,normal);font-variation-settings:var(--default-font-variationSettings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-monoFont-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-monoFont-featureSettings,normal);font-variation-settings:var(--default-monoFont-variationSettings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden~=until-found])){display:none!important}.container{width:100%}.aic{align-items:center}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.text-2xl{font-size:var(--text-2xl-fontSize);line-height:var(--un-leading,var(--text-2xl-lineHeight))}.text-3{font-size:.75rem}.text-3\.5{font-size:.875rem}.text-4{font-size:1rem}.text-xs{font-size:var(--text-xs-fontSize);line-height:var(--un-leading,var(--text-xs-lineHeight))}.c-\#1e3a8a{color:color-mix(in oklab,#1e3a8a var(--un-text-opacity),transparent)}.c-\#7c2d12{color:color-mix(in oklab,#7c2d12 var(--un-text-opacity),transparent)}.c-blue{color:color-mix(in srgb,var(--colors-blue-DEFAULT)var(--un-text-opacity),transparent)}.c-gray\/70{color:color-mix(in srgb,var(--colors-gray-DEFAULT)70%,transparent)}.c-red\/75{color:color-mix(in srgb,var(--colors-red-DEFAULT)75%,transparent)}.leading-5{--un-leading:calc(4px*5);line-height:20px}.lh-\[1\]{--un-leading:1;line-height:1}.font-medium{--un-font-weight:var(--fontWeight-medium);font-weight:var(--fontWeight-medium)}.m9{margin:36px}.mx-1{margin-inline:4px}.mx-3\!{margin-inline:12px!important}.my-1{margin-block:4px}.ml{margin-left:16px}.ml-\.5{margin-left:2px}.ml-1{margin-left:4px}.mr--1{margin-right:-4px}.mr-1{margin-right:4px}.mr-2{margin-right:8px}.mr-2\.5{margin-right:10px}.mt-1{margin-top:4px}.p-1{padding:4px}.p-4\!{padding:16px!important}.px,.px-4{padding-inline:16px}.px-1\.5{padding-inline:6px}.px-2{padding-inline:8px}.py-1{padding-block:4px}.py-1\.5{padding-block:6px}.py-2{padding-block:8px}.pl-1{padding-left:4px}.pl-4{padding-left:16px}.pr-4{padding-right:16px}.ps{padding-inline-start:16px}.outline-0{outline-style:var(--un-outline-style);outline-width:0}.outline-2{outline-style:var(--un-outline-style);outline-width:2px}.outline-blue{outline-color:color-mix(in srgb,var(--colors-blue-DEFAULT)var(--un-outline-opacity),transparent)}.outline-none{--un-outline-style:none;outline-style:none}.b,.b-1,.border{border-width:1px}.b-r-0{border-right-width:0}.b-\#00000000\!{border-color:color-mix(in oklab,#0000 var(--un-border-opacity),transparent)!important}.b-\#4f7ff0{border-color:color-mix(in oklab,#4f7ff0 var(--un-border-opacity),transparent)}.b-\#f59e0b{border-color:color-mix(in oklab,#f59e0b var(--un-border-opacity),transparent)}.rd-2{border-radius:.5rem}.rd-sm{border-radius:var(--radius-sm)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rd-l-4{border-top-left-radius:1rem;border-bottom-left-radius:1rem}.b-dashed{--un-border-style:dashed;border-style:dashed}.b-solid{--un-border-style:solid;border-style:solid}.bg-\#dbe6ff\/75{background-color:#dbe6ffbf;background-color:lab(91.0303% -.143617 -13.4803/.75)}.bg-\#fff{background-color:color-mix(in oklab,#fff var(--un-bg-opacity),transparent)}.bg-\#fff3d6\/85{background-color:#fff3d6d9;background-color:lab(96.236% .744313 15.5662/.85)}.bg-blue\/20\!{background-color:color-mix(in srgb,var(--colors-blue-DEFAULT)20%,transparent)!important}.bg-gray\/20{background-color:color-mix(in srgb,var(--colors-gray-DEFAULT)20%,transparent)}.bg-green\!{background-color:color-mix(in srgb,var(--colors-green-DEFAULT)var(--un-bg-opacity),transparent)!important}.bg-red\!{background-color:color-mix(in srgb,var(--colors-red-DEFAULT)var(--un-bg-opacity),transparent)!important}.bg-transparent{background-color:#0000}.hover\:bg-black\/8:hover{background-color:color-mix(in srgb,var(--colors-black)8%,transparent)}.op-0{opacity:0}.op-15{opacity:.15}.op-60{opacity:.6}.op-75{opacity:.75}.op40{opacity:.4}.group:hover .group-hover\:op-100{opacity:1}.flex{display:flex}.flex-1{flex:1}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.gap-1{gap:4px}.gap-1\.5{gap:6px}.gap-2{gap:8px}.grid{display:grid}.size-3\.5{width:14px;height:14px}.size-4\!{width:16px!important;height:16px!important}.size-full{width:100%;height:100%}.h-1\!{height:4px!important}.h-6{height:24px}.h-a\!{height:auto!important}.h-full{height:100%}.max-h-100{max-height:400px}.min-h-16{min-height:64px}.min-h-40{min-height:160px}.min-h-a\!{min-height:auto!important}.min-w-24{min-width:96px}.min-w-52{min-width:208px}.w-10{width:40px}.w-10px\!{width:10px!important}.w-a\!{width:auto!important}.after\:h-1:after{height:4px}.after\:w-1:after{width:4px}.inline{display:inline}.block{display:block}.inline-block{display:inline-block}.contents{display:contents}.hidden{display:none}.visible{visibility:visible}.collapse{visibility:collapse}.cursor-s-resize{cursor:s-resize}.cursor-w-resize{cursor:w-resize}.pointer-events-none{pointer-events:none}.resize{resize:both}.resize-none{resize:none}.select-none{-webkit-user-select:none;user-select:none}.shadow-sm{--un-shadow:0 1px 3px 0 var(--un-shadow-color,#0000001a),0 1px 2px -1px var(--un-shadow-color,#0000001a);box-shadow:var(--un-inset-shadow),var(--un-inset-ring-shadow),var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.translate-x--1\/2{--un-translate-x:-50%;translate:var(--un-translate-x)var(--un-translate-y)}.translate-x-1\/2{--un-translate-x:50%;translate:var(--un-translate-x)var(--un-translate-y)}.translate-y--1\/2{--un-translate-y:-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)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,--un-gradient-from,--un-gradient-via,--un-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter;transition-timing-function:var(--un-ease,var(--default-transition-timingFunction));transition-duration:var(--un-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--un-ease,var(--default-transition-timingFunction));transition-duration:var(--un-duration,var(--default-transition-duration))}.items-start{align-items:flex-start}.items-center{align-items:center}.box-border{box-sizing:border-box}.inset-0{inset:0}.bottom-0{bottom:0}.left--0,.left-0{left:0}.right-0{right:0}.top-0{top:0}.top-1\/2{top:50%}.justify-end\!{justify-content:flex-end!important}.justify-center{justify-content:center}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.z--1{z-index:-1}.z-1{z-index:1}.z-2{z-index:2}.z-9{z-index:9}.overflow-auto{overflow:auto}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin{animation:1s linear infinite spin}.filter{filter:var(--un-blur,)var(--un-brightness,)var(--un-contrast,)var(--un-grayscale,)var(--un-hue-rotate,)var(--un-invert,)var(--un-saturate,)var(--un-sepia,)var(--un-drop-shadow,)}.table{display:table}.table-cell{display:table-cell}:where(.space-y-5>:not(:last-child)){--un-space-y-reverse:0;margin-block-start:calc(calc(4px*5)*var(--un-space-y-reverse));margin-block-end:calc(calc(4px*5)*calc(1 - var(--un-space-y-reverse)))}@supports (color:color-mix(in lab, red, red)){.c-blue{color:color-mix(in oklab,var(--colors-blue-DEFAULT)var(--un-text-opacity),transparent)}.c-gray\/70{color:color-mix(in oklab,var(--colors-gray-DEFAULT)70%,transparent)}.c-red\/75{color:color-mix(in oklab,var(--colors-red-DEFAULT)75%,transparent)}.outline-blue{outline-color:color-mix(in oklab,var(--colors-blue-DEFAULT)var(--un-outline-opacity),transparent)}.bg-blue\/20\!{background-color:color-mix(in oklab,var(--colors-blue-DEFAULT)20%,transparent)!important}.bg-gray\/20{background-color:color-mix(in oklab,var(--colors-gray-DEFAULT)20%,transparent)}.bg-green\!{background-color:color-mix(in oklab,var(--colors-green-DEFAULT)var(--un-bg-opacity),transparent)!important}.bg-red\!{background-color:color-mix(in oklab,var(--colors-red-DEFAULT)var(--un-bg-opacity),transparent)!important}.hover\:bg-black\/8:hover{background-color:color-mix(in oklab,var(--colors-black)8%,transparent)}}
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-leading:initial;--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%}}@property --un-text-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@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-border-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@property --un-bg-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@property --un-inset-ring-color{syntax:"*";inherits:false}@property --un-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@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-inset{syntax:"*";inherits:false}@property --un-ring-offset-color{syntax:"*";inherits:false}@property --un-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --un-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --un-shadow-color{syntax:"*";inherits:false}@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}@property --un-space-y-reverse{syntax:"*";inherits:false;initial-value:0}:root,:host{--spacing:.25rem;--radius-DEFAULT:.25rem;--colors-gray-DEFAULT:#99a1af;--text-sm-fontSize:.875rem;--text-sm-lineHeight:1.25rem;--default-transition-timingFunction:cubic-bezier(.4,0,.2,1);--default-transition-duration:.15s;--radius-md:.375rem;--radius-xl:.75rem;--fontWeight-medium:500;--radius-sm:.25rem;--colors-blue-DEFAULT:#54a2ff;--colors-red-DEFAULT:#ff6568;--text-2xl-fontSize:1.5rem;--text-2xl-lineHeight:2rem;--text-xs-fontSize:.75rem;--text-xs-lineHeight:1rem;--colors-green-DEFAULT:#05df72;--colors-black:#000;--font-sans:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--default-font-family:var(--font-sans);--default-monoFont-family:var(--font-mono)}@supports (color:lab(0% 0 0)){:root,:host{--colors-gray-DEFAULT:lab(65.9269% -.832677 -8.17474);--colors-blue-DEFAULT:lab(65.0361% -1.42065 -56.9802);--colors-red-DEFAULT:lab(63.7053% 60.745 31.3109);--colors-green-DEFAULT:lab(78.503% -64.9264 39.7492)}}*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-featureSettings,normal);font-variation-settings:var(--default-font-variationSettings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-monoFont-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-monoFont-featureSettings,normal);font-variation-settings:var(--default-monoFont-variationSettings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden~=until-found])){display:none!important}.container{width:100%}.aic{align-items:center}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.text-2xl{font-size:var(--text-2xl-fontSize);line-height:var(--un-leading,var(--text-2xl-lineHeight))}.text-3{font-size:.75rem}.text-3\.5{font-size:.875rem}.text-4{font-size:1rem}.text-xs{font-size:var(--text-xs-fontSize);line-height:var(--un-leading,var(--text-xs-lineHeight))}.c-\#1e3a8a{color:color-mix(in oklab,#1e3a8a var(--un-text-opacity),transparent)}.c-\#7c2d12{color:color-mix(in oklab,#7c2d12 var(--un-text-opacity),transparent)}.c-blue{color:color-mix(in srgb,var(--colors-blue-DEFAULT)var(--un-text-opacity),transparent)}.c-gray\/70{color:color-mix(in srgb,var(--colors-gray-DEFAULT)70%,transparent)}.c-red\/75{color:color-mix(in srgb,var(--colors-red-DEFAULT)75%,transparent)}.leading-5{--un-leading:calc(4px*5);line-height:20px}.lh-\[1\]{--un-leading:1;line-height:1}.font-medium{--un-font-weight:var(--fontWeight-medium);font-weight:var(--fontWeight-medium)}.m9{margin:36px}.mx-1{margin-inline:4px}.mx-3\!{margin-inline:12px!important}.my-1{margin-block:4px}.ml{margin-left:16px}.ml-\.5{margin-left:2px}.ml-1{margin-left:4px}.mr--1{margin-right:-4px}.mr-1{margin-right:4px}.mr-2{margin-right:8px}.mr-2\.5{margin-right:10px}.mt-1{margin-top:4px}.p-1{padding:4px}.p-4\!{padding:16px!important}.px,.px-4{padding-inline:16px}.px-1\.5{padding-inline:6px}.px-2{padding-inline:8px}.py-1{padding-block:4px}.py-1\.5{padding-block:6px}.py-2{padding-block:8px}.pl-1{padding-left:4px}.pl-4{padding-left:16px}.pr-4{padding-right:16px}.ps{padding-inline-start:16px}.outline-0{outline-style:var(--un-outline-style);outline-width:0}.outline-2{outline-style:var(--un-outline-style);outline-width:2px}.outline-blue{outline-color:color-mix(in srgb,var(--colors-blue-DEFAULT)var(--un-outline-opacity),transparent)}.outline-none{--un-outline-style:none;outline-style:none}.b,.b-1,.border{border-width:1px}.b-r-0{border-right-width:0}.b-\#00000000\!{border-color:color-mix(in oklab,#0000 var(--un-border-opacity),transparent)!important}.b-\#4f7ff0{border-color:color-mix(in oklab,#4f7ff0 var(--un-border-opacity),transparent)}.b-\#f59e0b{border-color:color-mix(in oklab,#f59e0b var(--un-border-opacity),transparent)}.rd-2{border-radius:.5rem}.rd-sm{border-radius:var(--radius-sm)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rd-l-4{border-top-left-radius:1rem;border-bottom-left-radius:1rem}.b-dashed{--un-border-style:dashed;border-style:dashed}.b-solid{--un-border-style:solid;border-style:solid}.bg-\#dbe6ff\/75{background-color:#dbe6ffbf;background-color:lab(91.0303% -.143617 -13.4803/.75)}.bg-\#fff{background-color:color-mix(in oklab,#fff var(--un-bg-opacity),transparent)}.bg-\#fff3d6\/85{background-color:#fff3d6d9;background-color:lab(96.236% .744313 15.5662/.85)}.bg-blue\/20\!{background-color:color-mix(in srgb,var(--colors-blue-DEFAULT)20%,transparent)!important}.bg-gray\/20{background-color:color-mix(in srgb,var(--colors-gray-DEFAULT)20%,transparent)}.bg-green\!{background-color:color-mix(in srgb,var(--colors-green-DEFAULT)var(--un-bg-opacity),transparent)!important}.bg-red\!{background-color:color-mix(in srgb,var(--colors-red-DEFAULT)var(--un-bg-opacity),transparent)!important}.bg-transparent{background-color:#0000}.hover\:bg-black\/8:hover{background-color:color-mix(in srgb,var(--colors-black)8%,transparent)}.op-0{opacity:0}.op-15{opacity:.15}.op-60{opacity:.6}.op-75{opacity:.75}.op40{opacity:.4}.group:hover .group-hover\:op-100{opacity:1}.flex{display:flex}.flex-1{flex:1}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.gap-1{gap:4px}.gap-1\.5{gap:6px}.gap-2{gap:8px}.grid{display:grid}.size-3\.5{width:14px;height:14px}.size-4\!{width:16px!important;height:16px!important}.size-full{width:100%;height:100%}.h-1\!{height:4px!important}.h-6{height:24px}.h-a\!{height:auto!important}.h-full{height:100%}.max-h-100{max-height:400px}.max-h-inherit{max-height:inherit}.min-h-16{min-height:64px}.min-h-40{min-height:160px}.min-h-a\!{min-height:auto!important}.min-w-24{min-width:96px}.min-w-52{min-width:208px}.w-10{width:40px}.w-10px\!{width:10px!important}.w-a\!{width:auto!important}.after\:h-1:after{height:4px}.after\:w-1:after{width:4px}.inline{display:inline}.block{display:block}.inline-block{display:inline-block}.contents{display:contents}.hidden{display:none}.visible{visibility:visible}.collapse{visibility:collapse}.cursor-s-resize{cursor:s-resize}.cursor-w-resize{cursor:w-resize}.pointer-events-none{pointer-events:none}.resize{resize:both}.resize-none{resize:none}.select-none{-webkit-user-select:none;user-select:none}.shadow-sm{--un-shadow:0 1px 3px 0 var(--un-shadow-color,#0000001a),0 1px 2px -1px var(--un-shadow-color,#0000001a);box-shadow:var(--un-inset-shadow),var(--un-inset-ring-shadow),var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.translate-x--1\/2{--un-translate-x:-50%;translate:var(--un-translate-x)var(--un-translate-y)}.translate-x-1\/2{--un-translate-x:50%;translate:var(--un-translate-x)var(--un-translate-y)}.translate-y--1\/2{--un-translate-y:-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)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,--un-gradient-from,--un-gradient-via,--un-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter;transition-timing-function:var(--un-ease,var(--default-transition-timingFunction));transition-duration:var(--un-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--un-ease,var(--default-transition-timingFunction));transition-duration:var(--un-duration,var(--default-transition-duration))}.items-start{align-items:flex-start}.items-center{align-items:center}.box-border{box-sizing:border-box}.inset-0{inset:0}.bottom-0{bottom:0}.left--0,.left-0{left:0}.right-0{right:0}.top-0{top:0}.top-1\/2{top:50%}.justify-end\!{justify-content:flex-end!important}.justify-center{justify-content:center}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.z--1{z-index:-1}.z-1{z-index:1}.z-2{z-index:2}.z-9{z-index:9}.overflow-auto{overflow:auto}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin{animation:1s linear infinite spin}.filter{filter:var(--un-blur,)var(--un-brightness,)var(--un-contrast,)var(--un-grayscale,)var(--un-hue-rotate,)var(--un-invert,)var(--un-saturate,)var(--un-sepia,)var(--un-drop-shadow,)}.table{display:table}.table-cell{display:table-cell}:where(.space-y-5>:not(:last-child)){--un-space-y-reverse:0;margin-block-start:calc(calc(4px*5)*var(--un-space-y-reverse));margin-block-end:calc(calc(4px*5)*calc(1 - var(--un-space-y-reverse)))}@supports (color:color-mix(in lab, red, red)){.c-blue{color:color-mix(in oklab,var(--colors-blue-DEFAULT)var(--un-text-opacity),transparent)}.c-gray\/70{color:color-mix(in oklab,var(--colors-gray-DEFAULT)70%,transparent)}.c-red\/75{color:color-mix(in oklab,var(--colors-red-DEFAULT)75%,transparent)}.outline-blue{outline-color:color-mix(in oklab,var(--colors-blue-DEFAULT)var(--un-outline-opacity),transparent)}.bg-blue\/20\!{background-color:color-mix(in oklab,var(--colors-blue-DEFAULT)20%,transparent)!important}.bg-gray\/20{background-color:color-mix(in oklab,var(--colors-gray-DEFAULT)20%,transparent)}.bg-green\!{background-color:color-mix(in oklab,var(--colors-green-DEFAULT)var(--un-bg-opacity),transparent)!important}.bg-red\!{background-color:color-mix(in oklab,var(--colors-red-DEFAULT)var(--un-bg-opacity),transparent)!important}.hover\:bg-black\/8:hover{background-color:color-mix(in oklab,var(--colors-black)8%,transparent)}}
@@ -4,6 +4,8 @@ interface VirtualizerOptions {
4
4
  batch?: number;
5
5
  getScrollElement: () => Element;
6
6
  horizontal?: boolean;
7
+ paddingStart?: number;
8
+ paddingEnd?: number;
7
9
  count: number;
8
10
  estimateSize: (i: number) => number;
9
11
  extras?: (startIdx: number, endIdx: number) => number[];
@@ -26,5 +28,6 @@ export declare function useVirtualizer(opt: VirtualizerOptions): {
26
28
  end: number;
27
29
  index: number;
28
30
  };
31
+ scrollToIndex: (i: number, center?: boolean) => void;
29
32
  };
30
33
  export {};
@@ -66,7 +66,7 @@ function useVirtualizer(d) {
66
66
  if (v(), !d.enable) return Array.from({ length: d.count }, (e, s) => S(s));
67
67
  let e = [];
68
68
  for (let s = C(); s <= w(); s++) e.push(S(s));
69
- return d.extras && (e.push(...d.extras(C(), w())?.map((e) => S(e)) || []), e = uniqBy(e, (e) => e.index)), e;
69
+ return d.extras && (e.push(...d.extras(C(), w())?.map((e) => S(e)) || []), e = uniqBy(e, (e) => e.index), e.sort((e, s) => e.index - s.index)), e;
70
70
  });
71
71
  return {
72
72
  options: d,
@@ -87,7 +87,17 @@ function useVirtualizer(d) {
87
87
  getVirtualItem: (() => {
88
88
  let e = createMemo(() => keyBy(T(), (e) => e.index));
89
89
  return (s) => e()[s];
90
- })()
90
+ })(),
91
+ scrollToIndex: (e, s) => {
92
+ let c = d.getScrollElement(), l = _.sum(e - 1);
93
+ d.horizontal ? c.scrollTo({
94
+ left: l + (s ? -c.offsetWidth / 2 : 0),
95
+ behavior: "instant"
96
+ }) : c.scrollTo({
97
+ top: l + (s ? -c.offsetHeight / 2 : 0),
98
+ behavior: "instant"
99
+ });
100
+ }
91
101
  };
92
102
  }
93
103
  export { useVirtualizer };
package/dist/index.d.ts CHANGED
@@ -70,7 +70,7 @@ export interface TableProps {
70
70
  Table?: Component<any>;
71
71
  Thead?: Component<any>;
72
72
  Tbody?: Component<any>;
73
- Td?: TD;
73
+ Td?: Component<TDProps>;
74
74
  Th?: Component<THProps>;
75
75
  Tr?: Component<{
76
76
  y?: number;
@@ -112,11 +112,11 @@ export type TDProps = {
112
112
  y: number;
113
113
  data: any;
114
114
  col: TableColumn;
115
+ value?: any;
115
116
  children?: JSX.Element;
116
117
  rowspan?: number;
117
118
  colspan?: number;
118
119
  };
119
- export type TD = Component<TDProps>;
120
120
  type Obj = Record<string | symbol, any>;
121
121
  export interface TableColumn extends Obj {
122
122
  id: any;
@@ -125,7 +125,6 @@ export interface TableColumn extends Obj {
125
125
  fixed?: 'left' | 'right';
126
126
  class?: any;
127
127
  style?: any;
128
- props?: (props: any) => JSX.HTMLAttributes<any>;
129
128
  }
130
129
  type Nullable<T> = T | undefined;
131
130
  export interface TableStore extends Obj {
package/dist/index.js CHANGED
@@ -26,7 +26,7 @@ import { createLazyMemo } from "@solid-primitives/memo";
26
26
  import { createElementSize, createResizeObserver, makeResizeObserver } from "@solid-primitives/resize-observer";
27
27
  import { createScrollPosition } from "@solid-primitives/scroll";
28
28
  import { difference, isEqual, memoize, sumBy } from "es-toolkit";
29
- var _tmpl$ = /* @__PURE__ */ template("<div>"), _tmpl$2 = /* @__PURE__ */ template("<table>"), _tmpl$3 = /* @__PURE__ */ template("<thead>"), _tmpl$4 = /* @__PURE__ */ template("<tbody>"), _tmpl$5 = /* @__PURE__ */ template("<tr>"), _tmpl$6 = /* @__PURE__ */ template("<th>"), _tmpl$7 = /* @__PURE__ */ template("<td>"), _tmpl$8 = /* @__PURE__ */ template("<div class=data-table__layers>"), _tmpl$9 = /* @__PURE__ */ template("<div class=\"data-table--scroll-view h-full\">"), _tmpl$0 = /* @__PURE__ */ template("<div class=data-table__empty>No data"), _tmpl$1 = /* @__PURE__ */ template("<div class=data-table__loading>");
29
+ var _tmpl$ = /* @__PURE__ */ template("<div>"), _tmpl$2 = /* @__PURE__ */ template("<table>"), _tmpl$3 = /* @__PURE__ */ template("<thead>"), _tmpl$4 = /* @__PURE__ */ template("<tbody>"), _tmpl$5 = /* @__PURE__ */ template("<tr>"), _tmpl$6 = /* @__PURE__ */ template("<th>"), _tmpl$7 = /* @__PURE__ */ template("<td>"), _tmpl$8 = /* @__PURE__ */ template("<div class=data-table__layers>"), _tmpl$9 = /* @__PURE__ */ template("<div class=\"data-table--scroll-view h-full max-h-inherit\">"), _tmpl$0 = /* @__PURE__ */ template("<div class=data-table__empty>No data"), _tmpl$1 = /* @__PURE__ */ template("<div class=data-table__loading>");
30
30
  const Ctx = createContext({
31
31
  props: {},
32
32
  store: {}
@@ -34,7 +34,7 @@ const Ctx = createContext({
34
34
  K = mergeProps$1({ rowKey: "id" }, K);
35
35
  let q = getOwner(), J = createMutable({
36
36
  get rawProps() {
37
- return K;
37
+ return K[$PROXY] ||= K;
38
38
  },
39
39
  get plugins() {
40
40
  return X();
@@ -132,7 +132,7 @@ var THead = () => {
132
132
  get data() {
133
133
  return K();
134
134
  },
135
- get children() {
135
+ get value() {
136
136
  return K()[J().id];
137
137
  }
138
138
  })
@@ -1,6 +1,5 @@
1
- import { createComponent } from "solid-js/web";
1
+ import { createComponent, mergeProps } from "solid-js/web";
2
2
  import { Show, createMemo } from "solid-js";
3
- import { combineProps } from "@solid-primitives/props";
4
3
  function buildMergeMap(e, t, n) {
5
4
  let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
6
5
  for (let a = 0; a < e.length; a++) for (let o = 0; o < t.length; o++) {
@@ -27,28 +26,28 @@ function buildMergeMap(e, t, n) {
27
26
  const CellMergePlugin = {
28
27
  name: "cell-merge",
29
28
  rewriteProps: {
30
- Table: ({ Table: t }, { store: r }) => (a) => (r._mergeMap ??= createMemo(() => {
31
- let { merge: e, data: t, columns: n } = r.props;
32
- return !e && !n?.some((e) => e.mergeRow) || !t?.length || !n?.length ? {
29
+ Table: ({ Table: t }, { store: n }) => (a) => (n._mergeMap ??= createMemo(() => {
30
+ let { merge: e, data: t, columns: r } = n.props;
31
+ return !e && !r?.some((e) => e.mergeRow) || !t?.length || !r?.length ? {
33
32
  spans: /* @__PURE__ */ new Map(),
34
33
  covered: /* @__PURE__ */ new Set()
35
- } : buildMergeMap(t, n, e);
34
+ } : buildMergeMap(t, r, e);
36
35
  }), createComponent(t, a)),
37
- Td: ({ Td: n }, { store: i }) => (a) => {
36
+ Td: ({ Td: r }, { store: i }) => (a) => {
38
37
  let o = () => `${a.y},${a.x}`, s = () => i._mergeMap?.().covered.has(o()) ?? !1, c = () => i._mergeMap?.().spans.get(o());
39
- return a = combineProps(a, {
40
- get rowspan() {
41
- return c()?.rowspan;
42
- },
43
- get colspan() {
44
- return c()?.colspan;
45
- }
46
- }), createComponent(Show, {
38
+ return createComponent(Show, {
47
39
  get when() {
48
40
  return !s();
49
41
  },
50
42
  get children() {
51
- return createComponent(n, a);
43
+ return createComponent(r, mergeProps(a, {
44
+ get rowspan() {
45
+ return c()?.rowspan;
46
+ },
47
+ get colspan() {
48
+ return c()?.colspan;
49
+ }
50
+ }));
52
51
  }
53
52
  });
54
53
  },
@@ -1,8 +1,10 @@
1
1
  import { usePointerDrag } from "../hooks/index.js";
2
+ import { unFn } from "../utils.js";
2
3
  import { createComponent, memo, mergeProps, template } from "solid-js/web";
3
4
  import { batch, createMemo } from "solid-js";
4
5
  import { combineProps } from "@solid-primitives/props";
5
- var _tmpl$ = /* @__PURE__ */ template("<div class=area>"), inrange = (e, i, a) => e <= a && e >= i;
6
+ import { createLazyMemo } from "@solid-primitives/memo";
7
+ var _tmpl$ = /* @__PURE__ */ template("<div class=area>"), inrange = (e, a, o) => e <= o && e >= a;
6
8
  const CellSelectionPlugin = {
7
9
  name: "cell-selection",
8
10
  store: (e) => ({
@@ -10,104 +12,130 @@ const CellSelectionPlugin = {
10
12
  start: [],
11
13
  end: []
12
14
  },
13
- cellSelectionRect: () => {
14
- let { start: i, end: a } = e.selected, o = [i[0], a[0]].sort((e, i) => e - i), s = [i[1], a[1]].sort((e, i) => e - i);
15
+ cellSelectionRect: createLazyMemo(() => {
16
+ let { start: a, end: o } = e.selected, s = [a[0], o[0]].sort((e, a) => e - a), c = [a[1], o[1]].sort((e, a) => e - a);
15
17
  return {
16
- xs: o,
17
- ys: s
18
+ xs: s,
19
+ ys: c
18
20
  };
19
- }
21
+ })
20
22
  }),
21
23
  commands: (e) => ({ getAreaRows() {
22
- let { start: i, end: a } = e.selected, [o, s] = [i[1], a[1]].sort((e, i) => e - i);
23
- return e.props.data.slice(o, s + 1);
24
+ let { start: a, end: o } = e.selected, [s, c] = [a[1], o[1]].sort((e, a) => e - a);
25
+ return e.props.data.slice(s, c + 1);
24
26
  } }),
25
27
  rewriteProps: {
26
- Table: ({ Table: a }, { store: o }) => (s) => (usePointerDrag(() => o.table, {
28
+ Table: ({ Table: a }, { store: s }) => (c) => (usePointerDrag(() => s.table, {
27
29
  preventDefault: !1,
28
- start(e, i, a) {
30
+ start(e, a, o) {
29
31
  batch(() => {
30
- let a = (e) => e.composedPath().find((e) => e.tagName == "TH" || e.tagName == "TD"), s = (e) => [e.getAttribute("x"), e.getAttribute("y")], c = a(e);
31
- if (c && !(e.buttons != 1 && c.classList.contains("range-selected"))) {
32
- if (c.tagName == "TH") {
33
- let [e, l] = s(c);
32
+ let o = (e) => e.composedPath().find((e) => e.tagName == "TH" || e.tagName == "TD"), c = (e) => [e.getAttribute("x"), e.getAttribute("y")], l = o(e);
33
+ if (l && !(e.buttons != 1 && l.classList.contains("range-selected"))) {
34
+ if (l.tagName == "TH") {
35
+ let [e, u] = c(l);
34
36
  if (e == null) return;
35
- o.selected.start = [+e, 0], o.selected.end = [+e, Infinity], i((e) => {
36
- let i = a(e);
37
- if (!i) return;
38
- let [c, l] = s(i);
39
- c != null && (o.selected.end = [+c, Infinity]);
37
+ s.selected.start = [+e, 0], s.selected.end = [+e, Infinity], a((e) => {
38
+ let a = o(e);
39
+ if (!a) return;
40
+ let [l, u] = c(a);
41
+ l != null && (s.selected.end = [+l, Infinity]);
40
42
  });
41
43
  }
42
- if (c.classList.contains("index")) {
43
- let [e, l] = s(c);
44
- if (e == null || l == null) return;
45
- o.selected.start = [0, +l], o.selected.end = [Infinity, +l], i((e) => {
46
- let i = a(e);
47
- if (!i) return;
48
- let [c, l] = s(i);
49
- c == null || l == null || (o.selected.end = [Infinity, +l]);
44
+ if (l.classList.contains("index")) {
45
+ let [e, u] = c(l);
46
+ if (e == null || u == null) return;
47
+ s.selected.start = [0, +u], s.selected.end = [Infinity, +u], a((e) => {
48
+ let a = o(e);
49
+ if (!a) return;
50
+ let [l, u] = c(a);
51
+ l == null || u == null || (s.selected.end = [Infinity, +u]);
50
52
  });
51
- } else if (c.tagName == "TD") {
52
- let [e, l] = s(c);
53
- if (e == null || l == null) return;
54
- o.selected.start = [+e, +l], o.selected.end = [...o.selected.start], i((e) => {
55
- let i = a(e);
56
- if (!i) return;
57
- let [c, l] = s(i);
58
- c == null || l == null || (o.selected.end = [+c, +l]);
53
+ } else if (l.tagName == "TD") {
54
+ let [e, u] = c(l);
55
+ if (e == null || u == null) return;
56
+ s.selected.start = [+e, +u], s.selected.end = [...s.selected.start], a((e) => {
57
+ let a = o(e);
58
+ if (!a) return;
59
+ let [l, u] = c(a);
60
+ l == null || u == null || (s.selected.end = [+l, +u]);
59
61
  });
60
62
  }
61
63
  }
62
64
  });
63
65
  }
64
- }), s = combineProps({ class: "select-none" }, s), createComponent(a, s)),
65
- Th: ({ Th: e }, { store: s }) => (c) => {
66
+ }), c = combineProps({ class: "select-none" }, c), createComponent(a, c)),
67
+ Th: ({ Th: e }, { store: a }) => (l) => {
66
68
  let u = createMemo(() => {
67
- let { start: e, end: i } = s.selected;
68
- return inrange(c.x, ...[e[0], i[0]].sort((e, i) => e - i)) ? "col-range-highlight" : "";
69
- }), d = combineProps(c, { get class() {
70
- return u();
71
- } });
72
- return createComponent(e, mergeProps(d, { get children() {
73
- return [memo(() => d.children), memo(() => memo(() => !!u())() && _tmpl$())];
74
- } }));
69
+ let { start: e, end: o } = a.selected;
70
+ return inrange(l.x, ...[e[0], o[0]].sort((e, a) => e - a)) ? "col-range-highlight" : "";
71
+ });
72
+ return createComponent(e, mergeProps(l, {
73
+ get class() {
74
+ return `${l.class} ${u()}`;
75
+ },
76
+ get children() {
77
+ return [l.children, memo(() => memo(() => !!u())() && _tmpl$())];
78
+ }
79
+ }));
75
80
  },
76
- Td: ({ Td: e }, { store: s }) => (c) => {
81
+ Td: ({ Td: e }, { store: a }) => (l) => {
77
82
  let u = createMemo(() => {
78
- let e = "", { xs: i, ys: a } = s.cellSelectionRect(), o = inrange(c.x, i[0], i[1]), l = inrange(c.y, a[0], a[1]);
79
- return o && l && (e += "range-selected ", c.x == i[0] && (e += "range-selected-l "), c.x == i[1] && (e += "range-selected-r "), c.y == a[0] && (e += "range-selected-t "), c.y == a[1] && (e += "range-selected-b ")), c.col.id == s.$index?.id && l && (e += "row-range-highlight "), e;
80
- }), d = combineProps(c, {
83
+ let e = "", { xs: o, ys: s } = a.cellSelectionRect(), c = inrange(l.x, o[0], o[1]), u = inrange(l.y, s[0], s[1]);
84
+ return c && u && (e += "range-selected ", l.x == o[0] && (e += "range-selected-l "), l.x == o[1] && (e += "range-selected-r "), l.y == s[0] && (e += "range-selected-t "), l.y == s[1] && (e += "range-selected-b ")), l.col.id == a.$index?.id && u && (e += "row-range-highlight "), e;
85
+ });
86
+ return createComponent(e, mergeProps(l, {
81
87
  get class() {
82
- return u();
88
+ return `${l.class} ${u()}`;
83
89
  },
84
- tabindex: -1
85
- });
86
- return createComponent(e, mergeProps(d, { get children() {
87
- return [memo(() => d.children), memo(() => memo(() => !!u())() && _tmpl$())];
88
- } }));
90
+ tabindex: -1,
91
+ get children() {
92
+ return [l.children, memo(() => memo(() => !!u())() && _tmpl$())];
93
+ }
94
+ }));
89
95
  }
90
96
  },
91
97
  keybindings: (e) => ({
92
- ArrowLeft: () => {
93
- let { start: i, end: a } = e.selected;
94
- i.length && (i[0] = a[0] = Math.max(i[0] - 1, 0), a[1] = i[1], e.scrollCellIfNeeded(i[0], i[1]));
98
+ ArrowLeft: async () => {
99
+ let { start: a, end: o } = e.selected;
100
+ a.length && (a[0] = o[0] = Math.max(a[0] - 1, 0), o[1] = a[1], e.scrollCellIfNeeded(a[0], a[1]), await new Promise(requestAnimationFrame), e.table.querySelector(`[x="${a[0]}"][y="${a[1]}"]`)?.focus());
95
101
  },
96
- ArrowRight: () => {
97
- let { start: i, end: a } = e.selected;
98
- i.length && (i[0] = a[0] = Math.min(i[0] + 1, e.props.columns.length - 1), a[1] = i[1], e.scrollCellIfNeeded(i[0], i[1]));
102
+ ArrowRight: async () => {
103
+ let { start: a, end: o } = e.selected;
104
+ a.length && (a[0] = o[0] = Math.min(a[0] + 1, e.props.columns.length - 1), o[1] = a[1], e.scrollCellIfNeeded(a[0], a[1]), await new Promise(requestAnimationFrame), e.table.querySelector(`[x="${a[0]}"][y="${a[1]}"]`)?.focus());
99
105
  },
100
- ArrowUp: () => {
101
- let { start: i, end: a } = e.selected;
102
- i.length && (i[1] = a[1] = Math.max(i[1] - 1, 0), a[0] = i[0], e.scrollCellIfNeeded(i[0], i[1]));
106
+ ArrowUp: async () => {
107
+ let { start: a, end: o } = e.selected;
108
+ a.length && (a[1] = o[1] = Math.max(a[1] - 1, 0), o[0] = a[0], e.scrollCellIfNeeded(a[0], a[1]), await new Promise(requestAnimationFrame), e.table.querySelector(`[x="${a[0]}"][y="${a[1]}"]`)?.focus());
103
109
  },
104
- ArrowDown: () => {
105
- let { start: i, end: a } = e.selected;
106
- i.length && (i[1] = a[1] = Math.min(i[1] + 1, e.props.data.length - 1), a[0] = i[0], e.scrollCellIfNeeded(i[0], i[1]));
110
+ ArrowDown: async () => {
111
+ let { start: a, end: o } = e.selected;
112
+ a.length && (a[1] = o[1] = Math.min(a[1] + 1, e.props.data.length - 1), o[0] = a[0], e.scrollCellIfNeeded(a[0], a[1]), await new Promise(requestAnimationFrame), e.table.querySelector(`[x="${a[0]}"][y="${a[1]}"]`)?.focus());
107
113
  },
108
114
  "$mod+a": () => {
109
- let { columns: i, data: a } = e.props;
110
- !i?.length || !a?.length || (e.selected.start = [0, 0], e.selected.end = [i.length - 1, a.length - 1], e.scrollCellIfNeeded(e.selected.start[0], e.selected.start[1]));
115
+ let { columns: a, data: o } = e.props;
116
+ !a?.length || !o?.length || (e.selected.start = [0, 0], e.selected.end = [a.length - 1, o.length - 1]);
117
+ },
118
+ backspace: () => {
119
+ let { start: o, end: s } = e.selected;
120
+ if (!o.length) return;
121
+ let [c, l] = [o[0], s[0]].sort((e, a) => e - a), [u, d] = [o[1], s[1]].sort((e, a) => e - a), f = [...e.props.data];
122
+ for (let o = u; o <= d; o++) {
123
+ let s = e.props.data[o], u = {};
124
+ for (let d = c; d <= l; d++) {
125
+ let c = e.props.columns[d];
126
+ unFn(e.props.editable, {
127
+ col: c,
128
+ data: s,
129
+ x: d,
130
+ y: o
131
+ }) && (u[c.id] = "");
132
+ }
133
+ f[o] = {
134
+ ...f[o],
135
+ ...u
136
+ };
137
+ }
138
+ e.commands.rowsChange(f.slice(u, d + 1));
111
139
  }
112
140
  })
113
141
  };
@@ -23,7 +23,7 @@ const CommandPlugin = {
23
23
  scrollCellIfNeeded(r, i, a = !1) {
24
24
  r = typeof r == "object" ? e.props.columns.indexOf(r) : r, i = typeof i == "object" ? e.props.data.indexOf(i) : i;
25
25
  let o = e.table.querySelector(`[x="${r}"][y="${i}"]`);
26
- o && (o.scrollIntoViewIfNeeded(a), o.focus());
26
+ o && o.scrollIntoViewIfNeeded(a);
27
27
  }
28
28
  };
29
29
  },
@@ -3,7 +3,6 @@ declare module '../index' {
3
3
  interface TableProps {
4
4
  diff?: {
5
5
  /** @default false */
6
- enable?: boolean;
7
6
  data?: any[];
8
7
  /** @default true */
9
8
  added?: boolean;
@@ -33,7 +33,7 @@ const DiffPlugin = {
33
33
  ...e
34
34
  }),
35
35
  data: ({ data: e }, { store: o }) => {
36
- if (!o.props.diff?.enable) return e;
36
+ if (!o.props.diff?.data) return e;
37
37
  let { rowKey: s, diff: c } = o.props || {}, l = o.diffData();
38
38
  if (e.length === l.length && e.length > 0) {
39
39
  let o = !0;
@@ -49,7 +49,7 @@ const DiffPlugin = {
49
49
  [o.internal]: 1
50
50
  })) : [] : e.value);
51
51
  },
52
- Td: ({ Td: u }, { store: f }) => f.props.diff?.enable ? (p) => {
52
+ Td: ({ Td: u }, { store: f }) => f.props.diff?.data ? (p) => {
53
53
  let m = createMemo(() => {
54
54
  let { diff: e } = f.props, o = p.data[f.props.rowKey];
55
55
  return [p.data[NEW] ? "bg-green!" : p.data[DEL] ? "bg-red!" : p.data[f.internal] ? "" : e.changed && p.data[p.col.id] != f.diffDataKeyed()[o]?.[p.col.id] ? "bg-green!" : ""].join(" ");