@aquera/nile-elements 0.1.73-beta-1.8 → 0.1.73-beta-1.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 +0 -3
- package/demo/index.html +9 -47
- package/dist/axe.min-2b379f29.cjs.js +12 -0
- package/dist/axe.min-2b379f29.cjs.js.map +1 -0
- package/dist/axe.min-c2cd8733.esm.js +12 -0
- package/dist/{fixture-90b199c4.esm.js → fixture-2b5b3aba.esm.js} +1 -1
- package/dist/{fixture-5b79f853.cjs.js → fixture-3bfb4490.cjs.js} +2 -2
- package/dist/{fixture-5b79f853.cjs.js.map → fixture-3bfb4490.cjs.js.map} +1 -1
- package/dist/{fixture-dbd66009.cjs.js → fixture-7bfb866e.cjs.js} +2 -2
- package/dist/fixture-7bfb866e.cjs.js.map +1 -0
- package/dist/{fixture-cf7bfcf5.esm.js → fixture-8edec91c.esm.js} +1 -1
- package/dist/fixture-e7023246.esm.js +569 -0
- package/dist/fixture-fe6c932e.cjs.js +395 -0
- package/dist/{fixture-dbd66009.cjs.js.map → fixture-fe6c932e.cjs.js.map} +1 -1
- package/dist/index.js +4 -5
- package/dist/nile-accordion/nile-accordian.test.cjs.js +1 -1
- package/dist/nile-accordion/nile-accordian.test.esm.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +1 -1
- package/dist/nile-avatar/nile-avatar.test.cjs.js +1 -1
- package/dist/nile-avatar/nile-avatar.test.esm.js +1 -1
- package/dist/nile-badge/nile-badge.test.cjs.js +1 -1
- package/dist/nile-badge/nile-badge.test.esm.js +1 -1
- package/dist/nile-button/nile-button.test.cjs.js +1 -1
- package/dist/nile-button/nile-button.test.esm.js +1 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js +1 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.esm.js +1 -1
- package/dist/nile-calendar/nile-calendar.test.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.test.esm.js +1 -1
- package/dist/nile-card/nile-card.test.cjs.js +1 -1
- package/dist/nile-card/nile-card.test.esm.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.test.cjs.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.test.esm.js +1 -1
- package/dist/nile-chip/nile-chip.test.cjs.js +1 -1
- package/dist/nile-chip/nile-chip.test.esm.js +1 -1
- package/dist/nile-dialog/nile-dialog.test.cjs.js +1 -1
- package/dist/nile-dialog/nile-dialog.test.esm.js +1 -1
- package/dist/nile-drawer/nile-drawer.test.cjs.js +1 -1
- package/dist/nile-drawer/nile-drawer.test.esm.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.test.cjs.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.test.esm.js +1 -1
- package/dist/nile-empty-state/nile-empty-state.test.cjs.js +1 -1
- package/dist/nile-empty-state/nile-empty-state.test.esm.js +1 -1
- package/dist/nile-error-message/nile-error-message.test.cjs.js +1 -1
- package/dist/nile-error-message/nile-error-message.test.esm.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.test.cjs.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.test.esm.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.test.cjs.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.test.esm.js +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.esm.js +1 -1
- package/dist/nile-form-group/nile-form-group.test.cjs.js +1 -1
- package/dist/nile-form-group/nile-form-group.test.esm.js +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.esm.js +1 -1
- package/dist/nile-hero/nile-hero.test.cjs.js +1 -1
- package/dist/nile-hero/nile-hero.test.esm.js +1 -1
- package/dist/nile-icon/nile-icon.test.cjs.js +1 -1
- package/dist/nile-icon/nile-icon.test.esm.js +1 -1
- package/dist/nile-input/nile-input.test.cjs.js +1 -1
- package/dist/nile-input/nile-input.test.esm.js +1 -1
- package/dist/nile-link/nile-link.test.cjs.js +1 -1
- package/dist/nile-link/nile-link.test.esm.js +1 -1
- package/dist/nile-loader/nile-loader.test.cjs.js +1 -1
- package/dist/nile-loader/nile-loader.test.esm.js +1 -1
- package/dist/nile-popover/nile-popover.test.cjs.js +1 -1
- package/dist/nile-popover/nile-popover.test.esm.js +1 -1
- package/dist/nile-popup/nile-popup.test.cjs.js +1 -1
- package/dist/nile-popup/nile-popup.test.esm.js +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.esm.js +1 -1
- package/dist/nile-radio/nile-radio.test.cjs.js +1 -1
- package/dist/nile-radio/nile-radio.test.esm.js +1 -1
- package/dist/nile-radio-group/nile-radio-group.test.cjs.js +1 -1
- package/dist/nile-radio-group/nile-radio-group.test.esm.js +1 -1
- package/dist/nile-select/nile-select.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.test.cjs.js +1 -1
- package/dist/nile-select/nile-select.test.esm.js +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.test.esm.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.test.cjs.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.test.esm.js +1 -1
- package/dist/nile-textarea/nile-textarea.test.cjs.js +1 -1
- package/dist/nile-textarea/nile-textarea.test.esm.js +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.cjs.js +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.cjs.js.map +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.esm.js +2 -2
- package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.test.esm.js +1 -1
- package/dist/nile-virtual-select/renderer.cjs.js +1 -1
- package/dist/nile-virtual-select/renderer.cjs.js.map +1 -1
- package/dist/nile-virtual-select/renderer.esm.js +3 -4
- package/dist/src/nile-icon/icons/svg/ng-lock-03.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/ng-lock-03.js +5 -0
- package/dist/src/nile-icon/icons/svg/ng-lock-03.js.map +1 -0
- package/dist/src/nile-select/nile-select.js.map +1 -1
- package/dist/src/nile-virtual-select/nile-virtual-select.d.ts +1 -9
- package/dist/src/nile-virtual-select/nile-virtual-select.js +5 -55
- package/dist/src/nile-virtual-select/nile-virtual-select.js.map +1 -1
- package/dist/src/nile-virtual-select/renderer.d.ts +2 -2
- package/dist/src/nile-virtual-select/renderer.js +5 -6
- package/dist/src/nile-virtual-select/renderer.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-select/nile-select.ts +11 -11
- package/src/nile-virtual-select/nile-virtual-select.ts +7 -68
- package/src/nile-virtual-select/renderer.ts +5 -7
- package/vscode-html-custom-data.json +1 -17
- package/dist/src/internal/resizable-helper.d.ts +0 -59
- package/dist/src/internal/resizable-helper.js +0 -115
- package/dist/src/internal/resizable-helper.js.map +0 -1
- package/dist/src/internal/resizable-styles.d.ts +0 -16
- package/dist/src/internal/resizable-styles.js +0 -144
- package/dist/src/internal/resizable-styles.js.map +0 -1
- package/dist/src/nile-badge/__snapshots__/nile-badge.test.snap.js +0 -17
- package/dist/src/nile-calendar/__snapshots__/nile-calendar.test.snap.js +0 -310
- package/dist/src/nile-card/__snapshots__/nile-card.test.snap.js +0 -34
- package/dist/src/nile-checkbox/__snapshots__/nile-checkbox.test.snap.js +0 -31
- package/dist/src/nile-grid/data-processor.d.ts +0 -37
- package/dist/src/nile-grid/data-processor.js +0 -122
- package/dist/src/nile-grid/data-processor.js.map +0 -1
- package/dist/src/nile-grid/event-handlers.d.ts +0 -35
- package/dist/src/nile-grid/event-handlers.js +0 -158
- package/dist/src/nile-grid/event-handlers.js.map +0 -1
- package/dist/src/nile-grid/index.d.ts +0 -5
- package/dist/src/nile-grid/index.js +0 -6
- package/dist/src/nile-grid/index.js.map +0 -1
- package/dist/src/nile-grid/nile-grid.css.d.ts +0 -1
- package/dist/src/nile-grid/nile-grid.css.js +0 -120
- package/dist/src/nile-grid/nile-grid.css.js.map +0 -1
- package/dist/src/nile-grid/nile-grid.d.ts +0 -39
- package/dist/src/nile-grid/nile-grid.js +0 -182
- package/dist/src/nile-grid/nile-grid.js.map +0 -1
- package/dist/src/nile-grid/renderer.d.ts +0 -8
- package/dist/src/nile-grid/renderer.js +0 -78
- package/dist/src/nile-grid/renderer.js.map +0 -1
- package/dist/src/nile-grid/resize-handler.d.ts +0 -4
- package/dist/src/nile-grid/resize-handler.js +0 -36
- package/dist/src/nile-grid/resize-handler.js.map +0 -1
- package/dist/src/nile-grid/types.d.ts +0 -32
- package/dist/src/nile-grid/types.js +0 -2
- package/dist/src/nile-grid/types.js.map +0 -1
- package/dist/src/nile-grid/utils.d.ts +0 -4
- package/dist/src/nile-grid/utils.js +0 -32
- package/dist/src/nile-grid/utils.js.map +0 -1
- package/dist/src/nile-hero/__snapshots__/nile-hero.test.snap.js +0 -47
- package/dist/src/nile-icon/__snapshots__/nile-icon.test.snap.js +0 -16
- package/dist/src/nile-input/__snapshots__/nile-input.test.snap.js +0 -75
- package/dist/src/nile-popover/__snapshots__/nile-popover.test.snap.js +0 -22
- package/dist/src/nile-table-body/virtual-scroll-helper.d.ts +0 -9
- package/dist/src/nile-table-body/virtual-scroll-helper.js +0 -24
- package/dist/src/nile-table-body/virtual-scroll-helper.js.map +0 -1
- package/dist/src/nile-virtual-table-body/index.d.ts +0 -2
- package/dist/src/nile-virtual-table-body/index.js +0 -3
- package/dist/src/nile-virtual-table-body/index.js.map +0 -1
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.css.d.ts +0 -1
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.css.js +0 -44
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.css.js.map +0 -1
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.d.ts +0 -50
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.js +0 -135
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.js.map +0 -1
- package/dist/src/nile-virtual-table-body/renderer.d.ts +0 -16
- package/dist/src/nile-virtual-table-body/renderer.js +0 -49
- package/dist/src/nile-virtual-table-body/renderer.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": "0.1.73-beta-1.
|
6
|
+
"version": "0.1.73-beta-1.9",
|
7
7
|
"main": "dist/src/index.js",
|
8
8
|
"type": "module",
|
9
9
|
"module": "dist/src/index.js",
|
@@ -118,7 +118,7 @@ export class NileSelect extends NileElement implements NileFormControl{
|
|
118
118
|
private typeToSelectString = '';
|
119
119
|
private typeToSelectTimeout: number;
|
120
120
|
private scrollTimeout: number | undefined;
|
121
|
-
private scrolling = false
|
121
|
+
private scrolling = false
|
122
122
|
|
123
123
|
@query('.select') popup: NilePopup;
|
124
124
|
@query('.select__combobox') combobox: HTMLSlotElement;
|
@@ -845,11 +845,11 @@ export class NileSelect extends NileElement implements NileFormControl{
|
|
845
845
|
|
846
846
|
handleSearchChange(e: any) {
|
847
847
|
this.searchValue = e.detail.value;
|
848
|
-
this.emit('nile-search', {
|
848
|
+
this.emit('nile-search', {
|
849
849
|
query: this.searchValue,
|
850
|
-
name: this.name
|
850
|
+
name: this.name
|
851
851
|
});
|
852
|
-
|
852
|
+
|
853
853
|
if(this.enableGroupHeader) {
|
854
854
|
this.handleGroupSearchChange();
|
855
855
|
}
|
@@ -866,7 +866,7 @@ export class NileSelect extends NileElement implements NileFormControl{
|
|
866
866
|
|
867
867
|
handleScroll(e: Event): void {
|
868
868
|
const target = e.target as HTMLElement;
|
869
|
-
|
869
|
+
|
870
870
|
this.emit('nile-scroll', {
|
871
871
|
scrollTop: target.scrollTop,
|
872
872
|
scrollLeft: target.scrollLeft,
|
@@ -891,12 +891,12 @@ export class NileSelect extends NileElement implements NileFormControl{
|
|
891
891
|
|
892
892
|
const isAtBottom = Math.ceil(target.scrollTop) >= Math.floor(target.scrollHeight - target.offsetHeight);
|
893
893
|
if (isAtBottom) {
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
894
|
+
this.emit('nile-scroll-end', {
|
895
|
+
scrollTop: target.scrollTop,
|
896
|
+
scrollLeft: target.scrollLeft,
|
897
|
+
name: this.name,
|
898
|
+
isAtBottom: true
|
899
|
+
});
|
900
900
|
}
|
901
901
|
}
|
902
902
|
|
@@ -29,7 +29,7 @@ import { HasSlotController } from '../internal/slot';
|
|
29
29
|
import { waitForEvent } from '../internal/event';
|
30
30
|
import { watch } from '../internal/watch';
|
31
31
|
import NileElement from '../internal/nile-element';
|
32
|
-
import type { CSSResultGroup,
|
32
|
+
import type { CSSResultGroup, TemplateResult } from 'lit';
|
33
33
|
import type { NileFormControl } from '../internal/nile-element';
|
34
34
|
import type NileOption from '../nile-option/nile-option';
|
35
35
|
import type NilePopup from '../nile-popup/nile-popup';
|
@@ -73,10 +73,6 @@ import { VirtualSelectRenderer } from './renderer.js';
|
|
73
73
|
* @event nile-hide - Emitted when the select's menu closes.
|
74
74
|
* @event nile-after-hide - Emitted after the select's menu closes and all animations are complete.
|
75
75
|
* @event nile-invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.
|
76
|
-
* @event nile-search - Emitted when the user types in the search input. The event payload includes the search query for backend search functionality.
|
77
|
-
* @event nile-scroll - Emitted when the user scrolls within the virtualized container. The event payload includes scroll position information.
|
78
|
-
* @event nile-scroll-start - Emitted when the user starts scrolling within the virtualized container.
|
79
|
-
* @event nile-scroll-end - Emitted when the user stops scrolling and reaches the bottom of the virtualized container (debounced).
|
80
76
|
*
|
81
77
|
* @csspart form-control - The form control that wraps the label, input, and help text.
|
82
78
|
* @csspart form-control-label - The label's wrapper.
|
@@ -115,9 +111,6 @@ export class NileVirtualSelect extends NileElement implements NileFormControl {
|
|
115
111
|
@state() displayLabel = '';
|
116
112
|
@state() selectedOptions: VirtualOption[] = [];
|
117
113
|
@state() oldValue: string | string[] = '';
|
118
|
-
|
119
|
-
private scrollTimeout: number | undefined;
|
120
|
-
private scrolling = false;
|
121
114
|
|
122
115
|
/** The name of the select, submitted as a name/value pair with form data. */
|
123
116
|
@property() name = '';
|
@@ -272,17 +265,6 @@ export class NileVirtualSelect extends NileElement implements NileFormControl {
|
|
272
265
|
|
273
266
|
disconnectedCallback() {
|
274
267
|
this.removeOpenListeners();
|
275
|
-
// Clear any pending scroll timeout to prevent memory leaks
|
276
|
-
if (this.scrollTimeout) {
|
277
|
-
clearTimeout(this.scrollTimeout);
|
278
|
-
this.scrollTimeout = undefined;
|
279
|
-
}
|
280
|
-
}
|
281
|
-
|
282
|
-
protected updated(changedProperties: PropertyValues): void {
|
283
|
-
if(changedProperties.has('value')) {
|
284
|
-
this.selectionChanged();
|
285
|
-
}
|
286
268
|
}
|
287
269
|
|
288
270
|
private initializeComponent(): void {
|
@@ -646,54 +628,12 @@ export class NileVirtualSelect extends NileElement implements NileFormControl {
|
|
646
628
|
|
647
629
|
handleSearchChange(e: any): void {
|
648
630
|
this.searchValue = e.detail.value;
|
649
|
-
|
650
|
-
this.emit('nile-search', {
|
651
|
-
query: this.searchValue,
|
652
|
-
name: this.name
|
653
|
-
});
|
654
|
-
|
655
631
|
if (!this.disableLocalSearch) {
|
656
632
|
this.filterVirtualOptions(this.searchValue);
|
657
633
|
this.resetScrollPosition();
|
658
634
|
}
|
659
635
|
}
|
660
636
|
|
661
|
-
handleScroll(e: Event): void {
|
662
|
-
const target = e.target as HTMLElement;
|
663
|
-
|
664
|
-
this.emit('nile-scroll', {
|
665
|
-
scrollTop: target.scrollTop,
|
666
|
-
scrollLeft: target.scrollLeft,
|
667
|
-
name: this.name
|
668
|
-
});
|
669
|
-
|
670
|
-
if (!this.scrolling) {
|
671
|
-
this.scrolling = true;
|
672
|
-
this.emit('nile-scroll-start', {
|
673
|
-
scrollTop: target.scrollTop,
|
674
|
-
scrollLeft: target.scrollLeft,
|
675
|
-
name: this.name
|
676
|
-
});
|
677
|
-
}
|
678
|
-
|
679
|
-
clearTimeout(this.scrollTimeout);
|
680
|
-
this.scrollTimeout = window.setTimeout(() => {
|
681
|
-
if (this.scrolling) {
|
682
|
-
this.scrolling = false;
|
683
|
-
}
|
684
|
-
}, 300);
|
685
|
-
|
686
|
-
const isAtBottom = Math.ceil(target.scrollTop) >= Math.floor(target.scrollHeight - target.offsetHeight);
|
687
|
-
if (isAtBottom) {
|
688
|
-
this.emit('nile-scroll-end', {
|
689
|
-
scrollTop: target.scrollTop,
|
690
|
-
scrollLeft: target.scrollLeft,
|
691
|
-
name: this.name,
|
692
|
-
isAtBottom: true
|
693
|
-
});
|
694
|
-
}
|
695
|
-
}
|
696
|
-
|
697
637
|
filterVirtualOptions(searchValue: string): void {
|
698
638
|
const result = VirtualSelectSearchManager.filterVirtualOptions(
|
699
639
|
searchValue,
|
@@ -730,10 +670,6 @@ export class NileVirtualSelect extends NileElement implements NileFormControl {
|
|
730
670
|
|
731
671
|
@watch('data', { waitUntilFirstUpdate: true })
|
732
672
|
handleDataChange(): void {
|
733
|
-
if (this.data.length > 0 && this.open) {
|
734
|
-
this.originalOptionItems = [...this.data];
|
735
|
-
}
|
736
|
-
|
737
673
|
this.selectionChanged();
|
738
674
|
// Show no results message when data is empty and not loading
|
739
675
|
if (!this.optionsLoading && this.data.length === 0) {
|
@@ -742,6 +678,10 @@ export class NileVirtualSelect extends NileElement implements NileFormControl {
|
|
742
678
|
this.showNoResults = false;
|
743
679
|
}
|
744
680
|
this.requestUpdate();
|
681
|
+
|
682
|
+
if (this.open) {
|
683
|
+
this.resetScrollPosition();
|
684
|
+
}
|
745
685
|
}
|
746
686
|
|
747
687
|
@watch('renderItemConfig', { waitUntilFirstUpdate: true })
|
@@ -805,7 +745,7 @@ export class NileVirtualSelect extends NileElement implements NileFormControl {
|
|
805
745
|
}
|
806
746
|
|
807
747
|
private initializeOriginalItems(): void {
|
808
|
-
if (this.data.length > 0) {
|
748
|
+
if (this.originalOptionItems.length === 0 && this.data.length > 0) {
|
809
749
|
this.originalOptionItems = [...this.data];
|
810
750
|
}
|
811
751
|
}
|
@@ -1257,8 +1197,7 @@ export class NileVirtualSelect extends NileElement implements NileFormControl {
|
|
1257
1197
|
this.renderItemConfig?.getValue,
|
1258
1198
|
this.showNoResults,
|
1259
1199
|
this.noResultsMessage,
|
1260
|
-
this.optionsLoading
|
1261
|
-
this.handleScroll.bind(this)
|
1200
|
+
this.optionsLoading
|
1262
1201
|
);
|
1263
1202
|
}
|
1264
1203
|
|
@@ -21,8 +21,7 @@ export class VirtualSelectRenderer {
|
|
21
21
|
getItemValue?: (item: any) => string,
|
22
22
|
showNoResults?: boolean,
|
23
23
|
noResultsMessage?: string,
|
24
|
-
optionsLoading?: boolean
|
25
|
-
onScroll?: (e: Event) => void
|
24
|
+
optionsLoading?: boolean
|
26
25
|
): TemplateResult {
|
27
26
|
return html`
|
28
27
|
<div part="select-options" class="select__options ${
|
@@ -38,7 +37,6 @@ export class VirtualSelectRenderer {
|
|
38
37
|
<div
|
39
38
|
class="virtualized"
|
40
39
|
part="virtualized"
|
41
|
-
@scroll=${onScroll}
|
42
40
|
>
|
43
41
|
${VirtualSelectRenderer.shouldUseVirtualizer(data)
|
44
42
|
? html`
|
@@ -72,8 +70,8 @@ export class VirtualSelectRenderer {
|
|
72
70
|
|
73
71
|
const optionValue = valueFn(item);
|
74
72
|
const displayText = displayTextFn(item);
|
75
|
-
const isDisabled = item
|
76
|
-
const className = item
|
73
|
+
const isDisabled = item.disabled || false;
|
74
|
+
const className = item.className;
|
77
75
|
|
78
76
|
let isSelected = false;
|
79
77
|
if (multiple) {
|
@@ -97,9 +95,9 @@ export class VirtualSelectRenderer {
|
|
97
95
|
|
98
96
|
/**
|
99
97
|
* Determines whether to use virtualizer based on dataset size
|
100
|
-
* For small datasets (less than
|
98
|
+
* For small datasets (less than 50 items), use regular rendering for better sizing
|
101
99
|
*/
|
102
100
|
private static shouldUseVirtualizer(data: any[]): boolean {
|
103
|
-
return data.length >=
|
101
|
+
return data.length >= 50;
|
104
102
|
}
|
105
103
|
}
|
@@ -4356,7 +4356,7 @@
|
|
4356
4356
|
},
|
4357
4357
|
{
|
4358
4358
|
"name": "nile-virtual-select",
|
4359
|
-
"description": "Events:\n\n * `nile-change` {} - Emitted when the control's value changes.\n\n * `nile-clear` {} - Emitted when the control's value is cleared.\n\n * `nile-input` {} - Emitted when the control receives input.\n\n * `nile-focus` {} - Emitted when the control gains focus.\n\n * `nile-blur` {} - Emitted when the control loses focus.\n\n * `nile-show` {} - Emitted when the select's menu opens.\n\n * `nile-after-show` {} - Emitted after the select's menu opens and all animations are complete.\n\n * `nile-hide` {} - Emitted when the select's menu closes.\n\n * `nile-after-hide` {} - Emitted after the select's menu closes and all animations are complete.\n\n * `nile-invalid` {} - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n\
|
4359
|
+
"description": "Events:\n\n * `nile-change` {} - Emitted when the control's value changes.\n\n * `nile-clear` {} - Emitted when the control's value is cleared.\n\n * `nile-input` {} - Emitted when the control receives input.\n\n * `nile-focus` {} - Emitted when the control gains focus.\n\n * `nile-blur` {} - Emitted when the control loses focus.\n\n * `nile-show` {} - Emitted when the select's menu opens.\n\n * `nile-after-show` {} - Emitted after the select's menu opens and all animations are complete.\n\n * `nile-hide` {} - Emitted when the select's menu closes.\n\n * `nile-after-hide` {} - Emitted after the select's menu closes and all animations are complete.\n\n * `nile-invalid` {} - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n\nSlots:\n\n * `label` {} - The input's label. Alternatively, you can use the `label` attribute.\n\n * `prefix` {} - Used to prepend a presentational icon or similar element to the combobox.\n\n * `clear-icon` {} - An icon to use in lieu of the default clear icon.\n\n * `expand-icon` {} - The icon to show when the control is expanded and collapsed.\n\n * `help-text` {} - Text that describes how to use the input. Alternatively, you can use the `help-text` attribute.\n\nAttributes:\n\n * `data` - Array of all option items for virtual scrolling\n\n * `size` {`\"medium\" | \"small\" | \"large\"`} - The select's size.\n\n * `placeholder` {`string`} - Placeholder text to show as a hint when the select is empty.\n\n * `searchEnabled` {`boolean`} - Enable search functionality\n\n * `internal-search-placeholder` {`string`} - Search input placeholder\n\n * `disableLocalSearch` {`boolean`} - Disable local search filtering\n\n * `optionsLoading` {`boolean`} - Show loading state\n\n * `multiple` {`boolean`} - Allows more than one option to be selected.\n\n * `help-text` {`string`} - Help text\n\n * `error-message` {`string`} - Error message\n\n * `warning` {`boolean`} - Sets the input to a warning state\n\n * `error` {`boolean`} - Sets the input to an error state\n\n * `success` {`boolean`} - Sets the input to a success state\n\n * `clearable` {`boolean`} - Adds a clear button when the select is not empty.\n\n * `open` {`boolean`} - The select's open state.\n\n * `hoist` {`boolean`} - Enable this option to prevent the listbox from being clipped when the component is placed inside a container with\n`overflow: auto|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.\n\n * `filled` {`boolean`} - Draws a filled select.\n\n * `pill` {`boolean`} - Draws a pill-style select with rounded edges.\n\n * `label` {`string`} - The select's label. If you need to display HTML, use the `label` slot instead.\n\n * `placement` {`\"top\" | \"bottom\"`} - The preferred placement of the select's menu. Note that the actual placement may vary as needed to keep the listbox\ninside of the viewport.\n\n * `showNoResults` {`boolean`} - Show no results message\n\n * `noResultsMessage` {`string`} - No results message\n\n * `showSelected` {`boolean`} - Show selected options only\n\n * `blockValueChange` {`boolean`} - Block value change events\n\n * `noWidthSync` {`boolean`} - Disable width synchronization\n\n * `max-options-visible` {`number`} - The maximum number of selected options to show when `multiple` is true. After the maximum, \"+n\" will be shown to\nindicate the number of additional items that are selected. Set to 0 to remove the limit.\n\n * `name` {`string`} - The name of the select, submitted as a name/value pair with form data.\n\n * `value` {`string | string[]`} - The current value of the select. When `multiple` is enabled, the value will be an array of selected values.\n\n * `disabled` {`boolean`} - Disables the select control.\n\n * `form` {`string`} - By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you\nto place the form control outside of a form and associate it with the form that has this `id`. The form must be in\nthe same document or shadow root for this to work.\n\n * `required` {`boolean`} - The select's required attribute.\n\nProperties:\n\n * `styles` - \n\n * `formControlController` - \n\n * `hasSlotController` - \n\n * `popup` - \n\n * `displayInput` {`HTMLInputElement`} - \n\n * `valueInput` {`HTMLInputElement`} - \n\n * `virtualizedContainer` {`HTMLElement`} - \n\n * `hasFocus` {`boolean`} - \n\n * `displayLabel` {`string`} - \n\n * `selectedOptions` {`VirtualOption[]`} - \n\n * `oldValue` {`string | string[]`} - \n\n * `data` - Array of all option items for virtual scrolling\n\n * `originalOptionItems` - Original unfiltered option items for search functionality\n\n * `size` {`\"medium\" | \"small\" | \"large\"`} - The select's size.\n\n * `placeholder` {`string`} - Placeholder text to show as a hint when the select is empty.\n\n * `searchValue` {`string`} - Current search value\n\n * `searchEnabled` {`boolean`} - Enable search functionality\n\n * `internalSearchPlaceHolder` {`string`} - Search input placeholder\n\n * `disableLocalSearch` {`boolean`} - Disable local search filtering\n\n * `optionsLoading` {`boolean`} - Show loading state\n\n * `multiple` {`boolean`} - Allows more than one option to be selected.\n\n * `helpText` {`string`} - Help text\n\n * `errorMessage` {`string`} - Error message\n\n * `warning` {`boolean`} - Sets the input to a warning state\n\n * `error` {`boolean`} - Sets the input to an error state\n\n * `success` {`boolean`} - Sets the input to a success state\n\n * `clearable` {`boolean`} - Adds a clear button when the select is not empty.\n\n * `open` {`boolean`} - The select's open state.\n\n * `hoist` {`boolean`} - Enable this option to prevent the listbox from being clipped when the component is placed inside a container with\n`overflow: auto|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.\n\n * `filled` {`boolean`} - Draws a filled select.\n\n * `pill` {`boolean`} - Draws a pill-style select with rounded edges.\n\n * `label` {`string`} - The select's label. If you need to display HTML, use the `label` slot instead.\n\n * `placement` {`\"top\" | \"bottom\"`} - The preferred placement of the select's menu. Note that the actual placement may vary as needed to keep the listbox\ninside of the viewport.\n\n * `showNoResults` {`boolean`} - Show no results message\n\n * `noResultsMessage` {`string`} - No results message\n\n * `showSelected` {`boolean`} - Show selected options only\n\n * `renderItemConfig` {`RenderItemConfig | undefined`} - Enhanced configuration for rendering items with support for display text, value, and search text\n\n * `blockValueChange` {`boolean`} - Block value change events\n\n * `noWidthSync` {`boolean`} - Disable width synchronization\n\n * `maxOptionsVisible` {`number`} - The maximum number of selected options to show when `multiple` is true. After the maximum, \"+n\" will be shown to\nindicate the number of additional items that are selected. Set to 0 to remove the limit.\n\n * `oldMaxOptionsVisible` {`number`} - \n\n * `handleDocumentMouseDown` - \n\n * `name` {`string`} - The name of the select, submitted as a name/value pair with form data.\n\n * `value` {`string | string[]`} - The current value of the select. When `multiple` is enabled, the value will be an array of selected values.\n\n * `disabled` {`boolean`} - Disables the select control.\n\n * `defaultValue` {`string | string[]`} - The default value of the form control. Primarily used for resetting the form control.\n\n * `defaultChecked` {`boolean | undefined`} - \n\n * `form` {`string`} - By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you\nto place the form control outside of a form and associate it with the form that has this `id`. The form must be in\nthe same document or shadow root for this to work.\n\n * `pattern` {`string | undefined`} - \n\n * `min` {`string | number | Date | undefined`} - \n\n * `max` {`string | number | Date | undefined`} - \n\n * `step` {`number | \"any\" | undefined`} - \n\n * `required` {`boolean`} - The select's required attribute.\n\n * `minlength` {`number | undefined`} - \n\n * `maxlength` {`number | undefined`} - \n\n * `validity` {`ValidityState`} - Gets the validity state object\n\n * `validationMessage` {`string`} - Gets the validation message\n\n * `checkValidity` - \n\n * `getForm` - \n\n * `reportValidity` - \n\n * `setCustomValidity` - \n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
|
4360
4360
|
"attributes": [
|
4361
4361
|
{
|
4362
4362
|
"name": "data",
|
@@ -4559,22 +4559,6 @@
|
|
4559
4559
|
{
|
4560
4560
|
"name": "onnile-invalid",
|
4561
4561
|
"description": "`nile-invalid` {} - Emitted when the form control has been checked for validity and its constraints aren't satisfied."
|
4562
|
-
},
|
4563
|
-
{
|
4564
|
-
"name": "onnile-search",
|
4565
|
-
"description": "`nile-search` {} - Emitted when the user types in the search input. The event payload includes the search query for backend search functionality."
|
4566
|
-
},
|
4567
|
-
{
|
4568
|
-
"name": "onnile-scroll",
|
4569
|
-
"description": "`nile-scroll` {} - Emitted when the user scrolls within the virtualized container. The event payload includes scroll position information."
|
4570
|
-
},
|
4571
|
-
{
|
4572
|
-
"name": "onnile-scroll-start",
|
4573
|
-
"description": "`nile-scroll-start` {} - Emitted when the user starts scrolling within the virtualized container."
|
4574
|
-
},
|
4575
|
-
{
|
4576
|
-
"name": "onnile-scroll-end",
|
4577
|
-
"description": "`nile-scroll-end` {} - Emitted when the user stops scrolling and reaches the bottom of the virtualized container (debounced)."
|
4578
4562
|
}
|
4579
4563
|
]
|
4580
4564
|
}
|
@@ -1,59 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright Aquera Inc 2023
|
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
|
-
* Resizable Helper Utility
|
9
|
-
* Provides common functionality for resizable table columns
|
10
|
-
*/
|
11
|
-
export interface ResizeOptions {
|
12
|
-
minWidth?: number;
|
13
|
-
startX: number;
|
14
|
-
startWidth: number;
|
15
|
-
element: HTMLElement;
|
16
|
-
}
|
17
|
-
export interface ColumnResizeData {
|
18
|
-
columnIndex: number;
|
19
|
-
newWidth: number;
|
20
|
-
}
|
21
|
-
/**
|
22
|
-
* Handles the start of a resize operation
|
23
|
-
* @param e Mouse event
|
24
|
-
* @param options Resize configuration options
|
25
|
-
* @returns Cleanup function to remove event listeners
|
26
|
-
*/
|
27
|
-
export declare function handleResizeStart(e: MouseEvent, options: ResizeOptions): () => void;
|
28
|
-
/**
|
29
|
-
* Gets the column index of an element within its table row
|
30
|
-
* @param element The table cell or header element
|
31
|
-
* @param selector The CSS selector for the column elements
|
32
|
-
* @returns Column index (0-based)
|
33
|
-
*/
|
34
|
-
export declare function getColumnIndex(element: HTMLElement, selector: string): number;
|
35
|
-
/**
|
36
|
-
* Synchronizes the width of all cells in the same column
|
37
|
-
* @param sourceElement The element that was resized
|
38
|
-
* @param newWidth The new width to apply
|
39
|
-
*/
|
40
|
-
export declare function synchronizeColumnWidth(sourceElement: HTMLElement, newWidth: number): void;
|
41
|
-
/**
|
42
|
-
* Checks if an element has the resizable attribute
|
43
|
-
* @param element The element to check
|
44
|
-
* @returns True if the element is resizable
|
45
|
-
*/
|
46
|
-
export declare function isResizable(element: HTMLElement): boolean;
|
47
|
-
/**
|
48
|
-
* Creates a resize handler function for use in component event listeners
|
49
|
-
* @param element The element to make resizable
|
50
|
-
* @param minWidth Minimum width constraint
|
51
|
-
* @returns Event handler function
|
52
|
-
*/
|
53
|
-
export declare function createResizeHandler(element: HTMLElement, minWidth?: number): (e: MouseEvent) => void;
|
54
|
-
/**
|
55
|
-
* Detects if any columns in a table are resizable
|
56
|
-
* @param tableBody The table body element
|
57
|
-
* @returns True if any columns have resizable attribute
|
58
|
-
*/
|
59
|
-
export declare function hasResizableColumns(tableBody: HTMLElement): boolean;
|
@@ -1,115 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright Aquera Inc 2023
|
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
|
-
* Handles the start of a resize operation
|
9
|
-
* @param e Mouse event
|
10
|
-
* @param options Resize configuration options
|
11
|
-
* @returns Cleanup function to remove event listeners
|
12
|
-
*/
|
13
|
-
export function handleResizeStart(e, options) {
|
14
|
-
e.preventDefault();
|
15
|
-
e.stopPropagation();
|
16
|
-
const { minWidth = 50, startX, startWidth, element } = options;
|
17
|
-
const resizer = e.target;
|
18
|
-
// Add resizing class for visual feedback
|
19
|
-
resizer.classList.add('resizing');
|
20
|
-
const onMouseMove = (e) => {
|
21
|
-
e.preventDefault();
|
22
|
-
e.stopPropagation();
|
23
|
-
const delta = e.pageX - startX;
|
24
|
-
const newWidth = Math.max(minWidth, startWidth + delta);
|
25
|
-
// Apply width to the current element
|
26
|
-
element.style.width = newWidth + 'px';
|
27
|
-
// Synchronize width across all cells in the same column
|
28
|
-
synchronizeColumnWidth(element, newWidth);
|
29
|
-
};
|
30
|
-
const onMouseUp = () => {
|
31
|
-
resizer.classList.remove('resizing');
|
32
|
-
document.removeEventListener('mousemove', onMouseMove);
|
33
|
-
document.removeEventListener('mouseup', onMouseUp);
|
34
|
-
};
|
35
|
-
document.addEventListener('mousemove', onMouseMove);
|
36
|
-
document.addEventListener('mouseup', onMouseUp);
|
37
|
-
// Return cleanup function
|
38
|
-
return () => {
|
39
|
-
document.removeEventListener('mousemove', onMouseMove);
|
40
|
-
document.removeEventListener('mouseup', onMouseUp);
|
41
|
-
};
|
42
|
-
}
|
43
|
-
/**
|
44
|
-
* Gets the column index of an element within its table row
|
45
|
-
* @param element The table cell or header element
|
46
|
-
* @param selector The CSS selector for the column elements
|
47
|
-
* @returns Column index (0-based)
|
48
|
-
*/
|
49
|
-
export function getColumnIndex(element, selector) {
|
50
|
-
const tableRow = element.closest('nile-table-row');
|
51
|
-
if (tableRow) {
|
52
|
-
const columns = tableRow.querySelectorAll(selector);
|
53
|
-
return Array.from(columns).indexOf(element);
|
54
|
-
}
|
55
|
-
return 0;
|
56
|
-
}
|
57
|
-
/**
|
58
|
-
* Synchronizes the width of all cells in the same column
|
59
|
-
* @param sourceElement The element that was resized
|
60
|
-
* @param newWidth The new width to apply
|
61
|
-
*/
|
62
|
-
export function synchronizeColumnWidth(sourceElement, newWidth) {
|
63
|
-
const tableBody = sourceElement.closest('nile-table-body');
|
64
|
-
if (!tableBody)
|
65
|
-
return;
|
66
|
-
const isHeader = sourceElement.tagName.toLowerCase() === 'nile-table-header-item';
|
67
|
-
const selector = isHeader ? 'nile-table-header-item' : 'nile-table-cell-item';
|
68
|
-
const targetSelector = isHeader ? 'nile-table-cell-item' : 'nile-table-cell-item';
|
69
|
-
const columnIndex = getColumnIndex(sourceElement, selector);
|
70
|
-
const rows = tableBody.querySelectorAll('nile-table-row');
|
71
|
-
rows.forEach(row => {
|
72
|
-
const cells = row.querySelectorAll(targetSelector);
|
73
|
-
if (cells[columnIndex]) {
|
74
|
-
cells[columnIndex].style.width = newWidth + 'px';
|
75
|
-
}
|
76
|
-
});
|
77
|
-
}
|
78
|
-
/**
|
79
|
-
* Checks if an element has the resizable attribute
|
80
|
-
* @param element The element to check
|
81
|
-
* @returns True if the element is resizable
|
82
|
-
*/
|
83
|
-
export function isResizable(element) {
|
84
|
-
return element.hasAttribute('resizable');
|
85
|
-
}
|
86
|
-
/**
|
87
|
-
* Creates a resize handler function for use in component event listeners
|
88
|
-
* @param element The element to make resizable
|
89
|
-
* @param minWidth Minimum width constraint
|
90
|
-
* @returns Event handler function
|
91
|
-
*/
|
92
|
-
export function createResizeHandler(element, minWidth = 50) {
|
93
|
-
return (e) => {
|
94
|
-
const options = {
|
95
|
-
minWidth,
|
96
|
-
startX: e.pageX,
|
97
|
-
startWidth: element.offsetWidth,
|
98
|
-
element
|
99
|
-
};
|
100
|
-
handleResizeStart(e, options);
|
101
|
-
};
|
102
|
-
}
|
103
|
-
/**
|
104
|
-
* Detects if any columns in a table are resizable
|
105
|
-
* @param tableBody The table body element
|
106
|
-
* @returns True if any columns have resizable attribute
|
107
|
-
*/
|
108
|
-
export function hasResizableColumns(tableBody) {
|
109
|
-
const headerItems = tableBody.querySelectorAll('nile-table-header-item');
|
110
|
-
const cellItems = tableBody.querySelectorAll('nile-table-cell-item');
|
111
|
-
const hasResizableHeaders = Array.from(headerItems).some(item => isResizable(item));
|
112
|
-
const hasResizableCells = Array.from(cellItems).some(item => isResizable(item));
|
113
|
-
return hasResizableHeaders || hasResizableCells;
|
114
|
-
}
|
115
|
-
//# sourceMappingURL=resizable-helper.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"resizable-helper.js","sourceRoot":"","sources":["../../../src/internal/resizable-helper.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * Resizable Helper Utility\n * Provides common functionality for resizable table columns\n */\n\nexport interface ResizeOptions {\n minWidth?: number;\n startX: number;\n startWidth: number;\n element: HTMLElement;\n}\n\nexport interface ColumnResizeData {\n columnIndex: number;\n newWidth: number;\n}\n\n/**\n * Handles the start of a resize operation\n * @param e Mouse event\n * @param options Resize configuration options\n * @returns Cleanup function to remove event listeners\n */\nexport function handleResizeStart(e: MouseEvent, options: ResizeOptions): () => void {\n e.preventDefault();\n e.stopPropagation();\n \n const { minWidth = 50, startX, startWidth, element } = options;\n const resizer = e.target as HTMLElement;\n \n // Add resizing class for visual feedback\n resizer.classList.add('resizing');\n\n const onMouseMove = (e: MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n \n const delta = e.pageX - startX;\n const newWidth = Math.max(minWidth, startWidth + delta);\n\n // Apply width to the current element\n element.style.width = newWidth + 'px';\n\n // Synchronize width across all cells in the same column\n synchronizeColumnWidth(element, newWidth);\n };\n\n const onMouseUp = () => {\n resizer.classList.remove('resizing');\n document.removeEventListener('mousemove', onMouseMove);\n document.removeEventListener('mouseup', onMouseUp);\n };\n\n document.addEventListener('mousemove', onMouseMove);\n document.addEventListener('mouseup', onMouseUp);\n\n // Return cleanup function\n return () => {\n document.removeEventListener('mousemove', onMouseMove);\n document.removeEventListener('mouseup', onMouseUp);\n };\n}\n\n/**\n * Gets the column index of an element within its table row\n * @param element The table cell or header element\n * @param selector The CSS selector for the column elements\n * @returns Column index (0-based)\n */\nexport function getColumnIndex(element: HTMLElement, selector: string): number {\n const tableRow = element.closest('nile-table-row');\n if (tableRow) {\n const columns = tableRow.querySelectorAll(selector);\n return Array.from(columns).indexOf(element);\n }\n return 0;\n}\n\n/**\n * Synchronizes the width of all cells in the same column\n * @param sourceElement The element that was resized\n * @param newWidth The new width to apply\n */\nexport function synchronizeColumnWidth(sourceElement: HTMLElement, newWidth: number): void {\n const tableBody = sourceElement.closest('nile-table-body');\n if (!tableBody) return;\n\n const isHeader = sourceElement.tagName.toLowerCase() === 'nile-table-header-item';\n const selector = isHeader ? 'nile-table-header-item' : 'nile-table-cell-item';\n const targetSelector = isHeader ? 'nile-table-cell-item' : 'nile-table-cell-item';\n \n const columnIndex = getColumnIndex(sourceElement, selector);\n const rows = tableBody.querySelectorAll('nile-table-row');\n \n rows.forEach(row => {\n const cells = row.querySelectorAll(targetSelector);\n if (cells[columnIndex]) {\n cells[columnIndex].style.width = newWidth + 'px';\n }\n });\n}\n\n/**\n * Checks if an element has the resizable attribute\n * @param element The element to check\n * @returns True if the element is resizable\n */\nexport function isResizable(element: HTMLElement): boolean {\n return element.hasAttribute('resizable');\n}\n\n/**\n * Creates a resize handler function for use in component event listeners\n * @param element The element to make resizable\n * @param minWidth Minimum width constraint\n * @returns Event handler function\n */\nexport function createResizeHandler(element: HTMLElement, minWidth: number = 50): (e: MouseEvent) => void {\n return (e: MouseEvent) => {\n const options: ResizeOptions = {\n minWidth,\n startX: e.pageX,\n startWidth: element.offsetWidth,\n element\n };\n \n handleResizeStart(e, options);\n };\n}\n\n/**\n * Detects if any columns in a table are resizable\n * @param tableBody The table body element\n * @returns True if any columns have resizable attribute\n */\nexport function hasResizableColumns(tableBody: HTMLElement): boolean {\n const headerItems = tableBody.querySelectorAll('nile-table-header-item');\n const cellItems = tableBody.querySelectorAll('nile-table-cell-item');\n \n const hasResizableHeaders = Array.from(headerItems).some(item => \n isResizable(item)\n );\n const hasResizableCells = Array.from(cellItems).some(item => \n isResizable(item)\n );\n \n return hasResizableHeaders || hasResizableCells;\n} \n"]}
|
@@ -1,16 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright Aquera Inc 2023
|
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
|
-
* Resizable Styles Utility
|
9
|
-
* Centralized styles for resizable table functionality
|
10
|
-
*/
|
11
|
-
export declare const resizableHostStyles: import("lit").CSSResult;
|
12
|
-
export declare const resizableHeaderStyles: import("lit").CSSResult;
|
13
|
-
export declare const resizerStyles: import("lit").CSSResult;
|
14
|
-
export declare const headerResizerStyles: import("lit").CSSResult;
|
15
|
-
export declare const resizableSlotStyles: import("lit").CSSResult;
|
16
|
-
export declare const tableLayoutStyles: import("lit").CSSResult;
|
@@ -1,144 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright Aquera Inc 2023
|
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
|
-
import { css } from 'lit';
|
8
|
-
/**
|
9
|
-
* Resizable Styles Utility
|
10
|
-
* Centralized styles for resizable table functionality
|
11
|
-
*/
|
12
|
-
export const resizableHostStyles = css `
|
13
|
-
/* Resizable-specific host styles */
|
14
|
-
:host([resizable]) {
|
15
|
-
position: relative;
|
16
|
-
overflow: hidden;
|
17
|
-
table-layout: fixed;
|
18
|
-
}
|
19
|
-
`;
|
20
|
-
export const resizableHeaderStyles = css `
|
21
|
-
/* Resizable-specific header styles */
|
22
|
-
:host([resizable]) {
|
23
|
-
position: relative;
|
24
|
-
border-right: 1px solid var(--nile-colors-neutral-400);
|
25
|
-
}
|
26
|
-
|
27
|
-
/* Resizable-specific wrapper styles */
|
28
|
-
:host([resizable]) .header__item__wrapper {
|
29
|
-
position: relative;
|
30
|
-
}
|
31
|
-
`;
|
32
|
-
export const resizerStyles = css `
|
33
|
-
/* Resizer styles - only apply when resizable */
|
34
|
-
.resizer {
|
35
|
-
position: absolute;
|
36
|
-
right: 0;
|
37
|
-
top: -1000px;
|
38
|
-
bottom: -1000px;
|
39
|
-
width: 8px;
|
40
|
-
cursor: col-resize;
|
41
|
-
user-select: none;
|
42
|
-
background-color: var(--nile-colors-neutral-100);
|
43
|
-
transition: background-color 0.2s;
|
44
|
-
z-index: 10;
|
45
|
-
opacity: 0;
|
46
|
-
transition: opacity 0.2s ease;
|
47
|
-
pointer-events: none;
|
48
|
-
}
|
49
|
-
|
50
|
-
:host([resizable]):hover .resizer {
|
51
|
-
opacity: 1;
|
52
|
-
pointer-events: auto;
|
53
|
-
}
|
54
|
-
|
55
|
-
.resizer::before {
|
56
|
-
content: '';
|
57
|
-
position: absolute;
|
58
|
-
right: 3px;
|
59
|
-
top: 0;
|
60
|
-
width: 2px;
|
61
|
-
height: 100%;
|
62
|
-
background-color: var(--nile-colors-neutral-500);
|
63
|
-
opacity: 0.8;
|
64
|
-
}
|
65
|
-
|
66
|
-
.resizer:hover {
|
67
|
-
background-color: var(--nile-colors-neutral-400);
|
68
|
-
}
|
69
|
-
|
70
|
-
.resizer:hover::before {
|
71
|
-
background-color: var(--nile-colors-neutral-700);
|
72
|
-
opacity: 1;
|
73
|
-
}
|
74
|
-
|
75
|
-
.resizer.resizing {
|
76
|
-
background-color: var(--nile-colors-neutral-400);
|
77
|
-
opacity: 1;
|
78
|
-
pointer-events: auto;
|
79
|
-
}
|
80
|
-
|
81
|
-
.resizer.resizing::before {
|
82
|
-
background-color: var(--nile-colors-neutral-700);
|
83
|
-
opacity: 1;
|
84
|
-
width: 3px;
|
85
|
-
}
|
86
|
-
`;
|
87
|
-
export const headerResizerStyles = css `
|
88
|
-
/* Header resizer styles */
|
89
|
-
.resizer {
|
90
|
-
position: absolute;
|
91
|
-
right: -2px;
|
92
|
-
top: -1000px;
|
93
|
-
bottom: -1000px;
|
94
|
-
width: 8px;
|
95
|
-
cursor: ew-resize;
|
96
|
-
user-select: none;
|
97
|
-
transition: background-color 0.2s;
|
98
|
-
z-index: 10;
|
99
|
-
opacity: 0;
|
100
|
-
transition: opacity 0.2s ease;
|
101
|
-
}
|
102
|
-
|
103
|
-
:host([resizable]):hover .resizer {
|
104
|
-
opacity: 1;
|
105
|
-
}
|
106
|
-
|
107
|
-
.resizer::before {
|
108
|
-
content: '';
|
109
|
-
position: absolute;
|
110
|
-
height: 100%;
|
111
|
-
opacity: 0.8;
|
112
|
-
}
|
113
|
-
|
114
|
-
.resizer.resizing {
|
115
|
-
border-right: 4px double var(--nile-colors-neutral-400);
|
116
|
-
background-color: transparent;
|
117
|
-
opacity: 1;
|
118
|
-
}
|
119
|
-
`;
|
120
|
-
export const resizableSlotStyles = css `
|
121
|
-
/* Slot styles for resizable mode */
|
122
|
-
:host([resizable]) ::slotted(*) {
|
123
|
-
overflow: hidden;
|
124
|
-
text-overflow: ellipsis;
|
125
|
-
white-space: nowrap;
|
126
|
-
display: block;
|
127
|
-
}
|
128
|
-
|
129
|
-
:host([resizable]) ::slotted(span),
|
130
|
-
:host([resizable]) ::slotted(div),
|
131
|
-
:host([resizable]) ::slotted(p) {
|
132
|
-
overflow: hidden;
|
133
|
-
text-overflow: ellipsis;
|
134
|
-
white-space: nowrap;
|
135
|
-
display: block;
|
136
|
-
}
|
137
|
-
`;
|
138
|
-
export const tableLayoutStyles = css `
|
139
|
-
/* Apply fixed table layout only when resizable columns are present */
|
140
|
-
.nile__table__body[resizable] {
|
141
|
-
table-layout: fixed;
|
142
|
-
}
|
143
|
-
`;
|
144
|
-
//# sourceMappingURL=resizable-styles.js.map
|