@keenmate/web-grid 1.0.0-rc04 → 1.0.0-rc05
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -1
- package/component-variables.manifest.json +1 -0
- package/dist/grid.d.ts +3 -0
- package/dist/modules/toolbar/index.d.ts +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/web-component.d.ts +2 -0
- package/dist/web-grid.js +677 -633
- package/dist/web-grid.umd.js +45 -45
- package/package.json +1 -1
- package/src/css/_variables.css +1 -1
package/dist/web-grid.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var w = (t, e, o) =>
|
|
4
|
-
class
|
|
1
|
+
var Ne = Object.defineProperty;
|
|
2
|
+
var Ue = (t, e, o) => e in t ? Ne(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
|
|
3
|
+
var w = (t, e, o) => Ue(t, typeof e != "symbol" ? e + "" : e, o);
|
|
4
|
+
class je {
|
|
5
5
|
constructor() {
|
|
6
6
|
// ==========================================================================
|
|
7
7
|
// Configuration Props
|
|
@@ -30,6 +30,7 @@ class Ue {
|
|
|
30
30
|
w(this, "_toolbarAlign", "center");
|
|
31
31
|
w(this, "_toolbarTopPosition", "center");
|
|
32
32
|
w(this, "_toolbarTrigger", "hover");
|
|
33
|
+
w(this, "_toolbarPosition", "auto");
|
|
33
34
|
w(this, "_contextMenu");
|
|
34
35
|
// ==========================================================================
|
|
35
36
|
// Callbacks
|
|
@@ -254,7 +255,7 @@ class Ue {
|
|
|
254
255
|
return this._toolbarTopPosition;
|
|
255
256
|
}
|
|
256
257
|
set toolbarTopPosition(e) {
|
|
257
|
-
this._toolbarTopPosition = e;
|
|
258
|
+
this._toolbarTopPosition = e, this.requestUpdate();
|
|
258
259
|
}
|
|
259
260
|
get toolbarTrigger() {
|
|
260
261
|
return this._toolbarTrigger;
|
|
@@ -262,6 +263,12 @@ class Ue {
|
|
|
262
263
|
set toolbarTrigger(e) {
|
|
263
264
|
this._toolbarTrigger = e, this.requestUpdate();
|
|
264
265
|
}
|
|
266
|
+
get toolbarPosition() {
|
|
267
|
+
return this._toolbarPosition;
|
|
268
|
+
}
|
|
269
|
+
set toolbarPosition(e) {
|
|
270
|
+
this._toolbarPosition = e, this.requestUpdate();
|
|
271
|
+
}
|
|
265
272
|
get contextMenu() {
|
|
266
273
|
return this._contextMenu;
|
|
267
274
|
}
|
|
@@ -741,12 +748,12 @@ class Ue {
|
|
|
741
748
|
this._focusedCell = null;
|
|
742
749
|
}
|
|
743
750
|
}
|
|
744
|
-
const je = ':host{--wg-rem: 10px;font-family:var(--wg-font-family, var(--base-font-family, system-ui, -apple-system, sans-serif));display:block;--wg-accent-color: var(--base-accent-color, #0078d4);--wg-accent-color-hover: var(--base-accent-color-hover, #106ebe);--wg-accent-color-active: var(--base-accent-color-active, #005a9e);--wg-accent-color-light: var(--base-accent-color-light, #e6f2ff);--wg-text-color-1: var(--base-text-color-1, #242424);--wg-text-color-2: var(--base-text-color-2, #424242);--wg-text-color-3: var(--base-text-color-3, #707070);--wg-text-on-accent: var(--base-text-color-on-accent, #ffffff);--wg-surface-1: var(--base-main-bg, #ffffff);--wg-surface-2: var(--base-elevated-bg, #f5f5f5);--wg-surface-3: var(--base-hover-bg, #ebebeb);--wg-surface-floating: var(--base-dropdown-bg, var(--base-main-bg, #ffffff));--wg-border-color: var(--base-border-color, #e0e0e0);--wg-border-color-hover: var(--base-border-color, #d1d1d1);--wg-input-bg: var(--base-input-bg, #ffffff);--wg-input-color: var(--base-input-color, var(--wg-text-color-1));--wg-input-border: var(--base-input-border, 1px solid #d1d1d1);--wg-input-border-hover: var(--base-input-border-hover, 1px solid #0078d4);--wg-input-border-focus: var(--base-input-border-focus, 1px solid #0078d4);--wg-input-placeholder-color: var(--base-input-placeholder-color, #707070);--wg-danger-color: var(--base-danger-color, #d13438);--wg-danger-bg-light: var(--base-danger-bg-light, #fde7e9);--wg-hover-bg: var(--base-hover-bg, #f0f0f0);--wg-active-bg: var(--base-hover-bg, #e0e0e0);--wg-font-size-base: calc(var(--base-font-size-base, 1.4) * var(--wg-rem));--wg-font-size-sm: calc(var(--base-font-size-sm, 1.2) * var(--wg-rem));--wg-font-size-xs: calc(var(--base-font-size-xs, 1.1) * var(--wg-rem));--wg-font-size-lg: calc(var(--base-font-size-lg, 1.6) * var(--wg-rem));--wg-line-height-base: calc(var(--base-line-height-normal, 2) * var(--wg-rem));--wg-font-weight-normal: var(--base-font-weight-normal, 400);--wg-font-weight-semibold: var(--base-font-weight-semibold, 600);--wg-border-radius-sm: calc(var(--base-border-radius-sm, .4) * var(--wg-rem));--wg-border-radius-md: calc(var(--base-border-radius-md, .6) * var(--wg-rem));--wg-border-radius-lg: calc(var(--base-border-radius-lg, .8) * var(--wg-rem));--wg-spacing-xs: calc(.4 * var(--wg-rem));--wg-spacing-sm: calc(.8 * var(--wg-rem));--wg-spacing-md: calc(1.2 * var(--wg-rem));--wg-spacing-lg: calc(1.6 * var(--wg-rem));--wg-spacing-xl: calc(2.4 * var(--wg-rem));--wg-table-bg: var(--wg-surface-1);--wg-table-border: 1px solid var(--wg-border-color);--wg-header-bg: var(--wg-surface-2);--wg-header-bg-hover: var(--wg-surface-3);--wg-header-bg-sorted: var(--wg-surface-3);--wg-header-color: var(--wg-text-color-1);--wg-header-border: 2px solid var(--wg-border-color);--wg-header-padding: var(--wg-spacing-sm) var(--wg-spacing-md);--wg-header-font-weight: var(--wg-font-weight-semibold);--wg-cell-padding: var(--wg-spacing-sm) var(--wg-spacing-md);--wg-cell-color: var(--wg-text-color-1);--wg-cell-border: 1px solid var(--wg-border-color);--wg-cell-bg-hover: var(--wg-hover-bg);--wg-cell-bg-editing: var(--wg-surface-1);--wg-cell-readonly-bg: var(--wg-surface-2);--wg-row-border: 1px solid var(--wg-border-color);--wg-row-bg-even: var(--wg-surface-2);--wg-row-bg-hover: var(--wg-surface-3);--wg-filter-bg: var(--wg-surface-1);--wg-filter-border: 1px solid var(--wg-border-color);--wg-filter-padding: var(--wg-spacing-xs) var(--wg-spacing-sm);--wg-filter-input-padding: calc(.4 * var(--wg-rem)) calc(.8 * var(--wg-rem));--wg-filter-input-bg: var(--wg-input-bg);--wg-filter-input-border: var(--wg-input-border);--wg-filter-input-border-focus: var(--wg-input-border-focus);--wg-filter-input-border-radius: var(--wg-border-radius-sm);--wg-filter-input-font-size: var(--wg-font-size-sm);--wg-sort-indicator-size: calc(1.4 * var(--wg-rem));--wg-sort-indicator-opacity: .9;--wg-sort-placeholder-opacity: .3;--wg-sort-priority-size: calc(1.1 * var(--wg-rem));--wg-pagination-padding: var(--wg-spacing-md);--wg-pagination-gap: calc(1.6 * var(--wg-rem));--wg-pagination-bg: var(--wg-surface-1);--wg-pagination-border: 1px solid var(--wg-border-color);--wg-pagination-btn-padding: calc(.6 * var(--wg-rem)) calc(1.6 * var(--wg-rem));--wg-pagination-btn-bg: var(--wg-surface-1);--wg-pagination-btn-bg-hover: var(--wg-surface-2);--wg-pagination-btn-bg-active: var(--wg-surface-3);--wg-pagination-btn-border: 1px solid var(--wg-border-color);--wg-pagination-btn-border-hover: 1px solid var(--wg-border-color-hover);--wg-pagination-btn-border-radius: var(--wg-border-radius-sm);--wg-pagination-btn-disabled-opacity: .4;--wg-empty-padding: var(--wg-spacing-xl);--wg-empty-color: var(--wg-text-color-3);--wg-error-cell-bg: var(--wg-danger-bg-light);--wg-error-cell-border: 1px solid var(--wg-danger-color);--wg-error-message-color: var(--wg-danger-color);--wg-error-message-font-size: var(--wg-font-size-xs);--wg-error-indicator-color: var(--wg-danger-color);--wg-editor-bg: var(--wg-surface-1);--wg-editor-outline: 2px solid var(--wg-accent-color);--wg-editor-outline-offset: -2px;--wg-editor-validating-opacity: .7;--wg-dropdown-toggle-right: var(--wg-spacing-md);--wg-dropdown-toggle-size: calc(1.2 * var(--wg-rem));--wg-dropdown-toggle-hitbox: calc(2.4 * var(--wg-rem));--wg-toolbar-bg: var(--wg-surface-floating);--wg-toolbar-border: 1px solid var(--wg-border-color);--wg-toolbar-border-radius: var(--wg-border-radius-sm);--wg-toolbar-shadow: var(--base-dropdown-box-shadow, 0 2px 8px rgba(0, 0, 0, .15));--wg-toolbar-divider-color: var(--wg-border-color);--wg-toolbar-btn-min-width: calc(2.4 * var(--wg-rem));--wg-toolbar-btn-padding: 0 calc(.4 * var(--wg-rem));--wg-toolbar-btn-border-radius: var(--wg-border-radius-sm);--wg-toolbar-btn-bg-hover: var(--wg-hover-bg);--wg-toolbar-btn-bg-active: var(--wg-active-bg);--wg-toolbar-btn-color: var(--wg-text-color-1);--wg-toolbar-trigger-color: var(--wg-text-color-3);--wg-toolbar-trigger-color-hover: var(--wg-text-color-1);--wg-toolbar-trigger-bg-hover: var(--wg-hover-bg);--wg-tooltip-bg: var(--base-tooltip-bg, #333);--wg-context-menu-z-index: 1001;--wg-context-menu-min-width: calc(16 * var(--wg-rem));--wg-focus-outline: 2px solid var(--wg-accent-color);--wg-focus-outline-offset: -2px;--wg-focus-bg: var(--wg-hover-bg);--wg-transition-fast: .1s ease;--wg-transition-normal: .15s ease;--wg-z-dropdown: 9999;--wg-z-toolbar: 1000;--wg-z-context-menu: 1001}web-grid:not(:defined){display:block;min-height:calc(10 * var(--wg-rem));color:transparent!important;background:transparent}.wg{position:relative;width:100%;max-height:inherit;overflow:auto;overscroll-behavior:contain;border:var(--wg-table-border)}.wg__table{width:max-content;min-width:100%;border-collapse:collapse;table-layout:fixed;background:var(--wg-table-bg);font-size:var(--wg-font-size-base);line-height:var(--wg-line-height-base)}.wg__table tbody tr{border-bottom:var(--wg-row-border)}.wg__row-number-header,.wg__row-number{width:40px;min-width:40px;max-width:40px;text-align:center;color:var(--wg-text-color-secondary);background:var(--wg-header-bg);-webkit-user-select:none;user-select:none;font-size:var(--wg-font-size-sm)}.wg__row-number{border-right:var(--wg-cell-border)}.wg__actions-column{width:32px;min-width:32px;max-width:32px;padding:0!important;text-align:center}thead .wg__actions-column{background:var(--wg-header-bg);border-bottom:var(--wg-header-border)}.wg__filter-row .wg__actions-column{background:var(--wg-filter-bg);border-bottom:var(--wg-filter-border)}.wg__header{position:sticky;top:0;z-index:1;background:var(--wg-header-bg);color:var(--wg-header-color);font-weight:var(--wg-header-font-weight);padding:var(--wg-header-padding);border-bottom:var(--wg-header-border);text-align:left;-webkit-user-select:none;user-select:none}.wg__header--sortable{cursor:pointer}.wg__header--sortable:hover{background:var(--wg-header-bg-hover)}.wg__header--sorted{background:var(--wg-header-bg-sorted)}.wg__header-content{display:flex;align-items:center;gap:4px;justify-content:space-between}.wg__header-title{flex:1}.wg__sort-indicator{font-size:var(--wg-sort-indicator-size);opacity:var(--wg-sort-indicator-opacity);min-width:16px;text-align:center;display:inline-flex;align-items:center}.wg__sort-placeholder{opacity:var(--wg-sort-placeholder-opacity)}.wg__sort-priority{font-size:var(--wg-sort-priority-size);font-weight:600;margin-left:2px;vertical-align:super;line-height:1}.wg__header-info{display:inline-flex;align-items:center;color:var(--wg-accent-color);cursor:help;opacity:.7;margin-left:4px;vertical-align:middle}.wg__header-info:hover{opacity:1}.wg__filter-row th{padding:var(--wg-filter-padding);background:var(--wg-filter-bg);border-bottom:var(--wg-filter-border)}.wg__filter-input{width:100%;padding:var(--wg-filter-input-padding);border:var(--wg-filter-input-border);border-radius:var(--wg-filter-input-border-radius);background:var(--wg-surface-1);color:var(--wg-text-color-1);font-size:var(--wg-filter-input-font-size);box-sizing:border-box}.wg__filter-input:focus{outline:none;border:var(--wg-filter-input-border-focus);box-shadow:0 0 0 1px var(--wg-accent-color)}.wg__cell{padding:var(--wg-cell-padding);color:var(--wg-cell-color);scroll-margin-top:3rem;scroll-margin-bottom:.5rem}.wg__cell-text{-webkit-user-select:none;user-select:none}.wg__cell--ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wg__cell--editable{cursor:pointer;position:relative}.wg__cell--editable:hover{background:var(--wg-cell-bg-hover)}.wg__cell--editable:hover:after{content:"";position:absolute;top:2px;right:2px;bottom:2px;left:2px;border:1px dashed var(--wg-border-color);border-radius:2px;pointer-events:none}.wg__cell--editing{position:relative;background:var(--wg-surface-1);outline:2px solid var(--wg-accent-color);outline-offset:-2px}.wg__cell--editing:after{display:none}.wg__cell--invalid{background:var(--wg-danger-bg-light, #fee);box-shadow:inset 0 0 0 2px var(--wg-danger-color, #c00)}.wg--navigate-mode .wg__cell:not(.wg__cell--editable){background:var(--wg-cell-readonly-bg, #f5f5f5)}.wg__editor{position:absolute;top:0;left:0;right:0;width:100%;padding:var(--wg-cell-padding);border:none;background:transparent;color:var(--wg-text-color-1);font-size:var(--wg-font-size-base);font-family:inherit;line-height:inherit;box-sizing:border-box}.wg__editor:focus,.wg__editor:focus-visible{outline:none;box-shadow:none}.wg__editor--text{text-align:inherit}.wg__editor--number{text-align:right}.wg__editor--date{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;background:var(--wg-editor-bg)}.wg__date-input{flex:1;min-width:0;height:100%;border:none;background:transparent;font:inherit;padding:var(--wg-cell-padding-block) var(--wg-cell-padding-inline);outline:none;color:inherit}.wg__date-trigger{width:var(--wg-date-trigger-size, 28px);height:100%;display:flex;align-items:center;justify-content:center;border:none;background:transparent;color:var(--wg-text-secondary, #666);cursor:pointer;padding:0;flex-shrink:0}.wg__date-trigger:hover{color:var(--wg-accent-color, #0078d4);background:var(--wg-hover-bg, rgba(0, 0, 0, .05))}.wg__editor--checkbox{width:auto;height:auto;margin:0 auto}.wg__editor--custom{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;background:var(--wg-editor-bg);padding:var(--wg-cell-padding-block) var(--wg-cell-padding-inline);cursor:pointer}.wg__editor--custom:focus{outline:none}.wg__custom-value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;cursor:pointer}.wg__editor--combobox,.wg__editor--autocomplete{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;padding:var(--wg-cell-padding);padding-right:0;background:transparent;box-sizing:border-box}.wg__combobox-input,.wg__autocomplete-input{flex:1;width:100%;height:100%;padding:0 24px 0 0;border:none;background:transparent;color:var(--wg-text-color-1);font-size:var(--wg-font-size-base);font-family:inherit;line-height:var(--wg-line-height-base);outline:none;box-sizing:border-box;margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.wg__combobox-input:focus,.wg__autocomplete-input:focus{outline:none}.wg__combobox-toggle{position:absolute;right:var(--wg-dropdown-toggle-right);top:50%;transform:translateY(-50%);font-size:var(--wg-dropdown-toggle-size);color:var(--wg-text-color-2);pointer-events:auto;cursor:pointer}.wg__combobox-toggle:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--wg-dropdown-toggle-hitbox);height:48px}.wg__loading-indicator{position:absolute;right:var(--wg-dropdown-toggle-right);top:50%;transform:translateY(-50%);font-size:12px;animation:wg-pulse 1s infinite}@keyframes wg-pulse{0%,to{opacity:1}50%{opacity:.4}}.wg__select-trigger{display:flex;align-items:center;justify-content:space-between;cursor:pointer;background:transparent}.wg__select-trigger:focus,.wg__select-trigger:focus-visible{outline:none;box-shadow:none}.wg__select-value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wg__select-toggle{position:relative;font-size:var(--wg-dropdown-toggle-size);opacity:.6;margin-left:4px;flex-shrink:0;pointer-events:auto;cursor:pointer}.wg__select-toggle:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--wg-dropdown-toggle-hitbox);height:48px}.wg__cell-dropdown-display{display:flex;align-items:center;justify-content:space-between;width:100%;cursor:pointer}.wg__cell-dropdown-display--toggle-on-focus .wg__select-toggle{opacity:0}.wg__cell:hover .wg__cell-dropdown-display--toggle-on-focus .wg__select-toggle,.wg__cell--focused .wg__cell-dropdown-display--toggle-on-focus .wg__select-toggle{opacity:.6}.wg__cell-date-display{display:flex;align-items:center;justify-content:space-between;width:100%;cursor:pointer}.wg__cell-date-display .wg__date-trigger{position:relative;background:none;border:none;padding:0;margin:0;cursor:pointer;opacity:.6;display:flex;align-items:center;justify-content:center;color:inherit}.wg__cell-date-display .wg__date-trigger:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--wg-dropdown-toggle-hitbox);height:48px}.wg__cell-date-display--toggle-on-focus .wg__date-trigger{opacity:0}.wg__cell:hover .wg__cell-date-display--toggle-on-focus .wg__date-trigger,.wg__cell--focused .wg__cell-date-display--toggle-on-focus .wg__date-trigger{opacity:.6}.wg__dropdown{background:var(--wg-surface-floating, #fff);border:1px solid var(--wg-border-color, #d1d1d1);border-radius:4px;box-shadow:var(--wg-toolbar-shadow);max-height:200px;overflow-y:auto;font-size:var(--wg-font-size-base);font-family:inherit;line-height:var(--wg-line-height-base)}.wg__dropdown-option{display:flex;align-items:center;gap:var(--wg-spacing-sm);padding:6px 12px;cursor:pointer;color:var(--wg-text-color-1)}.wg__dropdown-option:hover,.wg__dropdown-option--highlighted{background:var(--wg-hover-bg, #f0f0f0)}.wg__dropdown-option--selected{background:var(--wg-accent-color-light, #e6f2ff)}.wg__dropdown-option--disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.wg__dropdown-option-icon{flex-shrink:0;width:1.5em;text-align:center}.wg__dropdown-option-content{flex:1;min-width:0;overflow:hidden}.wg__dropdown-option-label{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wg__dropdown-option-subtitle{display:block;font-size:var(--wg-font-size-sm);color:var(--wg-text-color-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wg__dropdown-empty{padding:8px 12px;color:var(--wg-text-color-2);font-style:italic;text-align:center}.wg--navigate-mode .wg__cell{cursor:cell}.wg--navigate-mode .wg__cell:focus{outline:none}.wg--navigate-mode .wg__cell.wg__cell--focused{outline:2px solid var(--wg-focus-border-color, #217346);outline-offset:-2px}.wg__cell--focused:after{display:none}.wg__pagination{display:flex;align-items:center;justify-content:center;gap:var(--wg-pagination-gap);padding:var(--wg-pagination-padding);border-top:var(--wg-pagination-border);background:var(--wg-pagination-bg)}.wg__pagination-btn{padding:var(--wg-pagination-btn-padding);background:var(--wg-pagination-btn-bg);border:var(--wg-pagination-btn-border);border-radius:var(--wg-pagination-btn-border-radius);color:var(--wg-cell-color);font-size:var(--wg-font-size-base);cursor:pointer;transition:all var(--wg-transition-fast)}.wg__pagination-btn:hover:not(:disabled){background:var(--wg-pagination-btn-bg-hover);border:var(--wg-pagination-btn-border-hover)}.wg__pagination-btn:active:not(:disabled){background:var(--wg-pagination-btn-bg-active)}.wg__pagination-btn:disabled{opacity:var(--wg-pagination-btn-disabled-opacity);cursor:not-allowed}.wg__pagination-info{font-size:var(--wg-font-size-base);color:var(--wg-cell-color)}.wg__pagination-count{font-size:var(--wg-font-size-sm);color:var(--wg-text-color-3);margin-left:4px}.wg__pagination-pagesize{display:flex;align-items:center;gap:6px}.wg__pagination-select{padding:4px 8px;background:var(--wg-pagination-btn-bg);border:var(--wg-pagination-btn-border);border-radius:var(--wg-pagination-btn-border-radius);color:var(--wg-cell-color);font-size:var(--wg-font-size-base);cursor:pointer}.wg__pagination-select:hover{background:var(--wg-pagination-btn-bg-hover);border:var(--wg-pagination-btn-border-hover)}.wg__pagination-select:focus{outline:2px solid var(--wg-accent-color);outline-offset:-2px}.wg__pagination-label{font-size:var(--wg-font-size-sm);color:var(--wg-text-color-3)}.wg__pagination--left{justify-content:flex-start}.wg__pagination--right{justify-content:flex-end}.wg__pagination--top{border-top:none;border-bottom:var(--wg-pagination-border)}.wg__summary{display:flex;align-items:center;padding:var(--wg-pagination-padding);border-top:var(--wg-pagination-border);background:var(--wg-pagination-bg);font-size:var(--wg-font-size-base);color:var(--wg-cell-color)}.wg__summary--left{justify-content:flex-start}.wg__summary--right{justify-content:flex-end}.wg__summary--top{border-top:none;border-bottom:var(--wg-pagination-border)}.wg__footer{display:flex;align-items:center;justify-content:space-between;border-top:var(--wg-pagination-border);background:var(--wg-pagination-bg)}.wg__footer--top{border-top:none;border-bottom:var(--wg-pagination-border)}.wg__footer .wg__summary,.wg__footer .wg__pagination{border:none}.wg__footer .wg__summary{flex:0 0 auto}.wg__footer .wg__pagination{flex:0 0 auto;margin-left:auto}.wg__toolbar-container{position:fixed;z-index:var(--wg-z-toolbar, 1000)}.wg__toolbar{display:flex;flex-direction:column-reverse;gap:0;padding:0;background:var(--wg-toolbar-bg);border:var(--wg-toolbar-border);border-radius:var(--wg-toolbar-border-radius);box-shadow:var(--wg-toolbar-shadow)}.wg__toolbar-row{display:flex;gap:2px;align-items:center;height:calc(var(--wg-design-unit, 4) * 4px + 21px);padding:0 4px}.wg__toolbar-row+.wg__toolbar-row{border-top:1px solid var(--wg-toolbar-divider-color)}.wg__toolbar-divider{width:1px;height:16px;background:var(--wg-toolbar-divider-color);margin:0 4px;flex-shrink:0}.wg__toolbar-btn{min-width:var(--wg-toolbar-btn-min-width);height:100%;border:none;border-radius:var(--wg-toolbar-btn-border-radius);background:transparent;color:var(--wg-toolbar-btn-color);cursor:pointer;display:flex;align-items:center;justify-content:center;gap:4px;font-size:var(--wg-font-size-base);font-weight:500;padding:var(--wg-toolbar-btn-padding);transition:background .1s ease}.wg__toolbar-btn:hover{background:var(--wg-toolbar-btn-bg-hover)}.wg__toolbar-btn:active{background:var(--wg-toolbar-btn-bg-active)}.wg__toolbar-btn:disabled{opacity:.5;cursor:not-allowed}.wg__toolbar-btn:disabled:hover{background:transparent}.wg__toolbar-btn--danger:hover{background:var(--wg-danger-bg-light);color:var(--wg-danger-color)}.wg__toolbar-label{font-size:12px;white-space:nowrap}.wg__actions-column{width:24px;min-width:24px;max-width:24px;padding:0!important;text-align:center}.wg__header .wg__actions-column{background:var(--wg-header-bg)}.wg__filter-row .wg__actions-column{background:var(--wg-filter-bg)}.wg__toolbar-trigger{position:relative;padding:0;background:transparent;border:none;border-radius:var(--wg-border-radius-sm);cursor:pointer;font-size:var(--wg-font-size-base);line-height:1;color:var(--wg-toolbar-trigger-color)}.wg__toolbar-trigger:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--wg-dropdown-toggle-hitbox);height:48px}.wg__toolbar-trigger:hover,.wg__toolbar-trigger--active{color:var(--wg-toolbar-trigger-color-hover);background:var(--wg-toolbar-trigger-bg-hover)}.wg--striped tbody tr:nth-child(2n){background:var(--wg-row-bg-even)}.wg--hoverable tbody tr:hover{background:var(--wg-row-bg-hover)}.wg__empty{text-align:center;padding:var(--wg-empty-padding);color:var(--wg-empty-color);font-style:italic}.wg__loading-more{text-align:center;padding:var(--wg-cell-padding);color:var(--wg-text-color-2);font-size:var(--wg-font-size-sm)}.wg__tooltip{position:fixed;z-index:var(--wg-z-tooltip, 10000);max-width:300px;padding:6px 10px;background:var(--wg-tooltip-bg, #333);color:var(--wg-tooltip-color, #fff);font-size:var(--wg-font-size-sm);line-height:1.4;border-radius:var(--wg-border-radius-sm);box-shadow:0 2px 8px #0003;pointer-events:none;opacity:0;transition:opacity var(--wg-transition-fast)}.wg__tooltip--visible{opacity:1}.wg__tooltip-arrow{position:absolute;width:8px;height:8px;background:var(--wg-tooltip-bg, #333);transform:rotate(45deg)}.wg__tooltip[data-placement^=top] .wg__tooltip-arrow{bottom:-4px}.wg__tooltip[data-placement^=bottom] .wg__tooltip-arrow{top:-4px}.wg__tooltip[data-placement^=left] .wg__tooltip-arrow{right:-4px}.wg__tooltip[data-placement^=right] .wg__tooltip-arrow{left:-4px}.wg__goto-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#0006;display:flex;align-items:center;justify-content:center;z-index:1000}.wg__goto-dialog{background:var(--wg-surface-1);border-radius:var(--wg-border-radius);padding:var(--wg-spacing-lg);box-shadow:0 4px 20px #00000026;min-width:250px}.wg__goto-label{display:block;margin-bottom:var(--wg-spacing-sm);font-size:var(--wg-font-size-base);color:var(--wg-text-color-1)}.wg__goto-input{width:100%;padding:var(--wg-spacing-sm) var(--wg-spacing-md);border:1px solid var(--wg-border-color);border-radius:var(--wg-border-radius-sm);font-size:var(--wg-font-size-base);margin-bottom:var(--wg-spacing-md);box-sizing:border-box}.wg__goto-input:focus{outline:none;border-color:var(--wg-accent-color);box-shadow:0 0 0 2px #0078d433}.wg__goto-buttons{display:flex;gap:var(--wg-spacing-sm);justify-content:flex-end}.wg__goto-btn{padding:var(--wg-spacing-sm) var(--wg-spacing-md);border:1px solid var(--wg-border-color);border-radius:var(--wg-border-radius-sm);font-size:var(--wg-font-size-sm);cursor:pointer;background:var(--wg-surface-1);color:var(--wg-text-color-1)}.wg__goto-btn:hover{background:var(--wg-surface-2)}.wg__goto-btn--go{background:var(--wg-accent-color);border-color:var(--wg-accent-color);color:#fff}.wg__goto-btn--go:hover{background:var(--wg-accent-color-hover, #106ebe)}.wg__spacer-top td,.wg__spacer-bottom td{padding:0;border:none;background:transparent;height:inherit;line-height:0}@media (prefers-color-scheme: dark){:host{--wg-surface-1: #1f1f1f;--wg-surface-2: #2b2b2b;--wg-surface-3: #333333;--wg-surface-floating: #2b2b2b;--wg-text-color-1: #e0e0e0;--wg-text-color-2: #c0c0c0;--wg-text-color-3: #a0a0a0;--wg-border-color: #3d3d3d;--wg-border-color-hover: #5a5a5a;--wg-input-bg: #1f1f1f;--wg-input-border: 1px solid #5a5a5a;--wg-hover-bg: #3a3a3a;--wg-active-bg: #4a4a4a;--wg-danger-bg-light: #442726;--wg-danger-color: #f87c86}}:host([data-theme="dark"]),[data-theme=dark] :host,:host([data-bs-theme="dark"]),[data-bs-theme=dark] :host,.dark :host{--wg-surface-1: #1f1f1f;--wg-surface-2: #2b2b2b;--wg-surface-3: #333333;--wg-surface-floating: #2b2b2b;--wg-text-color-1: #e0e0e0;--wg-text-color-2: #c0c0c0;--wg-text-color-3: #a0a0a0;--wg-border-color: #3d3d3d;--wg-border-color-hover: #5a5a5a;--wg-input-bg: #1f1f1f;--wg-input-border: 1px solid #5a5a5a;--wg-hover-bg: #3a3a3a;--wg-active-bg: #4a4a4a;--wg-danger-bg-light: #442726;--wg-danger-color: #f87c86}';
|
|
751
|
+
const Be = ':host{--wg-rem: 10px;font-family:var(--wg-font-family, var(--base-font-family, system-ui, -apple-system, sans-serif));display:block;--wg-accent-color: var(--base-accent-color, #0078d4);--wg-accent-color-hover: var(--base-accent-color-hover, #106ebe);--wg-accent-color-active: var(--base-accent-color-active, #005a9e);--wg-accent-color-light: var(--base-accent-color-light, #e6f2ff);--wg-text-color-1: var(--base-text-color-1, #242424);--wg-text-color-2: var(--base-text-color-2, #424242);--wg-text-color-3: var(--base-text-color-3, #707070);--wg-text-on-accent: var(--base-text-color-on-accent, #ffffff);--wg-surface-1: var(--base-main-bg, #ffffff);--wg-surface-2: var(--base-elevated-bg, #f5f5f5);--wg-surface-3: var(--base-hover-bg, #ebebeb);--wg-surface-floating: var(--base-dropdown-bg, var(--base-main-bg, #ffffff));--wg-border-color: var(--base-border-color, #e0e0e0);--wg-border-color-hover: var(--base-border-color, #d1d1d1);--wg-input-bg: var(--base-input-bg, #ffffff);--wg-input-color: var(--base-input-color, var(--wg-text-color-1));--wg-input-border: var(--base-input-border, 1px solid #d1d1d1);--wg-input-border-hover: var(--base-input-border-hover, 1px solid #0078d4);--wg-input-border-focus: var(--base-input-border-focus, 1px solid #0078d4);--wg-input-placeholder-color: var(--base-input-placeholder-color, #707070);--wg-danger-color: var(--base-danger-color, #d13438);--wg-danger-bg-light: var(--base-danger-bg-light, #fde7e9);--wg-hover-bg: var(--base-hover-bg, #f0f0f0);--wg-active-bg: var(--base-hover-bg, #e0e0e0);--wg-font-size-base: calc(var(--base-font-size-base, 1.4) * var(--wg-rem));--wg-font-size-sm: calc(var(--base-font-size-sm, 1.2) * var(--wg-rem));--wg-font-size-xs: calc(var(--base-font-size-xs, 1.1) * var(--wg-rem));--wg-font-size-lg: calc(var(--base-font-size-lg, 1.6) * var(--wg-rem));--wg-line-height-base: calc(var(--base-line-height-normal, 2) * var(--wg-rem));--wg-font-weight-normal: var(--base-font-weight-normal, 400);--wg-font-weight-semibold: var(--base-font-weight-semibold, 600);--wg-border-radius-sm: calc(var(--base-border-radius-sm, .4) * var(--wg-rem));--wg-border-radius-md: calc(var(--base-border-radius-md, .6) * var(--wg-rem));--wg-border-radius-lg: calc(var(--base-border-radius-lg, .8) * var(--wg-rem));--wg-spacing-xs: calc(.4 * var(--wg-rem));--wg-spacing-sm: calc(.8 * var(--wg-rem));--wg-spacing-md: calc(1.2 * var(--wg-rem));--wg-spacing-lg: calc(1.6 * var(--wg-rem));--wg-spacing-xl: calc(2.4 * var(--wg-rem));--wg-table-bg: var(--wg-surface-1);--wg-table-border: 1px solid var(--wg-border-color);--wg-header-bg: var(--wg-surface-2);--wg-header-bg-hover: var(--wg-surface-3);--wg-header-bg-sorted: var(--wg-surface-3);--wg-header-color: var(--wg-text-color-1);--wg-header-border: 2px solid var(--wg-border-color);--wg-header-padding: var(--wg-spacing-sm) var(--wg-spacing-md);--wg-header-font-weight: var(--wg-font-weight-semibold);--wg-cell-padding: var(--wg-spacing-sm) var(--wg-spacing-md);--wg-cell-color: var(--wg-text-color-1);--wg-cell-border: 1px solid var(--wg-border-color);--wg-cell-bg-hover: var(--wg-hover-bg);--wg-cell-bg-editing: var(--wg-surface-1);--wg-cell-readonly-bg: var(--base-disabled-bg, var(--wg-surface-2));--wg-row-border: 1px solid var(--wg-border-color);--wg-row-bg-even: var(--wg-surface-2);--wg-row-bg-hover: var(--wg-surface-3);--wg-filter-bg: var(--wg-surface-1);--wg-filter-border: 1px solid var(--wg-border-color);--wg-filter-padding: var(--wg-spacing-xs) var(--wg-spacing-sm);--wg-filter-input-padding: calc(.4 * var(--wg-rem)) calc(.8 * var(--wg-rem));--wg-filter-input-bg: var(--wg-input-bg);--wg-filter-input-border: var(--wg-input-border);--wg-filter-input-border-focus: var(--wg-input-border-focus);--wg-filter-input-border-radius: var(--wg-border-radius-sm);--wg-filter-input-font-size: var(--wg-font-size-sm);--wg-sort-indicator-size: calc(1.4 * var(--wg-rem));--wg-sort-indicator-opacity: .9;--wg-sort-placeholder-opacity: .3;--wg-sort-priority-size: calc(1.1 * var(--wg-rem));--wg-pagination-padding: var(--wg-spacing-md);--wg-pagination-gap: calc(1.6 * var(--wg-rem));--wg-pagination-bg: var(--wg-surface-1);--wg-pagination-border: 1px solid var(--wg-border-color);--wg-pagination-btn-padding: calc(.6 * var(--wg-rem)) calc(1.6 * var(--wg-rem));--wg-pagination-btn-bg: var(--wg-surface-1);--wg-pagination-btn-bg-hover: var(--wg-surface-2);--wg-pagination-btn-bg-active: var(--wg-surface-3);--wg-pagination-btn-border: 1px solid var(--wg-border-color);--wg-pagination-btn-border-hover: 1px solid var(--wg-border-color-hover);--wg-pagination-btn-border-radius: var(--wg-border-radius-sm);--wg-pagination-btn-disabled-opacity: .4;--wg-empty-padding: var(--wg-spacing-xl);--wg-empty-color: var(--wg-text-color-3);--wg-error-cell-bg: var(--wg-danger-bg-light);--wg-error-cell-border: 1px solid var(--wg-danger-color);--wg-error-message-color: var(--wg-danger-color);--wg-error-message-font-size: var(--wg-font-size-xs);--wg-error-indicator-color: var(--wg-danger-color);--wg-editor-bg: var(--wg-surface-1);--wg-editor-outline: 2px solid var(--wg-accent-color);--wg-editor-outline-offset: -2px;--wg-editor-validating-opacity: .7;--wg-dropdown-toggle-right: var(--wg-spacing-md);--wg-dropdown-toggle-size: calc(1.2 * var(--wg-rem));--wg-dropdown-toggle-hitbox: calc(2.4 * var(--wg-rem));--wg-toolbar-bg: var(--wg-surface-floating);--wg-toolbar-border: 1px solid var(--wg-border-color);--wg-toolbar-border-radius: var(--wg-border-radius-sm);--wg-toolbar-shadow: var(--base-dropdown-box-shadow, 0 2px 8px rgba(0, 0, 0, .15));--wg-toolbar-divider-color: var(--wg-border-color);--wg-toolbar-btn-min-width: calc(2.4 * var(--wg-rem));--wg-toolbar-btn-padding: 0 calc(.4 * var(--wg-rem));--wg-toolbar-btn-border-radius: var(--wg-border-radius-sm);--wg-toolbar-btn-bg-hover: var(--wg-hover-bg);--wg-toolbar-btn-bg-active: var(--wg-active-bg);--wg-toolbar-btn-color: var(--wg-text-color-1);--wg-toolbar-trigger-color: var(--wg-text-color-3);--wg-toolbar-trigger-color-hover: var(--wg-text-color-1);--wg-toolbar-trigger-bg-hover: var(--wg-hover-bg);--wg-tooltip-bg: var(--base-tooltip-bg, #333);--wg-context-menu-z-index: 1001;--wg-context-menu-min-width: calc(16 * var(--wg-rem));--wg-focus-outline: 2px solid var(--wg-accent-color);--wg-focus-outline-offset: -2px;--wg-focus-bg: var(--wg-hover-bg);--wg-transition-fast: .1s ease;--wg-transition-normal: .15s ease;--wg-z-dropdown: 9999;--wg-z-toolbar: 1000;--wg-z-context-menu: 1001}web-grid:not(:defined){display:block;min-height:calc(10 * var(--wg-rem));color:transparent!important;background:transparent}.wg{position:relative;width:100%;max-height:inherit;overflow:auto;overscroll-behavior:contain;border:var(--wg-table-border)}.wg__table{width:max-content;min-width:100%;border-collapse:collapse;table-layout:fixed;background:var(--wg-table-bg);font-size:var(--wg-font-size-base);line-height:var(--wg-line-height-base)}.wg__table tbody tr{border-bottom:var(--wg-row-border)}.wg__row-number-header,.wg__row-number{width:40px;min-width:40px;max-width:40px;text-align:center;color:var(--wg-text-color-secondary);background:var(--wg-header-bg);-webkit-user-select:none;user-select:none;font-size:var(--wg-font-size-sm)}.wg__row-number{border-right:var(--wg-cell-border)}.wg__actions-column{width:32px;min-width:32px;max-width:32px;padding:0!important;text-align:center}thead .wg__actions-column{background:var(--wg-header-bg);border-bottom:var(--wg-header-border)}.wg__filter-row .wg__actions-column{background:var(--wg-filter-bg);border-bottom:var(--wg-filter-border)}.wg__header{position:sticky;top:0;z-index:1;background:var(--wg-header-bg);color:var(--wg-header-color);font-weight:var(--wg-header-font-weight);padding:var(--wg-header-padding);border-bottom:var(--wg-header-border);text-align:left;-webkit-user-select:none;user-select:none}.wg__header--sortable{cursor:pointer}.wg__header--sortable:hover{background:var(--wg-header-bg-hover)}.wg__header--sorted{background:var(--wg-header-bg-sorted)}.wg__header-content{display:flex;align-items:center;gap:4px;justify-content:space-between}.wg__header-title{flex:1}.wg__sort-indicator{font-size:var(--wg-sort-indicator-size);opacity:var(--wg-sort-indicator-opacity);min-width:16px;text-align:center;display:inline-flex;align-items:center}.wg__sort-placeholder{opacity:var(--wg-sort-placeholder-opacity)}.wg__sort-priority{font-size:var(--wg-sort-priority-size);font-weight:600;margin-left:2px;vertical-align:super;line-height:1}.wg__header-info{display:inline-flex;align-items:center;color:var(--wg-accent-color);cursor:help;opacity:.7;margin-left:4px;vertical-align:middle}.wg__header-info:hover{opacity:1}.wg__filter-row th{padding:var(--wg-filter-padding);background:var(--wg-filter-bg);border-bottom:var(--wg-filter-border)}.wg__filter-input{width:100%;padding:var(--wg-filter-input-padding);border:var(--wg-filter-input-border);border-radius:var(--wg-filter-input-border-radius);background:var(--wg-surface-1);color:var(--wg-text-color-1);font-size:var(--wg-filter-input-font-size);box-sizing:border-box}.wg__filter-input:focus{outline:none;border:var(--wg-filter-input-border-focus);box-shadow:0 0 0 1px var(--wg-accent-color)}.wg__cell{padding:var(--wg-cell-padding);color:var(--wg-cell-color);scroll-margin-top:3rem;scroll-margin-bottom:.5rem}.wg__cell-text{-webkit-user-select:none;user-select:none}.wg__cell--ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wg__cell--editable{cursor:pointer;position:relative}.wg__cell--editable:hover{background:var(--wg-cell-bg-hover)}.wg__cell--editable:hover:after{content:"";position:absolute;top:2px;right:2px;bottom:2px;left:2px;border:1px dashed var(--wg-border-color);border-radius:2px;pointer-events:none}.wg__cell--editing{position:relative;background:var(--wg-surface-1);outline:2px solid var(--wg-accent-color);outline-offset:-2px}.wg__cell--editing:after{display:none}.wg__cell--invalid{background:var(--wg-danger-bg-light, #fee);box-shadow:inset 0 0 0 2px var(--wg-danger-color, #c00)}.wg--navigate-mode .wg__cell:not(.wg__cell--editable){background:var(--wg-cell-readonly-bg, #f5f5f5)}.wg__editor{position:absolute;top:0;left:0;right:0;width:100%;padding:var(--wg-cell-padding);border:none;background:transparent;color:var(--wg-text-color-1);font-size:var(--wg-font-size-base);font-family:inherit;line-height:inherit;box-sizing:border-box}.wg__editor:focus,.wg__editor:focus-visible{outline:none;box-shadow:none}.wg__editor--text{text-align:inherit}.wg__editor--number{text-align:right}.wg__editor--date{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;background:var(--wg-editor-bg)}.wg__date-input{flex:1;min-width:0;height:100%;border:none;background:transparent;font:inherit;padding:var(--wg-cell-padding-block) var(--wg-cell-padding-inline);outline:none;color:inherit}.wg__date-trigger{width:var(--wg-date-trigger-size, 28px);height:100%;display:flex;align-items:center;justify-content:center;border:none;background:transparent;color:var(--wg-text-secondary, #666);cursor:pointer;padding:0;flex-shrink:0}.wg__date-trigger:hover{color:var(--wg-accent-color, #0078d4);background:var(--wg-hover-bg, rgba(0, 0, 0, .05))}.wg__editor--checkbox{width:auto;height:auto;margin:0 auto}.wg__editor--custom{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;background:var(--wg-editor-bg);padding:var(--wg-cell-padding-block) var(--wg-cell-padding-inline);cursor:pointer}.wg__editor--custom:focus{outline:none}.wg__custom-value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;cursor:pointer}.wg__editor--combobox,.wg__editor--autocomplete{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;padding:var(--wg-cell-padding);padding-right:0;background:transparent;box-sizing:border-box}.wg__combobox-input,.wg__autocomplete-input{flex:1;width:100%;height:100%;padding:0 24px 0 0;border:none;background:transparent;color:var(--wg-text-color-1);font-size:var(--wg-font-size-base);font-family:inherit;line-height:var(--wg-line-height-base);outline:none;box-sizing:border-box;margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.wg__combobox-input:focus,.wg__autocomplete-input:focus{outline:none}.wg__combobox-toggle{position:absolute;right:var(--wg-dropdown-toggle-right);top:50%;transform:translateY(-50%);font-size:var(--wg-dropdown-toggle-size);color:var(--wg-text-color-2);pointer-events:auto;cursor:pointer}.wg__combobox-toggle:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--wg-dropdown-toggle-hitbox);height:48px}.wg__loading-indicator{position:absolute;right:var(--wg-dropdown-toggle-right);top:50%;transform:translateY(-50%);font-size:12px;animation:wg-pulse 1s infinite}@keyframes wg-pulse{0%,to{opacity:1}50%{opacity:.4}}.wg__select-trigger{display:flex;align-items:center;justify-content:space-between;cursor:pointer;background:transparent}.wg__select-trigger:focus,.wg__select-trigger:focus-visible{outline:none;box-shadow:none}.wg__select-value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wg__select-toggle{position:relative;font-size:var(--wg-dropdown-toggle-size);opacity:.6;margin-left:4px;flex-shrink:0;pointer-events:auto;cursor:pointer}.wg__select-toggle:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--wg-dropdown-toggle-hitbox);height:48px}.wg__cell-dropdown-display{display:flex;align-items:center;justify-content:space-between;width:100%;cursor:pointer}.wg__cell-dropdown-display--toggle-on-focus .wg__select-toggle{opacity:0}.wg__cell:hover .wg__cell-dropdown-display--toggle-on-focus .wg__select-toggle,.wg__cell--focused .wg__cell-dropdown-display--toggle-on-focus .wg__select-toggle{opacity:.6}.wg__cell-date-display{display:flex;align-items:center;justify-content:space-between;width:100%;cursor:pointer}.wg__cell-date-display .wg__date-trigger{position:relative;background:none;border:none;padding:0;margin:0;cursor:pointer;opacity:.6;display:flex;align-items:center;justify-content:center;color:inherit}.wg__cell-date-display .wg__date-trigger:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--wg-dropdown-toggle-hitbox);height:48px}.wg__cell-date-display--toggle-on-focus .wg__date-trigger{opacity:0}.wg__cell:hover .wg__cell-date-display--toggle-on-focus .wg__date-trigger,.wg__cell--focused .wg__cell-date-display--toggle-on-focus .wg__date-trigger{opacity:.6}.wg__dropdown{background:var(--wg-surface-floating, #fff);border:1px solid var(--wg-border-color, #d1d1d1);border-radius:4px;box-shadow:var(--wg-toolbar-shadow);max-height:200px;overflow-y:auto;font-size:var(--wg-font-size-base);font-family:inherit;line-height:var(--wg-line-height-base)}.wg__dropdown-option{display:flex;align-items:center;gap:var(--wg-spacing-sm);padding:6px 12px;cursor:pointer;color:var(--wg-text-color-1)}.wg__dropdown-option:hover,.wg__dropdown-option--highlighted{background:var(--wg-hover-bg, #f0f0f0)}.wg__dropdown-option--selected{background:var(--wg-accent-color-light, #e6f2ff)}.wg__dropdown-option--disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.wg__dropdown-option-icon{flex-shrink:0;width:1.5em;text-align:center}.wg__dropdown-option-content{flex:1;min-width:0;overflow:hidden}.wg__dropdown-option-label{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wg__dropdown-option-subtitle{display:block;font-size:var(--wg-font-size-sm);color:var(--wg-text-color-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wg__dropdown-empty{padding:8px 12px;color:var(--wg-text-color-2);font-style:italic;text-align:center}.wg--navigate-mode .wg__cell{cursor:cell}.wg--navigate-mode .wg__cell:focus{outline:none}.wg--navigate-mode .wg__cell.wg__cell--focused{outline:2px solid var(--wg-focus-border-color, #217346);outline-offset:-2px}.wg__cell--focused:after{display:none}.wg__pagination{display:flex;align-items:center;justify-content:center;gap:var(--wg-pagination-gap);padding:var(--wg-pagination-padding);border-top:var(--wg-pagination-border);background:var(--wg-pagination-bg)}.wg__pagination-btn{padding:var(--wg-pagination-btn-padding);background:var(--wg-pagination-btn-bg);border:var(--wg-pagination-btn-border);border-radius:var(--wg-pagination-btn-border-radius);color:var(--wg-cell-color);font-size:var(--wg-font-size-base);cursor:pointer;transition:all var(--wg-transition-fast)}.wg__pagination-btn:hover:not(:disabled){background:var(--wg-pagination-btn-bg-hover);border:var(--wg-pagination-btn-border-hover)}.wg__pagination-btn:active:not(:disabled){background:var(--wg-pagination-btn-bg-active)}.wg__pagination-btn:disabled{opacity:var(--wg-pagination-btn-disabled-opacity);cursor:not-allowed}.wg__pagination-info{font-size:var(--wg-font-size-base);color:var(--wg-cell-color)}.wg__pagination-count{font-size:var(--wg-font-size-sm);color:var(--wg-text-color-3);margin-left:4px}.wg__pagination-pagesize{display:flex;align-items:center;gap:6px}.wg__pagination-select{padding:4px 8px;background:var(--wg-pagination-btn-bg);border:var(--wg-pagination-btn-border);border-radius:var(--wg-pagination-btn-border-radius);color:var(--wg-cell-color);font-size:var(--wg-font-size-base);cursor:pointer}.wg__pagination-select:hover{background:var(--wg-pagination-btn-bg-hover);border:var(--wg-pagination-btn-border-hover)}.wg__pagination-select:focus{outline:2px solid var(--wg-accent-color);outline-offset:-2px}.wg__pagination-label{font-size:var(--wg-font-size-sm);color:var(--wg-text-color-3)}.wg__pagination--left{justify-content:flex-start}.wg__pagination--right{justify-content:flex-end}.wg__pagination--top{border-top:none;border-bottom:var(--wg-pagination-border)}.wg__summary{display:flex;align-items:center;padding:var(--wg-pagination-padding);border-top:var(--wg-pagination-border);background:var(--wg-pagination-bg);font-size:var(--wg-font-size-base);color:var(--wg-cell-color)}.wg__summary--left{justify-content:flex-start}.wg__summary--right{justify-content:flex-end}.wg__summary--top{border-top:none;border-bottom:var(--wg-pagination-border)}.wg__footer{display:flex;align-items:center;justify-content:space-between;border-top:var(--wg-pagination-border);background:var(--wg-pagination-bg)}.wg__footer--top{border-top:none;border-bottom:var(--wg-pagination-border)}.wg__footer .wg__summary,.wg__footer .wg__pagination{border:none}.wg__footer .wg__summary{flex:0 0 auto}.wg__footer .wg__pagination{flex:0 0 auto;margin-left:auto}.wg__toolbar-container{position:fixed;z-index:var(--wg-z-toolbar, 1000)}.wg__toolbar{display:flex;flex-direction:column-reverse;gap:0;padding:0;background:var(--wg-toolbar-bg);border:var(--wg-toolbar-border);border-radius:var(--wg-toolbar-border-radius);box-shadow:var(--wg-toolbar-shadow)}.wg__toolbar-row{display:flex;gap:2px;align-items:center;height:calc(var(--wg-design-unit, 4) * 4px + 21px);padding:0 4px}.wg__toolbar-row+.wg__toolbar-row{border-top:1px solid var(--wg-toolbar-divider-color)}.wg__toolbar-divider{width:1px;height:16px;background:var(--wg-toolbar-divider-color);margin:0 4px;flex-shrink:0}.wg__toolbar-btn{min-width:var(--wg-toolbar-btn-min-width);height:100%;border:none;border-radius:var(--wg-toolbar-btn-border-radius);background:transparent;color:var(--wg-toolbar-btn-color);cursor:pointer;display:flex;align-items:center;justify-content:center;gap:4px;font-size:var(--wg-font-size-base);font-weight:500;padding:var(--wg-toolbar-btn-padding);transition:background .1s ease}.wg__toolbar-btn:hover{background:var(--wg-toolbar-btn-bg-hover)}.wg__toolbar-btn:active{background:var(--wg-toolbar-btn-bg-active)}.wg__toolbar-btn:disabled{opacity:.5;cursor:not-allowed}.wg__toolbar-btn:disabled:hover{background:transparent}.wg__toolbar-btn--danger:hover{background:var(--wg-danger-bg-light);color:var(--wg-danger-color)}.wg__toolbar-label{font-size:12px;white-space:nowrap}.wg__actions-column{width:24px;min-width:24px;max-width:24px;padding:0!important;text-align:center}.wg__header .wg__actions-column{background:var(--wg-header-bg)}.wg__filter-row .wg__actions-column{background:var(--wg-filter-bg)}.wg__toolbar-trigger{position:relative;padding:0;background:transparent;border:none;border-radius:var(--wg-border-radius-sm);cursor:pointer;font-size:var(--wg-font-size-base);line-height:1;color:var(--wg-toolbar-trigger-color)}.wg__toolbar-trigger:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--wg-dropdown-toggle-hitbox);height:48px}.wg__toolbar-trigger:hover,.wg__toolbar-trigger--active{color:var(--wg-toolbar-trigger-color-hover);background:var(--wg-toolbar-trigger-bg-hover)}.wg--striped tbody tr:nth-child(2n){background:var(--wg-row-bg-even)}.wg--hoverable tbody tr:hover{background:var(--wg-row-bg-hover)}.wg__empty{text-align:center;padding:var(--wg-empty-padding);color:var(--wg-empty-color);font-style:italic}.wg__loading-more{text-align:center;padding:var(--wg-cell-padding);color:var(--wg-text-color-2);font-size:var(--wg-font-size-sm)}.wg__tooltip{position:fixed;z-index:var(--wg-z-tooltip, 10000);max-width:300px;padding:6px 10px;background:var(--wg-tooltip-bg, #333);color:var(--wg-tooltip-color, #fff);font-size:var(--wg-font-size-sm);line-height:1.4;border-radius:var(--wg-border-radius-sm);box-shadow:0 2px 8px #0003;pointer-events:none;opacity:0;transition:opacity var(--wg-transition-fast)}.wg__tooltip--visible{opacity:1}.wg__tooltip-arrow{position:absolute;width:8px;height:8px;background:var(--wg-tooltip-bg, #333);transform:rotate(45deg)}.wg__tooltip[data-placement^=top] .wg__tooltip-arrow{bottom:-4px}.wg__tooltip[data-placement^=bottom] .wg__tooltip-arrow{top:-4px}.wg__tooltip[data-placement^=left] .wg__tooltip-arrow{right:-4px}.wg__tooltip[data-placement^=right] .wg__tooltip-arrow{left:-4px}.wg__goto-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#0006;display:flex;align-items:center;justify-content:center;z-index:1000}.wg__goto-dialog{background:var(--wg-surface-1);border-radius:var(--wg-border-radius);padding:var(--wg-spacing-lg);box-shadow:0 4px 20px #00000026;min-width:250px}.wg__goto-label{display:block;margin-bottom:var(--wg-spacing-sm);font-size:var(--wg-font-size-base);color:var(--wg-text-color-1)}.wg__goto-input{width:100%;padding:var(--wg-spacing-sm) var(--wg-spacing-md);border:1px solid var(--wg-border-color);border-radius:var(--wg-border-radius-sm);font-size:var(--wg-font-size-base);margin-bottom:var(--wg-spacing-md);box-sizing:border-box}.wg__goto-input:focus{outline:none;border-color:var(--wg-accent-color);box-shadow:0 0 0 2px #0078d433}.wg__goto-buttons{display:flex;gap:var(--wg-spacing-sm);justify-content:flex-end}.wg__goto-btn{padding:var(--wg-spacing-sm) var(--wg-spacing-md);border:1px solid var(--wg-border-color);border-radius:var(--wg-border-radius-sm);font-size:var(--wg-font-size-sm);cursor:pointer;background:var(--wg-surface-1);color:var(--wg-text-color-1)}.wg__goto-btn:hover{background:var(--wg-surface-2)}.wg__goto-btn--go{background:var(--wg-accent-color);border-color:var(--wg-accent-color);color:#fff}.wg__goto-btn--go:hover{background:var(--wg-accent-color-hover, #106ebe)}.wg__spacer-top td,.wg__spacer-bottom td{padding:0;border:none;background:transparent;height:inherit;line-height:0}@media (prefers-color-scheme: dark){:host{--wg-surface-1: #1f1f1f;--wg-surface-2: #2b2b2b;--wg-surface-3: #333333;--wg-surface-floating: #2b2b2b;--wg-text-color-1: #e0e0e0;--wg-text-color-2: #c0c0c0;--wg-text-color-3: #a0a0a0;--wg-border-color: #3d3d3d;--wg-border-color-hover: #5a5a5a;--wg-input-bg: #1f1f1f;--wg-input-border: 1px solid #5a5a5a;--wg-hover-bg: #3a3a3a;--wg-active-bg: #4a4a4a;--wg-danger-bg-light: #442726;--wg-danger-color: #f87c86}}:host([data-theme="dark"]),[data-theme=dark] :host,:host([data-bs-theme="dark"]),[data-bs-theme=dark] :host,.dark :host{--wg-surface-1: #1f1f1f;--wg-surface-2: #2b2b2b;--wg-surface-3: #333333;--wg-surface-floating: #2b2b2b;--wg-text-color-1: #e0e0e0;--wg-text-color-2: #c0c0c0;--wg-text-color-3: #a0a0a0;--wg-border-color: #3d3d3d;--wg-border-color-hover: #5a5a5a;--wg-input-bg: #1f1f1f;--wg-input-border: 1px solid #5a5a5a;--wg-hover-bg: #3a3a3a;--wg-active-bg: #4a4a4a;--wg-danger-bg-light: #442726;--wg-danger-color: #f87c86}';
|
|
745
752
|
function Jt(t, e, o) {
|
|
746
753
|
const i = o.valueMember || "value", r = o.displayMember || "label", s = e.find((n) => n[i] === t);
|
|
747
754
|
return s ? String(s[r] ?? "") : t != null ? String(t) : "";
|
|
748
755
|
}
|
|
749
|
-
function
|
|
756
|
+
function Ct(t, e) {
|
|
750
757
|
if (e.getDisplayCallback) return e.getDisplayCallback(t);
|
|
751
758
|
const o = e.displayMember || "label";
|
|
752
759
|
return String(t[o] ?? t.label ?? "");
|
|
@@ -756,29 +763,29 @@ function at(t, e) {
|
|
|
756
763
|
const o = e.valueMember || "value";
|
|
757
764
|
return t[o] ?? t.value;
|
|
758
765
|
}
|
|
759
|
-
function
|
|
766
|
+
function Ke(t, e) {
|
|
760
767
|
return e.getIconCallback ? e.getIconCallback(t) : e.iconMember && t[e.iconMember] || null;
|
|
761
768
|
}
|
|
762
|
-
function
|
|
769
|
+
function We(t, e) {
|
|
763
770
|
return e.getSubtitleCallback ? e.getSubtitleCallback(t) : e.subtitleMember && t[e.subtitleMember] || null;
|
|
764
771
|
}
|
|
765
772
|
function mt(t, e) {
|
|
766
773
|
return e.getDisabledCallback ? e.getDisabledCallback(t) : e.disabledMember ? !!t[e.disabledMember] : !1;
|
|
767
774
|
}
|
|
768
|
-
const it = Math.min,
|
|
775
|
+
const it = Math.min, N = Math.max, Tt = Math.round, Dt = Math.floor, G = (t) => ({
|
|
769
776
|
x: t,
|
|
770
777
|
y: t
|
|
771
|
-
}),
|
|
778
|
+
}), Xe = {
|
|
772
779
|
left: "right",
|
|
773
780
|
right: "left",
|
|
774
781
|
bottom: "top",
|
|
775
782
|
top: "bottom"
|
|
776
|
-
},
|
|
783
|
+
}, Qe = {
|
|
777
784
|
start: "end",
|
|
778
785
|
end: "start"
|
|
779
786
|
};
|
|
780
787
|
function Ut(t, e, o) {
|
|
781
|
-
return
|
|
788
|
+
return N(t, it(e, o));
|
|
782
789
|
}
|
|
783
790
|
function pt(t, e) {
|
|
784
791
|
return typeof t == "function" ? t(e) : t;
|
|
@@ -789,54 +796,54 @@ function rt(t) {
|
|
|
789
796
|
function ft(t) {
|
|
790
797
|
return t.split("-")[1];
|
|
791
798
|
}
|
|
792
|
-
function
|
|
799
|
+
function ke(t) {
|
|
793
800
|
return t === "x" ? "y" : "x";
|
|
794
801
|
}
|
|
795
802
|
function Zt(t) {
|
|
796
803
|
return t === "y" ? "height" : "width";
|
|
797
804
|
}
|
|
798
|
-
const
|
|
805
|
+
const Ge = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
799
806
|
function tt(t) {
|
|
800
|
-
return
|
|
807
|
+
return Ge.has(rt(t)) ? "y" : "x";
|
|
801
808
|
}
|
|
802
809
|
function te(t) {
|
|
803
|
-
return
|
|
810
|
+
return ke(tt(t));
|
|
804
811
|
}
|
|
805
|
-
function
|
|
812
|
+
function Je(t, e, o) {
|
|
806
813
|
o === void 0 && (o = !1);
|
|
807
814
|
const i = ft(t), r = te(t), s = Zt(r);
|
|
808
815
|
let n = r === "x" ? i === (o ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
809
|
-
return e.reference[s] > e.floating[s] && (n =
|
|
816
|
+
return e.reference[s] > e.floating[s] && (n = Et(n)), [n, Et(n)];
|
|
810
817
|
}
|
|
811
|
-
function
|
|
812
|
-
const e =
|
|
818
|
+
function Ze(t) {
|
|
819
|
+
const e = Et(t);
|
|
813
820
|
return [jt(t), e, jt(e)];
|
|
814
821
|
}
|
|
815
822
|
function jt(t) {
|
|
816
|
-
return t.replace(/start|end/g, (e) =>
|
|
823
|
+
return t.replace(/start|end/g, (e) => Qe[e]);
|
|
817
824
|
}
|
|
818
|
-
const
|
|
819
|
-
function
|
|
825
|
+
const le = ["left", "right"], de = ["right", "left"], to = ["top", "bottom"], eo = ["bottom", "top"];
|
|
826
|
+
function oo(t, e, o) {
|
|
820
827
|
switch (t) {
|
|
821
828
|
case "top":
|
|
822
829
|
case "bottom":
|
|
823
|
-
return o ? e ?
|
|
830
|
+
return o ? e ? de : le : e ? le : de;
|
|
824
831
|
case "left":
|
|
825
832
|
case "right":
|
|
826
|
-
return e ?
|
|
833
|
+
return e ? to : eo;
|
|
827
834
|
default:
|
|
828
835
|
return [];
|
|
829
836
|
}
|
|
830
837
|
}
|
|
831
|
-
function
|
|
838
|
+
function io(t, e, o, i) {
|
|
832
839
|
const r = ft(t);
|
|
833
|
-
let s =
|
|
840
|
+
let s = oo(rt(t), o === "start", i);
|
|
834
841
|
return r && (s = s.map((n) => n + "-" + r), e && (s = s.concat(s.map(jt)))), s;
|
|
835
842
|
}
|
|
836
|
-
function
|
|
837
|
-
return t.replace(/left|right|bottom|top/g, (e) =>
|
|
843
|
+
function Et(t) {
|
|
844
|
+
return t.replace(/left|right|bottom|top/g, (e) => Xe[e]);
|
|
838
845
|
}
|
|
839
|
-
function
|
|
846
|
+
function ro(t) {
|
|
840
847
|
return {
|
|
841
848
|
top: 0,
|
|
842
849
|
right: 0,
|
|
@@ -845,15 +852,15 @@ function io(t) {
|
|
|
845
852
|
...t
|
|
846
853
|
};
|
|
847
854
|
}
|
|
848
|
-
function
|
|
849
|
-
return typeof t != "number" ?
|
|
855
|
+
function De(t) {
|
|
856
|
+
return typeof t != "number" ? ro(t) : {
|
|
850
857
|
top: t,
|
|
851
858
|
right: t,
|
|
852
859
|
bottom: t,
|
|
853
860
|
left: t
|
|
854
861
|
};
|
|
855
862
|
}
|
|
856
|
-
function
|
|
863
|
+
function $t(t) {
|
|
857
864
|
const {
|
|
858
865
|
x: e,
|
|
859
866
|
y: o,
|
|
@@ -871,7 +878,7 @@ function Dt(t) {
|
|
|
871
878
|
y: o
|
|
872
879
|
};
|
|
873
880
|
}
|
|
874
|
-
function
|
|
881
|
+
function ce(t, e, o) {
|
|
875
882
|
let {
|
|
876
883
|
reference: i,
|
|
877
884
|
floating: r
|
|
@@ -919,7 +926,7 @@ function de(t, e, o) {
|
|
|
919
926
|
}
|
|
920
927
|
return u;
|
|
921
928
|
}
|
|
922
|
-
const
|
|
929
|
+
const no = async (t, e, o) => {
|
|
923
930
|
const {
|
|
924
931
|
placement: i = "bottom",
|
|
925
932
|
strategy: r = "absolute",
|
|
@@ -933,17 +940,17 @@ const ro = async (t, e, o) => {
|
|
|
933
940
|
}), {
|
|
934
941
|
x: l,
|
|
935
942
|
y: g
|
|
936
|
-
} =
|
|
943
|
+
} = ce(c, i, a), h = i, u = {}, p = 0;
|
|
937
944
|
for (let m = 0; m < d.length; m++) {
|
|
938
945
|
const {
|
|
939
946
|
name: f,
|
|
940
|
-
fn:
|
|
947
|
+
fn: b
|
|
941
948
|
} = d[m], {
|
|
942
|
-
x:
|
|
949
|
+
x: v,
|
|
943
950
|
y: _,
|
|
944
951
|
data: S,
|
|
945
952
|
reset: y
|
|
946
|
-
} = await
|
|
953
|
+
} = await b({
|
|
947
954
|
x: l,
|
|
948
955
|
y: g,
|
|
949
956
|
initialPlacement: i,
|
|
@@ -957,7 +964,7 @@ const ro = async (t, e, o) => {
|
|
|
957
964
|
floating: e
|
|
958
965
|
}
|
|
959
966
|
});
|
|
960
|
-
l =
|
|
967
|
+
l = v ?? l, g = _ ?? g, u = {
|
|
961
968
|
...u,
|
|
962
969
|
[f]: {
|
|
963
970
|
...u[f],
|
|
@@ -970,7 +977,7 @@ const ro = async (t, e, o) => {
|
|
|
970
977
|
}) : y.rects), {
|
|
971
978
|
x: l,
|
|
972
979
|
y: g
|
|
973
|
-
} =
|
|
980
|
+
} = ce(c, h, a)), m = -1);
|
|
974
981
|
}
|
|
975
982
|
return {
|
|
976
983
|
x: l,
|
|
@@ -996,12 +1003,12 @@ async function ee(t, e) {
|
|
|
996
1003
|
elementContext: g = "floating",
|
|
997
1004
|
altBoundary: h = !1,
|
|
998
1005
|
padding: u = 0
|
|
999
|
-
} = pt(e, t), p =
|
|
1006
|
+
} = pt(e, t), p = De(u), f = d[h ? g === "floating" ? "reference" : "floating" : g], b = $t(await s.getClippingRect({
|
|
1000
1007
|
element: (o = await (s.isElement == null ? void 0 : s.isElement(f))) == null || o ? f : f.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(d.floating)),
|
|
1001
1008
|
boundary: c,
|
|
1002
1009
|
rootBoundary: l,
|
|
1003
1010
|
strategy: a
|
|
1004
|
-
})),
|
|
1011
|
+
})), v = g === "floating" ? {
|
|
1005
1012
|
x: i,
|
|
1006
1013
|
y: r,
|
|
1007
1014
|
width: n.floating.width,
|
|
@@ -1012,20 +1019,20 @@ async function ee(t, e) {
|
|
|
1012
1019
|
} : {
|
|
1013
1020
|
x: 1,
|
|
1014
1021
|
y: 1
|
|
1015
|
-
}, y =
|
|
1022
|
+
}, y = $t(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
1016
1023
|
elements: d,
|
|
1017
|
-
rect:
|
|
1024
|
+
rect: v,
|
|
1018
1025
|
offsetParent: _,
|
|
1019
1026
|
strategy: a
|
|
1020
|
-
}) :
|
|
1027
|
+
}) : v);
|
|
1021
1028
|
return {
|
|
1022
|
-
top: (
|
|
1023
|
-
bottom: (y.bottom -
|
|
1024
|
-
left: (
|
|
1025
|
-
right: (y.right -
|
|
1029
|
+
top: (b.top - y.top + p.top) / S.y,
|
|
1030
|
+
bottom: (y.bottom - b.bottom + p.bottom) / S.y,
|
|
1031
|
+
left: (b.left - y.left + p.left) / S.x,
|
|
1032
|
+
right: (y.right - b.right + p.right) / S.x
|
|
1026
1033
|
};
|
|
1027
1034
|
}
|
|
1028
|
-
const
|
|
1035
|
+
const so = (t) => ({
|
|
1029
1036
|
name: "arrow",
|
|
1030
1037
|
options: t,
|
|
1031
1038
|
async fn(e) {
|
|
@@ -1043,26 +1050,26 @@ const no = (t) => ({
|
|
|
1043
1050
|
} = pt(t, e) || {};
|
|
1044
1051
|
if (c == null)
|
|
1045
1052
|
return {};
|
|
1046
|
-
const g =
|
|
1053
|
+
const g = De(l), h = {
|
|
1047
1054
|
x: o,
|
|
1048
1055
|
y: i
|
|
1049
|
-
}, u = te(r), p = Zt(u), m = await n.getDimensions(c), f = u === "y",
|
|
1056
|
+
}, u = te(r), p = Zt(u), m = await n.getDimensions(c), f = u === "y", b = f ? "top" : "left", v = f ? "bottom" : "right", _ = f ? "clientHeight" : "clientWidth", S = s.reference[p] + s.reference[u] - h[u] - s.floating[p], y = h[u] - s.reference[u], D = await (n.getOffsetParent == null ? void 0 : n.getOffsetParent(c));
|
|
1050
1057
|
let x = D ? D[_] : 0;
|
|
1051
1058
|
(!x || !await (n.isElement == null ? void 0 : n.isElement(D))) && (x = d.floating[_] || s.floating[p]);
|
|
1052
|
-
const C = S / 2 - y / 2, T = x / 2 - m[p] / 2 - 1, k = it(g[
|
|
1059
|
+
const C = S / 2 - y / 2, T = x / 2 - m[p] / 2 - 1, k = it(g[b], T), E = it(g[v], T), A = k, H = x - m[p] - E, O = x / 2 - m[p] / 2 + C, R = Ut(A, O, H), z = !a.arrow && ft(r) != null && O !== R && s.reference[p] / 2 - (O < A ? k : E) - m[p] / 2 < 0, F = z ? O < A ? O - A : O - H : 0;
|
|
1053
1060
|
return {
|
|
1054
|
-
[u]: h[u] +
|
|
1061
|
+
[u]: h[u] + F,
|
|
1055
1062
|
data: {
|
|
1056
|
-
[u]:
|
|
1057
|
-
centerOffset:
|
|
1058
|
-
...
|
|
1059
|
-
alignmentOffset:
|
|
1063
|
+
[u]: R,
|
|
1064
|
+
centerOffset: O - R - F,
|
|
1065
|
+
...z && {
|
|
1066
|
+
alignmentOffset: F
|
|
1060
1067
|
}
|
|
1061
1068
|
},
|
|
1062
|
-
reset:
|
|
1069
|
+
reset: z
|
|
1063
1070
|
};
|
|
1064
1071
|
}
|
|
1065
|
-
}),
|
|
1072
|
+
}), ao = function(t) {
|
|
1066
1073
|
return t === void 0 && (t = {}), {
|
|
1067
1074
|
name: "flip",
|
|
1068
1075
|
options: t,
|
|
@@ -1086,70 +1093,70 @@ const no = (t) => ({
|
|
|
1086
1093
|
} = pt(t, e);
|
|
1087
1094
|
if ((o = s.arrow) != null && o.alignmentOffset)
|
|
1088
1095
|
return {};
|
|
1089
|
-
const
|
|
1090
|
-
!h && D && y.push(...
|
|
1096
|
+
const b = rt(r), v = tt(d), _ = rt(d) === d, S = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), y = h || (_ || !m ? [Et(d)] : Ze(d)), D = p !== "none";
|
|
1097
|
+
!h && D && y.push(...io(d, m, p, S));
|
|
1091
1098
|
const x = [d, ...y], C = await ee(e, f), T = [];
|
|
1092
1099
|
let k = ((i = s.flip) == null ? void 0 : i.overflows) || [];
|
|
1093
|
-
if (l && T.push(C[
|
|
1094
|
-
const
|
|
1095
|
-
T.push(C[
|
|
1100
|
+
if (l && T.push(C[b]), g) {
|
|
1101
|
+
const O = Je(r, n, S);
|
|
1102
|
+
T.push(C[O[0]], C[O[1]]);
|
|
1096
1103
|
}
|
|
1097
1104
|
if (k = [...k, {
|
|
1098
1105
|
placement: r,
|
|
1099
1106
|
overflows: T
|
|
1100
|
-
}], !T.every((
|
|
1101
|
-
var
|
|
1102
|
-
const
|
|
1103
|
-
if (
|
|
1107
|
+
}], !T.every((O) => O <= 0)) {
|
|
1108
|
+
var E, A;
|
|
1109
|
+
const O = (((E = s.flip) == null ? void 0 : E.index) || 0) + 1, R = x[O];
|
|
1110
|
+
if (R && (!(g === "alignment" ? v !== tt(R) : !1) || // We leave the current main axis only if every placement on that axis
|
|
1104
1111
|
// overflows the main axis.
|
|
1105
|
-
k.every((
|
|
1112
|
+
k.every((V) => tt(V.placement) === v ? V.overflows[0] > 0 : !0)))
|
|
1106
1113
|
return {
|
|
1107
1114
|
data: {
|
|
1108
|
-
index:
|
|
1115
|
+
index: O,
|
|
1109
1116
|
overflows: k
|
|
1110
1117
|
},
|
|
1111
1118
|
reset: {
|
|
1112
|
-
placement:
|
|
1119
|
+
placement: R
|
|
1113
1120
|
}
|
|
1114
1121
|
};
|
|
1115
|
-
let
|
|
1116
|
-
if (!
|
|
1122
|
+
let z = (A = k.filter((F) => F.overflows[0] <= 0).sort((F, V) => F.overflows[1] - V.overflows[1])[0]) == null ? void 0 : A.placement;
|
|
1123
|
+
if (!z)
|
|
1117
1124
|
switch (u) {
|
|
1118
1125
|
case "bestFit": {
|
|
1119
|
-
var
|
|
1120
|
-
const
|
|
1126
|
+
var H;
|
|
1127
|
+
const F = (H = k.filter((V) => {
|
|
1121
1128
|
if (D) {
|
|
1122
|
-
const
|
|
1123
|
-
return
|
|
1129
|
+
const P = tt(V.placement);
|
|
1130
|
+
return P === v || // Create a bias to the `y` side axis due to horizontal
|
|
1124
1131
|
// reading directions favoring greater width.
|
|
1125
|
-
|
|
1132
|
+
P === "y";
|
|
1126
1133
|
}
|
|
1127
1134
|
return !0;
|
|
1128
|
-
}).map((
|
|
1129
|
-
|
|
1135
|
+
}).map((V) => [V.placement, V.overflows.filter((P) => P > 0).reduce((P, q) => P + q, 0)]).sort((V, P) => V[1] - P[1])[0]) == null ? void 0 : H[0];
|
|
1136
|
+
F && (z = F);
|
|
1130
1137
|
break;
|
|
1131
1138
|
}
|
|
1132
1139
|
case "initialPlacement":
|
|
1133
|
-
|
|
1140
|
+
z = d;
|
|
1134
1141
|
break;
|
|
1135
1142
|
}
|
|
1136
|
-
if (r !==
|
|
1143
|
+
if (r !== z)
|
|
1137
1144
|
return {
|
|
1138
1145
|
reset: {
|
|
1139
|
-
placement:
|
|
1146
|
+
placement: z
|
|
1140
1147
|
}
|
|
1141
1148
|
};
|
|
1142
1149
|
}
|
|
1143
1150
|
return {};
|
|
1144
1151
|
}
|
|
1145
1152
|
};
|
|
1146
|
-
},
|
|
1147
|
-
async function
|
|
1153
|
+
}, lo = /* @__PURE__ */ new Set(["left", "top"]);
|
|
1154
|
+
async function co(t, e) {
|
|
1148
1155
|
const {
|
|
1149
1156
|
placement: o,
|
|
1150
1157
|
platform: i,
|
|
1151
1158
|
elements: r
|
|
1152
|
-
} = t, s = await (i.isRTL == null ? void 0 : i.isRTL(r.floating)), n = rt(o), d = ft(o), a = tt(o) === "y", c =
|
|
1159
|
+
} = t, s = await (i.isRTL == null ? void 0 : i.isRTL(r.floating)), n = rt(o), d = ft(o), a = tt(o) === "y", c = lo.has(n) ? -1 : 1, l = s && a ? -1 : 1, g = pt(e, t);
|
|
1153
1160
|
let {
|
|
1154
1161
|
mainAxis: h,
|
|
1155
1162
|
crossAxis: u,
|
|
@@ -1171,7 +1178,7 @@ async function lo(t, e) {
|
|
|
1171
1178
|
y: u * l
|
|
1172
1179
|
};
|
|
1173
1180
|
}
|
|
1174
|
-
const
|
|
1181
|
+
const go = function(t) {
|
|
1175
1182
|
return t === void 0 && (t = 0), {
|
|
1176
1183
|
name: "offset",
|
|
1177
1184
|
options: t,
|
|
@@ -1182,7 +1189,7 @@ const co = function(t) {
|
|
|
1182
1189
|
y: s,
|
|
1183
1190
|
placement: n,
|
|
1184
1191
|
middlewareData: d
|
|
1185
|
-
} = e, a = await
|
|
1192
|
+
} = e, a = await co(e, t);
|
|
1186
1193
|
return n === ((o = d.offset) == null ? void 0 : o.placement) && (i = d.arrow) != null && i.alignmentOffset ? {} : {
|
|
1187
1194
|
x: r + a.x,
|
|
1188
1195
|
y: s + a.y,
|
|
@@ -1193,7 +1200,7 @@ const co = function(t) {
|
|
|
1193
1200
|
};
|
|
1194
1201
|
}
|
|
1195
1202
|
};
|
|
1196
|
-
},
|
|
1203
|
+
}, uo = function(t) {
|
|
1197
1204
|
return t === void 0 && (t = {}), {
|
|
1198
1205
|
name: "shift",
|
|
1199
1206
|
options: t,
|
|
@@ -1208,12 +1215,12 @@ const co = function(t) {
|
|
|
1208
1215
|
limiter: d = {
|
|
1209
1216
|
fn: (f) => {
|
|
1210
1217
|
let {
|
|
1211
|
-
x:
|
|
1212
|
-
y:
|
|
1218
|
+
x: b,
|
|
1219
|
+
y: v
|
|
1213
1220
|
} = f;
|
|
1214
1221
|
return {
|
|
1215
|
-
x:
|
|
1216
|
-
y:
|
|
1222
|
+
x: b,
|
|
1223
|
+
y: v
|
|
1217
1224
|
};
|
|
1218
1225
|
}
|
|
1219
1226
|
},
|
|
@@ -1221,15 +1228,15 @@ const co = function(t) {
|
|
|
1221
1228
|
} = pt(t, e), c = {
|
|
1222
1229
|
x: o,
|
|
1223
1230
|
y: i
|
|
1224
|
-
}, l = await ee(e, a), g = tt(rt(r)), h =
|
|
1231
|
+
}, l = await ee(e, a), g = tt(rt(r)), h = ke(g);
|
|
1225
1232
|
let u = c[h], p = c[g];
|
|
1226
1233
|
if (s) {
|
|
1227
|
-
const f = h === "y" ? "top" : "left",
|
|
1228
|
-
u = Ut(
|
|
1234
|
+
const f = h === "y" ? "top" : "left", b = h === "y" ? "bottom" : "right", v = u + l[f], _ = u - l[b];
|
|
1235
|
+
u = Ut(v, u, _);
|
|
1229
1236
|
}
|
|
1230
1237
|
if (n) {
|
|
1231
|
-
const f = g === "y" ? "top" : "left",
|
|
1232
|
-
p = Ut(
|
|
1238
|
+
const f = g === "y" ? "top" : "left", b = g === "y" ? "bottom" : "right", v = p + l[f], _ = p - l[b];
|
|
1239
|
+
p = Ut(v, p, _);
|
|
1233
1240
|
}
|
|
1234
1241
|
const m = d.fn({
|
|
1235
1242
|
...e,
|
|
@@ -1249,7 +1256,7 @@ const co = function(t) {
|
|
|
1249
1256
|
};
|
|
1250
1257
|
}
|
|
1251
1258
|
};
|
|
1252
|
-
},
|
|
1259
|
+
}, ho = function(t) {
|
|
1253
1260
|
return t === void 0 && (t = {}), {
|
|
1254
1261
|
name: "size",
|
|
1255
1262
|
options: t,
|
|
@@ -1268,13 +1275,13 @@ const co = function(t) {
|
|
|
1268
1275
|
width: p,
|
|
1269
1276
|
height: m
|
|
1270
1277
|
} = s.floating;
|
|
1271
|
-
let f,
|
|
1272
|
-
g === "top" || g === "bottom" ? (f = g,
|
|
1273
|
-
const
|
|
1278
|
+
let f, b;
|
|
1279
|
+
g === "top" || g === "bottom" ? (f = g, b = h === (await (n.isRTL == null ? void 0 : n.isRTL(d.floating)) ? "start" : "end") ? "left" : "right") : (b = g, f = h === "end" ? "top" : "bottom");
|
|
1280
|
+
const v = m - l.top - l.bottom, _ = p - l.left - l.right, S = it(m - l[f], v), y = it(p - l[b], _), D = !e.middlewareData.shift;
|
|
1274
1281
|
let x = S, C = y;
|
|
1275
|
-
if ((o = e.middlewareData.shift) != null && o.enabled.x && (C = _), (i = e.middlewareData.shift) != null && i.enabled.y && (x =
|
|
1276
|
-
const k =
|
|
1277
|
-
u ? C = p - 2 * (k !== 0 ||
|
|
1282
|
+
if ((o = e.middlewareData.shift) != null && o.enabled.x && (C = _), (i = e.middlewareData.shift) != null && i.enabled.y && (x = v), D && !h) {
|
|
1283
|
+
const k = N(l.left, 0), E = N(l.right, 0), A = N(l.top, 0), H = N(l.bottom, 0);
|
|
1284
|
+
u ? C = p - 2 * (k !== 0 || E !== 0 ? k + E : N(l.left, l.right)) : x = m - 2 * (A !== 0 || H !== 0 ? A + H : N(l.top, l.bottom));
|
|
1278
1285
|
}
|
|
1279
1286
|
await a({
|
|
1280
1287
|
...e,
|
|
@@ -1290,49 +1297,49 @@ const co = function(t) {
|
|
|
1290
1297
|
}
|
|
1291
1298
|
};
|
|
1292
1299
|
};
|
|
1293
|
-
function
|
|
1300
|
+
function Ot() {
|
|
1294
1301
|
return typeof window < "u";
|
|
1295
1302
|
}
|
|
1296
1303
|
function wt(t) {
|
|
1297
|
-
return
|
|
1304
|
+
return Te(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
1298
1305
|
}
|
|
1299
|
-
function
|
|
1306
|
+
function U(t) {
|
|
1300
1307
|
var e;
|
|
1301
1308
|
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
1302
1309
|
}
|
|
1303
1310
|
function Z(t) {
|
|
1304
1311
|
var e;
|
|
1305
|
-
return (e = (
|
|
1312
|
+
return (e = (Te(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
1306
1313
|
}
|
|
1307
|
-
function
|
|
1308
|
-
return
|
|
1314
|
+
function Te(t) {
|
|
1315
|
+
return Ot() ? t instanceof Node || t instanceof U(t).Node : !1;
|
|
1309
1316
|
}
|
|
1310
|
-
function
|
|
1311
|
-
return
|
|
1317
|
+
function X(t) {
|
|
1318
|
+
return Ot() ? t instanceof Element || t instanceof U(t).Element : !1;
|
|
1312
1319
|
}
|
|
1313
1320
|
function J(t) {
|
|
1314
|
-
return
|
|
1321
|
+
return Ot() ? t instanceof HTMLElement || t instanceof U(t).HTMLElement : !1;
|
|
1315
1322
|
}
|
|
1316
|
-
function
|
|
1317
|
-
return !
|
|
1323
|
+
function ge(t) {
|
|
1324
|
+
return !Ot() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof U(t).ShadowRoot;
|
|
1318
1325
|
}
|
|
1319
|
-
const
|
|
1320
|
-
function
|
|
1326
|
+
const po = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
1327
|
+
function St(t) {
|
|
1321
1328
|
const {
|
|
1322
1329
|
overflow: e,
|
|
1323
1330
|
overflowX: o,
|
|
1324
1331
|
overflowY: i,
|
|
1325
1332
|
display: r
|
|
1326
|
-
} =
|
|
1327
|
-
return /auto|scroll|overlay|hidden|clip/.test(e + i + o) && !
|
|
1333
|
+
} = Q(t);
|
|
1334
|
+
return /auto|scroll|overlay|hidden|clip/.test(e + i + o) && !po.has(r);
|
|
1328
1335
|
}
|
|
1329
|
-
const
|
|
1330
|
-
function
|
|
1331
|
-
return
|
|
1336
|
+
const fo = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
1337
|
+
function wo(t) {
|
|
1338
|
+
return fo.has(wt(t));
|
|
1332
1339
|
}
|
|
1333
|
-
const
|
|
1334
|
-
function
|
|
1335
|
-
return
|
|
1340
|
+
const mo = [":popover-open", ":modal"];
|
|
1341
|
+
function Rt(t) {
|
|
1342
|
+
return mo.some((e) => {
|
|
1336
1343
|
try {
|
|
1337
1344
|
return t.matches(e);
|
|
1338
1345
|
} catch {
|
|
@@ -1340,17 +1347,17 @@ function At(t) {
|
|
|
1340
1347
|
}
|
|
1341
1348
|
});
|
|
1342
1349
|
}
|
|
1343
|
-
const
|
|
1350
|
+
const bo = ["transform", "translate", "scale", "rotate", "perspective"], vo = ["transform", "translate", "scale", "rotate", "perspective", "filter"], _o = ["paint", "layout", "strict", "content"];
|
|
1344
1351
|
function oe(t) {
|
|
1345
|
-
const e = ie(), o =
|
|
1346
|
-
return
|
|
1352
|
+
const e = ie(), o = X(t) ? Q(t) : t;
|
|
1353
|
+
return bo.some((i) => o[i] ? o[i] !== "none" : !1) || (o.containerType ? o.containerType !== "normal" : !1) || !e && (o.backdropFilter ? o.backdropFilter !== "none" : !1) || !e && (o.filter ? o.filter !== "none" : !1) || vo.some((i) => (o.willChange || "").includes(i)) || _o.some((i) => (o.contain || "").includes(i));
|
|
1347
1354
|
}
|
|
1348
|
-
function
|
|
1355
|
+
function yo(t) {
|
|
1349
1356
|
let e = nt(t);
|
|
1350
1357
|
for (; J(e) && !ht(e); ) {
|
|
1351
1358
|
if (oe(e))
|
|
1352
1359
|
return e;
|
|
1353
|
-
if (
|
|
1360
|
+
if (Rt(e))
|
|
1354
1361
|
return null;
|
|
1355
1362
|
e = nt(e);
|
|
1356
1363
|
}
|
|
@@ -1359,15 +1366,15 @@ function _o(t) {
|
|
|
1359
1366
|
function ie() {
|
|
1360
1367
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
1361
1368
|
}
|
|
1362
|
-
const
|
|
1369
|
+
const Co = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
1363
1370
|
function ht(t) {
|
|
1364
|
-
return
|
|
1371
|
+
return Co.has(wt(t));
|
|
1365
1372
|
}
|
|
1366
|
-
function
|
|
1367
|
-
return
|
|
1373
|
+
function Q(t) {
|
|
1374
|
+
return U(t).getComputedStyle(t);
|
|
1368
1375
|
}
|
|
1369
|
-
function
|
|
1370
|
-
return
|
|
1376
|
+
function Pt(t) {
|
|
1377
|
+
return X(t) ? {
|
|
1371
1378
|
scrollLeft: t.scrollLeft,
|
|
1372
1379
|
scrollTop: t.scrollTop
|
|
1373
1380
|
} : {
|
|
@@ -1382,32 +1389,32 @@ function nt(t) {
|
|
|
1382
1389
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
1383
1390
|
t.assignedSlot || // DOM Element detected.
|
|
1384
1391
|
t.parentNode || // ShadowRoot detected.
|
|
1385
|
-
|
|
1392
|
+
ge(t) && t.host || // Fallback.
|
|
1386
1393
|
Z(t)
|
|
1387
1394
|
);
|
|
1388
|
-
return
|
|
1395
|
+
return ge(e) ? e.host : e;
|
|
1389
1396
|
}
|
|
1390
|
-
function
|
|
1397
|
+
function Ee(t) {
|
|
1391
1398
|
const e = nt(t);
|
|
1392
|
-
return ht(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : J(e) &&
|
|
1399
|
+
return ht(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : J(e) && St(e) ? e : Ee(e);
|
|
1393
1400
|
}
|
|
1394
|
-
function
|
|
1401
|
+
function _t(t, e, o) {
|
|
1395
1402
|
var i;
|
|
1396
1403
|
e === void 0 && (e = []), o === void 0 && (o = !0);
|
|
1397
|
-
const r =
|
|
1404
|
+
const r = Ee(t), s = r === ((i = t.ownerDocument) == null ? void 0 : i.body), n = U(r);
|
|
1398
1405
|
if (s) {
|
|
1399
1406
|
const d = Bt(n);
|
|
1400
|
-
return e.concat(n, n.visualViewport || [],
|
|
1407
|
+
return e.concat(n, n.visualViewport || [], St(r) ? r : [], d && o ? _t(d) : []);
|
|
1401
1408
|
}
|
|
1402
|
-
return e.concat(r,
|
|
1409
|
+
return e.concat(r, _t(r, [], o));
|
|
1403
1410
|
}
|
|
1404
1411
|
function Bt(t) {
|
|
1405
1412
|
return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
|
|
1406
1413
|
}
|
|
1407
|
-
function
|
|
1408
|
-
const e =
|
|
1414
|
+
function $e(t) {
|
|
1415
|
+
const e = Q(t);
|
|
1409
1416
|
let o = parseFloat(e.width) || 0, i = parseFloat(e.height) || 0;
|
|
1410
|
-
const r = J(t), s = r ? t.offsetWidth : o, n = r ? t.offsetHeight : i, d =
|
|
1417
|
+
const r = J(t), s = r ? t.offsetWidth : o, n = r ? t.offsetHeight : i, d = Tt(o) !== s || Tt(i) !== n;
|
|
1411
1418
|
return d && (o = s, i = n), {
|
|
1412
1419
|
width: o,
|
|
1413
1420
|
height: i,
|
|
@@ -1415,7 +1422,7 @@ function Te(t) {
|
|
|
1415
1422
|
};
|
|
1416
1423
|
}
|
|
1417
1424
|
function re(t) {
|
|
1418
|
-
return
|
|
1425
|
+
return X(t) ? t : t.contextElement;
|
|
1419
1426
|
}
|
|
1420
1427
|
function ut(t) {
|
|
1421
1428
|
const e = re(t);
|
|
@@ -1425,65 +1432,65 @@ function ut(t) {
|
|
|
1425
1432
|
width: i,
|
|
1426
1433
|
height: r,
|
|
1427
1434
|
$: s
|
|
1428
|
-
} =
|
|
1429
|
-
let n = (s ?
|
|
1435
|
+
} = $e(e);
|
|
1436
|
+
let n = (s ? Tt(o.width) : o.width) / i, d = (s ? Tt(o.height) : o.height) / r;
|
|
1430
1437
|
return (!n || !Number.isFinite(n)) && (n = 1), (!d || !Number.isFinite(d)) && (d = 1), {
|
|
1431
1438
|
x: n,
|
|
1432
1439
|
y: d
|
|
1433
1440
|
};
|
|
1434
1441
|
}
|
|
1435
|
-
const
|
|
1436
|
-
function
|
|
1437
|
-
const e =
|
|
1438
|
-
return !ie() || !e.visualViewport ?
|
|
1442
|
+
const So = /* @__PURE__ */ G(0);
|
|
1443
|
+
function Me(t) {
|
|
1444
|
+
const e = U(t);
|
|
1445
|
+
return !ie() || !e.visualViewport ? So : {
|
|
1439
1446
|
x: e.visualViewport.offsetLeft,
|
|
1440
1447
|
y: e.visualViewport.offsetTop
|
|
1441
1448
|
};
|
|
1442
1449
|
}
|
|
1443
|
-
function
|
|
1444
|
-
return e === void 0 && (e = !1), !o || e && o !==
|
|
1450
|
+
function xo(t, e, o) {
|
|
1451
|
+
return e === void 0 && (e = !1), !o || e && o !== U(t) ? !1 : e;
|
|
1445
1452
|
}
|
|
1446
1453
|
function lt(t, e, o, i) {
|
|
1447
1454
|
e === void 0 && (e = !1), o === void 0 && (o = !1);
|
|
1448
1455
|
const r = t.getBoundingClientRect(), s = re(t);
|
|
1449
1456
|
let n = G(1);
|
|
1450
|
-
e && (i ?
|
|
1451
|
-
const d =
|
|
1457
|
+
e && (i ? X(i) && (n = ut(i)) : n = ut(t));
|
|
1458
|
+
const d = xo(s, o, i) ? Me(s) : G(0);
|
|
1452
1459
|
let a = (r.left + d.x) / n.x, c = (r.top + d.y) / n.y, l = r.width / n.x, g = r.height / n.y;
|
|
1453
1460
|
if (s) {
|
|
1454
|
-
const h =
|
|
1461
|
+
const h = U(s), u = i && X(i) ? U(i) : i;
|
|
1455
1462
|
let p = h, m = Bt(p);
|
|
1456
1463
|
for (; m && i && u !== p; ) {
|
|
1457
|
-
const f = ut(m),
|
|
1458
|
-
a *= f.x, c *= f.y, l *= f.x, g *= f.y, a += _, c += S, p =
|
|
1464
|
+
const f = ut(m), b = m.getBoundingClientRect(), v = Q(m), _ = b.left + (m.clientLeft + parseFloat(v.paddingLeft)) * f.x, S = b.top + (m.clientTop + parseFloat(v.paddingTop)) * f.y;
|
|
1465
|
+
a *= f.x, c *= f.y, l *= f.x, g *= f.y, a += _, c += S, p = U(m), m = Bt(p);
|
|
1459
1466
|
}
|
|
1460
1467
|
}
|
|
1461
|
-
return
|
|
1468
|
+
return $t({
|
|
1462
1469
|
width: l,
|
|
1463
1470
|
height: g,
|
|
1464
1471
|
x: a,
|
|
1465
1472
|
y: c
|
|
1466
1473
|
});
|
|
1467
1474
|
}
|
|
1468
|
-
function
|
|
1469
|
-
const o =
|
|
1475
|
+
function It(t, e) {
|
|
1476
|
+
const o = Pt(t).scrollLeft;
|
|
1470
1477
|
return e ? e.left + o : lt(Z(t)).left + o;
|
|
1471
1478
|
}
|
|
1472
|
-
function
|
|
1473
|
-
const o = t.getBoundingClientRect(), i = o.left + e.scrollLeft -
|
|
1479
|
+
function Ae(t, e) {
|
|
1480
|
+
const o = t.getBoundingClientRect(), i = o.left + e.scrollLeft - It(t, o), r = o.top + e.scrollTop;
|
|
1474
1481
|
return {
|
|
1475
1482
|
x: i,
|
|
1476
1483
|
y: r
|
|
1477
1484
|
};
|
|
1478
1485
|
}
|
|
1479
|
-
function
|
|
1486
|
+
function ko(t) {
|
|
1480
1487
|
let {
|
|
1481
1488
|
elements: e,
|
|
1482
1489
|
rect: o,
|
|
1483
1490
|
offsetParent: i,
|
|
1484
1491
|
strategy: r
|
|
1485
1492
|
} = t;
|
|
1486
|
-
const s = r === "fixed", n = Z(i), d = e ?
|
|
1493
|
+
const s = r === "fixed", n = Z(i), d = e ? Rt(e.floating) : !1;
|
|
1487
1494
|
if (i === n || d && s)
|
|
1488
1495
|
return o;
|
|
1489
1496
|
let a = {
|
|
@@ -1491,11 +1498,11 @@ function xo(t) {
|
|
|
1491
1498
|
scrollTop: 0
|
|
1492
1499
|
}, c = G(1);
|
|
1493
1500
|
const l = G(0), g = J(i);
|
|
1494
|
-
if ((g || !g && !s) && ((wt(i) !== "body" ||
|
|
1501
|
+
if ((g || !g && !s) && ((wt(i) !== "body" || St(n)) && (a = Pt(i)), J(i))) {
|
|
1495
1502
|
const u = lt(i);
|
|
1496
1503
|
c = ut(i), l.x = u.x + i.clientLeft, l.y = u.y + i.clientTop;
|
|
1497
1504
|
}
|
|
1498
|
-
const h = n && !g && !s ?
|
|
1505
|
+
const h = n && !g && !s ? Ae(n, a) : G(0);
|
|
1499
1506
|
return {
|
|
1500
1507
|
width: o.width * c.x,
|
|
1501
1508
|
height: o.height * c.y,
|
|
@@ -1503,34 +1510,34 @@ function xo(t) {
|
|
|
1503
1510
|
y: o.y * c.y - a.scrollTop * c.y + l.y + h.y
|
|
1504
1511
|
};
|
|
1505
1512
|
}
|
|
1506
|
-
function
|
|
1513
|
+
function Do(t) {
|
|
1507
1514
|
return Array.from(t.getClientRects());
|
|
1508
1515
|
}
|
|
1509
|
-
function
|
|
1510
|
-
const e = Z(t), o =
|
|
1511
|
-
let n = -o.scrollLeft +
|
|
1516
|
+
function To(t) {
|
|
1517
|
+
const e = Z(t), o = Pt(t), i = t.ownerDocument.body, r = N(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), s = N(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
|
|
1518
|
+
let n = -o.scrollLeft + It(t);
|
|
1512
1519
|
const d = -o.scrollTop;
|
|
1513
|
-
return
|
|
1520
|
+
return Q(i).direction === "rtl" && (n += N(e.clientWidth, i.clientWidth) - r), {
|
|
1514
1521
|
width: r,
|
|
1515
1522
|
height: s,
|
|
1516
1523
|
x: n,
|
|
1517
1524
|
y: d
|
|
1518
1525
|
};
|
|
1519
1526
|
}
|
|
1520
|
-
const
|
|
1521
|
-
function
|
|
1522
|
-
const o =
|
|
1527
|
+
const ue = 25;
|
|
1528
|
+
function Eo(t, e) {
|
|
1529
|
+
const o = U(t), i = Z(t), r = o.visualViewport;
|
|
1523
1530
|
let s = i.clientWidth, n = i.clientHeight, d = 0, a = 0;
|
|
1524
1531
|
if (r) {
|
|
1525
1532
|
s = r.width, n = r.height;
|
|
1526
1533
|
const l = ie();
|
|
1527
1534
|
(!l || l && e === "fixed") && (d = r.offsetLeft, a = r.offsetTop);
|
|
1528
1535
|
}
|
|
1529
|
-
const c =
|
|
1536
|
+
const c = It(i);
|
|
1530
1537
|
if (c <= 0) {
|
|
1531
1538
|
const l = i.ownerDocument, g = l.body, h = getComputedStyle(g), u = l.compatMode === "CSS1Compat" && parseFloat(h.marginLeft) + parseFloat(h.marginRight) || 0, p = Math.abs(i.clientWidth - g.clientWidth - u);
|
|
1532
|
-
p <=
|
|
1533
|
-
} else c <=
|
|
1539
|
+
p <= ue && (s -= p);
|
|
1540
|
+
} else c <= ue && (s += c);
|
|
1534
1541
|
return {
|
|
1535
1542
|
width: s,
|
|
1536
1543
|
height: n,
|
|
@@ -1538,8 +1545,8 @@ function To(t, e) {
|
|
|
1538
1545
|
y: a
|
|
1539
1546
|
};
|
|
1540
1547
|
}
|
|
1541
|
-
const
|
|
1542
|
-
function
|
|
1548
|
+
const $o = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
1549
|
+
function Mo(t, e) {
|
|
1543
1550
|
const o = lt(t, !0, e === "fixed"), i = o.top + t.clientTop, r = o.left + t.clientLeft, s = J(t) ? ut(t) : G(1), n = t.clientWidth * s.x, d = t.clientHeight * s.y, a = r * s.x, c = i * s.y;
|
|
1544
1551
|
return {
|
|
1545
1552
|
width: n,
|
|
@@ -1548,16 +1555,16 @@ function $o(t, e) {
|
|
|
1548
1555
|
y: c
|
|
1549
1556
|
};
|
|
1550
1557
|
}
|
|
1551
|
-
function
|
|
1558
|
+
function he(t, e, o) {
|
|
1552
1559
|
let i;
|
|
1553
1560
|
if (e === "viewport")
|
|
1554
|
-
i =
|
|
1561
|
+
i = Eo(t, o);
|
|
1555
1562
|
else if (e === "document")
|
|
1556
|
-
i =
|
|
1557
|
-
else if (
|
|
1558
|
-
i =
|
|
1563
|
+
i = To(Z(t));
|
|
1564
|
+
else if (X(e))
|
|
1565
|
+
i = Mo(e, o);
|
|
1559
1566
|
else {
|
|
1560
|
-
const r =
|
|
1567
|
+
const r = Me(t);
|
|
1561
1568
|
i = {
|
|
1562
1569
|
x: e.x - r.x,
|
|
1563
1570
|
y: e.y - r.y,
|
|
@@ -1565,36 +1572,36 @@ function ue(t, e, o) {
|
|
|
1565
1572
|
height: e.height
|
|
1566
1573
|
};
|
|
1567
1574
|
}
|
|
1568
|
-
return
|
|
1575
|
+
return $t(i);
|
|
1569
1576
|
}
|
|
1570
|
-
function
|
|
1577
|
+
function Oe(t, e) {
|
|
1571
1578
|
const o = nt(t);
|
|
1572
|
-
return o === e || !
|
|
1579
|
+
return o === e || !X(o) || ht(o) ? !1 : Q(o).position === "fixed" || Oe(o, e);
|
|
1573
1580
|
}
|
|
1574
|
-
function
|
|
1581
|
+
function Ao(t, e) {
|
|
1575
1582
|
const o = e.get(t);
|
|
1576
1583
|
if (o)
|
|
1577
1584
|
return o;
|
|
1578
|
-
let i =
|
|
1579
|
-
const s =
|
|
1585
|
+
let i = _t(t, [], !1).filter((d) => X(d) && wt(d) !== "body"), r = null;
|
|
1586
|
+
const s = Q(t).position === "fixed";
|
|
1580
1587
|
let n = s ? nt(t) : t;
|
|
1581
|
-
for (;
|
|
1582
|
-
const d =
|
|
1583
|
-
!a && d.position === "fixed" && (r = null), (s ? !a && !r : !a && d.position === "static" && !!r &&
|
|
1588
|
+
for (; X(n) && !ht(n); ) {
|
|
1589
|
+
const d = Q(n), a = oe(n);
|
|
1590
|
+
!a && d.position === "fixed" && (r = null), (s ? !a && !r : !a && d.position === "static" && !!r && $o.has(r.position) || St(n) && !a && Oe(t, n)) ? i = i.filter((l) => l !== n) : r = d, n = nt(n);
|
|
1584
1591
|
}
|
|
1585
1592
|
return e.set(t, i), i;
|
|
1586
1593
|
}
|
|
1587
|
-
function
|
|
1594
|
+
function Oo(t) {
|
|
1588
1595
|
let {
|
|
1589
1596
|
element: e,
|
|
1590
1597
|
boundary: o,
|
|
1591
1598
|
rootBoundary: i,
|
|
1592
1599
|
strategy: r
|
|
1593
1600
|
} = t;
|
|
1594
|
-
const n = [...o === "clippingAncestors" ?
|
|
1595
|
-
const g =
|
|
1596
|
-
return c.top =
|
|
1597
|
-
},
|
|
1601
|
+
const n = [...o === "clippingAncestors" ? Rt(e) ? [] : Ao(e, this._c) : [].concat(o), i], d = n[0], a = n.reduce((c, l) => {
|
|
1602
|
+
const g = he(e, l, r);
|
|
1603
|
+
return c.top = N(g.top, c.top), c.right = it(g.right, c.right), c.bottom = it(g.bottom, c.bottom), c.left = N(g.left, c.left), c;
|
|
1604
|
+
}, he(e, d, r));
|
|
1598
1605
|
return {
|
|
1599
1606
|
width: a.right - a.left,
|
|
1600
1607
|
height: a.bottom - a.top,
|
|
@@ -1602,17 +1609,17 @@ function Ao(t) {
|
|
|
1602
1609
|
y: a.top
|
|
1603
1610
|
};
|
|
1604
1611
|
}
|
|
1605
|
-
function
|
|
1612
|
+
function Ro(t) {
|
|
1606
1613
|
const {
|
|
1607
1614
|
width: e,
|
|
1608
1615
|
height: o
|
|
1609
|
-
} =
|
|
1616
|
+
} = $e(t);
|
|
1610
1617
|
return {
|
|
1611
1618
|
width: e,
|
|
1612
1619
|
height: o
|
|
1613
1620
|
};
|
|
1614
1621
|
}
|
|
1615
|
-
function
|
|
1622
|
+
function Po(t, e, o) {
|
|
1616
1623
|
const i = J(e), r = Z(e), s = o === "fixed", n = lt(t, !0, s, e);
|
|
1617
1624
|
let d = {
|
|
1618
1625
|
scrollLeft: 0,
|
|
@@ -1620,15 +1627,15 @@ function Ro(t, e, o) {
|
|
|
1620
1627
|
};
|
|
1621
1628
|
const a = G(0);
|
|
1622
1629
|
function c() {
|
|
1623
|
-
a.x =
|
|
1630
|
+
a.x = It(r);
|
|
1624
1631
|
}
|
|
1625
1632
|
if (i || !i && !s)
|
|
1626
|
-
if ((wt(e) !== "body" ||
|
|
1633
|
+
if ((wt(e) !== "body" || St(r)) && (d = Pt(e)), i) {
|
|
1627
1634
|
const u = lt(e, !0, s, e);
|
|
1628
1635
|
a.x = u.x + e.clientLeft, a.y = u.y + e.clientTop;
|
|
1629
1636
|
} else r && c();
|
|
1630
1637
|
s && !i && r && c();
|
|
1631
|
-
const l = r && !i && !s ?
|
|
1638
|
+
const l = r && !i && !s ? Ae(r, d) : G(0), g = n.left + d.scrollLeft - a.x - l.x, h = n.top + d.scrollTop - a.y - l.y;
|
|
1632
1639
|
return {
|
|
1633
1640
|
x: g,
|
|
1634
1641
|
y: h,
|
|
@@ -1637,38 +1644,38 @@ function Ro(t, e, o) {
|
|
|
1637
1644
|
};
|
|
1638
1645
|
}
|
|
1639
1646
|
function Ht(t) {
|
|
1640
|
-
return
|
|
1647
|
+
return Q(t).position === "static";
|
|
1641
1648
|
}
|
|
1642
|
-
function
|
|
1643
|
-
if (!J(t) ||
|
|
1649
|
+
function pe(t, e) {
|
|
1650
|
+
if (!J(t) || Q(t).position === "fixed")
|
|
1644
1651
|
return null;
|
|
1645
1652
|
if (e)
|
|
1646
1653
|
return e(t);
|
|
1647
1654
|
let o = t.offsetParent;
|
|
1648
1655
|
return Z(t) === o && (o = o.ownerDocument.body), o;
|
|
1649
1656
|
}
|
|
1650
|
-
function
|
|
1651
|
-
const o =
|
|
1652
|
-
if (
|
|
1657
|
+
function Re(t, e) {
|
|
1658
|
+
const o = U(t);
|
|
1659
|
+
if (Rt(t))
|
|
1653
1660
|
return o;
|
|
1654
1661
|
if (!J(t)) {
|
|
1655
1662
|
let r = nt(t);
|
|
1656
1663
|
for (; r && !ht(r); ) {
|
|
1657
|
-
if (
|
|
1664
|
+
if (X(r) && !Ht(r))
|
|
1658
1665
|
return r;
|
|
1659
1666
|
r = nt(r);
|
|
1660
1667
|
}
|
|
1661
1668
|
return o;
|
|
1662
1669
|
}
|
|
1663
|
-
let i =
|
|
1664
|
-
for (; i &&
|
|
1665
|
-
i =
|
|
1666
|
-
return i && ht(i) && Ht(i) && !oe(i) ? o : i ||
|
|
1670
|
+
let i = pe(t, e);
|
|
1671
|
+
for (; i && wo(i) && Ht(i); )
|
|
1672
|
+
i = pe(i, e);
|
|
1673
|
+
return i && ht(i) && Ht(i) && !oe(i) ? o : i || yo(t) || o;
|
|
1667
1674
|
}
|
|
1668
|
-
const
|
|
1669
|
-
const e = this.getOffsetParent ||
|
|
1675
|
+
const Io = async function(t) {
|
|
1676
|
+
const e = this.getOffsetParent || Re, o = this.getDimensions, i = await o(t.floating);
|
|
1670
1677
|
return {
|
|
1671
|
-
reference:
|
|
1678
|
+
reference: Po(t.reference, await e(t.floating), t.strategy),
|
|
1672
1679
|
floating: {
|
|
1673
1680
|
x: 0,
|
|
1674
1681
|
y: 0,
|
|
@@ -1677,25 +1684,25 @@ const Lo = async function(t) {
|
|
|
1677
1684
|
}
|
|
1678
1685
|
};
|
|
1679
1686
|
};
|
|
1680
|
-
function
|
|
1681
|
-
return
|
|
1687
|
+
function Lo(t) {
|
|
1688
|
+
return Q(t).direction === "rtl";
|
|
1682
1689
|
}
|
|
1683
|
-
const
|
|
1684
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
1690
|
+
const Ho = {
|
|
1691
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: ko,
|
|
1685
1692
|
getDocumentElement: Z,
|
|
1686
|
-
getClippingRect:
|
|
1687
|
-
getOffsetParent:
|
|
1688
|
-
getElementRects:
|
|
1689
|
-
getClientRects:
|
|
1690
|
-
getDimensions:
|
|
1693
|
+
getClippingRect: Oo,
|
|
1694
|
+
getOffsetParent: Re,
|
|
1695
|
+
getElementRects: Io,
|
|
1696
|
+
getClientRects: Do,
|
|
1697
|
+
getDimensions: Ro,
|
|
1691
1698
|
getScale: ut,
|
|
1692
|
-
isElement:
|
|
1693
|
-
isRTL:
|
|
1699
|
+
isElement: X,
|
|
1700
|
+
isRTL: Lo
|
|
1694
1701
|
};
|
|
1695
|
-
function
|
|
1702
|
+
function Pe(t, e) {
|
|
1696
1703
|
return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
|
|
1697
1704
|
}
|
|
1698
|
-
function
|
|
1705
|
+
function zo(t, e) {
|
|
1699
1706
|
let o = null, i;
|
|
1700
1707
|
const r = Z(t);
|
|
1701
1708
|
function s() {
|
|
@@ -1712,9 +1719,9 @@ function Ho(t, e) {
|
|
|
1712
1719
|
} = c;
|
|
1713
1720
|
if (d || e(), !h || !u)
|
|
1714
1721
|
return;
|
|
1715
|
-
const p =
|
|
1716
|
-
rootMargin: -p + "px " + -m + "px " + -f + "px " + -
|
|
1717
|
-
threshold:
|
|
1722
|
+
const p = Dt(g), m = Dt(r.clientWidth - (l + h)), f = Dt(r.clientHeight - (g + u)), b = Dt(l), _ = {
|
|
1723
|
+
rootMargin: -p + "px " + -m + "px " + -f + "px " + -b + "px",
|
|
1724
|
+
threshold: N(0, it(1, a)) || 1
|
|
1718
1725
|
};
|
|
1719
1726
|
let S = !0;
|
|
1720
1727
|
function y(D) {
|
|
@@ -1726,7 +1733,7 @@ function Ho(t, e) {
|
|
|
1726
1733
|
n(!1, 1e-7);
|
|
1727
1734
|
}, 1e3);
|
|
1728
1735
|
}
|
|
1729
|
-
x === 1 && !
|
|
1736
|
+
x === 1 && !Pe(c, t.getBoundingClientRect()) && n(), S = !1;
|
|
1730
1737
|
}
|
|
1731
1738
|
try {
|
|
1732
1739
|
o = new IntersectionObserver(y, {
|
|
@@ -1741,7 +1748,7 @@ function Ho(t, e) {
|
|
|
1741
1748
|
}
|
|
1742
1749
|
return n(!0), s;
|
|
1743
1750
|
}
|
|
1744
|
-
function
|
|
1751
|
+
function Fo(t, e, o, i) {
|
|
1745
1752
|
i === void 0 && (i = {});
|
|
1746
1753
|
const {
|
|
1747
1754
|
ancestorScroll: r = !0,
|
|
@@ -1749,17 +1756,17 @@ function zo(t, e, o, i) {
|
|
|
1749
1756
|
elementResize: n = typeof ResizeObserver == "function",
|
|
1750
1757
|
layoutShift: d = typeof IntersectionObserver == "function",
|
|
1751
1758
|
animationFrame: a = !1
|
|
1752
|
-
} = i, c = re(t), l = r || s ? [...c ?
|
|
1753
|
-
l.forEach((
|
|
1754
|
-
r &&
|
|
1759
|
+
} = i, c = re(t), l = r || s ? [...c ? _t(c) : [], ..._t(e)] : [];
|
|
1760
|
+
l.forEach((b) => {
|
|
1761
|
+
r && b.addEventListener("scroll", o, {
|
|
1755
1762
|
passive: !0
|
|
1756
|
-
}), s &&
|
|
1763
|
+
}), s && b.addEventListener("resize", o);
|
|
1757
1764
|
});
|
|
1758
|
-
const g = c && d ?
|
|
1765
|
+
const g = c && d ? zo(c, o) : null;
|
|
1759
1766
|
let h = -1, u = null;
|
|
1760
|
-
n && (u = new ResizeObserver((
|
|
1761
|
-
let [
|
|
1762
|
-
|
|
1767
|
+
n && (u = new ResizeObserver((b) => {
|
|
1768
|
+
let [v] = b;
|
|
1769
|
+
v && v.target === c && u && (u.unobserve(e), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
|
|
1763
1770
|
var _;
|
|
1764
1771
|
(_ = u) == null || _.observe(e);
|
|
1765
1772
|
})), o();
|
|
@@ -1767,25 +1774,25 @@ function zo(t, e, o, i) {
|
|
|
1767
1774
|
let p, m = a ? lt(t) : null;
|
|
1768
1775
|
a && f();
|
|
1769
1776
|
function f() {
|
|
1770
|
-
const
|
|
1771
|
-
m && !
|
|
1777
|
+
const b = lt(t);
|
|
1778
|
+
m && !Pe(m, b) && o(), m = b, p = requestAnimationFrame(f);
|
|
1772
1779
|
}
|
|
1773
1780
|
return o(), () => {
|
|
1774
|
-
var
|
|
1775
|
-
l.forEach((
|
|
1776
|
-
r &&
|
|
1777
|
-
}), g == null || g(), (
|
|
1781
|
+
var b;
|
|
1782
|
+
l.forEach((v) => {
|
|
1783
|
+
r && v.removeEventListener("scroll", o), s && v.removeEventListener("resize", o);
|
|
1784
|
+
}), g == null || g(), (b = u) == null || b.disconnect(), u = null, a && cancelAnimationFrame(p);
|
|
1778
1785
|
};
|
|
1779
1786
|
}
|
|
1780
|
-
const Lt =
|
|
1787
|
+
const Lt = go, ne = uo, xt = ao, Vo = ho, qo = so, kt = (t, e, o) => {
|
|
1781
1788
|
const i = /* @__PURE__ */ new Map(), r = {
|
|
1782
|
-
platform:
|
|
1789
|
+
platform: Ho,
|
|
1783
1790
|
...o
|
|
1784
1791
|
}, s = {
|
|
1785
1792
|
...r.platform,
|
|
1786
1793
|
_c: i
|
|
1787
1794
|
};
|
|
1788
|
-
return
|
|
1795
|
+
return no(t, e, {
|
|
1789
1796
|
...r,
|
|
1790
1797
|
platform: s
|
|
1791
1798
|
});
|
|
@@ -1811,26 +1818,26 @@ function dt(t, e, o, i) {
|
|
|
1811
1818
|
const _ = { index: c, isHighlighted: l, isSelected: g, isDisabled: h };
|
|
1812
1819
|
return i.renderOptionCallback(a, _);
|
|
1813
1820
|
}
|
|
1814
|
-
const u =
|
|
1821
|
+
const u = Ct(a, i), p = Ke(a, i), m = We(a, i), f = ["wg__dropdown-option"];
|
|
1815
1822
|
l && f.push("wg__dropdown-option--highlighted"), g && f.push("wg__dropdown-option--selected"), h && f.push("wg__dropdown-option--disabled");
|
|
1816
|
-
const
|
|
1823
|
+
const b = p ? `<span class="wg__dropdown-option-icon">${t.escapeHtml(p)}</span>` : "", v = m ? `<span class="wg__dropdown-option-subtitle">${t.escapeHtml(m)}</span>` : "";
|
|
1817
1824
|
return `<div class="${f.join(" ")}" data-index="${c}" ${h ? 'data-disabled="true"' : ""}>
|
|
1818
|
-
${
|
|
1825
|
+
${b}
|
|
1819
1826
|
<div class="wg__dropdown-option-content">
|
|
1820
1827
|
<span class="wg__dropdown-option-label">${t.escapeHtml(u)}</span>
|
|
1821
|
-
${
|
|
1828
|
+
${v}
|
|
1822
1829
|
</div>
|
|
1823
1830
|
</div>`;
|
|
1824
1831
|
}).join("");
|
|
1825
1832
|
}
|
|
1826
|
-
return t.shadow.appendChild(r), t.dropdownOpen = !0,
|
|
1833
|
+
return t.shadow.appendChild(r), t.dropdownOpen = !0, kt(e, r, {
|
|
1827
1834
|
strategy: "fixed",
|
|
1828
1835
|
placement: "bottom-start",
|
|
1829
1836
|
middleware: [
|
|
1830
1837
|
// Add 1px gap to prevent sub-pixel overlap with cell border
|
|
1831
1838
|
Lt(1),
|
|
1832
|
-
|
|
1833
|
-
|
|
1839
|
+
xt({ fallbackPlacements: ["top-start"] }),
|
|
1840
|
+
Vo({
|
|
1834
1841
|
apply({ rects: n }) {
|
|
1835
1842
|
Object.assign(r.style, {
|
|
1836
1843
|
width: `${n.reference.width}px`
|
|
@@ -1849,7 +1856,7 @@ function L(t) {
|
|
|
1849
1856
|
const e = t.shadow.querySelector(".wg__dropdown");
|
|
1850
1857
|
e == null || e.remove(), t.dropdownOpen = !1, t.highlightedIndex = -1, t.filterText = "";
|
|
1851
1858
|
}
|
|
1852
|
-
function
|
|
1859
|
+
function Ie(t, e, o = !0) {
|
|
1853
1860
|
const i = t.dropdownOptions[e];
|
|
1854
1861
|
if (!i) return;
|
|
1855
1862
|
const r = t.grid.editingCell;
|
|
@@ -1876,17 +1883,17 @@ function et(t) {
|
|
|
1876
1883
|
i.classList.toggle("wg__dropdown-option--highlighted", r === t.highlightedIndex);
|
|
1877
1884
|
});
|
|
1878
1885
|
}
|
|
1879
|
-
function
|
|
1886
|
+
function fe(t) {
|
|
1880
1887
|
const e = t.shadow.querySelector(".wg__dropdown-option--highlighted");
|
|
1881
1888
|
e == null || e.scrollIntoView({ block: "nearest" });
|
|
1882
1889
|
}
|
|
1883
|
-
function
|
|
1890
|
+
function we(t, e) {
|
|
1884
1891
|
const o = t.shadow.querySelector(".wg__loading-indicator");
|
|
1885
1892
|
o && (o.style.display = e ? "inline" : "none");
|
|
1886
1893
|
const i = t.shadow.querySelector(".wg__editor--autocomplete .wg__combobox-toggle");
|
|
1887
1894
|
i && (i.style.display = e ? "none" : "inline");
|
|
1888
1895
|
}
|
|
1889
|
-
function
|
|
1896
|
+
function W(t) {
|
|
1890
1897
|
if (t.justSelected) return;
|
|
1891
1898
|
const e = t.getCurrentEditingColumn();
|
|
1892
1899
|
if (!e) return;
|
|
@@ -1896,7 +1903,7 @@ function K(t) {
|
|
|
1896
1903
|
const n = o.options || [];
|
|
1897
1904
|
if (t.filterText) {
|
|
1898
1905
|
const d = t.filterText.toLowerCase();
|
|
1899
|
-
t.dropdownOptions = n.filter((a) =>
|
|
1906
|
+
t.dropdownOptions = n.filter((a) => Ct(a, o).toLowerCase().includes(d)), r = t.dropdownOptions.length > 0 ? 0 : -1;
|
|
1900
1907
|
} else {
|
|
1901
1908
|
t.dropdownOptions = n;
|
|
1902
1909
|
const d = t.grid.editingCell;
|
|
@@ -1945,8 +1952,8 @@ function K(t) {
|
|
|
1945
1952
|
});
|
|
1946
1953
|
}
|
|
1947
1954
|
}
|
|
1948
|
-
function
|
|
1949
|
-
t.dropdownOpen ? L(t) :
|
|
1955
|
+
function me(t) {
|
|
1956
|
+
t.dropdownOpen ? L(t) : W(t);
|
|
1950
1957
|
}
|
|
1951
1958
|
function ct(t, e) {
|
|
1952
1959
|
e.addEventListener("mousedown", (o) => {
|
|
@@ -1954,16 +1961,16 @@ function ct(t, e) {
|
|
|
1954
1961
|
const i = o.target.closest(".wg__dropdown-option");
|
|
1955
1962
|
if (i && !i.hasAttribute("data-disabled")) {
|
|
1956
1963
|
const r = parseInt(i.getAttribute("data-index") || "0", 10);
|
|
1957
|
-
|
|
1964
|
+
Ie(t, r, !1);
|
|
1958
1965
|
}
|
|
1959
1966
|
}), e.addEventListener("mouseover", (o) => {
|
|
1960
1967
|
const i = o.target.closest(".wg__dropdown-option");
|
|
1961
1968
|
i && !i.hasAttribute("data-disabled") && (t.highlightedIndex = parseInt(i.getAttribute("data-index") || "0", 10), et(t));
|
|
1962
1969
|
});
|
|
1963
1970
|
}
|
|
1964
|
-
function
|
|
1971
|
+
function be(t, e) {
|
|
1965
1972
|
const o = e.options || [], i = t.filterText.toLowerCase(), r = t.filterText;
|
|
1966
|
-
t.dropdownOptions = o.filter((n) =>
|
|
1973
|
+
t.dropdownOptions = o.filter((n) => Ct(n, e).toLowerCase().includes(i)), t.highlightedIndex = t.dropdownOptions.length > 0 ? 0 : -1;
|
|
1967
1974
|
const s = t.shadow.querySelector(".wg__editor--select");
|
|
1968
1975
|
if (s)
|
|
1969
1976
|
if (t.dropdownOptions.length > 0) {
|
|
@@ -1972,7 +1979,7 @@ function me(t, e) {
|
|
|
1972
1979
|
} else
|
|
1973
1980
|
L(t);
|
|
1974
1981
|
}
|
|
1975
|
-
function
|
|
1982
|
+
function Yo(t, e) {
|
|
1976
1983
|
const o = e.target;
|
|
1977
1984
|
t.filterText = o.value, t.isUserFiltering = !0;
|
|
1978
1985
|
const i = t.getCurrentEditingColumn();
|
|
@@ -1980,7 +1987,7 @@ function qo(t, e) {
|
|
|
1980
1987
|
const r = i.editorOptions || {}, s = r.options || [];
|
|
1981
1988
|
if (t.filterText.trim()) {
|
|
1982
1989
|
const d = t.filterText.toLowerCase();
|
|
1983
|
-
t.dropdownOptions = s.filter((a) =>
|
|
1990
|
+
t.dropdownOptions = s.filter((a) => Ct(a, r).toLowerCase().includes(d));
|
|
1984
1991
|
} else
|
|
1985
1992
|
t.dropdownOptions = s;
|
|
1986
1993
|
t.highlightedIndex = t.dropdownOptions.length > 0 ? 0 : -1;
|
|
@@ -1990,7 +1997,7 @@ function qo(t, e) {
|
|
|
1990
1997
|
ct(t, d), t.highlightedIndex = t.dropdownOptions.length > 0 ? 0 : -1, et(t);
|
|
1991
1998
|
}
|
|
1992
1999
|
}
|
|
1993
|
-
function
|
|
2000
|
+
function No(t, e) {
|
|
1994
2001
|
const o = e.target;
|
|
1995
2002
|
t.filterText = o.value;
|
|
1996
2003
|
const i = t.getCurrentEditingColumn();
|
|
@@ -2011,15 +2018,15 @@ function Yo(t, e) {
|
|
|
2011
2018
|
return;
|
|
2012
2019
|
}
|
|
2013
2020
|
t.searchDebounceTimer = setTimeout(() => {
|
|
2014
|
-
|
|
2021
|
+
Uo(t, t.filterText, i);
|
|
2015
2022
|
}, s);
|
|
2016
2023
|
}
|
|
2017
|
-
async function
|
|
2024
|
+
async function Uo(t, e, o) {
|
|
2018
2025
|
const i = o.editorOptions || {};
|
|
2019
2026
|
if (!i.onSearchCallback) return;
|
|
2020
2027
|
t.searchAbortController && t.searchAbortController.abort(), t.searchAbortController = new AbortController();
|
|
2021
2028
|
const r = t.searchAbortController.signal;
|
|
2022
|
-
t.isSearching = !0,
|
|
2029
|
+
t.isSearching = !0, we(t, !0);
|
|
2023
2030
|
try {
|
|
2024
2031
|
const s = t.grid.editingCell;
|
|
2025
2032
|
if (!s) return;
|
|
@@ -2042,16 +2049,16 @@ async function No(t, e, o) {
|
|
|
2042
2049
|
ct(t, d);
|
|
2043
2050
|
}
|
|
2044
2051
|
} finally {
|
|
2045
|
-
r.aborted || (t.isSearching = !1,
|
|
2052
|
+
r.aborted || (t.isSearching = !1, we(t, !1));
|
|
2046
2053
|
}
|
|
2047
2054
|
}
|
|
2048
|
-
function
|
|
2055
|
+
function ve(t, e, o, i, r) {
|
|
2049
2056
|
const s = i ?? t.tooltipShowDelay;
|
|
2050
2057
|
t.tooltipHideTimer && (clearTimeout(t.tooltipHideTimer), t.tooltipHideTimer = null), !(t.tooltipElement && t.tooltipAnchor === e) && (t.tooltipShowTimer && clearTimeout(t.tooltipShowTimer), t.tooltipShowTimer = setTimeout(() => {
|
|
2051
|
-
|
|
2058
|
+
Bo(t, e, o, r);
|
|
2052
2059
|
}, s));
|
|
2053
2060
|
}
|
|
2054
|
-
function
|
|
2061
|
+
function jo(t, e) {
|
|
2055
2062
|
const o = e ?? t.tooltipHideDelay;
|
|
2056
2063
|
t.tooltipShowTimer && (clearTimeout(t.tooltipShowTimer), t.tooltipShowTimer = null), t.tooltipElement && (t.tooltipHideTimer = setTimeout(() => {
|
|
2057
2064
|
t.tooltipElement && (t.tooltipElement.classList.remove("wg__tooltip--visible"), setTimeout(() => {
|
|
@@ -2060,7 +2067,7 @@ function Uo(t, e) {
|
|
|
2060
2067
|
}, 100));
|
|
2061
2068
|
}, o));
|
|
2062
2069
|
}
|
|
2063
|
-
function
|
|
2070
|
+
function Bo(t, e, o, i) {
|
|
2064
2071
|
var d;
|
|
2065
2072
|
(d = t.tooltipElement) == null || d.remove();
|
|
2066
2073
|
const r = document.createElement("div");
|
|
@@ -2068,13 +2075,13 @@ function jo(t, e, o, i) {
|
|
|
2068
2075
|
const s = document.createElement("div");
|
|
2069
2076
|
s.className = "wg__tooltip-content", i ? s.innerHTML = o : s.textContent = o, r.appendChild(s);
|
|
2070
2077
|
const n = document.createElement("div");
|
|
2071
|
-
n.className = "wg__tooltip-arrow", r.appendChild(n), t.shadow.appendChild(r), t.tooltipElement = r, t.tooltipArrowElement = n, t.tooltipAnchor = e,
|
|
2078
|
+
n.className = "wg__tooltip-arrow", r.appendChild(n), t.shadow.appendChild(r), t.tooltipElement = r, t.tooltipArrowElement = n, t.tooltipAnchor = e, kt(e, r, {
|
|
2072
2079
|
strategy: "fixed",
|
|
2073
2080
|
placement: "top",
|
|
2074
2081
|
middleware: [
|
|
2075
2082
|
Lt(8),
|
|
2076
|
-
|
|
2077
|
-
|
|
2083
|
+
xt({ fallbackPlacements: ["bottom", "left", "right"] }),
|
|
2084
|
+
qo({ element: n })
|
|
2078
2085
|
]
|
|
2079
2086
|
}).then(({ x: a, y: c, placement: l, middlewareData: g }) => {
|
|
2080
2087
|
if (r.style.left = `${a}px`, r.style.top = `${c}px`, r.setAttribute("data-placement", l), g.arrow) {
|
|
@@ -2086,9 +2093,9 @@ function jo(t, e, o, i) {
|
|
|
2086
2093
|
});
|
|
2087
2094
|
});
|
|
2088
2095
|
}
|
|
2089
|
-
function
|
|
2096
|
+
function Ko(t, e, o) {
|
|
2090
2097
|
if (t.grid.shouldUseVirtualScroll()) {
|
|
2091
|
-
|
|
2098
|
+
Wo(t, e);
|
|
2092
2099
|
const n = t.shadow.querySelector(
|
|
2093
2100
|
`[data-row="${e}"][data-col="${o}"]`
|
|
2094
2101
|
);
|
|
@@ -2109,7 +2116,7 @@ function Bo(t, e, o) {
|
|
|
2109
2116
|
}
|
|
2110
2117
|
}
|
|
2111
2118
|
}
|
|
2112
|
-
function
|
|
2119
|
+
function Wo(t, e) {
|
|
2113
2120
|
const o = t.shadow.querySelector(".wg");
|
|
2114
2121
|
if (!o) return;
|
|
2115
2122
|
const i = t.grid.virtualScrollRowHeight, r = o.scrollTop, s = o.clientHeight, n = t.shadow.querySelector(".wg__header"), d = (n == null ? void 0 : n.offsetHeight) || 0, a = e * i, c = a + i, l = r + d, g = r + s;
|
|
@@ -2121,7 +2128,7 @@ function st(t, e) {
|
|
|
2121
2128
|
const i = t.grid.virtualScrollRowHeight, r = Math.max(0, (e - 1) * i), s = Math.max(0, o.scrollHeight - o.clientHeight);
|
|
2122
2129
|
o.scrollTop = Math.min(r, s);
|
|
2123
2130
|
}
|
|
2124
|
-
function
|
|
2131
|
+
function K(t, e, o) {
|
|
2125
2132
|
if (e) {
|
|
2126
2133
|
const i = t.shadow.querySelector(
|
|
2127
2134
|
`[data-row="${e.rowIndex}"][data-col="${e.colIndex}"]`
|
|
@@ -2135,7 +2142,7 @@ function B(t, e, o) {
|
|
|
2135
2142
|
i == null || i.classList.add("wg__cell--focused");
|
|
2136
2143
|
}
|
|
2137
2144
|
}
|
|
2138
|
-
function
|
|
2145
|
+
function Y(t) {
|
|
2139
2146
|
const e = t.grid.editingCell;
|
|
2140
2147
|
if (e) {
|
|
2141
2148
|
const o = t.grid.columns.findIndex((r) => String(r.field) === e.field), i = t.shadow.querySelector(
|
|
@@ -2144,16 +2151,16 @@ function F(t) {
|
|
|
2144
2151
|
i && i.classList.remove("wg__cell--editing");
|
|
2145
2152
|
}
|
|
2146
2153
|
}
|
|
2147
|
-
function
|
|
2154
|
+
function Xo(t, e, o) {
|
|
2148
2155
|
if (!t.grid.isNavigateMode) return;
|
|
2149
2156
|
const i = t.grid.focusedCell, r = { rowIndex: e, colIndex: o };
|
|
2150
|
-
t.grid.setFocusedCell(e, o),
|
|
2157
|
+
t.grid.setFocusedCell(e, o), K(t, i, r);
|
|
2151
2158
|
}
|
|
2152
|
-
function
|
|
2159
|
+
function $(t, e, o) {
|
|
2153
2160
|
const i = t.grid.focusedCell, r = { rowIndex: e, colIndex: o };
|
|
2154
|
-
t.grid.setFocusedCell(e, o),
|
|
2161
|
+
t.grid.setFocusedCell(e, o), K(t, i, r), Ko(t, e, o);
|
|
2155
2162
|
}
|
|
2156
|
-
function
|
|
2163
|
+
function B(t, e, o, i) {
|
|
2157
2164
|
const s = t.grid.columns[o];
|
|
2158
2165
|
if (!s || !t.grid.isCellEditable(s))
|
|
2159
2166
|
return;
|
|
@@ -2187,14 +2194,14 @@ function zt(t, e) {
|
|
|
2187
2194
|
}
|
|
2188
2195
|
return a;
|
|
2189
2196
|
}
|
|
2190
|
-
function
|
|
2197
|
+
function Qo(t, e) {
|
|
2191
2198
|
const o = e.relatedTarget, i = t.shadow.querySelector(".wg__table");
|
|
2192
2199
|
if (!o || !(i != null && i.contains(o))) {
|
|
2193
2200
|
const r = t.grid.focusedCell;
|
|
2194
|
-
t.grid.clearFocusedCell(),
|
|
2201
|
+
t.grid.clearFocusedCell(), K(t, r, null);
|
|
2195
2202
|
}
|
|
2196
2203
|
}
|
|
2197
|
-
function
|
|
2204
|
+
function Go(t, e) {
|
|
2198
2205
|
if (!t) return null;
|
|
2199
2206
|
const [o, i, r] = t.split("-").map(Number), s = new Date(o, i - 1, r);
|
|
2200
2207
|
if (isNaN(s.getTime())) return null;
|
|
@@ -2208,21 +2215,21 @@ function Qo(t, e) {
|
|
|
2208
2215
|
return t;
|
|
2209
2216
|
}
|
|
2210
2217
|
}
|
|
2211
|
-
function
|
|
2218
|
+
function Mt(t, e) {
|
|
2212
2219
|
const o = parseInt(e.dataset.row || "0", 10), i = e.dataset.field || "";
|
|
2213
2220
|
let r;
|
|
2214
2221
|
if (e instanceof HTMLInputElement)
|
|
2215
2222
|
if (e.type === "checkbox") {
|
|
2216
2223
|
const s = JSON.parse(e.dataset.trueValue || "true"), n = JSON.parse(e.dataset.falseValue || "false");
|
|
2217
2224
|
r = e.checked ? s : n;
|
|
2218
|
-
} else e.classList.contains("wg__editor--number") ? r = e.value === "" ? null : parseFloat(e.value) : e.type === "date" ? r =
|
|
2225
|
+
} else e.classList.contains("wg__editor--number") ? r = e.value === "" ? null : parseFloat(e.value) : e.type === "date" ? r = Go(e.value, e.dataset.outputFormat || "iso") : r = e.value;
|
|
2219
2226
|
else e instanceof HTMLSelectElement && (r = e.value);
|
|
2220
2227
|
t.grid.commitEdit(o, i, r);
|
|
2221
2228
|
}
|
|
2222
|
-
function
|
|
2223
|
-
|
|
2229
|
+
function Jo(t, e) {
|
|
2230
|
+
Mt(t, e);
|
|
2224
2231
|
}
|
|
2225
|
-
function
|
|
2232
|
+
function Zo(t, e, o) {
|
|
2226
2233
|
const i = t.grid.columns[o];
|
|
2227
2234
|
if (!i) return;
|
|
2228
2235
|
const r = String(i.field), s = t.grid.displayItems[e];
|
|
@@ -2231,11 +2238,11 @@ function Jo(t, e, o) {
|
|
|
2231
2238
|
t.grid.commitEdit(e, r, l);
|
|
2232
2239
|
const g = t.grid.displayItems;
|
|
2233
2240
|
e < g.length - 1 && requestAnimationFrame(() => {
|
|
2234
|
-
|
|
2241
|
+
$(t, e + 1, o);
|
|
2235
2242
|
});
|
|
2236
2243
|
}
|
|
2237
|
-
function
|
|
2238
|
-
t.isCommittingFromKeyboard || t.grid.editingCell &&
|
|
2244
|
+
function ti(t, e) {
|
|
2245
|
+
t.isCommittingFromKeyboard || t.grid.editingCell && Mt(t, e);
|
|
2239
2246
|
}
|
|
2240
2247
|
function Ft(t, e, o, i) {
|
|
2241
2248
|
const s = t.grid.columns.findIndex((c) => String(c.field) === o), n = t.grid.displayItems;
|
|
@@ -2249,38 +2256,38 @@ function Ft(t, e, o, i) {
|
|
|
2249
2256
|
i === "next" ? l >= 0 && l < c.length - 1 ? a = c[l + 1].index : e < n.length - 1 && (d = e + 1, a = c[0].index) : l > 0 ? a = c[l - 1].index : e > 0 && (d = e - 1, a = c[c.length - 1].index);
|
|
2250
2257
|
}
|
|
2251
2258
|
requestAnimationFrame(() => {
|
|
2252
|
-
|
|
2259
|
+
$(t, d, a), t.isCommittingFromKeyboard = !1;
|
|
2253
2260
|
});
|
|
2254
2261
|
}
|
|
2255
|
-
function
|
|
2262
|
+
function ei(t, e, o) {
|
|
2256
2263
|
const r = t.grid.columns.findIndex((s) => String(s.field) === o);
|
|
2257
2264
|
r >= 0 && requestAnimationFrame(() => {
|
|
2258
|
-
|
|
2265
|
+
$(t, e, r), t.isCommittingFromKeyboard = !1;
|
|
2259
2266
|
});
|
|
2260
2267
|
}
|
|
2261
|
-
function
|
|
2268
|
+
function Le(t, e, o, i) {
|
|
2262
2269
|
const r = String(i.field), s = t.grid.displayItems[e], n = t.grid.getCellRawValue(s, e, r);
|
|
2263
2270
|
switch (i.editor || "text") {
|
|
2264
2271
|
case "checkbox":
|
|
2265
|
-
return
|
|
2272
|
+
return si(t, e, r, n, i);
|
|
2266
2273
|
case "number":
|
|
2267
|
-
return oi(t, e, r, n, i);
|
|
2268
|
-
case "date":
|
|
2269
2274
|
return ii(t, e, r, n, i);
|
|
2275
|
+
case "date":
|
|
2276
|
+
return ri(t, e, r, n, i);
|
|
2270
2277
|
case "select":
|
|
2271
|
-
return si(t, e, r, n, i);
|
|
2272
|
-
case "combobox":
|
|
2273
2278
|
return ai(t, e, r, n, i);
|
|
2274
|
-
case "
|
|
2279
|
+
case "combobox":
|
|
2275
2280
|
return li(t, e, r, n, i);
|
|
2276
|
-
case "
|
|
2281
|
+
case "autocomplete":
|
|
2277
2282
|
return di(t, e, r, n, i);
|
|
2283
|
+
case "custom":
|
|
2284
|
+
return ci(t, e, r, n, i);
|
|
2278
2285
|
case "text":
|
|
2279
2286
|
default:
|
|
2280
|
-
return
|
|
2287
|
+
return oi(t, e, r, n, i);
|
|
2281
2288
|
}
|
|
2282
2289
|
}
|
|
2283
|
-
function
|
|
2290
|
+
function oi(t, e, o, i, r) {
|
|
2284
2291
|
var a;
|
|
2285
2292
|
const s = r.editorOptions || {}, n = (a = t.grid.editingCell) == null ? void 0 : a.initialSearchQuery, d = n !== void 0 ? n : i != null ? String(i) : "";
|
|
2286
2293
|
return `
|
|
@@ -2296,7 +2303,7 @@ function ei(t, e, o, i, r) {
|
|
|
2296
2303
|
/>
|
|
2297
2304
|
`;
|
|
2298
2305
|
}
|
|
2299
|
-
function
|
|
2306
|
+
function ii(t, e, o, i, r) {
|
|
2300
2307
|
var d;
|
|
2301
2308
|
r.editorOptions;
|
|
2302
2309
|
const s = (d = t.grid.editingCell) == null ? void 0 : d.initialSearchQuery;
|
|
@@ -2311,9 +2318,9 @@ function oi(t, e, o, i, r) {
|
|
|
2311
2318
|
/>
|
|
2312
2319
|
`;
|
|
2313
2320
|
}
|
|
2314
|
-
function
|
|
2321
|
+
function ri(t, e, o, i, r) {
|
|
2315
2322
|
var c;
|
|
2316
|
-
const s = r.editorOptions || {}, n = (c = t.grid.editingCell) == null ? void 0 : c.initialSearchQuery, d = Vt(i), a = n !== void 0 ? n :
|
|
2323
|
+
const s = r.editorOptions || {}, n = (c = t.grid.editingCell) == null ? void 0 : c.initialSearchQuery, d = Vt(i), a = n !== void 0 ? n : ni(i, s.dateFormat);
|
|
2317
2324
|
return `
|
|
2318
2325
|
<div class="wg__editor wg__editor--date" data-row="${e}" data-field="${o}">
|
|
2319
2326
|
<input
|
|
@@ -2335,7 +2342,7 @@ function ii(t, e, o, i, r) {
|
|
|
2335
2342
|
</div>
|
|
2336
2343
|
`;
|
|
2337
2344
|
}
|
|
2338
|
-
function
|
|
2345
|
+
function ni(t, e) {
|
|
2339
2346
|
if (!t) return "";
|
|
2340
2347
|
let o = null;
|
|
2341
2348
|
if (t instanceof Date ? o = t : typeof t == "number" ? o = new Date(t) : typeof t == "string" && (o = new Date(t)), !o || isNaN(o.getTime())) return "";
|
|
@@ -2349,7 +2356,7 @@ function Vt(t) {
|
|
|
2349
2356
|
const o = e.getFullYear(), i = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
|
|
2350
2357
|
return `${o}-${i}-${r}`;
|
|
2351
2358
|
}
|
|
2352
|
-
function
|
|
2359
|
+
function si(t, e, o, i, r) {
|
|
2353
2360
|
const s = r.editorOptions || {}, n = s.trueValue !== void 0 ? s.trueValue : !0;
|
|
2354
2361
|
return `
|
|
2355
2362
|
<input
|
|
@@ -2363,7 +2370,7 @@ function ni(t, e, o, i, r) {
|
|
|
2363
2370
|
/>
|
|
2364
2371
|
`;
|
|
2365
2372
|
}
|
|
2366
|
-
function
|
|
2373
|
+
function ai(t, e, o, i, r) {
|
|
2367
2374
|
var c;
|
|
2368
2375
|
const s = r.editorOptions || {}, n = s.options || [], d = Jt(i, n, s), a = (c = t.grid.editingCell) == null ? void 0 : c.initialSearchQuery;
|
|
2369
2376
|
return t.dropdownOptions = n, t.filterText = a || "", t.highlightedIndex = n.findIndex((l) => at(l, s) === i), t.highlightedIndex < 0 && n.length > 0 && (t.highlightedIndex = 0), `
|
|
@@ -2380,7 +2387,7 @@ function si(t, e, o, i, r) {
|
|
|
2380
2387
|
</div>
|
|
2381
2388
|
`;
|
|
2382
2389
|
}
|
|
2383
|
-
function
|
|
2390
|
+
function li(t, e, o, i, r) {
|
|
2384
2391
|
var l;
|
|
2385
2392
|
const s = r.editorOptions || {}, n = s.options || [], d = Jt(i, n, s), a = (l = t.grid.editingCell) == null ? void 0 : l.initialSearchQuery, c = a !== void 0 ? a : d;
|
|
2386
2393
|
return t.dropdownOptions = n, t.filterText = c, t.highlightedIndex = n.length > 0 ? 0 : -1, `
|
|
@@ -2396,7 +2403,7 @@ function ai(t, e, o, i, r) {
|
|
|
2396
2403
|
</div>
|
|
2397
2404
|
`;
|
|
2398
2405
|
}
|
|
2399
|
-
function
|
|
2406
|
+
function di(t, e, o, i, r) {
|
|
2400
2407
|
var l;
|
|
2401
2408
|
const s = r.editorOptions || {}, n = s.initialOptions || s.options || [], d = Jt(i, n, s), a = (l = t.grid.editingCell) == null ? void 0 : l.initialSearchQuery, c = a !== void 0 ? a : d;
|
|
2402
2409
|
return t.dropdownOptions = n, t.filterText = c, t.highlightedIndex = n.length > 0 ? 0 : -1, `
|
|
@@ -2414,7 +2421,7 @@ function li(t, e, o, i, r) {
|
|
|
2414
2421
|
</div>
|
|
2415
2422
|
`;
|
|
2416
2423
|
}
|
|
2417
|
-
function
|
|
2424
|
+
function ci(t, e, o, i, r) {
|
|
2418
2425
|
const s = r.formatCallback ? r.formatCallback(i, t.grid.displayItems[e]) : i != null ? String(i) : "";
|
|
2419
2426
|
return `
|
|
2420
2427
|
<div
|
|
@@ -2427,7 +2434,7 @@ function di(t, e, o, i, r) {
|
|
|
2427
2434
|
</div>
|
|
2428
2435
|
`;
|
|
2429
2436
|
}
|
|
2430
|
-
function
|
|
2437
|
+
function He(t, e, o, i, r, s) {
|
|
2431
2438
|
const n = i.editor === "select" || i.editor === "combobox" || i.editor === "autocomplete", d = i.editor === "date", a = String(i.field);
|
|
2432
2439
|
return n ? `
|
|
2433
2440
|
<div class="wg__cell-dropdown-display ${t.grid.getEffectiveToggleVisibility(i) === "on-focus" ? "wg__cell-dropdown-display--toggle-on-focus" : ""}" data-row="${e}" data-field="${a}">
|
|
@@ -2443,22 +2450,22 @@ function Pe(t, e, o, i, r, s) {
|
|
|
2443
2450
|
</div>
|
|
2444
2451
|
` : i.templateCallback ? `<span class="wg__cell-text">${r}</span>` : `<span class="wg__cell-text">${t.escapeHtml(r)}</span>`;
|
|
2445
2452
|
}
|
|
2446
|
-
let
|
|
2453
|
+
let I = {
|
|
2447
2454
|
path: null,
|
|
2448
2455
|
arrowPos: null,
|
|
2449
2456
|
arrowDir: "right"
|
|
2450
2457
|
};
|
|
2451
|
-
const
|
|
2458
|
+
const gi = {
|
|
2452
2459
|
add: { icon: "+", title: "Add row" },
|
|
2453
2460
|
delete: { icon: "−", title: "Delete row", danger: !0 },
|
|
2454
2461
|
duplicate: { icon: "⧉", title: "Duplicate row" },
|
|
2455
2462
|
moveUp: { icon: "↑", title: "Move up" },
|
|
2456
2463
|
moveDown: { icon: "↓", title: "Move down" }
|
|
2457
2464
|
};
|
|
2458
|
-
function
|
|
2465
|
+
function ui(t) {
|
|
2459
2466
|
return t.map((e, o) => {
|
|
2460
2467
|
if (typeof e == "string") {
|
|
2461
|
-
const i =
|
|
2468
|
+
const i = gi[e];
|
|
2462
2469
|
return i ? {
|
|
2463
2470
|
id: e,
|
|
2464
2471
|
icon: i.icon,
|
|
@@ -2483,7 +2490,7 @@ function gi(t) {
|
|
|
2483
2490
|
};
|
|
2484
2491
|
}).filter((e) => e !== null);
|
|
2485
2492
|
}
|
|
2486
|
-
function
|
|
2493
|
+
function hi(t) {
|
|
2487
2494
|
const e = /* @__PURE__ */ new Map();
|
|
2488
2495
|
for (const r of t) {
|
|
2489
2496
|
const s = r.row;
|
|
@@ -2507,8 +2514,8 @@ function ui(t) {
|
|
|
2507
2514
|
}
|
|
2508
2515
|
return o;
|
|
2509
2516
|
}
|
|
2510
|
-
function
|
|
2511
|
-
return `<div class="wg__toolbar">${
|
|
2517
|
+
function pi(t, e, o) {
|
|
2518
|
+
return `<div class="wg__toolbar">${hi(t).map(({ groups: s }) => `<div class="wg__toolbar-row">${s.map(({ items: d }, a) => {
|
|
2512
2519
|
const c = a > 0 ? '<div class="wg__toolbar-divider"></div>' : "", l = d.map((g) => {
|
|
2513
2520
|
const h = typeof g.disabled == "function" ? g.disabled(e, o) : g.disabled, u = [
|
|
2514
2521
|
"wg__toolbar-btn",
|
|
@@ -2524,36 +2531,58 @@ function hi(t, e, o) {
|
|
|
2524
2531
|
return c + l;
|
|
2525
2532
|
}).join("")}</div>`).join("")}</div>`;
|
|
2526
2533
|
}
|
|
2527
|
-
let
|
|
2528
|
-
function
|
|
2529
|
-
|
|
2530
|
-
const d =
|
|
2534
|
+
let M = null;
|
|
2535
|
+
function fi(t, e, o, i, r, s, n) {
|
|
2536
|
+
At();
|
|
2537
|
+
const d = pi(i, r, o), a = document.createElement("div");
|
|
2531
2538
|
a.className = "wg__toolbar-container", a.innerHTML = d, t.shadow.appendChild(a);
|
|
2532
2539
|
const c = a.querySelector(".wg__toolbar");
|
|
2533
2540
|
let l = "left";
|
|
2534
|
-
requestAnimationFrame(() => {
|
|
2541
|
+
c.style.position = "fixed", c.style.visibility = "hidden", requestAnimationFrame(() => {
|
|
2535
2542
|
const h = t.shadow.querySelector(`tr[data-row-index="${o}"]`);
|
|
2536
2543
|
if (!h) {
|
|
2537
|
-
|
|
2544
|
+
At();
|
|
2538
2545
|
return;
|
|
2539
2546
|
}
|
|
2540
|
-
const u =
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2547
|
+
const u = t.grid.toolbarPosition, p = t.grid.toolbarAlign, m = t.grid.toolbarTopPosition;
|
|
2548
|
+
let f, b;
|
|
2549
|
+
const v = p === "top" ? "-start" : "", _ = () => m === "start" ? "top-start" : m === "end" ? "top-end" : "top";
|
|
2550
|
+
u === "left" ? (f = `left${v}`, b = [`right${v}`, _()]) : u === "right" ? (f = `right${v}`, b = [`left${v}`, _()]) : u === "top" ? (f = _(), b = [`left${v}`, `right${v}`]) : (f = `left${v}`, b = [`right${v}`, _()]);
|
|
2551
|
+
let S = h;
|
|
2552
|
+
if (m === "cursor" && n !== void 0 && u === "top") {
|
|
2553
|
+
const y = h.getBoundingClientRect();
|
|
2554
|
+
S = {
|
|
2555
|
+
getBoundingClientRect: () => ({
|
|
2556
|
+
x: n,
|
|
2557
|
+
y: y.top,
|
|
2558
|
+
top: y.top,
|
|
2559
|
+
left: n,
|
|
2560
|
+
bottom: y.bottom,
|
|
2561
|
+
right: n,
|
|
2562
|
+
width: 0,
|
|
2563
|
+
height: y.height,
|
|
2564
|
+
toJSON: () => ({})
|
|
2565
|
+
})
|
|
2566
|
+
};
|
|
2551
2567
|
}
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2568
|
+
kt(S, c, {
|
|
2569
|
+
strategy: "fixed",
|
|
2570
|
+
placement: f,
|
|
2571
|
+
middleware: [
|
|
2572
|
+
xt({ fallbackPlacements: b }),
|
|
2573
|
+
ne({ padding: 8 })
|
|
2574
|
+
// Keep within viewport
|
|
2575
|
+
]
|
|
2576
|
+
}).then(({ x: y, y: D, placement: x }) => {
|
|
2577
|
+
Object.assign(c.style, {
|
|
2578
|
+
left: `${y}px`,
|
|
2579
|
+
top: `${D}px`,
|
|
2580
|
+
visibility: "visible"
|
|
2581
|
+
// Show now that it's positioned
|
|
2582
|
+
}), l = x.split("-")[0], M && (M.position = l);
|
|
2583
|
+
}).catch(() => {
|
|
2584
|
+
c.style.visibility = "visible";
|
|
2585
|
+
});
|
|
2557
2586
|
});
|
|
2558
2587
|
const g = (h) => {
|
|
2559
2588
|
const u = h.target.closest(".wg__toolbar-btn");
|
|
@@ -2562,7 +2591,7 @@ function pi(t, e, o, i, r, s, n) {
|
|
|
2562
2591
|
m && s(m);
|
|
2563
2592
|
}
|
|
2564
2593
|
};
|
|
2565
|
-
a.addEventListener("click", g),
|
|
2594
|
+
a.addEventListener("click", g), M = {
|
|
2566
2595
|
container: a,
|
|
2567
2596
|
toolbar: c,
|
|
2568
2597
|
rowIndex: o,
|
|
@@ -2573,80 +2602,89 @@ function pi(t, e, o, i, r, s, n) {
|
|
|
2573
2602
|
cleanup: () => {
|
|
2574
2603
|
a.removeEventListener("click", g), a.remove();
|
|
2575
2604
|
}
|
|
2576
|
-
},
|
|
2605
|
+
}, I = { path: null, arrowPos: null, arrowDir: "right" };
|
|
2577
2606
|
}
|
|
2578
|
-
function
|
|
2579
|
-
|
|
2607
|
+
function At() {
|
|
2608
|
+
M && (M.cleanup(), M = null), I = { path: null, arrowPos: null, arrowDir: "right" };
|
|
2580
2609
|
}
|
|
2581
|
-
function
|
|
2582
|
-
return (
|
|
2610
|
+
function bt() {
|
|
2611
|
+
return (M == null ? void 0 : M.rowIndex) ?? null;
|
|
2583
2612
|
}
|
|
2584
|
-
function
|
|
2585
|
-
return (
|
|
2613
|
+
function wi(t) {
|
|
2614
|
+
return (M == null ? void 0 : M.container.getRootNode()) === t;
|
|
2586
2615
|
}
|
|
2587
2616
|
function qt(t) {
|
|
2588
|
-
return (
|
|
2617
|
+
return (M == null ? void 0 : M.rowIndex) === t;
|
|
2589
2618
|
}
|
|
2590
|
-
function
|
|
2591
|
-
return
|
|
2619
|
+
function mi() {
|
|
2620
|
+
return I;
|
|
2592
2621
|
}
|
|
2593
|
-
function
|
|
2594
|
-
if (
|
|
2595
|
-
|
|
2622
|
+
function _e(t, e) {
|
|
2623
|
+
if (!M) {
|
|
2624
|
+
I = { path: null, arrowPos: null, arrowDir: "right" };
|
|
2596
2625
|
return;
|
|
2597
2626
|
}
|
|
2598
|
-
const { toolbar: o, rowItem: i, position: r } =
|
|
2627
|
+
const { toolbar: o, rowItem: i, position: r } = M, s = e.findIndex((y) => y === i);
|
|
2599
2628
|
if (s === -1) {
|
|
2600
|
-
|
|
2629
|
+
I = { path: null, arrowPos: null, arrowDir: "right" };
|
|
2601
2630
|
return;
|
|
2602
2631
|
}
|
|
2603
2632
|
const n = t.shadow.querySelector(`tr[data-row-index="${s}"]`);
|
|
2604
2633
|
if (!n) {
|
|
2605
|
-
|
|
2634
|
+
I = { path: null, arrowPos: null, arrowDir: "right" };
|
|
2606
2635
|
return;
|
|
2607
2636
|
}
|
|
2608
|
-
if (s ===
|
|
2609
|
-
|
|
2637
|
+
if (s === M.rowIndex || (M.hasRowMoved = !0), !M.hasRowMoved) {
|
|
2638
|
+
I = { path: null, arrowPos: null, arrowDir: "right" };
|
|
2610
2639
|
return;
|
|
2611
2640
|
}
|
|
2612
|
-
const a = o.getBoundingClientRect(), c = n.getBoundingClientRect(), l = t.shadow.querySelector(".wg__table"), g = l == null ? void 0 : l.getBoundingClientRect();
|
|
2613
|
-
if (!g) {
|
|
2614
|
-
|
|
2641
|
+
const a = o.getBoundingClientRect(), c = n.getBoundingClientRect(), l = t.shadow.querySelector(".wg__table"), g = l == null ? void 0 : l.getBoundingClientRect(), h = t.shadow.querySelector(".wg"), u = h == null ? void 0 : h.getBoundingClientRect();
|
|
2642
|
+
if (!g || !u) {
|
|
2643
|
+
I = { path: null, arrowPos: null, arrowDir: "right" };
|
|
2615
2644
|
return;
|
|
2616
2645
|
}
|
|
2617
|
-
const
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2646
|
+
const p = document.dir === "rtl" || document.documentElement.dir === "rtl", m = c.top + c.height / 2, f = c.bottom <= u.top, b = c.top >= u.bottom, v = !f && !b;
|
|
2647
|
+
let _, S = "right";
|
|
2648
|
+
if (f ? (_ = u.top + 8, S = "up") : b ? (_ = u.bottom - 8, S = "down") : _ = m, r === "left") {
|
|
2649
|
+
const y = a.right, D = a.top + a.height / 2, x = p ? u.right + 15 : u.left - 15;
|
|
2650
|
+
if (!v) {
|
|
2651
|
+
I = { path: `M ${y} ${D} H ${x} V ${_}`, arrowPos: { x, y: _ }, arrowDir: S };
|
|
2652
|
+
return;
|
|
2653
|
+
}
|
|
2654
|
+
const C = p ? u.right - 8 : u.left + 8;
|
|
2655
|
+
S = p ? "left" : "right", I = { path: `M ${y} ${D} H ${x} V ${_} H ${C}`, arrowPos: { x: C, y: _ }, arrowDir: S };
|
|
2656
|
+
return;
|
|
2624
2657
|
} else if (r === "right") {
|
|
2625
|
-
const
|
|
2626
|
-
|
|
2658
|
+
const y = a.left, D = a.top + a.height / 2, x = p ? u.left - 15 : u.right + 15;
|
|
2659
|
+
if (!v) {
|
|
2660
|
+
I = { path: `M ${y} ${D} H ${x} V ${_}`, arrowPos: { x, y: _ }, arrowDir: S };
|
|
2661
|
+
return;
|
|
2662
|
+
}
|
|
2663
|
+
const C = p ? u.left + 8 : u.right - 8;
|
|
2664
|
+
S = p ? "right" : "left", I = { path: `M ${y} ${D} H ${x} V ${_} H ${C}`, arrowPos: { x: C, y: _ }, arrowDir: S };
|
|
2665
|
+
return;
|
|
2627
2666
|
} else {
|
|
2628
|
-
const
|
|
2629
|
-
if (
|
|
2630
|
-
|
|
2631
|
-
|
|
2667
|
+
const D = a.right, x = a.top + a.height / 2, C = D + 48, T = s - M.rowIndex, k = 8;
|
|
2668
|
+
if (T === 0) {
|
|
2669
|
+
let E = c.top - k;
|
|
2670
|
+
b && (E = u.bottom - k), I = { path: `M ${D} ${x} H ${C} V ${E}`, arrowPos: { x: C, y: E }, arrowDir: "down" };
|
|
2632
2671
|
return;
|
|
2633
|
-
} else if (
|
|
2634
|
-
const
|
|
2635
|
-
|
|
2672
|
+
} else if (T === -1) {
|
|
2673
|
+
const A = a.top + a.height * 0.25, H = a.top + a.height * 0.75, O = a.right + 24, R = a.right + k;
|
|
2674
|
+
I = { path: `M ${a.right} ${A} H ${O} V ${H} H ${R}`, arrowPos: { x: R, y: H }, arrowDir: "left" };
|
|
2636
2675
|
return;
|
|
2637
|
-
} else if (
|
|
2638
|
-
|
|
2639
|
-
f = `M ${
|
|
2676
|
+
} else if (T < 0) {
|
|
2677
|
+
let E = c.bottom + k;
|
|
2678
|
+
f && (E = u.top + k), I = { path: `M ${D} ${x} H ${C} V ${E}`, arrowPos: { x: C, y: E }, arrowDir: "up" };
|
|
2640
2679
|
return;
|
|
2641
2680
|
} else {
|
|
2642
|
-
|
|
2643
|
-
|
|
2681
|
+
let E = c.top - k;
|
|
2682
|
+
b && (E = u.bottom - k), I = { path: `M ${D} ${x} H ${C} V ${E}`, arrowPos: { x: C, y: E }, arrowDir: "down" };
|
|
2644
2683
|
return;
|
|
2645
2684
|
}
|
|
2646
2685
|
}
|
|
2647
|
-
V = { path: f, arrowPos: { x: p, y: m }, arrowDir: v };
|
|
2648
2686
|
}
|
|
2649
|
-
function
|
|
2687
|
+
function ze(t, e) {
|
|
2650
2688
|
return `<button
|
|
2651
2689
|
class="wg__toolbar-trigger ${e ? "wg__toolbar-trigger--active" : ""}"
|
|
2652
2690
|
data-toolbar-trigger="${t}"
|
|
@@ -2671,16 +2709,16 @@ function vi(t) {
|
|
|
2671
2709
|
let f = "";
|
|
2672
2710
|
if (a)
|
|
2673
2711
|
if (g) {
|
|
2674
|
-
const
|
|
2675
|
-
f = `<span class="wg__sort-indicator">${
|
|
2712
|
+
const v = c.direction === "asc" ? "▲" : "▼", _ = t.grid.sort.length > 1 ? `<sup class="wg__sort-priority">${l}</sup>` : "";
|
|
2713
|
+
f = `<span class="wg__sort-indicator">${v}${_}</span>`;
|
|
2676
2714
|
} else
|
|
2677
2715
|
f = '<span class="wg__sort-indicator wg__sort-placeholder">⬍</span>';
|
|
2678
|
-
let
|
|
2679
|
-
return n.headerInfo && (
|
|
2716
|
+
let b = "";
|
|
2717
|
+
return n.headerInfo && (b = `<span class="wg__header-info" data-tooltip="${t.escapeHtml(n.headerInfo)}"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg></span>`), `
|
|
2680
2718
|
<th class="${h.join(" ")}" ${m} data-field="${d}">
|
|
2681
2719
|
<div class="wg__header-content">
|
|
2682
2720
|
<span class="wg__header-title">${t.escapeHtml(n.title)}</span>
|
|
2683
|
-
${
|
|
2721
|
+
${b}
|
|
2684
2722
|
${f}
|
|
2685
2723
|
</div>
|
|
2686
2724
|
</th>
|
|
@@ -2698,23 +2736,23 @@ function _i(t) {
|
|
|
2698
2736
|
</td>
|
|
2699
2737
|
</tr>
|
|
2700
2738
|
`;
|
|
2701
|
-
const n =
|
|
2739
|
+
const n = bt();
|
|
2702
2740
|
return e.map((d, a) => {
|
|
2703
2741
|
const c = i ? `<td class="wg__cell wg__row-number">${a + 1}</td>` : "";
|
|
2704
2742
|
let l = "";
|
|
2705
2743
|
r && (l = `
|
|
2706
2744
|
<td class="wg__cell wg__actions-column">
|
|
2707
|
-
${
|
|
2745
|
+
${ze(a, n === a)}
|
|
2708
2746
|
</td>
|
|
2709
2747
|
`);
|
|
2710
2748
|
const g = o.map((u, p) => {
|
|
2711
|
-
const m = String(u.field), f = t.grid.getCellValue(d, u, a),
|
|
2712
|
-
if (
|
|
2749
|
+
const m = String(u.field), f = t.grid.getCellValue(d, u, a), b = u.align || "left", v = t.grid.isCellEditable(u), _ = t.grid.isCellFocused(a, p), S = ["wg__cell"], y = t.grid.isEditing(a, m);
|
|
2750
|
+
if (v && S.push("wg__cell--editable"), _ && !y && S.push("wg__cell--focused"), u.textOverflow === "ellipsis" && S.push("wg__cell--ellipsis"), y && S.push("wg__cell--editing"), t.grid.isCellInvalid(a, m) && S.push("wg__cell--invalid"), u.cellClass && S.push(u.cellClass), u.cellClassCallback) {
|
|
2713
2751
|
const T = t.grid.getCellRawValue(d, a, m), k = u.cellClassCallback(T, d);
|
|
2714
2752
|
k && S.push(k);
|
|
2715
2753
|
}
|
|
2716
2754
|
const D = [
|
|
2717
|
-
`text-align: ${
|
|
2755
|
+
`text-align: ${b}`,
|
|
2718
2756
|
u.width ? `width: ${u.width}` : "",
|
|
2719
2757
|
u.minWidth ? `min-width: ${u.minWidth}` : "",
|
|
2720
2758
|
u.maxWidth ? `max-width: ${u.maxWidth}` : ""
|
|
@@ -2732,14 +2770,14 @@ function _i(t) {
|
|
|
2732
2770
|
if (T) {
|
|
2733
2771
|
const k = u.validationTooltipCallback || t.grid.validationTooltipCallback;
|
|
2734
2772
|
if (k) {
|
|
2735
|
-
const
|
|
2773
|
+
const E = t.grid.getCellRawValue(d, a, m), A = k({
|
|
2736
2774
|
field: m,
|
|
2737
2775
|
error: T,
|
|
2738
|
-
value:
|
|
2776
|
+
value: E,
|
|
2739
2777
|
row: d,
|
|
2740
2778
|
rowIndex: a
|
|
2741
2779
|
});
|
|
2742
|
-
|
|
2780
|
+
A && (C = `data-tooltip-html="${t.escapeHtml(A)}"`);
|
|
2743
2781
|
}
|
|
2744
2782
|
C || (C = `data-tooltip="${t.escapeHtml(T)}"`);
|
|
2745
2783
|
}
|
|
@@ -2754,7 +2792,7 @@ function _i(t) {
|
|
|
2754
2792
|
${x}
|
|
2755
2793
|
${C}
|
|
2756
2794
|
>
|
|
2757
|
-
${t.grid.isEditing(a, m) ?
|
|
2795
|
+
${t.grid.isEditing(a, m) ? Le(t, a, p, u) : He(t, a, p, u, f)}
|
|
2758
2796
|
</td>
|
|
2759
2797
|
`;
|
|
2760
2798
|
}).join(""), h = ["wg__row"];
|
|
@@ -2765,7 +2803,7 @@ function _i(t) {
|
|
|
2765
2803
|
return `<tr class="${h.join(" ")}" data-row-index="${a}">${c}${l}${g}</tr>`;
|
|
2766
2804
|
}).join("");
|
|
2767
2805
|
}
|
|
2768
|
-
function
|
|
2806
|
+
function ye(t, e) {
|
|
2769
2807
|
const o = t.grid.displayItems, i = t.grid.columns, { startIndex: r, endIndex: s, rowHeight: n, totalItems: d } = e, a = t.grid.showRowNumbers, c = t.grid.showRowToolbar && t.grid.toolbarTrigger === "button", l = i.length + (c ? 1 : 0) + (a ? 1 : 0);
|
|
2770
2808
|
if (o.length === 0)
|
|
2771
2809
|
return `
|
|
@@ -2775,68 +2813,68 @@ function ve(t, e) {
|
|
|
2775
2813
|
</td>
|
|
2776
2814
|
</tr>
|
|
2777
2815
|
`;
|
|
2778
|
-
const g =
|
|
2779
|
-
for (let
|
|
2780
|
-
const
|
|
2816
|
+
const g = bt(), h = r * n, u = (d - s) * n, p = h > 0 ? `<tr class="wg__spacer-top"><td colspan="${l}" style="height: ${h}px"></td></tr>` : "", m = [];
|
|
2817
|
+
for (let b = r; b < s && b < o.length; b++) {
|
|
2818
|
+
const v = o[b], _ = b, S = a ? `<td class="wg__cell wg__row-number">${_ + 1}</td>` : "";
|
|
2781
2819
|
let y = "";
|
|
2782
2820
|
c && (y = `
|
|
2783
2821
|
<td class="wg__cell wg__actions-column">
|
|
2784
|
-
${
|
|
2822
|
+
${ze(_, g === _)}
|
|
2785
2823
|
</td>
|
|
2786
2824
|
`);
|
|
2787
2825
|
const D = i.map((C, T) => {
|
|
2788
|
-
const k = String(C.field),
|
|
2789
|
-
if (
|
|
2790
|
-
const
|
|
2791
|
-
ot &&
|
|
2826
|
+
const k = String(C.field), E = t.grid.getCellValue(v, C, _), A = C.align || "left", H = t.grid.isCellEditable(C), O = t.grid.isCellFocused(_, T), R = ["wg__cell"], z = t.grid.isEditing(_, k);
|
|
2827
|
+
if (H && R.push("wg__cell--editable"), O && !z && R.push("wg__cell--focused"), C.textOverflow === "ellipsis" && R.push("wg__cell--ellipsis"), z && R.push("wg__cell--editing"), t.grid.isCellInvalid(_, k) && R.push("wg__cell--invalid"), C.cellClass && R.push(C.cellClass), C.cellClassCallback) {
|
|
2828
|
+
const q = t.grid.getCellRawValue(v, _, k), ot = C.cellClassCallback(q, v);
|
|
2829
|
+
ot && R.push(ot);
|
|
2792
2830
|
}
|
|
2793
|
-
const
|
|
2794
|
-
`text-align: ${
|
|
2831
|
+
const F = [
|
|
2832
|
+
`text-align: ${A}`,
|
|
2795
2833
|
C.width ? `width: ${C.width}` : "",
|
|
2796
2834
|
C.minWidth ? `min-width: ${C.minWidth}` : "",
|
|
2797
2835
|
C.maxWidth ? `max-width: ${C.maxWidth}` : ""
|
|
2798
|
-
].filter(Boolean).join("; "),
|
|
2799
|
-
let
|
|
2836
|
+
].filter(Boolean).join("; "), V = t.grid.isNavigateMode ? 'tabindex="0"' : "";
|
|
2837
|
+
let P = "";
|
|
2800
2838
|
if (C.tooltipCallback) {
|
|
2801
|
-
const
|
|
2802
|
-
ot && (
|
|
2839
|
+
const q = t.grid.getCellRawValue(v, _, k), ot = C.tooltipCallback(q, v);
|
|
2840
|
+
ot && (P = `data-tooltip="${t.escapeHtml(ot)}"`);
|
|
2803
2841
|
} else if (C.tooltipMember) {
|
|
2804
|
-
const
|
|
2805
|
-
|
|
2842
|
+
const q = v[C.tooltipMember];
|
|
2843
|
+
q && typeof q == "string" && (P = `data-tooltip="${t.escapeHtml(q)}"`);
|
|
2806
2844
|
}
|
|
2807
|
-
if (!
|
|
2808
|
-
const
|
|
2809
|
-
if (
|
|
2845
|
+
if (!P && t.grid.isCellInvalid(_, k)) {
|
|
2846
|
+
const q = t.grid.getCellValidationError(_, k);
|
|
2847
|
+
if (q) {
|
|
2810
2848
|
const ot = C.validationTooltipCallback || t.grid.validationTooltipCallback;
|
|
2811
2849
|
if (ot) {
|
|
2812
|
-
const
|
|
2850
|
+
const Ye = t.grid.getCellRawValue(v, _, k), ae = ot({
|
|
2813
2851
|
field: k,
|
|
2814
|
-
error:
|
|
2815
|
-
value:
|
|
2816
|
-
row:
|
|
2852
|
+
error: q,
|
|
2853
|
+
value: Ye,
|
|
2854
|
+
row: v,
|
|
2817
2855
|
rowIndex: _
|
|
2818
2856
|
});
|
|
2819
|
-
|
|
2857
|
+
ae && (P = `data-tooltip-html="${t.escapeHtml(ae)}"`);
|
|
2820
2858
|
}
|
|
2821
|
-
|
|
2859
|
+
P || (P = `data-tooltip="${t.escapeHtml(q)}"`);
|
|
2822
2860
|
}
|
|
2823
2861
|
}
|
|
2824
2862
|
return `
|
|
2825
2863
|
<td
|
|
2826
|
-
class="${
|
|
2827
|
-
style="${
|
|
2864
|
+
class="${R.join(" ")}"
|
|
2865
|
+
style="${F}"
|
|
2828
2866
|
data-row="${_}"
|
|
2829
2867
|
data-col="${T}"
|
|
2830
2868
|
data-field="${k}"
|
|
2831
|
-
${
|
|
2832
|
-
${
|
|
2869
|
+
${V}
|
|
2870
|
+
${P}
|
|
2833
2871
|
>
|
|
2834
|
-
${t.grid.isEditing(_, k) ?
|
|
2872
|
+
${t.grid.isEditing(_, k) ? Le(t, _, T, C) : He(t, _, T, C, E)}
|
|
2835
2873
|
</td>
|
|
2836
2874
|
`;
|
|
2837
2875
|
}).join(""), x = ["wg__row"];
|
|
2838
2876
|
if (t.grid.rowClassCallback) {
|
|
2839
|
-
const C = t.grid.rowClassCallback(
|
|
2877
|
+
const C = t.grid.rowClassCallback(v, _);
|
|
2840
2878
|
C && x.push(C);
|
|
2841
2879
|
}
|
|
2842
2880
|
m.push(`<tr class="${x.join(" ")}" data-row-index="${_}">${S}${y}${D}</tr>`);
|
|
@@ -2888,14 +2926,14 @@ function Yt(t, e = "bottom-center") {
|
|
|
2888
2926
|
<div class="wg__pagination-pagesize">
|
|
2889
2927
|
<select class="wg__pagination-select" data-action="pagesize">
|
|
2890
2928
|
${n.map(
|
|
2891
|
-
(
|
|
2929
|
+
(v) => `<option value="${v}" ${v === s ? "selected" : ""}>${v}</option>`
|
|
2892
2930
|
).join("")}
|
|
2893
2931
|
</select>
|
|
2894
2932
|
<span class="wg__pagination-label">${g.perPage}</span>
|
|
2895
2933
|
</div>
|
|
2896
2934
|
` : ""
|
|
2897
|
-
},
|
|
2898
|
-
return `<div class="${p.join(" ")}">${
|
|
2935
|
+
}, b = t.grid.paginationLayout.split("|").map((v) => v.trim()).map((v) => m[v] || "").join("");
|
|
2936
|
+
return `<div class="${p.join(" ")}">${b}</div>`;
|
|
2899
2937
|
}
|
|
2900
2938
|
function Nt(t, e) {
|
|
2901
2939
|
const o = t.grid.summaryContentCallback;
|
|
@@ -2910,7 +2948,7 @@ function Nt(t, e) {
|
|
|
2910
2948
|
}), c = e.startsWith("top-"), l = e.replace("top-", "").replace("bottom-", ""), g = ["wg__summary"];
|
|
2911
2949
|
return l === "left" ? g.push("wg__summary--left") : l === "right" && g.push("wg__summary--right"), c && g.push("wg__summary--top"), `<div class="${g.join(" ")}">${a}</div>`;
|
|
2912
2950
|
}
|
|
2913
|
-
const
|
|
2951
|
+
const Fe = {
|
|
2914
2952
|
today: "Today",
|
|
2915
2953
|
clear: "Clear",
|
|
2916
2954
|
monthNames: [
|
|
@@ -2964,7 +3002,7 @@ function Kt(t) {
|
|
|
2964
3002
|
maxLength: t.length
|
|
2965
3003
|
};
|
|
2966
3004
|
}
|
|
2967
|
-
function
|
|
3005
|
+
function Ve(t, e) {
|
|
2968
3006
|
if (!t || isNaN(t.getTime())) return "";
|
|
2969
3007
|
const o = t.getFullYear(), i = String(t.getMonth() + 1).padStart(2, "0"), r = String(t.getDate()).padStart(2, "0"), { separator: s, parts: n } = e, d = [];
|
|
2970
3008
|
for (let a = 0; a < 3; a++)
|
|
@@ -2993,7 +3031,7 @@ function yi(t, e) {
|
|
|
2993
3031
|
const a = new Date(s, n - 1, d);
|
|
2994
3032
|
return a.getMonth() !== n - 1 || a.getDate() !== d ? null : a;
|
|
2995
3033
|
}
|
|
2996
|
-
function
|
|
3034
|
+
function j(t) {
|
|
2997
3035
|
if (!t) return null;
|
|
2998
3036
|
let e;
|
|
2999
3037
|
if (typeof t == "string") {
|
|
@@ -3007,11 +3045,11 @@ function Wt(t) {
|
|
|
3007
3045
|
const e = t.getFullYear(), o = String(t.getMonth() + 1).padStart(2, "0"), i = String(t.getDate()).padStart(2, "0");
|
|
3008
3046
|
return `${e}-${o}-${i}`;
|
|
3009
3047
|
}
|
|
3010
|
-
function
|
|
3048
|
+
function yt(t, e) {
|
|
3011
3049
|
return !t || !e ? !1 : t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate();
|
|
3012
3050
|
}
|
|
3013
3051
|
function Ci(t) {
|
|
3014
|
-
return
|
|
3052
|
+
return yt(t, /* @__PURE__ */ new Date());
|
|
3015
3053
|
}
|
|
3016
3054
|
function gt(t, e) {
|
|
3017
3055
|
return new Date(t, e + 1, 0).getDate();
|
|
@@ -3029,7 +3067,7 @@ function xi(t, e) {
|
|
|
3029
3067
|
const o = parseInt(t, 10);
|
|
3030
3068
|
return { min: o, max: o };
|
|
3031
3069
|
}
|
|
3032
|
-
function ki(t, e, o =
|
|
3070
|
+
function ki(t, e, o = Fe) {
|
|
3033
3071
|
const i = Di(t, o), r = Ti(t, e, o), s = Ei(t, e, o), n = e.showTodayButton !== !1 ? Ai(o) : "";
|
|
3034
3072
|
return `
|
|
3035
3073
|
<div class="wg-datepicker">
|
|
@@ -3083,7 +3121,7 @@ function Ti(t, e, o) {
|
|
|
3083
3121
|
`;
|
|
3084
3122
|
}
|
|
3085
3123
|
function Ei(t, e, o) {
|
|
3086
|
-
const i = $i(o), r =
|
|
3124
|
+
const i = $i(o), r = qe(t, e);
|
|
3087
3125
|
return `
|
|
3088
3126
|
<div class="wg-datepicker__weekdays">
|
|
3089
3127
|
${i}
|
|
@@ -3096,33 +3134,33 @@ function Ei(t, e, o) {
|
|
|
3096
3134
|
function $i(t) {
|
|
3097
3135
|
return t.weekdayNamesShort.map((e) => `<div class="wg-datepicker__weekday">${e}</div>`).join("");
|
|
3098
3136
|
}
|
|
3099
|
-
function
|
|
3100
|
-
const { viewYear: o, viewMonth: i, selectedDate: r, focusedDate: s } = t, n = e.minDate ?
|
|
3137
|
+
function qe(t, e) {
|
|
3138
|
+
const { viewYear: o, viewMonth: i, selectedDate: r, focusedDate: s } = t, n = e.minDate ? j(e.minDate) : null, d = e.maxDate ? j(e.maxDate) : null, a = Si(o, i), c = gt(o, i), l = gt(o, i - 1), g = new Date(o, i - 1, 1), h = g.getFullYear(), u = g.getMonth(), p = new Date(o, i + 1, 1), m = p.getFullYear(), f = p.getMonth(), b = [];
|
|
3101
3139
|
for (let y = a - 1; y >= 0; y--) {
|
|
3102
3140
|
const D = l - y;
|
|
3103
|
-
|
|
3141
|
+
b.push({
|
|
3104
3142
|
date: new Date(h, u, D),
|
|
3105
3143
|
day: D,
|
|
3106
3144
|
isOtherMonth: !0
|
|
3107
3145
|
});
|
|
3108
3146
|
}
|
|
3109
3147
|
for (let y = 1; y <= c; y++)
|
|
3110
|
-
|
|
3148
|
+
b.push({
|
|
3111
3149
|
date: new Date(o, i, y),
|
|
3112
3150
|
day: y,
|
|
3113
3151
|
isOtherMonth: !1
|
|
3114
3152
|
});
|
|
3115
|
-
const _ = Math.ceil((a + c) / 7) * 7 -
|
|
3153
|
+
const _ = Math.ceil((a + c) / 7) * 7 - b.length;
|
|
3116
3154
|
for (let y = 1; y <= _; y++)
|
|
3117
|
-
|
|
3155
|
+
b.push({
|
|
3118
3156
|
date: new Date(m, f, y),
|
|
3119
3157
|
day: y,
|
|
3120
3158
|
isOtherMonth: !0
|
|
3121
3159
|
});
|
|
3122
3160
|
let S = "";
|
|
3123
|
-
for (const y of
|
|
3161
|
+
for (const y of b) {
|
|
3124
3162
|
const D = ["wg-datepicker__day"];
|
|
3125
|
-
y.isOtherMonth && D.push("wg-datepicker__day--other-month"), Mi(y.date, n, d) && D.push("wg-datepicker__day--disabled"), Ci(y.date) && D.push("wg-datepicker__day--today"),
|
|
3163
|
+
y.isOtherMonth && D.push("wg-datepicker__day--other-month"), Mi(y.date, n, d) && D.push("wg-datepicker__day--disabled"), Ci(y.date) && D.push("wg-datepicker__day--today"), yt(y.date, r) && D.push("wg-datepicker__day--selected"), yt(y.date, s) && D.push("wg-datepicker__day--focused");
|
|
3126
3164
|
const C = Wt(y.date);
|
|
3127
3165
|
S += `<div class="${D.join(" ")}" data-date="${C}">${y.day}</div>`;
|
|
3128
3166
|
}
|
|
@@ -3142,7 +3180,7 @@ function Ai(t) {
|
|
|
3142
3180
|
}
|
|
3143
3181
|
function Oi(t, e, o) {
|
|
3144
3182
|
const i = t.querySelector(".wg-datepicker__days");
|
|
3145
|
-
i && (i.innerHTML =
|
|
3183
|
+
i && (i.innerHTML = qe(e, o));
|
|
3146
3184
|
}
|
|
3147
3185
|
function Ri(t, e, o) {
|
|
3148
3186
|
const i = t.querySelector(".wg-datepicker__month-year");
|
|
@@ -3151,7 +3189,7 @@ function Ri(t, e, o) {
|
|
|
3151
3189
|
i.textContent = `${r} ${e.viewYear}`;
|
|
3152
3190
|
}
|
|
3153
3191
|
}
|
|
3154
|
-
function
|
|
3192
|
+
function Pi(t, e) {
|
|
3155
3193
|
const o = t.querySelector(".wg-datepicker__rolling-selector"), i = t.querySelector(".wg-datepicker__calendar");
|
|
3156
3194
|
o && o.classList.toggle("wg-datepicker__rolling-selector--visible", e), i && i.classList.toggle("wg-datepicker__calendar--hidden", e);
|
|
3157
3195
|
}
|
|
@@ -3164,7 +3202,7 @@ function Ii(t, e) {
|
|
|
3164
3202
|
r.classList.toggle("wg-datepicker__rolling-item--selected", s === e.viewMonth);
|
|
3165
3203
|
});
|
|
3166
3204
|
}
|
|
3167
|
-
function
|
|
3205
|
+
function Ce(t) {
|
|
3168
3206
|
const e = t.querySelector("[data-year].wg-datepicker__rolling-item--selected"), o = t.querySelector("[data-month].wg-datepicker__rolling-item--selected");
|
|
3169
3207
|
if (e) {
|
|
3170
3208
|
const i = e.parentElement;
|
|
@@ -3187,7 +3225,7 @@ function Xt(t) {
|
|
|
3187
3225
|
function Qt(t) {
|
|
3188
3226
|
t.viewMonth === 11 ? (t.viewMonth = 0, t.viewYear++) : t.viewMonth++;
|
|
3189
3227
|
}
|
|
3190
|
-
function
|
|
3228
|
+
function Li(t, e, o, i) {
|
|
3191
3229
|
var s, n, d, a;
|
|
3192
3230
|
const { key: r } = t;
|
|
3193
3231
|
if (r === "Escape")
|
|
@@ -3211,8 +3249,8 @@ function Pi(t, e, o, i) {
|
|
|
3211
3249
|
if (t.preventDefault(), t.ctrlKey || t.metaKey) {
|
|
3212
3250
|
let c = e.viewYear;
|
|
3213
3251
|
const l = new Date(c, 0, 1);
|
|
3214
|
-
if (e.focusedDate &&
|
|
3215
|
-
const g =
|
|
3252
|
+
if (e.focusedDate && yt(e.focusedDate, l) && c--, o.minDate) {
|
|
3253
|
+
const g = j(o.minDate);
|
|
3216
3254
|
g && c < g.getFullYear() && (c = g.getFullYear());
|
|
3217
3255
|
}
|
|
3218
3256
|
e.viewMonth = 0, e.viewYear = c, e.focusedDate = new Date(c, 0, 1);
|
|
@@ -3224,8 +3262,8 @@ function Pi(t, e, o, i) {
|
|
|
3224
3262
|
if (t.preventDefault(), t.ctrlKey || t.metaKey) {
|
|
3225
3263
|
let c = e.viewYear;
|
|
3226
3264
|
const l = new Date(c, 11, 31);
|
|
3227
|
-
if (e.focusedDate &&
|
|
3228
|
-
const g =
|
|
3265
|
+
if (e.focusedDate && yt(e.focusedDate, l) && c++, o.maxDate) {
|
|
3266
|
+
const g = j(o.maxDate);
|
|
3229
3267
|
g && c > g.getFullYear() && (c = g.getFullYear());
|
|
3230
3268
|
}
|
|
3231
3269
|
e.viewMonth = 11, e.viewYear = c, e.focusedDate = new Date(c, 11, 31);
|
|
@@ -3256,7 +3294,7 @@ function Hi(t, e, o) {
|
|
|
3256
3294
|
t.focusedDate = t.selectedDate ? new Date(t.selectedDate) : new Date(t.viewYear, t.viewMonth, 1);
|
|
3257
3295
|
return;
|
|
3258
3296
|
}
|
|
3259
|
-
const i = new Date(t.focusedDate), r = o.minDate ?
|
|
3297
|
+
const i = new Date(t.focusedDate), r = o.minDate ? j(o.minDate) : null, s = o.maxDate ? j(o.maxDate) : null;
|
|
3260
3298
|
switch (e) {
|
|
3261
3299
|
case "ArrowLeft":
|
|
3262
3300
|
i.setDate(i.getDate() - 1);
|
|
@@ -3299,13 +3337,13 @@ function Vi(t, e, o) {
|
|
|
3299
3337
|
const i = t.dataset.date;
|
|
3300
3338
|
if (!i || t.classList.contains("wg-datepicker__day--disabled"))
|
|
3301
3339
|
return null;
|
|
3302
|
-
const [r, s, n] = i.split("-").map(Number), d = new Date(r, s - 1, n), a = o.minDate ?
|
|
3340
|
+
const [r, s, n] = i.split("-").map(Number), d = new Date(r, s - 1, n), a = o.minDate ? j(o.minDate) : null, c = o.maxDate ? j(o.maxDate) : null;
|
|
3303
3341
|
return a && d < a || c && d > c ? null : (e.selectedDate = d, e.focusedDate = d, d);
|
|
3304
3342
|
}
|
|
3305
3343
|
function qi(t, e) {
|
|
3306
3344
|
const o = /* @__PURE__ */ new Date();
|
|
3307
3345
|
o.setHours(0, 0, 0, 0);
|
|
3308
|
-
const i = e.minDate ?
|
|
3346
|
+
const i = e.minDate ? j(e.minDate) : null, r = e.maxDate ? j(e.maxDate) : null;
|
|
3309
3347
|
return i && o < i || r && o > r ? null : (t.selectedDate = o, t.focusedDate = o, t.viewYear = o.getFullYear(), t.viewMonth = o.getMonth(), o);
|
|
3310
3348
|
}
|
|
3311
3349
|
function Yi(t, e) {
|
|
@@ -3325,9 +3363,9 @@ function Gt(t, e) {
|
|
|
3325
3363
|
].sort((m, f) => m.pos - f.pos);
|
|
3326
3364
|
let c = "", l = 0;
|
|
3327
3365
|
for (let m = 0; m < a.length; m++) {
|
|
3328
|
-
const f = a[m],
|
|
3329
|
-
if (!
|
|
3330
|
-
c +=
|
|
3366
|
+
const f = a[m], b = n.substring(l, l + f.length);
|
|
3367
|
+
if (!b) break;
|
|
3368
|
+
c += b, l += b.length, m < a.length - 1 && b.length === f.length && (c += o);
|
|
3331
3369
|
}
|
|
3332
3370
|
return c.substring(0, r);
|
|
3333
3371
|
}
|
|
@@ -3396,7 +3434,7 @@ function Ki(t, e, o, i) {
|
|
|
3396
3434
|
return !1;
|
|
3397
3435
|
const r = yi(t, e);
|
|
3398
3436
|
if (!r) return !1;
|
|
3399
|
-
const s = i.minDate ?
|
|
3437
|
+
const s = i.minDate ? j(i.minDate) : null, n = i.maxDate ? j(i.maxDate) : null;
|
|
3400
3438
|
return s && r < s || n && r > n ? !1 : (o.selectedDate = r, o.focusedDate = r, o.viewYear = r.getFullYear(), o.viewMonth = r.getMonth(), !0);
|
|
3401
3439
|
}
|
|
3402
3440
|
const Wi = `
|
|
@@ -3650,8 +3688,8 @@ const Wi = `
|
|
|
3650
3688
|
background-color: color-mix(in srgb, var(--wg-dp-accent-color) 10%, transparent);
|
|
3651
3689
|
}
|
|
3652
3690
|
`;
|
|
3653
|
-
let
|
|
3654
|
-
class
|
|
3691
|
+
let Se = !1;
|
|
3692
|
+
class se {
|
|
3655
3693
|
constructor(e = {}) {
|
|
3656
3694
|
w(this, "options");
|
|
3657
3695
|
w(this, "state");
|
|
@@ -3708,30 +3746,30 @@ class ne {
|
|
|
3708
3746
|
weekdayNamesShort: l
|
|
3709
3747
|
};
|
|
3710
3748
|
} catch {
|
|
3711
|
-
return
|
|
3749
|
+
return Fe;
|
|
3712
3750
|
}
|
|
3713
3751
|
}
|
|
3714
3752
|
/**
|
|
3715
3753
|
* Inject datepicker styles into document head (once)
|
|
3716
3754
|
*/
|
|
3717
3755
|
static injectStyles() {
|
|
3718
|
-
if (
|
|
3756
|
+
if (Se) return;
|
|
3719
3757
|
const e = document.createElement("style");
|
|
3720
|
-
e.id = "wg-datepicker-styles", e.textContent = Wi, document.head.appendChild(e),
|
|
3758
|
+
e.id = "wg-datepicker-styles", e.textContent = Wi, document.head.appendChild(e), Se = !0;
|
|
3721
3759
|
}
|
|
3722
3760
|
/**
|
|
3723
3761
|
* Open the date picker
|
|
3724
3762
|
*/
|
|
3725
3763
|
open(e, o = null) {
|
|
3726
|
-
|
|
3727
|
-
const i =
|
|
3764
|
+
se.injectStyles(), this.state.isOpen && this.close(), this.anchor = e;
|
|
3765
|
+
const i = j(o);
|
|
3728
3766
|
if (i)
|
|
3729
3767
|
this.state.selectedDate = i, this.state.viewYear = i.getFullYear(), this.state.viewMonth = i.getMonth();
|
|
3730
3768
|
else {
|
|
3731
3769
|
const r = /* @__PURE__ */ new Date();
|
|
3732
3770
|
this.state.viewYear = r.getFullYear(), this.state.viewMonth = r.getMonth();
|
|
3733
3771
|
}
|
|
3734
|
-
Fi(this.state), this.element = document.createElement("div"), this.element.className = "wg-datepicker-container", this.element.innerHTML = ki(this.state, this.options, this.localeStrings), document.body.appendChild(this.element), this.position(), this.attachListeners(), this.state.isOpen = !0, this.state.rollingSelectorOpen &&
|
|
3772
|
+
Fi(this.state), this.element = document.createElement("div"), this.element.className = "wg-datepicker-container", this.element.innerHTML = ki(this.state, this.options, this.localeStrings), document.body.appendChild(this.element), this.position(), this.attachListeners(), this.state.isOpen = !0, this.state.rollingSelectorOpen && Ce(this.element);
|
|
3735
3773
|
}
|
|
3736
3774
|
/**
|
|
3737
3775
|
* Close the date picker
|
|
@@ -3757,7 +3795,7 @@ class ne {
|
|
|
3757
3795
|
* Get formatted value
|
|
3758
3796
|
*/
|
|
3759
3797
|
getFormattedValue() {
|
|
3760
|
-
return
|
|
3798
|
+
return Ve(this.state.selectedDate, this.formatInfo);
|
|
3761
3799
|
}
|
|
3762
3800
|
/**
|
|
3763
3801
|
* Position the picker using Floating UI
|
|
@@ -3765,13 +3803,13 @@ class ne {
|
|
|
3765
3803
|
position() {
|
|
3766
3804
|
if (!this.element || !this.anchor) return;
|
|
3767
3805
|
const e = this.element.querySelector(".wg-datepicker");
|
|
3768
|
-
e && (this.cleanupAutoUpdate =
|
|
3769
|
-
|
|
3806
|
+
e && (this.cleanupAutoUpdate = Fo(this.anchor, e, () => {
|
|
3807
|
+
kt(this.anchor, e, {
|
|
3770
3808
|
placement: "bottom-start",
|
|
3771
3809
|
middleware: [
|
|
3772
3810
|
Lt(4),
|
|
3773
|
-
|
|
3774
|
-
|
|
3811
|
+
xt({ fallbackPlacements: ["top-start", "bottom-end", "top-end"] }),
|
|
3812
|
+
ne({ padding: 8 })
|
|
3775
3813
|
]
|
|
3776
3814
|
}).then(({ x: o, y: i }) => {
|
|
3777
3815
|
Object.assign(e.style, {
|
|
@@ -3804,7 +3842,7 @@ class ne {
|
|
|
3804
3842
|
return;
|
|
3805
3843
|
}
|
|
3806
3844
|
if (i === "toggle-rolling") {
|
|
3807
|
-
e.preventDefault(), this.state.rollingSelectorOpen = !this.state.rollingSelectorOpen, this.render(), this.state.rollingSelectorOpen && this.element &&
|
|
3845
|
+
e.preventDefault(), this.state.rollingSelectorOpen = !this.state.rollingSelectorOpen, this.render(), this.state.rollingSelectorOpen && this.element && Ce(this.element);
|
|
3808
3846
|
return;
|
|
3809
3847
|
}
|
|
3810
3848
|
if (i === "today") {
|
|
@@ -3843,7 +3881,7 @@ class ne {
|
|
|
3843
3881
|
* Handle keyboard events
|
|
3844
3882
|
*/
|
|
3845
3883
|
handleKeyDown(e) {
|
|
3846
|
-
|
|
3884
|
+
Li(e, this.state, this.options, {
|
|
3847
3885
|
onSelect: (i, r) => this.selectDate(i, r),
|
|
3848
3886
|
onClose: () => this.close()
|
|
3849
3887
|
}) && this.render();
|
|
@@ -3861,7 +3899,7 @@ class ne {
|
|
|
3861
3899
|
render() {
|
|
3862
3900
|
if (!this.element) return;
|
|
3863
3901
|
const e = this.element.querySelector(".wg-datepicker");
|
|
3864
|
-
e && (Ri(e, this.state, this.localeStrings),
|
|
3902
|
+
e && (Ri(e, this.state, this.localeStrings), Pi(e, this.state.rollingSelectorOpen), this.state.rollingSelectorOpen ? Ii(e, this.state) : Oi(e, this.state, this.options));
|
|
3865
3903
|
}
|
|
3866
3904
|
/**
|
|
3867
3905
|
* Connect an input field for masked input
|
|
@@ -3967,11 +4005,11 @@ const Xi = `
|
|
|
3967
4005
|
margin: var(--wg-cm-padding) 0;
|
|
3968
4006
|
}
|
|
3969
4007
|
`;
|
|
3970
|
-
let
|
|
4008
|
+
let xe = !1;
|
|
3971
4009
|
function Qi() {
|
|
3972
|
-
if (
|
|
4010
|
+
if (xe) return;
|
|
3973
4011
|
const t = document.createElement("style");
|
|
3974
|
-
t.id = "wg-context-menu-styles", t.textContent = Xi, document.head.appendChild(t),
|
|
4012
|
+
t.id = "wg-context-menu-styles", t.textContent = Xi, document.head.appendChild(t), xe = !0;
|
|
3975
4013
|
}
|
|
3976
4014
|
function Gi(t, e) {
|
|
3977
4015
|
const o = t.filter((r) => r.visible === void 0 ? !0 : typeof r.visible == "function" ? r.visible(e) : r.visible);
|
|
@@ -3991,7 +4029,7 @@ function Ji(t, e, o, i, r, s, n) {
|
|
|
3991
4029
|
const a = document.createElement("div");
|
|
3992
4030
|
a.className = "wg-context-menu-container", a.innerHTML = d, document.body.appendChild(a);
|
|
3993
4031
|
const c = a.querySelector(".wg-context-menu");
|
|
3994
|
-
|
|
4032
|
+
kt({
|
|
3995
4033
|
getBoundingClientRect: () => ({
|
|
3996
4034
|
width: 0,
|
|
3997
4035
|
height: 0,
|
|
@@ -4006,8 +4044,8 @@ function Ji(t, e, o, i, r, s, n) {
|
|
|
4006
4044
|
placement: "bottom-start",
|
|
4007
4045
|
middleware: [
|
|
4008
4046
|
Lt(4),
|
|
4009
|
-
|
|
4010
|
-
|
|
4047
|
+
xt({ fallbackPlacements: ["top-start", "bottom-end", "top-end"] }),
|
|
4048
|
+
ne({ padding: 8 })
|
|
4011
4049
|
]
|
|
4012
4050
|
}).then(({ x: u, y: p }) => {
|
|
4013
4051
|
Object.assign(c.style, {
|
|
@@ -4022,15 +4060,15 @@ function Ji(t, e, o, i, r, s, n) {
|
|
|
4022
4060
|
}
|
|
4023
4061
|
});
|
|
4024
4062
|
const g = (u) => {
|
|
4025
|
-
a.contains(u.target) || (
|
|
4063
|
+
a.contains(u.target) || (vt(a, g, h), n());
|
|
4026
4064
|
}, h = (u) => {
|
|
4027
|
-
u.key === "Escape" && (u.preventDefault(),
|
|
4065
|
+
u.key === "Escape" && (u.preventDefault(), vt(a, g, h), n());
|
|
4028
4066
|
};
|
|
4029
4067
|
return setTimeout(() => {
|
|
4030
4068
|
document.addEventListener("mousedown", g), document.addEventListener("keydown", h);
|
|
4031
4069
|
}, 0), a._cleanup = { handleOutsideClick: g, handleKeyDown: h }, a;
|
|
4032
4070
|
}
|
|
4033
|
-
function
|
|
4071
|
+
function vt(t, e, o) {
|
|
4034
4072
|
e && document.removeEventListener("mousedown", e), o && document.removeEventListener("keydown", o);
|
|
4035
4073
|
const i = t._cleanup;
|
|
4036
4074
|
i && (i.handleOutsideClick && document.removeEventListener("mousedown", i.handleOutsideClick), i.handleKeyDown && document.removeEventListener("keydown", i.handleKeyDown)), t.remove();
|
|
@@ -4112,7 +4150,7 @@ class Zi extends HTMLElement {
|
|
|
4112
4150
|
const a = String(s.field);
|
|
4113
4151
|
this.grid.commitEdit(i, a, d), this.render();
|
|
4114
4152
|
});
|
|
4115
|
-
this.shadow = this.attachShadow({ mode: "open" }), this.grid = new
|
|
4153
|
+
this.shadow = this.attachShadow({ mode: "open" }), this.grid = new je(), this.styleElement = document.createElement("style"), this.styleElement.textContent = Be, this.shadow.appendChild(this.styleElement), this.grid.requestUpdate = () => this.requestUpdate();
|
|
4116
4154
|
}
|
|
4117
4155
|
get tooltipShowDelay() {
|
|
4118
4156
|
return this._tooltipShowDelay;
|
|
@@ -4133,7 +4171,7 @@ class Zi extends HTMLElement {
|
|
|
4133
4171
|
this.render(), this.addEventListener("paste", this.handlePaste);
|
|
4134
4172
|
}
|
|
4135
4173
|
disconnectedCallback() {
|
|
4136
|
-
this.removeEventListener("paste", this.handlePaste), this.datepicker && (this.datepicker.destroy(), this.datepicker = null), this.contextMenuElement && (
|
|
4174
|
+
this.removeEventListener("paste", this.handlePaste), this.datepicker && (this.datepicker.destroy(), this.datepicker = null), this.contextMenuElement && (vt(this.contextMenuElement), this.contextMenuElement = null), At();
|
|
4137
4175
|
}
|
|
4138
4176
|
// ==========================================================================
|
|
4139
4177
|
// Public API - Proxy to WebGrid
|
|
@@ -4282,6 +4320,12 @@ class Zi extends HTMLElement {
|
|
|
4282
4320
|
set toolbarTrigger(o) {
|
|
4283
4321
|
this.grid.toolbarTrigger = o;
|
|
4284
4322
|
}
|
|
4323
|
+
get toolbarPosition() {
|
|
4324
|
+
return this.grid.toolbarPosition;
|
|
4325
|
+
}
|
|
4326
|
+
set toolbarPosition(o) {
|
|
4327
|
+
this.grid.toolbarPosition = o;
|
|
4328
|
+
}
|
|
4285
4329
|
get contextMenu() {
|
|
4286
4330
|
return this.grid.contextMenu;
|
|
4287
4331
|
}
|
|
@@ -4563,34 +4607,34 @@ class Zi extends HTMLElement {
|
|
|
4563
4607
|
}
|
|
4564
4608
|
switch (o.key) {
|
|
4565
4609
|
case "ArrowUp":
|
|
4566
|
-
o.preventDefault(), i > 0 &&
|
|
4610
|
+
o.preventDefault(), i > 0 && $(this, i - 1, r);
|
|
4567
4611
|
break;
|
|
4568
4612
|
case "ArrowDown":
|
|
4569
|
-
o.preventDefault(), i < n.length - 1 &&
|
|
4613
|
+
o.preventDefault(), i < n.length - 1 && $(this, i + 1, r);
|
|
4570
4614
|
break;
|
|
4571
4615
|
case "ArrowLeft":
|
|
4572
|
-
o.preventDefault(), r > 0 &&
|
|
4616
|
+
o.preventDefault(), r > 0 && $(this, i, r - 1);
|
|
4573
4617
|
break;
|
|
4574
4618
|
case "ArrowRight":
|
|
4575
|
-
o.preventDefault(), r < s.length - 1 &&
|
|
4619
|
+
o.preventDefault(), r < s.length - 1 && $(this, i, r + 1);
|
|
4576
4620
|
break;
|
|
4577
4621
|
case "Tab":
|
|
4578
4622
|
if (o.preventDefault(), o.shiftKey) {
|
|
4579
4623
|
if (a > 0) {
|
|
4580
4624
|
const l = d[a - 1].index;
|
|
4581
|
-
|
|
4625
|
+
$(this, i, l);
|
|
4582
4626
|
} else if (i > 0) {
|
|
4583
4627
|
const l = d[d.length - 1].index;
|
|
4584
|
-
|
|
4628
|
+
$(this, i - 1, l);
|
|
4585
4629
|
}
|
|
4586
4630
|
} else if (a >= 0 && a < d.length - 1) {
|
|
4587
4631
|
const l = d[a + 1].index;
|
|
4588
|
-
|
|
4632
|
+
$(this, i, l);
|
|
4589
4633
|
} else if (a === -1 && d.length > 0)
|
|
4590
|
-
|
|
4634
|
+
$(this, i, d[0].index);
|
|
4591
4635
|
else if (i < n.length - 1) {
|
|
4592
4636
|
const l = d[0].index;
|
|
4593
|
-
|
|
4637
|
+
$(this, i + 1, l);
|
|
4594
4638
|
}
|
|
4595
4639
|
break;
|
|
4596
4640
|
case "Home":
|
|
@@ -4599,11 +4643,11 @@ class Zi extends HTMLElement {
|
|
|
4599
4643
|
const l = this.grid.focusedCell;
|
|
4600
4644
|
this.grid.setFocusedCell(0, 0), st(this, 0);
|
|
4601
4645
|
const g = this.shadow.querySelector('td[data-row="0"][data-col="0"]');
|
|
4602
|
-
g && (g.focus({ preventScroll: !0 }),
|
|
4646
|
+
g && (g.focus({ preventScroll: !0 }), K(this, l, { rowIndex: 0, colIndex: 0 }));
|
|
4603
4647
|
} else
|
|
4604
|
-
|
|
4648
|
+
$(this, 0, 0);
|
|
4605
4649
|
else
|
|
4606
|
-
|
|
4650
|
+
$(this, i, 0);
|
|
4607
4651
|
break;
|
|
4608
4652
|
case "End":
|
|
4609
4653
|
if (o.preventDefault(), o.ctrlKey) {
|
|
@@ -4612,11 +4656,11 @@ class Zi extends HTMLElement {
|
|
|
4612
4656
|
const h = this.grid.focusedCell;
|
|
4613
4657
|
this.grid.setFocusedCell(l, g), st(this, l);
|
|
4614
4658
|
const u = this.shadow.querySelector(`td[data-row="${l}"][data-col="${g}"]`);
|
|
4615
|
-
u && (u.focus({ preventScroll: !0 }),
|
|
4659
|
+
u && (u.focus({ preventScroll: !0 }), K(this, h, { rowIndex: l, colIndex: g }));
|
|
4616
4660
|
} else
|
|
4617
|
-
|
|
4661
|
+
$(this, l, g);
|
|
4618
4662
|
} else
|
|
4619
|
-
|
|
4663
|
+
$(this, i, s.length - 1);
|
|
4620
4664
|
break;
|
|
4621
4665
|
case "PageUp":
|
|
4622
4666
|
if (o.preventDefault(), o.ctrlKey)
|
|
@@ -4624,18 +4668,18 @@ class Zi extends HTMLElement {
|
|
|
4624
4668
|
const l = this.grid.focusedCell;
|
|
4625
4669
|
this.grid.setFocusedCell(0, r), st(this, 0);
|
|
4626
4670
|
const g = this.shadow.querySelector(`td[data-row="0"][data-col="${r}"]`);
|
|
4627
|
-
g && (g.focus({ preventScroll: !0 }),
|
|
4671
|
+
g && (g.focus({ preventScroll: !0 }), K(this, l, { rowIndex: 0, colIndex: r }));
|
|
4628
4672
|
} else
|
|
4629
|
-
|
|
4673
|
+
$(this, 0, r);
|
|
4630
4674
|
else {
|
|
4631
4675
|
const l = Math.max(0, i - 10);
|
|
4632
4676
|
if (this.grid.shouldUseVirtualScroll()) {
|
|
4633
4677
|
const g = this.grid.focusedCell;
|
|
4634
4678
|
this.grid.setFocusedCell(l, r), st(this, l);
|
|
4635
4679
|
const h = this.shadow.querySelector(`td[data-row="${l}"][data-col="${r}"]`);
|
|
4636
|
-
h && (h.focus({ preventScroll: !0 }),
|
|
4680
|
+
h && (h.focus({ preventScroll: !0 }), K(this, g, { rowIndex: l, colIndex: r }));
|
|
4637
4681
|
} else
|
|
4638
|
-
|
|
4682
|
+
$(this, l, r);
|
|
4639
4683
|
}
|
|
4640
4684
|
break;
|
|
4641
4685
|
case "PageDown":
|
|
@@ -4645,18 +4689,18 @@ class Zi extends HTMLElement {
|
|
|
4645
4689
|
const g = this.grid.focusedCell;
|
|
4646
4690
|
this.grid.setFocusedCell(l, r), st(this, l);
|
|
4647
4691
|
const h = this.shadow.querySelector(`td[data-row="${l}"][data-col="${r}"]`);
|
|
4648
|
-
h && (h.focus({ preventScroll: !0 }),
|
|
4692
|
+
h && (h.focus({ preventScroll: !0 }), K(this, g, { rowIndex: l, colIndex: r }));
|
|
4649
4693
|
} else
|
|
4650
|
-
|
|
4694
|
+
$(this, l, r);
|
|
4651
4695
|
} else {
|
|
4652
4696
|
const l = Math.min(n.length - 1, i + 10);
|
|
4653
4697
|
if (this.grid.shouldUseVirtualScroll()) {
|
|
4654
4698
|
const g = this.grid.focusedCell;
|
|
4655
4699
|
this.grid.setFocusedCell(l, r), st(this, l);
|
|
4656
4700
|
const h = this.shadow.querySelector(`td[data-row="${l}"][data-col="${r}"]`);
|
|
4657
|
-
h && (h.focus({ preventScroll: !0 }),
|
|
4701
|
+
h && (h.focus({ preventScroll: !0 }), K(this, g, { rowIndex: l, colIndex: r }));
|
|
4658
4702
|
} else
|
|
4659
|
-
|
|
4703
|
+
$(this, l, r);
|
|
4660
4704
|
}
|
|
4661
4705
|
break;
|
|
4662
4706
|
case "g":
|
|
@@ -4666,16 +4710,16 @@ class Zi extends HTMLElement {
|
|
|
4666
4710
|
case "Enter": {
|
|
4667
4711
|
o.preventDefault();
|
|
4668
4712
|
const l = s[r];
|
|
4669
|
-
((l == null ? void 0 : l.editor) === "select" || (l == null ? void 0 : l.editor) === "combobox" || (l == null ? void 0 : l.editor) === "autocomplete") && this.grid.getEffectiveOpenDropdownOnEnter(l) ? (
|
|
4670
|
-
this.dropdownOpen ||
|
|
4671
|
-
})) : i < n.length - 1 &&
|
|
4713
|
+
((l == null ? void 0 : l.editor) === "select" || (l == null ? void 0 : l.editor) === "combobox" || (l == null ? void 0 : l.editor) === "autocomplete") && this.grid.getEffectiveOpenDropdownOnEnter(l) ? (B(this, i, r), requestAnimationFrame(() => {
|
|
4714
|
+
this.dropdownOpen || W(this);
|
|
4715
|
+
})) : i < n.length - 1 && $(this, i + 1, r);
|
|
4672
4716
|
break;
|
|
4673
4717
|
}
|
|
4674
4718
|
case "F2": {
|
|
4675
4719
|
o.preventDefault();
|
|
4676
4720
|
const l = s[r], g = (l == null ? void 0 : l.editor) === "select" || (l == null ? void 0 : l.editor) === "combobox" || (l == null ? void 0 : l.editor) === "autocomplete", h = (l == null ? void 0 : l.editor) === "custom";
|
|
4677
|
-
|
|
4678
|
-
this.dropdownOpen ||
|
|
4721
|
+
B(this, i, r), g ? requestAnimationFrame(() => {
|
|
4722
|
+
this.dropdownOpen || W(this);
|
|
4679
4723
|
}) : h && requestAnimationFrame(() => {
|
|
4680
4724
|
this.openCustomEditor(i, r);
|
|
4681
4725
|
});
|
|
@@ -4684,25 +4728,25 @@ class Zi extends HTMLElement {
|
|
|
4684
4728
|
case " ": {
|
|
4685
4729
|
o.preventDefault();
|
|
4686
4730
|
const l = s[r], g = (l == null ? void 0 : l.editor) === "checkbox", h = (l == null ? void 0 : l.editor) === "select" || (l == null ? void 0 : l.editor) === "combobox" || (l == null ? void 0 : l.editor) === "autocomplete", u = (l == null ? void 0 : l.editor) === "date", p = (l == null ? void 0 : l.editor) === "custom";
|
|
4687
|
-
g ?
|
|
4688
|
-
this.dropdownOpen ||
|
|
4689
|
-
})) : u ? (
|
|
4690
|
-
var
|
|
4691
|
-
const m = (
|
|
4731
|
+
g ? Zo(this, i, r) : h ? (B(this, i, r), requestAnimationFrame(() => {
|
|
4732
|
+
this.dropdownOpen || W(this);
|
|
4733
|
+
})) : u ? (B(this, i, r), requestAnimationFrame(() => {
|
|
4734
|
+
var v;
|
|
4735
|
+
const m = (v = this.shadowRoot) == null ? void 0 : v.querySelector(
|
|
4692
4736
|
`.wg__cell[data-row="${i}"][data-col="${r}"]`
|
|
4693
|
-
), f = m == null ? void 0 : m.querySelector(".wg__date-input"),
|
|
4694
|
-
f &&
|
|
4695
|
-
})) : p && (
|
|
4737
|
+
), f = m == null ? void 0 : m.querySelector(".wg__date-input"), b = m == null ? void 0 : m.querySelector(".wg__editor--date");
|
|
4738
|
+
f && b && this.openDatePicker(f, b);
|
|
4739
|
+
})) : p && (B(this, i, r), requestAnimationFrame(() => {
|
|
4696
4740
|
this.openCustomEditor(i, r);
|
|
4697
4741
|
}));
|
|
4698
4742
|
break;
|
|
4699
4743
|
}
|
|
4700
4744
|
case "Escape":
|
|
4701
4745
|
if (o.preventDefault(), this.grid.editingCell)
|
|
4702
|
-
|
|
4746
|
+
Y(this), this.grid.cancelEdit();
|
|
4703
4747
|
else {
|
|
4704
4748
|
const l = this.grid.focusedCell;
|
|
4705
|
-
this.grid.clearFocusedCell(),
|
|
4749
|
+
this.grid.clearFocusedCell(), K(this, l, null), (c = o.target) == null || c.blur();
|
|
4706
4750
|
}
|
|
4707
4751
|
break;
|
|
4708
4752
|
case "Delete": {
|
|
@@ -4727,7 +4771,7 @@ class Zi extends HTMLElement {
|
|
|
4727
4771
|
const l = s[r];
|
|
4728
4772
|
if ((l == null ? void 0 : l.editor) === "number" && !/[\d.\-]/.test(o.key))
|
|
4729
4773
|
return;
|
|
4730
|
-
|
|
4774
|
+
B(this, i, r, { initialSearchQuery: o.key }), o.preventDefault();
|
|
4731
4775
|
}
|
|
4732
4776
|
break;
|
|
4733
4777
|
}
|
|
@@ -4742,7 +4786,7 @@ class Zi extends HTMLElement {
|
|
|
4742
4786
|
const r = parseInt(i.dataset.row || "0", 10), s = i.dataset.field || "", n = this.grid.columns.find((l) => l.field === s), d = (n == null ? void 0 : n.editor) || "text", a = d === "select" || d === "combobox" || d === "autocomplete", c = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Home", "End"];
|
|
4743
4787
|
if (a && !this.dropdownOpen && c.includes(o.key)) {
|
|
4744
4788
|
o.preventDefault(), o.stopPropagation();
|
|
4745
|
-
const l = this.grid.columns.findIndex((
|
|
4789
|
+
const l = this.grid.columns.findIndex((b) => b.field === s), g = this.grid.columns.map((b, v) => ({ index: v, column: b })).filter((b) => b.column.editable !== !1), h = g.findIndex((b) => b.index === l), u = this.grid.displayItems;
|
|
4746
4790
|
let p = r, m = l, f = !1;
|
|
4747
4791
|
switch (o.key) {
|
|
4748
4792
|
case "ArrowUp":
|
|
@@ -4770,8 +4814,8 @@ class Zi extends HTMLElement {
|
|
|
4770
4814
|
o.ctrlKey ? (p = u.length - 1, m = this.grid.columns.length - 1) : m = this.grid.columns.length - 1, f = !0;
|
|
4771
4815
|
break;
|
|
4772
4816
|
}
|
|
4773
|
-
f && (
|
|
4774
|
-
|
|
4817
|
+
f && (Y(this), this.grid.cancelEdit(), queueMicrotask(() => {
|
|
4818
|
+
$(this, p, m);
|
|
4775
4819
|
}));
|
|
4776
4820
|
return;
|
|
4777
4821
|
}
|
|
@@ -4783,7 +4827,7 @@ class Zi extends HTMLElement {
|
|
|
4783
4827
|
let g = this.highlightedIndex + 1;
|
|
4784
4828
|
for (; g < this.dropdownOptions.length && mt(this.dropdownOptions[g], l); )
|
|
4785
4829
|
g++;
|
|
4786
|
-
g < this.dropdownOptions.length && (this.highlightedIndex = g, et(this),
|
|
4830
|
+
g < this.dropdownOptions.length && (this.highlightedIndex = g, et(this), fe(this));
|
|
4787
4831
|
}
|
|
4788
4832
|
break;
|
|
4789
4833
|
case "ArrowUp":
|
|
@@ -4793,13 +4837,13 @@ class Zi extends HTMLElement {
|
|
|
4793
4837
|
let g = this.highlightedIndex - 1;
|
|
4794
4838
|
for (; g >= 0 && mt(this.dropdownOptions[g], l); )
|
|
4795
4839
|
g--;
|
|
4796
|
-
g >= 0 && (this.highlightedIndex = g, et(this),
|
|
4840
|
+
g >= 0 && (this.highlightedIndex = g, et(this), fe(this));
|
|
4797
4841
|
}
|
|
4798
4842
|
break;
|
|
4799
4843
|
case "Enter":
|
|
4800
4844
|
if (this.datepicker)
|
|
4801
4845
|
return;
|
|
4802
|
-
o.preventDefault(), o.stopPropagation(), this.dropdownOpen && this.highlightedIndex >= 0 ?
|
|
4846
|
+
o.preventDefault(), o.stopPropagation(), this.dropdownOpen && this.highlightedIndex >= 0 ? Ie(this, this.highlightedIndex) : a && !this.dropdownOpen ? W(this) : (this.isCommittingFromKeyboard = !0, L(this), d === "date" && i instanceof HTMLInputElement ? this.commitDateEditor(i) : Mt(this, i), Ft(this, r, s, "down"));
|
|
4803
4847
|
break;
|
|
4804
4848
|
case "Tab":
|
|
4805
4849
|
if (this.datepicker)
|
|
@@ -4812,20 +4856,20 @@ class Zi extends HTMLElement {
|
|
|
4812
4856
|
}
|
|
4813
4857
|
L(this);
|
|
4814
4858
|
} else
|
|
4815
|
-
L(this), d === "date" && i instanceof HTMLInputElement ? this.commitDateEditor(i) : a ||
|
|
4859
|
+
L(this), d === "date" && i instanceof HTMLInputElement ? this.commitDateEditor(i) : a || Mt(this, i);
|
|
4816
4860
|
Ft(this, r, s, o.shiftKey ? "prev" : "next");
|
|
4817
4861
|
break;
|
|
4818
4862
|
case "Escape":
|
|
4819
|
-
o.preventDefault(), o.stopPropagation(), this.dropdownOpen && L(this), this.datepicker && (this.datepicker.close(!0), this.datepicker = null), this.isCommittingFromKeyboard = !0,
|
|
4863
|
+
o.preventDefault(), o.stopPropagation(), this.dropdownOpen && L(this), this.datepicker && (this.datepicker.close(!0), this.datepicker = null), this.isCommittingFromKeyboard = !0, Y(this), this.grid.cancelEdit(), ei(this, r, s);
|
|
4820
4864
|
break;
|
|
4821
4865
|
case "F2":
|
|
4822
|
-
o.preventDefault(), o.stopPropagation(), a && !this.dropdownOpen &&
|
|
4866
|
+
o.preventDefault(), o.stopPropagation(), a && !this.dropdownOpen && W(this);
|
|
4823
4867
|
break;
|
|
4824
4868
|
case "Backspace":
|
|
4825
|
-
d === "select" && (o.preventDefault(), o.stopPropagation(), this.filterText.length > 0 && (this.filterText = this.filterText.slice(0, -1),
|
|
4869
|
+
d === "select" && (o.preventDefault(), o.stopPropagation(), this.filterText.length > 0 && (this.filterText = this.filterText.slice(0, -1), be(this, n.editorOptions || {})));
|
|
4826
4870
|
break;
|
|
4827
4871
|
default:
|
|
4828
|
-
d === "select" && o.key.length === 1 && !o.ctrlKey && !o.altKey && !o.metaKey && (o.preventDefault(), o.stopPropagation(), this.filterText += o.key,
|
|
4872
|
+
d === "select" && o.key.length === 1 && !o.ctrlKey && !o.altKey && !o.metaKey && (o.preventDefault(), o.stopPropagation(), this.filterText += o.key, be(this, n.editorOptions || {}));
|
|
4829
4873
|
break;
|
|
4830
4874
|
}
|
|
4831
4875
|
}
|
|
@@ -4840,11 +4884,11 @@ class Zi extends HTMLElement {
|
|
|
4840
4884
|
const n = s.target;
|
|
4841
4885
|
if (n.matches(".wg__cell")) {
|
|
4842
4886
|
const a = parseInt(n.dataset.row || "0", 10), c = parseInt(n.dataset.col || "0", 10);
|
|
4843
|
-
|
|
4887
|
+
Xo(this, a, c);
|
|
4844
4888
|
}
|
|
4845
4889
|
if (n.matches(".wg__select-trigger, .wg__combobox-input, .wg__autocomplete-input") && !this.justSelected && !this.dropdownOpen) {
|
|
4846
4890
|
const a = n.dataset.field || "", c = this.grid.columns.find((h) => h.field === a), l = (c == null ? void 0 : c.editorOptions) || {};
|
|
4847
|
-
(((d = this.grid.editingCell) == null ? void 0 : d.initialSearchQuery) !== void 0 || l.showOnFocus !== !1) &&
|
|
4891
|
+
(((d = this.grid.editingCell) == null ? void 0 : d.initialSearchQuery) !== void 0 || l.showOnFocus !== !1) && W(this);
|
|
4848
4892
|
}
|
|
4849
4893
|
}, !0), o.addEventListener("keydown", (s) => {
|
|
4850
4894
|
const n = s.target;
|
|
@@ -4857,7 +4901,7 @@ class Zi extends HTMLElement {
|
|
|
4857
4901
|
this.handleCellKeyDown(s, d, a);
|
|
4858
4902
|
}
|
|
4859
4903
|
}), o.addEventListener("focusout", (s) => {
|
|
4860
|
-
|
|
4904
|
+
Qo(this, s);
|
|
4861
4905
|
}), o.addEventListener("dblclick", (s) => {
|
|
4862
4906
|
s.preventDefault();
|
|
4863
4907
|
const d = s.target.closest(".wg__cell");
|
|
@@ -4867,10 +4911,10 @@ class Zi extends HTMLElement {
|
|
|
4867
4911
|
const g = l.editTrigger || this.grid.editTrigger;
|
|
4868
4912
|
if (g === "dblclick" || g === "navigate") {
|
|
4869
4913
|
const h = zt(s, d);
|
|
4870
|
-
|
|
4914
|
+
B(this, a, c, { cursorPosition: h ?? void 0 });
|
|
4871
4915
|
const u = l.editor;
|
|
4872
4916
|
u === "select" || u === "combobox" || u === "autocomplete" ? requestAnimationFrame(() => {
|
|
4873
|
-
this.dropdownOpen ||
|
|
4917
|
+
this.dropdownOpen || W(this);
|
|
4874
4918
|
}) : u === "custom" && requestAnimationFrame(() => {
|
|
4875
4919
|
this.openCustomEditor(a, c);
|
|
4876
4920
|
});
|
|
@@ -4884,10 +4928,10 @@ class Zi extends HTMLElement {
|
|
|
4884
4928
|
if (l && (l.editTrigger || this.grid.editTrigger) === "click") {
|
|
4885
4929
|
s.preventDefault();
|
|
4886
4930
|
const h = zt(s, d);
|
|
4887
|
-
|
|
4931
|
+
B(this, a, c, { cursorPosition: h ?? void 0 });
|
|
4888
4932
|
const u = l.editor;
|
|
4889
4933
|
u === "select" || u === "combobox" || u === "autocomplete" ? requestAnimationFrame(() => {
|
|
4890
|
-
this.dropdownOpen ||
|
|
4934
|
+
this.dropdownOpen || W(this);
|
|
4891
4935
|
}) : u === "custom" && requestAnimationFrame(() => {
|
|
4892
4936
|
this.openCustomEditor(a, c);
|
|
4893
4937
|
});
|
|
@@ -4903,7 +4947,7 @@ class Zi extends HTMLElement {
|
|
|
4903
4947
|
l && this.openDatePicker(l, c);
|
|
4904
4948
|
} else if (a) {
|
|
4905
4949
|
const l = parseInt(a.dataset.row || "0", 10), g = a.dataset.field || "", h = this.grid.columns.findIndex((u) => String(u.field) === g);
|
|
4906
|
-
h >= 0 && (this.isTransitioningCells = !0, this.grid.editingCell && (L(this),
|
|
4950
|
+
h >= 0 && (this.isTransitioningCells = !0, this.grid.editingCell && (L(this), Y(this), this.grid.cancelEdit()), B(this, l, h), requestAnimationFrame(() => {
|
|
4907
4951
|
var f;
|
|
4908
4952
|
this.isTransitioningCells = !1;
|
|
4909
4953
|
const u = (f = this.shadowRoot) == null ? void 0 : f.querySelector(
|
|
@@ -4921,16 +4965,16 @@ class Zi extends HTMLElement {
|
|
|
4921
4965
|
if (g && !h) {
|
|
4922
4966
|
const u = this.grid.columns.findIndex((p) => String(p.field) === g.field);
|
|
4923
4967
|
if (c !== g.rowIndex || l !== u) {
|
|
4924
|
-
s.preventDefault(), this.isTransitioningCells = !0, L(this),
|
|
4925
|
-
const p = this.grid.columns[l], m = (p == null ? void 0 : p.editTrigger) || this.grid.editTrigger,
|
|
4968
|
+
s.preventDefault(), this.isTransitioningCells = !0, L(this), Y(this), this.grid.cancelEdit();
|
|
4969
|
+
const p = this.grid.columns[l], m = (p == null ? void 0 : p.editTrigger) || this.grid.editTrigger, b = s.clientX;
|
|
4926
4970
|
requestAnimationFrame(() => {
|
|
4927
4971
|
if (this.isTransitioningCells = !1, m === "click" && p && this.grid.isCellEditable(p)) {
|
|
4928
|
-
const
|
|
4972
|
+
const v = this.shadow.querySelector(
|
|
4929
4973
|
`td[data-row="${c}"][data-col="${l}"]`
|
|
4930
|
-
), _ =
|
|
4931
|
-
|
|
4974
|
+
), _ = v ? zt({ clientX: b }, v) : void 0;
|
|
4975
|
+
B(this, c, l, { cursorPosition: _ ?? void 0 });
|
|
4932
4976
|
} else
|
|
4933
|
-
|
|
4977
|
+
$(this, c, l);
|
|
4934
4978
|
});
|
|
4935
4979
|
return;
|
|
4936
4980
|
}
|
|
@@ -4941,11 +4985,11 @@ class Zi extends HTMLElement {
|
|
|
4941
4985
|
s.preventDefault(), s.stopPropagation();
|
|
4942
4986
|
const a = n.closest(".wg__cell-dropdown-display");
|
|
4943
4987
|
if (n.closest(".wg__editor--select, .wg__editor--combobox, .wg__editor--autocomplete"))
|
|
4944
|
-
|
|
4988
|
+
me(this);
|
|
4945
4989
|
else if (a) {
|
|
4946
4990
|
const l = parseInt(a.dataset.row || "0", 10), g = a.dataset.field || "", h = this.grid.columns.findIndex((u) => String(u.field) === g);
|
|
4947
|
-
h >= 0 && (this.isTransitioningCells = !0, this.grid.editingCell && (L(this),
|
|
4948
|
-
this.isTransitioningCells = !1, this.dropdownOpen ||
|
|
4991
|
+
h >= 0 && (this.isTransitioningCells = !0, this.grid.editingCell && (L(this), Y(this), this.grid.cancelEdit()), B(this, l, h), requestAnimationFrame(() => {
|
|
4992
|
+
this.isTransitioningCells = !1, this.dropdownOpen || W(this);
|
|
4949
4993
|
}));
|
|
4950
4994
|
}
|
|
4951
4995
|
}
|
|
@@ -4954,13 +4998,13 @@ class Zi extends HTMLElement {
|
|
|
4954
4998
|
const a = n.closest(".wg__cell-dropdown-display");
|
|
4955
4999
|
if (a) {
|
|
4956
5000
|
const c = parseInt(a.dataset.row || "0", 10), l = a.dataset.field || "", g = this.grid.columns.findIndex((h) => String(h.field) === l);
|
|
4957
|
-
g >= 0 && (this.isTransitioningCells = !0, this.grid.editingCell && (L(this),
|
|
4958
|
-
this.isTransitioningCells = !1, this.dropdownOpen ||
|
|
5001
|
+
g >= 0 && (this.isTransitioningCells = !0, this.grid.editingCell && (L(this), Y(this), this.grid.cancelEdit()), B(this, c, g), requestAnimationFrame(() => {
|
|
5002
|
+
this.isTransitioningCells = !1, this.dropdownOpen || W(this);
|
|
4959
5003
|
}));
|
|
4960
5004
|
}
|
|
4961
5005
|
}
|
|
4962
5006
|
}), o.addEventListener("click", (s) => {
|
|
4963
|
-
s.target.matches(".wg__select-trigger, .wg__select-value") && (s.preventDefault(), s.stopPropagation(),
|
|
5007
|
+
s.target.matches(".wg__select-trigger, .wg__select-value") && (s.preventDefault(), s.stopPropagation(), me(this));
|
|
4964
5008
|
}), o.addEventListener("click", (s) => {
|
|
4965
5009
|
const n = s, a = n.target.closest(".wg__header--sortable");
|
|
4966
5010
|
if (a) {
|
|
@@ -4973,20 +5017,20 @@ class Zi extends HTMLElement {
|
|
|
4973
5017
|
this.handleContextMenu(s);
|
|
4974
5018
|
}), o.addEventListener("change", (s) => {
|
|
4975
5019
|
const n = s.target;
|
|
4976
|
-
n.matches(".wg__editor--checkbox") &&
|
|
5020
|
+
n.matches(".wg__editor--checkbox") && Jo(this, n);
|
|
4977
5021
|
}), o.addEventListener("input", (s) => {
|
|
4978
5022
|
const n = s.target;
|
|
4979
|
-
n.matches(".wg__combobox-input") ?
|
|
5023
|
+
n.matches(".wg__combobox-input") ? Yo(this, s) : n.matches(".wg__autocomplete-input") && No(this, s);
|
|
4980
5024
|
}), o.addEventListener("blur", (s) => {
|
|
4981
5025
|
const n = s.target;
|
|
4982
|
-
if (n.matches(".wg__editor--text, .wg__editor--number") &&
|
|
5026
|
+
if (n.matches(".wg__editor--text, .wg__editor--number") && ti(this, n), n.matches(".wg__date-input") && !this.datepicker && !this.isCommittingFromKeyboard && !this.isTransitioningCells && this.commitDateEditor(n), n.matches(".wg__select-trigger") && !this.isCommittingFromKeyboard && !this.isTransitioningCells && !this.dropdownOpen && !this.isOpeningDropdown && (L(this), Y(this), this.grid.cancelEdit()), n.matches(".wg__combobox-input, .wg__autocomplete-input")) {
|
|
4983
5027
|
if (this.isCommittingFromKeyboard || this.isTransitioningCells)
|
|
4984
5028
|
return;
|
|
4985
5029
|
if (L(this), this.grid.editingCell) {
|
|
4986
5030
|
const d = n, a = this.getCurrentEditingColumn();
|
|
4987
5031
|
if (a) {
|
|
4988
5032
|
const c = a.editorOptions || {}, g = (c.options || c.initialOptions || []).find(
|
|
4989
|
-
(h) =>
|
|
5033
|
+
(h) => Ct(h, c).toLowerCase() === d.value.toLowerCase()
|
|
4990
5034
|
);
|
|
4991
5035
|
g ? this.grid.commitEdit(this.grid.editingCell.rowIndex, this.grid.editingCell.field, at(g, c)) : this.grid.commitEdit(this.grid.editingCell.rowIndex, this.grid.editingCell.field, d.value);
|
|
4992
5036
|
}
|
|
@@ -4995,24 +5039,24 @@ class Zi extends HTMLElement {
|
|
|
4995
5039
|
}, !0);
|
|
4996
5040
|
const i = this.shadow.querySelector(".wg");
|
|
4997
5041
|
i && i.addEventListener("scroll", () => {
|
|
4998
|
-
this.dropdownOpen && !this.isTransitioningCells && !this.isOpeningDropdown && (L(this),
|
|
5042
|
+
this.dropdownOpen && !this.isTransitioningCells && !this.isOpeningDropdown && (L(this), Y(this), this.grid.cancelEdit()), this.grid.shouldUseVirtualScroll() && this.handleVirtualScroll(i), this.grid.infiniteScroll && this.grid.hasMoreItems && !this.isLoadingMoreItems && this.handleInfiniteScroll(i), bt() !== null && (_e(this, this.grid.displayItems), this.renderConnector());
|
|
4999
5043
|
}), this.wheelListenerAdded || (this.wheelListenerAdded = !0, window.addEventListener("scroll", () => {
|
|
5000
|
-
this.dropdownOpen && !this.isTransitioningCells && (L(this),
|
|
5044
|
+
this.dropdownOpen && !this.isTransitioningCells && (L(this), Y(this), this.grid.cancelEdit());
|
|
5001
5045
|
}, { passive: !0, capture: !0 })), o.addEventListener("mouseenter", (s) => {
|
|
5002
5046
|
const n = s.target, d = n.closest("[data-tooltip-html]");
|
|
5003
5047
|
if (d) {
|
|
5004
5048
|
const c = d.getAttribute("data-tooltip-html");
|
|
5005
|
-
|
|
5049
|
+
ve(this, d, c, this._tooltipShowDelay, !0);
|
|
5006
5050
|
return;
|
|
5007
5051
|
}
|
|
5008
5052
|
const a = n.closest("[data-tooltip]");
|
|
5009
5053
|
if (a) {
|
|
5010
5054
|
const c = a.getAttribute("data-tooltip");
|
|
5011
|
-
|
|
5055
|
+
ve(this, a, c, this._tooltipShowDelay, !1);
|
|
5012
5056
|
}
|
|
5013
5057
|
}, !0), o.addEventListener("mouseleave", (s) => {
|
|
5014
5058
|
const n = s, d = n.target, a = n.relatedTarget, c = d.closest("[data-tooltip], [data-tooltip-html]");
|
|
5015
|
-
c && (a == null ? void 0 : a.closest("[data-tooltip], [data-tooltip-html]")) === c || c &&
|
|
5059
|
+
c && (a == null ? void 0 : a.closest("[data-tooltip], [data-tooltip-html]")) === c || c && jo(this, this._tooltipHideDelay);
|
|
5016
5060
|
}, !0), o.addEventListener("click", (s) => {
|
|
5017
5061
|
const d = s.target.closest(".wg__toolbar-trigger");
|
|
5018
5062
|
if (d && this.grid.toolbarTrigger === "button") {
|
|
@@ -5045,7 +5089,7 @@ class Zi extends HTMLElement {
|
|
|
5045
5089
|
qt(c) ? (this.closeToolbarAndReset(), this.render()) : this.showToolbarForRow(a, c, n.clientX);
|
|
5046
5090
|
}
|
|
5047
5091
|
}), this.toolbarOutsideClickAdded || (this.toolbarOutsideClickAdded = !0, document.addEventListener("click", (s) => {
|
|
5048
|
-
if (!
|
|
5092
|
+
if (!wi(this.shadow))
|
|
5049
5093
|
return;
|
|
5050
5094
|
const n = s.composedPath(), d = n.some((l) => {
|
|
5051
5095
|
var g;
|
|
@@ -5054,9 +5098,9 @@ class Zi extends HTMLElement {
|
|
|
5054
5098
|
var g;
|
|
5055
5099
|
return (g = l.classList) == null ? void 0 : g.contains("wg__toolbar-trigger");
|
|
5056
5100
|
});
|
|
5057
|
-
d || a || n.includes(this) && (this.grid.toolbarTrigger === "hover" || this.grid.toolbarTrigger === "click") ||
|
|
5101
|
+
d || a || n.includes(this) && (this.grid.toolbarTrigger === "hover" || this.grid.toolbarTrigger === "click") || bt() !== null && (this.closeToolbarAndReset(), this.render());
|
|
5058
5102
|
})), this.toolbarScrollListenerAdded || (this.toolbarScrollListenerAdded = !0, window.addEventListener("scroll", () => {
|
|
5059
|
-
|
|
5103
|
+
bt() !== null && (this.closeToolbarAndReset(), this.render());
|
|
5060
5104
|
}, !0)), this.shadow.querySelectorAll(".wg__pagination").forEach((s) => {
|
|
5061
5105
|
s.addEventListener("click", (d) => {
|
|
5062
5106
|
const c = d.target.closest(".wg__pagination-btn");
|
|
@@ -5103,12 +5147,12 @@ class Zi extends HTMLElement {
|
|
|
5103
5147
|
rowHeight: this.grid.virtualScrollRowHeight,
|
|
5104
5148
|
totalItems: r.length
|
|
5105
5149
|
}, n = this.grid.focusedCell;
|
|
5106
|
-
if (i.innerHTML =
|
|
5150
|
+
if (i.innerHTML = ye(this, s), n) {
|
|
5107
5151
|
this.grid.setFocusedCell(n.rowIndex, n.colIndex);
|
|
5108
5152
|
const d = i.querySelector(
|
|
5109
5153
|
`td[data-row="${n.rowIndex}"][data-col="${n.colIndex}"]`
|
|
5110
5154
|
);
|
|
5111
|
-
d && (d.focus({ preventScroll: !0 }),
|
|
5155
|
+
d && (d.focus({ preventScroll: !0 }), K(this, null, n));
|
|
5112
5156
|
}
|
|
5113
5157
|
}
|
|
5114
5158
|
/**
|
|
@@ -5127,18 +5171,18 @@ class Zi extends HTMLElement {
|
|
|
5127
5171
|
o && o.remove();
|
|
5128
5172
|
const n = document.createElement("div");
|
|
5129
5173
|
n.className = bi(this);
|
|
5130
|
-
const d = this.grid.paginationPosition.split("|").map((f) => f.trim()), a = this.grid.summaryPosition ? this.grid.summaryPosition.split("|").map((f) => f.trim()) : [], c = (f,
|
|
5131
|
-
const
|
|
5132
|
-
(x) =>
|
|
5174
|
+
const d = this.grid.paginationPosition.split("|").map((f) => f.trim()), a = this.grid.summaryPosition ? this.grid.summaryPosition.split("|").map((f) => f.trim()) : [], c = (f, b) => {
|
|
5175
|
+
const v = d.filter(
|
|
5176
|
+
(x) => b ? x.startsWith("top-") : x.startsWith("bottom-")
|
|
5133
5177
|
), _ = a.filter(
|
|
5134
|
-
(x) =>
|
|
5135
|
-
), S =
|
|
5136
|
-
return !S && !y ? "" : y && S && this.grid.summaryInline ? `<div class="wg__footer${
|
|
5178
|
+
(x) => b ? x.startsWith("top-") : x.startsWith("bottom-")
|
|
5179
|
+
), S = v.length > 0, y = _.length > 0;
|
|
5180
|
+
return !S && !y ? "" : y && S && this.grid.summaryInline ? `<div class="wg__footer${b ? " wg__footer--top" : ""}">
|
|
5137
5181
|
${Nt(this, _[0])}
|
|
5138
|
-
${Yt(this,
|
|
5139
|
-
</div>` : [.../* @__PURE__ */ new Set([...
|
|
5140
|
-
const C =
|
|
5141
|
-
return T && C ? `<div class="wg__footer${
|
|
5182
|
+
${Yt(this, v[0])}
|
|
5183
|
+
</div>` : [.../* @__PURE__ */ new Set([...v, ..._])].map((x) => {
|
|
5184
|
+
const C = v.includes(x), T = _.includes(x);
|
|
5185
|
+
return T && C ? `<div class="wg__footer${b ? " wg__footer--top" : ""}">
|
|
5142
5186
|
${Nt(this, x)}
|
|
5143
5187
|
${Yt(this, x)}
|
|
5144
5188
|
</div>` : T ? Nt(this, x) : Yt(this, x);
|
|
@@ -5146,15 +5190,15 @@ class Zi extends HTMLElement {
|
|
|
5146
5190
|
}, l = c(d, !0), g = c(d, !1), h = this.grid.shouldUseVirtualScroll();
|
|
5147
5191
|
let u;
|
|
5148
5192
|
if (h) {
|
|
5149
|
-
const f = this.grid.displayItems,
|
|
5193
|
+
const f = this.grid.displayItems, b = this.grid.virtualScrollRowHeight, v = this.grid.virtualScrollBuffer, _ = (o == null ? void 0 : o.clientHeight) || 400, S = Math.max(0, Math.floor(i / b) - v), y = Math.ceil(_ / b) + v * 2, D = Math.min(f.length, S + y);
|
|
5150
5194
|
this.virtualScrollStart = S, this.virtualScrollEnd = D;
|
|
5151
5195
|
const x = {
|
|
5152
5196
|
startIndex: S,
|
|
5153
5197
|
endIndex: D,
|
|
5154
|
-
rowHeight:
|
|
5198
|
+
rowHeight: b,
|
|
5155
5199
|
totalItems: f.length
|
|
5156
5200
|
};
|
|
5157
|
-
u =
|
|
5201
|
+
u = ye(this, x);
|
|
5158
5202
|
} else
|
|
5159
5203
|
u = _i(this);
|
|
5160
5204
|
h && n.classList.add("wg--virtual-scroll");
|
|
@@ -5178,15 +5222,15 @@ class Zi extends HTMLElement {
|
|
|
5178
5222
|
if (n.scrollLeft = r, this.attachEventListeners(), this.grid.editingCell) {
|
|
5179
5223
|
let f = this.shadow.querySelector(".wg__combobox-input, .wg__autocomplete-input, .wg__select-trigger, .wg__date-input");
|
|
5180
5224
|
if (f || (f = this.shadow.querySelector(".wg__editor")), f && (f.focus(), f instanceof HTMLInputElement && f.type === "text")) {
|
|
5181
|
-
const
|
|
5225
|
+
const b = this.grid.editingCell.cursorPosition, v = this.getCurrentEditingColumn(), _ = ((m = v == null ? void 0 : v.editorOptions) == null ? void 0 : m.editStartSelection) || this.grid.editStartSelection;
|
|
5182
5226
|
if (this.grid.editingCell.initialSearchQuery !== void 0) {
|
|
5183
5227
|
const S = f.value.length;
|
|
5184
5228
|
f.setSelectionRange(S, S);
|
|
5185
5229
|
} else
|
|
5186
5230
|
switch (_) {
|
|
5187
5231
|
case "mousePosition":
|
|
5188
|
-
if (
|
|
5189
|
-
const S = Math.min(
|
|
5232
|
+
if (b !== void 0) {
|
|
5233
|
+
const S = Math.min(b, f.value.length);
|
|
5190
5234
|
f.setSelectionRange(S, S);
|
|
5191
5235
|
} else
|
|
5192
5236
|
f.setSelectionRange(f.value.length, f.value.length);
|
|
@@ -5221,7 +5265,7 @@ class Zi extends HTMLElement {
|
|
|
5221
5265
|
renderConnector() {
|
|
5222
5266
|
const o = this.shadow.querySelector(".wg__connector");
|
|
5223
5267
|
o && o.remove();
|
|
5224
|
-
const i =
|
|
5268
|
+
const i = mi();
|
|
5225
5269
|
if (!i.path || !i.arrowPos)
|
|
5226
5270
|
return;
|
|
5227
5271
|
const r = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
@@ -5237,7 +5281,7 @@ class Zi extends HTMLElement {
|
|
|
5237
5281
|
openDatePicker(o, i) {
|
|
5238
5282
|
this.datepicker && (this.datepicker.close(!0), this.datepicker = null);
|
|
5239
5283
|
const r = o.dataset.dateFormat || "YYYY-MM-DD", s = o.dataset.minDate, n = o.dataset.maxDate, d = o.dataset.dateValue || "";
|
|
5240
|
-
this.datepicker = new
|
|
5284
|
+
this.datepicker = new se({
|
|
5241
5285
|
dateFormat: r,
|
|
5242
5286
|
minDate: s || void 0,
|
|
5243
5287
|
maxDate: n || void 0,
|
|
@@ -5245,7 +5289,7 @@ class Zi extends HTMLElement {
|
|
|
5245
5289
|
this.handleDatePickerSelect(o, a, c);
|
|
5246
5290
|
},
|
|
5247
5291
|
onClose: () => {
|
|
5248
|
-
this.datepicker = null,
|
|
5292
|
+
this.datepicker = null, Y(this), this.grid.cancelEdit();
|
|
5249
5293
|
}
|
|
5250
5294
|
}), this.datepicker.open(i, d || null);
|
|
5251
5295
|
}
|
|
@@ -5254,7 +5298,7 @@ class Zi extends HTMLElement {
|
|
|
5254
5298
|
*/
|
|
5255
5299
|
handleDatePickerSelect(o, i, r) {
|
|
5256
5300
|
const s = o.dataset.dateFormat || "YYYY-MM-DD", n = Kt(s);
|
|
5257
|
-
o.value =
|
|
5301
|
+
o.value = Ve(i, n), o.dataset.dateValue = Wt(i), this.isCommittingFromKeyboard = !0, this.commitDateEditor(o);
|
|
5258
5302
|
const d = parseInt(o.dataset.row || "0", 10), a = o.dataset.field || "";
|
|
5259
5303
|
this.moveFocusAfterCommit(d, a, r || "down");
|
|
5260
5304
|
}
|
|
@@ -5336,7 +5380,7 @@ class Zi extends HTMLElement {
|
|
|
5336
5380
|
const u = this.shadow.querySelector(
|
|
5337
5381
|
`td[data-row="${g}"][data-col="${o}"]`
|
|
5338
5382
|
);
|
|
5339
|
-
u && (u.scrollIntoView({ block: "nearest", behavior: "auto" }), u.focus(),
|
|
5383
|
+
u && (u.scrollIntoView({ block: "nearest", behavior: "auto" }), u.focus(), K(this, h, { rowIndex: g, colIndex: o }));
|
|
5340
5384
|
}
|
|
5341
5385
|
};
|
|
5342
5386
|
n.addEventListener("click", c), d.addEventListener("click", a), r.addEventListener("click", (l) => {
|
|
@@ -5360,13 +5404,13 @@ class Zi extends HTMLElement {
|
|
|
5360
5404
|
rowIndex: o,
|
|
5361
5405
|
field: s,
|
|
5362
5406
|
commit: (c) => {
|
|
5363
|
-
this.grid.commitEdit(o, s, c),
|
|
5364
|
-
|
|
5407
|
+
this.grid.commitEdit(o, s, c), Y(this), requestAnimationFrame(() => {
|
|
5408
|
+
$(this, o, i);
|
|
5365
5409
|
});
|
|
5366
5410
|
},
|
|
5367
5411
|
cancel: () => {
|
|
5368
|
-
|
|
5369
|
-
|
|
5412
|
+
Y(this), this.grid.cancelEdit(), requestAnimationFrame(() => {
|
|
5413
|
+
$(this, o, i);
|
|
5370
5414
|
});
|
|
5371
5415
|
}
|
|
5372
5416
|
};
|
|
@@ -5382,7 +5426,7 @@ class Zi extends HTMLElement {
|
|
|
5382
5426
|
const s = o.target.closest(".wg__cell");
|
|
5383
5427
|
if (!s)
|
|
5384
5428
|
return;
|
|
5385
|
-
o.preventDefault(), this.contextMenuElement && (
|
|
5429
|
+
o.preventDefault(), this.contextMenuElement && (vt(this.contextMenuElement), this.contextMenuElement = null);
|
|
5386
5430
|
const n = parseInt(s.dataset.row || "0", 10), d = parseInt(s.dataset.col || "0", 10), a = this.grid.columns[d];
|
|
5387
5431
|
if (!a) return;
|
|
5388
5432
|
const c = this.grid.displayItems[n];
|
|
@@ -5402,7 +5446,7 @@ class Zi extends HTMLElement {
|
|
|
5402
5446
|
h,
|
|
5403
5447
|
(u) => {
|
|
5404
5448
|
const p = i.find((m) => m.id === u);
|
|
5405
|
-
p != null && p.onclick && p.onclick(h), this.contextMenuElement && (
|
|
5449
|
+
p != null && p.onclick && p.onclick(h), this.contextMenuElement && (vt(this.contextMenuElement), this.contextMenuElement = null);
|
|
5406
5450
|
},
|
|
5407
5451
|
() => {
|
|
5408
5452
|
this.contextMenuElement = null;
|
|
@@ -5415,10 +5459,10 @@ class Zi extends HTMLElement {
|
|
|
5415
5459
|
showToolbarForRow(o, i, r) {
|
|
5416
5460
|
if (!this.grid.showRowToolbar || !this.grid.rowToolbar.length)
|
|
5417
5461
|
return;
|
|
5418
|
-
const s =
|
|
5462
|
+
const s = ui(this.grid.rowToolbar), n = this.grid.displayItems[i];
|
|
5419
5463
|
if (!n)
|
|
5420
5464
|
return;
|
|
5421
|
-
if (this.toolbarHideTimeout && (clearTimeout(this.toolbarHideTimeout), this.toolbarHideTimeout = null),
|
|
5465
|
+
if (this.toolbarHideTimeout && (clearTimeout(this.toolbarHideTimeout), this.toolbarHideTimeout = null), fi(
|
|
5422
5466
|
this,
|
|
5423
5467
|
o,
|
|
5424
5468
|
i,
|
|
@@ -5448,7 +5492,7 @@ class Zi extends HTMLElement {
|
|
|
5448
5492
|
* Close toolbar and reset move flag
|
|
5449
5493
|
*/
|
|
5450
5494
|
closeToolbarAndReset() {
|
|
5451
|
-
this.toolbarMoveInProgress = !1, this.toolbarHovered = !1, this.toolbarHideTimeout && (clearTimeout(this.toolbarHideTimeout), this.toolbarHideTimeout = null),
|
|
5495
|
+
this.toolbarMoveInProgress = !1, this.toolbarHovered = !1, this.toolbarHideTimeout && (clearTimeout(this.toolbarHideTimeout), this.toolbarHideTimeout = null), At();
|
|
5452
5496
|
}
|
|
5453
5497
|
/**
|
|
5454
5498
|
* Handle toolbar item click
|
|
@@ -5468,12 +5512,12 @@ class Zi extends HTMLElement {
|
|
|
5468
5512
|
this.closeToolbarAndReset(), this.render();
|
|
5469
5513
|
return;
|
|
5470
5514
|
}
|
|
5471
|
-
n ? (this.render(),
|
|
5515
|
+
n ? (this.render(), _e(this, this.grid.displayItems), this.renderConnector()) : this.render();
|
|
5472
5516
|
}
|
|
5473
5517
|
}
|
|
5474
5518
|
typeof customElements < "u" && !customElements.get("web-grid") && customElements.define("web-grid", Zi);
|
|
5475
5519
|
export {
|
|
5476
5520
|
Zi as GridElement,
|
|
5477
|
-
|
|
5521
|
+
je as WebGrid,
|
|
5478
5522
|
Zi as default
|
|
5479
5523
|
};
|