@db-ux/wc-core-components 4.13.1-angular-signal-forms13-577b861 → 4.14.0
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/CHANGELOG.md +14 -0
- package/bundle/db-badge.js +1 -1
- package/bundle/db-brand.js +1 -1
- package/bundle/db-checkbox.js +1 -1
- package/bundle/db-custom-select.js +1 -1
- package/bundle/db-drawer.js +1 -1
- package/bundle/db-header.js +1 -1
- package/bundle/db-input.js +1 -1
- package/bundle/db-navigation-item.js +1 -1
- package/bundle/db-notification.js +1 -1
- package/bundle/db-popover.js +1 -1
- package/bundle/db-select.js +1 -1
- package/bundle/db-switch.js +1 -1
- package/bundle/db-tabs.js +1 -1
- package/bundle/db-tag.js +1 -1
- package/bundle/db-textarea.js +1 -1
- package/bundle/db-tooltip.js +1 -1
- package/bundle/index.js +1 -1
- package/bundle/p-BXHP_qH1.js +1 -0
- package/bundle/{p-Be1wVxvg.js → p-Bl3Nkowh.js} +1 -1
- package/bundle/p-Bsv9xU74.js +1 -0
- package/bundle/p-C3D_kjdU.js +1 -0
- package/bundle/p-Cm3dPtkD.js +1 -0
- package/bundle/{p-By8B0zRG.js → p-Cmc3AFmy.js} +1 -1
- package/bundle/{p-C_qYW0Kh.js → p-DmKfvZy3.js} +1 -1
- package/bundle/p-DzJeNSBs.js +1 -0
- package/bundle/{p-Dd85RhMq.js → p-OXsRLHzG.js} +1 -1
- package/dist/cjs/{constants-bMY2_d8A.js → constants-Dy7QIUQi.js} +5 -1
- package/dist/cjs/db-badge.cjs.entry.js +1 -1
- package/dist/cjs/db-brand.cjs.entry.js +1 -1
- package/dist/cjs/db-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/db-custom-select-dropdown_5.cjs.entry.js +1 -1
- package/dist/cjs/db-custom-select.cjs.entry.js +40 -25
- package/dist/cjs/db-drawer.cjs.entry.js +1 -1
- package/dist/cjs/db-header.cjs.entry.js +3 -3
- package/dist/cjs/db-navigation-item.cjs.entry.js +3 -3
- package/dist/cjs/db-notification.cjs.entry.js +1 -1
- package/dist/cjs/db-popover.cjs.entry.js +50 -23
- package/dist/cjs/db-select.cjs.entry.js +1 -1
- package/dist/cjs/db-switch.cjs.entry.js +1 -1
- package/dist/cjs/db-tabs.cjs.entry.js +22 -17
- package/dist/cjs/db-textarea.cjs.entry.js +1 -1
- package/dist/cjs/db-tooltip.cjs.entry.js +40 -28
- package/dist/cjs/db-ux.cjs.js +1 -1
- package/dist/cjs/{document-click-listener-Bt1Iysz5.js → document-click-listener-DyO00UZC.js} +5 -9
- package/dist/cjs/{floating-components-SpHkZuLA.js → floating-components-Ns3Jt7dw.js} +161 -106
- package/dist/cjs/index.cjs.js +9 -6
- package/dist/cjs/intersection-observer-listener-BBUA6END.js +101 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{navigation-DUTSDY4q.js → navigation-fsWSnlKn.js} +1 -1
- package/dist/cjs/resize-observer-listener-B1uhHzqv.js +103 -0
- package/dist/collection/components/custom-select/custom-select.js +37 -20
- package/dist/collection/components/popover/popover.js +75 -46
- package/dist/collection/components/tabs/tabs.js +75 -18
- package/dist/collection/components/tooltip/tooltip.js +63 -49
- package/dist/collection/shared/constants.js +3 -1
- package/dist/collection/utils/abstract-document-listener.js +23 -0
- package/dist/collection/utils/abstract-observer-listener.js +61 -0
- package/dist/collection/utils/document-click-listener.js +5 -9
- package/dist/collection/utils/document-scroll-listener.js +5 -9
- package/dist/collection/utils/floating-components.js +161 -106
- package/dist/collection/utils/intersection-observer-listener.js +36 -0
- package/dist/collection/utils/resize-observer-listener.js +36 -0
- package/dist/custom-elements.json +232 -257
- package/dist/db-ux/db-ux.esm.js +1 -1
- package/dist/db-ux/index.esm.js +1 -1
- package/dist/db-ux/{p-d40a44ca.entry.js → p-1006233c.entry.js} +1 -1
- package/dist/db-ux/p-24767117.entry.js +1 -0
- package/dist/db-ux/{p-c83a359f.entry.js → p-40e78127.entry.js} +1 -1
- package/dist/db-ux/p-4a1282b9.entry.js +1 -0
- package/dist/db-ux/p-5b4ad0fd.entry.js +1 -0
- package/dist/db-ux/{p-dfc9ad26.entry.js → p-6a77f198.entry.js} +1 -1
- package/dist/db-ux/{p-1f740a3b.entry.js → p-6dfb57d0.entry.js} +1 -1
- package/dist/db-ux/p-775ef2b5.entry.js +1 -0
- package/dist/db-ux/p-78b4f191.entry.js +1 -0
- package/dist/db-ux/{p-2e66b25f.entry.js → p-7c26be27.entry.js} +1 -1
- package/dist/db-ux/{p-f4eb1ad4.entry.js → p-7fb6bf32.entry.js} +1 -1
- package/dist/db-ux/p-Bn4tE1v7.js +1 -0
- package/dist/db-ux/p-C3D_kjdU.js +1 -0
- package/dist/db-ux/p-Cm3dPtkD.js +1 -0
- package/dist/db-ux/{p-C_qYW0Kh.js → p-DmKfvZy3.js} +1 -1
- package/dist/db-ux/p-MhMqbaAW.js +1 -0
- package/dist/db-ux/p-aClGBxfA.js +1 -0
- package/dist/db-ux/{p-3649de37.entry.js → p-bfaec517.entry.js} +1 -1
- package/dist/db-ux/{p-3b9d4cc3.entry.js → p-c9b6ae8f.entry.js} +1 -1
- package/dist/db-ux/{p-c33fe9e0.entry.js → p-e8d5f721.entry.js} +1 -1
- package/dist/db-ux/{p-e35b2f5d.entry.js → p-fbb85f89.entry.js} +1 -1
- package/dist/esm/{constants-BdL-nI5y.js → constants-Cm3dPtkD.js} +4 -2
- package/dist/esm/db-badge.entry.js +1 -1
- package/dist/esm/db-brand.entry.js +1 -1
- package/dist/esm/db-checkbox.entry.js +1 -1
- package/dist/esm/db-custom-select-dropdown_5.entry.js +1 -1
- package/dist/esm/db-custom-select.entry.js +38 -23
- package/dist/esm/db-drawer.entry.js +1 -1
- package/dist/esm/db-header.entry.js +3 -3
- package/dist/esm/db-navigation-item.entry.js +3 -3
- package/dist/esm/db-notification.entry.js +1 -1
- package/dist/esm/db-popover.entry.js +48 -21
- package/dist/esm/db-select.entry.js +1 -1
- package/dist/esm/db-switch.entry.js +1 -1
- package/dist/esm/db-tabs.entry.js +22 -17
- package/dist/esm/db-textarea.entry.js +1 -1
- package/dist/esm/db-tooltip.entry.js +37 -25
- package/dist/esm/db-ux.js +1 -1
- package/dist/esm/{document-click-listener-B9qg-hEl.js → document-click-listener-Cqaqu5Jn.js} +5 -9
- package/dist/esm/{floating-components-C0q9XJSc.js → floating-components-C3D_kjdU.js} +162 -107
- package/dist/esm/index.js +6 -5
- package/dist/esm/intersection-observer-listener-DNd-fDFa.js +97 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{navigation-Cd7KZ6E2.js → navigation-BET7zThU.js} +1 -1
- package/dist/esm/resize-observer-listener-ed-nCkCj.js +100 -0
- package/dist/types/components/custom-select/custom-select.d.ts +3 -2
- package/dist/types/components/custom-select/model.d.ts +5 -1
- package/dist/types/components/popover/popover.d.ts +3 -2
- package/dist/types/components/tabs/model.d.ts +4 -12
- package/dist/types/components/tabs/tabs.d.ts +3 -1
- package/dist/types/components/tooltip/tooltip.d.ts +3 -2
- package/dist/types/components.d.ts +8 -2
- package/dist/types/shared/constants.d.ts +2 -0
- package/dist/types/shared/model.d.ts +27 -4
- package/dist/types/utils/abstract-document-listener.d.ts +18 -0
- package/dist/types/utils/abstract-observer-listener.d.ts +39 -0
- package/dist/types/utils/document-click-listener.d.ts +3 -3
- package/dist/types/utils/document-scroll-listener.d.ts +3 -3
- package/dist/types/utils/floating-components.d.ts +29 -6
- package/dist/types/utils/intersection-observer-listener.d.ts +15 -0
- package/dist/types/utils/resize-observer-listener.d.ts +15 -0
- package/dist/vscode.html-custom-data.json +29 -19
- package/dist/web-types.json +82 -75
- package/package.json +3 -3
- package/bundle/p-BdL-nI5y.js +0 -1
- package/bundle/p-C0q9XJSc.js +0 -1
- package/bundle/p-CTkfdjBp.js +0 -1
- package/bundle/p-LpyedXhR.js +0 -1
- package/dist/cjs/document-scroll-listener-Dd_hGebZ.js +0 -43
- package/dist/db-ux/p-177f3aeb.entry.js +0 -1
- package/dist/db-ux/p-2aee37e2.entry.js +0 -1
- package/dist/db-ux/p-550bd66a.entry.js +0 -1
- package/dist/db-ux/p-91d7fcc4.entry.js +0 -1
- package/dist/db-ux/p-B-HK8lhm.js +0 -1
- package/dist/db-ux/p-BdL-nI5y.js +0 -1
- package/dist/db-ux/p-C0q9XJSc.js +0 -1
- package/dist/db-ux/p-Z7eYHp_l.js +0 -1
- package/dist/db-ux/p-bc835df4.entry.js +0 -1
- package/dist/esm/document-scroll-listener-ewGU9bif.js +0 -41
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { u as uuid } from './index-BiyJ0WOE.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Generic base class for singleton observer listeners.
|
|
5
|
+
* Uses a Map<Element, Map<id, callback>> for O(1) element lookup in the
|
|
6
|
+
* observer handler — avoids quadratic scanning when many elements are observed.
|
|
7
|
+
*
|
|
8
|
+
* Subclasses own their static state (callbacksByElement, idToElement, observer,
|
|
9
|
+
* instance) and expose it via the abstract accessor methods below.
|
|
10
|
+
*
|
|
11
|
+
* @template TObserver - The observer type (ResizeObserver, IntersectionObserver, etc.)
|
|
12
|
+
* @template TEntry - The entry type passed to the callback
|
|
13
|
+
*/
|
|
14
|
+
class AbstractObserverListener {
|
|
15
|
+
observe(element, callback) {
|
|
16
|
+
const observer = this.getObserver();
|
|
17
|
+
if (!observer)
|
|
18
|
+
return undefined;
|
|
19
|
+
const id = uuid();
|
|
20
|
+
const callbacksByElement = this.getCallbacksByElement();
|
|
21
|
+
const idToElement = this.getIdToElement();
|
|
22
|
+
let elementCallbacks = callbacksByElement.get(element);
|
|
23
|
+
if (!elementCallbacks) {
|
|
24
|
+
elementCallbacks = new Map();
|
|
25
|
+
callbacksByElement.set(element, elementCallbacks);
|
|
26
|
+
// Only call observe on the native observer if this is a new element
|
|
27
|
+
this.observeElement(observer, element);
|
|
28
|
+
}
|
|
29
|
+
elementCallbacks.set(id, callback);
|
|
30
|
+
idToElement.set(id, element);
|
|
31
|
+
return id;
|
|
32
|
+
}
|
|
33
|
+
unobserve(id) {
|
|
34
|
+
const callbacksByElement = this.getCallbacksByElement();
|
|
35
|
+
const idToElement = this.getIdToElement();
|
|
36
|
+
const observer = this.getObserver();
|
|
37
|
+
const element = idToElement.get(id);
|
|
38
|
+
if (!element || !observer)
|
|
39
|
+
return;
|
|
40
|
+
const elementCallbacks = callbacksByElement.get(element);
|
|
41
|
+
if (elementCallbacks) {
|
|
42
|
+
elementCallbacks.delete(id);
|
|
43
|
+
// If no more callbacks for this element, unobserve it
|
|
44
|
+
if (elementCallbacks.size === 0) {
|
|
45
|
+
callbacksByElement.delete(element);
|
|
46
|
+
this.unobserveElement(observer, element);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
idToElement.delete(id);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Called by subclass observer handlers to dispatch callbacks for an entry.
|
|
53
|
+
*/
|
|
54
|
+
dispatchEntry(element, entry) {
|
|
55
|
+
const elementCallbacks = this.getCallbacksByElement().get(element);
|
|
56
|
+
if (elementCallbacks) {
|
|
57
|
+
elementCallbacks.forEach(callback => {
|
|
58
|
+
callback(entry);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
class ResizeObserverListener extends AbstractObserverListener {
|
|
65
|
+
constructor() {
|
|
66
|
+
super();
|
|
67
|
+
if (ResizeObserverListener._instance) {
|
|
68
|
+
return ResizeObserverListener._instance;
|
|
69
|
+
}
|
|
70
|
+
ResizeObserverListener._instance = this;
|
|
71
|
+
if (typeof window !== 'undefined' && 'ResizeObserver' in window) {
|
|
72
|
+
ResizeObserverListener.observer = new ResizeObserver(entries => {
|
|
73
|
+
for (const entry of entries) {
|
|
74
|
+
this.dispatchEntry(entry.target, entry);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
getCallbacksByElement() {
|
|
80
|
+
return ResizeObserverListener.callbacksByElement;
|
|
81
|
+
}
|
|
82
|
+
getIdToElement() {
|
|
83
|
+
return ResizeObserverListener.idToElement;
|
|
84
|
+
}
|
|
85
|
+
getObserver() {
|
|
86
|
+
return ResizeObserverListener.observer;
|
|
87
|
+
}
|
|
88
|
+
observeElement(observer, element) {
|
|
89
|
+
observer.observe(element);
|
|
90
|
+
}
|
|
91
|
+
unobserveElement(observer, element) {
|
|
92
|
+
observer.unobserve(element);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
ResizeObserverListener._instance = null;
|
|
96
|
+
ResizeObserverListener.callbacksByElement = new Map();
|
|
97
|
+
ResizeObserverListener.idToElement = new Map();
|
|
98
|
+
ResizeObserverListener.observer = null;
|
|
99
|
+
|
|
100
|
+
export { AbstractObserverListener as A, ResizeObserverListener as R };
|
|
@@ -92,7 +92,8 @@ export declare class DBCustomSelect {
|
|
|
92
92
|
_documentClickListenerCallbackId: any;
|
|
93
93
|
_internalChangeTimestamp: number;
|
|
94
94
|
_documentScrollListenerCallbackId: any;
|
|
95
|
-
|
|
95
|
+
_intersectionObserverCallbackId: any;
|
|
96
|
+
_resizeObserverCallbackId: any;
|
|
96
97
|
_searchValue: any;
|
|
97
98
|
selectAllChecked: boolean;
|
|
98
99
|
selectAllIndeterminate: boolean;
|
|
@@ -107,7 +108,7 @@ export declare class DBCustomSelect {
|
|
|
107
108
|
getOptionLabel(option: CustomSelectOptionType): string;
|
|
108
109
|
getOptionChecked(value?: string): boolean;
|
|
109
110
|
getTagRemoveLabel(option: CustomSelectOptionType): string;
|
|
110
|
-
handleTagRemove(option: CustomSelectOptionType, event?: ClickEvent<HTMLButtonElement> |
|
|
111
|
+
handleTagRemove(option: CustomSelectOptionType, event?: ClickEvent<HTMLButtonElement> | Event | void): void;
|
|
111
112
|
handleAutoPlacement(): void;
|
|
112
113
|
handleArrowDownUp(event: any): void;
|
|
113
114
|
handleKeyboardPress(event: any): void;
|
|
@@ -194,6 +194,10 @@ export type DBCustomSelectDefaultState = {
|
|
|
194
194
|
_infoTextId?: string;
|
|
195
195
|
_internalChangeTimestamp: number;
|
|
196
196
|
_documentClickListenerCallbackId?: string;
|
|
197
|
+
_documentScrollListenerCallbackId?: string;
|
|
198
|
+
handleDocumentScroll: (event: any) => void;
|
|
199
|
+
_intersectionObserverCallbackId?: string;
|
|
200
|
+
_resizeObserverCallbackId?: string;
|
|
197
201
|
_searchValue?: string;
|
|
198
202
|
_userInteraction?: boolean;
|
|
199
203
|
getNativeSelectValue: () => string;
|
|
@@ -204,7 +208,7 @@ export type DBCustomSelectDefaultState = {
|
|
|
204
208
|
searchEnabled: boolean;
|
|
205
209
|
amountOptions: number;
|
|
206
210
|
setDescById: (descId?: string) => void;
|
|
207
|
-
handleTagRemove: (option: CustomSelectOptionType, event?: ClickEvent<HTMLButtonElement> | void) => void;
|
|
211
|
+
handleTagRemove: (option: CustomSelectOptionType, event?: ClickEvent<HTMLButtonElement> | Event | void) => void;
|
|
208
212
|
handleSummaryFocus: () => void;
|
|
209
213
|
handleSelect: (value?: string) => void;
|
|
210
214
|
handleSelectAll: (event: any) => void;
|
|
@@ -6,7 +6,6 @@ import { DBPopoverProps } from "./model.js";
|
|
|
6
6
|
export declare class DBPopover {
|
|
7
7
|
rootElement: HTMLElement;
|
|
8
8
|
private _ref;
|
|
9
|
-
placement: DBPopoverProps["placement"];
|
|
10
9
|
id: DBPopoverProps["id"];
|
|
11
10
|
propOverrides: DBPopoverProps["propOverrides"];
|
|
12
11
|
className: DBPopoverProps["className"];
|
|
@@ -16,10 +15,12 @@ export declare class DBPopover {
|
|
|
16
15
|
open: DBPopoverProps["open"];
|
|
17
16
|
delay: DBPopoverProps["delay"];
|
|
18
17
|
width: DBPopoverProps["width"];
|
|
18
|
+
placement: DBPopoverProps["placement"];
|
|
19
19
|
initialized: boolean;
|
|
20
20
|
isExpanded: boolean;
|
|
21
21
|
_documentScrollListenerCallbackId: any;
|
|
22
|
-
|
|
22
|
+
_intersectionObserverCallbackId: any;
|
|
23
|
+
_resizeObserverCallbackId: any;
|
|
23
24
|
observer: any;
|
|
24
25
|
handleEscape(event: any): void;
|
|
25
26
|
handleAutoPlacement(): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AlignmentProps, GlobalProps, InitializedState, InputEvent, OrientationProps, WidthProps } from '../../shared/model.js';
|
|
1
|
+
import type { AlignmentProps, GlobalProps, InitializedState, InputEvent, OrientationProps, OverflowScrollButtonProps, OverflowScrollButtonState, WidthProps } from '../../shared/model.js';
|
|
2
2
|
import type { DBTabItemProps } from '../tab-item/model.js';
|
|
3
3
|
import type { DBTabPanelProps } from '../tab-panel/model.js';
|
|
4
4
|
export declare const TabsBehaviorList: readonly ["scrollbar", "arrows"];
|
|
@@ -7,10 +7,6 @@ export declare const TabsInitialSelectedModeList: readonly ["auto", "manually"];
|
|
|
7
7
|
export type TabsInitialSelectedModeType = (typeof TabsInitialSelectedModeList)[number];
|
|
8
8
|
export type DBSimpleTabProps = DBTabItemProps & DBTabPanelProps;
|
|
9
9
|
export type DBTabsDefaultProps = {
|
|
10
|
-
/**
|
|
11
|
-
* Change amount of distance if you click on an arrow, only available with behavior="arrows"
|
|
12
|
-
*/
|
|
13
|
-
arrowScrollDistance?: number | string;
|
|
14
10
|
/**
|
|
15
11
|
* Show a scrollbar or buttons with arrows to navigate for horizontal tabs with overflow visible
|
|
16
12
|
*/
|
|
@@ -50,18 +46,14 @@ export type DBTabsEventProps = {
|
|
|
50
46
|
*/
|
|
51
47
|
tabSelect?: (event?: InputEvent<HTMLElement>) => void;
|
|
52
48
|
};
|
|
53
|
-
export type DBTabsProps = DBTabsDefaultProps & GlobalProps & OrientationProps & WidthProps & AlignmentProps & DBTabsEventProps;
|
|
49
|
+
export type DBTabsProps = DBTabsDefaultProps & GlobalProps & OrientationProps & WidthProps & AlignmentProps & OverflowScrollButtonProps & DBTabsEventProps;
|
|
54
50
|
export type DBTabsDefaultState = {
|
|
55
51
|
_name: string;
|
|
56
52
|
scrollContainer?: Element | null;
|
|
57
|
-
scroll: (left?: boolean) => void;
|
|
58
|
-
showScrollLeft?: boolean;
|
|
59
|
-
showScrollRight?: boolean;
|
|
60
|
-
evaluateScrollButtons: (tabList: Element) => void;
|
|
61
53
|
convertTabs: () => DBSimpleTabProps[];
|
|
62
54
|
initTabList: () => void;
|
|
63
55
|
initTabs: (init?: boolean) => void;
|
|
64
56
|
handleChange: (event: InputEvent<HTMLElement>) => void;
|
|
65
|
-
|
|
57
|
+
_resizeObserverCallbackId?: string;
|
|
66
58
|
};
|
|
67
|
-
export type DBTabsState = DBTabsDefaultState & InitializedState;
|
|
59
|
+
export type DBTabsState = DBTabsDefaultState & InitializedState & OverflowScrollButtonState;
|
|
@@ -22,12 +22,14 @@ export declare class DBTabs {
|
|
|
22
22
|
className: DBTabsProps["className"];
|
|
23
23
|
alignment: DBTabsProps["alignment"];
|
|
24
24
|
width: DBTabsProps["width"];
|
|
25
|
+
scrollLeftText: DBTabsProps["scrollLeftText"];
|
|
26
|
+
scrollRightText: DBTabsProps["scrollRightText"];
|
|
25
27
|
_name: string;
|
|
26
28
|
initialized: boolean;
|
|
27
29
|
showScrollLeft: boolean;
|
|
28
30
|
showScrollRight: boolean;
|
|
29
31
|
scrollContainer: any;
|
|
30
|
-
|
|
32
|
+
_resizeObserverCallbackId: any;
|
|
31
33
|
observer: any;
|
|
32
34
|
convertTabs(): any;
|
|
33
35
|
evaluateScrollButtons(tList: Element): void;
|
|
@@ -10,7 +10,6 @@ export declare class DBTooltip {
|
|
|
10
10
|
id: DBTooltipProps["id"];
|
|
11
11
|
propOverrides: DBTooltipProps["propOverrides"];
|
|
12
12
|
variant: DBTooltipProps["variant"];
|
|
13
|
-
placement: DBTooltipProps["placement"];
|
|
14
13
|
className: DBTooltipProps["className"];
|
|
15
14
|
emphasis: DBTooltipProps["emphasis"];
|
|
16
15
|
wrap: DBTooltipProps["wrap"];
|
|
@@ -18,11 +17,13 @@ export declare class DBTooltip {
|
|
|
18
17
|
delay: DBTooltipProps["delay"];
|
|
19
18
|
width: DBTooltipProps["width"];
|
|
20
19
|
showArrow: DBTooltipProps["showArrow"];
|
|
20
|
+
placement: DBTooltipProps["placement"];
|
|
21
21
|
text: DBTooltipProps["text"];
|
|
22
22
|
_id: string;
|
|
23
23
|
initialized: boolean;
|
|
24
24
|
_documentScrollListenerCallbackId: any;
|
|
25
|
-
|
|
25
|
+
_intersectionObserverCallbackId: any;
|
|
26
|
+
_resizeObserverCallbackId: any;
|
|
26
27
|
_attachedParent: any;
|
|
27
28
|
_attachedId: any;
|
|
28
29
|
_activeTriggerCount: number;
|
|
@@ -688,6 +688,8 @@ export namespace Components {
|
|
|
688
688
|
"name": DBTabsProps["name"];
|
|
689
689
|
"orientation": DBTabsProps["orientation"];
|
|
690
690
|
"propOverrides": DBTabsProps["propOverrides"];
|
|
691
|
+
"scrollLeftText": DBTabsProps["scrollLeftText"];
|
|
692
|
+
"scrollRightText": DBTabsProps["scrollRightText"];
|
|
691
693
|
"tabs": DBTabsProps["tabs"];
|
|
692
694
|
"width": DBTabsProps["width"];
|
|
693
695
|
}
|
|
@@ -1994,6 +1996,8 @@ declare namespace LocalJSX {
|
|
|
1994
1996
|
"onTabSelect"?: (event: DbTabsCustomEvent<any>) => void;
|
|
1995
1997
|
"orientation"?: DBTabsProps["orientation"];
|
|
1996
1998
|
"propOverrides"?: DBTabsProps["propOverrides"];
|
|
1999
|
+
"scrollLeftText"?: DBTabsProps["scrollLeftText"];
|
|
2000
|
+
"scrollRightText"?: DBTabsProps["scrollRightText"];
|
|
1997
2001
|
"tabs"?: DBTabsProps["tabs"];
|
|
1998
2002
|
"width"?: DBTabsProps["width"];
|
|
1999
2003
|
}
|
|
@@ -2411,7 +2415,6 @@ declare namespace LocalJSX {
|
|
|
2411
2415
|
"mainClass": DBPageProps["mainClass"];
|
|
2412
2416
|
}
|
|
2413
2417
|
interface DbPopoverAttributes {
|
|
2414
|
-
"placement": DBPopoverProps["placement"];
|
|
2415
2418
|
"id": DBPopoverProps["id"];
|
|
2416
2419
|
"className": DBPopoverProps["className"];
|
|
2417
2420
|
"spacing": DBPopoverProps["spacing"];
|
|
@@ -2420,6 +2423,7 @@ declare namespace LocalJSX {
|
|
|
2420
2423
|
"open": string;
|
|
2421
2424
|
"delay": DBPopoverProps["delay"];
|
|
2422
2425
|
"width": DBPopoverProps["width"];
|
|
2426
|
+
"placement": DBPopoverProps["placement"];
|
|
2423
2427
|
}
|
|
2424
2428
|
interface DbRadioAttributes {
|
|
2425
2429
|
"id": DBRadioProps["id"];
|
|
@@ -2598,6 +2602,8 @@ declare namespace LocalJSX {
|
|
|
2598
2602
|
"className": DBTabsProps["className"];
|
|
2599
2603
|
"alignment": DBTabsProps["alignment"];
|
|
2600
2604
|
"width": DBTabsProps["width"];
|
|
2605
|
+
"scrollLeftText": DBTabsProps["scrollLeftText"];
|
|
2606
|
+
"scrollRightText": DBTabsProps["scrollRightText"];
|
|
2601
2607
|
}
|
|
2602
2608
|
interface DbTagAttributes {
|
|
2603
2609
|
"removeButton": DBTagProps["removeButton"];
|
|
@@ -2651,7 +2657,6 @@ declare namespace LocalJSX {
|
|
|
2651
2657
|
interface DbTooltipAttributes {
|
|
2652
2658
|
"id": DBTooltipProps["id"];
|
|
2653
2659
|
"variant": DBTooltipProps["variant"];
|
|
2654
|
-
"placement": DBTooltipProps["placement"];
|
|
2655
2660
|
"className": DBTooltipProps["className"];
|
|
2656
2661
|
"emphasis": DBTooltipProps["emphasis"];
|
|
2657
2662
|
"wrap": string;
|
|
@@ -2659,6 +2664,7 @@ declare namespace LocalJSX {
|
|
|
2659
2664
|
"delay": DBTooltipProps["delay"];
|
|
2660
2665
|
"width": DBTooltipProps["width"];
|
|
2661
2666
|
"showArrow": string;
|
|
2667
|
+
"placement": DBTooltipProps["placement"];
|
|
2662
2668
|
"text": DBTooltipProps["text"];
|
|
2663
2669
|
}
|
|
2664
2670
|
|
|
@@ -14,6 +14,8 @@ export declare const DEFAULT_INVALID_MESSAGE: string;
|
|
|
14
14
|
export declare const DEFAULT_REMOVE: string;
|
|
15
15
|
export declare const DEFAULT_BACK: string;
|
|
16
16
|
export declare const DEFAULT_SELECTED: string;
|
|
17
|
+
export declare const DEFAULT_SCROLL_LEFT: string;
|
|
18
|
+
export declare const DEFAULT_SCROLL_RIGHT: string;
|
|
17
19
|
export declare const DEFAULT_BURGER_MENU: string;
|
|
18
20
|
export declare const DEFAULT_ICON: string;
|
|
19
21
|
export declare const DEFAULT_ROWS: number;
|
|
@@ -237,11 +237,13 @@ export type ValueProps = {
|
|
|
237
237
|
*/
|
|
238
238
|
value?: any;
|
|
239
239
|
};
|
|
240
|
-
export type
|
|
240
|
+
export type DisabledProps = {
|
|
241
241
|
/**
|
|
242
|
-
* The disabled attribute can be set to keep a user from clicking on the
|
|
242
|
+
* The disabled attribute can be set to keep a user from clicking on the item.
|
|
243
243
|
*/
|
|
244
244
|
disabled?: boolean | string;
|
|
245
|
+
};
|
|
246
|
+
export type BaseFormProps = {
|
|
245
247
|
/**
|
|
246
248
|
* The label attribute specifies the caption of the form element.
|
|
247
249
|
*/
|
|
@@ -250,7 +252,7 @@ export type BaseFormProps = {
|
|
|
250
252
|
* The name attribute gives the name of the form control, as used in form submission and in the form element's elements object.
|
|
251
253
|
*/
|
|
252
254
|
name?: string;
|
|
253
|
-
};
|
|
255
|
+
} & DisabledProps;
|
|
254
256
|
export type CustomFormProps = {
|
|
255
257
|
/**
|
|
256
258
|
* Overwrites auto handling for aria-describedby.
|
|
@@ -537,10 +539,31 @@ export type ValueLabelType = {
|
|
|
537
539
|
value: string;
|
|
538
540
|
label?: string;
|
|
539
541
|
};
|
|
542
|
+
export type OverflowScrollButtonProps = {
|
|
543
|
+
/**
|
|
544
|
+
* Change amount of scroll distance when clicking on an overflow scroll arrow button.
|
|
545
|
+
*/
|
|
546
|
+
arrowScrollDistance?: number | string;
|
|
547
|
+
/**
|
|
548
|
+
* Set the text for the scroll left button
|
|
549
|
+
*/
|
|
550
|
+
scrollLeftText?: string;
|
|
551
|
+
/**
|
|
552
|
+
* Set the text for the scroll right button
|
|
553
|
+
*/
|
|
554
|
+
scrollRightText?: string;
|
|
555
|
+
};
|
|
556
|
+
export type OverflowScrollButtonState = {
|
|
557
|
+
scroll: (left?: boolean) => void;
|
|
558
|
+
showScrollLeft?: boolean;
|
|
559
|
+
showScrollRight?: boolean;
|
|
560
|
+
evaluateScrollButtons: (tabList: Element) => void;
|
|
561
|
+
};
|
|
540
562
|
export type DocumentScrollState = {
|
|
541
563
|
_documentScrollListenerCallbackId?: string;
|
|
542
564
|
handleDocumentScroll: (event: any, parent?: HTMLElement) => void;
|
|
543
|
-
|
|
565
|
+
_intersectionObserverCallbackId?: string;
|
|
566
|
+
_resizeObserverCallbackId?: string;
|
|
544
567
|
};
|
|
545
568
|
export type PopoverState = {
|
|
546
569
|
handleEscape: (event: any) => void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic base class for singleton document event listeners.
|
|
3
|
+
* Manages a shared set of callbacks dispatched when a document-level
|
|
4
|
+
* event fires.
|
|
5
|
+
*
|
|
6
|
+
* Subclasses own their static state (callbacks, instance) and expose
|
|
7
|
+
* it via the abstract accessor methods below.
|
|
8
|
+
*
|
|
9
|
+
* @template TEvent - The event type passed to callbacks (Event, MouseEvent, etc.)
|
|
10
|
+
*/
|
|
11
|
+
export declare abstract class AbstractDocumentListener<TEvent = any> {
|
|
12
|
+
/**
|
|
13
|
+
* Subclasses must return a reference to their own static callbacks store.
|
|
14
|
+
*/
|
|
15
|
+
protected abstract getCallbacks(): Record<string, (event: TEvent) => void>;
|
|
16
|
+
addCallback(callback: (event: TEvent) => void): string;
|
|
17
|
+
removeCallback(id: string): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic base class for singleton observer listeners.
|
|
3
|
+
* Uses a Map<Element, Map<id, callback>> for O(1) element lookup in the
|
|
4
|
+
* observer handler — avoids quadratic scanning when many elements are observed.
|
|
5
|
+
*
|
|
6
|
+
* Subclasses own their static state (callbacksByElement, idToElement, observer,
|
|
7
|
+
* instance) and expose it via the abstract accessor methods below.
|
|
8
|
+
*
|
|
9
|
+
* @template TObserver - The observer type (ResizeObserver, IntersectionObserver, etc.)
|
|
10
|
+
* @template TEntry - The entry type passed to the callback
|
|
11
|
+
*/
|
|
12
|
+
export declare abstract class AbstractObserverListener<TObserver, TEntry> {
|
|
13
|
+
/**
|
|
14
|
+
* Returns a Map keyed by Element, where each value is a Map of id → callback.
|
|
15
|
+
*/
|
|
16
|
+
protected abstract getCallbacksByElement(): Map<Element, Map<string, (entry: TEntry) => void>>;
|
|
17
|
+
/**
|
|
18
|
+
* Returns a Map of id → Element for reverse lookup during unobserve.
|
|
19
|
+
*/
|
|
20
|
+
protected abstract getIdToElement(): Map<string, Element>;
|
|
21
|
+
/**
|
|
22
|
+
* Subclasses must return their own static observer instance (or null).
|
|
23
|
+
*/
|
|
24
|
+
protected abstract getObserver(): TObserver | null;
|
|
25
|
+
/**
|
|
26
|
+
* Start observing an element via the underlying observer API.
|
|
27
|
+
*/
|
|
28
|
+
protected abstract observeElement(observer: TObserver, element: Element): void;
|
|
29
|
+
/**
|
|
30
|
+
* Stop observing an element via the underlying observer API.
|
|
31
|
+
*/
|
|
32
|
+
protected abstract unobserveElement(observer: TObserver, element: Element): void;
|
|
33
|
+
observe(element: Element, callback: (entry: TEntry) => void): string | undefined;
|
|
34
|
+
unobserve(id: string): void;
|
|
35
|
+
/**
|
|
36
|
+
* Called by subclass observer handlers to dispatch callbacks for an entry.
|
|
37
|
+
*/
|
|
38
|
+
protected dispatchEntry(element: Element, entry: TEntry): void;
|
|
39
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { AbstractDocumentListener } from './abstract-document-listener.js';
|
|
2
|
+
export declare class DocumentClickListener extends AbstractDocumentListener {
|
|
2
3
|
private static callbacks;
|
|
3
4
|
private static _instance;
|
|
4
5
|
private static runCallbacks;
|
|
5
6
|
constructor();
|
|
6
|
-
|
|
7
|
-
removeCallback(id: string): void;
|
|
7
|
+
protected getCallbacks(): Record<string, (event: any) => void>;
|
|
8
8
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { AbstractDocumentListener } from './abstract-document-listener.js';
|
|
2
|
+
export declare class DocumentScrollListener extends AbstractDocumentListener {
|
|
2
3
|
private static callbacks;
|
|
3
4
|
private static _instance;
|
|
4
5
|
private static runCallbacks;
|
|
5
6
|
private ticking;
|
|
6
7
|
constructor();
|
|
7
|
-
|
|
8
|
-
removeCallback(id: string): void;
|
|
8
|
+
protected getCallbacks(): Record<string, (event: any) => void>;
|
|
9
9
|
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
export interface DBDataOutsidePair {
|
|
2
|
-
vx?: 'left' | 'right';
|
|
3
|
-
vy?: 'top' | 'bottom';
|
|
4
|
-
}
|
|
5
|
-
export declare const handleDataOutside: (el: HTMLElement) => DBDataOutsidePair;
|
|
6
1
|
export declare const handleFixedDropdown: (element: HTMLElement, parent: HTMLElement, placement: string) => void;
|
|
7
2
|
export declare const getFloatingProps: (element: HTMLElement, parent: HTMLElement, placement: string) => {
|
|
8
3
|
top: number;
|
|
@@ -16,5 +11,33 @@ export declare const getFloatingProps: (element: HTMLElement, parent: HTMLElemen
|
|
|
16
11
|
correctedPlacement: string;
|
|
17
12
|
innerWidth: number;
|
|
18
13
|
innerHeight: number;
|
|
14
|
+
outsideYBoth?: undefined;
|
|
15
|
+
} | {
|
|
16
|
+
top: number;
|
|
17
|
+
bottom: number;
|
|
18
|
+
right: number;
|
|
19
|
+
height: number;
|
|
20
|
+
width: number;
|
|
21
|
+
left: number;
|
|
22
|
+
childHeight: number;
|
|
23
|
+
childWidth: number;
|
|
24
|
+
correctedPlacement: string;
|
|
25
|
+
innerWidth: number;
|
|
26
|
+
innerHeight: number;
|
|
27
|
+
outsideYBoth: boolean;
|
|
19
28
|
};
|
|
20
|
-
export declare const handleFixedPopover: (element: HTMLElement, parent: HTMLElement, placement
|
|
29
|
+
export declare const handleFixedPopover: (element: HTMLElement, parent: HTMLElement, placement?: string) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Detects whether a floating element overflows the viewport edges
|
|
32
|
+
* and sets `data-outside-vy` / `data-outside-vx` attributes accordingly.
|
|
33
|
+
* CSS rules can use these attributes to flip/reposition the element.
|
|
34
|
+
*
|
|
35
|
+
* If the element was already flipped (has existing data-outside-* attributes),
|
|
36
|
+
* it checks whether the flipped position would overflow on the opposite side
|
|
37
|
+
* using the parent's rect as reference, preventing infinite flip-flop.
|
|
38
|
+
*/
|
|
39
|
+
export interface DBDataOutsidePair {
|
|
40
|
+
vx?: 'left' | 'right';
|
|
41
|
+
vy?: 'top' | 'bottom';
|
|
42
|
+
}
|
|
43
|
+
export declare const handleDataOutside: (el: HTMLElement) => DBDataOutsidePair;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AbstractObserverListener } from './abstract-observer-listener.js';
|
|
2
|
+
type IntersectionCallback = (entry: IntersectionObserverEntry) => void;
|
|
3
|
+
export declare class IntersectionObserverListener extends AbstractObserverListener<IntersectionObserver, IntersectionObserverEntry> {
|
|
4
|
+
private static _instance;
|
|
5
|
+
private static callbacksByElement;
|
|
6
|
+
private static idToElement;
|
|
7
|
+
private static observer;
|
|
8
|
+
constructor();
|
|
9
|
+
protected getCallbacksByElement(): Map<Element, Map<string, IntersectionCallback>>;
|
|
10
|
+
protected getIdToElement(): Map<string, Element>;
|
|
11
|
+
protected getObserver(): IntersectionObserver | null;
|
|
12
|
+
protected observeElement(observer: IntersectionObserver, element: Element): void;
|
|
13
|
+
protected unobserveElement(observer: IntersectionObserver, element: Element): void;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AbstractObserverListener } from './abstract-observer-listener.js';
|
|
2
|
+
type ResizeCallback = (entry: ResizeObserverEntry) => void;
|
|
3
|
+
export declare class ResizeObserverListener extends AbstractObserverListener<ResizeObserver, ResizeObserverEntry> {
|
|
4
|
+
private static _instance;
|
|
5
|
+
private static callbacksByElement;
|
|
6
|
+
private static idToElement;
|
|
7
|
+
private static observer;
|
|
8
|
+
constructor();
|
|
9
|
+
protected getCallbacksByElement(): Map<Element, Map<string, ResizeCallback>>;
|
|
10
|
+
protected getIdToElement(): Map<string, Element>;
|
|
11
|
+
protected getObserver(): ResizeObserver | null;
|
|
12
|
+
protected observeElement(observer: ResizeObserver, element: Element): void;
|
|
13
|
+
protected unobserveElement(observer: ResizeObserver, element: Element): void;
|
|
14
|
+
}
|
|
15
|
+
export {};
|