@phcdevworks/spectre-components 1.18.0 → 1.19.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/README.md +4 -2
- package/dist/dropdown.cjs +11 -3
- package/dist/dropdown.cjs.map +1 -1
- package/dist/dropdown.js +11 -3
- package/dist/dropdown.js.map +1 -1
- package/dist/index.cjs +23 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +23 -7
- package/dist/index.js.map +1 -1
- package/dist/radio.cjs +3 -2
- package/dist/radio.cjs.map +1 -1
- package/dist/radio.js +3 -2
- package/dist/radio.js.map +1 -1
- package/dist/tooltip.cjs +9 -2
- package/dist/tooltip.cjs.map +1 -1
- package/dist/tooltip.js +9 -2
- package/dist/tooltip.js.map +1 -1
- package/package.json +15 -11
package/dist/index.cjs
CHANGED
|
@@ -1712,7 +1712,7 @@ var SpectreRadioElement = class extends SpectreProjectableElement {
|
|
|
1712
1712
|
}
|
|
1713
1713
|
updated(changedProperties) {
|
|
1714
1714
|
super.updated(changedProperties);
|
|
1715
|
-
if ((changedProperties.has("checked") || changedProperties.has("name")) && this.checked && this.name) {
|
|
1715
|
+
if ((changedProperties.has("checked") || changedProperties.has("name") || changedProperties.has("form")) && this.checked && this.name) {
|
|
1716
1716
|
this.syncGroup();
|
|
1717
1717
|
}
|
|
1718
1718
|
}
|
|
@@ -1724,8 +1724,9 @@ var SpectreRadioElement = class extends SpectreProjectableElement {
|
|
|
1724
1724
|
const radios = root.querySelectorAll(
|
|
1725
1725
|
"sp-radio"
|
|
1726
1726
|
);
|
|
1727
|
+
const form = this.nativeInput?.form;
|
|
1727
1728
|
radios.forEach((radio) => {
|
|
1728
|
-
if (radio !== this && radio.name === this.name && radio.checked) {
|
|
1729
|
+
if (radio !== this && radio.name === this.name && radio.nativeInput?.form === form && radio.checked) {
|
|
1729
1730
|
radio.checked = false;
|
|
1730
1731
|
}
|
|
1731
1732
|
});
|
|
@@ -3410,13 +3411,20 @@ var SpectreDropdownElement = class extends SpectreBaseElement {
|
|
|
3410
3411
|
return false;
|
|
3411
3412
|
}
|
|
3412
3413
|
const el = node;
|
|
3413
|
-
return el.hasAttribute("data-sp-dropdown-menu") || el.hasAttribute("data-sp-dropdown-trigger");
|
|
3414
|
+
return el.hasAttribute("data-sp-dropdown-native") || el.hasAttribute("data-sp-dropdown-menu") || el.hasAttribute("data-sp-dropdown-trigger");
|
|
3414
3415
|
}
|
|
3415
3416
|
syncProjectedContent() {
|
|
3416
3417
|
const nextTriggerContent = [];
|
|
3417
3418
|
const nextMenuContent = [];
|
|
3418
|
-
|
|
3419
|
-
|
|
3419
|
+
const sourceNodes = [
|
|
3420
|
+
...this.triggerContent.filter((node) => this.contains(node)),
|
|
3421
|
+
...this.menuContent.filter((node) => this.contains(node)),
|
|
3422
|
+
...Array.from(this.childNodes).filter(
|
|
3423
|
+
(node) => !this.hasUpdated || node.nodeType !== Node.TEXT_NODE || node.textContent?.trim()
|
|
3424
|
+
)
|
|
3425
|
+
];
|
|
3426
|
+
new Set(sourceNodes).forEach((node) => {
|
|
3427
|
+
if (node.nodeType === Node.COMMENT_NODE || this.isInternalNode(node)) {
|
|
3420
3428
|
return;
|
|
3421
3429
|
}
|
|
3422
3430
|
const isTriggerSlot = node.nodeType === Node.ELEMENT_NODE && node.getAttribute("slot") === "trigger";
|
|
@@ -3529,6 +3537,7 @@ var SpectreDropdownElement = class extends SpectreBaseElement {
|
|
|
3529
3537
|
render() {
|
|
3530
3538
|
return lit.html`<div
|
|
3531
3539
|
class="${this.dropdownClasses}"
|
|
3540
|
+
data-sp-dropdown-native
|
|
3532
3541
|
id="${ifDefined_js.ifDefined(this.id || void 0)}"
|
|
3533
3542
|
title="${ifDefined_js.ifDefined(this.title || void 0)}"
|
|
3534
3543
|
>
|
|
@@ -4759,8 +4768,15 @@ var SpectreTooltipElement = class extends SpectreBaseElement {
|
|
|
4759
4768
|
syncProjectedContent() {
|
|
4760
4769
|
const nextTooltipContent = [];
|
|
4761
4770
|
const nextTriggerContent = [];
|
|
4762
|
-
|
|
4763
|
-
|
|
4771
|
+
const sourceNodes = [
|
|
4772
|
+
...this.triggerContent.filter((node) => this.contains(node)),
|
|
4773
|
+
...this.tooltipContent.filter((node) => this.contains(node)),
|
|
4774
|
+
...Array.from(this.childNodes).filter(
|
|
4775
|
+
(node) => !this.hasUpdated || node.nodeType !== Node.TEXT_NODE || node.textContent?.trim()
|
|
4776
|
+
)
|
|
4777
|
+
];
|
|
4778
|
+
new Set(sourceNodes).forEach((node) => {
|
|
4779
|
+
if (node.nodeType === Node.COMMENT_NODE || this.isInternalNode(node)) {
|
|
4764
4780
|
return;
|
|
4765
4781
|
}
|
|
4766
4782
|
const isTooltipSlot = node.nodeType === Node.ELEMENT_NODE && node.getAttribute("slot") === "tooltip";
|