<div x-data="paginationLoader()" class="mt-6 flex flex-col items-center text-center" :class="[
size === 'small' ? 'gap-2' : '',
size === 'medium' ? 'gap-4' : '',
size === 'large' ? 'gap-6' : ''
]">
<div class="text-black/72 text-body-base">
Page <span x-text="currentPage" class="font-semibold"></span> sur <span x-text="totalPages" class="font-bold"></span>
</div>
<div class="inline-flex justify-center items-center gap-2.5">
<template x-if="!isLoading">
<button type="button" @click="loadMore" class=" btn btn-uno btn-solid btn-size-md">
Afficher plus
</button>
</template>
<template x-if="isLoading">
<svg class="animate-spin" width="40" height="40" viewBox="0 0 57 56" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Frame 6">
<g clip-path="url(#paint0_angular_16067_692_clip_path)" data-figma-skip-parse="true">
<g transform="matrix(0.028 0 0 0.028 28.5 28)">
<foreignObject x="-1000" y="-1000" width="2000" height="2000">
<div xmlns="http://www.w3.org/1999/xhtml" style="background:conic-gradient(from 90deg,rgba(74, 138, 166, 0.0001) 0deg,rgba(31, 107, 133, 1) 359.964deg,rgba(74, 138, 166, 0.0001) 360deg);height:100%;width:100%;opacity:1"></div>
</foreignObject>
</g>
</g>
<path id="track" d="M56.5 28C56.5 43.464 43.964 56 28.5 56C13.036 56 0.5 43.464 0.5 28C0.5 12.536 13.036 0 28.5 0C43.964 0 56.5 12.536 56.5 28ZM10.3 28C10.3 38.0516 18.4484 46.2 28.5 46.2C38.5516 46.2 46.7 38.0516 46.7 28C46.7 17.9484 38.5516 9.8 28.5 9.8C18.4484 9.8 10.3 17.9484 10.3 28Z" data-figma-gradient-fill="{"type":"GRADIENT_ANGULAR","stops":[{"color":{"r":0.12156862765550613,"g":0.41960784792900085,"b":0.52156865596771240,"a":1.0},"position":0.99989998340606689},{"color":{"r":0.29019609093666077,"g":0.54117649793624878,"b":0.65098041296005249,"a":9.9999997473787516e-05},"position":1.0}],"stopsVar":[{"color":{"r":0.12156862765550613,"g":0.41960784792900085,"b":0.52156865596771240,"a":1.0},"position":0.99989998340606689},{"color":{"r":0.29019609093666077,"g":0.54117649793624878,"b":0.65098041296005249,"a":9.9999997473787516e-05},"position":1.0}],"transform":{"m00":56.0,"m01":0.0,"m02":0.50,"m10":0.0,"m11":56.0,"m12":0.0},"opacity":1.0,"blendMode":"NORMAL","visible":true}" />
</g>
<defs>
<clipPath id="paint0_angular_16067_692_clip_path">
<path id="track" d="M56.5 28C56.5 43.464 43.964 56 28.5 56C13.036 56 0.5 43.464 0.5 28C0.5 12.536 13.036 0 28.5 0C43.964 0 56.5 12.536 56.5 28ZM10.3 28C10.3 38.0516 18.4484 46.2 28.5 46.2C38.5516 46.2 46.7 38.0516 46.7 28C46.7 17.9484 38.5516 9.8 28.5 9.8C18.4484 9.8 10.3 17.9484 10.3 28Z" />
</clipPath>
</defs>
</svg>
</template>
</div>
</div>
<script>
function paginationLoader() {
return {
currentPage: 1,
totalPages: 8,
size: 'medium', // 'small' | 'medium' | 'large'
isLoading: false,
async loadMore() {
this.isLoading = true;
await new Promise(r => setTimeout(r, 1500));
if (this.currentPage < this.totalPages) {
this.currentPage++;
}
this.isLoading = false;
}
}
}
</script>
<div x-data="paginationLoader()"
class="mt-6 flex flex-col items-center text-center"
:class="[
size === 'small' ? 'gap-2' : '',
size === 'medium' ? 'gap-4' : '',
size === 'large' ? 'gap-6' : ''
]"
>
<div class="text-black/72 text-body-base">
Page <span x-text="currentPage" class="font-semibold"></span> sur <span x-text="totalPages" class="font-bold"></span>
</div>
<div class="inline-flex justify-center items-center gap-2.5">
<template x-if="!isLoading">
{% render "@template-button" with {
color: 'uno',
size: size == 'small' ? "sm" : size == 'medium' ? 'md' : "lg",
label: 'Afficher plus',
icon: {
name: "heroicons--arrow-left-outline",
},
button_attribute: ("@click=\"loadMore\"")|replace({'\"': '"'})
} %}
</template>
<template x-if="isLoading">
{% set svgSize = size == 'small' ? 24 : size == 'medium' ? 40 : 56 %}
<svg class="animate-spin" width="{{ svgSize }}" height="{{ svgSize }}" viewBox="0 0 57 56" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Frame 6">
<g clip-path="url(#paint0_angular_16067_692_clip_path)" data-figma-skip-parse="true">
<g transform="matrix(0.028 0 0 0.028 28.5 28)">
<foreignObject x="-1000" y="-1000" width="2000" height="2000">
<div xmlns="http://www.w3.org/1999/xhtml" style="background:conic-gradient(from 90deg,rgba(74, 138, 166, 0.0001) 0deg,rgba(31, 107, 133, 1) 359.964deg,rgba(74, 138, 166, 0.0001) 360deg);height:100%;width:100%;opacity:1"></div>
</foreignObject>
</g>
</g>
<path id="track" d="M56.5 28C56.5 43.464 43.964 56 28.5 56C13.036 56 0.5 43.464 0.5 28C0.5 12.536 13.036 0 28.5 0C43.964 0 56.5 12.536 56.5 28ZM10.3 28C10.3 38.0516 18.4484 46.2 28.5 46.2C38.5516 46.2 46.7 38.0516 46.7 28C46.7 17.9484 38.5516 9.8 28.5 9.8C18.4484 9.8 10.3 17.9484 10.3 28Z" data-figma-gradient-fill="{"type":"GRADIENT_ANGULAR","stops":[{"color":{"r":0.12156862765550613,"g":0.41960784792900085,"b":0.52156865596771240,"a":1.0},"position":0.99989998340606689},{"color":{"r":0.29019609093666077,"g":0.54117649793624878,"b":0.65098041296005249,"a":9.9999997473787516e-05},"position":1.0}],"stopsVar":[{"color":{"r":0.12156862765550613,"g":0.41960784792900085,"b":0.52156865596771240,"a":1.0},"position":0.99989998340606689},{"color":{"r":0.29019609093666077,"g":0.54117649793624878,"b":0.65098041296005249,"a":9.9999997473787516e-05},"position":1.0}],"transform":{"m00":56.0,"m01":0.0,"m02":0.50,"m10":0.0,"m11":56.0,"m12":0.0},"opacity":1.0,"blendMode":"NORMAL","visible":true}"/>
</g>
<defs>
<clipPath id="paint0_angular_16067_692_clip_path">
<path id="track" d="M56.5 28C56.5 43.464 43.964 56 28.5 56C13.036 56 0.5 43.464 0.5 28C0.5 12.536 13.036 0 28.5 0C43.964 0 56.5 12.536 56.5 28ZM10.3 28C10.3 38.0516 18.4484 46.2 28.5 46.2C38.5516 46.2 46.7 38.0516 46.7 28C46.7 17.9484 38.5516 9.8 28.5 9.8C18.4484 9.8 10.3 17.9484 10.3 28Z"/>
</clipPath>
</defs>
</svg>
</template>
</div>
</div>
<script>
function paginationLoader() {
return {
currentPage: {{ currentPage }},
totalPages: {{ totalPages }},
size: '{{ size }}', // 'small' | 'medium' | 'large'
isLoading: false,
async loadMore() {
this.isLoading = true;
await new Promise(r => setTimeout(r, 1500));
if (this.currentPage < this.totalPages) {
this.currentPage++;
}
this.isLoading = false;
}
}
}
</script>
{
"size": "medium",
"currentPage": 1,
"totalPages": 8,
"showMore": true,
"isLoading": false,
"loadMoreLabel": "afficher plus"
}
No notes defined.