Skip to content

Commit 47c2200

Browse files
committed
improved resize experience
Signed-off-by: Maximilian Inckmann <[email protected]>
1 parent 3db2daa commit 47c2200

File tree

8 files changed

+294
-164
lines changed

8 files changed

+294
-164
lines changed

packages/react-library/lib/components/stencil-generated/components.ts

Lines changed: 86 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -7,174 +7,144 @@
77

88
/* eslint-disable */
99

10-
import {
11-
ColorHighlight as ColorHighlightElement,
12-
defineCustomElement as defineColorHighlight,
13-
} from '@kit-data-manager/pid-component/dist/components/color-highlight.js';
14-
import {
15-
CopyButton as CopyButtonElement,
16-
defineCustomElement as defineCopyButton,
17-
} from '@kit-data-manager/pid-component/dist/components/copy-button.js';
18-
import {
19-
defineCustomElement as defineJsonViewer,
20-
JsonViewer as JsonViewerElement,
21-
} from '@kit-data-manager/pid-component/dist/components/json-viewer.js';
22-
import {
23-
defineCustomElement as defineLocaleVisualization,
24-
LocaleVisualization as LocaleVisualizationElement,
25-
} from '@kit-data-manager/pid-component/dist/components/locale-visualization.js';
26-
import {
27-
defineCustomElement as definePidActions,
28-
PidActions as PidActionsElement,
29-
} from '@kit-data-manager/pid-component/dist/components/pid-actions.js';
30-
import {
31-
defineCustomElement as definePidCollapsible,
32-
PidCollapsible as PidCollapsibleElement,
33-
} from '@kit-data-manager/pid-component/dist/components/pid-collapsible.js';
34-
import {
35-
defineCustomElement as definePidComponent,
36-
PidComponent as PidComponentElement,
37-
} from '@kit-data-manager/pid-component/dist/components/pid-component.js';
38-
import {
39-
defineCustomElement as definePidDataTable,
40-
PidDataTable as PidDataTableElement,
41-
} from '@kit-data-manager/pid-component/dist/components/pid-data-table.js';
42-
import {
43-
defineCustomElement as definePidPagination,
44-
PidPagination as PidPaginationElement,
45-
} from '@kit-data-manager/pid-component/dist/components/pid-pagination.js';
46-
import {
47-
defineCustomElement as definePidTooltip,
48-
PidTooltip as PidTooltipElement,
49-
} from '@kit-data-manager/pid-component/dist/components/pid-tooltip.js';
10+
import { ColorHighlight as ColorHighlightElement, defineCustomElement as defineColorHighlight } from "@kit-data-manager/pid-component/dist/components/color-highlight.js";
11+
import { CopyButton as CopyButtonElement, defineCustomElement as defineCopyButton } from "@kit-data-manager/pid-component/dist/components/copy-button.js";
12+
import { JsonViewer as JsonViewerElement, defineCustomElement as defineJsonViewer } from "@kit-data-manager/pid-component/dist/components/json-viewer.js";
13+
import { LocaleVisualization as LocaleVisualizationElement, defineCustomElement as defineLocaleVisualization } from "@kit-data-manager/pid-component/dist/components/locale-visualization.js";
14+
import { PidActions as PidActionsElement, defineCustomElement as definePidActions } from "@kit-data-manager/pid-component/dist/components/pid-actions.js";
15+
import { PidCollapsible as PidCollapsibleElement, defineCustomElement as definePidCollapsible } from "@kit-data-manager/pid-component/dist/components/pid-collapsible.js";
16+
import { PidComponent as PidComponentElement, defineCustomElement as definePidComponent } from "@kit-data-manager/pid-component/dist/components/pid-component.js";
17+
import { PidDataTable as PidDataTableElement, defineCustomElement as definePidDataTable } from "@kit-data-manager/pid-component/dist/components/pid-data-table.js";
18+
import { PidPagination as PidPaginationElement, defineCustomElement as definePidPagination } from "@kit-data-manager/pid-component/dist/components/pid-pagination.js";
19+
import { PidTooltip as PidTooltipElement, defineCustomElement as definePidTooltip } from "@kit-data-manager/pid-component/dist/components/pid-tooltip.js";
5020
import type { EventName, StencilReactComponent } from '@stencil/react-output-target/runtime';
5121
import { createComponent } from '@stencil/react-output-target/runtime';
5222
import React from 'react';
5323

5424
export type ColorHighlightEvents = NonNullable<unknown>;
5525

5626
export const ColorHighlight: StencilReactComponent<ColorHighlightElement, ColorHighlightEvents> = /*@__PURE__*/ createComponent<ColorHighlightElement, ColorHighlightEvents>({
57-
tagName: 'color-highlight',
58-
elementClass: ColorHighlightElement,
59-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
60-
react: React,
61-
events: {} as ColorHighlightEvents,
62-
defineCustomElement: defineColorHighlight
27+
tagName: 'color-highlight',
28+
elementClass: ColorHighlightElement,
29+
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
30+
react: React,
31+
events: {} as ColorHighlightEvents,
32+
defineCustomElement: defineColorHighlight
6333
});
6434

