@nectary/components 5.57.3 → 5.59.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/alert/index.js +1 -1
- package/alert/types.d.ts +4 -1
- package/alert/utils.js +1 -1
- package/bundle.js +74 -43
- package/field-v2/index.js +12 -3
- package/input/types.d.ts +2 -2
- package/package.json +3 -3
- package/toggle/index.d.ts +1 -0
- package/toggle/index.js +23 -9
- package/toggle/types.d.ts +3 -1
- package/utils/dom.js +38 -30
package/alert/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import "../text/index.js";
|
|
|
4
4
|
import { updateAttribute, getLiteralAttribute, updateLiteralAttribute, getAttribute } from "../utils/dom.js";
|
|
5
5
|
import { defineCustomElement, NectaryElement } from "../utils/element.js";
|
|
6
6
|
import { typeValues } from "./utils.js";
|
|
7
|
-
const templateHTML = '<style>:host{display:block}#wrapper{display:flex;flex-direction:row;gap:8px;align-items:center;padding:8px 16px;box-sizing:border-box;width:100%;min-height:48px}:host([type=warn]) #wrapper{background-color:var(--sinch-comp-alert-color-warning-default-background)}:host([type=error]) #wrapper{background-color:var(--sinch-comp-alert-color-error-default-background)}:host([type=info]) #wrapper{background-color:var(--sinch-comp-alert-color-info-default-background)}#icon-error,#icon-info,#icon-warn{display:none}#icon-warn{--sinch-global-color-icon:var(--sinch-comp-alert-color-warning-default-icon)}#icon-error{--sinch-global-color-icon:var(--sinch-comp-alert-color-error-default-icon)}#icon-info{--sinch-global-color-icon:var(--sinch-comp-alert-color-info-default-icon)}:host([type=error]) #icon-error,:host([type=info]) #icon-info,:host([type=warn]) #icon-warn{display:block}#text{display:flex;flex-direction:column;gap:8px;flex:1;min-width:0;--sinch-comp-rich-text-font:var(--sinch-comp-alert-font-body)}:host([type=warn]) #text{--sinch-global-color-text:var(--sinch-comp-alert-color-warning-default-text)}:host([type=error]) #text{--sinch-global-color-text:var(--sinch-comp-alert-color-error-default-text)}:host([type=info]) #text{--sinch-global-color-text:var(--sinch-comp-alert-color-info-default-text)}</style><div id="wrapper"><sinch-icon icons-version="2" name="circle-info" id="icon-info"></sinch-icon><sinch-icon icons-version="2" name="triangle-exclamation" id="icon-warn"></sinch-icon><sinch-icon icons-version="2" name="octagon-exclamation" id="icon-error"></sinch-icon><sinch-rich-text id="text"></sinch-rich-text><slot name="action"></slot><slot name="close"></slot></div>';
|
|
7
|
+
const templateHTML = '<style>:host{display:block}#wrapper{display:flex;flex-direction:row;gap:8px;align-items:center;padding:8px 16px;box-sizing:border-box;width:100%;min-height:48px}:host([type=warn]) #wrapper{background-color:var(--sinch-comp-alert-color-warning-default-background)}:host([type=error]) #wrapper{background-color:var(--sinch-comp-alert-color-error-default-background)}:host([type=info]) #wrapper{background-color:var(--sinch-comp-alert-color-info-default-background)}:host([type=success]) #wrapper{background-color:var(--sinch-comp-alert-color-success-default-background)}#icon-error,#icon-info,#icon-success,#icon-warn{display:none}#icon-warn{--sinch-global-color-icon:var(--sinch-comp-alert-color-warning-default-icon)}#icon-error{--sinch-global-color-icon:var(--sinch-comp-alert-color-error-default-icon)}#icon-info{--sinch-global-color-icon:var(--sinch-comp-alert-color-info-default-icon)}#icon-success{--sinch-global-color-icon:var(--sinch-comp-alert-color-success-default-icon)}:host([type=error]) #icon-error,:host([type=info]) #icon-info,:host([type=success]) #icon-success,:host([type=warn]) #icon-warn{display:block}#text{display:flex;flex-direction:column;gap:8px;flex:1;min-width:0;--sinch-comp-rich-text-font:var(--sinch-comp-alert-font-body)}:host([type=warn]) #text{--sinch-global-color-text:var(--sinch-comp-alert-color-warning-default-text)}:host([type=error]) #text{--sinch-global-color-text:var(--sinch-comp-alert-color-error-default-text)}:host([type=info]) #text{--sinch-global-color-text:var(--sinch-comp-alert-color-info-default-text)}:host([type=success]) #text{--sinch-global-color-text:var(--sinch-comp-alert-color-success-default-text)}</style><div id="wrapper"><sinch-icon icons-version="2" name="circle-info" id="icon-info"></sinch-icon><sinch-icon icons-version="2" name="triangle-exclamation" id="icon-warn"></sinch-icon><sinch-icon icons-version="2" name="octagon-exclamation" id="icon-error"></sinch-icon><sinch-icon icons-version="2" name="circle-check" id="icon-success"></sinch-icon><sinch-rich-text id="text"></sinch-rich-text><slot name="action"></slot><slot name="close"></slot></div>';
|
|
8
8
|
const template = document.createElement("template");
|
|
9
9
|
template.innerHTML = templateHTML;
|
|
10
10
|
class Alert extends NectaryElement {
|
package/alert/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { NectaryComponentReactByType, NectaryComponentVanillaByType, NectaryComponentReact, NectaryComponentVanilla } from '../types';
|
|
2
|
-
export type TSinchAlertType = 'info' | 'warn' | 'error';
|
|
2
|
+
export type TSinchAlertType = 'info' | 'success' | 'warn' | 'error';
|
|
3
3
|
export type TSinchAlertProps = {
|
|
4
4
|
/** Type */
|
|
5
5
|
type: TSinchAlertType;
|
|
@@ -16,6 +16,9 @@ export type TSinchAlertStyle = {
|
|
|
16
16
|
'--sinch-comp-alert-color-info-default-background'?: string;
|
|
17
17
|
'--sinch-comp-alert-color-info-default-icon'?: string;
|
|
18
18
|
'--sinch-comp-alert-color-info-default-text'?: string;
|
|
19
|
+
'--sinch-comp-alert-color-success-default-background'?: string;
|
|
20
|
+
'--sinch-comp-alert-color-success-default-icon'?: string;
|
|
21
|
+
'--sinch-comp-alert-color-success-default-text'?: string;
|
|
19
22
|
'--sinch-comp-alert-font-body'?: string;
|
|
20
23
|
'--sinch-global-color-icon'?: string;
|
|
21
24
|
'--sinch-global-color-text'?: string;
|
package/alert/utils.js
CHANGED
package/bundle.js
CHANGED
|
@@ -175,28 +175,42 @@ const composedContains = (container, node) => {
|
|
|
175
175
|
const isAttrEqual = (oldVal, newVal) => {
|
|
176
176
|
return oldVal === newVal || newVal === null && oldVal === "false" || newVal === "" && oldVal === "true";
|
|
177
177
|
};
|
|
178
|
+
const isScrollableOverflow = (value) => {
|
|
179
|
+
return value === "auto" || value === "scroll";
|
|
180
|
+
};
|
|
181
|
+
const isScrollableElement = (element) => {
|
|
182
|
+
if (element.scrollHeight <= element.clientHeight && element.scrollWidth <= element.clientWidth) {
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
const style = getComputedStyle(element);
|
|
186
|
+
return isScrollableOverflow(style.overflow) || isScrollableOverflow(style.overflowY) || isScrollableOverflow(style.overflowX);
|
|
187
|
+
};
|
|
188
|
+
const nextFlatTreeAncestor = (element) => {
|
|
189
|
+
const slot = element.assignedSlot;
|
|
190
|
+
if (slot != null) {
|
|
191
|
+
return slot;
|
|
192
|
+
}
|
|
193
|
+
const parent = element.parentElement;
|
|
194
|
+
if (parent != null) {
|
|
195
|
+
return parent;
|
|
196
|
+
}
|
|
197
|
+
const root = element.getRootNode();
|
|
198
|
+
if (root instanceof ShadowRoot && root.host instanceof HTMLElement) {
|
|
199
|
+
return root.host;
|
|
200
|
+
}
|
|
201
|
+
return null;
|
|
202
|
+
};
|
|
178
203
|
const getScrollableParents = (node) => {
|
|
179
204
|
const scrollableParents = [];
|
|
180
205
|
if (node == null) {
|
|
181
206
|
return scrollableParents;
|
|
182
207
|
}
|
|
183
|
-
let current = node
|
|
208
|
+
let current = node;
|
|
184
209
|
while (current != null) {
|
|
185
|
-
|
|
186
|
-
if ((current.scrollHeight > current.clientHeight || current.scrollWidth > current.clientWidth) && (computedStyle.overflow === "auto" || computedStyle.overflow === "scroll" || computedStyle.overflowY === "auto" || computedStyle.overflowY === "scroll" || computedStyle.overflowX === "auto" || computedStyle.overflowX === "scroll")) {
|
|
210
|
+
if (current !== node && isScrollableElement(current)) {
|
|
187
211
|
scrollableParents.push(current);
|
|
188
212
|
}
|
|
189
|
-
|
|
190
|
-
if (parent != null) {
|
|
191
|
-
current = parent;
|
|
192
|
-
continue;
|
|
193
|
-
}
|
|
194
|
-
const root = current.getRootNode();
|
|
195
|
-
if (root instanceof ShadowRoot && root.host instanceof HTMLElement) {
|
|
196
|
-
current = root.host;
|
|
197
|
-
continue;
|
|
198
|
-
}
|
|
199
|
-
break;
|
|
213
|
+
current = nextFlatTreeAncestor(current);
|
|
200
214
|
}
|
|
201
215
|
scrollableParents.push(document);
|
|
202
216
|
return scrollableParents;
|
|
@@ -209,33 +223,27 @@ const createScopedElement = (anchor, tag) => {
|
|
|
209
223
|
}
|
|
210
224
|
return document.createElement(tag);
|
|
211
225
|
};
|
|
226
|
+
const establishesFixedContainingBlock = (contain) => {
|
|
227
|
+
return contain.split(/\s+/).some((value) => {
|
|
228
|
+
return value === "layout" || value === "paint" || value === "content" || value === "strict";
|
|
229
|
+
});
|
|
230
|
+
};
|
|
212
231
|
const isTransformedElement = (element) => {
|
|
213
232
|
if (element == null) {
|
|
214
233
|
return false;
|
|
215
234
|
}
|
|
216
235
|
const style = getComputedStyle(element);
|
|
217
236
|
const backdropFilter = style.getPropertyValue("backdrop-filter");
|
|
218
|
-
|
|
237
|
+
const contentVisibility = style.getPropertyValue("content-visibility");
|
|
238
|
+
return style.transform !== "none" || style.perspective !== "none" || style.filter !== "none" || backdropFilter !== "" && backdropFilter !== "none" || establishesFixedContainingBlock(style.getPropertyValue("contain")) || contentVisibility === "auto" || contentVisibility === "hidden";
|
|
219
239
|
};
|
|
220
240
|
const getTransformedAncestor = (node) => {
|
|
221
241
|
let current = node;
|
|
222
242
|
while (current != null) {
|
|
223
|
-
if (current !== node) {
|
|
224
|
-
|
|
225
|
-
return current;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
const parent = current.parentElement;
|
|
229
|
-
if (parent != null) {
|
|
230
|
-
current = parent;
|
|
231
|
-
continue;
|
|
232
|
-
}
|
|
233
|
-
const root = current.getRootNode();
|
|
234
|
-
if (root instanceof ShadowRoot && root.host instanceof HTMLElement) {
|
|
235
|
-
current = root.host;
|
|
236
|
-
continue;
|
|
243
|
+
if (current !== node && isTransformedElement(current)) {
|
|
244
|
+
return current;
|
|
237
245
|
}
|
|
238
|
-
|
|
246
|
+
current = nextFlatTreeAncestor(current);
|
|
239
247
|
}
|
|
240
248
|
return null;
|
|
241
249
|
};
|
|
@@ -2172,8 +2180,8 @@ class RichText extends NectaryElement {
|
|
|
2172
2180
|
};
|
|
2173
2181
|
}
|
|
2174
2182
|
defineCustomElement("sinch-rich-text", RichText);
|
|
2175
|
-
const typeValues$5 = ["info", "warn", "error"];
|
|
2176
|
-
const templateHTML$19 = '<style>:host{display:block}#wrapper{display:flex;flex-direction:row;gap:8px;align-items:center;padding:8px 16px;box-sizing:border-box;width:100%;min-height:48px}:host([type=warn]) #wrapper{background-color:var(--sinch-comp-alert-color-warning-default-background)}:host([type=error]) #wrapper{background-color:var(--sinch-comp-alert-color-error-default-background)}:host([type=info]) #wrapper{background-color:var(--sinch-comp-alert-color-info-default-background)}#icon-error,#icon-info,#icon-warn{display:none}#icon-warn{--sinch-global-color-icon:var(--sinch-comp-alert-color-warning-default-icon)}#icon-error{--sinch-global-color-icon:var(--sinch-comp-alert-color-error-default-icon)}#icon-info{--sinch-global-color-icon:var(--sinch-comp-alert-color-info-default-icon)}:host([type=error]) #icon-error,:host([type=info]) #icon-info,:host([type=warn]) #icon-warn{display:block}#text{display:flex;flex-direction:column;gap:8px;flex:1;min-width:0;--sinch-comp-rich-text-font:var(--sinch-comp-alert-font-body)}:host([type=warn]) #text{--sinch-global-color-text:var(--sinch-comp-alert-color-warning-default-text)}:host([type=error]) #text{--sinch-global-color-text:var(--sinch-comp-alert-color-error-default-text)}:host([type=info]) #text{--sinch-global-color-text:var(--sinch-comp-alert-color-info-default-text)}</style><div id="wrapper"><sinch-icon icons-version="2" name="circle-info" id="icon-info"></sinch-icon><sinch-icon icons-version="2" name="triangle-exclamation" id="icon-warn"></sinch-icon><sinch-icon icons-version="2" name="octagon-exclamation" id="icon-error"></sinch-icon><sinch-rich-text id="text"></sinch-rich-text><slot name="action"></slot><slot name="close"></slot></div>';
|
|
2183
|
+
const typeValues$5 = ["info", "success", "warn", "error"];
|
|
2184
|
+
const templateHTML$19 = '<style>:host{display:block}#wrapper{display:flex;flex-direction:row;gap:8px;align-items:center;padding:8px 16px;box-sizing:border-box;width:100%;min-height:48px}:host([type=warn]) #wrapper{background-color:var(--sinch-comp-alert-color-warning-default-background)}:host([type=error]) #wrapper{background-color:var(--sinch-comp-alert-color-error-default-background)}:host([type=info]) #wrapper{background-color:var(--sinch-comp-alert-color-info-default-background)}:host([type=success]) #wrapper{background-color:var(--sinch-comp-alert-color-success-default-background)}#icon-error,#icon-info,#icon-success,#icon-warn{display:none}#icon-warn{--sinch-global-color-icon:var(--sinch-comp-alert-color-warning-default-icon)}#icon-error{--sinch-global-color-icon:var(--sinch-comp-alert-color-error-default-icon)}#icon-info{--sinch-global-color-icon:var(--sinch-comp-alert-color-info-default-icon)}#icon-success{--sinch-global-color-icon:var(--sinch-comp-alert-color-success-default-icon)}:host([type=error]) #icon-error,:host([type=info]) #icon-info,:host([type=success]) #icon-success,:host([type=warn]) #icon-warn{display:block}#text{display:flex;flex-direction:column;gap:8px;flex:1;min-width:0;--sinch-comp-rich-text-font:var(--sinch-comp-alert-font-body)}:host([type=warn]) #text{--sinch-global-color-text:var(--sinch-comp-alert-color-warning-default-text)}:host([type=error]) #text{--sinch-global-color-text:var(--sinch-comp-alert-color-error-default-text)}:host([type=info]) #text{--sinch-global-color-text:var(--sinch-comp-alert-color-info-default-text)}:host([type=success]) #text{--sinch-global-color-text:var(--sinch-comp-alert-color-success-default-text)}</style><div id="wrapper"><sinch-icon icons-version="2" name="circle-info" id="icon-info"></sinch-icon><sinch-icon icons-version="2" name="triangle-exclamation" id="icon-warn"></sinch-icon><sinch-icon icons-version="2" name="octagon-exclamation" id="icon-error"></sinch-icon><sinch-icon icons-version="2" name="circle-check" id="icon-success"></sinch-icon><sinch-rich-text id="text"></sinch-rich-text><slot name="action"></slot><slot name="close"></slot></div>';
|
|
2177
2185
|
const template$19 = document.createElement("template");
|
|
2178
2186
|
template$19.innerHTML = templateHTML$19;
|
|
2179
2187
|
class Alert extends NectaryElement {
|
|
@@ -8940,6 +8948,7 @@ class FieldV2 extends NectaryElement {
|
|
|
8940
8948
|
#$tooltipWrapper;
|
|
8941
8949
|
#$tooltipSlot;
|
|
8942
8950
|
#controller = null;
|
|
8951
|
+
#writtenAriaLabel = null;
|
|
8943
8952
|
constructor() {
|
|
8944
8953
|
super();
|
|
8945
8954
|
const shadowRoot = this.attachShadow();
|
|
@@ -9117,14 +9126,22 @@ class FieldV2 extends NectaryElement {
|
|
|
9117
9126
|
}
|
|
9118
9127
|
#syncInputAriaLabel(labelText) {
|
|
9119
9128
|
const inputElement = getFirstSlotElement(this.#$inputSlot);
|
|
9129
|
+
const name = labelText ?? "";
|
|
9120
9130
|
if (inputElement === null) {
|
|
9131
|
+
if (name.trim().length === 0) {
|
|
9132
|
+
this.#writtenAriaLabel = null;
|
|
9133
|
+
}
|
|
9121
9134
|
return;
|
|
9122
9135
|
}
|
|
9123
|
-
if (
|
|
9124
|
-
inputElement.setAttribute("aria-label",
|
|
9125
|
-
|
|
9136
|
+
if (name.trim().length > 0) {
|
|
9137
|
+
inputElement.setAttribute("aria-label", name);
|
|
9138
|
+
this.#writtenAriaLabel = name;
|
|
9139
|
+
return;
|
|
9140
|
+
}
|
|
9141
|
+
if (this.#writtenAriaLabel !== null && inputElement.getAttribute("aria-label") === this.#writtenAriaLabel) {
|
|
9126
9142
|
inputElement.removeAttribute("aria-label");
|
|
9127
9143
|
}
|
|
9144
|
+
this.#writtenAriaLabel = null;
|
|
9128
9145
|
}
|
|
9129
9146
|
#syncInputDescription() {
|
|
9130
9147
|
const inputElement = getFirstSlotElement(this.#$inputSlot);
|
|
@@ -18887,16 +18904,19 @@ class ToastManager extends NectaryElement {
|
|
|
18887
18904
|
};
|
|
18888
18905
|
}
|
|
18889
18906
|
defineCustomElement("sinch-toast-manager", ToastManager);
|
|
18890
|
-
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#wrapper{position:relative;display:flex;flex-direction:row;gap:8px;width:100%;height:var(--sinch-local-size);cursor:pointer;user-select:none;--sinch-local-size:20px}:host([small]) #wrapper{--sinch-local-size:16px}:host([disabled]) #wrapper{cursor:initial}#knob-container{position:relative;width:40px;height:var(--sinch-local-size);border-radius:calc(var(--sinch-local-size) * .5);background-color:var(--sinch-comp-toggle-color-default-background-initial);pointer-events:none;transition:background-color .15s ease-in-out}:host([small]) #knob-container{width:32px;height:var(--sinch-local-size)}:host([checked]) #knob-container{background-color:var(--sinch-comp-toggle-color-checked-background-initial)}:host([disabled]) #knob-container{background-color:var(--sinch-comp-toggle-color-disabled-background-initial)}:host([checked][disabled]) #knob-container{background-color:var(--sinch-comp-toggle-color-checked-disabled-background-initial)}#knob{position:relative;width:16px;height:16px;left:2px;top:2px;border-radius:50%;background-color:var(--sinch-comp-toggle-color-default-knob-background-initial);box-shadow:var(--sinch-comp-toggle-shadow-knob-default);transform:translateX(0);transition:transform .15s ease-in-out;will-change:transform}:host([small]) #knob{width:12px;height:12px}:host([disabled]) #knob-container>#knob{box-shadow:var(--sinch-comp-toggle-shadow-knob-disabled)}:host([checked]) #knob-container>#knob{transform:translateX(20px)}:host([small][checked]) #knob-container>#knob{transform:translateX(16px)}#knob::after,#knob::before{font:var(--sinch-comp-toggle-font-size-m-inside-text);color:var(--sinch-comp-toggle-color-default-text-inside-initial);text-transform:uppercase;position:absolute;top:0;padding:0 1px;opacity:0;transition:opacity .15s ease-in-out;user-select:none}#knob::before{content:"on";right:100%}#knob::after{content:"off";left:100%}:host([labeled]:not([small]):not([checked])) #knob::after{opacity:1}:host([labeled]:not([small])[checked]) #knob::before{opacity:1}@media (prefers-reduced-motion){#knob,#knob-container,#knob::after,#knob::before{transition:none}}#outline{display:none;position:absolute;left:-3px;top:-3px;right:-3px;bottom:-3px;border:2px solid var(--sinch-comp-toggle-color-default-outline-focus);border-radius:17px;pointer-events:none}:host(:focus-visible) #outline{display:block}#label{flex:1;min-width:0;align-self:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font:var(--sinch-comp-toggle-font-size-m-label);color:var(--sinch-comp-toggle-color-default-label-initial)}#label:empty{display:none}:host([small]) #label{font:var(--sinch-comp-toggle-font-size-s-label)}:host([disabled]) #label{color:var(--sinch-comp-toggle-color-disabled-label-initial)}</style><div id="wrapper"><div id="knob-container"><div id="outline"></div><div id="knob"></div></div><span id="label"></span></div>';
|
|
18907
|
+
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#wrapper{position:relative;display:flex;flex-direction:row;gap:8px;width:100%;height:var(--sinch-local-size);cursor:pointer;user-select:none;--sinch-local-size:20px}:host([small]) #wrapper{--sinch-local-size:16px}:host([disabled]) #wrapper{cursor:initial}#knob-container{position:relative;width:40px;height:var(--sinch-local-size);border-radius:calc(var(--sinch-local-size) * .5);background-color:var(--sinch-comp-toggle-color-default-background-initial);pointer-events:none;transition:background-color .15s ease-in-out}:host([small]) #knob-container{width:32px;height:var(--sinch-local-size)}:host([checked]) #knob-container{background-color:var(--sinch-comp-toggle-color-checked-background-initial)}:host([disabled]) #knob-container{background-color:var(--sinch-comp-toggle-color-disabled-background-initial)}:host([checked][disabled]) #knob-container{background-color:var(--sinch-comp-toggle-color-checked-disabled-background-initial)}#knob{position:relative;width:16px;height:16px;left:2px;top:2px;border-radius:50%;background-color:var(--sinch-comp-toggle-color-default-knob-background-initial);box-shadow:var(--sinch-comp-toggle-shadow-knob-default);transform:translateX(0);transition:transform .15s ease-in-out;will-change:transform}:host([small]) #knob{width:12px;height:12px}:host([disabled]) #knob-container>#knob{box-shadow:var(--sinch-comp-toggle-shadow-knob-disabled)}:host([checked]) #knob-container>#knob{transform:translateX(20px)}:host([small][checked]) #knob-container>#knob{transform:translateX(16px)}#knob::after,#knob::before{font:var(--sinch-comp-toggle-font-size-m-inside-text);color:var(--sinch-comp-toggle-color-default-text-inside-initial);text-transform:uppercase;position:absolute;top:0;padding:0 1px;opacity:0;transition:opacity .15s ease-in-out;user-select:none}#knob::before{content:"on";content:"on"/"";right:100%}#knob::after{content:"off";content:"off"/"";left:100%}:host([labeled]:not([small]):not([checked])) #knob::after{opacity:1}:host([labeled]:not([small])[checked]) #knob::before{opacity:1}@media (prefers-reduced-motion){#knob,#knob-container,#knob::after,#knob::before{transition:none}}#outline{display:none;position:absolute;left:-3px;top:-3px;right:-3px;bottom:-3px;border:2px solid var(--sinch-comp-toggle-color-default-outline-focus);border-radius:17px;pointer-events:none}:host(:focus-visible) #outline{display:block}#label{flex:1;min-width:0;align-self:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font:var(--sinch-comp-toggle-font-size-m-label);color:var(--sinch-comp-toggle-color-default-label-initial)}#label:empty{display:none}:host([small]) #label{font:var(--sinch-comp-toggle-font-size-s-label)}:host([disabled]) #label{color:var(--sinch-comp-toggle-color-disabled-label-initial)}</style><div id="wrapper"><div id="knob-container"><div id="outline"></div><div id="knob"></div></div><span id="label"></span></div>';
|
|
18891
18908
|
const template = document.createElement("template");
|
|
18892
18909
|
template.innerHTML = templateHTML;
|
|
18893
18910
|
class Toggle extends NectaryElement {
|
|
18894
18911
|
#$label;
|
|
18895
18912
|
#controller = null;
|
|
18913
|
+
#internals;
|
|
18914
|
+
static formAssociated = true;
|
|
18896
18915
|
constructor() {
|
|
18897
18916
|
super();
|
|
18898
18917
|
const shadowRoot = this.attachShadow();
|
|
18899
18918
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
18919
|
+
this.#internals = this.attachInternals();
|
|
18900
18920
|
this.#$label = shadowRoot.querySelector("#label");
|
|
18901
18921
|
}
|
|
18902
18922
|
connectedCallback() {
|
|
@@ -18904,6 +18924,9 @@ class Toggle extends NectaryElement {
|
|
|
18904
18924
|
const { signal } = this.#controller;
|
|
18905
18925
|
const options = { signal };
|
|
18906
18926
|
this.setAttribute("role", "checkbox");
|
|
18927
|
+
this.#internals.role = "checkbox";
|
|
18928
|
+
this.#syncChecked();
|
|
18929
|
+
this.#syncDisabled();
|
|
18907
18930
|
this.addEventListener("click", this.#onClick, options);
|
|
18908
18931
|
this.addEventListener("keydown", this.#onKeydown, options);
|
|
18909
18932
|
this.addEventListener("focus", this.#onFocus, options);
|
|
@@ -18936,16 +18959,11 @@ class Toggle extends NectaryElement {
|
|
|
18936
18959
|
break;
|
|
18937
18960
|
}
|
|
18938
18961
|
case "checked": {
|
|
18939
|
-
|
|
18940
|
-
updateExplicitBooleanAttribute(this, "aria-checked", isChecked);
|
|
18941
|
-
updateBooleanAttribute(this, name, isChecked);
|
|
18962
|
+
this.#syncChecked();
|
|
18942
18963
|
break;
|
|
18943
18964
|
}
|
|
18944
18965
|
case "disabled": {
|
|
18945
|
-
|
|
18946
|
-
this.#updateTabIndex();
|
|
18947
|
-
updateExplicitBooleanAttribute(this, "aria-disabled", isDisabled);
|
|
18948
|
-
updateBooleanAttribute(this, name, isDisabled);
|
|
18966
|
+
this.#syncDisabled();
|
|
18949
18967
|
break;
|
|
18950
18968
|
}
|
|
18951
18969
|
case "small":
|
|
@@ -19005,6 +19023,19 @@ class Toggle extends NectaryElement {
|
|
|
19005
19023
|
}
|
|
19006
19024
|
}
|
|
19007
19025
|
};
|
|
19026
|
+
#syncChecked() {
|
|
19027
|
+
const isChecked = this.checked;
|
|
19028
|
+
updateExplicitBooleanAttribute(this, "aria-checked", isChecked);
|
|
19029
|
+
this.#internals.ariaChecked = isChecked.toString();
|
|
19030
|
+
updateBooleanAttribute(this, "checked", isChecked);
|
|
19031
|
+
}
|
|
19032
|
+
#syncDisabled() {
|
|
19033
|
+
const isDisabled = this.disabled;
|
|
19034
|
+
this.#updateTabIndex();
|
|
19035
|
+
updateExplicitBooleanAttribute(this, "aria-disabled", isDisabled);
|
|
19036
|
+
this.#internals.ariaDisabled = isDisabled.toString();
|
|
19037
|
+
updateBooleanAttribute(this, "disabled", isDisabled);
|
|
19038
|
+
}
|
|
19008
19039
|
#updateTabIndex() {
|
|
19009
19040
|
this.tabIndex = this.disabled ? -1 : 0;
|
|
19010
19041
|
}
|
package/field-v2/index.js
CHANGED
|
@@ -54,6 +54,7 @@ class FieldV2 extends NectaryElement {
|
|
|
54
54
|
#$tooltipWrapper;
|
|
55
55
|
#$tooltipSlot;
|
|
56
56
|
#controller = null;
|
|
57
|
+
#writtenAriaLabel = null;
|
|
57
58
|
constructor() {
|
|
58
59
|
super();
|
|
59
60
|
const shadowRoot = this.attachShadow();
|
|
@@ -231,14 +232,22 @@ class FieldV2 extends NectaryElement {
|
|
|
231
232
|
}
|
|
232
233
|
#syncInputAriaLabel(labelText) {
|
|
233
234
|
const inputElement = getFirstSlotElement(this.#$inputSlot);
|
|
235
|
+
const name = labelText ?? "";
|
|
234
236
|
if (inputElement === null) {
|
|
237
|
+
if (name.trim().length === 0) {
|
|
238
|
+
this.#writtenAriaLabel = null;
|
|
239
|
+
}
|
|
235
240
|
return;
|
|
236
241
|
}
|
|
237
|
-
if (
|
|
238
|
-
inputElement.setAttribute("aria-label",
|
|
239
|
-
|
|
242
|
+
if (name.trim().length > 0) {
|
|
243
|
+
inputElement.setAttribute("aria-label", name);
|
|
244
|
+
this.#writtenAriaLabel = name;
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
if (this.#writtenAriaLabel !== null && inputElement.getAttribute("aria-label") === this.#writtenAriaLabel) {
|
|
240
248
|
inputElement.removeAttribute("aria-label");
|
|
241
249
|
}
|
|
250
|
+
this.#writtenAriaLabel = null;
|
|
242
251
|
}
|
|
243
252
|
#syncInputDescription() {
|
|
244
253
|
const inputElement = getFirstSlotElement(this.#$inputSlot);
|
package/input/types.d.ts
CHANGED
|
@@ -12,8 +12,8 @@ export type TSinchInputProps = {
|
|
|
12
12
|
value?: string;
|
|
13
13
|
/** Mask */
|
|
14
14
|
mask?: string | null;
|
|
15
|
-
/**
|
|
16
|
-
'aria-label'
|
|
15
|
+
/** Accessible name. May be omitted when a parent field `label` supplies the name. */
|
|
16
|
+
'aria-label'?: string;
|
|
17
17
|
/** Accessible description. Exposed on the native input through a description in this shadow root. */
|
|
18
18
|
'aria-description'?: string;
|
|
19
19
|
/** Text field type, `text` by default */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nectary/components",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.59.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"**/*/*.css",
|
|
6
6
|
"**/*/*.json",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.22.15",
|
|
27
|
-
"@nectary/assets": "3.7.
|
|
27
|
+
"@nectary/assets": "3.7.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@babel/cli": "^7.22.15",
|
|
@@ -41,6 +41,6 @@
|
|
|
41
41
|
"vite": "^7.0.6"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@nectary/theme-base": "1.
|
|
44
|
+
"@nectary/theme-base": "1.20.0"
|
|
45
45
|
}
|
|
46
46
|
}
|
package/toggle/index.d.ts
CHANGED
package/toggle/index.js
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { isAttrEqual, updateBooleanAttribute, isAttrTrue,
|
|
1
|
+
import { isAttrEqual, updateBooleanAttribute, isAttrTrue, getBooleanAttribute, updateAttribute, getAttribute, updateExplicitBooleanAttribute } from "../utils/dom.js";
|
|
2
2
|
import { defineCustomElement, NectaryElement } from "../utils/element.js";
|
|
3
3
|
import { getReactEventHandler } from "../utils/get-react-event-handler.js";
|
|
4
|
-
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#wrapper{position:relative;display:flex;flex-direction:row;gap:8px;width:100%;height:var(--sinch-local-size);cursor:pointer;user-select:none;--sinch-local-size:20px}:host([small]) #wrapper{--sinch-local-size:16px}:host([disabled]) #wrapper{cursor:initial}#knob-container{position:relative;width:40px;height:var(--sinch-local-size);border-radius:calc(var(--sinch-local-size) * .5);background-color:var(--sinch-comp-toggle-color-default-background-initial);pointer-events:none;transition:background-color .15s ease-in-out}:host([small]) #knob-container{width:32px;height:var(--sinch-local-size)}:host([checked]) #knob-container{background-color:var(--sinch-comp-toggle-color-checked-background-initial)}:host([disabled]) #knob-container{background-color:var(--sinch-comp-toggle-color-disabled-background-initial)}:host([checked][disabled]) #knob-container{background-color:var(--sinch-comp-toggle-color-checked-disabled-background-initial)}#knob{position:relative;width:16px;height:16px;left:2px;top:2px;border-radius:50%;background-color:var(--sinch-comp-toggle-color-default-knob-background-initial);box-shadow:var(--sinch-comp-toggle-shadow-knob-default);transform:translateX(0);transition:transform .15s ease-in-out;will-change:transform}:host([small]) #knob{width:12px;height:12px}:host([disabled]) #knob-container>#knob{box-shadow:var(--sinch-comp-toggle-shadow-knob-disabled)}:host([checked]) #knob-container>#knob{transform:translateX(20px)}:host([small][checked]) #knob-container>#knob{transform:translateX(16px)}#knob::after,#knob::before{font:var(--sinch-comp-toggle-font-size-m-inside-text);color:var(--sinch-comp-toggle-color-default-text-inside-initial);text-transform:uppercase;position:absolute;top:0;padding:0 1px;opacity:0;transition:opacity .15s ease-in-out;user-select:none}#knob::before{content:"on";right:100%}#knob::after{content:"off";left:100%}:host([labeled]:not([small]):not([checked])) #knob::after{opacity:1}:host([labeled]:not([small])[checked]) #knob::before{opacity:1}@media (prefers-reduced-motion){#knob,#knob-container,#knob::after,#knob::before{transition:none}}#outline{display:none;position:absolute;left:-3px;top:-3px;right:-3px;bottom:-3px;border:2px solid var(--sinch-comp-toggle-color-default-outline-focus);border-radius:17px;pointer-events:none}:host(:focus-visible) #outline{display:block}#label{flex:1;min-width:0;align-self:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font:var(--sinch-comp-toggle-font-size-m-label);color:var(--sinch-comp-toggle-color-default-label-initial)}#label:empty{display:none}:host([small]) #label{font:var(--sinch-comp-toggle-font-size-s-label)}:host([disabled]) #label{color:var(--sinch-comp-toggle-color-disabled-label-initial)}</style><div id="wrapper"><div id="knob-container"><div id="outline"></div><div id="knob"></div></div><span id="label"></span></div>';
|
|
4
|
+
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#wrapper{position:relative;display:flex;flex-direction:row;gap:8px;width:100%;height:var(--sinch-local-size);cursor:pointer;user-select:none;--sinch-local-size:20px}:host([small]) #wrapper{--sinch-local-size:16px}:host([disabled]) #wrapper{cursor:initial}#knob-container{position:relative;width:40px;height:var(--sinch-local-size);border-radius:calc(var(--sinch-local-size) * .5);background-color:var(--sinch-comp-toggle-color-default-background-initial);pointer-events:none;transition:background-color .15s ease-in-out}:host([small]) #knob-container{width:32px;height:var(--sinch-local-size)}:host([checked]) #knob-container{background-color:var(--sinch-comp-toggle-color-checked-background-initial)}:host([disabled]) #knob-container{background-color:var(--sinch-comp-toggle-color-disabled-background-initial)}:host([checked][disabled]) #knob-container{background-color:var(--sinch-comp-toggle-color-checked-disabled-background-initial)}#knob{position:relative;width:16px;height:16px;left:2px;top:2px;border-radius:50%;background-color:var(--sinch-comp-toggle-color-default-knob-background-initial);box-shadow:var(--sinch-comp-toggle-shadow-knob-default);transform:translateX(0);transition:transform .15s ease-in-out;will-change:transform}:host([small]) #knob{width:12px;height:12px}:host([disabled]) #knob-container>#knob{box-shadow:var(--sinch-comp-toggle-shadow-knob-disabled)}:host([checked]) #knob-container>#knob{transform:translateX(20px)}:host([small][checked]) #knob-container>#knob{transform:translateX(16px)}#knob::after,#knob::before{font:var(--sinch-comp-toggle-font-size-m-inside-text);color:var(--sinch-comp-toggle-color-default-text-inside-initial);text-transform:uppercase;position:absolute;top:0;padding:0 1px;opacity:0;transition:opacity .15s ease-in-out;user-select:none}#knob::before{content:"on";content:"on"/"";right:100%}#knob::after{content:"off";content:"off"/"";left:100%}:host([labeled]:not([small]):not([checked])) #knob::after{opacity:1}:host([labeled]:not([small])[checked]) #knob::before{opacity:1}@media (prefers-reduced-motion){#knob,#knob-container,#knob::after,#knob::before{transition:none}}#outline{display:none;position:absolute;left:-3px;top:-3px;right:-3px;bottom:-3px;border:2px solid var(--sinch-comp-toggle-color-default-outline-focus);border-radius:17px;pointer-events:none}:host(:focus-visible) #outline{display:block}#label{flex:1;min-width:0;align-self:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font:var(--sinch-comp-toggle-font-size-m-label);color:var(--sinch-comp-toggle-color-default-label-initial)}#label:empty{display:none}:host([small]) #label{font:var(--sinch-comp-toggle-font-size-s-label)}:host([disabled]) #label{color:var(--sinch-comp-toggle-color-disabled-label-initial)}</style><div id="wrapper"><div id="knob-container"><div id="outline"></div><div id="knob"></div></div><span id="label"></span></div>';
|
|
5
5
|
const template = document.createElement("template");
|
|
6
6
|
template.innerHTML = templateHTML;
|
|
7
7
|
class Toggle extends NectaryElement {
|
|
8
8
|
#$label;
|
|
9
9
|
#controller = null;
|
|
10
|
+
#internals;
|
|
11
|
+
static formAssociated = true;
|
|
10
12
|
constructor() {
|
|
11
13
|
super();
|
|
12
14
|
const shadowRoot = this.attachShadow();
|
|
13
15
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
16
|
+
this.#internals = this.attachInternals();
|
|
14
17
|
this.#$label = shadowRoot.querySelector("#label");
|
|
15
18
|
}
|
|
16
19
|
connectedCallback() {
|
|
@@ -18,6 +21,9 @@ class Toggle extends NectaryElement {
|
|
|
18
21
|
const { signal } = this.#controller;
|
|
19
22
|
const options = { signal };
|
|
20
23
|
this.setAttribute("role", "checkbox");
|
|
24
|
+
this.#internals.role = "checkbox";
|
|
25
|
+
this.#syncChecked();
|
|
26
|
+
this.#syncDisabled();
|
|
21
27
|
this.addEventListener("click", this.#onClick, options);
|
|
22
28
|
this.addEventListener("keydown", this.#onKeydown, options);
|
|
23
29
|
this.addEventListener("focus", this.#onFocus, options);
|
|
@@ -50,16 +56,11 @@ class Toggle extends NectaryElement {
|
|
|
50
56
|
break;
|
|
51
57
|
}
|
|
52
58
|
case "checked": {
|
|
53
|
-
|
|
54
|
-
updateExplicitBooleanAttribute(this, "aria-checked", isChecked);
|
|
55
|
-
updateBooleanAttribute(this, name, isChecked);
|
|
59
|
+
this.#syncChecked();
|
|
56
60
|
break;
|
|
57
61
|
}
|
|
58
62
|
case "disabled": {
|
|
59
|
-
|
|
60
|
-
this.#updateTabIndex();
|
|
61
|
-
updateExplicitBooleanAttribute(this, "aria-disabled", isDisabled);
|
|
62
|
-
updateBooleanAttribute(this, name, isDisabled);
|
|
63
|
+
this.#syncDisabled();
|
|
63
64
|
break;
|
|
64
65
|
}
|
|
65
66
|
case "small":
|
|
@@ -119,6 +120,19 @@ class Toggle extends NectaryElement {
|
|
|
119
120
|
}
|
|
120
121
|
}
|
|
121
122
|
};
|
|
123
|
+
#syncChecked() {
|
|
124
|
+
const isChecked = this.checked;
|
|
125
|
+
updateExplicitBooleanAttribute(this, "aria-checked", isChecked);
|
|
126
|
+
this.#internals.ariaChecked = isChecked.toString();
|
|
127
|
+
updateBooleanAttribute(this, "checked", isChecked);
|
|
128
|
+
}
|
|
129
|
+
#syncDisabled() {
|
|
130
|
+
const isDisabled = this.disabled;
|
|
131
|
+
this.#updateTabIndex();
|
|
132
|
+
updateExplicitBooleanAttribute(this, "aria-disabled", isDisabled);
|
|
133
|
+
this.#internals.ariaDisabled = isDisabled.toString();
|
|
134
|
+
updateBooleanAttribute(this, "disabled", isDisabled);
|
|
135
|
+
}
|
|
122
136
|
#updateTabIndex() {
|
|
123
137
|
this.tabIndex = this.disabled ? -1 : 0;
|
|
124
138
|
}
|
package/toggle/types.d.ts
CHANGED
|
@@ -5,7 +5,9 @@ export type TSinchToggleProps = {
|
|
|
5
5
|
labeled?: boolean;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
text?: string;
|
|
8
|
-
|
|
8
|
+
/** Id a label's for attribute can point at */
|
|
9
|
+
id?: string;
|
|
10
|
+
'aria-label'?: string;
|
|
9
11
|
};
|
|
10
12
|
export type TSinchToggleEvents = {
|
|
11
13
|
'-change'?: (e: CustomEvent<boolean>) => void;
|
package/utils/dom.js
CHANGED
|
@@ -185,28 +185,42 @@ const composedContains = (container, node) => {
|
|
|
185
185
|
const isAttrEqual = (oldVal, newVal) => {
|
|
186
186
|
return oldVal === newVal || newVal === null && oldVal === "false" || newVal === "" && oldVal === "true";
|
|
187
187
|
};
|
|
188
|
+
const isScrollableOverflow = (value) => {
|
|
189
|
+
return value === "auto" || value === "scroll";
|
|
190
|
+
};
|
|
191
|
+
const isScrollableElement = (element) => {
|
|
192
|
+
if (element.scrollHeight <= element.clientHeight && element.scrollWidth <= element.clientWidth) {
|
|
193
|
+
return false;
|
|
194
|
+
}
|
|
195
|
+
const style = getComputedStyle(element);
|
|
196
|
+
return isScrollableOverflow(style.overflow) || isScrollableOverflow(style.overflowY) || isScrollableOverflow(style.overflowX);
|
|
197
|
+
};
|
|
198
|
+
const nextFlatTreeAncestor = (element) => {
|
|
199
|
+
const slot = element.assignedSlot;
|
|
200
|
+
if (slot != null) {
|
|
201
|
+
return slot;
|
|
202
|
+
}
|
|
203
|
+
const parent = element.parentElement;
|
|
204
|
+
if (parent != null) {
|
|
205
|
+
return parent;
|
|
206
|
+
}
|
|
207
|
+
const root = element.getRootNode();
|
|
208
|
+
if (root instanceof ShadowRoot && root.host instanceof HTMLElement) {
|
|
209
|
+
return root.host;
|
|
210
|
+
}
|
|
211
|
+
return null;
|
|
212
|
+
};
|
|
188
213
|
const getScrollableParents = (node) => {
|
|
189
214
|
const scrollableParents = [];
|
|
190
215
|
if (node == null) {
|
|
191
216
|
return scrollableParents;
|
|
192
217
|
}
|
|
193
|
-
let current = node
|
|
218
|
+
let current = node;
|
|
194
219
|
while (current != null) {
|
|
195
|
-
|
|
196
|
-
if ((current.scrollHeight > current.clientHeight || current.scrollWidth > current.clientWidth) && (computedStyle.overflow === "auto" || computedStyle.overflow === "scroll" || computedStyle.overflowY === "auto" || computedStyle.overflowY === "scroll" || computedStyle.overflowX === "auto" || computedStyle.overflowX === "scroll")) {
|
|
220
|
+
if (current !== node && isScrollableElement(current)) {
|
|
197
221
|
scrollableParents.push(current);
|
|
198
222
|
}
|
|
199
|
-
|
|
200
|
-
if (parent != null) {
|
|
201
|
-
current = parent;
|
|
202
|
-
continue;
|
|
203
|
-
}
|
|
204
|
-
const root = current.getRootNode();
|
|
205
|
-
if (root instanceof ShadowRoot && root.host instanceof HTMLElement) {
|
|
206
|
-
current = root.host;
|
|
207
|
-
continue;
|
|
208
|
-
}
|
|
209
|
-
break;
|
|
223
|
+
current = nextFlatTreeAncestor(current);
|
|
210
224
|
}
|
|
211
225
|
scrollableParents.push(document);
|
|
212
226
|
return scrollableParents;
|
|
@@ -219,33 +233,27 @@ const createScopedElement = (anchor, tag) => {
|
|
|
219
233
|
}
|
|
220
234
|
return document.createElement(tag);
|
|
221
235
|
};
|
|
236
|
+
const establishesFixedContainingBlock = (contain) => {
|
|
237
|
+
return contain.split(/\s+/).some((value) => {
|
|
238
|
+
return value === "layout" || value === "paint" || value === "content" || value === "strict";
|
|
239
|
+
});
|
|
240
|
+
};
|
|
222
241
|
const isTransformedElement = (element) => {
|
|
223
242
|
if (element == null) {
|
|
224
243
|
return false;
|
|
225
244
|
}
|
|
226
245
|
const style = getComputedStyle(element);
|
|
227
246
|
const backdropFilter = style.getPropertyValue("backdrop-filter");
|
|
228
|
-
|
|
247
|
+
const contentVisibility = style.getPropertyValue("content-visibility");
|
|
248
|
+
return style.transform !== "none" || style.perspective !== "none" || style.filter !== "none" || backdropFilter !== "" && backdropFilter !== "none" || establishesFixedContainingBlock(style.getPropertyValue("contain")) || contentVisibility === "auto" || contentVisibility === "hidden";
|
|
229
249
|
};
|
|
230
250
|
const getTransformedAncestor = (node) => {
|
|
231
251
|
let current = node;
|
|
232
252
|
while (current != null) {
|
|
233
|
-
if (current !== node) {
|
|
234
|
-
|
|
235
|
-
return current;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
const parent = current.parentElement;
|
|
239
|
-
if (parent != null) {
|
|
240
|
-
current = parent;
|
|
241
|
-
continue;
|
|
242
|
-
}
|
|
243
|
-
const root = current.getRootNode();
|
|
244
|
-
if (root instanceof ShadowRoot && root.host instanceof HTMLElement) {
|
|
245
|
-
current = root.host;
|
|
246
|
-
continue;
|
|
253
|
+
if (current !== node && isTransformedElement(current)) {
|
|
254
|
+
return current;
|
|
247
255
|
}
|
|
248
|
-
|
|
256
|
+
current = nextFlatTreeAncestor(current);
|
|
249
257
|
}
|
|
250
258
|
return null;
|
|
251
259
|
};
|