@toolbox-web/grid 1.2.0 → 1.3.0
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/README.md +80 -22
- package/all.js +439 -416
- package/all.js.map +1 -1
- package/index.js +358 -300
- package/index.js.map +1 -1
- package/lib/core/grid.d.ts +64 -1
- package/lib/core/grid.d.ts.map +1 -1
- package/lib/core/internal/row-animation.d.ts +37 -0
- package/lib/core/internal/row-animation.d.ts.map +1 -0
- package/lib/core/types.d.ts +13 -0
- package/lib/core/types.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.js +73 -69
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/clipboard/types.d.ts +1 -0
- package/lib/plugins/clipboard/types.d.ts.map +1 -1
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
- package/lib/plugins/editing/index.js +69 -40
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/responsive/index.js.map +1 -1
- package/lib/plugins/row-reorder/index.js.map +1 -1
- package/lib/plugins/selection/SelectionPlugin.d.ts +13 -0
- package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
- package/lib/plugins/selection/index.d.ts +1 -1
- package/lib/plugins/selection/index.d.ts.map +1 -1
- package/lib/plugins/selection/index.js +95 -64
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/selection/types.d.ts +50 -6
- package/lib/plugins/selection/types.d.ts.map +1 -1
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +21 -4
- package/public.d.ts +1 -1
- package/public.d.ts.map +1 -1
- package/umd/grid.all.umd.js +18 -18
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +9 -9
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/clipboard.umd.js +5 -5
- package/umd/plugins/clipboard.umd.js.map +1 -1
- package/umd/plugins/editing.umd.js +1 -1
- package/umd/plugins/editing.umd.js.map +1 -1
- package/umd/plugins/selection.umd.js +2 -2
- package/umd/plugins/selection.umd.js.map +1 -1
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const ce = '@layer tbw-base,tbw-plugins,tbw-theme;@layer tbw-base{:root{color-scheme:light dark}tbw-grid{--tbw-base-icon-size: 1em;--tbw-base-radius: .25em;--tbw-font-size: 1em;--tbw-font-size-sm: .9285em;--tbw-font-size-xs: .7857em;--tbw-font-size-2xs: .7142em;--tbw-spacing-xs: .25em;--tbw-spacing-sm: .375em;--tbw-spacing-md: .5em;--tbw-spacing-lg: .75em;--tbw-spacing-xl: 1em;--tbw-icon-size: var(--tbw-base-icon-size);--tbw-icon-size-sm: .875em;--tbw-checkbox-size: var(--tbw-base-icon-size);--tbw-toggle-size: 1.25em;--tbw-border-radius: var(--tbw-base-radius);--tbw-color-bg: transparent;--tbw-color-panel-bg: light-dark(#eeeeee, #222222);--tbw-color-fg: light-dark(#222222, #eeeeee);--tbw-color-fg-muted: light-dark(#555555, #aaaaaa);--tbw-color-accent: light-dark(#3b82f6, #3b82f6);--tbw-color-accent-fg: light-dark(#ffffff, #000000);--tbw-color-success: light-dark(hsl(122, 39%, 40%), hsl(122, 39%, 49%));--tbw-color-error: light-dark(hsl(0, 65%, 51%), hsl(0, 65%, 55%));--tbw-color-selection: light-dark(#fff7d6, #333333);--tbw-color-row-alt: var(--tbw-color-bg);--tbw-color-row-hover: light-dark(#f0f6ff, #1c1c1c);--tbw-color-header-bg: color-mix(in hsl, var(--tbw-color-panel-bg) 85%, var(--tbw-color-fg));--tbw-color-header-fg: color-mix(in hsl, var(--tbw-color-fg) 75%, var(--tbw-color-panel-bg));--tbw-color-border: light-dark(#d0d0d4, #454545);--tbw-color-border-strong: light-dark(#777777, #666666);--tbw-color-border-cell: var(--tbw-color-border);--tbw-color-border-header: var(--tbw-color-border);--tbw-color-shadow: light-dark(rgba(0, 0, 0, .1), rgba(0, 0, 0, .3));--tbw-font-family: inherit;--tbw-font-size-header: var(--tbw-font-size);--tbw-font-weight-header: bold;--tbw-cell-padding-header: var(--tbw-spacing-xs) var(--tbw-spacing-md);--tbw-cell-padding: var(--tbw-spacing-xs) var(--tbw-spacing-md);--tbw-cell-padding-input: var(--tbw-spacing-xs) var(--tbw-spacing-sm);--tbw-row-height: 1.75em;--tbw-header-height: 1.875em;--tbw-cell-white-space: nowrap;--tbw-border-input: 1px solid var(--tbw-color-border-strong);--tbw-border-header: 1px solid var(--tbw-color-border-header);--tbw-row-divider: 1px solid var(--tbw-color-border-cell);--tbw-row-hover-outline: 0;--tbw-color-active-row-bg: var(--tbw-color-selection);--tbw-active-row-outline: 0;--tbw-focus-outline: 2px solid var(--tbw-color-accent);--tbw-focus-outline-offset: -2px;--tbw-focus-background: rgba(from var(--tbw-color-accent) r g b / 12%);--tbw-range-border-color: var(--tbw-color-accent);--tbw-range-selection-bg: rgba(from var(--tbw-range-border-color) r g b / 12%);--tbw-resize-handle-width: var(--tbw-spacing-sm);--tbw-resize-handle-color: transparent;--tbw-resize-handle-color-hover: var(--tbw-color-accent);--tbw-resize-handle-border-radius: 0;--tbw-resize-indicator-width: 2px;--tbw-resize-indicator-color: var(--tbw-color-accent);--tbw-resize-indicator-opacity: .6;--tbw-scrollbar-thumb: var(--tbw-color-border-strong);--tbw-scrollbar-track: var(--tbw-color-bg);--tbw-transition-duration: .12s;--tbw-transition-ease: ease;--tbw-animation-duration: .2s;--tbw-animation-easing: ease-out;--tbw-animation-enabled: 1;--tbw-sort-indicator-color: var(--tbw-color-fg-muted);--tbw-sort-indicator-active-color: var(--tbw-color-accent);--tbw-header-text-transform: none;--tbw-header-letter-spacing: normal;--tbw-color-header-separator: var(--tbw-color-border-cell);--tbw-density-scale: 1;--tbw-shell-header-height: 2.75em;--tbw-shell-header-bg: var(--tbw-color-panel-bg);--tbw-shell-header-border: var(--tbw-color-border);--tbw-shell-title-font-size: var(--tbw-font-size);--tbw-shell-title-font-weight: 600;--tbw-tool-panel-width: 17.5em;--tbw-tool-panel-bg: var(--tbw-color-panel-bg);--tbw-tool-panel-border: var(--tbw-color-border);--tbw-tool-panel-header-height: 2.5em;--tbw-tool-panel-transition: var(--tbw-animation-duration) var(--tbw-animation-easing);--tbw-toolbar-button-size: 2em;--tbw-toolbar-button-gap: var(--tbw-spacing-xs);--tbw-panel-padding: var(--tbw-spacing-lg);--tbw-panel-gap: var(--tbw-spacing-md);--tbw-menu-item-padding: var(--tbw-spacing-sm) var(--tbw-spacing-lg);--tbw-menu-item-gap: var(--tbw-spacing-md);--tbw-menu-min-width: 10rem;--tbw-button-padding: var(--tbw-spacing-sm) var(--tbw-spacing-lg);--tbw-button-padding-sm: var(--tbw-spacing-xs) var(--tbw-spacing-md);--tbw-input-height: var(--tbw-row-height);--tbw-input-padding: 0 var(--tbw-spacing-md);--tbw-detail-padding: var(--tbw-spacing-xl);--tbw-detail-max-height: 31.25rem;--tbw-indicator-size: var(--tbw-spacing-sm);position:relative;display:block;width:100%;height:100%;min-height:0;contain:content;font-family:var(--tbw-font-family);font-size:var(--tbw-font-size);background:var(--tbw-color-bg);color:var(--tbw-color-fg);border:1px solid var(--tbw-color-border);border-radius:var(--tbw-border-radius);overflow:clip;outline:none;&,*{box-sizing:border-box}.header{display:block;flex-shrink:0;z-index:var(--tbw-z-layer-header, 30);background:var(--tbw-color-header-bg);overflow:visible}.header-group-row{display:grid;grid-template-columns:var(--tbw-column-template);background:var(--tbw-color-header-bg);z-index:var(--tbw-z-layer-header, 30)}.header-group-cell{display:flex;align-items:center;justify-content:flex-start;padding:var(--tbw-cell-padding-header, 2px 8px);color:var(--tbw-color-header-group-fg, var(--tbw-color-header-fg));font-weight:var(--tbw-font-weight-header-group, var(--tbw-font-weight-header));justify-content:var(--tbw-align-header-group, var(--tbw-align-header, flex-start));&:not(:last-child){border-right:2px solid var(--tbw-color-border)}}.header-row{display:grid;grid-template-columns:var(--tbw-column-template);color:var(--tbw-color-header-fg);font-size:var(--tbw-font-size-header);min-height:var(--tbw-header-height);border-bottom:var(--tbw-border-header);z-index:var(--tbw-z-layer-header, 30);>.cell{display:flex;align-items:center;gap:4px;padding:var(--tbw-cell-padding-header, 2px 8px);background-color:var(--tbw-color-header-bg);font-weight:var(--tbw-font-weight-header);border-right:1px solid var(--tbw-color-border-cell);overflow:visible;min-width:0;>span:first-child{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}>span[part~=sort-indicator]{flex-shrink:0;opacity:.6}&:last-child{border-right:0}&.grouped.group-end:not(:last-child){border-right:2px solid var(--tbw-color-border)}&.resizable{position:relative}&.sticky-left,&.sticky-right{background:var(--tbw-color-header-bg);z-index:35}}}.tbw-grid-root{display:flex;flex-direction:column;height:100%;&.has-shell{display:flex;flex-direction:column;height:100%}}.rows-body-wrapper{flex:1;min-height:0;display:flex;flex-direction:row;width:100%;min-width:fit-content}.rows-body{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:visible}.rows-container{display:flex;flex-direction:row;flex:1;min-height:0;overflow:visible}.rows-viewport{flex:1;min-width:0;position:relative;display:block;overflow:clip;.rows{position:absolute;top:0;left:0;min-width:100%;will-change:transform;z-index:var(--tbw-z-layer-rows, 1)}}.faux-vscroll{position:sticky;inset-inline-end:0;flex-shrink:0;width:auto;overflow-y:auto;overflow-x:hidden;z-index:var(--tbw-z-layer-header, 30)}.faux-vscroll-spacer{width:1px}.data-grid-row{display:grid;grid-template-columns:var(--tbw-column-template);contain:layout style;content-visibility:auto;contain-intrinsic-size:auto var(--tbw-row-height);&:nth-child(2n){background:var(--tbw-color-row-alt)}&:hover{background:var(--tbw-color-row-hover)}>.cell{display:block;padding:var(--tbw-cell-padding, 2px 8px);border-bottom:var(--tbw-row-divider);min-height:var(--tbw-row-height);line-height:calc(var(--tbw-row-height) - 5px);border-right:1px solid var(--tbw-color-border-cell);overflow:hidden;min-width:0;white-space:var(--tbw-cell-white-space, nowrap);text-overflow:ellipsis;>*{overflow:hidden;text-overflow:ellipsis;white-space:inherit;min-width:0}&:last-child{border-right:0}&[data-type=boolean]{text-align:center;input[type=checkbox]{margin:0;width:var(--tbw-checkbox-size);height:var(--tbw-checkbox-size);vertical-align:middle}}&.selected:focus-visible,&:focus-visible:not(.cell-focus){outline:none}&.sticky-left,&.sticky-right{background:var(--tbw-color-panel-bg)}}}.selecting .data-grid-row>.cell{user-select:none}.sortable{cursor:pointer;user-select:none}.resize-handle{position:absolute;top:0;right:calc(var(--tbw-resize-handle-width) / -2);width:var(--tbw-resize-handle-width);height:100%;cursor:e-resize;user-select:none;touch-action:none;z-index:20;background:var(--tbw-resize-handle-color);transition:background .12s ease;border-radius:var(--tbw-resize-handle-border-radius);&:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);width:var(--tbw-resize-indicator-width, 2px);height:0;background:var(--tbw-resize-indicator-color, var(--tbw-color-accent));opacity:0;pointer-events:none;transition:opacity .12s ease,height 0s .12s;z-index:1000}&:hover{background:var(--tbw-resize-handle-color-hover);&:after{height:100vh;opacity:var(--tbw-resize-indicator-opacity, .6);transition:opacity .12s ease,height 0s}}}&[data-has-focus]{.cell-focus,.row-focus{outline:var(--tbw-focus-outline);outline-offset:var(--tbw-focus-outline-offset)}}.sticky-left,.sticky-right{position:sticky;z-index:25}.sticky-left{box-shadow:1px 0 0 var(--tbw-color-border)}.sticky-right{box-shadow:-1px 0 0 var(--tbw-color-border)}.tbw-shell-header{display:flex;align-items:center;gap:8px;min-height:var(--tbw-shell-header-height);padding:0 8px;background:var(--tbw-shell-header-bg);border-bottom:1px solid var(--tbw-shell-header-border);flex-shrink:0}.tbw-shell-title{font-size:var(--tbw-shell-title-font-size);font-weight:var(--tbw-shell-title-font-weight);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tbw-shell-content{flex:1;display:flex;align-items:center;gap:12px;min-width:0;overflow:hidden}.tbw-shell-toolbar{display:flex;align-items:center;gap:var(--tbw-toolbar-button-gap);flex-shrink:0}.tbw-toolbar-btn{display:inline-flex;align-items:center;justify-content:center;width:var(--tbw-toolbar-button-size);height:var(--tbw-toolbar-button-size);padding:0;border:1px solid transparent;border-radius:var(--tbw-border-radius);background:transparent;color:var(--tbw-color-fg);cursor:pointer;font-size:16px;transition:background var(--tbw-transition-duration) var(--tbw-transition-ease),border-color var(--tbw-transition-duration) var(--tbw-transition-ease);&:hover{background:var(--tbw-color-row-hover)}&:focus-visible{outline:var(--tbw-focus-outline);outline-offset:var(--tbw-focus-outline-offset)}&.active{background:var(--tbw-focus-background);border-color:var(--tbw-color-accent)}&:disabled{opacity:.5;cursor:not-allowed}}.tbw-toolbar-separator{width:1px;height:20px;background:var(--tbw-color-border);margin:0 4px}.tbw-shell-body{position:relative;display:flex;flex:1;min-height:0;overflow:visible}.tbw-grid-content{flex:1;min-width:0;min-height:0;display:flex;flex-direction:row;overflow:hidden}.tbw-scroll-area{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow-x:auto;overflow-y:hidden;overflow-anchor:none}.tbw-tool-panel{position:absolute;top:0;bottom:0;right:0;width:0;overflow:hidden;background:var(--tbw-tool-panel-bg);border-left:1px solid var(--tbw-tool-panel-border);transition:width var(--tbw-tool-panel-transition);display:flex;flex-direction:column;z-index:30;box-shadow:-2px 0 8px var(--tbw-color-shadow);&[data-position=left]{right:auto;left:0;border-left:none;border-right:1px solid var(--tbw-tool-panel-border);box-shadow:2px 0 8px var(--tbw-color-shadow)}&.open{width:var(--tbw-tool-panel-width)}}.tbw-tool-panel-resize{position:absolute;top:0;bottom:0;width:6px;cursor:col-resize;background:transparent;z-index:10;transition:background var(--tbw-transition-duration) var(--tbw-transition-ease);&[data-handle-position=left]{left:0}&[data-handle-position=right]{right:0}&:hover,&.resizing{background:var(--tbw-color-accent)}}.tbw-tool-panel-header{display:flex;align-items:center;justify-content:space-between;min-height:var(--tbw-tool-panel-header-height);padding:0 12px;border-bottom:1px solid var(--tbw-tool-panel-border);flex-shrink:0}.tbw-tool-panel-title{font-weight:600;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tbw-tool-panel-close{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:var(--tbw-border-radius);background:transparent;color:var(--tbw-color-fg-muted);cursor:pointer;font-size:14px;&:hover{background:var(--tbw-color-row-hover);color:var(--tbw-color-fg)}}.tbw-tool-panel-content{flex:1;overflow:auto}.tbw-accordion{display:flex;flex-direction:column;gap:0}.tbw-accordion-section{border-bottom:1px solid var(--tbw-tool-panel-border);&:last-child{border-bottom:none}&.single .tbw-accordion-header{cursor:default;&:hover{background:transparent}}&.expanded{.tbw-accordion-chevron{transform:rotate(90deg)}.tbw-accordion-content{display:block}}}.tbw-accordion-header{display:flex;align-items:center;gap:8px;width:100%;padding:10px 12px;border:none;background:transparent;color:var(--tbw-color-fg);font-size:13px;font-weight:600;text-align:left;cursor:pointer;user-select:none;&:hover{background:var(--tbw-color-row-hover)}}.tbw-accordion-chevron{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;font-size:10px;color:var(--tbw-color-fg-muted);transition:transform .15s ease;flex-shrink:0}.tbw-accordion-icon{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;font-size:14px;flex-shrink:0}.tbw-accordion-title{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tbw-accordion-content{display:none}.tbw-expanding{animation:tbw-expand var(--tbw-animation-duration) var(--tbw-animation-easing) forwards;overflow:hidden}.tbw-collapsing{animation:tbw-collapse var(--tbw-animation-duration) var(--tbw-animation-easing) forwards;overflow:hidden}&[data-animation-mode=off]{--tbw-animation-enabled: 0;--tbw-animation-duration: 0ms}}@media(forced-colors:active){tbw-grid{--tbw-color-border: CanvasText;--tbw-color-border-strong: CanvasText;--tbw-color-border-cell: CanvasText;--tbw-color-border-header: CanvasText;--tbw-color-fg: CanvasText;--tbw-color-bg: Canvas;--tbw-color-panel-bg: Canvas;--tbw-color-header-bg: Canvas;--tbw-color-header-fg: CanvasText;--tbw-color-accent: Highlight;--tbw-color-accent-fg: HighlightText;--tbw-color-selection: Highlight;--tbw-color-row-hover: Highlight;--tbw-focus-outline: 2px solid Highlight;--tbw-range-border-color: Highlight;.cell:focus,.cell.active-cell{outline:2px solid Highlight!important;outline-offset:-2px}.data-grid-row[aria-selected=true]{background:Highlight!important;color:HighlightText!important}}}@media(prefers-reduced-motion:reduce){tbw-grid[data-animation-mode=reduced-motion]{--tbw-animation-enabled: 0;--tbw-animation-duration: 0ms}}@keyframes tbw-expand{0%{opacity:0;max-height:0;transform:translateY(-8px)}to{opacity:1;max-height:500px;transform:translateY(0)}}@keyframes tbw-collapse{0%{opacity:1;max-height:500px;transform:translateY(0)}to{opacity:0;max-height:0;transform:translateY(-8px)}}}', B = {
|
|
1
|
+
const he = '@layer tbw-base,tbw-plugins,tbw-theme;@layer tbw-base{:root{color-scheme:light dark}tbw-grid{--tbw-base-icon-size: 1em;--tbw-base-radius: .25em;--tbw-font-size: 1em;--tbw-font-size-sm: .9285em;--tbw-font-size-xs: .7857em;--tbw-font-size-2xs: .7142em;--tbw-spacing-xs: .25em;--tbw-spacing-sm: .375em;--tbw-spacing-md: .5em;--tbw-spacing-lg: .75em;--tbw-spacing-xl: 1em;--tbw-icon-size: var(--tbw-base-icon-size);--tbw-icon-size-sm: .875em;--tbw-checkbox-size: var(--tbw-base-icon-size);--tbw-toggle-size: 1.25em;--tbw-border-radius: var(--tbw-base-radius);--tbw-color-bg: transparent;--tbw-color-panel-bg: light-dark(#eeeeee, #222222);--tbw-color-fg: light-dark(#222222, #eeeeee);--tbw-color-fg-muted: light-dark(#555555, #aaaaaa);--tbw-color-accent: light-dark(#3b82f6, #3b82f6);--tbw-color-accent-fg: light-dark(#ffffff, #000000);--tbw-color-success: light-dark(hsl(122, 39%, 40%), hsl(122, 39%, 49%));--tbw-color-error: light-dark(hsl(0, 65%, 51%), hsl(0, 65%, 55%));--tbw-color-selection: light-dark(#fff7d6, #333333);--tbw-color-row-alt: var(--tbw-color-bg);--tbw-color-row-hover: light-dark(#f0f6ff, #1c1c1c);--tbw-color-header-bg: color-mix(in hsl, var(--tbw-color-panel-bg) 85%, var(--tbw-color-fg));--tbw-color-header-fg: color-mix(in hsl, var(--tbw-color-fg) 75%, var(--tbw-color-panel-bg));--tbw-color-border: light-dark(#d0d0d4, #454545);--tbw-color-border-strong: light-dark(#777777, #666666);--tbw-color-border-cell: var(--tbw-color-border);--tbw-color-border-header: var(--tbw-color-border);--tbw-color-shadow: light-dark(rgba(0, 0, 0, .1), rgba(0, 0, 0, .3));--tbw-font-family: inherit;--tbw-font-size-header: var(--tbw-font-size);--tbw-font-weight-header: bold;--tbw-cell-padding-header: var(--tbw-spacing-xs) var(--tbw-spacing-md);--tbw-cell-padding: var(--tbw-spacing-xs) var(--tbw-spacing-md);--tbw-cell-padding-input: var(--tbw-spacing-xs) var(--tbw-spacing-sm);--tbw-row-height: 1.75em;--tbw-header-height: 1.875em;--tbw-cell-white-space: nowrap;--tbw-border-input: 1px solid var(--tbw-color-border-strong);--tbw-border-header: 1px solid var(--tbw-color-border-header);--tbw-row-divider: 1px solid var(--tbw-color-border-cell);--tbw-row-hover-outline: 0;--tbw-color-active-row-bg: var(--tbw-color-selection);--tbw-active-row-outline: 0;--tbw-focus-outline: 2px solid var(--tbw-color-accent);--tbw-focus-outline-offset: -2px;--tbw-focus-background: rgba(from var(--tbw-color-accent) r g b / 12%);--tbw-range-border-color: var(--tbw-color-accent);--tbw-range-selection-bg: rgba(from var(--tbw-range-border-color) r g b / 12%);--tbw-resize-handle-width: var(--tbw-spacing-sm);--tbw-resize-handle-color: transparent;--tbw-resize-handle-color-hover: var(--tbw-color-accent);--tbw-resize-handle-border-radius: 0;--tbw-resize-indicator-width: 2px;--tbw-resize-indicator-color: var(--tbw-color-accent);--tbw-resize-indicator-opacity: .6;--tbw-scrollbar-thumb: var(--tbw-color-border-strong);--tbw-scrollbar-track: var(--tbw-color-bg);--tbw-transition-duration: .12s;--tbw-transition-ease: ease;--tbw-animation-duration: .2s;--tbw-animation-easing: ease-out;--tbw-animation-enabled: 1;--tbw-row-change-duration: .5s;--tbw-row-insert-duration: .3s;--tbw-row-remove-duration: .2s;--tbw-row-change-color: rgba(from var(--tbw-color-accent) r g b / 25%);--tbw-sort-indicator-color: var(--tbw-color-fg-muted);--tbw-sort-indicator-active-color: var(--tbw-color-accent);--tbw-header-text-transform: none;--tbw-header-letter-spacing: normal;--tbw-color-header-separator: var(--tbw-color-border-cell);--tbw-density-scale: 1;--tbw-shell-header-height: 2.75em;--tbw-shell-header-bg: var(--tbw-color-panel-bg);--tbw-shell-header-border: var(--tbw-color-border);--tbw-shell-title-font-size: var(--tbw-font-size);--tbw-shell-title-font-weight: 600;--tbw-tool-panel-width: 17.5em;--tbw-tool-panel-bg: var(--tbw-color-panel-bg);--tbw-tool-panel-border: var(--tbw-color-border);--tbw-tool-panel-header-height: 2.5em;--tbw-tool-panel-transition: var(--tbw-animation-duration) var(--tbw-animation-easing);--tbw-toolbar-button-size: 2em;--tbw-toolbar-button-gap: var(--tbw-spacing-xs);--tbw-panel-padding: var(--tbw-spacing-lg);--tbw-panel-gap: var(--tbw-spacing-md);--tbw-menu-item-padding: var(--tbw-spacing-sm) var(--tbw-spacing-lg);--tbw-menu-item-gap: var(--tbw-spacing-md);--tbw-menu-min-width: 10rem;--tbw-button-padding: var(--tbw-spacing-sm) var(--tbw-spacing-lg);--tbw-button-padding-sm: var(--tbw-spacing-xs) var(--tbw-spacing-md);--tbw-input-height: var(--tbw-row-height);--tbw-input-padding: 0 var(--tbw-spacing-md);--tbw-detail-padding: var(--tbw-spacing-xl);--tbw-detail-max-height: 31.25rem;--tbw-indicator-size: var(--tbw-spacing-sm);position:relative;display:block;width:100%;height:100%;min-height:0;contain:content;font-family:var(--tbw-font-family);font-size:var(--tbw-font-size);background:var(--tbw-color-bg);color:var(--tbw-color-fg);border:1px solid var(--tbw-color-border);border-radius:var(--tbw-border-radius);overflow:clip;outline:none;&,*{box-sizing:border-box}.header{display:block;flex-shrink:0;z-index:var(--tbw-z-layer-header, 30);background:var(--tbw-color-header-bg);overflow:visible}.header-group-row{display:grid;grid-template-columns:var(--tbw-column-template);background:var(--tbw-color-header-bg);z-index:var(--tbw-z-layer-header, 30)}.header-group-cell{display:flex;align-items:center;justify-content:flex-start;padding:var(--tbw-cell-padding-header, 2px 8px);color:var(--tbw-color-header-group-fg, var(--tbw-color-header-fg));font-weight:var(--tbw-font-weight-header-group, var(--tbw-font-weight-header));justify-content:var(--tbw-align-header-group, var(--tbw-align-header, flex-start));&:not(:last-child){border-right:2px solid var(--tbw-color-border)}}.header-row{display:grid;grid-template-columns:var(--tbw-column-template);color:var(--tbw-color-header-fg);font-size:var(--tbw-font-size-header);min-height:var(--tbw-header-height);border-bottom:var(--tbw-border-header);z-index:var(--tbw-z-layer-header, 30);>.cell{display:flex;align-items:center;gap:4px;padding:var(--tbw-cell-padding-header, 2px 8px);background-color:var(--tbw-color-header-bg);font-weight:var(--tbw-font-weight-header);border-right:1px solid var(--tbw-color-border-cell);overflow:visible;min-width:0;>span:first-child{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}>span[part~=sort-indicator]{flex-shrink:0;opacity:.6}&:last-child{border-right:0}&.grouped.group-end:not(:last-child){border-right:2px solid var(--tbw-color-border)}&.resizable{position:relative}&.sticky-left,&.sticky-right{background:var(--tbw-color-header-bg);z-index:35}}}.tbw-grid-root{display:flex;flex-direction:column;height:100%;&.has-shell{display:flex;flex-direction:column;height:100%}}.rows-body-wrapper{flex:1;min-height:0;display:flex;flex-direction:row;width:100%;min-width:fit-content}.rows-body{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:visible}.rows-container{display:flex;flex-direction:row;flex:1;min-height:0;overflow:visible}.rows-viewport{flex:1;min-width:0;position:relative;display:block;overflow:clip;.rows{position:absolute;top:0;left:0;min-width:100%;will-change:transform;z-index:var(--tbw-z-layer-rows, 1)}}.faux-vscroll{position:sticky;inset-inline-end:0;flex-shrink:0;width:auto;overflow-y:auto;overflow-x:hidden;z-index:var(--tbw-z-layer-header, 30)}.faux-vscroll-spacer{width:1px}.data-grid-row{display:grid;grid-template-columns:var(--tbw-column-template);contain:layout style;content-visibility:auto;contain-intrinsic-size:auto var(--tbw-row-height);&:nth-child(2n){background:var(--tbw-color-row-alt)}&:hover{background:var(--tbw-color-row-hover)}>.cell{display:block;padding:var(--tbw-cell-padding, 2px 8px);border-bottom:var(--tbw-row-divider);min-height:var(--tbw-row-height);line-height:calc(var(--tbw-row-height) - 5px);border-right:1px solid var(--tbw-color-border-cell);overflow:hidden;min-width:0;white-space:var(--tbw-cell-white-space, nowrap);text-overflow:ellipsis;>*{overflow:hidden;text-overflow:ellipsis;white-space:inherit;min-width:0}&:last-child{border-right:0}&[data-type=boolean]{text-align:center;input[type=checkbox]{margin:0;width:var(--tbw-checkbox-size);height:var(--tbw-checkbox-size);vertical-align:middle}}&.selected:focus-visible,&:focus-visible:not(.cell-focus){outline:none}&.sticky-left,&.sticky-right{background:var(--tbw-color-panel-bg)}}}.selecting .data-grid-row>.cell{user-select:none}.sortable{cursor:pointer;user-select:none}.resize-handle{position:absolute;top:0;right:calc(var(--tbw-resize-handle-width) / -2);width:var(--tbw-resize-handle-width);height:100%;cursor:e-resize;user-select:none;touch-action:none;z-index:20;background:var(--tbw-resize-handle-color);transition:background .12s ease;border-radius:var(--tbw-resize-handle-border-radius);&:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);width:var(--tbw-resize-indicator-width, 2px);height:0;background:var(--tbw-resize-indicator-color, var(--tbw-color-accent));opacity:0;pointer-events:none;transition:opacity .12s ease,height 0s .12s;z-index:1000}&:hover{background:var(--tbw-resize-handle-color-hover);&:after{height:100vh;opacity:var(--tbw-resize-indicator-opacity, .6);transition:opacity .12s ease,height 0s}}}&[data-has-focus]{.cell-focus,.row-focus{outline:var(--tbw-focus-outline);outline-offset:var(--tbw-focus-outline-offset)}}.sticky-left,.sticky-right{position:sticky;z-index:25}.sticky-left{box-shadow:1px 0 0 var(--tbw-color-border)}.sticky-right{box-shadow:-1px 0 0 var(--tbw-color-border)}.tbw-shell-header{display:flex;align-items:center;gap:8px;min-height:var(--tbw-shell-header-height);padding:0 8px;background:var(--tbw-shell-header-bg);border-bottom:1px solid var(--tbw-shell-header-border);flex-shrink:0}.tbw-shell-title{font-size:var(--tbw-shell-title-font-size);font-weight:var(--tbw-shell-title-font-weight);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tbw-shell-content{flex:1;display:flex;align-items:center;gap:12px;min-width:0;overflow:hidden}.tbw-shell-toolbar{display:flex;align-items:center;gap:var(--tbw-toolbar-button-gap);flex-shrink:0}.tbw-toolbar-btn{display:inline-flex;align-items:center;justify-content:center;width:var(--tbw-toolbar-button-size);height:var(--tbw-toolbar-button-size);padding:0;border:1px solid transparent;border-radius:var(--tbw-border-radius);background:transparent;color:var(--tbw-color-fg);cursor:pointer;font-size:16px;transition:background var(--tbw-transition-duration) var(--tbw-transition-ease),border-color var(--tbw-transition-duration) var(--tbw-transition-ease);&:hover{background:var(--tbw-color-row-hover)}&:focus-visible{outline:var(--tbw-focus-outline);outline-offset:var(--tbw-focus-outline-offset)}&.active{background:var(--tbw-focus-background);border-color:var(--tbw-color-accent)}&:disabled{opacity:.5;cursor:not-allowed}}.tbw-toolbar-separator{width:1px;height:20px;background:var(--tbw-color-border);margin:0 4px}.tbw-shell-body{position:relative;display:flex;flex:1;min-height:0;overflow:visible}.tbw-grid-content{flex:1;min-width:0;min-height:0;display:flex;flex-direction:row;overflow:hidden}.tbw-scroll-area{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow-x:auto;overflow-y:hidden;overflow-anchor:none}.tbw-tool-panel{position:absolute;top:0;bottom:0;right:0;width:0;overflow:hidden;background:var(--tbw-tool-panel-bg);border-left:1px solid var(--tbw-tool-panel-border);transition:width var(--tbw-tool-panel-transition);display:flex;flex-direction:column;z-index:30;box-shadow:-2px 0 8px var(--tbw-color-shadow);&[data-position=left]{right:auto;left:0;border-left:none;border-right:1px solid var(--tbw-tool-panel-border);box-shadow:2px 0 8px var(--tbw-color-shadow)}&.open{width:var(--tbw-tool-panel-width)}}.tbw-tool-panel-resize{position:absolute;top:0;bottom:0;width:6px;cursor:col-resize;background:transparent;z-index:10;transition:background var(--tbw-transition-duration) var(--tbw-transition-ease);&[data-handle-position=left]{left:0}&[data-handle-position=right]{right:0}&:hover,&.resizing{background:var(--tbw-color-accent)}}.tbw-tool-panel-header{display:flex;align-items:center;justify-content:space-between;min-height:var(--tbw-tool-panel-header-height);padding:0 12px;border-bottom:1px solid var(--tbw-tool-panel-border);flex-shrink:0}.tbw-tool-panel-title{font-weight:600;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tbw-tool-panel-close{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:var(--tbw-border-radius);background:transparent;color:var(--tbw-color-fg-muted);cursor:pointer;font-size:14px;&:hover{background:var(--tbw-color-row-hover);color:var(--tbw-color-fg)}}.tbw-tool-panel-content{flex:1;overflow:auto}.tbw-accordion{display:flex;flex-direction:column;gap:0}.tbw-accordion-section{border-bottom:1px solid var(--tbw-tool-panel-border);&:last-child{border-bottom:none}&.single .tbw-accordion-header{cursor:default;&:hover{background:transparent}}&.expanded{.tbw-accordion-chevron{transform:rotate(90deg)}.tbw-accordion-content{display:block}}}.tbw-accordion-header{display:flex;align-items:center;gap:8px;width:100%;padding:10px 12px;border:none;background:transparent;color:var(--tbw-color-fg);font-size:13px;font-weight:600;text-align:left;cursor:pointer;user-select:none;&:hover{background:var(--tbw-color-row-hover)}}.tbw-accordion-chevron{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;font-size:10px;color:var(--tbw-color-fg-muted);transition:transform .15s ease;flex-shrink:0}.tbw-accordion-icon{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;font-size:14px;flex-shrink:0}.tbw-accordion-title{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tbw-accordion-content{display:none}.tbw-expanding{animation:tbw-expand var(--tbw-animation-duration) var(--tbw-animation-easing) forwards;overflow:hidden}.tbw-collapsing{animation:tbw-collapse var(--tbw-animation-duration) var(--tbw-animation-easing) forwards;overflow:hidden}&[data-animation-mode=off]{--tbw-animation-enabled: 0;--tbw-animation-duration: 0ms;.data-grid-row[data-animating]{animation:none}}}@media(forced-colors:active){tbw-grid{--tbw-color-border: CanvasText;--tbw-color-border-strong: CanvasText;--tbw-color-border-cell: CanvasText;--tbw-color-border-header: CanvasText;--tbw-color-fg: CanvasText;--tbw-color-bg: Canvas;--tbw-color-panel-bg: Canvas;--tbw-color-header-bg: Canvas;--tbw-color-header-fg: CanvasText;--tbw-color-accent: Highlight;--tbw-color-accent-fg: HighlightText;--tbw-color-selection: Highlight;--tbw-color-row-hover: Highlight;--tbw-focus-outline: 2px solid Highlight;--tbw-range-border-color: Highlight;.cell:focus,.cell.active-cell{outline:2px solid Highlight!important;outline-offset:-2px}.data-grid-row[aria-selected=true]{background:Highlight!important;color:HighlightText!important}}}@media(prefers-reduced-motion:reduce){tbw-grid[data-animation-mode=reduced-motion]{--tbw-animation-enabled: 0;--tbw-animation-duration: 0ms;.data-grid-row[data-animating]{animation:none}}}@keyframes tbw-expand{0%{opacity:0;max-height:0;transform:translateY(-8px)}to{opacity:1;max-height:500px;transform:translateY(0)}}@keyframes tbw-collapse{0%{opacity:1;max-height:500px;transform:translateY(0)}to{opacity:0;max-height:0;transform:translateY(-8px)}}@keyframes tbw-row-change{0%{background-color:transparent}20%{background-color:var(--tbw-row-change-color)}to{background-color:transparent}}@keyframes tbw-row-insert{0%{opacity:0;max-height:0;overflow:hidden}to{opacity:1;max-height:var(--tbw-row-height, 28px);overflow:hidden}}@keyframes tbw-row-remove{0%{opacity:1;transform:translateY(0);max-height:var(--tbw-row-height, 28px)}to{opacity:0;max-height:0;transform:translateY(-8px)}}tbw-grid .data-grid-row[data-animating=change]{animation:tbw-row-change var(--tbw-row-change-duration) ease-out}tbw-grid .data-grid-row[data-animating=insert]{animation:tbw-row-insert var(--tbw-row-insert-duration) ease-out;will-change:max-height,opacity}tbw-grid .data-grid-row[data-animating=remove]{animation:tbw-row-remove var(--tbw-row-remove-duration) ease-out forwards;will-change:max-height,opacity,transform;pointer-events:none}}', B = {
|
|
2
2
|
STRETCH: "stretch",
|
|
3
3
|
FIXED: "fixed"
|
|
4
|
-
},
|
|
4
|
+
}, Be = {
|
|
5
5
|
mode: "reduced-motion",
|
|
6
6
|
duration: 200,
|
|
7
7
|
easing: "ease-out"
|
|
@@ -15,7 +15,7 @@ const ce = '@layer tbw-base,tbw-plugins,tbw-theme;@layer tbw-base{:root{color-sc
|
|
|
15
15
|
dragHandle: "⋮⋮",
|
|
16
16
|
toolPanel: "☰"
|
|
17
17
|
};
|
|
18
|
-
function
|
|
18
|
+
function Ge(t) {
|
|
19
19
|
return Array.from(t.querySelectorAll("tbw-grid-column")).map((o) => {
|
|
20
20
|
const n = o.getAttribute("field") || "";
|
|
21
21
|
if (!n) return null;
|
|
@@ -44,15 +44,15 @@ function Ve(t) {
|
|
|
44
44
|
const _ = y.createRenderer(b);
|
|
45
45
|
_ && (h.viewRenderer = _);
|
|
46
46
|
}
|
|
47
|
-
const E = m ?? o,
|
|
48
|
-
if (
|
|
49
|
-
const _ =
|
|
47
|
+
const E = m ?? o, C = T.find((_) => _.canHandle(E));
|
|
48
|
+
if (C) {
|
|
49
|
+
const _ = C.createEditor(E);
|
|
50
50
|
_ && (h.editor = _);
|
|
51
51
|
}
|
|
52
52
|
return h;
|
|
53
53
|
}).filter((o) => !!o);
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function ue(t, e) {
|
|
56
56
|
if ((!t || !t.length) && (!e || !e.length)) return [];
|
|
57
57
|
if (!t || !t.length) return e || [];
|
|
58
58
|
if (!e || !e.length) return t;
|
|
@@ -76,7 +76,7 @@ function de(t, e) {
|
|
|
76
76
|
});
|
|
77
77
|
return Object.keys(o).forEach((i) => n.push(o[i])), n;
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function fe(t, e) {
|
|
80
80
|
try {
|
|
81
81
|
t.part?.add?.(e);
|
|
82
82
|
} catch {
|
|
@@ -84,7 +84,7 @@ function he(t, e) {
|
|
|
84
84
|
const o = t.getAttribute("part");
|
|
85
85
|
o ? o.split(/\s+/).includes(e) || t.setAttribute("part", o + " " + e) : t.setAttribute("part", e);
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function pe(t) {
|
|
88
88
|
const e = t.effectiveConfig?.fitMode || t.fitMode || B.STRETCH;
|
|
89
89
|
if (e !== B.STRETCH && e !== B.FIXED || t.__didInitialAutoSize || !t.isConnected) return;
|
|
90
90
|
const o = Array.from(t._headerRowEl?.children || []);
|
|
@@ -111,23 +111,23 @@ function U(t) {
|
|
|
111
111
|
return n != null ? `minmax(${n}px, 1fr)` : "1fr";
|
|
112
112
|
}).join(" ").trim() : t._gridTemplate = t._visibleColumns.map((o) => o.width ? `${o.width}px` : "max-content").join(" "), t.style.setProperty("--tbw-column-template", t._gridTemplate);
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function Xe(t) {
|
|
115
115
|
return t == null ? "string" : typeof t == "number" ? "number" : typeof t == "boolean" ? "boolean" : t instanceof Date || typeof t == "string" && /\d{4}-\d{2}-\d{2}/.test(t) && !isNaN(Date.parse(t)) ? "date" : "string";
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function Ye(t, e) {
|
|
118
118
|
const o = t[0] || {}, n = Object.keys(o).map((r) => {
|
|
119
|
-
const s = o[r], l =
|
|
119
|
+
const s = o[r], l = Xe(s);
|
|
120
120
|
return { field: r, header: r.charAt(0).toUpperCase() + r.slice(1), type: l };
|
|
121
121
|
}), i = {};
|
|
122
122
|
return n.forEach((r) => {
|
|
123
123
|
i[r.field] = r.type || "string";
|
|
124
124
|
}), { columns: n, typeMap: i };
|
|
125
125
|
}
|
|
126
|
-
const
|
|
127
|
-
function
|
|
126
|
+
const je = /{{\s*([^}]+)\s*}}/g, O = "__DG_EMPTY__", Ke = /^[\w$. '?+\-*/%:()!<>=,&|]+$/, Ze = /__(proto|defineGetter|defineSetter)|constructor|window|globalThis|global|process|Function|import|eval|Reflect|Proxy|Error|arguments|document|location|cookie|localStorage|sessionStorage|indexedDB|fetch|XMLHttpRequest|WebSocket|Worker|SharedWorker|ServiceWorker|opener|parent|top|frames|self|this\b/;
|
|
127
|
+
function Je(t) {
|
|
128
128
|
return !t || typeof t != "string" ? "" : t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
129
129
|
}
|
|
130
|
-
const
|
|
130
|
+
const Qe = /* @__PURE__ */ new Set([
|
|
131
131
|
"script",
|
|
132
132
|
"iframe",
|
|
133
133
|
"object",
|
|
@@ -152,23 +152,23 @@ const Ze = /* @__PURE__ */ new Set([
|
|
|
152
152
|
"plaintext",
|
|
153
153
|
"xmp",
|
|
154
154
|
"listing"
|
|
155
|
-
]),
|
|
155
|
+
]), ge = /^on\w+$/i, et = /* @__PURE__ */ new Set(["href", "src", "action", "formaction", "data", "srcdoc", "xlink:href", "poster", "srcset"]), tt = /^\s*(javascript|vbscript|data|blob):/i;
|
|
156
156
|
function K(t) {
|
|
157
157
|
if (!t || typeof t != "string") return "";
|
|
158
158
|
if (t.indexOf("<") === -1) return t;
|
|
159
159
|
const e = document.createElement("template");
|
|
160
|
-
return e.innerHTML = t,
|
|
160
|
+
return e.innerHTML = t, ot(e.content), e.innerHTML;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function ot(t) {
|
|
163
163
|
const e = [], o = t.querySelectorAll("*");
|
|
164
164
|
for (const n of o) {
|
|
165
165
|
const i = n.tagName.toLowerCase();
|
|
166
|
-
if (
|
|
166
|
+
if (Qe.has(i)) {
|
|
167
167
|
e.push(n);
|
|
168
168
|
continue;
|
|
169
169
|
}
|
|
170
170
|
if ((i === "svg" || n.namespaceURI === "http://www.w3.org/2000/svg") && Array.from(n.attributes).some(
|
|
171
|
-
(l) =>
|
|
171
|
+
(l) => ge.test(l.name) || l.name === "href" || l.name === "xlink:href"
|
|
172
172
|
)) {
|
|
173
173
|
e.push(n);
|
|
174
174
|
continue;
|
|
@@ -176,11 +176,11 @@ function et(t) {
|
|
|
176
176
|
const r = [];
|
|
177
177
|
for (const s of n.attributes) {
|
|
178
178
|
const l = s.name.toLowerCase();
|
|
179
|
-
if (
|
|
179
|
+
if (ge.test(l)) {
|
|
180
180
|
r.push(s.name);
|
|
181
181
|
continue;
|
|
182
182
|
}
|
|
183
|
-
if (
|
|
183
|
+
if (et.has(l) && tt.test(s.value)) {
|
|
184
184
|
r.push(s.name);
|
|
185
185
|
continue;
|
|
186
186
|
}
|
|
@@ -193,22 +193,22 @@ function et(t) {
|
|
|
193
193
|
}
|
|
194
194
|
e.forEach((n) => n.remove());
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function Le(t, e) {
|
|
197
197
|
if (!t || t.indexOf("{{") === -1) return t;
|
|
198
|
-
const o = [], n = t.replace(
|
|
199
|
-
const a =
|
|
198
|
+
const o = [], n = t.replace(je, (l, c) => {
|
|
199
|
+
const a = nt(c, e);
|
|
200
200
|
return o.push({ expr: c.trim(), result: a }), a;
|
|
201
|
-
}), i =
|
|
201
|
+
}), i = it(n), r = o.length && o.every((l) => l.result === "" || l.result === O);
|
|
202
202
|
return /Reflect\.|\bProxy\b|ownKeys\(/.test(t) || r ? "" : i;
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function nt(t, e) {
|
|
205
205
|
if (t = (t || "").trim(), !t || /\b(Reflect|Proxy|ownKeys)\b/.test(t)) return O;
|
|
206
206
|
if (t === "value") return e.value == null ? O : String(e.value);
|
|
207
207
|
if (t.startsWith("row.") && !/[()?]/.test(t) && !t.includes(":")) {
|
|
208
208
|
const n = t.slice(4), i = e.row ? e.row[n] : void 0;
|
|
209
209
|
return i == null ? O : String(i);
|
|
210
210
|
}
|
|
211
|
-
if (t.length > 80 || !
|
|
211
|
+
if (t.length > 80 || !Ke.test(t) || Ze.test(t)) return O;
|
|
212
212
|
const o = t.match(/\./g);
|
|
213
213
|
if (o && o.length > 1) return O;
|
|
214
214
|
try {
|
|
@@ -218,10 +218,10 @@ function tt(t, e) {
|
|
|
218
218
|
return O;
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
|
-
function
|
|
221
|
+
function it(t) {
|
|
222
222
|
return t && t.replace(new RegExp(O, "g"), "").replace(/Reflect\.[^<>{}\s]+/g, "").replace(/\bProxy\b/g, "").replace(/ownKeys\([^)]*\)/g, "");
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function rt(t) {
|
|
225
225
|
if (/Reflect|Proxy|ownKeys/.test(t.textContent || "")) {
|
|
226
226
|
if (Array.from(t.childNodes).forEach((e) => {
|
|
227
227
|
e.nodeType === Node.TEXT_NODE && /Reflect|Proxy|ownKeys/.test(e.textContent || "") && (e.textContent = "");
|
|
@@ -233,12 +233,12 @@ function nt(t) {
|
|
|
233
233
|
(t.textContent || "").trim().length === 0 && (t.textContent = "");
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
function
|
|
237
|
-
const e = /Reflect\.|\bProxy\b|ownKeys\(/.test(t), o = ((n) => e ? "" :
|
|
236
|
+
function we(t) {
|
|
237
|
+
const e = /Reflect\.|\bProxy\b|ownKeys\(/.test(t), o = ((n) => e ? "" : Le(t, n));
|
|
238
238
|
return o.__blocked = e, o;
|
|
239
239
|
}
|
|
240
|
-
const
|
|
241
|
-
class
|
|
240
|
+
const st = 100;
|
|
241
|
+
class lt {
|
|
242
242
|
#n;
|
|
243
243
|
#c;
|
|
244
244
|
#f;
|
|
@@ -320,7 +320,7 @@ class rt {
|
|
|
320
320
|
const e = (this.#h.columns?.length ?? 0) > 0;
|
|
321
321
|
if (!this.#u && e)
|
|
322
322
|
return;
|
|
323
|
-
const o = this.#
|
|
323
|
+
const o = this.#C();
|
|
324
324
|
this.#u = !1, this.#i = o, Object.freeze(this.#i), this.#i.columns && Object.freeze(this.#i.columns), this.#h = this.#A(this.#i), this.#p();
|
|
325
325
|
}
|
|
326
326
|
#A(e) {
|
|
@@ -339,23 +339,23 @@ class rt {
|
|
|
339
339
|
n.width == null && (n.width = 80);
|
|
340
340
|
}), this.#r.applyAnimationConfig(e);
|
|
341
341
|
}
|
|
342
|
-
#
|
|
342
|
+
#C() {
|
|
343
343
|
const e = this.#n ? { ...this.#n } : {}, o = Array.isArray(e.columns) ? [...e.columns] : [], n = (this.#d ?? []).map((s) => ({
|
|
344
344
|
...s
|
|
345
345
|
}));
|
|
346
|
-
let i =
|
|
346
|
+
let i = ue(
|
|
347
347
|
o,
|
|
348
348
|
n
|
|
349
349
|
);
|
|
350
|
-
this.#c && this.#c.length && (i =
|
|
350
|
+
this.#c && this.#c.length && (i = ue(
|
|
351
351
|
this.#c,
|
|
352
352
|
n
|
|
353
353
|
));
|
|
354
354
|
const r = this.#r.getRows();
|
|
355
|
-
return i.length === 0 && r.length && (i =
|
|
355
|
+
return i.length === 0 && r.length && (i = Ye(r).columns), i.length && (i.forEach((s) => {
|
|
356
356
|
s.sortable === void 0 && (s.sortable = !0), s.resizable === void 0 && (s.resizable = !0), s.__originalWidth === void 0 && typeof s.width == "number" && (s.__originalWidth = s.width);
|
|
357
357
|
}), i.forEach((s) => {
|
|
358
|
-
s.__viewTemplate && !s.__compiledView && (s.__compiledView =
|
|
358
|
+
s.__viewTemplate && !s.__compiledView && (s.__compiledView = we(s.__viewTemplate.innerHTML)), s.__editorTemplate && !s.__compiledEditor && (s.__compiledEditor = we(s.__editorTemplate.innerHTML));
|
|
359
359
|
}), e.columns = i), this.#f && (e.fitMode = this.#f), e.fitMode || (e.fitMode = "stretch"), this.#y(e), e.columnState && !this.#w && (this.#w = e.columnState), e;
|
|
360
360
|
}
|
|
361
361
|
#y(e) {
|
|
@@ -380,7 +380,7 @@ class rt {
|
|
|
380
380
|
h.sort((u, p) => (u.order ?? 0) - (p.order ?? 0)), e.shell.header.toolbarContents = h;
|
|
381
381
|
}
|
|
382
382
|
collectState(e) {
|
|
383
|
-
const o = this.columns, n = this.#
|
|
383
|
+
const o = this.columns, n = this.#v();
|
|
384
384
|
return {
|
|
385
385
|
columns: o.map((i, r) => {
|
|
386
386
|
const s = {
|
|
@@ -438,7 +438,7 @@ class rt {
|
|
|
438
438
|
});
|
|
439
439
|
this.requestStateChange(e);
|
|
440
440
|
}
|
|
441
|
-
#
|
|
441
|
+
#v() {
|
|
442
442
|
const e = /* @__PURE__ */ new Map(), o = this.#r.getSortState();
|
|
443
443
|
return o && e.set(o.field, {
|
|
444
444
|
direction: o.direction === 1 ? "asc" : "desc",
|
|
@@ -450,7 +450,7 @@ class rt {
|
|
|
450
450
|
this.#g = void 0;
|
|
451
451
|
const o = this.collectState(e);
|
|
452
452
|
this.#r.emit("column-state-change", o);
|
|
453
|
-
},
|
|
453
|
+
}, st);
|
|
454
454
|
}
|
|
455
455
|
setColumnVisible(e, o) {
|
|
456
456
|
const n = this.columns, i = n.find((s) => s.field === e);
|
|
@@ -498,7 +498,7 @@ class rt {
|
|
|
498
498
|
this.columns = n, this.#r.renderHeader(), this.#r.updateTemplate(), this.#r.refreshVirtualWindow();
|
|
499
499
|
}
|
|
500
500
|
parseLightDomColumns(e) {
|
|
501
|
-
this.#d || (this.#s = Array.from(e.querySelectorAll("tbw-grid-column")), this.#d = this.#s.length ?
|
|
501
|
+
this.#d || (this.#s = Array.from(e.querySelectorAll("tbw-grid-column")), this.#d = this.#s.length ? Ge(e) : []);
|
|
502
502
|
}
|
|
503
503
|
clearLightDomCache() {
|
|
504
504
|
this.#d = void 0;
|
|
@@ -551,10 +551,10 @@ class rt {
|
|
|
551
551
|
this.#l?.disconnect(), this.#m = [], this.#g && clearTimeout(this.#g);
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function He(t) {
|
|
555
555
|
return `<span role="checkbox" aria-checked="${t}" aria-label="${t}">${t ? "🗹" : "☐"}</span>`;
|
|
556
556
|
}
|
|
557
|
-
function
|
|
557
|
+
function Oe(t) {
|
|
558
558
|
if (t == null || t === "") return "";
|
|
559
559
|
if (t instanceof Date)
|
|
560
560
|
return isNaN(t.getTime()) ? "" : t.toLocaleDateString();
|
|
@@ -564,7 +564,7 @@ function Le(t) {
|
|
|
564
564
|
}
|
|
565
565
|
return "";
|
|
566
566
|
}
|
|
567
|
-
function
|
|
567
|
+
function De(t) {
|
|
568
568
|
if (!t) return -1;
|
|
569
569
|
const e = t.getAttribute("data-row");
|
|
570
570
|
if (e) return parseInt(e, 10);
|
|
@@ -577,15 +577,15 @@ function He(t) {
|
|
|
577
577
|
if (i[r] === o) return r;
|
|
578
578
|
return -1;
|
|
579
579
|
}
|
|
580
|
-
function
|
|
580
|
+
function at(t) {
|
|
581
581
|
if (!t) return -1;
|
|
582
582
|
const e = t.getAttribute("data-col");
|
|
583
583
|
return e ? parseInt(e, 10) : -1;
|
|
584
584
|
}
|
|
585
|
-
function
|
|
585
|
+
function ae(t) {
|
|
586
586
|
t && t.querySelectorAll(".cell-focus").forEach((e) => e.classList.remove("cell-focus"));
|
|
587
587
|
}
|
|
588
|
-
function
|
|
588
|
+
function Me(t, e) {
|
|
589
589
|
const o = e.renderer || e.viewRenderer;
|
|
590
590
|
if (o) return o;
|
|
591
591
|
if (!e.type) return;
|
|
@@ -599,31 +599,31 @@ function Oe(t, e) {
|
|
|
599
599
|
return r.renderer;
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
|
-
const
|
|
602
|
+
const ze = 'input,select,textarea,[contenteditable="true"],[contenteditable=""],[tabindex]:not([tabindex="-1"])';
|
|
603
603
|
function ee(t) {
|
|
604
604
|
return (t.__editingCellCount ?? 0) > 0;
|
|
605
605
|
}
|
|
606
606
|
function te(t) {
|
|
607
607
|
t.__editingCellCount = 0, t.removeAttribute("data-has-editing"), t.querySelectorAll(".cell.editing").forEach((o) => o.classList.remove("editing"));
|
|
608
608
|
}
|
|
609
|
-
const
|
|
610
|
-
|
|
611
|
-
const
|
|
612
|
-
|
|
613
|
-
function
|
|
614
|
-
return
|
|
609
|
+
const Ne = document.createElement("template");
|
|
610
|
+
Ne.innerHTML = '<div class="cell" role="gridcell" part="cell"></div>';
|
|
611
|
+
const ke = document.createElement("template");
|
|
612
|
+
ke.innerHTML = '<div class="data-grid-row" role="row" part="row"></div>';
|
|
613
|
+
function ct() {
|
|
614
|
+
return Ne.content.firstElementChild.cloneNode(!0);
|
|
615
615
|
}
|
|
616
|
-
function
|
|
617
|
-
return
|
|
616
|
+
function dt() {
|
|
617
|
+
return ke.content.firstElementChild.cloneNode(!0);
|
|
618
618
|
}
|
|
619
619
|
function X(t) {
|
|
620
620
|
t.__cellDisplayCache = void 0, t.__cellCacheEpoch = void 0, t.__hasSpecialColumns = void 0;
|
|
621
621
|
}
|
|
622
|
-
function
|
|
622
|
+
function ht(t, e, o, n, i) {
|
|
623
623
|
const r = Math.max(0, o - e), s = t._bodyEl, l = t._visibleColumns, c = l.length;
|
|
624
624
|
let a = t.__cachedHeaderRowCount;
|
|
625
625
|
for (a === void 0 && (a = t.querySelector(".header-group-row") ? 2 : 1, t.__cachedHeaderRowCount = a); t._rowPool.length < r; ) {
|
|
626
|
-
const p =
|
|
626
|
+
const p = dt();
|
|
627
627
|
t._rowPool.push(p);
|
|
628
628
|
}
|
|
629
629
|
if (t._rowPool.length > r) {
|
|
@@ -660,11 +660,11 @@ function ct(t, e, o, n, i) {
|
|
|
660
660
|
S && !P ? (te(d), V(t, d, g, f), d.__epoch = n, d.__rowDataRef = g) : oe(t, d, g, f);
|
|
661
661
|
}
|
|
662
662
|
let E = !1;
|
|
663
|
-
const
|
|
664
|
-
if (
|
|
663
|
+
const C = t.changedRowIds;
|
|
664
|
+
if (C && C.length > 0)
|
|
665
665
|
try {
|
|
666
666
|
const S = t.getRowId?.(g);
|
|
667
|
-
S && (E =
|
|
667
|
+
S && (E = C.includes(S));
|
|
668
668
|
} catch {
|
|
669
669
|
}
|
|
670
670
|
const _ = d.classList.contains("changed");
|
|
@@ -713,8 +713,8 @@ function oe(t, e, o, n) {
|
|
|
713
713
|
if (d.classList.contains("editing")) continue;
|
|
714
714
|
const w = r[g], m = o[w.field];
|
|
715
715
|
d.textContent = m == null ? "" : String(m), d.getAttribute("data-row") !== f && d.setAttribute("data-row", f);
|
|
716
|
-
const R = a === n && h === g,
|
|
717
|
-
R !==
|
|
716
|
+
const R = a === n && h === g, v = d.classList.contains("cell-focus");
|
|
717
|
+
R !== v && (d.classList.toggle("cell-focus", R), d.setAttribute("aria-selected", String(R))), u && t._afterCellRender?.({
|
|
718
718
|
row: o,
|
|
719
719
|
rowIndex: n,
|
|
720
720
|
column: w,
|
|
@@ -736,32 +736,32 @@ function oe(t, e, o, n) {
|
|
|
736
736
|
w.getAttribute("data-row") !== f && w.setAttribute("data-row", f);
|
|
737
737
|
const m = a === n && h === g, R = w.classList.contains("cell-focus");
|
|
738
738
|
m !== R && (w.classList.toggle("cell-focus", m), w.setAttribute("aria-selected", String(m)));
|
|
739
|
-
const
|
|
740
|
-
if (
|
|
739
|
+
const v = d.cellClass;
|
|
740
|
+
if (v) {
|
|
741
741
|
const E = w.getAttribute("data-dynamic-classes");
|
|
742
|
-
E && E.split(" ").forEach((
|
|
742
|
+
E && E.split(" ").forEach((C) => C && w.classList.remove(C));
|
|
743
743
|
try {
|
|
744
|
-
const
|
|
744
|
+
const C = o[d.field], _ = v(C, o, d);
|
|
745
745
|
if (_ && _.length > 0) {
|
|
746
746
|
const N = _.filter((S) => S && typeof S == "string");
|
|
747
747
|
N.forEach((S) => w.classList.add(S)), w.setAttribute("data-dynamic-classes", N.join(" "));
|
|
748
748
|
} else
|
|
749
749
|
w.removeAttribute("data-dynamic-classes");
|
|
750
|
-
} catch (
|
|
751
|
-
console.warn(`[tbw-grid] cellClass callback error for column '${d.field}':`,
|
|
750
|
+
} catch (C) {
|
|
751
|
+
console.warn(`[tbw-grid] cellClass callback error for column '${d.field}':`, C), w.removeAttribute("data-dynamic-classes");
|
|
752
752
|
}
|
|
753
753
|
}
|
|
754
754
|
if (w.classList.contains("editing")) continue;
|
|
755
|
-
const T =
|
|
755
|
+
const T = Me(t, d);
|
|
756
756
|
if (T) {
|
|
757
|
-
const E = o[d.field],
|
|
757
|
+
const E = o[d.field], C = T({
|
|
758
758
|
row: o,
|
|
759
759
|
value: E,
|
|
760
760
|
field: d.field,
|
|
761
761
|
column: d,
|
|
762
762
|
cellEl: w
|
|
763
763
|
});
|
|
764
|
-
typeof
|
|
764
|
+
typeof C == "string" ? w.innerHTML = K(C) : C instanceof Node ? C.parentElement !== w && (w.innerHTML = "", w.appendChild(C)) : C == null && (w.textContent = E == null ? "" : String(E)), u && t._afterCellRender?.({
|
|
765
765
|
row: o,
|
|
766
766
|
rowIndex: n,
|
|
767
767
|
column: d,
|
|
@@ -783,7 +783,7 @@ function oe(t, e, o, n) {
|
|
|
783
783
|
} catch (E) {
|
|
784
784
|
console.warn(`[tbw-grid] Format error in column '${d.field}':`, E), y = b == null ? "" : String(b);
|
|
785
785
|
}
|
|
786
|
-
else d.type === "date" ? (y =
|
|
786
|
+
else d.type === "date" ? (y = Oe(b), w.textContent = y) : d.type === "boolean" ? w.innerHTML = He(!!b) : (y = b == null ? "" : String(b), w.textContent = y);
|
|
787
787
|
u && t._afterCellRender?.({
|
|
788
788
|
row: o,
|
|
789
789
|
rowIndex: n,
|
|
@@ -799,7 +799,7 @@ function V(t, e, o, n) {
|
|
|
799
799
|
e.innerHTML = "";
|
|
800
800
|
const i = t._visibleColumns, r = i.length, s = t._focusRow, l = t._focusCol, c = t, a = t._hasAfterCellRenderHook?.() ?? !1, h = document.createDocumentFragment();
|
|
801
801
|
for (let u = 0; u < r; u++) {
|
|
802
|
-
const p = i[u], f =
|
|
802
|
+
const p = i[u], f = ct();
|
|
803
803
|
f.setAttribute("aria-colindex", String(u + 1)), f.setAttribute("data-col", String(u)), f.setAttribute("data-row", String(n)), f.setAttribute("data-field", p.field), f.setAttribute("data-header", p.header ?? p.field), p.type && f.setAttribute("data-type", p.type);
|
|
804
804
|
let g = o[p.field];
|
|
805
805
|
if (p.format)
|
|
@@ -808,11 +808,11 @@ function V(t, e, o, n) {
|
|
|
808
808
|
} catch (b) {
|
|
809
809
|
console.warn(`[tbw-grid] Format error in column '${p.field}':`, b);
|
|
810
810
|
}
|
|
811
|
-
const d = p.__compiledView, w = p.__viewTemplate, m =
|
|
812
|
-
let
|
|
811
|
+
const d = p.__compiledView, w = p.__viewTemplate, m = Me(t, p), R = p.externalView;
|
|
812
|
+
let v = !1;
|
|
813
813
|
if (m) {
|
|
814
814
|
const b = m({ row: o, value: g, field: p.field, column: p, cellEl: f });
|
|
815
|
-
typeof b == "string" ? (f.innerHTML = K(b),
|
|
815
|
+
typeof b == "string" ? (f.innerHTML = K(b), v = !0) : b instanceof Node ? b.parentElement !== f && (f.textContent = "", f.appendChild(b)) : b == null && (f.textContent = g == null ? "" : String(g));
|
|
816
816
|
} else if (R) {
|
|
817
817
|
const b = R, y = document.createElement("div");
|
|
818
818
|
y.setAttribute("data-external-view", ""), y.setAttribute("data-field", p.field), f.appendChild(y);
|
|
@@ -820,8 +820,8 @@ function V(t, e, o, n) {
|
|
|
820
820
|
if (b.mount)
|
|
821
821
|
try {
|
|
822
822
|
b.mount({ placeholder: y, context: E, spec: b });
|
|
823
|
-
} catch (
|
|
824
|
-
console.warn(`[tbw-grid] External view mount error for column '${p.field}':`,
|
|
823
|
+
} catch (C) {
|
|
824
|
+
console.warn(`[tbw-grid] External view mount error for column '${p.field}':`, C);
|
|
825
825
|
}
|
|
826
826
|
else
|
|
827
827
|
queueMicrotask(() => {
|
|
@@ -833,21 +833,21 @@ function V(t, e, o, n) {
|
|
|
833
833
|
detail: { placeholder: y, spec: b, context: E }
|
|
834
834
|
})
|
|
835
835
|
);
|
|
836
|
-
} catch (
|
|
837
|
-
console.warn(`[tbw-grid] External view event dispatch error for column '${p.field}':`,
|
|
836
|
+
} catch (C) {
|
|
837
|
+
console.warn(`[tbw-grid] External view event dispatch error for column '${p.field}':`, C);
|
|
838
838
|
}
|
|
839
839
|
});
|
|
840
840
|
y.setAttribute("data-mounted", "");
|
|
841
841
|
} else if (d) {
|
|
842
842
|
const b = d({ row: o, value: g, field: p.field, column: p }), y = d.__blocked;
|
|
843
|
-
f.innerHTML = y ? "" : K(b),
|
|
843
|
+
f.innerHTML = y ? "" : K(b), v = !0, y && (f.textContent = "", f.setAttribute("data-blocked-template", ""));
|
|
844
844
|
} else if (w) {
|
|
845
845
|
const b = w.innerHTML;
|
|
846
|
-
/Reflect\.|\bProxy\b|ownKeys\(/.test(b) ? (f.textContent = "", f.setAttribute("data-blocked-template", "")) : (f.innerHTML = K(
|
|
846
|
+
/Reflect\.|\bProxy\b|ownKeys\(/.test(b) ? (f.textContent = "", f.setAttribute("data-blocked-template", "")) : (f.innerHTML = K(Le(b, { row: o, value: g })), v = !0);
|
|
847
847
|
} else
|
|
848
|
-
p.type === "date" ? f.textContent =
|
|
849
|
-
if (
|
|
850
|
-
|
|
848
|
+
p.type === "date" ? f.textContent = Oe(g) : p.type === "boolean" ? f.innerHTML = He(!!g) : f.textContent = g == null ? "" : String(g);
|
|
849
|
+
if (v) {
|
|
850
|
+
rt(f);
|
|
851
851
|
const b = f.textContent || "";
|
|
852
852
|
/Proxy|Reflect\.ownKeys/.test(b) && (f.textContent = b.replace(/Proxy|Reflect\.ownKeys/g, "").trim(), /Proxy|Reflect\.ownKeys/.test(f.textContent || "") && (f.textContent = ""));
|
|
853
853
|
}
|
|
@@ -857,8 +857,8 @@ function V(t, e, o, n) {
|
|
|
857
857
|
try {
|
|
858
858
|
const b = o[p.field], y = T(b, o, p);
|
|
859
859
|
if (y && y.length > 0) {
|
|
860
|
-
const E = y.filter((
|
|
861
|
-
E.forEach((
|
|
860
|
+
const E = y.filter((C) => C && typeof C == "string");
|
|
861
|
+
E.forEach((C) => f.classList.add(C)), f.setAttribute("data-dynamic-classes", E.join(" "));
|
|
862
862
|
}
|
|
863
863
|
} catch (b) {
|
|
864
864
|
console.warn(`[tbw-grid] cellClass callback error for column '${p.field}':`, b);
|
|
@@ -875,9 +875,9 @@ function V(t, e, o, n) {
|
|
|
875
875
|
}
|
|
876
876
|
e.appendChild(h);
|
|
877
877
|
}
|
|
878
|
-
function
|
|
878
|
+
function me(t, e, o) {
|
|
879
879
|
if (e.target?.closest(".resize-handle")) return;
|
|
880
|
-
const n = o.querySelector(".cell[data-row]"), i =
|
|
880
|
+
const n = o.querySelector(".cell[data-row]"), i = De(n);
|
|
881
881
|
if (i < 0) return;
|
|
882
882
|
const r = t._rows[i];
|
|
883
883
|
if (!r || t._dispatchRowClick?.(e, i, r, o))
|
|
@@ -890,8 +890,8 @@ function ge(t, e, o) {
|
|
|
890
890
|
return;
|
|
891
891
|
const c = t._focusRow !== i || t._focusCol !== l;
|
|
892
892
|
if (t._focusRow = i, t._focusCol = l, s.classList.contains("editing")) {
|
|
893
|
-
c && (
|
|
894
|
-
const a = s.querySelector(
|
|
893
|
+
c && (ae(t._bodyEl ?? t), s.classList.add("cell-focus"));
|
|
894
|
+
const a = s.querySelector(ze);
|
|
895
895
|
try {
|
|
896
896
|
a?.focus({ preventScroll: !0 });
|
|
897
897
|
} catch {
|
|
@@ -902,7 +902,7 @@ function ge(t, e, o) {
|
|
|
902
902
|
}
|
|
903
903
|
}
|
|
904
904
|
}
|
|
905
|
-
function
|
|
905
|
+
function ut(t, e) {
|
|
906
906
|
if (t._dispatchKeyDown?.(e))
|
|
907
907
|
return;
|
|
908
908
|
const o = t._rows.length - 1, n = t._visibleColumns.length - 1, i = t._activeEditRows !== void 0 && t._activeEditRows !== -1, s = t._visibleColumns[t._focusCol]?.type, l = e.composedPath?.() ?? [], c = l.length ? l[0] : e.target, a = (h) => {
|
|
@@ -957,11 +957,11 @@ function dt(t, e) {
|
|
|
957
957
|
detail: m
|
|
958
958
|
});
|
|
959
959
|
t.dispatchEvent(R);
|
|
960
|
-
const
|
|
960
|
+
const v = new CustomEvent("activate-cell", {
|
|
961
961
|
cancelable: !0,
|
|
962
962
|
detail: { row: h, col: u }
|
|
963
963
|
});
|
|
964
|
-
if (t.dispatchEvent(
|
|
964
|
+
if (t.dispatchEvent(v), R.defaultPrevented || v.defaultPrevented) {
|
|
965
965
|
e.preventDefault();
|
|
966
966
|
return;
|
|
967
967
|
}
|
|
@@ -982,7 +982,7 @@ function $(t, e) {
|
|
|
982
982
|
}
|
|
983
983
|
}
|
|
984
984
|
const o = t._activeEditRows !== void 0 && t._activeEditRows !== -1;
|
|
985
|
-
o || t.refreshVirtualWindow(!1),
|
|
985
|
+
o || t.refreshVirtualWindow(!1), ae(t._bodyEl), Array.from(t._bodyEl.querySelectorAll('[aria-selected="true"]')).forEach((s) => {
|
|
986
986
|
s.setAttribute("aria-selected", "false");
|
|
987
987
|
});
|
|
988
988
|
const n = t._focusRow, i = t._virtualization.start ?? 0, r = t._virtualization.end ?? t._rows.length;
|
|
@@ -1005,7 +1005,7 @@ function $(t, e) {
|
|
|
1005
1005
|
}
|
|
1006
1006
|
}
|
|
1007
1007
|
if (t._activeEditRows !== void 0 && t._activeEditRows !== -1 && l.classList.contains("editing")) {
|
|
1008
|
-
const a = l.querySelector(
|
|
1008
|
+
const a = l.querySelector(ze);
|
|
1009
1009
|
if (a && document.activeElement !== a)
|
|
1010
1010
|
try {
|
|
1011
1011
|
a.focus({ preventScroll: !0 });
|
|
@@ -1022,11 +1022,11 @@ function $(t, e) {
|
|
|
1022
1022
|
}
|
|
1023
1023
|
}
|
|
1024
1024
|
const Z = /* @__PURE__ */ new WeakMap();
|
|
1025
|
-
function
|
|
1026
|
-
const o =
|
|
1027
|
-
o < 0 || n < 0 || (t._focusRow = o, t._focusCol = n,
|
|
1025
|
+
function ft(t, e) {
|
|
1026
|
+
const o = De(e), n = at(e);
|
|
1027
|
+
o < 0 || n < 0 || (t._focusRow = o, t._focusCol = n, ae(t._bodyEl), e.classList.add("cell-focus"), e.setAttribute("aria-selected", "true"));
|
|
1028
1028
|
}
|
|
1029
|
-
function
|
|
1029
|
+
function ce(t, e, o, n) {
|
|
1030
1030
|
let i = null;
|
|
1031
1031
|
const r = o.composedPath?.();
|
|
1032
1032
|
if (r && r.length > 0 ? i = r[0] : i = o.target, i && !e.contains(i)) {
|
|
@@ -1050,74 +1050,74 @@ function ae(t, e, o, n) {
|
|
|
1050
1050
|
cell: a !== void 0 && h !== void 0 && a >= 0 && h >= 0 ? { row: a, col: h } : void 0
|
|
1051
1051
|
};
|
|
1052
1052
|
}
|
|
1053
|
-
function
|
|
1054
|
-
const n =
|
|
1053
|
+
function pt(t, e, o) {
|
|
1054
|
+
const n = ce(t, e, o, "mousedown");
|
|
1055
1055
|
(t._dispatchCellMouseDown?.(n) ?? !1) && Z.set(t, !0);
|
|
1056
1056
|
}
|
|
1057
|
-
function
|
|
1057
|
+
function gt(t, e, o) {
|
|
1058
1058
|
if (!Z.get(t)) return;
|
|
1059
|
-
const n =
|
|
1059
|
+
const n = ce(t, e, o, "mousemove");
|
|
1060
1060
|
t._dispatchCellMouseMove?.(n);
|
|
1061
1061
|
}
|
|
1062
|
-
function
|
|
1062
|
+
function wt(t, e, o) {
|
|
1063
1063
|
if (!Z.get(t)) return;
|
|
1064
|
-
const n =
|
|
1064
|
+
const n = ce(t, e, o, "mouseup");
|
|
1065
1065
|
t._dispatchCellMouseUp?.(n), Z.set(t, !1);
|
|
1066
1066
|
}
|
|
1067
|
-
function
|
|
1067
|
+
function mt(t, e, o) {
|
|
1068
1068
|
e.addEventListener(
|
|
1069
1069
|
"mousedown",
|
|
1070
1070
|
(n) => {
|
|
1071
1071
|
const i = n.target.closest(".cell[data-col]");
|
|
1072
|
-
i && (i.classList.contains("editing") ||
|
|
1072
|
+
i && (i.classList.contains("editing") || ft(t, i));
|
|
1073
1073
|
},
|
|
1074
1074
|
{ signal: o }
|
|
1075
1075
|
), e.addEventListener(
|
|
1076
1076
|
"click",
|
|
1077
1077
|
(n) => {
|
|
1078
1078
|
const i = n.target.closest(".data-grid-row");
|
|
1079
|
-
i &&
|
|
1079
|
+
i && me(t, n, i);
|
|
1080
1080
|
},
|
|
1081
1081
|
{ signal: o }
|
|
1082
1082
|
), e.addEventListener(
|
|
1083
1083
|
"dblclick",
|
|
1084
1084
|
(n) => {
|
|
1085
1085
|
const i = n.target.closest(".data-grid-row");
|
|
1086
|
-
i &&
|
|
1086
|
+
i && me(t, n, i);
|
|
1087
1087
|
},
|
|
1088
1088
|
{ signal: o }
|
|
1089
1089
|
);
|
|
1090
1090
|
}
|
|
1091
|
-
function
|
|
1092
|
-
e.addEventListener("keydown", (i) =>
|
|
1091
|
+
function bt(t, e, o, n) {
|
|
1092
|
+
e.addEventListener("keydown", (i) => ut(t, i), { signal: n }), o.addEventListener("mousedown", (i) => pt(t, o, i), { signal: n }), document.addEventListener("mousemove", (i) => gt(t, o, i), { signal: n }), document.addEventListener("mouseup", (i) => wt(t, o, i), { signal: n });
|
|
1093
1093
|
}
|
|
1094
|
-
function
|
|
1094
|
+
function vt(t, e) {
|
|
1095
1095
|
return t == null && e == null ? 0 : t == null ? -1 : e == null || t > e ? 1 : t < e ? -1 : 0;
|
|
1096
1096
|
}
|
|
1097
|
-
function
|
|
1098
|
-
const i = o.find((l) => l.field === e.field)?.sortComparator ??
|
|
1097
|
+
function Ct(t, e, o) {
|
|
1098
|
+
const i = o.find((l) => l.field === e.field)?.sortComparator ?? vt, { field: r, direction: s } = e;
|
|
1099
1099
|
return [...t].sort((l, c) => i(l[r], c[r], l, c) * s);
|
|
1100
1100
|
}
|
|
1101
|
-
function
|
|
1101
|
+
function be(t, e, o, n) {
|
|
1102
1102
|
t._rows = e, t.__rowRenderEpoch++, t._rowPool.forEach((i) => i.__epoch = -1), J(t), t.refreshVirtualWindow(!0), t.dispatchEvent(
|
|
1103
1103
|
new CustomEvent("sort-change", { detail: { field: o.field, direction: n } })
|
|
1104
1104
|
), t.requestStateChange?.();
|
|
1105
1105
|
}
|
|
1106
|
-
function
|
|
1107
|
-
!t._sortState || t._sortState.field !== e.field ? (t._sortState || (t.__originalOrder = t._rows.slice()),
|
|
1106
|
+
function ve(t, e) {
|
|
1107
|
+
!t._sortState || t._sortState.field !== e.field ? (t._sortState || (t.__originalOrder = t._rows.slice()), Ce(t, e, 1)) : t._sortState.direction === 1 ? Ce(t, e, -1) : (t._sortState = null, t.__rowRenderEpoch++, t._rowPool.forEach((n) => n.__epoch = -1), t._rows = t.__originalOrder.slice(), J(t), t._headerRowEl?.querySelectorAll('[role="columnheader"].sortable')?.forEach((n) => {
|
|
1108
1108
|
n.getAttribute("aria-sort") ? (n.getAttribute("aria-sort") === "ascending" || n.getAttribute("aria-sort") === "descending") && (t._sortState || n.setAttribute("aria-sort", "none")) : n.setAttribute("aria-sort", "none");
|
|
1109
1109
|
}), t.refreshVirtualWindow(!0), t.dispatchEvent(
|
|
1110
1110
|
new CustomEvent("sort-change", { detail: { field: e.field, direction: 0 } })
|
|
1111
1111
|
), t.requestStateChange?.());
|
|
1112
1112
|
}
|
|
1113
|
-
function
|
|
1113
|
+
function Ce(t, e, o) {
|
|
1114
1114
|
t._sortState = { field: e.field, direction: o };
|
|
1115
|
-
const n = { field: e.field, direction: o }, i = t._columns, s = (t.effectiveConfig?.sortHandler ??
|
|
1115
|
+
const n = { field: e.field, direction: o }, i = t._columns, s = (t.effectiveConfig?.sortHandler ?? Ct)(t._rows, n, i);
|
|
1116
1116
|
s && typeof s.then == "function" ? s.then((l) => {
|
|
1117
|
-
|
|
1118
|
-
}) :
|
|
1117
|
+
be(t, l, e, o);
|
|
1118
|
+
}) : be(t, s, e, o);
|
|
1119
1119
|
}
|
|
1120
|
-
function
|
|
1120
|
+
function yt(t, e) {
|
|
1121
1121
|
typeof e == "string" ? t.textContent = e : e instanceof HTMLElement && (t.innerHTML = "", t.appendChild(e.cloneNode(!0)));
|
|
1122
1122
|
}
|
|
1123
1123
|
function J(t) {
|
|
@@ -1125,7 +1125,7 @@ function J(t) {
|
|
|
1125
1125
|
const e = t._headerRowEl;
|
|
1126
1126
|
e && (e.innerHTML = "", t._visibleColumns.forEach((o, n) => {
|
|
1127
1127
|
const i = document.createElement("div");
|
|
1128
|
-
i.className = "cell",
|
|
1128
|
+
i.className = "cell", fe(i, "header-cell"), i.setAttribute("role", "columnheader"), i.setAttribute("aria-colindex", String(n + 1)), i.setAttribute("data-field", o.field), i.setAttribute("data-col", String(n));
|
|
1129
1129
|
const r = o.__headerTemplate;
|
|
1130
1130
|
if (r) Array.from(r.childNodes).forEach((s) => i.appendChild(s.cloneNode(!0)));
|
|
1131
1131
|
else {
|
|
@@ -1135,14 +1135,14 @@ function J(t) {
|
|
|
1135
1135
|
if (o.sortable) {
|
|
1136
1136
|
i.classList.add("sortable"), i.tabIndex = 0;
|
|
1137
1137
|
const s = document.createElement("span");
|
|
1138
|
-
|
|
1138
|
+
fe(s, "sort-indicator");
|
|
1139
1139
|
const l = t._sortState?.field === o.field ? t._sortState.direction : 0, c = { ...z, ...t.icons }, a = l === 1 ? c.sortAsc : l === -1 ? c.sortDesc : c.sortNone;
|
|
1140
|
-
|
|
1141
|
-
t._resizeController?.isResizing || t._dispatchHeaderClick?.(h, n, i) ||
|
|
1140
|
+
yt(s, a), i.appendChild(s), i.setAttribute("aria-sort", l === 0 ? "none" : l === 1 ? "ascending" : "descending"), i.addEventListener("click", (h) => {
|
|
1141
|
+
t._resizeController?.isResizing || t._dispatchHeaderClick?.(h, n, i) || ve(t, o);
|
|
1142
1142
|
}), i.addEventListener("keydown", (h) => {
|
|
1143
1143
|
if (h.key === "Enter" || h.key === " ") {
|
|
1144
1144
|
if (h.preventDefault(), t._dispatchHeaderClick?.(h, n, i)) return;
|
|
1145
|
-
|
|
1145
|
+
ve(t, o);
|
|
1146
1146
|
}
|
|
1147
1147
|
});
|
|
1148
1148
|
}
|
|
@@ -1160,9 +1160,9 @@ function J(t) {
|
|
|
1160
1160
|
o.getAttribute("aria-sort") || o.setAttribute("aria-sort", "none");
|
|
1161
1161
|
}), e.children.length > 0 ? (e.setAttribute("role", "row"), e.setAttribute("aria-rowindex", "1")) : (e.removeAttribute("role"), e.removeAttribute("aria-rowindex")));
|
|
1162
1162
|
}
|
|
1163
|
-
const
|
|
1164
|
-
function
|
|
1165
|
-
return
|
|
1163
|
+
const Ie = typeof requestIdleCallback == "function";
|
|
1164
|
+
function _t(t, e) {
|
|
1165
|
+
return Ie ? requestIdleCallback(t, e) : window.setTimeout(() => {
|
|
1166
1166
|
const o = Date.now();
|
|
1167
1167
|
t({
|
|
1168
1168
|
didTimeout: !1,
|
|
@@ -1170,11 +1170,11 @@ function vt(t, e) {
|
|
|
1170
1170
|
});
|
|
1171
1171
|
}, 1);
|
|
1172
1172
|
}
|
|
1173
|
-
function
|
|
1174
|
-
|
|
1173
|
+
function ye(t) {
|
|
1174
|
+
Ie ? cancelIdleCallback(t) : clearTimeout(t);
|
|
1175
1175
|
}
|
|
1176
1176
|
var x = ((t) => (t[t.STYLE = 1] = "STYLE", t[t.VIRTUALIZATION = 2] = "VIRTUALIZATION", t[t.HEADER = 3] = "HEADER", t[t.ROWS = 4] = "ROWS", t[t.COLUMNS = 5] = "COLUMNS", t[t.FULL = 6] = "FULL", t))(x || {});
|
|
1177
|
-
class
|
|
1177
|
+
class Et {
|
|
1178
1178
|
#n;
|
|
1179
1179
|
#c = 0;
|
|
1180
1180
|
#f = 0;
|
|
@@ -1217,7 +1217,7 @@ class yt {
|
|
|
1217
1217
|
this.#c = 0, e >= 5 && this.#n.mergeConfig(), e >= 4 && this.#n.processRows(), e >= 5 && (this.#n.processColumns(), this.#n.updateTemplate()), e >= 3 && this.#n.renderHeader(), e >= 2 && this.#n.renderVirtualWindow(), e >= 1 && this.#n.afterRender(), !this.#h && this.#i && (this.#h = !0, this.#i()), this.#s && (this.#s(), this.#s = null, this.#d = null);
|
|
1218
1218
|
}
|
|
1219
1219
|
}
|
|
1220
|
-
function
|
|
1220
|
+
function _e(t) {
|
|
1221
1221
|
let e = null, o = null, n = null, i = null;
|
|
1222
1222
|
const r = (c) => {
|
|
1223
1223
|
if (!e) return;
|
|
@@ -1255,6 +1255,54 @@ function ve(t) {
|
|
|
1255
1255
|
}
|
|
1256
1256
|
};
|
|
1257
1257
|
}
|
|
1258
|
+
const ne = "data-animating", St = {
|
|
1259
|
+
change: "--tbw-row-change-duration",
|
|
1260
|
+
insert: "--tbw-row-insert-duration",
|
|
1261
|
+
remove: "--tbw-row-remove-duration"
|
|
1262
|
+
}, Rt = {
|
|
1263
|
+
change: 500,
|
|
1264
|
+
insert: 300,
|
|
1265
|
+
remove: 200
|
|
1266
|
+
};
|
|
1267
|
+
function Tt(t) {
|
|
1268
|
+
const e = t.trim().toLowerCase();
|
|
1269
|
+
return e.endsWith("ms") ? parseFloat(e) : e.endsWith("s") ? parseFloat(e) * 1e3 : parseFloat(e);
|
|
1270
|
+
}
|
|
1271
|
+
function xt(t, e) {
|
|
1272
|
+
const o = St[e], n = getComputedStyle(t).getPropertyValue(o);
|
|
1273
|
+
if (n) {
|
|
1274
|
+
const i = Tt(n);
|
|
1275
|
+
if (!isNaN(i) && i > 0)
|
|
1276
|
+
return i;
|
|
1277
|
+
}
|
|
1278
|
+
return Rt[e];
|
|
1279
|
+
}
|
|
1280
|
+
function At(t, e, o) {
|
|
1281
|
+
t.removeAttribute(ne), t.offsetWidth, t.setAttribute(ne, e);
|
|
1282
|
+
const n = xt(t, e);
|
|
1283
|
+
setTimeout(() => {
|
|
1284
|
+
e !== "remove" && t.removeAttribute(ne);
|
|
1285
|
+
}, n);
|
|
1286
|
+
}
|
|
1287
|
+
function de(t, e, o) {
|
|
1288
|
+
if (e < 0)
|
|
1289
|
+
return !1;
|
|
1290
|
+
const n = t.findRenderedRowElement?.(e);
|
|
1291
|
+
return n ? (At(n, o), !0) : !1;
|
|
1292
|
+
}
|
|
1293
|
+
function Pt(t, e, o) {
|
|
1294
|
+
let n = 0;
|
|
1295
|
+
for (const i of e)
|
|
1296
|
+
de(t, i, o) && n++;
|
|
1297
|
+
return n;
|
|
1298
|
+
}
|
|
1299
|
+
function Lt(t, e, o) {
|
|
1300
|
+
const n = t._rows ?? [], i = t.getRowId;
|
|
1301
|
+
if (!i)
|
|
1302
|
+
return !1;
|
|
1303
|
+
const r = n.findIndex((s) => i(s) === e);
|
|
1304
|
+
return r < 0 ? !1 : de(t, r, o);
|
|
1305
|
+
}
|
|
1258
1306
|
function Y(t, e, o) {
|
|
1259
1307
|
const n = document.createElement(t);
|
|
1260
1308
|
if (e)
|
|
@@ -1273,7 +1321,7 @@ function L(t, e) {
|
|
|
1273
1321
|
}
|
|
1274
1322
|
return o;
|
|
1275
1323
|
}
|
|
1276
|
-
function
|
|
1324
|
+
function qe(t, e, o) {
|
|
1277
1325
|
const n = document.createElement("button");
|
|
1278
1326
|
if (t && (n.className = t), e)
|
|
1279
1327
|
for (const i in e) {
|
|
@@ -1282,8 +1330,8 @@ function ke(t, e, o) {
|
|
|
1282
1330
|
}
|
|
1283
1331
|
return n;
|
|
1284
1332
|
}
|
|
1285
|
-
const
|
|
1286
|
-
|
|
1333
|
+
const We = document.createElement("template");
|
|
1334
|
+
We.innerHTML = `
|
|
1287
1335
|
<div class="tbw-scroll-area">
|
|
1288
1336
|
<div class="rows-body-wrapper">
|
|
1289
1337
|
<div class="rows-body" role="grid">
|
|
@@ -1302,20 +1350,20 @@ Ie.innerHTML = `
|
|
|
1302
1350
|
<div class="faux-vscroll-spacer"></div>
|
|
1303
1351
|
</div>
|
|
1304
1352
|
`;
|
|
1305
|
-
function
|
|
1306
|
-
return
|
|
1353
|
+
function $e() {
|
|
1354
|
+
return We.content.cloneNode(!0);
|
|
1307
1355
|
}
|
|
1308
|
-
function
|
|
1356
|
+
function Ee(t) {
|
|
1309
1357
|
const e = document.createDocumentFragment(), o = L(t.hasShell ? "tbw-grid-root has-shell" : "tbw-grid-root");
|
|
1310
1358
|
if (t.hasShell && t.shellHeader && t.shellBody)
|
|
1311
1359
|
o.appendChild(t.shellHeader), o.appendChild(t.shellBody);
|
|
1312
1360
|
else {
|
|
1313
1361
|
const n = L("tbw-grid-content");
|
|
1314
|
-
n.appendChild(
|
|
1362
|
+
n.appendChild($e()), o.appendChild(n);
|
|
1315
1363
|
}
|
|
1316
1364
|
return e.appendChild(o), e;
|
|
1317
1365
|
}
|
|
1318
|
-
function
|
|
1366
|
+
function Ht(t) {
|
|
1319
1367
|
const e = L("tbw-shell-header", { part: "shell-header", role: "presentation" });
|
|
1320
1368
|
if (t.title) {
|
|
1321
1369
|
const r = L("tbw-shell-title");
|
|
@@ -1333,7 +1381,7 @@ function _t(t) {
|
|
|
1333
1381
|
for (const r of t.apiButtons)
|
|
1334
1382
|
r.hasRender && n.appendChild(L("tbw-toolbar-content-slot", { "data-toolbar-content": r.id }));
|
|
1335
1383
|
if ((t.configButtons.some((r) => r.hasRender) || t.apiButtons.some((r) => r.hasRender)) && t.hasPanels && n.appendChild(L("tbw-toolbar-separator")), t.hasPanels) {
|
|
1336
|
-
const r =
|
|
1384
|
+
const r = qe(t.isPanelOpen ? "tbw-toolbar-btn active" : "tbw-toolbar-btn", {
|
|
1337
1385
|
"data-panel-toggle": "",
|
|
1338
1386
|
title: "Settings",
|
|
1339
1387
|
"aria-label": "Toggle settings panel",
|
|
@@ -1344,9 +1392,9 @@ function _t(t) {
|
|
|
1344
1392
|
}
|
|
1345
1393
|
return e.appendChild(n), e;
|
|
1346
1394
|
}
|
|
1347
|
-
function
|
|
1395
|
+
function Ot(t) {
|
|
1348
1396
|
const e = L("tbw-shell-body"), o = t.panels.length > 0, n = t.panels.length === 1, i = L("tbw-grid-content");
|
|
1349
|
-
i.appendChild(
|
|
1397
|
+
i.appendChild($e());
|
|
1350
1398
|
let r = null;
|
|
1351
1399
|
if (o) {
|
|
1352
1400
|
r = Y("aside", {
|
|
@@ -1366,7 +1414,7 @@ function Et(t) {
|
|
|
1366
1414
|
);
|
|
1367
1415
|
const l = L("tbw-tool-panel-content", { role: "presentation" }), c = L("tbw-accordion");
|
|
1368
1416
|
for (const a of t.panels) {
|
|
1369
|
-
const h = `tbw-accordion-section${a.isExpanded ? " expanded" : ""}${n ? " single" : ""}`, u = L(h, { "data-section": a.id }), p =
|
|
1417
|
+
const h = `tbw-accordion-section${a.isExpanded ? " expanded" : ""}${n ? " single" : ""}`, u = L(h, { "data-section": a.id }), p = qe("tbw-accordion-header", {
|
|
1370
1418
|
"aria-expanded": String(a.isExpanded),
|
|
1371
1419
|
"aria-controls": `tbw-section-${a.id}`
|
|
1372
1420
|
});
|
|
@@ -1393,7 +1441,7 @@ function Et(t) {
|
|
|
1393
1441
|
function k(t) {
|
|
1394
1442
|
return t ? typeof t == "string" ? t : t.outerHTML : "";
|
|
1395
1443
|
}
|
|
1396
|
-
function
|
|
1444
|
+
function Dt() {
|
|
1397
1445
|
return {
|
|
1398
1446
|
toolPanels: /* @__PURE__ */ new Map(),
|
|
1399
1447
|
headerContents: /* @__PURE__ */ new Map(),
|
|
@@ -1412,10 +1460,10 @@ function St() {
|
|
|
1412
1460
|
lightDomContentMoved: !1
|
|
1413
1461
|
};
|
|
1414
1462
|
}
|
|
1415
|
-
function
|
|
1463
|
+
function Fe(t) {
|
|
1416
1464
|
return !!(t?.header?.title || t?.header?.toolbarContents?.length || t?.toolPanels?.length || t?.headerContents?.length || t?.header?.lightDomContent?.length || t?.header?.hasToolButtonsContainer);
|
|
1417
1465
|
}
|
|
1418
|
-
function
|
|
1466
|
+
function Se(t, e, o = "☰") {
|
|
1419
1467
|
const n = t?.header?.title ?? e.lightDomTitle ?? "", i = !!n, r = k(o), s = t?.header?.toolbarContents ?? [], l = [...e.toolbarContents.values()], c = new Set(s.map((d) => d.id)), a = [...s];
|
|
1420
1468
|
for (const d of l)
|
|
1421
1469
|
c.has(d.id) || a.push(d);
|
|
@@ -1429,7 +1477,7 @@ function _e(t, e, o = "☰") {
|
|
|
1429
1477
|
}
|
|
1430
1478
|
return `
|
|
1431
1479
|
<div class="tbw-shell-header" part="shell-header" role="presentation">
|
|
1432
|
-
${i ? `<div class="tbw-shell-title">${
|
|
1480
|
+
${i ? `<div class="tbw-shell-title">${Je(n)}</div>` : ""}
|
|
1433
1481
|
<div class="tbw-shell-content" part="shell-content" role="presentation" data-light-dom-header-content></div>
|
|
1434
1482
|
<div class="tbw-shell-toolbar" part="shell-toolbar" role="presentation">
|
|
1435
1483
|
${g}
|
|
@@ -1504,7 +1552,7 @@ function W(t, e, o) {
|
|
|
1504
1552
|
e.toolPanels.set(s, g), e.lightDomToolPanelIds.add(s), r.style.display = "none";
|
|
1505
1553
|
});
|
|
1506
1554
|
}
|
|
1507
|
-
function
|
|
1555
|
+
function Mt(t, e, o, n) {
|
|
1508
1556
|
const i = t.querySelector(".tbw-shell-toolbar");
|
|
1509
1557
|
i && i.addEventListener("click", (s) => {
|
|
1510
1558
|
if (s.target.closest("[data-panel-toggle]")) {
|
|
@@ -1521,7 +1569,7 @@ function Rt(t, e, o, n) {
|
|
|
1521
1569
|
}
|
|
1522
1570
|
});
|
|
1523
1571
|
}
|
|
1524
|
-
function
|
|
1572
|
+
function zt(t, e, o) {
|
|
1525
1573
|
const n = t.querySelector(".tbw-tool-panel"), i = t.querySelector("[data-resize-handle]"), r = t.querySelector(".tbw-shell-body");
|
|
1526
1574
|
if (!n || !i || !r)
|
|
1527
1575
|
return () => {
|
|
@@ -1545,7 +1593,7 @@ function Tt(t, e, o) {
|
|
|
1545
1593
|
i.removeEventListener("mousedown", g), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", f);
|
|
1546
1594
|
};
|
|
1547
1595
|
}
|
|
1548
|
-
function
|
|
1596
|
+
function Re(t, e, o) {
|
|
1549
1597
|
const n = e?.header?.toolbarContents ?? [], i = [...o.toolbarContents.values()], r = new Set(n.map((l) => l.id)), s = [...n];
|
|
1550
1598
|
for (const l of i)
|
|
1551
1599
|
r.has(l.id) || s.push(l);
|
|
@@ -1557,7 +1605,7 @@ function Ee(t, e, o) {
|
|
|
1557
1605
|
a && o.toolbarContentCleanups.set(l.id, a);
|
|
1558
1606
|
}
|
|
1559
1607
|
}
|
|
1560
|
-
function
|
|
1608
|
+
function se(t, e) {
|
|
1561
1609
|
const o = e.lightDomHeaderContent.length > 0 && !e.lightDomContentMoved, n = e.headerContents.size > 0;
|
|
1562
1610
|
if (!o && !n) return;
|
|
1563
1611
|
const i = t.querySelector(".tbw-shell-content");
|
|
@@ -1577,7 +1625,7 @@ function re(t, e) {
|
|
|
1577
1625
|
a && e.headerContentCleanups.set(s.id, a);
|
|
1578
1626
|
}
|
|
1579
1627
|
}
|
|
1580
|
-
function
|
|
1628
|
+
function Nt(t, e, o) {
|
|
1581
1629
|
if (!e.isPanelOpen) return;
|
|
1582
1630
|
const n = k(o?.expand ?? z.expand), i = k(o?.collapse ?? z.collapse);
|
|
1583
1631
|
for (const [r, s] of e.toolPanels) {
|
|
@@ -1598,15 +1646,15 @@ function xt(t, e, o) {
|
|
|
1598
1646
|
}
|
|
1599
1647
|
}
|
|
1600
1648
|
}
|
|
1601
|
-
function
|
|
1649
|
+
function Te(t, e) {
|
|
1602
1650
|
const o = t.querySelector("[data-panel-toggle]");
|
|
1603
1651
|
o && (o.classList.toggle("active", e.isPanelOpen), o.setAttribute("aria-pressed", String(e.isPanelOpen)));
|
|
1604
1652
|
}
|
|
1605
|
-
function
|
|
1653
|
+
function xe(t, e) {
|
|
1606
1654
|
const o = t.querySelector(".tbw-tool-panel");
|
|
1607
1655
|
o && (o.classList.toggle("open", e.isPanelOpen), e.isPanelOpen || (o.style.width = ""));
|
|
1608
1656
|
}
|
|
1609
|
-
function
|
|
1657
|
+
function kt(t) {
|
|
1610
1658
|
for (const e of t.headerContentCleanups.values())
|
|
1611
1659
|
e();
|
|
1612
1660
|
t.headerContentCleanups.clear();
|
|
@@ -1623,7 +1671,7 @@ function At(t) {
|
|
|
1623
1671
|
t.toolPanels.get(e)?.onClose?.();
|
|
1624
1672
|
t.isPanelOpen = !1, t.expandedSections.clear(), t.toolPanels.clear(), t.headerContents.clear(), t.toolbarContents.clear(), t.lightDomHeaderContent = [], t.lightDomToolPanelIds.clear(), t.lightDomToolbarContentIds.clear(), t.lightDomContentMoved = !1;
|
|
1625
1673
|
}
|
|
1626
|
-
function
|
|
1674
|
+
function It(t, e) {
|
|
1627
1675
|
let o = !1;
|
|
1628
1676
|
const n = {
|
|
1629
1677
|
get isInitialized() {
|
|
@@ -1652,7 +1700,7 @@ function Pt(t, e) {
|
|
|
1652
1700
|
s && t.expandedSections.add(s.id);
|
|
1653
1701
|
}
|
|
1654
1702
|
const i = e.getShadow();
|
|
1655
|
-
|
|
1703
|
+
Te(i, t), xe(i, t), Nt(i, t, e.getAccordionIcons()), e.emit("tool-panel-open", { sections: n.expandedSections });
|
|
1656
1704
|
},
|
|
1657
1705
|
closeToolPanel() {
|
|
1658
1706
|
if (!t.isPanelOpen) return;
|
|
@@ -1663,7 +1711,7 @@ function Pt(t, e) {
|
|
|
1663
1711
|
r.onClose?.();
|
|
1664
1712
|
t.isPanelOpen = !1;
|
|
1665
1713
|
const i = e.getShadow();
|
|
1666
|
-
|
|
1714
|
+
Te(i, t), xe(i, t), e.emit("tool-panel-close", {});
|
|
1667
1715
|
},
|
|
1668
1716
|
toggleToolPanel() {
|
|
1669
1717
|
t.isPanelOpen ? n.closeToolPanel() : n.openToolPanel();
|
|
@@ -1679,16 +1727,16 @@ function Pt(t, e) {
|
|
|
1679
1727
|
const s = e.getShadow(), l = t.expandedSections.has(i);
|
|
1680
1728
|
if (l) {
|
|
1681
1729
|
const c = t.panelCleanups.get(i);
|
|
1682
|
-
c && (c(), t.panelCleanups.delete(i)), r.onClose?.(), t.expandedSections.delete(i),
|
|
1730
|
+
c && (c(), t.panelCleanups.delete(i)), r.onClose?.(), t.expandedSections.delete(i), ie(s, i, !1);
|
|
1683
1731
|
} else {
|
|
1684
1732
|
for (const [c, a] of t.toolPanels)
|
|
1685
1733
|
if (c !== i && t.expandedSections.has(c)) {
|
|
1686
1734
|
const h = t.panelCleanups.get(c);
|
|
1687
|
-
h && (h(), t.panelCleanups.delete(c)), a.onClose?.(), t.expandedSections.delete(c),
|
|
1735
|
+
h && (h(), t.panelCleanups.delete(c)), a.onClose?.(), t.expandedSections.delete(c), ie(s, c, !1);
|
|
1688
1736
|
const u = s.querySelector(`[data-section="${c}"] .tbw-accordion-content`);
|
|
1689
1737
|
u && (u.innerHTML = "");
|
|
1690
1738
|
}
|
|
1691
|
-
t.expandedSections.add(i),
|
|
1739
|
+
t.expandedSections.add(i), ie(s, i, !0), qt(s, t, i);
|
|
1692
1740
|
}
|
|
1693
1741
|
e.emit("tool-panel-section-toggle", { id: i, expanded: !l });
|
|
1694
1742
|
},
|
|
@@ -1717,7 +1765,7 @@ function Pt(t, e) {
|
|
|
1717
1765
|
console.warn(`[tbw-grid] Header content "${i.id}" already registered`);
|
|
1718
1766
|
return;
|
|
1719
1767
|
}
|
|
1720
|
-
t.headerContents.set(i.id, i), o &&
|
|
1768
|
+
t.headerContents.set(i.id, i), o && se(e.getShadow(), t);
|
|
1721
1769
|
},
|
|
1722
1770
|
unregisterHeaderContent(i) {
|
|
1723
1771
|
const r = t.headerContentCleanups.get(i);
|
|
@@ -1742,11 +1790,11 @@ function Pt(t, e) {
|
|
|
1742
1790
|
};
|
|
1743
1791
|
return n;
|
|
1744
1792
|
}
|
|
1745
|
-
function
|
|
1793
|
+
function ie(t, e, o) {
|
|
1746
1794
|
const n = t.querySelector(`[data-section="${e}"]`);
|
|
1747
1795
|
n && n.classList.toggle("expanded", o);
|
|
1748
1796
|
}
|
|
1749
|
-
function
|
|
1797
|
+
function qt(t, e, o) {
|
|
1750
1798
|
const n = e.toolPanels.get(o);
|
|
1751
1799
|
if (!n?.render) return;
|
|
1752
1800
|
const i = t.querySelector(`[data-section="${o}"] .tbw-accordion-content`);
|
|
@@ -1754,8 +1802,8 @@ function Lt(t, e, o) {
|
|
|
1754
1802
|
const r = n.render(i);
|
|
1755
1803
|
r && e.panelCleanups.set(o, r);
|
|
1756
1804
|
}
|
|
1757
|
-
function
|
|
1758
|
-
const i =
|
|
1805
|
+
function Wt(t, e, o, n) {
|
|
1806
|
+
const i = Fe(e), r = [], s = [
|
|
1759
1807
|
"tbw-grid-header",
|
|
1760
1808
|
"tbw-grid-tool-buttons",
|
|
1761
1809
|
"tbw-grid-tool-panel",
|
|
@@ -1769,15 +1817,15 @@ function Ht(t, e, o, n) {
|
|
|
1769
1817
|
for (const l of r)
|
|
1770
1818
|
t.appendChild(l);
|
|
1771
1819
|
if (i) {
|
|
1772
|
-
const l = k(n?.toolPanel ?? z.toolPanel), c = k(n?.expand ?? z.expand), a = k(n?.collapse ?? z.collapse), u = [...e?.header?.toolbarContents ?? []].sort((
|
|
1820
|
+
const l = k(n?.toolPanel ?? z.toolPanel), c = k(n?.expand ?? z.expand), a = k(n?.collapse ?? z.collapse), u = [...e?.header?.toolbarContents ?? []].sort((v, T) => (v.order ?? 0) - (T.order ?? 0)), f = [...e?.toolPanels ?? []].sort((v, T) => (v.order ?? 100) - (T.order ?? 100)), g = {
|
|
1773
1821
|
title: e?.header?.title ?? void 0,
|
|
1774
1822
|
hasPanels: f.length > 0,
|
|
1775
1823
|
isPanelOpen: o.isPanelOpen,
|
|
1776
1824
|
toolPanelIcon: l,
|
|
1777
|
-
configButtons: u.map((
|
|
1778
|
-
id:
|
|
1825
|
+
configButtons: u.map((v) => ({
|
|
1826
|
+
id: v.id,
|
|
1779
1827
|
hasElement: !1,
|
|
1780
|
-
hasRender: !!
|
|
1828
|
+
hasRender: !!v.render
|
|
1781
1829
|
})),
|
|
1782
1830
|
apiButtons: []
|
|
1783
1831
|
}, d = {
|
|
@@ -1785,25 +1833,25 @@ function Ht(t, e, o, n) {
|
|
|
1785
1833
|
isPanelOpen: o.isPanelOpen,
|
|
1786
1834
|
expandIcon: c,
|
|
1787
1835
|
collapseIcon: a,
|
|
1788
|
-
panels: f.map((
|
|
1789
|
-
id:
|
|
1790
|
-
title:
|
|
1791
|
-
icon: k(
|
|
1792
|
-
isExpanded: o.expandedSections.has(
|
|
1836
|
+
panels: f.map((v) => ({
|
|
1837
|
+
id: v.id,
|
|
1838
|
+
title: v.title,
|
|
1839
|
+
icon: k(v.icon),
|
|
1840
|
+
isExpanded: o.expandedSections.has(v.id)
|
|
1793
1841
|
}))
|
|
1794
|
-
}, w =
|
|
1842
|
+
}, w = Ht(g), m = Ot(d), R = Ee({
|
|
1795
1843
|
hasShell: !0,
|
|
1796
1844
|
shellHeader: w,
|
|
1797
1845
|
shellBody: m
|
|
1798
1846
|
});
|
|
1799
1847
|
t.appendChild(R);
|
|
1800
1848
|
} else {
|
|
1801
|
-
const l =
|
|
1849
|
+
const l = Ee({ hasShell: !1 });
|
|
1802
1850
|
t.appendChild(l);
|
|
1803
1851
|
}
|
|
1804
1852
|
return i;
|
|
1805
1853
|
}
|
|
1806
|
-
function
|
|
1854
|
+
function $t() {
|
|
1807
1855
|
return {
|
|
1808
1856
|
startY: null,
|
|
1809
1857
|
startX: null,
|
|
@@ -1817,19 +1865,19 @@ function Ot() {
|
|
|
1817
1865
|
momentumRaf: 0
|
|
1818
1866
|
};
|
|
1819
1867
|
}
|
|
1820
|
-
function
|
|
1868
|
+
function Ft(t) {
|
|
1821
1869
|
t.startY = null, t.startX = null, t.scrollTop = null, t.scrollLeft = null, t.lastY = null, t.lastX = null, t.lastTime = null;
|
|
1822
1870
|
}
|
|
1823
|
-
function
|
|
1871
|
+
function Ue(t) {
|
|
1824
1872
|
t.momentumRaf && (cancelAnimationFrame(t.momentumRaf), t.momentumRaf = 0);
|
|
1825
1873
|
}
|
|
1826
|
-
function
|
|
1874
|
+
function Ut(t, e, o) {
|
|
1827
1875
|
if (t.touches.length !== 1) return;
|
|
1828
|
-
|
|
1876
|
+
Ue(e);
|
|
1829
1877
|
const n = t.touches[0];
|
|
1830
1878
|
e.startY = n.clientY, e.startX = n.clientX, e.lastY = n.clientY, e.lastX = n.clientX, e.lastTime = performance.now(), e.scrollTop = o.fauxScrollbar.scrollTop, e.scrollLeft = o.scrollArea?.scrollLeft ?? 0, e.velocityY = 0, e.velocityX = 0;
|
|
1831
1879
|
}
|
|
1832
|
-
function
|
|
1880
|
+
function Vt(t, e, o) {
|
|
1833
1881
|
if (t.touches.length !== 1 || e.startY === null || e.startX === null || e.scrollTop === null || e.scrollLeft === null)
|
|
1834
1882
|
return !1;
|
|
1835
1883
|
const n = t.touches[0], i = n.clientY, r = n.clientX, s = performance.now(), l = e.startY - i, c = e.startX - r;
|
|
@@ -1846,10 +1894,10 @@ function zt(t, e, o) {
|
|
|
1846
1894
|
}
|
|
1847
1895
|
return f && (o.fauxScrollbar.scrollTop = e.scrollTop + l), g && o.scrollArea && (o.scrollArea.scrollLeft = e.scrollLeft + c), f || g;
|
|
1848
1896
|
}
|
|
1849
|
-
function
|
|
1850
|
-
(Math.abs(t.velocityY) > 0.1 || Math.abs(t.velocityX) > 0.1) &&
|
|
1897
|
+
function Bt(t, e) {
|
|
1898
|
+
(Math.abs(t.velocityY) > 0.1 || Math.abs(t.velocityX) > 0.1) && Gt(t, e), Ft(t);
|
|
1851
1899
|
}
|
|
1852
|
-
function
|
|
1900
|
+
function Gt(t, e) {
|
|
1853
1901
|
const i = () => {
|
|
1854
1902
|
t.velocityY *= 0.95, t.velocityX *= 0.95;
|
|
1855
1903
|
const r = t.velocityY * 16, s = t.velocityX * 16;
|
|
@@ -1857,19 +1905,19 @@ function kt(t, e) {
|
|
|
1857
1905
|
};
|
|
1858
1906
|
t.momentumRaf = requestAnimationFrame(i);
|
|
1859
1907
|
}
|
|
1860
|
-
function
|
|
1861
|
-
t.addEventListener("touchstart", (i) =>
|
|
1908
|
+
function Xt(t, e, o, n) {
|
|
1909
|
+
t.addEventListener("touchstart", (i) => Ut(i, e, o), {
|
|
1862
1910
|
passive: !0,
|
|
1863
1911
|
signal: n
|
|
1864
1912
|
}), t.addEventListener(
|
|
1865
1913
|
"touchmove",
|
|
1866
1914
|
(i) => {
|
|
1867
|
-
|
|
1915
|
+
Vt(i, e, o) && i.preventDefault();
|
|
1868
1916
|
},
|
|
1869
1917
|
{ passive: !1, signal: n }
|
|
1870
|
-
), t.addEventListener("touchend", () =>
|
|
1918
|
+
), t.addEventListener("touchend", () => Bt(e, o), { passive: !0, signal: n });
|
|
1871
1919
|
}
|
|
1872
|
-
const
|
|
1920
|
+
const Yt = [
|
|
1873
1921
|
{
|
|
1874
1922
|
property: "editable",
|
|
1875
1923
|
pluginName: "editing",
|
|
@@ -1907,7 +1955,7 @@ const qt = [
|
|
|
1907
1955
|
importHint: "import { PinnedColumnsPlugin } from '@toolbox-web/grid/plugins/pinned-columns';",
|
|
1908
1956
|
isUsed: (t) => t === "left" || t === "right"
|
|
1909
1957
|
}
|
|
1910
|
-
],
|
|
1958
|
+
], jt = [
|
|
1911
1959
|
{
|
|
1912
1960
|
property: "columnGroups",
|
|
1913
1961
|
pluginName: "groupingColumns",
|
|
@@ -1916,7 +1964,7 @@ const qt = [
|
|
|
1916
1964
|
importHint: "import { GroupingColumnsPlugin } from '@toolbox-web/grid/plugins/grouping-columns';",
|
|
1917
1965
|
isUsed: (t) => Array.isArray(t) && t.length > 0
|
|
1918
1966
|
}
|
|
1919
|
-
],
|
|
1967
|
+
], Kt = {
|
|
1920
1968
|
editing: "import { EditingPlugin } from '@toolbox-web/grid/plugins/editing';",
|
|
1921
1969
|
selection: "import { SelectionPlugin } from '@toolbox-web/grid/plugins/selection';",
|
|
1922
1970
|
reorder: "import { ReorderPlugin } from '@toolbox-web/grid/plugins/reorder';",
|
|
@@ -1937,10 +1985,10 @@ const qt = [
|
|
|
1937
1985
|
serverSide: "import { ServerSidePlugin } from '@toolbox-web/grid/plugins/server-side';",
|
|
1938
1986
|
columnVirtualization: "import { ColumnVirtualizationPlugin } from '@toolbox-web/grid/plugins/column-virtualization';"
|
|
1939
1987
|
};
|
|
1940
|
-
function
|
|
1941
|
-
return
|
|
1988
|
+
function le(t) {
|
|
1989
|
+
return Kt[t] ?? `import { ${D(t)}Plugin } from '@toolbox-web/grid/plugins/${t}';`;
|
|
1942
1990
|
}
|
|
1943
|
-
function
|
|
1991
|
+
function Ve() {
|
|
1944
1992
|
if (typeof window < "u" && window.location) {
|
|
1945
1993
|
const t = window.location.hostname;
|
|
1946
1994
|
if (t === "localhost" || t === "127.0.0.1" || t === "::1")
|
|
@@ -1951,11 +1999,11 @@ function Fe() {
|
|
|
1951
1999
|
function D(t) {
|
|
1952
2000
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
1953
2001
|
}
|
|
1954
|
-
function
|
|
2002
|
+
function Ae(t, e) {
|
|
1955
2003
|
return t.some((o) => o.name === e);
|
|
1956
2004
|
}
|
|
1957
|
-
function
|
|
1958
|
-
const o =
|
|
2005
|
+
function Zt(t, e) {
|
|
2006
|
+
const o = Yt, n = jt, i = /* @__PURE__ */ new Map();
|
|
1959
2007
|
function r(l, c, a, h, u = !1) {
|
|
1960
2008
|
i.has(l) || i.set(l, { description: c, importHint: a, fields: [], isConfigProperty: u });
|
|
1961
2009
|
const p = i.get(l);
|
|
@@ -1963,16 +2011,16 @@ function Ft(t, e) {
|
|
|
1963
2011
|
}
|
|
1964
2012
|
for (const l of n) {
|
|
1965
2013
|
const c = t[l.property];
|
|
1966
|
-
(l.isUsed ? l.isUsed(c) : c !== void 0) && !
|
|
2014
|
+
(l.isUsed ? l.isUsed(c) : c !== void 0) && !Ae(e, l.pluginName) && r(l.pluginName, l.description, l.importHint ?? le(l.pluginName), l.property, !0);
|
|
1967
2015
|
}
|
|
1968
2016
|
const s = t.columns;
|
|
1969
2017
|
if (s && s.length > 0)
|
|
1970
2018
|
for (const l of s)
|
|
1971
2019
|
for (const c of o) {
|
|
1972
2020
|
const a = l[c.property];
|
|
1973
|
-
if ((c.isUsed ? c.isUsed(a) : a !== void 0) && !
|
|
2021
|
+
if ((c.isUsed ? c.isUsed(a) : a !== void 0) && !Ae(e, c.pluginName)) {
|
|
1974
2022
|
const u = l.field || "<unknown>";
|
|
1975
|
-
r(c.pluginName, c.description, c.importHint ??
|
|
2023
|
+
r(c.pluginName, c.description, c.importHint ?? le(c.pluginName), u);
|
|
1976
2024
|
}
|
|
1977
2025
|
}
|
|
1978
2026
|
if (i.size > 0) {
|
|
@@ -2005,7 +2053,7 @@ This validation helps catch misconfigurations early. The properties listed above
|
|
|
2005
2053
|
);
|
|
2006
2054
|
}
|
|
2007
2055
|
}
|
|
2008
|
-
function
|
|
2056
|
+
function Jt(t) {
|
|
2009
2057
|
const e = [], o = [];
|
|
2010
2058
|
for (const n of t) {
|
|
2011
2059
|
const r = n.constructor.manifest;
|
|
@@ -2018,7 +2066,7 @@ function Ut(t) {
|
|
|
2018
2066
|
}
|
|
2019
2067
|
}
|
|
2020
2068
|
}
|
|
2021
|
-
if (o.length > 0 &&
|
|
2069
|
+
if (o.length > 0 && Ve())
|
|
2022
2070
|
for (const n of o)
|
|
2023
2071
|
console.warn(n);
|
|
2024
2072
|
if (e.length > 0)
|
|
@@ -2028,12 +2076,12 @@ ${e.join(`
|
|
|
2028
2076
|
|
|
2029
2077
|
`)}`);
|
|
2030
2078
|
}
|
|
2031
|
-
function
|
|
2079
|
+
function Qt(t, e) {
|
|
2032
2080
|
const o = t.name, i = t.constructor.dependencies ?? [];
|
|
2033
2081
|
for (const r of i) {
|
|
2034
2082
|
const s = r.name, l = r.required ?? !0, c = r.reason;
|
|
2035
2083
|
if (!e.some((h) => h.name === s)) {
|
|
2036
|
-
const h = c ?? `${D(o)}Plugin requires ${D(s)}Plugin`, u =
|
|
2084
|
+
const h = c ?? `${D(o)}Plugin requires ${D(s)}Plugin`, u = le(s);
|
|
2037
2085
|
if (l)
|
|
2038
2086
|
throw new Error(
|
|
2039
2087
|
`[tbw-grid] Plugin dependency error:
|
|
@@ -2050,8 +2098,8 @@ ${h}.
|
|
|
2050
2098
|
}
|
|
2051
2099
|
}
|
|
2052
2100
|
}
|
|
2053
|
-
function
|
|
2054
|
-
if (!
|
|
2101
|
+
function eo(t) {
|
|
2102
|
+
if (!Ve()) return;
|
|
2055
2103
|
const e = new Set(t.map((n) => n.name)), o = /* @__PURE__ */ new Set();
|
|
2056
2104
|
for (const n of t) {
|
|
2057
2105
|
const r = n.constructor.manifest;
|
|
@@ -2073,7 +2121,7 @@ ${D(n.name)}Plugin and ${D(s.name)}Plugin are both loaded, but they are currentl
|
|
|
2073
2121
|
}
|
|
2074
2122
|
}
|
|
2075
2123
|
}
|
|
2076
|
-
class
|
|
2124
|
+
class to {
|
|
2077
2125
|
constructor(e) {
|
|
2078
2126
|
this.grid = e;
|
|
2079
2127
|
}
|
|
@@ -2090,7 +2138,7 @@ class Gt {
|
|
|
2090
2138
|
this.attach(o);
|
|
2091
2139
|
}
|
|
2092
2140
|
attach(e) {
|
|
2093
|
-
if (
|
|
2141
|
+
if (Qt(e, this.plugins), this.pluginMap.set(e.constructor, e), this.plugins.push(e), e.cellRenderers)
|
|
2094
2142
|
for (const [o, n] of Object.entries(e.cellRenderers))
|
|
2095
2143
|
this.cellRenderers.set(o, n);
|
|
2096
2144
|
if (e.headerRenderers)
|
|
@@ -2290,7 +2338,7 @@ class Gt {
|
|
|
2290
2338
|
}
|
|
2291
2339
|
class H extends HTMLElement {
|
|
2292
2340
|
static tagName = "tbw-grid";
|
|
2293
|
-
static version = "1.
|
|
2341
|
+
static version = "1.3.0";
|
|
2294
2342
|
static adapters = [];
|
|
2295
2343
|
static registerAdapter(e) {
|
|
2296
2344
|
this.adapters.push(e);
|
|
@@ -2327,11 +2375,11 @@ class H extends HTMLElement {
|
|
|
2327
2375
|
#w = null;
|
|
2328
2376
|
#r = !1;
|
|
2329
2377
|
#b;
|
|
2330
|
-
#A =
|
|
2378
|
+
#A = $t();
|
|
2331
2379
|
#p;
|
|
2332
|
-
#v;
|
|
2333
|
-
#y;
|
|
2334
2380
|
#C;
|
|
2381
|
+
#y;
|
|
2382
|
+
#v;
|
|
2335
2383
|
#E = {
|
|
2336
2384
|
scrollTop: 0,
|
|
2337
2385
|
scrollLeft: 0,
|
|
@@ -2346,7 +2394,7 @@ class H extends HTMLElement {
|
|
|
2346
2394
|
#P;
|
|
2347
2395
|
#L;
|
|
2348
2396
|
#t;
|
|
2349
|
-
#e =
|
|
2397
|
+
#e = Dt();
|
|
2350
2398
|
#a;
|
|
2351
2399
|
#D;
|
|
2352
2400
|
#H = /* @__PURE__ */ new Map();
|
|
@@ -2435,9 +2483,9 @@ class H extends HTMLElement {
|
|
|
2435
2483
|
return this.#p || (this.#p = new AbortController()), this.#p.signal;
|
|
2436
2484
|
}
|
|
2437
2485
|
constructor() {
|
|
2438
|
-
super(), this.#le(), this.#f = new Promise((e) => this.#d = e), this.#l = new
|
|
2486
|
+
super(), this.#le(), this.#f = new Promise((e) => this.#d = e), this.#l = new Et({
|
|
2439
2487
|
mergeConfig: () => {
|
|
2440
|
-
this.#t.parseLightDomColumns(this), this.#t.merge(), this.#K(),
|
|
2488
|
+
this.#t.parseLightDomColumns(this), this.#t.merge(), this.#K(), Zt(this.#i, this.#o?.getPlugins() ?? []), Jt(this.#o?.getPlugins() ?? []), eo(this.#o?.getPlugins() ?? []), this.#I = [...this._columns];
|
|
2441
2489
|
},
|
|
2442
2490
|
processColumns: () => this.#me(),
|
|
2443
2491
|
processRows: () => this.#be(),
|
|
@@ -2445,10 +2493,10 @@ class H extends HTMLElement {
|
|
|
2445
2493
|
updateTemplate: () => U(this),
|
|
2446
2494
|
renderVirtualWindow: () => this.refreshVirtualWindow(!0, !0),
|
|
2447
2495
|
afterRender: () => {
|
|
2448
|
-
this.#o?.afterRender(), this.#i.fitMode === "fixed" && !this.__didInitialAutoSize && (this.__didInitialAutoSize = !0,
|
|
2496
|
+
this.#o?.afterRender(), this.#i.fitMode === "fixed" && !this.__didInitialAutoSize && (this.__didInitialAutoSize = !0, pe(this)), this._restoreFocusAfterRender && (this._restoreFocusAfterRender = !1, $(this)), this._virtualization.enabled && !this.#N && this.#ce();
|
|
2449
2497
|
},
|
|
2450
2498
|
isConnected: () => this.isConnected && this.#h
|
|
2451
|
-
}), this.#l.setInitialReadyResolver(() => this.#d?.()), this.#a =
|
|
2499
|
+
}), this.#l.setInitialReadyResolver(() => this.#d?.()), this.#a = It(this.#e, {
|
|
2452
2500
|
getShadow: () => this.#n,
|
|
2453
2501
|
getShellConfig: () => this.#i?.shell,
|
|
2454
2502
|
getAccordionIcons: () => ({
|
|
@@ -2457,7 +2505,7 @@ class H extends HTMLElement {
|
|
|
2457
2505
|
}),
|
|
2458
2506
|
emit: (e, o) => this.#T(e, o),
|
|
2459
2507
|
refreshShellHeader: () => this.refreshShellHeader()
|
|
2460
|
-
}), this.#t = new
|
|
2508
|
+
}), this.#t = new lt({
|
|
2461
2509
|
getRows: () => this.#s,
|
|
2462
2510
|
getSortState: () => this._sortState,
|
|
2463
2511
|
setSortState: (e) => {
|
|
@@ -2478,7 +2526,7 @@ class H extends HTMLElement {
|
|
|
2478
2526
|
setRowHeight: (e) => {
|
|
2479
2527
|
this._virtualization.rowHeight = e;
|
|
2480
2528
|
},
|
|
2481
|
-
applyAnimationConfig: (e) => this.#
|
|
2529
|
+
applyAnimationConfig: (e) => this.#ve(e),
|
|
2482
2530
|
getShellLightDomTitle: () => this.#e.lightDomTitle,
|
|
2483
2531
|
getShellToolPanels: () => this.#e.toolPanels,
|
|
2484
2532
|
getShellHeaderContents: () => this.#e.headerContents,
|
|
@@ -2504,8 +2552,8 @@ ${o}`;
|
|
|
2504
2552
|
}
|
|
2505
2553
|
async #le() {
|
|
2506
2554
|
if (!H.#M) {
|
|
2507
|
-
if (
|
|
2508
|
-
H.#M =
|
|
2555
|
+
if (he.length > 0) {
|
|
2556
|
+
H.#M = he, H.#W();
|
|
2509
2557
|
return;
|
|
2510
2558
|
}
|
|
2511
2559
|
await new Promise((e) => setTimeout(e, 50));
|
|
@@ -2551,7 +2599,7 @@ ${o}`;
|
|
|
2551
2599
|
this.#l.requestPhase(x.STYLE, "plugin:requestAfterRender");
|
|
2552
2600
|
}
|
|
2553
2601
|
#j() {
|
|
2554
|
-
this.#o = new
|
|
2602
|
+
this.#o = new to(this);
|
|
2555
2603
|
const e = this.#i?.plugins, o = Array.isArray(e) ? e : [];
|
|
2556
2604
|
this.#o.attachAll(o);
|
|
2557
2605
|
}
|
|
@@ -2613,9 +2661,9 @@ ${o}`;
|
|
|
2613
2661
|
};
|
|
2614
2662
|
}
|
|
2615
2663
|
connectedCallback() {
|
|
2616
|
-
this.hasAttribute("tabindex") || (this.tabIndex = 0), this.hasAttribute("version") || this.setAttribute("version", H.version), this._rows = Array.isArray(this.#s) ? [...this.#s] : [], this.#p && (this.#p.abort(), this.#O = !1), this.#p = new AbortController(), this.#
|
|
2664
|
+
this.hasAttribute("tabindex") || (this.tabIndex = 0), this.hasAttribute("version") || this.setAttribute("version", H.version), this._rows = Array.isArray(this.#s) ? [...this.#s] : [], this.#p && (this.#p.abort(), this.#O = !1), this.#p = new AbortController(), this.#v && (ye(this.#v), this.#v = void 0), I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#R()), this.#t.parseLightDomColumns(this), this.#t.merge(), this.#j();
|
|
2617
2665
|
const e = this.#i?.plugins;
|
|
2618
|
-
this.#_ = Array.isArray(e) ? e : [], this.#Z(), this.#c || (this.#G(), this.#z(), this.#c = !0), this.#J(), this.#
|
|
2666
|
+
this.#_ = Array.isArray(e) ? e : [], this.#Z(), this.#c || (this.#G(), this.#z(), this.#c = !0), this.#J(), this.#v = _t(
|
|
2619
2667
|
() => {
|
|
2620
2668
|
this.#Ee();
|
|
2621
2669
|
},
|
|
@@ -2623,7 +2671,7 @@ ${o}`;
|
|
|
2623
2671
|
);
|
|
2624
2672
|
}
|
|
2625
2673
|
disconnectedCallback() {
|
|
2626
|
-
this.#
|
|
2674
|
+
this.#v && (ye(this.#v), this.#v = void 0), this.#ae(), kt(this.#e), this.#a.setInitialized(!1), this.#D?.(), this.#D = void 0, Ue(this.#A), this.#p && (this.#p.abort(), this.#p = void 0), this.#P?.abort(), this.#P = void 0, this.#O = !1, this._resizeController && this._resizeController.dispose(), this.#C && (this.#C.disconnect(), this.#C = void 0), this.#y && (this.#y.disconnect(), this.#y = void 0, this.#N = !1), X(this), this.#S.clear(), this.#_ = void 0;
|
|
2627
2675
|
for (const e of this._rowPool)
|
|
2628
2676
|
e.remove();
|
|
2629
2677
|
this._rowPool.length = 0, this.__rowsBodyEl = null, this.#h = !1;
|
|
@@ -2642,15 +2690,15 @@ ${o}`;
|
|
|
2642
2690
|
#J() {
|
|
2643
2691
|
const o = this.#n.querySelector(".tbw-grid-content") ?? this.#n.querySelector(".tbw-grid-root");
|
|
2644
2692
|
if (this._headerRowEl = o?.querySelector(".header-row"), this._virtualization.totalHeightEl = o?.querySelector(".faux-vscroll-spacer"), this._virtualization.viewportEl = o?.querySelector(".rows-viewport"), this._bodyEl = o?.querySelector(".rows"), this.__rowsBodyEl = o?.querySelector(".rows-body"), this.#a.isInitialized) {
|
|
2645
|
-
|
|
2693
|
+
se(this.#n, this.#e), Re(this.#n, this.#i?.shell, this.#e);
|
|
2646
2694
|
const r = this.#i?.shell?.toolPanel?.defaultOpen;
|
|
2647
2695
|
r && this.#e.toolPanels.has(r) && (this.openToolPanel(), this.#e.expandedSections.add(r));
|
|
2648
2696
|
}
|
|
2649
|
-
if (this.setAttribute("data-upgraded", ""), this.#h = !0, this._resizeController =
|
|
2697
|
+
if (this.setAttribute("data-upgraded", ""), this.#h = !0, this._resizeController = _e(this), this.#x(), this.#ee(o), this.#O)
|
|
2650
2698
|
return;
|
|
2651
2699
|
this.#O = !0;
|
|
2652
2700
|
const n = this.disconnectSignal;
|
|
2653
|
-
|
|
2701
|
+
bt(this, this, this.#n, n);
|
|
2654
2702
|
const i = this.#i.rowHeight;
|
|
2655
2703
|
i && i > 0 ? this._virtualization.rowHeight = i : requestAnimationFrame(() => this.#Q()), queueMicrotask(() => this.#de()), this.#l.requestPhase(x.FULL, "afterConnect");
|
|
2656
2704
|
}
|
|
@@ -2684,7 +2732,7 @@ ${o}`;
|
|
|
2684
2732
|
i.style.transform = `translateY(${u}px)`;
|
|
2685
2733
|
}
|
|
2686
2734
|
this.#w = l, this.#g || (this.#g = requestAnimationFrame(() => {
|
|
2687
|
-
this.#g = 0, this.#w !== null && (this.#
|
|
2735
|
+
this.#g = 0, this.#w !== null && (this.#Ce(this.#w), this.#w = null);
|
|
2688
2736
|
}));
|
|
2689
2737
|
},
|
|
2690
2738
|
{ passive: !0, signal: o }
|
|
@@ -2703,11 +2751,11 @@ ${o}`;
|
|
|
2703
2751
|
}
|
|
2704
2752
|
},
|
|
2705
2753
|
{ passive: !1, signal: o }
|
|
2706
|
-
),
|
|
2754
|
+
), Xt(r, this.#A, { fauxScrollbar: n, scrollArea: s }, o));
|
|
2707
2755
|
}
|
|
2708
|
-
this._bodyEl &&
|
|
2756
|
+
this._bodyEl && mt(this, this._bodyEl, o), this.#C?.disconnect(), this._virtualization.viewportEl && (this.#C = new ResizeObserver(() => {
|
|
2709
2757
|
this.#l.requestPhase(x.VIRTUALIZATION, "resize-observer");
|
|
2710
|
-
}), this.#
|
|
2758
|
+
}), this.#C.observe(this._virtualization.viewportEl)), this.#n.addEventListener(
|
|
2711
2759
|
"focusin",
|
|
2712
2760
|
() => {
|
|
2713
2761
|
this.dataset.hasFocus = "";
|
|
@@ -2791,7 +2839,7 @@ ${o}`;
|
|
|
2791
2839
|
X(this), this.#t.merge(), this.#x();
|
|
2792
2840
|
}
|
|
2793
2841
|
#pe() {
|
|
2794
|
-
this.#t.merge(), this.#i.fitMode === "fixed" ? (this.__didInitialAutoSize = !1,
|
|
2842
|
+
this.#t.merge(), this.#i.fitMode === "fixed" ? (this.__didInitialAutoSize = !1, pe(this)) : (this._columns.forEach((o) => {
|
|
2795
2843
|
!o.__userResized && o.__autoSized && delete o.width;
|
|
2796
2844
|
}), U(this));
|
|
2797
2845
|
}
|
|
@@ -2799,7 +2847,7 @@ ${o}`;
|
|
|
2799
2847
|
I(this, this.#e), q(this, this.#e);
|
|
2800
2848
|
const e = !!this.#n.querySelector(".has-shell"), o = !!this.#n.querySelector(".tbw-tool-panel"), n = this.#n.querySelectorAll(".tbw-accordion-section").length;
|
|
2801
2849
|
this.#t.parseLightDomColumns(this), this.#t.merge(), this.#K(), W(this, this.#e, this.#R()), this.#t.markSourcesChanged(), this.#t.merge();
|
|
2802
|
-
const i =
|
|
2850
|
+
const i = Fe(this.#i?.shell), r = (this.#i?.shell?.toolPanels?.length ?? 0) > 0, s = (this.#i?.shell?.toolPanels?.length ?? 0) !== n;
|
|
2803
2851
|
if (e !== i || !e && i || !o && r || o && s) {
|
|
2804
2852
|
this.#G(), this.#z(), this.#J(), this.#$();
|
|
2805
2853
|
return;
|
|
@@ -2829,16 +2877,16 @@ ${o}`;
|
|
|
2829
2877
|
const e = Array.isArray(this.#s) ? [...this.#s] : [], o = this.#o?.processRows(e) ?? e;
|
|
2830
2878
|
this._rows = o;
|
|
2831
2879
|
}
|
|
2832
|
-
#
|
|
2880
|
+
#ve(e) {
|
|
2833
2881
|
const o = {
|
|
2834
|
-
...
|
|
2882
|
+
...Be,
|
|
2835
2883
|
...e.animation
|
|
2836
2884
|
}, n = o.mode ?? "reduced-motion";
|
|
2837
2885
|
let i = 1;
|
|
2838
2886
|
n === !1 || n === "off" ? i = 0 : (n === !0 || n === "on") && (i = 1), this.style.setProperty("--tbw-animation-duration", `${o.duration}ms`), this.style.setProperty("--tbw-animation-easing", o.easing ?? "ease-out"), this.style.setProperty("--tbw-animation-enabled", String(i)), this.dataset.animationMode = typeof n == "boolean" ? n ? "on" : "off" : n;
|
|
2839
2887
|
}
|
|
2840
2888
|
#F(e, o, n = this.__rowRenderEpoch) {
|
|
2841
|
-
this.#b || (this.#b = (i, r, s) => this.#o?.renderRow(i, r, s) ?? !1),
|
|
2889
|
+
this.#b || (this.#b = (i, r, s) => this.#o?.renderRow(i, r, s) ?? !1), ht(this, e, o, n, this.#b);
|
|
2842
2890
|
}
|
|
2843
2891
|
#U = -1;
|
|
2844
2892
|
#ne = -1;
|
|
@@ -2859,7 +2907,7 @@ ${o}`;
|
|
|
2859
2907
|
this._bodyEl && (this._bodyEl.style.display = "", this._bodyEl.style.gridTemplateColumns = ""), this.#l.requestPhase(x.FULL, "setup");
|
|
2860
2908
|
}
|
|
2861
2909
|
}
|
|
2862
|
-
#
|
|
2910
|
+
#Ce(e) {
|
|
2863
2911
|
if (this.refreshVirtualWindow(!1), this.#o?.onScrollRender(), this.#r) {
|
|
2864
2912
|
const o = this._virtualization.container, n = this.#E;
|
|
2865
2913
|
n.scrollTop = e, n.scrollLeft = o?.scrollLeft ?? 0, n.scrollHeight = o?.scrollHeight ?? 0, n.scrollWidth = o?.scrollWidth ?? 0, n.clientHeight = o?.clientHeight ?? 0, n.clientWidth = o?.clientWidth ?? 0, this.#o?.onScroll(n);
|
|
@@ -3021,6 +3069,15 @@ ${o}`;
|
|
|
3021
3069
|
}
|
|
3022
3070
|
n && this.#l.requestPhase(x.ROWS, "updateRows");
|
|
3023
3071
|
}
|
|
3072
|
+
animateRow(e, o) {
|
|
3073
|
+
de(this, e, o);
|
|
3074
|
+
}
|
|
3075
|
+
animateRows(e, o) {
|
|
3076
|
+
Pt(this, e, o);
|
|
3077
|
+
}
|
|
3078
|
+
animateRowById(e, o) {
|
|
3079
|
+
return Lt(this, e, o);
|
|
3080
|
+
}
|
|
3024
3081
|
setColumnVisible(e, o) {
|
|
3025
3082
|
const n = this.#t.setColumnVisible(e, o);
|
|
3026
3083
|
return n && this.requestStateChange(), n;
|
|
@@ -3121,11 +3178,11 @@ ${o}`;
|
|
|
3121
3178
|
#_e() {
|
|
3122
3179
|
const o = this.#n.querySelector(".tbw-grid-content") ?? this.#n.querySelector(".tbw-grid-root");
|
|
3123
3180
|
if (this._headerRowEl = o?.querySelector(".header-row"), this._virtualization.totalHeightEl = o?.querySelector(".faux-vscroll-spacer"), this._virtualization.viewportEl = o?.querySelector(".rows-viewport"), this._bodyEl = o?.querySelector(".rows"), this.__rowsBodyEl = o?.querySelector(".rows-body"), this.#a.isInitialized) {
|
|
3124
|
-
|
|
3181
|
+
se(this.#n, this.#e), Re(this.#n, this.#i?.shell, this.#e);
|
|
3125
3182
|
const n = this.#i?.shell?.toolPanel?.defaultOpen;
|
|
3126
3183
|
n && this.#e.toolPanels.has(n) && (this.openToolPanel(), this.#e.expandedSections.add(n));
|
|
3127
3184
|
}
|
|
3128
|
-
this._resizeController =
|
|
3185
|
+
this._resizeController = _e(this), this.#ee(o), this.#l.requestPhase(x.COLUMNS, "shellRefresh");
|
|
3129
3186
|
}
|
|
3130
3187
|
#S = /* @__PURE__ */ new Map();
|
|
3131
3188
|
registerStyles(e, o) {
|
|
@@ -3153,7 +3210,7 @@ ${o}`;
|
|
|
3153
3210
|
this.#t.markSourcesChanged(), this.#t.merge();
|
|
3154
3211
|
const l = this.#n.querySelector(".tbw-shell-header");
|
|
3155
3212
|
if (l) {
|
|
3156
|
-
const c =
|
|
3213
|
+
const c = Se(
|
|
3157
3214
|
this.#i.shell,
|
|
3158
3215
|
this.#e,
|
|
3159
3216
|
this.#i.icons?.toolPanel
|
|
@@ -3177,7 +3234,7 @@ ${o}`;
|
|
|
3177
3234
|
this.#t.markSourcesChanged(), this.#t.merge();
|
|
3178
3235
|
const s = this.#n.querySelector(".tbw-shell-header");
|
|
3179
3236
|
if (s) {
|
|
3180
|
-
const l =
|
|
3237
|
+
const l = Se(
|
|
3181
3238
|
this.#i.shell,
|
|
3182
3239
|
this.#e,
|
|
3183
3240
|
this.#i.icons?.toolPanel
|
|
@@ -3208,7 +3265,7 @@ ${o}`;
|
|
|
3208
3265
|
let a = Math.floor(c / l), h = 0;
|
|
3209
3266
|
const u = 10;
|
|
3210
3267
|
for (; h < u; ) {
|
|
3211
|
-
const
|
|
3268
|
+
const v = this.#o?.getExtraHeightBefore?.(a) ?? 0, T = Math.floor((c - v) / l);
|
|
3212
3269
|
if (T >= a || T < 0) break;
|
|
3213
3270
|
a = T, h++;
|
|
3214
3271
|
}
|
|
@@ -3225,8 +3282,8 @@ ${o}`;
|
|
|
3225
3282
|
this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${w}px`);
|
|
3226
3283
|
const m = this.#o?.getExtraHeightBefore?.(a) ?? 0, R = -(c - a * l - m);
|
|
3227
3284
|
this._bodyEl.style.transform = `translateY(${R}px)`, this.#F(a, g, e ? ++this.__rowRenderEpoch : this.__rowRenderEpoch), this.#ie(n, this._visibleColumns.length), e && !o && (this.#o?.afterRender(), queueMicrotask(() => {
|
|
3228
|
-
const
|
|
3229
|
-
if (
|
|
3285
|
+
const v = i.clientHeight, T = r.clientHeight;
|
|
3286
|
+
if (v === 0 && T > 0) return;
|
|
3230
3287
|
const b = this.#B(n);
|
|
3231
3288
|
this._virtualization.totalHeightEl && (this._virtualization.totalHeightEl.style.height = `${b}px`);
|
|
3232
3289
|
}));
|
|
@@ -3234,7 +3291,7 @@ ${o}`;
|
|
|
3234
3291
|
#G() {
|
|
3235
3292
|
I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#R()), this.#t.markSourcesChanged(), this.#t.merge();
|
|
3236
3293
|
const e = this.#i?.shell;
|
|
3237
|
-
|
|
3294
|
+
Wt(
|
|
3238
3295
|
this.#n,
|
|
3239
3296
|
e,
|
|
3240
3297
|
{ isPanelOpen: this.#e.isPanelOpen, expandedSections: this.#e.expandedSections },
|
|
@@ -3242,24 +3299,24 @@ ${o}`;
|
|
|
3242
3299
|
) && (this.#X(), this.#a.setInitialized(!0));
|
|
3243
3300
|
}
|
|
3244
3301
|
#X() {
|
|
3245
|
-
|
|
3302
|
+
Mt(this.#n, this.#i?.shell, this.#e, {
|
|
3246
3303
|
onPanelToggle: () => this.toggleToolPanel(),
|
|
3247
3304
|
onSectionToggle: (e) => this.toggleToolPanelSection(e)
|
|
3248
|
-
}), this.#D?.(), this.#D =
|
|
3305
|
+
}), this.#D?.(), this.#D = zt(this.#n, this.#i?.shell, (e) => {
|
|
3249
3306
|
this.style.setProperty("--tbw-tool-panel-width", `${e}px`);
|
|
3250
3307
|
});
|
|
3251
3308
|
}
|
|
3252
3309
|
}
|
|
3253
3310
|
customElements.get(H.tagName) || customElements.define(H.tagName, H);
|
|
3254
3311
|
globalThis.DataGridElement = H;
|
|
3255
|
-
const
|
|
3312
|
+
const no = {
|
|
3256
3313
|
CAN_MOVE_COLUMN: "canMoveColumn",
|
|
3257
3314
|
GET_CONTEXT_MENU_ITEMS: "getContextMenuItems"
|
|
3258
3315
|
};
|
|
3259
|
-
class
|
|
3316
|
+
class io {
|
|
3260
3317
|
static dependencies;
|
|
3261
3318
|
static manifest;
|
|
3262
|
-
version = "1.
|
|
3319
|
+
version = "1.3.0";
|
|
3263
3320
|
styles;
|
|
3264
3321
|
cellRenderers;
|
|
3265
3322
|
headerRenderers;
|
|
@@ -3386,7 +3443,7 @@ const A = {
|
|
|
3386
3443
|
GROUP_KEY: "data-group-key",
|
|
3387
3444
|
TREE_LEVEL: "data-tree-level",
|
|
3388
3445
|
STICKY: "data-sticky"
|
|
3389
|
-
},
|
|
3446
|
+
}, ro = {
|
|
3390
3447
|
ROOT: `.${A.ROOT}`,
|
|
3391
3448
|
HEADER: `.${A.HEADER}`,
|
|
3392
3449
|
HEADER_ROW: `.${A.HEADER_ROW}`,
|
|
@@ -3401,7 +3458,7 @@ const A = {
|
|
|
3401
3458
|
CELL_AT: (t, e) => `.${A.DATA_ROW}[${j.ROW_INDEX}="${t}"] .${A.DATA_CELL}[${j.COL_INDEX}="${e}"]`,
|
|
3402
3459
|
SELECTED_ROWS: `.${A.DATA_ROW}.${A.SELECTED}`,
|
|
3403
3460
|
EDITING_CELL: `.${A.DATA_CELL}.${A.EDITING}`
|
|
3404
|
-
},
|
|
3461
|
+
}, so = {
|
|
3405
3462
|
COLOR_BG: "--tbw-color-bg",
|
|
3406
3463
|
COLOR_FG: "--tbw-color-fg",
|
|
3407
3464
|
COLOR_FG_MUTED: "--tbw-color-fg-muted",
|
|
@@ -3420,14 +3477,14 @@ const A = {
|
|
|
3420
3477
|
BORDER_RADIUS: "--tbw-border-radius",
|
|
3421
3478
|
FOCUS_OUTLINE: "--tbw-focus-outline"
|
|
3422
3479
|
};
|
|
3423
|
-
function
|
|
3480
|
+
function lo(t) {
|
|
3424
3481
|
const e = document.createElement("tbw-grid");
|
|
3425
3482
|
return t && (e.gridConfig = t), e;
|
|
3426
3483
|
}
|
|
3427
|
-
function
|
|
3484
|
+
function ao(t, e = document) {
|
|
3428
3485
|
return e.querySelector(t);
|
|
3429
3486
|
}
|
|
3430
|
-
const
|
|
3487
|
+
const co = {
|
|
3431
3488
|
CELL_CHANGE: "cell-change",
|
|
3432
3489
|
CELL_COMMIT: "cell-commit",
|
|
3433
3490
|
ROW_COMMIT: "row-commit",
|
|
@@ -3440,7 +3497,7 @@ const eo = {
|
|
|
3440
3497
|
CELL_ACTIVATE: "cell-activate",
|
|
3441
3498
|
GROUP_TOGGLE: "group-toggle",
|
|
3442
3499
|
COLUMN_STATE_CHANGE: "column-state-change"
|
|
3443
|
-
},
|
|
3500
|
+
}, ho = {
|
|
3444
3501
|
SELECTION_CHANGE: "selection-change",
|
|
3445
3502
|
TREE_EXPAND: "tree-expand",
|
|
3446
3503
|
FILTER_CHANGE: "filter-change",
|
|
@@ -3458,7 +3515,7 @@ const eo = {
|
|
|
3458
3515
|
COLUMN_REORDER: "column-reorder",
|
|
3459
3516
|
DETAIL_EXPAND: "detail-expand",
|
|
3460
3517
|
GROUP_EXPAND: "group-expand"
|
|
3461
|
-
},
|
|
3518
|
+
}, re = {
|
|
3462
3519
|
sum: (t, e) => t.reduce((o, n) => o + (Number(n[e]) || 0), 0),
|
|
3463
3520
|
avg: (t, e) => {
|
|
3464
3521
|
const o = t.reduce((n, i) => n + (Number(i[e]) || 0), 0);
|
|
@@ -3478,19 +3535,19 @@ const eo = {
|
|
|
3478
3535
|
},
|
|
3479
3536
|
get(t) {
|
|
3480
3537
|
if (t !== void 0)
|
|
3481
|
-
return typeof t == "function" ? t : F.get(t) ??
|
|
3538
|
+
return typeof t == "function" ? t : F.get(t) ?? re[t];
|
|
3482
3539
|
},
|
|
3483
3540
|
run(t, e, o, n) {
|
|
3484
3541
|
const i = this.get(t);
|
|
3485
3542
|
return i ? i(e, o, n) : void 0;
|
|
3486
3543
|
},
|
|
3487
3544
|
has(t) {
|
|
3488
|
-
return F.has(t) || t in
|
|
3545
|
+
return F.has(t) || t in re;
|
|
3489
3546
|
},
|
|
3490
3547
|
list() {
|
|
3491
|
-
return [...Object.keys(
|
|
3548
|
+
return [...Object.keys(re), ...F.keys()];
|
|
3492
3549
|
}
|
|
3493
|
-
},
|
|
3550
|
+
}, Pe = {
|
|
3494
3551
|
sum: (t) => t.reduce((e, o) => e + o, 0),
|
|
3495
3552
|
avg: (t) => t.length ? t.reduce((e, o) => e + o, 0) / t.length : 0,
|
|
3496
3553
|
count: (t) => t.length,
|
|
@@ -3499,45 +3556,46 @@ const eo = {
|
|
|
3499
3556
|
first: (t) => t[0] ?? 0,
|
|
3500
3557
|
last: (t) => t[t.length - 1] ?? 0
|
|
3501
3558
|
};
|
|
3502
|
-
function
|
|
3503
|
-
return
|
|
3559
|
+
function oo(t) {
|
|
3560
|
+
return Pe[t] ?? Pe.sum;
|
|
3504
3561
|
}
|
|
3505
|
-
function
|
|
3506
|
-
return
|
|
3562
|
+
function uo(t, e) {
|
|
3563
|
+
return oo(t)(e);
|
|
3507
3564
|
}
|
|
3508
|
-
const
|
|
3565
|
+
const fo = M.register.bind(M), po = M.unregister.bind(M), go = M.get.bind(M), wo = M.run.bind(M), mo = M.list.bind(M);
|
|
3509
3566
|
export {
|
|
3510
|
-
|
|
3511
|
-
|
|
3567
|
+
io as BaseGridPlugin,
|
|
3568
|
+
Be as DEFAULT_ANIMATION_CONFIG,
|
|
3512
3569
|
z as DEFAULT_GRID_ICONS,
|
|
3513
|
-
|
|
3570
|
+
co as DGEvents,
|
|
3514
3571
|
H as DataGridElement,
|
|
3515
3572
|
B as FitModeEnum,
|
|
3516
|
-
|
|
3573
|
+
so as GridCSSVars,
|
|
3517
3574
|
A as GridClasses,
|
|
3518
3575
|
j as GridDataAttrs,
|
|
3519
3576
|
H as GridElement,
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3577
|
+
ro as GridSelectors,
|
|
3578
|
+
no as PLUGIN_QUERIES,
|
|
3579
|
+
ho as PluginEvents,
|
|
3580
|
+
to as PluginManager,
|
|
3524
3581
|
x as RenderPhase,
|
|
3525
|
-
|
|
3582
|
+
At as a,
|
|
3526
3583
|
M as aggregatorRegistry,
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3584
|
+
$ as b,
|
|
3585
|
+
Ct as builtInSort,
|
|
3586
|
+
ae as c,
|
|
3587
|
+
lo as createGrid,
|
|
3588
|
+
vt as defaultComparator,
|
|
3589
|
+
Le as e,
|
|
3590
|
+
De as g,
|
|
3591
|
+
go as getAggregator,
|
|
3592
|
+
oo as getValueAggregator,
|
|
3593
|
+
mo as listAggregators,
|
|
3594
|
+
ao as queryGrid,
|
|
3595
|
+
fo as registerAggregator,
|
|
3596
|
+
wo as runAggregator,
|
|
3597
|
+
uo as runValueAggregator,
|
|
3540
3598
|
K as s,
|
|
3541
|
-
|
|
3599
|
+
po as unregisterAggregator
|
|
3542
3600
|
};
|
|
3543
3601
|
//# sourceMappingURL=index.js.map
|