@aquera/ngx-smart-table 0.0.17-patch-0.6 → 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/nile-chip-editor.mjs +5 -2
- 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 +77 -46
- package/fesm2015/aquera-ngx-smart-table.mjs.map +1 -1
- package/fesm2020/aquera-ngx-smart-table.mjs +75 -46
- package/fesm2020/aquera-ngx-smart-table.mjs.map +1 -1
- package/lib/editors/nile-chip-editor.d.ts +1 -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
|
@@ -4898,6 +4898,7 @@ class NileChipEditor {
|
|
|
4898
4898
|
this.acceptsInitialKeypress = false;
|
|
4899
4899
|
this.eventListeners = [];
|
|
4900
4900
|
this.trackedValues = [];
|
|
4901
|
+
this.hasChangeOccurred = false;
|
|
4901
4902
|
}
|
|
4902
4903
|
edit(context) {
|
|
4903
4904
|
var _a, _b;
|
|
@@ -5054,6 +5055,7 @@ class NileChipEditor {
|
|
|
5054
5055
|
const detail = e.detail;
|
|
5055
5056
|
const newValue = Array.isArray(detail === null || detail === void 0 ? void 0 : detail.value) ? [...detail.value] : (((_a = this.chip) === null || _a === void 0 ? void 0 : _a.value) ? [...this.chip.value] : []);
|
|
5056
5057
|
this.trackedValues = newValue;
|
|
5058
|
+
this.hasChangeOccurred = true;
|
|
5057
5059
|
context.onChange(newValue);
|
|
5058
5060
|
});
|
|
5059
5061
|
// Keyboard handling on the chip element
|
|
@@ -5123,6 +5125,7 @@ class NileChipEditor {
|
|
|
5123
5125
|
this.chip = undefined;
|
|
5124
5126
|
this.cellContainer = undefined;
|
|
5125
5127
|
this.trackedValues = [];
|
|
5128
|
+
this.hasChangeOccurred = false;
|
|
5126
5129
|
}
|
|
5127
5130
|
focus() {
|
|
5128
5131
|
var _a;
|
|
@@ -5132,7 +5135,7 @@ class NileChipEditor {
|
|
|
5132
5135
|
catch ( /* ignore */_b) { /* ignore */ }
|
|
5133
5136
|
}
|
|
5134
5137
|
getCurrentValue() {
|
|
5135
|
-
if (this.
|
|
5138
|
+
if (this.hasChangeOccurred) {
|
|
5136
5139
|
return [...this.trackedValues];
|
|
5137
5140
|
}
|
|
5138
5141
|
if (!this.chip)
|
|
@@ -8056,7 +8059,7 @@ class StColumnMenuDropdownComponent {
|
|
|
8056
8059
|
*/
|
|
8057
8060
|
this.isOpen = false;
|
|
8058
8061
|
/**
|
|
8059
|
-
* Position of the dropdown (x, y coordinates)
|
|
8062
|
+
* Position of the dropdown (x, y coordinates, triggerTop for flip positioning)
|
|
8060
8063
|
*/
|
|
8061
8064
|
this.position = { x: 0, y: 0 };
|
|
8062
8065
|
/**
|
|
@@ -8170,25 +8173,42 @@ class StColumnMenuDropdownComponent {
|
|
|
8170
8173
|
this.dropdownStyle = {};
|
|
8171
8174
|
return;
|
|
8172
8175
|
}
|
|
8173
|
-
const viewportWidth = window.innerWidth;
|
|
8174
|
-
const viewportHeight = window.innerHeight;
|
|
8175
|
-
const dropdownWidth = 280; // Approximate dropdown width
|
|
8176
|
-
const dropdownHeight = 300; // Approximate max dropdown height
|
|
8177
8176
|
let { x, y } = this.position;
|
|
8178
|
-
//
|
|
8179
|
-
if (x + dropdownWidth > viewportWidth) {
|
|
8180
|
-
x = Math.max(10, viewportWidth - dropdownWidth - 10);
|
|
8181
|
-
}
|
|
8182
|
-
// Adjust vertical position if dropdown would overflow
|
|
8183
|
-
if (y + dropdownHeight > viewportHeight) {
|
|
8184
|
-
y = Math.max(10, viewportHeight - dropdownHeight - 10);
|
|
8185
|
-
}
|
|
8177
|
+
// Render at initial position first
|
|
8186
8178
|
this.dropdownStyle = {
|
|
8187
8179
|
position: 'fixed',
|
|
8188
8180
|
left: `${x}px`,
|
|
8189
8181
|
top: `${y}px`,
|
|
8190
|
-
'z-index': 9999
|
|
8182
|
+
'z-index': 9999,
|
|
8183
|
+
visibility: 'hidden'
|
|
8191
8184
|
};
|
|
8185
|
+
// After rendering, measure actual size and adjust if needed
|
|
8186
|
+
requestAnimationFrame(() => {
|
|
8187
|
+
var _a, _b;
|
|
8188
|
+
const viewportWidth = window.innerWidth;
|
|
8189
|
+
const viewportHeight = window.innerHeight;
|
|
8190
|
+
const el = (_a = this.dropdownPanel) === null || _a === void 0 ? void 0 : _a.nativeElement;
|
|
8191
|
+
const dropdownWidth = (el === null || el === void 0 ? void 0 : el.offsetWidth) || 280;
|
|
8192
|
+
const dropdownHeight = (el === null || el === void 0 ? void 0 : el.offsetHeight) || 200;
|
|
8193
|
+
// Adjust horizontal position if dropdown would overflow
|
|
8194
|
+
if (x + dropdownWidth > viewportWidth) {
|
|
8195
|
+
x = Math.max(10, viewportWidth - dropdownWidth - 10);
|
|
8196
|
+
}
|
|
8197
|
+
// Adjust vertical position — flip above the trigger if it overflows bottom
|
|
8198
|
+
if (y + dropdownHeight > viewportHeight) {
|
|
8199
|
+
const triggerTop = (_b = this.position.triggerTop) !== null && _b !== void 0 ? _b : this.position.y;
|
|
8200
|
+
y = triggerTop - dropdownHeight - 4;
|
|
8201
|
+
}
|
|
8202
|
+
// Clamp to viewport edges
|
|
8203
|
+
x = Math.max(10, x);
|
|
8204
|
+
y = Math.max(10, y);
|
|
8205
|
+
this.dropdownStyle = {
|
|
8206
|
+
position: 'fixed',
|
|
8207
|
+
left: `${x}px`,
|
|
8208
|
+
top: `${y}px`,
|
|
8209
|
+
'z-index': 9999
|
|
8210
|
+
};
|
|
8211
|
+
});
|
|
8192
8212
|
}
|
|
8193
8213
|
/**
|
|
8194
8214
|
* Check if an action is disabled
|
|
@@ -8256,10 +8276,10 @@ class StColumnMenuDropdownComponent {
|
|
|
8256
8276
|
}
|
|
8257
8277
|
}
|
|
8258
8278
|
StColumnMenuDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: StColumnMenuDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8259
|
-
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"] }] });
|
|
8279
|
+
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"] }] });
|
|
8260
8280
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: StColumnMenuDropdownComponent, decorators: [{
|
|
8261
8281
|
type: Component,
|
|
8262
|
-
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"] }]
|
|
8282
|
+
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"] }]
|
|
8263
8283
|
}], propDecorators: { isOpen: [{
|
|
8264
8284
|
type: Input
|
|
8265
8285
|
}], position: [{
|
|
@@ -8273,6 +8293,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
8273
8293
|
}], filterPopup: [{
|
|
8274
8294
|
type: ViewChild,
|
|
8275
8295
|
args: ['filterPopup']
|
|
8296
|
+
}], dropdownPanel: [{
|
|
8297
|
+
type: ViewChild,
|
|
8298
|
+
args: ['dropdownPanel']
|
|
8276
8299
|
}], onBackdropClick: [{
|
|
8277
8300
|
type: HostListener,
|
|
8278
8301
|
args: ['click', ['$event']]
|
|
@@ -8285,7 +8308,7 @@ class StRowActionsDropdownComponent {
|
|
|
8285
8308
|
*/
|
|
8286
8309
|
this.isOpen = false;
|
|
8287
8310
|
/**
|
|
8288
|
-
* Position of the dropdown (x, y coordinates)
|
|
8311
|
+
* Position of the dropdown (x, y coordinates, triggerTop for flip positioning)
|
|
8289
8312
|
*/
|
|
8290
8313
|
this.position = { x: 0, y: 0 };
|
|
8291
8314
|
/**
|
|
@@ -8340,35 +8363,40 @@ class StRowActionsDropdownComponent {
|
|
|
8340
8363
|
this.dropdownStyle = {};
|
|
8341
8364
|
return;
|
|
8342
8365
|
}
|
|
8343
|
-
const DROPDOWN_WIDTH = 200; // Approximate width
|
|
8344
|
-
const DROPDOWN_HEIGHT = this.visibleActions.length * 40 + 16; // Approximate height
|
|
8345
|
-
const viewportWidth = window.innerWidth;
|
|
8346
|
-
const viewportHeight = window.innerHeight;
|
|
8347
8366
|
let left = this.position.x;
|
|
8348
8367
|
let top = this.position.y;
|
|
8349
|
-
//
|
|
8350
|
-
if (left + DROPDOWN_WIDTH > viewportWidth) {
|
|
8351
|
-
left = viewportWidth - DROPDOWN_WIDTH - 10;
|
|
8352
|
-
}
|
|
8353
|
-
// Check if dropdown would overflow bottom edge
|
|
8354
|
-
if (top + DROPDOWN_HEIGHT > viewportHeight) {
|
|
8355
|
-
// Position above the trigger
|
|
8356
|
-
top = this.position.y - DROPDOWN_HEIGHT;
|
|
8357
|
-
}
|
|
8358
|
-
// Ensure dropdown doesn't go off-screen on the left
|
|
8359
|
-
if (left < 10) {
|
|
8360
|
-
left = 10;
|
|
8361
|
-
}
|
|
8362
|
-
// Ensure dropdown doesn't go off-screen on the top
|
|
8363
|
-
if (top < 10) {
|
|
8364
|
-
top = 10;
|
|
8365
|
-
}
|
|
8368
|
+
// Render at initial position first (hidden until measured)
|
|
8366
8369
|
this.dropdownStyle = {
|
|
8367
8370
|
position: 'fixed',
|
|
8368
8371
|
left: `${left}px`,
|
|
8369
8372
|
top: `${top}px`,
|
|
8370
|
-
zIndex: TableZIndex.ROW_ACTIONS_DROPDOWN
|
|
8373
|
+
zIndex: TableZIndex.ROW_ACTIONS_DROPDOWN,
|
|
8374
|
+
visibility: 'hidden'
|
|
8371
8375
|
};
|
|
8376
|
+
// After rendering, measure actual size and adjust position directly on the DOM
|
|
8377
|
+
// (OnPush change detection won't pick up property changes inside requestAnimationFrame)
|
|
8378
|
+
requestAnimationFrame(() => {
|
|
8379
|
+
var _a, _b;
|
|
8380
|
+
const el = (_a = this.dropdownPanel) === null || _a === void 0 ? void 0 : _a.nativeElement;
|
|
8381
|
+
if (!el)
|
|
8382
|
+
return;
|
|
8383
|
+
const viewportWidth = window.innerWidth;
|
|
8384
|
+
const viewportHeight = window.innerHeight;
|
|
8385
|
+
const dropdownWidth = el.offsetWidth || 200;
|
|
8386
|
+
const dropdownHeight = el.offsetHeight || (this.visibleActions.length * 40 + 16);
|
|
8387
|
+
if (left + dropdownWidth > viewportWidth) {
|
|
8388
|
+
left = viewportWidth - dropdownWidth - 10;
|
|
8389
|
+
}
|
|
8390
|
+
if (top + dropdownHeight > viewportHeight) {
|
|
8391
|
+
const triggerTop = (_b = this.position.triggerTop) !== null && _b !== void 0 ? _b : this.position.y;
|
|
8392
|
+
top = triggerTop - dropdownHeight - 4;
|
|
8393
|
+
}
|
|
8394
|
+
left = Math.max(10, left);
|
|
8395
|
+
top = Math.max(10, top);
|
|
8396
|
+
el.style.left = `${left}px`;
|
|
8397
|
+
el.style.top = `${top}px`;
|
|
8398
|
+
el.style.visibility = 'visible';
|
|
8399
|
+
});
|
|
8372
8400
|
}
|
|
8373
8401
|
/**
|
|
8374
8402
|
* Handle action click
|
|
@@ -8422,10 +8450,10 @@ class StRowActionsDropdownComponent {
|
|
|
8422
8450
|
}
|
|
8423
8451
|
}
|
|
8424
8452
|
StRowActionsDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: StRowActionsDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8425
|
-
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\"
|
|
8453
|
+
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 });
|
|
8426
8454
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: StRowActionsDropdownComponent, decorators: [{
|
|
8427
8455
|
type: Component,
|
|
8428
|
-
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\"
|
|
8456
|
+
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"] }]
|
|
8429
8457
|
}], propDecorators: { isOpen: [{
|
|
8430
8458
|
type: Input
|
|
8431
8459
|
}], position: [{
|
|
@@ -8436,6 +8464,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
8436
8464
|
type: Output
|
|
8437
8465
|
}], closed: [{
|
|
8438
8466
|
type: Output
|
|
8467
|
+
}], dropdownPanel: [{
|
|
8468
|
+
type: ViewChild,
|
|
8469
|
+
args: ['dropdownPanel']
|
|
8439
8470
|
}], onEscapeKey: [{
|
|
8440
8471
|
type: HostListener,
|
|
8441
8472
|
args: ['document:keydown.escape', ['$event']]
|
|
@@ -9730,10 +9761,10 @@ class StTableComponent {
|
|
|
9730
9761
|
event.stopPropagation();
|
|
9731
9762
|
const target = event.currentTarget;
|
|
9732
9763
|
const rect = target.getBoundingClientRect();
|
|
9733
|
-
// Calculate position (below the button by default)
|
|
9734
9764
|
const position = {
|
|
9735
9765
|
x: rect.left,
|
|
9736
|
-
y: rect.bottom + 4
|
|
9766
|
+
y: rect.bottom + 4,
|
|
9767
|
+
triggerTop: rect.top
|
|
9737
9768
|
};
|
|
9738
9769
|
// Create context
|
|
9739
9770
|
const context = {
|
|
@@ -9795,10 +9826,10 @@ class StTableComponent {
|
|
|
9795
9826
|
event.stopPropagation();
|
|
9796
9827
|
const target = event.currentTarget;
|
|
9797
9828
|
const rect = target.getBoundingClientRect();
|
|
9798
|
-
// Calculate position (below the button by default)
|
|
9799
9829
|
const position = {
|
|
9800
9830
|
x: rect.left,
|
|
9801
|
-
y: rect.bottom + 4
|
|
9831
|
+
y: rect.bottom + 4,
|
|
9832
|
+
triggerTop: rect.top
|
|
9802
9833
|
};
|
|
9803
9834
|
// Create context
|
|
9804
9835
|
const context = {
|