@nectary/components 5.41.1 → 5.41.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/bundle.js +12 -7
- package/floating-panel/index.js +12 -7
- package/package.json +1 -1
package/bundle.js
CHANGED
|
@@ -9032,6 +9032,7 @@ const applyCountPlaceholder = (template2, count) => {
|
|
|
9032
9032
|
return template2.replaceAll("{count}", count);
|
|
9033
9033
|
};
|
|
9034
9034
|
const sanitizeAttr = (value) => value.replaceAll("&", "&").replaceAll('"', """).replaceAll("<", "<");
|
|
9035
|
+
const toReactCamelCaseHandlerName = (eventSuffix) => `on${eventSuffix.split("-").map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("")}`;
|
|
9035
9036
|
const isValidAction = (value) => {
|
|
9036
9037
|
if (typeof value !== "object" || value === null) {
|
|
9037
9038
|
return false;
|
|
@@ -9102,9 +9103,9 @@ class FloatingPanel extends NectaryElement {
|
|
|
9102
9103
|
this.#resizeThrottle?.fn();
|
|
9103
9104
|
});
|
|
9104
9105
|
this.#resizeObserver.observe(this.#$dialog);
|
|
9105
|
-
this.addEventListener("-close", this.#
|
|
9106
|
-
this.addEventListener("-select-all", this.#
|
|
9107
|
-
this.addEventListener("-action", this.#
|
|
9106
|
+
this.addEventListener("-close", this.#onCloseReactHandler, { signal });
|
|
9107
|
+
this.addEventListener("-select-all", this.#onSelectAllReactHandler, { signal });
|
|
9108
|
+
this.addEventListener("-action", this.#onActionReactHandler, { signal });
|
|
9108
9109
|
if (!this.hasAttribute("actions")) {
|
|
9109
9110
|
this.#renderActions(null);
|
|
9110
9111
|
}
|
|
@@ -9305,7 +9306,7 @@ class FloatingPanel extends NectaryElement {
|
|
|
9305
9306
|
* `-${action}` convenience event. The per-action event lets consumers bind
|
|
9306
9307
|
* directly to a specific action (e.g. `on-archive`) without switching on
|
|
9307
9308
|
* `e.detail` — and it works for any user-defined action, not just the
|
|
9308
|
-
* built-in defaults. React handlers are forwarded by `#
|
|
9309
|
+
* built-in defaults. React handlers are forwarded by `#onActionReactHandler`.
|
|
9309
9310
|
*/
|
|
9310
9311
|
#dispatchAction(action) {
|
|
9311
9312
|
this.dispatchEvent(new CustomEvent("-action", { detail: action }));
|
|
@@ -9411,16 +9412,20 @@ class FloatingPanel extends NectaryElement {
|
|
|
9411
9412
|
#onActionsPopoverClose = () => {
|
|
9412
9413
|
this.#closeOverflowMenu();
|
|
9413
9414
|
};
|
|
9414
|
-
#
|
|
9415
|
+
#onCloseReactHandler = (e) => {
|
|
9415
9416
|
getReactEventHandler(this, "on-close")?.(e);
|
|
9417
|
+
getReactEventHandler(this, "onClose")?.(e);
|
|
9416
9418
|
};
|
|
9417
|
-
#
|
|
9419
|
+
#onSelectAllReactHandler = (e) => {
|
|
9418
9420
|
getReactEventHandler(this, "on-select-all")?.(e);
|
|
9421
|
+
getReactEventHandler(this, "onSelectAll")?.(e);
|
|
9419
9422
|
};
|
|
9420
|
-
#
|
|
9423
|
+
#onActionReactHandler = (e) => {
|
|
9421
9424
|
getReactEventHandler(this, "on-action")?.(e);
|
|
9425
|
+
getReactEventHandler(this, "onAction")?.(e);
|
|
9422
9426
|
if (e instanceof CustomEvent && typeof e.detail === "string") {
|
|
9423
9427
|
getReactEventHandler(this, `on-${e.detail}`)?.(e);
|
|
9428
|
+
getReactEventHandler(this, toReactCamelCaseHandlerName(e.detail))?.(e);
|
|
9424
9429
|
}
|
|
9425
9430
|
};
|
|
9426
9431
|
get panelRect() {
|
package/floating-panel/index.js
CHANGED
|
@@ -29,6 +29,7 @@ const applyCountPlaceholder = (template2, count) => {
|
|
|
29
29
|
return template2.replaceAll("{count}", count);
|
|
30
30
|
};
|
|
31
31
|
const sanitizeAttr = (value) => value.replaceAll("&", "&").replaceAll('"', """).replaceAll("<", "<");
|
|
32
|
+
const toReactCamelCaseHandlerName = (eventSuffix) => `on${eventSuffix.split("-").map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("")}`;
|
|
32
33
|
const isValidAction = (value) => {
|
|
33
34
|
if (typeof value !== "object" || value === null) {
|
|
34
35
|
return false;
|
|
@@ -99,9 +100,9 @@ class FloatingPanel extends NectaryElement {
|
|
|
99
100
|
this.#resizeThrottle?.fn();
|
|
100
101
|
});
|
|
101
102
|
this.#resizeObserver.observe(this.#$dialog);
|
|
102
|
-
this.addEventListener("-close", this.#
|
|
103
|
-
this.addEventListener("-select-all", this.#
|
|
104
|
-
this.addEventListener("-action", this.#
|
|
103
|
+
this.addEventListener("-close", this.#onCloseReactHandler, { signal });
|
|
104
|
+
this.addEventListener("-select-all", this.#onSelectAllReactHandler, { signal });
|
|
105
|
+
this.addEventListener("-action", this.#onActionReactHandler, { signal });
|
|
105
106
|
if (!this.hasAttribute("actions")) {
|
|
106
107
|
this.#renderActions(null);
|
|
107
108
|
}
|
|
@@ -302,7 +303,7 @@ class FloatingPanel extends NectaryElement {
|
|
|
302
303
|
* `-${action}` convenience event. The per-action event lets consumers bind
|
|
303
304
|
* directly to a specific action (e.g. `on-archive`) without switching on
|
|
304
305
|
* `e.detail` — and it works for any user-defined action, not just the
|
|
305
|
-
* built-in defaults. React handlers are forwarded by `#
|
|
306
|
+
* built-in defaults. React handlers are forwarded by `#onActionReactHandler`.
|
|
306
307
|
*/
|
|
307
308
|
#dispatchAction(action) {
|
|
308
309
|
this.dispatchEvent(new CustomEvent("-action", { detail: action }));
|
|
@@ -408,16 +409,20 @@ class FloatingPanel extends NectaryElement {
|
|
|
408
409
|
#onActionsPopoverClose = () => {
|
|
409
410
|
this.#closeOverflowMenu();
|
|
410
411
|
};
|
|
411
|
-
#
|
|
412
|
+
#onCloseReactHandler = (e) => {
|
|
412
413
|
getReactEventHandler(this, "on-close")?.(e);
|
|
414
|
+
getReactEventHandler(this, "onClose")?.(e);
|
|
413
415
|
};
|
|
414
|
-
#
|
|
416
|
+
#onSelectAllReactHandler = (e) => {
|
|
415
417
|
getReactEventHandler(this, "on-select-all")?.(e);
|
|
418
|
+
getReactEventHandler(this, "onSelectAll")?.(e);
|
|
416
419
|
};
|
|
417
|
-
#
|
|
420
|
+
#onActionReactHandler = (e) => {
|
|
418
421
|
getReactEventHandler(this, "on-action")?.(e);
|
|
422
|
+
getReactEventHandler(this, "onAction")?.(e);
|
|
419
423
|
if (e instanceof CustomEvent && typeof e.detail === "string") {
|
|
420
424
|
getReactEventHandler(this, `on-${e.detail}`)?.(e);
|
|
425
|
+
getReactEventHandler(this, toReactCamelCaseHandlerName(e.detail))?.(e);
|
|
421
426
|
}
|
|
422
427
|
};
|
|
423
428
|
get panelRect() {
|