@keenmate/web-grid 1.0.0-rc02 → 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 +19 -7
- package/component-variables.manifest.json +5 -4
- package/dist/grid.d.ts +14 -2
- package/dist/modules/toolbar/index.d.ts +1 -0
- package/dist/modules/tooltip/tooltip.d.ts +2 -2
- package/dist/types.d.ts +15 -1
- package/dist/web-component.d.ts +9 -1
- package/dist/web-grid.js +982 -829
- package/dist/web-grid.umd.js +51 -51
- package/package.json +1 -1
- package/src/css/_variables.css +8 -8
package/dist/web-grid.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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
|
|
8
8
|
// ==========================================================================
|
|
9
9
|
w(this, "_items", []);
|
|
10
10
|
w(this, "_columns", []);
|
|
11
|
-
w(this, "
|
|
11
|
+
w(this, "_sortMode", "none");
|
|
12
12
|
w(this, "_filterable", !1);
|
|
13
13
|
w(this, "_pageable", !1);
|
|
14
14
|
w(this, "_pageSize", 10);
|
|
@@ -17,6 +17,7 @@ class Ve {
|
|
|
17
17
|
w(this, "_hoverable", !0);
|
|
18
18
|
w(this, "_editable", !1);
|
|
19
19
|
w(this, "_editTrigger", "dblclick");
|
|
20
|
+
w(this, "_editStartSelection", "mousePosition");
|
|
20
21
|
w(this, "_mode", "excel");
|
|
21
22
|
w(this, "_dropdownToggleVisibility", "always");
|
|
22
23
|
w(this, "_dropdownShowOnFocus", !0);
|
|
@@ -29,6 +30,7 @@ class Ve {
|
|
|
29
30
|
w(this, "_toolbarAlign", "center");
|
|
30
31
|
w(this, "_toolbarTopPosition", "center");
|
|
31
32
|
w(this, "_toolbarTrigger", "hover");
|
|
33
|
+
w(this, "_toolbarPosition", "auto");
|
|
32
34
|
w(this, "_contextMenu");
|
|
33
35
|
// ==========================================================================
|
|
34
36
|
// Callbacks
|
|
@@ -37,6 +39,7 @@ class Ve {
|
|
|
37
39
|
w(this, "_onroweditstart");
|
|
38
40
|
w(this, "_onroweditcancel");
|
|
39
41
|
w(this, "_onvalidationerror");
|
|
42
|
+
w(this, "_validationTooltipCallback");
|
|
40
43
|
w(this, "_ontoolbarclick");
|
|
41
44
|
w(this, "_onrowaction");
|
|
42
45
|
w(this, "_oncontextmenuopen");
|
|
@@ -100,11 +103,18 @@ class Ve {
|
|
|
100
103
|
set columns(e) {
|
|
101
104
|
this._columns = e, this.requestUpdate();
|
|
102
105
|
}
|
|
106
|
+
get sortMode() {
|
|
107
|
+
return this._sortMode;
|
|
108
|
+
}
|
|
109
|
+
set sortMode(e) {
|
|
110
|
+
this._sortMode = e, this.requestUpdate();
|
|
111
|
+
}
|
|
112
|
+
/** @deprecated Use sortMode instead. sortable=true maps to sortMode="multi", sortable=false maps to sortMode="none" */
|
|
103
113
|
get sortable() {
|
|
104
|
-
return this.
|
|
114
|
+
return this._sortMode !== "none";
|
|
105
115
|
}
|
|
106
116
|
set sortable(e) {
|
|
107
|
-
this.
|
|
117
|
+
this._sortMode = e ? "multi" : "none", this.requestUpdate();
|
|
108
118
|
}
|
|
109
119
|
get filterable() {
|
|
110
120
|
return this._filterable;
|
|
@@ -154,6 +164,12 @@ class Ve {
|
|
|
154
164
|
set editTrigger(e) {
|
|
155
165
|
this._editTrigger = e, this.requestUpdate();
|
|
156
166
|
}
|
|
167
|
+
get editStartSelection() {
|
|
168
|
+
return this._editStartSelection;
|
|
169
|
+
}
|
|
170
|
+
set editStartSelection(e) {
|
|
171
|
+
this._editStartSelection = e;
|
|
172
|
+
}
|
|
157
173
|
get mode() {
|
|
158
174
|
return this._mode;
|
|
159
175
|
}
|
|
@@ -239,7 +255,7 @@ class Ve {
|
|
|
239
255
|
return this._toolbarTopPosition;
|
|
240
256
|
}
|
|
241
257
|
set toolbarTopPosition(e) {
|
|
242
|
-
this._toolbarTopPosition = e;
|
|
258
|
+
this._toolbarTopPosition = e, this.requestUpdate();
|
|
243
259
|
}
|
|
244
260
|
get toolbarTrigger() {
|
|
245
261
|
return this._toolbarTrigger;
|
|
@@ -247,6 +263,12 @@ class Ve {
|
|
|
247
263
|
set toolbarTrigger(e) {
|
|
248
264
|
this._toolbarTrigger = e, this.requestUpdate();
|
|
249
265
|
}
|
|
266
|
+
get toolbarPosition() {
|
|
267
|
+
return this._toolbarPosition;
|
|
268
|
+
}
|
|
269
|
+
set toolbarPosition(e) {
|
|
270
|
+
this._toolbarPosition = e, this.requestUpdate();
|
|
271
|
+
}
|
|
250
272
|
get contextMenu() {
|
|
251
273
|
return this._contextMenu;
|
|
252
274
|
}
|
|
@@ -415,6 +437,12 @@ class Ve {
|
|
|
415
437
|
set onvalidationerror(e) {
|
|
416
438
|
this._onvalidationerror = e;
|
|
417
439
|
}
|
|
440
|
+
get validationTooltipCallback() {
|
|
441
|
+
return this._validationTooltipCallback;
|
|
442
|
+
}
|
|
443
|
+
set validationTooltipCallback(e) {
|
|
444
|
+
this._validationTooltipCallback = e;
|
|
445
|
+
}
|
|
418
446
|
get ontoolbarclick() {
|
|
419
447
|
return this._ontoolbarclick;
|
|
420
448
|
}
|
|
@@ -720,102 +748,102 @@ class Ve {
|
|
|
720
748
|
this._focusedCell = null;
|
|
721
749
|
}
|
|
722
750
|
}
|
|
723
|
-
const qe = ':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-on-accent, #ffffff);--wg-surface-1: var(--base-surface-1, #ffffff);--wg-surface-2: var(--base-surface-2, #f5f5f5);--wg-surface-3: var(--base-surface-3, #ebebeb);--wg-surface-floating: var(--base-dropdown-bg, var(--base-surface-1, #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-surface-3, #f0f0f0);--wg-active-bg: var(--base-surface-3, #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}';
|
|
724
|
-
function
|
|
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}';
|
|
752
|
+
function Jt(t, e, o) {
|
|
725
753
|
const i = o.valueMember || "value", r = o.displayMember || "label", s = e.find((n) => n[i] === t);
|
|
726
754
|
return s ? String(s[r] ?? "") : t != null ? String(t) : "";
|
|
727
755
|
}
|
|
728
|
-
function
|
|
756
|
+
function Ct(t, e) {
|
|
729
757
|
if (e.getDisplayCallback) return e.getDisplayCallback(t);
|
|
730
758
|
const o = e.displayMember || "label";
|
|
731
759
|
return String(t[o] ?? t.label ?? "");
|
|
732
760
|
}
|
|
733
|
-
function
|
|
761
|
+
function at(t, e) {
|
|
734
762
|
if (e.getValueCallback) return e.getValueCallback(t);
|
|
735
763
|
const o = e.valueMember || "value";
|
|
736
764
|
return t[o] ?? t.value;
|
|
737
765
|
}
|
|
738
|
-
function
|
|
766
|
+
function Ke(t, e) {
|
|
739
767
|
return e.getIconCallback ? e.getIconCallback(t) : e.iconMember && t[e.iconMember] || null;
|
|
740
768
|
}
|
|
741
|
-
function
|
|
769
|
+
function We(t, e) {
|
|
742
770
|
return e.getSubtitleCallback ? e.getSubtitleCallback(t) : e.subtitleMember && t[e.subtitleMember] || null;
|
|
743
771
|
}
|
|
744
772
|
function mt(t, e) {
|
|
745
773
|
return e.getDisabledCallback ? e.getDisabledCallback(t) : e.disabledMember ? !!t[e.disabledMember] : !1;
|
|
746
774
|
}
|
|
747
|
-
const
|
|
775
|
+
const it = Math.min, N = Math.max, Tt = Math.round, Dt = Math.floor, G = (t) => ({
|
|
748
776
|
x: t,
|
|
749
777
|
y: t
|
|
750
|
-
}),
|
|
778
|
+
}), Xe = {
|
|
751
779
|
left: "right",
|
|
752
780
|
right: "left",
|
|
753
781
|
bottom: "top",
|
|
754
782
|
top: "bottom"
|
|
755
|
-
},
|
|
783
|
+
}, Qe = {
|
|
756
784
|
start: "end",
|
|
757
785
|
end: "start"
|
|
758
786
|
};
|
|
759
|
-
function
|
|
760
|
-
return
|
|
787
|
+
function Ut(t, e, o) {
|
|
788
|
+
return N(t, it(e, o));
|
|
761
789
|
}
|
|
762
|
-
function
|
|
790
|
+
function pt(t, e) {
|
|
763
791
|
return typeof t == "function" ? t(e) : t;
|
|
764
792
|
}
|
|
765
|
-
function
|
|
793
|
+
function rt(t) {
|
|
766
794
|
return t.split("-")[0];
|
|
767
795
|
}
|
|
768
|
-
function
|
|
796
|
+
function ft(t) {
|
|
769
797
|
return t.split("-")[1];
|
|
770
798
|
}
|
|
771
|
-
function
|
|
799
|
+
function ke(t) {
|
|
772
800
|
return t === "x" ? "y" : "x";
|
|
773
801
|
}
|
|
774
|
-
function
|
|
802
|
+
function Zt(t) {
|
|
775
803
|
return t === "y" ? "height" : "width";
|
|
776
804
|
}
|
|
777
|
-
const
|
|
805
|
+
const Ge = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
778
806
|
function tt(t) {
|
|
779
|
-
return
|
|
807
|
+
return Ge.has(rt(t)) ? "y" : "x";
|
|
780
808
|
}
|
|
781
|
-
function
|
|
782
|
-
return
|
|
809
|
+
function te(t) {
|
|
810
|
+
return ke(tt(t));
|
|
783
811
|
}
|
|
784
|
-
function
|
|
812
|
+
function Je(t, e, o) {
|
|
785
813
|
o === void 0 && (o = !1);
|
|
786
|
-
const i =
|
|
814
|
+
const i = ft(t), r = te(t), s = Zt(r);
|
|
787
815
|
let n = r === "x" ? i === (o ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
788
|
-
return e.reference[s] > e.floating[s] && (n =
|
|
816
|
+
return e.reference[s] > e.floating[s] && (n = Et(n)), [n, Et(n)];
|
|
789
817
|
}
|
|
790
|
-
function
|
|
791
|
-
const e =
|
|
792
|
-
return [
|
|
818
|
+
function Ze(t) {
|
|
819
|
+
const e = Et(t);
|
|
820
|
+
return [jt(t), e, jt(e)];
|
|
793
821
|
}
|
|
794
|
-
function
|
|
795
|
-
return t.replace(/start|end/g, (e) =>
|
|
822
|
+
function jt(t) {
|
|
823
|
+
return t.replace(/start|end/g, (e) => Qe[e]);
|
|
796
824
|
}
|
|
797
|
-
const
|
|
798
|
-
function
|
|
825
|
+
const le = ["left", "right"], de = ["right", "left"], to = ["top", "bottom"], eo = ["bottom", "top"];
|
|
826
|
+
function oo(t, e, o) {
|
|
799
827
|
switch (t) {
|
|
800
828
|
case "top":
|
|
801
829
|
case "bottom":
|
|
802
|
-
return o ? e ?
|
|
830
|
+
return o ? e ? de : le : e ? le : de;
|
|
803
831
|
case "left":
|
|
804
832
|
case "right":
|
|
805
|
-
return e ?
|
|
833
|
+
return e ? to : eo;
|
|
806
834
|
default:
|
|
807
835
|
return [];
|
|
808
836
|
}
|
|
809
837
|
}
|
|
810
|
-
function
|
|
811
|
-
const r =
|
|
812
|
-
let s =
|
|
813
|
-
return r && (s = s.map((n) => n + "-" + r), e && (s = s.concat(s.map(
|
|
838
|
+
function io(t, e, o, i) {
|
|
839
|
+
const r = ft(t);
|
|
840
|
+
let s = oo(rt(t), o === "start", i);
|
|
841
|
+
return r && (s = s.map((n) => n + "-" + r), e && (s = s.concat(s.map(jt)))), s;
|
|
814
842
|
}
|
|
815
|
-
function
|
|
816
|
-
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]);
|
|
817
845
|
}
|
|
818
|
-
function
|
|
846
|
+
function ro(t) {
|
|
819
847
|
return {
|
|
820
848
|
top: 0,
|
|
821
849
|
right: 0,
|
|
@@ -824,15 +852,15 @@ function Ze(t) {
|
|
|
824
852
|
...t
|
|
825
853
|
};
|
|
826
854
|
}
|
|
827
|
-
function
|
|
828
|
-
return typeof t != "number" ?
|
|
855
|
+
function De(t) {
|
|
856
|
+
return typeof t != "number" ? ro(t) : {
|
|
829
857
|
top: t,
|
|
830
858
|
right: t,
|
|
831
859
|
bottom: t,
|
|
832
860
|
left: t
|
|
833
861
|
};
|
|
834
862
|
}
|
|
835
|
-
function
|
|
863
|
+
function $t(t) {
|
|
836
864
|
const {
|
|
837
865
|
x: e,
|
|
838
866
|
y: o,
|
|
@@ -850,12 +878,12 @@ function Dt(t) {
|
|
|
850
878
|
y: o
|
|
851
879
|
};
|
|
852
880
|
}
|
|
853
|
-
function
|
|
881
|
+
function ce(t, e, o) {
|
|
854
882
|
let {
|
|
855
883
|
reference: i,
|
|
856
884
|
floating: r
|
|
857
885
|
} = t;
|
|
858
|
-
const s = tt(e), n =
|
|
886
|
+
const s = tt(e), n = te(e), d = Zt(n), a = rt(e), c = s === "y", l = i.x + i.width / 2 - r.width / 2, g = i.y + i.height / 2 - r.height / 2, h = i[d] / 2 - r[d] / 2;
|
|
859
887
|
let u;
|
|
860
888
|
switch (a) {
|
|
861
889
|
case "top":
|
|
@@ -888,7 +916,7 @@ function ae(t, e, o) {
|
|
|
888
916
|
y: i.y
|
|
889
917
|
};
|
|
890
918
|
}
|
|
891
|
-
switch (
|
|
919
|
+
switch (ft(e)) {
|
|
892
920
|
case "start":
|
|
893
921
|
u[n] -= h * (o && c ? -1 : 1);
|
|
894
922
|
break;
|
|
@@ -898,7 +926,7 @@ function ae(t, e, o) {
|
|
|
898
926
|
}
|
|
899
927
|
return u;
|
|
900
928
|
}
|
|
901
|
-
const
|
|
929
|
+
const no = async (t, e, o) => {
|
|
902
930
|
const {
|
|
903
931
|
placement: i = "bottom",
|
|
904
932
|
strategy: r = "absolute",
|
|
@@ -912,7 +940,7 @@ const to = async (t, e, o) => {
|
|
|
912
940
|
}), {
|
|
913
941
|
x: l,
|
|
914
942
|
y: g
|
|
915
|
-
} =
|
|
943
|
+
} = ce(c, i, a), h = i, u = {}, p = 0;
|
|
916
944
|
for (let m = 0; m < d.length; m++) {
|
|
917
945
|
const {
|
|
918
946
|
name: f,
|
|
@@ -920,7 +948,7 @@ const to = async (t, e, o) => {
|
|
|
920
948
|
} = d[m], {
|
|
921
949
|
x: v,
|
|
922
950
|
y: _,
|
|
923
|
-
data:
|
|
951
|
+
data: S,
|
|
924
952
|
reset: y
|
|
925
953
|
} = await b({
|
|
926
954
|
x: l,
|
|
@@ -940,7 +968,7 @@ const to = async (t, e, o) => {
|
|
|
940
968
|
...u,
|
|
941
969
|
[f]: {
|
|
942
970
|
...u[f],
|
|
943
|
-
...
|
|
971
|
+
...S
|
|
944
972
|
}
|
|
945
973
|
}, y && p <= 50 && (p++, typeof y == "object" && (y.placement && (h = y.placement), y.rects && (c = y.rects === !0 ? await n.getElementRects({
|
|
946
974
|
reference: t,
|
|
@@ -949,7 +977,7 @@ const to = async (t, e, o) => {
|
|
|
949
977
|
}) : y.rects), {
|
|
950
978
|
x: l,
|
|
951
979
|
y: g
|
|
952
|
-
} =
|
|
980
|
+
} = ce(c, h, a)), m = -1);
|
|
953
981
|
}
|
|
954
982
|
return {
|
|
955
983
|
x: l,
|
|
@@ -959,7 +987,7 @@ const to = async (t, e, o) => {
|
|
|
959
987
|
middlewareData: u
|
|
960
988
|
};
|
|
961
989
|
};
|
|
962
|
-
async function
|
|
990
|
+
async function ee(t, e) {
|
|
963
991
|
var o;
|
|
964
992
|
e === void 0 && (e = {});
|
|
965
993
|
const {
|
|
@@ -975,7 +1003,7 @@ async function te(t, e) {
|
|
|
975
1003
|
elementContext: g = "floating",
|
|
976
1004
|
altBoundary: h = !1,
|
|
977
1005
|
padding: u = 0
|
|
978
|
-
} =
|
|
1006
|
+
} = pt(e, t), p = De(u), f = d[h ? g === "floating" ? "reference" : "floating" : g], b = $t(await s.getClippingRect({
|
|
979
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)),
|
|
980
1008
|
boundary: c,
|
|
981
1009
|
rootBoundary: l,
|
|
@@ -985,26 +1013,26 @@ async function te(t, e) {
|
|
|
985
1013
|
y: r,
|
|
986
1014
|
width: n.floating.width,
|
|
987
1015
|
height: n.floating.height
|
|
988
|
-
} : n.reference, _ = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(d.floating)),
|
|
1016
|
+
} : n.reference, _ = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(d.floating)), S = await (s.isElement == null ? void 0 : s.isElement(_)) ? await (s.getScale == null ? void 0 : s.getScale(_)) || {
|
|
989
1017
|
x: 1,
|
|
990
1018
|
y: 1
|
|
991
1019
|
} : {
|
|
992
1020
|
x: 1,
|
|
993
1021
|
y: 1
|
|
994
|
-
}, y =
|
|
1022
|
+
}, y = $t(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
995
1023
|
elements: d,
|
|
996
1024
|
rect: v,
|
|
997
1025
|
offsetParent: _,
|
|
998
1026
|
strategy: a
|
|
999
1027
|
}) : v);
|
|
1000
1028
|
return {
|
|
1001
|
-
top: (b.top - y.top + p.top) /
|
|
1002
|
-
bottom: (y.bottom - b.bottom + p.bottom) /
|
|
1003
|
-
left: (b.left - y.left + p.left) /
|
|
1004
|
-
right: (y.right - b.right + p.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
|
|
1005
1033
|
};
|
|
1006
1034
|
}
|
|
1007
|
-
const
|
|
1035
|
+
const so = (t) => ({
|
|
1008
1036
|
name: "arrow",
|
|
1009
1037
|
options: t,
|
|
1010
1038
|
async fn(e) {
|
|
@@ -1019,29 +1047,29 @@ const eo = (t) => ({
|
|
|
1019
1047
|
} = e, {
|
|
1020
1048
|
element: c,
|
|
1021
1049
|
padding: l = 0
|
|
1022
|
-
} =
|
|
1050
|
+
} = pt(t, e) || {};
|
|
1023
1051
|
if (c == null)
|
|
1024
1052
|
return {};
|
|
1025
|
-
const g =
|
|
1053
|
+
const g = De(l), h = {
|
|
1026
1054
|
x: o,
|
|
1027
1055
|
y: i
|
|
1028
|
-
}, u =
|
|
1029
|
-
let x =
|
|
1030
|
-
(!x || !await (n.isElement == null ? void 0 : n.isElement(
|
|
1031
|
-
const
|
|
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));
|
|
1057
|
+
let x = D ? D[_] : 0;
|
|
1058
|
+
(!x || !await (n.isElement == null ? void 0 : n.isElement(D))) && (x = d.floating[_] || s.floating[p]);
|
|
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;
|
|
1032
1060
|
return {
|
|
1033
|
-
[u]: h[u] +
|
|
1061
|
+
[u]: h[u] + F,
|
|
1034
1062
|
data: {
|
|
1035
|
-
[u]:
|
|
1036
|
-
centerOffset:
|
|
1037
|
-
...
|
|
1038
|
-
alignmentOffset:
|
|
1063
|
+
[u]: R,
|
|
1064
|
+
centerOffset: O - R - F,
|
|
1065
|
+
...z && {
|
|
1066
|
+
alignmentOffset: F
|
|
1039
1067
|
}
|
|
1040
1068
|
},
|
|
1041
|
-
reset:
|
|
1069
|
+
reset: z
|
|
1042
1070
|
};
|
|
1043
1071
|
}
|
|
1044
|
-
}),
|
|
1072
|
+
}), ao = function(t) {
|
|
1045
1073
|
return t === void 0 && (t = {}), {
|
|
1046
1074
|
name: "flip",
|
|
1047
1075
|
options: t,
|
|
@@ -1062,73 +1090,73 @@ const eo = (t) => ({
|
|
|
1062
1090
|
fallbackAxisSideDirection: p = "none",
|
|
1063
1091
|
flipAlignment: m = !0,
|
|
1064
1092
|
...f
|
|
1065
|
-
} =
|
|
1093
|
+
} = pt(t, e);
|
|
1066
1094
|
if ((o = s.arrow) != null && o.alignmentOffset)
|
|
1067
1095
|
return {};
|
|
1068
|
-
const b =
|
|
1069
|
-
!h &&
|
|
1070
|
-
const x = [d, ...y],
|
|
1071
|
-
let
|
|
1072
|
-
if (l && T.push(
|
|
1073
|
-
const
|
|
1074
|
-
T.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));
|
|
1098
|
+
const x = [d, ...y], C = await ee(e, f), T = [];
|
|
1099
|
+
let k = ((i = s.flip) == null ? void 0 : i.overflows) || [];
|
|
1100
|
+
if (l && T.push(C[b]), g) {
|
|
1101
|
+
const O = Je(r, n, S);
|
|
1102
|
+
T.push(C[O[0]], C[O[1]]);
|
|
1075
1103
|
}
|
|
1076
|
-
if (
|
|
1104
|
+
if (k = [...k, {
|
|
1077
1105
|
placement: r,
|
|
1078
1106
|
overflows: T
|
|
1079
|
-
}], !T.every((
|
|
1080
|
-
var
|
|
1081
|
-
const
|
|
1082
|
-
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
|
|
1083
1111
|
// overflows the main axis.
|
|
1084
|
-
|
|
1112
|
+
k.every((V) => tt(V.placement) === v ? V.overflows[0] > 0 : !0)))
|
|
1085
1113
|
return {
|
|
1086
1114
|
data: {
|
|
1087
|
-
index:
|
|
1088
|
-
overflows:
|
|
1115
|
+
index: O,
|
|
1116
|
+
overflows: k
|
|
1089
1117
|
},
|
|
1090
1118
|
reset: {
|
|
1091
|
-
placement:
|
|
1119
|
+
placement: R
|
|
1092
1120
|
}
|
|
1093
1121
|
};
|
|
1094
|
-
let
|
|
1095
|
-
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)
|
|
1096
1124
|
switch (u) {
|
|
1097
1125
|
case "bestFit": {
|
|
1098
|
-
var
|
|
1099
|
-
const
|
|
1100
|
-
if (
|
|
1101
|
-
const
|
|
1102
|
-
return
|
|
1126
|
+
var H;
|
|
1127
|
+
const F = (H = k.filter((V) => {
|
|
1128
|
+
if (D) {
|
|
1129
|
+
const P = tt(V.placement);
|
|
1130
|
+
return P === v || // Create a bias to the `y` side axis due to horizontal
|
|
1103
1131
|
// reading directions favoring greater width.
|
|
1104
|
-
|
|
1132
|
+
P === "y";
|
|
1105
1133
|
}
|
|
1106
1134
|
return !0;
|
|
1107
|
-
}).map((
|
|
1108
|
-
|
|
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);
|
|
1109
1137
|
break;
|
|
1110
1138
|
}
|
|
1111
1139
|
case "initialPlacement":
|
|
1112
|
-
|
|
1140
|
+
z = d;
|
|
1113
1141
|
break;
|
|
1114
1142
|
}
|
|
1115
|
-
if (r !==
|
|
1143
|
+
if (r !== z)
|
|
1116
1144
|
return {
|
|
1117
1145
|
reset: {
|
|
1118
|
-
placement:
|
|
1146
|
+
placement: z
|
|
1119
1147
|
}
|
|
1120
1148
|
};
|
|
1121
1149
|
}
|
|
1122
1150
|
return {};
|
|
1123
1151
|
}
|
|
1124
1152
|
};
|
|
1125
|
-
},
|
|
1126
|
-
async function
|
|
1153
|
+
}, lo = /* @__PURE__ */ new Set(["left", "top"]);
|
|
1154
|
+
async function co(t, e) {
|
|
1127
1155
|
const {
|
|
1128
1156
|
placement: o,
|
|
1129
1157
|
platform: i,
|
|
1130
1158
|
elements: r
|
|
1131
|
-
} = t, s = await (i.isRTL == null ? void 0 : i.isRTL(r.floating)), n =
|
|
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);
|
|
1132
1160
|
let {
|
|
1133
1161
|
mainAxis: h,
|
|
1134
1162
|
crossAxis: u,
|
|
@@ -1150,7 +1178,7 @@ async function ro(t, e) {
|
|
|
1150
1178
|
y: u * l
|
|
1151
1179
|
};
|
|
1152
1180
|
}
|
|
1153
|
-
const
|
|
1181
|
+
const go = function(t) {
|
|
1154
1182
|
return t === void 0 && (t = 0), {
|
|
1155
1183
|
name: "offset",
|
|
1156
1184
|
options: t,
|
|
@@ -1161,7 +1189,7 @@ const no = function(t) {
|
|
|
1161
1189
|
y: s,
|
|
1162
1190
|
placement: n,
|
|
1163
1191
|
middlewareData: d
|
|
1164
|
-
} = e, a = await
|
|
1192
|
+
} = e, a = await co(e, t);
|
|
1165
1193
|
return n === ((o = d.offset) == null ? void 0 : o.placement) && (i = d.arrow) != null && i.alignmentOffset ? {} : {
|
|
1166
1194
|
x: r + a.x,
|
|
1167
1195
|
y: s + a.y,
|
|
@@ -1172,7 +1200,7 @@ const no = function(t) {
|
|
|
1172
1200
|
};
|
|
1173
1201
|
}
|
|
1174
1202
|
};
|
|
1175
|
-
},
|
|
1203
|
+
}, uo = function(t) {
|
|
1176
1204
|
return t === void 0 && (t = {}), {
|
|
1177
1205
|
name: "shift",
|
|
1178
1206
|
options: t,
|
|
@@ -1197,18 +1225,18 @@ const no = function(t) {
|
|
|
1197
1225
|
}
|
|
1198
1226
|
},
|
|
1199
1227
|
...a
|
|
1200
|
-
} =
|
|
1228
|
+
} = pt(t, e), c = {
|
|
1201
1229
|
x: o,
|
|
1202
1230
|
y: i
|
|
1203
|
-
}, l = await
|
|
1231
|
+
}, l = await ee(e, a), g = tt(rt(r)), h = ke(g);
|
|
1204
1232
|
let u = c[h], p = c[g];
|
|
1205
1233
|
if (s) {
|
|
1206
1234
|
const f = h === "y" ? "top" : "left", b = h === "y" ? "bottom" : "right", v = u + l[f], _ = u - l[b];
|
|
1207
|
-
u =
|
|
1235
|
+
u = Ut(v, u, _);
|
|
1208
1236
|
}
|
|
1209
1237
|
if (n) {
|
|
1210
1238
|
const f = g === "y" ? "top" : "left", b = g === "y" ? "bottom" : "right", v = p + l[f], _ = p - l[b];
|
|
1211
|
-
p =
|
|
1239
|
+
p = Ut(v, p, _);
|
|
1212
1240
|
}
|
|
1213
1241
|
const m = d.fn({
|
|
1214
1242
|
...e,
|
|
@@ -1228,7 +1256,7 @@ const no = function(t) {
|
|
|
1228
1256
|
};
|
|
1229
1257
|
}
|
|
1230
1258
|
};
|
|
1231
|
-
},
|
|
1259
|
+
}, ho = function(t) {
|
|
1232
1260
|
return t === void 0 && (t = {}), {
|
|
1233
1261
|
name: "size",
|
|
1234
1262
|
options: t,
|
|
@@ -1243,21 +1271,21 @@ const no = function(t) {
|
|
|
1243
1271
|
apply: a = () => {
|
|
1244
1272
|
},
|
|
1245
1273
|
...c
|
|
1246
|
-
} =
|
|
1274
|
+
} = pt(t, e), l = await ee(e, c), g = rt(r), h = ft(r), u = tt(r) === "y", {
|
|
1247
1275
|
width: p,
|
|
1248
1276
|
height: m
|
|
1249
1277
|
} = s.floating;
|
|
1250
1278
|
let f, b;
|
|
1251
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");
|
|
1252
|
-
const v = m - l.top - l.bottom, _ = p - l.left - l.right,
|
|
1253
|
-
let x =
|
|
1254
|
-
if ((o = e.middlewareData.shift) != null && o.enabled.x && (
|
|
1255
|
-
const
|
|
1256
|
-
u ?
|
|
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;
|
|
1281
|
+
let x = S, C = y;
|
|
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));
|
|
1257
1285
|
}
|
|
1258
1286
|
await a({
|
|
1259
1287
|
...e,
|
|
1260
|
-
availableWidth:
|
|
1288
|
+
availableWidth: C,
|
|
1261
1289
|
availableHeight: x
|
|
1262
1290
|
});
|
|
1263
1291
|
const T = await n.getDimensions(d.floating);
|
|
@@ -1269,49 +1297,49 @@ const no = function(t) {
|
|
|
1269
1297
|
}
|
|
1270
1298
|
};
|
|
1271
1299
|
};
|
|
1272
|
-
function
|
|
1300
|
+
function Ot() {
|
|
1273
1301
|
return typeof window < "u";
|
|
1274
1302
|
}
|
|
1275
|
-
function
|
|
1276
|
-
return
|
|
1303
|
+
function wt(t) {
|
|
1304
|
+
return Te(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
1277
1305
|
}
|
|
1278
|
-
function
|
|
1306
|
+
function U(t) {
|
|
1279
1307
|
var e;
|
|
1280
1308
|
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
1281
1309
|
}
|
|
1282
|
-
function
|
|
1310
|
+
function Z(t) {
|
|
1283
1311
|
var e;
|
|
1284
|
-
return (e = (
|
|
1312
|
+
return (e = (Te(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
1285
1313
|
}
|
|
1286
|
-
function
|
|
1287
|
-
return
|
|
1314
|
+
function Te(t) {
|
|
1315
|
+
return Ot() ? t instanceof Node || t instanceof U(t).Node : !1;
|
|
1288
1316
|
}
|
|
1289
|
-
function
|
|
1290
|
-
return
|
|
1317
|
+
function X(t) {
|
|
1318
|
+
return Ot() ? t instanceof Element || t instanceof U(t).Element : !1;
|
|
1291
1319
|
}
|
|
1292
|
-
function
|
|
1293
|
-
return
|
|
1320
|
+
function J(t) {
|
|
1321
|
+
return Ot() ? t instanceof HTMLElement || t instanceof U(t).HTMLElement : !1;
|
|
1294
1322
|
}
|
|
1295
|
-
function
|
|
1296
|
-
return !
|
|
1323
|
+
function ge(t) {
|
|
1324
|
+
return !Ot() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof U(t).ShadowRoot;
|
|
1297
1325
|
}
|
|
1298
|
-
const
|
|
1299
|
-
function
|
|
1326
|
+
const po = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
1327
|
+
function St(t) {
|
|
1300
1328
|
const {
|
|
1301
1329
|
overflow: e,
|
|
1302
1330
|
overflowX: o,
|
|
1303
1331
|
overflowY: i,
|
|
1304
1332
|
display: r
|
|
1305
|
-
} =
|
|
1306
|
-
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);
|
|
1307
1335
|
}
|
|
1308
|
-
const
|
|
1309
|
-
function
|
|
1310
|
-
return
|
|
1336
|
+
const fo = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
1337
|
+
function wo(t) {
|
|
1338
|
+
return fo.has(wt(t));
|
|
1311
1339
|
}
|
|
1312
|
-
const
|
|
1313
|
-
function
|
|
1314
|
-
return
|
|
1340
|
+
const mo = [":popover-open", ":modal"];
|
|
1341
|
+
function Rt(t) {
|
|
1342
|
+
return mo.some((e) => {
|
|
1315
1343
|
try {
|
|
1316
1344
|
return t.matches(e);
|
|
1317
1345
|
} catch {
|
|
@@ -1319,34 +1347,34 @@ function At(t) {
|
|
|
1319
1347
|
}
|
|
1320
1348
|
});
|
|
1321
1349
|
}
|
|
1322
|
-
const
|
|
1323
|
-
function
|
|
1324
|
-
const e =
|
|
1325
|
-
return
|
|
1350
|
+
const bo = ["transform", "translate", "scale", "rotate", "perspective"], vo = ["transform", "translate", "scale", "rotate", "perspective", "filter"], _o = ["paint", "layout", "strict", "content"];
|
|
1351
|
+
function oe(t) {
|
|
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));
|
|
1326
1354
|
}
|
|
1327
|
-
function
|
|
1328
|
-
let e =
|
|
1329
|
-
for (;
|
|
1330
|
-
if (
|
|
1355
|
+
function yo(t) {
|
|
1356
|
+
let e = nt(t);
|
|
1357
|
+
for (; J(e) && !ht(e); ) {
|
|
1358
|
+
if (oe(e))
|
|
1331
1359
|
return e;
|
|
1332
|
-
if (
|
|
1360
|
+
if (Rt(e))
|
|
1333
1361
|
return null;
|
|
1334
|
-
e =
|
|
1362
|
+
e = nt(e);
|
|
1335
1363
|
}
|
|
1336
1364
|
return null;
|
|
1337
1365
|
}
|
|
1338
|
-
function
|
|
1366
|
+
function ie() {
|
|
1339
1367
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
1340
1368
|
}
|
|
1341
|
-
const
|
|
1342
|
-
function
|
|
1343
|
-
return
|
|
1369
|
+
const Co = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
1370
|
+
function ht(t) {
|
|
1371
|
+
return Co.has(wt(t));
|
|
1344
1372
|
}
|
|
1345
|
-
function
|
|
1346
|
-
return
|
|
1373
|
+
function Q(t) {
|
|
1374
|
+
return U(t).getComputedStyle(t);
|
|
1347
1375
|
}
|
|
1348
|
-
function
|
|
1349
|
-
return
|
|
1376
|
+
function Pt(t) {
|
|
1377
|
+
return X(t) ? {
|
|
1350
1378
|
scrollLeft: t.scrollLeft,
|
|
1351
1379
|
scrollTop: t.scrollTop
|
|
1352
1380
|
} : {
|
|
@@ -1354,127 +1382,127 @@ function Ot(t) {
|
|
|
1354
1382
|
scrollTop: t.scrollY
|
|
1355
1383
|
};
|
|
1356
1384
|
}
|
|
1357
|
-
function
|
|
1358
|
-
if (
|
|
1385
|
+
function nt(t) {
|
|
1386
|
+
if (wt(t) === "html")
|
|
1359
1387
|
return t;
|
|
1360
1388
|
const e = (
|
|
1361
1389
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
1362
1390
|
t.assignedSlot || // DOM Element detected.
|
|
1363
1391
|
t.parentNode || // ShadowRoot detected.
|
|
1364
|
-
|
|
1365
|
-
|
|
1392
|
+
ge(t) && t.host || // Fallback.
|
|
1393
|
+
Z(t)
|
|
1366
1394
|
);
|
|
1367
|
-
return
|
|
1395
|
+
return ge(e) ? e.host : e;
|
|
1368
1396
|
}
|
|
1369
|
-
function
|
|
1370
|
-
const e =
|
|
1371
|
-
return
|
|
1397
|
+
function Ee(t) {
|
|
1398
|
+
const e = nt(t);
|
|
1399
|
+
return ht(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : J(e) && St(e) ? e : Ee(e);
|
|
1372
1400
|
}
|
|
1373
|
-
function
|
|
1401
|
+
function _t(t, e, o) {
|
|
1374
1402
|
var i;
|
|
1375
1403
|
e === void 0 && (e = []), o === void 0 && (o = !0);
|
|
1376
|
-
const r =
|
|
1404
|
+
const r = Ee(t), s = r === ((i = t.ownerDocument) == null ? void 0 : i.body), n = U(r);
|
|
1377
1405
|
if (s) {
|
|
1378
|
-
const d =
|
|
1379
|
-
return e.concat(n, n.visualViewport || [],
|
|
1406
|
+
const d = Bt(n);
|
|
1407
|
+
return e.concat(n, n.visualViewport || [], St(r) ? r : [], d && o ? _t(d) : []);
|
|
1380
1408
|
}
|
|
1381
|
-
return e.concat(r,
|
|
1409
|
+
return e.concat(r, _t(r, [], o));
|
|
1382
1410
|
}
|
|
1383
|
-
function
|
|
1411
|
+
function Bt(t) {
|
|
1384
1412
|
return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
|
|
1385
1413
|
}
|
|
1386
|
-
function
|
|
1387
|
-
const e =
|
|
1414
|
+
function $e(t) {
|
|
1415
|
+
const e = Q(t);
|
|
1388
1416
|
let o = parseFloat(e.width) || 0, i = parseFloat(e.height) || 0;
|
|
1389
|
-
const r =
|
|
1417
|
+
const r = J(t), s = r ? t.offsetWidth : o, n = r ? t.offsetHeight : i, d = Tt(o) !== s || Tt(i) !== n;
|
|
1390
1418
|
return d && (o = s, i = n), {
|
|
1391
1419
|
width: o,
|
|
1392
1420
|
height: i,
|
|
1393
1421
|
$: d
|
|
1394
1422
|
};
|
|
1395
1423
|
}
|
|
1396
|
-
function
|
|
1397
|
-
return
|
|
1424
|
+
function re(t) {
|
|
1425
|
+
return X(t) ? t : t.contextElement;
|
|
1398
1426
|
}
|
|
1399
|
-
function
|
|
1400
|
-
const e =
|
|
1401
|
-
if (!
|
|
1402
|
-
return
|
|
1427
|
+
function ut(t) {
|
|
1428
|
+
const e = re(t);
|
|
1429
|
+
if (!J(e))
|
|
1430
|
+
return G(1);
|
|
1403
1431
|
const o = e.getBoundingClientRect(), {
|
|
1404
1432
|
width: i,
|
|
1405
1433
|
height: r,
|
|
1406
1434
|
$: s
|
|
1407
|
-
} =
|
|
1408
|
-
let n = (s ?
|
|
1435
|
+
} = $e(e);
|
|
1436
|
+
let n = (s ? Tt(o.width) : o.width) / i, d = (s ? Tt(o.height) : o.height) / r;
|
|
1409
1437
|
return (!n || !Number.isFinite(n)) && (n = 1), (!d || !Number.isFinite(d)) && (d = 1), {
|
|
1410
1438
|
x: n,
|
|
1411
1439
|
y: d
|
|
1412
1440
|
};
|
|
1413
1441
|
}
|
|
1414
|
-
const
|
|
1415
|
-
function
|
|
1416
|
-
const e =
|
|
1417
|
-
return !
|
|
1442
|
+
const So = /* @__PURE__ */ G(0);
|
|
1443
|
+
function Me(t) {
|
|
1444
|
+
const e = U(t);
|
|
1445
|
+
return !ie() || !e.visualViewport ? So : {
|
|
1418
1446
|
x: e.visualViewport.offsetLeft,
|
|
1419
1447
|
y: e.visualViewport.offsetTop
|
|
1420
1448
|
};
|
|
1421
1449
|
}
|
|
1422
|
-
function
|
|
1423
|
-
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;
|
|
1424
1452
|
}
|
|
1425
|
-
function
|
|
1453
|
+
function lt(t, e, o, i) {
|
|
1426
1454
|
e === void 0 && (e = !1), o === void 0 && (o = !1);
|
|
1427
|
-
const r = t.getBoundingClientRect(), s =
|
|
1428
|
-
let n =
|
|
1429
|
-
e && (i ?
|
|
1430
|
-
const d =
|
|
1455
|
+
const r = t.getBoundingClientRect(), s = re(t);
|
|
1456
|
+
let n = G(1);
|
|
1457
|
+
e && (i ? X(i) && (n = ut(i)) : n = ut(t));
|
|
1458
|
+
const d = xo(s, o, i) ? Me(s) : G(0);
|
|
1431
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;
|
|
1432
1460
|
if (s) {
|
|
1433
|
-
const h =
|
|
1434
|
-
let p = h, m =
|
|
1461
|
+
const h = U(s), u = i && X(i) ? U(i) : i;
|
|
1462
|
+
let p = h, m = Bt(p);
|
|
1435
1463
|
for (; m && i && u !== p; ) {
|
|
1436
|
-
const f =
|
|
1437
|
-
a *= f.x, c *= f.y, l *= f.x, g *= f.y, a += _, c +=
|
|
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);
|
|
1438
1466
|
}
|
|
1439
1467
|
}
|
|
1440
|
-
return
|
|
1468
|
+
return $t({
|
|
1441
1469
|
width: l,
|
|
1442
1470
|
height: g,
|
|
1443
1471
|
x: a,
|
|
1444
1472
|
y: c
|
|
1445
1473
|
});
|
|
1446
1474
|
}
|
|
1447
|
-
function
|
|
1448
|
-
const o =
|
|
1449
|
-
return e ? e.left + o :
|
|
1475
|
+
function It(t, e) {
|
|
1476
|
+
const o = Pt(t).scrollLeft;
|
|
1477
|
+
return e ? e.left + o : lt(Z(t)).left + o;
|
|
1450
1478
|
}
|
|
1451
|
-
function
|
|
1452
|
-
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;
|
|
1453
1481
|
return {
|
|
1454
1482
|
x: i,
|
|
1455
1483
|
y: r
|
|
1456
1484
|
};
|
|
1457
1485
|
}
|
|
1458
|
-
function
|
|
1486
|
+
function ko(t) {
|
|
1459
1487
|
let {
|
|
1460
1488
|
elements: e,
|
|
1461
1489
|
rect: o,
|
|
1462
1490
|
offsetParent: i,
|
|
1463
1491
|
strategy: r
|
|
1464
1492
|
} = t;
|
|
1465
|
-
const s = r === "fixed", n =
|
|
1493
|
+
const s = r === "fixed", n = Z(i), d = e ? Rt(e.floating) : !1;
|
|
1466
1494
|
if (i === n || d && s)
|
|
1467
1495
|
return o;
|
|
1468
1496
|
let a = {
|
|
1469
1497
|
scrollLeft: 0,
|
|
1470
1498
|
scrollTop: 0
|
|
1471
|
-
}, c =
|
|
1472
|
-
const l =
|
|
1473
|
-
if ((g || !g && !s) && ((
|
|
1474
|
-
const u =
|
|
1475
|
-
c =
|
|
1499
|
+
}, c = G(1);
|
|
1500
|
+
const l = G(0), g = J(i);
|
|
1501
|
+
if ((g || !g && !s) && ((wt(i) !== "body" || St(n)) && (a = Pt(i)), J(i))) {
|
|
1502
|
+
const u = lt(i);
|
|
1503
|
+
c = ut(i), l.x = u.x + i.clientLeft, l.y = u.y + i.clientTop;
|
|
1476
1504
|
}
|
|
1477
|
-
const h = n && !g && !s ?
|
|
1505
|
+
const h = n && !g && !s ? Ae(n, a) : G(0);
|
|
1478
1506
|
return {
|
|
1479
1507
|
width: o.width * c.x,
|
|
1480
1508
|
height: o.height * c.y,
|
|
@@ -1482,34 +1510,34 @@ function _o(t) {
|
|
|
1482
1510
|
y: o.y * c.y - a.scrollTop * c.y + l.y + h.y
|
|
1483
1511
|
};
|
|
1484
1512
|
}
|
|
1485
|
-
function
|
|
1513
|
+
function Do(t) {
|
|
1486
1514
|
return Array.from(t.getClientRects());
|
|
1487
1515
|
}
|
|
1488
|
-
function
|
|
1489
|
-
const e =
|
|
1490
|
-
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);
|
|
1491
1519
|
const d = -o.scrollTop;
|
|
1492
|
-
return
|
|
1520
|
+
return Q(i).direction === "rtl" && (n += N(e.clientWidth, i.clientWidth) - r), {
|
|
1493
1521
|
width: r,
|
|
1494
1522
|
height: s,
|
|
1495
1523
|
x: n,
|
|
1496
1524
|
y: d
|
|
1497
1525
|
};
|
|
1498
1526
|
}
|
|
1499
|
-
const
|
|
1500
|
-
function
|
|
1501
|
-
const o =
|
|
1527
|
+
const ue = 25;
|
|
1528
|
+
function Eo(t, e) {
|
|
1529
|
+
const o = U(t), i = Z(t), r = o.visualViewport;
|
|
1502
1530
|
let s = i.clientWidth, n = i.clientHeight, d = 0, a = 0;
|
|
1503
1531
|
if (r) {
|
|
1504
1532
|
s = r.width, n = r.height;
|
|
1505
|
-
const l =
|
|
1533
|
+
const l = ie();
|
|
1506
1534
|
(!l || l && e === "fixed") && (d = r.offsetLeft, a = r.offsetTop);
|
|
1507
1535
|
}
|
|
1508
|
-
const c =
|
|
1536
|
+
const c = It(i);
|
|
1509
1537
|
if (c <= 0) {
|
|
1510
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);
|
|
1511
|
-
p <=
|
|
1512
|
-
} else c <=
|
|
1539
|
+
p <= ue && (s -= p);
|
|
1540
|
+
} else c <= ue && (s += c);
|
|
1513
1541
|
return {
|
|
1514
1542
|
width: s,
|
|
1515
1543
|
height: n,
|
|
@@ -1517,9 +1545,9 @@ function So(t, e) {
|
|
|
1517
1545
|
y: a
|
|
1518
1546
|
};
|
|
1519
1547
|
}
|
|
1520
|
-
const
|
|
1521
|
-
function
|
|
1522
|
-
const o =
|
|
1548
|
+
const $o = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
1549
|
+
function Mo(t, e) {
|
|
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;
|
|
1523
1551
|
return {
|
|
1524
1552
|
width: n,
|
|
1525
1553
|
height: d,
|
|
@@ -1527,16 +1555,16 @@ function ko(t, e) {
|
|
|
1527
1555
|
y: c
|
|
1528
1556
|
};
|
|
1529
1557
|
}
|
|
1530
|
-
function
|
|
1558
|
+
function he(t, e, o) {
|
|
1531
1559
|
let i;
|
|
1532
1560
|
if (e === "viewport")
|
|
1533
|
-
i =
|
|
1561
|
+
i = Eo(t, o);
|
|
1534
1562
|
else if (e === "document")
|
|
1535
|
-
i =
|
|
1536
|
-
else if (
|
|
1537
|
-
i =
|
|
1563
|
+
i = To(Z(t));
|
|
1564
|
+
else if (X(e))
|
|
1565
|
+
i = Mo(e, o);
|
|
1538
1566
|
else {
|
|
1539
|
-
const r =
|
|
1567
|
+
const r = Me(t);
|
|
1540
1568
|
i = {
|
|
1541
1569
|
x: e.x - r.x,
|
|
1542
1570
|
y: e.y - r.y,
|
|
@@ -1544,36 +1572,36 @@ function ce(t, e, o) {
|
|
|
1544
1572
|
height: e.height
|
|
1545
1573
|
};
|
|
1546
1574
|
}
|
|
1547
|
-
return
|
|
1575
|
+
return $t(i);
|
|
1548
1576
|
}
|
|
1549
|
-
function
|
|
1550
|
-
const o =
|
|
1551
|
-
return o === e || !
|
|
1577
|
+
function Oe(t, e) {
|
|
1578
|
+
const o = nt(t);
|
|
1579
|
+
return o === e || !X(o) || ht(o) ? !1 : Q(o).position === "fixed" || Oe(o, e);
|
|
1552
1580
|
}
|
|
1553
|
-
function
|
|
1581
|
+
function Ao(t, e) {
|
|
1554
1582
|
const o = e.get(t);
|
|
1555
1583
|
if (o)
|
|
1556
1584
|
return o;
|
|
1557
|
-
let i =
|
|
1558
|
-
const s =
|
|
1559
|
-
let n = s ?
|
|
1560
|
-
for (;
|
|
1561
|
-
const d =
|
|
1562
|
-
!a && d.position === "fixed" && (r = null), (s ? !a && !r : !a && d.position === "static" && !!r &&
|
|
1585
|
+
let i = _t(t, [], !1).filter((d) => X(d) && wt(d) !== "body"), r = null;
|
|
1586
|
+
const s = Q(t).position === "fixed";
|
|
1587
|
+
let n = s ? nt(t) : t;
|
|
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);
|
|
1563
1591
|
}
|
|
1564
1592
|
return e.set(t, i), i;
|
|
1565
1593
|
}
|
|
1566
|
-
function
|
|
1594
|
+
function Oo(t) {
|
|
1567
1595
|
let {
|
|
1568
1596
|
element: e,
|
|
1569
1597
|
boundary: o,
|
|
1570
1598
|
rootBoundary: i,
|
|
1571
1599
|
strategy: r
|
|
1572
1600
|
} = t;
|
|
1573
|
-
const n = [...o === "clippingAncestors" ?
|
|
1574
|
-
const g =
|
|
1575
|
-
return c.top =
|
|
1576
|
-
},
|
|
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));
|
|
1577
1605
|
return {
|
|
1578
1606
|
width: a.right - a.left,
|
|
1579
1607
|
height: a.bottom - a.top,
|
|
@@ -1581,33 +1609,33 @@ function To(t) {
|
|
|
1581
1609
|
y: a.top
|
|
1582
1610
|
};
|
|
1583
1611
|
}
|
|
1584
|
-
function
|
|
1612
|
+
function Ro(t) {
|
|
1585
1613
|
const {
|
|
1586
1614
|
width: e,
|
|
1587
1615
|
height: o
|
|
1588
|
-
} =
|
|
1616
|
+
} = $e(t);
|
|
1589
1617
|
return {
|
|
1590
1618
|
width: e,
|
|
1591
1619
|
height: o
|
|
1592
1620
|
};
|
|
1593
1621
|
}
|
|
1594
|
-
function
|
|
1595
|
-
const i =
|
|
1622
|
+
function Po(t, e, o) {
|
|
1623
|
+
const i = J(e), r = Z(e), s = o === "fixed", n = lt(t, !0, s, e);
|
|
1596
1624
|
let d = {
|
|
1597
1625
|
scrollLeft: 0,
|
|
1598
1626
|
scrollTop: 0
|
|
1599
1627
|
};
|
|
1600
|
-
const a =
|
|
1628
|
+
const a = G(0);
|
|
1601
1629
|
function c() {
|
|
1602
|
-
a.x =
|
|
1630
|
+
a.x = It(r);
|
|
1603
1631
|
}
|
|
1604
1632
|
if (i || !i && !s)
|
|
1605
|
-
if ((
|
|
1606
|
-
const u =
|
|
1633
|
+
if ((wt(e) !== "body" || St(r)) && (d = Pt(e)), i) {
|
|
1634
|
+
const u = lt(e, !0, s, e);
|
|
1607
1635
|
a.x = u.x + e.clientLeft, a.y = u.y + e.clientTop;
|
|
1608
1636
|
} else r && c();
|
|
1609
1637
|
s && !i && r && c();
|
|
1610
|
-
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;
|
|
1611
1639
|
return {
|
|
1612
1640
|
x: g,
|
|
1613
1641
|
y: h,
|
|
@@ -1616,38 +1644,38 @@ function $o(t, e, o) {
|
|
|
1616
1644
|
};
|
|
1617
1645
|
}
|
|
1618
1646
|
function Ht(t) {
|
|
1619
|
-
return
|
|
1647
|
+
return Q(t).position === "static";
|
|
1620
1648
|
}
|
|
1621
|
-
function
|
|
1622
|
-
if (!
|
|
1649
|
+
function pe(t, e) {
|
|
1650
|
+
if (!J(t) || Q(t).position === "fixed")
|
|
1623
1651
|
return null;
|
|
1624
1652
|
if (e)
|
|
1625
1653
|
return e(t);
|
|
1626
1654
|
let o = t.offsetParent;
|
|
1627
|
-
return
|
|
1655
|
+
return Z(t) === o && (o = o.ownerDocument.body), o;
|
|
1628
1656
|
}
|
|
1629
|
-
function
|
|
1630
|
-
const o =
|
|
1631
|
-
if (
|
|
1657
|
+
function Re(t, e) {
|
|
1658
|
+
const o = U(t);
|
|
1659
|
+
if (Rt(t))
|
|
1632
1660
|
return o;
|
|
1633
|
-
if (!
|
|
1634
|
-
let r =
|
|
1635
|
-
for (; r && !
|
|
1636
|
-
if (
|
|
1661
|
+
if (!J(t)) {
|
|
1662
|
+
let r = nt(t);
|
|
1663
|
+
for (; r && !ht(r); ) {
|
|
1664
|
+
if (X(r) && !Ht(r))
|
|
1637
1665
|
return r;
|
|
1638
|
-
r =
|
|
1666
|
+
r = nt(r);
|
|
1639
1667
|
}
|
|
1640
1668
|
return o;
|
|
1641
1669
|
}
|
|
1642
|
-
let i =
|
|
1643
|
-
for (; i &&
|
|
1644
|
-
i =
|
|
1645
|
-
return 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;
|
|
1646
1674
|
}
|
|
1647
|
-
const
|
|
1648
|
-
const e = this.getOffsetParent ||
|
|
1675
|
+
const Io = async function(t) {
|
|
1676
|
+
const e = this.getOffsetParent || Re, o = this.getDimensions, i = await o(t.floating);
|
|
1649
1677
|
return {
|
|
1650
|
-
reference:
|
|
1678
|
+
reference: Po(t.reference, await e(t.floating), t.strategy),
|
|
1651
1679
|
floating: {
|
|
1652
1680
|
x: 0,
|
|
1653
1681
|
y: 0,
|
|
@@ -1656,27 +1684,27 @@ const Mo = async function(t) {
|
|
|
1656
1684
|
}
|
|
1657
1685
|
};
|
|
1658
1686
|
};
|
|
1659
|
-
function
|
|
1660
|
-
return
|
|
1661
|
-
}
|
|
1662
|
-
const
|
|
1663
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
1664
|
-
getDocumentElement:
|
|
1665
|
-
getClippingRect:
|
|
1666
|
-
getOffsetParent:
|
|
1667
|
-
getElementRects:
|
|
1668
|
-
getClientRects:
|
|
1669
|
-
getDimensions:
|
|
1670
|
-
getScale:
|
|
1671
|
-
isElement:
|
|
1672
|
-
isRTL:
|
|
1687
|
+
function Lo(t) {
|
|
1688
|
+
return Q(t).direction === "rtl";
|
|
1689
|
+
}
|
|
1690
|
+
const Ho = {
|
|
1691
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: ko,
|
|
1692
|
+
getDocumentElement: Z,
|
|
1693
|
+
getClippingRect: Oo,
|
|
1694
|
+
getOffsetParent: Re,
|
|
1695
|
+
getElementRects: Io,
|
|
1696
|
+
getClientRects: Do,
|
|
1697
|
+
getDimensions: Ro,
|
|
1698
|
+
getScale: ut,
|
|
1699
|
+
isElement: X,
|
|
1700
|
+
isRTL: Lo
|
|
1673
1701
|
};
|
|
1674
|
-
function
|
|
1702
|
+
function Pe(t, e) {
|
|
1675
1703
|
return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
|
|
1676
1704
|
}
|
|
1677
|
-
function
|
|
1705
|
+
function zo(t, e) {
|
|
1678
1706
|
let o = null, i;
|
|
1679
|
-
const r =
|
|
1707
|
+
const r = Z(t);
|
|
1680
1708
|
function s() {
|
|
1681
1709
|
var d;
|
|
1682
1710
|
clearTimeout(i), (d = o) == null || d.disconnect(), o = null;
|
|
@@ -1691,21 +1719,21 @@ function Ro(t, e) {
|
|
|
1691
1719
|
} = c;
|
|
1692
1720
|
if (d || e(), !h || !u)
|
|
1693
1721
|
return;
|
|
1694
|
-
const p =
|
|
1722
|
+
const p = Dt(g), m = Dt(r.clientWidth - (l + h)), f = Dt(r.clientHeight - (g + u)), b = Dt(l), _ = {
|
|
1695
1723
|
rootMargin: -p + "px " + -m + "px " + -f + "px " + -b + "px",
|
|
1696
|
-
threshold:
|
|
1724
|
+
threshold: N(0, it(1, a)) || 1
|
|
1697
1725
|
};
|
|
1698
|
-
let
|
|
1699
|
-
function y(
|
|
1700
|
-
const x =
|
|
1726
|
+
let S = !0;
|
|
1727
|
+
function y(D) {
|
|
1728
|
+
const x = D[0].intersectionRatio;
|
|
1701
1729
|
if (x !== a) {
|
|
1702
|
-
if (!
|
|
1730
|
+
if (!S)
|
|
1703
1731
|
return n();
|
|
1704
1732
|
x ? n(!1, x) : i = setTimeout(() => {
|
|
1705
1733
|
n(!1, 1e-7);
|
|
1706
1734
|
}, 1e3);
|
|
1707
1735
|
}
|
|
1708
|
-
x === 1 &&
|
|
1736
|
+
x === 1 && !Pe(c, t.getBoundingClientRect()) && n(), S = !1;
|
|
1709
1737
|
}
|
|
1710
1738
|
try {
|
|
1711
1739
|
o = new IntersectionObserver(y, {
|
|
@@ -1720,7 +1748,7 @@ function Ro(t, e) {
|
|
|
1720
1748
|
}
|
|
1721
1749
|
return n(!0), s;
|
|
1722
1750
|
}
|
|
1723
|
-
function
|
|
1751
|
+
function Fo(t, e, o, i) {
|
|
1724
1752
|
i === void 0 && (i = {});
|
|
1725
1753
|
const {
|
|
1726
1754
|
ancestorScroll: r = !0,
|
|
@@ -1728,13 +1756,13 @@ function Io(t, e, o, i) {
|
|
|
1728
1756
|
elementResize: n = typeof ResizeObserver == "function",
|
|
1729
1757
|
layoutShift: d = typeof IntersectionObserver == "function",
|
|
1730
1758
|
animationFrame: a = !1
|
|
1731
|
-
} = i, c =
|
|
1759
|
+
} = i, c = re(t), l = r || s ? [...c ? _t(c) : [], ..._t(e)] : [];
|
|
1732
1760
|
l.forEach((b) => {
|
|
1733
1761
|
r && b.addEventListener("scroll", o, {
|
|
1734
1762
|
passive: !0
|
|
1735
1763
|
}), s && b.addEventListener("resize", o);
|
|
1736
1764
|
});
|
|
1737
|
-
const g = c && d ?
|
|
1765
|
+
const g = c && d ? zo(c, o) : null;
|
|
1738
1766
|
let h = -1, u = null;
|
|
1739
1767
|
n && (u = new ResizeObserver((b) => {
|
|
1740
1768
|
let [v] = b;
|
|
@@ -1743,11 +1771,11 @@ function Io(t, e, o, i) {
|
|
|
1743
1771
|
(_ = u) == null || _.observe(e);
|
|
1744
1772
|
})), o();
|
|
1745
1773
|
}), c && !a && u.observe(c), u.observe(e));
|
|
1746
|
-
let p, m = a ?
|
|
1774
|
+
let p, m = a ? lt(t) : null;
|
|
1747
1775
|
a && f();
|
|
1748
1776
|
function f() {
|
|
1749
|
-
const b =
|
|
1750
|
-
m &&
|
|
1777
|
+
const b = lt(t);
|
|
1778
|
+
m && !Pe(m, b) && o(), m = b, p = requestAnimationFrame(f);
|
|
1751
1779
|
}
|
|
1752
1780
|
return o(), () => {
|
|
1753
1781
|
var b;
|
|
@@ -1756,22 +1784,22 @@ function Io(t, e, o, i) {
|
|
|
1756
1784
|
}), g == null || g(), (b = u) == null || b.disconnect(), u = null, a && cancelAnimationFrame(p);
|
|
1757
1785
|
};
|
|
1758
1786
|
}
|
|
1759
|
-
const
|
|
1787
|
+
const Lt = go, ne = uo, xt = ao, Vo = ho, qo = so, kt = (t, e, o) => {
|
|
1760
1788
|
const i = /* @__PURE__ */ new Map(), r = {
|
|
1761
|
-
platform:
|
|
1789
|
+
platform: Ho,
|
|
1762
1790
|
...o
|
|
1763
1791
|
}, s = {
|
|
1764
1792
|
...r.platform,
|
|
1765
1793
|
_c: i
|
|
1766
1794
|
};
|
|
1767
|
-
return
|
|
1795
|
+
return no(t, e, {
|
|
1768
1796
|
...r,
|
|
1769
1797
|
platform: s
|
|
1770
1798
|
});
|
|
1771
1799
|
};
|
|
1772
|
-
function
|
|
1800
|
+
function dt(t, e, o, i) {
|
|
1773
1801
|
var s;
|
|
1774
|
-
|
|
1802
|
+
L(t);
|
|
1775
1803
|
const r = document.createElement("div");
|
|
1776
1804
|
if (r.className = "wg__dropdown", r.style.cssText = `
|
|
1777
1805
|
position: fixed;
|
|
@@ -1785,12 +1813,12 @@ function lt(t, e, o, i) {
|
|
|
1785
1813
|
else {
|
|
1786
1814
|
const n = t.grid.editingCell, d = n ? (s = t.grid.displayItems[n.rowIndex]) == null ? void 0 : s[n.field] : void 0;
|
|
1787
1815
|
r.innerHTML = o.map((a, c) => {
|
|
1788
|
-
const l = c === t.highlightedIndex, g =
|
|
1816
|
+
const l = c === t.highlightedIndex, g = at(a, i) === d, h = mt(a, i);
|
|
1789
1817
|
if (i.renderOptionCallback) {
|
|
1790
1818
|
const _ = { index: c, isHighlighted: l, isSelected: g, isDisabled: h };
|
|
1791
1819
|
return i.renderOptionCallback(a, _);
|
|
1792
1820
|
}
|
|
1793
|
-
const u =
|
|
1821
|
+
const u = Ct(a, i), p = Ke(a, i), m = We(a, i), f = ["wg__dropdown-option"];
|
|
1794
1822
|
l && f.push("wg__dropdown-option--highlighted"), g && f.push("wg__dropdown-option--selected"), h && f.push("wg__dropdown-option--disabled");
|
|
1795
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>` : "";
|
|
1796
1824
|
return `<div class="${f.join(" ")}" data-index="${c}" ${h ? 'data-disabled="true"' : ""}>
|
|
@@ -1802,14 +1830,14 @@ function lt(t, e, o, i) {
|
|
|
1802
1830
|
</div>`;
|
|
1803
1831
|
}).join("");
|
|
1804
1832
|
}
|
|
1805
|
-
return t.shadow.appendChild(r), t.dropdownOpen = !0,
|
|
1833
|
+
return t.shadow.appendChild(r), t.dropdownOpen = !0, kt(e, r, {
|
|
1806
1834
|
strategy: "fixed",
|
|
1807
1835
|
placement: "bottom-start",
|
|
1808
1836
|
middleware: [
|
|
1809
1837
|
// Add 1px gap to prevent sub-pixel overlap with cell border
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1838
|
+
Lt(1),
|
|
1839
|
+
xt({ fallbackPlacements: ["top-start"] }),
|
|
1840
|
+
Vo({
|
|
1813
1841
|
apply({ rects: n }) {
|
|
1814
1842
|
Object.assign(r.style, {
|
|
1815
1843
|
width: `${n.reference.width}px`
|
|
@@ -1824,19 +1852,19 @@ function lt(t, e, o, i) {
|
|
|
1824
1852
|
});
|
|
1825
1853
|
}), r;
|
|
1826
1854
|
}
|
|
1827
|
-
function
|
|
1855
|
+
function L(t) {
|
|
1828
1856
|
const e = t.shadow.querySelector(".wg__dropdown");
|
|
1829
1857
|
e == null || e.remove(), t.dropdownOpen = !1, t.highlightedIndex = -1, t.filterText = "";
|
|
1830
1858
|
}
|
|
1831
|
-
function
|
|
1859
|
+
function Ie(t, e, o = !0) {
|
|
1832
1860
|
const i = t.dropdownOptions[e];
|
|
1833
1861
|
if (!i) return;
|
|
1834
1862
|
const r = t.grid.editingCell;
|
|
1835
1863
|
if (!r) return;
|
|
1836
1864
|
const s = t.getCurrentEditorOptions();
|
|
1837
1865
|
if (mt(i, s)) return;
|
|
1838
|
-
const n =
|
|
1839
|
-
if (s.onselect && a && s.onselect(i, a), t.justSelected = !0, t.isCommittingFromKeyboard = !0,
|
|
1866
|
+
const n = at(i, s), d = t.grid.columns.findIndex((c) => String(c.field) === r.field), a = t.grid.displayItems[r.rowIndex];
|
|
1867
|
+
if (s.onselect && a && s.onselect(i, a), t.justSelected = !0, t.isCommittingFromKeyboard = !0, L(t), t.grid.commitEdit(r.rowIndex, r.field, n), o)
|
|
1840
1868
|
t.moveFocusAfterCommit(r.rowIndex, r.field, "down");
|
|
1841
1869
|
else {
|
|
1842
1870
|
const c = t.shadow.querySelector(
|
|
@@ -1855,17 +1883,17 @@ function et(t) {
|
|
|
1855
1883
|
i.classList.toggle("wg__dropdown-option--highlighted", r === t.highlightedIndex);
|
|
1856
1884
|
});
|
|
1857
1885
|
}
|
|
1858
|
-
function
|
|
1886
|
+
function fe(t) {
|
|
1859
1887
|
const e = t.shadow.querySelector(".wg__dropdown-option--highlighted");
|
|
1860
1888
|
e == null || e.scrollIntoView({ block: "nearest" });
|
|
1861
1889
|
}
|
|
1862
|
-
function
|
|
1890
|
+
function we(t, e) {
|
|
1863
1891
|
const o = t.shadow.querySelector(".wg__loading-indicator");
|
|
1864
1892
|
o && (o.style.display = e ? "inline" : "none");
|
|
1865
1893
|
const i = t.shadow.querySelector(".wg__editor--autocomplete .wg__combobox-toggle");
|
|
1866
1894
|
i && (i.style.display = e ? "none" : "inline");
|
|
1867
1895
|
}
|
|
1868
|
-
function
|
|
1896
|
+
function W(t) {
|
|
1869
1897
|
if (t.justSelected) return;
|
|
1870
1898
|
const e = t.getCurrentEditingColumn();
|
|
1871
1899
|
if (!e) return;
|
|
@@ -1875,13 +1903,13 @@ function X(t) {
|
|
|
1875
1903
|
const n = o.options || [];
|
|
1876
1904
|
if (t.filterText) {
|
|
1877
1905
|
const d = t.filterText.toLowerCase();
|
|
1878
|
-
t.dropdownOptions = n.filter((a) =>
|
|
1906
|
+
t.dropdownOptions = n.filter((a) => Ct(a, o).toLowerCase().includes(d)), r = t.dropdownOptions.length > 0 ? 0 : -1;
|
|
1879
1907
|
} else {
|
|
1880
1908
|
t.dropdownOptions = n;
|
|
1881
1909
|
const d = t.grid.editingCell;
|
|
1882
1910
|
if (d) {
|
|
1883
1911
|
const a = t.grid.displayItems[d.rowIndex], c = a ? a[d.field] : void 0, l = t.dropdownOptions.findIndex(
|
|
1884
|
-
(g) =>
|
|
1912
|
+
(g) => at(g, o) === c
|
|
1885
1913
|
);
|
|
1886
1914
|
r = l >= 0 ? l : 0;
|
|
1887
1915
|
} else
|
|
@@ -1895,7 +1923,7 @@ function X(t) {
|
|
|
1895
1923
|
a = l ? l[d.field] : void 0;
|
|
1896
1924
|
}
|
|
1897
1925
|
const c = n.findIndex(
|
|
1898
|
-
(l) =>
|
|
1926
|
+
(l) => at(l, o) === a
|
|
1899
1927
|
);
|
|
1900
1928
|
if (c >= 0)
|
|
1901
1929
|
t.dropdownOptions = n, r = c;
|
|
@@ -1916,42 +1944,42 @@ function X(t) {
|
|
|
1916
1944
|
if (s && t.dropdownOptions.length > 0) {
|
|
1917
1945
|
const n = t.filterText;
|
|
1918
1946
|
t.isOpeningDropdown = !0;
|
|
1919
|
-
const d =
|
|
1920
|
-
|
|
1947
|
+
const d = dt(t, s, t.dropdownOptions, o);
|
|
1948
|
+
ct(t, d), t.filterText = n, t.highlightedIndex = r, et(t);
|
|
1921
1949
|
const a = t.shadow.querySelector(".wg__select-trigger"), c = t.shadow.querySelector(".wg__combobox-input, .wg__autocomplete-input"), l = a || c;
|
|
1922
1950
|
l && l.focus(), requestAnimationFrame(() => {
|
|
1923
1951
|
t.isOpeningDropdown = !1;
|
|
1924
1952
|
});
|
|
1925
1953
|
}
|
|
1926
1954
|
}
|
|
1927
|
-
function
|
|
1928
|
-
t.dropdownOpen ?
|
|
1955
|
+
function me(t) {
|
|
1956
|
+
t.dropdownOpen ? L(t) : W(t);
|
|
1929
1957
|
}
|
|
1930
|
-
function
|
|
1958
|
+
function ct(t, e) {
|
|
1931
1959
|
e.addEventListener("mousedown", (o) => {
|
|
1932
1960
|
o.preventDefault();
|
|
1933
1961
|
const i = o.target.closest(".wg__dropdown-option");
|
|
1934
1962
|
if (i && !i.hasAttribute("data-disabled")) {
|
|
1935
1963
|
const r = parseInt(i.getAttribute("data-index") || "0", 10);
|
|
1936
|
-
|
|
1964
|
+
Ie(t, r, !1);
|
|
1937
1965
|
}
|
|
1938
1966
|
}), e.addEventListener("mouseover", (o) => {
|
|
1939
1967
|
const i = o.target.closest(".wg__dropdown-option");
|
|
1940
1968
|
i && !i.hasAttribute("data-disabled") && (t.highlightedIndex = parseInt(i.getAttribute("data-index") || "0", 10), et(t));
|
|
1941
1969
|
});
|
|
1942
1970
|
}
|
|
1943
|
-
function
|
|
1971
|
+
function be(t, e) {
|
|
1944
1972
|
const o = e.options || [], i = t.filterText.toLowerCase(), r = t.filterText;
|
|
1945
|
-
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;
|
|
1946
1974
|
const s = t.shadow.querySelector(".wg__editor--select");
|
|
1947
1975
|
if (s)
|
|
1948
1976
|
if (t.dropdownOptions.length > 0) {
|
|
1949
|
-
const n =
|
|
1950
|
-
|
|
1977
|
+
const n = dt(t, s, t.dropdownOptions, e);
|
|
1978
|
+
ct(t, n), t.filterText = r, t.highlightedIndex = 0, et(t);
|
|
1951
1979
|
} else
|
|
1952
|
-
|
|
1980
|
+
L(t);
|
|
1953
1981
|
}
|
|
1954
|
-
function
|
|
1982
|
+
function Yo(t, e) {
|
|
1955
1983
|
const o = e.target;
|
|
1956
1984
|
t.filterText = o.value, t.isUserFiltering = !0;
|
|
1957
1985
|
const i = t.getCurrentEditingColumn();
|
|
@@ -1959,17 +1987,17 @@ function Ho(t, e) {
|
|
|
1959
1987
|
const r = i.editorOptions || {}, s = r.options || [];
|
|
1960
1988
|
if (t.filterText.trim()) {
|
|
1961
1989
|
const d = t.filterText.toLowerCase();
|
|
1962
|
-
t.dropdownOptions = s.filter((a) =>
|
|
1990
|
+
t.dropdownOptions = s.filter((a) => Ct(a, r).toLowerCase().includes(d));
|
|
1963
1991
|
} else
|
|
1964
1992
|
t.dropdownOptions = s;
|
|
1965
1993
|
t.highlightedIndex = t.dropdownOptions.length > 0 ? 0 : -1;
|
|
1966
1994
|
const n = o.closest(".wg__editor--combobox");
|
|
1967
1995
|
if (n) {
|
|
1968
|
-
const d =
|
|
1969
|
-
|
|
1996
|
+
const d = dt(t, n, t.dropdownOptions, r);
|
|
1997
|
+
ct(t, d), t.highlightedIndex = t.dropdownOptions.length > 0 ? 0 : -1, et(t);
|
|
1970
1998
|
}
|
|
1971
1999
|
}
|
|
1972
|
-
function
|
|
2000
|
+
function No(t, e) {
|
|
1973
2001
|
const o = e.target;
|
|
1974
2002
|
t.filterText = o.value;
|
|
1975
2003
|
const i = t.getCurrentEditingColumn();
|
|
@@ -1979,26 +2007,26 @@ function zo(t, e) {
|
|
|
1979
2007
|
const d = o.closest(".wg__editor--autocomplete");
|
|
1980
2008
|
if (!t.dropdownOpen && d) {
|
|
1981
2009
|
t.dropdownOptions = r.initialOptions || [];
|
|
1982
|
-
const a =
|
|
1983
|
-
|
|
2010
|
+
const a = dt(t, d, t.dropdownOptions, r);
|
|
2011
|
+
ct(t, a), t.highlightedIndex = t.dropdownOptions.length > 0 ? 0 : -1, et(t);
|
|
1984
2012
|
}
|
|
1985
2013
|
if (t.filterText.length < n) {
|
|
1986
2014
|
if (t.dropdownOptions = r.initialOptions || [], d) {
|
|
1987
|
-
const a =
|
|
1988
|
-
|
|
2015
|
+
const a = dt(t, d, t.dropdownOptions, r);
|
|
2016
|
+
ct(t, a), t.highlightedIndex = t.dropdownOptions.length > 0 ? 0 : -1, et(t);
|
|
1989
2017
|
}
|
|
1990
2018
|
return;
|
|
1991
2019
|
}
|
|
1992
2020
|
t.searchDebounceTimer = setTimeout(() => {
|
|
1993
|
-
|
|
2021
|
+
Uo(t, t.filterText, i);
|
|
1994
2022
|
}, s);
|
|
1995
2023
|
}
|
|
1996
|
-
async function
|
|
2024
|
+
async function Uo(t, e, o) {
|
|
1997
2025
|
const i = o.editorOptions || {};
|
|
1998
2026
|
if (!i.onSearchCallback) return;
|
|
1999
2027
|
t.searchAbortController && t.searchAbortController.abort(), t.searchAbortController = new AbortController();
|
|
2000
2028
|
const r = t.searchAbortController.signal;
|
|
2001
|
-
t.isSearching = !0,
|
|
2029
|
+
t.isSearching = !0, we(t, !0);
|
|
2002
2030
|
try {
|
|
2003
2031
|
const s = t.grid.editingCell;
|
|
2004
2032
|
if (!s) return;
|
|
@@ -2007,8 +2035,8 @@ async function Fo(t, e, o) {
|
|
|
2007
2035
|
t.dropdownOptions = d;
|
|
2008
2036
|
const a = t.shadow.querySelector(".wg__editor--autocomplete");
|
|
2009
2037
|
if (a) {
|
|
2010
|
-
const c =
|
|
2011
|
-
|
|
2038
|
+
const c = dt(t, a, t.dropdownOptions, i);
|
|
2039
|
+
ct(t, c), t.highlightedIndex = d.length > 0 ? 0 : -1, et(t);
|
|
2012
2040
|
}
|
|
2013
2041
|
}
|
|
2014
2042
|
} catch (s) {
|
|
@@ -2017,20 +2045,20 @@ async function Fo(t, e, o) {
|
|
|
2017
2045
|
console.error("Autocomplete search failed:", s), t.dropdownOptions = [];
|
|
2018
2046
|
const n = t.shadow.querySelector(".wg__editor--autocomplete");
|
|
2019
2047
|
if (n) {
|
|
2020
|
-
const d =
|
|
2021
|
-
|
|
2048
|
+
const d = dt(t, n, t.dropdownOptions, i);
|
|
2049
|
+
ct(t, d);
|
|
2022
2050
|
}
|
|
2023
2051
|
} finally {
|
|
2024
|
-
r.aborted || (t.isSearching = !1,
|
|
2052
|
+
r.aborted || (t.isSearching = !1, we(t, !1));
|
|
2025
2053
|
}
|
|
2026
2054
|
}
|
|
2027
|
-
function
|
|
2028
|
-
const
|
|
2055
|
+
function ve(t, e, o, i, r) {
|
|
2056
|
+
const s = i ?? t.tooltipShowDelay;
|
|
2029
2057
|
t.tooltipHideTimer && (clearTimeout(t.tooltipHideTimer), t.tooltipHideTimer = null), !(t.tooltipElement && t.tooltipAnchor === e) && (t.tooltipShowTimer && clearTimeout(t.tooltipShowTimer), t.tooltipShowTimer = setTimeout(() => {
|
|
2030
|
-
|
|
2031
|
-
},
|
|
2058
|
+
Bo(t, e, o, r);
|
|
2059
|
+
}, s));
|
|
2032
2060
|
}
|
|
2033
|
-
function
|
|
2061
|
+
function jo(t, e) {
|
|
2034
2062
|
const o = e ?? t.tooltipHideDelay;
|
|
2035
2063
|
t.tooltipShowTimer && (clearTimeout(t.tooltipShowTimer), t.tooltipShowTimer = null), t.tooltipElement && (t.tooltipHideTimer = setTimeout(() => {
|
|
2036
2064
|
t.tooltipElement && (t.tooltipElement.classList.remove("wg__tooltip--visible"), setTimeout(() => {
|
|
@@ -2039,33 +2067,35 @@ function qo(t, e) {
|
|
|
2039
2067
|
}, 100));
|
|
2040
2068
|
}, o));
|
|
2041
2069
|
}
|
|
2042
|
-
function
|
|
2043
|
-
var
|
|
2044
|
-
(
|
|
2045
|
-
const i = document.createElement("div");
|
|
2046
|
-
i.className = "wg__tooltip", i.textContent = o;
|
|
2070
|
+
function Bo(t, e, o, i) {
|
|
2071
|
+
var d;
|
|
2072
|
+
(d = t.tooltipElement) == null || d.remove();
|
|
2047
2073
|
const r = document.createElement("div");
|
|
2048
|
-
r.className = "wg__tooltip
|
|
2074
|
+
r.className = "wg__tooltip";
|
|
2075
|
+
const s = document.createElement("div");
|
|
2076
|
+
s.className = "wg__tooltip-content", i ? s.innerHTML = o : s.textContent = o, r.appendChild(s);
|
|
2077
|
+
const n = document.createElement("div");
|
|
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, {
|
|
2049
2079
|
strategy: "fixed",
|
|
2050
2080
|
placement: "top",
|
|
2051
2081
|
middleware: [
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2082
|
+
Lt(8),
|
|
2083
|
+
xt({ fallbackPlacements: ["bottom", "left", "right"] }),
|
|
2084
|
+
qo({ element: n })
|
|
2055
2085
|
]
|
|
2056
|
-
}).then(({ x:
|
|
2057
|
-
if (
|
|
2058
|
-
const { x:
|
|
2059
|
-
|
|
2086
|
+
}).then(({ x: a, y: c, placement: l, middlewareData: g }) => {
|
|
2087
|
+
if (r.style.left = `${a}px`, r.style.top = `${c}px`, r.setAttribute("data-placement", l), g.arrow) {
|
|
2088
|
+
const { x: h, y: u } = g.arrow;
|
|
2089
|
+
h != null && (n.style.left = `${h}px`), u != null && (n.style.top = `${u}px`);
|
|
2060
2090
|
}
|
|
2061
2091
|
requestAnimationFrame(() => {
|
|
2062
|
-
|
|
2092
|
+
r.classList.add("wg__tooltip--visible");
|
|
2063
2093
|
});
|
|
2064
2094
|
});
|
|
2065
2095
|
}
|
|
2066
|
-
function
|
|
2096
|
+
function Ko(t, e, o) {
|
|
2067
2097
|
if (t.grid.shouldUseVirtualScroll()) {
|
|
2068
|
-
|
|
2098
|
+
Wo(t, e);
|
|
2069
2099
|
const n = t.shadow.querySelector(
|
|
2070
2100
|
`[data-row="${e}"][data-col="${o}"]`
|
|
2071
2101
|
);
|
|
@@ -2086,19 +2116,19 @@ function No(t, e, o) {
|
|
|
2086
2116
|
}
|
|
2087
2117
|
}
|
|
2088
2118
|
}
|
|
2089
|
-
function
|
|
2119
|
+
function Wo(t, e) {
|
|
2090
2120
|
const o = t.shadow.querySelector(".wg");
|
|
2091
2121
|
if (!o) return;
|
|
2092
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;
|
|
2093
2123
|
a < l ? o.scrollTop = a - d : c > g && (o.scrollTop = c - s);
|
|
2094
2124
|
}
|
|
2095
|
-
function
|
|
2125
|
+
function st(t, e) {
|
|
2096
2126
|
const o = t.shadow.querySelector(".wg");
|
|
2097
2127
|
if (!o) return;
|
|
2098
2128
|
const i = t.grid.virtualScrollRowHeight, r = Math.max(0, (e - 1) * i), s = Math.max(0, o.scrollHeight - o.clientHeight);
|
|
2099
2129
|
o.scrollTop = Math.min(r, s);
|
|
2100
2130
|
}
|
|
2101
|
-
function
|
|
2131
|
+
function K(t, e, o) {
|
|
2102
2132
|
if (e) {
|
|
2103
2133
|
const i = t.shadow.querySelector(
|
|
2104
2134
|
`[data-row="${e.rowIndex}"][data-col="${e.colIndex}"]`
|
|
@@ -2112,7 +2142,7 @@ function U(t, e, o) {
|
|
|
2112
2142
|
i == null || i.classList.add("wg__cell--focused");
|
|
2113
2143
|
}
|
|
2114
2144
|
}
|
|
2115
|
-
function
|
|
2145
|
+
function Y(t) {
|
|
2116
2146
|
const e = t.grid.editingCell;
|
|
2117
2147
|
if (e) {
|
|
2118
2148
|
const o = t.grid.columns.findIndex((r) => String(r.field) === e.field), i = t.shadow.querySelector(
|
|
@@ -2121,23 +2151,23 @@ function P(t) {
|
|
|
2121
2151
|
i && i.classList.remove("wg__cell--editing");
|
|
2122
2152
|
}
|
|
2123
2153
|
}
|
|
2124
|
-
function
|
|
2154
|
+
function Xo(t, e, o) {
|
|
2125
2155
|
if (!t.grid.isNavigateMode) return;
|
|
2126
2156
|
const i = t.grid.focusedCell, r = { rowIndex: e, colIndex: o };
|
|
2127
|
-
t.grid.setFocusedCell(e, o),
|
|
2157
|
+
t.grid.setFocusedCell(e, o), K(t, i, r);
|
|
2128
2158
|
}
|
|
2129
|
-
function
|
|
2159
|
+
function $(t, e, o) {
|
|
2130
2160
|
const i = t.grid.focusedCell, r = { rowIndex: e, colIndex: o };
|
|
2131
|
-
t.grid.setFocusedCell(e, o),
|
|
2161
|
+
t.grid.setFocusedCell(e, o), K(t, i, r), Ko(t, e, o);
|
|
2132
2162
|
}
|
|
2133
|
-
function
|
|
2163
|
+
function B(t, e, o, i) {
|
|
2134
2164
|
const s = t.grid.columns[o];
|
|
2135
2165
|
if (!s || !t.grid.isCellEditable(s))
|
|
2136
2166
|
return;
|
|
2137
2167
|
const n = String(s.field);
|
|
2138
2168
|
t.grid.startEdit(e, n, i);
|
|
2139
2169
|
}
|
|
2140
|
-
function
|
|
2170
|
+
function zt(t, e) {
|
|
2141
2171
|
const o = e.querySelector(".wg__cell-text");
|
|
2142
2172
|
if (!o) return null;
|
|
2143
2173
|
const i = o.textContent || "";
|
|
@@ -2164,14 +2194,14 @@ function Bo(t, e) {
|
|
|
2164
2194
|
}
|
|
2165
2195
|
return a;
|
|
2166
2196
|
}
|
|
2167
|
-
function
|
|
2197
|
+
function Qo(t, e) {
|
|
2168
2198
|
const o = e.relatedTarget, i = t.shadow.querySelector(".wg__table");
|
|
2169
2199
|
if (!o || !(i != null && i.contains(o))) {
|
|
2170
2200
|
const r = t.grid.focusedCell;
|
|
2171
|
-
t.grid.clearFocusedCell(),
|
|
2201
|
+
t.grid.clearFocusedCell(), K(t, r, null);
|
|
2172
2202
|
}
|
|
2173
2203
|
}
|
|
2174
|
-
function
|
|
2204
|
+
function Go(t, e) {
|
|
2175
2205
|
if (!t) return null;
|
|
2176
2206
|
const [o, i, r] = t.split("-").map(Number), s = new Date(o, i - 1, r);
|
|
2177
2207
|
if (isNaN(s.getTime())) return null;
|
|
@@ -2185,21 +2215,21 @@ function Wo(t, e) {
|
|
|
2185
2215
|
return t;
|
|
2186
2216
|
}
|
|
2187
2217
|
}
|
|
2188
|
-
function
|
|
2218
|
+
function Mt(t, e) {
|
|
2189
2219
|
const o = parseInt(e.dataset.row || "0", 10), i = e.dataset.field || "";
|
|
2190
2220
|
let r;
|
|
2191
2221
|
if (e instanceof HTMLInputElement)
|
|
2192
2222
|
if (e.type === "checkbox") {
|
|
2193
2223
|
const s = JSON.parse(e.dataset.trueValue || "true"), n = JSON.parse(e.dataset.falseValue || "false");
|
|
2194
2224
|
r = e.checked ? s : n;
|
|
2195
|
-
} 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;
|
|
2196
2226
|
else e instanceof HTMLSelectElement && (r = e.value);
|
|
2197
2227
|
t.grid.commitEdit(o, i, r);
|
|
2198
2228
|
}
|
|
2199
|
-
function
|
|
2200
|
-
|
|
2229
|
+
function Jo(t, e) {
|
|
2230
|
+
Mt(t, e);
|
|
2201
2231
|
}
|
|
2202
|
-
function
|
|
2232
|
+
function Zo(t, e, o) {
|
|
2203
2233
|
const i = t.grid.columns[o];
|
|
2204
2234
|
if (!i) return;
|
|
2205
2235
|
const r = String(i.field), s = t.grid.displayItems[e];
|
|
@@ -2208,13 +2238,13 @@ function Qo(t, e, o) {
|
|
|
2208
2238
|
t.grid.commitEdit(e, r, l);
|
|
2209
2239
|
const g = t.grid.displayItems;
|
|
2210
2240
|
e < g.length - 1 && requestAnimationFrame(() => {
|
|
2211
|
-
|
|
2241
|
+
$(t, e + 1, o);
|
|
2212
2242
|
});
|
|
2213
2243
|
}
|
|
2214
|
-
function
|
|
2215
|
-
t.isCommittingFromKeyboard || t.grid.editingCell &&
|
|
2244
|
+
function ti(t, e) {
|
|
2245
|
+
t.isCommittingFromKeyboard || t.grid.editingCell && Mt(t, e);
|
|
2216
2246
|
}
|
|
2217
|
-
function
|
|
2247
|
+
function Ft(t, e, o, i) {
|
|
2218
2248
|
const s = t.grid.columns.findIndex((c) => String(c.field) === o), n = t.grid.displayItems;
|
|
2219
2249
|
let d = e, a = s;
|
|
2220
2250
|
if (i === "down")
|
|
@@ -2226,38 +2256,38 @@ function zt(t, e, o, i) {
|
|
|
2226
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);
|
|
2227
2257
|
}
|
|
2228
2258
|
requestAnimationFrame(() => {
|
|
2229
|
-
|
|
2259
|
+
$(t, d, a), t.isCommittingFromKeyboard = !1;
|
|
2230
2260
|
});
|
|
2231
2261
|
}
|
|
2232
|
-
function
|
|
2262
|
+
function ei(t, e, o) {
|
|
2233
2263
|
const r = t.grid.columns.findIndex((s) => String(s.field) === o);
|
|
2234
2264
|
r >= 0 && requestAnimationFrame(() => {
|
|
2235
|
-
|
|
2265
|
+
$(t, e, r), t.isCommittingFromKeyboard = !1;
|
|
2236
2266
|
});
|
|
2237
2267
|
}
|
|
2238
|
-
function
|
|
2268
|
+
function Le(t, e, o, i) {
|
|
2239
2269
|
const r = String(i.field), s = t.grid.displayItems[e], n = t.grid.getCellRawValue(s, e, r);
|
|
2240
2270
|
switch (i.editor || "text") {
|
|
2241
2271
|
case "checkbox":
|
|
2242
|
-
return
|
|
2272
|
+
return si(t, e, r, n, i);
|
|
2243
2273
|
case "number":
|
|
2244
|
-
return
|
|
2274
|
+
return ii(t, e, r, n, i);
|
|
2245
2275
|
case "date":
|
|
2246
|
-
return ei(t, e, r, n, i);
|
|
2247
|
-
case "select":
|
|
2248
2276
|
return ri(t, e, r, n, i);
|
|
2277
|
+
case "select":
|
|
2278
|
+
return ai(t, e, r, n, i);
|
|
2249
2279
|
case "combobox":
|
|
2250
|
-
return
|
|
2280
|
+
return li(t, e, r, n, i);
|
|
2251
2281
|
case "autocomplete":
|
|
2252
|
-
return
|
|
2282
|
+
return di(t, e, r, n, i);
|
|
2253
2283
|
case "custom":
|
|
2254
|
-
return
|
|
2284
|
+
return ci(t, e, r, n, i);
|
|
2255
2285
|
case "text":
|
|
2256
2286
|
default:
|
|
2257
|
-
return
|
|
2287
|
+
return oi(t, e, r, n, i);
|
|
2258
2288
|
}
|
|
2259
2289
|
}
|
|
2260
|
-
function
|
|
2290
|
+
function oi(t, e, o, i, r) {
|
|
2261
2291
|
var a;
|
|
2262
2292
|
const s = r.editorOptions || {}, n = (a = t.grid.editingCell) == null ? void 0 : a.initialSearchQuery, d = n !== void 0 ? n : i != null ? String(i) : "";
|
|
2263
2293
|
return `
|
|
@@ -2273,7 +2303,7 @@ function Zo(t, e, o, i, r) {
|
|
|
2273
2303
|
/>
|
|
2274
2304
|
`;
|
|
2275
2305
|
}
|
|
2276
|
-
function
|
|
2306
|
+
function ii(t, e, o, i, r) {
|
|
2277
2307
|
var d;
|
|
2278
2308
|
r.editorOptions;
|
|
2279
2309
|
const s = (d = t.grid.editingCell) == null ? void 0 : d.initialSearchQuery;
|
|
@@ -2288,9 +2318,9 @@ function ti(t, e, o, i, r) {
|
|
|
2288
2318
|
/>
|
|
2289
2319
|
`;
|
|
2290
2320
|
}
|
|
2291
|
-
function
|
|
2321
|
+
function ri(t, e, o, i, r) {
|
|
2292
2322
|
var c;
|
|
2293
|
-
const s = r.editorOptions || {}, n = (c = t.grid.editingCell) == null ? void 0 : c.initialSearchQuery, d =
|
|
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);
|
|
2294
2324
|
return `
|
|
2295
2325
|
<div class="wg__editor wg__editor--date" data-row="${e}" data-field="${o}">
|
|
2296
2326
|
<input
|
|
@@ -2302,8 +2332,8 @@ function ei(t, e, o, i, r) {
|
|
|
2302
2332
|
data-date-value="${d}"
|
|
2303
2333
|
data-output-format="${s.outputFormat || "iso"}"
|
|
2304
2334
|
data-date-format="${s.dateFormat || "YYYY-MM-DD"}"
|
|
2305
|
-
${s.minDate ? `data-min-date="${
|
|
2306
|
-
${s.maxDate ? `data-max-date="${
|
|
2335
|
+
${s.minDate ? `data-min-date="${Vt(s.minDate)}"` : ""}
|
|
2336
|
+
${s.maxDate ? `data-max-date="${Vt(s.maxDate)}"` : ""}
|
|
2307
2337
|
placeholder="${t.escapeHtml(s.dateFormat || "YYYY-MM-DD")}"
|
|
2308
2338
|
/>
|
|
2309
2339
|
<button type="button" class="wg__date-trigger" tabindex="-1">
|
|
@@ -2312,21 +2342,21 @@ function ei(t, e, o, i, r) {
|
|
|
2312
2342
|
</div>
|
|
2313
2343
|
`;
|
|
2314
2344
|
}
|
|
2315
|
-
function
|
|
2345
|
+
function ni(t, e) {
|
|
2316
2346
|
if (!t) return "";
|
|
2317
2347
|
let o = null;
|
|
2318
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 "";
|
|
2319
2349
|
const i = e || "YYYY-MM-DD", r = o.getFullYear(), s = String(o.getMonth() + 1).padStart(2, "0"), n = String(o.getDate()).padStart(2, "0");
|
|
2320
2350
|
return i.replace("YYYY", String(r)).replace("YY", String(r).slice(-2)).replace("MM", s).replace("DD", n);
|
|
2321
2351
|
}
|
|
2322
|
-
function
|
|
2352
|
+
function Vt(t) {
|
|
2323
2353
|
if (!t) return "";
|
|
2324
2354
|
let e = null;
|
|
2325
2355
|
if (t instanceof Date ? e = t : typeof t == "number" ? e = new Date(t) : typeof t == "string" && (e = new Date(t)), !e || isNaN(e.getTime())) return "";
|
|
2326
2356
|
const o = e.getFullYear(), i = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
|
|
2327
2357
|
return `${o}-${i}-${r}`;
|
|
2328
2358
|
}
|
|
2329
|
-
function
|
|
2359
|
+
function si(t, e, o, i, r) {
|
|
2330
2360
|
const s = r.editorOptions || {}, n = s.trueValue !== void 0 ? s.trueValue : !0;
|
|
2331
2361
|
return `
|
|
2332
2362
|
<input
|
|
@@ -2340,10 +2370,10 @@ function ii(t, e, o, i, r) {
|
|
|
2340
2370
|
/>
|
|
2341
2371
|
`;
|
|
2342
2372
|
}
|
|
2343
|
-
function
|
|
2373
|
+
function ai(t, e, o, i, r) {
|
|
2344
2374
|
var c;
|
|
2345
|
-
const s = r.editorOptions || {}, n = s.options || [], d =
|
|
2346
|
-
return t.dropdownOptions = n, t.filterText = a || "", t.highlightedIndex = n.findIndex((l) =>
|
|
2375
|
+
const s = r.editorOptions || {}, n = s.options || [], d = Jt(i, n, s), a = (c = t.grid.editingCell) == null ? void 0 : c.initialSearchQuery;
|
|
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), `
|
|
2347
2377
|
<div
|
|
2348
2378
|
class="wg__editor wg__editor--select wg__select-trigger"
|
|
2349
2379
|
tabindex="0"
|
|
@@ -2357,9 +2387,9 @@ function ri(t, e, o, i, r) {
|
|
|
2357
2387
|
</div>
|
|
2358
2388
|
`;
|
|
2359
2389
|
}
|
|
2360
|
-
function
|
|
2390
|
+
function li(t, e, o, i, r) {
|
|
2361
2391
|
var l;
|
|
2362
|
-
const s = r.editorOptions || {}, n = s.options || [], d =
|
|
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;
|
|
2363
2393
|
return t.dropdownOptions = n, t.filterText = c, t.highlightedIndex = n.length > 0 ? 0 : -1, `
|
|
2364
2394
|
<div class="wg__editor wg__editor--combobox" data-row="${e}" data-field="${o}">
|
|
2365
2395
|
<input
|
|
@@ -2373,9 +2403,9 @@ function ni(t, e, o, i, r) {
|
|
|
2373
2403
|
</div>
|
|
2374
2404
|
`;
|
|
2375
2405
|
}
|
|
2376
|
-
function
|
|
2406
|
+
function di(t, e, o, i, r) {
|
|
2377
2407
|
var l;
|
|
2378
|
-
const s = r.editorOptions || {}, n = s.initialOptions || s.options || [], d =
|
|
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;
|
|
2379
2409
|
return t.dropdownOptions = n, t.filterText = c, t.highlightedIndex = n.length > 0 ? 0 : -1, `
|
|
2380
2410
|
<div class="wg__editor wg__editor--autocomplete" data-row="${e}" data-field="${o}">
|
|
2381
2411
|
<input
|
|
@@ -2391,7 +2421,7 @@ function si(t, e, o, i, r) {
|
|
|
2391
2421
|
</div>
|
|
2392
2422
|
`;
|
|
2393
2423
|
}
|
|
2394
|
-
function
|
|
2424
|
+
function ci(t, e, o, i, r) {
|
|
2395
2425
|
const s = r.formatCallback ? r.formatCallback(i, t.grid.displayItems[e]) : i != null ? String(i) : "";
|
|
2396
2426
|
return `
|
|
2397
2427
|
<div
|
|
@@ -2404,7 +2434,7 @@ function ai(t, e, o, i, r) {
|
|
|
2404
2434
|
</div>
|
|
2405
2435
|
`;
|
|
2406
2436
|
}
|
|
2407
|
-
function
|
|
2437
|
+
function He(t, e, o, i, r, s) {
|
|
2408
2438
|
const n = i.editor === "select" || i.editor === "combobox" || i.editor === "autocomplete", d = i.editor === "date", a = String(i.field);
|
|
2409
2439
|
return n ? `
|
|
2410
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}">
|
|
@@ -2420,22 +2450,22 @@ function Re(t, e, o, i, r, s) {
|
|
|
2420
2450
|
</div>
|
|
2421
2451
|
` : i.templateCallback ? `<span class="wg__cell-text">${r}</span>` : `<span class="wg__cell-text">${t.escapeHtml(r)}</span>`;
|
|
2422
2452
|
}
|
|
2423
|
-
let
|
|
2453
|
+
let I = {
|
|
2424
2454
|
path: null,
|
|
2425
2455
|
arrowPos: null,
|
|
2426
2456
|
arrowDir: "right"
|
|
2427
2457
|
};
|
|
2428
|
-
const
|
|
2458
|
+
const gi = {
|
|
2429
2459
|
add: { icon: "+", title: "Add row" },
|
|
2430
2460
|
delete: { icon: "−", title: "Delete row", danger: !0 },
|
|
2431
2461
|
duplicate: { icon: "⧉", title: "Duplicate row" },
|
|
2432
2462
|
moveUp: { icon: "↑", title: "Move up" },
|
|
2433
2463
|
moveDown: { icon: "↓", title: "Move down" }
|
|
2434
2464
|
};
|
|
2435
|
-
function
|
|
2465
|
+
function ui(t) {
|
|
2436
2466
|
return t.map((e, o) => {
|
|
2437
2467
|
if (typeof e == "string") {
|
|
2438
|
-
const i =
|
|
2468
|
+
const i = gi[e];
|
|
2439
2469
|
return i ? {
|
|
2440
2470
|
id: e,
|
|
2441
2471
|
icon: i.icon,
|
|
@@ -2460,7 +2490,7 @@ function di(t) {
|
|
|
2460
2490
|
};
|
|
2461
2491
|
}).filter((e) => e !== null);
|
|
2462
2492
|
}
|
|
2463
|
-
function
|
|
2493
|
+
function hi(t) {
|
|
2464
2494
|
const e = /* @__PURE__ */ new Map();
|
|
2465
2495
|
for (const r of t) {
|
|
2466
2496
|
const s = r.row;
|
|
@@ -2484,8 +2514,8 @@ function ci(t) {
|
|
|
2484
2514
|
}
|
|
2485
2515
|
return o;
|
|
2486
2516
|
}
|
|
2487
|
-
function
|
|
2488
|
-
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) => {
|
|
2489
2519
|
const c = a > 0 ? '<div class="wg__toolbar-divider"></div>' : "", l = d.map((g) => {
|
|
2490
2520
|
const h = typeof g.disabled == "function" ? g.disabled(e, o) : g.disabled, u = [
|
|
2491
2521
|
"wg__toolbar-btn",
|
|
@@ -2501,36 +2531,58 @@ function gi(t, e, o) {
|
|
|
2501
2531
|
return c + l;
|
|
2502
2532
|
}).join("")}</div>`).join("")}</div>`;
|
|
2503
2533
|
}
|
|
2504
|
-
let
|
|
2505
|
-
function
|
|
2506
|
-
|
|
2507
|
-
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");
|
|
2508
2538
|
a.className = "wg__toolbar-container", a.innerHTML = d, t.shadow.appendChild(a);
|
|
2509
2539
|
const c = a.querySelector(".wg__toolbar");
|
|
2510
2540
|
let l = "left";
|
|
2511
|
-
requestAnimationFrame(() => {
|
|
2541
|
+
c.style.position = "fixed", c.style.visibility = "hidden", requestAnimationFrame(() => {
|
|
2512
2542
|
const h = t.shadow.querySelector(`tr[data-row-index="${o}"]`);
|
|
2513
2543
|
if (!h) {
|
|
2514
|
-
|
|
2544
|
+
At();
|
|
2515
2545
|
return;
|
|
2516
2546
|
}
|
|
2517
|
-
const u =
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
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
|
+
};
|
|
2528
2567
|
}
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
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
|
+
});
|
|
2534
2586
|
});
|
|
2535
2587
|
const g = (h) => {
|
|
2536
2588
|
const u = h.target.closest(".wg__toolbar-btn");
|
|
@@ -2539,7 +2591,7 @@ function ui(t, e, o, i, r, s, n) {
|
|
|
2539
2591
|
m && s(m);
|
|
2540
2592
|
}
|
|
2541
2593
|
};
|
|
2542
|
-
a.addEventListener("click", g),
|
|
2594
|
+
a.addEventListener("click", g), M = {
|
|
2543
2595
|
container: a,
|
|
2544
2596
|
toolbar: c,
|
|
2545
2597
|
rowIndex: o,
|
|
@@ -2550,95 +2602,104 @@ function ui(t, e, o, i, r, s, n) {
|
|
|
2550
2602
|
cleanup: () => {
|
|
2551
2603
|
a.removeEventListener("click", g), a.remove();
|
|
2552
2604
|
}
|
|
2553
|
-
},
|
|
2605
|
+
}, I = { path: null, arrowPos: null, arrowDir: "right" };
|
|
2554
2606
|
}
|
|
2555
|
-
function
|
|
2556
|
-
|
|
2607
|
+
function At() {
|
|
2608
|
+
M && (M.cleanup(), M = null), I = { path: null, arrowPos: null, arrowDir: "right" };
|
|
2557
2609
|
}
|
|
2558
|
-
function
|
|
2559
|
-
return (
|
|
2610
|
+
function bt() {
|
|
2611
|
+
return (M == null ? void 0 : M.rowIndex) ?? null;
|
|
2560
2612
|
}
|
|
2561
|
-
function
|
|
2562
|
-
return (
|
|
2613
|
+
function wi(t) {
|
|
2614
|
+
return (M == null ? void 0 : M.container.getRootNode()) === t;
|
|
2563
2615
|
}
|
|
2564
|
-
function
|
|
2565
|
-
return (
|
|
2616
|
+
function qt(t) {
|
|
2617
|
+
return (M == null ? void 0 : M.rowIndex) === t;
|
|
2566
2618
|
}
|
|
2567
|
-
function
|
|
2568
|
-
return
|
|
2619
|
+
function mi() {
|
|
2620
|
+
return I;
|
|
2569
2621
|
}
|
|
2570
|
-
function
|
|
2571
|
-
if (
|
|
2572
|
-
|
|
2622
|
+
function _e(t, e) {
|
|
2623
|
+
if (!M) {
|
|
2624
|
+
I = { path: null, arrowPos: null, arrowDir: "right" };
|
|
2573
2625
|
return;
|
|
2574
2626
|
}
|
|
2575
|
-
const { toolbar: o, rowItem: i, position: r } =
|
|
2627
|
+
const { toolbar: o, rowItem: i, position: r } = M, s = e.findIndex((y) => y === i);
|
|
2576
2628
|
if (s === -1) {
|
|
2577
|
-
|
|
2629
|
+
I = { path: null, arrowPos: null, arrowDir: "right" };
|
|
2578
2630
|
return;
|
|
2579
2631
|
}
|
|
2580
2632
|
const n = t.shadow.querySelector(`tr[data-row-index="${s}"]`);
|
|
2581
2633
|
if (!n) {
|
|
2582
|
-
|
|
2634
|
+
I = { path: null, arrowPos: null, arrowDir: "right" };
|
|
2583
2635
|
return;
|
|
2584
2636
|
}
|
|
2585
|
-
if (s ===
|
|
2586
|
-
|
|
2637
|
+
if (s === M.rowIndex || (M.hasRowMoved = !0), !M.hasRowMoved) {
|
|
2638
|
+
I = { path: null, arrowPos: null, arrowDir: "right" };
|
|
2587
2639
|
return;
|
|
2588
2640
|
}
|
|
2589
|
-
const a = o.getBoundingClientRect(), c = n.getBoundingClientRect(), l = t.shadow.querySelector(".wg__table"), g = l == null ? void 0 : l.getBoundingClientRect();
|
|
2590
|
-
if (!g) {
|
|
2591
|
-
|
|
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" };
|
|
2592
2644
|
return;
|
|
2593
2645
|
}
|
|
2594
|
-
const
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
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;
|
|
2601
2657
|
} else if (r === "right") {
|
|
2602
|
-
const
|
|
2603
|
-
|
|
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;
|
|
2604
2666
|
} else {
|
|
2605
|
-
const
|
|
2606
|
-
if (
|
|
2607
|
-
|
|
2608
|
-
|
|
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" };
|
|
2609
2671
|
return;
|
|
2610
|
-
} else if (
|
|
2611
|
-
const
|
|
2612
|
-
|
|
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" };
|
|
2613
2675
|
return;
|
|
2614
|
-
} else if (
|
|
2615
|
-
|
|
2616
|
-
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" };
|
|
2617
2679
|
return;
|
|
2618
2680
|
} else {
|
|
2619
|
-
|
|
2620
|
-
|
|
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" };
|
|
2621
2683
|
return;
|
|
2622
2684
|
}
|
|
2623
2685
|
}
|
|
2624
|
-
H = { path: f, arrowPos: { x: p, y: m }, arrowDir: b };
|
|
2625
2686
|
}
|
|
2626
|
-
function
|
|
2687
|
+
function ze(t, e) {
|
|
2627
2688
|
return `<button
|
|
2628
2689
|
class="wg__toolbar-trigger ${e ? "wg__toolbar-trigger--active" : ""}"
|
|
2629
2690
|
data-toolbar-trigger="${t}"
|
|
2630
2691
|
title="Row actions"
|
|
2631
2692
|
>⋮</button>`;
|
|
2632
2693
|
}
|
|
2633
|
-
function
|
|
2694
|
+
function bi(t) {
|
|
2634
2695
|
const e = ["wg"];
|
|
2635
2696
|
return t.grid.striped && e.push("wg--striped"), t.grid.hoverable && e.push("wg--hoverable"), t.grid.editable && e.push("wg--editable"), t.grid.isNavigateMode && e.push("wg--navigate-mode"), e.join(" ");
|
|
2636
2697
|
}
|
|
2637
|
-
function
|
|
2698
|
+
function vi(t) {
|
|
2638
2699
|
const e = t.grid.columns;
|
|
2639
2700
|
if (e.length === 0) return "";
|
|
2640
2701
|
const o = t.grid.showRowNumbers ? '<th class="wg__header wg__row-number-header">#</th>' : "", r = t.grid.showRowToolbar && t.grid.toolbarTrigger === "button" ? '<th class="wg__header wg__actions-column"></th>' : "", s = e.map((n) => {
|
|
2641
|
-
const d = String(n.field), a = n.sortable !== !1 && t.grid.
|
|
2702
|
+
const d = String(n.field), a = n.sortable !== !1 && t.grid.sortMode !== "none", c = t.grid.getColumnSortState(d), l = t.grid.getColumnSortPriority(d), g = c !== void 0, h = ["wg__header"];
|
|
2642
2703
|
a && h.push("wg__header--sortable"), g && h.push("wg__header--sorted");
|
|
2643
2704
|
const u = n.width || n.maxWidth, m = `style="${[
|
|
2644
2705
|
u ? `width: ${u}` : "",
|
|
@@ -2665,7 +2726,7 @@ function mi(t) {
|
|
|
2665
2726
|
}).join("");
|
|
2666
2727
|
return `<tr>${o}${r}${s}</tr>`;
|
|
2667
2728
|
}
|
|
2668
|
-
function
|
|
2729
|
+
function _i(t) {
|
|
2669
2730
|
const e = t.grid.displayItems, o = t.grid.columns, i = t.grid.showRowNumbers, r = t.grid.showRowToolbar && t.grid.toolbarTrigger === "button", s = o.length + (r ? 1 : 0) + (i ? 1 : 0);
|
|
2670
2731
|
if (e.length === 0)
|
|
2671
2732
|
return `
|
|
@@ -2675,46 +2736,63 @@ function bi(t) {
|
|
|
2675
2736
|
</td>
|
|
2676
2737
|
</tr>
|
|
2677
2738
|
`;
|
|
2678
|
-
const n =
|
|
2739
|
+
const n = bt();
|
|
2679
2740
|
return e.map((d, a) => {
|
|
2680
2741
|
const c = i ? `<td class="wg__cell wg__row-number">${a + 1}</td>` : "";
|
|
2681
2742
|
let l = "";
|
|
2682
2743
|
r && (l = `
|
|
2683
2744
|
<td class="wg__cell wg__actions-column">
|
|
2684
|
-
${
|
|
2745
|
+
${ze(a, n === a)}
|
|
2685
2746
|
</td>
|
|
2686
2747
|
`);
|
|
2687
2748
|
const g = o.map((u, p) => {
|
|
2688
|
-
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),
|
|
2689
|
-
if (v &&
|
|
2690
|
-
const T = t.grid.getCellRawValue(d, a, m),
|
|
2691
|
-
|
|
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) {
|
|
2751
|
+
const T = t.grid.getCellRawValue(d, a, m), k = u.cellClassCallback(T, d);
|
|
2752
|
+
k && S.push(k);
|
|
2692
2753
|
}
|
|
2693
|
-
const
|
|
2754
|
+
const D = [
|
|
2694
2755
|
`text-align: ${b}`,
|
|
2695
2756
|
u.width ? `width: ${u.width}` : "",
|
|
2696
2757
|
u.minWidth ? `min-width: ${u.minWidth}` : "",
|
|
2697
2758
|
u.maxWidth ? `max-width: ${u.maxWidth}` : ""
|
|
2698
2759
|
].filter(Boolean).join("; "), x = t.grid.isNavigateMode ? 'tabindex="0"' : "";
|
|
2699
|
-
let
|
|
2760
|
+
let C = "";
|
|
2700
2761
|
if (u.tooltipCallback) {
|
|
2701
|
-
const T = t.grid.getCellRawValue(d, a, m),
|
|
2702
|
-
|
|
2762
|
+
const T = t.grid.getCellRawValue(d, a, m), k = u.tooltipCallback(T, d);
|
|
2763
|
+
k && (C = `data-tooltip="${t.escapeHtml(k)}"`);
|
|
2703
2764
|
} else if (u.tooltipMember) {
|
|
2704
2765
|
const T = d[u.tooltipMember];
|
|
2705
|
-
T && typeof T == "string" && (
|
|
2766
|
+
T && typeof T == "string" && (C = `data-tooltip="${t.escapeHtml(T)}"`);
|
|
2767
|
+
}
|
|
2768
|
+
if (!C && t.grid.isCellInvalid(a, m)) {
|
|
2769
|
+
const T = t.grid.getCellValidationError(a, m);
|
|
2770
|
+
if (T) {
|
|
2771
|
+
const k = u.validationTooltipCallback || t.grid.validationTooltipCallback;
|
|
2772
|
+
if (k) {
|
|
2773
|
+
const E = t.grid.getCellRawValue(d, a, m), A = k({
|
|
2774
|
+
field: m,
|
|
2775
|
+
error: T,
|
|
2776
|
+
value: E,
|
|
2777
|
+
row: d,
|
|
2778
|
+
rowIndex: a
|
|
2779
|
+
});
|
|
2780
|
+
A && (C = `data-tooltip-html="${t.escapeHtml(A)}"`);
|
|
2781
|
+
}
|
|
2782
|
+
C || (C = `data-tooltip="${t.escapeHtml(T)}"`);
|
|
2783
|
+
}
|
|
2706
2784
|
}
|
|
2707
2785
|
return `
|
|
2708
2786
|
<td
|
|
2709
|
-
class="${
|
|
2710
|
-
style="${
|
|
2787
|
+
class="${S.join(" ")}"
|
|
2788
|
+
style="${D}"
|
|
2711
2789
|
data-row="${a}"
|
|
2712
2790
|
data-col="${p}"
|
|
2713
2791
|
data-field="${m}"
|
|
2714
2792
|
${x}
|
|
2715
|
-
${
|
|
2793
|
+
${C}
|
|
2716
2794
|
>
|
|
2717
|
-
${t.grid.isEditing(a, m) ?
|
|
2795
|
+
${t.grid.isEditing(a, m) ? Le(t, a, p, u) : He(t, a, p, u, f)}
|
|
2718
2796
|
</td>
|
|
2719
2797
|
`;
|
|
2720
2798
|
}).join(""), h = ["wg__row"];
|
|
@@ -2725,7 +2803,7 @@ function bi(t) {
|
|
|
2725
2803
|
return `<tr class="${h.join(" ")}" data-row-index="${a}">${c}${l}${g}</tr>`;
|
|
2726
2804
|
}).join("");
|
|
2727
2805
|
}
|
|
2728
|
-
function
|
|
2806
|
+
function ye(t, e) {
|
|
2729
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);
|
|
2730
2808
|
if (o.length === 0)
|
|
2731
2809
|
return `
|
|
@@ -2735,59 +2813,76 @@ function we(t, e) {
|
|
|
2735
2813
|
</td>
|
|
2736
2814
|
</tr>
|
|
2737
2815
|
`;
|
|
2738
|
-
const g =
|
|
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 = [];
|
|
2739
2817
|
for (let b = r; b < s && b < o.length; b++) {
|
|
2740
|
-
const v = o[b], _ = b,
|
|
2818
|
+
const v = o[b], _ = b, S = a ? `<td class="wg__cell wg__row-number">${_ + 1}</td>` : "";
|
|
2741
2819
|
let y = "";
|
|
2742
2820
|
c && (y = `
|
|
2743
2821
|
<td class="wg__cell wg__actions-column">
|
|
2744
|
-
${
|
|
2822
|
+
${ze(_, g === _)}
|
|
2745
2823
|
</td>
|
|
2746
2824
|
`);
|
|
2747
|
-
const
|
|
2748
|
-
const
|
|
2749
|
-
if (
|
|
2750
|
-
const
|
|
2751
|
-
|
|
2825
|
+
const D = i.map((C, T) => {
|
|
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);
|
|
2752
2830
|
}
|
|
2753
|
-
const
|
|
2754
|
-
`text-align: ${
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
].filter(Boolean).join("; "),
|
|
2759
|
-
let
|
|
2760
|
-
if (
|
|
2761
|
-
const
|
|
2762
|
-
|
|
2763
|
-
} else if (
|
|
2764
|
-
const
|
|
2765
|
-
|
|
2831
|
+
const F = [
|
|
2832
|
+
`text-align: ${A}`,
|
|
2833
|
+
C.width ? `width: ${C.width}` : "",
|
|
2834
|
+
C.minWidth ? `min-width: ${C.minWidth}` : "",
|
|
2835
|
+
C.maxWidth ? `max-width: ${C.maxWidth}` : ""
|
|
2836
|
+
].filter(Boolean).join("; "), V = t.grid.isNavigateMode ? 'tabindex="0"' : "";
|
|
2837
|
+
let P = "";
|
|
2838
|
+
if (C.tooltipCallback) {
|
|
2839
|
+
const q = t.grid.getCellRawValue(v, _, k), ot = C.tooltipCallback(q, v);
|
|
2840
|
+
ot && (P = `data-tooltip="${t.escapeHtml(ot)}"`);
|
|
2841
|
+
} else if (C.tooltipMember) {
|
|
2842
|
+
const q = v[C.tooltipMember];
|
|
2843
|
+
q && typeof q == "string" && (P = `data-tooltip="${t.escapeHtml(q)}"`);
|
|
2844
|
+
}
|
|
2845
|
+
if (!P && t.grid.isCellInvalid(_, k)) {
|
|
2846
|
+
const q = t.grid.getCellValidationError(_, k);
|
|
2847
|
+
if (q) {
|
|
2848
|
+
const ot = C.validationTooltipCallback || t.grid.validationTooltipCallback;
|
|
2849
|
+
if (ot) {
|
|
2850
|
+
const Ye = t.grid.getCellRawValue(v, _, k), ae = ot({
|
|
2851
|
+
field: k,
|
|
2852
|
+
error: q,
|
|
2853
|
+
value: Ye,
|
|
2854
|
+
row: v,
|
|
2855
|
+
rowIndex: _
|
|
2856
|
+
});
|
|
2857
|
+
ae && (P = `data-tooltip-html="${t.escapeHtml(ae)}"`);
|
|
2858
|
+
}
|
|
2859
|
+
P || (P = `data-tooltip="${t.escapeHtml(q)}"`);
|
|
2860
|
+
}
|
|
2766
2861
|
}
|
|
2767
2862
|
return `
|
|
2768
2863
|
<td
|
|
2769
|
-
class="${
|
|
2770
|
-
style="${
|
|
2864
|
+
class="${R.join(" ")}"
|
|
2865
|
+
style="${F}"
|
|
2771
2866
|
data-row="${_}"
|
|
2772
2867
|
data-col="${T}"
|
|
2773
|
-
data-field="${
|
|
2774
|
-
${
|
|
2775
|
-
${
|
|
2868
|
+
data-field="${k}"
|
|
2869
|
+
${V}
|
|
2870
|
+
${P}
|
|
2776
2871
|
>
|
|
2777
|
-
${t.grid.isEditing(_,
|
|
2872
|
+
${t.grid.isEditing(_, k) ? Le(t, _, T, C) : He(t, _, T, C, E)}
|
|
2778
2873
|
</td>
|
|
2779
2874
|
`;
|
|
2780
2875
|
}).join(""), x = ["wg__row"];
|
|
2781
2876
|
if (t.grid.rowClassCallback) {
|
|
2782
|
-
const
|
|
2783
|
-
|
|
2877
|
+
const C = t.grid.rowClassCallback(v, _);
|
|
2878
|
+
C && x.push(C);
|
|
2784
2879
|
}
|
|
2785
|
-
m.push(`<tr class="${x.join(" ")}" data-row-index="${_}">${
|
|
2880
|
+
m.push(`<tr class="${x.join(" ")}" data-row-index="${_}">${S}${y}${D}</tr>`);
|
|
2786
2881
|
}
|
|
2787
2882
|
const f = u > 0 ? `<tr class="wg__spacer-bottom"><td colspan="${l}" style="height: ${u}px"></td></tr>` : "";
|
|
2788
2883
|
return p + m.join("") + f;
|
|
2789
2884
|
}
|
|
2790
|
-
function
|
|
2885
|
+
function Yt(t, e = "bottom-center") {
|
|
2791
2886
|
const o = t.grid.showPagination;
|
|
2792
2887
|
if (!t.grid.pageable || o === !1 || o === "auto" && t.grid.totalPages <= 1) return "";
|
|
2793
2888
|
const i = t.grid.currentPage, r = t.grid.totalPages, s = t.grid.pageSize, n = t.grid.pageSizes, d = t.grid.totalItems !== null ? t.grid.totalItems : t.grid.sortedItems.length, a = {
|
|
@@ -2840,7 +2935,7 @@ function qt(t, e = "bottom-center") {
|
|
|
2840
2935
|
}, b = t.grid.paginationLayout.split("|").map((v) => v.trim()).map((v) => m[v] || "").join("");
|
|
2841
2936
|
return `<div class="${p.join(" ")}">${b}</div>`;
|
|
2842
2937
|
}
|
|
2843
|
-
function
|
|
2938
|
+
function Nt(t, e) {
|
|
2844
2939
|
const o = t.grid.summaryContentCallback;
|
|
2845
2940
|
if (!o) return "";
|
|
2846
2941
|
const i = t.grid.currentPage, r = t.grid.pageSize, s = t.grid.sortedItems, n = t.grid.displayItems, d = t.grid.totalItems !== null ? t.grid.totalItems : s.length, a = o({
|
|
@@ -2853,7 +2948,7 @@ function Yt(t, e) {
|
|
|
2853
2948
|
}), c = e.startsWith("top-"), l = e.replace("top-", "").replace("bottom-", ""), g = ["wg__summary"];
|
|
2854
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>`;
|
|
2855
2950
|
}
|
|
2856
|
-
const
|
|
2951
|
+
const Fe = {
|
|
2857
2952
|
today: "Today",
|
|
2858
2953
|
clear: "Clear",
|
|
2859
2954
|
monthNames: [
|
|
@@ -2895,7 +2990,7 @@ const Le = {
|
|
|
2895
2990
|
],
|
|
2896
2991
|
weekdayNamesShort: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
|
|
2897
2992
|
};
|
|
2898
|
-
function
|
|
2993
|
+
function Kt(t) {
|
|
2899
2994
|
const e = {};
|
|
2900
2995
|
let o = "";
|
|
2901
2996
|
return t.includes("-") ? o = "-" : t.includes("/") ? o = "/" : t.includes(".") && (o = "."), t.split(o).forEach((r, s) => {
|
|
@@ -2907,14 +3002,14 @@ function Bt(t) {
|
|
|
2907
3002
|
maxLength: t.length
|
|
2908
3003
|
};
|
|
2909
3004
|
}
|
|
2910
|
-
function
|
|
3005
|
+
function Ve(t, e) {
|
|
2911
3006
|
if (!t || isNaN(t.getTime())) return "";
|
|
2912
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 = [];
|
|
2913
3008
|
for (let a = 0; a < 3; a++)
|
|
2914
3009
|
n.year && n.year.index === a ? d.push(n.year.length === 2 ? String(o).slice(-2) : o) : n.month && n.month.index === a ? d.push(i) : n.day && n.day.index === a && d.push(r);
|
|
2915
3010
|
return d.join(s);
|
|
2916
3011
|
}
|
|
2917
|
-
function
|
|
3012
|
+
function yi(t, e) {
|
|
2918
3013
|
if (!t) return null;
|
|
2919
3014
|
const { separator: o, parts: i } = e, r = t.split(o);
|
|
2920
3015
|
let s = null, n = null, d = null;
|
|
@@ -2936,7 +3031,7 @@ function vi(t, e) {
|
|
|
2936
3031
|
const a = new Date(s, n - 1, d);
|
|
2937
3032
|
return a.getMonth() !== n - 1 || a.getDate() !== d ? null : a;
|
|
2938
3033
|
}
|
|
2939
|
-
function
|
|
3034
|
+
function j(t) {
|
|
2940
3035
|
if (!t) return null;
|
|
2941
3036
|
let e;
|
|
2942
3037
|
if (typeof t == "string") {
|
|
@@ -2946,23 +3041,23 @@ function V(t) {
|
|
|
2946
3041
|
e = new Date(t);
|
|
2947
3042
|
return e.setHours(0, 0, 0, 0), isNaN(e.getTime()) ? null : e;
|
|
2948
3043
|
}
|
|
2949
|
-
function
|
|
3044
|
+
function Wt(t) {
|
|
2950
3045
|
const e = t.getFullYear(), o = String(t.getMonth() + 1).padStart(2, "0"), i = String(t.getDate()).padStart(2, "0");
|
|
2951
3046
|
return `${e}-${o}-${i}`;
|
|
2952
3047
|
}
|
|
2953
|
-
function
|
|
3048
|
+
function yt(t, e) {
|
|
2954
3049
|
return !t || !e ? !1 : t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate();
|
|
2955
3050
|
}
|
|
2956
|
-
function
|
|
2957
|
-
return
|
|
3051
|
+
function Ci(t) {
|
|
3052
|
+
return yt(t, /* @__PURE__ */ new Date());
|
|
2958
3053
|
}
|
|
2959
|
-
function
|
|
3054
|
+
function gt(t, e) {
|
|
2960
3055
|
return new Date(t, e + 1, 0).getDate();
|
|
2961
3056
|
}
|
|
2962
|
-
function
|
|
3057
|
+
function Si(t, e) {
|
|
2963
3058
|
return new Date(t, e, 1).getDay();
|
|
2964
3059
|
}
|
|
2965
|
-
function
|
|
3060
|
+
function xi(t, e) {
|
|
2966
3061
|
if (!t)
|
|
2967
3062
|
return { min: e - 10, max: e + 10 };
|
|
2968
3063
|
if (t.includes("-")) {
|
|
@@ -2972,8 +3067,8 @@ function Ci(t, e) {
|
|
|
2972
3067
|
const o = parseInt(t, 10);
|
|
2973
3068
|
return { min: o, max: o };
|
|
2974
3069
|
}
|
|
2975
|
-
function
|
|
2976
|
-
const i =
|
|
3070
|
+
function ki(t, e, o = Fe) {
|
|
3071
|
+
const i = Di(t, o), r = Ti(t, e, o), s = Ei(t, e, o), n = e.showTodayButton !== !1 ? Ai(o) : "";
|
|
2977
3072
|
return `
|
|
2978
3073
|
<div class="wg-datepicker">
|
|
2979
3074
|
<div class="wg-datepicker__header">
|
|
@@ -2989,7 +3084,7 @@ function Si(t, e, o = Le) {
|
|
|
2989
3084
|
</div>
|
|
2990
3085
|
`;
|
|
2991
3086
|
}
|
|
2992
|
-
function
|
|
3087
|
+
function Di(t, e) {
|
|
2993
3088
|
return `
|
|
2994
3089
|
<button type="button" class="wg-datepicker__nav wg-datepicker__nav--prev" data-action="prev-month">
|
|
2995
3090
|
<svg viewBox="0 0 24 24" width="16" height="16"><path fill="currentColor" d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/></svg>
|
|
@@ -3002,8 +3097,8 @@ function xi(t, e) {
|
|
|
3002
3097
|
</button>
|
|
3003
3098
|
`;
|
|
3004
3099
|
}
|
|
3005
|
-
function
|
|
3006
|
-
const i =
|
|
3100
|
+
function Ti(t, e, o) {
|
|
3101
|
+
const i = xi(e.rollingYearRange, (/* @__PURE__ */ new Date()).getFullYear());
|
|
3007
3102
|
let r = "";
|
|
3008
3103
|
for (let n = i.min; n <= i.max; n++) {
|
|
3009
3104
|
const d = n === t.viewYear ? " wg-datepicker__rolling-item--selected" : "";
|
|
@@ -3025,8 +3120,8 @@ function ki(t, e, o) {
|
|
|
3025
3120
|
</div>
|
|
3026
3121
|
`;
|
|
3027
3122
|
}
|
|
3028
|
-
function
|
|
3029
|
-
const i =
|
|
3123
|
+
function Ei(t, e, o) {
|
|
3124
|
+
const i = $i(o), r = qe(t, e);
|
|
3030
3125
|
return `
|
|
3031
3126
|
<div class="wg-datepicker__weekdays">
|
|
3032
3127
|
${i}
|
|
@@ -3036,16 +3131,16 @@ function Di(t, e, o) {
|
|
|
3036
3131
|
</div>
|
|
3037
3132
|
`;
|
|
3038
3133
|
}
|
|
3039
|
-
function
|
|
3134
|
+
function $i(t) {
|
|
3040
3135
|
return t.weekdayNamesShort.map((e) => `<div class="wg-datepicker__weekday">${e}</div>`).join("");
|
|
3041
3136
|
}
|
|
3042
|
-
function
|
|
3043
|
-
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 = [];
|
|
3044
3139
|
for (let y = a - 1; y >= 0; y--) {
|
|
3045
|
-
const
|
|
3140
|
+
const D = l - y;
|
|
3046
3141
|
b.push({
|
|
3047
|
-
date: new Date(h, u,
|
|
3048
|
-
day:
|
|
3142
|
+
date: new Date(h, u, D),
|
|
3143
|
+
day: D,
|
|
3049
3144
|
isOtherMonth: !0
|
|
3050
3145
|
});
|
|
3051
3146
|
}
|
|
@@ -3062,19 +3157,19 @@ function He(t, e) {
|
|
|
3062
3157
|
day: y,
|
|
3063
3158
|
isOtherMonth: !0
|
|
3064
3159
|
});
|
|
3065
|
-
let
|
|
3160
|
+
let S = "";
|
|
3066
3161
|
for (const y of b) {
|
|
3067
|
-
const
|
|
3068
|
-
y.isOtherMonth &&
|
|
3069
|
-
const
|
|
3070
|
-
|
|
3162
|
+
const D = ["wg-datepicker__day"];
|
|
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");
|
|
3164
|
+
const C = Wt(y.date);
|
|
3165
|
+
S += `<div class="${D.join(" ")}" data-date="${C}">${y.day}</div>`;
|
|
3071
3166
|
}
|
|
3072
|
-
return
|
|
3167
|
+
return S;
|
|
3073
3168
|
}
|
|
3074
|
-
function
|
|
3169
|
+
function Mi(t, e, o) {
|
|
3075
3170
|
return !!(e && t < e || o && t > o);
|
|
3076
3171
|
}
|
|
3077
|
-
function
|
|
3172
|
+
function Ai(t) {
|
|
3078
3173
|
return `
|
|
3079
3174
|
<div class="wg-datepicker__footer">
|
|
3080
3175
|
<button type="button" class="wg-datepicker__today-btn" data-action="today">
|
|
@@ -3083,22 +3178,22 @@ function $i(t) {
|
|
|
3083
3178
|
</div>
|
|
3084
3179
|
`;
|
|
3085
3180
|
}
|
|
3086
|
-
function
|
|
3181
|
+
function Oi(t, e, o) {
|
|
3087
3182
|
const i = t.querySelector(".wg-datepicker__days");
|
|
3088
|
-
i && (i.innerHTML =
|
|
3183
|
+
i && (i.innerHTML = qe(e, o));
|
|
3089
3184
|
}
|
|
3090
|
-
function
|
|
3185
|
+
function Ri(t, e, o) {
|
|
3091
3186
|
const i = t.querySelector(".wg-datepicker__month-year");
|
|
3092
3187
|
if (i) {
|
|
3093
3188
|
const r = o.monthNames[e.viewMonth];
|
|
3094
3189
|
i.textContent = `${r} ${e.viewYear}`;
|
|
3095
3190
|
}
|
|
3096
3191
|
}
|
|
3097
|
-
function
|
|
3192
|
+
function Pi(t, e) {
|
|
3098
3193
|
const o = t.querySelector(".wg-datepicker__rolling-selector"), i = t.querySelector(".wg-datepicker__calendar");
|
|
3099
3194
|
o && o.classList.toggle("wg-datepicker__rolling-selector--visible", e), i && i.classList.toggle("wg-datepicker__calendar--hidden", e);
|
|
3100
3195
|
}
|
|
3101
|
-
function
|
|
3196
|
+
function Ii(t, e) {
|
|
3102
3197
|
t.querySelectorAll("[data-year]").forEach((r) => {
|
|
3103
3198
|
const s = parseInt(r.dataset.year || "0", 10);
|
|
3104
3199
|
r.classList.toggle("wg-datepicker__rolling-item--selected", s === e.viewYear);
|
|
@@ -3107,7 +3202,7 @@ function Ri(t, e) {
|
|
|
3107
3202
|
r.classList.toggle("wg-datepicker__rolling-item--selected", s === e.viewMonth);
|
|
3108
3203
|
});
|
|
3109
3204
|
}
|
|
3110
|
-
function
|
|
3205
|
+
function Ce(t) {
|
|
3111
3206
|
const e = t.querySelector("[data-year].wg-datepicker__rolling-item--selected"), o = t.querySelector("[data-month].wg-datepicker__rolling-item--selected");
|
|
3112
3207
|
if (e) {
|
|
3113
3208
|
const i = e.parentElement;
|
|
@@ -3124,28 +3219,28 @@ function me(t) {
|
|
|
3124
3219
|
}
|
|
3125
3220
|
}
|
|
3126
3221
|
}
|
|
3127
|
-
function
|
|
3222
|
+
function Xt(t) {
|
|
3128
3223
|
t.viewMonth === 0 ? (t.viewMonth = 11, t.viewYear--) : t.viewMonth--;
|
|
3129
3224
|
}
|
|
3130
|
-
function
|
|
3225
|
+
function Qt(t) {
|
|
3131
3226
|
t.viewMonth === 11 ? (t.viewMonth = 0, t.viewYear++) : t.viewMonth++;
|
|
3132
3227
|
}
|
|
3133
|
-
function
|
|
3228
|
+
function Li(t, e, o, i) {
|
|
3134
3229
|
var s, n, d, a;
|
|
3135
3230
|
const { key: r } = t;
|
|
3136
3231
|
if (r === "Escape")
|
|
3137
3232
|
return (s = i.onClose) == null || s.call(i), !0;
|
|
3138
3233
|
if (e.rollingSelectorOpen)
|
|
3139
|
-
return
|
|
3234
|
+
return zi(t, e);
|
|
3140
3235
|
if ((r === "ArrowLeft" || r === "ArrowRight") && (t.ctrlKey || t.metaKey)) {
|
|
3141
|
-
if (t.preventDefault(), r === "ArrowLeft" ?
|
|
3142
|
-
const c = Math.min(e.focusedDate.getDate(),
|
|
3236
|
+
if (t.preventDefault(), r === "ArrowLeft" ? Xt(e) : Qt(e), e.focusedDate) {
|
|
3237
|
+
const c = Math.min(e.focusedDate.getDate(), gt(e.viewYear, e.viewMonth));
|
|
3143
3238
|
e.focusedDate = new Date(e.viewYear, e.viewMonth, c);
|
|
3144
3239
|
}
|
|
3145
3240
|
return !0;
|
|
3146
3241
|
}
|
|
3147
3242
|
if (["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(r))
|
|
3148
|
-
return t.preventDefault(),
|
|
3243
|
+
return t.preventDefault(), Hi(e, r, o), !0;
|
|
3149
3244
|
if (r === "Enter")
|
|
3150
3245
|
return t.preventDefault(), e.focusedDate && ((n = i.onSelect) == null || n.call(i, e.focusedDate, "down")), !0;
|
|
3151
3246
|
if (r === "Tab")
|
|
@@ -3154,8 +3249,8 @@ function Ii(t, e, o, i) {
|
|
|
3154
3249
|
if (t.preventDefault(), t.ctrlKey || t.metaKey) {
|
|
3155
3250
|
let c = e.viewYear;
|
|
3156
3251
|
const l = new Date(c, 0, 1);
|
|
3157
|
-
if (e.focusedDate &&
|
|
3158
|
-
const g =
|
|
3252
|
+
if (e.focusedDate && yt(e.focusedDate, l) && c--, o.minDate) {
|
|
3253
|
+
const g = j(o.minDate);
|
|
3159
3254
|
g && c < g.getFullYear() && (c = g.getFullYear());
|
|
3160
3255
|
}
|
|
3161
3256
|
e.viewMonth = 0, e.viewYear = c, e.focusedDate = new Date(c, 0, 1);
|
|
@@ -3167,39 +3262,39 @@ function Ii(t, e, o, i) {
|
|
|
3167
3262
|
if (t.preventDefault(), t.ctrlKey || t.metaKey) {
|
|
3168
3263
|
let c = e.viewYear;
|
|
3169
3264
|
const l = new Date(c, 11, 31);
|
|
3170
|
-
if (e.focusedDate &&
|
|
3171
|
-
const g =
|
|
3265
|
+
if (e.focusedDate && yt(e.focusedDate, l) && c++, o.maxDate) {
|
|
3266
|
+
const g = j(o.maxDate);
|
|
3172
3267
|
g && c > g.getFullYear() && (c = g.getFullYear());
|
|
3173
3268
|
}
|
|
3174
3269
|
e.viewMonth = 11, e.viewYear = c, e.focusedDate = new Date(c, 11, 31);
|
|
3175
3270
|
} else {
|
|
3176
|
-
const c =
|
|
3271
|
+
const c = gt(e.viewYear, e.viewMonth);
|
|
3177
3272
|
e.focusedDate = new Date(e.viewYear, e.viewMonth, c);
|
|
3178
3273
|
}
|
|
3179
3274
|
return !0;
|
|
3180
3275
|
}
|
|
3181
3276
|
if (r === "PageUp") {
|
|
3182
|
-
if (t.preventDefault(),
|
|
3183
|
-
const c = Math.min(e.focusedDate.getDate(),
|
|
3277
|
+
if (t.preventDefault(), Xt(e), e.focusedDate) {
|
|
3278
|
+
const c = Math.min(e.focusedDate.getDate(), gt(e.viewYear, e.viewMonth));
|
|
3184
3279
|
e.focusedDate = new Date(e.viewYear, e.viewMonth, c);
|
|
3185
3280
|
}
|
|
3186
3281
|
return !0;
|
|
3187
3282
|
}
|
|
3188
3283
|
if (r === "PageDown") {
|
|
3189
|
-
if (t.preventDefault(),
|
|
3190
|
-
const c = Math.min(e.focusedDate.getDate(),
|
|
3284
|
+
if (t.preventDefault(), Qt(e), e.focusedDate) {
|
|
3285
|
+
const c = Math.min(e.focusedDate.getDate(), gt(e.viewYear, e.viewMonth));
|
|
3191
3286
|
e.focusedDate = new Date(e.viewYear, e.viewMonth, c);
|
|
3192
3287
|
}
|
|
3193
3288
|
return !0;
|
|
3194
3289
|
}
|
|
3195
3290
|
return !1;
|
|
3196
3291
|
}
|
|
3197
|
-
function
|
|
3292
|
+
function Hi(t, e, o) {
|
|
3198
3293
|
if (!t.focusedDate) {
|
|
3199
3294
|
t.focusedDate = t.selectedDate ? new Date(t.selectedDate) : new Date(t.viewYear, t.viewMonth, 1);
|
|
3200
3295
|
return;
|
|
3201
3296
|
}
|
|
3202
|
-
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;
|
|
3203
3298
|
switch (e) {
|
|
3204
3299
|
case "ArrowLeft":
|
|
3205
3300
|
i.setDate(i.getDate() - 1);
|
|
@@ -3216,7 +3311,7 @@ function Li(t, e, o) {
|
|
|
3216
3311
|
}
|
|
3217
3312
|
r && i < r || s && i > s || (t.focusedDate = i, (i.getMonth() !== t.viewMonth || i.getFullYear() !== t.viewYear) && (t.viewMonth = i.getMonth(), t.viewYear = i.getFullYear()));
|
|
3218
3313
|
}
|
|
3219
|
-
function
|
|
3314
|
+
function zi(t, e) {
|
|
3220
3315
|
const { key: o } = t;
|
|
3221
3316
|
if (o === "ArrowUp" || o === "ArrowDown") {
|
|
3222
3317
|
t.preventDefault();
|
|
@@ -3230,7 +3325,7 @@ function Pi(t, e) {
|
|
|
3230
3325
|
}
|
|
3231
3326
|
return o === "ArrowLeft" || o === "ArrowRight" ? (t.preventDefault(), e.rollingSelectorMode = e.rollingSelectorMode === "month" ? "year" : "month", !0) : o === "Enter" || o === "Escape" ? (t.preventDefault(), e.rollingSelectorOpen = !1, !0) : !1;
|
|
3232
3327
|
}
|
|
3233
|
-
function
|
|
3328
|
+
function Fi(t) {
|
|
3234
3329
|
if (t.selectedDate)
|
|
3235
3330
|
t.focusedDate = new Date(t.selectedDate), t.viewYear = t.selectedDate.getFullYear(), t.viewMonth = t.selectedDate.getMonth();
|
|
3236
3331
|
else {
|
|
@@ -3238,28 +3333,28 @@ function Hi(t) {
|
|
|
3238
3333
|
t.focusedDate = new Date(t.viewYear, t.viewMonth, e.getDate());
|
|
3239
3334
|
}
|
|
3240
3335
|
}
|
|
3241
|
-
function
|
|
3336
|
+
function Vi(t, e, o) {
|
|
3242
3337
|
const i = t.dataset.date;
|
|
3243
3338
|
if (!i || t.classList.contains("wg-datepicker__day--disabled"))
|
|
3244
3339
|
return null;
|
|
3245
|
-
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;
|
|
3246
3341
|
return a && d < a || c && d > c ? null : (e.selectedDate = d, e.focusedDate = d, d);
|
|
3247
3342
|
}
|
|
3248
|
-
function
|
|
3343
|
+
function qi(t, e) {
|
|
3249
3344
|
const o = /* @__PURE__ */ new Date();
|
|
3250
3345
|
o.setHours(0, 0, 0, 0);
|
|
3251
|
-
const i = e.minDate ?
|
|
3346
|
+
const i = e.minDate ? j(e.minDate) : null, r = e.maxDate ? j(e.maxDate) : null;
|
|
3252
3347
|
return i && o < i || r && o > r ? null : (t.selectedDate = o, t.focusedDate = o, t.viewYear = o.getFullYear(), t.viewMonth = o.getMonth(), o);
|
|
3253
3348
|
}
|
|
3254
|
-
function
|
|
3349
|
+
function Yi(t, e) {
|
|
3255
3350
|
const o = t.dataset.month;
|
|
3256
3351
|
o !== void 0 && (e.viewMonth = parseInt(o, 10));
|
|
3257
3352
|
}
|
|
3258
|
-
function
|
|
3353
|
+
function Ni(t, e) {
|
|
3259
3354
|
const o = t.dataset.year;
|
|
3260
3355
|
o !== void 0 && (e.viewYear = parseInt(o, 10));
|
|
3261
3356
|
}
|
|
3262
|
-
function
|
|
3357
|
+
function Gt(t, e) {
|
|
3263
3358
|
var g, h, u, p;
|
|
3264
3359
|
const { separator: o, parts: i, maxLength: r } = e, s = o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), n = t.replace(new RegExp(s, "g"), ""), d = ((g = i.year) == null ? void 0 : g.length) ?? 4, a = [
|
|
3265
3360
|
{ type: "year", pos: ((h = i.year) == null ? void 0 : h.index) ?? 0, length: d },
|
|
@@ -3274,8 +3369,8 @@ function Qt(t, e) {
|
|
|
3274
3369
|
}
|
|
3275
3370
|
return c.substring(0, r);
|
|
3276
3371
|
}
|
|
3277
|
-
function
|
|
3278
|
-
const i = t.value, r = t.selectionStart || 0, s = i.length < o.length, { separator: n } = e, d = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), a = i.replace(new RegExp(`[^0-9${d}]`, "g"), ""), c =
|
|
3372
|
+
function Ui(t, e, o) {
|
|
3373
|
+
const i = t.value, r = t.selectionStart || 0, s = i.length < o.length, { separator: n } = e, d = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), a = i.replace(new RegExp(`[^0-9${d}]`, "g"), ""), c = Gt(a, e);
|
|
3279
3374
|
if (c !== i) {
|
|
3280
3375
|
t.value = c;
|
|
3281
3376
|
let l = r;
|
|
@@ -3291,7 +3386,7 @@ function Yi(t, e, o) {
|
|
|
3291
3386
|
}
|
|
3292
3387
|
return c;
|
|
3293
3388
|
}
|
|
3294
|
-
function
|
|
3389
|
+
function ji(t, e) {
|
|
3295
3390
|
const { key: o, ctrlKey: i, metaKey: r } = t, { separator: s } = e;
|
|
3296
3391
|
if ([
|
|
3297
3392
|
"Backspace",
|
|
@@ -3326,23 +3421,23 @@ function Ni(t, e) {
|
|
|
3326
3421
|
}
|
|
3327
3422
|
return !/^\d$/.test(o) && o !== s ? (t.preventDefault(), !0) : !1;
|
|
3328
3423
|
}
|
|
3329
|
-
function
|
|
3424
|
+
function Bi(t, e, o) {
|
|
3330
3425
|
var u;
|
|
3331
3426
|
t.preventDefault();
|
|
3332
|
-
const i = ((u = t.clipboardData) == null ? void 0 : u.getData("text")) || "", { separator: r } = o, s = r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), n = i.replace(new RegExp(`[^0-9${s}]`, "g"), ""), d =
|
|
3333
|
-
e.value =
|
|
3427
|
+
const i = ((u = t.clipboardData) == null ? void 0 : u.getData("text")) || "", { separator: r } = o, s = r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), n = i.replace(new RegExp(`[^0-9${s}]`, "g"), ""), d = Gt(n, o), a = e.selectionStart || 0, c = e.selectionEnd || 0, l = e.value, g = l.substring(0, a) + d + l.substring(c);
|
|
3428
|
+
e.value = Gt(g, o);
|
|
3334
3429
|
const h = a + d.length;
|
|
3335
3430
|
e.setSelectionRange(h, h);
|
|
3336
3431
|
}
|
|
3337
|
-
function
|
|
3432
|
+
function Ki(t, e, o, i) {
|
|
3338
3433
|
if (!t || t.length < e.maxLength)
|
|
3339
3434
|
return !1;
|
|
3340
|
-
const r =
|
|
3435
|
+
const r = yi(t, e);
|
|
3341
3436
|
if (!r) return !1;
|
|
3342
|
-
const s = i.minDate ?
|
|
3437
|
+
const s = i.minDate ? j(i.minDate) : null, n = i.maxDate ? j(i.maxDate) : null;
|
|
3343
3438
|
return s && r < s || n && r > n ? !1 : (o.selectedDate = r, o.focusedDate = r, o.viewYear = r.getFullYear(), o.viewMonth = r.getMonth(), !0);
|
|
3344
3439
|
}
|
|
3345
|
-
const
|
|
3440
|
+
const Wi = `
|
|
3346
3441
|
.wg-datepicker-container {
|
|
3347
3442
|
position: fixed;
|
|
3348
3443
|
z-index: var(--wg-dp-z-index, 9999);
|
|
@@ -3593,8 +3688,8 @@ const Bi = `
|
|
|
3593
3688
|
background-color: color-mix(in srgb, var(--wg-dp-accent-color) 10%, transparent);
|
|
3594
3689
|
}
|
|
3595
3690
|
`;
|
|
3596
|
-
let
|
|
3597
|
-
class
|
|
3691
|
+
let Se = !1;
|
|
3692
|
+
class se {
|
|
3598
3693
|
constructor(e = {}) {
|
|
3599
3694
|
w(this, "options");
|
|
3600
3695
|
w(this, "state");
|
|
@@ -3621,7 +3716,7 @@ class re {
|
|
|
3621
3716
|
rollingSelectorOpen: !1,
|
|
3622
3717
|
rollingSelectorMode: "month",
|
|
3623
3718
|
focusedDate: null
|
|
3624
|
-
}, this.localeStrings = this.initLocaleStrings(e.locale), this.formatInfo =
|
|
3719
|
+
}, this.localeStrings = this.initLocaleStrings(e.locale), this.formatInfo = Kt(this.options.dateFormat || "YYYY-MM-DD"), this.boundHandleClickOutside = this.handleClickOutside.bind(this), this.boundHandleKeyDown = this.handleKeyDown.bind(this);
|
|
3625
3720
|
}
|
|
3626
3721
|
/**
|
|
3627
3722
|
* Initialize locale strings (use browser Intl API if available)
|
|
@@ -3651,30 +3746,30 @@ class re {
|
|
|
3651
3746
|
weekdayNamesShort: l
|
|
3652
3747
|
};
|
|
3653
3748
|
} catch {
|
|
3654
|
-
return
|
|
3749
|
+
return Fe;
|
|
3655
3750
|
}
|
|
3656
3751
|
}
|
|
3657
3752
|
/**
|
|
3658
3753
|
* Inject datepicker styles into document head (once)
|
|
3659
3754
|
*/
|
|
3660
3755
|
static injectStyles() {
|
|
3661
|
-
if (
|
|
3756
|
+
if (Se) return;
|
|
3662
3757
|
const e = document.createElement("style");
|
|
3663
|
-
e.id = "wg-datepicker-styles", e.textContent =
|
|
3758
|
+
e.id = "wg-datepicker-styles", e.textContent = Wi, document.head.appendChild(e), Se = !0;
|
|
3664
3759
|
}
|
|
3665
3760
|
/**
|
|
3666
3761
|
* Open the date picker
|
|
3667
3762
|
*/
|
|
3668
3763
|
open(e, o = null) {
|
|
3669
|
-
|
|
3670
|
-
const i =
|
|
3764
|
+
se.injectStyles(), this.state.isOpen && this.close(), this.anchor = e;
|
|
3765
|
+
const i = j(o);
|
|
3671
3766
|
if (i)
|
|
3672
3767
|
this.state.selectedDate = i, this.state.viewYear = i.getFullYear(), this.state.viewMonth = i.getMonth();
|
|
3673
3768
|
else {
|
|
3674
3769
|
const r = /* @__PURE__ */ new Date();
|
|
3675
3770
|
this.state.viewYear = r.getFullYear(), this.state.viewMonth = r.getMonth();
|
|
3676
3771
|
}
|
|
3677
|
-
|
|
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);
|
|
3678
3773
|
}
|
|
3679
3774
|
/**
|
|
3680
3775
|
* Close the date picker
|
|
@@ -3700,7 +3795,7 @@ class re {
|
|
|
3700
3795
|
* Get formatted value
|
|
3701
3796
|
*/
|
|
3702
3797
|
getFormattedValue() {
|
|
3703
|
-
return
|
|
3798
|
+
return Ve(this.state.selectedDate, this.formatInfo);
|
|
3704
3799
|
}
|
|
3705
3800
|
/**
|
|
3706
3801
|
* Position the picker using Floating UI
|
|
@@ -3708,13 +3803,13 @@ class re {
|
|
|
3708
3803
|
position() {
|
|
3709
3804
|
if (!this.element || !this.anchor) return;
|
|
3710
3805
|
const e = this.element.querySelector(".wg-datepicker");
|
|
3711
|
-
e && (this.cleanupAutoUpdate =
|
|
3712
|
-
|
|
3806
|
+
e && (this.cleanupAutoUpdate = Fo(this.anchor, e, () => {
|
|
3807
|
+
kt(this.anchor, e, {
|
|
3713
3808
|
placement: "bottom-start",
|
|
3714
3809
|
middleware: [
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3810
|
+
Lt(4),
|
|
3811
|
+
xt({ fallbackPlacements: ["top-start", "bottom-end", "top-end"] }),
|
|
3812
|
+
ne({ padding: 8 })
|
|
3718
3813
|
]
|
|
3719
3814
|
}).then(({ x: o, y: i }) => {
|
|
3720
3815
|
Object.assign(e.style, {
|
|
@@ -3739,38 +3834,38 @@ class re {
|
|
|
3739
3834
|
var d;
|
|
3740
3835
|
const o = e.target, i = (d = o.closest("[data-action]")) == null ? void 0 : d.getAttribute("data-action");
|
|
3741
3836
|
if (i === "prev-month") {
|
|
3742
|
-
e.preventDefault(),
|
|
3837
|
+
e.preventDefault(), Xt(this.state), this.render();
|
|
3743
3838
|
return;
|
|
3744
3839
|
}
|
|
3745
3840
|
if (i === "next-month") {
|
|
3746
|
-
e.preventDefault(),
|
|
3841
|
+
e.preventDefault(), Qt(this.state), this.render();
|
|
3747
3842
|
return;
|
|
3748
3843
|
}
|
|
3749
3844
|
if (i === "toggle-rolling") {
|
|
3750
|
-
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);
|
|
3751
3846
|
return;
|
|
3752
3847
|
}
|
|
3753
3848
|
if (i === "today") {
|
|
3754
3849
|
e.preventDefault();
|
|
3755
|
-
const a =
|
|
3850
|
+
const a = qi(this.state, this.options);
|
|
3756
3851
|
a && this.selectDate(a);
|
|
3757
3852
|
return;
|
|
3758
3853
|
}
|
|
3759
3854
|
const r = o.closest(".wg-datepicker__day");
|
|
3760
3855
|
if (r) {
|
|
3761
3856
|
e.preventDefault();
|
|
3762
|
-
const a =
|
|
3857
|
+
const a = Vi(r, this.state, this.options);
|
|
3763
3858
|
a && this.selectDate(a);
|
|
3764
3859
|
return;
|
|
3765
3860
|
}
|
|
3766
3861
|
const s = o.closest("[data-month]");
|
|
3767
3862
|
if (s && this.state.rollingSelectorOpen) {
|
|
3768
|
-
e.preventDefault(),
|
|
3863
|
+
e.preventDefault(), Yi(s, this.state), this.render();
|
|
3769
3864
|
return;
|
|
3770
3865
|
}
|
|
3771
3866
|
const n = o.closest("[data-year]");
|
|
3772
3867
|
if (n && this.state.rollingSelectorOpen) {
|
|
3773
|
-
e.preventDefault(),
|
|
3868
|
+
e.preventDefault(), Ni(n, this.state), this.render();
|
|
3774
3869
|
return;
|
|
3775
3870
|
}
|
|
3776
3871
|
}
|
|
@@ -3786,7 +3881,7 @@ class re {
|
|
|
3786
3881
|
* Handle keyboard events
|
|
3787
3882
|
*/
|
|
3788
3883
|
handleKeyDown(e) {
|
|
3789
|
-
|
|
3884
|
+
Li(e, this.state, this.options, {
|
|
3790
3885
|
onSelect: (i, r) => this.selectDate(i, r),
|
|
3791
3886
|
onClose: () => this.close()
|
|
3792
3887
|
}) && this.render();
|
|
@@ -3804,24 +3899,24 @@ class re {
|
|
|
3804
3899
|
render() {
|
|
3805
3900
|
if (!this.element) return;
|
|
3806
3901
|
const e = this.element.querySelector(".wg-datepicker");
|
|
3807
|
-
e && (
|
|
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));
|
|
3808
3903
|
}
|
|
3809
3904
|
/**
|
|
3810
3905
|
* Connect an input field for masked input
|
|
3811
3906
|
*/
|
|
3812
3907
|
connectInput(e) {
|
|
3813
3908
|
this.input = e, this.previousInputValue = e.value, e.addEventListener("input", () => {
|
|
3814
|
-
this.previousInputValue =
|
|
3909
|
+
this.previousInputValue = Ui(e, this.formatInfo, this.previousInputValue), Ki(e.value, this.formatInfo, this.state, this.options);
|
|
3815
3910
|
}), e.addEventListener("keydown", (o) => {
|
|
3816
|
-
|
|
3911
|
+
ji(o, this.formatInfo);
|
|
3817
3912
|
}), e.addEventListener("paste", (o) => {
|
|
3818
|
-
|
|
3913
|
+
Bi(o, e, this.formatInfo);
|
|
3819
3914
|
}), e.addEventListener("focus", () => {
|
|
3820
3915
|
!this.state.isOpen && this.anchor && this.open(this.anchor, e.value);
|
|
3821
3916
|
});
|
|
3822
3917
|
}
|
|
3823
3918
|
}
|
|
3824
|
-
const
|
|
3919
|
+
const Xi = `
|
|
3825
3920
|
.wg-context-menu-container {
|
|
3826
3921
|
position: fixed;
|
|
3827
3922
|
z-index: var(--wg-cm-z-index, 10000);
|
|
@@ -3910,13 +4005,13 @@ const Ki = `
|
|
|
3910
4005
|
margin: var(--wg-cm-padding) 0;
|
|
3911
4006
|
}
|
|
3912
4007
|
`;
|
|
3913
|
-
let
|
|
3914
|
-
function
|
|
3915
|
-
if (
|
|
4008
|
+
let xe = !1;
|
|
4009
|
+
function Qi() {
|
|
4010
|
+
if (xe) return;
|
|
3916
4011
|
const t = document.createElement("style");
|
|
3917
|
-
t.id = "wg-context-menu-styles", t.textContent =
|
|
4012
|
+
t.id = "wg-context-menu-styles", t.textContent = Xi, document.head.appendChild(t), xe = !0;
|
|
3918
4013
|
}
|
|
3919
|
-
function
|
|
4014
|
+
function Gi(t, e) {
|
|
3920
4015
|
const o = t.filter((r) => r.visible === void 0 ? !0 : typeof r.visible == "function" ? r.visible(e) : r.visible);
|
|
3921
4016
|
return o.length === 0 ? "" : `<div class="wg-context-menu">${o.map((r, s) => {
|
|
3922
4017
|
const n = typeof r.label == "function" ? r.label(e) : r.label, d = typeof r.icon == "function" ? r.icon(e) : r.icon, a = typeof r.disabled == "function" ? r.disabled(e) : r.disabled, c = r.danger === !0, l = [
|
|
@@ -3927,14 +4022,14 @@ function Xi(t, e) {
|
|
|
3927
4022
|
return `${g}<div class="${l}" data-item-id="${r.id}" data-disabled="${a ? "true" : "false"}">${h}<span class="wg-context-menu__label">${n}</span></div>`;
|
|
3928
4023
|
}).join("")}</div>`;
|
|
3929
4024
|
}
|
|
3930
|
-
function
|
|
3931
|
-
|
|
3932
|
-
const d =
|
|
4025
|
+
function Ji(t, e, o, i, r, s, n) {
|
|
4026
|
+
Qi();
|
|
4027
|
+
const d = Gi(i, r);
|
|
3933
4028
|
if (!d) return null;
|
|
3934
4029
|
const a = document.createElement("div");
|
|
3935
4030
|
a.className = "wg-context-menu-container", a.innerHTML = d, document.body.appendChild(a);
|
|
3936
4031
|
const c = a.querySelector(".wg-context-menu");
|
|
3937
|
-
|
|
4032
|
+
kt({
|
|
3938
4033
|
getBoundingClientRect: () => ({
|
|
3939
4034
|
width: 0,
|
|
3940
4035
|
height: 0,
|
|
@@ -3948,9 +4043,9 @@ function Qi(t, e, o, i, r, s, n) {
|
|
|
3948
4043
|
}, c, {
|
|
3949
4044
|
placement: "bottom-start",
|
|
3950
4045
|
middleware: [
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
4046
|
+
Lt(4),
|
|
4047
|
+
xt({ fallbackPlacements: ["top-start", "bottom-end", "top-end"] }),
|
|
4048
|
+
ne({ padding: 8 })
|
|
3954
4049
|
]
|
|
3955
4050
|
}).then(({ x: u, y: p }) => {
|
|
3956
4051
|
Object.assign(c.style, {
|
|
@@ -3965,20 +4060,20 @@ function Qi(t, e, o, i, r, s, n) {
|
|
|
3965
4060
|
}
|
|
3966
4061
|
});
|
|
3967
4062
|
const g = (u) => {
|
|
3968
|
-
a.contains(u.target) || (
|
|
4063
|
+
a.contains(u.target) || (vt(a, g, h), n());
|
|
3969
4064
|
}, h = (u) => {
|
|
3970
|
-
u.key === "Escape" && (u.preventDefault(),
|
|
4065
|
+
u.key === "Escape" && (u.preventDefault(), vt(a, g, h), n());
|
|
3971
4066
|
};
|
|
3972
4067
|
return setTimeout(() => {
|
|
3973
4068
|
document.addEventListener("mousedown", g), document.addEventListener("keydown", h);
|
|
3974
4069
|
}, 0), a._cleanup = { handleOutsideClick: g, handleKeyDown: h }, a;
|
|
3975
4070
|
}
|
|
3976
|
-
function
|
|
4071
|
+
function vt(t, e, o) {
|
|
3977
4072
|
e && document.removeEventListener("mousedown", e), o && document.removeEventListener("keydown", o);
|
|
3978
4073
|
const i = t._cleanup;
|
|
3979
4074
|
i && (i.handleOutsideClick && document.removeEventListener("mousedown", i.handleOutsideClick), i.handleKeyDown && document.removeEventListener("keydown", i.handleKeyDown)), t.remove();
|
|
3980
4075
|
}
|
|
3981
|
-
class
|
|
4076
|
+
class Zi extends HTMLElement {
|
|
3982
4077
|
constructor() {
|
|
3983
4078
|
super();
|
|
3984
4079
|
// Core grid logic (composition)
|
|
@@ -4055,7 +4150,7 @@ class Gi extends HTMLElement {
|
|
|
4055
4150
|
const a = String(s.field);
|
|
4056
4151
|
this.grid.commitEdit(i, a, d), this.render();
|
|
4057
4152
|
});
|
|
4058
|
-
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();
|
|
4059
4154
|
}
|
|
4060
4155
|
get tooltipShowDelay() {
|
|
4061
4156
|
return this._tooltipShowDelay;
|
|
@@ -4076,7 +4171,7 @@ class Gi extends HTMLElement {
|
|
|
4076
4171
|
this.render(), this.addEventListener("paste", this.handlePaste);
|
|
4077
4172
|
}
|
|
4078
4173
|
disconnectedCallback() {
|
|
4079
|
-
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();
|
|
4080
4175
|
}
|
|
4081
4176
|
// ==========================================================================
|
|
4082
4177
|
// Public API - Proxy to WebGrid
|
|
@@ -4147,6 +4242,12 @@ class Gi extends HTMLElement {
|
|
|
4147
4242
|
set editTrigger(o) {
|
|
4148
4243
|
this.grid.editTrigger = o;
|
|
4149
4244
|
}
|
|
4245
|
+
get editStartSelection() {
|
|
4246
|
+
return this.grid.editStartSelection;
|
|
4247
|
+
}
|
|
4248
|
+
set editStartSelection(o) {
|
|
4249
|
+
this.grid.editStartSelection = o;
|
|
4250
|
+
}
|
|
4150
4251
|
get mode() {
|
|
4151
4252
|
return this.grid.mode;
|
|
4152
4253
|
}
|
|
@@ -4219,6 +4320,12 @@ class Gi extends HTMLElement {
|
|
|
4219
4320
|
set toolbarTrigger(o) {
|
|
4220
4321
|
this.grid.toolbarTrigger = o;
|
|
4221
4322
|
}
|
|
4323
|
+
get toolbarPosition() {
|
|
4324
|
+
return this.grid.toolbarPosition;
|
|
4325
|
+
}
|
|
4326
|
+
set toolbarPosition(o) {
|
|
4327
|
+
this.grid.toolbarPosition = o;
|
|
4328
|
+
}
|
|
4222
4329
|
get contextMenu() {
|
|
4223
4330
|
return this.grid.contextMenu;
|
|
4224
4331
|
}
|
|
@@ -4251,6 +4358,12 @@ class Gi extends HTMLElement {
|
|
|
4251
4358
|
set onvalidationerror(o) {
|
|
4252
4359
|
this.grid.onvalidationerror = o;
|
|
4253
4360
|
}
|
|
4361
|
+
get validationTooltipCallback() {
|
|
4362
|
+
return this.grid.validationTooltipCallback;
|
|
4363
|
+
}
|
|
4364
|
+
set validationTooltipCallback(o) {
|
|
4365
|
+
this.grid.validationTooltipCallback = o;
|
|
4366
|
+
}
|
|
4254
4367
|
set ontoolbarclick(o) {
|
|
4255
4368
|
this.grid.ontoolbarclick = o;
|
|
4256
4369
|
}
|
|
@@ -4279,6 +4392,12 @@ class Gi extends HTMLElement {
|
|
|
4279
4392
|
set sort(o) {
|
|
4280
4393
|
this.grid.sort = o;
|
|
4281
4394
|
}
|
|
4395
|
+
get sortMode() {
|
|
4396
|
+
return this.grid.sortMode;
|
|
4397
|
+
}
|
|
4398
|
+
set sortMode(o) {
|
|
4399
|
+
this.grid.sortMode = o;
|
|
4400
|
+
}
|
|
4282
4401
|
get currentPage() {
|
|
4283
4402
|
return this.grid.currentPage;
|
|
4284
4403
|
}
|
|
@@ -4445,7 +4564,7 @@ class Gi extends HTMLElement {
|
|
|
4445
4564
|
}
|
|
4446
4565
|
// Delegate to module function - needed for lifecycle module
|
|
4447
4566
|
moveFocusAfterCommit(o, i, r) {
|
|
4448
|
-
|
|
4567
|
+
Ft(this, o, i, r);
|
|
4449
4568
|
}
|
|
4450
4569
|
// ==========================================================================
|
|
4451
4570
|
// Update Mechanism
|
|
@@ -4488,79 +4607,79 @@ class Gi extends HTMLElement {
|
|
|
4488
4607
|
}
|
|
4489
4608
|
switch (o.key) {
|
|
4490
4609
|
case "ArrowUp":
|
|
4491
|
-
o.preventDefault(), i > 0 &&
|
|
4610
|
+
o.preventDefault(), i > 0 && $(this, i - 1, r);
|
|
4492
4611
|
break;
|
|
4493
4612
|
case "ArrowDown":
|
|
4494
|
-
o.preventDefault(), i < n.length - 1 &&
|
|
4613
|
+
o.preventDefault(), i < n.length - 1 && $(this, i + 1, r);
|
|
4495
4614
|
break;
|
|
4496
4615
|
case "ArrowLeft":
|
|
4497
|
-
o.preventDefault(), r > 0 &&
|
|
4616
|
+
o.preventDefault(), r > 0 && $(this, i, r - 1);
|
|
4498
4617
|
break;
|
|
4499
4618
|
case "ArrowRight":
|
|
4500
|
-
o.preventDefault(), r < s.length - 1 &&
|
|
4619
|
+
o.preventDefault(), r < s.length - 1 && $(this, i, r + 1);
|
|
4501
4620
|
break;
|
|
4502
4621
|
case "Tab":
|
|
4503
4622
|
if (o.preventDefault(), o.shiftKey) {
|
|
4504
4623
|
if (a > 0) {
|
|
4505
4624
|
const l = d[a - 1].index;
|
|
4506
|
-
|
|
4625
|
+
$(this, i, l);
|
|
4507
4626
|
} else if (i > 0) {
|
|
4508
4627
|
const l = d[d.length - 1].index;
|
|
4509
|
-
|
|
4628
|
+
$(this, i - 1, l);
|
|
4510
4629
|
}
|
|
4511
4630
|
} else if (a >= 0 && a < d.length - 1) {
|
|
4512
4631
|
const l = d[a + 1].index;
|
|
4513
|
-
|
|
4632
|
+
$(this, i, l);
|
|
4514
4633
|
} else if (a === -1 && d.length > 0)
|
|
4515
|
-
|
|
4634
|
+
$(this, i, d[0].index);
|
|
4516
4635
|
else if (i < n.length - 1) {
|
|
4517
4636
|
const l = d[0].index;
|
|
4518
|
-
|
|
4637
|
+
$(this, i + 1, l);
|
|
4519
4638
|
}
|
|
4520
4639
|
break;
|
|
4521
4640
|
case "Home":
|
|
4522
4641
|
if (o.preventDefault(), o.ctrlKey)
|
|
4523
4642
|
if (this.grid.shouldUseVirtualScroll()) {
|
|
4524
4643
|
const l = this.grid.focusedCell;
|
|
4525
|
-
this.grid.setFocusedCell(0, 0),
|
|
4644
|
+
this.grid.setFocusedCell(0, 0), st(this, 0);
|
|
4526
4645
|
const g = this.shadow.querySelector('td[data-row="0"][data-col="0"]');
|
|
4527
|
-
g && (g.focus({ preventScroll: !0 }),
|
|
4646
|
+
g && (g.focus({ preventScroll: !0 }), K(this, l, { rowIndex: 0, colIndex: 0 }));
|
|
4528
4647
|
} else
|
|
4529
|
-
|
|
4648
|
+
$(this, 0, 0);
|
|
4530
4649
|
else
|
|
4531
|
-
|
|
4650
|
+
$(this, i, 0);
|
|
4532
4651
|
break;
|
|
4533
4652
|
case "End":
|
|
4534
4653
|
if (o.preventDefault(), o.ctrlKey) {
|
|
4535
4654
|
const l = n.length - 1, g = s.length - 1;
|
|
4536
4655
|
if (this.grid.shouldUseVirtualScroll()) {
|
|
4537
4656
|
const h = this.grid.focusedCell;
|
|
4538
|
-
this.grid.setFocusedCell(l, g),
|
|
4657
|
+
this.grid.setFocusedCell(l, g), st(this, l);
|
|
4539
4658
|
const u = this.shadow.querySelector(`td[data-row="${l}"][data-col="${g}"]`);
|
|
4540
|
-
u && (u.focus({ preventScroll: !0 }),
|
|
4659
|
+
u && (u.focus({ preventScroll: !0 }), K(this, h, { rowIndex: l, colIndex: g }));
|
|
4541
4660
|
} else
|
|
4542
|
-
|
|
4661
|
+
$(this, l, g);
|
|
4543
4662
|
} else
|
|
4544
|
-
|
|
4663
|
+
$(this, i, s.length - 1);
|
|
4545
4664
|
break;
|
|
4546
4665
|
case "PageUp":
|
|
4547
4666
|
if (o.preventDefault(), o.ctrlKey)
|
|
4548
4667
|
if (this.grid.shouldUseVirtualScroll()) {
|
|
4549
4668
|
const l = this.grid.focusedCell;
|
|
4550
|
-
this.grid.setFocusedCell(0, r),
|
|
4669
|
+
this.grid.setFocusedCell(0, r), st(this, 0);
|
|
4551
4670
|
const g = this.shadow.querySelector(`td[data-row="0"][data-col="${r}"]`);
|
|
4552
|
-
g && (g.focus({ preventScroll: !0 }),
|
|
4671
|
+
g && (g.focus({ preventScroll: !0 }), K(this, l, { rowIndex: 0, colIndex: r }));
|
|
4553
4672
|
} else
|
|
4554
|
-
|
|
4673
|
+
$(this, 0, r);
|
|
4555
4674
|
else {
|
|
4556
4675
|
const l = Math.max(0, i - 10);
|
|
4557
4676
|
if (this.grid.shouldUseVirtualScroll()) {
|
|
4558
4677
|
const g = this.grid.focusedCell;
|
|
4559
|
-
this.grid.setFocusedCell(l, r),
|
|
4678
|
+
this.grid.setFocusedCell(l, r), st(this, l);
|
|
4560
4679
|
const h = this.shadow.querySelector(`td[data-row="${l}"][data-col="${r}"]`);
|
|
4561
|
-
h && (h.focus({ preventScroll: !0 }),
|
|
4680
|
+
h && (h.focus({ preventScroll: !0 }), K(this, g, { rowIndex: l, colIndex: r }));
|
|
4562
4681
|
} else
|
|
4563
|
-
|
|
4682
|
+
$(this, l, r);
|
|
4564
4683
|
}
|
|
4565
4684
|
break;
|
|
4566
4685
|
case "PageDown":
|
|
@@ -4568,20 +4687,20 @@ class Gi extends HTMLElement {
|
|
|
4568
4687
|
const l = n.length - 1;
|
|
4569
4688
|
if (this.grid.shouldUseVirtualScroll()) {
|
|
4570
4689
|
const g = this.grid.focusedCell;
|
|
4571
|
-
this.grid.setFocusedCell(l, r),
|
|
4690
|
+
this.grid.setFocusedCell(l, r), st(this, l);
|
|
4572
4691
|
const h = this.shadow.querySelector(`td[data-row="${l}"][data-col="${r}"]`);
|
|
4573
|
-
h && (h.focus({ preventScroll: !0 }),
|
|
4692
|
+
h && (h.focus({ preventScroll: !0 }), K(this, g, { rowIndex: l, colIndex: r }));
|
|
4574
4693
|
} else
|
|
4575
|
-
|
|
4694
|
+
$(this, l, r);
|
|
4576
4695
|
} else {
|
|
4577
4696
|
const l = Math.min(n.length - 1, i + 10);
|
|
4578
4697
|
if (this.grid.shouldUseVirtualScroll()) {
|
|
4579
4698
|
const g = this.grid.focusedCell;
|
|
4580
|
-
this.grid.setFocusedCell(l, r),
|
|
4699
|
+
this.grid.setFocusedCell(l, r), st(this, l);
|
|
4581
4700
|
const h = this.shadow.querySelector(`td[data-row="${l}"][data-col="${r}"]`);
|
|
4582
|
-
h && (h.focus({ preventScroll: !0 }),
|
|
4701
|
+
h && (h.focus({ preventScroll: !0 }), K(this, g, { rowIndex: l, colIndex: r }));
|
|
4583
4702
|
} else
|
|
4584
|
-
|
|
4703
|
+
$(this, l, r);
|
|
4585
4704
|
}
|
|
4586
4705
|
break;
|
|
4587
4706
|
case "g":
|
|
@@ -4591,16 +4710,16 @@ class Gi extends HTMLElement {
|
|
|
4591
4710
|
case "Enter": {
|
|
4592
4711
|
o.preventDefault();
|
|
4593
4712
|
const l = s[r];
|
|
4594
|
-
((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) ? (
|
|
4595
|
-
this.dropdownOpen ||
|
|
4596
|
-
})) : 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);
|
|
4597
4716
|
break;
|
|
4598
4717
|
}
|
|
4599
4718
|
case "F2": {
|
|
4600
4719
|
o.preventDefault();
|
|
4601
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";
|
|
4602
|
-
|
|
4603
|
-
this.dropdownOpen ||
|
|
4721
|
+
B(this, i, r), g ? requestAnimationFrame(() => {
|
|
4722
|
+
this.dropdownOpen || W(this);
|
|
4604
4723
|
}) : h && requestAnimationFrame(() => {
|
|
4605
4724
|
this.openCustomEditor(i, r);
|
|
4606
4725
|
});
|
|
@@ -4609,25 +4728,25 @@ class Gi extends HTMLElement {
|
|
|
4609
4728
|
case " ": {
|
|
4610
4729
|
o.preventDefault();
|
|
4611
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";
|
|
4612
|
-
g ?
|
|
4613
|
-
this.dropdownOpen ||
|
|
4614
|
-
})) : u ? (
|
|
4731
|
+
g ? Zo(this, i, r) : h ? (B(this, i, r), requestAnimationFrame(() => {
|
|
4732
|
+
this.dropdownOpen || W(this);
|
|
4733
|
+
})) : u ? (B(this, i, r), requestAnimationFrame(() => {
|
|
4615
4734
|
var v;
|
|
4616
4735
|
const m = (v = this.shadowRoot) == null ? void 0 : v.querySelector(
|
|
4617
4736
|
`.wg__cell[data-row="${i}"][data-col="${r}"]`
|
|
4618
4737
|
), f = m == null ? void 0 : m.querySelector(".wg__date-input"), b = m == null ? void 0 : m.querySelector(".wg__editor--date");
|
|
4619
4738
|
f && b && this.openDatePicker(f, b);
|
|
4620
|
-
})) : p && (
|
|
4739
|
+
})) : p && (B(this, i, r), requestAnimationFrame(() => {
|
|
4621
4740
|
this.openCustomEditor(i, r);
|
|
4622
4741
|
}));
|
|
4623
4742
|
break;
|
|
4624
4743
|
}
|
|
4625
4744
|
case "Escape":
|
|
4626
4745
|
if (o.preventDefault(), this.grid.editingCell)
|
|
4627
|
-
|
|
4746
|
+
Y(this), this.grid.cancelEdit();
|
|
4628
4747
|
else {
|
|
4629
4748
|
const l = this.grid.focusedCell;
|
|
4630
|
-
this.grid.clearFocusedCell(),
|
|
4749
|
+
this.grid.clearFocusedCell(), K(this, l, null), (c = o.target) == null || c.blur();
|
|
4631
4750
|
}
|
|
4632
4751
|
break;
|
|
4633
4752
|
case "Delete": {
|
|
@@ -4652,7 +4771,7 @@ class Gi extends HTMLElement {
|
|
|
4652
4771
|
const l = s[r];
|
|
4653
4772
|
if ((l == null ? void 0 : l.editor) === "number" && !/[\d.\-]/.test(o.key))
|
|
4654
4773
|
return;
|
|
4655
|
-
|
|
4774
|
+
B(this, i, r, { initialSearchQuery: o.key }), o.preventDefault();
|
|
4656
4775
|
}
|
|
4657
4776
|
break;
|
|
4658
4777
|
}
|
|
@@ -4695,8 +4814,8 @@ class Gi extends HTMLElement {
|
|
|
4695
4814
|
o.ctrlKey ? (p = u.length - 1, m = this.grid.columns.length - 1) : m = this.grid.columns.length - 1, f = !0;
|
|
4696
4815
|
break;
|
|
4697
4816
|
}
|
|
4698
|
-
f && (
|
|
4699
|
-
|
|
4817
|
+
f && (Y(this), this.grid.cancelEdit(), queueMicrotask(() => {
|
|
4818
|
+
$(this, p, m);
|
|
4700
4819
|
}));
|
|
4701
4820
|
return;
|
|
4702
4821
|
}
|
|
@@ -4708,7 +4827,7 @@ class Gi extends HTMLElement {
|
|
|
4708
4827
|
let g = this.highlightedIndex + 1;
|
|
4709
4828
|
for (; g < this.dropdownOptions.length && mt(this.dropdownOptions[g], l); )
|
|
4710
4829
|
g++;
|
|
4711
|
-
g < this.dropdownOptions.length && (this.highlightedIndex = g, et(this),
|
|
4830
|
+
g < this.dropdownOptions.length && (this.highlightedIndex = g, et(this), fe(this));
|
|
4712
4831
|
}
|
|
4713
4832
|
break;
|
|
4714
4833
|
case "ArrowUp":
|
|
@@ -4718,13 +4837,13 @@ class Gi extends HTMLElement {
|
|
|
4718
4837
|
let g = this.highlightedIndex - 1;
|
|
4719
4838
|
for (; g >= 0 && mt(this.dropdownOptions[g], l); )
|
|
4720
4839
|
g--;
|
|
4721
|
-
g >= 0 && (this.highlightedIndex = g, et(this),
|
|
4840
|
+
g >= 0 && (this.highlightedIndex = g, et(this), fe(this));
|
|
4722
4841
|
}
|
|
4723
4842
|
break;
|
|
4724
4843
|
case "Enter":
|
|
4725
4844
|
if (this.datepicker)
|
|
4726
4845
|
return;
|
|
4727
|
-
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"));
|
|
4728
4847
|
break;
|
|
4729
4848
|
case "Tab":
|
|
4730
4849
|
if (this.datepicker)
|
|
@@ -4732,25 +4851,25 @@ class Gi extends HTMLElement {
|
|
|
4732
4851
|
if (o.preventDefault(), o.stopPropagation(), this.isCommittingFromKeyboard = !0, this.dropdownOpen && this.highlightedIndex >= 0 && a) {
|
|
4733
4852
|
const l = this.dropdownOptions[this.highlightedIndex], g = this.getCurrentEditorOptions();
|
|
4734
4853
|
if (l && !mt(l, g)) {
|
|
4735
|
-
const h =
|
|
4854
|
+
const h = at(l, g);
|
|
4736
4855
|
this.grid.commitEdit(r, s, h);
|
|
4737
4856
|
}
|
|
4738
|
-
|
|
4857
|
+
L(this);
|
|
4739
4858
|
} else
|
|
4740
|
-
|
|
4741
|
-
|
|
4859
|
+
L(this), d === "date" && i instanceof HTMLInputElement ? this.commitDateEditor(i) : a || Mt(this, i);
|
|
4860
|
+
Ft(this, r, s, o.shiftKey ? "prev" : "next");
|
|
4742
4861
|
break;
|
|
4743
4862
|
case "Escape":
|
|
4744
|
-
o.preventDefault(), o.stopPropagation(), this.dropdownOpen &&
|
|
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);
|
|
4745
4864
|
break;
|
|
4746
4865
|
case "F2":
|
|
4747
|
-
o.preventDefault(), o.stopPropagation(), a && !this.dropdownOpen &&
|
|
4866
|
+
o.preventDefault(), o.stopPropagation(), a && !this.dropdownOpen && W(this);
|
|
4748
4867
|
break;
|
|
4749
4868
|
case "Backspace":
|
|
4750
|
-
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 || {})));
|
|
4751
4870
|
break;
|
|
4752
4871
|
default:
|
|
4753
|
-
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 || {}));
|
|
4754
4873
|
break;
|
|
4755
4874
|
}
|
|
4756
4875
|
}
|
|
@@ -4765,11 +4884,11 @@ class Gi extends HTMLElement {
|
|
|
4765
4884
|
const n = s.target;
|
|
4766
4885
|
if (n.matches(".wg__cell")) {
|
|
4767
4886
|
const a = parseInt(n.dataset.row || "0", 10), c = parseInt(n.dataset.col || "0", 10);
|
|
4768
|
-
|
|
4887
|
+
Xo(this, a, c);
|
|
4769
4888
|
}
|
|
4770
4889
|
if (n.matches(".wg__select-trigger, .wg__combobox-input, .wg__autocomplete-input") && !this.justSelected && !this.dropdownOpen) {
|
|
4771
4890
|
const a = n.dataset.field || "", c = this.grid.columns.find((h) => h.field === a), l = (c == null ? void 0 : c.editorOptions) || {};
|
|
4772
|
-
(((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);
|
|
4773
4892
|
}
|
|
4774
4893
|
}, !0), o.addEventListener("keydown", (s) => {
|
|
4775
4894
|
const n = s.target;
|
|
@@ -4782,7 +4901,7 @@ class Gi extends HTMLElement {
|
|
|
4782
4901
|
this.handleCellKeyDown(s, d, a);
|
|
4783
4902
|
}
|
|
4784
4903
|
}), o.addEventListener("focusout", (s) => {
|
|
4785
|
-
|
|
4904
|
+
Qo(this, s);
|
|
4786
4905
|
}), o.addEventListener("dblclick", (s) => {
|
|
4787
4906
|
s.preventDefault();
|
|
4788
4907
|
const d = s.target.closest(".wg__cell");
|
|
@@ -4791,17 +4910,33 @@ class Gi extends HTMLElement {
|
|
|
4791
4910
|
if (l) {
|
|
4792
4911
|
const g = l.editTrigger || this.grid.editTrigger;
|
|
4793
4912
|
if (g === "dblclick" || g === "navigate") {
|
|
4794
|
-
const h =
|
|
4795
|
-
|
|
4913
|
+
const h = zt(s, d);
|
|
4914
|
+
B(this, a, c, { cursorPosition: h ?? void 0 });
|
|
4796
4915
|
const u = l.editor;
|
|
4797
4916
|
u === "select" || u === "combobox" || u === "autocomplete" ? requestAnimationFrame(() => {
|
|
4798
|
-
this.dropdownOpen ||
|
|
4917
|
+
this.dropdownOpen || W(this);
|
|
4799
4918
|
}) : u === "custom" && requestAnimationFrame(() => {
|
|
4800
4919
|
this.openCustomEditor(a, c);
|
|
4801
4920
|
});
|
|
4802
4921
|
}
|
|
4803
4922
|
}
|
|
4804
4923
|
}
|
|
4924
|
+
}), o.addEventListener("click", (s) => {
|
|
4925
|
+
const d = s.target.closest(".wg__cell");
|
|
4926
|
+
if (d && !d.classList.contains("wg__cell--editing")) {
|
|
4927
|
+
const a = parseInt(d.dataset.row || "0", 10), c = parseInt(d.dataset.col || "0", 10), l = this.grid.columns[c];
|
|
4928
|
+
if (l && (l.editTrigger || this.grid.editTrigger) === "click") {
|
|
4929
|
+
s.preventDefault();
|
|
4930
|
+
const h = zt(s, d);
|
|
4931
|
+
B(this, a, c, { cursorPosition: h ?? void 0 });
|
|
4932
|
+
const u = l.editor;
|
|
4933
|
+
u === "select" || u === "combobox" || u === "autocomplete" ? requestAnimationFrame(() => {
|
|
4934
|
+
this.dropdownOpen || W(this);
|
|
4935
|
+
}) : u === "custom" && requestAnimationFrame(() => {
|
|
4936
|
+
this.openCustomEditor(a, c);
|
|
4937
|
+
});
|
|
4938
|
+
}
|
|
4939
|
+
}
|
|
4805
4940
|
}), o.addEventListener("mousedown", (s) => {
|
|
4806
4941
|
const n = s.target;
|
|
4807
4942
|
if (n.closest(".wg__date-trigger")) {
|
|
@@ -4812,7 +4947,7 @@ class Gi extends HTMLElement {
|
|
|
4812
4947
|
l && this.openDatePicker(l, c);
|
|
4813
4948
|
} else if (a) {
|
|
4814
4949
|
const l = parseInt(a.dataset.row || "0", 10), g = a.dataset.field || "", h = this.grid.columns.findIndex((u) => String(u.field) === g);
|
|
4815
|
-
h >= 0 && (this.isTransitioningCells = !0, this.grid.editingCell && (
|
|
4950
|
+
h >= 0 && (this.isTransitioningCells = !0, this.grid.editingCell && (L(this), Y(this), this.grid.cancelEdit()), B(this, l, h), requestAnimationFrame(() => {
|
|
4816
4951
|
var f;
|
|
4817
4952
|
this.isTransitioningCells = !1;
|
|
4818
4953
|
const u = (f = this.shadowRoot) == null ? void 0 : f.querySelector(
|
|
@@ -4830,8 +4965,16 @@ class Gi extends HTMLElement {
|
|
|
4830
4965
|
if (g && !h) {
|
|
4831
4966
|
const u = this.grid.columns.findIndex((p) => String(p.field) === g.field);
|
|
4832
4967
|
if (c !== g.rowIndex || l !== u) {
|
|
4833
|
-
s.preventDefault(), this.isTransitioningCells = !0,
|
|
4834
|
-
|
|
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;
|
|
4970
|
+
requestAnimationFrame(() => {
|
|
4971
|
+
if (this.isTransitioningCells = !1, m === "click" && p && this.grid.isCellEditable(p)) {
|
|
4972
|
+
const v = this.shadow.querySelector(
|
|
4973
|
+
`td[data-row="${c}"][data-col="${l}"]`
|
|
4974
|
+
), _ = v ? zt({ clientX: b }, v) : void 0;
|
|
4975
|
+
B(this, c, l, { cursorPosition: _ ?? void 0 });
|
|
4976
|
+
} else
|
|
4977
|
+
$(this, c, l);
|
|
4835
4978
|
});
|
|
4836
4979
|
return;
|
|
4837
4980
|
}
|
|
@@ -4842,11 +4985,11 @@ class Gi extends HTMLElement {
|
|
|
4842
4985
|
s.preventDefault(), s.stopPropagation();
|
|
4843
4986
|
const a = n.closest(".wg__cell-dropdown-display");
|
|
4844
4987
|
if (n.closest(".wg__editor--select, .wg__editor--combobox, .wg__editor--autocomplete"))
|
|
4845
|
-
|
|
4988
|
+
me(this);
|
|
4846
4989
|
else if (a) {
|
|
4847
4990
|
const l = parseInt(a.dataset.row || "0", 10), g = a.dataset.field || "", h = this.grid.columns.findIndex((u) => String(u.field) === g);
|
|
4848
|
-
h >= 0 && (this.isTransitioningCells = !0, this.grid.editingCell && (
|
|
4849
|
-
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);
|
|
4850
4993
|
}));
|
|
4851
4994
|
}
|
|
4852
4995
|
}
|
|
@@ -4855,65 +4998,71 @@ class Gi extends HTMLElement {
|
|
|
4855
4998
|
const a = n.closest(".wg__cell-dropdown-display");
|
|
4856
4999
|
if (a) {
|
|
4857
5000
|
const c = parseInt(a.dataset.row || "0", 10), l = a.dataset.field || "", g = this.grid.columns.findIndex((h) => String(h.field) === l);
|
|
4858
|
-
g >= 0 && (this.isTransitioningCells = !0, this.grid.editingCell && (
|
|
4859
|
-
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);
|
|
4860
5003
|
}));
|
|
4861
5004
|
}
|
|
4862
5005
|
}
|
|
4863
5006
|
}), o.addEventListener("click", (s) => {
|
|
4864
|
-
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));
|
|
4865
5008
|
}), o.addEventListener("click", (s) => {
|
|
4866
5009
|
const n = s, a = n.target.closest(".wg__header--sortable");
|
|
4867
5010
|
if (a) {
|
|
4868
5011
|
const c = a.dataset.field;
|
|
4869
5012
|
if (!c) return;
|
|
4870
5013
|
const l = [...this.grid.sort], g = l.findIndex((u) => u.column === c);
|
|
4871
|
-
n.ctrlKey || n.metaKey ? g >= 0 ? l[g].direction === "asc" ? l[g] = { column: c, direction: "desc" } : l.splice(g, 1) : l.push({ column: c, direction: "asc" }) : g >= 0 && l.length === 1 ? l[0].direction === "asc" ? l[0] = { column: c, direction: "desc" } : l.length = 0 : (l.length = 0, l.push({ column: c, direction: "asc" })), this.grid.sort = l, this.grid.pageable && (this.grid.currentPage = 1), this.grid.fireDataRequest("sort"), this.render();
|
|
5014
|
+
(n.ctrlKey || n.metaKey) && this.grid.sortMode === "multi" ? g >= 0 ? l[g].direction === "asc" ? l[g] = { column: c, direction: "desc" } : l.splice(g, 1) : l.push({ column: c, direction: "asc" }) : g >= 0 && l.length === 1 ? l[0].direction === "asc" ? l[0] = { column: c, direction: "desc" } : l.length = 0 : (l.length = 0, l.push({ column: c, direction: "asc" })), this.grid.sort = l, this.grid.pageable && (this.grid.currentPage = 1), this.grid.fireDataRequest("sort"), this.render();
|
|
4872
5015
|
}
|
|
4873
5016
|
}), o.addEventListener("contextmenu", (s) => {
|
|
4874
5017
|
this.handleContextMenu(s);
|
|
4875
5018
|
}), o.addEventListener("change", (s) => {
|
|
4876
5019
|
const n = s.target;
|
|
4877
|
-
n.matches(".wg__editor--checkbox") &&
|
|
5020
|
+
n.matches(".wg__editor--checkbox") && Jo(this, n);
|
|
4878
5021
|
}), o.addEventListener("input", (s) => {
|
|
4879
5022
|
const n = s.target;
|
|
4880
|
-
n.matches(".wg__combobox-input") ?
|
|
5023
|
+
n.matches(".wg__combobox-input") ? Yo(this, s) : n.matches(".wg__autocomplete-input") && No(this, s);
|
|
4881
5024
|
}), o.addEventListener("blur", (s) => {
|
|
4882
5025
|
const n = s.target;
|
|
4883
|
-
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")) {
|
|
4884
5027
|
if (this.isCommittingFromKeyboard || this.isTransitioningCells)
|
|
4885
5028
|
return;
|
|
4886
|
-
if (
|
|
5029
|
+
if (L(this), this.grid.editingCell) {
|
|
4887
5030
|
const d = n, a = this.getCurrentEditingColumn();
|
|
4888
5031
|
if (a) {
|
|
4889
5032
|
const c = a.editorOptions || {}, g = (c.options || c.initialOptions || []).find(
|
|
4890
|
-
(h) =>
|
|
5033
|
+
(h) => Ct(h, c).toLowerCase() === d.value.toLowerCase()
|
|
4891
5034
|
);
|
|
4892
|
-
g ? this.grid.commitEdit(this.grid.editingCell.rowIndex, this.grid.editingCell.field,
|
|
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);
|
|
4893
5036
|
}
|
|
4894
5037
|
}
|
|
4895
5038
|
}
|
|
4896
5039
|
}, !0);
|
|
4897
5040
|
const i = this.shadow.querySelector(".wg");
|
|
4898
5041
|
i && i.addEventListener("scroll", () => {
|
|
4899
|
-
this.dropdownOpen && !this.isTransitioningCells && !this.isOpeningDropdown && (
|
|
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());
|
|
4900
5043
|
}), this.wheelListenerAdded || (this.wheelListenerAdded = !0, window.addEventListener("scroll", () => {
|
|
4901
|
-
this.dropdownOpen && !this.isTransitioningCells && (
|
|
5044
|
+
this.dropdownOpen && !this.isTransitioningCells && (L(this), Y(this), this.grid.cancelEdit());
|
|
4902
5045
|
}, { passive: !0, capture: !0 })), o.addEventListener("mouseenter", (s) => {
|
|
4903
|
-
const
|
|
5046
|
+
const n = s.target, d = n.closest("[data-tooltip-html]");
|
|
4904
5047
|
if (d) {
|
|
4905
|
-
const
|
|
4906
|
-
|
|
5048
|
+
const c = d.getAttribute("data-tooltip-html");
|
|
5049
|
+
ve(this, d, c, this._tooltipShowDelay, !0);
|
|
5050
|
+
return;
|
|
5051
|
+
}
|
|
5052
|
+
const a = n.closest("[data-tooltip]");
|
|
5053
|
+
if (a) {
|
|
5054
|
+
const c = a.getAttribute("data-tooltip");
|
|
5055
|
+
ve(this, a, c, this._tooltipShowDelay, !1);
|
|
4907
5056
|
}
|
|
4908
5057
|
}, !0), o.addEventListener("mouseleave", (s) => {
|
|
4909
|
-
const n = s, d = n.target, a = n.relatedTarget, c = d.closest("[data-tooltip]");
|
|
4910
|
-
c && (a == null ? void 0 : a.closest("[data-tooltip]")) === c || c &&
|
|
5058
|
+
const n = s, d = n.target, a = n.relatedTarget, c = d.closest("[data-tooltip], [data-tooltip-html]");
|
|
5059
|
+
c && (a == null ? void 0 : a.closest("[data-tooltip], [data-tooltip-html]")) === c || c && jo(this, this._tooltipHideDelay);
|
|
4911
5060
|
}, !0), o.addEventListener("click", (s) => {
|
|
4912
5061
|
const d = s.target.closest(".wg__toolbar-trigger");
|
|
4913
5062
|
if (d && this.grid.toolbarTrigger === "button") {
|
|
4914
5063
|
s.preventDefault(), s.stopPropagation();
|
|
4915
5064
|
const a = parseInt(d.dataset.toolbarTrigger || "0", 10), c = o.querySelector(`tr[data-row-index="${a}"]`);
|
|
4916
|
-
c && (
|
|
5065
|
+
c && (qt(a) ? (this.closeToolbarAndReset(), this.render()) : this.showToolbarForRow(c, a));
|
|
4917
5066
|
}
|
|
4918
5067
|
}), o.addEventListener("mouseenter", (s) => {
|
|
4919
5068
|
if (this.grid.toolbarTrigger !== "hover") return;
|
|
@@ -4921,7 +5070,7 @@ class Gi extends HTMLElement {
|
|
|
4921
5070
|
const n = s, a = n.target.closest(".wg__row");
|
|
4922
5071
|
if (a) {
|
|
4923
5072
|
const c = parseInt(a.dataset.rowIndex || "0", 10);
|
|
4924
|
-
|
|
5073
|
+
qt(c) || this.showToolbarForRow(a, c, n.clientX);
|
|
4925
5074
|
}
|
|
4926
5075
|
}, !0), o.addEventListener("mouseleave", (s) => {
|
|
4927
5076
|
if (this.grid.toolbarTrigger !== "hover") return;
|
|
@@ -4937,10 +5086,10 @@ class Gi extends HTMLElement {
|
|
|
4937
5086
|
const n = s, d = n.target, a = d.closest(".wg__row");
|
|
4938
5087
|
if (a && !d.closest(".wg__cell--editing")) {
|
|
4939
5088
|
const c = parseInt(a.dataset.rowIndex || "0", 10);
|
|
4940
|
-
|
|
5089
|
+
qt(c) ? (this.closeToolbarAndReset(), this.render()) : this.showToolbarForRow(a, c, n.clientX);
|
|
4941
5090
|
}
|
|
4942
5091
|
}), this.toolbarOutsideClickAdded || (this.toolbarOutsideClickAdded = !0, document.addEventListener("click", (s) => {
|
|
4943
|
-
if (!
|
|
5092
|
+
if (!wi(this.shadow))
|
|
4944
5093
|
return;
|
|
4945
5094
|
const n = s.composedPath(), d = n.some((l) => {
|
|
4946
5095
|
var g;
|
|
@@ -4949,9 +5098,9 @@ class Gi extends HTMLElement {
|
|
|
4949
5098
|
var g;
|
|
4950
5099
|
return (g = l.classList) == null ? void 0 : g.contains("wg__toolbar-trigger");
|
|
4951
5100
|
});
|
|
4952
|
-
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());
|
|
4953
5102
|
})), this.toolbarScrollListenerAdded || (this.toolbarScrollListenerAdded = !0, window.addEventListener("scroll", () => {
|
|
4954
|
-
|
|
5103
|
+
bt() !== null && (this.closeToolbarAndReset(), this.render());
|
|
4955
5104
|
}, !0)), this.shadow.querySelectorAll(".wg__pagination").forEach((s) => {
|
|
4956
5105
|
s.addEventListener("click", (d) => {
|
|
4957
5106
|
const c = d.target.closest(".wg__pagination-btn");
|
|
@@ -4998,12 +5147,12 @@ class Gi extends HTMLElement {
|
|
|
4998
5147
|
rowHeight: this.grid.virtualScrollRowHeight,
|
|
4999
5148
|
totalItems: r.length
|
|
5000
5149
|
}, n = this.grid.focusedCell;
|
|
5001
|
-
if (i.innerHTML =
|
|
5150
|
+
if (i.innerHTML = ye(this, s), n) {
|
|
5002
5151
|
this.grid.setFocusedCell(n.rowIndex, n.colIndex);
|
|
5003
5152
|
const d = i.querySelector(
|
|
5004
5153
|
`td[data-row="${n.rowIndex}"][data-col="${n.colIndex}"]`
|
|
5005
5154
|
);
|
|
5006
|
-
d && (d.focus({ preventScroll: !0 }),
|
|
5155
|
+
d && (d.focus({ preventScroll: !0 }), K(this, null, n));
|
|
5007
5156
|
}
|
|
5008
5157
|
}
|
|
5009
5158
|
/**
|
|
@@ -5021,43 +5170,43 @@ class Gi extends HTMLElement {
|
|
|
5021
5170
|
const o = this.shadow.querySelector(".wg"), i = (o == null ? void 0 : o.scrollTop) || 0, r = (o == null ? void 0 : o.scrollLeft) || 0, s = this.grid.focusedCell;
|
|
5022
5171
|
o && o.remove();
|
|
5023
5172
|
const n = document.createElement("div");
|
|
5024
|
-
n.className =
|
|
5173
|
+
n.className = bi(this);
|
|
5025
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) => {
|
|
5026
5175
|
const v = d.filter(
|
|
5027
5176
|
(x) => b ? x.startsWith("top-") : x.startsWith("bottom-")
|
|
5028
5177
|
), _ = a.filter(
|
|
5029
5178
|
(x) => b ? x.startsWith("top-") : x.startsWith("bottom-")
|
|
5030
|
-
),
|
|
5031
|
-
return !
|
|
5032
|
-
${
|
|
5033
|
-
${
|
|
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" : ""}">
|
|
5181
|
+
${Nt(this, _[0])}
|
|
5182
|
+
${Yt(this, v[0])}
|
|
5034
5183
|
</div>` : [.../* @__PURE__ */ new Set([...v, ..._])].map((x) => {
|
|
5035
|
-
const
|
|
5036
|
-
return T &&
|
|
5184
|
+
const C = v.includes(x), T = _.includes(x);
|
|
5185
|
+
return T && C ? `<div class="wg__footer${b ? " wg__footer--top" : ""}">
|
|
5186
|
+
${Nt(this, x)}
|
|
5037
5187
|
${Yt(this, x)}
|
|
5038
|
-
|
|
5039
|
-
</div>` : T ? Yt(this, x) : qt(this, x);
|
|
5188
|
+
</div>` : T ? Nt(this, x) : Yt(this, x);
|
|
5040
5189
|
}).join("");
|
|
5041
5190
|
}, l = c(d, !0), g = c(d, !1), h = this.grid.shouldUseVirtualScroll();
|
|
5042
5191
|
let u;
|
|
5043
5192
|
if (h) {
|
|
5044
|
-
const f = this.grid.displayItems, b = this.grid.virtualScrollRowHeight, v = this.grid.virtualScrollBuffer, _ = (o == null ? void 0 : o.clientHeight) || 400,
|
|
5045
|
-
this.virtualScrollStart =
|
|
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);
|
|
5194
|
+
this.virtualScrollStart = S, this.virtualScrollEnd = D;
|
|
5046
5195
|
const x = {
|
|
5047
|
-
startIndex:
|
|
5048
|
-
endIndex:
|
|
5196
|
+
startIndex: S,
|
|
5197
|
+
endIndex: D,
|
|
5049
5198
|
rowHeight: b,
|
|
5050
5199
|
totalItems: f.length
|
|
5051
5200
|
};
|
|
5052
|
-
u =
|
|
5201
|
+
u = ye(this, x);
|
|
5053
5202
|
} else
|
|
5054
|
-
u =
|
|
5203
|
+
u = _i(this);
|
|
5055
5204
|
h && n.classList.add("wg--virtual-scroll");
|
|
5056
5205
|
const p = `
|
|
5057
5206
|
${l}
|
|
5058
5207
|
<table class="wg__table">
|
|
5059
5208
|
<thead>
|
|
5060
|
-
${
|
|
5209
|
+
${vi(this)}
|
|
5061
5210
|
</thead>
|
|
5062
5211
|
<tbody>
|
|
5063
5212
|
${u}
|
|
@@ -5073,15 +5222,19 @@ class Gi extends HTMLElement {
|
|
|
5073
5222
|
if (n.scrollLeft = r, this.attachEventListeners(), this.grid.editingCell) {
|
|
5074
5223
|
let f = this.shadow.querySelector(".wg__combobox-input, .wg__autocomplete-input, .wg__select-trigger, .wg__date-input");
|
|
5075
5224
|
if (f || (f = this.shadow.querySelector(".wg__editor")), f && (f.focus(), f instanceof HTMLInputElement && f.type === "text")) {
|
|
5076
|
-
const b = this.grid.editingCell.cursorPosition, v = this.getCurrentEditingColumn(), _ = ((m = v == null ? void 0 : v.editorOptions) == null ? void 0 : m.editStartSelection) ||
|
|
5077
|
-
if (
|
|
5078
|
-
const
|
|
5079
|
-
f.setSelectionRange(
|
|
5080
|
-
} else if (this.grid.editingCell.initialSearchQuery !== void 0) {
|
|
5081
|
-
const C = f.value.length;
|
|
5082
|
-
f.setSelectionRange(C, C);
|
|
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;
|
|
5226
|
+
if (this.grid.editingCell.initialSearchQuery !== void 0) {
|
|
5227
|
+
const S = f.value.length;
|
|
5228
|
+
f.setSelectionRange(S, S);
|
|
5083
5229
|
} else
|
|
5084
5230
|
switch (_) {
|
|
5231
|
+
case "mousePosition":
|
|
5232
|
+
if (b !== void 0) {
|
|
5233
|
+
const S = Math.min(b, f.value.length);
|
|
5234
|
+
f.setSelectionRange(S, S);
|
|
5235
|
+
} else
|
|
5236
|
+
f.setSelectionRange(f.value.length, f.value.length);
|
|
5237
|
+
break;
|
|
5085
5238
|
case "cursorAtStart":
|
|
5086
5239
|
f.setSelectionRange(0, 0);
|
|
5087
5240
|
break;
|
|
@@ -5112,7 +5265,7 @@ class Gi extends HTMLElement {
|
|
|
5112
5265
|
renderConnector() {
|
|
5113
5266
|
const o = this.shadow.querySelector(".wg__connector");
|
|
5114
5267
|
o && o.remove();
|
|
5115
|
-
const i =
|
|
5268
|
+
const i = mi();
|
|
5116
5269
|
if (!i.path || !i.arrowPos)
|
|
5117
5270
|
return;
|
|
5118
5271
|
const r = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
@@ -5128,7 +5281,7 @@ class Gi extends HTMLElement {
|
|
|
5128
5281
|
openDatePicker(o, i) {
|
|
5129
5282
|
this.datepicker && (this.datepicker.close(!0), this.datepicker = null);
|
|
5130
5283
|
const r = o.dataset.dateFormat || "YYYY-MM-DD", s = o.dataset.minDate, n = o.dataset.maxDate, d = o.dataset.dateValue || "";
|
|
5131
|
-
this.datepicker = new
|
|
5284
|
+
this.datepicker = new se({
|
|
5132
5285
|
dateFormat: r,
|
|
5133
5286
|
minDate: s || void 0,
|
|
5134
5287
|
maxDate: n || void 0,
|
|
@@ -5136,7 +5289,7 @@ class Gi extends HTMLElement {
|
|
|
5136
5289
|
this.handleDatePickerSelect(o, a, c);
|
|
5137
5290
|
},
|
|
5138
5291
|
onClose: () => {
|
|
5139
|
-
this.datepicker = null,
|
|
5292
|
+
this.datepicker = null, Y(this), this.grid.cancelEdit();
|
|
5140
5293
|
}
|
|
5141
5294
|
}), this.datepicker.open(i, d || null);
|
|
5142
5295
|
}
|
|
@@ -5144,8 +5297,8 @@ class Gi extends HTMLElement {
|
|
|
5144
5297
|
* Handle date selection from the date picker
|
|
5145
5298
|
*/
|
|
5146
5299
|
handleDatePickerSelect(o, i, r) {
|
|
5147
|
-
const s = o.dataset.dateFormat || "YYYY-MM-DD", n =
|
|
5148
|
-
o.value =
|
|
5300
|
+
const s = o.dataset.dateFormat || "YYYY-MM-DD", n = Kt(s);
|
|
5301
|
+
o.value = Ve(i, n), o.dataset.dateValue = Wt(i), this.isCommittingFromKeyboard = !0, this.commitDateEditor(o);
|
|
5149
5302
|
const d = parseInt(o.dataset.row || "0", 10), a = o.dataset.field || "";
|
|
5150
5303
|
this.moveFocusAfterCommit(d, a, r || "down");
|
|
5151
5304
|
}
|
|
@@ -5154,7 +5307,7 @@ class Gi extends HTMLElement {
|
|
|
5154
5307
|
*/
|
|
5155
5308
|
commitDateEditor(o) {
|
|
5156
5309
|
if (!this.grid.editingCell) return;
|
|
5157
|
-
const i = parseInt(o.dataset.row || "0", 10), r = o.dataset.field || "", s = o.dataset.outputFormat || "iso", n = o.dataset.dateFormat || "YYYY-MM-DD", d =
|
|
5310
|
+
const i = parseInt(o.dataset.row || "0", 10), r = o.dataset.field || "", s = o.dataset.outputFormat || "iso", n = o.dataset.dateFormat || "YYYY-MM-DD", d = Kt(n), a = o.value ? this.parseDateInput(o.value, d) : null;
|
|
5158
5311
|
let c = null;
|
|
5159
5312
|
if (a)
|
|
5160
5313
|
switch (s) {
|
|
@@ -5166,7 +5319,7 @@ class Gi extends HTMLElement {
|
|
|
5166
5319
|
break;
|
|
5167
5320
|
case "iso":
|
|
5168
5321
|
default:
|
|
5169
|
-
c =
|
|
5322
|
+
c = Wt(a);
|
|
5170
5323
|
break;
|
|
5171
5324
|
}
|
|
5172
5325
|
this.grid.commitEdit(i, r, c);
|
|
@@ -5215,7 +5368,7 @@ class Gi extends HTMLElement {
|
|
|
5215
5368
|
a();
|
|
5216
5369
|
const g = l - 1, h = this.grid.focusedCell;
|
|
5217
5370
|
if (this.grid.setFocusedCell(g, o), this.grid.shouldUseVirtualScroll())
|
|
5218
|
-
|
|
5371
|
+
st(this, g), requestAnimationFrame(() => {
|
|
5219
5372
|
requestAnimationFrame(() => {
|
|
5220
5373
|
const u = this.shadow.querySelector(
|
|
5221
5374
|
`td[data-row="${g}"][data-col="${o}"]`
|
|
@@ -5227,7 +5380,7 @@ class Gi extends HTMLElement {
|
|
|
5227
5380
|
const u = this.shadow.querySelector(
|
|
5228
5381
|
`td[data-row="${g}"][data-col="${o}"]`
|
|
5229
5382
|
);
|
|
5230
|
-
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 }));
|
|
5231
5384
|
}
|
|
5232
5385
|
};
|
|
5233
5386
|
n.addEventListener("click", c), d.addEventListener("click", a), r.addEventListener("click", (l) => {
|
|
@@ -5251,13 +5404,13 @@ class Gi extends HTMLElement {
|
|
|
5251
5404
|
rowIndex: o,
|
|
5252
5405
|
field: s,
|
|
5253
5406
|
commit: (c) => {
|
|
5254
|
-
this.grid.commitEdit(o, s, c),
|
|
5255
|
-
|
|
5407
|
+
this.grid.commitEdit(o, s, c), Y(this), requestAnimationFrame(() => {
|
|
5408
|
+
$(this, o, i);
|
|
5256
5409
|
});
|
|
5257
5410
|
},
|
|
5258
5411
|
cancel: () => {
|
|
5259
|
-
|
|
5260
|
-
|
|
5412
|
+
Y(this), this.grid.cancelEdit(), requestAnimationFrame(() => {
|
|
5413
|
+
$(this, o, i);
|
|
5261
5414
|
});
|
|
5262
5415
|
}
|
|
5263
5416
|
};
|
|
@@ -5273,7 +5426,7 @@ class Gi extends HTMLElement {
|
|
|
5273
5426
|
const s = o.target.closest(".wg__cell");
|
|
5274
5427
|
if (!s)
|
|
5275
5428
|
return;
|
|
5276
|
-
o.preventDefault(), this.contextMenuElement && (
|
|
5429
|
+
o.preventDefault(), this.contextMenuElement && (vt(this.contextMenuElement), this.contextMenuElement = null);
|
|
5277
5430
|
const n = parseInt(s.dataset.row || "0", 10), d = parseInt(s.dataset.col || "0", 10), a = this.grid.columns[d];
|
|
5278
5431
|
if (!a) return;
|
|
5279
5432
|
const c = this.grid.displayItems[n];
|
|
@@ -5285,7 +5438,7 @@ class Gi extends HTMLElement {
|
|
|
5285
5438
|
column: a,
|
|
5286
5439
|
cellValue: g
|
|
5287
5440
|
};
|
|
5288
|
-
this.grid.oncontextmenuopen && this.grid.oncontextmenuopen(h), this.contextMenuElement =
|
|
5441
|
+
this.grid.oncontextmenuopen && this.grid.oncontextmenuopen(h), this.contextMenuElement = Ji(
|
|
5289
5442
|
this,
|
|
5290
5443
|
o.clientX,
|
|
5291
5444
|
o.clientY,
|
|
@@ -5293,7 +5446,7 @@ class Gi extends HTMLElement {
|
|
|
5293
5446
|
h,
|
|
5294
5447
|
(u) => {
|
|
5295
5448
|
const p = i.find((m) => m.id === u);
|
|
5296
|
-
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);
|
|
5297
5450
|
},
|
|
5298
5451
|
() => {
|
|
5299
5452
|
this.contextMenuElement = null;
|
|
@@ -5306,10 +5459,10 @@ class Gi extends HTMLElement {
|
|
|
5306
5459
|
showToolbarForRow(o, i, r) {
|
|
5307
5460
|
if (!this.grid.showRowToolbar || !this.grid.rowToolbar.length)
|
|
5308
5461
|
return;
|
|
5309
|
-
const s =
|
|
5462
|
+
const s = ui(this.grid.rowToolbar), n = this.grid.displayItems[i];
|
|
5310
5463
|
if (!n)
|
|
5311
5464
|
return;
|
|
5312
|
-
if (this.toolbarHideTimeout && (clearTimeout(this.toolbarHideTimeout), this.toolbarHideTimeout = null),
|
|
5465
|
+
if (this.toolbarHideTimeout && (clearTimeout(this.toolbarHideTimeout), this.toolbarHideTimeout = null), fi(
|
|
5313
5466
|
this,
|
|
5314
5467
|
o,
|
|
5315
5468
|
i,
|
|
@@ -5339,7 +5492,7 @@ class Gi extends HTMLElement {
|
|
|
5339
5492
|
* Close toolbar and reset move flag
|
|
5340
5493
|
*/
|
|
5341
5494
|
closeToolbarAndReset() {
|
|
5342
|
-
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();
|
|
5343
5496
|
}
|
|
5344
5497
|
/**
|
|
5345
5498
|
* Handle toolbar item click
|
|
@@ -5359,12 +5512,12 @@ class Gi extends HTMLElement {
|
|
|
5359
5512
|
this.closeToolbarAndReset(), this.render();
|
|
5360
5513
|
return;
|
|
5361
5514
|
}
|
|
5362
|
-
n ? (this.render(),
|
|
5515
|
+
n ? (this.render(), _e(this, this.grid.displayItems), this.renderConnector()) : this.render();
|
|
5363
5516
|
}
|
|
5364
5517
|
}
|
|
5365
|
-
typeof customElements < "u" && !customElements.get("web-grid") && customElements.define("web-grid",
|
|
5518
|
+
typeof customElements < "u" && !customElements.get("web-grid") && customElements.define("web-grid", Zi);
|
|
5366
5519
|
export {
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
|
|
5520
|
+
Zi as GridElement,
|
|
5521
|
+
je as WebGrid,
|
|
5522
|
+
Zi as default
|
|
5370
5523
|
};
|