@aquera/ngx-smart-table 0.0.17-patch-0.5 → 0.0.17-patch-0.7
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/esm2020/lib/editors/index.mjs +2 -1
- package/esm2020/lib/editors/nile-chip-editor.mjs +296 -0
- package/esm2020/lib/editors/nile-code-editor.mjs +9 -10
- package/esm2020/lib/renderer/components/st-column-menu/st-column-menu.component.mjs +36 -17
- package/esm2020/lib/renderer/components/st-row-actions-dropdown/st-row-actions-dropdown.component.mjs +34 -27
- package/esm2020/lib/renderer/components/st-table/st-table.component.mjs +5 -5
- package/fesm2015/aquera-ngx-smart-table.mjs +384 -55
- package/fesm2015/aquera-ngx-smart-table.mjs.map +1 -1
- package/fesm2020/aquera-ngx-smart-table.mjs +376 -55
- package/fesm2020/aquera-ngx-smart-table.mjs.map +1 -1
- package/lib/editors/index.d.ts +1 -0
- package/lib/editors/nile-chip-editor.d.ts +95 -0
- package/lib/renderer/components/st-column-menu/st-column-menu.component.d.ts +4 -2
- package/lib/renderer/components/st-row-actions-dropdown/st-row-actions-dropdown.component.d.ts +4 -2
- package/lib/renderer/components/st-table/st-table.component.d.ts +2 -0
- package/package.json +1 -1
|
@@ -4890,6 +4890,302 @@ class NileDatePickerEditor {
|
|
|
4890
4890
|
}
|
|
4891
4891
|
}
|
|
4892
4892
|
|
|
4893
|
+
/**
|
|
4894
|
+
* Custom editor using NileChip from @aquera/nile-elements
|
|
4895
|
+
* Renders the chip input in a floating popover below the cell to avoid row height mismatch.
|
|
4896
|
+
*
|
|
4897
|
+
* @see https://nile.aqueralabs.com/1.6.3/chip?theme=enterprise
|
|
4898
|
+
*/
|
|
4899
|
+
let chipStylesInjected = false;
|
|
4900
|
+
function injectChipStyles() {
|
|
4901
|
+
if (chipStylesInjected)
|
|
4902
|
+
return;
|
|
4903
|
+
chipStylesInjected = true;
|
|
4904
|
+
const styleId = 'nile-chip-editor-styles';
|
|
4905
|
+
if (document.getElementById(styleId))
|
|
4906
|
+
return;
|
|
4907
|
+
const style = document.createElement('style');
|
|
4908
|
+
style.id = styleId;
|
|
4909
|
+
style.textContent = `
|
|
4910
|
+
.st-chip-popover {
|
|
4911
|
+
position: fixed;
|
|
4912
|
+
z-index: 10000;
|
|
4913
|
+
background: var(--nile-colors-white-base, #fff);
|
|
4914
|
+
border: 1px solid var(--nile-colors-neutral-200, #e2e8f0);
|
|
4915
|
+
border-radius: 6px;
|
|
4916
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
4917
|
+
padding: 8px;
|
|
4918
|
+
box-sizing: border-box;
|
|
4919
|
+
max-height: 200px;
|
|
4920
|
+
overflow-y: auto;
|
|
4921
|
+
}
|
|
4922
|
+
.st-chip-popover nile-chip {
|
|
4923
|
+
width: 100%;
|
|
4924
|
+
}
|
|
4925
|
+
.st-chip-popover nile-chip::part(base) {
|
|
4926
|
+
border: none !important;
|
|
4927
|
+
box-shadow: none !important;
|
|
4928
|
+
min-height: 32px;
|
|
4929
|
+
}
|
|
4930
|
+
.st-chip-popover nile-chip::part(input) {
|
|
4931
|
+
font-size: var(--nile-font-size-small, 13px);
|
|
4932
|
+
}
|
|
4933
|
+
`;
|
|
4934
|
+
document.head.appendChild(style);
|
|
4935
|
+
}
|
|
4936
|
+
/**
|
|
4937
|
+
* Custom editor that uses NileChip (tag input) component.
|
|
4938
|
+
* Renders in a floating popover below the cell to avoid expanding row height.
|
|
4939
|
+
*
|
|
4940
|
+
* Cell value is expected to be `string[]` (array of tag strings).
|
|
4941
|
+
*/
|
|
4942
|
+
class NileChipEditor {
|
|
4943
|
+
constructor(options) {
|
|
4944
|
+
this.options = options;
|
|
4945
|
+
this.acceptsInitialKeypress = false;
|
|
4946
|
+
this.eventListeners = [];
|
|
4947
|
+
this.trackedValues = [];
|
|
4948
|
+
this.hasChangeOccurred = false;
|
|
4949
|
+
}
|
|
4950
|
+
edit(context) {
|
|
4951
|
+
if (!context.container) {
|
|
4952
|
+
console.warn('NileChipEditor requires a container element');
|
|
4953
|
+
return;
|
|
4954
|
+
}
|
|
4955
|
+
injectChipStyles();
|
|
4956
|
+
this.cellContainer = context.container;
|
|
4957
|
+
// Create the floating popover
|
|
4958
|
+
this.popover = document.createElement('div');
|
|
4959
|
+
this.popover.className = 'st-chip-popover';
|
|
4960
|
+
// Create nile-chip inside the popover
|
|
4961
|
+
this.chip = document.createElement('nile-chip');
|
|
4962
|
+
this.chip.className = 'st-cell-editor st-nile-chip-editor';
|
|
4963
|
+
this.setInitialValue(context.value);
|
|
4964
|
+
this.applyOptions();
|
|
4965
|
+
this.popover.appendChild(this.chip);
|
|
4966
|
+
// Apply custom max-height if provided
|
|
4967
|
+
if (this.options?.popoverMaxHeight) {
|
|
4968
|
+
this.popover.style.maxHeight = `${this.options.popoverMaxHeight}px`;
|
|
4969
|
+
}
|
|
4970
|
+
// Append popover to body and position it
|
|
4971
|
+
document.body.appendChild(this.popover);
|
|
4972
|
+
this.positionPopover();
|
|
4973
|
+
this.setupEventListeners(context);
|
|
4974
|
+
if (this.options?.autoFocus !== false) {
|
|
4975
|
+
setTimeout(() => {
|
|
4976
|
+
try {
|
|
4977
|
+
this.chip?.focus();
|
|
4978
|
+
}
|
|
4979
|
+
catch { /* ignore */ }
|
|
4980
|
+
}, 0);
|
|
4981
|
+
}
|
|
4982
|
+
}
|
|
4983
|
+
positionPopover() {
|
|
4984
|
+
if (!this.popover || !this.cellContainer)
|
|
4985
|
+
return;
|
|
4986
|
+
const rect = this.cellContainer.getBoundingClientRect();
|
|
4987
|
+
const minWidth = this.options?.popoverMinWidth ?? rect.width;
|
|
4988
|
+
const popoverWidth = Math.max(minWidth, rect.width);
|
|
4989
|
+
this.popover.style.top = `${rect.bottom + 2}px`;
|
|
4990
|
+
this.popover.style.left = `${rect.left}px`;
|
|
4991
|
+
this.popover.style.width = `${popoverWidth}px`;
|
|
4992
|
+
// After rendering, check if it goes off-screen bottom and flip above if needed
|
|
4993
|
+
requestAnimationFrame(() => {
|
|
4994
|
+
if (!this.popover)
|
|
4995
|
+
return;
|
|
4996
|
+
const popRect = this.popover.getBoundingClientRect();
|
|
4997
|
+
if (popRect.bottom > window.innerHeight) {
|
|
4998
|
+
this.popover.style.top = `${rect.top - popRect.height - 2}px`;
|
|
4999
|
+
}
|
|
5000
|
+
});
|
|
5001
|
+
}
|
|
5002
|
+
setInitialValue(value) {
|
|
5003
|
+
if (!this.chip)
|
|
5004
|
+
return;
|
|
5005
|
+
if (Array.isArray(value)) {
|
|
5006
|
+
this.trackedValues = [...value];
|
|
5007
|
+
this.chip.value = this.trackedValues;
|
|
5008
|
+
}
|
|
5009
|
+
else if (typeof value === 'string' && value) {
|
|
5010
|
+
this.trackedValues = [value];
|
|
5011
|
+
this.chip.value = this.trackedValues;
|
|
5012
|
+
}
|
|
5013
|
+
else {
|
|
5014
|
+
this.trackedValues = [];
|
|
5015
|
+
this.chip.value = [];
|
|
5016
|
+
}
|
|
5017
|
+
}
|
|
5018
|
+
applyOptions() {
|
|
5019
|
+
if (!this.chip || !this.options)
|
|
5020
|
+
return;
|
|
5021
|
+
if (this.options.placeholder) {
|
|
5022
|
+
this.chip.placeholder = this.options.placeholder;
|
|
5023
|
+
}
|
|
5024
|
+
if (this.options.label) {
|
|
5025
|
+
this.chip.label = this.options.label;
|
|
5026
|
+
}
|
|
5027
|
+
if (this.options.helpText) {
|
|
5028
|
+
this.chip.helpText = this.options.helpText;
|
|
5029
|
+
}
|
|
5030
|
+
if (this.options.disabled !== undefined) {
|
|
5031
|
+
this.chip.disabled = this.options.disabled;
|
|
5032
|
+
}
|
|
5033
|
+
if (this.options.readonly !== undefined) {
|
|
5034
|
+
this.chip.readonly = this.options.readonly;
|
|
5035
|
+
}
|
|
5036
|
+
if (this.options.acceptUserInput !== undefined) {
|
|
5037
|
+
this.chip.acceptUserInput = this.options.acceptUserInput;
|
|
5038
|
+
}
|
|
5039
|
+
if (this.options.noDuplicates !== undefined) {
|
|
5040
|
+
this.chip.noDuplicates = this.options.noDuplicates;
|
|
5041
|
+
}
|
|
5042
|
+
if (this.options.clearable !== undefined) {
|
|
5043
|
+
this.chip.clearable = this.options.clearable;
|
|
5044
|
+
}
|
|
5045
|
+
if (this.options.noWrap !== undefined) {
|
|
5046
|
+
this.chip.noWrap = this.options.noWrap;
|
|
5047
|
+
}
|
|
5048
|
+
if (this.options.noAutoComplete !== undefined) {
|
|
5049
|
+
this.chip.noAutoComplete = this.options.noAutoComplete;
|
|
5050
|
+
}
|
|
5051
|
+
if (this.options.enableVirtualScroll !== undefined) {
|
|
5052
|
+
this.chip.enableVirtualScroll = this.options.enableVirtualScroll;
|
|
5053
|
+
}
|
|
5054
|
+
if (this.options.openDropdownOnFocus !== undefined) {
|
|
5055
|
+
this.chip.openDropdownOnFocus = this.options.openDropdownOnFocus;
|
|
5056
|
+
}
|
|
5057
|
+
if (this.options.loading !== undefined) {
|
|
5058
|
+
this.chip.loading = this.options.loading;
|
|
5059
|
+
}
|
|
5060
|
+
// Visual states
|
|
5061
|
+
if (this.options.warning !== undefined) {
|
|
5062
|
+
this.chip.warning = this.options.warning;
|
|
5063
|
+
}
|
|
5064
|
+
if (this.options.error !== undefined) {
|
|
5065
|
+
this.chip.error = this.options.error;
|
|
5066
|
+
}
|
|
5067
|
+
if (this.options.success !== undefined) {
|
|
5068
|
+
this.chip.success = this.options.success;
|
|
5069
|
+
}
|
|
5070
|
+
if (this.options.errorMessage) {
|
|
5071
|
+
this.chip.errorMessage = this.options.errorMessage;
|
|
5072
|
+
}
|
|
5073
|
+
if (this.options.errorIndexes) {
|
|
5074
|
+
this.chip.errorIndexes = this.options.errorIndexes;
|
|
5075
|
+
}
|
|
5076
|
+
// Autocomplete options
|
|
5077
|
+
if (this.options.autoCompleteOptions) {
|
|
5078
|
+
const opts = this.options.autoCompleteOptions;
|
|
5079
|
+
const stringOpts = opts.map(o => typeof o === 'string' ? o : (o.label ?? o.value));
|
|
5080
|
+
this.chip.autoCompleteOptions = stringOpts;
|
|
5081
|
+
}
|
|
5082
|
+
if (this.options.filterFunction) {
|
|
5083
|
+
this.chip.filterFunction = this.options.filterFunction;
|
|
5084
|
+
}
|
|
5085
|
+
if (this.options.renderItemFunction) {
|
|
5086
|
+
this.chip.renderItemFunction = this.options.renderItemFunction;
|
|
5087
|
+
}
|
|
5088
|
+
}
|
|
5089
|
+
addListener(element, event, handler, capture) {
|
|
5090
|
+
element.addEventListener(event, handler, capture);
|
|
5091
|
+
this.eventListeners.push({ element, event, handler, capture });
|
|
5092
|
+
}
|
|
5093
|
+
setupEventListeners(context) {
|
|
5094
|
+
if (!this.chip)
|
|
5095
|
+
return;
|
|
5096
|
+
// Track chip changes
|
|
5097
|
+
this.addListener(this.chip, 'nile-chip-change', (e) => {
|
|
5098
|
+
const detail = e.detail;
|
|
5099
|
+
const newValue = Array.isArray(detail?.value) ? [...detail.value] : (this.chip?.value ? [...this.chip.value] : []);
|
|
5100
|
+
this.trackedValues = newValue;
|
|
5101
|
+
this.hasChangeOccurred = true;
|
|
5102
|
+
context.onChange(newValue);
|
|
5103
|
+
});
|
|
5104
|
+
// Keyboard handling on the chip element
|
|
5105
|
+
this.addListener(this.chip, 'keydown', (e) => {
|
|
5106
|
+
const keyEvent = e;
|
|
5107
|
+
if (keyEvent.key === 'Enter') {
|
|
5108
|
+
keyEvent.stopPropagation();
|
|
5109
|
+
}
|
|
5110
|
+
else if (keyEvent.key === 'Escape') {
|
|
5111
|
+
keyEvent.preventDefault();
|
|
5112
|
+
keyEvent.stopPropagation();
|
|
5113
|
+
context.onCancel();
|
|
5114
|
+
}
|
|
5115
|
+
else if (keyEvent.key === 'Tab') {
|
|
5116
|
+
keyEvent.preventDefault();
|
|
5117
|
+
keyEvent.stopPropagation();
|
|
5118
|
+
context.onSave(this.getCurrentValue());
|
|
5119
|
+
}
|
|
5120
|
+
});
|
|
5121
|
+
// Click-outside: save when clicking anywhere outside the popover
|
|
5122
|
+
let saveTriggered = false;
|
|
5123
|
+
const mousedownHandler = (e) => {
|
|
5124
|
+
if (saveTriggered)
|
|
5125
|
+
return;
|
|
5126
|
+
if (!this.popover)
|
|
5127
|
+
return;
|
|
5128
|
+
const path = e.composedPath();
|
|
5129
|
+
for (const el of path) {
|
|
5130
|
+
if (el === this.popover)
|
|
5131
|
+
return;
|
|
5132
|
+
if (el === this.chip)
|
|
5133
|
+
return;
|
|
5134
|
+
if (el instanceof HTMLElement) {
|
|
5135
|
+
if (el.tagName?.toLowerCase() === 'nile-chip')
|
|
5136
|
+
return;
|
|
5137
|
+
if (el.className && typeof el.className === 'string' && el.className.includes('nile-chip'))
|
|
5138
|
+
return;
|
|
5139
|
+
}
|
|
5140
|
+
}
|
|
5141
|
+
saveTriggered = true;
|
|
5142
|
+
context.onSave(this.getCurrentValue());
|
|
5143
|
+
};
|
|
5144
|
+
document.addEventListener('mousedown', mousedownHandler, true);
|
|
5145
|
+
this._documentMousedownHandler = mousedownHandler;
|
|
5146
|
+
// Reposition on scroll/resize so popover stays aligned with the cell
|
|
5147
|
+
const reposition = () => this.positionPopover();
|
|
5148
|
+
this.addListener(window, 'resize', reposition);
|
|
5149
|
+
this.addListener(window, 'scroll', reposition, true);
|
|
5150
|
+
}
|
|
5151
|
+
destroy() {
|
|
5152
|
+
// Remove document mousedown handler
|
|
5153
|
+
if (this._documentMousedownHandler) {
|
|
5154
|
+
document.removeEventListener('mousedown', this._documentMousedownHandler, true);
|
|
5155
|
+
delete this._documentMousedownHandler;
|
|
5156
|
+
}
|
|
5157
|
+
// Remove all tracked listeners
|
|
5158
|
+
for (const { element, event, handler, capture } of this.eventListeners) {
|
|
5159
|
+
element.removeEventListener(event, handler, capture);
|
|
5160
|
+
}
|
|
5161
|
+
this.eventListeners = [];
|
|
5162
|
+
// Remove the popover from the DOM
|
|
5163
|
+
if (this.popover) {
|
|
5164
|
+
this.popover.remove();
|
|
5165
|
+
this.popover = undefined;
|
|
5166
|
+
}
|
|
5167
|
+
this.chip = undefined;
|
|
5168
|
+
this.cellContainer = undefined;
|
|
5169
|
+
this.trackedValues = [];
|
|
5170
|
+
this.hasChangeOccurred = false;
|
|
5171
|
+
}
|
|
5172
|
+
focus() {
|
|
5173
|
+
try {
|
|
5174
|
+
this.chip?.focus();
|
|
5175
|
+
}
|
|
5176
|
+
catch { /* ignore */ }
|
|
5177
|
+
}
|
|
5178
|
+
getCurrentValue() {
|
|
5179
|
+
if (this.hasChangeOccurred) {
|
|
5180
|
+
return [...this.trackedValues];
|
|
5181
|
+
}
|
|
5182
|
+
if (!this.chip)
|
|
5183
|
+
return [];
|
|
5184
|
+
const val = this.chip.value;
|
|
5185
|
+
return Array.isArray(val) ? [...val] : [];
|
|
5186
|
+
}
|
|
5187
|
+
}
|
|
5188
|
+
|
|
4893
5189
|
/**
|
|
4894
5190
|
* Custom editor using NileCodeEditor from @aquera/nile-elements
|
|
4895
5191
|
* This provides code editing capabilities with syntax highlighting for table cells
|
|
@@ -5031,7 +5327,7 @@ class NileCodeEditor {
|
|
|
5031
5327
|
this.syncingFromDialog = false; // Flag to prevent inline editor from overwriting multiline content
|
|
5032
5328
|
this.userEditedInline = false; // Flag to track if user has typed in inline editor
|
|
5033
5329
|
this.dialogOriginalValue = ''; // Store original value when dialog opens
|
|
5034
|
-
this.dialogCurrentValue =
|
|
5330
|
+
this.dialogCurrentValue = null; // Track current value in dialog
|
|
5035
5331
|
}
|
|
5036
5332
|
edit(context) {
|
|
5037
5333
|
if (!context.container) {
|
|
@@ -5306,7 +5602,7 @@ class NileCodeEditor {
|
|
|
5306
5602
|
*/
|
|
5307
5603
|
getDialogEditorValue() {
|
|
5308
5604
|
// Use tracked value from change events (most reliable)
|
|
5309
|
-
if (this.dialogCurrentValue) {
|
|
5605
|
+
if (this.dialogCurrentValue !== null && this.dialogCurrentValue !== undefined) {
|
|
5310
5606
|
return this.dialogCurrentValue.replace(/\n+$/, '');
|
|
5311
5607
|
}
|
|
5312
5608
|
if (!this.dialogEditor)
|
|
@@ -5335,10 +5631,9 @@ class NileCodeEditor {
|
|
|
5335
5631
|
applyDialogChanges() {
|
|
5336
5632
|
if (!this.dialogOpen)
|
|
5337
5633
|
return;
|
|
5338
|
-
//
|
|
5634
|
+
// Always read live dialog editor state to avoid stale tracked values from debounced updates
|
|
5339
5635
|
let dialogValue = this.dialogCurrentValue;
|
|
5340
|
-
|
|
5341
|
-
if (!dialogValue && this.dialogEditor) {
|
|
5636
|
+
if (this.dialogEditor) {
|
|
5342
5637
|
try {
|
|
5343
5638
|
const shadowRoot = this.dialogEditor.shadowRoot;
|
|
5344
5639
|
if (shadowRoot) {
|
|
@@ -5352,12 +5647,12 @@ class NileCodeEditor {
|
|
|
5352
5647
|
// Fall through
|
|
5353
5648
|
}
|
|
5354
5649
|
// Fallback to value property
|
|
5355
|
-
if (
|
|
5650
|
+
if (dialogValue === null || dialogValue === undefined) {
|
|
5356
5651
|
dialogValue = this.dialogEditor.value ?? '';
|
|
5357
5652
|
}
|
|
5358
5653
|
}
|
|
5359
5654
|
// Strip trailing newlines
|
|
5360
|
-
dialogValue = (dialogValue
|
|
5655
|
+
dialogValue = (dialogValue ?? '').replace(/\n+$/, '');
|
|
5361
5656
|
// Update tracked value and inline editor
|
|
5362
5657
|
this.trackedValue = dialogValue;
|
|
5363
5658
|
this.userEditedInline = false;
|
|
@@ -5399,7 +5694,7 @@ class NileCodeEditor {
|
|
|
5399
5694
|
*/
|
|
5400
5695
|
closeDialogUI() {
|
|
5401
5696
|
this.dialogOpen = false;
|
|
5402
|
-
this.dialogCurrentValue =
|
|
5697
|
+
this.dialogCurrentValue = null;
|
|
5403
5698
|
if (this.dialog) {
|
|
5404
5699
|
this.dialog.open = false;
|
|
5405
5700
|
const dialogRef = this.dialog;
|
|
@@ -5644,7 +5939,7 @@ class NileCodeEditor {
|
|
|
5644
5939
|
this.trackedValue = null;
|
|
5645
5940
|
this.userEditedInline = false;
|
|
5646
5941
|
this.dialogOriginalValue = '';
|
|
5647
|
-
this.dialogCurrentValue =
|
|
5942
|
+
this.dialogCurrentValue = null;
|
|
5648
5943
|
}
|
|
5649
5944
|
focus() {
|
|
5650
5945
|
this.editor?.focus();
|
|
@@ -7804,7 +8099,7 @@ class StColumnMenuDropdownComponent {
|
|
|
7804
8099
|
*/
|
|
7805
8100
|
this.isOpen = false;
|
|
7806
8101
|
/**
|
|
7807
|
-
* Position of the dropdown (x, y coordinates)
|
|
8102
|
+
* Position of the dropdown (x, y coordinates, triggerTop for flip positioning)
|
|
7808
8103
|
*/
|
|
7809
8104
|
this.position = { x: 0, y: 0 };
|
|
7810
8105
|
/**
|
|
@@ -7917,25 +8212,41 @@ class StColumnMenuDropdownComponent {
|
|
|
7917
8212
|
this.dropdownStyle = {};
|
|
7918
8213
|
return;
|
|
7919
8214
|
}
|
|
7920
|
-
const viewportWidth = window.innerWidth;
|
|
7921
|
-
const viewportHeight = window.innerHeight;
|
|
7922
|
-
const dropdownWidth = 280; // Approximate dropdown width
|
|
7923
|
-
const dropdownHeight = 300; // Approximate max dropdown height
|
|
7924
8215
|
let { x, y } = this.position;
|
|
7925
|
-
//
|
|
7926
|
-
if (x + dropdownWidth > viewportWidth) {
|
|
7927
|
-
x = Math.max(10, viewportWidth - dropdownWidth - 10);
|
|
7928
|
-
}
|
|
7929
|
-
// Adjust vertical position if dropdown would overflow
|
|
7930
|
-
if (y + dropdownHeight > viewportHeight) {
|
|
7931
|
-
y = Math.max(10, viewportHeight - dropdownHeight - 10);
|
|
7932
|
-
}
|
|
8216
|
+
// Render at initial position first
|
|
7933
8217
|
this.dropdownStyle = {
|
|
7934
8218
|
position: 'fixed',
|
|
7935
8219
|
left: `${x}px`,
|
|
7936
8220
|
top: `${y}px`,
|
|
7937
|
-
'z-index': 9999
|
|
8221
|
+
'z-index': 9999,
|
|
8222
|
+
visibility: 'hidden'
|
|
7938
8223
|
};
|
|
8224
|
+
// After rendering, measure actual size and adjust if needed
|
|
8225
|
+
requestAnimationFrame(() => {
|
|
8226
|
+
const viewportWidth = window.innerWidth;
|
|
8227
|
+
const viewportHeight = window.innerHeight;
|
|
8228
|
+
const el = this.dropdownPanel?.nativeElement;
|
|
8229
|
+
const dropdownWidth = el?.offsetWidth || 280;
|
|
8230
|
+
const dropdownHeight = el?.offsetHeight || 200;
|
|
8231
|
+
// Adjust horizontal position if dropdown would overflow
|
|
8232
|
+
if (x + dropdownWidth > viewportWidth) {
|
|
8233
|
+
x = Math.max(10, viewportWidth - dropdownWidth - 10);
|
|
8234
|
+
}
|
|
8235
|
+
// Adjust vertical position — flip above the trigger if it overflows bottom
|
|
8236
|
+
if (y + dropdownHeight > viewportHeight) {
|
|
8237
|
+
const triggerTop = this.position.triggerTop ?? this.position.y;
|
|
8238
|
+
y = triggerTop - dropdownHeight - 4;
|
|
8239
|
+
}
|
|
8240
|
+
// Clamp to viewport edges
|
|
8241
|
+
x = Math.max(10, x);
|
|
8242
|
+
y = Math.max(10, y);
|
|
8243
|
+
this.dropdownStyle = {
|
|
8244
|
+
position: 'fixed',
|
|
8245
|
+
left: `${x}px`,
|
|
8246
|
+
top: `${y}px`,
|
|
8247
|
+
'z-index': 9999
|
|
8248
|
+
};
|
|
8249
|
+
});
|
|
7939
8250
|
}
|
|
7940
8251
|
/**
|
|
7941
8252
|
* Check if an action is disabled
|
|
@@ -8002,10 +8313,10 @@ class StColumnMenuDropdownComponent {
|
|
|
8002
8313
|
}
|
|
8003
8314
|
}
|
|
8004
8315
|
StColumnMenuDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: StColumnMenuDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8005
|
-
StColumnMenuDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: StColumnMenuDropdownComponent, selector: "st-column-menu-dropdown", inputs: { isOpen: "isOpen", position: "position", context: "context" }, outputs: { actionClicked: "actionClicked", closed: "closed" }, host: { listeners: { "click": "onBackdropClick($event)" } }, viewQueries: [{ propertyName: "filterPopup", first: true, predicate: ["filterPopup"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<!-- Dropdown container with backdrop -->\n<div class=\"dropdown-container\" *ngIf=\"isOpen && context\">\n <!-- Backdrop -->\n <div class=\"dropdown-backdrop\" (click)=\"closed.emit()\"></div>\n \n <!-- Dropdown menu -->\n <div class=\"column-menu-dropdown\" [ngStyle]=\"dropdownStyle\">\n <!-- Main menu with actions -->\n <nile-menu *ngIf=\"!isFilterOpen\">\n <!-- Dynamically render all visible actions -->\n <ng-container *ngFor=\"let action of visibleActions; let i = index; let last = last\">\n <nile-menu-item \n (click)=\"onActionClick(action)\"\n [class.disabled]=\"isActionDisabled(action)\"\n [class.active]=\"isActionActive(action)\">\n <span class=\"checkmark\" *ngIf=\"isActionActive(action)\">\u2713</span>\n <nile-icon slot=\"prefix\" *ngIf=\"action.icon && !isActionActive(action)\" [name]=\"action.icon\"></nile-icon>\n <span class=\"action-label\">{{ action.label }}</span>\n </nile-menu-item>\n \n <!-- Add divider after action groups -->\n <nile-divider *ngIf=\"shouldShowDividerAfter(action, i, last)\"></nile-divider>\n </ng-container>\n \n <!-- Fallback if no actions -->\n <nile-menu-item *ngIf=\"visibleActions.length === 0\">\n No actions available\n </nile-menu-item>\n </nile-menu>\n \n <!-- Filter popup (conditionally rendered) -->\n <st-column-filter\n #filterPopup\n *ngIf=\"isFilterOpen && context\"\n [column]=\"context.column\"\n [tableState]=\"context.tableState\"\n [columnIndex]=\"context.columnIndex\"\n [isFirstColumn]=\"context.isFirstColumn\"\n [isLastColumn]=\"context.isLastColumn\"\n [isOpen]=\"isFilterOpen\"\n (filterApplied)=\"onFilterApplied($event)\"\n (filterCleared)=\"onFilterCleared()\"\n (closed)=\"onFilterClosed()\">\n </st-column-filter>\n </div>\n</div>\n", styles: [".dropdown-container{position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:9998}.dropdown-backdrop{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:auto;z-index:9998}.column-menu-dropdown{min-width:200px;max-width:300px;background-color:#fff;border-radius:8px;box-shadow:0 10px 25px #00000026;overflow:hidden;pointer-events:auto;z-index:9999}nile-menu nile-divider::part(divider){margin:0}nile-menu nile-menu-item::part(base){height:2.5rem;min-height:auto}nile-menu nile-menu-item .checkmark{margin-right:8px;color:#4299e1;font-weight:700}\n"], components: [{ type: StColumnFilterComponent, selector: "st-column-filter", inputs: ["column", "tableState", "columnIndex", "isFirstColumn", "isLastColumn", "isOpen", "filterContext"], outputs: ["closed", "filterApplied", "filterCleared"] }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
8316
|
+
StColumnMenuDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: StColumnMenuDropdownComponent, selector: "st-column-menu-dropdown", inputs: { isOpen: "isOpen", position: "position", context: "context" }, outputs: { actionClicked: "actionClicked", closed: "closed" }, host: { listeners: { "click": "onBackdropClick($event)" } }, viewQueries: [{ propertyName: "filterPopup", first: true, predicate: ["filterPopup"], descendants: true }, { propertyName: "dropdownPanel", first: true, predicate: ["dropdownPanel"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<!-- Dropdown container with backdrop -->\n<div class=\"dropdown-container\" *ngIf=\"isOpen && context\">\n <!-- Backdrop -->\n <div class=\"dropdown-backdrop\" (click)=\"closed.emit()\"></div>\n \n <!-- Dropdown menu -->\n <div class=\"column-menu-dropdown\" #dropdownPanel [ngStyle]=\"dropdownStyle\">\n <!-- Main menu with actions -->\n <nile-menu *ngIf=\"!isFilterOpen\">\n <!-- Dynamically render all visible actions -->\n <ng-container *ngFor=\"let action of visibleActions; let i = index; let last = last\">\n <nile-menu-item \n (click)=\"onActionClick(action)\"\n [class.disabled]=\"isActionDisabled(action)\"\n [class.active]=\"isActionActive(action)\">\n <span class=\"checkmark\" *ngIf=\"isActionActive(action)\">\u2713</span>\n <nile-icon slot=\"prefix\" *ngIf=\"action.icon && !isActionActive(action)\" [name]=\"action.icon\"></nile-icon>\n <span class=\"action-label\">{{ action.label }}</span>\n </nile-menu-item>\n \n <!-- Add divider after action groups -->\n <nile-divider *ngIf=\"shouldShowDividerAfter(action, i, last)\"></nile-divider>\n </ng-container>\n \n <!-- Fallback if no actions -->\n <nile-menu-item *ngIf=\"visibleActions.length === 0\">\n No actions available\n </nile-menu-item>\n </nile-menu>\n \n <!-- Filter popup (conditionally rendered) -->\n <st-column-filter\n #filterPopup\n *ngIf=\"isFilterOpen && context\"\n [column]=\"context.column\"\n [tableState]=\"context.tableState\"\n [columnIndex]=\"context.columnIndex\"\n [isFirstColumn]=\"context.isFirstColumn\"\n [isLastColumn]=\"context.isLastColumn\"\n [isOpen]=\"isFilterOpen\"\n (filterApplied)=\"onFilterApplied($event)\"\n (filterCleared)=\"onFilterCleared()\"\n (closed)=\"onFilterClosed()\">\n </st-column-filter>\n </div>\n</div>\n", styles: [".dropdown-container{position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:9998}.dropdown-backdrop{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:auto;z-index:9998}.column-menu-dropdown{min-width:200px;max-width:300px;background-color:#fff;border-radius:8px;box-shadow:0 10px 25px #00000026;overflow:hidden;pointer-events:auto;z-index:9999}nile-menu nile-divider::part(divider){margin:0}nile-menu nile-menu-item::part(base){height:2.5rem;min-height:auto}nile-menu nile-menu-item .checkmark{margin-right:8px;color:#4299e1;font-weight:700}\n"], components: [{ type: StColumnFilterComponent, selector: "st-column-filter", inputs: ["column", "tableState", "columnIndex", "isFirstColumn", "isLastColumn", "isOpen", "filterContext"], outputs: ["closed", "filterApplied", "filterCleared"] }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
8006
8317
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: StColumnMenuDropdownComponent, decorators: [{
|
|
8007
8318
|
type: Component,
|
|
8008
|
-
args: [{ selector: 'st-column-menu-dropdown', template: "<!-- Dropdown container with backdrop -->\n<div class=\"dropdown-container\" *ngIf=\"isOpen && context\">\n <!-- Backdrop -->\n <div class=\"dropdown-backdrop\" (click)=\"closed.emit()\"></div>\n \n <!-- Dropdown menu -->\n <div class=\"column-menu-dropdown\" [ngStyle]=\"dropdownStyle\">\n <!-- Main menu with actions -->\n <nile-menu *ngIf=\"!isFilterOpen\">\n <!-- Dynamically render all visible actions -->\n <ng-container *ngFor=\"let action of visibleActions; let i = index; let last = last\">\n <nile-menu-item \n (click)=\"onActionClick(action)\"\n [class.disabled]=\"isActionDisabled(action)\"\n [class.active]=\"isActionActive(action)\">\n <span class=\"checkmark\" *ngIf=\"isActionActive(action)\">\u2713</span>\n <nile-icon slot=\"prefix\" *ngIf=\"action.icon && !isActionActive(action)\" [name]=\"action.icon\"></nile-icon>\n <span class=\"action-label\">{{ action.label }}</span>\n </nile-menu-item>\n \n <!-- Add divider after action groups -->\n <nile-divider *ngIf=\"shouldShowDividerAfter(action, i, last)\"></nile-divider>\n </ng-container>\n \n <!-- Fallback if no actions -->\n <nile-menu-item *ngIf=\"visibleActions.length === 0\">\n No actions available\n </nile-menu-item>\n </nile-menu>\n \n <!-- Filter popup (conditionally rendered) -->\n <st-column-filter\n #filterPopup\n *ngIf=\"isFilterOpen && context\"\n [column]=\"context.column\"\n [tableState]=\"context.tableState\"\n [columnIndex]=\"context.columnIndex\"\n [isFirstColumn]=\"context.isFirstColumn\"\n [isLastColumn]=\"context.isLastColumn\"\n [isOpen]=\"isFilterOpen\"\n (filterApplied)=\"onFilterApplied($event)\"\n (filterCleared)=\"onFilterCleared()\"\n (closed)=\"onFilterClosed()\">\n </st-column-filter>\n </div>\n</div>\n", styles: [".dropdown-container{position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:9998}.dropdown-backdrop{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:auto;z-index:9998}.column-menu-dropdown{min-width:200px;max-width:300px;background-color:#fff;border-radius:8px;box-shadow:0 10px 25px #00000026;overflow:hidden;pointer-events:auto;z-index:9999}nile-menu nile-divider::part(divider){margin:0}nile-menu nile-menu-item::part(base){height:2.5rem;min-height:auto}nile-menu nile-menu-item .checkmark{margin-right:8px;color:#4299e1;font-weight:700}\n"] }]
|
|
8319
|
+
args: [{ selector: 'st-column-menu-dropdown', template: "<!-- Dropdown container with backdrop -->\n<div class=\"dropdown-container\" *ngIf=\"isOpen && context\">\n <!-- Backdrop -->\n <div class=\"dropdown-backdrop\" (click)=\"closed.emit()\"></div>\n \n <!-- Dropdown menu -->\n <div class=\"column-menu-dropdown\" #dropdownPanel [ngStyle]=\"dropdownStyle\">\n <!-- Main menu with actions -->\n <nile-menu *ngIf=\"!isFilterOpen\">\n <!-- Dynamically render all visible actions -->\n <ng-container *ngFor=\"let action of visibleActions; let i = index; let last = last\">\n <nile-menu-item \n (click)=\"onActionClick(action)\"\n [class.disabled]=\"isActionDisabled(action)\"\n [class.active]=\"isActionActive(action)\">\n <span class=\"checkmark\" *ngIf=\"isActionActive(action)\">\u2713</span>\n <nile-icon slot=\"prefix\" *ngIf=\"action.icon && !isActionActive(action)\" [name]=\"action.icon\"></nile-icon>\n <span class=\"action-label\">{{ action.label }}</span>\n </nile-menu-item>\n \n <!-- Add divider after action groups -->\n <nile-divider *ngIf=\"shouldShowDividerAfter(action, i, last)\"></nile-divider>\n </ng-container>\n \n <!-- Fallback if no actions -->\n <nile-menu-item *ngIf=\"visibleActions.length === 0\">\n No actions available\n </nile-menu-item>\n </nile-menu>\n \n <!-- Filter popup (conditionally rendered) -->\n <st-column-filter\n #filterPopup\n *ngIf=\"isFilterOpen && context\"\n [column]=\"context.column\"\n [tableState]=\"context.tableState\"\n [columnIndex]=\"context.columnIndex\"\n [isFirstColumn]=\"context.isFirstColumn\"\n [isLastColumn]=\"context.isLastColumn\"\n [isOpen]=\"isFilterOpen\"\n (filterApplied)=\"onFilterApplied($event)\"\n (filterCleared)=\"onFilterCleared()\"\n (closed)=\"onFilterClosed()\">\n </st-column-filter>\n </div>\n</div>\n", styles: [".dropdown-container{position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:9998}.dropdown-backdrop{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:auto;z-index:9998}.column-menu-dropdown{min-width:200px;max-width:300px;background-color:#fff;border-radius:8px;box-shadow:0 10px 25px #00000026;overflow:hidden;pointer-events:auto;z-index:9999}nile-menu nile-divider::part(divider){margin:0}nile-menu nile-menu-item::part(base){height:2.5rem;min-height:auto}nile-menu nile-menu-item .checkmark{margin-right:8px;color:#4299e1;font-weight:700}\n"] }]
|
|
8009
8320
|
}], propDecorators: { isOpen: [{
|
|
8010
8321
|
type: Input
|
|
8011
8322
|
}], position: [{
|
|
@@ -8019,6 +8330,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
8019
8330
|
}], filterPopup: [{
|
|
8020
8331
|
type: ViewChild,
|
|
8021
8332
|
args: ['filterPopup']
|
|
8333
|
+
}], dropdownPanel: [{
|
|
8334
|
+
type: ViewChild,
|
|
8335
|
+
args: ['dropdownPanel']
|
|
8022
8336
|
}], onBackdropClick: [{
|
|
8023
8337
|
type: HostListener,
|
|
8024
8338
|
args: ['click', ['$event']]
|
|
@@ -8031,7 +8345,7 @@ class StRowActionsDropdownComponent {
|
|
|
8031
8345
|
*/
|
|
8032
8346
|
this.isOpen = false;
|
|
8033
8347
|
/**
|
|
8034
|
-
* Position of the dropdown (x, y coordinates)
|
|
8348
|
+
* Position of the dropdown (x, y coordinates, triggerTop for flip positioning)
|
|
8035
8349
|
*/
|
|
8036
8350
|
this.position = { x: 0, y: 0 };
|
|
8037
8351
|
/**
|
|
@@ -8086,35 +8400,39 @@ class StRowActionsDropdownComponent {
|
|
|
8086
8400
|
this.dropdownStyle = {};
|
|
8087
8401
|
return;
|
|
8088
8402
|
}
|
|
8089
|
-
const DROPDOWN_WIDTH = 200; // Approximate width
|
|
8090
|
-
const DROPDOWN_HEIGHT = this.visibleActions.length * 40 + 16; // Approximate height
|
|
8091
|
-
const viewportWidth = window.innerWidth;
|
|
8092
|
-
const viewportHeight = window.innerHeight;
|
|
8093
8403
|
let left = this.position.x;
|
|
8094
8404
|
let top = this.position.y;
|
|
8095
|
-
//
|
|
8096
|
-
if (left + DROPDOWN_WIDTH > viewportWidth) {
|
|
8097
|
-
left = viewportWidth - DROPDOWN_WIDTH - 10;
|
|
8098
|
-
}
|
|
8099
|
-
// Check if dropdown would overflow bottom edge
|
|
8100
|
-
if (top + DROPDOWN_HEIGHT > viewportHeight) {
|
|
8101
|
-
// Position above the trigger
|
|
8102
|
-
top = this.position.y - DROPDOWN_HEIGHT;
|
|
8103
|
-
}
|
|
8104
|
-
// Ensure dropdown doesn't go off-screen on the left
|
|
8105
|
-
if (left < 10) {
|
|
8106
|
-
left = 10;
|
|
8107
|
-
}
|
|
8108
|
-
// Ensure dropdown doesn't go off-screen on the top
|
|
8109
|
-
if (top < 10) {
|
|
8110
|
-
top = 10;
|
|
8111
|
-
}
|
|
8405
|
+
// Render at initial position first (hidden until measured)
|
|
8112
8406
|
this.dropdownStyle = {
|
|
8113
8407
|
position: 'fixed',
|
|
8114
8408
|
left: `${left}px`,
|
|
8115
8409
|
top: `${top}px`,
|
|
8116
|
-
zIndex: TableZIndex.ROW_ACTIONS_DROPDOWN
|
|
8410
|
+
zIndex: TableZIndex.ROW_ACTIONS_DROPDOWN,
|
|
8411
|
+
visibility: 'hidden'
|
|
8117
8412
|
};
|
|
8413
|
+
// After rendering, measure actual size and adjust position directly on the DOM
|
|
8414
|
+
// (OnPush change detection won't pick up property changes inside requestAnimationFrame)
|
|
8415
|
+
requestAnimationFrame(() => {
|
|
8416
|
+
const el = this.dropdownPanel?.nativeElement;
|
|
8417
|
+
if (!el)
|
|
8418
|
+
return;
|
|
8419
|
+
const viewportWidth = window.innerWidth;
|
|
8420
|
+
const viewportHeight = window.innerHeight;
|
|
8421
|
+
const dropdownWidth = el.offsetWidth || 200;
|
|
8422
|
+
const dropdownHeight = el.offsetHeight || (this.visibleActions.length * 40 + 16);
|
|
8423
|
+
if (left + dropdownWidth > viewportWidth) {
|
|
8424
|
+
left = viewportWidth - dropdownWidth - 10;
|
|
8425
|
+
}
|
|
8426
|
+
if (top + dropdownHeight > viewportHeight) {
|
|
8427
|
+
const triggerTop = this.position.triggerTop ?? this.position.y;
|
|
8428
|
+
top = triggerTop - dropdownHeight - 4;
|
|
8429
|
+
}
|
|
8430
|
+
left = Math.max(10, left);
|
|
8431
|
+
top = Math.max(10, top);
|
|
8432
|
+
el.style.left = `${left}px`;
|
|
8433
|
+
el.style.top = `${top}px`;
|
|
8434
|
+
el.style.visibility = 'visible';
|
|
8435
|
+
});
|
|
8118
8436
|
}
|
|
8119
8437
|
/**
|
|
8120
8438
|
* Handle action click
|
|
@@ -8168,10 +8486,10 @@ class StRowActionsDropdownComponent {
|
|
|
8168
8486
|
}
|
|
8169
8487
|
}
|
|
8170
8488
|
StRowActionsDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: StRowActionsDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8171
|
-
StRowActionsDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: StRowActionsDropdownComponent, selector: "st-row-actions-dropdown", inputs: { isOpen: "isOpen", position: "position", context: "context" }, outputs: { actionClicked: "actionClicked", closed: "closed" }, host: { listeners: { "document:keydown.escape": "onEscapeKey($event)" } }, usesOnChanges: true, ngImport: i0, template: "<div class=\"dropdown-container\" *ngIf=\"isOpen && context\">\n <!-- Backdrop -->\n <div class=\"dropdown-overlay\" (click)=\"closed.emit()\"></div>\n \n <!-- Dropdown menu -->\n <div class=\"dropdown-menu\" [ngStyle]=\"dropdownStyle\">\n <nile-menu *ngIf=\"isOpen\"
|
|
8489
|
+
StRowActionsDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: StRowActionsDropdownComponent, selector: "st-row-actions-dropdown", inputs: { isOpen: "isOpen", position: "position", context: "context" }, outputs: { actionClicked: "actionClicked", closed: "closed" }, host: { listeners: { "document:keydown.escape": "onEscapeKey($event)" } }, viewQueries: [{ propertyName: "dropdownPanel", first: true, predicate: ["dropdownPanel"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"dropdown-container\" *ngIf=\"isOpen && context\">\n <!-- Backdrop -->\n <div class=\"dropdown-overlay\" (click)=\"closed.emit()\"></div>\n \n <!-- Dropdown menu -->\n <div class=\"dropdown-menu\" #dropdownPanel [ngStyle]=\"dropdownStyle\">\n <nile-menu *ngIf=\"isOpen\">\n <ng-container *ngFor=\"let action of visibleActions\">\n <nile-menu-item [class.disabled]=\"isActionDisabled(action)\" (click)=\"onActionClick(action)\" class=\"action-label\">\n <nile-icon *ngIf=\"action.icon\" size=\"14\" slot=\"prefix\" [name]=\"action.icon\"></nile-icon>\n {{ action.label }}\n </nile-menu-item>\n </ng-container>\n \n <nile-menu-item *ngIf=\"visibleActions.length === 0\">No actions available</nile-menu-item>\n </nile-menu>\n </div>\n</div>\n", styles: [".dropdown-container{position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:9998}.dropdown-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background-color:transparent;pointer-events:auto;z-index:9998}.dropdown-menu{position:fixed;background-color:#fff;box-shadow:0 5px 15px #0000004d,0 0 0 1px #0000001a;overflow:hidden;pointer-events:auto;z-index:9999}.action-icon{display:flex;align-items:center;justify-content:center;font-size:16px;width:20px;flex-shrink:0}.action-label{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dropdown-empty{padding:16px;text-align:center;color:#a0aec0;font-size:14px;font-style:italic}nile-menu{height:fit-content}\n"], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8172
8490
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: StRowActionsDropdownComponent, decorators: [{
|
|
8173
8491
|
type: Component,
|
|
8174
|
-
args: [{ selector: 'st-row-actions-dropdown', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"dropdown-container\" *ngIf=\"isOpen && context\">\n <!-- Backdrop -->\n <div class=\"dropdown-overlay\" (click)=\"closed.emit()\"></div>\n \n <!-- Dropdown menu -->\n <div class=\"dropdown-menu\" [ngStyle]=\"dropdownStyle\">\n <nile-menu *ngIf=\"isOpen\"
|
|
8492
|
+
args: [{ selector: 'st-row-actions-dropdown', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"dropdown-container\" *ngIf=\"isOpen && context\">\n <!-- Backdrop -->\n <div class=\"dropdown-overlay\" (click)=\"closed.emit()\"></div>\n \n <!-- Dropdown menu -->\n <div class=\"dropdown-menu\" #dropdownPanel [ngStyle]=\"dropdownStyle\">\n <nile-menu *ngIf=\"isOpen\">\n <ng-container *ngFor=\"let action of visibleActions\">\n <nile-menu-item [class.disabled]=\"isActionDisabled(action)\" (click)=\"onActionClick(action)\" class=\"action-label\">\n <nile-icon *ngIf=\"action.icon\" size=\"14\" slot=\"prefix\" [name]=\"action.icon\"></nile-icon>\n {{ action.label }}\n </nile-menu-item>\n </ng-container>\n \n <nile-menu-item *ngIf=\"visibleActions.length === 0\">No actions available</nile-menu-item>\n </nile-menu>\n </div>\n</div>\n", styles: [".dropdown-container{position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:9998}.dropdown-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background-color:transparent;pointer-events:auto;z-index:9998}.dropdown-menu{position:fixed;background-color:#fff;box-shadow:0 5px 15px #0000004d,0 0 0 1px #0000001a;overflow:hidden;pointer-events:auto;z-index:9999}.action-icon{display:flex;align-items:center;justify-content:center;font-size:16px;width:20px;flex-shrink:0}.action-label{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dropdown-empty{padding:16px;text-align:center;color:#a0aec0;font-size:14px;font-style:italic}nile-menu{height:fit-content}\n"] }]
|
|
8175
8493
|
}], propDecorators: { isOpen: [{
|
|
8176
8494
|
type: Input
|
|
8177
8495
|
}], position: [{
|
|
@@ -8182,6 +8500,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
8182
8500
|
type: Output
|
|
8183
8501
|
}], closed: [{
|
|
8184
8502
|
type: Output
|
|
8503
|
+
}], dropdownPanel: [{
|
|
8504
|
+
type: ViewChild,
|
|
8505
|
+
args: ['dropdownPanel']
|
|
8185
8506
|
}], onEscapeKey: [{
|
|
8186
8507
|
type: HostListener,
|
|
8187
8508
|
args: ['document:keydown.escape', ['$event']]
|
|
@@ -9459,10 +9780,10 @@ class StTableComponent {
|
|
|
9459
9780
|
event.stopPropagation();
|
|
9460
9781
|
const target = event.currentTarget;
|
|
9461
9782
|
const rect = target.getBoundingClientRect();
|
|
9462
|
-
// Calculate position (below the button by default)
|
|
9463
9783
|
const position = {
|
|
9464
9784
|
x: rect.left,
|
|
9465
|
-
y: rect.bottom + 4
|
|
9785
|
+
y: rect.bottom + 4,
|
|
9786
|
+
triggerTop: rect.top
|
|
9466
9787
|
};
|
|
9467
9788
|
// Create context
|
|
9468
9789
|
const context = {
|
|
@@ -9523,10 +9844,10 @@ class StTableComponent {
|
|
|
9523
9844
|
event.stopPropagation();
|
|
9524
9845
|
const target = event.currentTarget;
|
|
9525
9846
|
const rect = target.getBoundingClientRect();
|
|
9526
|
-
// Calculate position (below the button by default)
|
|
9527
9847
|
const position = {
|
|
9528
9848
|
x: rect.left,
|
|
9529
|
-
y: rect.bottom + 4
|
|
9849
|
+
y: rect.bottom + 4,
|
|
9850
|
+
triggerTop: rect.top
|
|
9530
9851
|
};
|
|
9531
9852
|
// Create context
|
|
9532
9853
|
const context = {
|
|
@@ -13350,5 +13671,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
13350
13671
|
* Generated bundle index. Do not edit.
|
|
13351
13672
|
*/
|
|
13352
13673
|
|
|
13353
|
-
export { ArrayFormatter, AutosaveService, BaseColumnConfig, BooleanEditor, BooleanFormatter, BuilderPreviewComponent, BuilderToolbarComponent, Cell, CellAlignment, CellDataType, CellLifecycleState, CellVerticalAlignment, ChainValidator, ClickOutsideDirective, ColumnConfigFactory, ColumnEditorComponent, ColumnListComponent, Columns, CurrencyFormatter, DEFAULT_AUTOSAVE_CONFIG, DEFAULT_COLUMN_CONFIG, DEFAULT_TABLE_CONFIG, DateEditor, DateFormatter, DateRangeValidator, DefaultFormatter, DefinitionBuilderComponent, DefinitionBuilderModule, DefinitionBuilderService, DefinitionExportService, DefinitionImportService, EditMode, EmailValidator, FilterOperator, FunctionFormatter, FunctionValidator, JsonSchemaValidatorService, LengthValidator, NavigationDirection, NavigationKey, NileAutoCompleteEditor, NileCalendarEditor, NileCodeEditor, NileDatePickerEditor, NileInputEditor, NileSelectEditor, NumberEditor, NumberFormatter, OUFormatter, PatternValidators, PercentageFormatter, RangeValidator, RegexValidator, RequiredValidator, RowValidationService, SampleDataGeneratorService, SelectEditor, SharedTableComponentsModule, SheetState, SimpleColumnConfig, SmartTableModule, SortDirection, StAddColumnButtonComponent, StCellComponent, StColumnEditorModalComponent, StColumnFilterComponent, StColumnMenuDropdownComponent, StColumnResizeDirective, StColumnVisibilityComponent, StHeaderComponent, StKeyboardNavigationDirective, StPaginationComponent, StRowActionsDropdownComponent, StSheetActionsComponent, StSheetComponent, StTableActionsComponent, StTableComponent, StWorkbookComponent, StringFormatter, TableConfigEditorComponent, TableState, TableZIndex, TemplateFormatter, TextAreaEditor, TextEditor, UrlValidator, ValidationLoggerService, VirtualScrollService, WorkbookState, canEdit, createCellState, createMemento, dnToHumanReadable, isCellValid, isDisplayMode, isNullOrUndefined, isValidDate, isValidationSuccess, mergeTableConfig, registerFormatter, resolveFormatter, restoreFromMemento };
|
|
13674
|
+
export { ArrayFormatter, AutosaveService, BaseColumnConfig, BooleanEditor, BooleanFormatter, BuilderPreviewComponent, BuilderToolbarComponent, Cell, CellAlignment, CellDataType, CellLifecycleState, CellVerticalAlignment, ChainValidator, ClickOutsideDirective, ColumnConfigFactory, ColumnEditorComponent, ColumnListComponent, Columns, CurrencyFormatter, DEFAULT_AUTOSAVE_CONFIG, DEFAULT_COLUMN_CONFIG, DEFAULT_TABLE_CONFIG, DateEditor, DateFormatter, DateRangeValidator, DefaultFormatter, DefinitionBuilderComponent, DefinitionBuilderModule, DefinitionBuilderService, DefinitionExportService, DefinitionImportService, EditMode, EmailValidator, FilterOperator, FunctionFormatter, FunctionValidator, JsonSchemaValidatorService, LengthValidator, NavigationDirection, NavigationKey, NileAutoCompleteEditor, NileCalendarEditor, NileChipEditor, NileCodeEditor, NileDatePickerEditor, NileInputEditor, NileSelectEditor, NumberEditor, NumberFormatter, OUFormatter, PatternValidators, PercentageFormatter, RangeValidator, RegexValidator, RequiredValidator, RowValidationService, SampleDataGeneratorService, SelectEditor, SharedTableComponentsModule, SheetState, SimpleColumnConfig, SmartTableModule, SortDirection, StAddColumnButtonComponent, StCellComponent, StColumnEditorModalComponent, StColumnFilterComponent, StColumnMenuDropdownComponent, StColumnResizeDirective, StColumnVisibilityComponent, StHeaderComponent, StKeyboardNavigationDirective, StPaginationComponent, StRowActionsDropdownComponent, StSheetActionsComponent, StSheetComponent, StTableActionsComponent, StTableComponent, StWorkbookComponent, StringFormatter, TableConfigEditorComponent, TableState, TableZIndex, TemplateFormatter, TextAreaEditor, TextEditor, UrlValidator, ValidationLoggerService, VirtualScrollService, WorkbookState, canEdit, createCellState, createMemento, dnToHumanReadable, isCellValid, isDisplayMode, isNullOrUndefined, isValidDate, isValidationSuccess, mergeTableConfig, registerFormatter, resolveFormatter, restoreFromMemento };
|
|
13354
13675
|
//# sourceMappingURL=aquera-ngx-smart-table.mjs.map
|