@designcrowd/library.brand-page 6.1.16 → 6.1.17-ast-header-button
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/lib/src/{CreatedOnBrandCrowd-de-de-CmNhDMIf.js → CreatedOnBrandCrowd-de-de-Cwq9enJs.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-DgplxxWa.js → CreatedOnBrandCrowd-en-us-ILK04gFj.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-DFdhFOa1.js → CreatedOnBrandCrowd-es-es-CbjxLxtu.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-DjLCWBLB.js → CreatedOnBrandCrowd-fr-ca-BwBDiK9z.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-DjLCWBLB.js → CreatedOnBrandCrowd-fr-fr-BwBDiK9z.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-CI2XD0OS.js → CreatedOnBrandCrowd-pt-br-DvhJROpG.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-CI2XD0OS.js → CreatedOnBrandCrowd-pt-pt-DvhJROpG.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-CkLkBztx.js → CreatedOnDcom-de-de-BK9imWOh.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-frnxBJJv.js → CreatedOnDcom-en-us-CyH-_qz1.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-CrqgiERj.js → CreatedOnDcom-es-es-Dh51qYEA.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-CPoEcusj.js → CreatedOnDcom-fr-ca-BArRxwWX.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-BqrRH3dV.js → CreatedOnDcom-fr-fr-CdglI-ZB.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-CpbVi3Sw.js → CreatedOnDcom-pt-br-DCehns-G.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-s0XZ3c7y.js → CreatedOnDcom-pt-pt-B8hl-oew.js} +1 -1
- package/lib/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.d.ts +27 -2
- package/lib/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.js +26 -0
- package/lib/src/brand-page/components/page-header/PageHeader.mixin.d.ts +3 -1
- package/lib/src/brand-page/components/page-header/PageHeader.mixin.js +12 -0
- package/lib/src/brand-page/models/index.d.ts +12 -0
- package/lib/src/brand-page/models/index.js +3 -0
- package/lib/src/brand-page/utils/button.util.d.ts +5 -0
- package/lib/src/brand-page/utils/button.util.js +4 -0
- package/lib/src/brand-page/utils/view-model.util.d.ts +1 -0
- package/lib/src/brand-page/utils/view-model.util.js +51 -1
- package/lib/src/brand-page/view-models.d.ts +3 -1
- package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +1 -1
- package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +1 -1
- package/lib/src/brand-page-maker/stores/ai-checkpoint/ai-checkpoint-store.d.ts +1008 -0
- package/lib/src/{bundled-translations-B2q5GWTQ.js → bundled-translations-B8fAEel0.js} +1 -1
- package/lib/src/bundles/bundled-translations.json +7 -1
- package/lib/src/css/library.brand-page-brandCrowd.min.css +315 -122
- package/lib/src/css/library.brand-page-brandPage.min.css +315 -122
- package/lib/src/css/library.brand-page-designCom.min.css +315 -122
- package/lib/src/css/library.brand-page-preview.min.css +315 -122
- package/lib/src/index.d.ts +1 -0
- package/lib/src/index.mjs +45 -44
- package/lib/src/{lib-O_eJgJHP.js → lib-KFjPFfxn.js} +31522 -31118
- package/lib/src/lib.js +1 -0
- package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +1 -1
- package/lib/src/shared/content-settings/components/payment-config-field/PaymentConfigField.mixin.d.ts +1 -1
- package/lib/src/shared/ecommerce-settings/util/refreshDuplicatedMetadata.d.ts +11 -0
- package/lib/src/shared/ecommerce-settings/util/refreshDuplicatedMetadata.js +80 -0
- package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +1 -1
- package/lib/src/shared/page-settings/components/delete-page-modal/DeletePageModal.mixin.d.ts +1 -1
- package/lib/src/shared/page-settings/components/new-page-modal/NewPageModal.mixin.d.ts +1 -1
- package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +113 -1
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +117 -2
- package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.js +43 -1
- package/lib/src/shared/page-settings/store/page-settings-store.d.ts +2 -2
- package/package.json +1 -1
- package/src/brand-page/components/button/Button.vue +35 -8
- package/src/brand-page/components/button/Button.vue.test.ts +59 -0
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.mixin.ts +29 -1
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.vue +36 -0
- package/src/brand-page/components/navigation/navigation-side-menu/NavigationSideMenu.vue.test.ts +175 -0
- package/src/brand-page/components/page/Page.vue +6 -0
- package/src/brand-page/components/page-header/HeaderLayout.vue +198 -4
- package/src/brand-page/components/page-header/PageHeader.mixin.ts +16 -1
- package/src/brand-page/components/page-header/PageHeader.vue +23 -1
- package/src/brand-page/components/page-header/PageHeader.vue.test.ts +378 -0
- package/src/brand-page/models/header-button.model.test.ts +86 -0
- package/src/brand-page/models/index.ts +16 -0
- package/src/brand-page/utils/__snapshots__/migration.util.test.ts.snap +6 -0
- package/src/brand-page/utils/__snapshots__/migration2.util.test.ts.snap +2 -0
- package/src/brand-page/utils/__snapshots__/model.util.test.ts.snap +4 -0
- package/src/brand-page/utils/button.util.ts +8 -0
- package/src/brand-page/utils/view-model.util.test.ts +146 -1
- package/src/brand-page/utils/view-model.util.ts +71 -1
- package/src/brand-page/view-models.ts +3 -0
- package/src/bundles/bundled-translations.json +7 -1
- package/src/lib.ts +1 -0
- package/src/shared/ecommerce-settings/util/refreshDuplicatedMetadata.test.ts +399 -0
- package/src/shared/ecommerce-settings/util/refreshDuplicatedMetadata.ts +99 -0
- package/src/shared/page-settings/components/header-settings-panel/HeaderSettingsPanel.button-section.test.ts +126 -0
- package/src/shared/page-settings/components/header-settings-panel/HeaderSettingsPanel.vue +43 -6
- package/src/shared/page-settings/components/page-settings-section-styles/HeaderButtonSettings.test.ts +167 -0
- package/src/shared/page-settings/components/page-settings-section-styles/HeaderButtonSettings.vue +237 -0
- package/src/shared/page-settings/components/page-settings-section-styles/HeaderDisplayStyle.test.ts +160 -0
- package/src/shared/page-settings/components/page-settings-section-styles/HeaderDisplayStyle.vue +37 -8
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.header-button.test.ts +113 -0
- package/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.ts +47 -0
- package/src/shared/page-settings/components/page-settings-section-styles/i18n/page-settings-section.json +7 -1
- package/src/shared/page-settings/store/page-settings-store.ts +2 -0
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<header
|
|
3
3
|
data-component="header-layout"
|
|
4
|
-
:class="[
|
|
4
|
+
:class="[
|
|
5
|
+
'root',
|
|
6
|
+
'layout',
|
|
7
|
+
displayStyle,
|
|
8
|
+
showNav ? 'show-nav' : 'no-nav',
|
|
9
|
+
{ 'has-header-cta': showCta },
|
|
10
|
+
]"
|
|
5
11
|
>
|
|
6
12
|
<div class="logo-container">
|
|
7
13
|
<slot name="logo" />
|
|
@@ -11,23 +17,53 @@
|
|
|
11
17
|
<slot name="nav" />
|
|
12
18
|
</div>
|
|
13
19
|
</div>
|
|
20
|
+
<div
|
|
21
|
+
v-if="showCta"
|
|
22
|
+
data-component="header-layout-cta"
|
|
23
|
+
class="cta-container"
|
|
24
|
+
>
|
|
25
|
+
<slot name="cta" />
|
|
26
|
+
</div>
|
|
14
27
|
</header>
|
|
15
28
|
</template>
|
|
16
29
|
<script setup lang="ts">
|
|
17
|
-
import { withDefaults } from 'vue';
|
|
18
|
-
import type
|
|
30
|
+
import { computed, withDefaults } from 'vue';
|
|
31
|
+
import { HEADER_DISPLAY, type HeaderDisplayStyle } from '../../constants';
|
|
19
32
|
|
|
20
|
-
withDefaults(
|
|
33
|
+
const props = withDefaults(
|
|
21
34
|
defineProps<{
|
|
22
35
|
navId: string;
|
|
23
36
|
showNav?: boolean;
|
|
24
37
|
displayStyle: HeaderDisplayStyle;
|
|
25
38
|
logoWidth: string | number;
|
|
39
|
+
hasCta?: boolean;
|
|
26
40
|
}>(),
|
|
27
41
|
{
|
|
28
42
|
showNav: true,
|
|
43
|
+
hasCta: false,
|
|
29
44
|
},
|
|
30
45
|
);
|
|
46
|
+
|
|
47
|
+
// The mobile hamburger row is deliberately CTA-free: the drawer carries the button
|
|
48
|
+
// (NavigationSideMenu) so the compact row keeps only the logo and the icon. When the
|
|
49
|
+
// nav itself is hidden (single-page site) there is no icon and no drawer, so the row
|
|
50
|
+
// carries the button after all — otherwise it would be unreachable on mobile.
|
|
51
|
+
const DRAWER_ONLY_CTA_DISPLAY_STYLES: HeaderDisplayStyle[] = [
|
|
52
|
+
HEADER_DISPLAY.MOBILE_HAMBURGER_1,
|
|
53
|
+
HEADER_DISPLAY.MOBILE_HAMBURGER_2,
|
|
54
|
+
HEADER_DISPLAY.MOBILE_HAMBURGER_3,
|
|
55
|
+
HEADER_DISPLAY.MOBILE_HAMBURGER_4,
|
|
56
|
+
HEADER_DISPLAY.MOBILE_HAMBURGER_NO_LOGO_1,
|
|
57
|
+
HEADER_DISPLAY.MOBILE_HAMBURGER_NO_LOGO_2,
|
|
58
|
+
HEADER_DISPLAY.MOBILE_HAMBURGER_NO_LOGO_3,
|
|
59
|
+
];
|
|
60
|
+
|
|
61
|
+
const showCta = computed(
|
|
62
|
+
(): boolean =>
|
|
63
|
+
props.hasCta &&
|
|
64
|
+
(props.showNav === false ||
|
|
65
|
+
!DRAWER_ONLY_CTA_DISPLAY_STYLES.includes(props.displayStyle)),
|
|
66
|
+
);
|
|
31
67
|
</script>
|
|
32
68
|
<style scoped>
|
|
33
69
|
.root {
|
|
@@ -46,6 +82,12 @@ withDefaults(
|
|
|
46
82
|
}
|
|
47
83
|
.logo-container {
|
|
48
84
|
}
|
|
85
|
+
/* The CTA container is a plain block: every family below positions the BOX, and the
|
|
86
|
+
button then fills whatever box it is given (full width for the mobile row,
|
|
87
|
+
content width everywhere else). */
|
|
88
|
+
.cta-container {
|
|
89
|
+
min-width: 0;
|
|
90
|
+
}
|
|
49
91
|
|
|
50
92
|
/* DESKTOP_TAB_1 */
|
|
51
93
|
.desktop-tab-horizontal-stack-left-logo-right-menu {
|
|
@@ -369,6 +411,158 @@ withDefaults(
|
|
|
369
411
|
.mobile-hamburger-no-logo-right-menu .logo-container {
|
|
370
412
|
@apply tw-hidden;
|
|
371
413
|
}
|
|
414
|
+
|
|
415
|
+
/* ==========================================================================
|
|
416
|
+
Header CTA placement (BP-5852)
|
|
417
|
+
|
|
418
|
+
Every rule here is additive and only applies once a CTA is rendered — the
|
|
419
|
+
track/flow-changing ones are gated on `.has-header-cta` — so a header with no
|
|
420
|
+
button lays out exactly as it did before. Four placements:
|
|
421
|
+
join - inline immediately after the nav links
|
|
422
|
+
edge - pinned to the header's outer right edge, nav left untouched
|
|
423
|
+
corner - floats top-right, out of flow, independent of a centered stack
|
|
424
|
+
row - full-width row below the whole stack (mobile bar nav)
|
|
425
|
+
========================================================================== */
|
|
426
|
+
|
|
427
|
+
/* join - DESKTOP_TAB_1: appended flex child; the nav's `flex: 1` right-aligns the
|
|
428
|
+
[links][button] group, so the button lands adjacent to the links. */
|
|
429
|
+
.desktop-tab-horizontal-stack-left-logo-right-menu .cta-container {
|
|
430
|
+
margin-left: 1rem;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/* edge - DESKTOP_TAB_2: the nav's `flex: 1` keeps the left-aligned links in place
|
|
434
|
+
and pushes the button to the outer right edge. */
|
|
435
|
+
.desktop-tab-horizontal-stack-left-logo-left-menu .cta-container {
|
|
436
|
+
margin-left: 1rem;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/* edge - DESKTOP_TAB_3: reuses the grid's existing trailing spacer column, so the
|
|
440
|
+
centered nav and left logo keep their tracks unchanged. */
|
|
441
|
+
.desktop-tab-horizontal-stack-left-logo-centered-menu .cta-container {
|
|
442
|
+
grid-column: nav-end / cols-end;
|
|
443
|
+
justify-self: end;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/* join - DESKTOP_TAB_4: adds a content-width column after the nav column. The two
|
|
447
|
+
`1fr` tracks absorb the free space (an `auto` logo track would stretch and pull
|
|
448
|
+
the button away from the links). */
|
|
449
|
+
.desktop-tab-horizontal-stack-centered-logo-right-menu.has-header-cta {
|
|
450
|
+
grid-template-columns:
|
|
451
|
+
[col-start] 1fr [logo-start] var(--logo-max-width)
|
|
452
|
+
[logo-end nav-start] 1fr [nav-end cta-start] auto [cta-end];
|
|
453
|
+
}
|
|
454
|
+
.desktop-tab-horizontal-stack-centered-logo-right-menu .cta-container {
|
|
455
|
+
grid-column: cta-start / cta-end;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/* corner - DESKTOP_TAB_5 / DESKTOP_TAB_6: out of flow, so the centered vertical
|
|
459
|
+
stack keeps its two explicit grid rows and stays centered. */
|
|
460
|
+
.desktop-tab-vertical-stack-centered-logo-centered-menu.has-header-cta,
|
|
461
|
+
.desktop-tab-vertical-stack-centered-menu-centered-logo.has-header-cta {
|
|
462
|
+
position: relative;
|
|
463
|
+
}
|
|
464
|
+
.desktop-tab-vertical-stack-centered-logo-centered-menu .cta-container,
|
|
465
|
+
.desktop-tab-vertical-stack-centered-menu-centered-logo .cta-container {
|
|
466
|
+
position: absolute;
|
|
467
|
+
top: 0;
|
|
468
|
+
right: 0;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/* row - MOBILE_TAB_1 / MOBILE_TAB_2: auto-places into an implicit third grid row
|
|
472
|
+
below the stack (both explicit rows are taken by the logo and the nav). */
|
|
473
|
+
.mobile-tab-vertical-stack-centered-logo-centered-menu .cta-container,
|
|
474
|
+
.mobile-tab-vertical-stack-centered-menu-centered-logo .cta-container {
|
|
475
|
+
width: 100%;
|
|
476
|
+
justify-self: stretch;
|
|
477
|
+
}
|
|
478
|
+
.mobile-tab-vertical-stack-centered-logo-centered-menu.no-nav.has-header-cta,
|
|
479
|
+
.mobile-tab-vertical-stack-centered-menu-centered-logo.no-nav.has-header-cta {
|
|
480
|
+
@apply tw-flex-wrap tw-justify-center;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
/* row - MOBILE_TAB_NO_LOGO_1: single centered flex row, so the full-width button
|
|
484
|
+
needs a wrap to drop below the nav. */
|
|
485
|
+
.mobile-tab-centered-menu-no-logo.has-header-cta {
|
|
486
|
+
@apply tw-flex-wrap;
|
|
487
|
+
}
|
|
488
|
+
.mobile-tab-centered-menu-no-logo .cta-container {
|
|
489
|
+
width: 100%;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/* join - DESKTOP_TAB_NO_LOGO_1 / _3: appended flex child sits adjacent to the
|
|
493
|
+
left- / right-aligned links. */
|
|
494
|
+
.desktop-tab-left-menu-no-logo .cta-container,
|
|
495
|
+
.desktop-tab-right-menu-no-logo .cta-container {
|
|
496
|
+
margin-left: 1rem;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
/* edge - DESKTOP_TAB_NO_LOGO_2: out of flow so the nav stays exactly centered
|
|
500
|
+
(an in-flow button would shift the centered group left). */
|
|
501
|
+
.desktop-tab-centered-menu-no-logo.has-header-cta {
|
|
502
|
+
position: relative;
|
|
503
|
+
}
|
|
504
|
+
.desktop-tab-centered-menu-no-logo .cta-container {
|
|
505
|
+
position: absolute;
|
|
506
|
+
top: 0;
|
|
507
|
+
right: 0;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
/* DESKTOP_HAMBURGER_1 / _2: the button joins the header row BEFORE the icon. These
|
|
511
|
+
grids declare exact tracks, so each gains a content-width CTA column ahead of the
|
|
512
|
+
nav column; the logo track becomes `1fr` to absorb the free space that an `auto`
|
|
513
|
+
track would otherwise share with the CTA. The mobile hamburger styles share the
|
|
514
|
+
base rules above but never render a CTA, so their tracks are untouched. */
|
|
515
|
+
.desktop-hamburger-horizontal-stack-left-logo-right-menu.has-header-cta {
|
|
516
|
+
grid-template-columns: [logo-start] 1fr [cta-start] auto [nav-start] var(
|
|
517
|
+
--hamburger-nav-width
|
|
518
|
+
);
|
|
519
|
+
}
|
|
520
|
+
.desktop-hamburger-horizontal-stack-centered-logo-right-menu.has-header-cta {
|
|
521
|
+
grid-template-columns:
|
|
522
|
+
[start] var(--hamburger-nav-width)
|
|
523
|
+
[logo-start] 1fr [cta-start] auto [nav-start] var(--hamburger-nav-width);
|
|
524
|
+
}
|
|
525
|
+
.desktop-hamburger-horizontal-stack-left-logo-right-menu .cta-container,
|
|
526
|
+
.desktop-hamburger-horizontal-stack-centered-logo-right-menu .cta-container {
|
|
527
|
+
grid-column: cta-start;
|
|
528
|
+
align-self: center;
|
|
529
|
+
@apply tw-mr-4;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/* DESKTOP_HAMBURGER_NO_LOGO_1..3: flex rows; `order` puts the button before the
|
|
533
|
+
icon without reordering the DOM. */
|
|
534
|
+
.desktop-hamburger-no-logo-left-menu .cta-container,
|
|
535
|
+
.desktop-hamburger-no-logo-centered-menu .cta-container,
|
|
536
|
+
.desktop-hamburger-no-logo-right-menu .cta-container {
|
|
537
|
+
order: -1;
|
|
538
|
+
align-self: center;
|
|
539
|
+
@apply tw-mr-4;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
/* row - MOBILE_HAMBURGER_* with the nav hidden (single-page site): no icon, no
|
|
543
|
+
drawer, so the button gets the mobile-bar full-width row below the logo. The
|
|
544
|
+
grid styles auto-place it into an implicit row spanning all tracks; the
|
|
545
|
+
flex no-logo styles wrap it onto its own line. */
|
|
546
|
+
.mobile-hamburger-horizontal-stack-left-logo-right-menu.no-nav .cta-container,
|
|
547
|
+
.mobile-hamburger-horizontal-stack-centered-logo-right-menu.no-nav
|
|
548
|
+
.cta-container,
|
|
549
|
+
.mobile-hamburger-horizontal-stack-left-menu-centered-logo.no-nav
|
|
550
|
+
.cta-container,
|
|
551
|
+
.mobile-hamburger-horizontal-stack-left-menu-left-logo.no-nav .cta-container {
|
|
552
|
+
grid-column: 1 / -1;
|
|
553
|
+
width: 100%;
|
|
554
|
+
margin-top: 1rem;
|
|
555
|
+
}
|
|
556
|
+
.mobile-hamburger-no-logo-left-menu.no-nav.has-header-cta,
|
|
557
|
+
.mobile-hamburger-no-logo-centered-menu.no-nav.has-header-cta,
|
|
558
|
+
.mobile-hamburger-no-logo-right-menu.no-nav.has-header-cta {
|
|
559
|
+
@apply tw-flex-wrap;
|
|
560
|
+
}
|
|
561
|
+
.mobile-hamburger-no-logo-left-menu.no-nav .cta-container,
|
|
562
|
+
.mobile-hamburger-no-logo-centered-menu.no-nav .cta-container,
|
|
563
|
+
.mobile-hamburger-no-logo-right-menu.no-nav .cta-container {
|
|
564
|
+
width: 100%;
|
|
565
|
+
}
|
|
372
566
|
</style>
|
|
373
567
|
|
|
374
568
|
<style>
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { defineComponent } from 'vue';
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
3
|
import type { BrandPageContext } from '@brand-page/models';
|
|
4
|
-
import type {
|
|
4
|
+
import type {
|
|
5
|
+
ButtonViewModel,
|
|
6
|
+
PageHeaderViewModel,
|
|
7
|
+
} from '@brand-page/view-models';
|
|
5
8
|
import { LOGO_SLIDER_DESKTOP_MAX } from '../../constants';
|
|
6
9
|
|
|
7
10
|
export default defineComponent({
|
|
@@ -37,6 +40,9 @@ export default defineComponent({
|
|
|
37
40
|
padding: '1.5rem 0', // var(--page-padding) 0
|
|
38
41
|
};
|
|
39
42
|
},
|
|
43
|
+
headerButtonViewModel(): ButtonViewModel | undefined {
|
|
44
|
+
return this.viewModel.headerButtonViewModel;
|
|
45
|
+
},
|
|
40
46
|
showNav(): boolean {
|
|
41
47
|
const visibleNavItems = this.context.nav.navItems.filter(
|
|
42
48
|
(item) => !item.isHidden,
|
|
@@ -54,5 +60,14 @@ export default defineComponent({
|
|
|
54
60
|
onHeaderContainerClick() {
|
|
55
61
|
this.$emit('header-container-click');
|
|
56
62
|
},
|
|
63
|
+
// In the maker preview the CTA is inert (BP-5852 decision): capture-phase so the
|
|
64
|
+
// prevent lands before the inner anchor/router-link fires, and the stop keeps the
|
|
65
|
+
// click from selecting the header panel. On the published site it does nothing.
|
|
66
|
+
onHeaderCtaClick(event: MouseEvent): void {
|
|
67
|
+
if (this.context.isPreview) {
|
|
68
|
+
event.preventDefault();
|
|
69
|
+
event.stopPropagation();
|
|
70
|
+
}
|
|
71
|
+
},
|
|
57
72
|
},
|
|
58
73
|
});
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
v-if="showNav || viewModel.logo.isVisible || headerButtonViewModel"
|
|
4
|
+
:style="containerCss"
|
|
5
|
+
>
|
|
3
6
|
<div class="c-page-header-container" @click="onHeaderContainerClick()">
|
|
4
7
|
<HeaderLayout
|
|
5
8
|
:nav-id="navId"
|
|
@@ -8,6 +11,7 @@
|
|
|
8
11
|
:logo-width="
|
|
9
12
|
viewModel.logo?.logoImageWidth || LOGO_SLIDER_DESKTOP_MAX + 'rem'
|
|
10
13
|
"
|
|
14
|
+
:has-cta="Boolean(headerButtonViewModel)"
|
|
11
15
|
>
|
|
12
16
|
<template #logo>
|
|
13
17
|
<Logo
|
|
@@ -29,6 +33,18 @@
|
|
|
29
33
|
@click.stop
|
|
30
34
|
/>
|
|
31
35
|
</template>
|
|
36
|
+
<template v-if="headerButtonViewModel" #cta>
|
|
37
|
+
<!-- The attribute value scopes the hook per instance (nav-1 = desktop,
|
|
38
|
+
nav-2 = mobile, "drawer" in the side menu) — MediaQuery keeps both
|
|
39
|
+
viewport headers in the DOM, so a bare hook would match all of them. -->
|
|
40
|
+
<Button
|
|
41
|
+
:data-test-header-cta-button="navId"
|
|
42
|
+
:view-model="headerButtonViewModel"
|
|
43
|
+
:context="context"
|
|
44
|
+
:variant="BUTTON_VARIANTS.header"
|
|
45
|
+
@click.capture="onHeaderCtaClick"
|
|
46
|
+
/>
|
|
47
|
+
</template>
|
|
32
48
|
</HeaderLayout>
|
|
33
49
|
</div>
|
|
34
50
|
</div>
|
|
@@ -38,15 +54,21 @@ import PageHeaderMixin from './PageHeader.mixin.ts';
|
|
|
38
54
|
import Logo from '../logo/Logo.vue';
|
|
39
55
|
import Navigation from '../navigation/Navigation.vue';
|
|
40
56
|
import HeaderLayout from './HeaderLayout.vue';
|
|
57
|
+
import Button from '../button/Button.vue';
|
|
58
|
+
import { BUTTON_VARIANTS } from '../../utils/button.util';
|
|
41
59
|
|
|
42
60
|
export default {
|
|
43
61
|
components: {
|
|
44
62
|
Navigation,
|
|
45
63
|
Logo,
|
|
46
64
|
HeaderLayout,
|
|
65
|
+
Button,
|
|
47
66
|
},
|
|
48
67
|
mixins: [PageHeaderMixin],
|
|
49
68
|
emits: ['open-side-menu'],
|
|
69
|
+
setup() {
|
|
70
|
+
return { BUTTON_VARIANTS };
|
|
71
|
+
},
|
|
50
72
|
};
|
|
51
73
|
</script>
|
|
52
74
|
<style scoped>
|