@aquera/nile-elements 1.7.7 → 1.7.9
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 +6 -0
- package/demo/nxtgen-classes.css +5705 -0
- package/demo/nxtgen-properties.css +5236 -0
- package/demo/nxtgen-utilities.css +10953 -0
- package/demo/utilities.css +662 -0
- package/dist/index-644974d4.esm.js +1 -0
- package/dist/index-dd2af8ec.cjs.js +2 -0
- package/dist/index-dd2af8ec.cjs.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +500 -336
- package/dist/nile-combobox/index.cjs.js +1 -1
- package/dist/nile-combobox/index.esm.js +1 -1
- package/dist/nile-combobox/nile-combobox.cjs.js +1 -1
- package/dist/nile-combobox/nile-combobox.esm.js +1 -1
- package/dist/nile-detail/index.cjs.js +1 -1
- package/dist/nile-detail/index.esm.js +1 -1
- package/dist/nile-detail/nile-detail.cjs.js +1 -1
- package/dist/nile-detail/nile-detail.cjs.js.map +1 -1
- package/dist/nile-detail/nile-detail.css.cjs.js +1 -1
- package/dist/nile-detail/nile-detail.css.cjs.js.map +1 -1
- package/dist/nile-detail/nile-detail.css.esm.js +17 -0
- package/dist/nile-detail/nile-detail.esm.js +3 -3
- package/dist/nile-status-light/index.cjs.js +2 -0
- package/dist/nile-status-light/index.cjs.js.map +1 -0
- package/dist/nile-status-light/index.esm.js +1 -0
- package/dist/nile-status-light/nile-status-light.cjs.js +2 -0
- package/dist/nile-status-light/nile-status-light.cjs.js.map +1 -0
- package/dist/nile-status-light/nile-status-light.css.cjs.js +2 -0
- package/dist/nile-status-light/nile-status-light.css.cjs.js.map +1 -0
- package/dist/nile-status-light/nile-status-light.css.esm.js +136 -0
- package/dist/nile-status-light/nile-status-light.esm.js +13 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/nile-detail/nile-detail.css.js +17 -0
- package/dist/src/nile-detail/nile-detail.css.js.map +1 -1
- package/dist/src/nile-detail/nile-detail.d.ts +5 -1
- package/dist/src/nile-detail/nile-detail.js +14 -5
- package/dist/src/nile-detail/nile-detail.js.map +1 -1
- package/dist/src/nile-status-light/index.d.ts +1 -0
- package/dist/src/nile-status-light/index.js +2 -0
- package/dist/src/nile-status-light/index.js.map +1 -0
- package/dist/src/nile-status-light/nile-status-light.css.d.ts +9 -0
- package/dist/src/nile-status-light/nile-status-light.css.js +145 -0
- package/dist/src/nile-status-light/nile-status-light.css.js.map +1 -0
- package/dist/src/nile-status-light/nile-status-light.d.ts +53 -0
- package/dist/src/nile-status-light/nile-status-light.js +108 -0
- package/dist/src/nile-status-light/nile-status-light.js.map +1 -0
- package/dist/src/version.js +2 -2
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
- package/src/index.ts +1 -0
- package/src/nile-detail/nile-detail.css.ts +17 -0
- package/src/nile-detail/nile-detail.ts +17 -6
- package/src/nile-status-light/index.ts +1 -0
- package/src/nile-status-light/nile-status-light.css.ts +146 -0
- package/src/nile-status-light/nile-status-light.ts +111 -0
- package/vscode-html-custom-data.json +65 -1
- package/dist/index-199b0eac.esm.js +0 -1
- package/dist/index-f5e587e2.cjs.js +0 -2
- package/dist/index-f5e587e2.cjs.js.map +0 -1
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Webcomponent nile-elements following open-wc recommendations",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "nile-elements",
|
|
6
|
-
"version": "1.7.
|
|
6
|
+
"version": "1.7.9",
|
|
7
7
|
"main": "dist/src/index.js",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"module": "dist/src/index.js",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"./nile-sidebar": "./dist/src/nile-sidebar/index.js",
|
|
18
18
|
"./nile-menu": "./dist/src/nile-menu/index.js",
|
|
19
19
|
"./nile-badge": "./dist/src/nile-badge/index.js",
|
|
20
|
+
"./nile-status-light": "./dist/src/nile-status-light/index.js",
|
|
20
21
|
"./nile-drawer": "./dist/src/nile-drawer/index.js",
|
|
21
22
|
"./nile-checkbox": "./dist/src/nile-checkbox/index.js",
|
|
22
23
|
"./nile-checkbox-group": "./dist/src/nile-checkbox-group/index.js",
|
package/src/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { NileInput } from './nile-input';
|
|
|
5
5
|
export { NileOtpInput } from './nile-otp-input';
|
|
6
6
|
export { NileMenu } from './nile-menu';
|
|
7
7
|
export { NileBadge } from './nile-badge';
|
|
8
|
+
export { NileStatusLight } from './nile-status-light';
|
|
8
9
|
export { NileDrawer } from './nile-drawer';
|
|
9
10
|
export { NileCheckbox } from './nile-checkbox';
|
|
10
11
|
export { NileCheckboxGroup } from './nile-checkbox-group';
|
|
@@ -401,6 +401,23 @@ export const styles = css`
|
|
|
401
401
|
background: rgba(0, 0, 0, 0.2);
|
|
402
402
|
border-radius: 4px;
|
|
403
403
|
}
|
|
404
|
+
|
|
405
|
+
/* ── Light variant ──────────────────────────────────────────────────────── */
|
|
406
|
+
|
|
407
|
+
.detail--light .detail__header {
|
|
408
|
+
background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));
|
|
409
|
+
padding: var(--nile-spacing-xl, var(--ng-spacing-xl))
|
|
410
|
+
var(--nile-spacing-3xl, var(--ng-spacing-3xl));
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.detail--light.detail--open .detail__header {
|
|
414
|
+
border-bottom: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
.detail--light .detail__content,
|
|
418
|
+
.detail--light .detail__selection-content {
|
|
419
|
+
padding: var(--nile-spacing-3xl, var(--ng-spacing-3xl));
|
|
420
|
+
}
|
|
404
421
|
`;
|
|
405
422
|
|
|
406
423
|
export default [styles];
|
|
@@ -21,7 +21,7 @@ import '../nile-lite-tooltip/index';
|
|
|
21
21
|
import { VirtualizerController } from '@tanstack/lit-virtual';
|
|
22
22
|
import type { CSSResultGroup } from 'lit';
|
|
23
23
|
|
|
24
|
-
export type NileDetailVariant = 'default' | 'selection';
|
|
24
|
+
export type NileDetailVariant = 'default' | 'selection' | 'light' | 'select-light';
|
|
25
25
|
|
|
26
26
|
export interface NileDetailSelectionItem {
|
|
27
27
|
value: string;
|
|
@@ -208,9 +208,19 @@ export class NileDetail extends NileElement {
|
|
|
208
208
|
|
|
209
209
|
private _pendingPages: any = new Set();
|
|
210
210
|
|
|
211
|
+
/** True for any variant that renders the selection UI/behavior. */
|
|
212
|
+
private get _isSelectionVariant(): boolean {
|
|
213
|
+
return this.variant === 'selection' || this.variant === 'select-light';
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/** True for any variant that applies the light styling. */
|
|
217
|
+
private get _isLightVariant(): boolean {
|
|
218
|
+
return this.variant === 'light' || this.variant === 'select-light';
|
|
219
|
+
}
|
|
220
|
+
|
|
211
221
|
private get _isInfiniteMode(): boolean {
|
|
212
222
|
return (
|
|
213
|
-
this.
|
|
223
|
+
this._isSelectionVariant &&
|
|
214
224
|
typeof this.fetchPage === 'function' &&
|
|
215
225
|
typeof this.totalCount === 'number' &&
|
|
216
226
|
this.orientation !== 'both'
|
|
@@ -288,7 +298,7 @@ export class NileDetail extends NileElement {
|
|
|
288
298
|
private get _isVirtualized(): boolean {
|
|
289
299
|
if (!IS_BROWSER) return false;
|
|
290
300
|
if (this._isInfiniteMode) return true;
|
|
291
|
-
return this.
|
|
301
|
+
return this._isSelectionVariant
|
|
292
302
|
&& (this.virtualize || this.items.length > this.virtualizeThreshold);
|
|
293
303
|
}
|
|
294
304
|
|
|
@@ -315,7 +325,7 @@ export class NileDetail extends NileElement {
|
|
|
315
325
|
}
|
|
316
326
|
|
|
317
327
|
updated(_changed: Map<string, unknown>) {
|
|
318
|
-
if (this.
|
|
328
|
+
if (this._isSelectionVariant) {
|
|
319
329
|
this._setupGridResizeObserver();
|
|
320
330
|
this._syncVirtualizer();
|
|
321
331
|
this._scheduleTooltipOverflowCheck();
|
|
@@ -437,7 +447,7 @@ export class NileDetail extends NileElement {
|
|
|
437
447
|
}
|
|
438
448
|
|
|
439
449
|
private _setupGridResizeObserver() {
|
|
440
|
-
if (this.
|
|
450
|
+
if (!this._isSelectionVariant) return;
|
|
441
451
|
if (typeof ResizeObserver === 'undefined') return;
|
|
442
452
|
const grid = this.shadowRoot?.querySelector('.detail__selection-grid') as HTMLElement | null;
|
|
443
453
|
if (!grid) return;
|
|
@@ -996,7 +1006,7 @@ export class NileDetail extends NileElement {
|
|
|
996
1006
|
}
|
|
997
1007
|
|
|
998
1008
|
render(): TemplateResult {
|
|
999
|
-
const isSelection = this.
|
|
1009
|
+
const isSelection = this._isSelectionVariant;
|
|
1000
1010
|
return html`
|
|
1001
1011
|
<details
|
|
1002
1012
|
part="base"
|
|
@@ -1006,6 +1016,7 @@ export class NileDetail extends NileElement {
|
|
|
1006
1016
|
'detail--open': this.open,
|
|
1007
1017
|
'detail--disabled': this.disabled,
|
|
1008
1018
|
'detail--selection': isSelection,
|
|
1019
|
+
'detail--light': this._isLightVariant,
|
|
1009
1020
|
})}
|
|
1010
1021
|
>
|
|
1011
1022
|
<summary
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NileStatusLight } from './nile-status-light';
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Aquera Inc 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { css } from 'lit';
|
|
9
|
+
export const styles = css`
|
|
10
|
+
:host {
|
|
11
|
+
-webkit-font-smoothing: var(
|
|
12
|
+
--nile-webkit-font-smoothing,
|
|
13
|
+
var(--ng-webkit-font-smoothing)
|
|
14
|
+
);
|
|
15
|
+
-moz-osx-font-smoothing: var(
|
|
16
|
+
--nile-moz-osx-font-smoothing,
|
|
17
|
+
var(--ng-moz-osx-font-smoothing)
|
|
18
|
+
);
|
|
19
|
+
text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));
|
|
20
|
+
display: inline-block;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.status-light {
|
|
24
|
+
display: inline-flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
gap: var(--nile-spacing-sm, var(--ng-spacing-2));
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.status-light__dot {
|
|
31
|
+
position: relative;
|
|
32
|
+
flex: none;
|
|
33
|
+
border-radius: var(--nile-radius-full, var(--ng-radius-full));
|
|
34
|
+
width: var(--nile-height-10px, var(--ng-height-10px));
|
|
35
|
+
height: var(--nile-height-10px, var(--ng-height-10px));
|
|
36
|
+
background: var(--nile-colors-gray-light-mode-500, var(--ng-componentcolors-utility-gray-500));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.status-light__label {
|
|
40
|
+
font-family: var(--nile-font-family-serif, var(--ng-font-family-body));
|
|
41
|
+
font-size: var(--nile-type-scale-2, var(--ng-font-size-text-sm));
|
|
42
|
+
font-style: normal;
|
|
43
|
+
font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-medium));
|
|
44
|
+
line-height: var(--nile-type-scale-5, var(--ng-line-height-text-sm));
|
|
45
|
+
letter-spacing: 0.2px;
|
|
46
|
+
color: var(--nile-colors-dark-900, var(--ng-componentcolors-utility-gray-900));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* #region Sizes */
|
|
50
|
+
|
|
51
|
+
.status-light--small .status-light__dot {
|
|
52
|
+
width: var(--nile-height-8px, var(--ng-height-8px));
|
|
53
|
+
height: var(--nile-height-8px, var(--ng-height-8px));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.status-light--medium .status-light__dot {
|
|
57
|
+
width: var(--nile-height-10px, var(--ng-height-10px));
|
|
58
|
+
height: var(--nile-height-10px, var(--ng-height-10px));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.status-light--large .status-light__dot {
|
|
62
|
+
width: var(--nile-height-12px, var(--ng-height-12px));
|
|
63
|
+
height: var(--nile-height-12px, var(--ng-height-12px));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.status-light--x-large .status-light__dot {
|
|
67
|
+
width: var(--nile-height-14px, var(--ng-height-14px));
|
|
68
|
+
height: var(--nile-height-14px, var(--ng-height-14px));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.status-light--large .status-light__label,
|
|
72
|
+
.status-light--x-large .status-light__label {
|
|
73
|
+
font-size: var(--nile-type-scale-3, var(--ng-font-size-text-md));
|
|
74
|
+
line-height: var(--nile-type-scale-6, var(--ng-line-height-text-md));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
.status-light--positive .status-light__dot {
|
|
80
|
+
background: var(--nile-colors-green-500, var(--ng-componentcolors-utility-success-500));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.status-light--negative .status-light__dot {
|
|
84
|
+
background: var(--nile-colors-red-500, var(--ng-componentcolors-utility-error-500));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.status-light--notice .status-light__dot {
|
|
88
|
+
background: var(--nile-colors-yellow-500, var(--ng-componentcolors-utility-warning-500));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.status-light--informative .status-light__dot {
|
|
92
|
+
background: var(--nile-colors-blue-500, var(--ng-componentcolors-utility-blue-light-500));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.status-light--neutral .status-light__dot {
|
|
96
|
+
background: var(--nile-colors-gray-light-mode-500, var(--ng-componentcolors-utility-gray-500));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.status-light--inactive .status-light__dot {
|
|
100
|
+
background: var(--nile-colors-gray-light-mode-300, var(--ng-componentcolors-utility-gray-300));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.status-light--inactive .status-light__label {
|
|
104
|
+
color: var(--nile-colors-text-tertiary, var(--ng-componentcolors-utility-gray-500));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.status-light--disabled .status-light__dot {
|
|
108
|
+
background: var(--nile-colors-text-disabled, var(--ng-componentcolors-utility-gray-300));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.status-light--disabled .status-light__label {
|
|
112
|
+
color: var(--nile-colors-text-disabled, var(--ng-colors-text-disabled));
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
.status-light--pulse .status-light__dot::after {
|
|
118
|
+
content: '';
|
|
119
|
+
position: absolute;
|
|
120
|
+
inset: 0;
|
|
121
|
+
border-radius: inherit;
|
|
122
|
+
background: inherit;
|
|
123
|
+
animation: status-light-pulse 1.5s ease-out infinite;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@keyframes status-light-pulse {
|
|
127
|
+
0% {
|
|
128
|
+
transform: scale(1);
|
|
129
|
+
opacity: 0.6;
|
|
130
|
+
}
|
|
131
|
+
100% {
|
|
132
|
+
transform: scale(2.5);
|
|
133
|
+
opacity: 0;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@media (prefers-reduced-motion: reduce) {
|
|
138
|
+
.status-light--pulse .status-light__dot::after {
|
|
139
|
+
animation: none;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* #endregion */
|
|
144
|
+
`;
|
|
145
|
+
|
|
146
|
+
export default [styles];
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Aquera Inc 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { html, TemplateResult } from 'lit';
|
|
9
|
+
import { styles } from './nile-status-light.css';
|
|
10
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
11
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
12
|
+
import NileElement, { setupA11yMetadata } from '../internal/nile-element';
|
|
13
|
+
import type { CSSResultGroup } from 'lit';
|
|
14
|
+
import { A11yProperty } from '../internal/accessibility/a11y.property.enum';
|
|
15
|
+
import { A11yRole } from '../internal/accessibility/a11y.role.enum';
|
|
16
|
+
import { Role } from '../internal/accessibility/role.enum';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Nile status light component.
|
|
20
|
+
*
|
|
21
|
+
* @tag nile-status-light
|
|
22
|
+
*
|
|
23
|
+
* @summary Status lights describe the status of an object, using a colored dot
|
|
24
|
+
* alongside a text label (e.g. "Active", "Error", "Pending").
|
|
25
|
+
* @status experimental
|
|
26
|
+
*
|
|
27
|
+
* @slot - The status light's text label.
|
|
28
|
+
*
|
|
29
|
+
* @attr {boolean} pulse - Optional pulse animation for active statuses.
|
|
30
|
+
*
|
|
31
|
+
* @csspart base - The component's base wrapper.
|
|
32
|
+
* @csspart indicator - The colored status dot.
|
|
33
|
+
* @csspart label - The status light's text label.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* <!-- Pulse animation for an active status -->
|
|
37
|
+
* <nile-status-light variant="positive" pulse>Active</nile-status-light>
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* <!-- Disabled status light with muted colors -->
|
|
41
|
+
* <nile-status-light variant="positive" disabled>Inactive</nile-status-light>
|
|
42
|
+
*/
|
|
43
|
+
@customElement('nile-status-light')
|
|
44
|
+
export class NileStatusLight extends NileElement {
|
|
45
|
+
static styles: CSSResultGroup = styles;
|
|
46
|
+
|
|
47
|
+
connectedCallback(): void {
|
|
48
|
+
super.connectedCallback();
|
|
49
|
+
setupA11yMetadata(this, {
|
|
50
|
+
[Role.Role]: A11yRole.Text,
|
|
51
|
+
[A11yProperty.AriaLabel]: this.textContent?.trim() || '',
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** The status light's color variant. */
|
|
56
|
+
@property({ reflect: true }) variant:
|
|
57
|
+
| 'positive'
|
|
58
|
+
| 'negative'
|
|
59
|
+
| 'notice'
|
|
60
|
+
| 'informative'
|
|
61
|
+
| 'neutral'
|
|
62
|
+
| 'inactive' = 'neutral';
|
|
63
|
+
|
|
64
|
+
/** The status light's size. */
|
|
65
|
+
@property({ reflect: true, attribute: true }) size: 'small' | 'medium' | 'large' | 'x-large' =
|
|
66
|
+
'medium';
|
|
67
|
+
|
|
68
|
+
/** Disables the status light, muting its colors. */
|
|
69
|
+
@property({ type: Boolean, reflect: true }) disabled = false;
|
|
70
|
+
|
|
71
|
+
/** Draws attention to an active status with a pulsing animation around the dot. */
|
|
72
|
+
@property({ type: Boolean, reflect: true }) pulse = false;
|
|
73
|
+
|
|
74
|
+
render(): TemplateResult {
|
|
75
|
+
return html`
|
|
76
|
+
<span
|
|
77
|
+
part="base"
|
|
78
|
+
class=${classMap({
|
|
79
|
+
'status-light': true,
|
|
80
|
+
'status-light--positive': this.variant === 'positive',
|
|
81
|
+
'status-light--negative': this.variant === 'negative',
|
|
82
|
+
'status-light--notice': this.variant === 'notice',
|
|
83
|
+
'status-light--informative': this.variant === 'informative',
|
|
84
|
+
'status-light--neutral': this.variant === 'neutral',
|
|
85
|
+
'status-light--inactive': this.variant === 'inactive',
|
|
86
|
+
'status-light--small': this.size === 'small',
|
|
87
|
+
'status-light--medium': this.size === 'medium',
|
|
88
|
+
'status-light--large': this.size === 'large',
|
|
89
|
+
'status-light--x-large': this.size === 'x-large',
|
|
90
|
+
'status-light--disabled': this.disabled,
|
|
91
|
+
'status-light--pulse': this.pulse && !this.disabled,
|
|
92
|
+
})}
|
|
93
|
+
>
|
|
94
|
+
<span
|
|
95
|
+
part="indicator"
|
|
96
|
+
class="status-light__dot"
|
|
97
|
+
aria-hidden="true"
|
|
98
|
+
></span>
|
|
99
|
+
<slot part="label" class="status-light__label"></slot>
|
|
100
|
+
</span>
|
|
101
|
+
`;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export default NileStatusLight;
|
|
106
|
+
|
|
107
|
+
declare global {
|
|
108
|
+
interface HTMLElementTagNameMap {
|
|
109
|
+
'nile-status-light': NileStatusLight;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -1808,7 +1808,7 @@
|
|
|
1808
1808
|
},
|
|
1809
1809
|
{
|
|
1810
1810
|
"name": "nile-detail",
|
|
1811
|
-
"description": "Events:\n\n * `nile-page-load` {`CustomEvent<{ pageIndex: number; offset: number; limit: number; rows: any; }>`} - \n\n * `nile-page-error` {`CustomEvent<{ pageIndex: number; offset: number; limit: number; error: any; }>`} - \n\n * `nile-change` {`CustomEvent<{ selected: string[]; }>`} - \n\n * `nile-search` {`CustomEvent<{ value: string; }>`} - \n\nAttributes:\n\n * `open` {`boolean`} - \n\n * `heading` {`string`} - \n\n * `description` {`string`} - \n\n * `expandIconPlacement` {`\"left\" | \"right\"`} - \n\n * `disabled` {`boolean`} - \n\n * `variant` {`NileDetailVariant`} - \n\n * `allow-html-label` {`boolean`} - \n\n * `disable-local-search` {`boolean`} - \n\n * `total-count` {`number | undefined`} - \n\n * `page-size` {`number`} - \n\n * `placeholder-label` {`string`} - \n\n * `search-placeholder` {`string`} - \n\n * `items-label` {`string`} - \n\n * `restore-label` {`string`} - \n\n * `clear-label` {`string`} - \n\n * `grid-rows` {`number`} - \n\n * `grid-columns` {`number`} - \n\n * `min-column-width` {`string`} - \n\n * `lane-height` {`number`} - \n\n * `orientation` {`\"vertical\" | \"horizontal\" | \"both\"`} - \n\n * `max-height` {`string`} - \n\n * `matrix-columns` {`number`} - \n\n * `virtualize` {`boolean`} - \n\n * `virtualize-threshold` {`number`} - \n\n * `overscan` {`number`} - \n\n * `show-selected-toggle` {`boolean`} - \n\n * `selected-only-label` {`string`} - \n\n * `show-all-label` {`string`} - \n\nProperties:\n\n * `styles` - \n\n * `detail` {`HTMLDetailsElement`} - \n\n * `header` {`HTMLElement`} - \n\n * `body` {`HTMLElement`} - \n\n * `open` {`boolean`} - \n\n * `heading` {`string`} - \n\n * `description` {`string`} - \n\n * `expandIconPlacement` {`\"left\" | \"right\"`} - \n\n * `disabled` {`boolean`} - \n\n * `variant` {`NileDetailVariant`} - \n\n * `items` {`SelectionItem[]`} - \n\n * `selected` {`string[]`} - \n\n * `renderItemConfig` {`NileDetailRenderItemConfig | undefined`} - \n\n * `allowHtmlLabel` {`boolean`} - \n\n * `disableLocalSearch` {`boolean`} - \n\n * `totalCount` {`number | undefined`} - \n\n * `pageSize` {`number`} - \n\n * `fetchPage` - \n\n * `placeholderLabel` {`string`} - \n\n * `config` {`NileDetailSelectionConfig | undefined`} - \n\n * `searchPlaceholder` {`string`} - \n\n * `itemsLabel` {`string`} - \n\n * `restoreLabel` {`string`} - \n\n * `clearLabel` {`string`} - \n\n * `gridRows` {`number`} - \n\n * `gridColumns` {`number`} - \n\n * `minColumnWidth` {`string`} - \n\n * `laneHeight` {`number`} - \n\n * `orientation` {`\"vertical\" | \"horizontal\" | \"both\"`} - \n\n * `maxHeight` {`string`} - \n\n * `matrixColumns` {`number`} - \n\n * `virtualize` {`boolean`} - \n\n * `virtualizeThreshold` {`number`} - \n\n * `overscan` {`number`} - \n\n * `_detailOpen` {`boolean`} - \n\n * `_hasSlottedContent` {`boolean`} - \n\n * `_searchTerm` {`string`} - \n\n * `_selectedSet` {`Set<string>`} - \n\n * `_showSelectedOnly` {`boolean`} - \n\n * `showSelectedToggle` {`boolean`} - \n\n * `selectedOnlyLabel` {`string`} - \n\n * `showAllLabel` {`string`} - \n\n * `_restoreDefaults` {`string[] | null`} - \n\n * `_gridResizeObserver` - \n\n * `_virtCtrl` - \n\n * `_rowVirtCtrl` - \n\n * `_colVirtCtrl` - \n\n * `_pageCache` - \n\n * `_pendingPages` - \n\n * `_isInfiniteMode` {`boolean`} - \n\n * `_isVirtualized` {`boolean`} - \n\n * `_columnWidthPx` {`number`} - \n\n * `_filteredItems` {`SelectionItem[]`} - \n\n * `_allChecked` {`boolean`} - \n\n * `_indeterminate` {`boolean`} - \n\n * `_countLabel` {`string`} - \n\n * `_summaryLabel` {`string`} - \n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
|
|
1811
|
+
"description": "Events:\n\n * `nile-page-load` {`CustomEvent<{ pageIndex: number; offset: number; limit: number; rows: any; }>`} - \n\n * `nile-page-error` {`CustomEvent<{ pageIndex: number; offset: number; limit: number; error: any; }>`} - \n\n * `nile-change` {`CustomEvent<{ selected: string[]; }>`} - \n\n * `nile-search` {`CustomEvent<{ value: string; }>`} - \n\nAttributes:\n\n * `open` {`boolean`} - \n\n * `heading` {`string`} - \n\n * `description` {`string`} - \n\n * `expandIconPlacement` {`\"left\" | \"right\"`} - \n\n * `disabled` {`boolean`} - \n\n * `variant` {`NileDetailVariant`} - \n\n * `allow-html-label` {`boolean`} - \n\n * `disable-local-search` {`boolean`} - \n\n * `total-count` {`number | undefined`} - \n\n * `page-size` {`number`} - \n\n * `placeholder-label` {`string`} - \n\n * `search-placeholder` {`string`} - \n\n * `items-label` {`string`} - \n\n * `restore-label` {`string`} - \n\n * `clear-label` {`string`} - \n\n * `grid-rows` {`number`} - \n\n * `grid-columns` {`number`} - \n\n * `min-column-width` {`string`} - \n\n * `lane-height` {`number`} - \n\n * `orientation` {`\"vertical\" | \"horizontal\" | \"both\"`} - \n\n * `max-height` {`string`} - \n\n * `matrix-columns` {`number`} - \n\n * `virtualize` {`boolean`} - \n\n * `virtualize-threshold` {`number`} - \n\n * `overscan` {`number`} - \n\n * `show-selected-toggle` {`boolean`} - \n\n * `selected-only-label` {`string`} - \n\n * `show-all-label` {`string`} - \n\nProperties:\n\n * `styles` - \n\n * `detail` {`HTMLDetailsElement`} - \n\n * `header` {`HTMLElement`} - \n\n * `body` {`HTMLElement`} - \n\n * `open` {`boolean`} - \n\n * `heading` {`string`} - \n\n * `description` {`string`} - \n\n * `expandIconPlacement` {`\"left\" | \"right\"`} - \n\n * `disabled` {`boolean`} - \n\n * `variant` {`NileDetailVariant`} - \n\n * `items` {`SelectionItem[]`} - \n\n * `selected` {`string[]`} - \n\n * `renderItemConfig` {`NileDetailRenderItemConfig | undefined`} - \n\n * `allowHtmlLabel` {`boolean`} - \n\n * `disableLocalSearch` {`boolean`} - \n\n * `totalCount` {`number | undefined`} - \n\n * `pageSize` {`number`} - \n\n * `fetchPage` - \n\n * `placeholderLabel` {`string`} - \n\n * `config` {`NileDetailSelectionConfig | undefined`} - \n\n * `searchPlaceholder` {`string`} - \n\n * `itemsLabel` {`string`} - \n\n * `restoreLabel` {`string`} - \n\n * `clearLabel` {`string`} - \n\n * `gridRows` {`number`} - \n\n * `gridColumns` {`number`} - \n\n * `minColumnWidth` {`string`} - \n\n * `laneHeight` {`number`} - \n\n * `orientation` {`\"vertical\" | \"horizontal\" | \"both\"`} - \n\n * `maxHeight` {`string`} - \n\n * `matrixColumns` {`number`} - \n\n * `virtualize` {`boolean`} - \n\n * `virtualizeThreshold` {`number`} - \n\n * `overscan` {`number`} - \n\n * `_detailOpen` {`boolean`} - \n\n * `_hasSlottedContent` {`boolean`} - \n\n * `_searchTerm` {`string`} - \n\n * `_selectedSet` {`Set<string>`} - \n\n * `_showSelectedOnly` {`boolean`} - \n\n * `showSelectedToggle` {`boolean`} - \n\n * `selectedOnlyLabel` {`string`} - \n\n * `showAllLabel` {`string`} - \n\n * `_restoreDefaults` {`string[] | null`} - \n\n * `_gridResizeObserver` - \n\n * `_virtCtrl` - \n\n * `_rowVirtCtrl` - \n\n * `_colVirtCtrl` - \n\n * `_pageCache` - \n\n * `_pendingPages` - \n\n * `_isSelectionVariant` {`boolean`} - True for any variant that renders the selection UI/behavior.\n\n * `_isLightVariant` {`boolean`} - True for any variant that applies the light styling.\n\n * `_isInfiniteMode` {`boolean`} - \n\n * `_isVirtualized` {`boolean`} - \n\n * `_columnWidthPx` {`number`} - \n\n * `_filteredItems` {`SelectionItem[]`} - \n\n * `_allChecked` {`boolean`} - \n\n * `_indeterminate` {`boolean`} - \n\n * `_countLabel` {`string`} - \n\n * `_summaryLabel` {`string`} - \n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
|
|
1812
1812
|
"attributes": [
|
|
1813
1813
|
{
|
|
1814
1814
|
"name": "open",
|
|
@@ -1844,11 +1844,17 @@
|
|
|
1844
1844
|
"name": "variant",
|
|
1845
1845
|
"description": "`variant` {`NileDetailVariant`} - \n\nProperty: variant\n\nDefault: default",
|
|
1846
1846
|
"values": [
|
|
1847
|
+
{
|
|
1848
|
+
"name": "light"
|
|
1849
|
+
},
|
|
1847
1850
|
{
|
|
1848
1851
|
"name": "default"
|
|
1849
1852
|
},
|
|
1850
1853
|
{
|
|
1851
1854
|
"name": "selection"
|
|
1855
|
+
},
|
|
1856
|
+
{
|
|
1857
|
+
"name": "select-light"
|
|
1852
1858
|
}
|
|
1853
1859
|
]
|
|
1854
1860
|
},
|
|
@@ -6406,6 +6412,64 @@
|
|
|
6406
6412
|
}
|
|
6407
6413
|
]
|
|
6408
6414
|
},
|
|
6415
|
+
{
|
|
6416
|
+
"name": "nile-status-light",
|
|
6417
|
+
"description": "Nile status light component.\n\nSlots:\n\n * ` ` {} - The status light's text label.\n\nAttributes:\n\n * `variant` {`\"positive\" | \"negative\" | \"notice\" | \"informative\" | \"neutral\" | \"inactive\"`} - The status light's color variant.\n\n * `size` {`\"small\" | \"medium\" | \"large\" | \"x-large\"`} - The status light's size.\n\n * `disabled` {`boolean`} - Disables the status light, muting its colors.\n\n * `pulse` {boolean} - Draws attention to an active status with a pulsing animation around the dot.\n\nProperties:\n\n * `styles` - \n\n * `variant` {`\"positive\" | \"negative\" | \"notice\" | \"informative\" | \"neutral\" | \"inactive\"`} - The status light's color variant.\n\n * `size` {`\"small\" | \"medium\" | \"large\" | \"x-large\"`} - The status light's size.\n\n * `disabled` {`boolean`} - Disables the status light, muting its colors.\n\n * `pulse` {boolean} - Draws attention to an active status with a pulsing animation around the dot.\n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
|
|
6418
|
+
"attributes": [
|
|
6419
|
+
{
|
|
6420
|
+
"name": "variant",
|
|
6421
|
+
"description": "`variant` {`\"positive\" | \"negative\" | \"notice\" | \"informative\" | \"neutral\" | \"inactive\"`} - The status light's color variant.\n\nProperty: variant\n\nDefault: neutral",
|
|
6422
|
+
"values": [
|
|
6423
|
+
{
|
|
6424
|
+
"name": "positive"
|
|
6425
|
+
},
|
|
6426
|
+
{
|
|
6427
|
+
"name": "negative"
|
|
6428
|
+
},
|
|
6429
|
+
{
|
|
6430
|
+
"name": "notice"
|
|
6431
|
+
},
|
|
6432
|
+
{
|
|
6433
|
+
"name": "informative"
|
|
6434
|
+
},
|
|
6435
|
+
{
|
|
6436
|
+
"name": "neutral"
|
|
6437
|
+
},
|
|
6438
|
+
{
|
|
6439
|
+
"name": "inactive"
|
|
6440
|
+
}
|
|
6441
|
+
]
|
|
6442
|
+
},
|
|
6443
|
+
{
|
|
6444
|
+
"name": "size",
|
|
6445
|
+
"description": "`size` {`\"small\" | \"medium\" | \"large\" | \"x-large\"`} - The status light's size.\n\nProperty: size\n\nDefault: medium",
|
|
6446
|
+
"values": [
|
|
6447
|
+
{
|
|
6448
|
+
"name": "small"
|
|
6449
|
+
},
|
|
6450
|
+
{
|
|
6451
|
+
"name": "medium"
|
|
6452
|
+
},
|
|
6453
|
+
{
|
|
6454
|
+
"name": "large"
|
|
6455
|
+
},
|
|
6456
|
+
{
|
|
6457
|
+
"name": "x-large"
|
|
6458
|
+
}
|
|
6459
|
+
]
|
|
6460
|
+
},
|
|
6461
|
+
{
|
|
6462
|
+
"name": "disabled",
|
|
6463
|
+
"description": "`disabled` {`boolean`} - Disables the status light, muting its colors.\n\nProperty: disabled\n\nDefault: false",
|
|
6464
|
+
"valueSet": "v"
|
|
6465
|
+
},
|
|
6466
|
+
{
|
|
6467
|
+
"name": "pulse",
|
|
6468
|
+
"description": "`pulse` {boolean} - Draws attention to an active status with a pulsing animation around the dot.\n\nProperty: pulse\n\nDefault: false",
|
|
6469
|
+
"valueSet": "v"
|
|
6470
|
+
}
|
|
6471
|
+
]
|
|
6472
|
+
},
|
|
6409
6473
|
{
|
|
6410
6474
|
"name": "nile-stepper-item",
|
|
6411
6475
|
"description": "Nile stepper-item component.\n\nAttributes:\n\n * `title` {`string`} - \n\n * `subtitle` {`string`} - \n\n * `completed` {`boolean`} - \n\n * `current` {`boolean`} - \n\nProperties:\n\n * `absoluteTitle` {`HTMLDivElement`} - \n\n * `absoluteSubtitle` {`HTMLDivElement`} - \n\n * `title` {`string`} - \n\n * `subtitle` {`string`} - \n\n * `completed` {`boolean`} - \n\n * `current` {`boolean`} - \n\n * `contentBelow` {`boolean`} - \n\n * `size` {`\"sm\" | \"lg\"`} - \n\n * `icon` {`string`} - \n\n * `isFirst` {`boolean`} - \n\n * `isLast` {`boolean`} - \n\n * `isComplete` {`boolean`} - \n\n * `isCurrent` {`boolean`} - \n\n * `isManualMode` {`boolean`} - \n\n * `currentStepValue` {`Number`} - \n\n * `completedStepValue` {`Number`} - \n\n * `calculatedCompletedStepValue` {`Number`} - \n\n * `value` {`Number`} - \n\n * `haveFlex` {`Boolean`} - \n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t(t,s,i){let h,n=i.initialDeps??[],e=!0;function r(){var r,o,l;let a;i.key&&(null==(r=i.debug)?void 0:r.call(i))&&(a=Date.now());const u=t();if(!(u.length!==n.length||u.some(((t,s)=>n[s]!==t))))return h;let d;if(n=u,i.key&&(null==(o=i.debug)?void 0:o.call(i))&&(d=Date.now()),h=s(...u),i.key&&(null==(l=i.debug)?void 0:l.call(i))){const t=Math.round(100*(Date.now()-a))/100,s=Math.round(100*(Date.now()-d))/100,h=s/16,n=(t,s)=>{for(t=String(t);t.length<s;)t=" "+t;return t};console.info(`%c⏱ ${n(s,5)} /${n(t,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*h,120))}deg 100% 31%);`,null==i?void 0:i.key)}return!(null==i?void 0:i.onChange)||e&&i.skipInitialOnChange||i.onChange(h),e=!1,h}return r.updateDeps=t=>{n=t},r}function s(t,s){if(void 0===t)throw new Error("Unexpected undefined"+(s?`: ${s}`:""));return t}const i=(t,s,i)=>{let h;return function(...n){t.clearTimeout(h),h=t.setTimeout((()=>s.apply(this,n)),i)}},h=t=>{const{offsetWidth:s,offsetHeight:i}=t;return{width:s,height:i}},n=t=>t,e=t=>{const s=Math.max(t.startIndex-t.overscan,0),i=Math.min(t.endIndex+t.overscan,t.count-1),h=[];for(let t=s;t<=i;t++)h.push(t);return h},r=(t,s)=>{const i=t.scrollElement;if(!i)return;const n=t.targetWindow;if(!n)return;const e=t=>{const{width:i,height:h}=t;s({width:Math.round(i),height:Math.round(h)})};if(e(h(i)),!n.ResizeObserver)return()=>{};const r=new n.ResizeObserver((s=>{const n=()=>{const t=s[0];if(null==t?void 0:t.borderBoxSize){const s=t.borderBoxSize[0];if(s)return void e({width:s.inlineSize,height:s.blockSize})}e(h(i))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(n):n()}));return r.observe(i,{box:"border-box"}),()=>{r.unobserve(i)}},o={passive:!0},l="undefined"==typeof window||"onscrollend"in window,a=(t,s)=>{const h=t.scrollElement;if(!h)return;const n=t.targetWindow;if(!n)return;let e=0;const r=t.options.useScrollendEvent&&l?()=>{}:i(n,(()=>{s(e,!1)}),t.options.isScrollingResetDelay),a=i=>()=>{const{horizontal:n,isRtl:o}=t.options;e=n?h.scrollLeft*(o?-1:1):h.scrollTop,r(),s(e,i)},u=a(!0),d=a(!1);h.addEventListener("scroll",u,o);const c=t.options.useScrollendEvent&&l;return c&&h.addEventListener("scrollend",d,o),()=>{h.removeEventListener("scroll",u),c&&h.removeEventListener("scrollend",d)}},u=(t,s,i)=>{if(null==s?void 0:s.borderBoxSize){const t=s.borderBoxSize[0];if(t){return Math.round(t[i.options.horizontal?"inlineSize":"blockSize"])}}return t[i.options.horizontal?"offsetWidth":"offsetHeight"]},d=(t,{adjustments:s=0,behavior:i},h)=>{var n,e;const r=t+s;null==(e=null==(n=h.scrollElement)?void 0:n.scrollTo)||e.call(n,{[h.options.horizontal?"left":"top"]:r,behavior:i})};class c{constructor(i){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var t,s,i;return(null==(i=null==(s=null==(t=this.targetWindow)?void 0:t.performance)?void 0:s.now)?void 0:i.call(s))??Date.now()},this.observer=(()=>{let t=null;const s=()=>t||(this.targetWindow&&this.targetWindow.ResizeObserver?t=new this.targetWindow.ResizeObserver((t=>{t.forEach((t=>{const s=()=>{const s=t.target,i=this.indexFromElement(s);s.isConnected?this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(s,t,this)):this.observer.unobserve(s)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()}))})):null);return{disconnect:()=>{var i;null==(i=s())||i.disconnect(),t=null},observe:t=>{var i;return null==(i=s())?void 0:i.observe(t,{box:"border-box"})},unobserve:t=>{var i;return null==(i=s())?void 0:i.unobserve(t)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach((([s,i])=>{void 0===i&&delete t[s]})),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:n,rangeExtractor:e,onChange:()=>{},measureElement:u,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...t}},this.notify=t=>{var s,i;null==(i=(s=this.options).onChange)||i.call(s,this,t)},this.maybeNotify=t((()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null])),(t=>{this.notify(t)}),{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach((t=>t())),this.unsubs=[],this.observer.disconnect(),null!=this.rafId&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const s=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==s){if(this.cleanup(),!s)return void this.maybeNotify();this.scrollElement=s,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(t=this.scrollElement)?void 0:t.window)??null,this.elementsCache.forEach((t=>{this.observer.observe(t)})),this.unsubs.push(this.options.observeElementRect(this,(t=>{this.scrollRect=t,this.maybeNotify()}))),this.unsubs.push(this.options.observeElementOffset(this,((t,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<t?"forward":"backward":null,this.scrollOffset=t,this.isScrolling=s,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()}))),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,s)=>{const i=new Map,h=new Map;for(let n=s-1;n>=0;n--){const s=t[n];if(i.has(s.lane))continue;const e=h.get(s.lane);if(null==e||s.end>e.end?h.set(s.lane,s):s.end<e.end&&i.set(s.lane,!0),i.size===this.options.lanes)break}return h.size===this.options.lanes?Array.from(h.values()).sort(((t,s)=>t.end===s.end?t.index-s.index:t.end-s.end))[0]:void 0},this.getMeasurementOptions=t((()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode]),((t,s,i,h,n,e,r)=>(void 0!==this.prevLanes&&this.prevLanes!==e&&(this.lanesChangedFlag=!0),this.prevLanes=e,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:s,scrollMargin:i,getItemKey:h,enabled:n,lanes:e,laneAssignmentMode:r})),{key:!1}),this.getMeasurements=t((()=>[this.getMeasurementOptions(),this.itemSizeCache]),(({count:t,paddingStart:s,scrollMargin:i,getItemKey:h,enabled:n,lanes:e,laneAssignmentMode:r},o)=>{if(!n)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const s of this.laneAssignments.keys())s>=t&&this.laneAssignments.delete(s);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),0!==this.measurementsCache.length||this.lanesSettling||(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach((t=>{this.itemSizeCache.set(t.key,t.size)})));const l=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const a=this.measurementsCache.slice(0,l),u=new Array(e).fill(void 0);for(let t=0;t<l;t++){const s=a[t];s&&(u[s.lane]=t)}for(let n=l;n<t;n++){const t=h(n),e=this.laneAssignments.get(n);let l,d;const c="estimate"===r||o.has(t);if(void 0!==e&&this.options.lanes>1){l=e;const t=u[l],h=void 0!==t?a[t]:void 0;d=h?h.end+this.options.gap:s+i}else{const t=1===this.options.lanes?a[n-1]:this.getFurthestMeasurement(a,n);d=t?t.end+this.options.gap:s+i,l=t?t.lane:n%this.options.lanes,this.options.lanes>1&&c&&this.laneAssignments.set(n,l)}const f=o.get(t),v="number"==typeof f?f:this.options.estimateSize(n),b=d+v;a[n]={index:n,start:d,size:v,end:b,key:t,lane:l},u[l]=n}return this.measurementsCache=a,a}),{key:!1,debug:()=>this.options.debug}),this.calculateRange=t((()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes]),((t,s,i,h)=>this.range=t.length>0&&s>0?function({measurements:t,outerSize:s,scrollOffset:i,lanes:h}){const n=t.length-1,e=s=>t[s].start;if(t.length<=h)return{startIndex:0,endIndex:n};let r=f(0,n,e,i),o=r;if(1===h)for(;o<n&&t[o].end<i+s;)o++;else if(h>1){const e=Array(h).fill(0);for(;o<n&&e.some((t=>t<i+s));){const s=t[o];e[s.lane]=s.end,o++}const l=Array(h).fill(i+s);for(;r>=0&&l.some((t=>t>=i));){const s=t[r];l[s.lane]=s.start,r--}r=Math.max(0,r-r%h),o=Math.min(n,o+(h-1-o%h))}return{startIndex:r,endIndex:o}}({measurements:t,outerSize:s,scrollOffset:i,lanes:h}):null),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=t((()=>{let t=null,s=null;const i=this.calculateRange();return i&&(t=i.startIndex,s=i.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,s]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,s]}),((t,s,i,h,n)=>null===h||null===n?[]:t({startIndex:h,endIndex:n,overscan:s,count:i})),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const s=this.options.indexAttribute,i=t.getAttribute(s);return i?parseInt(i,10):(console.warn(`Missing attribute name '${s}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var s;if(!this.scrollState||"smooth"!==this.scrollState.behavior)return!0;const i=this.scrollState.index??(null==(s=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))?void 0:s.index);if(void 0!==i&&this.range){const s=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),h=Math.max(0,i-s),n=Math.min(this.options.count-1,i+s);return t>=h&&t<=n}return!0},this.measureElement=t=>{if(!t)return void this.elementsCache.forEach(((t,s)=>{t.isConnected||(this.observer.unobserve(t),this.elementsCache.delete(s))}));const s=this.indexFromElement(t),i=this.options.getItemKey(s),h=this.elementsCache.get(i);h!==t&&(h&&this.observer.unobserve(h),this.observer.observe(t),this.elementsCache.set(i,t)),this.isScrolling&&!this.scrollState||!this.shouldMeasureDuringScroll(s)||this.resizeItem(s,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,s)=>{var i;const h=this.measurementsCache[t];if(!h)return;const n=s-(this.itemSizeCache.get(h.key)??h.size);0!==n&&("smooth"!==(null==(i=this.scrollState)?void 0:i.behavior)&&(void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(h,n,this):h.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=n,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(h.index),this.itemSizeCache=new Map(this.itemSizeCache.set(h.key,s)),this.notify(!1))},this.getVirtualItems=t((()=>[this.getVirtualIndexes(),this.getMeasurements()]),((t,s)=>{const i=[];for(let h=0,n=t.length;h<n;h++){const n=s[t[h]];i.push(n)}return i}),{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const i=this.getMeasurements();if(0!==i.length)return s(i[f(0,i.length-1,(t=>s(i[t]).start),t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,s,i=0)=>{if(!this.scrollElement)return 0;const h=this.getSize(),n=this.getScrollOffset();"auto"===s&&(s=t>=n+h?"end":"start"),"center"===s?t+=(i-h)/2:"end"===s&&(t-=h);const e=this.getMaxScrollOffset();return Math.max(Math.min(e,t),0)},this.getOffsetForIndex=(t,s="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const i=this.getSize(),h=this.getScrollOffset(),n=this.measurementsCache[t];if(!n)return;if("auto"===s)if(n.end>=h+i-this.options.scrollPaddingEnd)s="end";else{if(!(n.start<=h+this.options.scrollPaddingStart))return[h,s];s="start"}if("end"===s&&t===this.options.count-1)return[this.getMaxScrollOffset(),s];const e="end"===s?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(e,s,n.size),s]},this.scrollToOffset=(t,{align:s="start",behavior:i="auto"}={})=>{const h=this.getOffsetForAlignment(t,s),n=this.now();this.scrollState={index:null,align:s,behavior:i,startedAt:n,lastTargetOffset:h,stableFrames:0},this._scrollToOffset(h,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:s="auto",behavior:i="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const h=this.getOffsetForIndex(t,s);if(!h)return;const[n,e]=h,r=this.now();this.scrollState={index:t,align:e,behavior:i,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:s="auto"}={})=>{const i=this.getScrollOffset()+t,h=this.now();this.scrollState={index:null,align:"start",behavior:s,startedAt:h,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var t;const s=this.getMeasurements();let i;if(0===s.length)i=this.options.paddingStart;else if(1===this.options.lanes)i=(null==(t=s[s.length-1])?void 0:t.end)??0;else{const t=Array(this.options.lanes).fill(null);let h=s.length-1;for(;h>=0&&t.some((t=>null===t));){const i=s[h];null===t[i.lane]&&(t[i.lane]=i.end),h--}i=Math.max(...t.filter((t=>null!==t)))}return Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:s,behavior:i})=>{this.options.scrollToFn(t,{behavior:i,adjustments:s},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(i)}scheduleScrollReconcile(){this.targetWindow?null==this.rafId&&(this.rafId=this.targetWindow.requestAnimationFrame((()=>{this.rafId=null,this.reconcileScroll()}))):this.scrollState=null}reconcileScroll(){if(!this.scrollState)return;if(!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3)return void(this.scrollState=null);const t=null!=this.scrollState.index?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=t?t[0]:this.scrollState.lastTargetOffset,i=s!==this.scrollState.lastTargetOffset;if(!i&&(h=s,n=this.getScrollOffset(),Math.abs(h-n)<1.01)){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1)return void(this.scrollState=null)}else this.scrollState.stableFrames=0,i&&(this.scrollState.lastTargetOffset=s,this.scrollState.behavior="auto",this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}));var h,n;this.scheduleScrollReconcile()}}const f=(t,s,i,h)=>{for(;t<=s;){const n=(t+s)/2|0,e=i(n);if(e<h)t=n+1;else{if(!(e>h))return n;s=n-1}}return t>0?t-1:0};class v{constructor(t,s){this.cleanup=()=>{};const i={...s,onChange:(t,i)=>{var h;this.host.updateComplete.then((()=>this.host.requestUpdate())),null==(h=s.onChange)||h.call(s,t,i)}};this.virtualizer=new c(i),(this.host=t).addController(this)}getVirtualizer(){return this.virtualizer}hostConnected(){this.cleanup=this.virtualizer._didMount()}hostUpdated(){this.virtualizer._willUpdate()}hostDisconnected(){this.cleanup()}}class b extends v{constructor(t,s){super(t,{observeElementRect:r,observeElementOffset:a,scrollToFn:d,...s})}}export{b as V};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register([],function(_export,_context){"use strict";var i,h,n,e,r,o,l,a,u,d,c,f,v,b;function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n8=0,F=function F(){};return{s:F,n:function n(){return _n8>=r.length?{done:!0}:{done:!1,value:r[_n8++]};},e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function t(t,s,i){var _i$initialDeps;var h,n=(_i$initialDeps=i.initialDeps)!==null&&_i$initialDeps!==void 0?_i$initialDeps:[],e=!0;function r(){var r,o,l;var a;i.key&&(null==(r=i.debug)?void 0:r.call(i))&&(a=Date.now());var u=t();if(!(u.length!==n.length||u.some(function(t,s){return n[s]!==t;})))return h;var d;if(n=u,i.key&&(null==(o=i.debug)?void 0:o.call(i))&&(d=Date.now()),h=s.apply(void 0,_toConsumableArray(u)),i.key&&(null==(l=i.debug)?void 0:l.call(i))){var _t=Math.round(100*(Date.now()-a))/100,_s=Math.round(100*(Date.now()-d))/100,_h=_s/16,_n=function _n(t,s){for(t=String(t);t.length<s;)t=" "+t;return t;};console.info("%c\u23F1 ".concat(_n(_s,5)," /").concat(_n(_t,5)," ms"),"\n font-size: .6rem;\n font-weight: bold;\n color: hsl(".concat(Math.max(0,Math.min(120-120*_h,120)),"deg 100% 31%);"),null==i?void 0:i.key);}return!(null==i?void 0:i.onChange)||e&&i.skipInitialOnChange||i.onChange(h),e=!1,h;}return r.updateDeps=function(t){n=t;},r;}function s(t,s){if(void 0===t)throw new Error("Unexpected undefined"+(s?": ".concat(s):""));return t;}return{setters:[],execute:function execute(){i=function i(t,s,_i){var h;return function(){var _this=this;for(var _len=arguments.length,n=new Array(_len),_key=0;_key<_len;_key++){n[_key]=arguments[_key];}t.clearTimeout(h),h=t.setTimeout(function(){return s.apply(_this,n);},_i);};},h=function h(t){var s=t.offsetWidth,i=t.offsetHeight;return{width:s,height:i};},n=function n(t){return t;},e=function e(t){var s=Math.max(t.startIndex-t.overscan,0),i=Math.min(t.endIndex+t.overscan,t.count-1),h=[];for(var _t2=s;_t2<=i;_t2++)h.push(_t2);return h;},r=function r(t,s){var i=t.scrollElement;if(!i)return;var n=t.targetWindow;if(!n)return;var e=function e(t){var i=t.width,h=t.height;s({width:Math.round(i),height:Math.round(h)});};if(e(h(i)),!n.ResizeObserver)return function(){};var r=new n.ResizeObserver(function(s){var n=function n(){var t=s[0];if(null==t?void 0:t.borderBoxSize){var _s2=t.borderBoxSize[0];if(_s2)return void e({width:_s2.inlineSize,height:_s2.blockSize});}e(h(i));};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(n):n();});return r.observe(i,{box:"border-box"}),function(){r.unobserve(i);};},o={passive:!0},l="undefined"==typeof window||"onscrollend"in window,a=function a(t,s){var h=t.scrollElement;if(!h)return;var n=t.targetWindow;if(!n)return;var e=0;var r=t.options.useScrollendEvent&&l?function(){}:i(n,function(){s(e,!1);},t.options.isScrollingResetDelay),a=function a(i){return function(){var _t$options=t.options,n=_t$options.horizontal,o=_t$options.isRtl;e=n?h.scrollLeft*(o?-1:1):h.scrollTop,r(),s(e,i);};},u=a(!0),d=a(!1);h.addEventListener("scroll",u,o);var c=t.options.useScrollendEvent&&l;return c&&h.addEventListener("scrollend",d,o),function(){h.removeEventListener("scroll",u),c&&h.removeEventListener("scrollend",d);};},u=function u(t,s,i){if(null==s?void 0:s.borderBoxSize){var _t3=s.borderBoxSize[0];if(_t3){return Math.round(_t3[i.options.horizontal?"inlineSize":"blockSize"]);}}return t[i.options.horizontal?"offsetWidth":"offsetHeight"];},d=function d(t,_ref,h){var _ref$adjustments=_ref.adjustments,s=_ref$adjustments===void 0?0:_ref$adjustments,i=_ref.behavior;var n,e;var r=t+s;null==(e=null==(n=h.scrollElement)?void 0:n.scrollTo)||e.call(n,_defineProperty(_defineProperty({},h.options.horizontal?"left":"top",r),"behavior",i));};c=/*#__PURE__*/function(){function c(i){var _this2=this;_classCallCheck(this,c);this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map(),this.laneAssignments=new Map(),this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map(),this.now=function(){var _ref2;var t,s,i;return(_ref2=null==(i=null==(s=null==(t=_this2.targetWindow)?void 0:t.performance)?void 0:s.now)?void 0:i.call(s))!==null&&_ref2!==void 0?_ref2:Date.now();},this.observer=function(){var t=null;var s=function s(){return t||(_this2.targetWindow&&_this2.targetWindow.ResizeObserver?t=new _this2.targetWindow.ResizeObserver(function(t){t.forEach(function(t){var s=function s(){var s=t.target,i=_this2.indexFromElement(s);s.isConnected?_this2.shouldMeasureDuringScroll(i)&&_this2.resizeItem(i,_this2.options.measureElement(s,t,_this2)):_this2.observer.unobserve(s);};_this2.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s();});}):null);};return{disconnect:function disconnect(){var i;null==(i=s())||i.disconnect(),t=null;},observe:function observe(t){var i;return null==(i=s())?void 0:i.observe(t,{box:"border-box"});},unobserve:function unobserve(t){var i;return null==(i=s())?void 0:i.unobserve(t);}};}(),this.range=null,this.setOptions=function(t){Object.entries(t).forEach(function(_ref3){var _ref4=_slicedToArray(_ref3,2),s=_ref4[0],i=_ref4[1];void 0===i&&delete t[s];}),_this2.options=_objectSpread({debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:n,rangeExtractor:e,onChange:function onChange(){},measureElement:u,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate"},t);},this.notify=function(t){var s,i;null==(i=(s=_this2.options).onChange)||i.call(s,_this2,t);},this.maybeNotify=t(function(){return _this2.calculateRange(),[_this2.isScrolling,_this2.range?_this2.range.startIndex:null,_this2.range?_this2.range.endIndex:null];},function(t){_this2.notify(t);},{key:!1,debug:function debug(){return _this2.options.debug;},initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=function(){_this2.unsubs.filter(Boolean).forEach(function(t){return t();}),_this2.unsubs=[],_this2.observer.disconnect(),null!=_this2.rafId&&_this2.targetWindow&&(_this2.targetWindow.cancelAnimationFrame(_this2.rafId),_this2.rafId=null),_this2.scrollState=null,_this2.scrollElement=null,_this2.targetWindow=null;},this._didMount=function(){return function(){_this2.cleanup();};},this._willUpdate=function(){var t;var s=_this2.options.enabled?_this2.options.getScrollElement():null;if(_this2.scrollElement!==s){var _ref5;if(_this2.cleanup(),!s)return void _this2.maybeNotify();_this2.scrollElement=s,_this2.scrollElement&&"ownerDocument"in _this2.scrollElement?_this2.targetWindow=_this2.scrollElement.ownerDocument.defaultView:_this2.targetWindow=(_ref5=null==(t=_this2.scrollElement)?void 0:t.window)!==null&&_ref5!==void 0?_ref5:null,_this2.elementsCache.forEach(function(t){_this2.observer.observe(t);}),_this2.unsubs.push(_this2.options.observeElementRect(_this2,function(t){_this2.scrollRect=t,_this2.maybeNotify();})),_this2.unsubs.push(_this2.options.observeElementOffset(_this2,function(t,s){_this2.scrollAdjustments=0,_this2.scrollDirection=s?_this2.getScrollOffset()<t?"forward":"backward":null,_this2.scrollOffset=t,_this2.isScrolling=s,_this2.scrollState&&_this2.scheduleScrollReconcile(),_this2.maybeNotify();})),_this2._scrollToOffset(_this2.getScrollOffset(),{adjustments:void 0,behavior:void 0});}},this.rafId=null,this.getSize=function(){var _this2$scrollRect;return _this2.options.enabled?(_this2.scrollRect=(_this2$scrollRect=_this2.scrollRect)!==null&&_this2$scrollRect!==void 0?_this2$scrollRect:_this2.options.initialRect,_this2.scrollRect[_this2.options.horizontal?"width":"height"]):(_this2.scrollRect=null,0);},this.getScrollOffset=function(){var _this2$scrollOffset;return _this2.options.enabled?(_this2.scrollOffset=(_this2$scrollOffset=_this2.scrollOffset)!==null&&_this2$scrollOffset!==void 0?_this2$scrollOffset:"function"==typeof _this2.options.initialOffset?_this2.options.initialOffset():_this2.options.initialOffset,_this2.scrollOffset):(_this2.scrollOffset=null,0);},this.getFurthestMeasurement=function(t,s){var i=new Map(),h=new Map();for(var _n2=s-1;_n2>=0;_n2--){var _s3=t[_n2];if(i.has(_s3.lane))continue;var _e=h.get(_s3.lane);if(null==_e||_s3.end>_e.end?h.set(_s3.lane,_s3):_s3.end<_e.end&&i.set(_s3.lane,!0),i.size===_this2.options.lanes)break;}return h.size===_this2.options.lanes?Array.from(h.values()).sort(function(t,s){return t.end===s.end?t.index-s.index:t.end-s.end;})[0]:void 0;},this.getMeasurementOptions=t(function(){return[_this2.options.count,_this2.options.paddingStart,_this2.options.scrollMargin,_this2.options.getItemKey,_this2.options.enabled,_this2.options.lanes,_this2.options.laneAssignmentMode];},function(t,s,i,h,n,e,r){return void 0!==_this2.prevLanes&&_this2.prevLanes!==e&&(_this2.lanesChangedFlag=!0),_this2.prevLanes=e,_this2.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:s,scrollMargin:i,getItemKey:h,enabled:n,lanes:e,laneAssignmentMode:r};},{key:!1}),this.getMeasurements=t(function(){return[_this2.getMeasurementOptions(),_this2.itemSizeCache];},function(_ref6,o){var t=_ref6.count,s=_ref6.paddingStart,i=_ref6.scrollMargin,h=_ref6.getItemKey,n=_ref6.enabled,e=_ref6.lanes,r=_ref6.laneAssignmentMode;if(!n)return _this2.measurementsCache=[],_this2.itemSizeCache.clear(),_this2.laneAssignments.clear(),[];if(_this2.laneAssignments.size>t){var _iterator=_createForOfIteratorHelper(_this2.laneAssignments.keys()),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _s4=_step.value;_s4>=t&&_this2.laneAssignments["delete"](_s4);}}catch(err){_iterator.e(err);}finally{_iterator.f();}}_this2.lanesChangedFlag&&(_this2.lanesChangedFlag=!1,_this2.lanesSettling=!0,_this2.measurementsCache=[],_this2.itemSizeCache.clear(),_this2.laneAssignments.clear(),_this2.pendingMeasuredCacheIndexes=[]),0!==_this2.measurementsCache.length||_this2.lanesSettling||(_this2.measurementsCache=_this2.options.initialMeasurementsCache,_this2.measurementsCache.forEach(function(t){_this2.itemSizeCache.set(t.key,t.size);}));var l=_this2.lanesSettling?0:_this2.pendingMeasuredCacheIndexes.length>0?Math.min.apply(Math,_toConsumableArray(_this2.pendingMeasuredCacheIndexes)):0;_this2.pendingMeasuredCacheIndexes=[],_this2.lanesSettling&&_this2.measurementsCache.length===t&&(_this2.lanesSettling=!1);var a=_this2.measurementsCache.slice(0,l),u=new Array(e).fill(void 0);for(var _t4=0;_t4<l;_t4++){var _s5=a[_t4];_s5&&(u[_s5.lane]=_t4);}for(var _n3=l;_n3<t;_n3++){var _t5=h(_n3),_e2=_this2.laneAssignments.get(_n3);var _l=void 0,_d=void 0;var _c="estimate"===r||o.has(_t5);if(void 0!==_e2&&_this2.options.lanes>1){_l=_e2;var _t6=u[_l],_h2=void 0!==_t6?a[_t6]:void 0;_d=_h2?_h2.end+_this2.options.gap:s+i;}else{var _t7=1===_this2.options.lanes?a[_n3-1]:_this2.getFurthestMeasurement(a,_n3);_d=_t7?_t7.end+_this2.options.gap:s+i,_l=_t7?_t7.lane:_n3%_this2.options.lanes,_this2.options.lanes>1&&_c&&_this2.laneAssignments.set(_n3,_l);}var _f=o.get(_t5),_v="number"==typeof _f?_f:_this2.options.estimateSize(_n3),_b=_d+_v;a[_n3]={index:_n3,start:_d,size:_v,end:_b,key:_t5,lane:_l},u[_l]=_n3;}return _this2.measurementsCache=a,a;},{key:!1,debug:function debug(){return _this2.options.debug;}}),this.calculateRange=t(function(){return[_this2.getMeasurements(),_this2.getSize(),_this2.getScrollOffset(),_this2.options.lanes];},function(t,s,i,h){return _this2.range=t.length>0&&s>0?function(_ref7){var t=_ref7.measurements,s=_ref7.outerSize,i=_ref7.scrollOffset,h=_ref7.lanes;var n=t.length-1,e=function e(s){return t[s].start;};if(t.length<=h)return{startIndex:0,endIndex:n};var r=f(0,n,e,i),o=r;if(1===h)for(;o<n&&t[o].end<i+s;)o++;else if(h>1){var _e3=Array(h).fill(0);for(;o<n&&_e3.some(function(t){return t<i+s;});){var _s6=t[o];_e3[_s6.lane]=_s6.end,o++;}var _l2=Array(h).fill(i+s);for(;r>=0&&_l2.some(function(t){return t>=i;});){var _s7=t[r];_l2[_s7.lane]=_s7.start,r--;}r=Math.max(0,r-r%h),o=Math.min(n,o+(h-1-o%h));}return{startIndex:r,endIndex:o};}({measurements:t,outerSize:s,scrollOffset:i,lanes:h}):null;},{key:!1,debug:function debug(){return _this2.options.debug;}}),this.getVirtualIndexes=t(function(){var t=null,s=null;var i=_this2.calculateRange();return i&&(t=i.startIndex,s=i.endIndex),_this2.maybeNotify.updateDeps([_this2.isScrolling,t,s]),[_this2.options.rangeExtractor,_this2.options.overscan,_this2.options.count,t,s];},function(t,s,i,h,n){return null===h||null===n?[]:t({startIndex:h,endIndex:n,overscan:s,count:i});},{key:!1,debug:function debug(){return _this2.options.debug;}}),this.indexFromElement=function(t){var s=_this2.options.indexAttribute,i=t.getAttribute(s);return i?parseInt(i,10):(console.warn("Missing attribute name '".concat(s,"={index}' on measured element.")),-1);},this.shouldMeasureDuringScroll=function(t){var _this2$scrollState$in;var s;if(!_this2.scrollState||"smooth"!==_this2.scrollState.behavior)return!0;var i=(_this2$scrollState$in=_this2.scrollState.index)!==null&&_this2$scrollState$in!==void 0?_this2$scrollState$in:null==(s=_this2.getVirtualItemForOffset(_this2.scrollState.lastTargetOffset))?void 0:s.index;if(void 0!==i&&_this2.range){var _s8=Math.max(_this2.options.overscan,Math.ceil((_this2.range.endIndex-_this2.range.startIndex)/2)),_h3=Math.max(0,i-_s8),_n4=Math.min(_this2.options.count-1,i+_s8);return t>=_h3&&t<=_n4;}return!0;},this.measureElement=function(t){if(!t)return void _this2.elementsCache.forEach(function(t,s){t.isConnected||(_this2.observer.unobserve(t),_this2.elementsCache["delete"](s));});var s=_this2.indexFromElement(t),i=_this2.options.getItemKey(s),h=_this2.elementsCache.get(i);h!==t&&(h&&_this2.observer.unobserve(h),_this2.observer.observe(t),_this2.elementsCache.set(i,t)),_this2.isScrolling&&!_this2.scrollState||!_this2.shouldMeasureDuringScroll(s)||_this2.resizeItem(s,_this2.options.measureElement(t,void 0,_this2));},this.resizeItem=function(t,s){var _this2$itemSizeCache$;var i;var h=_this2.measurementsCache[t];if(!h)return;var n=s-((_this2$itemSizeCache$=_this2.itemSizeCache.get(h.key))!==null&&_this2$itemSizeCache$!==void 0?_this2$itemSizeCache$:h.size);0!==n&&("smooth"!==(null==(i=_this2.scrollState)?void 0:i.behavior)&&(void 0!==_this2.shouldAdjustScrollPositionOnItemSizeChange?_this2.shouldAdjustScrollPositionOnItemSizeChange(h,n,_this2):h.start<_this2.getScrollOffset()+_this2.scrollAdjustments)&&_this2._scrollToOffset(_this2.getScrollOffset(),{adjustments:_this2.scrollAdjustments+=n,behavior:void 0}),_this2.pendingMeasuredCacheIndexes.push(h.index),_this2.itemSizeCache=new Map(_this2.itemSizeCache.set(h.key,s)),_this2.notify(!1));},this.getVirtualItems=t(function(){return[_this2.getVirtualIndexes(),_this2.getMeasurements()];},function(t,s){var i=[];for(var _h4=0,_n5=t.length;_h4<_n5;_h4++){var _n6=s[t[_h4]];i.push(_n6);}return i;},{key:!1,debug:function debug(){return _this2.options.debug;}}),this.getVirtualItemForOffset=function(t){var i=_this2.getMeasurements();if(0!==i.length)return s(i[f(0,i.length-1,function(t){return s(i[t]).start;},t)]);},this.getMaxScrollOffset=function(){if(!_this2.scrollElement)return 0;if("scrollHeight"in _this2.scrollElement)return _this2.options.horizontal?_this2.scrollElement.scrollWidth-_this2.scrollElement.clientWidth:_this2.scrollElement.scrollHeight-_this2.scrollElement.clientHeight;{var _t8=_this2.scrollElement.document.documentElement;return _this2.options.horizontal?_t8.scrollWidth-_this2.scrollElement.innerWidth:_t8.scrollHeight-_this2.scrollElement.innerHeight;}},this.getOffsetForAlignment=function(t,s){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;if(!_this2.scrollElement)return 0;var h=_this2.getSize(),n=_this2.getScrollOffset();"auto"===s&&(s=t>=n+h?"end":"start"),"center"===s?t+=(i-h)/2:"end"===s&&(t-=h);var e=_this2.getMaxScrollOffset();return Math.max(Math.min(e,t),0);},this.getOffsetForIndex=function(t){var s=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"auto";t=Math.max(0,Math.min(t,_this2.options.count-1));var i=_this2.getSize(),h=_this2.getScrollOffset(),n=_this2.measurementsCache[t];if(!n)return;if("auto"===s)if(n.end>=h+i-_this2.options.scrollPaddingEnd)s="end";else{if(!(n.start<=h+_this2.options.scrollPaddingStart))return[h,s];s="start";}if("end"===s&&t===_this2.options.count-1)return[_this2.getMaxScrollOffset(),s];var e="end"===s?n.end+_this2.options.scrollPaddingEnd:n.start-_this2.options.scrollPaddingStart;return[_this2.getOffsetForAlignment(e,s,n.size),s];},this.scrollToOffset=function(t){var _ref8=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref8$align=_ref8.align,s=_ref8$align===void 0?"start":_ref8$align,_ref8$behavior=_ref8.behavior,i=_ref8$behavior===void 0?"auto":_ref8$behavior;var h=_this2.getOffsetForAlignment(t,s),n=_this2.now();_this2.scrollState={index:null,align:s,behavior:i,startedAt:n,lastTargetOffset:h,stableFrames:0},_this2._scrollToOffset(h,{adjustments:void 0,behavior:i}),_this2.scheduleScrollReconcile();},this.scrollToIndex=function(t){var _ref9=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref9$align=_ref9.align,s=_ref9$align===void 0?"auto":_ref9$align,_ref9$behavior=_ref9.behavior,i=_ref9$behavior===void 0?"auto":_ref9$behavior;t=Math.max(0,Math.min(t,_this2.options.count-1));var h=_this2.getOffsetForIndex(t,s);if(!h)return;var _h5=_slicedToArray(h,2),n=_h5[0],e=_h5[1],r=_this2.now();_this2.scrollState={index:t,align:e,behavior:i,startedAt:r,lastTargetOffset:n,stableFrames:0},_this2._scrollToOffset(n,{adjustments:void 0,behavior:i}),_this2.scheduleScrollReconcile();},this.scrollBy=function(t){var _ref10=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref10$behavior=_ref10.behavior,s=_ref10$behavior===void 0?"auto":_ref10$behavior;var i=_this2.getScrollOffset()+t,h=_this2.now();_this2.scrollState={index:null,align:"start",behavior:s,startedAt:h,lastTargetOffset:i,stableFrames:0},_this2._scrollToOffset(i,{adjustments:void 0,behavior:s}),_this2.scheduleScrollReconcile();},this.getTotalSize=function(){var _ref11;var t;var s=_this2.getMeasurements();var i;if(0===s.length)i=_this2.options.paddingStart;else if(1===_this2.options.lanes)i=(_ref11=null==(t=s[s.length-1])?void 0:t.end)!==null&&_ref11!==void 0?_ref11:0;else{var _t9=Array(_this2.options.lanes).fill(null);var _h6=s.length-1;for(;_h6>=0&&_t9.some(function(t){return null===t;});){var _i2=s[_h6];null===_t9[_i2.lane]&&(_t9[_i2.lane]=_i2.end),_h6--;}i=Math.max.apply(Math,_toConsumableArray(_t9.filter(function(t){return null!==t;})));}return Math.max(i-_this2.options.scrollMargin+_this2.options.paddingEnd,0);},this._scrollToOffset=function(t,_ref12){var s=_ref12.adjustments,i=_ref12.behavior;_this2.options.scrollToFn(t,{behavior:i,adjustments:s},_this2);},this.measure=function(){_this2.itemSizeCache=new Map(),_this2.laneAssignments=new Map(),_this2.notify(!1);},this.setOptions(i);}return _createClass(c,[{key:"scheduleScrollReconcile",value:function scheduleScrollReconcile(){var _this3=this;this.targetWindow?null==this.rafId&&(this.rafId=this.targetWindow.requestAnimationFrame(function(){_this3.rafId=null,_this3.reconcileScroll();})):this.scrollState=null;}},{key:"reconcileScroll",value:function reconcileScroll(){if(!this.scrollState)return;if(!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3)return void(this.scrollState=null);var t=null!=this.scrollState.index?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=t?t[0]:this.scrollState.lastTargetOffset,i=s!==this.scrollState.lastTargetOffset;if(!i&&(h=s,n=this.getScrollOffset(),Math.abs(h-n)<1.01)){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1)return void(this.scrollState=null);}else this.scrollState.stableFrames=0,i&&(this.scrollState.lastTargetOffset=s,this.scrollState.behavior="auto",this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}));var h,n;this.scheduleScrollReconcile();}}]);}();f=function f(t,s,i,h){for(;t<=s;){var _n7=(t+s)/2|0,_e4=i(_n7);if(_e4<h)t=_n7+1;else{if(!(_e4>h))return _n7;s=_n7-1;}}return t>0?t-1:0;};v=/*#__PURE__*/function(){function v(t,s){var _this4=this;_classCallCheck(this,v);this.cleanup=function(){};var i=_objectSpread(_objectSpread({},s),{},{onChange:function onChange(t,i){var h;_this4.host.updateComplete.then(function(){return _this4.host.requestUpdate();}),null==(h=s.onChange)||h.call(s,t,i);}});this.virtualizer=new c(i),(this.host=t).addController(this);}return _createClass(v,[{key:"getVirtualizer",value:function getVirtualizer(){return this.virtualizer;}},{key:"hostConnected",value:function hostConnected(){this.cleanup=this.virtualizer._didMount();}},{key:"hostUpdated",value:function hostUpdated(){this.virtualizer._willUpdate();}},{key:"hostDisconnected",value:function hostDisconnected(){this.cleanup();}}]);}();_export("V",b=/*#__PURE__*/function(_v2){function b(t,s){_classCallCheck(this,b);return _callSuper(this,b,[t,_objectSpread({observeElementRect:r,observeElementOffset:a,scrollToFn:d},s)]);}_inherits(b,_v2);return _createClass(b);}(v));}};});
|
|
2
|
-
//# sourceMappingURL=index-f5e587e2.cjs.js.map
|