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