65-
export type CopyButtonEvents = NonNulla,ble<unknown>;
35+
export type CopyButtonEvents = NonNullable<unknown>;
6636

6737
export const CopyButton: StencilReactComponent<CopyButtonElement, CopyButtonEvents> = /*@__PURE__*/ createComponent<CopyButtonElement, CopyButtonEvents>({
68-
tagName: 'copy-button',
69-
elementClass: CopyButtonElement,
70-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
71-
react: React,
72-
events: {} as CopyButtonEvents,
73-
defineCustomElement: defineCopyButton,
38+
tagName: 'copy-button',
39+
elementClass: CopyButtonElement,
40+
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
41+
react: React,
42+
events: {} as CopyButtonEvents,
43+
defineCustomElement: defineCopyButton
7444
});
7545

7646
export type JsonViewerEvents = NonNullable<unknown>;
7747

7848
export const JsonViewer: StencilReactComponent<JsonViewerElement, JsonViewerEvents> = /*@__PURE__*/ createComponent<JsonViewerElement, JsonViewerEvents>({
79-
tagName: 'json-viewer',
80-
elementClass: JsonViewerElement,
81-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
82-
react: React,
83-
events: {} as JsonViewerEvents,
84-
defineCustomElement: defineJsonViewer,
49+
tagName: 'json-viewer',
50+
elementClass: JsonViewerElement,
51+
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
52+
react: React,
53+
events: {} as JsonViewerEvents,
54+
defineCustomElement: defineJsonViewer
8555
});
8656

8757
export type LocaleVisualizationEvents = NonNullable<unknown>;
8858

8959
export const LocaleVisualization: StencilReactComponent<LocaleVisualizationElement, LocaleVisualizationEvents> = /*@__PURE__*/ createComponent<LocaleVisualizationElement, LocaleVisualizationEvents>({
90-
tagName: 'locale-visualization',
91-
elementClass: LocaleVisualizationElement,
92-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
93-
react: React,
94-
events: {} as LocaleVisualizationEvents,
95-
defineCustomElement: defineLocaleVisualization,
60+
tagName: 'locale-visualization',
61+
elementClass: LocaleVisualizationElement,
62+
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
63+
react: React,
64+
events: {} as LocaleVisualizationEvents,
65+
defineCustomElement: defineLocaleVisualization
9666
});
9767

9868
export type PidActionsEvents = NonNullable<unknown>;
9969

10070
export const PidActions: StencilReactComponent<PidActionsElement, PidActionsEvents> = /*@__PURE__*/ createComponent<PidActionsElement, PidActionsEvents>({
101-
tagName: 'pid-actions',
102-
elementClass: PidActionsElement,
103-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
104-
react: React,
105-
events: {} as PidActionsEvents,
106-
defineCustomElement: definePidActions,
71+
tagName: 'pid-actions',
72+
elementClass: PidActionsElement,
73+
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
74+
react: React,
75+
events: {} as PidActionsEvents,
76+
defineCustomElement: definePidActions
10777
});
10878

10979
export type PidCollapsibleEvents = {
110-
onCollapsibleToggle: EventName<CustomEvent<boolean>>,
111-
onContentHeightChange: EventName<CustomEvent<{ maxHeight: number }>>
80+
onCollapsibleToggle: EventName<CustomEvent<boolean>>,
81+
onContentHeightChange: EventName<CustomEvent<{ maxHeight: number }>>
11282
};
11383

11484
export const PidCollapsible: StencilReactComponent<PidCollapsibleElement, PidCollapsibleEvents> = /*@__PURE__*/ createComponent<PidCollapsibleElement, PidCollapsibleEvents>({
115-
tagName: 'pid-collapsible',
116-
elementClass: PidCollapsibleElement,
117-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
118-
react: React,
119-
events: {
120-
onCollapsibleToggle: 'collapsibleToggle',
121-
onContentHeightChange: 'contentHeightChange',
122-
} as PidCollapsibleEvents,
123-
defineCustomElement: definePidCollapsible,
85+
tagName: 'pid-collapsible',
86+
elementClass: PidCollapsibleElement,
87+
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
88+
react: React,
89+
events: {
90+
onCollapsibleToggle: 'collapsibleToggle',
91+
onContentHeightChange: 'contentHeightChange'
92+
} as PidCollapsibleEvents,
93+
defineCustomElement: definePidCollapsible
12494
});
12595

12696
export type PidComponentEvents = NonNullable<unknown>;
12797

12898
export const PidComponent: StencilReactComponent<PidComponentElement, PidComponentEvents> = /*@__PURE__*/ createComponent<PidComponentElement, PidComponentEvents>({
129-
tagName: 'pid-component',
130-
elementClass: PidComponentElement,
131-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
132-
react: React,
133-
events: {} as PidComponentEvents,
134-
defineCustomElement: definePidComponent,
99+
tagName: 'pid-component',
100+
elementClass: PidComponentElement,
101+
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
102+
react: React,
103+
events: {} as PidComponentEvents,
104+
defineCustomElement: definePidComponent
135105
});
136106

