@designcrowd/library.brand-page 6.1.17-ast-header-button → 6.1.17-ast-header-button-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/lib/src/{CreatedOnBrandCrowd-de-de-Cwq9enJs.js → CreatedOnBrandCrowd-de-de-ClD0Z4Nf.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-en-us-ILK04gFj.js → CreatedOnBrandCrowd-en-us-x35bJCuy.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-es-es-CbjxLxtu.js → CreatedOnBrandCrowd-es-es-zm1tzSt2.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-fr-BwBDiK9z.js → CreatedOnBrandCrowd-fr-ca-B7XCRP8c.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-fr-ca-BwBDiK9z.js → CreatedOnBrandCrowd-fr-fr-B7XCRP8c.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-pt-DvhJROpG.js → CreatedOnBrandCrowd-pt-br-7QHheNW1.js} +1 -1
- package/lib/src/{CreatedOnBrandCrowd-pt-br-DvhJROpG.js → CreatedOnBrandCrowd-pt-pt-7QHheNW1.js} +1 -1
- package/lib/src/{CreatedOnDcom-de-de-BK9imWOh.js → CreatedOnDcom-de-de-Yn0mPf9E.js} +1 -1
- package/lib/src/{CreatedOnDcom-en-us-CyH-_qz1.js → CreatedOnDcom-en-us-BO8_HZ9Q.js} +1 -1
- package/lib/src/{CreatedOnDcom-es-es-Dh51qYEA.js → CreatedOnDcom-es-es-cZcgEsjB.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-ca-BArRxwWX.js → CreatedOnDcom-fr-ca-CA-hvR-A.js} +1 -1
- package/lib/src/{CreatedOnDcom-fr-fr-CdglI-ZB.js → CreatedOnDcom-fr-fr-CEWt2rrU.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-br-DCehns-G.js → CreatedOnDcom-pt-br-DYnOYrQv.js} +1 -1
- package/lib/src/{CreatedOnDcom-pt-pt-B8hl-oew.js → CreatedOnDcom-pt-pt-C7BpvRge.js} +1 -1
- package/lib/src/css/library.brand-page-brandCrowd.min.css +1 -1
- package/lib/src/css/library.brand-page-brandPage.min.css +1 -1
- package/lib/src/css/library.brand-page-designCom.min.css +1 -1
- package/lib/src/css/library.brand-page-preview.min.css +1 -1
- package/lib/src/index.mjs +1 -1
- package/lib/src/{lib-KFjPFfxn.js → lib-DnnaLgX8.js} +1306 -1292
- package/package.json +1 -1
- package/src/shared/page-settings/components/header-settings-panel/HeaderSettingsPanel.button-section.test.ts +25 -14
- package/src/shared/page-settings/components/header-settings-panel/HeaderSettingsPanel.vue +38 -26
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@designcrowd/library.brand-page",
|
|
3
3
|
"description": "A collection of Maker/Designer applications",
|
|
4
|
-
"version": "6.1.17-ast-header-button",
|
|
4
|
+
"version": "6.1.17-ast-header-button-1",
|
|
5
5
|
"author": "Design.com Eng",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"type": "module",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { describe, test, expect, beforeEach } from 'vitest';
|
|
2
2
|
import { createPinia, setActivePinia } from 'pinia';
|
|
3
3
|
import { shallowMount } from '@vue/test-utils';
|
|
4
|
-
import type { VueWrapper } from '@vue/test-utils';
|
|
5
4
|
import { Toggle } from '@designcrowd/fe-shared-lib';
|
|
6
5
|
import type { LogoTheme } from '@brand-page';
|
|
7
6
|
import { VIEWPORTS } from '@brand-page';
|
|
@@ -10,9 +9,9 @@ import HeaderButtonSettings from '../page-settings-section-styles/HeaderButtonSe
|
|
|
10
9
|
import { useUiPageSettingsStore } from '../../store';
|
|
11
10
|
import { FabricRenderClient } from '../../../../clients/fabric-render-client';
|
|
12
11
|
|
|
13
|
-
// BP-5852: the header call-to-action button is brandsite-only,
|
|
14
|
-
//
|
|
15
|
-
// viewports.
|
|
12
|
+
// BP-5852: the header call-to-action button is brandsite-only, the section is a
|
|
13
|
+
// plain (non-collapsible) card whose header Toggle shows/hides the fields, and
|
|
14
|
+
// every write syncs both viewports.
|
|
16
15
|
describe('HeaderSettingsPanel — Button section', () => {
|
|
17
16
|
beforeEach(() => {
|
|
18
17
|
setActivePinia(createPinia());
|
|
@@ -78,15 +77,14 @@ describe('HeaderSettingsPanel — Button section', () => {
|
|
|
78
77
|
expect(wrapper.findComponent(HeaderButtonSettings).exists()).toBe(true);
|
|
79
78
|
});
|
|
80
79
|
|
|
81
|
-
test('expanding
|
|
80
|
+
test('expanding via the chevron while off switches the button on; later collapses freely', async () => {
|
|
82
81
|
const wrapper = mountPanel(true);
|
|
82
|
+
const sectionHeader = wrapper.get(
|
|
83
|
+
'[data-test-header-button-section-header]',
|
|
84
|
+
);
|
|
83
85
|
|
|
84
|
-
//
|
|
85
|
-
|
|
86
|
-
const buttonPanel = panels[panels.length - 1] as VueWrapper;
|
|
87
|
-
|
|
88
|
-
await buttonPanel.vm.$emit('changed');
|
|
89
|
-
await wrapper.vm.$nextTick();
|
|
86
|
+
// off + collapsed: expanding turns the button on and shows the fields
|
|
87
|
+
await sectionHeader.trigger('click');
|
|
90
88
|
|
|
91
89
|
const sections = useUiPageSettingsStore().sections.header;
|
|
92
90
|
|
|
@@ -94,11 +92,15 @@ describe('HeaderSettingsPanel — Button section', () => {
|
|
|
94
92
|
expect(sections[VIEWPORTS.mobile].headerButton?.isVisible).toBe(true);
|
|
95
93
|
expect(wrapper.findComponent(HeaderButtonSettings).exists()).toBe(true);
|
|
96
94
|
|
|
97
|
-
//
|
|
98
|
-
await
|
|
99
|
-
await wrapper.vm.$nextTick();
|
|
95
|
+
// on: the chevron only collapses/expands, never switches the button off
|
|
96
|
+
await sectionHeader.trigger('click');
|
|
100
97
|
|
|
101
98
|
expect(sections[VIEWPORTS.desktop].headerButton?.isVisible).toBe(true);
|
|
99
|
+
expect(wrapper.findComponent(HeaderButtonSettings).exists()).toBe(false);
|
|
100
|
+
|
|
101
|
+
await sectionHeader.trigger('click');
|
|
102
|
+
|
|
103
|
+
expect(wrapper.findComponent(HeaderButtonSettings).exists()).toBe(true);
|
|
102
104
|
});
|
|
103
105
|
|
|
104
106
|
test('toggling off hides the fields but keeps the configuration for a re-enable', async () => {
|
|
@@ -122,5 +124,14 @@ describe('HeaderSettingsPanel — Button section', () => {
|
|
|
122
124
|
expect(wrapper.findComponent(HeaderButtonSettings).exists()).toBe(false);
|
|
123
125
|
expect(desktop.headerButton?.isVisible).toBe(false);
|
|
124
126
|
expect(desktop.headerButton?.text).toBe('Book now');
|
|
127
|
+
|
|
128
|
+
// toggling off also collapsed the section, so a single chevron click
|
|
129
|
+
// re-enables — never a dead first click on a phantom-expanded section
|
|
130
|
+
await wrapper
|
|
131
|
+
.get('[data-test-header-button-section-header]')
|
|
132
|
+
.trigger('click');
|
|
133
|
+
|
|
134
|
+
expect(desktop.headerButton?.isVisible).toBe(true);
|
|
135
|
+
expect(wrapper.findComponent(HeaderButtonSettings).exists()).toBe(true);
|
|
125
136
|
});
|
|
126
137
|
});
|
|
@@ -145,35 +145,53 @@
|
|
|
145
145
|
</div>
|
|
146
146
|
</CollapsiblePanel>
|
|
147
147
|
|
|
148
|
-
<
|
|
148
|
+
<div
|
|
149
149
|
v-if="isBrandSite"
|
|
150
|
-
data-
|
|
151
|
-
|
|
152
|
-
:is-collapsed="collapsedSections.button"
|
|
153
|
-
@changed="onButtonSectionChanged"
|
|
150
|
+
data-test-header-button-section
|
|
151
|
+
class="tw-bg-white tw-border tw-border-grayscale-500 tw-border-solid tw-flex tw-flex-col tw-mb-4 tw-p-4 tw-rounded-md"
|
|
154
152
|
>
|
|
155
|
-
<
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
:
|
|
160
|
-
|
|
153
|
+
<div
|
|
154
|
+
data-test-header-button-section-header
|
|
155
|
+
class="tw-cursor-pointer tw-text-secondary-500 tw-flex tw-items-center tw-select-none"
|
|
156
|
+
:class="{
|
|
157
|
+
'tw-mb-2': !collapsedSections.button && isHeaderButtonVisible,
|
|
158
|
+
}"
|
|
159
|
+
@click="onButtonSectionChanged"
|
|
160
|
+
>
|
|
161
|
+
<div
|
|
162
|
+
class="tw-grow tw-text-md tw-font-sans tw-font-bold tw-text-secondary-800"
|
|
163
|
+
>
|
|
164
|
+
{{ pageSettingsTr('buttonSectionTitle') }}
|
|
165
|
+
</div>
|
|
166
|
+
<div class="tw-ml-2" @click.stop>
|
|
167
|
+
<Toggle
|
|
168
|
+
id="header-button-visible"
|
|
169
|
+
data-test-header-button-toggle
|
|
170
|
+
:model-value="isHeaderButtonVisible"
|
|
171
|
+
@update:model-value="onHeaderButtonToggle"
|
|
172
|
+
/>
|
|
173
|
+
</div>
|
|
174
|
+
<Icon
|
|
175
|
+
class="tw-ml-2 tw-text-grayscale-600"
|
|
176
|
+
:name="collapsedSections.button ? 'chevron-down' : 'chevron-up'"
|
|
177
|
+
size="sm"
|
|
161
178
|
/>
|
|
162
|
-
</
|
|
179
|
+
</div>
|
|
163
180
|
<HeaderButtonSettings
|
|
164
|
-
v-if="isHeaderButtonVisible"
|
|
181
|
+
v-if="!collapsedSections.button && isHeaderButtonVisible"
|
|
165
182
|
:value="headerButton"
|
|
166
183
|
:is-admin-maker="isAdminMaker"
|
|
167
184
|
:logo-theme="logoTheme"
|
|
168
185
|
@on-change="onHeaderButtonChange"
|
|
169
186
|
/>
|
|
170
|
-
</
|
|
187
|
+
</div>
|
|
171
188
|
</div>
|
|
172
189
|
</template>
|
|
173
190
|
<script>
|
|
174
191
|
import {
|
|
175
192
|
CollapsiblePanel,
|
|
176
193
|
HelloBar,
|
|
194
|
+
Icon,
|
|
177
195
|
Slider,
|
|
178
196
|
TabMenu,
|
|
179
197
|
Toggle,
|
|
@@ -195,6 +213,7 @@ export default {
|
|
|
195
213
|
CollapsiblePanel,
|
|
196
214
|
ColorField,
|
|
197
215
|
HelloBar,
|
|
216
|
+
Icon,
|
|
198
217
|
Slider,
|
|
199
218
|
TabMenu,
|
|
200
219
|
Toggle,
|
|
@@ -238,27 +257,20 @@ export default {
|
|
|
238
257
|
toggleSectionCollapsed(section) {
|
|
239
258
|
this.collapsedSections[section] = !this.collapsedSections[section];
|
|
240
259
|
},
|
|
260
|
+
onHeaderButtonToggle(isVisible) {
|
|
261
|
+
this.onHeaderButtonChange({ isVisible });
|
|
262
|
+
|
|
263
|
+
this.collapsedSections.button = !isVisible;
|
|
264
|
+
},
|
|
241
265
|
onButtonSectionChanged() {
|
|
242
266
|
const isExpanding = this.collapsedSections.button;
|
|
243
267
|
|
|
244
268
|
this.toggleSectionCollapsed('button');
|
|
245
269
|
|
|
246
|
-
// Expanding while the button is off would show an empty body — opening the
|
|
247
|
-
// section IS the intent to configure it, so switch the button on. Collapsing
|
|
248
|
-
// never switches it off.
|
|
249
270
|
if (isExpanding && !this.isHeaderButtonVisible) {
|
|
250
271
|
this.onHeaderButtonChange({ isVisible: true });
|
|
251
272
|
}
|
|
252
273
|
},
|
|
253
|
-
onHeaderButtonToggle(isVisible) {
|
|
254
|
-
this.onHeaderButtonChange({ isVisible });
|
|
255
|
-
|
|
256
|
-
// Enabling the button is what makes the section worth looking at — open it
|
|
257
|
-
// so the fields appear with the flick of the toggle (matches the design).
|
|
258
|
-
if (isVisible) {
|
|
259
|
-
this.collapsedSections.button = false;
|
|
260
|
-
}
|
|
261
|
-
},
|
|
262
274
|
},
|
|
263
275
|
};
|
|
264
276
|
</script>
|