@carbon/ibmdotcom-web-components 2.46.0 → 2.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +6 -0
- package/dist/dotcom-shell.js +5 -5
- package/dist/dotcom-shell.min.js +5 -5
- package/dist/ibmdotcom-web-components-dotcom-shell.js +5 -5
- package/dist/ibmdotcom-web-components-dotcom-shell.min.js +5 -5
- package/dist/{index-2a27319c.js → index-2afb6b83.js} +79 -11
- package/dist/{index-6499062e.js → index-d71fad5e.js} +9 -9
- package/dist/{left-nav-menu-87cb8009.js → left-nav-menu-c200cfbf.js} +5 -5
- package/dist/{left-nav-menu-category-heading-f24e3053.js → left-nav-menu-category-heading-5e03be50.js} +5 -5
- package/dist/{left-nav-menu-category-heading-8d21b7ff.js → left-nav-menu-category-heading-920e6a4d.js} +5 -5
- package/dist/{left-nav-menu-d2fd2328.js → left-nav-menu-fd372a33.js} +5 -5
- package/dist/{left-nav-menu-item-c7dd7954.js → left-nav-menu-item-4f1e5c31.js} +5 -5
- package/dist/{left-nav-menu-item-65681d32.js → left-nav-menu-item-7fdb8ccb.js} +5 -5
- package/dist/{left-nav-menu-section-dfce35ff.js → left-nav-menu-section-030cb39a.js} +5 -5
- package/dist/{left-nav-menu-section-8f88f76b.js → left-nav-menu-section-6b023c26.js} +5 -5
- package/dist/{left-nav-overlay-69e1d9a3.js → left-nav-overlay-08587d78.js} +5 -5
- package/dist/{left-nav-overlay-da850571.js → left-nav-overlay-889c0a90.js} +5 -5
- package/dist/{megamenu-category-group-6674efc2.js → megamenu-category-group-26bd14a7.js} +5 -5
- package/dist/{megamenu-category-group-copy-49c71042.js → megamenu-category-group-copy-3b2207e3.js} +5 -5
- package/dist/{megamenu-category-group-copy-5da065ae.js → megamenu-category-group-copy-6164fd89.js} +5 -5
- package/dist/{megamenu-category-group-c3e817e7.js → megamenu-category-group-dd55d8cd.js} +5 -5
- package/dist/{megamenu-category-heading-e38dad42.js → megamenu-category-heading-1916b04a.js} +5 -5
- package/dist/{megamenu-category-heading-7cf0e3e0.js → megamenu-category-heading-7d136716.js} +5 -5
- package/dist/{megamenu-category-link-fc2fc4fe.js → megamenu-category-link-5b9838a2.js} +5 -5
- package/dist/{megamenu-category-link-46334ebb.js → megamenu-category-link-d47b8f6a.js} +5 -5
- package/dist/{megamenu-category-link-group-20985052.js → megamenu-category-link-group-97e7fb8f.js} +5 -5
- package/dist/{megamenu-category-link-group-240c9051.js → megamenu-category-link-group-c112da07.js} +5 -5
- package/dist/{megamenu-left-navigation-f119bbfc.js → megamenu-left-navigation-68bc901a.js} +5 -5
- package/dist/{megamenu-left-navigation-6245546d.js → megamenu-left-navigation-8bbb4f4b.js} +5 -5
- package/dist/{megamenu-overlay-6350b555.js → megamenu-overlay-1e5cbcc8.js} +5 -5
- package/dist/{megamenu-overlay-babb8218.js → megamenu-overlay-a191f87b.js} +5 -5
- package/dist/{megamenu-tab-320d35fa.js → megamenu-tab-15ccf09c.js} +5 -5
- package/dist/{megamenu-tab-f8d14ecf.js → megamenu-tab-70d5982a.js} +5 -5
- package/es/components/masthead/masthead-cart.d.ts +14 -1
- package/es/components/masthead/masthead-cart.js +75 -7
- package/es/components/masthead/masthead-cart.js.map +1 -1
- package/package.json +2 -2
package/custom-elements.json
CHANGED
|
@@ -17789,6 +17789,12 @@
|
|
|
17789
17789
|
"type": "{ lc: string; cc: string; }",
|
|
17790
17790
|
"default": "{\"lc\":\"en\",\"cc\":\"us\"}"
|
|
17791
17791
|
},
|
|
17792
|
+
{
|
|
17793
|
+
"name": "updateCart",
|
|
17794
|
+
"description": "Updates cart state",
|
|
17795
|
+
"type": "() => void",
|
|
17796
|
+
"default": "\"() => {\\n const hasCart = SAPCommerceAPI.hasActiveCart();\\n this.hasActiveCart = hasCart;\\n }\""
|
|
17797
|
+
},
|
|
17792
17798
|
{
|
|
17793
17799
|
"name": "styles",
|
|
17794
17800
|
"default": "\"styles\""
|
package/dist/dotcom-shell.js
CHANGED
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
21
21
|
* LICENSE file in the root directory of this source tree.
|
|
22
22
|
*
|
|
23
|
-
* lit-
|
|
23
|
+
* lit-element:
|
|
24
24
|
*
|
|
25
25
|
* @license
|
|
26
|
-
* Copyright
|
|
26
|
+
* Copyright 2017 Google LLC
|
|
27
27
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
28
|
*
|
|
29
|
-
* lit-
|
|
29
|
+
* lit-html:
|
|
30
30
|
*
|
|
31
31
|
* @license
|
|
32
|
-
* Copyright
|
|
32
|
+
* Copyright 2022 Google LLC
|
|
33
33
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
34
34
|
*
|
|
35
35
|
* @lit/reactive-element:
|
|
@@ -88,4 +88,4 @@
|
|
|
88
88
|
*/
|
|
89
89
|
|
|
90
90
|
let process = { env: {} };
|
|
91
|
-
import './index-
|
|
91
|
+
import './index-2afb6b83.js';
|
package/dist/dotcom-shell.min.js
CHANGED
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
21
21
|
* LICENSE file in the root directory of this source tree.
|
|
22
22
|
*
|
|
23
|
-
* lit-
|
|
23
|
+
* lit-element:
|
|
24
24
|
*
|
|
25
25
|
* @license
|
|
26
|
-
* Copyright
|
|
26
|
+
* Copyright 2017 Google LLC
|
|
27
27
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
28
|
*
|
|
29
|
-
* lit-
|
|
29
|
+
* lit-html:
|
|
30
30
|
*
|
|
31
31
|
* @license
|
|
32
|
-
* Copyright
|
|
32
|
+
* Copyright 2022 Google LLC
|
|
33
33
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
34
34
|
*
|
|
35
35
|
* @lit/reactive-element:
|
|
@@ -87,4 +87,4 @@
|
|
|
87
87
|
* https://www.npmjs.com/package/striptags
|
|
88
88
|
*/
|
|
89
89
|
|
|
90
|
-
import"./index-
|
|
90
|
+
import"./index-d71fad5e.js";
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
21
21
|
* LICENSE file in the root directory of this source tree.
|
|
22
22
|
*
|
|
23
|
-
* lit-
|
|
23
|
+
* lit-element:
|
|
24
24
|
*
|
|
25
25
|
* @license
|
|
26
|
-
* Copyright
|
|
26
|
+
* Copyright 2017 Google LLC
|
|
27
27
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
28
|
*
|
|
29
|
-
* lit-
|
|
29
|
+
* lit-html:
|
|
30
30
|
*
|
|
31
31
|
* @license
|
|
32
|
-
* Copyright
|
|
32
|
+
* Copyright 2022 Google LLC
|
|
33
33
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
34
34
|
*
|
|
35
35
|
* @lit/reactive-element:
|
|
@@ -88,4 +88,4 @@
|
|
|
88
88
|
*/
|
|
89
89
|
|
|
90
90
|
let process = { env: {} };
|
|
91
|
-
import './index-
|
|
91
|
+
import './index-2afb6b83.js';
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
21
21
|
* LICENSE file in the root directory of this source tree.
|
|
22
22
|
*
|
|
23
|
-
* lit-
|
|
23
|
+
* lit-element:
|
|
24
24
|
*
|
|
25
25
|
* @license
|
|
26
|
-
* Copyright
|
|
26
|
+
* Copyright 2017 Google LLC
|
|
27
27
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
28
|
*
|
|
29
|
-
* lit-
|
|
29
|
+
* lit-html:
|
|
30
30
|
*
|
|
31
31
|
* @license
|
|
32
|
-
* Copyright
|
|
32
|
+
* Copyright 2022 Google LLC
|
|
33
33
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
34
34
|
*
|
|
35
35
|
* @lit/reactive-element:
|
|
@@ -87,4 +87,4 @@
|
|
|
87
87
|
* https://www.npmjs.com/package/striptags
|
|
88
88
|
*/
|
|
89
89
|
|
|
90
|
-
import"./index-
|
|
90
|
+
import"./index-d71fad5e.js";
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
21
21
|
* LICENSE file in the root directory of this source tree.
|
|
22
22
|
*
|
|
23
|
-
* lit-
|
|
23
|
+
* lit-element:
|
|
24
24
|
*
|
|
25
25
|
* @license
|
|
26
|
-
* Copyright
|
|
26
|
+
* Copyright 2017 Google LLC
|
|
27
27
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
28
|
*
|
|
29
|
-
* lit-
|
|
29
|
+
* lit-html:
|
|
30
30
|
*
|
|
31
31
|
* @license
|
|
32
|
-
* Copyright
|
|
32
|
+
* Copyright 2022 Google LLC
|
|
33
33
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
34
34
|
*
|
|
35
35
|
* @lit/reactive-element:
|
|
@@ -33015,7 +33015,7 @@ let C4DMegaMenuTopNavMenu = _decorate$s([carbonElement(`${c4dPrefix$s}-megamenu-
|
|
|
33015
33015
|
var _this$parentElement;
|
|
33016
33016
|
// Import needed subcomponents on first expansion
|
|
33017
33017
|
if (!((_this$parentElement = this.parentElement) !== null && _this$parentElement !== void 0 && _this$parentElement.importedMegamenu)) {
|
|
33018
|
-
await Promise.all([import('./megamenu-left-navigation-
|
|
33018
|
+
await Promise.all([import('./megamenu-left-navigation-68bc901a.js'), import('./megamenu-category-link-d47b8f6a.js'), import('./megamenu-category-link-group-c112da07.js'), import('./megamenu-category-group-26bd14a7.js'), import('./megamenu-category-group-copy-3b2207e3.js'), import('./megamenu-category-heading-1916b04a.js'), Promise.resolve().then(function () { return megamenuLinkWithIcon; }), import('./megamenu-overlay-a191f87b.js'), import('./megamenu-tab-70d5982a.js'), Promise.resolve().then(function () { return megamenuTabs; })]);
|
|
33019
33019
|
this.parentElement.importedMegamenu = true;
|
|
33020
33020
|
}
|
|
33021
33021
|
|
|
@@ -36661,13 +36661,81 @@ _decorate$i([carbonElement(`${c4dPrefix$i}-masthead-cart`)], function (_initiali
|
|
|
36661
36661
|
|
|
36662
36662
|
function connectedCallback() {
|
|
36663
36663
|
_superPropGet$c(C4DMastheadCart, "connectedCallback", this, 3)([]);
|
|
36664
|
-
|
|
36665
|
-
|
|
36666
|
-
|
|
36664
|
+
|
|
36665
|
+
// Initial check
|
|
36666
|
+
this.updateCart();
|
|
36667
|
+
|
|
36668
|
+
// Fallback retry
|
|
36669
|
+
this.checkCartWithRetry();
|
|
36670
|
+
|
|
36671
|
+
// Listen for cross-tab updates
|
|
36672
|
+
window.addEventListener('storage', this.updateCart);
|
|
36673
|
+
|
|
36674
|
+
// Fetch locale
|
|
36667
36675
|
LocaleAPI.getLocale().then(locale => {
|
|
36668
36676
|
this.locale = locale;
|
|
36669
36677
|
});
|
|
36670
36678
|
}
|
|
36679
|
+
}, {
|
|
36680
|
+
kind: "method",
|
|
36681
|
+
key: "disconnectedCallback",
|
|
36682
|
+
value: function disconnectedCallback() {
|
|
36683
|
+
_superPropGet$c(C4DMastheadCart, "disconnectedCallback", this, 3)([]);
|
|
36684
|
+
window.removeEventListener('storage', this.updateCart);
|
|
36685
|
+
}
|
|
36686
|
+
|
|
36687
|
+
/**
|
|
36688
|
+
* Updates cart state
|
|
36689
|
+
*/
|
|
36690
|
+
}, {
|
|
36691
|
+
kind: "field",
|
|
36692
|
+
key: "updateCart",
|
|
36693
|
+
value() {
|
|
36694
|
+
return () => {
|
|
36695
|
+
const hasCart = SAPCommerceAPI.hasActiveCart();
|
|
36696
|
+
this.hasActiveCart = hasCart;
|
|
36697
|
+
};
|
|
36698
|
+
}
|
|
36699
|
+
}, {
|
|
36700
|
+
kind: "method",
|
|
36701
|
+
key: "checkCartWithRetry",
|
|
36702
|
+
value:
|
|
36703
|
+
/**
|
|
36704
|
+
* Checks if the user has an active cart and retries a few times if the cart cookie is not available yet.
|
|
36705
|
+
*/
|
|
36706
|
+
function checkCartWithRetry(retries = 5, delay = 200) {
|
|
36707
|
+
const check = () => {
|
|
36708
|
+
const hasCart = SAPCommerceAPI.hasActiveCart();
|
|
36709
|
+
if (hasCart) {
|
|
36710
|
+
this.hasActiveCart = true;
|
|
36711
|
+
return;
|
|
36712
|
+
}
|
|
36713
|
+
if (retries > 0) {
|
|
36714
|
+
retries--;
|
|
36715
|
+
setTimeout(check, delay);
|
|
36716
|
+
}
|
|
36717
|
+
};
|
|
36718
|
+
check();
|
|
36719
|
+
}
|
|
36720
|
+
|
|
36721
|
+
/**
|
|
36722
|
+
* Filter the correct checkout URL based on locale and country code.
|
|
36723
|
+
*/
|
|
36724
|
+
}, {
|
|
36725
|
+
kind: "method",
|
|
36726
|
+
key: "handleURL",
|
|
36727
|
+
value: function handleURL(cc, lc) {
|
|
36728
|
+
switch (cc) {
|
|
36729
|
+
case 'uk':
|
|
36730
|
+
return `/store/en/gb/checkout`;
|
|
36731
|
+
case 'ae':
|
|
36732
|
+
return `/store/en/ae/checkout`;
|
|
36733
|
+
case 'sa':
|
|
36734
|
+
return `/store/en/sa/checkout`;
|
|
36735
|
+
default:
|
|
36736
|
+
return `/store/${lc}/${cc}/checkout`;
|
|
36737
|
+
}
|
|
36738
|
+
}
|
|
36671
36739
|
}, {
|
|
36672
36740
|
kind: "method",
|
|
36673
36741
|
key: "updated",
|
|
@@ -36694,12 +36762,12 @@ _decorate$i([carbonElement(`${c4dPrefix$i}-masthead-cart`)], function (_initiali
|
|
|
36694
36762
|
return x(_t$f || (_t$f = _$f`
|
|
36695
36763
|
<a
|
|
36696
36764
|
part="cart-link"
|
|
36697
|
-
href="
|
|
36765
|
+
href="${0}"
|
|
36698
36766
|
class="${0}--header__menu-item ${0}--header__menu-title"
|
|
36699
36767
|
aria-label="${0}"
|
|
36700
36768
|
>${0}</a
|
|
36701
36769
|
>
|
|
36702
|
-
`),
|
|
36770
|
+
`), this.handleURL(cc, lc), prefix$9, prefix$9, linkLabel, svgResultCarbonIcon$3());
|
|
36703
36771
|
}
|
|
36704
36772
|
}, {
|
|
36705
36773
|
kind: "get",
|
|
@@ -39078,7 +39146,7 @@ let C4DLeftNav = _decorate$b([carbonElement(`${c4dPrefix$b}-left-nav`)], functio
|
|
|
39078
39146
|
value() {
|
|
39079
39147
|
return async event => {
|
|
39080
39148
|
if (!this._importedSideNav) {
|
|
39081
|
-
await Promise.all([Promise.resolve().then(function () { return leftNavName; }), import('./left-nav-menu-
|
|
39149
|
+
await Promise.all([Promise.resolve().then(function () { return leftNavName; }), import('./left-nav-menu-fd372a33.js'), import('./left-nav-menu-section-030cb39a.js'), import('./left-nav-menu-item-7fdb8ccb.js'), import('./left-nav-menu-category-heading-920e6a4d.js'), import('./left-nav-overlay-889c0a90.js')]);
|
|
39082
39150
|
this._importedSideNav = true;
|
|
39083
39151
|
}
|
|
39084
39152
|
this.expanded = event.detail.active;
|