@acorex/components 22.4.36 → 22.4.37
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/fesm2022/acorex-components-combo-box.mjs +129 -6
- package/fesm2022/acorex-components-combo-box.mjs.map +1 -1
- package/fesm2022/acorex-components-data-table.mjs +125 -19
- package/fesm2022/acorex-components-data-table.mjs.map +1 -1
- package/fesm2022/acorex-components-lookup.mjs +48 -15
- package/fesm2022/acorex-components-lookup.mjs.map +1 -1
- package/fesm2022/acorex-components-tooltip.mjs +35 -14
- package/fesm2022/acorex-components-tooltip.mjs.map +1 -1
- package/package.json +3 -3
- package/types/acorex-components-combo-box.d.ts +5 -3
- package/types/acorex-components-data-table.d.ts +15 -2
- package/types/acorex-components-lookup.d.ts +4 -2
- package/types/acorex-components-tooltip.d.ts +1 -0
|
@@ -57,20 +57,16 @@ class AXTooltipDirective {
|
|
|
57
57
|
}
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
else if (content instanceof TemplateRef) {
|
|
67
|
-
this.popoverRef.content = content;
|
|
68
|
-
this.popoverRef.context = this.context();
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
this.popoverRef.context = { text: '' };
|
|
72
|
-
this.popoverRef.content = null;
|
|
60
|
+
if (overflowOnly) {
|
|
61
|
+
if (this.popoverRef) {
|
|
62
|
+
this.applyPopoverContent(content);
|
|
63
|
+
this.popoverRef.disabled = true;
|
|
64
|
+
}
|
|
65
|
+
return;
|
|
73
66
|
}
|
|
67
|
+
this.ensurePopover();
|
|
68
|
+
this.popoverRef.disabled = false;
|
|
69
|
+
this.applyPopoverContent(content);
|
|
74
70
|
}, /* @ts-ignore */
|
|
75
71
|
...(ngDevMode ? [{ debugName: "#contentEff" }] : /* istanbul ignore next */ []));
|
|
76
72
|
this.#dragWatchEff = effect(() => {
|
|
@@ -141,6 +137,23 @@ class AXTooltipDirective {
|
|
|
141
137
|
this.popoverRef.disabled = this.axTooltipDisabled();
|
|
142
138
|
}
|
|
143
139
|
#contentEff;
|
|
140
|
+
applyPopoverContent(content) {
|
|
141
|
+
if (!this.popoverRef) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
if (typeof content === 'string') {
|
|
145
|
+
this.popoverRef.content = AXTooltipComponent;
|
|
146
|
+
this.popoverRef.context = { text: content };
|
|
147
|
+
}
|
|
148
|
+
else if (content instanceof TemplateRef) {
|
|
149
|
+
this.popoverRef.content = content;
|
|
150
|
+
this.popoverRef.context = this.context();
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
this.popoverRef.context = { text: '' };
|
|
154
|
+
this.popoverRef.content = null;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
144
157
|
close() {
|
|
145
158
|
this.popoverRef?.close();
|
|
146
159
|
}
|
|
@@ -153,8 +166,16 @@ class AXTooltipDirective {
|
|
|
153
166
|
if (!content || this.axTooltipDisabled()) {
|
|
154
167
|
return;
|
|
155
168
|
}
|
|
169
|
+
if (!this.isOverflowing()) {
|
|
170
|
+
if (this.popoverRef) {
|
|
171
|
+
this.popoverRef.disabled = true;
|
|
172
|
+
}
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
156
175
|
this.ensurePopover();
|
|
157
|
-
this.
|
|
176
|
+
this.applyPopoverContent(content);
|
|
177
|
+
this.popoverRef.disabled = false;
|
|
178
|
+
void this.popoverRef.open();
|
|
158
179
|
}
|
|
159
180
|
isOverflowing() {
|
|
160
181
|
const host = this.elementRef.nativeElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-components-tooltip.mjs","sources":["../../../../packages/components/tooltip/src/lib/tooltip.component.ts","../../../../packages/components/tooltip/src/lib/tooltip.component.html","../../../../packages/components/tooltip/src/lib/tooltip.directive.ts","../../../../packages/components/tooltip/src/lib/tooltip.module.ts","../../../../packages/components/tooltip/src/acorex-components-tooltip.ts"],"sourcesContent":["import { AXComponent, AXPlacement, MXBaseComponent } from '@acorex/cdk/common';\nimport { Component, Input, ViewEncapsulation } from '@angular/core';\n\n/**\n * A component for displaying tooltips with additional information or context when hovering over elements.\n * @category Components\n */\n@Component({\n selector: 'ax-tooltip',\n templateUrl: './tooltip.component.html',\n styleUrls: ['./tooltip.component.css'],\n encapsulation: ViewEncapsulation.None,\n\n providers: [{ provide: AXComponent, useExisting: AXTooltipComponent }],\n})\nexport class AXTooltipComponent extends MXBaseComponent {\n /**\n * The text content displayed in the tooltip.\n * @defaultValue 'string'\n */\n @Input()\n text: string;\n\n /**\n * Specifies the position of the tooltip relative to the target element.\n *\n * @type {AXPlacement}\n */\n @Input()\n position: AXPlacement;\n}\n","<div class=\"ax-tooltip-container\">\n <div class=\"ax-tooltip\">\n {{ text }}\n </div>\n <!-- <div class=\"ax-tooltip-tringle ax-tooltip-tringle-{{ position }}\"></div> -->\n</div>\n","import { AXPlacementType, convertToPlacement } from '@acorex/cdk/common';\nimport { AXPopoverComponent } from '@acorex/components/popover';\nimport { Directive, effect, ElementRef, inject, input, Input, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { AXTooltipComponent } from './tooltip.component';\n//prettier-ignore\n// import { AXDragDirective } from '@acorex/cdk/drag-drop';\n\n@Directive({\n selector: '[axTooltip]',\n host: {\n '(mouseenter)': 'onHostMouseEnter()',\n },\n})\nexport class AXTooltipDirective {\n private vc = inject(ViewContainerRef);\n private elementRef = inject(ElementRef);\n // private dragRef = inject(AXDragDirective, { optional: true });\n\n axTooltipDisabled = input(false);\n content = input<string | TemplateRef<unknown>>('', { alias: 'axTooltip' });\n context = input<unknown>({}, { alias: 'axTooltipContext' });\n\n /**\n * When true, the tooltip opens on hover only if the host or a descendant is horizontally truncated.\n *\n * @defaultValue false\n */\n axTooltipOverflowOnly = input(false);\n\n private _placement: AXPlacementType = convertToPlacement('top');\n @Input('axTooltipPlacement')\n public get placement(): AXPlacementType {\n return this._placement;\n }\n public set placement(v: AXPlacementType) {\n this._placement = v;\n if (this.popoverRef) {\n this.popoverRef.placement = v;\n }\n }\n\n private _offsetX = 0;\n @Input('axTooltipOffsetX')\n public get offsetX(): number {\n return this._offsetX;\n }\n public set offsetX(v: number) {\n this._offsetX = v;\n if (this.popoverRef) {\n this.popoverRef.offsetX = v;\n }\n }\n\n private _offsetY = 0;\n @Input('axTooltipOffsetY')\n public get offsetY(): number {\n return this._offsetY;\n }\n public set offsetY(v: number) {\n this._offsetY = v;\n if (this.popoverRef) {\n this.popoverRef.offsetY = v;\n }\n }\n\n private _openAfter = 100;\n @Input('axTooltipOpenAfter')\n public get openAfter(): number {\n return this._openAfter;\n }\n public set openAfter(v: number) {\n this._openAfter = v;\n if (this.popoverRef) {\n this.popoverRef.openAfter = v;\n }\n }\n\n private _closeAfter = 100;\n @Input('axTooltipCloseAfter')\n public get closeAfter(): number {\n return this._closeAfter;\n }\n public set closeAfter(v: number) {\n this._closeAfter = v;\n if (this.popoverRef) {\n this.popoverRef.closeAfter = v;\n }\n }\n\n private popoverRef: AXPopoverComponent;\n\n private ensurePopover(): void {\n if (this.popoverRef) return;\n this.popoverRef = this.vc.createComponent(AXPopoverComponent).instance;\n this.popoverRef.target = this.elementRef.nativeElement;\n this.popoverRef.openOn = 'hover';\n this.popoverRef.closeOn = 'leave';\n this.popoverRef.placement = this.placement;\n this.popoverRef.offsetX = this.offsetX;\n this.popoverRef.offsetY = this.offsetY;\n this.popoverRef.openAfter = this.openAfter;\n this.popoverRef.closeAfter = this.closeAfter;\n this.popoverRef.restoreFocusOnClose = false;\n this.popoverRef.disabled = this.axTooltipDisabled();\n }\n\n #contentEff = effect(() => {\n const content = this.content();\n const disabled = this.axTooltipDisabled();\n const overflowOnly = this.axTooltipOverflowOnly();\n\n if (!content || disabled) {\n if (this.popoverRef?.isOpen) {\n this.popoverRef.close();\n }\n if (this.popoverRef) {\n this.popoverRef.disabled = true;\n }\n return;\n }\n\n this.ensurePopover();\n this.popoverRef.disabled = overflowOnly;\n\n if (typeof content === 'string') {\n this.popoverRef.content = AXTooltipComponent;\n this.popoverRef.context = { text: content };\n } else if (content instanceof TemplateRef) {\n this.popoverRef.content = content as TemplateRef<unknown>;\n this.popoverRef.context = this.context();\n } else {\n this.popoverRef.context = { text: '' };\n this.popoverRef.content = null;\n }\n });\n\n public close() {\n this.popoverRef?.close();\n }\n\n /** @ignore */\n protected onHostMouseEnter(): void {\n if (!this.axTooltipOverflowOnly()) {\n return;\n }\n const content = this.content();\n if (!content || this.axTooltipDisabled()) {\n return;\n }\n this.ensurePopover();\n this.popoverRef.disabled = !this.isOverflowing();\n }\n\n private isOverflowing(): boolean {\n const host = this.elementRef.nativeElement as HTMLElement;\n if (this.elementOverflows(host)) {\n return true;\n }\n const nodes = host.querySelectorAll<HTMLElement>('*');\n for (const node of nodes) {\n if (node.clientWidth === 0) {\n continue;\n }\n if (this.elementOverflows(node)) {\n return true;\n }\n }\n return false;\n }\n\n private elementOverflows(element: HTMLElement): boolean {\n return element.scrollWidth > element.clientWidth + 1;\n }\n\n #dragWatchEff = effect(() => {\n // if (this.dragRef?.isMoving()) {\n // this.popoverRef.close();\n // }\n });\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXTooltipComponent } from './tooltip.component';\nimport { AXTooltipDirective } from './tooltip.directive';\n\nconst COMPONENT = [AXTooltipComponent, AXTooltipDirective];\nconst MODULES = [CommonModule];\n\n@NgModule({\n imports: [...MODULES, ...COMPONENT],\n exports: [...COMPONENT],\n})\nexport class AXTooltipModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAGA;;;AAGG;AASG,MAAO,kBAAmB,SAAQ,eAAe,CAAA;8GAA1C,kBAAkB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAlB,IAAA,SAAA,IAAA,CA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.component.ts","../../../../packages/components/tooltip/src/lib/tooltip.component.html","../../../../packages/components/tooltip/src/lib/tooltip.directive.ts","../../../../packages/components/tooltip/src/lib/tooltip.module.ts","../../../../packages/components/tooltip/src/acorex-components-tooltip.ts"],"sourcesContent":["import { AXComponent, AXPlacement, MXBaseComponent } from '@acorex/cdk/common';\nimport { Component, Input, ViewEncapsulation } from '@angular/core';\n\n/**\n * A component for displaying tooltips with additional information or context when hovering over elements.\n * @category Components\n */\n@Component({\n selector: 'ax-tooltip',\n templateUrl: './tooltip.component.html',\n styleUrls: ['./tooltip.component.css'],\n encapsulation: ViewEncapsulation.None,\n\n providers: [{ provide: AXComponent, useExisting: AXTooltipComponent }],\n})\nexport class AXTooltipComponent extends MXBaseComponent {\n /**\n * The text content displayed in the tooltip.\n * @defaultValue 'string'\n */\n @Input()\n text: string;\n\n /**\n * Specifies the position of the tooltip relative to the target element.\n *\n * @type {AXPlacement}\n */\n @Input()\n position: AXPlacement;\n}\n","<div class=\"ax-tooltip-container\">\n <div class=\"ax-tooltip\">\n {{ text }}\n </div>\n <!-- <div class=\"ax-tooltip-tringle ax-tooltip-tringle-{{ position }}\"></div> -->\n</div>\n","import { AXPlacementType, convertToPlacement } from '@acorex/cdk/common';\nimport { AXPopoverComponent } from '@acorex/components/popover';\nimport { Directive, effect, ElementRef, inject, input, Input, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { AXTooltipComponent } from './tooltip.component';\n//prettier-ignore\n// import { AXDragDirective } from '@acorex/cdk/drag-drop';\n\n@Directive({\n selector: '[axTooltip]',\n host: {\n '(mouseenter)': 'onHostMouseEnter()',\n },\n})\nexport class AXTooltipDirective {\n private vc = inject(ViewContainerRef);\n private elementRef = inject(ElementRef);\n // private dragRef = inject(AXDragDirective, { optional: true });\n\n axTooltipDisabled = input(false);\n content = input<string | TemplateRef<unknown>>('', { alias: 'axTooltip' });\n context = input<unknown>({}, { alias: 'axTooltipContext' });\n\n /**\n * When true, the tooltip opens on hover only if the host or a descendant is horizontally truncated.\n *\n * @defaultValue false\n */\n axTooltipOverflowOnly = input(false);\n\n private _placement: AXPlacementType = convertToPlacement('top');\n @Input('axTooltipPlacement')\n public get placement(): AXPlacementType {\n return this._placement;\n }\n public set placement(v: AXPlacementType) {\n this._placement = v;\n if (this.popoverRef) {\n this.popoverRef.placement = v;\n }\n }\n\n private _offsetX = 0;\n @Input('axTooltipOffsetX')\n public get offsetX(): number {\n return this._offsetX;\n }\n public set offsetX(v: number) {\n this._offsetX = v;\n if (this.popoverRef) {\n this.popoverRef.offsetX = v;\n }\n }\n\n private _offsetY = 0;\n @Input('axTooltipOffsetY')\n public get offsetY(): number {\n return this._offsetY;\n }\n public set offsetY(v: number) {\n this._offsetY = v;\n if (this.popoverRef) {\n this.popoverRef.offsetY = v;\n }\n }\n\n private _openAfter = 100;\n @Input('axTooltipOpenAfter')\n public get openAfter(): number {\n return this._openAfter;\n }\n public set openAfter(v: number) {\n this._openAfter = v;\n if (this.popoverRef) {\n this.popoverRef.openAfter = v;\n }\n }\n\n private _closeAfter = 100;\n @Input('axTooltipCloseAfter')\n public get closeAfter(): number {\n return this._closeAfter;\n }\n public set closeAfter(v: number) {\n this._closeAfter = v;\n if (this.popoverRef) {\n this.popoverRef.closeAfter = v;\n }\n }\n\n private popoverRef: AXPopoverComponent;\n\n private ensurePopover(): void {\n if (this.popoverRef) return;\n this.popoverRef = this.vc.createComponent(AXPopoverComponent).instance;\n this.popoverRef.target = this.elementRef.nativeElement;\n this.popoverRef.openOn = 'hover';\n this.popoverRef.closeOn = 'leave';\n this.popoverRef.placement = this.placement;\n this.popoverRef.offsetX = this.offsetX;\n this.popoverRef.offsetY = this.offsetY;\n this.popoverRef.openAfter = this.openAfter;\n this.popoverRef.closeAfter = this.closeAfter;\n this.popoverRef.restoreFocusOnClose = false;\n this.popoverRef.disabled = this.axTooltipDisabled();\n }\n\n #contentEff = effect(() => {\n const content = this.content();\n const disabled = this.axTooltipDisabled();\n const overflowOnly = this.axTooltipOverflowOnly();\n\n if (!content || disabled) {\n if (this.popoverRef?.isOpen) {\n this.popoverRef.close();\n }\n if (this.popoverRef) {\n this.popoverRef.disabled = true;\n }\n return;\n }\n\n if (overflowOnly) {\n if (this.popoverRef) {\n this.applyPopoverContent(content);\n this.popoverRef.disabled = true;\n }\n return;\n }\n\n this.ensurePopover();\n this.popoverRef.disabled = false;\n this.applyPopoverContent(content);\n });\n\n private applyPopoverContent(content: string | TemplateRef<unknown>): void {\n if (!this.popoverRef) {\n return;\n }\n if (typeof content === 'string') {\n this.popoverRef.content = AXTooltipComponent;\n this.popoverRef.context = { text: content };\n } else if (content instanceof TemplateRef) {\n this.popoverRef.content = content as TemplateRef<unknown>;\n this.popoverRef.context = this.context();\n } else {\n this.popoverRef.context = { text: '' };\n this.popoverRef.content = null;\n }\n }\n\n public close() {\n this.popoverRef?.close();\n }\n\n /** @ignore */\n protected onHostMouseEnter(): void {\n if (!this.axTooltipOverflowOnly()) {\n return;\n }\n const content = this.content();\n if (!content || this.axTooltipDisabled()) {\n return;\n }\n if (!this.isOverflowing()) {\n if (this.popoverRef) {\n this.popoverRef.disabled = true;\n }\n return;\n }\n this.ensurePopover();\n this.applyPopoverContent(content);\n this.popoverRef.disabled = false;\n void this.popoverRef.open();\n }\n\n private isOverflowing(): boolean {\n const host = this.elementRef.nativeElement as HTMLElement;\n if (this.elementOverflows(host)) {\n return true;\n }\n const nodes = host.querySelectorAll<HTMLElement>('*');\n for (const node of nodes) {\n if (node.clientWidth === 0) {\n continue;\n }\n if (this.elementOverflows(node)) {\n return true;\n }\n }\n return false;\n }\n\n private elementOverflows(element: HTMLElement): boolean {\n return element.scrollWidth > element.clientWidth + 1;\n }\n\n #dragWatchEff = effect(() => {\n // if (this.dragRef?.isMoving()) {\n // this.popoverRef.close();\n // }\n });\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXTooltipComponent } from './tooltip.component';\nimport { AXTooltipDirective } from './tooltip.directive';\n\nconst COMPONENT = [AXTooltipComponent, AXTooltipDirective];\nconst MODULES = [CommonModule];\n\n@NgModule({\n imports: [...MODULES, ...COMPONENT],\n exports: [...COMPONENT],\n})\nexport class AXTooltipModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAGA;;;AAGG;AASG,MAAO,kBAAmB,SAAQ,eAAe,CAAA;8GAA1C,kBAAkB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAlB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,kBAAkB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,QAAA,EAAA,UAAA,EAAA,EAAA,SAAA,EAFlB,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC,iDCbxE,+LAMA,EAAA,MAAA,EAAA,CAAA,8gEAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;2FDSa,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAR9B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,YAAY,EAAA,aAAA,EAGP,iBAAiB,CAAC,IAAI,aAE1B,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAA,kBAAoB,EAAE,CAAC,EAAA,QAAA,EAAA,+LAAA,EAAA,MAAA,EAAA,CAAA,8gEAAA,CAAA,EAAA;;sBAOrE;;sBAQA;;;AExBH;AACA;MAQa,kBAAkB,CAAA;AAN/B,IAAA,WAAA,GAAA;AAOU,QAAA,IAAA,CAAA,EAAE,GAAG,MAAM,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;uBAAC,kBAAkB;;sBAYxB,KAAK;uBAAC,oBAAoB;;sBAY1B,KAAK;uBAAC,qBAAqB;;;ACzE9B,MAAM,SAAS,GAAG,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;AAC1D,MAAM,OAAO,GAAG,CAAC,YAAY,CAAC;MAMjB,eAAe,CAAA;8GAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAf,eAAe,EAAA,OAAA,EAAA,CANX,YAAY,EADV,kBAAkB,EAAE,kBAAkB,CAAA,EAAA,OAAA,EAAA,CAAtC,kBAAkB,EAAE,kBAAkB,CAAA,EAAA,CAAA,CAAA;AAO5C,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,YAHb,OAAO,CAAA,EAAA,CAAA,CAAA;;2FAGT,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,GAAG,SAAS,CAAC;AACnC,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;AACxB,iBAAA;;;ACXD;;AAEG;;"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acorex/components",
|
|
3
|
-
"version": "22.4.
|
|
3
|
+
"version": "22.4.37",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@acorex/core": "22.4.
|
|
6
|
-
"@acorex/cdk": "22.4.
|
|
5
|
+
"@acorex/core": "22.4.37",
|
|
6
|
+
"@acorex/cdk": "22.4.37",
|
|
7
7
|
"@angular/aria": ">=22.1.0",
|
|
8
8
|
"polytype": ">=0.17.0",
|
|
9
9
|
"hammerjs": ">=2.0.8",
|
|
@@ -237,12 +237,13 @@ declare class AXComboBoxComponent extends NXValueComponent implements FormValueC
|
|
|
237
237
|
/**
|
|
238
238
|
* Keyboard handling on the trigger:
|
|
239
239
|
* - Searchable: Enter never submits the form; with no matches the value is cleared (`null`).
|
|
240
|
+
* - Arrow keys open the list (when collapsed) and move the active option (when expanded), like `ax-lookup`.
|
|
241
|
+
* - Multi-select: Space toggles the active option while the popup is open; Backspace with an empty
|
|
242
|
+
* trigger input removes the last chip; repeated presses clear the whole selection.
|
|
240
243
|
* - Non-searchable: open with Enter/Space when collapsed; commit with Space when expanded.
|
|
241
|
-
* - Multi-select: Backspace with an empty trigger input removes the last chip; repeated presses
|
|
242
|
-
* clear the whole selection.
|
|
243
244
|
*/
|
|
244
245
|
protected onTriggerKeydown(event: KeyboardEvent): void;
|
|
245
|
-
/** Handles
|
|
246
|
+
/** Handles keyboard in the actionsheet search field (ArrowDown moves to the list; Enter commits). */
|
|
246
247
|
protected onSheetSearchKeydown(e: AXHtmlEvent<KeyboardEvent>): void;
|
|
247
248
|
/** Blocks typing when the trigger is not editable (keeps Tab / keyboard open working). */
|
|
248
249
|
protected onBeforeInput(event: Event): void;
|
|
@@ -292,6 +293,7 @@ declare class AXComboBoxComponent extends NXValueComponent implements FormValueC
|
|
|
292
293
|
* When the user typed a query with no matches, Enter clears single-select to `null`.
|
|
293
294
|
*/
|
|
294
295
|
protected onListEnter(event: Event): void;
|
|
296
|
+
protected onListSpace(event: Event): void;
|
|
295
297
|
protected commit(event?: Event): void;
|
|
296
298
|
/**
|
|
297
299
|
* Focuses the combo box trigger input.
|
|
@@ -34,7 +34,7 @@ declare abstract class AXDataTableColumnComponent {
|
|
|
34
34
|
allowSorting: boolean;
|
|
35
35
|
allowResizing: boolean;
|
|
36
36
|
/**
|
|
37
|
-
* When true, shows the cell
|
|
37
|
+
* When true, shows the full cell text in a tooltip on hover when the cell is truncated.
|
|
38
38
|
*/
|
|
39
39
|
hasTitle: boolean;
|
|
40
40
|
sortIndex: number | undefined;
|
|
@@ -703,6 +703,8 @@ declare class AXRowExpandColumnComponent extends AXDataTableColumnComponent {
|
|
|
703
703
|
declare class AXRowIndexColumnComponent extends AXDataTableColumnComponent implements OnInit {
|
|
704
704
|
protected grid: AXBaseDataTable;
|
|
705
705
|
private unsubscriber;
|
|
706
|
+
private formatService;
|
|
707
|
+
private platformId;
|
|
706
708
|
/**
|
|
707
709
|
* @ignore
|
|
708
710
|
*/
|
|
@@ -741,6 +743,10 @@ declare class AXRowIndexColumnComponent extends AXDataTableColumnComponent imple
|
|
|
741
743
|
* @defaultValue false
|
|
742
744
|
*/
|
|
743
745
|
padZero: boolean;
|
|
746
|
+
/**
|
|
747
|
+
* Fixed width for zero-padding the row index. When set, padding uses this length instead of deriving it from the total row count.
|
|
748
|
+
*/
|
|
749
|
+
zeroPadLength?: number;
|
|
744
750
|
/**
|
|
745
751
|
* @ignore
|
|
746
752
|
*/
|
|
@@ -749,6 +755,9 @@ declare class AXRowIndexColumnComponent extends AXDataTableColumnComponent imple
|
|
|
749
755
|
* @ignore
|
|
750
756
|
*/
|
|
751
757
|
ngOnInit(): void;
|
|
758
|
+
/** Formats the 1-based row index synchronously so auto-fit can measure cell text in the DOM. */
|
|
759
|
+
protected formatRowIndex(rowIndex: number): string;
|
|
760
|
+
private scheduleAutoFit;
|
|
752
761
|
/**
|
|
753
762
|
* Disables sorting for this column.
|
|
754
763
|
*
|
|
@@ -766,7 +775,7 @@ declare class AXRowIndexColumnComponent extends AXDataTableColumnComponent imple
|
|
|
766
775
|
get autoFitPadding(): number;
|
|
767
776
|
get minAutoWidth(): number;
|
|
768
777
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXRowIndexColumnComponent, never>;
|
|
769
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AXRowIndexColumnComponent, "ax-index-column", never, { "width": { "alias": "width"; "required": false; }; "caption": { "alias": "caption"; "required": false; }; "fixed": { "alias": "fixed"; "required": false; }; "footerTemplate": { "alias": "footerTemplate"; "required": false; }; "padZero": { "alias": "padZero"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
778
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AXRowIndexColumnComponent, "ax-index-column", never, { "width": { "alias": "width"; "required": false; }; "caption": { "alias": "caption"; "required": false; }; "fixed": { "alias": "fixed"; "required": false; }; "footerTemplate": { "alias": "footerTemplate"; "required": false; }; "padZero": { "alias": "padZero"; "required": false; }; "zeroPadLength": { "alias": "zeroPadLength"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
770
779
|
}
|
|
771
780
|
|
|
772
781
|
/**
|
|
@@ -1314,6 +1323,10 @@ declare class AXDataTableComponent extends AXBaseDataTable implements OnInit, Af
|
|
|
1314
1323
|
* @ignore
|
|
1315
1324
|
*/
|
|
1316
1325
|
protected resolveColumnWidth(column: AXDataTableColumnComponent): string | number | 'auto';
|
|
1326
|
+
/**
|
|
1327
|
+
* Returns the display text for a cell. Used for overflow tooltips when the column has `hasTitle`.
|
|
1328
|
+
*/
|
|
1329
|
+
resolveCellTooltipText(column: AXDataTableColumnComponent, rowData: unknown): string;
|
|
1317
1330
|
/**
|
|
1318
1331
|
* Returns the display text for a cell. Used for the cell tooltip when the column has `hasTitle`.
|
|
1319
1332
|
*/
|
|
@@ -600,10 +600,12 @@ declare class AXLookupComponent<T = AXLookupItem> extends NXValueComponent imple
|
|
|
600
600
|
/** Blocks typing when the trigger is not editable (keeps Tab / keyboard open working). */
|
|
601
601
|
protected onBeforeInput(event: Event): void;
|
|
602
602
|
/**
|
|
603
|
-
* On pointer down,
|
|
604
|
-
*
|
|
603
|
+
* On pointer down, focus the trigger without preventing native selection.
|
|
604
|
+
* Select-all runs on pointer up when the pointer did not move (see `onTriggerPointerUp`).
|
|
605
605
|
*/
|
|
606
606
|
protected onTriggerPointerDown(event: PointerEvent): void;
|
|
607
|
+
protected onTriggerPointerUp(event: PointerEvent): void;
|
|
608
|
+
protected onTriggerPointerCancel(): void;
|
|
607
609
|
/**
|
|
608
610
|
* Returns focus to the search field when list navigation requests it.
|
|
609
611
|
*/
|