@toolbox-web/grid 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/all.d.ts +1 -0
- package/all.d.ts.map +1 -1
- package/all.js +899 -637
- package/all.js.map +1 -1
- package/index.js +641 -600
- package/index.js.map +1 -1
- package/lib/core/grid.d.ts.map +1 -1
- package/lib/core/internal/header.d.ts +7 -0
- package/lib/core/internal/header.d.ts.map +1 -1
- package/lib/core/types.d.ts +147 -0
- package/lib/core/types.d.ts.map +1 -1
- package/lib/plugins/clipboard/index.js +2 -1
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/column-virtualization/index.js +6 -5
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/index.js +2 -1
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/editing/EditingPlugin.d.ts.map +1 -1
- package/lib/plugins/editing/index.js +9 -6
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/export/index.js +2 -1
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/index.js +60 -59
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/grouping-columns/index.js +2 -1
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/index.js +2 -1
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/master-detail/index.js +2 -1
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/multi-sort/index.js +2 -1
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/index.js +2 -1
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/index.js +2 -1
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/index.js +2 -1
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/print/PrintPlugin.d.ts +98 -0
- package/lib/plugins/print/PrintPlugin.d.ts.map +1 -0
- package/lib/plugins/print/index.d.ts +10 -0
- package/lib/plugins/print/index.d.ts.map +1 -0
- package/lib/plugins/print/index.js +626 -0
- package/lib/plugins/print/index.js.map +1 -0
- package/lib/plugins/print/print-isolated.d.ts +26 -0
- package/lib/plugins/print/print-isolated.d.ts.map +1 -0
- package/lib/plugins/print/types.d.ts +147 -0
- package/lib/plugins/print/types.d.ts.map +1 -0
- package/lib/plugins/reorder/index.js +2 -1
- package/lib/plugins/reorder/index.js.map +1 -1
- package/lib/plugins/responsive/index.js +2 -1
- package/lib/plugins/responsive/index.js.map +1 -1
- package/lib/plugins/row-reorder/index.js +2 -1
- package/lib/plugins/row-reorder/index.js.map +1 -1
- package/lib/plugins/selection/SelectionPlugin.d.ts.map +1 -1
- package/lib/plugins/selection/index.js +109 -97
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/server-side/index.js +2 -1
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/tree/index.js +2 -1
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/undo-redo/index.js +2 -1
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/visibility/index.js +2 -1
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +1 -1
- package/public.d.ts +1 -1
- package/public.d.ts.map +1 -1
- package/umd/grid.all.umd.js +98 -24
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +11 -11
- package/umd/grid.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/print.umd.js +76 -0
- package/umd/plugins/print.umd.js.map +1 -0
- 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 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 = {
|
|
1
|
+
const pe = '@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-display: inline-flex;--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;display:var(--tbw-sort-indicator-display, inline-flex);visibility:var(--tbw-sort-indicator-visibility, visible);transition:opacity .15s,visibility 0s,display 0s allow-discrete;transition-behavior:allow-discrete}&:hover>span[part~=sort-indicator],&[aria-sort=ascending]>span[part~=sort-indicator],&[aria-sort=descending]>span[part~=sort-indicator]{display:inline-flex;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}}', G = {
|
|
2
2
|
STRETCH: "stretch",
|
|
3
3
|
FIXED: "fixed"
|
|
4
|
-
},
|
|
4
|
+
}, je = {
|
|
5
5
|
mode: "reduced-motion",
|
|
6
6
|
duration: 200,
|
|
7
7
|
easing: "ease-out"
|
|
8
|
-
},
|
|
8
|
+
}, ge = '<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: "▲",
|
|
@@ -14,10 +14,11 @@ const he = '@layer tbw-base,tbw-plugins,tbw-theme;@layer tbw-base{tbw-grid{--tbw
|
|
|
14
14
|
submenuArrow: "▶",
|
|
15
15
|
dragHandle: "⋮⋮",
|
|
16
16
|
toolPanel: "☰",
|
|
17
|
-
filter:
|
|
18
|
-
filterActive:
|
|
17
|
+
filter: ge,
|
|
18
|
+
filterActive: ge,
|
|
19
|
+
print: "🖨️"
|
|
19
20
|
};
|
|
20
|
-
function
|
|
21
|
+
function Ke(t) {
|
|
21
22
|
return Array.from(t.querySelectorAll("tbw-grid-column")).map((o) => {
|
|
22
23
|
const n = o.getAttribute("field") || "";
|
|
23
24
|
if (!n) return null;
|
|
@@ -54,7 +55,7 @@ function Xe(t) {
|
|
|
54
55
|
return h;
|
|
55
56
|
}).filter((o) => !!o);
|
|
56
57
|
}
|
|
57
|
-
function
|
|
58
|
+
function we(t, e) {
|
|
58
59
|
if ((!t || !t.length) && (!e || !e.length)) return [];
|
|
59
60
|
if (!t || !t.length) return e || [];
|
|
60
61
|
if (!e || !e.length) return t;
|
|
@@ -78,7 +79,7 @@ function fe(t, e) {
|
|
|
78
79
|
});
|
|
79
80
|
return Object.keys(o).forEach((i) => n.push(o[i])), n;
|
|
80
81
|
}
|
|
81
|
-
function
|
|
82
|
+
function De(t, e) {
|
|
82
83
|
try {
|
|
83
84
|
t.part?.add?.(e);
|
|
84
85
|
} catch {
|
|
@@ -86,9 +87,9 @@ function pe(t, e) {
|
|
|
86
87
|
const o = t.getAttribute("part");
|
|
87
88
|
o ? o.split(/\s+/).includes(e) || t.setAttribute("part", o + " " + e) : t.setAttribute("part", e);
|
|
88
89
|
}
|
|
89
|
-
function
|
|
90
|
-
const e = t.effectiveConfig?.fitMode || t.fitMode ||
|
|
91
|
-
if (e !==
|
|
90
|
+
function me(t) {
|
|
91
|
+
const e = t.effectiveConfig?.fitMode || t.fitMode || G.STRETCH;
|
|
92
|
+
if (e !== G.STRETCH && e !== G.FIXED || t.__didInitialAutoSize || !t.isConnected) return;
|
|
92
93
|
const o = Array.from(t._headerRowEl?.children || []);
|
|
93
94
|
if (!o.length) return;
|
|
94
95
|
let n = !1;
|
|
@@ -104,32 +105,32 @@ function ge(t) {
|
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
107
|
l > 0 && (i.width = l + 2, i.__autoSized = !0, n = !0);
|
|
107
|
-
}), n &&
|
|
108
|
+
}), n && V(t), t.__didInitialAutoSize = !0;
|
|
108
109
|
}
|
|
109
|
-
function
|
|
110
|
-
(t.effectiveConfig?.fitMode || t.fitMode ||
|
|
110
|
+
function V(t) {
|
|
111
|
+
(t.effectiveConfig?.fitMode || t.fitMode || G.STRETCH) === G.STRETCH ? t._gridTemplate = t._visibleColumns.map((o) => {
|
|
111
112
|
if (o.width) return `${o.width}px`;
|
|
112
113
|
const n = o.minWidth;
|
|
113
114
|
return n != null ? `minmax(${n}px, 1fr)` : "1fr";
|
|
114
115
|
}).join(" ").trim() : t._gridTemplate = t._visibleColumns.map((o) => o.width ? `${o.width}px` : "max-content").join(" "), t.style.setProperty("--tbw-column-template", t._gridTemplate);
|
|
115
116
|
}
|
|
116
|
-
function
|
|
117
|
+
function Ze(t) {
|
|
117
118
|
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";
|
|
118
119
|
}
|
|
119
|
-
function
|
|
120
|
+
function Je(t, e) {
|
|
120
121
|
const o = t[0] || {}, n = Object.keys(o).map((r) => {
|
|
121
|
-
const s = o[r], l =
|
|
122
|
+
const s = o[r], l = Ze(s);
|
|
122
123
|
return { field: r, header: r.charAt(0).toUpperCase() + r.slice(1), type: l };
|
|
123
124
|
}), i = {};
|
|
124
125
|
return n.forEach((r) => {
|
|
125
126
|
i[r.field] = r.type || "string";
|
|
126
127
|
}), { columns: n, typeMap: i };
|
|
127
128
|
}
|
|
128
|
-
const
|
|
129
|
-
function
|
|
129
|
+
const Qe = /{{\s*([^}]+)\s*}}/g, O = "__DG_EMPTY__", et = /^[\w$. '?+\-*/%:()!<>=,&|]+$/, tt = /__(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/;
|
|
130
|
+
function ot(t) {
|
|
130
131
|
return !t || typeof t != "string" ? "" : t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
131
132
|
}
|
|
132
|
-
const
|
|
133
|
+
const nt = /* @__PURE__ */ new Set([
|
|
133
134
|
"script",
|
|
134
135
|
"iframe",
|
|
135
136
|
"object",
|
|
@@ -154,23 +155,23 @@ const et = /* @__PURE__ */ new Set([
|
|
|
154
155
|
"plaintext",
|
|
155
156
|
"xmp",
|
|
156
157
|
"listing"
|
|
157
|
-
]),
|
|
158
|
-
function
|
|
158
|
+
]), be = /^on\w+$/i, it = /* @__PURE__ */ new Set(["href", "src", "action", "formaction", "data", "srcdoc", "xlink:href", "poster", "srcset"]), rt = /^\s*(javascript|vbscript|data|blob):/i;
|
|
159
|
+
function F(t) {
|
|
159
160
|
if (!t || typeof t != "string") return "";
|
|
160
161
|
if (t.indexOf("<") === -1) return t;
|
|
161
162
|
const e = document.createElement("template");
|
|
162
|
-
return e.innerHTML = t,
|
|
163
|
+
return e.innerHTML = t, st(e.content), e.innerHTML;
|
|
163
164
|
}
|
|
164
|
-
function
|
|
165
|
+
function st(t) {
|
|
165
166
|
const e = [], o = t.querySelectorAll("*");
|
|
166
167
|
for (const n of o) {
|
|
167
168
|
const i = n.tagName.toLowerCase();
|
|
168
|
-
if (
|
|
169
|
+
if (nt.has(i)) {
|
|
169
170
|
e.push(n);
|
|
170
171
|
continue;
|
|
171
172
|
}
|
|
172
173
|
if ((i === "svg" || n.namespaceURI === "http://www.w3.org/2000/svg") && Array.from(n.attributes).some(
|
|
173
|
-
(l) =>
|
|
174
|
+
(l) => be.test(l.name) || l.name === "href" || l.name === "xlink:href"
|
|
174
175
|
)) {
|
|
175
176
|
e.push(n);
|
|
176
177
|
continue;
|
|
@@ -178,11 +179,11 @@ function nt(t) {
|
|
|
178
179
|
const r = [];
|
|
179
180
|
for (const s of n.attributes) {
|
|
180
181
|
const l = s.name.toLowerCase();
|
|
181
|
-
if (
|
|
182
|
+
if (be.test(l)) {
|
|
182
183
|
r.push(s.name);
|
|
183
184
|
continue;
|
|
184
185
|
}
|
|
185
|
-
if (
|
|
186
|
+
if (it.has(l) && rt.test(s.value)) {
|
|
186
187
|
r.push(s.name);
|
|
187
188
|
continue;
|
|
188
189
|
}
|
|
@@ -195,22 +196,22 @@ function nt(t) {
|
|
|
195
196
|
}
|
|
196
197
|
e.forEach((n) => n.remove());
|
|
197
198
|
}
|
|
198
|
-
function
|
|
199
|
+
function Me(t, e) {
|
|
199
200
|
if (!t || t.indexOf("{{") === -1) return t;
|
|
200
|
-
const o = [], n = t.replace(
|
|
201
|
-
const a =
|
|
201
|
+
const o = [], n = t.replace(Qe, (l, c) => {
|
|
202
|
+
const a = lt(c, e);
|
|
202
203
|
return o.push({ expr: c.trim(), result: a }), a;
|
|
203
|
-
}), i =
|
|
204
|
+
}), i = at(n), r = o.length && o.every((l) => l.result === "" || l.result === O);
|
|
204
205
|
return /Reflect\.|\bProxy\b|ownKeys\(/.test(t) || r ? "" : i;
|
|
205
206
|
}
|
|
206
|
-
function
|
|
207
|
+
function lt(t, e) {
|
|
207
208
|
if (t = (t || "").trim(), !t || /\b(Reflect|Proxy|ownKeys)\b/.test(t)) return O;
|
|
208
209
|
if (t === "value") return e.value == null ? O : String(e.value);
|
|
209
210
|
if (t.startsWith("row.") && !/[()?]/.test(t) && !t.includes(":")) {
|
|
210
211
|
const n = t.slice(4), i = e.row ? e.row[n] : void 0;
|
|
211
212
|
return i == null ? O : String(i);
|
|
212
213
|
}
|
|
213
|
-
if (t.length > 80 || !
|
|
214
|
+
if (t.length > 80 || !et.test(t) || tt.test(t)) return O;
|
|
214
215
|
const o = t.match(/\./g);
|
|
215
216
|
if (o && o.length > 1) return O;
|
|
216
217
|
try {
|
|
@@ -220,10 +221,10 @@ function it(t, e) {
|
|
|
220
221
|
return O;
|
|
221
222
|
}
|
|
222
223
|
}
|
|
223
|
-
function
|
|
224
|
+
function at(t) {
|
|
224
225
|
return t && t.replace(new RegExp(O, "g"), "").replace(/Reflect\.[^<>{}\s]+/g, "").replace(/\bProxy\b/g, "").replace(/ownKeys\([^)]*\)/g, "");
|
|
225
226
|
}
|
|
226
|
-
function
|
|
227
|
+
function ct(t) {
|
|
227
228
|
if (/Reflect|Proxy|ownKeys/.test(t.textContent || "")) {
|
|
228
229
|
if (Array.from(t.childNodes).forEach((e) => {
|
|
229
230
|
e.nodeType === Node.TEXT_NODE && /Reflect|Proxy|ownKeys/.test(e.textContent || "") && (e.textContent = "");
|
|
@@ -235,40 +236,40 @@ function st(t) {
|
|
|
235
236
|
(t.textContent || "").trim().length === 0 && (t.textContent = "");
|
|
236
237
|
}
|
|
237
238
|
}
|
|
238
|
-
function
|
|
239
|
-
const e = /Reflect\.|\bProxy\b|ownKeys\(/.test(t), o = ((n) => e ? "" :
|
|
239
|
+
function ve(t) {
|
|
240
|
+
const e = /Reflect\.|\bProxy\b|ownKeys\(/.test(t), o = ((n) => e ? "" : Me(t, n));
|
|
240
241
|
return o.__blocked = e, o;
|
|
241
242
|
}
|
|
242
|
-
const
|
|
243
|
-
class
|
|
244
|
-
#
|
|
245
|
-
#
|
|
246
|
-
#
|
|
243
|
+
const dt = 100;
|
|
244
|
+
class ht {
|
|
245
|
+
#l;
|
|
246
|
+
#i;
|
|
247
|
+
#u;
|
|
247
248
|
#d;
|
|
249
|
+
#h;
|
|
250
|
+
#a = {};
|
|
251
|
+
#n = {};
|
|
252
|
+
#f = !0;
|
|
253
|
+
#g = [];
|
|
254
|
+
#b;
|
|
248
255
|
#s;
|
|
249
|
-
#
|
|
250
|
-
#h = {};
|
|
251
|
-
#u = !0;
|
|
252
|
-
#m = [];
|
|
253
|
-
#l;
|
|
254
|
-
#g;
|
|
255
|
-
#w;
|
|
256
|
+
#v;
|
|
256
257
|
#r;
|
|
257
|
-
#
|
|
258
|
+
#m;
|
|
258
259
|
constructor(e) {
|
|
259
260
|
this.#r = e;
|
|
260
261
|
}
|
|
261
262
|
get original() {
|
|
262
|
-
return this.#
|
|
263
|
+
return this.#a;
|
|
263
264
|
}
|
|
264
265
|
get effective() {
|
|
265
|
-
return this.#
|
|
266
|
+
return this.#n;
|
|
266
267
|
}
|
|
267
268
|
get columns() {
|
|
268
|
-
return this.#
|
|
269
|
+
return this.#n.columns ?? [];
|
|
269
270
|
}
|
|
270
271
|
set columns(e) {
|
|
271
|
-
this.#
|
|
272
|
+
this.#n.columns = e;
|
|
272
273
|
}
|
|
273
274
|
get lightDomColumnsCache() {
|
|
274
275
|
return this.#d;
|
|
@@ -277,55 +278,55 @@ class at {
|
|
|
277
278
|
this.#d = e;
|
|
278
279
|
}
|
|
279
280
|
get originalColumnNodes() {
|
|
280
|
-
return this.#
|
|
281
|
+
return this.#h;
|
|
281
282
|
}
|
|
282
283
|
set originalColumnNodes(e) {
|
|
283
|
-
this.#
|
|
284
|
+
this.#h = e;
|
|
284
285
|
}
|
|
285
286
|
get lightDomTitle() {
|
|
286
|
-
return this.#
|
|
287
|
+
return this.#m;
|
|
287
288
|
}
|
|
288
289
|
set lightDomTitle(e) {
|
|
289
|
-
this.#
|
|
290
|
+
this.#m = e;
|
|
290
291
|
}
|
|
291
292
|
get initialColumnState() {
|
|
292
|
-
return this.#
|
|
293
|
+
return this.#v;
|
|
293
294
|
}
|
|
294
295
|
set initialColumnState(e) {
|
|
295
|
-
this.#
|
|
296
|
+
this.#v = e;
|
|
296
297
|
}
|
|
297
298
|
get sourcesChanged() {
|
|
298
|
-
return this.#
|
|
299
|
+
return this.#f;
|
|
299
300
|
}
|
|
300
301
|
markSourcesChanged() {
|
|
301
|
-
this.#
|
|
302
|
+
this.#f = !0;
|
|
302
303
|
}
|
|
303
304
|
setGridConfig(e) {
|
|
304
|
-
this.#
|
|
305
|
+
this.#l = e, this.#f = !0, this.#d = void 0;
|
|
305
306
|
}
|
|
306
307
|
getGridConfig() {
|
|
307
|
-
return this.#
|
|
308
|
+
return this.#l;
|
|
308
309
|
}
|
|
309
310
|
setColumns(e) {
|
|
310
|
-
this.#
|
|
311
|
+
this.#i = e, this.#f = !0;
|
|
311
312
|
}
|
|
312
313
|
getColumns() {
|
|
313
|
-
return this.#
|
|
314
|
+
return this.#i;
|
|
314
315
|
}
|
|
315
316
|
setFitMode(e) {
|
|
316
|
-
this.#
|
|
317
|
+
this.#u = e, this.#f = !0;
|
|
317
318
|
}
|
|
318
319
|
getFitMode() {
|
|
319
|
-
return this.#
|
|
320
|
+
return this.#u;
|
|
320
321
|
}
|
|
321
322
|
merge() {
|
|
322
|
-
const e = (this.#
|
|
323
|
-
if (!this.#
|
|
323
|
+
const e = (this.#n.columns?.length ?? 0) > 0;
|
|
324
|
+
if (!this.#f && e)
|
|
324
325
|
return;
|
|
325
|
-
const o = this.#
|
|
326
|
-
this.#
|
|
326
|
+
const o = this.#w();
|
|
327
|
+
this.#f = !1, this.#a = o, Object.freeze(this.#a), this.#a.columns && Object.freeze(this.#a.columns), this.#n = this.#S(this.#a), this.#A();
|
|
327
328
|
}
|
|
328
|
-
#
|
|
329
|
+
#S(e) {
|
|
329
330
|
const o = { ...e };
|
|
330
331
|
return e.columns && (o.columns = e.columns.map((n) => ({ ...n }))), e.shell && (o.shell = {
|
|
331
332
|
...e.shell,
|
|
@@ -335,35 +336,35 @@ class at {
|
|
|
335
336
|
headerContents: e.shell.headerContents?.map((n) => ({ ...n }))
|
|
336
337
|
}), o;
|
|
337
338
|
}
|
|
338
|
-
#
|
|
339
|
-
const e = this.#
|
|
339
|
+
#A() {
|
|
340
|
+
const e = this.#n;
|
|
340
341
|
e.rowHeight && e.rowHeight > 0 && this.#r.setRowHeight(e.rowHeight), e.fitMode === "fixed" && this.columns.forEach((n) => {
|
|
341
342
|
n.width == null && (n.width = 80);
|
|
342
343
|
}), this.#r.applyAnimationConfig(e);
|
|
343
344
|
}
|
|
344
|
-
#
|
|
345
|
-
const e = this.#
|
|
345
|
+
#w() {
|
|
346
|
+
const e = this.#l ? { ...this.#l } : {}, o = Array.isArray(e.columns) ? [...e.columns] : [], n = (this.#d ?? []).map((s) => ({
|
|
346
347
|
...s
|
|
347
348
|
}));
|
|
348
|
-
let i =
|
|
349
|
+
let i = we(
|
|
349
350
|
o,
|
|
350
351
|
n
|
|
351
352
|
);
|
|
352
|
-
this.#
|
|
353
|
-
this.#
|
|
353
|
+
this.#i && this.#i.length && (i = we(
|
|
354
|
+
this.#i,
|
|
354
355
|
n
|
|
355
356
|
));
|
|
356
357
|
const r = this.#r.getRows();
|
|
357
|
-
return i.length === 0 && r.length && (i =
|
|
358
|
+
return i.length === 0 && r.length && (i = Je(r).columns), i.length && (i.forEach((s) => {
|
|
358
359
|
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);
|
|
359
360
|
}), i.forEach((s) => {
|
|
360
|
-
s.__viewTemplate && !s.__compiledView && (s.__compiledView =
|
|
361
|
-
}), e.columns = i), this.#
|
|
361
|
+
s.__viewTemplate && !s.__compiledView && (s.__compiledView = ve(s.__viewTemplate.innerHTML)), s.__editorTemplate && !s.__compiledEditor && (s.__compiledEditor = ve(s.__editorTemplate.innerHTML));
|
|
362
|
+
}), e.columns = i), this.#u && (e.fitMode = this.#u), e.fitMode || (e.fitMode = "stretch"), this.#C(e), e.columnState && !this.#v && (this.#v = e.columnState), e;
|
|
362
363
|
}
|
|
363
|
-
#
|
|
364
|
+
#C(e) {
|
|
364
365
|
e.shell = e.shell ? { ...e.shell } : {}, e.shell.header = e.shell.header ? { ...e.shell.header } : {};
|
|
365
366
|
const o = this.#r.getShellLightDomTitle();
|
|
366
|
-
o && (this.#
|
|
367
|
+
o && (this.#m = o), this.#m && !e.shell.header.title && (e.shell.header.title = this.#m);
|
|
367
368
|
const n = this.#r.getShellLightDomHeaderContent();
|
|
368
369
|
n?.length > 0 && (e.shell.header.lightDomContent = n), this.#r.getShellHasToolButtonsContainer() && (e.shell.header.hasToolButtonsContainer = !0);
|
|
369
370
|
const i = this.#r.getShellToolPanels();
|
|
@@ -376,13 +377,13 @@ class at {
|
|
|
376
377
|
const u = Array.from(r.values());
|
|
377
378
|
u.sort((p, f) => (p.order ?? 100) - (f.order ?? 100)), e.shell.headerContents = u;
|
|
378
379
|
}
|
|
379
|
-
const s = this.#r.getShellToolbarContents(), l = Array.from(s.values()), c = this.#
|
|
380
|
+
const s = this.#r.getShellToolbarContents(), l = Array.from(s.values()), c = this.#l?.shell?.header?.toolbarContents ?? [], a = new Set(c.map((u) => u.id)), h = [...c];
|
|
380
381
|
for (const u of l)
|
|
381
382
|
a.has(u.id) || h.push(u);
|
|
382
383
|
h.sort((u, p) => (u.order ?? 0) - (p.order ?? 0)), e.shell.header.toolbarContents = h;
|
|
383
384
|
}
|
|
384
385
|
collectState(e) {
|
|
385
|
-
const o = this.columns, n = this.#
|
|
386
|
+
const o = this.columns, n = this.#y();
|
|
386
387
|
return {
|
|
387
388
|
columns: o.map((i, r) => {
|
|
388
389
|
const s = {
|
|
@@ -429,7 +430,7 @@ class at {
|
|
|
429
430
|
l.applyColumnState(c.field, c);
|
|
430
431
|
}
|
|
431
432
|
resetState(e) {
|
|
432
|
-
this.#
|
|
433
|
+
this.#v = void 0, this.#r.setSortState(null), this.#n = this.#S(this.#a), this.#A();
|
|
433
434
|
for (const o of e)
|
|
434
435
|
if (o.applyColumnState)
|
|
435
436
|
for (const n of this.columns)
|
|
@@ -440,7 +441,7 @@ class at {
|
|
|
440
441
|
});
|
|
441
442
|
this.requestStateChange(e);
|
|
442
443
|
}
|
|
443
|
-
#
|
|
444
|
+
#y() {
|
|
444
445
|
const e = /* @__PURE__ */ new Map(), o = this.#r.getSortState();
|
|
445
446
|
return o && e.set(o.field, {
|
|
446
447
|
direction: o.direction === 1 ? "asc" : "desc",
|
|
@@ -448,11 +449,11 @@ class at {
|
|
|
448
449
|
}), e;
|
|
449
450
|
}
|
|
450
451
|
requestStateChange(e) {
|
|
451
|
-
this.#
|
|
452
|
-
this.#
|
|
452
|
+
this.#s && clearTimeout(this.#s), this.#s = setTimeout(() => {
|
|
453
|
+
this.#s = void 0;
|
|
453
454
|
const o = this.collectState(e);
|
|
454
455
|
this.#r.emit("column-state-change", o);
|
|
455
|
-
},
|
|
456
|
+
}, dt);
|
|
456
457
|
}
|
|
457
458
|
setColumnVisible(e, o) {
|
|
458
459
|
const n = this.columns, i = n.find((s) => s.field === e);
|
|
@@ -500,42 +501,42 @@ class at {
|
|
|
500
501
|
this.columns = n, this.#r.renderHeader(), this.#r.updateTemplate(), this.#r.refreshVirtualWindow();
|
|
501
502
|
}
|
|
502
503
|
parseLightDomColumns(e) {
|
|
503
|
-
this.#d || (this.#
|
|
504
|
+
this.#d || (this.#h = Array.from(e.querySelectorAll("tbw-grid-column")), this.#d = this.#h.length ? Ke(e) : []);
|
|
504
505
|
}
|
|
505
506
|
clearLightDomCache() {
|
|
506
507
|
this.#d = void 0;
|
|
507
508
|
}
|
|
508
|
-
#
|
|
509
|
+
#p = /* @__PURE__ */ new Map();
|
|
509
510
|
registerLightDomHandler(e, o) {
|
|
510
|
-
this.#
|
|
511
|
+
this.#p.set(e.toLowerCase(), o);
|
|
511
512
|
}
|
|
512
513
|
unregisterLightDomHandler(e) {
|
|
513
|
-
this.#
|
|
514
|
+
this.#p.delete(e.toLowerCase());
|
|
514
515
|
}
|
|
515
516
|
observeLightDOM(e) {
|
|
516
|
-
this.#
|
|
517
|
+
this.#b && this.#b.disconnect();
|
|
517
518
|
const o = /* @__PURE__ */ new Set();
|
|
518
519
|
let n = null;
|
|
519
520
|
const i = () => {
|
|
520
521
|
n = null;
|
|
521
522
|
for (const r of o)
|
|
522
|
-
this.#
|
|
523
|
+
this.#p.get(r)?.();
|
|
523
524
|
o.clear();
|
|
524
525
|
};
|
|
525
|
-
this.#
|
|
526
|
+
this.#b = new MutationObserver((r) => {
|
|
526
527
|
for (const s of r) {
|
|
527
528
|
for (const l of s.addedNodes) {
|
|
528
529
|
if (l.nodeType !== Node.ELEMENT_NODE) continue;
|
|
529
530
|
const a = l.tagName.toLowerCase();
|
|
530
|
-
this.#
|
|
531
|
+
this.#p.has(a) && o.add(a);
|
|
531
532
|
}
|
|
532
533
|
if (s.type === "attributes" && s.target.nodeType === Node.ELEMENT_NODE) {
|
|
533
534
|
const c = s.target.tagName.toLowerCase();
|
|
534
|
-
this.#
|
|
535
|
+
this.#p.has(c) && o.add(c);
|
|
535
536
|
}
|
|
536
537
|
}
|
|
537
538
|
o.size > 0 && !n && (n = setTimeout(i, 0));
|
|
538
|
-
}), this.#
|
|
539
|
+
}), this.#b.observe(e, {
|
|
539
540
|
childList: !0,
|
|
540
541
|
subtree: !0,
|
|
541
542
|
attributes: !0,
|
|
@@ -543,20 +544,20 @@ class at {
|
|
|
543
544
|
});
|
|
544
545
|
}
|
|
545
546
|
onChange(e) {
|
|
546
|
-
this.#
|
|
547
|
+
this.#g.push(e);
|
|
547
548
|
}
|
|
548
549
|
notifyChange() {
|
|
549
|
-
for (const e of this.#
|
|
550
|
+
for (const e of this.#g)
|
|
550
551
|
e();
|
|
551
552
|
}
|
|
552
553
|
dispose() {
|
|
553
|
-
this.#
|
|
554
|
+
this.#b?.disconnect(), this.#g = [], this.#s && clearTimeout(this.#s);
|
|
554
555
|
}
|
|
555
556
|
}
|
|
556
|
-
function
|
|
557
|
+
function ze(t) {
|
|
557
558
|
return `<span role="checkbox" aria-checked="${t}" aria-label="${t}">${t ? "🗹" : "☐"}</span>`;
|
|
558
559
|
}
|
|
559
|
-
function
|
|
560
|
+
function Ne(t) {
|
|
560
561
|
if (t == null || t === "") return "";
|
|
561
562
|
if (t instanceof Date)
|
|
562
563
|
return isNaN(t.getTime()) ? "" : t.toLocaleDateString();
|
|
@@ -566,7 +567,7 @@ function De(t) {
|
|
|
566
567
|
}
|
|
567
568
|
return "";
|
|
568
569
|
}
|
|
569
|
-
function
|
|
570
|
+
function ke(t) {
|
|
570
571
|
if (!t) return -1;
|
|
571
572
|
const e = t.getAttribute("data-row");
|
|
572
573
|
if (e) return parseInt(e, 10);
|
|
@@ -579,15 +580,15 @@ function Me(t) {
|
|
|
579
580
|
if (i[r] === o) return r;
|
|
580
581
|
return -1;
|
|
581
582
|
}
|
|
582
|
-
function
|
|
583
|
+
function ut(t) {
|
|
583
584
|
if (!t) return -1;
|
|
584
585
|
const e = t.getAttribute("data-col");
|
|
585
586
|
return e ? parseInt(e, 10) : -1;
|
|
586
587
|
}
|
|
587
|
-
function
|
|
588
|
+
function he(t) {
|
|
588
589
|
t && t.querySelectorAll(".cell-focus").forEach((e) => e.classList.remove("cell-focus"));
|
|
589
590
|
}
|
|
590
|
-
function
|
|
591
|
+
function Ie(t, e) {
|
|
591
592
|
const o = e.renderer || e.viewRenderer;
|
|
592
593
|
if (o) return o;
|
|
593
594
|
if (!e.type) return;
|
|
@@ -601,31 +602,31 @@ function ze(t, e) {
|
|
|
601
602
|
return r.renderer;
|
|
602
603
|
}
|
|
603
604
|
}
|
|
604
|
-
const
|
|
605
|
-
function
|
|
605
|
+
const qe = 'input,select,textarea,[contenteditable="true"],[contenteditable=""],[tabindex]:not([tabindex="-1"])';
|
|
606
|
+
function ne(t) {
|
|
606
607
|
return (t.__editingCellCount ?? 0) > 0;
|
|
607
608
|
}
|
|
608
|
-
function
|
|
609
|
+
function ie(t) {
|
|
609
610
|
t.__editingCellCount = 0, t.removeAttribute("data-has-editing"), t.querySelectorAll(".cell.editing").forEach((o) => o.classList.remove("editing"));
|
|
610
611
|
}
|
|
611
|
-
const
|
|
612
|
-
|
|
613
|
-
const
|
|
614
|
-
|
|
615
|
-
function
|
|
616
|
-
return
|
|
612
|
+
const We = document.createElement("template");
|
|
613
|
+
We.innerHTML = '<div class="cell" role="gridcell" part="cell"></div>';
|
|
614
|
+
const $e = document.createElement("template");
|
|
615
|
+
$e.innerHTML = '<div class="data-grid-row" role="row" part="row"></div>';
|
|
616
|
+
function ft() {
|
|
617
|
+
return We.content.firstElementChild.cloneNode(!0);
|
|
617
618
|
}
|
|
618
|
-
function
|
|
619
|
-
return
|
|
619
|
+
function pt() {
|
|
620
|
+
return $e.content.firstElementChild.cloneNode(!0);
|
|
620
621
|
}
|
|
621
|
-
function
|
|
622
|
+
function Y(t) {
|
|
622
623
|
t.__cellDisplayCache = void 0, t.__cellCacheEpoch = void 0, t.__hasSpecialColumns = void 0;
|
|
623
624
|
}
|
|
624
|
-
function
|
|
625
|
+
function gt(t, e, o, n, i) {
|
|
625
626
|
const r = Math.max(0, o - e), s = t._bodyEl, l = t._visibleColumns, c = l.length;
|
|
626
627
|
let a = t.__cachedHeaderRowCount;
|
|
627
628
|
for (a === void 0 && (a = t.querySelector(".header-group-row") ? 2 : 1, t.__cachedHeaderRowCount = a); t._rowPool.length < r; ) {
|
|
628
|
-
const p =
|
|
629
|
+
const p = pt();
|
|
629
630
|
t._rowPool.push(p);
|
|
630
631
|
}
|
|
631
632
|
if (t._rowPool.length > r) {
|
|
@@ -652,14 +653,14 @@ function ut(t, e, o, n, i) {
|
|
|
652
653
|
}
|
|
653
654
|
}
|
|
654
655
|
if (!T || y) {
|
|
655
|
-
const S =
|
|
656
|
-
S && !P ? (d.__isCustomRow && (d.className = "data-grid-row", d.setAttribute("role", "row"), d.__isCustomRow = !1),
|
|
656
|
+
const S = ne(d), P = t._activeEditRows === f;
|
|
657
|
+
S && !P ? (d.__isCustomRow && (d.className = "data-grid-row", d.setAttribute("role", "row"), d.__isCustomRow = !1), ie(d), B(t, d, g, f), d.__epoch = n, d.__rowDataRef = g) : S && P ? (re(t, d, g, f), d.__rowDataRef = g) : (d.__isCustomRow && (d.className = "data-grid-row", d.setAttribute("role", "row"), d.__isCustomRow = !1), B(t, d, g, f), d.__epoch = n, d.__rowDataRef = g);
|
|
657
658
|
} else if (b) {
|
|
658
|
-
const S =
|
|
659
|
-
S && !P ? (
|
|
659
|
+
const S = ne(d), P = t._activeEditRows === f;
|
|
660
|
+
S && !P ? (ie(d), B(t, d, g, f), d.__epoch = n, d.__rowDataRef = g) : (re(t, d, g, f), d.__rowDataRef = g);
|
|
660
661
|
} else {
|
|
661
|
-
const S =
|
|
662
|
-
S && !P ? (
|
|
662
|
+
const S = ne(d), P = t._activeEditRows === f;
|
|
663
|
+
S && !P ? (ie(d), B(t, d, g, f), d.__epoch = n, d.__rowDataRef = g) : re(t, d, g, f);
|
|
663
664
|
}
|
|
664
665
|
let E = !1;
|
|
665
666
|
const C = t.changedRowIds;
|
|
@@ -678,8 +679,8 @@ function ut(t, e, o, n, i) {
|
|
|
678
679
|
try {
|
|
679
680
|
const P = N(g);
|
|
680
681
|
if (P && P.length > 0) {
|
|
681
|
-
const
|
|
682
|
-
|
|
682
|
+
const oe = P.filter((X) => X && typeof X == "string");
|
|
683
|
+
oe.forEach((X) => d.classList.add(X)), d.setAttribute("data-dynamic-classes", oe.join(" "));
|
|
683
684
|
} else
|
|
684
685
|
d.removeAttribute("data-dynamic-classes");
|
|
685
686
|
} catch (P) {
|
|
@@ -693,7 +694,7 @@ function ut(t, e, o, n, i) {
|
|
|
693
694
|
}), d.parentNode !== s && s.appendChild(d);
|
|
694
695
|
}
|
|
695
696
|
}
|
|
696
|
-
function
|
|
697
|
+
function re(t, e, o, n) {
|
|
697
698
|
const i = e.children, r = t._visibleColumns, s = r.length, l = i.length, c = s < l ? s : l, a = t._focusRow, h = t._focusCol, u = t._hasAfterCellRenderHook?.() ?? !1;
|
|
698
699
|
let p = t.__hasSpecialColumns;
|
|
699
700
|
if (p === void 0) {
|
|
@@ -730,7 +731,7 @@ function oe(t, e, o, n) {
|
|
|
730
731
|
}
|
|
731
732
|
for (let g = 0; g < c; g++)
|
|
732
733
|
if (r[g].externalView && !i[g].querySelector("[data-external-view]")) {
|
|
733
|
-
|
|
734
|
+
B(t, e, o, n);
|
|
734
735
|
return;
|
|
735
736
|
}
|
|
736
737
|
for (let g = 0; g < c; g++) {
|
|
@@ -754,7 +755,7 @@ function oe(t, e, o, n) {
|
|
|
754
755
|
}
|
|
755
756
|
}
|
|
756
757
|
if (w.classList.contains("editing")) continue;
|
|
757
|
-
const T =
|
|
758
|
+
const T = Ie(t, d);
|
|
758
759
|
if (T) {
|
|
759
760
|
const E = o[d.field], C = T({
|
|
760
761
|
row: o,
|
|
@@ -763,7 +764,7 @@ function oe(t, e, o, n) {
|
|
|
763
764
|
column: d,
|
|
764
765
|
cellEl: w
|
|
765
766
|
});
|
|
766
|
-
typeof C == "string" ? w.innerHTML =
|
|
767
|
+
typeof C == "string" ? w.innerHTML = F(C) : C instanceof Node ? C.parentElement !== w && (w.innerHTML = "", w.appendChild(C)) : C == null && (w.textContent = E == null ? "" : String(E)), u && t._afterCellRender?.({
|
|
767
768
|
row: o,
|
|
768
769
|
rowIndex: n,
|
|
769
770
|
column: d,
|
|
@@ -785,7 +786,7 @@ function oe(t, e, o, n) {
|
|
|
785
786
|
} catch (E) {
|
|
786
787
|
console.warn(`[tbw-grid] Format error in column '${d.field}':`, E), y = b == null ? "" : String(b);
|
|
787
788
|
}
|
|
788
|
-
else d.type === "date" ? (y =
|
|
789
|
+
else d.type === "date" ? (y = Ne(b), w.textContent = y) : d.type === "boolean" ? w.innerHTML = ze(!!b) : (y = b == null ? "" : String(b), w.textContent = y);
|
|
789
790
|
u && t._afterCellRender?.({
|
|
790
791
|
row: o,
|
|
791
792
|
rowIndex: n,
|
|
@@ -797,11 +798,11 @@ function oe(t, e, o, n) {
|
|
|
797
798
|
});
|
|
798
799
|
}
|
|
799
800
|
}
|
|
800
|
-
function
|
|
801
|
+
function B(t, e, o, n) {
|
|
801
802
|
e.innerHTML = "";
|
|
802
803
|
const i = t._visibleColumns, r = i.length, s = t._focusRow, l = t._focusCol, c = t, a = t._hasAfterCellRenderHook?.() ?? !1, h = document.createDocumentFragment();
|
|
803
804
|
for (let u = 0; u < r; u++) {
|
|
804
|
-
const p = i[u], f =
|
|
805
|
+
const p = i[u], f = ft();
|
|
805
806
|
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);
|
|
806
807
|
let g = o[p.field];
|
|
807
808
|
if (p.format)
|
|
@@ -810,11 +811,11 @@ function V(t, e, o, n) {
|
|
|
810
811
|
} catch (b) {
|
|
811
812
|
console.warn(`[tbw-grid] Format error in column '${p.field}':`, b);
|
|
812
813
|
}
|
|
813
|
-
const d = p.__compiledView, w = p.__viewTemplate, m =
|
|
814
|
+
const d = p.__compiledView, w = p.__viewTemplate, m = Ie(t, p), R = p.externalView;
|
|
814
815
|
let v = !1;
|
|
815
816
|
if (m) {
|
|
816
817
|
const b = m({ row: o, value: g, field: p.field, column: p, cellEl: f });
|
|
817
|
-
typeof b == "string" ? (f.innerHTML =
|
|
818
|
+
typeof b == "string" ? (f.innerHTML = F(b), v = !0) : b instanceof Node ? b.parentElement !== f && (f.textContent = "", f.appendChild(b)) : b == null && (f.textContent = g == null ? "" : String(g));
|
|
818
819
|
} else if (R) {
|
|
819
820
|
const b = R, y = document.createElement("div");
|
|
820
821
|
y.setAttribute("data-external-view", ""), y.setAttribute("data-field", p.field), f.appendChild(y);
|
|
@@ -842,14 +843,14 @@ function V(t, e, o, n) {
|
|
|
842
843
|
y.setAttribute("data-mounted", "");
|
|
843
844
|
} else if (d) {
|
|
844
845
|
const b = d({ row: o, value: g, field: p.field, column: p }), y = d.__blocked;
|
|
845
|
-
f.innerHTML = y ? "" :
|
|
846
|
+
f.innerHTML = y ? "" : F(b), v = !0, y && (f.textContent = "", f.setAttribute("data-blocked-template", ""));
|
|
846
847
|
} else if (w) {
|
|
847
848
|
const b = w.innerHTML;
|
|
848
|
-
/Reflect\.|\bProxy\b|ownKeys\(/.test(b) ? (f.textContent = "", f.setAttribute("data-blocked-template", "")) : (f.innerHTML =
|
|
849
|
+
/Reflect\.|\bProxy\b|ownKeys\(/.test(b) ? (f.textContent = "", f.setAttribute("data-blocked-template", "")) : (f.innerHTML = F(Me(b, { row: o, value: g })), v = !0);
|
|
849
850
|
} else
|
|
850
|
-
p.type === "date" ? f.textContent =
|
|
851
|
+
p.type === "date" ? f.textContent = Ne(g) : p.type === "boolean" ? f.innerHTML = ze(!!g) : f.textContent = g == null ? "" : String(g);
|
|
851
852
|
if (v) {
|
|
852
|
-
|
|
853
|
+
ct(f);
|
|
853
854
|
const b = f.textContent || "";
|
|
854
855
|
/Proxy|Reflect\.ownKeys/.test(b) && (f.textContent = b.replace(/Proxy|Reflect\.ownKeys/g, "").trim(), /Proxy|Reflect\.ownKeys/.test(f.textContent || "") && (f.textContent = ""));
|
|
855
856
|
}
|
|
@@ -877,9 +878,9 @@ function V(t, e, o, n) {
|
|
|
877
878
|
}
|
|
878
879
|
e.appendChild(h);
|
|
879
880
|
}
|
|
880
|
-
function
|
|
881
|
+
function Ce(t, e, o) {
|
|
881
882
|
if (e.target?.closest(".resize-handle")) return;
|
|
882
|
-
const n = o.querySelector(".cell[data-row]"), i =
|
|
883
|
+
const n = o.querySelector(".cell[data-row]"), i = ke(n);
|
|
883
884
|
if (i < 0) return;
|
|
884
885
|
const r = t._rows[i];
|
|
885
886
|
if (!r || t._dispatchRowClick?.(e, i, r, o))
|
|
@@ -892,8 +893,8 @@ function be(t, e, o) {
|
|
|
892
893
|
return;
|
|
893
894
|
const c = t._focusRow !== i || t._focusCol !== l;
|
|
894
895
|
if (t._focusRow = i, t._focusCol = l, s.classList.contains("editing")) {
|
|
895
|
-
c && (
|
|
896
|
-
const a = s.querySelector(
|
|
896
|
+
c && (he(t._bodyEl ?? t), s.classList.add("cell-focus"));
|
|
897
|
+
const a = s.querySelector(qe);
|
|
897
898
|
try {
|
|
898
899
|
a?.focus({ preventScroll: !0 });
|
|
899
900
|
} catch {
|
|
@@ -904,7 +905,7 @@ function be(t, e, o) {
|
|
|
904
905
|
}
|
|
905
906
|
}
|
|
906
907
|
}
|
|
907
|
-
function
|
|
908
|
+
function wt(t, e) {
|
|
908
909
|
if (t._dispatchKeyDown?.(e))
|
|
909
910
|
return;
|
|
910
911
|
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) => {
|
|
@@ -984,7 +985,7 @@ function $(t, e) {
|
|
|
984
985
|
}
|
|
985
986
|
}
|
|
986
987
|
const o = t._activeEditRows !== void 0 && t._activeEditRows !== -1;
|
|
987
|
-
o || t.refreshVirtualWindow(!1),
|
|
988
|
+
o || t.refreshVirtualWindow(!1), he(t._bodyEl), Array.from(t._bodyEl.querySelectorAll('[aria-selected="true"]')).forEach((s) => {
|
|
988
989
|
s.setAttribute("aria-selected", "false");
|
|
989
990
|
});
|
|
990
991
|
const n = t._focusRow, i = t._virtualization.start ?? 0, r = t._virtualization.end ?? t._rows.length;
|
|
@@ -1007,7 +1008,7 @@ function $(t, e) {
|
|
|
1007
1008
|
}
|
|
1008
1009
|
}
|
|
1009
1010
|
if (t._activeEditRows !== void 0 && t._activeEditRows !== -1 && l.classList.contains("editing")) {
|
|
1010
|
-
const a = l.querySelector(
|
|
1011
|
+
const a = l.querySelector(qe);
|
|
1011
1012
|
if (a && document.activeElement !== a)
|
|
1012
1013
|
try {
|
|
1013
1014
|
a.focus({ preventScroll: !0 });
|
|
@@ -1023,12 +1024,12 @@ function $(t, e) {
|
|
|
1023
1024
|
}
|
|
1024
1025
|
}
|
|
1025
1026
|
}
|
|
1026
|
-
const
|
|
1027
|
-
function
|
|
1028
|
-
const o =
|
|
1029
|
-
o < 0 || n < 0 || (t._focusRow = o, t._focusCol = n,
|
|
1027
|
+
const ee = /* @__PURE__ */ new WeakMap();
|
|
1028
|
+
function mt(t, e) {
|
|
1029
|
+
const o = ke(e), n = ut(e);
|
|
1030
|
+
o < 0 || n < 0 || (t._focusRow = o, t._focusCol = n, he(t._bodyEl), e.classList.add("cell-focus"), e.setAttribute("aria-selected", "true"));
|
|
1030
1031
|
}
|
|
1031
|
-
function
|
|
1032
|
+
function ue(t, e, o, n) {
|
|
1032
1033
|
let i = null;
|
|
1033
1034
|
const r = o.composedPath?.();
|
|
1034
1035
|
if (r && r.length > 0 ? i = r[0] : i = o.target, i && !e.contains(i)) {
|
|
@@ -1052,119 +1053,149 @@ function ce(t, e, o, n) {
|
|
|
1052
1053
|
cell: a !== void 0 && h !== void 0 && a >= 0 && h >= 0 ? { row: a, col: h } : void 0
|
|
1053
1054
|
};
|
|
1054
1055
|
}
|
|
1055
|
-
function
|
|
1056
|
-
const n =
|
|
1057
|
-
(t._dispatchCellMouseDown?.(n) ?? !1) &&
|
|
1056
|
+
function bt(t, e, o) {
|
|
1057
|
+
const n = ue(t, e, o, "mousedown");
|
|
1058
|
+
(t._dispatchCellMouseDown?.(n) ?? !1) && ee.set(t, !0);
|
|
1058
1059
|
}
|
|
1059
|
-
function
|
|
1060
|
-
if (!
|
|
1061
|
-
const n =
|
|
1060
|
+
function vt(t, e, o) {
|
|
1061
|
+
if (!ee.get(t)) return;
|
|
1062
|
+
const n = ue(t, e, o, "mousemove");
|
|
1062
1063
|
t._dispatchCellMouseMove?.(n);
|
|
1063
1064
|
}
|
|
1064
|
-
function
|
|
1065
|
-
if (!
|
|
1066
|
-
const n =
|
|
1067
|
-
t._dispatchCellMouseUp?.(n),
|
|
1065
|
+
function Ct(t, e, o) {
|
|
1066
|
+
if (!ee.get(t)) return;
|
|
1067
|
+
const n = ue(t, e, o, "mouseup");
|
|
1068
|
+
t._dispatchCellMouseUp?.(n), ee.set(t, !1);
|
|
1068
1069
|
}
|
|
1069
|
-
function
|
|
1070
|
+
function yt(t, e, o) {
|
|
1070
1071
|
e.addEventListener(
|
|
1071
1072
|
"mousedown",
|
|
1072
1073
|
(n) => {
|
|
1073
1074
|
const i = n.target.closest(".cell[data-col]");
|
|
1074
|
-
i && (i.classList.contains("editing") ||
|
|
1075
|
+
i && (i.classList.contains("editing") || mt(t, i));
|
|
1075
1076
|
},
|
|
1076
1077
|
{ signal: o }
|
|
1077
1078
|
), e.addEventListener(
|
|
1078
1079
|
"click",
|
|
1079
1080
|
(n) => {
|
|
1080
1081
|
const i = n.target.closest(".data-grid-row");
|
|
1081
|
-
i &&
|
|
1082
|
+
i && Ce(t, n, i);
|
|
1082
1083
|
},
|
|
1083
1084
|
{ signal: o }
|
|
1084
1085
|
), e.addEventListener(
|
|
1085
1086
|
"dblclick",
|
|
1086
1087
|
(n) => {
|
|
1087
1088
|
const i = n.target.closest(".data-grid-row");
|
|
1088
|
-
i &&
|
|
1089
|
+
i && Ce(t, n, i);
|
|
1089
1090
|
},
|
|
1090
1091
|
{ signal: o }
|
|
1091
1092
|
);
|
|
1092
1093
|
}
|
|
1093
|
-
function
|
|
1094
|
-
e.addEventListener("keydown", (i) =>
|
|
1094
|
+
function _t(t, e, o, n) {
|
|
1095
|
+
e.addEventListener("keydown", (i) => wt(t, i), { signal: n }), o.addEventListener("mousedown", (i) => bt(t, o, i), { signal: n }), document.addEventListener("mousemove", (i) => vt(t, o, i), { signal: n }), document.addEventListener("mouseup", (i) => Ct(t, o, i), { signal: n });
|
|
1095
1096
|
}
|
|
1096
|
-
function
|
|
1097
|
+
function Et(t, e) {
|
|
1097
1098
|
return t == null && e == null ? 0 : t == null ? -1 : e == null || t > e ? 1 : t < e ? -1 : 0;
|
|
1098
1099
|
}
|
|
1099
|
-
function
|
|
1100
|
-
const i = o.find((l) => l.field === e.field)?.sortComparator ??
|
|
1100
|
+
function St(t, e, o) {
|
|
1101
|
+
const i = o.find((l) => l.field === e.field)?.sortComparator ?? Et, { field: r, direction: s } = e;
|
|
1101
1102
|
return [...t].sort((l, c) => i(l[r], c[r], l, c) * s);
|
|
1102
1103
|
}
|
|
1103
|
-
function
|
|
1104
|
-
t._rows = e, t.__rowRenderEpoch++, t._rowPool.forEach((i) => i.__epoch = -1),
|
|
1104
|
+
function ye(t, e, o, n) {
|
|
1105
|
+
t._rows = e, t.__rowRenderEpoch++, t._rowPool.forEach((i) => i.__epoch = -1), te(t), t.refreshVirtualWindow(!0), t.dispatchEvent(
|
|
1105
1106
|
new CustomEvent("sort-change", { detail: { field: o.field, direction: n } })
|
|
1106
1107
|
), t.requestStateChange?.();
|
|
1107
1108
|
}
|
|
1108
|
-
function
|
|
1109
|
-
!t._sortState || t._sortState.field !== e.field ? (t._sortState || (t.__originalOrder = t._rows.slice()),
|
|
1109
|
+
function _e(t, e) {
|
|
1110
|
+
!t._sortState || t._sortState.field !== e.field ? (t._sortState || (t.__originalOrder = t._rows.slice()), Ee(t, e, 1)) : t._sortState.direction === 1 ? Ee(t, e, -1) : (t._sortState = null, t.__rowRenderEpoch++, t._rowPool.forEach((n) => n.__epoch = -1), t._rows = t.__originalOrder.slice(), te(t), t._headerRowEl?.querySelectorAll('[role="columnheader"].sortable')?.forEach((n) => {
|
|
1110
1111
|
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");
|
|
1111
1112
|
}), t.refreshVirtualWindow(!0), t.dispatchEvent(
|
|
1112
1113
|
new CustomEvent("sort-change", { detail: { field: e.field, direction: 0 } })
|
|
1113
1114
|
), t.requestStateChange?.());
|
|
1114
1115
|
}
|
|
1115
|
-
function
|
|
1116
|
+
function Ee(t, e, o) {
|
|
1116
1117
|
t._sortState = { field: e.field, direction: o };
|
|
1117
|
-
const n = { field: e.field, direction: o }, i = t._columns, s = (t.effectiveConfig?.sortHandler ??
|
|
1118
|
+
const n = { field: e.field, direction: o }, i = t._columns, s = (t.effectiveConfig?.sortHandler ?? St)(t._rows, n, i);
|
|
1118
1119
|
s && typeof s.then == "function" ? s.then((l) => {
|
|
1119
|
-
|
|
1120
|
-
}) :
|
|
1120
|
+
ye(t, l, e, o);
|
|
1121
|
+
}) : ye(t, s, e, o);
|
|
1121
1122
|
}
|
|
1122
|
-
function
|
|
1123
|
+
function Rt(t, e) {
|
|
1123
1124
|
typeof e == "string" ? t.textContent = e : e instanceof HTMLElement && (t.innerHTML = "", t.appendChild(e.cloneNode(!0)));
|
|
1124
1125
|
}
|
|
1125
|
-
function
|
|
1126
|
+
function j(t, e) {
|
|
1127
|
+
const o = document.createElement("span");
|
|
1128
|
+
De(o, "sort-indicator");
|
|
1129
|
+
const n = t._sortState?.field === e.field ? t._sortState.direction : 0, i = { ...z, ...t.icons }, r = n === 1 ? i.sortAsc : n === -1 ? i.sortDesc : i.sortNone;
|
|
1130
|
+
return Rt(o, r), o;
|
|
1131
|
+
}
|
|
1132
|
+
function K(t, e, o) {
|
|
1133
|
+
const n = document.createElement("div");
|
|
1134
|
+
return n.className = "resize-handle", n.setAttribute("aria-hidden", "true"), n.addEventListener("mousedown", (i) => {
|
|
1135
|
+
i.stopPropagation(), i.preventDefault(), t._resizeController.start(i, e, o);
|
|
1136
|
+
}), n.addEventListener("dblclick", (i) => {
|
|
1137
|
+
i.stopPropagation(), i.preventDefault(), t._resizeController.resetColumn(e);
|
|
1138
|
+
}), n;
|
|
1139
|
+
}
|
|
1140
|
+
function Z(t, e, o, n) {
|
|
1141
|
+
n.classList.add("sortable"), n.tabIndex = 0;
|
|
1142
|
+
const i = t._sortState?.field === e.field ? t._sortState.direction : 0;
|
|
1143
|
+
n.setAttribute("aria-sort", i === 0 ? "none" : i === 1 ? "ascending" : "descending"), n.addEventListener("click", (r) => {
|
|
1144
|
+
t._resizeController?.isResizing || t._dispatchHeaderClick?.(r, o, n) || _e(t, e);
|
|
1145
|
+
}), n.addEventListener("keydown", (r) => {
|
|
1146
|
+
if (r.key === "Enter" || r.key === " ") {
|
|
1147
|
+
if (r.preventDefault(), t._dispatchHeaderClick?.(r, o, n)) return;
|
|
1148
|
+
_e(t, e);
|
|
1149
|
+
}
|
|
1150
|
+
});
|
|
1151
|
+
}
|
|
1152
|
+
function Tt(t, e) {
|
|
1153
|
+
if (e != null)
|
|
1154
|
+
if (typeof e == "string") {
|
|
1155
|
+
const o = document.createElement("span");
|
|
1156
|
+
for (o.innerHTML = F(e); o.firstChild; )
|
|
1157
|
+
t.appendChild(o.firstChild);
|
|
1158
|
+
} else e instanceof Node && t.appendChild(e);
|
|
1159
|
+
}
|
|
1160
|
+
function te(t) {
|
|
1126
1161
|
t._headerRowEl = t.findHeaderRow();
|
|
1127
1162
|
const e = t._headerRowEl;
|
|
1128
1163
|
e && (e.innerHTML = "", t._visibleColumns.forEach((o, n) => {
|
|
1129
1164
|
const i = document.createElement("div");
|
|
1130
|
-
i.className = "cell",
|
|
1131
|
-
const r = o.
|
|
1132
|
-
if (
|
|
1165
|
+
i.className = "cell", De(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));
|
|
1166
|
+
const r = o.header ?? o.field, s = t._sortState?.field === o.field ? t._sortState.direction : 0, l = s === 1 ? "asc" : s === -1 ? "desc" : null;
|
|
1167
|
+
if (o.headerRenderer) {
|
|
1168
|
+
const c = {
|
|
1169
|
+
column: o,
|
|
1170
|
+
value: r,
|
|
1171
|
+
sortState: l,
|
|
1172
|
+
filterActive: !1,
|
|
1173
|
+
cellEl: i,
|
|
1174
|
+
renderSortIcon: () => o.sortable ? j(t, o) : null,
|
|
1175
|
+
renderFilterButton: () => null,
|
|
1176
|
+
renderResizeHandle: () => K(t, n, i)
|
|
1177
|
+
}, a = o.headerRenderer(c);
|
|
1178
|
+
Tt(i, a), o.sortable && Z(t, o, n, i), o.resizable && i.classList.add("resizable");
|
|
1179
|
+
} else if (o.headerLabelRenderer) {
|
|
1180
|
+
const c = {
|
|
1181
|
+
column: o,
|
|
1182
|
+
value: r
|
|
1183
|
+
}, a = o.headerLabelRenderer(c), h = document.createElement("span");
|
|
1184
|
+
a == null ? h.textContent = r : typeof a == "string" ? h.innerHTML = F(a) : a instanceof Node && h.appendChild(a), i.appendChild(h), o.sortable && (Z(t, o, n, i), i.appendChild(j(t, o))), o.resizable && (i.classList.add("resizable"), i.appendChild(K(t, n, i)));
|
|
1185
|
+
} else if (o.__headerTemplate)
|
|
1186
|
+
Array.from(o.__headerTemplate.childNodes).forEach((c) => i.appendChild(c.cloneNode(!0))), o.sortable && (Z(t, o, n, i), i.appendChild(j(t, o))), o.resizable && (i.classList.add("resizable"), i.appendChild(K(t, n, i)));
|
|
1133
1187
|
else {
|
|
1134
|
-
const
|
|
1135
|
-
|
|
1136
|
-
}
|
|
1137
|
-
if (o.sortable) {
|
|
1138
|
-
i.classList.add("sortable"), i.tabIndex = 0;
|
|
1139
|
-
const s = document.createElement("span");
|
|
1140
|
-
pe(s, "sort-indicator");
|
|
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;
|
|
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);
|
|
1144
|
-
}), i.addEventListener("keydown", (h) => {
|
|
1145
|
-
if (h.key === "Enter" || h.key === " ") {
|
|
1146
|
-
if (h.preventDefault(), t._dispatchHeaderClick?.(h, n, i)) return;
|
|
1147
|
-
Ce(t, o);
|
|
1148
|
-
}
|
|
1149
|
-
});
|
|
1150
|
-
}
|
|
1151
|
-
if (o.resizable) {
|
|
1152
|
-
i.classList.add("resizable");
|
|
1153
|
-
const s = document.createElement("div");
|
|
1154
|
-
s.className = "resize-handle", s.setAttribute("aria-hidden", "true"), s.addEventListener("mousedown", (l) => {
|
|
1155
|
-
l.stopPropagation(), l.preventDefault(), t._resizeController.start(l, n, i);
|
|
1156
|
-
}), s.addEventListener("dblclick", (l) => {
|
|
1157
|
-
l.stopPropagation(), l.preventDefault(), t._resizeController.resetColumn(n);
|
|
1158
|
-
}), i.appendChild(s);
|
|
1188
|
+
const c = document.createElement("span");
|
|
1189
|
+
c.textContent = r, i.appendChild(c), o.sortable && (Z(t, o, n, i), i.appendChild(j(t, o))), o.resizable && (i.classList.add("resizable"), i.appendChild(K(t, n, i)));
|
|
1159
1190
|
}
|
|
1160
1191
|
e.appendChild(i);
|
|
1161
1192
|
}), e.querySelectorAll(".cell.sortable").forEach((o) => {
|
|
1162
1193
|
o.getAttribute("aria-sort") || o.setAttribute("aria-sort", "none");
|
|
1163
1194
|
}), e.children.length > 0 ? (e.setAttribute("role", "row"), e.setAttribute("aria-rowindex", "1")) : (e.removeAttribute("role"), e.removeAttribute("aria-rowindex")));
|
|
1164
1195
|
}
|
|
1165
|
-
const
|
|
1166
|
-
function
|
|
1167
|
-
return
|
|
1196
|
+
const Fe = typeof requestIdleCallback == "function";
|
|
1197
|
+
function xt(t, e) {
|
|
1198
|
+
return Fe ? requestIdleCallback(t, e) : window.setTimeout(() => {
|
|
1168
1199
|
const o = Date.now();
|
|
1169
1200
|
t({
|
|
1170
1201
|
didTimeout: !1,
|
|
@@ -1172,54 +1203,54 @@ function Et(t, e) {
|
|
|
1172
1203
|
});
|
|
1173
1204
|
}, 1);
|
|
1174
1205
|
}
|
|
1175
|
-
function
|
|
1176
|
-
|
|
1206
|
+
function Se(t) {
|
|
1207
|
+
Fe ? cancelIdleCallback(t) : clearTimeout(t);
|
|
1177
1208
|
}
|
|
1178
1209
|
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 || {});
|
|
1179
|
-
class
|
|
1180
|
-
#
|
|
1181
|
-
#
|
|
1182
|
-
#
|
|
1210
|
+
class At {
|
|
1211
|
+
#l;
|
|
1212
|
+
#i = 0;
|
|
1213
|
+
#u = 0;
|
|
1183
1214
|
#d = null;
|
|
1184
|
-
#
|
|
1185
|
-
#
|
|
1186
|
-
#
|
|
1215
|
+
#h = null;
|
|
1216
|
+
#a = null;
|
|
1217
|
+
#n = !1;
|
|
1187
1218
|
constructor(e) {
|
|
1188
|
-
this.#
|
|
1219
|
+
this.#l = e;
|
|
1189
1220
|
}
|
|
1190
1221
|
requestPhase(e, o) {
|
|
1191
|
-
e > this.#
|
|
1222
|
+
e > this.#i && (this.#i = e), this.#u === 0 && (this.#f(), this.#u = requestAnimationFrame(() => this.#g()));
|
|
1192
1223
|
}
|
|
1193
1224
|
whenReady() {
|
|
1194
1225
|
return this.#d ? this.#d : Promise.resolve();
|
|
1195
1226
|
}
|
|
1196
1227
|
setInitialReadyResolver(e) {
|
|
1197
|
-
this.#
|
|
1228
|
+
this.#a = e;
|
|
1198
1229
|
}
|
|
1199
1230
|
cancel() {
|
|
1200
|
-
this.#
|
|
1231
|
+
this.#u !== 0 && (cancelAnimationFrame(this.#u), this.#u = 0), this.#i = 0, this.#h && (this.#h(), this.#h = null, this.#d = null);
|
|
1201
1232
|
}
|
|
1202
1233
|
get isPending() {
|
|
1203
|
-
return this.#
|
|
1234
|
+
return this.#i !== 0;
|
|
1204
1235
|
}
|
|
1205
1236
|
get pendingPhase() {
|
|
1206
|
-
return this.#
|
|
1237
|
+
return this.#i;
|
|
1207
1238
|
}
|
|
1208
|
-
#
|
|
1239
|
+
#f() {
|
|
1209
1240
|
this.#d || (this.#d = new Promise((e) => {
|
|
1210
|
-
this.#
|
|
1241
|
+
this.#h = e;
|
|
1211
1242
|
}));
|
|
1212
1243
|
}
|
|
1213
|
-
#
|
|
1214
|
-
if (this.#
|
|
1215
|
-
this.#
|
|
1244
|
+
#g() {
|
|
1245
|
+
if (this.#u = 0, !this.#l.isConnected()) {
|
|
1246
|
+
this.#i = 0, this.#h && (this.#h(), this.#h = null, this.#d = null);
|
|
1216
1247
|
return;
|
|
1217
1248
|
}
|
|
1218
|
-
const e = this.#
|
|
1219
|
-
this.#
|
|
1249
|
+
const e = this.#i;
|
|
1250
|
+
this.#i = 0, e >= 5 && this.#l.mergeConfig(), e >= 4 && this.#l.processRows(), e >= 5 && (this.#l.processColumns(), this.#l.updateTemplate()), e >= 3 && this.#l.renderHeader(), e >= 2 && this.#l.renderVirtualWindow(), e >= 1 && this.#l.afterRender(), !this.#n && this.#a && (this.#n = !0, this.#a()), this.#h && (this.#h(), this.#h = null, this.#d = null);
|
|
1220
1251
|
}
|
|
1221
1252
|
}
|
|
1222
|
-
function
|
|
1253
|
+
function Re(t) {
|
|
1223
1254
|
let e = null, o = null, n = null, i = null;
|
|
1224
1255
|
const r = (c) => {
|
|
1225
1256
|
if (!e) return;
|
|
@@ -1257,55 +1288,55 @@ function Ee(t) {
|
|
|
1257
1288
|
}
|
|
1258
1289
|
};
|
|
1259
1290
|
}
|
|
1260
|
-
const
|
|
1291
|
+
const se = "data-animating", Pt = {
|
|
1261
1292
|
change: "--tbw-row-change-duration",
|
|
1262
1293
|
insert: "--tbw-row-insert-duration",
|
|
1263
1294
|
remove: "--tbw-row-remove-duration"
|
|
1264
|
-
},
|
|
1295
|
+
}, Lt = {
|
|
1265
1296
|
change: 500,
|
|
1266
1297
|
insert: 300,
|
|
1267
1298
|
remove: 200
|
|
1268
1299
|
};
|
|
1269
|
-
function
|
|
1300
|
+
function Ht(t) {
|
|
1270
1301
|
const e = t.trim().toLowerCase();
|
|
1271
1302
|
return e.endsWith("ms") ? parseFloat(e) : e.endsWith("s") ? parseFloat(e) * 1e3 : parseFloat(e);
|
|
1272
1303
|
}
|
|
1273
|
-
function
|
|
1274
|
-
const o =
|
|
1304
|
+
function Ot(t, e) {
|
|
1305
|
+
const o = Pt[e], n = getComputedStyle(t).getPropertyValue(o);
|
|
1275
1306
|
if (n) {
|
|
1276
|
-
const i =
|
|
1307
|
+
const i = Ht(n);
|
|
1277
1308
|
if (!isNaN(i) && i > 0)
|
|
1278
1309
|
return i;
|
|
1279
1310
|
}
|
|
1280
|
-
return
|
|
1311
|
+
return Lt[e];
|
|
1281
1312
|
}
|
|
1282
|
-
function
|
|
1283
|
-
t.removeAttribute(
|
|
1284
|
-
const n =
|
|
1313
|
+
function Dt(t, e, o) {
|
|
1314
|
+
t.removeAttribute(se), t.offsetWidth, t.setAttribute(se, e);
|
|
1315
|
+
const n = Ot(t, e);
|
|
1285
1316
|
setTimeout(() => {
|
|
1286
|
-
e !== "remove" && t.removeAttribute(
|
|
1317
|
+
e !== "remove" && t.removeAttribute(se);
|
|
1287
1318
|
}, n);
|
|
1288
1319
|
}
|
|
1289
|
-
function
|
|
1320
|
+
function fe(t, e, o) {
|
|
1290
1321
|
if (e < 0)
|
|
1291
1322
|
return !1;
|
|
1292
1323
|
const n = t.findRenderedRowElement?.(e);
|
|
1293
|
-
return n ? (
|
|
1324
|
+
return n ? (Dt(n, o), !0) : !1;
|
|
1294
1325
|
}
|
|
1295
|
-
function
|
|
1326
|
+
function Mt(t, e, o) {
|
|
1296
1327
|
let n = 0;
|
|
1297
1328
|
for (const i of e)
|
|
1298
|
-
|
|
1329
|
+
fe(t, i, o) && n++;
|
|
1299
1330
|
return n;
|
|
1300
1331
|
}
|
|
1301
|
-
function
|
|
1332
|
+
function zt(t, e, o) {
|
|
1302
1333
|
const n = t._rows ?? [], i = t.getRowId;
|
|
1303
1334
|
if (!i)
|
|
1304
1335
|
return !1;
|
|
1305
1336
|
const r = n.findIndex((s) => i(s) === e);
|
|
1306
|
-
return r < 0 ? !1 :
|
|
1337
|
+
return r < 0 ? !1 : fe(t, r, o);
|
|
1307
1338
|
}
|
|
1308
|
-
function
|
|
1339
|
+
function J(t, e, o) {
|
|
1309
1340
|
const n = document.createElement(t);
|
|
1310
1341
|
if (e)
|
|
1311
1342
|
for (const i in e) {
|
|
@@ -1314,7 +1345,7 @@ function Y(t, e, o) {
|
|
|
1314
1345
|
}
|
|
1315
1346
|
return n;
|
|
1316
1347
|
}
|
|
1317
|
-
function
|
|
1348
|
+
function H(t, e) {
|
|
1318
1349
|
const o = document.createElement("div");
|
|
1319
1350
|
if (t && (o.className = t), e)
|
|
1320
1351
|
for (const n in e) {
|
|
@@ -1323,7 +1354,7 @@ function L(t, e) {
|
|
|
1323
1354
|
}
|
|
1324
1355
|
return o;
|
|
1325
1356
|
}
|
|
1326
|
-
function
|
|
1357
|
+
function Ue(t, e, o) {
|
|
1327
1358
|
const n = document.createElement("button");
|
|
1328
1359
|
if (t && (n.className = t), e)
|
|
1329
1360
|
for (const i in e) {
|
|
@@ -1332,8 +1363,8 @@ function We(t, e, o) {
|
|
|
1332
1363
|
}
|
|
1333
1364
|
return n;
|
|
1334
1365
|
}
|
|
1335
|
-
const
|
|
1336
|
-
|
|
1366
|
+
const Ve = document.createElement("template");
|
|
1367
|
+
Ve.innerHTML = `
|
|
1337
1368
|
<div class="tbw-scroll-area">
|
|
1338
1369
|
<div class="rows-body-wrapper">
|
|
1339
1370
|
<div class="rows-body" role="grid">
|
|
@@ -1352,38 +1383,38 @@ $e.innerHTML = `
|
|
|
1352
1383
|
<div class="faux-vscroll-spacer"></div>
|
|
1353
1384
|
</div>
|
|
1354
1385
|
`;
|
|
1355
|
-
function
|
|
1356
|
-
return
|
|
1386
|
+
function Be() {
|
|
1387
|
+
return Ve.content.cloneNode(!0);
|
|
1357
1388
|
}
|
|
1358
|
-
function
|
|
1359
|
-
const e = document.createDocumentFragment(), o =
|
|
1389
|
+
function Te(t) {
|
|
1390
|
+
const e = document.createDocumentFragment(), o = H(t.hasShell ? "tbw-grid-root has-shell" : "tbw-grid-root");
|
|
1360
1391
|
if (t.hasShell && t.shellHeader && t.shellBody)
|
|
1361
1392
|
o.appendChild(t.shellHeader), o.appendChild(t.shellBody);
|
|
1362
1393
|
else {
|
|
1363
|
-
const n =
|
|
1364
|
-
n.appendChild(
|
|
1394
|
+
const n = H("tbw-grid-content");
|
|
1395
|
+
n.appendChild(Be()), o.appendChild(n);
|
|
1365
1396
|
}
|
|
1366
1397
|
return e.appendChild(o), e;
|
|
1367
1398
|
}
|
|
1368
|
-
function
|
|
1369
|
-
const e =
|
|
1399
|
+
function Nt(t) {
|
|
1400
|
+
const e = H("tbw-shell-header", { part: "shell-header", role: "presentation" });
|
|
1370
1401
|
if (t.title) {
|
|
1371
|
-
const r =
|
|
1402
|
+
const r = H("tbw-shell-title");
|
|
1372
1403
|
r.textContent = t.title, e.appendChild(r);
|
|
1373
1404
|
}
|
|
1374
|
-
const o =
|
|
1405
|
+
const o = H("tbw-shell-content", {
|
|
1375
1406
|
part: "shell-content",
|
|
1376
1407
|
role: "presentation",
|
|
1377
1408
|
"data-light-dom-header-content": ""
|
|
1378
1409
|
});
|
|
1379
1410
|
e.appendChild(o);
|
|
1380
|
-
const n =
|
|
1411
|
+
const n = H("tbw-shell-toolbar", { part: "shell-toolbar", role: "presentation" });
|
|
1381
1412
|
for (const r of t.configButtons)
|
|
1382
|
-
r.hasRender && n.appendChild(
|
|
1413
|
+
r.hasRender && n.appendChild(H("tbw-toolbar-content-slot", { "data-toolbar-content": r.id }));
|
|
1383
1414
|
for (const r of t.apiButtons)
|
|
1384
|
-
r.hasRender && n.appendChild(
|
|
1385
|
-
if ((t.configButtons.some((r) => r.hasRender) || t.apiButtons.some((r) => r.hasRender)) && t.hasPanels && n.appendChild(
|
|
1386
|
-
const r =
|
|
1415
|
+
r.hasRender && n.appendChild(H("tbw-toolbar-content-slot", { "data-toolbar-content": r.id }));
|
|
1416
|
+
if ((t.configButtons.some((r) => r.hasRender) || t.apiButtons.some((r) => r.hasRender)) && t.hasPanels && n.appendChild(H("tbw-toolbar-separator")), t.hasPanels) {
|
|
1417
|
+
const r = Ue(t.isPanelOpen ? "tbw-toolbar-btn active" : "tbw-toolbar-btn", {
|
|
1387
1418
|
"data-panel-toggle": "",
|
|
1388
1419
|
title: "Settings",
|
|
1389
1420
|
"aria-label": "Toggle settings panel",
|
|
@@ -1394,12 +1425,12 @@ function Ot(t) {
|
|
|
1394
1425
|
}
|
|
1395
1426
|
return e.appendChild(n), e;
|
|
1396
1427
|
}
|
|
1397
|
-
function
|
|
1398
|
-
const e =
|
|
1399
|
-
i.appendChild(
|
|
1428
|
+
function kt(t) {
|
|
1429
|
+
const e = H("tbw-shell-body"), o = t.panels.length > 0, n = t.panels.length === 1, i = H("tbw-grid-content");
|
|
1430
|
+
i.appendChild(Be());
|
|
1400
1431
|
let r = null;
|
|
1401
1432
|
if (o) {
|
|
1402
|
-
r =
|
|
1433
|
+
r = J("aside", {
|
|
1403
1434
|
class: t.isPanelOpen ? "tbw-tool-panel open" : "tbw-tool-panel",
|
|
1404
1435
|
part: "tool-panel",
|
|
1405
1436
|
"data-position": t.position,
|
|
@@ -1408,29 +1439,29 @@ function Dt(t) {
|
|
|
1408
1439
|
});
|
|
1409
1440
|
const s = t.position === "left" ? "right" : "left";
|
|
1410
1441
|
r.appendChild(
|
|
1411
|
-
|
|
1442
|
+
H("tbw-tool-panel-resize", {
|
|
1412
1443
|
"data-resize-handle": "",
|
|
1413
1444
|
"data-handle-position": s,
|
|
1414
1445
|
"aria-hidden": "true"
|
|
1415
1446
|
})
|
|
1416
1447
|
);
|
|
1417
|
-
const l =
|
|
1448
|
+
const l = H("tbw-tool-panel-content", { role: "presentation" }), c = H("tbw-accordion");
|
|
1418
1449
|
for (const a of t.panels) {
|
|
1419
|
-
const h = `tbw-accordion-section${a.isExpanded ? " expanded" : ""}${n ? " single" : ""}`, u =
|
|
1450
|
+
const h = `tbw-accordion-section${a.isExpanded ? " expanded" : ""}${n ? " single" : ""}`, u = H(h, { "data-section": a.id }), p = Ue("tbw-accordion-header", {
|
|
1420
1451
|
"aria-expanded": String(a.isExpanded),
|
|
1421
1452
|
"aria-controls": `tbw-section-${a.id}`
|
|
1422
1453
|
});
|
|
1423
1454
|
if (n && p.setAttribute("aria-disabled", "true"), a.icon) {
|
|
1424
|
-
const g =
|
|
1455
|
+
const g = J("span", { class: "tbw-accordion-icon" });
|
|
1425
1456
|
g.innerHTML = a.icon, p.appendChild(g);
|
|
1426
1457
|
}
|
|
1427
|
-
const f =
|
|
1458
|
+
const f = J("span", { class: "tbw-accordion-title" });
|
|
1428
1459
|
if (f.textContent = a.title, p.appendChild(f), !n) {
|
|
1429
|
-
const g =
|
|
1460
|
+
const g = J("span", { class: "tbw-accordion-chevron" });
|
|
1430
1461
|
g.innerHTML = a.isExpanded ? t.collapseIcon : t.expandIcon, p.appendChild(g);
|
|
1431
1462
|
}
|
|
1432
1463
|
u.appendChild(p), u.appendChild(
|
|
1433
|
-
|
|
1464
|
+
H("tbw-accordion-content", {
|
|
1434
1465
|
id: `tbw-section-${a.id}`,
|
|
1435
1466
|
role: "presentation"
|
|
1436
1467
|
})
|
|
@@ -1443,7 +1474,7 @@ function Dt(t) {
|
|
|
1443
1474
|
function k(t) {
|
|
1444
1475
|
return t ? typeof t == "string" ? t : t.outerHTML : "";
|
|
1445
1476
|
}
|
|
1446
|
-
function
|
|
1477
|
+
function It() {
|
|
1447
1478
|
return {
|
|
1448
1479
|
toolPanels: /* @__PURE__ */ new Map(),
|
|
1449
1480
|
headerContents: /* @__PURE__ */ new Map(),
|
|
@@ -1462,10 +1493,10 @@ function Mt() {
|
|
|
1462
1493
|
lightDomContentMoved: !1
|
|
1463
1494
|
};
|
|
1464
1495
|
}
|
|
1465
|
-
function
|
|
1496
|
+
function Ge(t) {
|
|
1466
1497
|
return !!(t?.header?.title || t?.header?.toolbarContents?.length || t?.toolPanels?.length || t?.headerContents?.length || t?.header?.lightDomContent?.length || t?.header?.hasToolButtonsContainer);
|
|
1467
1498
|
}
|
|
1468
|
-
function
|
|
1499
|
+
function xe(t, e, o = "☰") {
|
|
1469
1500
|
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];
|
|
1470
1501
|
for (const d of l)
|
|
1471
1502
|
c.has(d.id) || a.push(d);
|
|
@@ -1479,7 +1510,7 @@ function Re(t, e, o = "☰") {
|
|
|
1479
1510
|
}
|
|
1480
1511
|
return `
|
|
1481
1512
|
<div class="tbw-shell-header" part="shell-header" role="presentation">
|
|
1482
|
-
${i ? `<div class="tbw-shell-title">${
|
|
1513
|
+
${i ? `<div class="tbw-shell-title">${ot(n)}</div>` : ""}
|
|
1483
1514
|
<div class="tbw-shell-content" part="shell-content" role="presentation" data-light-dom-header-content></div>
|
|
1484
1515
|
<div class="tbw-shell-toolbar" part="shell-toolbar" role="presentation">
|
|
1485
1516
|
${g}
|
|
@@ -1554,7 +1585,7 @@ function W(t, e, o) {
|
|
|
1554
1585
|
e.toolPanels.set(s, g), e.lightDomToolPanelIds.add(s), r.style.display = "none";
|
|
1555
1586
|
});
|
|
1556
1587
|
}
|
|
1557
|
-
function
|
|
1588
|
+
function qt(t, e, o, n) {
|
|
1558
1589
|
const i = t.querySelector(".tbw-shell-toolbar");
|
|
1559
1590
|
i && i.addEventListener("click", (s) => {
|
|
1560
1591
|
if (s.target.closest("[data-panel-toggle]")) {
|
|
@@ -1571,7 +1602,7 @@ function zt(t, e, o, n) {
|
|
|
1571
1602
|
}
|
|
1572
1603
|
});
|
|
1573
1604
|
}
|
|
1574
|
-
function
|
|
1605
|
+
function Wt(t, e, o) {
|
|
1575
1606
|
const n = t.querySelector(".tbw-tool-panel"), i = t.querySelector("[data-resize-handle]"), r = t.querySelector(".tbw-shell-body");
|
|
1576
1607
|
if (!n || !i || !r)
|
|
1577
1608
|
return () => {
|
|
@@ -1595,7 +1626,7 @@ function Nt(t, e, o) {
|
|
|
1595
1626
|
i.removeEventListener("mousedown", g), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", f);
|
|
1596
1627
|
};
|
|
1597
1628
|
}
|
|
1598
|
-
function
|
|
1629
|
+
function Ae(t, e, o) {
|
|
1599
1630
|
const n = e?.header?.toolbarContents ?? [], i = [...o.toolbarContents.values()], r = new Set(n.map((l) => l.id)), s = [...n];
|
|
1600
1631
|
for (const l of i)
|
|
1601
1632
|
r.has(l.id) || s.push(l);
|
|
@@ -1607,7 +1638,7 @@ function Te(t, e, o) {
|
|
|
1607
1638
|
a && o.toolbarContentCleanups.set(l.id, a);
|
|
1608
1639
|
}
|
|
1609
1640
|
}
|
|
1610
|
-
function
|
|
1641
|
+
function ce(t, e) {
|
|
1611
1642
|
const o = e.lightDomHeaderContent.length > 0 && !e.lightDomContentMoved, n = e.headerContents.size > 0;
|
|
1612
1643
|
if (!o && !n) return;
|
|
1613
1644
|
const i = t.querySelector(".tbw-shell-content");
|
|
@@ -1627,7 +1658,7 @@ function se(t, e) {
|
|
|
1627
1658
|
a && e.headerContentCleanups.set(s.id, a);
|
|
1628
1659
|
}
|
|
1629
1660
|
}
|
|
1630
|
-
function
|
|
1661
|
+
function $t(t, e, o) {
|
|
1631
1662
|
if (!e.isPanelOpen) return;
|
|
1632
1663
|
const n = k(o?.expand ?? z.expand), i = k(o?.collapse ?? z.collapse);
|
|
1633
1664
|
for (const [r, s] of e.toolPanels) {
|
|
@@ -1648,15 +1679,15 @@ function kt(t, e, o) {
|
|
|
1648
1679
|
}
|
|
1649
1680
|
}
|
|
1650
1681
|
}
|
|
1651
|
-
function
|
|
1682
|
+
function Pe(t, e) {
|
|
1652
1683
|
const o = t.querySelector("[data-panel-toggle]");
|
|
1653
1684
|
o && (o.classList.toggle("active", e.isPanelOpen), o.setAttribute("aria-pressed", String(e.isPanelOpen)));
|
|
1654
1685
|
}
|
|
1655
|
-
function
|
|
1686
|
+
function Le(t, e) {
|
|
1656
1687
|
const o = t.querySelector(".tbw-tool-panel");
|
|
1657
1688
|
o && (o.classList.toggle("open", e.isPanelOpen), e.isPanelOpen || (o.style.width = ""));
|
|
1658
1689
|
}
|
|
1659
|
-
function
|
|
1690
|
+
function Ft(t) {
|
|
1660
1691
|
for (const e of t.headerContentCleanups.values())
|
|
1661
1692
|
e();
|
|
1662
1693
|
t.headerContentCleanups.clear();
|
|
@@ -1673,7 +1704,7 @@ function It(t) {
|
|
|
1673
1704
|
t.toolPanels.get(e)?.onClose?.();
|
|
1674
1705
|
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;
|
|
1675
1706
|
}
|
|
1676
|
-
function
|
|
1707
|
+
function Ut(t, e) {
|
|
1677
1708
|
let o = !1;
|
|
1678
1709
|
const n = {
|
|
1679
1710
|
get isInitialized() {
|
|
@@ -1702,7 +1733,7 @@ function qt(t, e) {
|
|
|
1702
1733
|
s && t.expandedSections.add(s.id);
|
|
1703
1734
|
}
|
|
1704
1735
|
const i = e.getShadow();
|
|
1705
|
-
|
|
1736
|
+
Pe(i, t), Le(i, t), $t(i, t, e.getAccordionIcons()), e.emit("tool-panel-open", { sections: n.expandedSections });
|
|
1706
1737
|
},
|
|
1707
1738
|
closeToolPanel() {
|
|
1708
1739
|
if (!t.isPanelOpen) return;
|
|
@@ -1713,7 +1744,7 @@ function qt(t, e) {
|
|
|
1713
1744
|
r.onClose?.();
|
|
1714
1745
|
t.isPanelOpen = !1;
|
|
1715
1746
|
const i = e.getShadow();
|
|
1716
|
-
|
|
1747
|
+
Pe(i, t), Le(i, t), e.emit("tool-panel-close", {});
|
|
1717
1748
|
},
|
|
1718
1749
|
toggleToolPanel() {
|
|
1719
1750
|
t.isPanelOpen ? n.closeToolPanel() : n.openToolPanel();
|
|
@@ -1729,16 +1760,16 @@ function qt(t, e) {
|
|
|
1729
1760
|
const s = e.getShadow(), l = t.expandedSections.has(i);
|
|
1730
1761
|
if (l) {
|
|
1731
1762
|
const c = t.panelCleanups.get(i);
|
|
1732
|
-
c && (c(), t.panelCleanups.delete(i)), r.onClose?.(), t.expandedSections.delete(i),
|
|
1763
|
+
c && (c(), t.panelCleanups.delete(i)), r.onClose?.(), t.expandedSections.delete(i), le(s, i, !1);
|
|
1733
1764
|
} else {
|
|
1734
1765
|
for (const [c, a] of t.toolPanels)
|
|
1735
1766
|
if (c !== i && t.expandedSections.has(c)) {
|
|
1736
1767
|
const h = t.panelCleanups.get(c);
|
|
1737
|
-
h && (h(), t.panelCleanups.delete(c)), a.onClose?.(), t.expandedSections.delete(c),
|
|
1768
|
+
h && (h(), t.panelCleanups.delete(c)), a.onClose?.(), t.expandedSections.delete(c), le(s, c, !1);
|
|
1738
1769
|
const u = s.querySelector(`[data-section="${c}"] .tbw-accordion-content`);
|
|
1739
1770
|
u && (u.innerHTML = "");
|
|
1740
1771
|
}
|
|
1741
|
-
t.expandedSections.add(i),
|
|
1772
|
+
t.expandedSections.add(i), le(s, i, !0), Vt(s, t, i);
|
|
1742
1773
|
}
|
|
1743
1774
|
e.emit("tool-panel-section-toggle", { id: i, expanded: !l });
|
|
1744
1775
|
},
|
|
@@ -1767,7 +1798,7 @@ function qt(t, e) {
|
|
|
1767
1798
|
console.warn(`[tbw-grid] Header content "${i.id}" already registered`);
|
|
1768
1799
|
return;
|
|
1769
1800
|
}
|
|
1770
|
-
t.headerContents.set(i.id, i), o &&
|
|
1801
|
+
t.headerContents.set(i.id, i), o && ce(e.getShadow(), t);
|
|
1771
1802
|
},
|
|
1772
1803
|
unregisterHeaderContent(i) {
|
|
1773
1804
|
const r = t.headerContentCleanups.get(i);
|
|
@@ -1792,11 +1823,11 @@ function qt(t, e) {
|
|
|
1792
1823
|
};
|
|
1793
1824
|
return n;
|
|
1794
1825
|
}
|
|
1795
|
-
function
|
|
1826
|
+
function le(t, e, o) {
|
|
1796
1827
|
const n = t.querySelector(`[data-section="${e}"]`);
|
|
1797
1828
|
n && n.classList.toggle("expanded", o);
|
|
1798
1829
|
}
|
|
1799
|
-
function
|
|
1830
|
+
function Vt(t, e, o) {
|
|
1800
1831
|
const n = e.toolPanels.get(o);
|
|
1801
1832
|
if (!n?.render) return;
|
|
1802
1833
|
const i = t.querySelector(`[data-section="${o}"] .tbw-accordion-content`);
|
|
@@ -1804,8 +1835,8 @@ function Wt(t, e, o) {
|
|
|
1804
1835
|
const r = n.render(i);
|
|
1805
1836
|
r && e.panelCleanups.set(o, r);
|
|
1806
1837
|
}
|
|
1807
|
-
function
|
|
1808
|
-
const i =
|
|
1838
|
+
function Bt(t, e, o, n) {
|
|
1839
|
+
const i = Ge(e), r = [], s = [
|
|
1809
1840
|
"tbw-grid-header",
|
|
1810
1841
|
"tbw-grid-tool-buttons",
|
|
1811
1842
|
"tbw-grid-tool-panel",
|
|
@@ -1841,19 +1872,19 @@ function $t(t, e, o, n) {
|
|
|
1841
1872
|
icon: k(v.icon),
|
|
1842
1873
|
isExpanded: o.expandedSections.has(v.id)
|
|
1843
1874
|
}))
|
|
1844
|
-
}, w =
|
|
1875
|
+
}, w = Nt(g), m = kt(d), R = Te({
|
|
1845
1876
|
hasShell: !0,
|
|
1846
1877
|
shellHeader: w,
|
|
1847
1878
|
shellBody: m
|
|
1848
1879
|
});
|
|
1849
1880
|
t.appendChild(R);
|
|
1850
1881
|
} else {
|
|
1851
|
-
const l =
|
|
1882
|
+
const l = Te({ hasShell: !1 });
|
|
1852
1883
|
t.appendChild(l);
|
|
1853
1884
|
}
|
|
1854
1885
|
return i;
|
|
1855
1886
|
}
|
|
1856
|
-
function
|
|
1887
|
+
function Gt() {
|
|
1857
1888
|
return {
|
|
1858
1889
|
startY: null,
|
|
1859
1890
|
startX: null,
|
|
@@ -1867,19 +1898,19 @@ function Ft() {
|
|
|
1867
1898
|
momentumRaf: 0
|
|
1868
1899
|
};
|
|
1869
1900
|
}
|
|
1870
|
-
function
|
|
1901
|
+
function Xt(t) {
|
|
1871
1902
|
t.startY = null, t.startX = null, t.scrollTop = null, t.scrollLeft = null, t.lastY = null, t.lastX = null, t.lastTime = null;
|
|
1872
1903
|
}
|
|
1873
|
-
function
|
|
1904
|
+
function Xe(t) {
|
|
1874
1905
|
t.momentumRaf && (cancelAnimationFrame(t.momentumRaf), t.momentumRaf = 0);
|
|
1875
1906
|
}
|
|
1876
|
-
function
|
|
1907
|
+
function Yt(t, e, o) {
|
|
1877
1908
|
if (t.touches.length !== 1) return;
|
|
1878
|
-
|
|
1909
|
+
Xe(e);
|
|
1879
1910
|
const n = t.touches[0];
|
|
1880
1911
|
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;
|
|
1881
1912
|
}
|
|
1882
|
-
function
|
|
1913
|
+
function jt(t, e, o) {
|
|
1883
1914
|
if (t.touches.length !== 1 || e.startY === null || e.startX === null || e.scrollTop === null || e.scrollLeft === null)
|
|
1884
1915
|
return !1;
|
|
1885
1916
|
const n = t.touches[0], i = n.clientY, r = n.clientX, s = performance.now(), l = e.startY - i, c = e.startX - r;
|
|
@@ -1896,10 +1927,10 @@ function Bt(t, e, o) {
|
|
|
1896
1927
|
}
|
|
1897
1928
|
return f && (o.fauxScrollbar.scrollTop = e.scrollTop + l), g && o.scrollArea && (o.scrollArea.scrollLeft = e.scrollLeft + c), f || g;
|
|
1898
1929
|
}
|
|
1899
|
-
function
|
|
1900
|
-
(Math.abs(t.velocityY) > 0.1 || Math.abs(t.velocityX) > 0.1) &&
|
|
1930
|
+
function Kt(t, e) {
|
|
1931
|
+
(Math.abs(t.velocityY) > 0.1 || Math.abs(t.velocityX) > 0.1) && Zt(t, e), Xt(t);
|
|
1901
1932
|
}
|
|
1902
|
-
function
|
|
1933
|
+
function Zt(t, e) {
|
|
1903
1934
|
const i = () => {
|
|
1904
1935
|
t.velocityY *= 0.95, t.velocityX *= 0.95;
|
|
1905
1936
|
const r = t.velocityY * 16, s = t.velocityX * 16;
|
|
@@ -1907,19 +1938,19 @@ function Xt(t, e) {
|
|
|
1907
1938
|
};
|
|
1908
1939
|
t.momentumRaf = requestAnimationFrame(i);
|
|
1909
1940
|
}
|
|
1910
|
-
function
|
|
1911
|
-
t.addEventListener("touchstart", (i) =>
|
|
1941
|
+
function Jt(t, e, o, n) {
|
|
1942
|
+
t.addEventListener("touchstart", (i) => Yt(i, e, o), {
|
|
1912
1943
|
passive: !0,
|
|
1913
1944
|
signal: n
|
|
1914
1945
|
}), t.addEventListener(
|
|
1915
1946
|
"touchmove",
|
|
1916
1947
|
(i) => {
|
|
1917
|
-
|
|
1948
|
+
jt(i, e, o) && i.preventDefault();
|
|
1918
1949
|
},
|
|
1919
1950
|
{ passive: !1, signal: n }
|
|
1920
|
-
), t.addEventListener("touchend", () =>
|
|
1951
|
+
), t.addEventListener("touchend", () => Kt(e, o), { passive: !0, signal: n });
|
|
1921
1952
|
}
|
|
1922
|
-
const
|
|
1953
|
+
const Qt = [
|
|
1923
1954
|
{
|
|
1924
1955
|
property: "editable",
|
|
1925
1956
|
pluginName: "editing",
|
|
@@ -1957,7 +1988,7 @@ const jt = [
|
|
|
1957
1988
|
importHint: "import { PinnedColumnsPlugin } from '@toolbox-web/grid/plugins/pinned-columns';",
|
|
1958
1989
|
isUsed: (t) => t === "left" || t === "right"
|
|
1959
1990
|
}
|
|
1960
|
-
],
|
|
1991
|
+
], eo = [
|
|
1961
1992
|
{
|
|
1962
1993
|
property: "columnGroups",
|
|
1963
1994
|
pluginName: "groupingColumns",
|
|
@@ -1966,7 +1997,7 @@ const jt = [
|
|
|
1966
1997
|
importHint: "import { GroupingColumnsPlugin } from '@toolbox-web/grid/plugins/grouping-columns';",
|
|
1967
1998
|
isUsed: (t) => Array.isArray(t) && t.length > 0
|
|
1968
1999
|
}
|
|
1969
|
-
],
|
|
2000
|
+
], to = {
|
|
1970
2001
|
editing: "import { EditingPlugin } from '@toolbox-web/grid/plugins/editing';",
|
|
1971
2002
|
selection: "import { SelectionPlugin } from '@toolbox-web/grid/plugins/selection';",
|
|
1972
2003
|
reorder: "import { ReorderPlugin } from '@toolbox-web/grid/plugins/reorder';",
|
|
@@ -1987,10 +2018,10 @@ const jt = [
|
|
|
1987
2018
|
serverSide: "import { ServerSidePlugin } from '@toolbox-web/grid/plugins/server-side';",
|
|
1988
2019
|
columnVirtualization: "import { ColumnVirtualizationPlugin } from '@toolbox-web/grid/plugins/column-virtualization';"
|
|
1989
2020
|
};
|
|
1990
|
-
function
|
|
1991
|
-
return
|
|
2021
|
+
function de(t) {
|
|
2022
|
+
return to[t] ?? `import { ${D(t)}Plugin } from '@toolbox-web/grid/plugins/${t}';`;
|
|
1992
2023
|
}
|
|
1993
|
-
function
|
|
2024
|
+
function Ye() {
|
|
1994
2025
|
if (typeof window < "u" && window.location) {
|
|
1995
2026
|
const t = window.location.hostname;
|
|
1996
2027
|
if (t === "localhost" || t === "127.0.0.1" || t === "::1")
|
|
@@ -2001,11 +2032,11 @@ function Be() {
|
|
|
2001
2032
|
function D(t) {
|
|
2002
2033
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
2003
2034
|
}
|
|
2004
|
-
function
|
|
2035
|
+
function He(t, e) {
|
|
2005
2036
|
return t.some((o) => o.name === e);
|
|
2006
2037
|
}
|
|
2007
|
-
function
|
|
2008
|
-
const o =
|
|
2038
|
+
function oo(t, e) {
|
|
2039
|
+
const o = Qt, n = eo, i = /* @__PURE__ */ new Map();
|
|
2009
2040
|
function r(l, c, a, h, u = !1) {
|
|
2010
2041
|
i.has(l) || i.set(l, { description: c, importHint: a, fields: [], isConfigProperty: u });
|
|
2011
2042
|
const p = i.get(l);
|
|
@@ -2013,16 +2044,16 @@ function Jt(t, e) {
|
|
|
2013
2044
|
}
|
|
2014
2045
|
for (const l of n) {
|
|
2015
2046
|
const c = t[l.property];
|
|
2016
|
-
(l.isUsed ? l.isUsed(c) : c !== void 0) && !
|
|
2047
|
+
(l.isUsed ? l.isUsed(c) : c !== void 0) && !He(e, l.pluginName) && r(l.pluginName, l.description, l.importHint ?? de(l.pluginName), l.property, !0);
|
|
2017
2048
|
}
|
|
2018
2049
|
const s = t.columns;
|
|
2019
2050
|
if (s && s.length > 0)
|
|
2020
2051
|
for (const l of s)
|
|
2021
2052
|
for (const c of o) {
|
|
2022
2053
|
const a = l[c.property];
|
|
2023
|
-
if ((c.isUsed ? c.isUsed(a) : a !== void 0) && !
|
|
2054
|
+
if ((c.isUsed ? c.isUsed(a) : a !== void 0) && !He(e, c.pluginName)) {
|
|
2024
2055
|
const u = l.field || "<unknown>";
|
|
2025
|
-
r(c.pluginName, c.description, c.importHint ??
|
|
2056
|
+
r(c.pluginName, c.description, c.importHint ?? de(c.pluginName), u);
|
|
2026
2057
|
}
|
|
2027
2058
|
}
|
|
2028
2059
|
if (i.size > 0) {
|
|
@@ -2055,7 +2086,7 @@ This validation helps catch misconfigurations early. The properties listed above
|
|
|
2055
2086
|
);
|
|
2056
2087
|
}
|
|
2057
2088
|
}
|
|
2058
|
-
function
|
|
2089
|
+
function no(t) {
|
|
2059
2090
|
const e = [], o = [];
|
|
2060
2091
|
for (const n of t) {
|
|
2061
2092
|
const r = n.constructor.manifest;
|
|
@@ -2068,7 +2099,7 @@ function Qt(t) {
|
|
|
2068
2099
|
}
|
|
2069
2100
|
}
|
|
2070
2101
|
}
|
|
2071
|
-
if (o.length > 0 &&
|
|
2102
|
+
if (o.length > 0 && Ye())
|
|
2072
2103
|
for (const n of o)
|
|
2073
2104
|
console.warn(n);
|
|
2074
2105
|
if (e.length > 0)
|
|
@@ -2078,12 +2109,12 @@ ${e.join(`
|
|
|
2078
2109
|
|
|
2079
2110
|
`)}`);
|
|
2080
2111
|
}
|
|
2081
|
-
function
|
|
2112
|
+
function io(t, e) {
|
|
2082
2113
|
const o = t.name, i = t.constructor.dependencies ?? [];
|
|
2083
2114
|
for (const r of i) {
|
|
2084
2115
|
const s = r.name, l = r.required ?? !0, c = r.reason;
|
|
2085
2116
|
if (!e.some((h) => h.name === s)) {
|
|
2086
|
-
const h = c ?? `${D(o)}Plugin requires ${D(s)}Plugin`, u =
|
|
2117
|
+
const h = c ?? `${D(o)}Plugin requires ${D(s)}Plugin`, u = de(s);
|
|
2087
2118
|
if (l)
|
|
2088
2119
|
throw new Error(
|
|
2089
2120
|
`[tbw-grid] Plugin dependency error:
|
|
@@ -2100,8 +2131,8 @@ ${h}.
|
|
|
2100
2131
|
}
|
|
2101
2132
|
}
|
|
2102
2133
|
}
|
|
2103
|
-
function
|
|
2104
|
-
if (!
|
|
2134
|
+
function ro(t) {
|
|
2135
|
+
if (!Ye()) return;
|
|
2105
2136
|
const e = new Set(t.map((n) => n.name)), o = /* @__PURE__ */ new Set();
|
|
2106
2137
|
for (const n of t) {
|
|
2107
2138
|
const r = n.constructor.manifest;
|
|
@@ -2123,7 +2154,7 @@ ${D(n.name)}Plugin and ${D(s.name)}Plugin are both loaded, but they are currentl
|
|
|
2123
2154
|
}
|
|
2124
2155
|
}
|
|
2125
2156
|
}
|
|
2126
|
-
class
|
|
2157
|
+
class so {
|
|
2127
2158
|
constructor(e) {
|
|
2128
2159
|
this.grid = e;
|
|
2129
2160
|
}
|
|
@@ -2140,7 +2171,7 @@ class oo {
|
|
|
2140
2171
|
this.attach(o);
|
|
2141
2172
|
}
|
|
2142
2173
|
attach(e) {
|
|
2143
|
-
if (
|
|
2174
|
+
if (io(e, this.plugins), this.pluginMap.set(e.constructor, e), this.plugins.push(e), e.cellRenderers)
|
|
2144
2175
|
for (const [o, n] of Object.entries(e.cellRenderers))
|
|
2145
2176
|
this.cellRenderers.set(o, n);
|
|
2146
2177
|
if (e.headerRenderers)
|
|
@@ -2338,9 +2369,10 @@ class oo {
|
|
|
2338
2369
|
return e.sort((o, n) => (o.content.order ?? 0) - (n.content.order ?? 0));
|
|
2339
2370
|
}
|
|
2340
2371
|
}
|
|
2341
|
-
class
|
|
2372
|
+
class L extends HTMLElement {
|
|
2342
2373
|
static tagName = "tbw-grid";
|
|
2343
|
-
static version = "1.
|
|
2374
|
+
static version = "1.4.0";
|
|
2375
|
+
static #l = 0;
|
|
2344
2376
|
static adapters = [];
|
|
2345
2377
|
static registerAdapter(e) {
|
|
2346
2378
|
this.adapters.push(e);
|
|
@@ -2354,35 +2386,35 @@ class H extends HTMLElement {
|
|
|
2354
2386
|
static get observedAttributes() {
|
|
2355
2387
|
return ["rows", "columns", "grid-config", "fit-mode"];
|
|
2356
2388
|
}
|
|
2357
|
-
get #
|
|
2389
|
+
get #i() {
|
|
2358
2390
|
return this;
|
|
2359
2391
|
}
|
|
2360
|
-
#
|
|
2361
|
-
#f;
|
|
2392
|
+
#u = !1;
|
|
2362
2393
|
#d;
|
|
2363
|
-
#
|
|
2364
|
-
|
|
2394
|
+
#h;
|
|
2395
|
+
#a = [];
|
|
2396
|
+
get #n() {
|
|
2365
2397
|
return this.#t?.effective ?? {};
|
|
2366
2398
|
}
|
|
2367
|
-
#
|
|
2368
|
-
#
|
|
2369
|
-
#
|
|
2399
|
+
#f = !1;
|
|
2400
|
+
#g = !1;
|
|
2401
|
+
#b = {
|
|
2370
2402
|
rows: !1,
|
|
2371
2403
|
columns: !1,
|
|
2372
2404
|
gridConfig: !1,
|
|
2373
2405
|
fitMode: !1
|
|
2374
2406
|
};
|
|
2375
|
-
#
|
|
2376
|
-
#
|
|
2377
|
-
#
|
|
2378
|
-
#
|
|
2379
|
-
#
|
|
2380
|
-
#A =
|
|
2381
|
-
#
|
|
2407
|
+
#s;
|
|
2408
|
+
#v = 0;
|
|
2409
|
+
#r = null;
|
|
2410
|
+
#m = !1;
|
|
2411
|
+
#S;
|
|
2412
|
+
#A = Gt();
|
|
2413
|
+
#w;
|
|
2382
2414
|
#C;
|
|
2383
2415
|
#y;
|
|
2384
|
-
#
|
|
2385
|
-
#
|
|
2416
|
+
#p;
|
|
2417
|
+
#ae = {
|
|
2386
2418
|
scrollTop: 0,
|
|
2387
2419
|
scrollLeft: 0,
|
|
2388
2420
|
scrollHeight: 0,
|
|
@@ -2396,17 +2428,17 @@ class H extends HTMLElement {
|
|
|
2396
2428
|
#P;
|
|
2397
2429
|
#L;
|
|
2398
2430
|
#t;
|
|
2399
|
-
#e =
|
|
2400
|
-
#
|
|
2431
|
+
#e = It();
|
|
2432
|
+
#c;
|
|
2401
2433
|
#D;
|
|
2402
2434
|
#H = /* @__PURE__ */ new Map();
|
|
2403
2435
|
_rows = [];
|
|
2404
2436
|
#I = [];
|
|
2405
2437
|
get _columns() {
|
|
2406
|
-
return this.#
|
|
2438
|
+
return this.#n.columns ?? [];
|
|
2407
2439
|
}
|
|
2408
2440
|
set _columns(e) {
|
|
2409
|
-
this.#
|
|
2441
|
+
this.#n.columns = e;
|
|
2410
2442
|
}
|
|
2411
2443
|
get _visibleColumns() {
|
|
2412
2444
|
return this._columns.filter((e) => !e.hidden);
|
|
@@ -2451,11 +2483,11 @@ class H extends HTMLElement {
|
|
|
2451
2483
|
return this._rows;
|
|
2452
2484
|
}
|
|
2453
2485
|
set rows(e) {
|
|
2454
|
-
const o = this.#
|
|
2455
|
-
this.#
|
|
2486
|
+
const o = this.#a;
|
|
2487
|
+
this.#a = e, o !== e && this.#k("rows");
|
|
2456
2488
|
}
|
|
2457
2489
|
get sourceRows() {
|
|
2458
|
-
return this.#
|
|
2490
|
+
return this.#a;
|
|
2459
2491
|
}
|
|
2460
2492
|
get columns() {
|
|
2461
2493
|
return [...this._columns];
|
|
@@ -2465,70 +2497,70 @@ class H extends HTMLElement {
|
|
|
2465
2497
|
this.#t?.setColumns(e), o !== e && this.#k("columns");
|
|
2466
2498
|
}
|
|
2467
2499
|
get gridConfig() {
|
|
2468
|
-
return this.#
|
|
2500
|
+
return this.#n;
|
|
2469
2501
|
}
|
|
2470
2502
|
set gridConfig(e) {
|
|
2471
2503
|
const o = this.#t?.getGridConfig();
|
|
2472
2504
|
this.#t?.setGridConfig(e), o !== e && (this.#t.clearLightDomCache(), this.#k("gridConfig"));
|
|
2473
2505
|
}
|
|
2474
2506
|
get fitMode() {
|
|
2475
|
-
return this.#
|
|
2507
|
+
return this.#n.fitMode ?? "stretch";
|
|
2476
2508
|
}
|
|
2477
2509
|
set fitMode(e) {
|
|
2478
2510
|
const o = this.#t?.getFitMode();
|
|
2479
2511
|
this.#t?.setFitMode(e), o !== e && this.#k("fitMode");
|
|
2480
2512
|
}
|
|
2481
2513
|
get effectiveConfig() {
|
|
2482
|
-
return this.#
|
|
2514
|
+
return this.#n;
|
|
2483
2515
|
}
|
|
2484
2516
|
get disconnectSignal() {
|
|
2485
|
-
return this.#
|
|
2517
|
+
return this.#w || (this.#w = new AbortController()), this.#w.signal;
|
|
2486
2518
|
}
|
|
2487
2519
|
constructor() {
|
|
2488
|
-
super(), this.#
|
|
2520
|
+
super(), this.#de(), this.#d = new Promise((e) => this.#h = e), this.#s = new At({
|
|
2489
2521
|
mergeConfig: () => {
|
|
2490
|
-
this.#t.parseLightDomColumns(this), this.#t.merge(), this.#K(),
|
|
2522
|
+
this.#t.parseLightDomColumns(this), this.#t.merge(), this.#K(), oo(this.#n, this.#o?.getPlugins() ?? []), no(this.#o?.getPlugins() ?? []), ro(this.#o?.getPlugins() ?? []), this.#Ee(), this.#I = [...this._columns];
|
|
2491
2523
|
},
|
|
2492
|
-
processColumns: () => this.#
|
|
2493
|
-
processRows: () => this.#
|
|
2494
|
-
renderHeader: () =>
|
|
2495
|
-
updateTemplate: () =>
|
|
2524
|
+
processColumns: () => this.#Ce(),
|
|
2525
|
+
processRows: () => this.#ye(),
|
|
2526
|
+
renderHeader: () => te(this),
|
|
2527
|
+
updateTemplate: () => V(this),
|
|
2496
2528
|
renderVirtualWindow: () => this.refreshVirtualWindow(!0, !0),
|
|
2497
2529
|
afterRender: () => {
|
|
2498
|
-
this.#o?.afterRender(), this.#
|
|
2530
|
+
this.#o?.afterRender(), this.#n.fitMode === "fixed" && !this.__didInitialAutoSize && (this.__didInitialAutoSize = !0, me(this)), this._restoreFocusAfterRender && (this._restoreFocusAfterRender = !1, $(this)), this._virtualization.enabled && !this.#N && this.#ue();
|
|
2499
2531
|
},
|
|
2500
|
-
isConnected: () => this.isConnected && this.#
|
|
2501
|
-
}), this.#
|
|
2502
|
-
getShadow: () => this.#
|
|
2503
|
-
getShellConfig: () => this.#
|
|
2532
|
+
isConnected: () => this.isConnected && this.#f
|
|
2533
|
+
}), this.#s.setInitialReadyResolver(() => this.#h?.()), this.#c = Ut(this.#e, {
|
|
2534
|
+
getShadow: () => this.#i,
|
|
2535
|
+
getShellConfig: () => this.#n?.shell,
|
|
2504
2536
|
getAccordionIcons: () => ({
|
|
2505
|
-
expand: this.#
|
|
2506
|
-
collapse: this.#
|
|
2537
|
+
expand: this.#n?.icons?.expand ?? z.expand,
|
|
2538
|
+
collapse: this.#n?.icons?.collapse ?? z.collapse
|
|
2507
2539
|
}),
|
|
2508
2540
|
emit: (e, o) => this.#T(e, o),
|
|
2509
2541
|
refreshShellHeader: () => this.refreshShellHeader()
|
|
2510
|
-
}), this.#t = new
|
|
2511
|
-
getRows: () => this.#
|
|
2542
|
+
}), this.#t = new ht({
|
|
2543
|
+
getRows: () => this.#a,
|
|
2512
2544
|
getSortState: () => this._sortState,
|
|
2513
2545
|
setSortState: (e) => {
|
|
2514
2546
|
this._sortState = e;
|
|
2515
2547
|
},
|
|
2516
2548
|
onConfigChange: () => {
|
|
2517
|
-
this.#
|
|
2549
|
+
this.#s.requestPhase(x.FULL, "configChange");
|
|
2518
2550
|
},
|
|
2519
2551
|
emit: (e, o) => this.#T(e, o),
|
|
2520
2552
|
clearRowPool: () => {
|
|
2521
2553
|
this._rowPool.length = 0, this._bodyEl && (this._bodyEl.innerHTML = ""), this.__rowRenderEpoch++;
|
|
2522
2554
|
},
|
|
2523
2555
|
setup: () => this.#x(),
|
|
2524
|
-
renderHeader: () =>
|
|
2525
|
-
updateTemplate: () =>
|
|
2526
|
-
refreshVirtualWindow: () => this.#
|
|
2556
|
+
renderHeader: () => te(this),
|
|
2557
|
+
updateTemplate: () => V(this),
|
|
2558
|
+
refreshVirtualWindow: () => this.#s.requestPhase(x.VIRTUALIZATION, "configManager"),
|
|
2527
2559
|
getVirtualization: () => this._virtualization,
|
|
2528
2560
|
setRowHeight: (e) => {
|
|
2529
2561
|
this._virtualization.rowHeight = e;
|
|
2530
2562
|
},
|
|
2531
|
-
applyAnimationConfig: (e) => this.#
|
|
2563
|
+
applyAnimationConfig: (e) => this.#_e(e),
|
|
2532
2564
|
getShellLightDomTitle: () => this.#e.lightDomTitle,
|
|
2533
2565
|
getShellToolPanels: () => this.#e.toolPanels,
|
|
2534
2566
|
getShellHeaderContents: () => this.#e.headerContents,
|
|
@@ -2540,22 +2572,22 @@ class H extends HTMLElement {
|
|
|
2540
2572
|
static #Y = "tbw-grid-styles";
|
|
2541
2573
|
static #M = "";
|
|
2542
2574
|
static #q = /* @__PURE__ */ new Map();
|
|
2543
|
-
static #
|
|
2575
|
+
static #ce() {
|
|
2544
2576
|
let e = document.getElementById(this.#Y);
|
|
2545
2577
|
return e || (e = document.createElement("style"), e.id = this.#Y, e.setAttribute("data-tbw-grid", "true"), document.head.appendChild(e)), e;
|
|
2546
2578
|
}
|
|
2547
2579
|
static #W() {
|
|
2548
|
-
const e = this.#
|
|
2580
|
+
const e = this.#ce(), o = Array.from(this.#q.values()).join(`
|
|
2549
2581
|
`);
|
|
2550
2582
|
e.textContent = `${this.#M}
|
|
2551
2583
|
|
|
2552
2584
|
/* Plugin Styles */
|
|
2553
2585
|
${o}`;
|
|
2554
2586
|
}
|
|
2555
|
-
async #
|
|
2556
|
-
if (!
|
|
2557
|
-
if (
|
|
2558
|
-
|
|
2587
|
+
async #de() {
|
|
2588
|
+
if (!L.#M) {
|
|
2589
|
+
if (pe.length > 0) {
|
|
2590
|
+
L.#M = pe, L.#W();
|
|
2559
2591
|
return;
|
|
2560
2592
|
}
|
|
2561
2593
|
await new Promise((e) => setTimeout(e, 50));
|
|
@@ -2572,7 +2604,7 @@ ${o}`;
|
|
|
2572
2604
|
} catch {
|
|
2573
2605
|
continue;
|
|
2574
2606
|
}
|
|
2575
|
-
e ? (
|
|
2607
|
+
e ? (L.#M = e, L.#W()) : (typeof process > "u" || process.env?.NODE_ENV !== "test") && console.warn(
|
|
2576
2608
|
"[tbw-grid] Could not find grid.css in document.styleSheets. Grid styling will not work.",
|
|
2577
2609
|
"Available stylesheets:",
|
|
2578
2610
|
Array.from(document.styleSheets).map((o) => o.href || "(inline)")
|
|
@@ -2589,31 +2621,31 @@ ${o}`;
|
|
|
2589
2621
|
return this.#o?.getPluginByName(e);
|
|
2590
2622
|
}
|
|
2591
2623
|
requestRender() {
|
|
2592
|
-
this.#
|
|
2624
|
+
this.#s.requestPhase(x.ROWS, "plugin:requestRender");
|
|
2593
2625
|
}
|
|
2594
2626
|
requestRenderWithFocus() {
|
|
2595
|
-
this._restoreFocusAfterRender = !0, this.#
|
|
2627
|
+
this._restoreFocusAfterRender = !0, this.#s.requestPhase(x.ROWS, "plugin:requestRenderWithFocus");
|
|
2596
2628
|
}
|
|
2597
2629
|
updateTemplate() {
|
|
2598
|
-
|
|
2630
|
+
V(this);
|
|
2599
2631
|
}
|
|
2600
2632
|
requestAfterRender() {
|
|
2601
|
-
this.#
|
|
2633
|
+
this.#s.requestPhase(x.STYLE, "plugin:requestAfterRender");
|
|
2602
2634
|
}
|
|
2603
2635
|
#j() {
|
|
2604
|
-
this.#o = new
|
|
2605
|
-
const e = this.#
|
|
2636
|
+
this.#o = new so(this);
|
|
2637
|
+
const e = this.#n?.plugins, o = Array.isArray(e) ? e : [];
|
|
2606
2638
|
this.#o.attachAll(o);
|
|
2607
2639
|
}
|
|
2608
2640
|
#z() {
|
|
2609
2641
|
const e = this.#o?.getPluginStyles() ?? [];
|
|
2610
2642
|
let o = !1;
|
|
2611
2643
|
for (const { name: n, styles: i } of e)
|
|
2612
|
-
|
|
2613
|
-
o &&
|
|
2644
|
+
L.#q.has(n) || (L.#q.set(n, i), o = !0);
|
|
2645
|
+
o && L.#W();
|
|
2614
2646
|
}
|
|
2615
2647
|
#K() {
|
|
2616
|
-
const e = this.#
|
|
2648
|
+
const e = this.#n?.plugins, o = Array.isArray(e) ? e : [];
|
|
2617
2649
|
if (this.#_ !== o) {
|
|
2618
2650
|
if (this.#_ && this.#_.length === o.length && this.#_.every((n, i) => n === o[i])) {
|
|
2619
2651
|
this.#_ = o;
|
|
@@ -2631,10 +2663,10 @@ ${o}`;
|
|
|
2631
2663
|
const i = this.#e.headerContentCleanups.get(n);
|
|
2632
2664
|
i && (i(), this.#e.headerContentCleanups.delete(n)), this.#e.headerContents.delete(n);
|
|
2633
2665
|
}
|
|
2634
|
-
this.#j(), this.#z(), this.#_ = o, this.#Z(), this.#
|
|
2666
|
+
this.#j(), this.#z(), this.#_ = o, this.#Z(), this.#m = this.#o?.getAll().some((n) => n.onScroll) ?? !1;
|
|
2635
2667
|
}
|
|
2636
2668
|
}
|
|
2637
|
-
#
|
|
2669
|
+
#he() {
|
|
2638
2670
|
this.#o?.detachAll();
|
|
2639
2671
|
}
|
|
2640
2672
|
#Z() {
|
|
@@ -2647,7 +2679,7 @@ ${o}`;
|
|
|
2647
2679
|
this.#e.headerContents.has(n.id) || this.#e.headerContents.set(n.id, n);
|
|
2648
2680
|
}
|
|
2649
2681
|
#R() {
|
|
2650
|
-
const e =
|
|
2682
|
+
const e = L.getAdapters();
|
|
2651
2683
|
if (e.length === 0 && !this.__frameworkAdapter) return;
|
|
2652
2684
|
const o = this.__frameworkAdapter;
|
|
2653
2685
|
return (n) => {
|
|
@@ -2663,20 +2695,20 @@ ${o}`;
|
|
|
2663
2695
|
};
|
|
2664
2696
|
}
|
|
2665
2697
|
connectedCallback() {
|
|
2666
|
-
this.hasAttribute("tabindex") || (this.tabIndex = 0), this.hasAttribute("version") || this.setAttribute("version",
|
|
2667
|
-
const e = this.#
|
|
2668
|
-
this.#_ = Array.isArray(e) ? e : [], this.#Z(), this.#
|
|
2698
|
+
this.hasAttribute("tabindex") || (this.tabIndex = 0), this.hasAttribute("version") || this.setAttribute("version", L.version), this.id || (this.id = `tbw-grid-${++L.#l}`), this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#w && (this.#w.abort(), this.#O = !1), this.#w = new AbortController(), this.#p && (Se(this.#p), this.#p = 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();
|
|
2699
|
+
const e = this.#n?.plugins;
|
|
2700
|
+
this.#_ = Array.isArray(e) ? e : [], this.#Z(), this.#u || (this.#G(), this.#z(), this.#u = !0), this.#J(), this.#p = xt(
|
|
2669
2701
|
() => {
|
|
2670
|
-
this.#
|
|
2702
|
+
this.#xe();
|
|
2671
2703
|
},
|
|
2672
2704
|
{ timeout: 100 }
|
|
2673
2705
|
);
|
|
2674
2706
|
}
|
|
2675
2707
|
disconnectedCallback() {
|
|
2676
|
-
this.#
|
|
2708
|
+
this.#p && (Se(this.#p), this.#p = void 0), this.#he(), Ft(this.#e), this.#c.setInitialized(!1), this.#D?.(), this.#D = void 0, Xe(this.#A), this.#w && (this.#w.abort(), this.#w = 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), Y(this), this.#E.clear(), this.#_ = void 0;
|
|
2677
2709
|
for (const e of this._rowPool)
|
|
2678
2710
|
e.remove();
|
|
2679
|
-
this._rowPool.length = 0, this.__rowsBodyEl = null, this.#
|
|
2711
|
+
this._rowPool.length = 0, this.__rowsBodyEl = null, this.#f = !1;
|
|
2680
2712
|
}
|
|
2681
2713
|
attributeChangedCallback(e, o, n) {
|
|
2682
2714
|
if (!(o === n || !n || n === "null" || n === "undefined"))
|
|
@@ -2690,19 +2722,19 @@ ${o}`;
|
|
|
2690
2722
|
else e === "fit-mode" && (this.fitMode = n);
|
|
2691
2723
|
}
|
|
2692
2724
|
#J() {
|
|
2693
|
-
const o = this.#
|
|
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.#
|
|
2695
|
-
|
|
2696
|
-
const r = this.#
|
|
2725
|
+
const o = this.#i.querySelector(".tbw-grid-content") ?? this.#i.querySelector(".tbw-grid-root");
|
|
2726
|
+
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.#c.isInitialized) {
|
|
2727
|
+
ce(this.#i, this.#e), Ae(this.#i, this.#n?.shell, this.#e);
|
|
2728
|
+
const r = this.#n?.shell?.toolPanel?.defaultOpen;
|
|
2697
2729
|
r && this.#e.toolPanels.has(r) && (this.openToolPanel(), this.#e.expandedSections.add(r));
|
|
2698
2730
|
}
|
|
2699
|
-
if (this.setAttribute("data-upgraded", ""), this.#
|
|
2731
|
+
if (this.setAttribute("data-upgraded", ""), this.#f = !0, this._resizeController = Re(this), this.#x(), this.#ee(o), this.#O)
|
|
2700
2732
|
return;
|
|
2701
2733
|
this.#O = !0;
|
|
2702
2734
|
const n = this.disconnectSignal;
|
|
2703
|
-
|
|
2704
|
-
const i = this.#
|
|
2705
|
-
i && i > 0 ? this._virtualization.rowHeight = i : requestAnimationFrame(() => this.#Q()), queueMicrotask(() => this.#
|
|
2735
|
+
_t(this, this, this.#i, n);
|
|
2736
|
+
const i = this.#n.rowHeight;
|
|
2737
|
+
i && i > 0 ? this._virtualization.rowHeight = i : requestAnimationFrame(() => this.#Q()), queueMicrotask(() => this.#fe()), this.#s.requestPhase(x.FULL, "afterConnect");
|
|
2706
2738
|
}
|
|
2707
2739
|
#Q() {
|
|
2708
2740
|
if (this.#o.hasExtraHeight())
|
|
@@ -2716,16 +2748,16 @@ ${o}`;
|
|
|
2716
2748
|
l > n && (n = l);
|
|
2717
2749
|
});
|
|
2718
2750
|
const i = e.getBoundingClientRect(), r = Math.max(i.height, n);
|
|
2719
|
-
r > 0 && Math.abs(r - this._virtualization.rowHeight) > 1 && (this._virtualization.rowHeight = r, this.#
|
|
2751
|
+
r > 0 && Math.abs(r - this._virtualization.rowHeight) > 1 && (this._virtualization.rowHeight = r, this.#s.requestPhase(x.VIRTUALIZATION, "measureRowHeight"));
|
|
2720
2752
|
}
|
|
2721
2753
|
#ee(e) {
|
|
2722
2754
|
this.#P?.abort(), this.#P = new AbortController();
|
|
2723
2755
|
const o = this.#P.signal, n = e?.querySelector(".faux-vscroll"), i = e?.querySelector(".rows");
|
|
2724
|
-
if (this._virtualization.container = n ?? this, this.#
|
|
2756
|
+
if (this._virtualization.container = n ?? this, this.#m = this.#o?.getAll().some((r) => r.onScroll) ?? !1, n && i) {
|
|
2725
2757
|
n.addEventListener(
|
|
2726
2758
|
"scroll",
|
|
2727
2759
|
() => {
|
|
2728
|
-
if (!this._virtualization.enabled && !this.#
|
|
2760
|
+
if (!this._virtualization.enabled && !this.#m) return;
|
|
2729
2761
|
const l = n.scrollTop, c = this._virtualization.rowHeight;
|
|
2730
2762
|
if (this._rows.length <= this._virtualization.bypassThreshold)
|
|
2731
2763
|
i.style.transform = `translateY(${-l}px)`;
|
|
@@ -2733,13 +2765,13 @@ ${o}`;
|
|
|
2733
2765
|
const a = Math.floor(l / c), h = a - a % 2, u = -(l - h * c);
|
|
2734
2766
|
i.style.transform = `translateY(${u}px)`;
|
|
2735
2767
|
}
|
|
2736
|
-
this.#
|
|
2737
|
-
this.#
|
|
2768
|
+
this.#r = l, this.#v || (this.#v = requestAnimationFrame(() => {
|
|
2769
|
+
this.#v = 0, this.#r !== null && (this.#Se(this.#r), this.#r = null);
|
|
2738
2770
|
}));
|
|
2739
2771
|
},
|
|
2740
2772
|
{ passive: !0, signal: o }
|
|
2741
2773
|
);
|
|
2742
|
-
const r = this.#
|
|
2774
|
+
const r = this.#i.querySelector(".tbw-grid-content"), s = this.#i.querySelector(".tbw-scroll-area");
|
|
2743
2775
|
r && (r.addEventListener(
|
|
2744
2776
|
"wheel",
|
|
2745
2777
|
(l) => {
|
|
@@ -2753,27 +2785,27 @@ ${o}`;
|
|
|
2753
2785
|
}
|
|
2754
2786
|
},
|
|
2755
2787
|
{ passive: !1, signal: o }
|
|
2756
|
-
),
|
|
2788
|
+
), Jt(r, this.#A, { fauxScrollbar: n, scrollArea: s }, o));
|
|
2757
2789
|
}
|
|
2758
|
-
this._bodyEl &&
|
|
2759
|
-
this.#
|
|
2760
|
-
}), this.#C.observe(this._virtualization.viewportEl)), this.#
|
|
2790
|
+
this._bodyEl && yt(this, this._bodyEl, o), this.#C?.disconnect(), this._virtualization.viewportEl && (this.#C = new ResizeObserver(() => {
|
|
2791
|
+
this.#s.requestPhase(x.VIRTUALIZATION, "resize-observer");
|
|
2792
|
+
}), this.#C.observe(this._virtualization.viewportEl)), this.#i.addEventListener(
|
|
2761
2793
|
"focusin",
|
|
2762
2794
|
() => {
|
|
2763
2795
|
this.dataset.hasFocus = "";
|
|
2764
2796
|
},
|
|
2765
2797
|
{ signal: o }
|
|
2766
|
-
), this.#
|
|
2798
|
+
), this.#i.addEventListener(
|
|
2767
2799
|
"focusout",
|
|
2768
2800
|
(r) => {
|
|
2769
2801
|
const s = r.relatedTarget;
|
|
2770
|
-
(!s || !this.#
|
|
2802
|
+
(!s || !this.#i.contains(s)) && delete this.dataset.hasFocus;
|
|
2771
2803
|
},
|
|
2772
2804
|
{ signal: o }
|
|
2773
2805
|
);
|
|
2774
2806
|
}
|
|
2775
2807
|
#N = !1;
|
|
2776
|
-
#
|
|
2808
|
+
#ue() {
|
|
2777
2809
|
if (this.#N) return;
|
|
2778
2810
|
const e = this._bodyEl?.querySelector(".data-grid-row");
|
|
2779
2811
|
e && (this.#N = !0, this.#y?.disconnect(), this.#y = new ResizeObserver(() => {
|
|
@@ -2783,7 +2815,7 @@ ${o}`;
|
|
|
2783
2815
|
#T(e, o) {
|
|
2784
2816
|
this.dispatchEvent(new CustomEvent(e, { detail: o, bubbles: !0, composed: !0 }));
|
|
2785
2817
|
}
|
|
2786
|
-
#
|
|
2818
|
+
#fe() {
|
|
2787
2819
|
this._bodyEl?.querySelectorAll(".data-grid-row")?.forEach((o, n) => {
|
|
2788
2820
|
const i = n === this._focusRow;
|
|
2789
2821
|
o.setAttribute("aria-selected", String(i)), o.querySelectorAll(".cell").forEach((r, s) => {
|
|
@@ -2792,31 +2824,31 @@ ${o}`;
|
|
|
2792
2824
|
});
|
|
2793
2825
|
}
|
|
2794
2826
|
#k(e) {
|
|
2795
|
-
this.#
|
|
2827
|
+
this.#b[e] = !0, !this.#g && (this.#g = !0, queueMicrotask(() => this.#pe()));
|
|
2796
2828
|
}
|
|
2797
|
-
#
|
|
2798
|
-
if (!this.#
|
|
2799
|
-
this.#
|
|
2829
|
+
#pe() {
|
|
2830
|
+
if (!this.#g || !this.#f) {
|
|
2831
|
+
this.#g = !1;
|
|
2800
2832
|
return;
|
|
2801
2833
|
}
|
|
2802
|
-
const e = this.#
|
|
2803
|
-
if (this.#
|
|
2834
|
+
const e = this.#b;
|
|
2835
|
+
if (this.#g = !1, this.#b = {
|
|
2804
2836
|
rows: !1,
|
|
2805
2837
|
columns: !1,
|
|
2806
2838
|
gridConfig: !1,
|
|
2807
2839
|
fitMode: !1
|
|
2808
2840
|
}, e.gridConfig) {
|
|
2809
|
-
this.#
|
|
2841
|
+
this.#be(), e.rows && this.#te();
|
|
2810
2842
|
return;
|
|
2811
2843
|
}
|
|
2812
|
-
e.columns && this.#
|
|
2844
|
+
e.columns && this.#we(), e.rows && this.#te(), e.fitMode && this.#me();
|
|
2813
2845
|
}
|
|
2814
2846
|
#te() {
|
|
2815
|
-
this._rows = Array.isArray(this.#
|
|
2847
|
+
this._rows = Array.isArray(this.#a) ? [...this.#a] : [], this.#$(), this.#s.requestPhase(x.ROWS, "applyRowsUpdate");
|
|
2816
2848
|
}
|
|
2817
2849
|
#$() {
|
|
2818
2850
|
this.#H.clear();
|
|
2819
|
-
const e = this.#
|
|
2851
|
+
const e = this.#n.getRowId;
|
|
2820
2852
|
this._rows.forEach((o, n) => {
|
|
2821
2853
|
const i = this.#oe(o, e);
|
|
2822
2854
|
i !== void 0 && this.#H.set(i, { row: o, index: n });
|
|
@@ -2829,7 +2861,7 @@ ${o}`;
|
|
|
2829
2861
|
if ("id" in n && n.id != null) return String(n.id);
|
|
2830
2862
|
if ("_id" in n && n._id != null) return String(n._id);
|
|
2831
2863
|
}
|
|
2832
|
-
#
|
|
2864
|
+
#ge(e, o) {
|
|
2833
2865
|
const n = this.#oe(e, o);
|
|
2834
2866
|
if (n === void 0)
|
|
2835
2867
|
throw new Error(
|
|
@@ -2837,33 +2869,33 @@ ${o}`;
|
|
|
2837
2869
|
);
|
|
2838
2870
|
return n;
|
|
2839
2871
|
}
|
|
2840
|
-
#
|
|
2841
|
-
|
|
2872
|
+
#we() {
|
|
2873
|
+
Y(this), this.#t.merge(), this.#x();
|
|
2842
2874
|
}
|
|
2843
|
-
#
|
|
2844
|
-
this.#t.merge(), this.#
|
|
2875
|
+
#me() {
|
|
2876
|
+
this.#t.merge(), this.#n.fitMode === "fixed" ? (this.__didInitialAutoSize = !1, me(this)) : (this._columns.forEach((o) => {
|
|
2845
2877
|
!o.__userResized && o.__autoSized && delete o.width;
|
|
2846
|
-
}),
|
|
2878
|
+
}), V(this));
|
|
2847
2879
|
}
|
|
2848
|
-
#
|
|
2880
|
+
#be() {
|
|
2849
2881
|
I(this, this.#e), q(this, this.#e);
|
|
2850
|
-
const e = !!this.#
|
|
2882
|
+
const e = !!this.#i.querySelector(".has-shell"), o = !!this.#i.querySelector(".tbw-tool-panel"), n = this.#i.querySelectorAll(".tbw-accordion-section").length;
|
|
2851
2883
|
this.#t.parseLightDomColumns(this), this.#t.merge(), this.#K(), W(this, this.#e, this.#R()), this.#t.markSourcesChanged(), this.#t.merge();
|
|
2852
|
-
const i =
|
|
2884
|
+
const i = Ge(this.#n?.shell), r = (this.#n?.shell?.toolPanels?.length ?? 0) > 0, s = (this.#n?.shell?.toolPanels?.length ?? 0) !== n;
|
|
2853
2885
|
if (e !== i || !e && i || !o && r || o && s) {
|
|
2854
2886
|
this.#G(), this.#z(), this.#J(), this.#$();
|
|
2855
2887
|
return;
|
|
2856
2888
|
}
|
|
2857
|
-
e && this.#
|
|
2889
|
+
e && this.#ve(), this.#$(), this.#s.requestPhase(x.COLUMNS, "applyGridConfigUpdate");
|
|
2858
2890
|
}
|
|
2859
|
-
#
|
|
2860
|
-
const e = this.#
|
|
2891
|
+
#ve() {
|
|
2892
|
+
const e = this.#i.querySelector(".tbw-shell-header");
|
|
2861
2893
|
if (!e) return;
|
|
2862
|
-
const o = this.#
|
|
2894
|
+
const o = this.#n.shell?.header?.title ?? this.#e.lightDomTitle;
|
|
2863
2895
|
let n = e.querySelector(".tbw-shell-title");
|
|
2864
2896
|
o ? (n || (n = document.createElement("h2"), n.className = "tbw-shell-title", n.setAttribute("part", "shell-title"), e.insertBefore(n, e.firstChild)), n.textContent = o) : n && n.remove();
|
|
2865
2897
|
}
|
|
2866
|
-
#
|
|
2898
|
+
#Ce() {
|
|
2867
2899
|
if (this.#o) {
|
|
2868
2900
|
const e = this.#I.length > 0 ? this.#I : this._columns, o = e.filter((r) => !r.hidden), n = e.filter((r) => r.hidden), i = this.#o.processColumns([...o]);
|
|
2869
2901
|
if (i !== o) {
|
|
@@ -2874,21 +2906,21 @@ ${o}`;
|
|
|
2874
2906
|
this._columns = [...e];
|
|
2875
2907
|
}
|
|
2876
2908
|
}
|
|
2877
|
-
#
|
|
2878
|
-
|
|
2879
|
-
const e = Array.isArray(this.#
|
|
2909
|
+
#ye() {
|
|
2910
|
+
Y(this);
|
|
2911
|
+
const e = Array.isArray(this.#a) ? [...this.#a] : [], o = this.#o?.processRows(e) ?? e;
|
|
2880
2912
|
this._rows = o;
|
|
2881
2913
|
}
|
|
2882
|
-
#
|
|
2914
|
+
#_e(e) {
|
|
2883
2915
|
const o = {
|
|
2884
|
-
...
|
|
2916
|
+
...je,
|
|
2885
2917
|
...e.animation
|
|
2886
2918
|
}, n = o.mode ?? "reduced-motion";
|
|
2887
2919
|
let i = 1;
|
|
2888
2920
|
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;
|
|
2889
2921
|
}
|
|
2890
2922
|
#F(e, o, n = this.__rowRenderEpoch) {
|
|
2891
|
-
this.#
|
|
2923
|
+
this.#S || (this.#S = (i, r, s) => this.#o?.renderRow(i, r, s) ?? !1), gt(this, e, o, n, this.#S);
|
|
2892
2924
|
}
|
|
2893
2925
|
#U = -1;
|
|
2894
2926
|
#ne = -1;
|
|
@@ -2898,6 +2930,15 @@ ${o}`;
|
|
|
2898
2930
|
const n = this.#U;
|
|
2899
2931
|
this.#U = e, this.#ne = o, this.__rowsBodyEl && (this.__rowsBodyEl.setAttribute("aria-rowcount", String(e)), this.__rowsBodyEl.setAttribute("aria-colcount", String(o))), e !== n && this._bodyEl && (e > 0 ? this._bodyEl.setAttribute("role", "rowgroup") : this._bodyEl.removeAttribute("role"));
|
|
2900
2932
|
}
|
|
2933
|
+
#re;
|
|
2934
|
+
#se;
|
|
2935
|
+
#Ee() {
|
|
2936
|
+
if (!this.__rowsBodyEl) return;
|
|
2937
|
+
const e = this.#n.gridAriaLabel, o = this.#n.shell?.header?.title ?? this.#e?.lightDomTitle ?? void 0, n = e ?? o;
|
|
2938
|
+
n !== this.#re && (this.#re = n, n ? this.__rowsBodyEl.setAttribute("aria-label", n) : this.__rowsBodyEl.removeAttribute("aria-label"));
|
|
2939
|
+
const i = this.#n.gridAriaDescribedBy;
|
|
2940
|
+
i !== this.#se && (this.#se = i, i ? this.__rowsBodyEl.setAttribute("aria-describedby", i) : this.__rowsBodyEl.removeAttribute("aria-describedby"));
|
|
2941
|
+
}
|
|
2901
2942
|
#x() {
|
|
2902
2943
|
if (this.isConnected && !(!this._headerRowEl || !this._bodyEl)) {
|
|
2903
2944
|
if (this.#t.parseLightDomColumns(this), this.#L) {
|
|
@@ -2906,17 +2947,17 @@ ${o}`;
|
|
|
2906
2947
|
const o = this.#o?.getAll() ?? [];
|
|
2907
2948
|
this.#t.applyState(e, o);
|
|
2908
2949
|
}
|
|
2909
|
-
this._bodyEl && (this._bodyEl.style.display = "", this._bodyEl.style.gridTemplateColumns = ""), this.#
|
|
2950
|
+
this._bodyEl && (this._bodyEl.style.display = "", this._bodyEl.style.gridTemplateColumns = ""), this.#s.requestPhase(x.FULL, "setup");
|
|
2910
2951
|
}
|
|
2911
2952
|
}
|
|
2912
|
-
#
|
|
2913
|
-
if (this.refreshVirtualWindow(!1), this.#o?.onScrollRender(), this.#
|
|
2914
|
-
const o = this._virtualization.container, n = this.#
|
|
2953
|
+
#Se(e) {
|
|
2954
|
+
if (this.refreshVirtualWindow(!1), this.#o?.onScrollRender(), this.#m) {
|
|
2955
|
+
const o = this._virtualization.container, n = this.#ae;
|
|
2915
2956
|
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);
|
|
2916
2957
|
}
|
|
2917
2958
|
}
|
|
2918
2959
|
findHeaderRow() {
|
|
2919
|
-
return this.#
|
|
2960
|
+
return this.#i.querySelector(".header-row");
|
|
2920
2961
|
}
|
|
2921
2962
|
findRenderedRowElement(e) {
|
|
2922
2963
|
return Array.from(this._bodyEl.querySelectorAll(".data-grid-row")).find((o) => {
|
|
@@ -3008,16 +3049,16 @@ ${o}`;
|
|
|
3008
3049
|
return this.#o?.hasAfterRowRenderHook() ?? !1;
|
|
3009
3050
|
}
|
|
3010
3051
|
async ready() {
|
|
3011
|
-
return this.#
|
|
3052
|
+
return this.#d;
|
|
3012
3053
|
}
|
|
3013
3054
|
async forceLayout() {
|
|
3014
|
-
return this.#
|
|
3055
|
+
return this.#s.requestPhase(x.FULL, "forceLayout"), this.#s.whenReady();
|
|
3015
3056
|
}
|
|
3016
3057
|
async getConfig() {
|
|
3017
|
-
return Object.freeze({ ...this.#
|
|
3058
|
+
return Object.freeze({ ...this.#n || {} });
|
|
3018
3059
|
}
|
|
3019
3060
|
getRowId(e) {
|
|
3020
|
-
return this.#
|
|
3061
|
+
return this.#ge(e, this.#n.getRowId);
|
|
3021
3062
|
}
|
|
3022
3063
|
getRow(e) {
|
|
3023
3064
|
return this.#H.get(e)?.row;
|
|
@@ -3044,7 +3085,7 @@ ${o}`;
|
|
|
3044
3085
|
changes: o,
|
|
3045
3086
|
source: n
|
|
3046
3087
|
});
|
|
3047
|
-
l.length > 0 && this.#
|
|
3088
|
+
l.length > 0 && this.#s.requestPhase(x.ROWS, "updateRow");
|
|
3048
3089
|
}
|
|
3049
3090
|
updateRows(e, o = "api") {
|
|
3050
3091
|
let n = !1;
|
|
@@ -3069,16 +3110,16 @@ ${o}`;
|
|
|
3069
3110
|
}));
|
|
3070
3111
|
}
|
|
3071
3112
|
}
|
|
3072
|
-
n && this.#
|
|
3113
|
+
n && this.#s.requestPhase(x.ROWS, "updateRows");
|
|
3073
3114
|
}
|
|
3074
3115
|
animateRow(e, o) {
|
|
3075
|
-
|
|
3116
|
+
fe(this, e, o);
|
|
3076
3117
|
}
|
|
3077
3118
|
animateRows(e, o) {
|
|
3078
|
-
|
|
3119
|
+
Mt(this, e, o);
|
|
3079
3120
|
}
|
|
3080
3121
|
animateRowById(e, o) {
|
|
3081
|
-
return
|
|
3122
|
+
return zt(this, e, o);
|
|
3082
3123
|
}
|
|
3083
3124
|
setColumnVisible(e, o) {
|
|
3084
3125
|
const n = this.#t.setColumnVisible(e, o);
|
|
@@ -3108,12 +3149,12 @@ ${o}`;
|
|
|
3108
3149
|
return this.#t.collectState(e);
|
|
3109
3150
|
}
|
|
3110
3151
|
set columnState(e) {
|
|
3111
|
-
e && (this.#L = e, this.#t.initialColumnState = e, this.#
|
|
3152
|
+
e && (this.#L = e, this.#t.initialColumnState = e, this.#u && this.#Re(e));
|
|
3112
3153
|
}
|
|
3113
3154
|
get columnState() {
|
|
3114
3155
|
return this.getColumnState();
|
|
3115
3156
|
}
|
|
3116
|
-
#
|
|
3157
|
+
#Re(e) {
|
|
3117
3158
|
const o = this.#o?.getAll() ?? [];
|
|
3118
3159
|
this.#t.applyState(e, o), this.#x();
|
|
3119
3160
|
}
|
|
@@ -3127,95 +3168,95 @@ ${o}`;
|
|
|
3127
3168
|
this.#t.resetState(e), this.#t.merge(), this.#x();
|
|
3128
3169
|
}
|
|
3129
3170
|
get isToolPanelOpen() {
|
|
3130
|
-
return this.#
|
|
3171
|
+
return this.#c.isPanelOpen;
|
|
3131
3172
|
}
|
|
3132
3173
|
get expandedToolPanelSections() {
|
|
3133
|
-
return this.#
|
|
3174
|
+
return this.#c.expandedSections;
|
|
3134
3175
|
}
|
|
3135
3176
|
openToolPanel() {
|
|
3136
|
-
this.#
|
|
3177
|
+
this.#c.openToolPanel();
|
|
3137
3178
|
}
|
|
3138
3179
|
closeToolPanel() {
|
|
3139
|
-
this.#
|
|
3180
|
+
this.#c.closeToolPanel();
|
|
3140
3181
|
}
|
|
3141
3182
|
toggleToolPanel() {
|
|
3142
|
-
this.#
|
|
3183
|
+
this.#c.toggleToolPanel();
|
|
3143
3184
|
}
|
|
3144
3185
|
toggleToolPanelSection(e) {
|
|
3145
|
-
this.#
|
|
3186
|
+
this.#c.toggleToolPanelSection(e);
|
|
3146
3187
|
}
|
|
3147
3188
|
getToolPanels() {
|
|
3148
|
-
return this.#
|
|
3189
|
+
return this.#c.getToolPanels();
|
|
3149
3190
|
}
|
|
3150
3191
|
registerToolPanel(e) {
|
|
3151
|
-
this.#e.apiToolPanelIds.add(e.id), this.#
|
|
3192
|
+
this.#e.apiToolPanelIds.add(e.id), this.#c.registerToolPanel(e);
|
|
3152
3193
|
}
|
|
3153
3194
|
unregisterToolPanel(e) {
|
|
3154
|
-
this.#e.apiToolPanelIds.delete(e), this.#
|
|
3195
|
+
this.#e.apiToolPanelIds.delete(e), this.#c.unregisterToolPanel(e);
|
|
3155
3196
|
}
|
|
3156
3197
|
getHeaderContents() {
|
|
3157
|
-
return this.#
|
|
3198
|
+
return this.#c.getHeaderContents();
|
|
3158
3199
|
}
|
|
3159
3200
|
registerHeaderContent(e) {
|
|
3160
|
-
this.#
|
|
3201
|
+
this.#c.registerHeaderContent(e);
|
|
3161
3202
|
}
|
|
3162
3203
|
unregisterHeaderContent(e) {
|
|
3163
|
-
this.#
|
|
3204
|
+
this.#c.unregisterHeaderContent(e);
|
|
3164
3205
|
}
|
|
3165
3206
|
getToolbarContents() {
|
|
3166
|
-
return this.#
|
|
3207
|
+
return this.#c.getToolbarContents();
|
|
3167
3208
|
}
|
|
3168
3209
|
registerToolbarContent(e) {
|
|
3169
|
-
this.#
|
|
3210
|
+
this.#c.registerToolbarContent(e);
|
|
3170
3211
|
}
|
|
3171
3212
|
unregisterToolbarContent(e) {
|
|
3172
|
-
this.#
|
|
3213
|
+
this.#c.unregisterToolbarContent(e);
|
|
3173
3214
|
}
|
|
3174
3215
|
#V = !1;
|
|
3175
3216
|
refreshShellHeader() {
|
|
3176
3217
|
this.#V || (this.#V = !0, queueMicrotask(() => {
|
|
3177
|
-
this.#V = !1, this.isConnected && (I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#R()), this.#t.markSourcesChanged(), this.#t.merge(), this.#G(), this.#z(), this.#
|
|
3218
|
+
this.#V = !1, this.isConnected && (I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#R()), this.#t.markSourcesChanged(), this.#t.merge(), this.#G(), this.#z(), this.#Te());
|
|
3178
3219
|
}));
|
|
3179
3220
|
}
|
|
3180
|
-
#
|
|
3181
|
-
const o = this.#
|
|
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.#
|
|
3183
|
-
|
|
3184
|
-
const n = this.#
|
|
3221
|
+
#Te() {
|
|
3222
|
+
const o = this.#i.querySelector(".tbw-grid-content") ?? this.#i.querySelector(".tbw-grid-root");
|
|
3223
|
+
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.#c.isInitialized) {
|
|
3224
|
+
ce(this.#i, this.#e), Ae(this.#i, this.#n?.shell, this.#e);
|
|
3225
|
+
const n = this.#n?.shell?.toolPanel?.defaultOpen;
|
|
3185
3226
|
n && this.#e.toolPanels.has(n) && (this.openToolPanel(), this.#e.expandedSections.add(n));
|
|
3186
3227
|
}
|
|
3187
|
-
this._resizeController =
|
|
3228
|
+
this._resizeController = Re(this), this.#ee(o), this.#s.requestPhase(x.COLUMNS, "shellRefresh");
|
|
3188
3229
|
}
|
|
3189
|
-
#
|
|
3230
|
+
#E = /* @__PURE__ */ new Map();
|
|
3190
3231
|
registerStyles(e, o) {
|
|
3191
|
-
let n = this.#
|
|
3192
|
-
n || (n = new CSSStyleSheet(), this.#
|
|
3232
|
+
let n = this.#E.get(e);
|
|
3233
|
+
n || (n = new CSSStyleSheet(), this.#E.set(e, n)), n.replaceSync(o), this.#le();
|
|
3193
3234
|
}
|
|
3194
3235
|
unregisterStyles(e) {
|
|
3195
|
-
this.#
|
|
3236
|
+
this.#E.delete(e) && this.#le();
|
|
3196
3237
|
}
|
|
3197
3238
|
getRegisteredStyles() {
|
|
3198
|
-
return Array.from(this.#
|
|
3239
|
+
return Array.from(this.#E.keys());
|
|
3199
3240
|
}
|
|
3200
|
-
#
|
|
3201
|
-
const e = Array.from(this.#
|
|
3202
|
-
(n) => !Array.from(this.#
|
|
3241
|
+
#le() {
|
|
3242
|
+
const e = Array.from(this.#E.values()), o = document.adoptedStyleSheets.filter(
|
|
3243
|
+
(n) => !Array.from(this.#E.values()).includes(n)
|
|
3203
3244
|
);
|
|
3204
3245
|
document.adoptedStyleSheets = [...o, ...e];
|
|
3205
3246
|
}
|
|
3206
|
-
#
|
|
3247
|
+
#xe() {
|
|
3207
3248
|
const e = () => {
|
|
3208
3249
|
const n = this.#e.lightDomTitle, i = this.#e.hasToolButtonsContainer;
|
|
3209
3250
|
I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#R());
|
|
3210
3251
|
const r = this.#e.lightDomTitle, s = this.#e.hasToolButtonsContainer;
|
|
3211
3252
|
if (r && !n || s && !i) {
|
|
3212
3253
|
this.#t.markSourcesChanged(), this.#t.merge();
|
|
3213
|
-
const l = this.#
|
|
3254
|
+
const l = this.#i.querySelector(".tbw-shell-header");
|
|
3214
3255
|
if (l) {
|
|
3215
|
-
const c =
|
|
3216
|
-
this.#
|
|
3256
|
+
const c = xe(
|
|
3257
|
+
this.#n.shell,
|
|
3217
3258
|
this.#e,
|
|
3218
|
-
this.#
|
|
3259
|
+
this.#n.icons?.toolPanel
|
|
3219
3260
|
), a = document.createElement("div");
|
|
3220
3261
|
a.innerHTML = c;
|
|
3221
3262
|
const h = a.firstElementChild;
|
|
@@ -3228,25 +3269,25 @@ ${o}`;
|
|
|
3228
3269
|
this.#t.registerLightDomHandler("tbw-grid-header", e), this.#t.registerLightDomHandler("tbw-grid-tool-buttons", e), this.#t.registerLightDomHandler("tbw-grid-tool-panel", e), this.#t.registerLightDomHandler("tbw-grid-column", o), this.#t.registerLightDomHandler("tbw-grid-detail", o), this.#t.observeLightDOM(this);
|
|
3229
3270
|
}
|
|
3230
3271
|
refreshColumns() {
|
|
3231
|
-
this.__lightDomColumnsCache = void 0,
|
|
3272
|
+
this.__lightDomColumnsCache = void 0, Y(this), this.#t.parseLightDomColumns(this);
|
|
3232
3273
|
const e = this.#e.lightDomTitle, o = this.#e.hasToolButtonsContainer;
|
|
3233
3274
|
I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#R());
|
|
3234
3275
|
const n = this.#e.lightDomTitle, i = this.#e.hasToolButtonsContainer;
|
|
3235
3276
|
if (n && !e || i && !o) {
|
|
3236
3277
|
this.#t.markSourcesChanged(), this.#t.merge();
|
|
3237
|
-
const s = this.#
|
|
3278
|
+
const s = this.#i.querySelector(".tbw-shell-header");
|
|
3238
3279
|
if (s) {
|
|
3239
|
-
const l =
|
|
3240
|
-
this.#
|
|
3280
|
+
const l = xe(
|
|
3281
|
+
this.#n.shell,
|
|
3241
3282
|
this.#e,
|
|
3242
|
-
this.#
|
|
3283
|
+
this.#n.icons?.toolPanel
|
|
3243
3284
|
), c = document.createElement("div");
|
|
3244
3285
|
c.innerHTML = l;
|
|
3245
3286
|
const a = c.firstElementChild;
|
|
3246
3287
|
a && (s.replaceWith(a), this.#X());
|
|
3247
3288
|
}
|
|
3248
3289
|
}
|
|
3249
|
-
this.#
|
|
3290
|
+
this.#s.requestPhase(x.COLUMNS, "refreshColumns");
|
|
3250
3291
|
}
|
|
3251
3292
|
#B(e) {
|
|
3252
3293
|
const o = this._virtualization.rowHeight, n = this._virtualization.container ?? this, i = this._virtualization.viewportEl ?? n, r = n.clientHeight, s = i.clientHeight, c = this.shadowRoot?.querySelector(".tbw-scroll-area"), a = c ? c.clientHeight : r, u = a - s, p = this.#o?.getExtraHeight() ?? 0, f = Math.max(0, r - a);
|
|
@@ -3277,7 +3318,7 @@ ${o}`;
|
|
|
3277
3318
|
const f = Math.ceil(s / l) + 3;
|
|
3278
3319
|
let g = a + f;
|
|
3279
3320
|
if (g > n && (g = n), this._virtualization.start = a, this._virtualization.end = g, i.clientHeight === 0 && s > 0) {
|
|
3280
|
-
this.#
|
|
3321
|
+
this.#s.requestPhase(x.VIRTUALIZATION, "stale-refs-retry");
|
|
3281
3322
|
return;
|
|
3282
3323
|
}
|
|
3283
3324
|
const w = this.#B(n);
|
|
@@ -3292,33 +3333,33 @@ ${o}`;
|
|
|
3292
3333
|
}
|
|
3293
3334
|
#G() {
|
|
3294
3335
|
I(this, this.#e), q(this, this.#e), W(this, this.#e, this.#R()), this.#t.markSourcesChanged(), this.#t.merge();
|
|
3295
|
-
const e = this.#
|
|
3296
|
-
|
|
3297
|
-
this.#
|
|
3336
|
+
const e = this.#n?.shell;
|
|
3337
|
+
Bt(
|
|
3338
|
+
this.#i,
|
|
3298
3339
|
e,
|
|
3299
3340
|
{ isPanelOpen: this.#e.isPanelOpen, expandedSections: this.#e.expandedSections },
|
|
3300
|
-
this.#
|
|
3301
|
-
) && (this.#X(), this.#
|
|
3341
|
+
this.#n?.icons
|
|
3342
|
+
) && (this.#X(), this.#c.setInitialized(!0));
|
|
3302
3343
|
}
|
|
3303
3344
|
#X() {
|
|
3304
|
-
|
|
3345
|
+
qt(this.#i, this.#n?.shell, this.#e, {
|
|
3305
3346
|
onPanelToggle: () => this.toggleToolPanel(),
|
|
3306
3347
|
onSectionToggle: (e) => this.toggleToolPanelSection(e)
|
|
3307
|
-
}), this.#D?.(), this.#D =
|
|
3348
|
+
}), this.#D?.(), this.#D = Wt(this.#i, this.#n?.shell, (e) => {
|
|
3308
3349
|
this.style.setProperty("--tbw-tool-panel-width", `${e}px`);
|
|
3309
3350
|
});
|
|
3310
3351
|
}
|
|
3311
3352
|
}
|
|
3312
|
-
customElements.get(
|
|
3313
|
-
globalThis.DataGridElement =
|
|
3314
|
-
const
|
|
3353
|
+
customElements.get(L.tagName) || customElements.define(L.tagName, L);
|
|
3354
|
+
globalThis.DataGridElement = L;
|
|
3355
|
+
const ao = {
|
|
3315
3356
|
CAN_MOVE_COLUMN: "canMoveColumn",
|
|
3316
3357
|
GET_CONTEXT_MENU_ITEMS: "getContextMenuItems"
|
|
3317
3358
|
};
|
|
3318
|
-
class
|
|
3359
|
+
class co {
|
|
3319
3360
|
static dependencies;
|
|
3320
3361
|
static manifest;
|
|
3321
|
-
version = "1.
|
|
3362
|
+
version = "1.4.0";
|
|
3322
3363
|
styles;
|
|
3323
3364
|
cellRenderers;
|
|
3324
3365
|
headerRenderers;
|
|
@@ -3326,7 +3367,7 @@ class ro {
|
|
|
3326
3367
|
grid;
|
|
3327
3368
|
config;
|
|
3328
3369
|
userConfig;
|
|
3329
|
-
#
|
|
3370
|
+
#l;
|
|
3330
3371
|
get defaultConfig() {
|
|
3331
3372
|
return {};
|
|
3332
3373
|
}
|
|
@@ -3334,10 +3375,10 @@ class ro {
|
|
|
3334
3375
|
this.userConfig = e;
|
|
3335
3376
|
}
|
|
3336
3377
|
attach(e) {
|
|
3337
|
-
this.#
|
|
3378
|
+
this.#l?.abort(), this.#l = new AbortController(), this.grid = e, this.config = { ...this.defaultConfig, ...this.userConfig };
|
|
3338
3379
|
}
|
|
3339
3380
|
detach() {
|
|
3340
|
-
this.#
|
|
3381
|
+
this.#l?.abort(), this.#l = void 0;
|
|
3341
3382
|
}
|
|
3342
3383
|
getPlugin(e) {
|
|
3343
3384
|
return this.grid?.getPlugin(e);
|
|
@@ -3374,7 +3415,7 @@ class ro {
|
|
|
3374
3415
|
return this.grid;
|
|
3375
3416
|
}
|
|
3376
3417
|
get disconnectSignal() {
|
|
3377
|
-
return this.#
|
|
3418
|
+
return this.#l?.signal ?? this.grid?.disconnectSignal;
|
|
3378
3419
|
}
|
|
3379
3420
|
get gridIcons() {
|
|
3380
3421
|
const e = this.grid?.gridConfig?.icons ?? {};
|
|
@@ -3438,14 +3479,14 @@ const A = {
|
|
|
3438
3479
|
GROUP_COUNT: "group-count",
|
|
3439
3480
|
RANGE_SELECTION: "range-selection",
|
|
3440
3481
|
SELECTION_OVERLAY: "selection-overlay"
|
|
3441
|
-
},
|
|
3482
|
+
}, Q = {
|
|
3442
3483
|
ROW_INDEX: "data-row-index",
|
|
3443
3484
|
COL_INDEX: "data-col-index",
|
|
3444
3485
|
FIELD: "data-field",
|
|
3445
3486
|
GROUP_KEY: "data-group-key",
|
|
3446
3487
|
TREE_LEVEL: "data-tree-level",
|
|
3447
3488
|
STICKY: "data-sticky"
|
|
3448
|
-
},
|
|
3489
|
+
}, ho = {
|
|
3449
3490
|
ROOT: `.${A.ROOT}`,
|
|
3450
3491
|
HEADER: `.${A.HEADER}`,
|
|
3451
3492
|
HEADER_ROW: `.${A.HEADER_ROW}`,
|
|
@@ -3455,12 +3496,12 @@ const A = {
|
|
|
3455
3496
|
DATA_ROW: `.${A.DATA_ROW}`,
|
|
3456
3497
|
DATA_CELL: `.${A.DATA_CELL}`,
|
|
3457
3498
|
GROUP_ROW: `.${A.GROUP_ROW}`,
|
|
3458
|
-
ROW_BY_INDEX: (t) => `.${A.DATA_ROW}[${
|
|
3459
|
-
CELL_BY_FIELD: (t) => `.${A.DATA_CELL}[${
|
|
3460
|
-
CELL_AT: (t, e) => `.${A.DATA_ROW}[${
|
|
3499
|
+
ROW_BY_INDEX: (t) => `.${A.DATA_ROW}[${Q.ROW_INDEX}="${t}"]`,
|
|
3500
|
+
CELL_BY_FIELD: (t) => `.${A.DATA_CELL}[${Q.FIELD}="${t}"]`,
|
|
3501
|
+
CELL_AT: (t, e) => `.${A.DATA_ROW}[${Q.ROW_INDEX}="${t}"] .${A.DATA_CELL}[${Q.COL_INDEX}="${e}"]`,
|
|
3461
3502
|
SELECTED_ROWS: `.${A.DATA_ROW}.${A.SELECTED}`,
|
|
3462
3503
|
EDITING_CELL: `.${A.DATA_CELL}.${A.EDITING}`
|
|
3463
|
-
},
|
|
3504
|
+
}, uo = {
|
|
3464
3505
|
COLOR_BG: "--tbw-color-bg",
|
|
3465
3506
|
COLOR_FG: "--tbw-color-fg",
|
|
3466
3507
|
COLOR_FG_MUTED: "--tbw-color-fg-muted",
|
|
@@ -3479,14 +3520,14 @@ const A = {
|
|
|
3479
3520
|
BORDER_RADIUS: "--tbw-border-radius",
|
|
3480
3521
|
FOCUS_OUTLINE: "--tbw-focus-outline"
|
|
3481
3522
|
};
|
|
3482
|
-
function
|
|
3523
|
+
function fo(t) {
|
|
3483
3524
|
const e = document.createElement("tbw-grid");
|
|
3484
3525
|
return t && (e.gridConfig = t), e;
|
|
3485
3526
|
}
|
|
3486
|
-
function
|
|
3527
|
+
function po(t, e = document) {
|
|
3487
3528
|
return e.querySelector(t);
|
|
3488
3529
|
}
|
|
3489
|
-
const
|
|
3530
|
+
const go = {
|
|
3490
3531
|
CELL_CHANGE: "cell-change",
|
|
3491
3532
|
CELL_COMMIT: "cell-commit",
|
|
3492
3533
|
ROW_COMMIT: "row-commit",
|
|
@@ -3499,7 +3540,7 @@ const ho = {
|
|
|
3499
3540
|
CELL_ACTIVATE: "cell-activate",
|
|
3500
3541
|
GROUP_TOGGLE: "group-toggle",
|
|
3501
3542
|
COLUMN_STATE_CHANGE: "column-state-change"
|
|
3502
|
-
},
|
|
3543
|
+
}, wo = {
|
|
3503
3544
|
SELECTION_CHANGE: "selection-change",
|
|
3504
3545
|
TREE_EXPAND: "tree-expand",
|
|
3505
3546
|
FILTER_CHANGE: "filter-change",
|
|
@@ -3517,7 +3558,7 @@ const ho = {
|
|
|
3517
3558
|
COLUMN_REORDER: "column-reorder",
|
|
3518
3559
|
DETAIL_EXPAND: "detail-expand",
|
|
3519
3560
|
GROUP_EXPAND: "group-expand"
|
|
3520
|
-
},
|
|
3561
|
+
}, ae = {
|
|
3521
3562
|
sum: (t, e) => t.reduce((o, n) => o + (Number(n[e]) || 0), 0),
|
|
3522
3563
|
avg: (t, e) => {
|
|
3523
3564
|
const o = t.reduce((n, i) => n + (Number(i[e]) || 0), 0);
|
|
@@ -3528,28 +3569,28 @@ const ho = {
|
|
|
3528
3569
|
max: (t, e) => Math.max(...t.map((o) => Number(o[e]) || -1 / 0)),
|
|
3529
3570
|
first: (t, e) => t[0]?.[e],
|
|
3530
3571
|
last: (t, e) => t[t.length - 1]?.[e]
|
|
3531
|
-
},
|
|
3572
|
+
}, U = /* @__PURE__ */ new Map(), M = {
|
|
3532
3573
|
register(t, e) {
|
|
3533
|
-
|
|
3574
|
+
U.set(t, e);
|
|
3534
3575
|
},
|
|
3535
3576
|
unregister(t) {
|
|
3536
|
-
|
|
3577
|
+
U.delete(t);
|
|
3537
3578
|
},
|
|
3538
3579
|
get(t) {
|
|
3539
3580
|
if (t !== void 0)
|
|
3540
|
-
return typeof t == "function" ? t :
|
|
3581
|
+
return typeof t == "function" ? t : U.get(t) ?? ae[t];
|
|
3541
3582
|
},
|
|
3542
3583
|
run(t, e, o, n) {
|
|
3543
3584
|
const i = this.get(t);
|
|
3544
3585
|
return i ? i(e, o, n) : void 0;
|
|
3545
3586
|
},
|
|
3546
3587
|
has(t) {
|
|
3547
|
-
return
|
|
3588
|
+
return U.has(t) || t in ae;
|
|
3548
3589
|
},
|
|
3549
3590
|
list() {
|
|
3550
|
-
return [...Object.keys(
|
|
3591
|
+
return [...Object.keys(ae), ...U.keys()];
|
|
3551
3592
|
}
|
|
3552
|
-
},
|
|
3593
|
+
}, Oe = {
|
|
3553
3594
|
sum: (t) => t.reduce((e, o) => e + o, 0),
|
|
3554
3595
|
avg: (t) => t.length ? t.reduce((e, o) => e + o, 0) / t.length : 0,
|
|
3555
3596
|
count: (t) => t.length,
|
|
@@ -3558,46 +3599,46 @@ const ho = {
|
|
|
3558
3599
|
first: (t) => t[0] ?? 0,
|
|
3559
3600
|
last: (t) => t[t.length - 1] ?? 0
|
|
3560
3601
|
};
|
|
3561
|
-
function
|
|
3562
|
-
return
|
|
3602
|
+
function lo(t) {
|
|
3603
|
+
return Oe[t] ?? Oe.sum;
|
|
3563
3604
|
}
|
|
3564
|
-
function
|
|
3565
|
-
return
|
|
3605
|
+
function mo(t, e) {
|
|
3606
|
+
return lo(t)(e);
|
|
3566
3607
|
}
|
|
3567
|
-
const
|
|
3608
|
+
const bo = M.register.bind(M), vo = M.unregister.bind(M), Co = M.get.bind(M), yo = M.run.bind(M), _o = M.list.bind(M);
|
|
3568
3609
|
export {
|
|
3569
|
-
|
|
3570
|
-
|
|
3610
|
+
co as BaseGridPlugin,
|
|
3611
|
+
je as DEFAULT_ANIMATION_CONFIG,
|
|
3571
3612
|
z as DEFAULT_GRID_ICONS,
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3613
|
+
go as DGEvents,
|
|
3614
|
+
L as DataGridElement,
|
|
3615
|
+
G as FitModeEnum,
|
|
3616
|
+
uo as GridCSSVars,
|
|
3576
3617
|
A as GridClasses,
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3618
|
+
Q as GridDataAttrs,
|
|
3619
|
+
L as GridElement,
|
|
3620
|
+
ho as GridSelectors,
|
|
3621
|
+
ao as PLUGIN_QUERIES,
|
|
3622
|
+
wo as PluginEvents,
|
|
3623
|
+
so as PluginManager,
|
|
3583
3624
|
x as RenderPhase,
|
|
3584
|
-
|
|
3625
|
+
Dt as a,
|
|
3585
3626
|
M as aggregatorRegistry,
|
|
3586
3627
|
$ as b,
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3628
|
+
St as builtInSort,
|
|
3629
|
+
he as c,
|
|
3630
|
+
fo as createGrid,
|
|
3631
|
+
Et as defaultComparator,
|
|
3632
|
+
Me as e,
|
|
3633
|
+
ke as g,
|
|
3634
|
+
Co as getAggregator,
|
|
3635
|
+
lo as getValueAggregator,
|
|
3636
|
+
_o as listAggregators,
|
|
3637
|
+
po as queryGrid,
|
|
3638
|
+
bo as registerAggregator,
|
|
3639
|
+
yo as runAggregator,
|
|
3640
|
+
mo as runValueAggregator,
|
|
3641
|
+
F as s,
|
|
3642
|
+
vo as unregisterAggregator
|
|
3602
3643
|
};
|
|
3603
3644
|
//# sourceMappingURL=index.js.map
|