137107
export type PidDataTableEvents = {
138-
onPageChange: EventName<CustomEvent<number>>,
139-
onItemsPerPageChange: EventName<CustomEvent<number>>
108+
onPageChange: EventName<CustomEvent<number>>,
109+
onItemsPerPageChange: EventName<CustomEvent<number>>
140110
};
141111

142112
export const PidDataTable: StencilReactComponent<PidDataTableElement, PidDataTableEvents> = /*@__PURE__*/ createComponent<PidDataTableElement, PidDataTableEvents>({
143-
tagName: 'pid-data-table',
144-
elementClass: PidDataTableElement,
145-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
146-
react: React,
147-
events: {
148-
onPageChange: 'pageChange',
149-
onItemsPerPageChange: 'itemsPerPageChange',
150-
} as PidDataTableEvents,
151-
defineCustomElement: definePidDataTable,
113+
tagName: 'pid-data-table',
114+
elementClass: PidDataTableElement,
115+
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
116+
react: React,
117+
events: {
118+
onPageChange: 'pageChange',
119+
onItemsPerPageChange: 'itemsPerPageChange'
120+
} as PidDataTableEvents,
121+
defineCustomElement: definePidDataTable
152122
});
153123

154124
export type PidPaginationEvents = {
155-
onPageChange: EventName<CustomEvent<number>>,
156-
onItemsPerPageChange: EventName<CustomEvent<number>>
125+
onPageChange: EventName<CustomEvent<number>>,
126+
onItemsPerPageChange: EventName<CustomEvent<number>>
157127
};
158128

159129
export const PidPagination: StencilReactComponent<PidPaginationElement, PidPaginationEvents> = /*@__PURE__*/ createComponent<PidPaginationElement, PidPaginationEvents>({
160-
tagName: 'pid-pagination',
161-
elementClass: PidPaginationElement,
162-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
163-
react: React,
164-
events: {
165-
onPageChange: 'pageChange',
166-
onItemsPerPageChange: 'itemsPerPageChange',
167-
} as PidPaginationEvents,
168-
defineCustomElement: definePidPagination,
130+
tagName: 'pid-pagination',
131+
elementClass: PidPaginationElement,
132+
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
133+
react: React,
134+
events: {
135+
onPageChange: 'pageChange',
136+
onItemsPerPageChange: 'itemsPerPageChange'
137+
} as PidPaginationEvents,
138+
defineCustomElement: definePidPagination
169139
});
170140

171141
export type PidTooltipEvents = { onTooltipExpansionChange: EventName<CustomEvent<{ expand: boolean; requiredHeight: number }>> };
172142

173143
export const PidTooltip: StencilReactComponent<PidTooltipElement, PidTooltipEvents> = /*@__PURE__*/ createComponent<PidTooltipElement, PidTooltipEvents>({
174-
tagName: 'pid-tooltip',
175-
elementClass: PidTooltipElement,
176-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
177-
react: React,
178-
events: { onTooltipExpansionChange: 'tooltipExpansionChange' } as PidTooltipEvents,
179-
defineCustomElement: definePidTooltip,
144+
tagName: 'pid-tooltip',
145+
elementClass: PidTooltipElement,
146+
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
147+
react: React,
148+
events: { onTooltipExpansionChange: 'tooltipExpansionChange' } as PidTooltipEvents,
149+
defineCustomElement: definePidTooltip
180150
});

packages/stencil-library/src/components.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ export namespace Components {
140140
*/
141141
"open": boolean;
142142
/**
143-
* Public method to recalculate content dimensions Can be called externally, for example when pagination changes
143+
* Public method to recalculate content dimensions Can be called externally, for example when pagination changes Optimized for better performance
144144
*/
145-
"recalculateContentDimensions": () => Promise<{ contentWidth: number; contentHeight: number; maxWidth: number; maxHeight: number; }>;
145+
"recalculateContentDimensions": () => Promise<any>;
146146
/**
147147
* Whether to show the footer section
148148
* @default false

packages/stencil-library/src/components/pid-collapsible/collapsible.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ pid-collapsible.resize-both {
3030
resize: both !important;
3131
overflow: auto !important;
3232
max-width: 100% !important; /* Prevent exceeding parent container */
33+
will-change: width, height; /* Hint to the browser to optimize for resizing */
34+
transition: none !important; /* Disable transitions during resize for better performance */
3335
}
3436

3537
/*
@@ -129,6 +131,12 @@ pid-collapsible.resize-both::after {
129131
margin-bottom: 1px; /* This tiny margin helps with layout stability */
130132
}
131133

134+
/* Optimization class for resize operations */
135+
pid-collapsible.resizing {
136+
pointer-events: none; /* Prevent interaction during resize for better performance */
137+
contain: layout size; /* CSS containment for better performance */
138+
}
139+
132140
/* Ensure collapsed state in Safari doesn't affect text flow */
133141
pid-collapsible:not(.resize-both)::after {
134142
content: '';

0 commit comments

Comments
 (0)