intable 0.0.34 → 0.0.36
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 +1 -1
- package/dist/components/Menu.js +49 -58
- package/dist/components/Render.js +16 -9
- package/dist/components/Textarea.d.ts +14 -0
- package/dist/components/Textarea.js +68 -0
- package/dist/hooks/useSelector.d.ts +2 -0
- package/dist/hooks/useSelector.js +4 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -5
- package/dist/plugins/EditablePlugin.js +66 -61
- package/dist/plugins/FilterPlugin.js +3 -3
- package/dist/plugins/MenuPlugin.js +90 -71
- package/dist/plugins/RowSelectionPlugin.js +22 -10
- package/dist/plugins/SortPlugin.d.ts +2 -2
- package/dist/plugins/SortPlugin.js +49 -47
- package/dist/plugins/ValidatorPlugin.js +0 -1
- package/dist/style.css +2 -2
- package/package.json +1 -1
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-numeric-figure{syntax:"*";inherits:false}@property --un-numeric-fraction{syntax:"*";inherits:false}@property --un-numeric-spacing{syntax:"*";inherits:false}@property --un-ordinal{syntax:"*";inherits:false}@property --un-slashed-zero{syntax:"*";inherits:false}@property --un-space-y-reverse{syntax:"*";inherits:false;initial-value:0}:root,:host{--spacing:.25rem;--radius-DEFAULT:.25rem;--colors-gray-DEFAULT:#99a1af;--leading-snug:1.375;--colors-gray-800:#1e2939;--colors-white:#fff;--colors-gray-100:#f3f4f6;--colors-gray-900:#101828;--text-sm-fontSize:.875rem;--text-sm-lineHeight:1.25rem;--text-xs-fontSize:.75rem;--text-xs-lineHeight:1rem;--default-transition-timingFunction:cubic-bezier(.4,0,.2,1);--default-transition-duration:.15s;--radius-md:.375rem;--radius-xl:.75rem;--fontWeight-medium:500;--fontWeight-semibold:600;--tracking-wide:.025em;--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--radius-sm:.25rem;--colors-blue-DEFAULT:#54a2ff;--colors-red-DEFAULT:#ff6568;--text-2xl-fontSize:1.5rem;--text-2xl-lineHeight:2rem;--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";--default-font-family:var(--font-sans);--default-monoFont-family:var(--font-mono)}@supports (color:lab(0% 0 0)){:root,:host{--colors-gray-DEFAULT:lab(65.9269% -.832707 -8.17474);--colors-gray-800:lab(16.1051% -1.18239 -11.7533);--colors-gray-100:lab(96.1596% -.082314 -1.13575);--colors-gray-900:lab(8.11897% .811279 -12.254);--colors-blue-DEFAULT:lab(65.0361% -1.42062 -56.9803);--colors-red-DEFAULT:lab(63.7053% 60.7449 31.3109);--colors-green-DEFAULT:lab(78.503% -64.9265 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-sm{font-size:var(--text-sm-fontSize);line-height:var(--un-leading,var(--text-sm-lineHeight))}.text-xs{font-size:var(--text-xs-fontSize);line-height:var(--un-leading,var(--text-xs-lineHeight))}.c-\[--c-primary\]{color:color-mix(in oklab,var(--c-primary)var(--un-text-opacity),transparent)}.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}.tracking-wide{--un-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.font-medium{--un-font-weight:var(--fontWeight-medium);font-weight:var(--fontWeight-medium)}.font-mono{font-family:var(--font-mono)}.font-semibold{--un-font-weight:var(--fontWeight-semibold);font-weight:var(--fontWeight-semibold)}.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}.px-3{padding-inline:12px}.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-2px{border-width:2px}.b-r-0{border-right-width:0}.b-\[--table-bg\]{border-color:color-mix(in oklab,var(--table-bg)var(--un-border-opacity),transparent)}.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-1{border-radius:.25rem}.rd-1\.5{border-radius:.375rem}.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-\[--c-primary\]{background-color:color-mix(in oklab,var(--c-primary)var(--un-bg-opacity),transparent)}.bg-\[--table-header-bg\]{background-color:color-mix(in oklab,var(--table-header-bg)var(--un-bg-opacity),transparent)}.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% .744224 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-\[--li-hover-bg\]:hover{background-color:color-mix(in oklab,var(--li-hover-bg)var(--un-bg-opacity),transparent)}.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}.opacity-50{opacity:.5}.group:hover .group-hover\:op-100{opacity:1}.hover\:underline:hover{text-decoration-line:underline}.flex{display:flex}.flex-1{flex:1}.flex-none{flex:none}.flex-shrink{flex-shrink:1}.flex-shrink-0,.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-2\.5{height:10px}.h-3\.5{height:14px}.h-6{height:24px}.h-6\.5{height:26px}.h-a\!{height:auto!important}.h-full{height:100%}.max-h-100{max-height:400px}.max-h-60{max-height:240px}.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-44{min-width:176px}.min-w-52{min-width:208px}.w-10{width:40px}.w-10px\!{width:10px!important}.w-2\.5{width:10px}.w-3\.5{width:14px}.w-6\.5{width:26px}.w-a\!{width:auto!important}.w-full{width:100%}.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-pointer{cursor:pointer}.cursor-crosshair{cursor:crosshair}.cursor-s-resize{cursor:s-resize}.cursor-w-resize{cursor:w-resize}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.resize{resize:both}.resize-none{resize:none}.select-none{-webkit-user-select:none;user-select:none}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.uppercase{text-transform:uppercase}.shadow-inner{--un-shadow:inset 0 2px 4px 0 var(--un-shadow-color,#0000000d);box-shadow:var(--un-inset-shadow),var(--un-inset-ring-shadow),var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.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)}.shadow-xl{--un-shadow:0 20px 25px -5px var(--un-shadow-color,#0000001a),0 8px 10px -6px 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}.justify-between{justify-content:space-between}.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}.of-y-auto{overflow-y: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}.tabular-nums{--un-numeric-spacing:tabular-nums;font-variant-numeric:var(--un-ordinal,)var(--un-slashed-zero,)var(--un-numeric-figure,)var(--un-numeric-spacing,)var(--un-numeric-fraction,)}: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-numeric-figure{syntax:"*";inherits:false}@property --un-numeric-fraction{syntax:"*";inherits:false}@property --un-numeric-spacing{syntax:"*";inherits:false}@property --un-ordinal{syntax:"*";inherits:false}@property --un-slashed-zero{syntax:"*";inherits:false}@property --un-space-y-reverse{syntax:"*";inherits:false;initial-value:0}:root,:host{--spacing:.25rem;--radius-DEFAULT:.25rem;--colors-gray-DEFAULT:#99a1af;--leading-snug:1.375;--colors-gray-800:#1e2939;--colors-white:#fff;--colors-gray-100:#f3f4f6;--colors-gray-900:#101828;--text-sm-fontSize:.875rem;--text-sm-lineHeight:1.25rem;--text-xs-fontSize:.75rem;--text-xs-lineHeight:1rem;--radius-md:.375rem;--default-transition-timingFunction:cubic-bezier(.4,0,.2,1);--default-transition-duration:.15s;--radius-xl:.75rem;--fontWeight-medium:500;--fontWeight-semibold:600;--tracking-wide:.025em;--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--radius-sm:.25rem;--colors-blue-DEFAULT:#54a2ff;--colors-red-DEFAULT:#ff6568;--text-2xl-fontSize:1.5rem;--text-2xl-lineHeight:2rem;--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";--default-font-family:var(--font-sans);--default-monoFont-family:var(--font-mono)}@supports (color:lab(0% 0 0)){:root,:host{--colors-gray-DEFAULT:lab(65.9269% -.832707 -8.17474);--colors-gray-800:lab(16.1051% -1.18239 -11.7533);--colors-gray-100:lab(96.1596% -.082314 -1.13575);--colors-gray-900:lab(8.11897% .811279 -12.254);--colors-blue-DEFAULT:lab(65.0361% -1.42062 -56.9803);--colors-red-DEFAULT:lab(63.7053% 60.7449 31.3109);--colors-green-DEFAULT:lab(78.503% -64.9265 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-sm{font-size:var(--text-sm-fontSize);line-height:var(--un-leading,var(--text-sm-lineHeight))}.text-xs{font-size:var(--text-xs-fontSize);line-height:var(--un-leading,var(--text-xs-lineHeight))}.c-\[--c-primary\]{color:color-mix(in oklab,var(--c-primary)var(--un-text-opacity),transparent)}.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}.tracking-wide{--un-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.font-medium{--un-font-weight:var(--fontWeight-medium);font-weight:var(--fontWeight-medium)}.font-mono{font-family:var(--font-mono)}.font-semibold{--un-font-weight:var(--fontWeight-semibold);font-weight:var(--fontWeight-semibold)}.m9{margin:36px}.mx-1{margin-inline:4px}.mx-2{margin-inline:8px}.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-0\!{padding:0!important}.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}.px-3{padding-inline:12px}.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}.text-center{text-align:center}.outline-0{outline-style:var(--un-outline-style);outline-width:0}.outline-1\.5px{outline-style:var(--un-outline-style);outline-width:1.5px}.outline-2{outline-style:var(--un-outline-style);outline-width:2px}.outline-\[--c-primary\]{outline-color:color-mix(in oklab,var(--c-primary)var(--un-outline-opacity),transparent)}.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}.outline-solid{--un-outline-style:solid;outline-style:solid}.b,.b-1,.border{border-width:1px}.b-2px{border-width:2px}.b-r-0{border-right-width:0}.b-\[--table-bg\]{border-color:color-mix(in oklab,var(--table-bg)var(--un-border-opacity),transparent)}.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-1{border-radius:.25rem}.rd-1\.5{border-radius:.375rem}.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-\[--bg\]{background-color:color-mix(in oklab,var(--bg)var(--un-bg-opacity),transparent)}.bg-\[--c-primary\]{background-color:color-mix(in oklab,var(--c-primary)var(--un-bg-opacity),transparent)}.bg-\[--table-bg\]{background-color:color-mix(in oklab,var(--table-bg)var(--un-bg-opacity),transparent)}.bg-\[--table-header-bg\]{background-color:color-mix(in oklab,var(--table-header-bg)var(--un-bg-opacity),transparent)}.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% .744224 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-\[--li-hover-bg\]:hover{background-color:color-mix(in oklab,var(--li-hover-bg)var(--un-bg-opacity),transparent)}.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}.opacity-50{opacity:.5}.group:hover .group-hover\:op-100{opacity:1}.hover\:underline:hover{text-decoration-line:underline}.flex{display:flex}.flex-1{flex:1}.flex-none{flex:none}.flex-shrink{flex-shrink:1}.flex-shrink-0,.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-2\.5{height:10px}.h-3\.5{height:14px}.h-5{height:20px}.h-6{height:24px}.h-6\.5{height:26px}.h-a\!{height:auto!important}.h-full{height:100%}.max-h-100{max-height:400px}.max-h-60{max-height:240px}.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-44{min-width:176px}.min-w-52{min-width:208px}.w-10{width:40px}.w-10px\!{width:10px!important}.w-2\.5{width:10px}.w-3\.5{width:14px}.w-6\.5{width:26px}.w-8\!{width:32px!important}.w-a\!{width:auto!important}.w-full{width:100%}.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-pointer{cursor:pointer}.cursor-crosshair{cursor:crosshair}.cursor-s-resize{cursor:s-resize}.cursor-w-resize{cursor:w-resize}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.resize{resize:both}.resize-none{resize:none}.select-none{-webkit-user-select:none;user-select:none}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.uppercase{text-transform:uppercase}.shadow-inner{--un-shadow:inset 0 2px 4px 0 var(--un-shadow-color,#0000000d);box-shadow:var(--un-inset-shadow),var(--un-inset-ring-shadow),var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.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)}.shadow-xl{--un-shadow:0 20px 25px -5px var(--un-shadow-color,#0000001a),0 8px 10px -6px 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}.justify-between{justify-content:space-between}.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}.of-y-auto{overflow-y: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}.tabular-nums{--un-numeric-spacing:tabular-nums;font-variant-numeric:var(--un-ordinal,)var(--un-slashed-zero,)var(--un-numeric-figure,)var(--un-numeric-spacing,)var(--un-numeric-fraction,)}: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)}}
|
package/dist/components/Menu.js
CHANGED
|
@@ -2,21 +2,20 @@ import { useSignle2 } from "../hooks/index.js";
|
|
|
2
2
|
import { unFn } from "../utils.js";
|
|
3
3
|
import { createRender } from "./Render.js";
|
|
4
4
|
import { VDir } from "../hooks/useDir.js";
|
|
5
|
-
import { Popover } from "./Popover.js";
|
|
6
5
|
import loading_default from "../loading.js";
|
|
7
6
|
import { className, createComponent, effect, insert, memo, mergeProps, spread, template, use } from "solid-js/web";
|
|
8
|
-
import { children, createContext, createEffect, createMemo, createSignal,
|
|
7
|
+
import { children, createContext, createEffect, createMemo, createSignal, splitProps, useContext } from "solid-js";
|
|
9
8
|
import { createMutable } from "solid-js/store";
|
|
10
9
|
import { combineProps } from "@solid-primitives/props";
|
|
10
|
+
import { createLazyMemo } from "@solid-primitives/memo";
|
|
11
11
|
import { delay } from "es-toolkit";
|
|
12
12
|
import { pointerHover } from "@solid-primitives/pointer";
|
|
13
|
-
import {
|
|
14
|
-
import { autoUpdate, createFloating, offset } from "floating-ui-solid";
|
|
13
|
+
import { autoUpdate, createFloating } from "floating-ui-solid";
|
|
15
14
|
var _tmpl$ = /* @__PURE__ */ template("<div><div>"), _tmpl$2 = /* @__PURE__ */ template("<div>"), _tmpl$3 = /* @__PURE__ */ template("<div class=\"px-4 py-2 op40\">无内容");
|
|
16
|
-
function Menu(
|
|
17
|
-
let
|
|
18
|
-
is: (
|
|
19
|
-
let
|
|
15
|
+
function Menu(D) {
|
|
16
|
+
let j = createContext({ deep: 0 }), M = createRender({
|
|
17
|
+
is: (T) => {
|
|
18
|
+
let E = useContext(j), [O, k] = splitProps(T, [
|
|
20
19
|
"children",
|
|
21
20
|
"label",
|
|
22
21
|
"icon",
|
|
@@ -24,16 +23,16 @@ function Menu(k) {
|
|
|
24
23
|
"cb",
|
|
25
24
|
"menu",
|
|
26
25
|
"popover"
|
|
27
|
-
]),
|
|
26
|
+
]), A = createMemo(() => D.x && E.deep == 1), M, [P, F] = createSignal(), [I, L] = useSignle2(!1, { before: () => delay(100) }), R = createMemo(() => P() ? createFloating({
|
|
28
27
|
strategy: "fixed",
|
|
29
|
-
placement:
|
|
30
|
-
...
|
|
28
|
+
placement: A() ? "bottom-start" : "right-start",
|
|
29
|
+
...O.menu,
|
|
31
30
|
elements: {
|
|
32
|
-
reference: () =>
|
|
33
|
-
floating:
|
|
31
|
+
reference: () => M,
|
|
32
|
+
floating: P
|
|
34
33
|
},
|
|
35
|
-
whileElementsMounted(
|
|
36
|
-
return autoUpdate(
|
|
34
|
+
whileElementsMounted(r, w, T) {
|
|
35
|
+
return autoUpdate(r, w, T, {
|
|
37
36
|
ancestorResize: !0,
|
|
38
37
|
elementResize: !0,
|
|
39
38
|
layoutShift: !0,
|
|
@@ -42,65 +41,57 @@ function Menu(k) {
|
|
|
42
41
|
}
|
|
43
42
|
}).floatingStyles : void 0);
|
|
44
43
|
createEffect(() => {
|
|
45
|
-
|
|
44
|
+
P() && Object.assign(P().style, R()?.() ?? {});
|
|
46
45
|
});
|
|
47
|
-
let
|
|
48
|
-
async function
|
|
49
|
-
if (
|
|
50
|
-
let
|
|
51
|
-
if (
|
|
52
|
-
await
|
|
46
|
+
let z = createMutable({ loading: !1 });
|
|
47
|
+
async function B() {
|
|
48
|
+
if (z.loading) return;
|
|
49
|
+
let r = O.cb?.();
|
|
50
|
+
if (r instanceof Promise) try {
|
|
51
|
+
await r, z.loading = !0;
|
|
53
52
|
} finally {
|
|
54
|
-
|
|
53
|
+
z.loading = !1, D.onAction?.(O);
|
|
55
54
|
}
|
|
56
|
-
else
|
|
55
|
+
else D.onAction?.(O);
|
|
57
56
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return typeof O == "function" ? use(O, i) : N = i, spread(i, mergeProps(() => combineProps({ class: `li flex aic rd-2 ${M() ? "my-1 p-1" : "mx-1 pl-1 pr-4 py-1"} ${unFn(A.isActive) && "active"}` }, j), { "on:click": H }), !1, !0), insert(D, (() => {
|
|
71
|
-
var i = memo(() => !!V.loading);
|
|
72
|
-
return () => i() ? createComponent(loading_default, {}) : A.icon;
|
|
73
|
-
})()), insert(i, () => A.label, null), insert(i, (() => {
|
|
74
|
-
var i = memo(() => !!(R() && A.children));
|
|
75
|
-
return () => i() && createComponent(I, {
|
|
76
|
-
ref: L,
|
|
77
|
-
class: "z-1",
|
|
57
|
+
let V = createLazyMemo(() => children(() => O.children)());
|
|
58
|
+
return (() => {
|
|
59
|
+
var r = _tmpl$(), T = r.firstChild;
|
|
60
|
+
use(pointerHover, r, () => L);
|
|
61
|
+
var E = M;
|
|
62
|
+
return typeof E == "function" ? use(E, r) : M = r, spread(r, mergeProps(() => combineProps({ class: `li flex aic rd-2 ${A() ? "my-1 p-1" : "mx-1 pl-1 pr-4 py-1"} ${unFn(O.isActive) && "active"}` }, k), { "on:click": B }), !1, !0), insert(T, (() => {
|
|
63
|
+
var r = memo(() => !!z.loading);
|
|
64
|
+
return () => r() ? createComponent(loading_default, {}) : O.icon;
|
|
65
|
+
})()), insert(r, () => O.label, null), insert(r, (() => {
|
|
66
|
+
var r = memo(() => !!(I() && V()));
|
|
67
|
+
return () => r() && createComponent(N, {
|
|
68
|
+
ref: F,
|
|
78
69
|
get children() {
|
|
79
|
-
return
|
|
70
|
+
return V();
|
|
80
71
|
}
|
|
81
72
|
});
|
|
82
|
-
})(), null), effect(() => className(
|
|
73
|
+
})(), null), effect(() => className(T, `flex aic ${A() ? "" : D.density == "comfortable" ? "ml-1 mr-2.5" : "ml-.5 mr-1"} `)), r;
|
|
83
74
|
})();
|
|
84
75
|
},
|
|
85
|
-
processProps: (
|
|
86
|
-
let
|
|
87
|
-
return Array.isArray(
|
|
76
|
+
processProps: (r) => {
|
|
77
|
+
let w = 0;
|
|
78
|
+
return Array.isArray(r.children) && r.children.forEach((r) => !r.is && typeof r == "object" && (r["data-index"] = w++)), r;
|
|
88
79
|
}
|
|
89
|
-
}),
|
|
90
|
-
let
|
|
91
|
-
return createComponent(
|
|
92
|
-
value:
|
|
80
|
+
}), N = (r) => {
|
|
81
|
+
let w = useContext(j), T = createMutable({ deep: w.deep + 1 });
|
|
82
|
+
return createComponent(j.Provider, {
|
|
83
|
+
value: T,
|
|
93
84
|
get children() {
|
|
94
|
-
var
|
|
95
|
-
return use(VDir,
|
|
85
|
+
var w = _tmpl$2();
|
|
86
|
+
return use(VDir, w, () => r.usedir), spread(w, mergeProps(() => combineProps({ class: `${D.x && T.deep == 1 ? "tt-menu-x flex" : "tt-menu max-h-100"} overflow-auto` }, r), { "on:click": (r) => r.stopPropagation() }), !1, !0), insert(w, () => ((r) => r ?? _tmpl$3())(r.children)), w;
|
|
96
87
|
}
|
|
97
88
|
});
|
|
98
89
|
};
|
|
99
|
-
return createComponent(
|
|
100
|
-
is:
|
|
90
|
+
return createComponent(M, mergeProps(() => combineProps({}, D), {
|
|
91
|
+
is: N,
|
|
101
92
|
items: null,
|
|
102
93
|
get children() {
|
|
103
|
-
return
|
|
94
|
+
return D.items;
|
|
104
95
|
}
|
|
105
96
|
}));
|
|
106
97
|
}
|
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
import { Dynamic, createComponent, memo, mergeProps } from "solid-js/web";
|
|
2
|
-
import { splitProps } from "solid-js";
|
|
2
|
+
import { For, splitProps } from "solid-js";
|
|
3
3
|
var unFn = (e, ...a) => typeof e == "function" ? e(...a) : e;
|
|
4
|
-
function createRender({ is:
|
|
5
|
-
let
|
|
6
|
-
let [
|
|
4
|
+
function createRender({ is: s, processProps: c = (e) => e } = {}) {
|
|
5
|
+
let l = (o) => {
|
|
6
|
+
let [l, d] = splitProps(c?.(o), [
|
|
7
7
|
"is",
|
|
8
8
|
"vIf",
|
|
9
9
|
"children"
|
|
10
10
|
]);
|
|
11
|
-
return memo(() => memo(() => !!(!("vIf" in
|
|
12
|
-
return
|
|
11
|
+
return memo(() => memo(() => !!(!("vIf" in l) || unFn(l.vIf)))() && createComponent(Dynamic, mergeProps({ get component() {
|
|
12
|
+
return l.is ?? s;
|
|
13
13
|
} }, d, { get children() {
|
|
14
|
-
return
|
|
14
|
+
return createComponent(u, { get each() {
|
|
15
|
+
return l.children;
|
|
16
|
+
} });
|
|
15
17
|
} })));
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
+
}, u = (e) => memo(() => memo(() => !!Array.isArray(e.each))() ? createComponent(For, {
|
|
19
|
+
get each() {
|
|
20
|
+
return e.each;
|
|
21
|
+
},
|
|
22
|
+
children: (e) => typeof e == "object" ? l(e) : e
|
|
23
|
+
}) : e.each);
|
|
24
|
+
return l;
|
|
18
25
|
}
|
|
19
26
|
const Render = createRender({ is: "div" });
|
|
20
27
|
export { Render, createRender };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type JSX } from 'solid-js';
|
|
2
|
+
type AutoSize = boolean | {
|
|
3
|
+
minRows?: number;
|
|
4
|
+
maxRows?: number;
|
|
5
|
+
};
|
|
6
|
+
export interface TextAreaProps extends Omit<JSX.TextareaHTMLAttributes<HTMLTextAreaElement>, 'value' | 'onInput' | 'onChange'> {
|
|
7
|
+
value?: string;
|
|
8
|
+
defaultValue?: string;
|
|
9
|
+
autosize?: AutoSize;
|
|
10
|
+
onInput?: (value: string) => void;
|
|
11
|
+
onChange?: (value: string) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const Textarea: (rawProps: TextAreaProps) => JSX.Element;
|
|
14
|
+
export default Textarea;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { mergeProps, spread, template, use } from "solid-js/web";
|
|
2
|
+
import { createEffect, createSignal, mergeProps as mergeProps$1, splitProps } from "solid-js";
|
|
3
|
+
var _tmpl$ = /* @__PURE__ */ template("<textarea>");
|
|
4
|
+
function getLineHeight(e) {
|
|
5
|
+
let o = getComputedStyle(e), s = parseFloat(o.lineHeight);
|
|
6
|
+
if (Number.isFinite(s)) return s;
|
|
7
|
+
let c = parseFloat(o.fontSize);
|
|
8
|
+
return Number.isFinite(c) ? c * 1.2 : 20;
|
|
9
|
+
}
|
|
10
|
+
function normalizeAutoSize(e) {
|
|
11
|
+
return e ? e === !0 ? {
|
|
12
|
+
minRows: void 0,
|
|
13
|
+
maxRows: void 0
|
|
14
|
+
} : e : null;
|
|
15
|
+
}
|
|
16
|
+
const Textarea = (s) => {
|
|
17
|
+
let d = mergeProps$1({
|
|
18
|
+
defaultValue: "",
|
|
19
|
+
autosize: !1
|
|
20
|
+
}, s), [f, p] = splitProps(d, [
|
|
21
|
+
"value",
|
|
22
|
+
"defaultValue",
|
|
23
|
+
"autosize",
|
|
24
|
+
"ref",
|
|
25
|
+
"onInput",
|
|
26
|
+
"onChange"
|
|
27
|
+
]), [m, h] = createSignal(f.value ?? f.defaultValue ?? ""), g, _ = () => {
|
|
28
|
+
if (!g) return;
|
|
29
|
+
let e = normalizeAutoSize(f.autosize);
|
|
30
|
+
if (!e) return;
|
|
31
|
+
let o = getComputedStyle(g), s = parseFloat(o.borderTopWidth || "0") + parseFloat(o.borderBottomWidth || "0"), c = parseFloat(o.paddingTop || "0") + parseFloat(o.paddingBottom || "0"), l = getLineHeight(g);
|
|
32
|
+
g.style.height = "";
|
|
33
|
+
let u = g.scrollHeight;
|
|
34
|
+
if (e.minRows) {
|
|
35
|
+
let o = e.minRows * l + c + s;
|
|
36
|
+
u = Math.max(u, o);
|
|
37
|
+
}
|
|
38
|
+
if (e.maxRows) {
|
|
39
|
+
let o = e.maxRows * l + c + s;
|
|
40
|
+
u = Math.min(u, o), g.style.overflowY = g.scrollHeight > o ? "auto" : "hidden";
|
|
41
|
+
} else g.style.overflowY = "hidden";
|
|
42
|
+
g.style.height = `${Math.ceil(u)}px`;
|
|
43
|
+
};
|
|
44
|
+
return createEffect(() => {
|
|
45
|
+
let e = f.value;
|
|
46
|
+
e != null && h(e);
|
|
47
|
+
}), createEffect(() => {
|
|
48
|
+
m(), f.autosize, queueMicrotask(_);
|
|
49
|
+
}), (() => {
|
|
50
|
+
var s = _tmpl$();
|
|
51
|
+
return use((e) => {
|
|
52
|
+
g = e, typeof f.ref == "function" && f.ref(e), queueMicrotask(_);
|
|
53
|
+
}, s), spread(s, mergeProps(p, {
|
|
54
|
+
get value() {
|
|
55
|
+
return m();
|
|
56
|
+
},
|
|
57
|
+
onInput: (e) => {
|
|
58
|
+
let o = e.currentTarget.value;
|
|
59
|
+
f.value ?? h(o), f.onInput?.(o), queueMicrotask(_);
|
|
60
|
+
},
|
|
61
|
+
onChange: (e) => {
|
|
62
|
+
f.onChange?.(e.currentTarget.value);
|
|
63
|
+
}
|
|
64
|
+
}), !1, !1), s;
|
|
65
|
+
})();
|
|
66
|
+
};
|
|
67
|
+
var Textarea_default = Textarea;
|
|
68
|
+
export { Textarea, Textarea_default as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ export interface Plugin {
|
|
|
54
54
|
*/
|
|
55
55
|
keybindings?: (store: TableStore) => Record<string, (e?: KeyboardEvent) => void>;
|
|
56
56
|
}
|
|
57
|
-
export type Plugin$0 = Plugin | ((store: TableStore) => Plugin);
|
|
57
|
+
export type Plugin$0 = Plugin | Plugin[] | ((store: TableStore) => Plugin);
|
|
58
58
|
export interface TableProps {
|
|
59
59
|
store?: {
|
|
60
60
|
value: TableStore;
|
|
@@ -126,7 +126,7 @@ export type TDProps = {
|
|
|
126
126
|
type Obj = Record<string | symbol, any>;
|
|
127
127
|
export interface TableColumn extends Obj {
|
|
128
128
|
id: any;
|
|
129
|
-
name?:
|
|
129
|
+
name?: any;
|
|
130
130
|
width?: number;
|
|
131
131
|
fixed?: 'left' | 'right';
|
|
132
132
|
class?: any;
|
package/dist/index.js
CHANGED
|
@@ -25,7 +25,7 @@ import { ImportExportPlugin } from "./plugins/ImportExportPlugin.js";
|
|
|
25
25
|
import { TooltipPlugin } from "./plugins/TooltipPlugin.js";
|
|
26
26
|
import loading_bold_default from "./loading-bold.js";
|
|
27
27
|
import { createComponent, insert, memo, mergeProps, spread, template, use } from "solid-js/web";
|
|
28
|
-
import { $PROXY, For, batch, createComputed, createContext, createEffect, createMemo, createSignal, getOwner, mapArray, mergeProps as mergeProps$1, on, onCleanup, onMount, runWithOwner, untrack, useContext } from "solid-js";
|
|
28
|
+
import { $PROXY, For, batch, createComputed, createContext, createEffect, createMemo, createRenderEffect, createSignal, getOwner, mapArray, mergeProps as mergeProps$1, on, onCleanup, onMount, runWithOwner, untrack, useContext } from "solid-js";
|
|
29
29
|
import { createMutable, reconcile } from "solid-js/store";
|
|
30
30
|
import { combineProps } from "@solid-primitives/props";
|
|
31
31
|
import { createLazyMemo } from "@solid-primitives/memo";
|
|
@@ -51,7 +51,7 @@ const Ctx = createContext({
|
|
|
51
51
|
...defaultsPlugins,
|
|
52
52
|
..._.plugins || [],
|
|
53
53
|
RenderPlugin
|
|
54
|
-
].map(Y).sort((_, K) => (K.priority || 0) - (_.priority || 0))), Q = difference(X, q);
|
|
54
|
+
].flat().map(Y).sort((_, K) => (K.priority || 0) - (_.priority || 0))), Q = difference(X, q);
|
|
55
55
|
return runWithOwner(K, () => {
|
|
56
56
|
Q.forEach((_) => Object.assign(J, _.store?.(J)));
|
|
57
57
|
}), X;
|
|
@@ -71,9 +71,9 @@ const Ctx = createContext({
|
|
|
71
71
|
props: J.props,
|
|
72
72
|
store: J
|
|
73
73
|
});
|
|
74
|
-
return window.store = J, window.ctx = Q,
|
|
74
|
+
return window.store = J, window.ctx = Q, createRenderEffect(() => {
|
|
75
75
|
let _ = J.props.store;
|
|
76
|
-
|
|
76
|
+
_ && (typeof _ == "function" ? _(J) : "value" in _ ? _.value = J : "current" in _ && (_.current = J));
|
|
77
77
|
}), createComponent(Ctx.Provider, {
|
|
78
78
|
value: Q,
|
|
79
79
|
get children() {
|
|
@@ -396,6 +396,7 @@ const defaultsPlugins = [
|
|
|
396
396
|
} }),
|
|
397
397
|
rewriteProps: { columns: ({ columns: _ }, { store: K }) => K.props?.index ? [K.$index, ..._ || []] : _ }
|
|
398
398
|
},
|
|
399
|
+
FilterPlugin,
|
|
399
400
|
SortPlugin,
|
|
400
401
|
ValidatorPlugin,
|
|
401
402
|
EditablePlugin,
|
|
@@ -424,7 +425,6 @@ const defaultsPlugins = [
|
|
|
424
425
|
ResizePlugin,
|
|
425
426
|
AggregatePlugin,
|
|
426
427
|
AutoFillPlugin,
|
|
427
|
-
FilterPlugin,
|
|
428
428
|
ImportExportPlugin,
|
|
429
429
|
TooltipPlugin
|
|
430
430
|
];
|