@aquera/nile-elements 2.0.4 → 2.0.5
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 +5 -0
- package/demo/nxtgen-classes.css +594 -0
- package/demo/nxtgen-dark.css +240 -21
- package/demo/nxtgen-utilities.css +594 -0
- package/demo/nxtgen.css +55 -0
- package/dist/index.js +51 -47
- package/dist/nile-combobox/nile-combobox.cjs.js +1 -1
- package/dist/nile-combobox/nile-combobox.cjs.js.map +1 -1
- package/dist/nile-combobox/nile-combobox.css.cjs.js +1 -1
- package/dist/nile-combobox/nile-combobox.css.cjs.js.map +1 -1
- package/dist/nile-combobox/nile-combobox.css.esm.js +28 -15
- package/dist/nile-combobox/nile-combobox.esm.js +11 -8
- package/dist/nile-combobox/portal-manager.cjs.js +1 -1
- package/dist/nile-combobox/portal-manager.cjs.js.map +1 -1
- package/dist/nile-combobox/portal-manager.esm.js +1 -1
- package/dist/nile-combobox/renderer.cjs.js +1 -1
- package/dist/nile-combobox/renderer.cjs.js.map +1 -1
- package/dist/nile-combobox/renderer.esm.js +31 -43
- package/dist/src/nile-combobox/nile-combobox.css.js +28 -15
- package/dist/src/nile-combobox/nile-combobox.css.js.map +1 -1
- package/dist/src/nile-combobox/nile-combobox.js +49 -10
- package/dist/src/nile-combobox/nile-combobox.js.map +1 -1
- package/dist/src/nile-combobox/portal-manager.js +2 -22
- package/dist/src/nile-combobox/portal-manager.js.map +1 -1
- package/dist/src/nile-combobox/renderer.d.ts +2 -3
- package/dist/src/nile-combobox/renderer.js +14 -45
- package/dist/src/nile-combobox/renderer.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +11 -3
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/version.cjs.js +1 -1
- package/dist/version.cjs.js.map +1 -1
- package/dist/version.esm.js +1 -1
- package/package.json +2 -1
- package/scripts/replace-version.cjs +12 -10
- package/src/nile-combobox/nile-combobox.css.ts +28 -15
- package/src/nile-combobox/nile-combobox.ts +61 -12
- package/src/nile-combobox/portal-manager.ts +4 -22
- package/src/nile-combobox/renderer.ts +26 -69
- package/src/version.ts +11 -2
|
@@ -999,8 +999,43 @@ let NileCombobox = class NileCombobox extends NileElement {
|
|
|
999
999
|
this.popup.popup.style.visibility = 'hidden';
|
|
1000
1000
|
}
|
|
1001
1001
|
this.popup.active = true;
|
|
1002
|
-
|
|
1003
|
-
await
|
|
1002
|
+
// Wait for Lit to render the listbox and attach scrollElementRef.
|
|
1003
|
+
await this.updateComplete;
|
|
1004
|
+
const scrollEl = this.isHorizontalGrid
|
|
1005
|
+
? this.hScrollElementRef.value
|
|
1006
|
+
: this.scrollElementRef.value;
|
|
1007
|
+
await new Promise(resolve => {
|
|
1008
|
+
let attempts = 0;
|
|
1009
|
+
const maxAttempts = 10;
|
|
1010
|
+
const check = () => {
|
|
1011
|
+
attempts++;
|
|
1012
|
+
const hasSize = this.isHorizontalGrid
|
|
1013
|
+
? (scrollEl?.offsetWidth ?? 0) > 0
|
|
1014
|
+
: (scrollEl?.offsetHeight ?? 0) > 0;
|
|
1015
|
+
if (hasSize || attempts >= maxAttempts) {
|
|
1016
|
+
resolve();
|
|
1017
|
+
}
|
|
1018
|
+
else {
|
|
1019
|
+
requestAnimationFrame(check);
|
|
1020
|
+
}
|
|
1021
|
+
};
|
|
1022
|
+
requestAnimationFrame(check);
|
|
1023
|
+
});
|
|
1024
|
+
if (this.isHorizontalGrid) {
|
|
1025
|
+
const hVirtualizer = this.hVirtualizerCtrl.getVirtualizer();
|
|
1026
|
+
hVirtualizer.scrollOffset = 0;
|
|
1027
|
+
hVirtualizer.measure();
|
|
1028
|
+
}
|
|
1029
|
+
else {
|
|
1030
|
+
const virtualizer = this.virtualizerCtrl.getVirtualizer();
|
|
1031
|
+
virtualizer.scrollOffset = 0;
|
|
1032
|
+
virtualizer.measure();
|
|
1033
|
+
}
|
|
1034
|
+
this.requestUpdate();
|
|
1035
|
+
await this.updateComplete;
|
|
1036
|
+
await new Promise(resolve => {
|
|
1037
|
+
requestAnimationFrame(() => resolve());
|
|
1038
|
+
});
|
|
1004
1039
|
if (this.popup?.popup) {
|
|
1005
1040
|
this.popup.popup.style.visibility = '';
|
|
1006
1041
|
}
|
|
@@ -1098,6 +1133,7 @@ let NileCombobox = class NileCombobox extends NileElement {
|
|
|
1098
1133
|
this.updateComplete.then(() => this.formControlController.updateValidity());
|
|
1099
1134
|
}
|
|
1100
1135
|
async resetScrollPosition() {
|
|
1136
|
+
this.stickyHeaderIndex = -1;
|
|
1101
1137
|
await this.portalManager.resetScrollPosition();
|
|
1102
1138
|
}
|
|
1103
1139
|
// ── Render ──
|
|
@@ -1294,8 +1330,8 @@ let NileCombobox = class NileCombobox extends NileElement {
|
|
|
1294
1330
|
</button>
|
|
1295
1331
|
`;
|
|
1296
1332
|
}
|
|
1297
|
-
renderStickyHeaderOverlay(
|
|
1298
|
-
if (!this.stickyGroupHeader
|
|
1333
|
+
renderStickyHeaderOverlay() {
|
|
1334
|
+
if (!this.stickyGroupHeader)
|
|
1299
1335
|
return html ``;
|
|
1300
1336
|
const idx = this.stickyHeaderIndex;
|
|
1301
1337
|
if (idx < 0 || idx >= this.filteredRows.length)
|
|
@@ -1342,29 +1378,32 @@ let NileCombobox = class NileCombobox extends NileElement {
|
|
|
1342
1378
|
class="combobox__listbox ${this.isBidirectionalGrid ? 'combobox__listbox--bidirectional' : ''} ${this.portal ? 'combobox__portal-hidden' : ''}"
|
|
1343
1379
|
tabindex="-1"
|
|
1344
1380
|
@mouseup=${this.onOptionClick}
|
|
1345
|
-
@scroll=${this.onScroll}
|
|
1346
1381
|
style="${this.portal ? 'display: none;' : ''}${this.isBidirectionalGrid ? `max-height:${this.gridRows * 38 + 16}px;` : ''}"
|
|
1347
|
-
${ref(this.scrollElementRef)}
|
|
1348
1382
|
>
|
|
1349
|
-
${this.renderLoader()}
|
|
1350
1383
|
${this.renderSelectAll()}
|
|
1351
|
-
|
|
1384
|
+
<div
|
|
1385
|
+
class="combobox__options-scroll"
|
|
1386
|
+
@scroll=${this.onScroll}
|
|
1387
|
+
${ref(this.scrollElementRef)}
|
|
1388
|
+
>
|
|
1389
|
+
${this.renderLoader()}
|
|
1352
1390
|
${this.showNoResults && !this.optionsLoading && !this.loading
|
|
1353
1391
|
? this.renderEmptyState()
|
|
1354
1392
|
: isGrid
|
|
1355
1393
|
? ComboboxRenderer.renderVirtualizedGrid(virtualItems, totalSize, this.filteredData, this.value, this.multiple, this.gridColumns, this.getDisplayText.bind(this), this.getItemValue.bind(this), this.optionsLoading || this.loading, this.allowHtmlLabel, this.renderItemConfig?.getDescription ? this.getItemDescription.bind(this) : undefined, this.renderItemConfig?.getPrefix ? this.getItemPrefix.bind(this) : undefined, this.renderItemConfig?.getSuffix ? this.getItemSuffix.bind(this) : undefined, this.isBidirectionalGrid ? this.gridColumnWidth : undefined)
|
|
1356
1394
|
: grouped
|
|
1357
1395
|
? (useVirtual
|
|
1358
|
-
? ComboboxRenderer.renderRowsVirtualized(virtualItems, totalSize, this.filteredRows, this.value, this.multiple, this.getDisplayText.bind(this), this.getItemValue.bind(this), this.optionsLoading || this.loading, this.allowHtmlLabel, this.renderItemConfig?.getDescription ? this.getItemDescription.bind(this) : undefined, this.renderItemConfig?.getPrefix ? this.getItemPrefix.bind(this) : undefined, this.renderItemConfig?.getSuffix ? this.getItemSuffix.bind(this) : undefined)
|
|
1396
|
+
? ComboboxRenderer.renderRowsVirtualized(virtualItems, totalSize, this.filteredRows, this.value, this.multiple, this.getDisplayText.bind(this), this.getItemValue.bind(this), this.optionsLoading || this.loading, this.allowHtmlLabel, this.renderItemConfig?.getDescription ? this.getItemDescription.bind(this) : undefined, this.renderItemConfig?.getPrefix ? this.getItemPrefix.bind(this) : undefined, this.renderItemConfig?.getSuffix ? this.getItemSuffix.bind(this) : undefined, undefined, this.renderStickyHeaderOverlay(), this.stickyGroupHeader ? this.stickyHeaderIndex : -1)
|
|
1359
1397
|
: ComboboxRenderer.renderRowsPlain(this.filteredRows, this.value, this.multiple, this.getDisplayText.bind(this), this.getItemValue.bind(this), this.showNoResults, this.noResultsMessage, this.optionsLoading || this.loading, this.onScroll.bind(this), this.allowHtmlLabel, this.renderItemConfig?.getDescription ? this.getItemDescription.bind(this) : undefined, this.renderItemConfig?.getPrefix ? this.getItemPrefix.bind(this) : undefined, this.renderItemConfig?.getSuffix ? this.getItemSuffix.bind(this) : undefined, undefined, this.hasActiveFilter ? this.noResultsSubtitle : undefined))
|
|
1360
1398
|
: useVirtual
|
|
1361
|
-
? ComboboxRenderer.renderVirtualizedOptions(virtualItems, totalSize, this.filteredData, this.value, this.multiple, this.getDisplayText.bind(this), this.getItemValue.bind(this), this.optionsLoading || this.loading, this.allowHtmlLabel,
|
|
1399
|
+
? ComboboxRenderer.renderVirtualizedOptions(virtualItems, totalSize, this.filteredData, this.value, this.multiple, this.getDisplayText.bind(this), this.getItemValue.bind(this), this.optionsLoading || this.loading, this.allowHtmlLabel, this.renderItemConfig?.getDescription ? this.getItemDescription.bind(this) : undefined, this.renderItemConfig?.getPrefix ? this.getItemPrefix.bind(this) : undefined, this.renderItemConfig?.getSuffix ? this.getItemSuffix.bind(this) : undefined)
|
|
1362
1400
|
: ComboboxRenderer.renderPlainOptions(this.filteredData, this.value, this.multiple, this.getDisplayText.bind(this), this.getItemValue.bind(this), this.showNoResults, this.noResultsMessage, this.optionsLoading || this.loading, this.onScroll.bind(this), this.allowHtmlLabel, this.renderItemConfig?.getDescription ? this.getItemDescription.bind(this) : undefined, this.renderItemConfig?.getPrefix ? this.getItemPrefix.bind(this) : undefined, this.renderItemConfig?.getSuffix ? this.getItemSuffix.bind(this) : undefined, undefined, this.hasActiveFilter ? this.noResultsSubtitle : undefined)}
|
|
1363
1401
|
${showAddOption ? html `
|
|
1364
1402
|
<div @mouseup=${(e) => { e.stopPropagation(); this.addCustomValue(this.searchValue.trim()); }}>
|
|
1365
1403
|
${ComboboxRenderer.renderAddCustomOption(this.searchValue.trim(), this.multiple)}
|
|
1366
1404
|
</div>
|
|
1367
1405
|
` : ''}
|
|
1406
|
+
</div>
|
|
1368
1407
|
${this.multiple && this.showFooter && !this.selectAllEnabled ? this.renderFooter() : ''}
|
|
1369
1408
|
</div>
|
|
1370
1409
|
`;
|