@roadtrip/components 3.33.0 → 3.33.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/cjs/loader.cjs.js +1 -1
- package/dist/cjs/road-badge_14.cjs.entry.js +89 -30
- package/dist/cjs/road-badge_14.cjs.entry.js.map +1 -1
- package/dist/cjs/road-phone-number-input.cjs.entry.js +2 -12
- package/dist/cjs/road-phone-number-input.cjs.entry.js.map +1 -1
- package/dist/cjs/roadtrip.cjs.js +1 -1
- package/dist/collection/components/drawer/drawer.css +8 -0
- package/dist/collection/components/drawer/drawer.js +1 -1
- package/dist/collection/components/drawer/drawer.js.map +1 -1
- package/dist/collection/components/input/input.js +92 -23
- package/dist/collection/components/input/input.js.map +1 -1
- package/dist/collection/components/input-group/input-group.css +10 -7
- package/dist/collection/components/input-group/input-group.js +19 -4
- package/dist/collection/components/input-group/input-group.js.map +1 -1
- package/dist/collection/components/phone-number-input/phone-number-input.js +2 -10
- package/dist/collection/components/phone-number-input/phone-number-input.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/road-badge_14.entry.js +89 -30
- package/dist/esm/road-badge_14.entry.js.map +1 -1
- package/dist/esm/road-phone-number-input.entry.js +2 -12
- package/dist/esm/road-phone-number-input.entry.js.map +1 -1
- package/dist/esm/roadtrip.js +1 -1
- package/dist/roadtrip/{p-913b72de.entry.js → p-55897254.entry.js} +3 -3
- package/dist/roadtrip/p-55897254.entry.js.map +1 -0
- package/dist/roadtrip/{p-ddfe088f.entry.js → p-950b8a43.entry.js} +2 -2
- package/dist/roadtrip/p-950b8a43.entry.js.map +1 -0
- package/dist/roadtrip/roadtrip.css +1 -1
- package/dist/roadtrip/roadtrip.esm.js +1 -1
- package/dist/roadtrip/roadtrip.esm.js.map +1 -1
- package/dist/types/components/input/input.d.ts +1 -1
- package/dist/types/components/input-group/input-group.d.ts +4 -2
- package/dist/types/components/phone-number-input/phone-number-input.d.ts +0 -1
- package/dist/types/components.d.ts +1 -0
- package/hydrate/index.js +241 -210
- package/hydrate/index.mjs +241 -210
- package/package.json +1 -1
- package/dist/collection/components/phone-number-input/constants.js +0 -3
- package/dist/collection/components/phone-number-input/constants.js.map +0 -1
- package/dist/roadtrip/p-913b72de.entry.js.map +0 -1
- package/dist/roadtrip/p-ddfe088f.entry.js.map +0 -1
- package/dist/types/components/phone-number-input/constants.d.ts +0 -1
package/hydrate/index.mjs
CHANGED
|
@@ -127,7 +127,7 @@ const NAMESPACE = 'roadtrip';
|
|
|
127
127
|
const BUILD = /* roadtrip */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, attachStyles: true, cloneNodeFix: false, constructableCSS: false, cssAnnotations: true, devTools: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: true, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: true, hydrateServerSide: true, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, scoped: true, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, shadowDomShim: true, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: true, taskQueue: true, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true };
|
|
128
128
|
|
|
129
129
|
/*
|
|
130
|
-
Stencil Hydrate Platform v4.27.
|
|
130
|
+
Stencil Hydrate Platform v4.27.0 | MIT Licensed | https://stenciljs.com
|
|
131
131
|
*/
|
|
132
132
|
var __defProp = Object.defineProperty;
|
|
133
133
|
var __export = (target, all) => {
|
|
@@ -147,9 +147,9 @@ var isComplexType = (o) => {
|
|
|
147
147
|
};
|
|
148
148
|
|
|
149
149
|
// src/utils/query-nonce-meta-tag-content.ts
|
|
150
|
-
function queryNonceMetaTagContent(
|
|
150
|
+
function queryNonceMetaTagContent(doc2) {
|
|
151
151
|
var _a, _b, _c;
|
|
152
|
-
return (_c = (_b = (_a =
|
|
152
|
+
return (_c = (_b = (_a = doc2.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
// src/utils/regular-expression.ts
|
|
@@ -506,8 +506,8 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
506
506
|
delete hostElm["s-sc"];
|
|
507
507
|
}
|
|
508
508
|
}
|
|
509
|
-
if (
|
|
510
|
-
initializeDocumentHydrate(
|
|
509
|
+
if (!plt.$orgLocNodes$ || !plt.$orgLocNodes$.size) {
|
|
510
|
+
initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
|
|
511
511
|
}
|
|
512
512
|
hostElm[HYDRATE_ID] = hostId;
|
|
513
513
|
hostElm.removeAttribute(HYDRATE_ID);
|
|
@@ -830,8 +830,8 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
|
|
|
830
830
|
childVNode.$name$ = slotName || null;
|
|
831
831
|
childVNode.$tag$ = "slot";
|
|
832
832
|
const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
|
|
833
|
-
if (shadowRootNodes
|
|
834
|
-
const slot = childVNode.$elm$ =
|
|
833
|
+
if (shadowRootNodes) {
|
|
834
|
+
const slot = childVNode.$elm$ = doc.createElement(childVNode.$tag$);
|
|
835
835
|
if (childVNode.$name$) {
|
|
836
836
|
childVNode.$elm$.setAttribute("name", slotName);
|
|
837
837
|
}
|
|
@@ -1275,10 +1275,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
1275
1275
|
var _a;
|
|
1276
1276
|
const scopeId2 = getScopeId(cmpMeta);
|
|
1277
1277
|
const style = styles$1.get(scopeId2);
|
|
1278
|
-
|
|
1279
|
-
return scopeId2;
|
|
1280
|
-
}
|
|
1281
|
-
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
|
|
1278
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
1282
1279
|
if (style) {
|
|
1283
1280
|
if (typeof style === "string") {
|
|
1284
1281
|
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
@@ -1291,9 +1288,9 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
1291
1288
|
if (styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
1292
1289
|
styleElm.innerHTML = style;
|
|
1293
1290
|
} else {
|
|
1294
|
-
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) ||
|
|
1291
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
|
|
1295
1292
|
styleElm.innerHTML = style;
|
|
1296
|
-
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(
|
|
1293
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
|
1297
1294
|
if (nonce != null) {
|
|
1298
1295
|
styleElm.setAttribute("nonce", nonce);
|
|
1299
1296
|
}
|
|
@@ -1543,7 +1540,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
1543
1540
|
}
|
|
1544
1541
|
}
|
|
1545
1542
|
if (newVNode2.$text$ !== null) {
|
|
1546
|
-
elm = newVNode2.$elm$ =
|
|
1543
|
+
elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
|
|
1547
1544
|
} else if (newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
1548
1545
|
elm = newVNode2.$elm$ = slotReferenceDebugNode(newVNode2) ;
|
|
1549
1546
|
{
|
|
@@ -1553,12 +1550,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
1553
1550
|
if (!isSvgMode) {
|
|
1554
1551
|
isSvgMode = newVNode2.$tag$ === "svg";
|
|
1555
1552
|
}
|
|
1556
|
-
|
|
1557
|
-
throw new Error(
|
|
1558
|
-
"You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component."
|
|
1559
|
-
);
|
|
1560
|
-
}
|
|
1561
|
-
elm = newVNode2.$elm$ = win.document.createElementNS(
|
|
1553
|
+
elm = newVNode2.$elm$ = doc.createElementNS(
|
|
1562
1554
|
isSvgMode ? SVG_NS : HTML_NS,
|
|
1563
1555
|
!useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
1564
1556
|
) ;
|
|
@@ -1940,7 +1932,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1940
1932
|
markSlotContentForRelocation(rootVnode.$elm$);
|
|
1941
1933
|
for (const relocateData of relocateNodes) {
|
|
1942
1934
|
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1943
|
-
if (!nodeToRelocate["s-ol"]
|
|
1935
|
+
if (!nodeToRelocate["s-ol"]) {
|
|
1944
1936
|
const orgLocationNode = originalLocationDebugNode(nodeToRelocate) ;
|
|
1945
1937
|
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
1946
1938
|
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
@@ -1984,18 +1976,12 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1984
1976
|
}
|
|
1985
1977
|
contentRef = void 0;
|
|
1986
1978
|
};
|
|
1987
|
-
var slotReferenceDebugNode = (slotVNode) =>
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
)
|
|
1992
|
-
|
|
1993
|
-
var originalLocationDebugNode = (nodeToRelocate) => {
|
|
1994
|
-
var _a;
|
|
1995
|
-
return (_a = win.document) == null ? void 0 : _a.createComment(
|
|
1996
|
-
`org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate["s-hn"]})` : `[${nodeToRelocate.textContent}]`)
|
|
1997
|
-
);
|
|
1998
|
-
};
|
|
1979
|
+
var slotReferenceDebugNode = (slotVNode) => doc.createComment(
|
|
1980
|
+
`<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ""}> (host=${hostTagName.toLowerCase()})`
|
|
1981
|
+
);
|
|
1982
|
+
var originalLocationDebugNode = (nodeToRelocate) => doc.createComment(
|
|
1983
|
+
`org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate["s-hn"]})` : `[${nodeToRelocate.textContent}]`)
|
|
1984
|
+
);
|
|
1999
1985
|
|
|
2000
1986
|
// src/runtime/update-component.ts
|
|
2001
1987
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
@@ -2192,7 +2178,7 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2192
2178
|
const hostRef = getHostRef(ref);
|
|
2193
2179
|
if (!hostRef) {
|
|
2194
2180
|
throw new Error(
|
|
2195
|
-
`Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/
|
|
2181
|
+
`Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`
|
|
2196
2182
|
);
|
|
2197
2183
|
}
|
|
2198
2184
|
const elm = hostRef.$hostElement$ ;
|
|
@@ -2496,19 +2482,16 @@ var connectedCallback = (elm) => {
|
|
|
2496
2482
|
}
|
|
2497
2483
|
};
|
|
2498
2484
|
var setContentReference = (elm) => {
|
|
2499
|
-
|
|
2500
|
-
return;
|
|
2501
|
-
}
|
|
2502
|
-
const contentRefElm = elm["s-cr"] = win.document.createComment(
|
|
2485
|
+
const contentRefElm = elm["s-cr"] = doc.createComment(
|
|
2503
2486
|
""
|
|
2504
2487
|
);
|
|
2505
2488
|
contentRefElm["s-cn"] = true;
|
|
2506
2489
|
insertBefore(elm, contentRefElm, elm.firstChild);
|
|
2507
2490
|
};
|
|
2508
2491
|
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
2509
|
-
if (listeners
|
|
2492
|
+
if (listeners) {
|
|
2510
2493
|
listeners.map(([flags, name, method]) => {
|
|
2511
|
-
const target = getHostListenerTarget(
|
|
2494
|
+
const target = getHostListenerTarget(elm, flags) ;
|
|
2512
2495
|
const handler = hostListenerProxy(hostRef, method);
|
|
2513
2496
|
const opts = hostListenerOpts(flags);
|
|
2514
2497
|
plt.ael(target, name, handler, opts);
|
|
@@ -2530,24 +2513,20 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
2530
2513
|
consoleError(e, hostRef.$hostElement$);
|
|
2531
2514
|
}
|
|
2532
2515
|
};
|
|
2533
|
-
var getHostListenerTarget = (
|
|
2534
|
-
if (flags & 4 /* TargetDocument */)
|
|
2535
|
-
|
|
2536
|
-
}
|
|
2537
|
-
if (flags & 8 /* TargetWindow */) {
|
|
2538
|
-
return win;
|
|
2539
|
-
}
|
|
2516
|
+
var getHostListenerTarget = (elm, flags) => {
|
|
2517
|
+
if (flags & 4 /* TargetDocument */) return doc;
|
|
2518
|
+
if (flags & 8 /* TargetWindow */) return win;
|
|
2540
2519
|
return elm;
|
|
2541
2520
|
};
|
|
2542
2521
|
var hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
2543
2522
|
|
|
2544
2523
|
// src/runtime/vdom/vdom-annotations.ts
|
|
2545
|
-
var insertVdomAnnotations = (
|
|
2546
|
-
if (
|
|
2547
|
-
const docData = STENCIL_DOC_DATA in
|
|
2524
|
+
var insertVdomAnnotations = (doc2, staticComponents) => {
|
|
2525
|
+
if (doc2 != null) {
|
|
2526
|
+
const docData = STENCIL_DOC_DATA in doc2 ? doc2[STENCIL_DOC_DATA] : { ...DEFAULT_DOC_DATA };
|
|
2548
2527
|
docData.staticComponents = new Set(staticComponents);
|
|
2549
2528
|
const orgLocationNodes = [];
|
|
2550
|
-
parseVNodeAnnotations(
|
|
2529
|
+
parseVNodeAnnotations(doc2, doc2.body, docData, orgLocationNodes);
|
|
2551
2530
|
orgLocationNodes.forEach((orgLocationNode) => {
|
|
2552
2531
|
var _a;
|
|
2553
2532
|
if (orgLocationNode != null && orgLocationNode["s-nr"]) {
|
|
@@ -2573,11 +2552,11 @@ var insertVdomAnnotations = (doc, staticComponents) => {
|
|
|
2573
2552
|
return;
|
|
2574
2553
|
}
|
|
2575
2554
|
}
|
|
2576
|
-
const commentBeforeTextNode =
|
|
2555
|
+
const commentBeforeTextNode = doc2.createComment(childId);
|
|
2577
2556
|
commentBeforeTextNode.nodeValue = `${TEXT_NODE_ID}.${childId}`;
|
|
2578
2557
|
insertBefore(nodeRef.parentNode, commentBeforeTextNode, nodeRef);
|
|
2579
2558
|
} else if (nodeRef.nodeType === 8 /* CommentNode */) {
|
|
2580
|
-
const commentBeforeTextNode =
|
|
2559
|
+
const commentBeforeTextNode = doc2.createComment(childId);
|
|
2581
2560
|
commentBeforeTextNode.nodeValue = `${COMMENT_NODE_ID}.${childId}`;
|
|
2582
2561
|
nodeRef.parentNode.insertBefore(commentBeforeTextNode, nodeRef);
|
|
2583
2562
|
}
|
|
@@ -2596,7 +2575,7 @@ var insertVdomAnnotations = (doc, staticComponents) => {
|
|
|
2596
2575
|
});
|
|
2597
2576
|
}
|
|
2598
2577
|
};
|
|
2599
|
-
var parseVNodeAnnotations = (
|
|
2578
|
+
var parseVNodeAnnotations = (doc2, node, docData, orgLocationNodes) => {
|
|
2600
2579
|
var _a;
|
|
2601
2580
|
if (node == null) {
|
|
2602
2581
|
return;
|
|
@@ -2612,13 +2591,13 @@ var parseVNodeAnnotations = (doc, node, docData, orgLocationNodes) => {
|
|
|
2612
2591
|
const cmpData = {
|
|
2613
2592
|
nodeIds: 0
|
|
2614
2593
|
};
|
|
2615
|
-
insertVNodeAnnotations(
|
|
2594
|
+
insertVNodeAnnotations(doc2, childNode, hostRef.$vnode$, docData, cmpData);
|
|
2616
2595
|
}
|
|
2617
|
-
parseVNodeAnnotations(
|
|
2596
|
+
parseVNodeAnnotations(doc2, childNode, docData, orgLocationNodes);
|
|
2618
2597
|
});
|
|
2619
2598
|
}
|
|
2620
2599
|
};
|
|
2621
|
-
var insertVNodeAnnotations = (
|
|
2600
|
+
var insertVNodeAnnotations = (doc2, hostElm, vnode, docData, cmpData) => {
|
|
2622
2601
|
if (vnode != null) {
|
|
2623
2602
|
const hostId = ++docData.hostIds;
|
|
2624
2603
|
hostElm.setAttribute(HYDRATE_ID, hostId);
|
|
@@ -2628,7 +2607,7 @@ var insertVNodeAnnotations = (doc, hostElm, vnode, docData, cmpData) => {
|
|
|
2628
2607
|
if (vnode.$children$ != null) {
|
|
2629
2608
|
const depth = 0;
|
|
2630
2609
|
vnode.$children$.forEach((vnodeChild, index) => {
|
|
2631
|
-
insertChildVNodeAnnotations(
|
|
2610
|
+
insertChildVNodeAnnotations(doc2, vnodeChild, cmpData, hostId, depth, index);
|
|
2632
2611
|
});
|
|
2633
2612
|
}
|
|
2634
2613
|
if (hostElm && vnode && vnode.$elm$ && !hostElm.hasAttribute(HYDRATE_CHILD_ID)) {
|
|
@@ -2649,7 +2628,7 @@ var insertVNodeAnnotations = (doc, hostElm, vnode, docData, cmpData) => {
|
|
|
2649
2628
|
}
|
|
2650
2629
|
}
|
|
2651
2630
|
};
|
|
2652
|
-
var insertChildVNodeAnnotations = (
|
|
2631
|
+
var insertChildVNodeAnnotations = (doc2, vnodeChild, cmpData, hostId, depth, index) => {
|
|
2653
2632
|
const childElm = vnodeChild.$elm$;
|
|
2654
2633
|
if (childElm == null) {
|
|
2655
2634
|
return;
|
|
@@ -2668,7 +2647,7 @@ var insertChildVNodeAnnotations = (doc, vnodeChild, cmpData, hostId, depth, inde
|
|
|
2668
2647
|
const nodeName = parentNode == null ? void 0 : parentNode.nodeName;
|
|
2669
2648
|
if (nodeName !== "STYLE" && nodeName !== "SCRIPT") {
|
|
2670
2649
|
const textNodeId = `${TEXT_NODE_ID}.${childId}`;
|
|
2671
|
-
const commentBeforeTextNode =
|
|
2650
|
+
const commentBeforeTextNode = doc2.createComment(textNodeId);
|
|
2672
2651
|
insertBefore(parentNode, commentBeforeTextNode, childElm);
|
|
2673
2652
|
}
|
|
2674
2653
|
} else if (childElm.nodeType === 8 /* CommentNode */) {
|
|
@@ -2681,7 +2660,7 @@ var insertChildVNodeAnnotations = (doc, vnodeChild, cmpData, hostId, depth, inde
|
|
|
2681
2660
|
if (vnodeChild.$children$ != null) {
|
|
2682
2661
|
const childDepth = depth + 1;
|
|
2683
2662
|
vnodeChild.$children$.forEach((vnode, index2) => {
|
|
2684
|
-
insertChildVNodeAnnotations(
|
|
2663
|
+
insertChildVNodeAnnotations(doc2, vnode, cmpData, hostId, childDepth, index2);
|
|
2685
2664
|
});
|
|
2686
2665
|
}
|
|
2687
2666
|
};
|
|
@@ -2897,7 +2876,7 @@ function hydrateApp(win2, opts, results, afterHydrate, resolve) {
|
|
|
2897
2876
|
return elm;
|
|
2898
2877
|
};
|
|
2899
2878
|
tmrId = globalThis.setTimeout(timeoutExceeded, opts.timeout);
|
|
2900
|
-
plt.$resourcesUrl$ = new URL(opts.resourcesUrl || "./",
|
|
2879
|
+
plt.$resourcesUrl$ = new URL(opts.resourcesUrl || "./", doc.baseURI).href;
|
|
2901
2880
|
patchChild2(win2.document.body);
|
|
2902
2881
|
waitLoop2().then(hydratedComplete).catch(hydratedError);
|
|
2903
2882
|
} catch (e) {
|
|
@@ -3104,6 +3083,7 @@ var registerComponents = (Cstrs) => {
|
|
|
3104
3083
|
}
|
|
3105
3084
|
};
|
|
3106
3085
|
var win = window;
|
|
3086
|
+
var doc = win.document;
|
|
3107
3087
|
var writeTask = (cb) => {
|
|
3108
3088
|
nextTick$1(() => {
|
|
3109
3089
|
try {
|
|
@@ -11231,7 +11211,7 @@ class Dialog {
|
|
|
11231
11211
|
}; }
|
|
11232
11212
|
}
|
|
11233
11213
|
|
|
11234
|
-
const drawerCss = ":host{--background:var(--road-surface);--color:var(--road-on-surface);--header-icon:var(--road-on-surface);--header-color:var(--road-on-surface);--header-background:var(--road-surface);--header-delimiter:0;--back-chevron-color:var(--road-icon);--max-height:auto;--z-index:10;position:fixed;top:0;left:0;z-index:var(--z-index);display:flex;justify-content:flex-start;width:100%;height:100%;overflow:hidden;font-family:var(--road-font, sans-serif);line-height:1.5;color:var(--color);visibility:hidden !important;opacity:0;transition:opacity 0.15s linear, visibility 0.15s}.drawer-overlay{position:absolute;top:0;right:0;bottom:0;left:0;display:block;touch-action:none;cursor:pointer;background:var(--road-overlay)}.drawer-dialog{position:relative;width:100%;pointer-events:none;transition:transform 0.3s ease-out;transform:translateX(-100%)}:host(.drawer-right){justify-content:flex-end}:host(.drawer-right) .drawer-dialog{transform:translateX(100%)}:host(.drawer-bottom){align-items:flex-end}:host(.drawer-bottom) .drawer-dialog{width:100%;max-height:var(--max-height);transform:translateY(100%)}:host(.drawer-bottom) .drawer-content{height:auto}.drawer-content{position:relative;display:flex;flex-direction:column;width:100%;height:100vh;pointer-events:auto;background-color:var(--background);background-clip:padding-box;box-shadow:var(--road-elevation-hight)}.drawer-header{display:flex;flex-shrink:0;align-items:center;justify-content:flex-end;height:3.5rem;color:var(--header-color);background:var(--header-background);border-color:var(--road-grey-300);border-style:solid;border-width:var(--header-delimiter)}.drawer-header road-icon{flex-shrink:0;color:var(--header-icon)}.drawer-footer{padding:var(--road-spacing-05);background-color:var(--road-surface)}.drawer-header-inverse{--header-icon:var(--road-on-primary);--header-color:var(--road-on-primary);--header-background:var(--road-primary-variant);margin-bottom:2.5rem}.drawer-action,.drawer-close{display:flex;align-items:center;justify-content:center;height:3.5rem;padding:0.5rem;font-family:inherit;font-size:0.875rem;color:inherit;cursor:pointer;background:transparent;border:0;appearance:none;-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}.drawer-header:not(.drawer-header-inverse) .drawer-action road-icon{color:var(--back-chevron-color)}.drawer-action~.drawer-title,.drawer-close~.drawer-title{padding-left:0}.drawer-action-left,.drawer-close-left{margin-right:auto}.drawer-title{display:flex;flex-grow:1;align-items:center;justify-content:center;height:3.5rem;padding-left:3.5rem;margin:0;font-size:var(--road-body-medium)}.drawer-body{overflow-y:auto;padding:0 var(--road-spacing-05) var(--road-spacing-05)}.drawer-body.remove-padding{padding:0}:host(.drawer-right) .drawer-body,:host(.drawer-left) .drawer-body{height:calc(100vh - 3.5rem)}.drawer-inner{padding:0 1rem 2.5rem}@media (min-width: 768px){.drawer-inner{padding:0 2rem 2.5rem}.drawer-body{padding:0 var(--road-spacing-08) var(--road-spacing-05)}.drawer-body.remove-padding{padding:0}.drawer-footer{padding:var(--road-spacing-05) var(--road-spacing-08)}}:host(.drawer-open){visibility:visible !important;opacity:1}:host(.drawer-open) .drawer-dialog{transform:none}";
|
|
11214
|
+
const drawerCss = ":host{--background:var(--road-surface);--color:var(--road-on-surface);--header-icon:var(--road-on-surface);--header-color:var(--road-on-surface);--header-background:var(--road-surface);--header-delimiter:0;--back-chevron-color:var(--road-icon);--max-height:auto;--z-index:10;position:fixed;top:0;left:0;z-index:var(--z-index);display:flex;justify-content:flex-start;width:100%;height:100%;overflow:hidden;font-family:var(--road-font, sans-serif);line-height:1.5;color:var(--color);visibility:hidden !important;opacity:0;transition:opacity 0.15s linear, visibility 0.15s}.drawer-overlay{position:absolute;top:0;right:0;bottom:0;left:0;display:block;touch-action:none;cursor:pointer;background:var(--road-overlay)}.drawer-dialog{position:relative;width:100%;pointer-events:none;transition:transform 0.3s ease-out;transform:translateX(-100%)}:host(.drawer-right){justify-content:flex-end}:host(.drawer-right) .drawer-dialog{transform:translateX(100%)}:host(.drawer-bottom){align-items:flex-end}:host(.drawer-bottom) .drawer-dialog{width:100%;max-height:var(--max-height);transform:translateY(100%)}:host(.drawer-bottom) .drawer-content{height:auto}.drawer-content{position:relative;display:flex;flex-direction:column;width:100%;height:100vh;pointer-events:auto;background-color:var(--background);background-clip:padding-box;box-shadow:var(--road-elevation-hight)}.drawer-header{display:flex;flex-shrink:0;align-items:center;justify-content:flex-end;height:3.5rem;color:var(--header-color);background:var(--header-background);border-color:var(--road-grey-300);border-style:solid;border-width:var(--header-delimiter)}.drawer-header road-icon{flex-shrink:0;color:var(--header-icon)}.drawer-footer{padding:var(--road-spacing-05);background-color:var(--road-surface)}.drawer-footer.remove-padding{padding:0}.drawer-header-inverse{--header-icon:var(--road-on-primary);--header-color:var(--road-on-primary);--header-background:var(--road-primary-variant);margin-bottom:2.5rem}.drawer-action,.drawer-close{display:flex;align-items:center;justify-content:center;height:3.5rem;padding:0.5rem;font-family:inherit;font-size:0.875rem;color:inherit;cursor:pointer;background:transparent;border:0;appearance:none;-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}.drawer-header:not(.drawer-header-inverse) .drawer-action road-icon{color:var(--back-chevron-color)}.drawer-action~.drawer-title,.drawer-close~.drawer-title{padding-left:0}.drawer-action-left,.drawer-close-left{margin-right:auto}.drawer-title{display:flex;flex-grow:1;align-items:center;justify-content:center;height:3.5rem;padding-left:3.5rem;margin:0;font-size:var(--road-body-medium)}.drawer-body{overflow-y:auto;padding:0 var(--road-spacing-05) var(--road-spacing-05)}.drawer-body.remove-padding{padding:0}:host(.drawer-right) .drawer-body,:host(.drawer-left) .drawer-body{height:calc(100vh - 3.5rem)}.drawer-inner{padding:0 1rem 2.5rem}@media (min-width: 768px){.drawer-inner{padding:0 2rem 2.5rem}.drawer-body{padding:0 var(--road-spacing-08) var(--road-spacing-05)}.drawer-body.remove-padding{padding:0}.drawer-footer{padding:var(--road-spacing-05) var(--road-spacing-08)}.drawer-footer.remove-padding{padding:0}}:host(.drawer-open){visibility:visible !important;opacity:1}:host(.drawer-open) .drawer-dialog{transform:none}";
|
|
11235
11215
|
var RoadDrawerStyle0 = drawerCss;
|
|
11236
11216
|
|
|
11237
11217
|
/**
|
|
@@ -11374,7 +11354,7 @@ class Drawer {
|
|
|
11374
11354
|
const backIconElement = this.hasBackIcon ? (hAsync("button", { type: "button", class: "drawer-action", "aria-label": ariaLabelBack, onClick: this.onClickBack }, hAsync("road-icon", { icon: navigationChevron, rotate: "180" }), this.backText)) : null;
|
|
11375
11355
|
const closeIconElement = this.hasCloseIcon ? (hAsync("button", { type: "button", class: "drawer-close", onClick: this.onClick, "aria-label": ariaLabelClose }, hAsync("road-icon", { icon: navigationClose, "aria-hidden": "true" }))) : null;
|
|
11376
11356
|
const drawerWidthValue = this.position === 'bottom' ? '100%' : `${this.drawerWidth}px`;
|
|
11377
|
-
return (hAsync(Host, { key: '
|
|
11357
|
+
return (hAsync(Host, { key: '803e9ce30d1511c6714bcf3eae6cf482ab910483', class: `${drawerIsOpenClass} drawer-${this.position}`, tabindex: "0", role: "dialog", "aria-label": ariaLabel }, hAsync("div", { key: 'e57c395fee5c6f507623221567aa8944225e077f', class: "drawer-overlay", onClick: this.onClick, tabindex: "-1" }), hAsync("div", { key: '13d65e0346da78e8d305e8ec367e1a425a64df42', class: "drawer-dialog", style: { maxWidth: drawerWidthValue }, role: "document", tabindex: "0" }, hAsync("div", { key: '3a9b0175243b9a330155a26155e19f288822a2ea', class: "drawer-content" }, hAsync("header", { key: '22f1f8fece85ce1e1d998b876fd83c7854c59ac1', class: `drawer-header ${inverseHeaderClass} ${drawerDelimiterClass}` }, backIconElement, this.drawerTitle ? (hAsync("h2", { class: "drawer-title" }, this.drawerTitle)) : (hAsync("div", { class: "drawer-title" }, hAsync("slot", { name: "title" }))), closeIconElement), hAsync("div", { key: '8d4c6ce1183733fbb7b22e96e2c8cd81c687cf3a', class: `drawer-body ${removePaddingClass}` }, hAsync("slot", { key: 'd8185e9a322bd64833b6ce2ce57807ce27a75dbd' })), hAsync("footer", { key: '8c3345df320d569fe9b8472faba3f4204750c903', class: `drawer-footer ${removePaddingClass}` }, hAsync("slot", { key: '716055f5fc9792510ed43f77cbd81f9b2a039002', name: "footer" }))))));
|
|
11378
11358
|
}
|
|
11379
11359
|
get el() { return getElement(this); }
|
|
11380
11360
|
static get watchers() { return {
|
|
@@ -29474,24 +29454,58 @@ class Input {
|
|
|
29474
29454
|
const input = ev.target;
|
|
29475
29455
|
let newValue = input.value;
|
|
29476
29456
|
if (this.type === 'number' && this.blockdecimal) {
|
|
29477
|
-
newValue = newValue.replace(/[.,]/g, ''); // Supprime les décimales si
|
|
29457
|
+
newValue = newValue.replace(/[.,]/g, ''); // Supprime les décimales si `blockdecimal` est activé
|
|
29458
|
+
}
|
|
29459
|
+
// Convertir en nombre et ajuster selon min/max
|
|
29460
|
+
let numericValue = parseFloat(newValue);
|
|
29461
|
+
const minValue = this.min !== undefined ? parseFloat(this.min) : undefined;
|
|
29462
|
+
const maxValue = this.max !== undefined ? parseFloat(this.max) : undefined;
|
|
29463
|
+
if (!isNaN(numericValue)) {
|
|
29464
|
+
if (minValue !== undefined && numericValue < minValue) {
|
|
29465
|
+
numericValue = minValue;
|
|
29466
|
+
}
|
|
29467
|
+
if (maxValue !== undefined && numericValue > maxValue) {
|
|
29468
|
+
numericValue = maxValue;
|
|
29469
|
+
}
|
|
29470
|
+
newValue = numericValue.toString();
|
|
29471
|
+
}
|
|
29472
|
+
if (this.type === 'number') {
|
|
29473
|
+
this.value = newValue;
|
|
29474
|
+
input.value = newValue; // Mise à jour immédiate du champ
|
|
29475
|
+
}
|
|
29476
|
+
else {
|
|
29477
|
+
this.value = newValue;
|
|
29478
29478
|
}
|
|
29479
|
-
this.value = newValue;
|
|
29480
29479
|
this.roadInput.emit(ev);
|
|
29481
29480
|
this.roadChange.emit({ value: newValue });
|
|
29481
|
+
// Appeler enforceMinMaxValue à chaque modification de la valeur
|
|
29482
|
+
this.enforceMinMaxValue();
|
|
29482
29483
|
};
|
|
29483
29484
|
this.onBlur = () => {
|
|
29484
29485
|
let value = this.getValue();
|
|
29485
|
-
|
|
29486
|
-
|
|
29487
|
-
|
|
29486
|
+
const minValue = this.min !== undefined ? parseFloat(this.min) : undefined;
|
|
29487
|
+
const maxValue = this.max !== undefined ? parseFloat(this.max) : undefined;
|
|
29488
|
+
let numericValue = parseFloat(value);
|
|
29489
|
+
if (!isNaN(numericValue)) {
|
|
29490
|
+
if (minValue !== undefined && numericValue < minValue) {
|
|
29491
|
+
numericValue = minValue;
|
|
29492
|
+
}
|
|
29493
|
+
if (maxValue !== undefined && numericValue > maxValue) {
|
|
29494
|
+
numericValue = maxValue;
|
|
29495
|
+
}
|
|
29496
|
+
value = numericValue.toString();
|
|
29497
|
+
}
|
|
29498
|
+
if (this.type === 'number') {
|
|
29499
|
+
this.value = value;
|
|
29500
|
+
const input = document.getElementById(this.inputId);
|
|
29501
|
+
input.value = value;
|
|
29488
29502
|
}
|
|
29489
|
-
|
|
29490
|
-
value =
|
|
29503
|
+
else {
|
|
29504
|
+
this.value = value;
|
|
29491
29505
|
}
|
|
29492
|
-
this.value = value; // Mettre à jour la valeur avec la valeur ajustée
|
|
29493
|
-
// Émettre l'événement roadblur avec la valeur ajustée
|
|
29494
29506
|
this.roadBlur.emit(value);
|
|
29507
|
+
// Appeler enforceMinMaxValue lors de la perte de focus
|
|
29508
|
+
this.enforceMinMaxValue();
|
|
29495
29509
|
};
|
|
29496
29510
|
this.onFocus = () => {
|
|
29497
29511
|
this.roadFocus.emit();
|
|
@@ -29519,25 +29533,35 @@ class Input {
|
|
|
29519
29533
|
*/
|
|
29520
29534
|
valueChanged() {
|
|
29521
29535
|
this.debouncedRoadChange(this.value);
|
|
29536
|
+
// Appeler enforceMinMaxValue après chaque changement de valeur
|
|
29537
|
+
this.enforceMinMaxValue();
|
|
29538
|
+
}
|
|
29539
|
+
async enforceMinMaxValue() {
|
|
29540
|
+
let value = this.getValue();
|
|
29541
|
+
const minValue = this.min !== undefined ? parseFloat(this.min) : undefined;
|
|
29542
|
+
const maxValue = this.max !== undefined ? parseFloat(this.max) : undefined;
|
|
29543
|
+
let numericValue = parseFloat(value);
|
|
29544
|
+
if (!isNaN(numericValue)) {
|
|
29545
|
+
if (minValue !== undefined && numericValue < minValue) {
|
|
29546
|
+
numericValue = minValue;
|
|
29547
|
+
}
|
|
29548
|
+
if (maxValue !== undefined && numericValue > maxValue) {
|
|
29549
|
+
numericValue = maxValue;
|
|
29550
|
+
}
|
|
29551
|
+
value = numericValue.toString();
|
|
29552
|
+
}
|
|
29553
|
+
if (this.type === 'number') {
|
|
29554
|
+
this.value = value;
|
|
29555
|
+
const input = document.getElementById(this.inputId);
|
|
29556
|
+
input.value = value;
|
|
29557
|
+
}
|
|
29558
|
+
this.roadChange.emit({ value });
|
|
29522
29559
|
}
|
|
29523
29560
|
getValue() {
|
|
29524
29561
|
return typeof this.value === 'number'
|
|
29525
29562
|
? this.value.toString()
|
|
29526
29563
|
: (this.value || '').toString();
|
|
29527
29564
|
}
|
|
29528
|
-
enforceMinMax(el) {
|
|
29529
|
-
if (el.value !== "") {
|
|
29530
|
-
const value = parseInt(el.value);
|
|
29531
|
-
const minValue = parseInt(el.min);
|
|
29532
|
-
const maxValue = parseInt(el.max);
|
|
29533
|
-
if (value < minValue) {
|
|
29534
|
-
el.value = el.min;
|
|
29535
|
-
}
|
|
29536
|
-
if (value > maxValue) {
|
|
29537
|
-
el.value = el.max;
|
|
29538
|
-
}
|
|
29539
|
-
}
|
|
29540
|
-
}
|
|
29541
29565
|
componentWillLoad() {
|
|
29542
29566
|
this.debounceChanged(); // Initialize debounce on component load
|
|
29543
29567
|
}
|
|
@@ -29547,7 +29571,7 @@ class Input {
|
|
|
29547
29571
|
const hasValueClass = this.value !== '' && this.value !== null ? 'has-value' : '';
|
|
29548
29572
|
const lessLabelClass = this.label !== '' ? '' : 'less-label';
|
|
29549
29573
|
const isInvalidClass = this.error !== undefined && this.error !== '' ? 'is-invalid' : '';
|
|
29550
|
-
return (hAsync(Host, { key: '
|
|
29574
|
+
return (hAsync(Host, { key: '5f6b006c06d7a18796cc0074a2200c47a529fbc5', "aria-disabled": this.disabled ? 'true' : null, class: this.sizes && `input-${this.sizes}`, value: value, blockdecimal: this.blockdecimal }, hAsync("input", { key: 'c83b3eed22f085e0c5d9c9474730da06c0ddc6d6', class: `form-control ${hasValueClass} ${isInvalidClass} ${lessLabelClass}`, id: this.inputId, "aria-disabled": this.disabled ? 'true' : null, "aria-labelledby": labelId, disabled: this.disabled, autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, enterKeyHint: this.enterkeyhint, autoFocus: this.autofocus, inputMode: this.inputmode, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, name: this.name, pattern: this.pattern, placeholder: this.placeholder, readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, step: this.step, size: this.size, type: this.type, value: value, onInput: this.onInput, onBlur: this.onBlur, onFocus: this.onFocus, onKeyDown: this.type === 'number' ? (event) => this.handleKeyDown(event) : undefined, "data-cy": 'road-input' }), hAsync("label", { key: '0570cdc0f7ec67a2569d0b2187914cb7591b9235', class: "form-label", id: labelId, htmlFor: this.inputId }, this.label), this.error && this.error !== '' && hAsync("p", { key: '4101c4759d90207af1ef234b298fb666ecce590d', class: "invalid-feedback" }, hAsync("road-icon", { key: '6e0aa0da85a06ced4c32b0fff2909e55122b68f9', slot: "start", name: "alert-error-solid", "aria-hidden": "true", size: "sm" }), this.error), this.helper && this.helper !== '' && hAsync("p", { key: '573cb5971b2a3cb6dc5496bb839036445c238fba', class: "helper" }, this.helper), this.type && this.type == 'password' && hAsync("slot", { key: 'e91164c69cb2c110edddbc1b755a8a6df1c86894', name: "checklistPassword" })));
|
|
29551
29575
|
}
|
|
29552
29576
|
static get watchers() { return {
|
|
29553
29577
|
"debounce": ["debounceChanged"],
|
|
@@ -29585,7 +29609,8 @@ class Input {
|
|
|
29585
29609
|
"label": [1],
|
|
29586
29610
|
"error": [1],
|
|
29587
29611
|
"helper": [1],
|
|
29588
|
-
"debounce": [2]
|
|
29612
|
+
"debounce": [2],
|
|
29613
|
+
"enforceMinMaxValue": [64]
|
|
29589
29614
|
},
|
|
29590
29615
|
"$listeners$": undefined,
|
|
29591
29616
|
"$lazyBundleId$": "-",
|
|
@@ -29594,7 +29619,7 @@ class Input {
|
|
|
29594
29619
|
}
|
|
29595
29620
|
let inputIds = 0;
|
|
29596
29621
|
|
|
29597
|
-
const inputGroupCss = ":host{display:block}.input-group{position:relative;display:flex;flex-wrap:wrap;align-items:stretch;width:100%;font-family:var(--road-font, sans-serif)}::slotted(road-input),::slotted(input),::slotted(textarea),::slotted(road-select){position:relative;flex:1 1 auto;width:1%;margin-bottom:0}::slotted([slot=\"prepend\"]){margin-right:-3px;border-color:var(--road-input-outline);border-
|
|
29622
|
+
const inputGroupCss = ":host{display:block}.input-group{position:relative;display:flex;flex-wrap:wrap;align-items:stretch;width:100%;font-family:var(--road-font, sans-serif)}::slotted(road-input),::slotted(input),::slotted(textarea),::slotted(road-select){position:relative;flex:1 1 auto;width:1%;margin-bottom:0}::slotted([slot=\"prepend\"]){margin-right:-3px;border-right-color:transparent;border-color:var(--road-input-outline);border-top-right-radius:0;border-bottom-right-radius:0;position:absolute;left:0;top:0;bottom:0}::slotted([slot=\"append\"]){margin-left:-0.25rem;border-color:var(--road-input-outline);border-left-width:0;position:absolute;right:0;top:0;bottom:0}@media (hover: hover){.input-group:not(.is-disabled):hover ::slotted([slot=\"prepend\"]){border-color:var(--road-input-outline-variant);border-right-color:transparent}.input-group:not(.is-disabled):hover ::slotted([slot=\"append\"]){border-color:var(--road-input-outline-variant);border-left-color:transparent}:host(.phone-number-group) .input-group:not(.is-disabled):hover ::slotted([slot=\"prepend\"]){border-color:var(--road-input-outline-variant)}}.input-group:focus-within ::slotted([slot=\"prepend\"]),:host(.phone-number-group) .input-group:focus-within ::slotted([slot=\"prepend\"]){border-color:var(--road-grey-0);border-width:2px;border-right-color:transparent;outline:none;}.input-group:focus-within ::slotted([slot=\"append\"]){border-color:var(--road-grey-0);border-width:2px;border-left-color:transparent;outline:none;}.input-group:focus-within ::slotted(road-input):focus-visible{border-color:var(--road-grey-0);border-width:2px;outline:none;}.input-group-prepend,.input-group-append{display:flex;height:3rem}::slotted(road-button){--padding-start:0.5rem;--padding-end:0.5rem;position:relative;z-index:2;min-width:3rem;margin:0;font-size:var(--road-font-size-14)}::slotted(road-button):hover{background-color:var(--road-button-ghost-variant)}.input-group-prepend{z-index:1;order:-1;position:relative}.input-group-prepend~.form-label{left:calc(3rem + 1px)}.input-group-append{position:relative;z-index:1;border-radius:0 0.25rem 0.25rem 0}::slotted(label){display:flex;align-items:center;padding:0 0.5rem;margin-bottom:0;color:var(--road-on-surface);text-align:center;white-space:nowrap;cursor:text;border-radius:0.25rem;-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}::slotted(road-label){display:flex;align-items:center;padding:0 0.5rem;margin-bottom:0;color:var(--road-on-surface);text-align:center;white-space:nowrap;cursor:text;background:var(--road-surface);border:1px solid var(--road-input-outline);border-radius:0.25rem;-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}::slotted(road-input:not(:first-child)),::slotted(road-select:not(:first-child)){border-radius:0}.input-group-append ::slotted([slot=\"append\"]){border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}.input-group-prepend ::slotted([slot=\"prepend\"]){border-right:0;border-top-right-radius:0;border-bottom-right-radius:0}:host(.phone-number-group) .input-group-prepend ::slotted([slot=\"prepend\"]){border-right:1px solid var(--road-input-outline);border-top-right-radius:0;border-bottom-right-radius:0}.input-group-prepend ::slotted(label){margin-right:calc(-1rem + 1px)}.input-group-append:hover ::slotted(road-button){background-color:var(--road-button-ghost-variant)}.size-xl .input-group-prepend,.size-xl .input-group-append{height:3.5rem}.size-xl ::slotted(road-button){height:3.5rem}.input-group.is-invalid ::slotted([slot=\"append\"]),.input-group.is-invalid ::slotted([slot=\"prepend\"]){border-color:var(--road-danger-outline)}:host(.phone-number-group) .input-group.is-invalid ::slotted([slot=\"prepend\"]){border-color:var(--road-danger-outline)}:host([disabled]){cursor:not-allowed}:host([disabled]) .input-group{pointer-events:none;}:host([disabled]) ::slotted([slot=\"append\"]),:host([disabled]) ::slotted([slot=\"prepend\"]){color:var(--road-on-surface-disabled);cursor:not-allowed;background:#e4e5e9}:host([disabled]) ::slotted([slot=\"append\"] road-icon),:host([disabled]) ::slotted([slot=\"prepend\"] road-icon){color:var(--road-on-surface-disabled)}:host([disabled]) road-icon{color:var(--road-on-surface-disabled)}";
|
|
29598
29623
|
var RoadInputGroupStyle0 = inputGroupCss;
|
|
29599
29624
|
|
|
29600
29625
|
/**
|
|
@@ -29612,7 +29637,7 @@ class InputGroup {
|
|
|
29612
29637
|
handleDisabledChange(newValue) {
|
|
29613
29638
|
this.updateDisabledState(newValue);
|
|
29614
29639
|
}
|
|
29615
|
-
/**
|
|
29640
|
+
/** Applique le `disabled` aux enfants */
|
|
29616
29641
|
updateDisabledState(isDisabled) {
|
|
29617
29642
|
const children = this.el.querySelectorAll('road-input, road-button, road-select');
|
|
29618
29643
|
children.forEach(child => {
|
|
@@ -29624,9 +29649,24 @@ class InputGroup {
|
|
|
29624
29649
|
}
|
|
29625
29650
|
});
|
|
29626
29651
|
}
|
|
29627
|
-
|
|
29628
|
-
|
|
29652
|
+
/** Vérifie et applique le `text-indent` si `prepend` est présent */
|
|
29653
|
+
updateIndentation() {
|
|
29654
|
+
const hasPrepend = !!this.el.querySelector('[slot="prepend"]');
|
|
29655
|
+
const formControl = this.el.querySelector('.form-control');
|
|
29656
|
+
const formLabel = this.el.querySelector('.form-label');
|
|
29657
|
+
if (formControl) {
|
|
29658
|
+
formControl.style.textIndent = hasPrepend ? '2rem' : '';
|
|
29659
|
+
}
|
|
29660
|
+
if (formLabel) {
|
|
29661
|
+
formLabel.style.textIndent = hasPrepend ? '2.7rem' : '';
|
|
29662
|
+
}
|
|
29663
|
+
}
|
|
29664
|
+
componentDidLoad() {
|
|
29629
29665
|
this.updateDisabledState(this.disabled);
|
|
29666
|
+
this.updateIndentation(); // Appliquer les styles au montage
|
|
29667
|
+
// Observer les mutations (au cas où des éléments sont ajoutés dynamiquement)
|
|
29668
|
+
const observer = new MutationObserver(() => this.updateIndentation());
|
|
29669
|
+
observer.observe(this.el, { childList: true, subtree: true });
|
|
29630
29670
|
}
|
|
29631
29671
|
render() {
|
|
29632
29672
|
const errorClass = this.el.querySelector('road-input[error]') ? 'is-invalid' : '';
|
|
@@ -29634,7 +29674,7 @@ class InputGroup {
|
|
|
29634
29674
|
? `size-${this.el.querySelector('road-input').sizes}`
|
|
29635
29675
|
: '';
|
|
29636
29676
|
const disabledClass = this.disabled ? 'is-disabled' : '';
|
|
29637
|
-
return (hAsync("div", { key: '
|
|
29677
|
+
return (hAsync("div", { key: 'd820b7eee7e4199722474ddb8a7e6dea5f3c1232', class: `input-group ${errorClass} ${disabledClass} ${sizeClass}` }, hAsync("div", { key: 'ca3a4babe8c43a9d105bce56ff4d34bab501d916', class: "input-group-prepend" }, hAsync("slot", { key: '85f0e1dacfa39a5e075edc6af93ad6b8233d55e3', name: "prepend" })), hAsync("slot", { key: 'd1b3bc429d1388db53b32fabf24f9a8d3c24f1cd' }), hAsync("div", { key: '557aff92ba2225803c997de830d60027e635be1a', class: "input-group-append" }, hAsync("slot", { key: 'c4e7a0ba1ff5a766ba3d0683c6cfefd8e31afef9', name: "append" }))));
|
|
29638
29678
|
}
|
|
29639
29679
|
get el() { return getElement(this); }
|
|
29640
29680
|
static get watchers() { return {
|
|
@@ -32227,9 +32267,6 @@ i18n.phonenumbers.AsYouTypeFormatter.prototype.inputDigitHelper_=function(a){var
|
|
|
32227
32267
|
});
|
|
32228
32268
|
}(libphonenumber));
|
|
32229
32269
|
|
|
32230
|
-
// list of forbidden characters
|
|
32231
|
-
const forbiddenChars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '=', '[', ']', '{', '}', '|', ';', ':', "'", '"', ',', '.', '<', '>', '/', '?'];
|
|
32232
|
-
|
|
32233
32270
|
const phoneNumberInputCss = ".is-invalid.sc-road-phone-number-input .phone-number-input-field.sc-road-input.sc-road-phone-number-input{border-color:var(--road-danger-outline)}.road-phone-input-select.sc-road-phone-number-input{position:relative;display:block;font-family:var(--road-font, sans-serif);color:var(--road-on-surface);background-color:var(--road-surface);border:1px solid var(--road-input-outline);border-radius:0.25rem;border-top-right-radius:0;border-bottom-right-radius:0;box-shadow:none;appearance:none;width:5rem;height:3.5rem}.sc-road-phone-number-input-h .is-error.sc-road-phone-number-input{border-color:var(--road-danger-outline)}.form-select-area.sc-road-phone-number-input{box-sizing:border-box;display:block;width:100%;height:3rem;padding:0.75rem 3rem 0 2rem;margin:0;font-size:var(--road-body-medium);line-height:1.5;color:var(--road-on-surface);background:url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCA2NCIgZmlsbD0icmdiYSgyMywgMzAsIDUyLCAwLjcyKSI+PHBhdGggZD0iTTIzIDI2bDkgMTIgOS0xMnoiLz48L3N2Zz4=\") no-repeat right -5px center/2.5rem 2rem;position:absolute;top:0;left:0;height:100%;width:95%;z-index:1;border:0;appearance:none;opacity:1;cursor:pointer}.form-select-area.sc-road-phone-number-input:-moz-focusring{color:transparent;text-shadow:0 0 0 #000000}.form-select-area.sc-road-phone-number-input::-ms-expand{display:none}.form-select-area.sc-road-phone-number-input::placeholder{color:var(--road-on-surface-extra-weak)}@media (hover: hover){.form-select-area.sc-road-phone-number-input:not(:disabled):hover{border-color:var(--road-input-outline-variant)}}.form-select-area.sc-road-phone-number-input:focus~.form-select-area-label.sc-road-phone-number-input,.form-select-area[required].sc-road-phone-number-input:valid~.form-select-area-label.sc-road-phone-number-input,.form-select-area.has-value.sc-road-phone-number-input~.form-select-area-label.sc-road-phone-number-input{transform:scale(0.625) translateY(-0.625rem)}.form-select-area.sc-road-phone-number-input:not(:disabled):focus{border-color:var(--road-input-outline-variant)}.form-select-area.sc-road-phone-number-input:disabled,.form-select-area[readonly].sc-road-phone-number-input{color:transparent;cursor:not-allowed;background:var(--road-surface-disabled);opacity:1}.form-select-area-label.sc-road-phone-number-input{position:absolute;top:0.9rem;left:1rem;display:block;font-size:var(--road-font-size-18);line-height:1.5;color:var(--road-on-surface-extra-weak);pointer-events:none;transition:transform 200ms cubic-bezier(0, 0, 0.2, 1) 0ms;transform-origin:0 0}.form-select-area.sc-road-phone-number-input:required~.form-select-area-label.sc-road-phone-number-input::after{color:var(--road-on-danger-surface);content:\" *\"}.form-select-area-value.sc-road-phone-number-input{position:absolute;top:1.4rem;left:1rem;display:block;font-size:var(--road-label-medium);line-height:1.5;color:var(--road-on-surface);pointer-events:none;transition:transform 200ms cubic-bezier(0, 0, 0.2, 1) 0ms;transform-origin:0 0}.select-xl.sc-road-phone-number-input-h .form-select-area.sc-road-phone-number-input{height:3.5rem;padding:0.75rem 0 0 1rem}.input-xl.sc-road-phone-number-input{height:3.5rem;padding:0.75rem 0 0 1rem}.select-xl.sc-road-phone-number-input-h .form-select-area-label.sc-road-phone-number-input{top:1rem}.select-xl.sc-road-phone-number-input-h .form-select-area.sc-road-phone-number-input:focus~.form-select-area-label.sc-road-phone-number-input,.select-xl.sc-road-phone-number-input-h .form-select-area[required].sc-road-phone-number-input:valid~.form-select-area-label.sc-road-phone-number-input,.select-xl.sc-road-phone-number-input-h .form-select-area.has-value.sc-road-phone-number-input~.form-select-area-label.sc-road-phone-number-input,.select-xl.sc-road-phone-number-input-h .form-select-area[type=\"date\"].sc-road-phone-number-input~.form-select-area-label.sc-road-phone-number-input,.select-xl.sc-road-phone-number-input-h .form-select-area[type=\"time\"].sc-road-phone-number-input~.form-select-area-label.sc-road-phone-number-input{transform:scale(0.75) translateY(-0.625rem)}.select-xl.sc-road-phone-number-input-h .form-select-area.sc-road-phone-number-input:placeholder-shown~.form-select-area-label.sc-road-phone-number-input{transform:scale(0.75) translateY(-0.625rem)}.invalid-feedback.sc-road-phone-number-input{gap:.25rem;display:flex;width:100%;margin:0.5rem 0;font-size:var(--road-body-small);color:var(--road-on-danger-surface)}.form-select-area.is-invalid.sc-road-phone-number-input,.was-validated.sc-road-phone-number-input .form-select-area.sc-road-phone-number-input:invalid{border-color:var(--road-on-danger-surface)}.form-select-area.is-invalid.sc-road-phone-number-input~.invalid-feedback.sc-road-phone-number-input,.was-validated.sc-road-phone-number-input .form-select-area.sc-road-phone-number-input:invalid~.invalid-feedback.sc-road-phone-number-input{display:block}.form-select-area.sc-road-phone-number-input option.sc-road-phone-number-input:checked::after{position:absolute;top:0;left:0;content:attr(data-content)}.form-select-area.sc-road-phone-number-input::after{position:absolute;top:0;left:0;content:var(--selected-content, '')}.phone-number-input-label.sc-road-phone-number-input{position:absolute;top:1rem;left:6rem;display:block;font-size:var(--road-body-medium);line-height:1.5;color:var(--road-on-surface-weak);pointer-events:none;transition:transform 200ms cubic-bezier(0, 0, 0.2, 1) 0ms;transform-origin:0 0}.phone-number-input-field.sc-road-phone-number-input:required~.phone-number-input-label.sc-road-phone-number-input::after{color:var(--road-danger-default);content:\" *\"}.phone-number-input-field.sc-road-phone-number-input:focus~.phone-number-input-label.sc-road-phone-number-input,.phone-number-input-field[required].sc-road-phone-number-input:valid~.phone-number-input-label.sc-road-phone-number-input,.phone-number-input-field.has-value.sc-road-phone-number-input~.phone-number-input-label.sc-road-phone-number-input{transform:scale(0.625) translateY(-0.625rem)}.phone-number-input-field.sc-road-phone-number-input:placeholder-shown~.phone-number-input-label.sc-road-phone-number-input{transform:scale(0.625) translateY(-0.625rem)}.phone-number-input-field.sc-road-phone-number-input:-ms-input-placeholder~.phone-number-input-label.sc-road-phone-number-input{transform:scale(0.625) translateY(-0.625rem)}.phone-number-inputs-container.sc-road-phone-number-input{position:relative;display:flex}.road-phone-input-select.sc-road-phone-number-input{margin-bottom:1rem}.is-error.sc-road-phone-number-input{margin-bottom:0}.phone-number-input-field.sc-road-phone-number-input{flex-grow:1;border:1px solid var(--road-input-outline);border-left:0;border-radius:0.25rem;border-bottom-left-radius:0;border-top-left-radius:0}";
|
|
32234
32271
|
var RoadPhoneNumberInputStyle0 = phoneNumberInputCss;
|
|
32235
32272
|
|
|
@@ -32283,13 +32320,6 @@ class RoadPhoneNumberInput {
|
|
|
32283
32320
|
this.phoneNumber = input.value;
|
|
32284
32321
|
this.createAndDispatchPhoneData();
|
|
32285
32322
|
}
|
|
32286
|
-
// On user key down
|
|
32287
|
-
handleKeyDown(event) {
|
|
32288
|
-
// checks if the forbidden characters's list contains the pressed key
|
|
32289
|
-
if (forbiddenChars.includes(event.key)) {
|
|
32290
|
-
event.preventDefault();
|
|
32291
|
-
}
|
|
32292
|
-
}
|
|
32293
32323
|
// On user select
|
|
32294
32324
|
handleSelect(event) {
|
|
32295
32325
|
const select = event.target;
|
|
@@ -32393,9 +32423,9 @@ class RoadPhoneNumberInput {
|
|
|
32393
32423
|
const isErrorClass = this.errorMessage.length ? 'is-error' : '';
|
|
32394
32424
|
const hasValueClass = this.hasValue() ? 'has-value' : '';
|
|
32395
32425
|
const sizes = 'xl';
|
|
32396
|
-
return (hAsync(Host, { key: '
|
|
32426
|
+
return (hAsync(Host, { key: '7d65a01428b79587c98a5e399bab8403c0849a68' }, hAsync("div", { key: 'b59d36be4bd2ecbe7469b37c194501d542895b29', class: 'phone-number-inputs-container' }, hAsync("div", { key: '4cf3f4e60de5f861e09c8cbde5551fb95f209970', class: `road-phone-input-select ${isErrorClass} ${isInvalidClass}`, slot: "prepend" }, hAsync("select", { key: '187f3724fcc9bf5c34c6490e61e5adee102ac052', id: selectId, class: `form-select-area has-value`, "aria-disabled": this.disabled ? 'true' : null, disabled: this.disabled, onChange: (event) => this.handleSelect(event), "aria-label": this.codeLabel, tabIndex: this.disabled ? -1 : 0 }, this.countryOptions && this.countryOptions.map(option => (hAsync("option", { value: option.value, disabled: option.disabled, selected: option.selected }, option.label)))), hAsync("label", { key: '8e867ef3d625b2e69246591cb8f84e7794ba1a7c', class: "form-select-area-label", id: labelId, htmlFor: selectId }, this.codeLabel), hAsync("label", { key: '71ae31a4e0da49b93d28e433a41fbb40b74b603d', class: "form-select-area-value", id: valueId, htmlFor: selectId }, "+", this.selectedCountryCode)), hAsync("input", { key: '289ac4032540c87f77784439864983ed5d544439', type: 'tel', id: inputId, class: `input-${sizes} phone-number-input-field ${hasValueClass} ${isErrorClass}`, value: this.phoneValue, required: this.required, tabIndex: 0, onInput: (event) => this.handleInput(event) }), hAsync("label", { key: '60e9f10714d8807449534d1bce2f74f65a1646dc', class: "phone-number-input-label", id: labelId, htmlFor: inputId }, this.phoneLabel)), this.errorMessage
|
|
32397
32427
|
&& this.errorMessage !== ''
|
|
32398
|
-
&& hAsync("p", { key: '
|
|
32428
|
+
&& hAsync("p", { key: 'b140351db845f88befd99aab39daa115c770732e', class: "invalid-feedback" }, hAsync("road-icon", { key: 'ed89fc9c99493f67973448bbea8d7f0c20e0c455', slot: "start", color: 'danger', name: "alert-error-solid", "aria-hidden": "true", size: "sm" }), this.errorMessage)));
|
|
32399
32429
|
}
|
|
32400
32430
|
get el() { return getElement(this); }
|
|
32401
32431
|
static get style() { return RoadPhoneNumberInputStyle0; }
|
|
@@ -36464,7 +36494,7 @@ var NAMESPACE = (
|
|
|
36464
36494
|
);
|
|
36465
36495
|
|
|
36466
36496
|
/*
|
|
36467
|
-
Stencil Hydrate Runner v4.27.
|
|
36497
|
+
Stencil Hydrate Runner v4.27.0 | MIT Licensed | https://stenciljs.com
|
|
36468
36498
|
*/
|
|
36469
36499
|
var __defProp = Object.defineProperty;
|
|
36470
36500
|
var __export = (target, all) => {
|
|
@@ -36810,19 +36840,19 @@ var MockCustomElementRegistry = class {
|
|
|
36810
36840
|
this.__whenDefined.delete(tagName);
|
|
36811
36841
|
}
|
|
36812
36842
|
}
|
|
36813
|
-
const
|
|
36814
|
-
if (
|
|
36815
|
-
const hosts =
|
|
36843
|
+
const doc2 = this.win.document;
|
|
36844
|
+
if (doc2 != null) {
|
|
36845
|
+
const hosts = doc2.querySelectorAll(tagName);
|
|
36816
36846
|
hosts.forEach((host) => {
|
|
36817
36847
|
if (upgradedElements.has(host) === false) {
|
|
36818
|
-
tempDisableCallbacks.add(
|
|
36819
|
-
const upgradedCmp = createCustomElement(this,
|
|
36848
|
+
tempDisableCallbacks.add(doc2);
|
|
36849
|
+
const upgradedCmp = createCustomElement(this, doc2, tagName);
|
|
36820
36850
|
for (let i = 0; i < host.childNodes.length; i++) {
|
|
36821
36851
|
const childNode = host.childNodes[i];
|
|
36822
36852
|
childNode.remove();
|
|
36823
36853
|
upgradedCmp.appendChild(childNode);
|
|
36824
36854
|
}
|
|
36825
|
-
tempDisableCallbacks.delete(
|
|
36855
|
+
tempDisableCallbacks.delete(doc2);
|
|
36826
36856
|
if (proxyElements.has(host)) {
|
|
36827
36857
|
proxyElements.set(host, upgradedCmp);
|
|
36828
36858
|
}
|
|
@@ -45266,11 +45296,11 @@ function parseFragment(fragmentContext, html, options) {
|
|
|
45266
45296
|
// src/mock-doc/parse-util.ts
|
|
45267
45297
|
var docParser = /* @__PURE__ */ new WeakMap();
|
|
45268
45298
|
function parseDocumentUtil(ownerDocument, html) {
|
|
45269
|
-
const
|
|
45270
|
-
|
|
45271
|
-
|
|
45272
|
-
|
|
45273
|
-
return
|
|
45299
|
+
const doc2 = parse(html.trim(), getParser(ownerDocument));
|
|
45300
|
+
doc2.documentElement = doc2.firstElementChild;
|
|
45301
|
+
doc2.head = doc2.documentElement.firstElementChild;
|
|
45302
|
+
doc2.body = doc2.head.nextElementSibling;
|
|
45303
|
+
return doc2;
|
|
45274
45304
|
}
|
|
45275
45305
|
function parseFragmentUtil(ownerDocument, html) {
|
|
45276
45306
|
if (typeof html === "string") {
|
|
@@ -45288,9 +45318,9 @@ function getParser(ownerDocument) {
|
|
|
45288
45318
|
}
|
|
45289
45319
|
const treeAdapter = {
|
|
45290
45320
|
createDocument() {
|
|
45291
|
-
const
|
|
45292
|
-
|
|
45293
|
-
return
|
|
45321
|
+
const doc2 = ownerDocument.createElement("#document" /* DOCUMENT_NODE */);
|
|
45322
|
+
doc2["x-mode"] = "no-quirks";
|
|
45323
|
+
return doc2;
|
|
45294
45324
|
},
|
|
45295
45325
|
setNodeSourceCodeLocation(node, location2) {
|
|
45296
45326
|
node.sourceCodeLocation = location2;
|
|
@@ -45328,22 +45358,22 @@ function getParser(ownerDocument) {
|
|
|
45328
45358
|
getTemplateContent(templateElement) {
|
|
45329
45359
|
return templateElement.content;
|
|
45330
45360
|
},
|
|
45331
|
-
setDocumentType(
|
|
45332
|
-
let doctypeNode =
|
|
45361
|
+
setDocumentType(doc2, name, publicId, systemId) {
|
|
45362
|
+
let doctypeNode = doc2.childNodes.find((n) => n.nodeType === 10 /* DOCUMENT_TYPE_NODE */);
|
|
45333
45363
|
if (doctypeNode == null) {
|
|
45334
45364
|
doctypeNode = ownerDocument.createDocumentTypeNode();
|
|
45335
|
-
|
|
45365
|
+
doc2.insertBefore(doctypeNode, doc2.firstChild);
|
|
45336
45366
|
}
|
|
45337
45367
|
doctypeNode.nodeValue = "!DOCTYPE";
|
|
45338
45368
|
doctypeNode["x-name"] = name;
|
|
45339
45369
|
doctypeNode["x-publicId"] = publicId;
|
|
45340
45370
|
doctypeNode["x-systemId"] = systemId;
|
|
45341
45371
|
},
|
|
45342
|
-
setDocumentMode(
|
|
45343
|
-
|
|
45372
|
+
setDocumentMode(doc2, mode) {
|
|
45373
|
+
doc2["x-mode"] = mode;
|
|
45344
45374
|
},
|
|
45345
|
-
getDocumentMode(
|
|
45346
|
-
return
|
|
45375
|
+
getDocumentMode(doc2) {
|
|
45376
|
+
return doc2["x-mode"];
|
|
45347
45377
|
},
|
|
45348
45378
|
detachNode(node) {
|
|
45349
45379
|
node.remove();
|
|
@@ -45519,9 +45549,9 @@ var jquery_default = (
|
|
|
45519
45549
|
nonce: true,
|
|
45520
45550
|
noModule: true
|
|
45521
45551
|
};
|
|
45522
|
-
function DOMEval(code, node,
|
|
45523
|
-
|
|
45524
|
-
var i2, script =
|
|
45552
|
+
function DOMEval(code, node, doc2) {
|
|
45553
|
+
doc2 = doc2 || document2;
|
|
45554
|
+
var i2, script = doc2.createElement("script");
|
|
45525
45555
|
script.text = code;
|
|
45526
45556
|
if (node) {
|
|
45527
45557
|
for (i2 in preservedScriptAttributes) {
|
|
@@ -45530,7 +45560,7 @@ var jquery_default = (
|
|
|
45530
45560
|
}
|
|
45531
45561
|
}
|
|
45532
45562
|
}
|
|
45533
|
-
|
|
45563
|
+
doc2.head.appendChild(script).parentNode.removeChild(script);
|
|
45534
45564
|
}
|
|
45535
45565
|
const jQuery = {};
|
|
45536
45566
|
var version = "4.0.0-pre+9352011a7.dirty +selector", rhtmlSuffix = /HTML$/i, jQueryOrig = function(selector, context) {
|
|
@@ -45667,8 +45697,8 @@ var jquery_default = (
|
|
|
45667
45697
|
},
|
|
45668
45698
|
// Evaluates a script in a provided context; falls back to the global one
|
|
45669
45699
|
// if not specified.
|
|
45670
|
-
globalEval: function(code, options,
|
|
45671
|
-
DOMEval(code, { nonce: options && options.nonce },
|
|
45700
|
+
globalEval: function(code, options, doc2) {
|
|
45701
|
+
DOMEval(code, { nonce: options && options.nonce }, doc2);
|
|
45672
45702
|
},
|
|
45673
45703
|
each: function(obj, callback) {
|
|
45674
45704
|
var length, i2 = 0;
|
|
@@ -46157,11 +46187,11 @@ var jquery_default = (
|
|
|
46157
46187
|
});
|
|
46158
46188
|
}
|
|
46159
46189
|
function setDocument(node) {
|
|
46160
|
-
var subWindow,
|
|
46161
|
-
if (
|
|
46190
|
+
var subWindow, doc2 = node ? node.ownerDocument || node : document2;
|
|
46191
|
+
if (doc2 == document$1 || doc2.nodeType !== 9) {
|
|
46162
46192
|
return;
|
|
46163
46193
|
}
|
|
46164
|
-
document$1 =
|
|
46194
|
+
document$1 = doc2;
|
|
46165
46195
|
documentElement$1 = document$1.documentElement;
|
|
46166
46196
|
documentIsHTML = !jQuery.isXMLDoc(document$1);
|
|
46167
46197
|
if (isIE && document2 != document$1 && (subWindow = document$1.defaultView) && subWindow.top !== subWindow) {
|
|
@@ -50506,10 +50536,10 @@ var MockDocument = class _MockDocument extends MockHTMLElement {
|
|
|
50506
50536
|
}
|
|
50507
50537
|
createElement(tagName) {
|
|
50508
50538
|
if (tagName === "#document" /* DOCUMENT_NODE */) {
|
|
50509
|
-
const
|
|
50510
|
-
|
|
50511
|
-
|
|
50512
|
-
return
|
|
50539
|
+
const doc2 = new _MockDocument(false);
|
|
50540
|
+
doc2.nodeName = tagName;
|
|
50541
|
+
doc2.parentNode = null;
|
|
50542
|
+
return doc2;
|
|
50513
50543
|
}
|
|
50514
50544
|
return createElement(this, tagName);
|
|
50515
50545
|
}
|
|
@@ -50549,10 +50579,10 @@ var MockDocument = class _MockDocument extends MockHTMLElement {
|
|
|
50549
50579
|
title.textContent = value;
|
|
50550
50580
|
}
|
|
50551
50581
|
};
|
|
50552
|
-
function resetDocument(
|
|
50553
|
-
if (
|
|
50554
|
-
resetEventListeners(
|
|
50555
|
-
const documentElement =
|
|
50582
|
+
function resetDocument(doc2) {
|
|
50583
|
+
if (doc2 != null) {
|
|
50584
|
+
resetEventListeners(doc2);
|
|
50585
|
+
const documentElement = doc2.documentElement;
|
|
50556
50586
|
if (documentElement != null) {
|
|
50557
50587
|
resetElement(documentElement);
|
|
50558
50588
|
for (let i = 0, ii = documentElement.childNodes.length; i < ii; i++) {
|
|
@@ -50561,25 +50591,25 @@ function resetDocument(doc) {
|
|
|
50561
50591
|
childNode.childNodes.length = 0;
|
|
50562
50592
|
}
|
|
50563
50593
|
}
|
|
50564
|
-
for (const key in
|
|
50565
|
-
if (
|
|
50566
|
-
delete
|
|
50594
|
+
for (const key in doc2) {
|
|
50595
|
+
if (doc2.hasOwnProperty(key) && !DOC_KEY_KEEPERS.has(key)) {
|
|
50596
|
+
delete doc2[key];
|
|
50567
50597
|
}
|
|
50568
50598
|
}
|
|
50569
50599
|
try {
|
|
50570
|
-
|
|
50600
|
+
doc2.nodeName = "#document" /* DOCUMENT_NODE */;
|
|
50571
50601
|
} catch (e) {
|
|
50572
50602
|
}
|
|
50573
50603
|
try {
|
|
50574
|
-
|
|
50604
|
+
doc2.nodeType = 9 /* DOCUMENT_NODE */;
|
|
50575
50605
|
} catch (e) {
|
|
50576
50606
|
}
|
|
50577
50607
|
try {
|
|
50578
|
-
|
|
50608
|
+
doc2.cookie = "";
|
|
50579
50609
|
} catch (e) {
|
|
50580
50610
|
}
|
|
50581
50611
|
try {
|
|
50582
|
-
|
|
50612
|
+
doc2.referrer = "";
|
|
50583
50613
|
} catch (e) {
|
|
50584
50614
|
}
|
|
50585
50615
|
}
|
|
@@ -50649,6 +50679,7 @@ var STENCIL_DEV_MODE = BUILD.isTesting ? ["STENCIL:"] : [
|
|
|
50649
50679
|
"color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px"
|
|
50650
50680
|
];
|
|
50651
50681
|
var win = typeof window !== "undefined" ? window : {};
|
|
50682
|
+
var doc = win.document || { head: {} };
|
|
50652
50683
|
var H = win.HTMLElement || class {
|
|
50653
50684
|
};
|
|
50654
50685
|
var supportsShadow = BUILD.shadowDom;
|
|
@@ -50782,14 +50813,14 @@ var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
|
50782
50813
|
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
50783
50814
|
|
|
50784
50815
|
// src/compiler/html/canonical-link.ts
|
|
50785
|
-
var updateCanonicalLink = (
|
|
50816
|
+
var updateCanonicalLink = (doc2, href) => {
|
|
50786
50817
|
var _a2;
|
|
50787
|
-
let canonicalLinkElm =
|
|
50818
|
+
let canonicalLinkElm = doc2.head.querySelector('link[rel="canonical"]');
|
|
50788
50819
|
if (typeof href === "string") {
|
|
50789
50820
|
if (canonicalLinkElm == null) {
|
|
50790
|
-
canonicalLinkElm =
|
|
50821
|
+
canonicalLinkElm = doc2.createElement("link");
|
|
50791
50822
|
canonicalLinkElm.setAttribute("rel", "canonical");
|
|
50792
|
-
|
|
50823
|
+
doc2.head.appendChild(canonicalLinkElm);
|
|
50793
50824
|
}
|
|
50794
50825
|
canonicalLinkElm.setAttribute("href", href);
|
|
50795
50826
|
} else {
|
|
@@ -50803,11 +50834,11 @@ var updateCanonicalLink = (doc, href) => {
|
|
|
50803
50834
|
};
|
|
50804
50835
|
|
|
50805
50836
|
// src/compiler/html/relocate-meta-charset.ts
|
|
50806
|
-
var relocateMetaCharset = (
|
|
50807
|
-
const head =
|
|
50837
|
+
var relocateMetaCharset = (doc2) => {
|
|
50838
|
+
const head = doc2.head;
|
|
50808
50839
|
let charsetElm = head.querySelector("meta[charset]");
|
|
50809
50840
|
if (charsetElm == null) {
|
|
50810
|
-
charsetElm =
|
|
50841
|
+
charsetElm = doc2.createElement("meta");
|
|
50811
50842
|
charsetElm.setAttribute("charset", "utf-8");
|
|
50812
50843
|
} else {
|
|
50813
50844
|
charsetElm.remove();
|
|
@@ -51082,13 +51113,13 @@ var parseCss = (css, filePath) => {
|
|
|
51082
51113
|
const m = match(/^@([-\w]+)?document *([^{]+)/);
|
|
51083
51114
|
if (!m) return null;
|
|
51084
51115
|
const vendor = trim(m[1]);
|
|
51085
|
-
const
|
|
51116
|
+
const doc2 = trim(m[2]);
|
|
51086
51117
|
if (!open()) return error(`@document missing '{'`);
|
|
51087
51118
|
const style = comments().concat(rules());
|
|
51088
51119
|
if (!close()) return error(`@document missing '}'`);
|
|
51089
51120
|
return pos({
|
|
51090
51121
|
type: 3 /* Document */,
|
|
51091
|
-
document:
|
|
51122
|
+
document: doc2,
|
|
51092
51123
|
vendor,
|
|
51093
51124
|
rules: style
|
|
51094
51125
|
});
|
|
@@ -51414,11 +51445,11 @@ var serializeCssPage = (opts, node) => {
|
|
|
51414
51445
|
};
|
|
51415
51446
|
var serializeCssDocument = (opts, node) => {
|
|
51416
51447
|
const documentCss = serializeCssMapVisit(opts, node.rules);
|
|
51417
|
-
const
|
|
51448
|
+
const doc2 = "@" + (node.vendor || "") + "document " + node.document;
|
|
51418
51449
|
if (documentCss === "") {
|
|
51419
51450
|
return "";
|
|
51420
51451
|
}
|
|
51421
|
-
return
|
|
51452
|
+
return doc2 + "{" + documentCss + "}";
|
|
51422
51453
|
};
|
|
51423
51454
|
var serializeCssMapVisit = (opts, nodes) => {
|
|
51424
51455
|
let rtn = "";
|
|
@@ -51516,12 +51547,12 @@ var collectUsedSelectors = (usedSelectors, elm) => {
|
|
|
51516
51547
|
};
|
|
51517
51548
|
|
|
51518
51549
|
// src/compiler/html/remove-unused-styles.ts
|
|
51519
|
-
var removeUnusedStyles = (
|
|
51550
|
+
var removeUnusedStyles = (doc2, diagnostics) => {
|
|
51520
51551
|
try {
|
|
51521
|
-
const styleElms =
|
|
51552
|
+
const styleElms = doc2.head.querySelectorAll(`style[data-styles]`);
|
|
51522
51553
|
const styleLen = styleElms.length;
|
|
51523
51554
|
if (styleLen > 0) {
|
|
51524
|
-
const usedSelectors = getUsedSelectors(
|
|
51555
|
+
const usedSelectors = getUsedSelectors(doc2.documentElement);
|
|
51525
51556
|
for (let i = 0; i < styleLen; i++) {
|
|
51526
51557
|
removeUnusedStyleText(usedSelectors, diagnostics, styleElms[i]);
|
|
51527
51558
|
}
|
|
@@ -51654,41 +51685,41 @@ function collectAttributes(node) {
|
|
|
51654
51685
|
var SKIP_ATTRS = /* @__PURE__ */ new Set(["s-id", "c-id"]);
|
|
51655
51686
|
|
|
51656
51687
|
// src/hydrate/runner/patch-dom-implementation.ts
|
|
51657
|
-
function patchDomImplementation(
|
|
51688
|
+
function patchDomImplementation(doc2, opts) {
|
|
51658
51689
|
let win2;
|
|
51659
|
-
if (
|
|
51690
|
+
if (doc2.defaultView != null) {
|
|
51660
51691
|
opts.destroyWindow = true;
|
|
51661
|
-
patchWindow(
|
|
51662
|
-
win2 =
|
|
51692
|
+
patchWindow(doc2.defaultView);
|
|
51693
|
+
win2 = doc2.defaultView;
|
|
51663
51694
|
} else {
|
|
51664
51695
|
opts.destroyWindow = true;
|
|
51665
51696
|
opts.destroyDocument = false;
|
|
51666
51697
|
win2 = new MockWindow(false);
|
|
51667
51698
|
}
|
|
51668
|
-
if (win2.document !==
|
|
51669
|
-
win2.document =
|
|
51699
|
+
if (win2.document !== doc2) {
|
|
51700
|
+
win2.document = doc2;
|
|
51670
51701
|
}
|
|
51671
|
-
if (
|
|
51672
|
-
|
|
51702
|
+
if (doc2.defaultView !== win2) {
|
|
51703
|
+
doc2.defaultView = win2;
|
|
51673
51704
|
}
|
|
51674
|
-
const HTMLElement2 =
|
|
51705
|
+
const HTMLElement2 = doc2.documentElement.constructor.prototype;
|
|
51675
51706
|
if (typeof HTMLElement2.getRootNode !== "function") {
|
|
51676
|
-
const elm =
|
|
51707
|
+
const elm = doc2.createElement("unknown-element");
|
|
51677
51708
|
const HTMLUnknownElement = elm.constructor.prototype;
|
|
51678
51709
|
HTMLUnknownElement.getRootNode = getRootNode;
|
|
51679
51710
|
}
|
|
51680
|
-
if (typeof
|
|
51681
|
-
const CustomEvent2 =
|
|
51711
|
+
if (typeof doc2.createEvent === "function") {
|
|
51712
|
+
const CustomEvent2 = doc2.createEvent("CustomEvent").constructor;
|
|
51682
51713
|
if (win2.CustomEvent !== CustomEvent2) {
|
|
51683
51714
|
win2.CustomEvent = CustomEvent2;
|
|
51684
51715
|
}
|
|
51685
51716
|
}
|
|
51686
51717
|
try {
|
|
51687
|
-
win2.__stencil_baseURI =
|
|
51718
|
+
win2.__stencil_baseURI = doc2.baseURI;
|
|
51688
51719
|
} catch (e) {
|
|
51689
|
-
Object.defineProperty(
|
|
51720
|
+
Object.defineProperty(doc2, "baseURI", {
|
|
51690
51721
|
get() {
|
|
51691
|
-
const baseElm =
|
|
51722
|
+
const baseElm = doc2.querySelector("base[href]");
|
|
51692
51723
|
if (baseElm) {
|
|
51693
51724
|
return new URL(baseElm.getAttribute("href"), win2.location.href).href;
|
|
51694
51725
|
}
|
|
@@ -51899,7 +51930,7 @@ var docData = {
|
|
|
51899
51930
|
rootLevelIds: 0,
|
|
51900
51931
|
staticComponents: /* @__PURE__ */ new Set()
|
|
51901
51932
|
};
|
|
51902
|
-
function initializeWindow(win2,
|
|
51933
|
+
function initializeWindow(win2, doc2, opts, results) {
|
|
51903
51934
|
if (typeof opts.url === "string") {
|
|
51904
51935
|
try {
|
|
51905
51936
|
win2.location.href = opts.url;
|
|
@@ -51914,31 +51945,31 @@ function initializeWindow(win2, doc, opts, results) {
|
|
|
51914
51945
|
}
|
|
51915
51946
|
if (typeof opts.cookie === "string") {
|
|
51916
51947
|
try {
|
|
51917
|
-
|
|
51948
|
+
doc2.cookie = opts.cookie;
|
|
51918
51949
|
} catch (e) {
|
|
51919
51950
|
}
|
|
51920
51951
|
}
|
|
51921
51952
|
if (typeof opts.referrer === "string") {
|
|
51922
51953
|
try {
|
|
51923
|
-
|
|
51954
|
+
doc2.referrer = opts.referrer;
|
|
51924
51955
|
} catch (e) {
|
|
51925
51956
|
}
|
|
51926
51957
|
}
|
|
51927
51958
|
if (typeof opts.direction === "string") {
|
|
51928
51959
|
try {
|
|
51929
|
-
|
|
51960
|
+
doc2.documentElement.setAttribute("dir", opts.direction);
|
|
51930
51961
|
} catch (e) {
|
|
51931
51962
|
}
|
|
51932
51963
|
}
|
|
51933
51964
|
if (typeof opts.language === "string") {
|
|
51934
51965
|
try {
|
|
51935
|
-
|
|
51966
|
+
doc2.documentElement.setAttribute("lang", opts.language);
|
|
51936
51967
|
} catch (e) {
|
|
51937
51968
|
}
|
|
51938
51969
|
}
|
|
51939
51970
|
if (typeof opts.buildId === "string") {
|
|
51940
51971
|
try {
|
|
51941
|
-
|
|
51972
|
+
doc2.documentElement.setAttribute("data-stencil-build", opts.buildId);
|
|
51942
51973
|
} catch (e) {
|
|
51943
51974
|
}
|
|
51944
51975
|
}
|
|
@@ -51950,7 +51981,7 @@ function initializeWindow(win2, doc, opts, results) {
|
|
|
51950
51981
|
constrainTimeouts(win2);
|
|
51951
51982
|
}
|
|
51952
51983
|
runtimeLogging(win2, opts, results);
|
|
51953
|
-
|
|
51984
|
+
doc2[STENCIL_DOC_DATA] = docData;
|
|
51954
51985
|
return win2;
|
|
51955
51986
|
}
|
|
51956
51987
|
|
|
@@ -51968,18 +51999,18 @@ function renderToString(html, options, asStream) {
|
|
|
51968
51999
|
opts.constrainTimeouts = false;
|
|
51969
52000
|
return hydrateDocument(html, opts, asStream);
|
|
51970
52001
|
}
|
|
51971
|
-
function hydrateDocument(
|
|
52002
|
+
function hydrateDocument(doc2, options, asStream) {
|
|
51972
52003
|
const opts = normalizeHydrateOptions(options);
|
|
51973
52004
|
let win2 = null;
|
|
51974
52005
|
const results = generateHydrateResults(opts);
|
|
51975
52006
|
if (hasError(results.diagnostics)) {
|
|
51976
52007
|
return Promise.resolve(results);
|
|
51977
52008
|
}
|
|
51978
|
-
if (typeof
|
|
52009
|
+
if (typeof doc2 === "string") {
|
|
51979
52010
|
try {
|
|
51980
52011
|
opts.destroyWindow = true;
|
|
51981
52012
|
opts.destroyDocument = true;
|
|
51982
|
-
win2 = new MockWindow(
|
|
52013
|
+
win2 = new MockWindow(doc2);
|
|
51983
52014
|
if (!asStream) {
|
|
51984
52015
|
return render(win2, opts, results).then(() => results);
|
|
51985
52016
|
}
|
|
@@ -51993,10 +52024,10 @@ function hydrateDocument(doc, options, asStream) {
|
|
|
51993
52024
|
return Promise.resolve(results);
|
|
51994
52025
|
}
|
|
51995
52026
|
}
|
|
51996
|
-
if (isValidDocument(
|
|
52027
|
+
if (isValidDocument(doc2)) {
|
|
51997
52028
|
try {
|
|
51998
52029
|
opts.destroyDocument = false;
|
|
51999
|
-
win2 = patchDomImplementation(
|
|
52030
|
+
win2 = patchDomImplementation(doc2, opts);
|
|
52000
52031
|
if (!asStream) {
|
|
52001
52032
|
return render(win2, opts, results).then(() => results);
|
|
52002
52033
|
}
|
|
@@ -52053,41 +52084,41 @@ async function afterHydrate(win2, opts, results, resolve) {
|
|
|
52053
52084
|
return resolve(finalizeHydrate(win2, win2.document, opts, results));
|
|
52054
52085
|
}
|
|
52055
52086
|
}
|
|
52056
|
-
function finalizeHydrate(win2,
|
|
52087
|
+
function finalizeHydrate(win2, doc2, opts, results) {
|
|
52057
52088
|
try {
|
|
52058
|
-
inspectElement(results,
|
|
52089
|
+
inspectElement(results, doc2.documentElement, 0);
|
|
52059
52090
|
if (opts.removeUnusedStyles !== false) {
|
|
52060
52091
|
try {
|
|
52061
|
-
removeUnusedStyles(
|
|
52092
|
+
removeUnusedStyles(doc2, results.diagnostics);
|
|
52062
52093
|
} catch (e) {
|
|
52063
52094
|
renderCatchError(results, e);
|
|
52064
52095
|
}
|
|
52065
52096
|
}
|
|
52066
52097
|
if (typeof opts.title === "string") {
|
|
52067
52098
|
try {
|
|
52068
|
-
|
|
52099
|
+
doc2.title = opts.title;
|
|
52069
52100
|
} catch (e) {
|
|
52070
52101
|
renderCatchError(results, e);
|
|
52071
52102
|
}
|
|
52072
52103
|
}
|
|
52073
|
-
results.title =
|
|
52104
|
+
results.title = doc2.title;
|
|
52074
52105
|
if (opts.removeScripts) {
|
|
52075
|
-
removeScripts(
|
|
52106
|
+
removeScripts(doc2.documentElement);
|
|
52076
52107
|
}
|
|
52077
52108
|
try {
|
|
52078
|
-
updateCanonicalLink(
|
|
52109
|
+
updateCanonicalLink(doc2, opts.canonicalUrl);
|
|
52079
52110
|
} catch (e) {
|
|
52080
52111
|
renderCatchError(results, e);
|
|
52081
52112
|
}
|
|
52082
52113
|
try {
|
|
52083
|
-
relocateMetaCharset(
|
|
52114
|
+
relocateMetaCharset(doc2);
|
|
52084
52115
|
} catch (e) {
|
|
52085
52116
|
}
|
|
52086
52117
|
if (!hasError(results.diagnostics)) {
|
|
52087
52118
|
results.httpStatus = 200;
|
|
52088
52119
|
}
|
|
52089
52120
|
try {
|
|
52090
|
-
const metaStatus =
|
|
52121
|
+
const metaStatus = doc2.head.querySelector('meta[http-equiv="status"]');
|
|
52091
52122
|
if (metaStatus != null) {
|
|
52092
52123
|
const metaStatusContent = metaStatus.getAttribute("content");
|
|
52093
52124
|
if (metaStatusContent && metaStatusContent.length > 0) {
|
|
@@ -52097,25 +52128,25 @@ function finalizeHydrate(win2, doc, opts, results) {
|
|
|
52097
52128
|
} catch (e) {
|
|
52098
52129
|
}
|
|
52099
52130
|
if (opts.clientHydrateAnnotations) {
|
|
52100
|
-
|
|
52131
|
+
doc2.documentElement.classList.add("hydrated");
|
|
52101
52132
|
}
|
|
52102
52133
|
if (opts.serializeToHtml) {
|
|
52103
|
-
results.html = serializeDocumentToString(
|
|
52134
|
+
results.html = serializeDocumentToString(doc2, opts);
|
|
52104
52135
|
}
|
|
52105
52136
|
} catch (e) {
|
|
52106
52137
|
renderCatchError(results, e);
|
|
52107
52138
|
}
|
|
52108
|
-
destroyWindow(win2,
|
|
52139
|
+
destroyWindow(win2, doc2, opts, results);
|
|
52109
52140
|
return results;
|
|
52110
52141
|
}
|
|
52111
|
-
function destroyWindow(win2,
|
|
52142
|
+
function destroyWindow(win2, doc2, opts, results) {
|
|
52112
52143
|
if (!opts.destroyWindow) {
|
|
52113
52144
|
return;
|
|
52114
52145
|
}
|
|
52115
52146
|
try {
|
|
52116
52147
|
if (!opts.destroyDocument) {
|
|
52117
52148
|
win2.document = null;
|
|
52118
|
-
|
|
52149
|
+
doc2.defaultView = null;
|
|
52119
52150
|
}
|
|
52120
52151
|
if (win2.close) {
|
|
52121
52152
|
win2.close();
|
|
@@ -52124,8 +52155,8 @@ function destroyWindow(win2, doc, opts, results) {
|
|
|
52124
52155
|
renderCatchError(results, e);
|
|
52125
52156
|
}
|
|
52126
52157
|
}
|
|
52127
|
-
function serializeDocumentToString(
|
|
52128
|
-
return serializeNodeToHtml(
|
|
52158
|
+
function serializeDocumentToString(doc2, opts) {
|
|
52159
|
+
return serializeNodeToHtml(doc2, {
|
|
52129
52160
|
approximateLineWidth: opts.approximateLineWidth,
|
|
52130
52161
|
outerHtml: false,
|
|
52131
52162
|
prettyHtml: opts.prettyHtml,
|
|
@@ -52137,8 +52168,8 @@ function serializeDocumentToString(doc, opts) {
|
|
|
52137
52168
|
fullDocument: opts.fullDocument
|
|
52138
52169
|
});
|
|
52139
52170
|
}
|
|
52140
|
-
function isValidDocument(
|
|
52141
|
-
return
|
|
52171
|
+
function isValidDocument(doc2) {
|
|
52172
|
+
return doc2 != null && doc2.nodeType === 9 && doc2.documentElement != null && doc2.documentElement.nodeType === 1 && doc2.body != null && doc2.body.nodeType === 1;
|
|
52142
52173
|
}
|
|
52143
52174
|
function removeScripts(elm) {
|
|
52144
52175
|
const children = elm.children;
|