wj-elements 0.4.1 → 0.4.2
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/dist/custom-elements.json +21140 -0
- package/dist/packages/wje-dropdown/dropdown.element.d.ts +29 -1
- package/dist/packages/wje-option/option.element.d.ts +3 -0
- package/dist/packages/wje-select/select.element.d.ts +17 -0
- package/dist/web-types.json +3842 -0
- package/dist/wje-dropdown.js +66 -1
- package/dist/wje-dropdown.js.map +1 -1
- package/dist/wje-option.js +8 -2
- package/dist/wje-option.js.map +1 -1
- package/dist/wje-select.js +174 -26
- package/dist/wje-select.js.map +1 -1
- package/package.json +1 -1
|
@@ -77,7 +77,35 @@ export default class Dropdown extends WJElement {
|
|
|
77
77
|
*/
|
|
78
78
|
afterDraw(): void;
|
|
79
79
|
onSlotChange: () => void;
|
|
80
|
-
|
|
80
|
+
/**
|
|
81
|
+
* Handles popup hide events and closes only the dropdown that owns the popup.
|
|
82
|
+
* This prevents nested dropdowns from collapsing their parent dropdown when the
|
|
83
|
+
* child popup is hidden.
|
|
84
|
+
* @param {Event} e The popup hide event.
|
|
85
|
+
*/
|
|
86
|
+
popupHideCallback: (e: Event) => void;
|
|
87
|
+
/**
|
|
88
|
+
* Assigns the current dropdown instance as the owner of its popup layers.
|
|
89
|
+
* Owner metadata is later used to resolve which dropdown should react to
|
|
90
|
+
* delegated menu-item clicks, including portaled popup content.
|
|
91
|
+
*/
|
|
92
|
+
syncPopupOwner(): void;
|
|
93
|
+
/**
|
|
94
|
+
* Recursively assigns owner metadata to the dropdown content subtree while
|
|
95
|
+
* leaving nested dropdown roots untouched, so each nested dropdown can keep
|
|
96
|
+
* its own ownership boundary.
|
|
97
|
+
* @param {HTMLElement} [root] The subtree root whose children should inherit this dropdown owner. Defaults to the current dropdown.
|
|
98
|
+
*/
|
|
99
|
+
syncOwnedContentOwner(root?: HTMLElement): void;
|
|
100
|
+
/**
|
|
101
|
+
* Resolves the dropdown that owns a clicked menu item. The lookup prefers
|
|
102
|
+
* explicit owner metadata and falls back to DOM traversal so both regular
|
|
103
|
+
* and portaled dropdown content can be scoped correctly.
|
|
104
|
+
* @param {EventTarget[]} path The composed event path.
|
|
105
|
+
* @param {HTMLElement} item The clicked menu item element.
|
|
106
|
+
* @returns {HTMLElement|null} The owning dropdown element or null when it cannot be resolved.
|
|
107
|
+
*/
|
|
108
|
+
getMenuItemOwner(path: EventTarget[], item: HTMLElement): HTMLElement | null;
|
|
81
109
|
/**
|
|
82
110
|
* Handles delegated clicks from inside the popup and closes the dropdown when a leaf menu item is selected.
|
|
83
111
|
* This works even when the menu is portaled, because we rely on the composed path.
|
|
@@ -54,6 +54,9 @@ export default class Option extends WJElement {
|
|
|
54
54
|
* @returns {boolean} Returns true if the 'wje-select' element has the 'multiple' attribute, otherwise false.
|
|
55
55
|
*/
|
|
56
56
|
get multiple(): boolean;
|
|
57
|
+
set ownerSelect(value: any);
|
|
58
|
+
get ownerSelect(): any;
|
|
59
|
+
_ownerSelect: any;
|
|
57
60
|
/**
|
|
58
61
|
* Sets the value attribute of the option.
|
|
59
62
|
* @param {string} value The value to set.
|
|
@@ -11,6 +11,7 @@ import { default as Options } from '../wje-options/options.js';
|
|
|
11
11
|
import { default as Checkbox } from '../wje-checkbox/checkbox.js';
|
|
12
12
|
export class Select extends FormAssociatedElement {
|
|
13
13
|
static _instanceId: number;
|
|
14
|
+
static portalStyles: string;
|
|
14
15
|
/**
|
|
15
16
|
* Returns the CSS styles for the component.
|
|
16
17
|
* @static
|
|
@@ -143,6 +144,22 @@ export class Select extends FormAssociatedElement {
|
|
|
143
144
|
* @returns {string} The default value of the input element.
|
|
144
145
|
*/
|
|
145
146
|
get defaultValue(): string;
|
|
147
|
+
/**
|
|
148
|
+
* Sets or removes the `portaled` attribute on the select.
|
|
149
|
+
* Mirrors the dropdown API so popup content can be rendered in a portal root.
|
|
150
|
+
* @param {boolean|string} value Determines whether and where the popup should be portaled.
|
|
151
|
+
*/
|
|
152
|
+
set portaled(value: boolean | string);
|
|
153
|
+
/**
|
|
154
|
+
* Getter for the `portaled` attribute value.
|
|
155
|
+
* @returns {string} The configured portal target or an empty string for the default body portal.
|
|
156
|
+
*/
|
|
157
|
+
get portaled(): string;
|
|
158
|
+
/**
|
|
159
|
+
* Checks whether popup content should be portaled.
|
|
160
|
+
* @returns {boolean} True when the `portaled` attribute is present.
|
|
161
|
+
*/
|
|
162
|
+
get isPortaled(): boolean;
|
|
146
163
|
/**
|
|
147
164
|
* Sets the trigger value.
|
|
148
165
|
* @param {string} value The trigger value to set.
|