lwc 2.24.0 → 2.25.1
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/engine-dom/esm/es2017/engine-dom.js +256 -141
- package/dist/engine-dom/iife/es2017/engine-dom.js +256 -141
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +243 -128
- package/dist/engine-dom/iife/es5/engine-dom.js +44 -12
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +42 -10
- package/dist/engine-dom/umd/es2017/engine-dom.js +256 -141
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +243 -128
- package/dist/engine-dom/umd/es5/engine-dom.js +44 -12
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +42 -10
- package/dist/engine-server/commonjs/es2017/engine-server.js +208 -122
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +208 -122
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3 -3
- package/dist/wire-service/esm/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.js +2 -2
- package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.js +2 -2
- package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
- package/package.json +7 -7
|
@@ -291,7 +291,7 @@ var LWC = (function (exports) {
|
|
|
291
291
|
CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
|
|
292
292
|
return attributeName;
|
|
293
293
|
}
|
|
294
|
-
/** version: 2.
|
|
294
|
+
/** version: 2.25.1 */
|
|
295
295
|
|
|
296
296
|
/**
|
|
297
297
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -373,7 +373,7 @@ var LWC = (function (exports) {
|
|
|
373
373
|
patch$1(propName);
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
|
-
/** version: 2.
|
|
376
|
+
/** version: 2.25.1 */
|
|
377
377
|
|
|
378
378
|
/**
|
|
379
379
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -399,6 +399,7 @@ var LWC = (function (exports) {
|
|
|
399
399
|
ENABLE_REACTIVE_SETTER: null,
|
|
400
400
|
ENABLE_WIRE_SYNC_EMIT: null,
|
|
401
401
|
ENABLE_LIGHT_GET_ROOT_NODE_PATCH: null,
|
|
402
|
+
DISABLE_LIGHT_DOM_UNSCOPED_CSS: null,
|
|
402
403
|
};
|
|
403
404
|
if (!_globalThis.lwcRuntimeFlags) {
|
|
404
405
|
Object.defineProperty(_globalThis, 'lwcRuntimeFlags', { value: create(null) });
|
|
@@ -2373,159 +2374,262 @@ var LWC = (function (exports) {
|
|
|
2373
2374
|
* SPDX-License-Identifier: MIT
|
|
2374
2375
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2375
2376
|
*/
|
|
2377
|
+
|
|
2376
2378
|
function makeHostToken(token) {
|
|
2377
|
-
|
|
2379
|
+
return `${token}-host`;
|
|
2378
2380
|
}
|
|
2381
|
+
|
|
2379
2382
|
function createInlineStyleVNode(content) {
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2383
|
+
return api.h('style', {
|
|
2384
|
+
key: 'style',
|
|
2385
|
+
attrs: {
|
|
2386
|
+
type: 'text/css'
|
|
2387
|
+
}
|
|
2388
|
+
}, [api.t(content)]);
|
|
2386
2389
|
}
|
|
2390
|
+
|
|
2387
2391
|
function updateStylesheetToken(vm, template) {
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
if (!isUndefined$1(oldToken)) {
|
|
2398
|
-
if (oldHasTokenInClass) {
|
|
2399
|
-
getClassList(elm).remove(makeHostToken(oldToken));
|
|
2400
|
-
}
|
|
2401
|
-
if (oldHasTokenInAttribute) {
|
|
2402
|
-
removeAttribute(elm, makeHostToken(oldToken));
|
|
2403
|
-
}
|
|
2392
|
+
const {
|
|
2393
|
+
elm,
|
|
2394
|
+
context,
|
|
2395
|
+
renderMode,
|
|
2396
|
+
shadowMode,
|
|
2397
|
+
renderer: {
|
|
2398
|
+
getClassList,
|
|
2399
|
+
removeAttribute,
|
|
2400
|
+
setAttribute
|
|
2404
2401
|
}
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2402
|
+
} = vm;
|
|
2403
|
+
const {
|
|
2404
|
+
stylesheets: newStylesheets,
|
|
2405
|
+
stylesheetToken: newStylesheetToken
|
|
2406
|
+
} = template;
|
|
2407
|
+
const isSyntheticShadow = renderMode === 1
|
|
2408
|
+
/* RenderMode.Shadow */
|
|
2409
|
+
&& shadowMode === 1
|
|
2410
|
+
/* ShadowMode.Synthetic */
|
|
2411
|
+
;
|
|
2412
|
+
const {
|
|
2413
|
+
hasScopedStyles
|
|
2414
|
+
} = context;
|
|
2415
|
+
let newToken;
|
|
2416
|
+
let newHasTokenInClass;
|
|
2417
|
+
let newHasTokenInAttribute; // Reset the styling token applied to the host element.
|
|
2418
|
+
|
|
2419
|
+
const {
|
|
2420
|
+
stylesheetToken: oldToken,
|
|
2421
|
+
hasTokenInClass: oldHasTokenInClass,
|
|
2422
|
+
hasTokenInAttribute: oldHasTokenInAttribute
|
|
2423
|
+
} = context;
|
|
2424
|
+
|
|
2425
|
+
if (!isUndefined$1(oldToken)) {
|
|
2426
|
+
if (oldHasTokenInClass) {
|
|
2427
|
+
getClassList(elm).remove(makeHostToken(oldToken));
|
|
2409
2428
|
}
|
|
2410
|
-
|
|
2411
|
-
if (
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2429
|
+
|
|
2430
|
+
if (oldHasTokenInAttribute) {
|
|
2431
|
+
removeAttribute(elm, makeHostToken(oldToken));
|
|
2432
|
+
}
|
|
2433
|
+
} // Apply the new template styling token to the host element, if the new template has any
|
|
2434
|
+
// associated stylesheets. In the case of light DOM, also ensure there is at least one scoped stylesheet.
|
|
2435
|
+
|
|
2436
|
+
|
|
2437
|
+
if (!isUndefined$1(newStylesheets) && newStylesheets.length !== 0) {
|
|
2438
|
+
newToken = newStylesheetToken;
|
|
2439
|
+
} // Set the new styling token on the host element
|
|
2440
|
+
|
|
2441
|
+
|
|
2442
|
+
if (!isUndefined$1(newToken)) {
|
|
2443
|
+
if (hasScopedStyles) {
|
|
2444
|
+
getClassList(elm).add(makeHostToken(newToken));
|
|
2445
|
+
newHasTokenInClass = true;
|
|
2446
|
+
}
|
|
2447
|
+
|
|
2448
|
+
if (isSyntheticShadow) {
|
|
2449
|
+
setAttribute(elm, makeHostToken(newToken), '');
|
|
2450
|
+
newHasTokenInAttribute = true;
|
|
2420
2451
|
}
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2452
|
+
} // Update the styling tokens present on the context object.
|
|
2453
|
+
|
|
2454
|
+
|
|
2455
|
+
context.stylesheetToken = newToken;
|
|
2456
|
+
context.hasTokenInClass = newHasTokenInClass;
|
|
2457
|
+
context.hasTokenInAttribute = newHasTokenInAttribute;
|
|
2425
2458
|
}
|
|
2459
|
+
|
|
2426
2460
|
function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2461
|
+
const content = [];
|
|
2462
|
+
let root;
|
|
2463
|
+
|
|
2464
|
+
for (let i = 0; i < stylesheets.length; i++) {
|
|
2465
|
+
let stylesheet = stylesheets[i];
|
|
2466
|
+
|
|
2467
|
+
if (isArray$1(stylesheet)) {
|
|
2468
|
+
ArrayPush$1.apply(content, evaluateStylesheetsContent(stylesheet, stylesheetToken, vm));
|
|
2469
|
+
} else {
|
|
2470
|
+
|
|
2471
|
+
const isScopedCss = stylesheet[KEY__SCOPED_CSS];
|
|
2472
|
+
|
|
2473
|
+
if (lwcRuntimeFlags.DISABLE_LIGHT_DOM_UNSCOPED_CSS) {
|
|
2474
|
+
if (!isScopedCss && vm.renderMode === 0
|
|
2475
|
+
/* RenderMode.Light */
|
|
2476
|
+
) {
|
|
2477
|
+
logError('Unscoped CSS is not supported in Light DOM. Please use scoped CSS (*.scoped.css) instead of unscoped CSS (*.css).');
|
|
2478
|
+
continue;
|
|
2433
2479
|
}
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2480
|
+
} // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
|
|
2481
|
+
|
|
2482
|
+
|
|
2483
|
+
const scopeToken = isScopedCss || vm.shadowMode === 1
|
|
2484
|
+
/* ShadowMode.Synthetic */
|
|
2485
|
+
&& vm.renderMode === 1
|
|
2486
|
+
/* RenderMode.Shadow */
|
|
2487
|
+
? stylesheetToken : undefined; // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
|
|
2488
|
+
// native shadow DOM. Synthetic shadow DOM never uses `:host`.
|
|
2489
|
+
|
|
2490
|
+
const useActualHostSelector = vm.renderMode === 0
|
|
2491
|
+
/* RenderMode.Light */
|
|
2492
|
+
? !isScopedCss : vm.shadowMode === 0
|
|
2493
|
+
/* ShadowMode.Native */
|
|
2494
|
+
; // Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
|
|
2495
|
+
// we use an attribute selector on the host to simulate :dir().
|
|
2496
|
+
|
|
2497
|
+
let useNativeDirPseudoclass;
|
|
2498
|
+
|
|
2499
|
+
if (vm.renderMode === 1
|
|
2500
|
+
/* RenderMode.Shadow */
|
|
2501
|
+
) {
|
|
2502
|
+
useNativeDirPseudoclass = vm.shadowMode === 0
|
|
2503
|
+
/* ShadowMode.Native */
|
|
2504
|
+
;
|
|
2505
|
+
} else {
|
|
2506
|
+
// Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
|
|
2507
|
+
// At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
|
|
2508
|
+
if (isUndefined$1(root)) {
|
|
2509
|
+
// Only calculate the root once as necessary
|
|
2510
|
+
root = getNearestShadowComponent(vm);
|
|
2462
2511
|
}
|
|
2512
|
+
|
|
2513
|
+
useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0
|
|
2514
|
+
/* ShadowMode.Native */
|
|
2515
|
+
;
|
|
2516
|
+
}
|
|
2517
|
+
|
|
2518
|
+
ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
|
|
2463
2519
|
}
|
|
2464
|
-
|
|
2520
|
+
}
|
|
2521
|
+
|
|
2522
|
+
return content;
|
|
2465
2523
|
}
|
|
2524
|
+
|
|
2466
2525
|
function getStylesheetsContent(vm, template) {
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2526
|
+
const {
|
|
2527
|
+
stylesheets,
|
|
2528
|
+
stylesheetToken
|
|
2529
|
+
} = template;
|
|
2530
|
+
let content = [];
|
|
2531
|
+
|
|
2532
|
+
if (!isUndefined$1(stylesheets) && stylesheets.length !== 0) {
|
|
2533
|
+
content = evaluateStylesheetsContent(stylesheets, stylesheetToken, vm);
|
|
2534
|
+
}
|
|
2535
|
+
|
|
2536
|
+
return content;
|
|
2537
|
+
} // It might be worth caching this to avoid doing the lookup repeatedly, but
|
|
2475
2538
|
// perf testing has not shown it to be a huge improvement yet:
|
|
2476
2539
|
// https://github.com/salesforce/lwc/pull/2460#discussion_r691208892
|
|
2540
|
+
|
|
2477
2541
|
function getNearestShadowComponent(vm) {
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2542
|
+
let owner = vm;
|
|
2543
|
+
|
|
2544
|
+
while (!isNull(owner)) {
|
|
2545
|
+
if (owner.renderMode === 1
|
|
2546
|
+
/* RenderMode.Shadow */
|
|
2547
|
+
) {
|
|
2548
|
+
return owner;
|
|
2484
2549
|
}
|
|
2485
|
-
|
|
2550
|
+
|
|
2551
|
+
owner = owner.owner;
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2554
|
+
return owner;
|
|
2486
2555
|
}
|
|
2487
2556
|
/**
|
|
2488
2557
|
* If the component that is currently being rendered uses scoped styles,
|
|
2489
2558
|
* this returns the unique token for that scoped stylesheet. Otherwise
|
|
2490
2559
|
* it returns null.
|
|
2491
2560
|
*/
|
|
2561
|
+
|
|
2562
|
+
|
|
2492
2563
|
function getScopeTokenClass(owner) {
|
|
2493
|
-
|
|
2494
|
-
|
|
2564
|
+
const {
|
|
2565
|
+
cmpTemplate,
|
|
2566
|
+
context
|
|
2567
|
+
} = owner;
|
|
2568
|
+
return context.hasScopedStyles && (cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken) || null;
|
|
2495
2569
|
}
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2570
|
+
/**
|
|
2571
|
+
* This function returns the host style token for a custom element if it
|
|
2572
|
+
* exists. Otherwise it returns null.
|
|
2573
|
+
*/
|
|
2574
|
+
|
|
2575
|
+
function getStylesheetTokenHost(vnode) {
|
|
2576
|
+
const {
|
|
2577
|
+
template: {
|
|
2578
|
+
stylesheetToken
|
|
2502
2579
|
}
|
|
2503
|
-
|
|
2580
|
+
} = getComponentInternalDef(vnode.ctor);
|
|
2581
|
+
return !isUndefined$1(stylesheetToken) ? makeHostToken(stylesheetToken) : null;
|
|
2582
|
+
}
|
|
2583
|
+
|
|
2584
|
+
function getNearestNativeShadowComponent(vm) {
|
|
2585
|
+
const owner = getNearestShadowComponent(vm);
|
|
2586
|
+
|
|
2587
|
+
if (!isNull(owner) && owner.shadowMode === 1
|
|
2588
|
+
/* ShadowMode.Synthetic */
|
|
2589
|
+
) {
|
|
2590
|
+
// Synthetic-within-native is impossible. So if the nearest shadow component is
|
|
2591
|
+
// synthetic, we know we won't find a native component if we go any further.
|
|
2592
|
+
return null;
|
|
2593
|
+
}
|
|
2594
|
+
|
|
2595
|
+
return owner;
|
|
2504
2596
|
}
|
|
2597
|
+
|
|
2505
2598
|
function createStylesheet(vm, stylesheets) {
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
}
|
|
2512
|
-
else if (vm.hydrated) {
|
|
2513
|
-
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
2514
|
-
// This works in the client, because the stylesheets are created, and cached in the VM
|
|
2515
|
-
// the first time the VM renders.
|
|
2516
|
-
// native shadow or light DOM, SSR
|
|
2517
|
-
return ArrayMap.call(stylesheets, createInlineStyleVNode);
|
|
2599
|
+
const {
|
|
2600
|
+
renderMode,
|
|
2601
|
+
shadowMode,
|
|
2602
|
+
renderer: {
|
|
2603
|
+
insertStylesheet
|
|
2518
2604
|
}
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2605
|
+
} = vm;
|
|
2606
|
+
|
|
2607
|
+
if (renderMode === 1
|
|
2608
|
+
/* RenderMode.Shadow */
|
|
2609
|
+
&& shadowMode === 1
|
|
2610
|
+
/* ShadowMode.Synthetic */
|
|
2611
|
+
) {
|
|
2612
|
+
for (let i = 0; i < stylesheets.length; i++) {
|
|
2613
|
+
insertStylesheet(stylesheets[i]);
|
|
2614
|
+
}
|
|
2615
|
+
} else if (vm.hydrated) {
|
|
2616
|
+
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
2617
|
+
// This works in the client, because the stylesheets are created, and cached in the VM
|
|
2618
|
+
// the first time the VM renders.
|
|
2619
|
+
// native shadow or light DOM, SSR
|
|
2620
|
+
return ArrayMap.call(stylesheets, createInlineStyleVNode);
|
|
2621
|
+
} else {
|
|
2622
|
+
// native shadow or light DOM, DOM renderer
|
|
2623
|
+
const root = getNearestNativeShadowComponent(vm); // null root means a global style
|
|
2624
|
+
|
|
2625
|
+
const target = isNull(root) ? undefined : root.shadowRoot;
|
|
2626
|
+
|
|
2627
|
+
for (let i = 0; i < stylesheets.length; i++) {
|
|
2628
|
+
insertStylesheet(stylesheets[i], target);
|
|
2527
2629
|
}
|
|
2528
|
-
|
|
2630
|
+
}
|
|
2631
|
+
|
|
2632
|
+
return null;
|
|
2529
2633
|
}
|
|
2530
2634
|
|
|
2531
2635
|
/*
|
|
@@ -2604,6 +2708,9 @@ var LWC = (function (exports) {
|
|
|
2604
2708
|
function isSameVnode(vnode1, vnode2) {
|
|
2605
2709
|
return vnode1.key === vnode2.key && vnode1.sel === vnode2.sel;
|
|
2606
2710
|
}
|
|
2711
|
+
function isVCustomElement(vnode) {
|
|
2712
|
+
return vnode.type === 3 /* VNodeType.CustomElement */;
|
|
2713
|
+
}
|
|
2607
2714
|
|
|
2608
2715
|
/*
|
|
2609
2716
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5445,6 +5552,7 @@ var LWC = (function (exports) {
|
|
|
5445
5552
|
let { className, classMap } = data;
|
|
5446
5553
|
const { getProperty, getClassList } = renderer;
|
|
5447
5554
|
const scopedToken = getScopeTokenClass(owner);
|
|
5555
|
+
const stylesheetTokenHost = isVCustomElement(vnode) ? getStylesheetTokenHost(vnode) : null;
|
|
5448
5556
|
// Classnames for scoped CSS are added directly to the DOM during rendering,
|
|
5449
5557
|
// or to the VDOM on the server in the case of SSR. As such, these classnames
|
|
5450
5558
|
// are never present in VDOM nodes in the browser.
|
|
@@ -5453,10 +5561,17 @@ var LWC = (function (exports) {
|
|
|
5453
5561
|
// are rendered during SSR. This needs to be accounted for when validating.
|
|
5454
5562
|
if (scopedToken) {
|
|
5455
5563
|
if (!isUndefined$1(className)) {
|
|
5456
|
-
className =
|
|
5564
|
+
className = isNull(stylesheetTokenHost)
|
|
5565
|
+
? `${scopedToken} ${className}`
|
|
5566
|
+
: `${scopedToken} ${className} ${stylesheetTokenHost}`;
|
|
5457
5567
|
}
|
|
5458
5568
|
else if (!isUndefined$1(classMap)) {
|
|
5459
|
-
classMap = Object.assign(Object.assign({}, classMap), { [scopedToken]: true });
|
|
5569
|
+
classMap = Object.assign(Object.assign(Object.assign({}, classMap), { [scopedToken]: true }), (isNull(stylesheetTokenHost) ? {} : { [stylesheetTokenHost]: true }));
|
|
5570
|
+
}
|
|
5571
|
+
else {
|
|
5572
|
+
className = isNull(stylesheetTokenHost)
|
|
5573
|
+
? `${scopedToken}`
|
|
5574
|
+
: `${scopedToken} ${stylesheetTokenHost}`;
|
|
5460
5575
|
}
|
|
5461
5576
|
}
|
|
5462
5577
|
let nodesAreCompatible = true;
|
|
@@ -5585,7 +5700,7 @@ var LWC = (function (exports) {
|
|
|
5585
5700
|
}
|
|
5586
5701
|
return ctor;
|
|
5587
5702
|
}
|
|
5588
|
-
/* version: 2.
|
|
5703
|
+
/* version: 2.25.1 */
|
|
5589
5704
|
|
|
5590
5705
|
/*
|
|
5591
5706
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5780,7 +5895,7 @@ var LWC = (function (exports) {
|
|
|
5780
5895
|
function isNull(obj) {
|
|
5781
5896
|
return obj === null;
|
|
5782
5897
|
}
|
|
5783
|
-
/** version: 2.
|
|
5898
|
+
/** version: 2.25.1 */
|
|
5784
5899
|
|
|
5785
5900
|
/*
|
|
5786
5901
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -6391,7 +6506,7 @@ var LWC = (function (exports) {
|
|
|
6391
6506
|
});
|
|
6392
6507
|
freeze(LightningElement);
|
|
6393
6508
|
seal(LightningElement.prototype);
|
|
6394
|
-
/* version: 2.
|
|
6509
|
+
/* version: 2.25.1 */
|
|
6395
6510
|
|
|
6396
6511
|
exports.LightningElement = LightningElement;
|
|
6397
6512
|
exports.__unstable__ProfilerControl = profilerControl;
|
|
@@ -365,9 +365,9 @@ var LWC = (function (exports) {
|
|
|
365
365
|
// Increment whenever the LWC template compiler changes
|
|
366
366
|
|
|
367
367
|
|
|
368
|
-
var LWC_VERSION = "2.
|
|
368
|
+
var LWC_VERSION = "2.25.1";
|
|
369
369
|
var LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
370
|
-
/** version: 2.
|
|
370
|
+
/** version: 2.25.1 */
|
|
371
371
|
|
|
372
372
|
/**
|
|
373
373
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -461,7 +461,7 @@ var LWC = (function (exports) {
|
|
|
461
461
|
patch$1(propName);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
/** version: 2.
|
|
464
|
+
/** version: 2.25.1 */
|
|
465
465
|
|
|
466
466
|
/**
|
|
467
467
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -488,7 +488,8 @@ var LWC = (function (exports) {
|
|
|
488
488
|
ENABLE_NODE_PATCH: null,
|
|
489
489
|
ENABLE_REACTIVE_SETTER: null,
|
|
490
490
|
ENABLE_WIRE_SYNC_EMIT: null,
|
|
491
|
-
ENABLE_LIGHT_GET_ROOT_NODE_PATCH: null
|
|
491
|
+
ENABLE_LIGHT_GET_ROOT_NODE_PATCH: null,
|
|
492
|
+
DISABLE_LIGHT_DOM_UNSCOPED_CSS: null
|
|
492
493
|
};
|
|
493
494
|
|
|
494
495
|
if (!_globalThis.lwcRuntimeFlags) {
|
|
@@ -554,7 +555,7 @@ var LWC = (function (exports) {
|
|
|
554
555
|
setFeatureFlag(name, value);
|
|
555
556
|
}
|
|
556
557
|
}
|
|
557
|
-
/** version: 2.
|
|
558
|
+
/** version: 2.25.1 */
|
|
558
559
|
|
|
559
560
|
/*
|
|
560
561
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -4348,7 +4349,17 @@ var LWC = (function (exports) {
|
|
|
4348
4349
|
stylesheet = getStyleOrSwappedStyle(stylesheet);
|
|
4349
4350
|
}
|
|
4350
4351
|
|
|
4351
|
-
var isScopedCss = stylesheet[KEY__SCOPED_CSS];
|
|
4352
|
+
var isScopedCss = stylesheet[KEY__SCOPED_CSS];
|
|
4353
|
+
|
|
4354
|
+
if (lwcRuntimeFlags.DISABLE_LIGHT_DOM_UNSCOPED_CSS) {
|
|
4355
|
+
if (!isScopedCss && vm.renderMode === 0
|
|
4356
|
+
/* RenderMode.Light */
|
|
4357
|
+
) {
|
|
4358
|
+
logError('Unscoped CSS is not supported in Light DOM. Please use scoped CSS (*.scoped.css) instead of unscoped CSS (*.css).');
|
|
4359
|
+
continue;
|
|
4360
|
+
}
|
|
4361
|
+
} // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
|
|
4362
|
+
|
|
4352
4363
|
|
|
4353
4364
|
var scopeToken = isScopedCss || vm.shadowMode === 1
|
|
4354
4365
|
/* ShadowMode.Synthetic */
|
|
@@ -4434,6 +4445,18 @@ var LWC = (function (exports) {
|
|
|
4434
4445
|
context = owner.context;
|
|
4435
4446
|
return context.hasScopedStyles && (cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken) || null;
|
|
4436
4447
|
}
|
|
4448
|
+
/**
|
|
4449
|
+
* This function returns the host style token for a custom element if it
|
|
4450
|
+
* exists. Otherwise it returns null.
|
|
4451
|
+
*/
|
|
4452
|
+
|
|
4453
|
+
|
|
4454
|
+
function getStylesheetTokenHost(vnode) {
|
|
4455
|
+
var _getComponentInternal = getComponentInternalDef(vnode.ctor),
|
|
4456
|
+
stylesheetToken = _getComponentInternal.template.stylesheetToken;
|
|
4457
|
+
|
|
4458
|
+
return !isUndefined$1(stylesheetToken) ? makeHostToken(stylesheetToken) : null;
|
|
4459
|
+
}
|
|
4437
4460
|
|
|
4438
4461
|
function getNearestNativeShadowComponent(vm) {
|
|
4439
4462
|
var owner = getNearestShadowComponent(vm);
|
|
@@ -4579,6 +4602,12 @@ var LWC = (function (exports) {
|
|
|
4579
4602
|
function isSameVnode(vnode1, vnode2) {
|
|
4580
4603
|
return vnode1.key === vnode2.key && vnode1.sel === vnode2.sel;
|
|
4581
4604
|
}
|
|
4605
|
+
|
|
4606
|
+
function isVCustomElement(vnode) {
|
|
4607
|
+
return vnode.type === 3
|
|
4608
|
+
/* VNodeType.CustomElement */
|
|
4609
|
+
;
|
|
4610
|
+
}
|
|
4582
4611
|
/*
|
|
4583
4612
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
4584
4613
|
* All rights reserved.
|
|
@@ -8192,7 +8221,8 @@ var LWC = (function (exports) {
|
|
|
8192
8221
|
classMap = data.classMap;
|
|
8193
8222
|
var getProperty = renderer.getProperty,
|
|
8194
8223
|
getClassList = renderer.getClassList;
|
|
8195
|
-
var scopedToken = getScopeTokenClass(owner);
|
|
8224
|
+
var scopedToken = getScopeTokenClass(owner);
|
|
8225
|
+
var stylesheetTokenHost = isVCustomElement(vnode) ? getStylesheetTokenHost(vnode) : null; // Classnames for scoped CSS are added directly to the DOM during rendering,
|
|
8196
8226
|
// or to the VDOM on the server in the case of SSR. As such, these classnames
|
|
8197
8227
|
// are never present in VDOM nodes in the browser.
|
|
8198
8228
|
//
|
|
@@ -8201,9 +8231,11 @@ var LWC = (function (exports) {
|
|
|
8201
8231
|
|
|
8202
8232
|
if (scopedToken) {
|
|
8203
8233
|
if (!isUndefined$1(className)) {
|
|
8204
|
-
className = "".concat(scopedToken, " ").concat(className);
|
|
8234
|
+
className = isNull(stylesheetTokenHost) ? "".concat(scopedToken, " ").concat(className) : "".concat(scopedToken, " ").concat(className, " ").concat(stylesheetTokenHost);
|
|
8205
8235
|
} else if (!isUndefined$1(classMap)) {
|
|
8206
|
-
classMap = Object.assign(Object.assign({}, classMap), _defineProperty({}, scopedToken, true));
|
|
8236
|
+
classMap = Object.assign(Object.assign(Object.assign({}, classMap), _defineProperty({}, scopedToken, true)), isNull(stylesheetTokenHost) ? {} : _defineProperty({}, stylesheetTokenHost, true));
|
|
8237
|
+
} else {
|
|
8238
|
+
className = isNull(stylesheetTokenHost) ? "".concat(scopedToken) : "".concat(scopedToken, " ").concat(stylesheetTokenHost);
|
|
8207
8239
|
}
|
|
8208
8240
|
}
|
|
8209
8241
|
|
|
@@ -8519,7 +8551,7 @@ var LWC = (function (exports) {
|
|
|
8519
8551
|
|
|
8520
8552
|
return ctor;
|
|
8521
8553
|
}
|
|
8522
|
-
/* version: 2.
|
|
8554
|
+
/* version: 2.25.1 */
|
|
8523
8555
|
|
|
8524
8556
|
/*
|
|
8525
8557
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -8747,7 +8779,7 @@ var LWC = (function (exports) {
|
|
|
8747
8779
|
function isNull(obj) {
|
|
8748
8780
|
return obj === null;
|
|
8749
8781
|
}
|
|
8750
|
-
/** version: 2.
|
|
8782
|
+
/** version: 2.25.1 */
|
|
8751
8783
|
|
|
8752
8784
|
/*
|
|
8753
8785
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -9477,7 +9509,7 @@ var LWC = (function (exports) {
|
|
|
9477
9509
|
});
|
|
9478
9510
|
freeze(LightningElement);
|
|
9479
9511
|
seal(LightningElement.prototype);
|
|
9480
|
-
/* version: 2.
|
|
9512
|
+
/* version: 2.25.1 */
|
|
9481
9513
|
|
|
9482
9514
|
exports.LightningElement = LightningElement;
|
|
9483
9515
|
exports.__unstable__ProfilerControl = profilerControl;
|