Skip to content
11 changes: 11 additions & 0 deletions libs/blocks/caas-config/caas-config.css
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,14 @@ dd.content .sort-options > .field {
transform: rotate(180deg);
display: inline-block;
}

/* Indent carousel options */
dd.content .carousel-options .field {
padding-left: 20px;
max-width: calc(var(--field-max-size) - 20px);
}

.caas-config .consonant-Wrapper--carousel {
width: 100%;
margin: 0;
}
23 changes: 16 additions & 7 deletions libs/blocks/caas-config/caas-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,10 @@ const defaultOptions = {
'over-background': 'Over Background',
},
paginationAnimationStyle: {
paged: 'Paged',
incremental: 'Incremental',
pagedModern: 'Modern (Paged)',
incrementalModern: 'Modern (Incremental)',
paged: 'Classic (Paged)',
incremental: 'Classic (Incremental)',
},
paginationType: {
paginator: 'Paginator',
Expand Down Expand Up @@ -378,6 +380,17 @@ const UiPanel = () => {
</div>
`;

const carouselOptions = html`
<div class="carousel-options">
<${Select}
label="Carousel Controls Options"
prop="paginationAnimationStyle"
options=${defaultOptions.paginationAnimationStyle}
/>
<${Input} label="Light background (Modern only)" prop="useLightControls" type="checkbox" />
</div>
`;

return html`
<${Input} label="Show Total Count" prop="showTotalResults" type="checkbox" />
<${Input} label="Show Card Borders" prop="setCardBorders" type="checkbox" />
Expand All @@ -393,6 +406,7 @@ const UiPanel = () => {
${state.cardStyle === 'blade-card' && bladeCardOptions}
<${Select} options=${defaultOptions.cardTitleAccessibilityLevel} prop="cardTitleAccessibilityLevel" label="Card Accessibility Title Level" />
<${Select} label="Layout" prop="container" options=${defaultOptions.container} />
${state.container === 'carousel' && carouselOptions}
<${Select} label="Layout Type" prop="layoutType" options=${defaultOptions.layoutType} />
<${Select} label="Grid Gap (Gutter)" prop="gutter" options=${defaultOptions.gutter} />
<${Select} label="Theme" prop="theme" options=${defaultOptions.theme} />
Expand Down Expand Up @@ -684,11 +698,6 @@ const PaginationPanel = () => {
prop="paginationType"
options=${defaultOptions.paginationType}
/>
<${Select}
label="Carousel Animation Style"
prop="paginationAnimationStyle"
options=${defaultOptions.paginationAnimationStyle}
/>
<${Input} label="Use Theme 3" prop="paginationUseTheme3" type="checkbox" />
`;

Expand Down
4 changes: 4 additions & 0 deletions libs/blocks/caas/caas.css
Original file line number Diff line number Diff line change
Expand Up @@ -571,3 +571,7 @@ color: #eee;
padding-top: 10px;
border-top: solid 2px #000;
}

.content-panel .consonant-Wrapper--carousel {
margin: 0;
}
9 changes: 7 additions & 2 deletions libs/blocks/caas/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,12 @@ export const getConfig = async (originalState, strs = {}) => {

const langFirst = state.langFirst ? `&langFirst=${state.langFirst}` : '';

const navigationStyle = state.container === 'carousel'
&& state.paginationAnimationStyle.includes('Modern')
&& state.useLightControls
? `${state.paginationAnimationStyle}-light`
: state.paginationAnimationStyle;

const config = {
collection: {
mode: state.theme,
Expand Down Expand Up @@ -985,7 +991,7 @@ export const getConfig = async (originalState, strs = {}) => {
options: getSortOptions(state, strs),
},
pagination: {
animationStyle: state.paginationAnimationStyle,
animationStyle: navigationStyle,
enabled: state.paginationEnabled,
resultsQuantityShown: state.paginationQuantityShown,
loadMoreButton: {
Expand Down Expand Up @@ -1050,7 +1056,6 @@ export const getConfig = async (originalState, strs = {}) => {
linkTransformer: pageConfig.caasLinkTransformer || stageMapToCaasTransforms(pageConfig),
headers: caasRequestHeaders,
};

return config;
};

Expand Down
Loading