1import { R as RmcIcon } from "./chunk-Bov-RE3A.js"; 2import { c as classNames, R as RmcButton } from "./chunk-B7DFmrmH.js"; 3import { j as defineComponent, _ as _export_sfc, o as openBlock, e as createElementBlock, z as createBlock, A as withCtx, C as renderSlot, m as mergeProps, B as resolveDynamicComponent, v as normalizeClass, c as computed, q as createVNode, f as createBaseVNode, h as toDisplayString, n as normalizeStyle, J as withModifiers, I as createTextVNode, y as createCommentVNode, F as Fragment, x as renderList, w as watch } from "./chunk-Cy-M6TJt.js"; 4import { s as scrollToTop } from "./chunk-CBgEPVdF.js"; 5import { u as useI18n } from "./chunk-DUNv5myb.js"; 6const _sfc_main$3 = /* @__PURE__ */ defineComponent({ 7 ...{ 8 inheritAttrs: false 9 }, 10 __name: "PageItem", 11 props: { 12 active: { type: Boolean, default: false }, 13 is: { default: "a" } 14 }, 15 setup(__props, { expose: __expose }) { 16 __expose(); 17 const __returned__ = { get classNames() { 18 return classNames; 19 } }; 20 Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); 21 return __returned__; 22 } 23}); 24function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) { 25 return openBlock(), createElementBlock("div", { 26 class: normalizeClass($setup.classNames("rmc-page-item", { active: $props.active })) 27 }, [ 28 (openBlock(), createBlock(resolveDynamicComponent($props.is), mergeProps({ class: "rmc-page-link" }, { ..._ctx.$attrs, ...$props.is === "a" ? { href: "#" } : null }), { 29 default: withCtx(() => [ 30 renderSlot(_ctx.$slots, "default") 31 ]), 32 _: 3 33 }, 16)) 34 ], 2); 35} 36const PageItem = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__file", "PageItem.vue"]]); 37const maxItems = 6; 38const _sfc_main$2 = /* @__PURE__ */ defineComponent({ 39 __name: "PaginationDesktop", 40 props: { 41 total: { default: 1 }, 42 current: { default: 1 } 43 }, 44 emits: ["change", "prev", "next"], 45 setup(__props, { expose: __expose, emit: __emit }) { 46 __expose(); 47 const { t } = useI18n(); 48 const emit = __emit; 49 const showPrev = computed(() => __props.current > 1); 50 const showNext = computed(() => __props.current < __props.total); 51 const handlePageClick = (v) => { 52 emit("change", v); 53 scrollToTop(); 54 }; 55 const displayItems = computed(() => { 56 let last = Math.max(maxItems, __props.current + 2); 57 if (last > __props.total - 1) { 58 last = __props.total - 1; 59 } 60 let first = 2; 61 if (last > maxItems) { 62 first = last - maxItems + 2; 63 } 64 return fillSequentialArray(first, last); 65 }); 66 function fillSequentialArray(first, last) { 67 return Array.from({ length: last - first + 1 }, (_, i) => first + i); 68 } 69 const __returned__ = { t, maxItems, emit, showPrev, showNext, handlePageClick, displayItems, fillSequentialArray, RmcIcon, PageItem }; 70 Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); 71 return __returned__; 72 } 73}); 74const _hoisted_1$1 = { 75 key: 0, 76 class: "rmc-pagination", 77 "data-testid": "fp-pagination-desktop" 78}; 79const _hoisted_2$1 = { 80 "aria-hidden": "true", 81 class: "rmc-color-blue-500" 82}; 83const _hoisted_3 = { 84 class: "d-flex rmc-pagination__numbers", 85 "data-testid": "fp-page-numbers" 86}; 87const _hoisted_4 = { 88 key: 0, 89 class: "d-flex align-items-center" 90}; 91const _hoisted_5 = { 92 key: 1, 93 class: "d-flex align-items-center" 94}; 95const _hoisted_6 = { 96 "aria-hidden": "true", 97 class: "rmc-color-blue-500" 98}; 99function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) { 100 return $props.total > 1 ? (openBlock(), createElementBlock("div", _hoisted_1$1, [ 101 createVNode($setup["PageItem"], { 102 class: "w-auto rmc-gap-md d-inline-flex", 103 style: normalizeStyle({ visibility: $setup.showPrev ? "visible" : "hidden" }), 104 "data-testid": "fp-page-prev", 105 "aria-hidden": !$setup.showPrev, 106 onClick: _cache[0] || (_cache[0] = withModifiers(($event) => $setup.showPrev && _ctx.$emit("prev"), ["prevent"])) 107 }, { 108 default: withCtx(() => [ 109 createBaseVNode("span", _hoisted_2$1, [ 110 createVNode($setup["RmcIcon"], { 111 class: "rmc-width-2xl", 112 "icon-name": "arrow-right" 113 }) 114 ]), 115 createBaseVNode("span", null, toDisplayString($setup.t("pagination.previous")), 1) 116 ]), 117 _: 1 118 }, 8, ["style", "aria-hidden"]), 119 createBaseVNode("div", _hoisted_3, [ 120 createVNode($setup["PageItem"], { 121 "data-testid": "fp-page-1", 122 onClick: _cache[1] || (_cache[1] = withModifiers(() => $setup.handlePageClick(1), ["prevent"])), 123 active: 1 === $props.current 124 }, { 125 default: withCtx(() => _cache[4] || (_cache[4] = [ 126 createTextVNode(" 1 ") 127 ])), 128 _: 1 129 }, 8, ["active"]), 130 $setup.displayItems[0] > 2 ? (openBlock(), createElementBlock("span", _hoisted_4, " ... ")) : createCommentVNode("", true), 131 (openBlock(true), createElementBlock(Fragment, null, renderList($setup.displayItems, (i) => { 132 return openBlock(), createBlock($setup["PageItem"], { 133 key: i, 134 "data-testid": `fp-page-${i}`, 135 onClick: withModifiers(() => $setup.handlePageClick(i), ["prevent"]), 136 active: i === $props.current 137 }, { 138 default: withCtx(() => [ 139 createTextVNode(toDisplayString(i), 1) 140 ]), 141 _: 2 142 }, 1032, ["data-testid", "onClick", "active"]); 143 }), 128)), 144 $setup.displayItems[$setup.displayItems.length - 1] < $props.total - 1 ? (openBlock(), createElementBlock("span", _hoisted_5, " ... ")) : createCommentVNode("", true), 145 createVNode($setup["PageItem"], { 146 "data-testid": `fp-page-${$props.total}`, 147 onClick: _cache[2] || (_cache[2] = withModifiers(() => $setup.handlePageClick($props.total), ["prevent"])), 148 active: $props.total === $props.current 149 }, { 150 default: withCtx(() => [ 151 createTextVNode(toDisplayString($props.total), 1) 152 ]), 153 _: 1 154 }, 8, ["data-testid", "active"]) 155 ]), 156 createVNode($setup["PageItem"], { 157 class: "w-auto rmc-gap-md d-inline-flex", 158 style: normalizeStyle({ visibility: $setup.showNext ? "visible" : "hidden" }), 159 "data-testid": "fp-page-next", 160 "aria-hidden": !$setup.showNext, 161 onClick: _cache[3] || (_cache[3] = withModifiers(($event) => $setup.showNext && _ctx.$emit("next"), ["prevent"])) 162 }, {
163 default: withCtx(() => [ 164 createBaseVNode("span", null, toDisplayString($setup.t("pagination.next")), 1), 165 createBaseVNode("span", _hoisted_6, [ 166 createVNode($setup["RmcIcon"], { 167 class: "rmc-width-2xl", 168 "icon-name": "arrow-right" 169 }) 170 ]) 171 ]), 172 _: 1 173 }, 8, ["style", "aria-hidden"]) 174 ])) : createCommentVNode("", true); 175} 176const PaginationDesktop = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__file", "PaginationDesktop.vue"]]); 177const _sfc_main$1 = /* @__PURE__ */ defineComponent({ 178 __name: "PaginationMobile", 179 props: { 180 total: { default: 1 }, 181 current: { default: 1 } 182 }, 183 emits: ["change", "prev", "next"], 184 setup(__props, { expose: __expose, emit: __emit }) { 185 __expose(); 186 const { t } = useI18n(); 187 const emit = __emit; 188 const showPrev = computed(() => __props.current > 1); 189 const showNext = computed(() => __props.current < __props.total); 190 const __returned__ = { t, emit, showPrev, showNext, RmcIcon, PageItem, RmcButton }; 191 Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); 192 return __returned__; 193 } 194}); 195const _hoisted_1 = { 196 key: 0, 197 class: "rmc-pagination" 198}; 199const _hoisted_2 = { class: "d-flex align-items-center" }; 200function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) { 201 return $props.total > 1 ? (openBlock(), createElementBlock("div", _hoisted_1, [ 202 createVNode($setup["PageItem"], { 203 class: "w-auto rmc-gap-md d-inline-flex", 204 "aria-hidden": !$setup.showPrev, 205 onClick: _cache[0] || (_cache[0] = withModifiers(($event) => $setup.showPrev && _ctx.$emit("prev"), ["prevent"])) 206 }, { 207 default: withCtx(() => [ 208 $setup.showPrev ? (openBlock(), createBlock($setup["RmcButton"], { 209 key: 0, 210 variant: "secondary", 211 class: "rmc-p-md" 212 }, { 213 default: withCtx(() => [ 214 createVNode($setup["RmcIcon"], { "icon-name": "arrow-right-alt" }) 215 ]), 216 _: 1 217 })) : (openBlock(), createBlock($setup["RmcButton"], { 218 key: 1, 219 variant: "secondary", 220 class: "rmc-p-md invisible", 221 "aria-hidden": "true", 222 tabindex: "-1" 223 })) 224 ]), 225 _: 1 226 }, 8, ["aria-hidden"]), 227 createBaseVNode("span", _hoisted_2, toDisplayString($setup.t("pagination.pageOf", { current: $props.current, total: $props.total })), 1), 228 createVNode($setup["PageItem"], { 229 class: "w-auto rmc-gap-md d-inline-flex", 230 "aria-hidden": !$setup.showNext, 231 onClick: _cache[1] || (_cache[1] = withModifiers(($event) => $setup.showNext && _ctx.$emit("next"), ["prevent"])) 232 }, { 233 default: withCtx(() => [ 234 $setup.showNext ? (openBlock(), createBlock($setup["RmcButton"], { 235 key: 0, 236 variant: "secondary", 237 class: "rmc-p-md" 238 }, { 239 default: withCtx(() => [ 240 createVNode($setup["RmcIcon"], { "icon-name": "arrow-right-alt" }) 241 ]), 242 _: 1 243 })) : (openBlock(), createBlock($setup["RmcButton"], { 244 key: 1, 245 variant: "secondary", 246 class: "rmc-p-md invisible", 247 "aria-hidden": "true", 248 tabindex: "-1" 249 })) 250 ]), 251 _: 1 252 }, 8, ["aria-hidden"]) 253 ])) : createCommentVNode("", true); 254} 255const PaginationMobile = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__file", "PaginationMobile.vue"]]); 256const _sfc_main = /* @__PURE__ */ defineComponent({ 257 __name: "RmcPagination", 258 props: { 259 total: { default: 1 }, 260 current: { default: 1 } 261 }, 262 setup(__props, { expose: __expose }) { 263 __expose(); 264 watch( 265 () => __props.current, 266 () => { 267 setTimeout(() => scrollToTop()); 268 } 269 ); 270 const __returned__ = { PaginationDesktop, PaginationMobile }; 271 Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true }); 272 return __returned__; 273 } 274}); 275function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { 276 return openBlock(), createElementBlock(Fragment, null, [ 277 createVNode($setup["PaginationDesktop"], mergeProps({ class: "d-none d-xl-flex" }
277, { ..._ctx.$attrs, total: $props.total, current: $props.current }), null, 16), 278 createVNode($setup["PaginationMobile"], mergeProps({ class: "d-flex d-xl-none" }, { ..._ctx.$attrs, total: $props.total, current: $props.current }), null, 16) 279 ], 64); 280} 281const RmcPagination = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "RmcPagination.vue"]]); 282export { 283 RmcPagination as R 284};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.