bootstrap-vue-next 0.45.4 → 0.45.6
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/dist/{BAccordion-Gz2SpRmq.mjs → BAccordion-D51b9HVD.mjs} +5 -5
- package/dist/{BAccordion-Gz2SpRmq.mjs.map → BAccordion-D51b9HVD.mjs.map} +1 -1
- package/dist/{BAccordion-DgXJMqdG.js → BAccordion-DYmuqZIG.js} +5 -5
- package/dist/{BAccordion-DgXJMqdG.js.map → BAccordion-DYmuqZIG.js.map} +1 -1
- package/dist/{BAlert-BFPBalmr.mjs → BAlert-Ce2uxrJi.mjs} +8 -8
- package/dist/{BAlert-BFPBalmr.mjs.map → BAlert-Ce2uxrJi.mjs.map} +1 -1
- package/dist/{BAlert-Dk3rgEOI.js → BAlert-croEtrQu.js} +8 -8
- package/dist/{BAlert-Dk3rgEOI.js.map → BAlert-croEtrQu.js.map} +1 -1
- package/dist/{BApp-CIu-zI8K.mjs → BApp-B-fUrnpK.mjs} +2 -2
- package/dist/{BApp-CIu-zI8K.mjs.map → BApp-B-fUrnpK.mjs.map} +1 -1
- package/dist/{BApp-cBKQc5Dd.js → BApp-DOvEe1jo.js} +2 -2
- package/dist/{BApp-cBKQc5Dd.js.map → BApp-DOvEe1jo.js.map} +1 -1
- package/dist/{BAspect-BULTO240.js → BAspect-CUIU48Ck.js} +2 -2
- package/dist/{BAspect-BULTO240.js.map → BAspect-CUIU48Ck.js.map} +1 -1
- package/dist/{BAspect-CwokVvvn.mjs → BAspect-wfiXM4KA.mjs} +2 -2
- package/dist/{BAspect-CwokVvvn.mjs.map → BAspect-wfiXM4KA.mjs.map} +1 -1
- package/dist/{BAutocomplete-j3KJbBFs.mjs → BAutocomplete-CH-bQzME.mjs} +9 -9
- package/dist/{BAutocomplete-j3KJbBFs.mjs.map → BAutocomplete-CH-bQzME.mjs.map} +1 -1
- package/dist/{BAutocomplete-BCOfyy8g.js → BAutocomplete-DLDFAV5_.js} +9 -9
- package/dist/{BAutocomplete-BCOfyy8g.js.map → BAutocomplete-DLDFAV5_.js.map} +1 -1
- package/dist/{BAvatar-CZn0MQHY.js → BAvatar-FGK0dK0x.js} +5 -5
- package/dist/{BAvatar-CZn0MQHY.js.map → BAvatar-FGK0dK0x.js.map} +1 -1
- package/dist/{BAvatar-DODGnQMY.mjs → BAvatar-iALHbqVk.mjs} +5 -5
- package/dist/{BAvatar-DODGnQMY.mjs.map → BAvatar-iALHbqVk.mjs.map} +1 -1
- package/dist/{BBadge-CZ219I7a.mjs → BBadge-Cx_CdauK.mjs} +3 -3
- package/dist/{BBadge-CZ219I7a.mjs.map → BBadge-Cx_CdauK.mjs.map} +1 -1
- package/dist/{BBadge-DTJcCo9u.js → BBadge-Db6SEnzy.js} +3 -3
- package/dist/{BBadge-DTJcCo9u.js.map → BBadge-Db6SEnzy.js.map} +1 -1
- package/dist/{BBreadcrumb-DFG2Qxl9.js → BBreadcrumb-B9ra7vg2.js} +3 -3
- package/dist/{BBreadcrumb-DFG2Qxl9.js.map → BBreadcrumb-B9ra7vg2.js.map} +1 -1
- package/dist/{BBreadcrumb-Dk4ia-9c.mjs → BBreadcrumb-BxADbg0O.mjs} +3 -3
- package/dist/{BBreadcrumb-Dk4ia-9c.mjs.map → BBreadcrumb-BxADbg0O.mjs.map} +1 -1
- package/dist/{BButton-C0Ylhonf.mjs → BButton-BSa7LfL5.mjs} +5 -5
- package/dist/{BButton-C0Ylhonf.mjs.map → BButton-BSa7LfL5.mjs.map} +1 -1
- package/dist/{BButton-BZ9eI3ZX.js → BButton-DRRlzkyK.js} +5 -5
- package/dist/{BButton-BZ9eI3ZX.js.map → BButton-DRRlzkyK.js.map} +1 -1
- package/dist/{BButton-D_sCrjpg.mjs → BButton-PY7AANXJ.mjs} +4 -4
- package/dist/{BButton-D_sCrjpg.mjs.map → BButton-PY7AANXJ.mjs.map} +1 -1
- package/dist/{BButton-Dr-RadYQ.js → BButton-aYtMnyHu.js} +4 -4
- package/dist/{BButton-Dr-RadYQ.js.map → BButton-aYtMnyHu.js.map} +1 -1
- package/dist/{BCard-cj8_dIcz.mjs → BCard-BWoruisp.mjs} +3 -3
- package/dist/{BCard-cj8_dIcz.mjs.map → BCard-BWoruisp.mjs.map} +1 -1
- package/dist/{BCard-BjQkY783.js → BCard-Bh8RLMo_.js} +3 -3
- package/dist/{BCard-BjQkY783.js.map → BCard-Bh8RLMo_.js.map} +1 -1
- package/dist/{BCard-TS8DtOwm.mjs → BCard-CHbKv2OR.mjs} +3 -3
- package/dist/{BCard-TS8DtOwm.mjs.map → BCard-CHbKv2OR.mjs.map} +1 -1
- package/dist/{BCard-BkvG5Zzw.js → BCard-DwNYhVmg.js} +3 -3
- package/dist/{BCard-BkvG5Zzw.js.map → BCard-DwNYhVmg.js.map} +1 -1
- package/dist/{BCarousel-D23rApAX.js → BCarousel-2JB21Pcu.js} +5 -5
- package/dist/{BCarousel-D23rApAX.js.map → BCarousel-2JB21Pcu.js.map} +1 -1
- package/dist/{BCarousel-VL1gVXpt.mjs → BCarousel-B6_bgQpl.mjs} +5 -5
- package/dist/{BCarousel-VL1gVXpt.mjs.map → BCarousel-B6_bgQpl.mjs.map} +1 -1
- package/dist/{BCloseButton-CCdRwLDo.mjs → BCloseButton-CKTKr4PS.mjs} +2 -2
- package/dist/{BCloseButton-CCdRwLDo.mjs.map → BCloseButton-CKTKr4PS.mjs.map} +1 -1
- package/dist/{BCloseButton-fw5ONnhr.js → BCloseButton-D42zHRLP.js} +2 -2
- package/dist/{BCloseButton-fw5ONnhr.js.map → BCloseButton-D42zHRLP.js.map} +1 -1
- package/dist/{BCol-VPaTVLsM.mjs → BCol-B3VeEk9z.mjs} +2 -2
- package/dist/{BCol-VPaTVLsM.mjs.map → BCol-B3VeEk9z.mjs.map} +1 -1
- package/dist/{BCol-CArTYHqb.js → BCol-Ck9VydHj.js} +2 -2
- package/dist/{BCol-CArTYHqb.js.map → BCol-Ck9VydHj.js.map} +1 -1
- package/dist/{BCollapse-CZlDVTpI.js → BCollapse-CDLYLSZo.js} +5 -5
- package/dist/{BCollapse-CZlDVTpI.js.map → BCollapse-CDLYLSZo.js.map} +1 -1
- package/dist/{BCollapse-CTvK48kB.mjs → BCollapse-kqhe4AmL.mjs} +5 -5
- package/dist/{BCollapse-CTvK48kB.mjs.map → BCollapse-kqhe4AmL.mjs.map} +1 -1
- package/dist/{BContainer-CeHyMYb_.mjs → BContainer-ATfhaxTc.mjs} +4 -4
- package/dist/{BContainer-CeHyMYb_.mjs.map → BContainer-ATfhaxTc.mjs.map} +1 -1
- package/dist/{BContainer-CNmEk2mi.js → BContainer-CcF6dgtI.js} +4 -4
- package/dist/{BContainer-CNmEk2mi.js.map → BContainer-CcF6dgtI.js.map} +1 -1
- package/dist/{BDateField-gRWIwMnA.mjs → BDateField-CccP3H1R.mjs} +3 -3
- package/dist/{BDateField-gRWIwMnA.mjs.map → BDateField-CccP3H1R.mjs.map} +1 -1
- package/dist/{BDateField-B4yL8Pju.js → BDateField-DzZw5FRX.js} +3 -3
- package/dist/{BDateField-B4yL8Pju.js.map → BDateField-DzZw5FRX.js.map} +1 -1
- package/dist/{BDatePicker-m2drV1fl.js → BDatePicker-BDkzkOcm.js} +3 -3
- package/dist/{BDatePicker-m2drV1fl.js.map → BDatePicker-BDkzkOcm.js.map} +1 -1
- package/dist/{BDatePicker-ZuMpgD91.mjs → BDatePicker-BnwnSkBg.mjs} +3 -3
- package/dist/{BDatePicker-ZuMpgD91.mjs.map → BDatePicker-BnwnSkBg.mjs.map} +1 -1
- package/dist/{BDropdown-D2ep4wKG.mjs → BDropdown-0E8x5kk6.mjs} +5 -5
- package/dist/{BDropdown-D2ep4wKG.mjs.map → BDropdown-0E8x5kk6.mjs.map} +1 -1
- package/dist/{BDropdown-B2vWJ-u0.mjs → BDropdown-B1DbvVzm.mjs} +7 -7
- package/dist/{BDropdown-B2vWJ-u0.mjs.map → BDropdown-B1DbvVzm.mjs.map} +1 -1
- package/dist/{BDropdown-BSCasYDc.js → BDropdown-BPFtkX3p.js} +7 -7
- package/dist/{BDropdown-BSCasYDc.js.map → BDropdown-BPFtkX3p.js.map} +1 -1
- package/dist/{BDropdown-CL-erjq8.js → BDropdown-DKCgBzYS.js} +5 -5
- package/dist/{BDropdown-CL-erjq8.js.map → BDropdown-DKCgBzYS.js.map} +1 -1
- package/dist/{BForm-CriVh5cC.js → BForm-6JlWdQMO.js} +10 -7
- package/dist/{BForm-CriVh5cC.js.map → BForm-6JlWdQMO.js.map} +1 -1
- package/dist/{BForm-CpNuvbIt.mjs → BForm-BVfW08s5.mjs} +2 -2
- package/dist/{BForm-CpNuvbIt.mjs.map → BForm-BVfW08s5.mjs.map} +1 -1
- package/dist/{BForm-__5Chigr.mjs → BForm-DJu2hDV_.mjs} +11 -8
- package/dist/{BForm-__5Chigr.mjs.map → BForm-DJu2hDV_.mjs.map} +1 -1
- package/dist/{BForm-K67Ciyza.js → BForm-cnRpggt9.js} +2 -2
- package/dist/{BForm-K67Ciyza.js.map → BForm-cnRpggt9.js.map} +1 -1
- package/dist/{BFormCheckbox-xN7AQw4O.mjs → BFormCheckbox-Baf_9BSc.mjs} +9 -6
- package/dist/BFormCheckbox-Baf_9BSc.mjs.map +1 -0
- package/dist/{BFormCheckbox-g7gtIrhy.js → BFormCheckbox-D5ySHMJ8.js} +9 -6
- package/dist/BFormCheckbox-D5ySHMJ8.js.map +1 -0
- package/dist/{BFormFile-DXdAyYmv.mjs → BFormFile-EXRrATZm.mjs} +3 -3
- package/dist/{BFormFile-DXdAyYmv.mjs.map → BFormFile-EXRrATZm.mjs.map} +1 -1
- package/dist/{BFormFile-DC-x9wQo.js → BFormFile-X-BQsYko.js} +3 -3
- package/dist/{BFormFile-DC-x9wQo.js.map → BFormFile-X-BQsYko.js.map} +1 -1
- package/dist/{BFormGroup-DZTiChgT.js → BFormGroup-Bk1t-D1N.js} +89 -104
- package/dist/BFormGroup-Bk1t-D1N.js.map +1 -0
- package/dist/{BFormGroup-ayltvQts.mjs → BFormGroup-vysRPb99.mjs} +90 -105
- package/dist/BFormGroup-vysRPb99.mjs.map +1 -0
- package/dist/{BFormInput-DNuvqbFQ.js → BFormInput-CBwwDjfC.js} +4 -4
- package/dist/{BFormInput-DNuvqbFQ.js.map → BFormInput-CBwwDjfC.js.map} +1 -1
- package/dist/{BFormInput-NKko58M2.mjs → BFormInput-sEfU3CuN.mjs} +4 -4
- package/dist/{BFormInput-NKko58M2.mjs.map → BFormInput-sEfU3CuN.mjs.map} +1 -1
- package/dist/{BFormOtp-B4al7MJf.mjs → BFormOtp-C8X3u1od.mjs} +4 -4
- package/dist/{BFormOtp-B4al7MJf.mjs.map → BFormOtp-C8X3u1od.mjs.map} +1 -1
- package/dist/{BFormOtp-UcLR9oFd.js → BFormOtp-CLrQJRPe.js} +4 -4
- package/dist/{BFormOtp-UcLR9oFd.js.map → BFormOtp-CLrQJRPe.js.map} +1 -1
- package/dist/{BFormRadio-DX-gM5Rc.js → BFormRadio-B2yu-o2v.js} +9 -6
- package/dist/BFormRadio-B2yu-o2v.js.map +1 -0
- package/dist/{BFormRadio-DHx68AdL.mjs → BFormRadio-COc_IbxC.mjs} +9 -6
- package/dist/BFormRadio-COc_IbxC.mjs.map +1 -0
- package/dist/{BFormRating-BR7RMvZG.mjs → BFormRating-CIgPVsH_.mjs} +4 -4
- package/dist/{BFormRating-BR7RMvZG.mjs.map → BFormRating-CIgPVsH_.mjs.map} +1 -1
- package/dist/{BFormRating-CF-x5qkB.js → BFormRating-CSdRxN5z.js} +4 -4
- package/dist/{BFormRating-CF-x5qkB.js.map → BFormRating-CSdRxN5z.js.map} +1 -1
- package/dist/{BFormSelect-CUkyKBNN.js → BFormSelect-CI92Dv27.js} +8 -7
- package/dist/BFormSelect-CI92Dv27.js.map +1 -0
- package/dist/{BFormSelect-Co-ZU8yY.mjs → BFormSelect-P-InkOm-.mjs} +8 -7
- package/dist/BFormSelect-P-InkOm-.mjs.map +1 -0
- package/dist/{BFormSelectOption-B3BO50XB.mjs → BFormSelectOption-DFN4lPRh.mjs} +3 -3
- package/dist/{BFormSelectOption-B3BO50XB.mjs.map → BFormSelectOption-DFN4lPRh.mjs.map} +1 -1
- package/dist/{BFormSelectOption-CQ3j1Q5j.js → BFormSelectOption-DrwJucNf.js} +3 -3
- package/dist/{BFormSelectOption-CQ3j1Q5j.js.map → BFormSelectOption-DrwJucNf.js.map} +1 -1
- package/dist/{BFormSpinbutton-DPCXum9q.js → BFormSpinbutton-1gTz4nTo.js} +4 -4
- package/dist/{BFormSpinbutton-DPCXum9q.js.map → BFormSpinbutton-1gTz4nTo.js.map} +1 -1
- package/dist/{BFormSpinbutton-CPsVUIh9.mjs → BFormSpinbutton-6qkTBF_4.mjs} +4 -4
- package/dist/{BFormSpinbutton-CPsVUIh9.mjs.map → BFormSpinbutton-6qkTBF_4.mjs.map} +1 -1
- package/dist/{BFormTag-Bsy6Znok.js → BFormTag-CeV0MSRC.js} +4 -4
- package/dist/{BFormTag-Bsy6Znok.js.map → BFormTag-CeV0MSRC.js.map} +1 -1
- package/dist/{BFormTag-Cjg1R-Lj.mjs → BFormTag-CnzI39y9.mjs} +4 -4
- package/dist/{BFormTag-Cjg1R-Lj.mjs.map → BFormTag-CnzI39y9.mjs.map} +1 -1
- package/dist/{BFormTags-D2Dk598Q.mjs → BFormTags-BMltSaKL.mjs} +4 -4
- package/dist/{BFormTags-D2Dk598Q.mjs.map → BFormTags-BMltSaKL.mjs.map} +1 -1
- package/dist/{BFormTags-BIZyBseI.js → BFormTags-BhO60uiL.js} +4 -4
- package/dist/{BFormTags-BIZyBseI.js.map → BFormTags-BhO60uiL.js.map} +1 -1
- package/dist/{BFormTextarea-CYh47SxL.js → BFormTextarea-C3Cj0DWj.js} +3 -3
- package/dist/{BFormTextarea-CYh47SxL.js.map → BFormTextarea-C3Cj0DWj.js.map} +1 -1
- package/dist/{BFormTextarea-M21mholw.mjs → BFormTextarea-DN1gAfSo.mjs} +3 -3
- package/dist/{BFormTextarea-M21mholw.mjs.map → BFormTextarea-DN1gAfSo.mjs.map} +1 -1
- package/dist/{BFormValidFeedback-DWkakzVO.mjs → BFormValidFeedback-CBYxQLDz.mjs} +44 -4
- package/dist/BFormValidFeedback-CBYxQLDz.mjs.map +1 -0
- package/dist/{BFormValidFeedback-BhkEhSa0.js → BFormValidFeedback-Kwxh798d.js} +48 -2
- package/dist/BFormValidFeedback-Kwxh798d.js.map +1 -0
- package/dist/{BImg-DFiJSy66.js → BImg-JKJLgYYT.js} +2 -2
- package/dist/{BImg-DFiJSy66.js.map → BImg-JKJLgYYT.js.map} +1 -1
- package/dist/{BImg-UUMOpbK0.mjs → BImg-QBS2ECBc.mjs} +2 -2
- package/dist/{BImg-UUMOpbK0.mjs.map → BImg-QBS2ECBc.mjs.map} +1 -1
- package/dist/{BInputGroup-BAC-B_UM.js → BInputGroup-Bvlfv6VD.js} +3 -3
- package/dist/{BInputGroup-BAC-B_UM.js.map → BInputGroup-Bvlfv6VD.js.map} +1 -1
- package/dist/{BInputGroup-CiKwWBSu.js → BInputGroup-D4fW324B.js} +3 -3
- package/dist/{BInputGroup-CiKwWBSu.js.map → BInputGroup-D4fW324B.js.map} +1 -1
- package/dist/{BInputGroup-CfELrPhK.mjs → BInputGroup-DiTSexkT.mjs} +3 -3
- package/dist/{BInputGroup-CfELrPhK.mjs.map → BInputGroup-DiTSexkT.mjs.map} +1 -1
- package/dist/{BInputGroup-3AVRA3U7.mjs → BInputGroup-X2Z53RJx.mjs} +3 -3
- package/dist/{BInputGroup-3AVRA3U7.mjs.map → BInputGroup-X2Z53RJx.mjs.map} +1 -1
- package/dist/{BLink-CNFWSz0D.mjs → BLink-Dfgte6dQ.mjs} +3 -3
- package/dist/{BLink-CNFWSz0D.mjs.map → BLink-Dfgte6dQ.mjs.map} +1 -1
- package/dist/{BLink-uLjtY3bY.js → BLink-kLEjleB1.js} +3 -3
- package/dist/{BLink-uLjtY3bY.js.map → BLink-kLEjleB1.js.map} +1 -1
- package/dist/{BListGroup-CeXKZio1.js → BListGroup-C8JOzHTz.js} +4 -4
- package/dist/{BListGroup-CeXKZio1.js.map → BListGroup-C8JOzHTz.js.map} +1 -1
- package/dist/{BListGroup-CGxa7ZEu.mjs → BListGroup-DwTLpNiD.mjs} +4 -4
- package/dist/{BListGroup-CGxa7ZEu.mjs.map → BListGroup-DwTLpNiD.mjs.map} +1 -1
- package/dist/{BModal-BEmloby5.mjs → BModal-C-ZCau2E.mjs} +7 -7
- package/dist/{BModal-BEmloby5.mjs.map → BModal-C-ZCau2E.mjs.map} +1 -1
- package/dist/{BModal-6hh-azT8.js → BModal-VstTwEq9.js} +7 -7
- package/dist/{BModal-6hh-azT8.js.map → BModal-VstTwEq9.js.map} +1 -1
- package/dist/{BNav-u9QwSGj3.js → BNav-DCLambmM.js} +5 -5
- package/dist/{BNav-u9QwSGj3.js.map → BNav-DCLambmM.js.map} +1 -1
- package/dist/{BNav-EHHlEg1E.mjs → BNav-DfYvjfRK.mjs} +5 -5
- package/dist/{BNav-EHHlEg1E.mjs.map → BNav-DfYvjfRK.mjs.map} +1 -1
- package/dist/{BNavbar-s8yvmhyz.js → BNavbar-BLWaZJRP.js} +4 -4
- package/dist/{BNavbar-s8yvmhyz.js.map → BNavbar-BLWaZJRP.js.map} +1 -1
- package/dist/{BNavbar-kgHIo_Gr.mjs → BNavbar-xYaikQVY.mjs} +4 -4
- package/dist/{BNavbar-kgHIo_Gr.mjs.map → BNavbar-xYaikQVY.mjs.map} +1 -1
- package/dist/{BOffcanvas-CwH0DqSG.mjs → BOffcanvas-CQb9XNvS.mjs} +6 -6
- package/dist/{BOffcanvas-CwH0DqSG.mjs.map → BOffcanvas-CQb9XNvS.mjs.map} +1 -1
- package/dist/{BOffcanvas-DdiP19Xz.js → BOffcanvas-DTRiZzwN.js} +6 -6
- package/dist/{BOffcanvas-DdiP19Xz.js.map → BOffcanvas-DTRiZzwN.js.map} +1 -1
- package/dist/{BOverlay-DSUoseNJ.mjs → BOverlay-Bh2PIN_q.mjs} +3 -3
- package/dist/{BOverlay-DSUoseNJ.mjs.map → BOverlay-Bh2PIN_q.mjs.map} +1 -1
- package/dist/{BOverlay--gZBEMlX.js → BOverlay-Bh4ldxgt.js} +3 -3
- package/dist/{BOverlay--gZBEMlX.js.map → BOverlay-Bh4ldxgt.js.map} +1 -1
- package/dist/{BPagination-C7MKOk8h.mjs → BPagination-D75q-ZNg.mjs} +2 -2
- package/dist/{BPagination-C7MKOk8h.mjs.map → BPagination-D75q-ZNg.mjs.map} +1 -1
- package/dist/{BPagination-D6W1LdgK.js → BPagination-fbjFAtxu.js} +2 -2
- package/dist/{BPagination-D6W1LdgK.js.map → BPagination-fbjFAtxu.js.map} +1 -1
- package/dist/{BPlaceholder-Ckvq3tMu.js → BPlaceholder-B3rs_39w.js} +4 -4
- package/dist/{BPlaceholder-Ckvq3tMu.js.map → BPlaceholder-B3rs_39w.js.map} +1 -1
- package/dist/{BPlaceholder-D__hNPyQ.mjs → BPlaceholder-DPQ6mCLN.mjs} +4 -4
- package/dist/{BPlaceholder-D__hNPyQ.mjs.map → BPlaceholder-DPQ6mCLN.mjs.map} +1 -1
- package/dist/{BProgress-I1ucNlpA.mjs → BProgress-BZlrPYhA.mjs} +3 -3
- package/dist/{BProgress-I1ucNlpA.mjs.map → BProgress-BZlrPYhA.mjs.map} +1 -1
- package/dist/{BProgress-ySlPjpRn.js → BProgress-th0-eZWo.js} +3 -3
- package/dist/{BProgress-ySlPjpRn.js.map → BProgress-th0-eZWo.js.map} +1 -1
- package/dist/{BRow-CmKiMcMZ.js → BRow-7AOuFiSy.js} +2 -2
- package/dist/{BRow-CmKiMcMZ.js.map → BRow-7AOuFiSy.js.map} +1 -1
- package/dist/{BRow-U3L8AcKV.mjs → BRow-eGSUYGCW.mjs} +2 -2
- package/dist/{BRow-U3L8AcKV.mjs.map → BRow-eGSUYGCW.mjs.map} +1 -1
- package/dist/{BSpinner-CAo-XD04.mjs → BSpinner-CUfGqviV.mjs} +2 -2
- package/dist/{BSpinner-CAo-XD04.mjs.map → BSpinner-CUfGqviV.mjs.map} +1 -1
- package/dist/{BSpinner-C1bm8U4-.js → BSpinner-DbYIp-C7.js} +2 -2
- package/dist/{BSpinner-C1bm8U4-.js.map → BSpinner-DbYIp-C7.js.map} +1 -1
- package/dist/{BTable-Bt75vbNu.mjs → BTable-CzMtFdt5.mjs} +5 -5
- package/dist/{BTable-Bt75vbNu.mjs.map → BTable-CzMtFdt5.mjs.map} +1 -1
- package/dist/{BTable-CXxJl2ps.js → BTable-DOpSWDaC.js} +5 -5
- package/dist/{BTable-CXxJl2ps.js.map → BTable-DOpSWDaC.js.map} +1 -1
- package/dist/{BTableSimple-pyz_6D4s.js → BTableSimple-BkdGAAKb.js} +3 -3
- package/dist/{BTableSimple-pyz_6D4s.js.map → BTableSimple-BkdGAAKb.js.map} +1 -1
- package/dist/{BTableSimple-CThwYBVl.mjs → BTableSimple-C-jn9Nwh.mjs} +3 -3
- package/dist/{BTableSimple-CThwYBVl.mjs.map → BTableSimple-C-jn9Nwh.mjs.map} +1 -1
- package/dist/{BTabs-C8rUY0Lx.js → BTabs-CvecFg5N.js} +4 -4
- package/dist/{BTabs-C8rUY0Lx.js.map → BTabs-CvecFg5N.js.map} +1 -1
- package/dist/{BTabs-Krs_Lv-R.mjs → BTabs-D_vWlBjT.mjs} +4 -4
- package/dist/{BTabs-Krs_Lv-R.mjs.map → BTabs-D_vWlBjT.mjs.map} +1 -1
- package/dist/{BTimeField-DSf4cMpN.mjs → BTimeField-BSDaZogC.mjs} +3 -3
- package/dist/{BTimeField-DSf4cMpN.mjs.map → BTimeField-BSDaZogC.mjs.map} +1 -1
- package/dist/{BTimeField-W2LqGCjB.js → BTimeField-BT5HXecp.js} +3 -3
- package/dist/{BTimeField-W2LqGCjB.js.map → BTimeField-BT5HXecp.js.map} +1 -1
- package/dist/{BToast-DZuxMDbe.js → BToast-DR0pek4W.js} +8 -8
- package/dist/{BToast-DZuxMDbe.js.map → BToast-DR0pek4W.js.map} +1 -1
- package/dist/{BToast-Dcfnqbxt.mjs → BToast-Y8BayxES.mjs} +8 -8
- package/dist/{BToast-Dcfnqbxt.mjs.map → BToast-Y8BayxES.mjs.map} +1 -1
- package/dist/{BTooltip-BWij0hjE.mjs → BTooltip-CVP8HdkU.mjs} +3 -3
- package/dist/{BTooltip-BWij0hjE.mjs.map → BTooltip-CVP8HdkU.mjs.map} +1 -1
- package/dist/{BTooltip-BGTjsV1z.js → BTooltip-DPLYtaL1.js} +3 -3
- package/dist/{BTooltip-BGTjsV1z.js.map → BTooltip-DPLYtaL1.js.map} +1 -1
- package/dist/bootstrap-vue-next.mjs +59 -59
- package/dist/bootstrap-vue-next.umd.js +59 -59
- package/dist/composables/useProvideFormGroupData.d.mts +15 -0
- package/dist/composables/useProvideFormGroupData.d.ts +15 -0
- package/dist/{floatingUi-8xXp54zf.mjs → floatingUi-62aeQtAb.mjs} +4 -4
- package/dist/{floatingUi-8xXp54zf.mjs.map → floatingUi-62aeQtAb.mjs.map} +1 -1
- package/dist/{floatingUi-9SWu8BgZ.js → floatingUi-DQ5bHmy3.js} +4 -4
- package/dist/{floatingUi-9SWu8BgZ.js.map → floatingUi-DQ5bHmy3.js.map} +1 -1
- package/dist/{keys-durSVUrO.js → keys-BMye8nSf.js} +10 -1
- package/dist/{keys-durSVUrO.js.map → keys-BMye8nSf.js.map} +1 -1
- package/dist/{keys-CQKrwmvN.mjs → keys-DU7sQgl3.mjs} +10 -1
- package/dist/{keys-CQKrwmvN.mjs.map → keys-DU7sQgl3.mjs.map} +1 -1
- package/dist/src/components/BAccordion/index.mjs +1 -1
- package/dist/src/components/BAccordion/index.umd.js +1 -1
- package/dist/src/components/BAlert/index.mjs +1 -1
- package/dist/src/components/BAlert/index.umd.js +1 -1
- package/dist/src/components/BApp/index.mjs +1 -1
- package/dist/src/components/BApp/index.umd.js +1 -1
- package/dist/src/components/BAspect/index.mjs +1 -1
- package/dist/src/components/BAspect/index.umd.js +1 -1
- package/dist/src/components/BAutocomplete/index.mjs +1 -1
- package/dist/src/components/BAutocomplete/index.umd.js +1 -1
- package/dist/src/components/BAvatar/index.mjs +1 -1
- package/dist/src/components/BAvatar/index.umd.js +1 -1
- package/dist/src/components/BBadge/index.mjs +1 -1
- package/dist/src/components/BBadge/index.umd.js +1 -1
- package/dist/src/components/BBreadcrumb/index.mjs +1 -1
- package/dist/src/components/BBreadcrumb/index.umd.js +1 -1
- package/dist/src/components/BButton/index.mjs +3 -3
- package/dist/src/components/BButton/index.umd.js +3 -3
- package/dist/src/components/BCard/index.mjs +2 -2
- package/dist/src/components/BCard/index.umd.js +2 -2
- package/dist/src/components/BCarousel/index.mjs +1 -1
- package/dist/src/components/BCarousel/index.umd.js +1 -1
- package/dist/src/components/BCol/index.mjs +1 -1
- package/dist/src/components/BCol/index.umd.js +1 -1
- package/dist/src/components/BCollapse/index.mjs +1 -1
- package/dist/src/components/BCollapse/index.umd.js +1 -1
- package/dist/src/components/BContainer/index.mjs +3 -3
- package/dist/src/components/BContainer/index.umd.js +3 -3
- package/dist/src/components/BDateField/index.mjs +1 -1
- package/dist/src/components/BDateField/index.umd.js +1 -1
- package/dist/src/components/BDatePicker/index.mjs +1 -1
- package/dist/src/components/BDatePicker/index.umd.js +1 -1
- package/dist/src/components/BDropdown/index.mjs +2 -2
- package/dist/src/components/BDropdown/index.umd.js +2 -2
- package/dist/src/components/BForm/index.mjs +3 -3
- package/dist/src/components/BForm/index.umd.js +3 -3
- package/dist/src/components/BFormCheckbox/index.mjs +1 -1
- package/dist/src/components/BFormCheckbox/index.umd.js +1 -1
- package/dist/src/components/BFormFile/index.mjs +1 -1
- package/dist/src/components/BFormFile/index.umd.js +1 -1
- package/dist/src/components/BFormGroup/index.mjs +1 -1
- package/dist/src/components/BFormGroup/index.umd.js +1 -1
- package/dist/src/components/BFormInput/index.mjs +1 -1
- package/dist/src/components/BFormInput/index.umd.js +1 -1
- package/dist/src/components/BFormOtp/index.mjs +1 -1
- package/dist/src/components/BFormOtp/index.umd.js +1 -1
- package/dist/src/components/BFormRadio/index.mjs +1 -1
- package/dist/src/components/BFormRadio/index.umd.js +1 -1
- package/dist/src/components/BFormRating/index.mjs +1 -1
- package/dist/src/components/BFormRating/index.umd.js +1 -1
- package/dist/src/components/BFormSelect/index.mjs +2 -2
- package/dist/src/components/BFormSelect/index.umd.js +2 -2
- package/dist/src/components/BFormSpinbutton/index.mjs +1 -1
- package/dist/src/components/BFormSpinbutton/index.umd.js +1 -1
- package/dist/src/components/BFormTags/index.mjs +2 -2
- package/dist/src/components/BFormTags/index.umd.js +2 -2
- package/dist/src/components/BFormTextarea/index.mjs +1 -1
- package/dist/src/components/BFormTextarea/index.umd.js +1 -1
- package/dist/src/components/BImg/index.mjs +1 -1
- package/dist/src/components/BImg/index.umd.js +1 -1
- package/dist/src/components/BInputGroup/index.mjs +2 -2
- package/dist/src/components/BInputGroup/index.umd.js +2 -2
- package/dist/src/components/BLink/index.mjs +1 -1
- package/dist/src/components/BLink/index.umd.js +1 -1
- package/dist/src/components/BListGroup/index.mjs +1 -1
- package/dist/src/components/BListGroup/index.umd.js +1 -1
- package/dist/src/components/BModal/index.mjs +1 -1
- package/dist/src/components/BModal/index.umd.js +1 -1
- package/dist/src/components/BNav/index.mjs +1 -1
- package/dist/src/components/BNav/index.umd.js +1 -1
- package/dist/src/components/BNavbar/index.mjs +1 -1
- package/dist/src/components/BNavbar/index.umd.js +1 -1
- package/dist/src/components/BOffcanvas/index.mjs +1 -1
- package/dist/src/components/BOffcanvas/index.umd.js +1 -1
- package/dist/src/components/BOverlay/index.mjs +1 -1
- package/dist/src/components/BOverlay/index.umd.js +1 -1
- package/dist/src/components/BPagination/index.mjs +1 -1
- package/dist/src/components/BPagination/index.umd.js +1 -1
- package/dist/src/components/BPlaceholder/index.mjs +1 -1
- package/dist/src/components/BPlaceholder/index.umd.js +1 -1
- package/dist/src/components/BPopover/index.mjs +1 -1
- package/dist/src/components/BPopover/index.umd.js +1 -1
- package/dist/src/components/BProgress/index.mjs +1 -1
- package/dist/src/components/BProgress/index.umd.js +1 -1
- package/dist/src/components/BRow/index.mjs +1 -1
- package/dist/src/components/BRow/index.umd.js +1 -1
- package/dist/src/components/BSpinner/index.mjs +1 -1
- package/dist/src/components/BSpinner/index.umd.js +1 -1
- package/dist/src/components/BTable/index.mjs +2 -2
- package/dist/src/components/BTable/index.umd.js +2 -2
- package/dist/src/components/BTabs/index.mjs +1 -1
- package/dist/src/components/BTabs/index.umd.js +1 -1
- package/dist/src/components/BTimeField/index.mjs +1 -1
- package/dist/src/components/BTimeField/index.umd.js +1 -1
- package/dist/src/components/BToast/index.mjs +1 -1
- package/dist/src/components/BToast/index.umd.js +1 -1
- package/dist/src/components/BTooltip/index.mjs +1 -1
- package/dist/src/components/BTooltip/index.umd.js +1 -1
- package/dist/src/components/index.mjs +59 -59
- package/dist/src/components/index.umd.js +59 -59
- package/dist/src/composables/orchestratorShared/index.mjs +1 -1
- package/dist/src/composables/orchestratorShared/index.umd.js +1 -1
- package/dist/src/composables/useBreadcrumb/index.mjs +1 -1
- package/dist/src/composables/useBreadcrumb/index.umd.js +1 -1
- package/dist/src/composables/useModal/index.mjs +2 -2
- package/dist/src/composables/useModal/index.umd.js +2 -2
- package/dist/src/composables/usePopover/index.mjs +3 -3
- package/dist/src/composables/usePopover/index.umd.js +3 -3
- package/dist/src/composables/useProvideDefaults/index.mjs +1 -1
- package/dist/src/composables/useProvideDefaults/index.umd.js +1 -1
- package/dist/src/composables/useRegistry/index.mjs +1 -1
- package/dist/src/composables/useRegistry/index.umd.js +1 -1
- package/dist/src/composables/useToast/index.mjs +2 -2
- package/dist/src/composables/useToast/index.umd.js +2 -2
- package/dist/src/composables/useToggle/index.mjs +1 -1
- package/dist/src/composables/useToggle/index.umd.js +1 -1
- package/dist/src/directives/BPopover/index.mjs +2 -2
- package/dist/src/directives/BPopover/index.umd.js +2 -2
- package/dist/src/directives/BScrollspy/index.mjs +1 -1
- package/dist/src/directives/BScrollspy/index.umd.js +1 -1
- package/dist/src/directives/BToggle/index.mjs +2 -2
- package/dist/src/directives/BToggle/index.umd.js +2 -2
- package/dist/src/directives/BTooltip/index.mjs +2 -2
- package/dist/src/directives/BTooltip/index.umd.js +2 -2
- package/dist/src/plugins/createBootstrap/index.mjs +1 -1
- package/dist/src/plugins/createBootstrap/index.umd.js +1 -1
- package/dist/src/plugins/orchestrator/index.mjs +1 -1
- package/dist/src/plugins/orchestrator/index.umd.js +1 -1
- package/dist/src/plugins/registry/index.mjs +1 -1
- package/dist/src/plugins/registry/index.umd.js +1 -1
- package/dist/src/plugins/rtl/index.mjs +1 -1
- package/dist/src/plugins/rtl/index.umd.js +1 -1
- package/dist/{useDefaults-DsLf4iRY.js → useDefaults-C0CYry78.js} +2 -2
- package/dist/{useDefaults-DsLf4iRY.js.map → useDefaults-C0CYry78.js.map} +1 -1
- package/dist/{useDefaults-BKgBaqOV.mjs → useDefaults-DseelK6y.mjs} +2 -2
- package/dist/{useDefaults-BKgBaqOV.mjs.map → useDefaults-DseelK6y.mjs.map} +1 -1
- package/dist/{useFormInput-CA4FYoV7.mjs → useFormInput-CXl8rpD0.mjs} +5 -4
- package/dist/useFormInput-CXl8rpD0.mjs.map +1 -0
- package/dist/{useFormInput-D31FCDxr.js → useFormInput-ip9hN2AU.js} +5 -4
- package/dist/useFormInput-ip9hN2AU.js.map +1 -0
- package/dist/{useFormSelect-C0nvno12.mjs → useFormSelect-BM0rsjni.mjs} +9 -2
- package/dist/useFormSelect-BM0rsjni.mjs.map +1 -0
- package/dist/{useFormSelect-CjAziZpu.js → useFormSelect-ClmzGzOy.js} +9 -2
- package/dist/useFormSelect-ClmzGzOy.js.map +1 -0
- package/dist/{useId-DHrBgM7P.js → useId-BkAY2oh6.js} +2 -2
- package/dist/{useId-DHrBgM7P.js.map → useId-BkAY2oh6.js.map} +1 -1
- package/dist/{useId-BKZFSYm8.mjs → useId-D1sqXtwx.mjs} +2 -2
- package/dist/{useId-BKZFSYm8.mjs.map → useId-D1sqXtwx.mjs.map} +1 -1
- package/dist/{useRtl-DDPRnA7g.js → useRtl-BSgvbs5F.js} +2 -2
- package/dist/{useRtl-DDPRnA7g.js.map → useRtl-BSgvbs5F.js.map} +1 -1
- package/dist/{useRtl-VR3M2Txg.mjs → useRtl-CGoXBxNo.mjs} +2 -2
- package/dist/{useRtl-VR3M2Txg.mjs.map → useRtl-CGoXBxNo.mjs.map} +1 -1
- package/dist/{useShowHide-DKdljnpv.mjs → useShowHide-CBFt1_EW.mjs} +2 -2
- package/dist/{useShowHide-DKdljnpv.mjs.map → useShowHide-CBFt1_EW.mjs.map} +1 -1
- package/dist/{useShowHide-BhdrR1wG.js → useShowHide-CHm2uUep.js} +2 -2
- package/dist/{useShowHide-BhdrR1wG.js.map → useShowHide-CHm2uUep.js.map} +1 -1
- package/dist/utils/keys.d.mts +11 -1
- package/dist/utils/keys.d.ts +11 -1
- package/dist/{utils-BbYwYPyP.mjs → utils-CWvndqPg.mjs} +3 -3
- package/dist/{utils-BbYwYPyP.mjs.map → utils-CWvndqPg.mjs.map} +1 -1
- package/dist/{utils-ePxMJ7rd.js → utils-Dk9yAtbs.js} +3 -3
- package/dist/{utils-ePxMJ7rd.js.map → utils-Dk9yAtbs.js.map} +1 -1
- package/package.json +1 -1
- package/dist/BFormCheckbox-g7gtIrhy.js.map +0 -1
- package/dist/BFormCheckbox-xN7AQw4O.mjs.map +0 -1
- package/dist/BFormGroup-DZTiChgT.js.map +0 -1
- package/dist/BFormGroup-ayltvQts.mjs.map +0 -1
- package/dist/BFormRadio-DHx68AdL.mjs.map +0 -1
- package/dist/BFormRadio-DX-gM5Rc.js.map +0 -1
- package/dist/BFormSelect-CUkyKBNN.js.map +0 -1
- package/dist/BFormSelect-Co-ZU8yY.mjs.map +0 -1
- package/dist/BFormValidFeedback-BhkEhSa0.js.map +0 -1
- package/dist/BFormValidFeedback-DWkakzVO.mjs.map +0 -1
- package/dist/useFormInput-CA4FYoV7.mjs.map +0 -1
- package/dist/useFormInput-D31FCDxr.js.map +0 -1
- package/dist/useFormSelect-C0nvno12.mjs.map +0 -1
- package/dist/useFormSelect-CjAziZpu.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BPagination-C7MKOk8h.mjs","names":[],"sources":["../src/components/BPagination/BPagination.vue","../src/components/BPagination/BPagination.vue"],"sourcesContent":["<template>\n <ul\n class=\"pagination\"\n :class=\"computedWrapperClasses\"\n role=\"menubar\"\n :aria-disabled=\"props.disabled\"\n :aria-label=\"props.ariaLabel || undefined\"\n @keydown=\"handleKeyNav\"\n >\n <li\n v-for=\"(page, index) in pages\"\n :key=\"`page-${page.id}`\"\n v-bind=\"page.li\"\n ref=\"_pageElements\"\n :[dataDisplayNameCustomAttribute]=\"index\"\n >\n <span\n v-if=\"page.id === FIRST_ELLIPSIS || page.id === LAST_ELLIPSIS\"\n v-bind=\"ellipsisProps.span\"\n >\n <slot name=\"ellipsis-text\">\n {{ props.ellipsisText || '...' }}\n </slot>\n </span>\n <component\n v-bind=\"page.button\"\n :is=\"page.button.is\"\n v-else-if=\"'button' in page\"\n @click=\"page.clickHandler\"\n >\n <slot\n :name=\"page.text.name\"\n :disabled=\"page.text.disabled\"\n :page=\"page.text.page\"\n :index=\"page.text.index\"\n :active=\"page.text.active ?? false\"\n :content=\"page.text.value\"\n >\n {{ page.text.value }}\n </slot>\n </component>\n </li>\n </ul>\n</template>\n\n<script setup lang=\"ts\">\nimport {BvEvent} from '../../utils'\nimport {computed, nextTick, useTemplateRef, watch} from 'vue'\nimport {useAlignment} from '../../composables/useAlignment'\nimport {useToNumber} from '@vueuse/core'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {ClassValue} from '../../types/AnyValuedAttributes'\nimport {CODE_DOWN, CODE_LEFT, CODE_RIGHT, CODE_UP} from '../../utils/constants'\nimport {getActiveElement} from '../../utils/dom'\nimport {type BPaginationEmits, type BPaginationProps, type BPaginationSlots} from '../../types'\n\n// Threshold of limit size when we start/stop showing ellipsis\nconst ELLIPSIS_THRESHOLD = 3\n\nconst FIRST_BUTTON = -1\nconst PREV_BUTTON = -2\nconst NEXT_BUTTON = -3\nconst LAST_BUTTON = -4\nconst FIRST_ELLIPSIS = -5\nconst LAST_ELLIPSIS = -6\n\nconst dataDisplayNameCustomAttribute = 'data-display-name'\n\nconst _props = withDefaults(defineProps<Omit<BPaginationProps, 'modelValue'>>(), {\n align: 'start',\n ariaControls: undefined,\n ariaLabel: 'Pagination',\n disabled: false,\n ellipsisClass: undefined,\n ellipsisText: '\\u2026',\n firstClass: undefined,\n firstNumber: false,\n firstText: '\\u00AB',\n noEllipsis: false,\n noGotoEndButtons: false,\n labelFirstPage: 'Go to first page',\n labelLastPage: 'Go to last page',\n labelNextPage: 'Go to next page',\n labelPage: 'Go to page',\n labelPrevPage: 'Go to previous page',\n lastClass: undefined,\n lastNumber: false,\n lastText: '\\u00BB',\n limit: 5,\n nextClass: undefined,\n nextText: '\\u203A',\n pageClass: undefined,\n perPage: DEFAULT_PER_PAGE,\n pills: false,\n prevClass: undefined,\n prevText: '\\u2039',\n size: undefined,\n totalRows: DEFAULT_TOTAL_ROWS,\n})\nconst props = useDefaults(_props, 'BPagination')\nconst emit = defineEmits<BPaginationEmits>()\ndefineSlots<BPaginationSlots>()\n\nconst modelValue = defineModel<Exclude<BPaginationProps['modelValue'], undefined>>({\n default: 1,\n})\n\nconst pageElements = useTemplateRef('_pageElements')\n\nconst limitNumber = useToNumber(() => props.limit, {nanToZero: true, method: 'parseInt'})\nconst perPageNumber = useToNumber(() => props.perPage, {nanToZero: true, method: 'parseInt'})\nconst totalRowsNumber = useToNumber(() => props.totalRows, {nanToZero: true, method: 'parseInt'})\nconst modelValueNumber = useToNumber(modelValue, {nanToZero: true, method: 'parseInt'})\n\nconst perPageSanitized = computed(() => Math.max(perPageNumber.value || DEFAULT_PER_PAGE, 1))\nconst totalRowsSanitized = computed(() => Math.max(totalRowsNumber.value || DEFAULT_TOTAL_ROWS, 0))\n// Use Active to on page-item to denote active tab\nconst numberOfPages = computed(() => Math.ceil(totalRowsSanitized.value / perPageSanitized.value))\nconst computedFill = computed(() => props.align === 'fill')\n// This doesn't use the computedFill util because TS cannot infer that it would never be 'fill'\nconst justifyAlign = computed(() => (props.align === 'fill' ? 'start' : props.align))\n\nconst alignment = useAlignment(justifyAlign)\n\nconst isActivePage = (pageNumber: number) => pageNumber === computedModelValue.value\nconst getTabIndex = (num: number) => (props.disabled ? null : isActivePage(num) ? '0' : '-1')\n\nconst checkDisabled = (num: number) =>\n props.disabled ||\n isActivePage(num) ||\n computedModelValue.value < 1 ||\n // Check if the number is out of bounds\n num < 1 ||\n num > numberOfPages.value\n\nconst firstDisabled = computed(() => checkDisabled(1))\nconst prevDisabled = computed(() => checkDisabled(computedModelValue.value - 1))\nconst lastDisabled = computed(() => checkDisabled(numberOfPages.value))\nconst nextDisabled = computed(() => checkDisabled(computedModelValue.value + 1))\n\nconst getBaseButtonProps = ({\n page,\n classVal,\n disabled,\n slotName,\n textValue,\n tabIndex,\n label,\n position,\n isActive,\n hidden,\n isSmHidden,\n}: {\n page: number\n disabled: boolean\n classVal: ClassValue\n slotName: 'first-text' | 'prev-text' | 'next-text' | 'last-text' | 'page'\n textValue?: string\n tabIndex?: string\n label?: string\n position?: number\n isActive?: boolean\n hidden?: boolean\n isSmHidden?: boolean\n}) => ({\n li: {\n 'class': [\n 'page-item',\n {\n 'active': isActive,\n disabled,\n 'bv-d-sm-down-none': isSmHidden,\n 'flex-fill': computedFill.value,\n 'd-flex': computedFill.value && !disabled,\n },\n classVal,\n ],\n 'role': 'presentation',\n 'aria-hidden': hidden,\n },\n button: {\n 'is': disabled ? 'span' : 'button',\n 'class': ['page-link', 'text-center', {'flex-grow-1': !disabled && computedFill.value}],\n 'aria-label': label,\n 'aria-controls': props.ariaControls || undefined,\n 'aria-disabled': disabled ? true : undefined,\n 'aria-posinset': position,\n 'aria-setsize': position ? numberOfPages.value : undefined,\n 'role': 'menuitem',\n 'type': disabled ? undefined : 'button',\n 'tabindex': disabled ? undefined : tabIndex,\n },\n text: {\n name: slotName,\n active: isActive,\n value: textValue ?? page,\n page,\n disabled,\n index: page - 1,\n content: textValue ? undefined : String(page),\n },\n clickHandler: (e: Readonly<MouseEvent>) => pageClick(e, page),\n})\n\nconst getButtonProps = ({\n page,\n classVal,\n disabled,\n slotName,\n textValue,\n label,\n}: {\n page: number\n disabled: boolean\n classVal: ClassValue\n slotName: 'first-text' | 'prev-text' | 'next-text' | 'last-text' | 'page'\n textValue?: string\n label: string\n}) => getBaseButtonProps({page, classVal, disabled, slotName, textValue, label, tabIndex: '-1'})\n\nconst getPageButtonProps = (page: number, isSmHidden?: boolean) =>\n getBaseButtonProps({\n page,\n disabled: props.disabled,\n classVal: props.pageClass,\n slotName: 'page',\n label: props.labelPage ? `${props.labelPage} ${page}` : undefined,\n tabIndex: getTabIndex(page) ?? undefined,\n position: page,\n isActive: isActivePage(page),\n isSmHidden,\n })\n\nconst firstButtonProps = computed(() =>\n getButtonProps({\n page: 1,\n disabled: firstDisabled.value,\n classVal: props.firstClass,\n slotName: 'first-text',\n textValue: props.firstText,\n label: props.labelFirstPage,\n })\n)\nconst prevButtonProps = computed(() =>\n getButtonProps({\n page: Math.max(computedModelValue.value - 1, 1),\n disabled: prevDisabled.value,\n classVal: props.prevClass,\n slotName: 'prev-text',\n textValue: props.prevText,\n label: props.labelPrevPage,\n })\n)\nconst nextButtonProps = computed(() =>\n getButtonProps({\n page: Math.min(computedModelValue.value + 1, numberOfPages.value),\n disabled: nextDisabled.value,\n classVal: props.nextClass,\n slotName: 'next-text',\n textValue: props.nextText,\n label: props.labelNextPage,\n })\n)\nconst lastButtonProps = computed(() =>\n getButtonProps({\n page: numberOfPages.value,\n disabled: lastDisabled.value,\n classVal: props.lastClass,\n slotName: 'last-text',\n textValue: props.lastText,\n label: props.labelLastPage,\n })\n)\n\nconst ellipsisProps = computed(() => ({\n li: {\n class: [\n 'page-item',\n 'disabled',\n 'text-center',\n 'bv-d-sm-down-none',\n computedFill.value ? 'flex-fill' : '',\n props.ellipsisClass,\n ],\n role: 'separator',\n },\n span: {\n class: ['page-link'],\n },\n}))\n\nconst computedWrapperClasses = computed(() => [\n alignment.value,\n {\n [`pagination-${props.size}`]: props.size !== undefined,\n 'b-pagination-pills': props.pills,\n },\n])\n\nconst pagination = computed(() => ({\n pageSize: perPageSanitized.value,\n totalRows: totalRowsNumber.value,\n numberOfPages: numberOfPages.value,\n}))\n\nconst pageClick = (event: Readonly<MouseEvent>, pageNumber: number) => {\n if (pageNumber === computedModelValue.value) return\n const clickEvent = new BvEvent('page-click', {\n cancelable: true,\n target: event.target,\n })\n emit('page-click', clickEvent, pageNumber)\n\n if (clickEvent.defaultPrevented) return\n\n modelValue.value = pageNumber\n\n nextTick(() => {\n if (pageNumber === 1) {\n focusFirst()\n } else if (pageNumber === pagination.value.numberOfPages) {\n focusLast()\n }\n })\n // nextTick(() => {\n // if (isVisible(target) && un_element.contains(target)) {\n // attemptFocus(target)\n //} else {\n //this.focusCurrent()\n //}\n // })\n}\n\nconst isDisabled = (el: HTMLButtonElement) => {\n const isElement = el && el.nodeType === Node.ELEMENT_NODE\n const hasAttr = isElement ? el.hasAttribute('disabled') : null\n const hasClass = isElement && el.classList ? el.classList.contains('disabled') : false\n\n return !isElement || el.disabled || hasAttr || hasClass\n}\n\nconst getButtons = (): HTMLButtonElement[] =>\n [...(pageElements.value ?? [])]\n .sort(\n (a, b) =>\n Number.parseInt(a.getAttribute(dataDisplayNameCustomAttribute) || '0') -\n Number.parseInt(b.getAttribute(dataDisplayNameCustomAttribute) || '0')\n )\n .map((page) => page.children[0])\n .filter((el) => {\n if (el?.getAttribute('display') === 'none' || el?.tagName.toUpperCase() !== 'BUTTON') {\n return false\n }\n\n const bcr = el?.getBoundingClientRect()\n\n return !!(bcr && bcr.height > 0 && bcr.width > 0)\n })\n .map((el) => el as HTMLButtonElement)\n\nconst focusFirst = () => {\n nextTick(() => {\n const btn = getButtons().find((el) => !isDisabled(el))\n btn?.focus()\n })\n}\n\nconst focusPrev = () => {\n nextTick(() => {\n const buttons = getButtons()\n const index = buttons.indexOf(getActiveElement() as HTMLButtonElement)\n\n const button = buttons[index - 1]\n if (index > 0 && button !== undefined && !isDisabled(button)) {\n buttons[index - 1]?.focus()\n }\n })\n}\n\nconst focusLast = () => {\n nextTick(() => {\n const btn = getButtons()\n .reverse()\n .find((el) => !isDisabled(el))\n btn?.focus()\n })\n}\n\nconst focusNext = () => {\n nextTick(() => {\n const buttons = getButtons()\n const index = buttons.indexOf(getActiveElement() as HTMLButtonElement)\n const button = buttons[index + 1]\n if (index < buttons.length - 1 && button !== undefined && !isDisabled(button)) {\n buttons[index + 1]?.focus()\n }\n })\n}\n\nconst handleKeyNav = (event: KeyboardEvent) => {\n const {code, shiftKey} = event\n if (code === CODE_LEFT || code === CODE_UP) {\n event.preventDefault()\n if (shiftKey) {\n focusFirst()\n } else {\n focusPrev()\n }\n } else if (code === CODE_RIGHT || code === CODE_DOWN) {\n event.preventDefault()\n if (shiftKey) {\n focusLast()\n } else {\n focusNext()\n }\n }\n}\n\nconst computedModelValue = computed(() => {\n const page = modelValueNumber.value || 1\n return page > numberOfPages.value ? numberOfPages.value : page < 1 ? 1 : page\n})\n\nwatch(pagination, (oldValue, newValue) => {\n if (newValue.pageSize !== oldValue.pageSize && newValue.totalRows === oldValue.totalRows) {\n // If the page size changes, reset to page 1\n modelValue.value = 1\n }\n})\n\nconst noFirstButton = computed(() => (props.noGotoEndButtons && !props.firstNumber ? 1 : 0))\nconst noLastButton = computed(() => (props.noGotoEndButtons && !props.lastNumber ? 1 : 0))\nconst showFirstButton = computed(() => (noFirstButton.value ? 0 : 1))\nconst showLastButton = computed(() => (noLastButton.value ? 0 : 1))\nconst firstPage = computed(() => (props.firstNumber ? 1 : 0))\nconst lastPage = computed(() => (props.lastNumber ? 1 : 0))\nconst halfLimit = computed(() => Math.floor(limitNumber.value / 2))\n\nconst pages = computed(() => {\n const {value} = computedModelValue\n\n const els = elements.value.map((p) => {\n switch (p) {\n case FIRST_BUTTON:\n return {id: p, ...firstButtonProps.value}\n case PREV_BUTTON:\n return {id: p, ...prevButtonProps.value}\n case NEXT_BUTTON:\n return {id: p, ...nextButtonProps.value}\n case LAST_BUTTON:\n return {id: p, ...lastButtonProps.value}\n case FIRST_ELLIPSIS:\n case LAST_ELLIPSIS:\n return {id: p, ...ellipsisProps.value}\n default:\n return {id: p, ...getPageButtonProps(p)}\n }\n })\n\n if (numberOfPages.value > 3) {\n if (value > numberOfPages.value - halfLimit.value - lastPage.value) {\n const idx = 2 + showFirstButton.value\n const el = els[idx]\n if (el !== undefined) {\n els[idx] = {id: el.id, ...getPageButtonProps(el.id, true)}\n }\n }\n\n if (value <= halfLimit.value + firstPage.value) {\n const idx = els.length - (3 + showLastButton.value)\n const el = els[idx]\n if (el !== undefined) {\n els[idx] = {id: el.id, ...getPageButtonProps(el.id, true)}\n }\n }\n }\n\n return els\n})\n\nconst elements = computed(() => {\n // The idea here is to create an array of all the buttons on the page control.\n // This way we can keep the invariants in one place and the template code just\n // iterates over the array.\n\n const pages = numberOfPages.value\n const {value} = computedModelValue\n const limit = limitNumber.value\n const noEllipsis = props.noEllipsis || limit <= ELLIPSIS_THRESHOLD\n\n // The first case is when all the page buttons fit on the control, this is\n // the simplest case and the only one that will create an array smaller than\n // Limit + 4 - noEndButtons * 2 (the [first, last,] prev, next buttons)\n\n if (pages < limit + firstPage.value + lastPage.value) {\n return [\n !firstPage.value && !noFirstButton.value ? FIRST_BUTTON : null,\n PREV_BUTTON,\n ...Array.from({length: pages}, (_, index) => index + 1),\n NEXT_BUTTON,\n !lastPage.value && !noLastButton.value ? LAST_BUTTON : null,\n ].filter((x) => x !== null) as number[]\n }\n\n // All the remaining cases result in an array that is exactly limit + 4 - noEndButtons * 2 in length, so create\n // the array upfront and set up the beginning and end buttons, then fill the rest for each case\n\n const buttons = Array.from({length: limit + 4 - (noFirstButton.value + noLastButton.value)})\n if (!noFirstButton.value) {\n if (!firstPage.value) {\n buttons[0] = FIRST_BUTTON\n buttons[1] = PREV_BUTTON\n } else {\n buttons[0] = PREV_BUTTON\n buttons[1] = 1\n }\n } else {\n buttons[0] = PREV_BUTTON\n }\n\n if (!noLastButton.value) {\n if (!lastPage.value) {\n buttons[buttons.length - 1] = LAST_BUTTON\n buttons[buttons.length - 2] = NEXT_BUTTON\n } else {\n buttons[buttons.length - 1] = NEXT_BUTTON\n buttons[buttons.length - 2] = pages\n }\n } else {\n buttons[buttons.length - 1] = NEXT_BUTTON\n }\n\n // The next case is where the page buttons start at the beginning, with\n // no ellipsis at the beginning, but one at the end\n\n if (value <= halfLimit.value + firstPage.value) {\n for (let index = 1; index <= limit; index++) {\n buttons[index + 1 - noFirstButton.value] = index + firstPage.value\n }\n\n if (!noEllipsis) {\n buttons[buttons.length - (2 + showLastButton.value)] = LAST_ELLIPSIS\n }\n }\n\n // And then we have the case where the page buttons go up to the end, with no\n // ellipsis at the end, but one at the beginning\n\n if (value > pages - halfLimit.value - lastPage.value) {\n const start = pages - (limit - 1) - lastPage.value\n for (let index = 0; index < limit; index++) {\n buttons[index + 2 - noFirstButton.value] = start + index\n }\n\n if (!noEllipsis) {\n buttons[1 + showFirstButton.value] = FIRST_ELLIPSIS\n }\n }\n\n // Finally we have the case where we have ellipsis at both ends\n if (!buttons[2]) {\n // Is there a more elegant way to check that we're in the final case?\n const start = value - Math.floor(limit / 2)\n for (let index = 0; index < limit; index++) {\n buttons[index + 2 - noFirstButton.value] = start + index\n }\n\n if (!noEllipsis) {\n buttons[1 + showFirstButton.value] = FIRST_ELLIPSIS\n buttons[buttons.length - (2 + showLastButton.value)] = LAST_ELLIPSIS\n }\n }\n\n //Enable sanity check for debugging purposes\n // for (let i = 0; i < buttons.length; i++) {\n // if (!buttons[i]) {\n // // eslint-disable-next-line no-console\n // console.log(\n // `Failed: button == ${i}, limit=${limit}, pages=${pages}, firstPage=${firstPage}, lastPage=${lastPage}, value=${value}`\n // )\n // }\n // }\n\n return buttons.filter((x) => x !== null) as number[]\n})\n</script>\n\n<script lang=\"ts\">\nconst DEFAULT_PER_PAGE = 20\nconst DEFAULT_TOTAL_ROWS = 0\n</script>\n","<template>\n <ul\n class=\"pagination\"\n :class=\"computedWrapperClasses\"\n role=\"menubar\"\n :aria-disabled=\"props.disabled\"\n :aria-label=\"props.ariaLabel || undefined\"\n @keydown=\"handleKeyNav\"\n >\n <li\n v-for=\"(page, index) in pages\"\n :key=\"`page-${page.id}`\"\n v-bind=\"page.li\"\n ref=\"_pageElements\"\n :[dataDisplayNameCustomAttribute]=\"index\"\n >\n <span\n v-if=\"page.id === FIRST_ELLIPSIS || page.id === LAST_ELLIPSIS\"\n v-bind=\"ellipsisProps.span\"\n >\n <slot name=\"ellipsis-text\">\n {{ props.ellipsisText || '...' }}\n </slot>\n </span>\n <component\n v-bind=\"page.button\"\n :is=\"page.button.is\"\n v-else-if=\"'button' in page\"\n @click=\"page.clickHandler\"\n >\n <slot\n :name=\"page.text.name\"\n :disabled=\"page.text.disabled\"\n :page=\"page.text.page\"\n :index=\"page.text.index\"\n :active=\"page.text.active ?? false\"\n :content=\"page.text.value\"\n >\n {{ page.text.value }}\n </slot>\n </component>\n </li>\n </ul>\n</template>\n\n<script setup lang=\"ts\">\nimport {BvEvent} from '../../utils'\nimport {computed, nextTick, useTemplateRef, watch} from 'vue'\nimport {useAlignment} from '../../composables/useAlignment'\nimport {useToNumber} from '@vueuse/core'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {ClassValue} from '../../types/AnyValuedAttributes'\nimport {CODE_DOWN, CODE_LEFT, CODE_RIGHT, CODE_UP} from '../../utils/constants'\nimport {getActiveElement} from '../../utils/dom'\nimport {type BPaginationEmits, type BPaginationProps, type BPaginationSlots} from '../../types'\n\n// Threshold of limit size when we start/stop showing ellipsis\nconst ELLIPSIS_THRESHOLD = 3\n\nconst FIRST_BUTTON = -1\nconst PREV_BUTTON = -2\nconst NEXT_BUTTON = -3\nconst LAST_BUTTON = -4\nconst FIRST_ELLIPSIS = -5\nconst LAST_ELLIPSIS = -6\n\nconst dataDisplayNameCustomAttribute = 'data-display-name'\n\nconst _props = withDefaults(defineProps<Omit<BPaginationProps, 'modelValue'>>(), {\n align: 'start',\n ariaControls: undefined,\n ariaLabel: 'Pagination',\n disabled: false,\n ellipsisClass: undefined,\n ellipsisText: '\\u2026',\n firstClass: undefined,\n firstNumber: false,\n firstText: '\\u00AB',\n noEllipsis: false,\n noGotoEndButtons: false,\n labelFirstPage: 'Go to first page',\n labelLastPage: 'Go to last page',\n labelNextPage: 'Go to next page',\n labelPage: 'Go to page',\n labelPrevPage: 'Go to previous page',\n lastClass: undefined,\n lastNumber: false,\n lastText: '\\u00BB',\n limit: 5,\n nextClass: undefined,\n nextText: '\\u203A',\n pageClass: undefined,\n perPage: DEFAULT_PER_PAGE,\n pills: false,\n prevClass: undefined,\n prevText: '\\u2039',\n size: undefined,\n totalRows: DEFAULT_TOTAL_ROWS,\n})\nconst props = useDefaults(_props, 'BPagination')\nconst emit = defineEmits<BPaginationEmits>()\ndefineSlots<BPaginationSlots>()\n\nconst modelValue = defineModel<Exclude<BPaginationProps['modelValue'], undefined>>({\n default: 1,\n})\n\nconst pageElements = useTemplateRef('_pageElements')\n\nconst limitNumber = useToNumber(() => props.limit, {nanToZero: true, method: 'parseInt'})\nconst perPageNumber = useToNumber(() => props.perPage, {nanToZero: true, method: 'parseInt'})\nconst totalRowsNumber = useToNumber(() => props.totalRows, {nanToZero: true, method: 'parseInt'})\nconst modelValueNumber = useToNumber(modelValue, {nanToZero: true, method: 'parseInt'})\n\nconst perPageSanitized = computed(() => Math.max(perPageNumber.value || DEFAULT_PER_PAGE, 1))\nconst totalRowsSanitized = computed(() => Math.max(totalRowsNumber.value || DEFAULT_TOTAL_ROWS, 0))\n// Use Active to on page-item to denote active tab\nconst numberOfPages = computed(() => Math.ceil(totalRowsSanitized.value / perPageSanitized.value))\nconst computedFill = computed(() => props.align === 'fill')\n// This doesn't use the computedFill util because TS cannot infer that it would never be 'fill'\nconst justifyAlign = computed(() => (props.align === 'fill' ? 'start' : props.align))\n\nconst alignment = useAlignment(justifyAlign)\n\nconst isActivePage = (pageNumber: number) => pageNumber === computedModelValue.value\nconst getTabIndex = (num: number) => (props.disabled ? null : isActivePage(num) ? '0' : '-1')\n\nconst checkDisabled = (num: number) =>\n props.disabled ||\n isActivePage(num) ||\n computedModelValue.value < 1 ||\n // Check if the number is out of bounds\n num < 1 ||\n num > numberOfPages.value\n\nconst firstDisabled = computed(() => checkDisabled(1))\nconst prevDisabled = computed(() => checkDisabled(computedModelValue.value - 1))\nconst lastDisabled = computed(() => checkDisabled(numberOfPages.value))\nconst nextDisabled = computed(() => checkDisabled(computedModelValue.value + 1))\n\nconst getBaseButtonProps = ({\n page,\n classVal,\n disabled,\n slotName,\n textValue,\n tabIndex,\n label,\n position,\n isActive,\n hidden,\n isSmHidden,\n}: {\n page: number\n disabled: boolean\n classVal: ClassValue\n slotName: 'first-text' | 'prev-text' | 'next-text' | 'last-text' | 'page'\n textValue?: string\n tabIndex?: string\n label?: string\n position?: number\n isActive?: boolean\n hidden?: boolean\n isSmHidden?: boolean\n}) => ({\n li: {\n 'class': [\n 'page-item',\n {\n 'active': isActive,\n disabled,\n 'bv-d-sm-down-none': isSmHidden,\n 'flex-fill': computedFill.value,\n 'd-flex': computedFill.value && !disabled,\n },\n classVal,\n ],\n 'role': 'presentation',\n 'aria-hidden': hidden,\n },\n button: {\n 'is': disabled ? 'span' : 'button',\n 'class': ['page-link', 'text-center', {'flex-grow-1': !disabled && computedFill.value}],\n 'aria-label': label,\n 'aria-controls': props.ariaControls || undefined,\n 'aria-disabled': disabled ? true : undefined,\n 'aria-posinset': position,\n 'aria-setsize': position ? numberOfPages.value : undefined,\n 'role': 'menuitem',\n 'type': disabled ? undefined : 'button',\n 'tabindex': disabled ? undefined : tabIndex,\n },\n text: {\n name: slotName,\n active: isActive,\n value: textValue ?? page,\n page,\n disabled,\n index: page - 1,\n content: textValue ? undefined : String(page),\n },\n clickHandler: (e: Readonly<MouseEvent>) => pageClick(e, page),\n})\n\nconst getButtonProps = ({\n page,\n classVal,\n disabled,\n slotName,\n textValue,\n label,\n}: {\n page: number\n disabled: boolean\n classVal: ClassValue\n slotName: 'first-text' | 'prev-text' | 'next-text' | 'last-text' | 'page'\n textValue?: string\n label: string\n}) => getBaseButtonProps({page, classVal, disabled, slotName, textValue, label, tabIndex: '-1'})\n\nconst getPageButtonProps = (page: number, isSmHidden?: boolean) =>\n getBaseButtonProps({\n page,\n disabled: props.disabled,\n classVal: props.pageClass,\n slotName: 'page',\n label: props.labelPage ? `${props.labelPage} ${page}` : undefined,\n tabIndex: getTabIndex(page) ?? undefined,\n position: page,\n isActive: isActivePage(page),\n isSmHidden,\n })\n\nconst firstButtonProps = computed(() =>\n getButtonProps({\n page: 1,\n disabled: firstDisabled.value,\n classVal: props.firstClass,\n slotName: 'first-text',\n textValue: props.firstText,\n label: props.labelFirstPage,\n })\n)\nconst prevButtonProps = computed(() =>\n getButtonProps({\n page: Math.max(computedModelValue.value - 1, 1),\n disabled: prevDisabled.value,\n classVal: props.prevClass,\n slotName: 'prev-text',\n textValue: props.prevText,\n label: props.labelPrevPage,\n })\n)\nconst nextButtonProps = computed(() =>\n getButtonProps({\n page: Math.min(computedModelValue.value + 1, numberOfPages.value),\n disabled: nextDisabled.value,\n classVal: props.nextClass,\n slotName: 'next-text',\n textValue: props.nextText,\n label: props.labelNextPage,\n })\n)\nconst lastButtonProps = computed(() =>\n getButtonProps({\n page: numberOfPages.value,\n disabled: lastDisabled.value,\n classVal: props.lastClass,\n slotName: 'last-text',\n textValue: props.lastText,\n label: props.labelLastPage,\n })\n)\n\nconst ellipsisProps = computed(() => ({\n li: {\n class: [\n 'page-item',\n 'disabled',\n 'text-center',\n 'bv-d-sm-down-none',\n computedFill.value ? 'flex-fill' : '',\n props.ellipsisClass,\n ],\n role: 'separator',\n },\n span: {\n class: ['page-link'],\n },\n}))\n\nconst computedWrapperClasses = computed(() => [\n alignment.value,\n {\n [`pagination-${props.size}`]: props.size !== undefined,\n 'b-pagination-pills': props.pills,\n },\n])\n\nconst pagination = computed(() => ({\n pageSize: perPageSanitized.value,\n totalRows: totalRowsNumber.value,\n numberOfPages: numberOfPages.value,\n}))\n\nconst pageClick = (event: Readonly<MouseEvent>, pageNumber: number) => {\n if (pageNumber === computedModelValue.value) return\n const clickEvent = new BvEvent('page-click', {\n cancelable: true,\n target: event.target,\n })\n emit('page-click', clickEvent, pageNumber)\n\n if (clickEvent.defaultPrevented) return\n\n modelValue.value = pageNumber\n\n nextTick(() => {\n if (pageNumber === 1) {\n focusFirst()\n } else if (pageNumber === pagination.value.numberOfPages) {\n focusLast()\n }\n })\n // nextTick(() => {\n // if (isVisible(target) && un_element.contains(target)) {\n // attemptFocus(target)\n //} else {\n //this.focusCurrent()\n //}\n // })\n}\n\nconst isDisabled = (el: HTMLButtonElement) => {\n const isElement = el && el.nodeType === Node.ELEMENT_NODE\n const hasAttr = isElement ? el.hasAttribute('disabled') : null\n const hasClass = isElement && el.classList ? el.classList.contains('disabled') : false\n\n return !isElement || el.disabled || hasAttr || hasClass\n}\n\nconst getButtons = (): HTMLButtonElement[] =>\n [...(pageElements.value ?? [])]\n .sort(\n (a, b) =>\n Number.parseInt(a.getAttribute(dataDisplayNameCustomAttribute) || '0') -\n Number.parseInt(b.getAttribute(dataDisplayNameCustomAttribute) || '0')\n )\n .map((page) => page.children[0])\n .filter((el) => {\n if (el?.getAttribute('display') === 'none' || el?.tagName.toUpperCase() !== 'BUTTON') {\n return false\n }\n\n const bcr = el?.getBoundingClientRect()\n\n return !!(bcr && bcr.height > 0 && bcr.width > 0)\n })\n .map((el) => el as HTMLButtonElement)\n\nconst focusFirst = () => {\n nextTick(() => {\n const btn = getButtons().find((el) => !isDisabled(el))\n btn?.focus()\n })\n}\n\nconst focusPrev = () => {\n nextTick(() => {\n const buttons = getButtons()\n const index = buttons.indexOf(getActiveElement() as HTMLButtonElement)\n\n const button = buttons[index - 1]\n if (index > 0 && button !== undefined && !isDisabled(button)) {\n buttons[index - 1]?.focus()\n }\n })\n}\n\nconst focusLast = () => {\n nextTick(() => {\n const btn = getButtons()\n .reverse()\n .find((el) => !isDisabled(el))\n btn?.focus()\n })\n}\n\nconst focusNext = () => {\n nextTick(() => {\n const buttons = getButtons()\n const index = buttons.indexOf(getActiveElement() as HTMLButtonElement)\n const button = buttons[index + 1]\n if (index < buttons.length - 1 && button !== undefined && !isDisabled(button)) {\n buttons[index + 1]?.focus()\n }\n })\n}\n\nconst handleKeyNav = (event: KeyboardEvent) => {\n const {code, shiftKey} = event\n if (code === CODE_LEFT || code === CODE_UP) {\n event.preventDefault()\n if (shiftKey) {\n focusFirst()\n } else {\n focusPrev()\n }\n } else if (code === CODE_RIGHT || code === CODE_DOWN) {\n event.preventDefault()\n if (shiftKey) {\n focusLast()\n } else {\n focusNext()\n }\n }\n}\n\nconst computedModelValue = computed(() => {\n const page = modelValueNumber.value || 1\n return page > numberOfPages.value ? numberOfPages.value : page < 1 ? 1 : page\n})\n\nwatch(pagination, (oldValue, newValue) => {\n if (newValue.pageSize !== oldValue.pageSize && newValue.totalRows === oldValue.totalRows) {\n // If the page size changes, reset to page 1\n modelValue.value = 1\n }\n})\n\nconst noFirstButton = computed(() => (props.noGotoEndButtons && !props.firstNumber ? 1 : 0))\nconst noLastButton = computed(() => (props.noGotoEndButtons && !props.lastNumber ? 1 : 0))\nconst showFirstButton = computed(() => (noFirstButton.value ? 0 : 1))\nconst showLastButton = computed(() => (noLastButton.value ? 0 : 1))\nconst firstPage = computed(() => (props.firstNumber ? 1 : 0))\nconst lastPage = computed(() => (props.lastNumber ? 1 : 0))\nconst halfLimit = computed(() => Math.floor(limitNumber.value / 2))\n\nconst pages = computed(() => {\n const {value} = computedModelValue\n\n const els = elements.value.map((p) => {\n switch (p) {\n case FIRST_BUTTON:\n return {id: p, ...firstButtonProps.value}\n case PREV_BUTTON:\n return {id: p, ...prevButtonProps.value}\n case NEXT_BUTTON:\n return {id: p, ...nextButtonProps.value}\n case LAST_BUTTON:\n return {id: p, ...lastButtonProps.value}\n case FIRST_ELLIPSIS:\n case LAST_ELLIPSIS:\n return {id: p, ...ellipsisProps.value}\n default:\n return {id: p, ...getPageButtonProps(p)}\n }\n })\n\n if (numberOfPages.value > 3) {\n if (value > numberOfPages.value - halfLimit.value - lastPage.value) {\n const idx = 2 + showFirstButton.value\n const el = els[idx]\n if (el !== undefined) {\n els[idx] = {id: el.id, ...getPageButtonProps(el.id, true)}\n }\n }\n\n if (value <= halfLimit.value + firstPage.value) {\n const idx = els.length - (3 + showLastButton.value)\n const el = els[idx]\n if (el !== undefined) {\n els[idx] = {id: el.id, ...getPageButtonProps(el.id, true)}\n }\n }\n }\n\n return els\n})\n\nconst elements = computed(() => {\n // The idea here is to create an array of all the buttons on the page control.\n // This way we can keep the invariants in one place and the template code just\n // iterates over the array.\n\n const pages = numberOfPages.value\n const {value} = computedModelValue\n const limit = limitNumber.value\n const noEllipsis = props.noEllipsis || limit <= ELLIPSIS_THRESHOLD\n\n // The first case is when all the page buttons fit on the control, this is\n // the simplest case and the only one that will create an array smaller than\n // Limit + 4 - noEndButtons * 2 (the [first, last,] prev, next buttons)\n\n if (pages < limit + firstPage.value + lastPage.value) {\n return [\n !firstPage.value && !noFirstButton.value ? FIRST_BUTTON : null,\n PREV_BUTTON,\n ...Array.from({length: pages}, (_, index) => index + 1),\n NEXT_BUTTON,\n !lastPage.value && !noLastButton.value ? LAST_BUTTON : null,\n ].filter((x) => x !== null) as number[]\n }\n\n // All the remaining cases result in an array that is exactly limit + 4 - noEndButtons * 2 in length, so create\n // the array upfront and set up the beginning and end buttons, then fill the rest for each case\n\n const buttons = Array.from({length: limit + 4 - (noFirstButton.value + noLastButton.value)})\n if (!noFirstButton.value) {\n if (!firstPage.value) {\n buttons[0] = FIRST_BUTTON\n buttons[1] = PREV_BUTTON\n } else {\n buttons[0] = PREV_BUTTON\n buttons[1] = 1\n }\n } else {\n buttons[0] = PREV_BUTTON\n }\n\n if (!noLastButton.value) {\n if (!lastPage.value) {\n buttons[buttons.length - 1] = LAST_BUTTON\n buttons[buttons.length - 2] = NEXT_BUTTON\n } else {\n buttons[buttons.length - 1] = NEXT_BUTTON\n buttons[buttons.length - 2] = pages\n }\n } else {\n buttons[buttons.length - 1] = NEXT_BUTTON\n }\n\n // The next case is where the page buttons start at the beginning, with\n // no ellipsis at the beginning, but one at the end\n\n if (value <= halfLimit.value + firstPage.value) {\n for (let index = 1; index <= limit; index++) {\n buttons[index + 1 - noFirstButton.value] = index + firstPage.value\n }\n\n if (!noEllipsis) {\n buttons[buttons.length - (2 + showLastButton.value)] = LAST_ELLIPSIS\n }\n }\n\n // And then we have the case where the page buttons go up to the end, with no\n // ellipsis at the end, but one at the beginning\n\n if (value > pages - halfLimit.value - lastPage.value) {\n const start = pages - (limit - 1) - lastPage.value\n for (let index = 0; index < limit; index++) {\n buttons[index + 2 - noFirstButton.value] = start + index\n }\n\n if (!noEllipsis) {\n buttons[1 + showFirstButton.value] = FIRST_ELLIPSIS\n }\n }\n\n // Finally we have the case where we have ellipsis at both ends\n if (!buttons[2]) {\n // Is there a more elegant way to check that we're in the final case?\n const start = value - Math.floor(limit / 2)\n for (let index = 0; index < limit; index++) {\n buttons[index + 2 - noFirstButton.value] = start + index\n }\n\n if (!noEllipsis) {\n buttons[1 + showFirstButton.value] = FIRST_ELLIPSIS\n buttons[buttons.length - (2 + showLastButton.value)] = LAST_ELLIPSIS\n }\n }\n\n //Enable sanity check for debugging purposes\n // for (let i = 0; i < buttons.length; i++) {\n // if (!buttons[i]) {\n // // eslint-disable-next-line no-console\n // console.log(\n // `Failed: button == ${i}, limit=${limit}, pages=${pages}, firstPage=${firstPage}, lastPage=${lastPage}, value=${value}`\n // )\n // }\n // }\n\n return buttons.filter((x) => x !== null) as number[]\n})\n</script>\n\n<script lang=\"ts\">\nconst DEFAULT_PER_PAGE = 20\nconst DEFAULT_TOTAL_ROWS = 0\n</script>\n"],"mappings":";;;;;;;;;;AA4kBA,IAAM,mBAA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AA"}
|
|
1
|
+
{"version":3,"file":"BPagination-D75q-ZNg.mjs","names":[],"sources":["../src/components/BPagination/BPagination.vue","../src/components/BPagination/BPagination.vue"],"sourcesContent":["<template>\n <ul\n class=\"pagination\"\n :class=\"computedWrapperClasses\"\n role=\"menubar\"\n :aria-disabled=\"props.disabled\"\n :aria-label=\"props.ariaLabel || undefined\"\n @keydown=\"handleKeyNav\"\n >\n <li\n v-for=\"(page, index) in pages\"\n :key=\"`page-${page.id}`\"\n v-bind=\"page.li\"\n ref=\"_pageElements\"\n :[dataDisplayNameCustomAttribute]=\"index\"\n >\n <span\n v-if=\"page.id === FIRST_ELLIPSIS || page.id === LAST_ELLIPSIS\"\n v-bind=\"ellipsisProps.span\"\n >\n <slot name=\"ellipsis-text\">\n {{ props.ellipsisText || '...' }}\n </slot>\n </span>\n <component\n v-bind=\"page.button\"\n :is=\"page.button.is\"\n v-else-if=\"'button' in page\"\n @click=\"page.clickHandler\"\n >\n <slot\n :name=\"page.text.name\"\n :disabled=\"page.text.disabled\"\n :page=\"page.text.page\"\n :index=\"page.text.index\"\n :active=\"page.text.active ?? false\"\n :content=\"page.text.value\"\n >\n {{ page.text.value }}\n </slot>\n </component>\n </li>\n </ul>\n</template>\n\n<script setup lang=\"ts\">\nimport {BvEvent} from '../../utils'\nimport {computed, nextTick, useTemplateRef, watch} from 'vue'\nimport {useAlignment} from '../../composables/useAlignment'\nimport {useToNumber} from '@vueuse/core'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {ClassValue} from '../../types/AnyValuedAttributes'\nimport {CODE_DOWN, CODE_LEFT, CODE_RIGHT, CODE_UP} from '../../utils/constants'\nimport {getActiveElement} from '../../utils/dom'\nimport {type BPaginationEmits, type BPaginationProps, type BPaginationSlots} from '../../types'\n\n// Threshold of limit size when we start/stop showing ellipsis\nconst ELLIPSIS_THRESHOLD = 3\n\nconst FIRST_BUTTON = -1\nconst PREV_BUTTON = -2\nconst NEXT_BUTTON = -3\nconst LAST_BUTTON = -4\nconst FIRST_ELLIPSIS = -5\nconst LAST_ELLIPSIS = -6\n\nconst dataDisplayNameCustomAttribute = 'data-display-name'\n\nconst _props = withDefaults(defineProps<Omit<BPaginationProps, 'modelValue'>>(), {\n align: 'start',\n ariaControls: undefined,\n ariaLabel: 'Pagination',\n disabled: false,\n ellipsisClass: undefined,\n ellipsisText: '\\u2026',\n firstClass: undefined,\n firstNumber: false,\n firstText: '\\u00AB',\n noEllipsis: false,\n noGotoEndButtons: false,\n labelFirstPage: 'Go to first page',\n labelLastPage: 'Go to last page',\n labelNextPage: 'Go to next page',\n labelPage: 'Go to page',\n labelPrevPage: 'Go to previous page',\n lastClass: undefined,\n lastNumber: false,\n lastText: '\\u00BB',\n limit: 5,\n nextClass: undefined,\n nextText: '\\u203A',\n pageClass: undefined,\n perPage: DEFAULT_PER_PAGE,\n pills: false,\n prevClass: undefined,\n prevText: '\\u2039',\n size: undefined,\n totalRows: DEFAULT_TOTAL_ROWS,\n})\nconst props = useDefaults(_props, 'BPagination')\nconst emit = defineEmits<BPaginationEmits>()\ndefineSlots<BPaginationSlots>()\n\nconst modelValue = defineModel<Exclude<BPaginationProps['modelValue'], undefined>>({\n default: 1,\n})\n\nconst pageElements = useTemplateRef('_pageElements')\n\nconst limitNumber = useToNumber(() => props.limit, {nanToZero: true, method: 'parseInt'})\nconst perPageNumber = useToNumber(() => props.perPage, {nanToZero: true, method: 'parseInt'})\nconst totalRowsNumber = useToNumber(() => props.totalRows, {nanToZero: true, method: 'parseInt'})\nconst modelValueNumber = useToNumber(modelValue, {nanToZero: true, method: 'parseInt'})\n\nconst perPageSanitized = computed(() => Math.max(perPageNumber.value || DEFAULT_PER_PAGE, 1))\nconst totalRowsSanitized = computed(() => Math.max(totalRowsNumber.value || DEFAULT_TOTAL_ROWS, 0))\n// Use Active to on page-item to denote active tab\nconst numberOfPages = computed(() => Math.ceil(totalRowsSanitized.value / perPageSanitized.value))\nconst computedFill = computed(() => props.align === 'fill')\n// This doesn't use the computedFill util because TS cannot infer that it would never be 'fill'\nconst justifyAlign = computed(() => (props.align === 'fill' ? 'start' : props.align))\n\nconst alignment = useAlignment(justifyAlign)\n\nconst isActivePage = (pageNumber: number) => pageNumber === computedModelValue.value\nconst getTabIndex = (num: number) => (props.disabled ? null : isActivePage(num) ? '0' : '-1')\n\nconst checkDisabled = (num: number) =>\n props.disabled ||\n isActivePage(num) ||\n computedModelValue.value < 1 ||\n // Check if the number is out of bounds\n num < 1 ||\n num > numberOfPages.value\n\nconst firstDisabled = computed(() => checkDisabled(1))\nconst prevDisabled = computed(() => checkDisabled(computedModelValue.value - 1))\nconst lastDisabled = computed(() => checkDisabled(numberOfPages.value))\nconst nextDisabled = computed(() => checkDisabled(computedModelValue.value + 1))\n\nconst getBaseButtonProps = ({\n page,\n classVal,\n disabled,\n slotName,\n textValue,\n tabIndex,\n label,\n position,\n isActive,\n hidden,\n isSmHidden,\n}: {\n page: number\n disabled: boolean\n classVal: ClassValue\n slotName: 'first-text' | 'prev-text' | 'next-text' | 'last-text' | 'page'\n textValue?: string\n tabIndex?: string\n label?: string\n position?: number\n isActive?: boolean\n hidden?: boolean\n isSmHidden?: boolean\n}) => ({\n li: {\n 'class': [\n 'page-item',\n {\n 'active': isActive,\n disabled,\n 'bv-d-sm-down-none': isSmHidden,\n 'flex-fill': computedFill.value,\n 'd-flex': computedFill.value && !disabled,\n },\n classVal,\n ],\n 'role': 'presentation',\n 'aria-hidden': hidden,\n },\n button: {\n 'is': disabled ? 'span' : 'button',\n 'class': ['page-link', 'text-center', {'flex-grow-1': !disabled && computedFill.value}],\n 'aria-label': label,\n 'aria-controls': props.ariaControls || undefined,\n 'aria-disabled': disabled ? true : undefined,\n 'aria-posinset': position,\n 'aria-setsize': position ? numberOfPages.value : undefined,\n 'role': 'menuitem',\n 'type': disabled ? undefined : 'button',\n 'tabindex': disabled ? undefined : tabIndex,\n },\n text: {\n name: slotName,\n active: isActive,\n value: textValue ?? page,\n page,\n disabled,\n index: page - 1,\n content: textValue ? undefined : String(page),\n },\n clickHandler: (e: Readonly<MouseEvent>) => pageClick(e, page),\n})\n\nconst getButtonProps = ({\n page,\n classVal,\n disabled,\n slotName,\n textValue,\n label,\n}: {\n page: number\n disabled: boolean\n classVal: ClassValue\n slotName: 'first-text' | 'prev-text' | 'next-text' | 'last-text' | 'page'\n textValue?: string\n label: string\n}) => getBaseButtonProps({page, classVal, disabled, slotName, textValue, label, tabIndex: '-1'})\n\nconst getPageButtonProps = (page: number, isSmHidden?: boolean) =>\n getBaseButtonProps({\n page,\n disabled: props.disabled,\n classVal: props.pageClass,\n slotName: 'page',\n label: props.labelPage ? `${props.labelPage} ${page}` : undefined,\n tabIndex: getTabIndex(page) ?? undefined,\n position: page,\n isActive: isActivePage(page),\n isSmHidden,\n })\n\nconst firstButtonProps = computed(() =>\n getButtonProps({\n page: 1,\n disabled: firstDisabled.value,\n classVal: props.firstClass,\n slotName: 'first-text',\n textValue: props.firstText,\n label: props.labelFirstPage,\n })\n)\nconst prevButtonProps = computed(() =>\n getButtonProps({\n page: Math.max(computedModelValue.value - 1, 1),\n disabled: prevDisabled.value,\n classVal: props.prevClass,\n slotName: 'prev-text',\n textValue: props.prevText,\n label: props.labelPrevPage,\n })\n)\nconst nextButtonProps = computed(() =>\n getButtonProps({\n page: Math.min(computedModelValue.value + 1, numberOfPages.value),\n disabled: nextDisabled.value,\n classVal: props.nextClass,\n slotName: 'next-text',\n textValue: props.nextText,\n label: props.labelNextPage,\n })\n)\nconst lastButtonProps = computed(() =>\n getButtonProps({\n page: numberOfPages.value,\n disabled: lastDisabled.value,\n classVal: props.lastClass,\n slotName: 'last-text',\n textValue: props.lastText,\n label: props.labelLastPage,\n })\n)\n\nconst ellipsisProps = computed(() => ({\n li: {\n class: [\n 'page-item',\n 'disabled',\n 'text-center',\n 'bv-d-sm-down-none',\n computedFill.value ? 'flex-fill' : '',\n props.ellipsisClass,\n ],\n role: 'separator',\n },\n span: {\n class: ['page-link'],\n },\n}))\n\nconst computedWrapperClasses = computed(() => [\n alignment.value,\n {\n [`pagination-${props.size}`]: props.size !== undefined,\n 'b-pagination-pills': props.pills,\n },\n])\n\nconst pagination = computed(() => ({\n pageSize: perPageSanitized.value,\n totalRows: totalRowsNumber.value,\n numberOfPages: numberOfPages.value,\n}))\n\nconst pageClick = (event: Readonly<MouseEvent>, pageNumber: number) => {\n if (pageNumber === computedModelValue.value) return\n const clickEvent = new BvEvent('page-click', {\n cancelable: true,\n target: event.target,\n })\n emit('page-click', clickEvent, pageNumber)\n\n if (clickEvent.defaultPrevented) return\n\n modelValue.value = pageNumber\n\n nextTick(() => {\n if (pageNumber === 1) {\n focusFirst()\n } else if (pageNumber === pagination.value.numberOfPages) {\n focusLast()\n }\n })\n // nextTick(() => {\n // if (isVisible(target) && un_element.contains(target)) {\n // attemptFocus(target)\n //} else {\n //this.focusCurrent()\n //}\n // })\n}\n\nconst isDisabled = (el: HTMLButtonElement) => {\n const isElement = el && el.nodeType === Node.ELEMENT_NODE\n const hasAttr = isElement ? el.hasAttribute('disabled') : null\n const hasClass = isElement && el.classList ? el.classList.contains('disabled') : false\n\n return !isElement || el.disabled || hasAttr || hasClass\n}\n\nconst getButtons = (): HTMLButtonElement[] =>\n [...(pageElements.value ?? [])]\n .sort(\n (a, b) =>\n Number.parseInt(a.getAttribute(dataDisplayNameCustomAttribute) || '0') -\n Number.parseInt(b.getAttribute(dataDisplayNameCustomAttribute) || '0')\n )\n .map((page) => page.children[0])\n .filter((el) => {\n if (el?.getAttribute('display') === 'none' || el?.tagName.toUpperCase() !== 'BUTTON') {\n return false\n }\n\n const bcr = el?.getBoundingClientRect()\n\n return !!(bcr && bcr.height > 0 && bcr.width > 0)\n })\n .map((el) => el as HTMLButtonElement)\n\nconst focusFirst = () => {\n nextTick(() => {\n const btn = getButtons().find((el) => !isDisabled(el))\n btn?.focus()\n })\n}\n\nconst focusPrev = () => {\n nextTick(() => {\n const buttons = getButtons()\n const index = buttons.indexOf(getActiveElement() as HTMLButtonElement)\n\n const button = buttons[index - 1]\n if (index > 0 && button !== undefined && !isDisabled(button)) {\n buttons[index - 1]?.focus()\n }\n })\n}\n\nconst focusLast = () => {\n nextTick(() => {\n const btn = getButtons()\n .reverse()\n .find((el) => !isDisabled(el))\n btn?.focus()\n })\n}\n\nconst focusNext = () => {\n nextTick(() => {\n const buttons = getButtons()\n const index = buttons.indexOf(getActiveElement() as HTMLButtonElement)\n const button = buttons[index + 1]\n if (index < buttons.length - 1 && button !== undefined && !isDisabled(button)) {\n buttons[index + 1]?.focus()\n }\n })\n}\n\nconst handleKeyNav = (event: KeyboardEvent) => {\n const {code, shiftKey} = event\n if (code === CODE_LEFT || code === CODE_UP) {\n event.preventDefault()\n if (shiftKey) {\n focusFirst()\n } else {\n focusPrev()\n }\n } else if (code === CODE_RIGHT || code === CODE_DOWN) {\n event.preventDefault()\n if (shiftKey) {\n focusLast()\n } else {\n focusNext()\n }\n }\n}\n\nconst computedModelValue = computed(() => {\n const page = modelValueNumber.value || 1\n return page > numberOfPages.value ? numberOfPages.value : page < 1 ? 1 : page\n})\n\nwatch(pagination, (oldValue, newValue) => {\n if (newValue.pageSize !== oldValue.pageSize && newValue.totalRows === oldValue.totalRows) {\n // If the page size changes, reset to page 1\n modelValue.value = 1\n }\n})\n\nconst noFirstButton = computed(() => (props.noGotoEndButtons && !props.firstNumber ? 1 : 0))\nconst noLastButton = computed(() => (props.noGotoEndButtons && !props.lastNumber ? 1 : 0))\nconst showFirstButton = computed(() => (noFirstButton.value ? 0 : 1))\nconst showLastButton = computed(() => (noLastButton.value ? 0 : 1))\nconst firstPage = computed(() => (props.firstNumber ? 1 : 0))\nconst lastPage = computed(() => (props.lastNumber ? 1 : 0))\nconst halfLimit = computed(() => Math.floor(limitNumber.value / 2))\n\nconst pages = computed(() => {\n const {value} = computedModelValue\n\n const els = elements.value.map((p) => {\n switch (p) {\n case FIRST_BUTTON:\n return {id: p, ...firstButtonProps.value}\n case PREV_BUTTON:\n return {id: p, ...prevButtonProps.value}\n case NEXT_BUTTON:\n return {id: p, ...nextButtonProps.value}\n case LAST_BUTTON:\n return {id: p, ...lastButtonProps.value}\n case FIRST_ELLIPSIS:\n case LAST_ELLIPSIS:\n return {id: p, ...ellipsisProps.value}\n default:\n return {id: p, ...getPageButtonProps(p)}\n }\n })\n\n if (numberOfPages.value > 3) {\n if (value > numberOfPages.value - halfLimit.value - lastPage.value) {\n const idx = 2 + showFirstButton.value\n const el = els[idx]\n if (el !== undefined) {\n els[idx] = {id: el.id, ...getPageButtonProps(el.id, true)}\n }\n }\n\n if (value <= halfLimit.value + firstPage.value) {\n const idx = els.length - (3 + showLastButton.value)\n const el = els[idx]\n if (el !== undefined) {\n els[idx] = {id: el.id, ...getPageButtonProps(el.id, true)}\n }\n }\n }\n\n return els\n})\n\nconst elements = computed(() => {\n // The idea here is to create an array of all the buttons on the page control.\n // This way we can keep the invariants in one place and the template code just\n // iterates over the array.\n\n const pages = numberOfPages.value\n const {value} = computedModelValue\n const limit = limitNumber.value\n const noEllipsis = props.noEllipsis || limit <= ELLIPSIS_THRESHOLD\n\n // The first case is when all the page buttons fit on the control, this is\n // the simplest case and the only one that will create an array smaller than\n // Limit + 4 - noEndButtons * 2 (the [first, last,] prev, next buttons)\n\n if (pages < limit + firstPage.value + lastPage.value) {\n return [\n !firstPage.value && !noFirstButton.value ? FIRST_BUTTON : null,\n PREV_BUTTON,\n ...Array.from({length: pages}, (_, index) => index + 1),\n NEXT_BUTTON,\n !lastPage.value && !noLastButton.value ? LAST_BUTTON : null,\n ].filter((x) => x !== null) as number[]\n }\n\n // All the remaining cases result in an array that is exactly limit + 4 - noEndButtons * 2 in length, so create\n // the array upfront and set up the beginning and end buttons, then fill the rest for each case\n\n const buttons = Array.from({length: limit + 4 - (noFirstButton.value + noLastButton.value)})\n if (!noFirstButton.value) {\n if (!firstPage.value) {\n buttons[0] = FIRST_BUTTON\n buttons[1] = PREV_BUTTON\n } else {\n buttons[0] = PREV_BUTTON\n buttons[1] = 1\n }\n } else {\n buttons[0] = PREV_BUTTON\n }\n\n if (!noLastButton.value) {\n if (!lastPage.value) {\n buttons[buttons.length - 1] = LAST_BUTTON\n buttons[buttons.length - 2] = NEXT_BUTTON\n } else {\n buttons[buttons.length - 1] = NEXT_BUTTON\n buttons[buttons.length - 2] = pages\n }\n } else {\n buttons[buttons.length - 1] = NEXT_BUTTON\n }\n\n // The next case is where the page buttons start at the beginning, with\n // no ellipsis at the beginning, but one at the end\n\n if (value <= halfLimit.value + firstPage.value) {\n for (let index = 1; index <= limit; index++) {\n buttons[index + 1 - noFirstButton.value] = index + firstPage.value\n }\n\n if (!noEllipsis) {\n buttons[buttons.length - (2 + showLastButton.value)] = LAST_ELLIPSIS\n }\n }\n\n // And then we have the case where the page buttons go up to the end, with no\n // ellipsis at the end, but one at the beginning\n\n if (value > pages - halfLimit.value - lastPage.value) {\n const start = pages - (limit - 1) - lastPage.value\n for (let index = 0; index < limit; index++) {\n buttons[index + 2 - noFirstButton.value] = start + index\n }\n\n if (!noEllipsis) {\n buttons[1 + showFirstButton.value] = FIRST_ELLIPSIS\n }\n }\n\n // Finally we have the case where we have ellipsis at both ends\n if (!buttons[2]) {\n // Is there a more elegant way to check that we're in the final case?\n const start = value - Math.floor(limit / 2)\n for (let index = 0; index < limit; index++) {\n buttons[index + 2 - noFirstButton.value] = start + index\n }\n\n if (!noEllipsis) {\n buttons[1 + showFirstButton.value] = FIRST_ELLIPSIS\n buttons[buttons.length - (2 + showLastButton.value)] = LAST_ELLIPSIS\n }\n }\n\n //Enable sanity check for debugging purposes\n // for (let i = 0; i < buttons.length; i++) {\n // if (!buttons[i]) {\n // // eslint-disable-next-line no-console\n // console.log(\n // `Failed: button == ${i}, limit=${limit}, pages=${pages}, firstPage=${firstPage}, lastPage=${lastPage}, value=${value}`\n // )\n // }\n // }\n\n return buttons.filter((x) => x !== null) as number[]\n})\n</script>\n\n<script lang=\"ts\">\nconst DEFAULT_PER_PAGE = 20\nconst DEFAULT_TOTAL_ROWS = 0\n</script>\n","<template>\n <ul\n class=\"pagination\"\n :class=\"computedWrapperClasses\"\n role=\"menubar\"\n :aria-disabled=\"props.disabled\"\n :aria-label=\"props.ariaLabel || undefined\"\n @keydown=\"handleKeyNav\"\n >\n <li\n v-for=\"(page, index) in pages\"\n :key=\"`page-${page.id}`\"\n v-bind=\"page.li\"\n ref=\"_pageElements\"\n :[dataDisplayNameCustomAttribute]=\"index\"\n >\n <span\n v-if=\"page.id === FIRST_ELLIPSIS || page.id === LAST_ELLIPSIS\"\n v-bind=\"ellipsisProps.span\"\n >\n <slot name=\"ellipsis-text\">\n {{ props.ellipsisText || '...' }}\n </slot>\n </span>\n <component\n v-bind=\"page.button\"\n :is=\"page.button.is\"\n v-else-if=\"'button' in page\"\n @click=\"page.clickHandler\"\n >\n <slot\n :name=\"page.text.name\"\n :disabled=\"page.text.disabled\"\n :page=\"page.text.page\"\n :index=\"page.text.index\"\n :active=\"page.text.active ?? false\"\n :content=\"page.text.value\"\n >\n {{ page.text.value }}\n </slot>\n </component>\n </li>\n </ul>\n</template>\n\n<script setup lang=\"ts\">\nimport {BvEvent} from '../../utils'\nimport {computed, nextTick, useTemplateRef, watch} from 'vue'\nimport {useAlignment} from '../../composables/useAlignment'\nimport {useToNumber} from '@vueuse/core'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {ClassValue} from '../../types/AnyValuedAttributes'\nimport {CODE_DOWN, CODE_LEFT, CODE_RIGHT, CODE_UP} from '../../utils/constants'\nimport {getActiveElement} from '../../utils/dom'\nimport {type BPaginationEmits, type BPaginationProps, type BPaginationSlots} from '../../types'\n\n// Threshold of limit size when we start/stop showing ellipsis\nconst ELLIPSIS_THRESHOLD = 3\n\nconst FIRST_BUTTON = -1\nconst PREV_BUTTON = -2\nconst NEXT_BUTTON = -3\nconst LAST_BUTTON = -4\nconst FIRST_ELLIPSIS = -5\nconst LAST_ELLIPSIS = -6\n\nconst dataDisplayNameCustomAttribute = 'data-display-name'\n\nconst _props = withDefaults(defineProps<Omit<BPaginationProps, 'modelValue'>>(), {\n align: 'start',\n ariaControls: undefined,\n ariaLabel: 'Pagination',\n disabled: false,\n ellipsisClass: undefined,\n ellipsisText: '\\u2026',\n firstClass: undefined,\n firstNumber: false,\n firstText: '\\u00AB',\n noEllipsis: false,\n noGotoEndButtons: false,\n labelFirstPage: 'Go to first page',\n labelLastPage: 'Go to last page',\n labelNextPage: 'Go to next page',\n labelPage: 'Go to page',\n labelPrevPage: 'Go to previous page',\n lastClass: undefined,\n lastNumber: false,\n lastText: '\\u00BB',\n limit: 5,\n nextClass: undefined,\n nextText: '\\u203A',\n pageClass: undefined,\n perPage: DEFAULT_PER_PAGE,\n pills: false,\n prevClass: undefined,\n prevText: '\\u2039',\n size: undefined,\n totalRows: DEFAULT_TOTAL_ROWS,\n})\nconst props = useDefaults(_props, 'BPagination')\nconst emit = defineEmits<BPaginationEmits>()\ndefineSlots<BPaginationSlots>()\n\nconst modelValue = defineModel<Exclude<BPaginationProps['modelValue'], undefined>>({\n default: 1,\n})\n\nconst pageElements = useTemplateRef('_pageElements')\n\nconst limitNumber = useToNumber(() => props.limit, {nanToZero: true, method: 'parseInt'})\nconst perPageNumber = useToNumber(() => props.perPage, {nanToZero: true, method: 'parseInt'})\nconst totalRowsNumber = useToNumber(() => props.totalRows, {nanToZero: true, method: 'parseInt'})\nconst modelValueNumber = useToNumber(modelValue, {nanToZero: true, method: 'parseInt'})\n\nconst perPageSanitized = computed(() => Math.max(perPageNumber.value || DEFAULT_PER_PAGE, 1))\nconst totalRowsSanitized = computed(() => Math.max(totalRowsNumber.value || DEFAULT_TOTAL_ROWS, 0))\n// Use Active to on page-item to denote active tab\nconst numberOfPages = computed(() => Math.ceil(totalRowsSanitized.value / perPageSanitized.value))\nconst computedFill = computed(() => props.align === 'fill')\n// This doesn't use the computedFill util because TS cannot infer that it would never be 'fill'\nconst justifyAlign = computed(() => (props.align === 'fill' ? 'start' : props.align))\n\nconst alignment = useAlignment(justifyAlign)\n\nconst isActivePage = (pageNumber: number) => pageNumber === computedModelValue.value\nconst getTabIndex = (num: number) => (props.disabled ? null : isActivePage(num) ? '0' : '-1')\n\nconst checkDisabled = (num: number) =>\n props.disabled ||\n isActivePage(num) ||\n computedModelValue.value < 1 ||\n // Check if the number is out of bounds\n num < 1 ||\n num > numberOfPages.value\n\nconst firstDisabled = computed(() => checkDisabled(1))\nconst prevDisabled = computed(() => checkDisabled(computedModelValue.value - 1))\nconst lastDisabled = computed(() => checkDisabled(numberOfPages.value))\nconst nextDisabled = computed(() => checkDisabled(computedModelValue.value + 1))\n\nconst getBaseButtonProps = ({\n page,\n classVal,\n disabled,\n slotName,\n textValue,\n tabIndex,\n label,\n position,\n isActive,\n hidden,\n isSmHidden,\n}: {\n page: number\n disabled: boolean\n classVal: ClassValue\n slotName: 'first-text' | 'prev-text' | 'next-text' | 'last-text' | 'page'\n textValue?: string\n tabIndex?: string\n label?: string\n position?: number\n isActive?: boolean\n hidden?: boolean\n isSmHidden?: boolean\n}) => ({\n li: {\n 'class': [\n 'page-item',\n {\n 'active': isActive,\n disabled,\n 'bv-d-sm-down-none': isSmHidden,\n 'flex-fill': computedFill.value,\n 'd-flex': computedFill.value && !disabled,\n },\n classVal,\n ],\n 'role': 'presentation',\n 'aria-hidden': hidden,\n },\n button: {\n 'is': disabled ? 'span' : 'button',\n 'class': ['page-link', 'text-center', {'flex-grow-1': !disabled && computedFill.value}],\n 'aria-label': label,\n 'aria-controls': props.ariaControls || undefined,\n 'aria-disabled': disabled ? true : undefined,\n 'aria-posinset': position,\n 'aria-setsize': position ? numberOfPages.value : undefined,\n 'role': 'menuitem',\n 'type': disabled ? undefined : 'button',\n 'tabindex': disabled ? undefined : tabIndex,\n },\n text: {\n name: slotName,\n active: isActive,\n value: textValue ?? page,\n page,\n disabled,\n index: page - 1,\n content: textValue ? undefined : String(page),\n },\n clickHandler: (e: Readonly<MouseEvent>) => pageClick(e, page),\n})\n\nconst getButtonProps = ({\n page,\n classVal,\n disabled,\n slotName,\n textValue,\n label,\n}: {\n page: number\n disabled: boolean\n classVal: ClassValue\n slotName: 'first-text' | 'prev-text' | 'next-text' | 'last-text' | 'page'\n textValue?: string\n label: string\n}) => getBaseButtonProps({page, classVal, disabled, slotName, textValue, label, tabIndex: '-1'})\n\nconst getPageButtonProps = (page: number, isSmHidden?: boolean) =>\n getBaseButtonProps({\n page,\n disabled: props.disabled,\n classVal: props.pageClass,\n slotName: 'page',\n label: props.labelPage ? `${props.labelPage} ${page}` : undefined,\n tabIndex: getTabIndex(page) ?? undefined,\n position: page,\n isActive: isActivePage(page),\n isSmHidden,\n })\n\nconst firstButtonProps = computed(() =>\n getButtonProps({\n page: 1,\n disabled: firstDisabled.value,\n classVal: props.firstClass,\n slotName: 'first-text',\n textValue: props.firstText,\n label: props.labelFirstPage,\n })\n)\nconst prevButtonProps = computed(() =>\n getButtonProps({\n page: Math.max(computedModelValue.value - 1, 1),\n disabled: prevDisabled.value,\n classVal: props.prevClass,\n slotName: 'prev-text',\n textValue: props.prevText,\n label: props.labelPrevPage,\n })\n)\nconst nextButtonProps = computed(() =>\n getButtonProps({\n page: Math.min(computedModelValue.value + 1, numberOfPages.value),\n disabled: nextDisabled.value,\n classVal: props.nextClass,\n slotName: 'next-text',\n textValue: props.nextText,\n label: props.labelNextPage,\n })\n)\nconst lastButtonProps = computed(() =>\n getButtonProps({\n page: numberOfPages.value,\n disabled: lastDisabled.value,\n classVal: props.lastClass,\n slotName: 'last-text',\n textValue: props.lastText,\n label: props.labelLastPage,\n })\n)\n\nconst ellipsisProps = computed(() => ({\n li: {\n class: [\n 'page-item',\n 'disabled',\n 'text-center',\n 'bv-d-sm-down-none',\n computedFill.value ? 'flex-fill' : '',\n props.ellipsisClass,\n ],\n role: 'separator',\n },\n span: {\n class: ['page-link'],\n },\n}))\n\nconst computedWrapperClasses = computed(() => [\n alignment.value,\n {\n [`pagination-${props.size}`]: props.size !== undefined,\n 'b-pagination-pills': props.pills,\n },\n])\n\nconst pagination = computed(() => ({\n pageSize: perPageSanitized.value,\n totalRows: totalRowsNumber.value,\n numberOfPages: numberOfPages.value,\n}))\n\nconst pageClick = (event: Readonly<MouseEvent>, pageNumber: number) => {\n if (pageNumber === computedModelValue.value) return\n const clickEvent = new BvEvent('page-click', {\n cancelable: true,\n target: event.target,\n })\n emit('page-click', clickEvent, pageNumber)\n\n if (clickEvent.defaultPrevented) return\n\n modelValue.value = pageNumber\n\n nextTick(() => {\n if (pageNumber === 1) {\n focusFirst()\n } else if (pageNumber === pagination.value.numberOfPages) {\n focusLast()\n }\n })\n // nextTick(() => {\n // if (isVisible(target) && un_element.contains(target)) {\n // attemptFocus(target)\n //} else {\n //this.focusCurrent()\n //}\n // })\n}\n\nconst isDisabled = (el: HTMLButtonElement) => {\n const isElement = el && el.nodeType === Node.ELEMENT_NODE\n const hasAttr = isElement ? el.hasAttribute('disabled') : null\n const hasClass = isElement && el.classList ? el.classList.contains('disabled') : false\n\n return !isElement || el.disabled || hasAttr || hasClass\n}\n\nconst getButtons = (): HTMLButtonElement[] =>\n [...(pageElements.value ?? [])]\n .sort(\n (a, b) =>\n Number.parseInt(a.getAttribute(dataDisplayNameCustomAttribute) || '0') -\n Number.parseInt(b.getAttribute(dataDisplayNameCustomAttribute) || '0')\n )\n .map((page) => page.children[0])\n .filter((el) => {\n if (el?.getAttribute('display') === 'none' || el?.tagName.toUpperCase() !== 'BUTTON') {\n return false\n }\n\n const bcr = el?.getBoundingClientRect()\n\n return !!(bcr && bcr.height > 0 && bcr.width > 0)\n })\n .map((el) => el as HTMLButtonElement)\n\nconst focusFirst = () => {\n nextTick(() => {\n const btn = getButtons().find((el) => !isDisabled(el))\n btn?.focus()\n })\n}\n\nconst focusPrev = () => {\n nextTick(() => {\n const buttons = getButtons()\n const index = buttons.indexOf(getActiveElement() as HTMLButtonElement)\n\n const button = buttons[index - 1]\n if (index > 0 && button !== undefined && !isDisabled(button)) {\n buttons[index - 1]?.focus()\n }\n })\n}\n\nconst focusLast = () => {\n nextTick(() => {\n const btn = getButtons()\n .reverse()\n .find((el) => !isDisabled(el))\n btn?.focus()\n })\n}\n\nconst focusNext = () => {\n nextTick(() => {\n const buttons = getButtons()\n const index = buttons.indexOf(getActiveElement() as HTMLButtonElement)\n const button = buttons[index + 1]\n if (index < buttons.length - 1 && button !== undefined && !isDisabled(button)) {\n buttons[index + 1]?.focus()\n }\n })\n}\n\nconst handleKeyNav = (event: KeyboardEvent) => {\n const {code, shiftKey} = event\n if (code === CODE_LEFT || code === CODE_UP) {\n event.preventDefault()\n if (shiftKey) {\n focusFirst()\n } else {\n focusPrev()\n }\n } else if (code === CODE_RIGHT || code === CODE_DOWN) {\n event.preventDefault()\n if (shiftKey) {\n focusLast()\n } else {\n focusNext()\n }\n }\n}\n\nconst computedModelValue = computed(() => {\n const page = modelValueNumber.value || 1\n return page > numberOfPages.value ? numberOfPages.value : page < 1 ? 1 : page\n})\n\nwatch(pagination, (oldValue, newValue) => {\n if (newValue.pageSize !== oldValue.pageSize && newValue.totalRows === oldValue.totalRows) {\n // If the page size changes, reset to page 1\n modelValue.value = 1\n }\n})\n\nconst noFirstButton = computed(() => (props.noGotoEndButtons && !props.firstNumber ? 1 : 0))\nconst noLastButton = computed(() => (props.noGotoEndButtons && !props.lastNumber ? 1 : 0))\nconst showFirstButton = computed(() => (noFirstButton.value ? 0 : 1))\nconst showLastButton = computed(() => (noLastButton.value ? 0 : 1))\nconst firstPage = computed(() => (props.firstNumber ? 1 : 0))\nconst lastPage = computed(() => (props.lastNumber ? 1 : 0))\nconst halfLimit = computed(() => Math.floor(limitNumber.value / 2))\n\nconst pages = computed(() => {\n const {value} = computedModelValue\n\n const els = elements.value.map((p) => {\n switch (p) {\n case FIRST_BUTTON:\n return {id: p, ...firstButtonProps.value}\n case PREV_BUTTON:\n return {id: p, ...prevButtonProps.value}\n case NEXT_BUTTON:\n return {id: p, ...nextButtonProps.value}\n case LAST_BUTTON:\n return {id: p, ...lastButtonProps.value}\n case FIRST_ELLIPSIS:\n case LAST_ELLIPSIS:\n return {id: p, ...ellipsisProps.value}\n default:\n return {id: p, ...getPageButtonProps(p)}\n }\n })\n\n if (numberOfPages.value > 3) {\n if (value > numberOfPages.value - halfLimit.value - lastPage.value) {\n const idx = 2 + showFirstButton.value\n const el = els[idx]\n if (el !== undefined) {\n els[idx] = {id: el.id, ...getPageButtonProps(el.id, true)}\n }\n }\n\n if (value <= halfLimit.value + firstPage.value) {\n const idx = els.length - (3 + showLastButton.value)\n const el = els[idx]\n if (el !== undefined) {\n els[idx] = {id: el.id, ...getPageButtonProps(el.id, true)}\n }\n }\n }\n\n return els\n})\n\nconst elements = computed(() => {\n // The idea here is to create an array of all the buttons on the page control.\n // This way we can keep the invariants in one place and the template code just\n // iterates over the array.\n\n const pages = numberOfPages.value\n const {value} = computedModelValue\n const limit = limitNumber.value\n const noEllipsis = props.noEllipsis || limit <= ELLIPSIS_THRESHOLD\n\n // The first case is when all the page buttons fit on the control, this is\n // the simplest case and the only one that will create an array smaller than\n // Limit + 4 - noEndButtons * 2 (the [first, last,] prev, next buttons)\n\n if (pages < limit + firstPage.value + lastPage.value) {\n return [\n !firstPage.value && !noFirstButton.value ? FIRST_BUTTON : null,\n PREV_BUTTON,\n ...Array.from({length: pages}, (_, index) => index + 1),\n NEXT_BUTTON,\n !lastPage.value && !noLastButton.value ? LAST_BUTTON : null,\n ].filter((x) => x !== null) as number[]\n }\n\n // All the remaining cases result in an array that is exactly limit + 4 - noEndButtons * 2 in length, so create\n // the array upfront and set up the beginning and end buttons, then fill the rest for each case\n\n const buttons = Array.from({length: limit + 4 - (noFirstButton.value + noLastButton.value)})\n if (!noFirstButton.value) {\n if (!firstPage.value) {\n buttons[0] = FIRST_BUTTON\n buttons[1] = PREV_BUTTON\n } else {\n buttons[0] = PREV_BUTTON\n buttons[1] = 1\n }\n } else {\n buttons[0] = PREV_BUTTON\n }\n\n if (!noLastButton.value) {\n if (!lastPage.value) {\n buttons[buttons.length - 1] = LAST_BUTTON\n buttons[buttons.length - 2] = NEXT_BUTTON\n } else {\n buttons[buttons.length - 1] = NEXT_BUTTON\n buttons[buttons.length - 2] = pages\n }\n } else {\n buttons[buttons.length - 1] = NEXT_BUTTON\n }\n\n // The next case is where the page buttons start at the beginning, with\n // no ellipsis at the beginning, but one at the end\n\n if (value <= halfLimit.value + firstPage.value) {\n for (let index = 1; index <= limit; index++) {\n buttons[index + 1 - noFirstButton.value] = index + firstPage.value\n }\n\n if (!noEllipsis) {\n buttons[buttons.length - (2 + showLastButton.value)] = LAST_ELLIPSIS\n }\n }\n\n // And then we have the case where the page buttons go up to the end, with no\n // ellipsis at the end, but one at the beginning\n\n if (value > pages - halfLimit.value - lastPage.value) {\n const start = pages - (limit - 1) - lastPage.value\n for (let index = 0; index < limit; index++) {\n buttons[index + 2 - noFirstButton.value] = start + index\n }\n\n if (!noEllipsis) {\n buttons[1 + showFirstButton.value] = FIRST_ELLIPSIS\n }\n }\n\n // Finally we have the case where we have ellipsis at both ends\n if (!buttons[2]) {\n // Is there a more elegant way to check that we're in the final case?\n const start = value - Math.floor(limit / 2)\n for (let index = 0; index < limit; index++) {\n buttons[index + 2 - noFirstButton.value] = start + index\n }\n\n if (!noEllipsis) {\n buttons[1 + showFirstButton.value] = FIRST_ELLIPSIS\n buttons[buttons.length - (2 + showLastButton.value)] = LAST_ELLIPSIS\n }\n }\n\n //Enable sanity check for debugging purposes\n // for (let i = 0; i < buttons.length; i++) {\n // if (!buttons[i]) {\n // // eslint-disable-next-line no-console\n // console.log(\n // `Failed: button == ${i}, limit=${limit}, pages=${pages}, firstPage=${firstPage}, lastPage=${lastPage}, value=${value}`\n // )\n // }\n // }\n\n return buttons.filter((x) => x !== null) as number[]\n})\n</script>\n\n<script lang=\"ts\">\nconst DEFAULT_PER_PAGE = 20\nconst DEFAULT_TOTAL_ROWS = 0\n</script>\n"],"mappings":";;;;;;;;;;AA4kBA,IAAM,mBAAmB;AACzB,IAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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2
|
const require_dist = require("./dist-DiXKLh_W.js");
|
|
3
3
|
const require_dom = require("./dom-Bs6DzM72.js");
|
|
4
|
-
const require_useDefaults = require("./useDefaults-
|
|
4
|
+
const require_useDefaults = require("./useDefaults-C0CYry78.js");
|
|
5
5
|
const require_classes = require("./classes-D5wrmmVs.js");
|
|
6
6
|
require("./constants-BLIvvaat.js");
|
|
7
7
|
const require_useAlignment = require("./useAlignment-oKolnDpb.js");
|
|
@@ -443,4 +443,4 @@ Object.defineProperty(exports, "BPagination_default", {
|
|
|
443
443
|
}
|
|
444
444
|
});
|
|
445
445
|
|
|
446
|
-
//# sourceMappingURL=BPagination-
|
|
446
|
+
//# sourceMappingURL=BPagination-fbjFAtxu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BPagination-D6W1LdgK.js","names":[],"sources":["../src/components/BPagination/BPagination.vue","../src/components/BPagination/BPagination.vue"],"sourcesContent":["<template>\n <ul\n class=\"pagination\"\n :class=\"computedWrapperClasses\"\n role=\"menubar\"\n :aria-disabled=\"props.disabled\"\n :aria-label=\"props.ariaLabel || undefined\"\n @keydown=\"handleKeyNav\"\n >\n <li\n v-for=\"(page, index) in pages\"\n :key=\"`page-${page.id}`\"\n v-bind=\"page.li\"\n ref=\"_pageElements\"\n :[dataDisplayNameCustomAttribute]=\"index\"\n >\n <span\n v-if=\"page.id === FIRST_ELLIPSIS || page.id === LAST_ELLIPSIS\"\n v-bind=\"ellipsisProps.span\"\n >\n <slot name=\"ellipsis-text\">\n {{ props.ellipsisText || '...' }}\n </slot>\n </span>\n <component\n v-bind=\"page.button\"\n :is=\"page.button.is\"\n v-else-if=\"'button' in page\"\n @click=\"page.clickHandler\"\n >\n <slot\n :name=\"page.text.name\"\n :disabled=\"page.text.disabled\"\n :page=\"page.text.page\"\n :index=\"page.text.index\"\n :active=\"page.text.active ?? false\"\n :content=\"page.text.value\"\n >\n {{ page.text.value }}\n </slot>\n </component>\n </li>\n </ul>\n</template>\n\n<script setup lang=\"ts\">\nimport {BvEvent} from '../../utils'\nimport {computed, nextTick, useTemplateRef, watch} from 'vue'\nimport {useAlignment} from '../../composables/useAlignment'\nimport {useToNumber} from '@vueuse/core'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {ClassValue} from '../../types/AnyValuedAttributes'\nimport {CODE_DOWN, CODE_LEFT, CODE_RIGHT, CODE_UP} from '../../utils/constants'\nimport {getActiveElement} from '../../utils/dom'\nimport {type BPaginationEmits, type BPaginationProps, type BPaginationSlots} from '../../types'\n\n// Threshold of limit size when we start/stop showing ellipsis\nconst ELLIPSIS_THRESHOLD = 3\n\nconst FIRST_BUTTON = -1\nconst PREV_BUTTON = -2\nconst NEXT_BUTTON = -3\nconst LAST_BUTTON = -4\nconst FIRST_ELLIPSIS = -5\nconst LAST_ELLIPSIS = -6\n\nconst dataDisplayNameCustomAttribute = 'data-display-name'\n\nconst _props = withDefaults(defineProps<Omit<BPaginationProps, 'modelValue'>>(), {\n align: 'start',\n ariaControls: undefined,\n ariaLabel: 'Pagination',\n disabled: false,\n ellipsisClass: undefined,\n ellipsisText: '\\u2026',\n firstClass: undefined,\n firstNumber: false,\n firstText: '\\u00AB',\n noEllipsis: false,\n noGotoEndButtons: false,\n labelFirstPage: 'Go to first page',\n labelLastPage: 'Go to last page',\n labelNextPage: 'Go to next page',\n labelPage: 'Go to page',\n labelPrevPage: 'Go to previous page',\n lastClass: undefined,\n lastNumber: false,\n lastText: '\\u00BB',\n limit: 5,\n nextClass: undefined,\n nextText: '\\u203A',\n pageClass: undefined,\n perPage: DEFAULT_PER_PAGE,\n pills: false,\n prevClass: undefined,\n prevText: '\\u2039',\n size: undefined,\n totalRows: DEFAULT_TOTAL_ROWS,\n})\nconst props = useDefaults(_props, 'BPagination')\nconst emit = defineEmits<BPaginationEmits>()\ndefineSlots<BPaginationSlots>()\n\nconst modelValue = defineModel<Exclude<BPaginationProps['modelValue'], undefined>>({\n default: 1,\n})\n\nconst pageElements = useTemplateRef('_pageElements')\n\nconst limitNumber = useToNumber(() => props.limit, {nanToZero: true, method: 'parseInt'})\nconst perPageNumber = useToNumber(() => props.perPage, {nanToZero: true, method: 'parseInt'})\nconst totalRowsNumber = useToNumber(() => props.totalRows, {nanToZero: true, method: 'parseInt'})\nconst modelValueNumber = useToNumber(modelValue, {nanToZero: true, method: 'parseInt'})\n\nconst perPageSanitized = computed(() => Math.max(perPageNumber.value || DEFAULT_PER_PAGE, 1))\nconst totalRowsSanitized = computed(() => Math.max(totalRowsNumber.value || DEFAULT_TOTAL_ROWS, 0))\n// Use Active to on page-item to denote active tab\nconst numberOfPages = computed(() => Math.ceil(totalRowsSanitized.value / perPageSanitized.value))\nconst computedFill = computed(() => props.align === 'fill')\n// This doesn't use the computedFill util because TS cannot infer that it would never be 'fill'\nconst justifyAlign = computed(() => (props.align === 'fill' ? 'start' : props.align))\n\nconst alignment = useAlignment(justifyAlign)\n\nconst isActivePage = (pageNumber: number) => pageNumber === computedModelValue.value\nconst getTabIndex = (num: number) => (props.disabled ? null : isActivePage(num) ? '0' : '-1')\n\nconst checkDisabled = (num: number) =>\n props.disabled ||\n isActivePage(num) ||\n computedModelValue.value < 1 ||\n // Check if the number is out of bounds\n num < 1 ||\n num > numberOfPages.value\n\nconst firstDisabled = computed(() => checkDisabled(1))\nconst prevDisabled = computed(() => checkDisabled(computedModelValue.value - 1))\nconst lastDisabled = computed(() => checkDisabled(numberOfPages.value))\nconst nextDisabled = computed(() => checkDisabled(computedModelValue.value + 1))\n\nconst getBaseButtonProps = ({\n page,\n classVal,\n disabled,\n slotName,\n textValue,\n tabIndex,\n label,\n position,\n isActive,\n hidden,\n isSmHidden,\n}: {\n page: number\n disabled: boolean\n classVal: ClassValue\n slotName: 'first-text' | 'prev-text' | 'next-text' | 'last-text' | 'page'\n textValue?: string\n tabIndex?: string\n label?: string\n position?: number\n isActive?: boolean\n hidden?: boolean\n isSmHidden?: boolean\n}) => ({\n li: {\n 'class': [\n 'page-item',\n {\n 'active': isActive,\n disabled,\n 'bv-d-sm-down-none': isSmHidden,\n 'flex-fill': computedFill.value,\n 'd-flex': computedFill.value && !disabled,\n },\n classVal,\n ],\n 'role': 'presentation',\n 'aria-hidden': hidden,\n },\n button: {\n 'is': disabled ? 'span' : 'button',\n 'class': ['page-link', 'text-center', {'flex-grow-1': !disabled && computedFill.value}],\n 'aria-label': label,\n 'aria-controls': props.ariaControls || undefined,\n 'aria-disabled': disabled ? true : undefined,\n 'aria-posinset': position,\n 'aria-setsize': position ? numberOfPages.value : undefined,\n 'role': 'menuitem',\n 'type': disabled ? undefined : 'button',\n 'tabindex': disabled ? undefined : tabIndex,\n },\n text: {\n name: slotName,\n active: isActive,\n value: textValue ?? page,\n page,\n disabled,\n index: page - 1,\n content: textValue ? undefined : String(page),\n },\n clickHandler: (e: Readonly<MouseEvent>) => pageClick(e, page),\n})\n\nconst getButtonProps = ({\n page,\n classVal,\n disabled,\n slotName,\n textValue,\n label,\n}: {\n page: number\n disabled: boolean\n classVal: ClassValue\n slotName: 'first-text' | 'prev-text' | 'next-text' | 'last-text' | 'page'\n textValue?: string\n label: string\n}) => getBaseButtonProps({page, classVal, disabled, slotName, textValue, label, tabIndex: '-1'})\n\nconst getPageButtonProps = (page: number, isSmHidden?: boolean) =>\n getBaseButtonProps({\n page,\n disabled: props.disabled,\n classVal: props.pageClass,\n slotName: 'page',\n label: props.labelPage ? `${props.labelPage} ${page}` : undefined,\n tabIndex: getTabIndex(page) ?? undefined,\n position: page,\n isActive: isActivePage(page),\n isSmHidden,\n })\n\nconst firstButtonProps = computed(() =>\n getButtonProps({\n page: 1,\n disabled: firstDisabled.value,\n classVal: props.firstClass,\n slotName: 'first-text',\n textValue: props.firstText,\n label: props.labelFirstPage,\n })\n)\nconst prevButtonProps = computed(() =>\n getButtonProps({\n page: Math.max(computedModelValue.value - 1, 1),\n disabled: prevDisabled.value,\n classVal: props.prevClass,\n slotName: 'prev-text',\n textValue: props.prevText,\n label: props.labelPrevPage,\n })\n)\nconst nextButtonProps = computed(() =>\n getButtonProps({\n page: Math.min(computedModelValue.value + 1, numberOfPages.value),\n disabled: nextDisabled.value,\n classVal: props.nextClass,\n slotName: 'next-text',\n textValue: props.nextText,\n label: props.labelNextPage,\n })\n)\nconst lastButtonProps = computed(() =>\n getButtonProps({\n page: numberOfPages.value,\n disabled: lastDisabled.value,\n classVal: props.lastClass,\n slotName: 'last-text',\n textValue: props.lastText,\n label: props.labelLastPage,\n })\n)\n\nconst ellipsisProps = computed(() => ({\n li: {\n class: [\n 'page-item',\n 'disabled',\n 'text-center',\n 'bv-d-sm-down-none',\n computedFill.value ? 'flex-fill' : '',\n props.ellipsisClass,\n ],\n role: 'separator',\n },\n span: {\n class: ['page-link'],\n },\n}))\n\nconst computedWrapperClasses = computed(() => [\n alignment.value,\n {\n [`pagination-${props.size}`]: props.size !== undefined,\n 'b-pagination-pills': props.pills,\n },\n])\n\nconst pagination = computed(() => ({\n pageSize: perPageSanitized.value,\n totalRows: totalRowsNumber.value,\n numberOfPages: numberOfPages.value,\n}))\n\nconst pageClick = (event: Readonly<MouseEvent>, pageNumber: number) => {\n if (pageNumber === computedModelValue.value) return\n const clickEvent = new BvEvent('page-click', {\n cancelable: true,\n target: event.target,\n })\n emit('page-click', clickEvent, pageNumber)\n\n if (clickEvent.defaultPrevented) return\n\n modelValue.value = pageNumber\n\n nextTick(() => {\n if (pageNumber === 1) {\n focusFirst()\n } else if (pageNumber === pagination.value.numberOfPages) {\n focusLast()\n }\n })\n // nextTick(() => {\n // if (isVisible(target) && un_element.contains(target)) {\n // attemptFocus(target)\n //} else {\n //this.focusCurrent()\n //}\n // })\n}\n\nconst isDisabled = (el: HTMLButtonElement) => {\n const isElement = el && el.nodeType === Node.ELEMENT_NODE\n const hasAttr = isElement ? el.hasAttribute('disabled') : null\n const hasClass = isElement && el.classList ? el.classList.contains('disabled') : false\n\n return !isElement || el.disabled || hasAttr || hasClass\n}\n\nconst getButtons = (): HTMLButtonElement[] =>\n [...(pageElements.value ?? [])]\n .sort(\n (a, b) =>\n Number.parseInt(a.getAttribute(dataDisplayNameCustomAttribute) || '0') -\n Number.parseInt(b.getAttribute(dataDisplayNameCustomAttribute) || '0')\n )\n .map((page) => page.children[0])\n .filter((el) => {\n if (el?.getAttribute('display') === 'none' || el?.tagName.toUpperCase() !== 'BUTTON') {\n return false\n }\n\n const bcr = el?.getBoundingClientRect()\n\n return !!(bcr && bcr.height > 0 && bcr.width > 0)\n })\n .map((el) => el as HTMLButtonElement)\n\nconst focusFirst = () => {\n nextTick(() => {\n const btn = getButtons().find((el) => !isDisabled(el))\n btn?.focus()\n })\n}\n\nconst focusPrev = () => {\n nextTick(() => {\n const buttons = getButtons()\n const index = buttons.indexOf(getActiveElement() as HTMLButtonElement)\n\n const button = buttons[index - 1]\n if (index > 0 && button !== undefined && !isDisabled(button)) {\n buttons[index - 1]?.focus()\n }\n })\n}\n\nconst focusLast = () => {\n nextTick(() => {\n const btn = getButtons()\n .reverse()\n .find((el) => !isDisabled(el))\n btn?.focus()\n })\n}\n\nconst focusNext = () => {\n nextTick(() => {\n const buttons = getButtons()\n const index = buttons.indexOf(getActiveElement() as HTMLButtonElement)\n const button = buttons[index + 1]\n if (index < buttons.length - 1 && button !== undefined && !isDisabled(button)) {\n buttons[index + 1]?.focus()\n }\n })\n}\n\nconst handleKeyNav = (event: KeyboardEvent) => {\n const {code, shiftKey} = event\n if (code === CODE_LEFT || code === CODE_UP) {\n event.preventDefault()\n if (shiftKey) {\n focusFirst()\n } else {\n focusPrev()\n }\n } else if (code === CODE_RIGHT || code === CODE_DOWN) {\n event.preventDefault()\n if (shiftKey) {\n focusLast()\n } else {\n focusNext()\n }\n }\n}\n\nconst computedModelValue = computed(() => {\n const page = modelValueNumber.value || 1\n return page > numberOfPages.value ? numberOfPages.value : page < 1 ? 1 : page\n})\n\nwatch(pagination, (oldValue, newValue) => {\n if (newValue.pageSize !== oldValue.pageSize && newValue.totalRows === oldValue.totalRows) {\n // If the page size changes, reset to page 1\n modelValue.value = 1\n }\n})\n\nconst noFirstButton = computed(() => (props.noGotoEndButtons && !props.firstNumber ? 1 : 0))\nconst noLastButton = computed(() => (props.noGotoEndButtons && !props.lastNumber ? 1 : 0))\nconst showFirstButton = computed(() => (noFirstButton.value ? 0 : 1))\nconst showLastButton = computed(() => (noLastButton.value ? 0 : 1))\nconst firstPage = computed(() => (props.firstNumber ? 1 : 0))\nconst lastPage = computed(() => (props.lastNumber ? 1 : 0))\nconst halfLimit = computed(() => Math.floor(limitNumber.value / 2))\n\nconst pages = computed(() => {\n const {value} = computedModelValue\n\n const els = elements.value.map((p) => {\n switch (p) {\n case FIRST_BUTTON:\n return {id: p, ...firstButtonProps.value}\n case PREV_BUTTON:\n return {id: p, ...prevButtonProps.value}\n case NEXT_BUTTON:\n return {id: p, ...nextButtonProps.value}\n case LAST_BUTTON:\n return {id: p, ...lastButtonProps.value}\n case FIRST_ELLIPSIS:\n case LAST_ELLIPSIS:\n return {id: p, ...ellipsisProps.value}\n default:\n return {id: p, ...getPageButtonProps(p)}\n }\n })\n\n if (numberOfPages.value > 3) {\n if (value > numberOfPages.value - halfLimit.value - lastPage.value) {\n const idx = 2 + showFirstButton.value\n const el = els[idx]\n if (el !== undefined) {\n els[idx] = {id: el.id, ...getPageButtonProps(el.id, true)}\n }\n }\n\n if (value <= halfLimit.value + firstPage.value) {\n const idx = els.length - (3 + showLastButton.value)\n const el = els[idx]\n if (el !== undefined) {\n els[idx] = {id: el.id, ...getPageButtonProps(el.id, true)}\n }\n }\n }\n\n return els\n})\n\nconst elements = computed(() => {\n // The idea here is to create an array of all the buttons on the page control.\n // This way we can keep the invariants in one place and the template code just\n // iterates over the array.\n\n const pages = numberOfPages.value\n const {value} = computedModelValue\n const limit = limitNumber.value\n const noEllipsis = props.noEllipsis || limit <= ELLIPSIS_THRESHOLD\n\n // The first case is when all the page buttons fit on the control, this is\n // the simplest case and the only one that will create an array smaller than\n // Limit + 4 - noEndButtons * 2 (the [first, last,] prev, next buttons)\n\n if (pages < limit + firstPage.value + lastPage.value) {\n return [\n !firstPage.value && !noFirstButton.value ? FIRST_BUTTON : null,\n PREV_BUTTON,\n ...Array.from({length: pages}, (_, index) => index + 1),\n NEXT_BUTTON,\n !lastPage.value && !noLastButton.value ? LAST_BUTTON : null,\n ].filter((x) => x !== null) as number[]\n }\n\n // All the remaining cases result in an array that is exactly limit + 4 - noEndButtons * 2 in length, so create\n // the array upfront and set up the beginning and end buttons, then fill the rest for each case\n\n const buttons = Array.from({length: limit + 4 - (noFirstButton.value + noLastButton.value)})\n if (!noFirstButton.value) {\n if (!firstPage.value) {\n buttons[0] = FIRST_BUTTON\n buttons[1] = PREV_BUTTON\n } else {\n buttons[0] = PREV_BUTTON\n buttons[1] = 1\n }\n } else {\n buttons[0] = PREV_BUTTON\n }\n\n if (!noLastButton.value) {\n if (!lastPage.value) {\n buttons[buttons.length - 1] = LAST_BUTTON\n buttons[buttons.length - 2] = NEXT_BUTTON\n } else {\n buttons[buttons.length - 1] = NEXT_BUTTON\n buttons[buttons.length - 2] = pages\n }\n } else {\n buttons[buttons.length - 1] = NEXT_BUTTON\n }\n\n // The next case is where the page buttons start at the beginning, with\n // no ellipsis at the beginning, but one at the end\n\n if (value <= halfLimit.value + firstPage.value) {\n for (let index = 1; index <= limit; index++) {\n buttons[index + 1 - noFirstButton.value] = index + firstPage.value\n }\n\n if (!noEllipsis) {\n buttons[buttons.length - (2 + showLastButton.value)] = LAST_ELLIPSIS\n }\n }\n\n // And then we have the case where the page buttons go up to the end, with no\n // ellipsis at the end, but one at the beginning\n\n if (value > pages - halfLimit.value - lastPage.value) {\n const start = pages - (limit - 1) - lastPage.value\n for (let index = 0; index < limit; index++) {\n buttons[index + 2 - noFirstButton.value] = start + index\n }\n\n if (!noEllipsis) {\n buttons[1 + showFirstButton.value] = FIRST_ELLIPSIS\n }\n }\n\n // Finally we have the case where we have ellipsis at both ends\n if (!buttons[2]) {\n // Is there a more elegant way to check that we're in the final case?\n const start = value - Math.floor(limit / 2)\n for (let index = 0; index < limit; index++) {\n buttons[index + 2 - noFirstButton.value] = start + index\n }\n\n if (!noEllipsis) {\n buttons[1 + showFirstButton.value] = FIRST_ELLIPSIS\n buttons[buttons.length - (2 + showLastButton.value)] = LAST_ELLIPSIS\n }\n }\n\n //Enable sanity check for debugging purposes\n // for (let i = 0; i < buttons.length; i++) {\n // if (!buttons[i]) {\n // // eslint-disable-next-line no-console\n // console.log(\n // `Failed: button == ${i}, limit=${limit}, pages=${pages}, firstPage=${firstPage}, lastPage=${lastPage}, value=${value}`\n // )\n // }\n // }\n\n return buttons.filter((x) => x !== null) as number[]\n})\n</script>\n\n<script lang=\"ts\">\nconst DEFAULT_PER_PAGE = 20\nconst DEFAULT_TOTAL_ROWS = 0\n</script>\n","<template>\n <ul\n class=\"pagination\"\n :class=\"computedWrapperClasses\"\n role=\"menubar\"\n :aria-disabled=\"props.disabled\"\n :aria-label=\"props.ariaLabel || undefined\"\n @keydown=\"handleKeyNav\"\n >\n <li\n v-for=\"(page, index) in pages\"\n :key=\"`page-${page.id}`\"\n v-bind=\"page.li\"\n ref=\"_pageElements\"\n :[dataDisplayNameCustomAttribute]=\"index\"\n >\n <span\n v-if=\"page.id === FIRST_ELLIPSIS || page.id === LAST_ELLIPSIS\"\n v-bind=\"ellipsisProps.span\"\n >\n <slot name=\"ellipsis-text\">\n {{ props.ellipsisText || '...' }}\n </slot>\n </span>\n <component\n v-bind=\"page.button\"\n :is=\"page.button.is\"\n v-else-if=\"'button' in page\"\n @click=\"page.clickHandler\"\n >\n <slot\n :name=\"page.text.name\"\n :disabled=\"page.text.disabled\"\n :page=\"page.text.page\"\n :index=\"page.text.index\"\n :active=\"page.text.active ?? false\"\n :content=\"page.text.value\"\n >\n {{ page.text.value }}\n </slot>\n </component>\n </li>\n </ul>\n</template>\n\n<script setup lang=\"ts\">\nimport {BvEvent} from '../../utils'\nimport {computed, nextTick, useTemplateRef, watch} from 'vue'\nimport {useAlignment} from '../../composables/useAlignment'\nimport {useToNumber} from '@vueuse/core'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {ClassValue} from '../../types/AnyValuedAttributes'\nimport {CODE_DOWN, CODE_LEFT, CODE_RIGHT, CODE_UP} from '../../utils/constants'\nimport {getActiveElement} from '../../utils/dom'\nimport {type BPaginationEmits, type BPaginationProps, type BPaginationSlots} from '../../types'\n\n// Threshold of limit size when we start/stop showing ellipsis\nconst ELLIPSIS_THRESHOLD = 3\n\nconst FIRST_BUTTON = -1\nconst PREV_BUTTON = -2\nconst NEXT_BUTTON = -3\nconst LAST_BUTTON = -4\nconst FIRST_ELLIPSIS = -5\nconst LAST_ELLIPSIS = -6\n\nconst dataDisplayNameCustomAttribute = 'data-display-name'\n\nconst _props = withDefaults(defineProps<Omit<BPaginationProps, 'modelValue'>>(), {\n align: 'start',\n ariaControls: undefined,\n ariaLabel: 'Pagination',\n disabled: false,\n ellipsisClass: undefined,\n ellipsisText: '\\u2026',\n firstClass: undefined,\n firstNumber: false,\n firstText: '\\u00AB',\n noEllipsis: false,\n noGotoEndButtons: false,\n labelFirstPage: 'Go to first page',\n labelLastPage: 'Go to last page',\n labelNextPage: 'Go to next page',\n labelPage: 'Go to page',\n labelPrevPage: 'Go to previous page',\n lastClass: undefined,\n lastNumber: false,\n lastText: '\\u00BB',\n limit: 5,\n nextClass: undefined,\n nextText: '\\u203A',\n pageClass: undefined,\n perPage: DEFAULT_PER_PAGE,\n pills: false,\n prevClass: undefined,\n prevText: '\\u2039',\n size: undefined,\n totalRows: DEFAULT_TOTAL_ROWS,\n})\nconst props = useDefaults(_props, 'BPagination')\nconst emit = defineEmits<BPaginationEmits>()\ndefineSlots<BPaginationSlots>()\n\nconst modelValue = defineModel<Exclude<BPaginationProps['modelValue'], undefined>>({\n default: 1,\n})\n\nconst pageElements = useTemplateRef('_pageElements')\n\nconst limitNumber = useToNumber(() => props.limit, {nanToZero: true, method: 'parseInt'})\nconst perPageNumber = useToNumber(() => props.perPage, {nanToZero: true, method: 'parseInt'})\nconst totalRowsNumber = useToNumber(() => props.totalRows, {nanToZero: true, method: 'parseInt'})\nconst modelValueNumber = useToNumber(modelValue, {nanToZero: true, method: 'parseInt'})\n\nconst perPageSanitized = computed(() => Math.max(perPageNumber.value || DEFAULT_PER_PAGE, 1))\nconst totalRowsSanitized = computed(() => Math.max(totalRowsNumber.value || DEFAULT_TOTAL_ROWS, 0))\n// Use Active to on page-item to denote active tab\nconst numberOfPages = computed(() => Math.ceil(totalRowsSanitized.value / perPageSanitized.value))\nconst computedFill = computed(() => props.align === 'fill')\n// This doesn't use the computedFill util because TS cannot infer that it would never be 'fill'\nconst justifyAlign = computed(() => (props.align === 'fill' ? 'start' : props.align))\n\nconst alignment = useAlignment(justifyAlign)\n\nconst isActivePage = (pageNumber: number) => pageNumber === computedModelValue.value\nconst getTabIndex = (num: number) => (props.disabled ? null : isActivePage(num) ? '0' : '-1')\n\nconst checkDisabled = (num: number) =>\n props.disabled ||\n isActivePage(num) ||\n computedModelValue.value < 1 ||\n // Check if the number is out of bounds\n num < 1 ||\n num > numberOfPages.value\n\nconst firstDisabled = computed(() => checkDisabled(1))\nconst prevDisabled = computed(() => checkDisabled(computedModelValue.value - 1))\nconst lastDisabled = computed(() => checkDisabled(numberOfPages.value))\nconst nextDisabled = computed(() => checkDisabled(computedModelValue.value + 1))\n\nconst getBaseButtonProps = ({\n page,\n classVal,\n disabled,\n slotName,\n textValue,\n tabIndex,\n label,\n position,\n isActive,\n hidden,\n isSmHidden,\n}: {\n page: number\n disabled: boolean\n classVal: ClassValue\n slotName: 'first-text' | 'prev-text' | 'next-text' | 'last-text' | 'page'\n textValue?: string\n tabIndex?: string\n label?: string\n position?: number\n isActive?: boolean\n hidden?: boolean\n isSmHidden?: boolean\n}) => ({\n li: {\n 'class': [\n 'page-item',\n {\n 'active': isActive,\n disabled,\n 'bv-d-sm-down-none': isSmHidden,\n 'flex-fill': computedFill.value,\n 'd-flex': computedFill.value && !disabled,\n },\n classVal,\n ],\n 'role': 'presentation',\n 'aria-hidden': hidden,\n },\n button: {\n 'is': disabled ? 'span' : 'button',\n 'class': ['page-link', 'text-center', {'flex-grow-1': !disabled && computedFill.value}],\n 'aria-label': label,\n 'aria-controls': props.ariaControls || undefined,\n 'aria-disabled': disabled ? true : undefined,\n 'aria-posinset': position,\n 'aria-setsize': position ? numberOfPages.value : undefined,\n 'role': 'menuitem',\n 'type': disabled ? undefined : 'button',\n 'tabindex': disabled ? undefined : tabIndex,\n },\n text: {\n name: slotName,\n active: isActive,\n value: textValue ?? page,\n page,\n disabled,\n index: page - 1,\n content: textValue ? undefined : String(page),\n },\n clickHandler: (e: Readonly<MouseEvent>) => pageClick(e, page),\n})\n\nconst getButtonProps = ({\n page,\n classVal,\n disabled,\n slotName,\n textValue,\n label,\n}: {\n page: number\n disabled: boolean\n classVal: ClassValue\n slotName: 'first-text' | 'prev-text' | 'next-text' | 'last-text' | 'page'\n textValue?: string\n label: string\n}) => getBaseButtonProps({page, classVal, disabled, slotName, textValue, label, tabIndex: '-1'})\n\nconst getPageButtonProps = (page: number, isSmHidden?: boolean) =>\n getBaseButtonProps({\n page,\n disabled: props.disabled,\n classVal: props.pageClass,\n slotName: 'page',\n label: props.labelPage ? `${props.labelPage} ${page}` : undefined,\n tabIndex: getTabIndex(page) ?? undefined,\n position: page,\n isActive: isActivePage(page),\n isSmHidden,\n })\n\nconst firstButtonProps = computed(() =>\n getButtonProps({\n page: 1,\n disabled: firstDisabled.value,\n classVal: props.firstClass,\n slotName: 'first-text',\n textValue: props.firstText,\n label: props.labelFirstPage,\n })\n)\nconst prevButtonProps = computed(() =>\n getButtonProps({\n page: Math.max(computedModelValue.value - 1, 1),\n disabled: prevDisabled.value,\n classVal: props.prevClass,\n slotName: 'prev-text',\n textValue: props.prevText,\n label: props.labelPrevPage,\n })\n)\nconst nextButtonProps = computed(() =>\n getButtonProps({\n page: Math.min(computedModelValue.value + 1, numberOfPages.value),\n disabled: nextDisabled.value,\n classVal: props.nextClass,\n slotName: 'next-text',\n textValue: props.nextText,\n label: props.labelNextPage,\n })\n)\nconst lastButtonProps = computed(() =>\n getButtonProps({\n page: numberOfPages.value,\n disabled: lastDisabled.value,\n classVal: props.lastClass,\n slotName: 'last-text',\n textValue: props.lastText,\n label: props.labelLastPage,\n })\n)\n\nconst ellipsisProps = computed(() => ({\n li: {\n class: [\n 'page-item',\n 'disabled',\n 'text-center',\n 'bv-d-sm-down-none',\n computedFill.value ? 'flex-fill' : '',\n props.ellipsisClass,\n ],\n role: 'separator',\n },\n span: {\n class: ['page-link'],\n },\n}))\n\nconst computedWrapperClasses = computed(() => [\n alignment.value,\n {\n [`pagination-${props.size}`]: props.size !== undefined,\n 'b-pagination-pills': props.pills,\n },\n])\n\nconst pagination = computed(() => ({\n pageSize: perPageSanitized.value,\n totalRows: totalRowsNumber.value,\n numberOfPages: numberOfPages.value,\n}))\n\nconst pageClick = (event: Readonly<MouseEvent>, pageNumber: number) => {\n if (pageNumber === computedModelValue.value) return\n const clickEvent = new BvEvent('page-click', {\n cancelable: true,\n target: event.target,\n })\n emit('page-click', clickEvent, pageNumber)\n\n if (clickEvent.defaultPrevented) return\n\n modelValue.value = pageNumber\n\n nextTick(() => {\n if (pageNumber === 1) {\n focusFirst()\n } else if (pageNumber === pagination.value.numberOfPages) {\n focusLast()\n }\n })\n // nextTick(() => {\n // if (isVisible(target) && un_element.contains(target)) {\n // attemptFocus(target)\n //} else {\n //this.focusCurrent()\n //}\n // })\n}\n\nconst isDisabled = (el: HTMLButtonElement) => {\n const isElement = el && el.nodeType === Node.ELEMENT_NODE\n const hasAttr = isElement ? el.hasAttribute('disabled') : null\n const hasClass = isElement && el.classList ? el.classList.contains('disabled') : false\n\n return !isElement || el.disabled || hasAttr || hasClass\n}\n\nconst getButtons = (): HTMLButtonElement[] =>\n [...(pageElements.value ?? [])]\n .sort(\n (a, b) =>\n Number.parseInt(a.getAttribute(dataDisplayNameCustomAttribute) || '0') -\n Number.parseInt(b.getAttribute(dataDisplayNameCustomAttribute) || '0')\n )\n .map((page) => page.children[0])\n .filter((el) => {\n if (el?.getAttribute('display') === 'none' || el?.tagName.toUpperCase() !== 'BUTTON') {\n return false\n }\n\n const bcr = el?.getBoundingClientRect()\n\n return !!(bcr && bcr.height > 0 && bcr.width > 0)\n })\n .map((el) => el as HTMLButtonElement)\n\nconst focusFirst = () => {\n nextTick(() => {\n const btn = getButtons().find((el) => !isDisabled(el))\n btn?.focus()\n })\n}\n\nconst focusPrev = () => {\n nextTick(() => {\n const buttons = getButtons()\n const index = buttons.indexOf(getActiveElement() as HTMLButtonElement)\n\n const button = buttons[index - 1]\n if (index > 0 && button !== undefined && !isDisabled(button)) {\n buttons[index - 1]?.focus()\n }\n })\n}\n\nconst focusLast = () => {\n nextTick(() => {\n const btn = getButtons()\n .reverse()\n .find((el) => !isDisabled(el))\n btn?.focus()\n })\n}\n\nconst focusNext = () => {\n nextTick(() => {\n const buttons = getButtons()\n const index = buttons.indexOf(getActiveElement() as HTMLButtonElement)\n const button = buttons[index + 1]\n if (index < buttons.length - 1 && button !== undefined && !isDisabled(button)) {\n buttons[index + 1]?.focus()\n }\n })\n}\n\nconst handleKeyNav = (event: KeyboardEvent) => {\n const {code, shiftKey} = event\n if (code === CODE_LEFT || code === CODE_UP) {\n event.preventDefault()\n if (shiftKey) {\n focusFirst()\n } else {\n focusPrev()\n }\n } else if (code === CODE_RIGHT || code === CODE_DOWN) {\n event.preventDefault()\n if (shiftKey) {\n focusLast()\n } else {\n focusNext()\n }\n }\n}\n\nconst computedModelValue = computed(() => {\n const page = modelValueNumber.value || 1\n return page > numberOfPages.value ? numberOfPages.value : page < 1 ? 1 : page\n})\n\nwatch(pagination, (oldValue, newValue) => {\n if (newValue.pageSize !== oldValue.pageSize && newValue.totalRows === oldValue.totalRows) {\n // If the page size changes, reset to page 1\n modelValue.value = 1\n }\n})\n\nconst noFirstButton = computed(() => (props.noGotoEndButtons && !props.firstNumber ? 1 : 0))\nconst noLastButton = computed(() => (props.noGotoEndButtons && !props.lastNumber ? 1 : 0))\nconst showFirstButton = computed(() => (noFirstButton.value ? 0 : 1))\nconst showLastButton = computed(() => (noLastButton.value ? 0 : 1))\nconst firstPage = computed(() => (props.firstNumber ? 1 : 0))\nconst lastPage = computed(() => (props.lastNumber ? 1 : 0))\nconst halfLimit = computed(() => Math.floor(limitNumber.value / 2))\n\nconst pages = computed(() => {\n const {value} = computedModelValue\n\n const els = elements.value.map((p) => {\n switch (p) {\n case FIRST_BUTTON:\n return {id: p, ...firstButtonProps.value}\n case PREV_BUTTON:\n return {id: p, ...prevButtonProps.value}\n case NEXT_BUTTON:\n return {id: p, ...nextButtonProps.value}\n case LAST_BUTTON:\n return {id: p, ...lastButtonProps.value}\n case FIRST_ELLIPSIS:\n case LAST_ELLIPSIS:\n return {id: p, ...ellipsisProps.value}\n default:\n return {id: p, ...getPageButtonProps(p)}\n }\n })\n\n if (numberOfPages.value > 3) {\n if (value > numberOfPages.value - halfLimit.value - lastPage.value) {\n const idx = 2 + showFirstButton.value\n const el = els[idx]\n if (el !== undefined) {\n els[idx] = {id: el.id, ...getPageButtonProps(el.id, true)}\n }\n }\n\n if (value <= halfLimit.value + firstPage.value) {\n const idx = els.length - (3 + showLastButton.value)\n const el = els[idx]\n if (el !== undefined) {\n els[idx] = {id: el.id, ...getPageButtonProps(el.id, true)}\n }\n }\n }\n\n return els\n})\n\nconst elements = computed(() => {\n // The idea here is to create an array of all the buttons on the page control.\n // This way we can keep the invariants in one place and the template code just\n // iterates over the array.\n\n const pages = numberOfPages.value\n const {value} = computedModelValue\n const limit = limitNumber.value\n const noEllipsis = props.noEllipsis || limit <= ELLIPSIS_THRESHOLD\n\n // The first case is when all the page buttons fit on the control, this is\n // the simplest case and the only one that will create an array smaller than\n // Limit + 4 - noEndButtons * 2 (the [first, last,] prev, next buttons)\n\n if (pages < limit + firstPage.value + lastPage.value) {\n return [\n !firstPage.value && !noFirstButton.value ? FIRST_BUTTON : null,\n PREV_BUTTON,\n ...Array.from({length: pages}, (_, index) => index + 1),\n NEXT_BUTTON,\n !lastPage.value && !noLastButton.value ? LAST_BUTTON : null,\n ].filter((x) => x !== null) as number[]\n }\n\n // All the remaining cases result in an array that is exactly limit + 4 - noEndButtons * 2 in length, so create\n // the array upfront and set up the beginning and end buttons, then fill the rest for each case\n\n const buttons = Array.from({length: limit + 4 - (noFirstButton.value + noLastButton.value)})\n if (!noFirstButton.value) {\n if (!firstPage.value) {\n buttons[0] = FIRST_BUTTON\n buttons[1] = PREV_BUTTON\n } else {\n buttons[0] = PREV_BUTTON\n buttons[1] = 1\n }\n } else {\n buttons[0] = PREV_BUTTON\n }\n\n if (!noLastButton.value) {\n if (!lastPage.value) {\n buttons[buttons.length - 1] = LAST_BUTTON\n buttons[buttons.length - 2] = NEXT_BUTTON\n } else {\n buttons[buttons.length - 1] = NEXT_BUTTON\n buttons[buttons.length - 2] = pages\n }\n } else {\n buttons[buttons.length - 1] = NEXT_BUTTON\n }\n\n // The next case is where the page buttons start at the beginning, with\n // no ellipsis at the beginning, but one at the end\n\n if (value <= halfLimit.value + firstPage.value) {\n for (let index = 1; index <= limit; index++) {\n buttons[index + 1 - noFirstButton.value] = index + firstPage.value\n }\n\n if (!noEllipsis) {\n buttons[buttons.length - (2 + showLastButton.value)] = LAST_ELLIPSIS\n }\n }\n\n // And then we have the case where the page buttons go up to the end, with no\n // ellipsis at the end, but one at the beginning\n\n if (value > pages - halfLimit.value - lastPage.value) {\n const start = pages - (limit - 1) - lastPage.value\n for (let index = 0; index < limit; index++) {\n buttons[index + 2 - noFirstButton.value] = start + index\n }\n\n if (!noEllipsis) {\n buttons[1 + showFirstButton.value] = FIRST_ELLIPSIS\n }\n }\n\n // Finally we have the case where we have ellipsis at both ends\n if (!buttons[2]) {\n // Is there a more elegant way to check that we're in the final case?\n const start = value - Math.floor(limit / 2)\n for (let index = 0; index < limit; index++) {\n buttons[index + 2 - noFirstButton.value] = start + index\n }\n\n if (!noEllipsis) {\n buttons[1 + showFirstButton.value] = FIRST_ELLIPSIS\n buttons[buttons.length - (2 + showLastButton.value)] = LAST_ELLIPSIS\n }\n }\n\n //Enable sanity check for debugging purposes\n // for (let i = 0; i < buttons.length; i++) {\n // if (!buttons[i]) {\n // // eslint-disable-next-line no-console\n // console.log(\n // `Failed: button == ${i}, limit=${limit}, pages=${pages}, firstPage=${firstPage}, lastPage=${lastPage}, value=${value}`\n // )\n // }\n // }\n\n return buttons.filter((x) => x !== null) as number[]\n})\n</script>\n\n<script lang=\"ts\">\nconst DEFAULT_PER_PAGE = 20\nconst DEFAULT_TOTAL_ROWS = 0\n</script>\n"],"mappings":";;;;;;;;;;;AA4kBA,IAAM,mBAAmB;AACzB,IAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAphB3B,MAAM,qBAAqB;EAE3B,MAAM,eAAe;EACrB,MAAM,cAAc;EACpB,MAAM,cAAc;EACpB,MAAM,cAAc;EACpB,MAAM,iBAAiB;EACvB,MAAM,gBAAgB;EAEtB,MAAM,iCAAiC;EAiCvC,MAAM,QAAQ,oBAAA,YA/BC,SA+BmB,cAAa;EAC/C,MAAM,OAAO;EAGb,MAAM,cAAA,GAAA,IAAA,UAA4E,SAAA,aAEjF;EAED,MAAM,gBAAA,GAAA,IAAA,gBAA8B,gBAAe;EAEnD,MAAM,cAAc,aAAA,kBAAkB,MAAM,OAAO;GAAC,WAAW;GAAM,QAAQ;GAAW,CAAA;EACxF,MAAM,gBAAgB,aAAA,kBAAkB,MAAM,SAAS;GAAC,WAAW;GAAM,QAAQ;GAAW,CAAA;EAC5F,MAAM,kBAAkB,aAAA,kBAAkB,MAAM,WAAW;GAAC,WAAW;GAAM,QAAQ;GAAW,CAAA;EAChG,MAAM,mBAAmB,aAAA,YAAY,YAAY;GAAC,WAAW;GAAM,QAAQ;GAAW,CAAA;EAEtF,MAAM,oBAAA,GAAA,IAAA,gBAAkC,KAAK,IAAI,cAAc,SAAS,kBAAkB,EAAE,CAAA;EAC5F,MAA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Pagination.vue"],"sourcesContent":["<template>\n <ul\n class=\"pagination\"\n :class=\"computedWrapperClasses\"\n role=\"menubar\"\n :aria-disabled=\"props.disabled\"\n :aria-label=\"props.ariaLabel || undefined\"\n @keydown=\"handleKeyNav\"\n >\n <li\n v-for=\"(page, index) in pages\"\n :key=\"`page-${page.id}`\"\n v-bind=\"page.li\"\n ref=\"_pageElements\"\n :[dataDisplayNameCustomAttribute]=\"index\"\n >\n <span\n v-if=\"page.id === FIRST_ELLIPSIS || page.id === LAST_ELLIPSIS\"\n v-bind=\"ellipsisProps.span\"\n >\n <slot name=\"ellipsis-text\">\n {{ props.ellipsisText || '...' }}\n </slot>\n </span>\n <component\n v-bind=\"page.button\"\n :is=\"page.button.is\"\n v-else-if=\"'button' in page\"\n @click=\"page.clickHandler\"\n >\n <slot\n :name=\"page.text.name\"\n :disabled=\"page.text.disabled\"\n :page=\"page.text.page\"\n :index=\"page.text.index\"\n :active=\"page.text.active ?? false\"\n :content=\"page.text.value\"\n >\n {{ page.text.value }}\n </slot>\n </component>\n </li>\n </ul>\n</template>\n\n<script setup lang=\"ts\">\nimport {BvEvent} from '../../utils'\nimport {computed, nextTick, useTemplateRef, watch} from 'vue'\nimport {useAlignment} from '../../composables/useAlignment'\nimport {useToNumber} from '@vueuse/core'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {ClassValue} from '../../types/AnyValuedAttributes'\nimport {CODE_DOWN, CODE_LEFT, CODE_RIGHT, CODE_UP} from '../../utils/constants'\nimport {getActiveElement} from '../../utils/dom'\nimport {type BPaginationEmits, type BPaginationProps, type BPaginationSlots} from '../../types'\n\n// Threshold of limit size when we start/stop showing ellipsis\nconst ELLIPSIS_THRESHOLD = 3\n\nconst FIRST_BUTTON = -1\nconst PREV_BUTTON = -2\nconst NEXT_BUTTON = -3\nconst LAST_BUTTON = -4\nconst FIRST_ELLIPSIS = -5\nconst LAST_ELLIPSIS = -6\n\nconst dataDisplayNameCustomAttribute = 'data-display-name'\n\nconst _props = withDefaults(defineProps<Omit<BPaginationProps, 'modelValue'>>(), {\n align: 'start',\n ariaControls: undefined,\n ariaLabel: 'Pagination',\n disabled: false,\n ellipsisClass: undefined,\n ellipsisText: '\\u2026',\n firstClass: undefined,\n firstNumber: false,\n firstText: '\\u00AB',\n noEllipsis: false,\n noGotoEndButtons: false,\n labelFirstPage: 'Go to first page',\n labelLastPage: 'Go to last page',\n labelNextPage: 'Go to next page',\n labelPage: 'Go to page',\n labelPrevPage: 'Go to previous page',\n lastClass: undefined,\n lastNumber: false,\n lastText: '\\u00BB',\n limit: 5,\n nextClass: undefined,\n nextText: '\\u203A',\n pageClass: undefined,\n perPage: DEFAULT_PER_PAGE,\n pills: false,\n prevClass: undefined,\n prevText: '\\u2039',\n size: undefined,\n totalRows: DEFAULT_TOTAL_ROWS,\n})\nconst props = useDefaults(_props, 'BPagination')\nconst emit = defineEmits<BPaginationEmits>()\ndefineSlots<BPaginationSlots>()\n\nconst modelValue = defineModel<Exclude<BPaginationProps['modelValue'], undefined>>({\n default: 1,\n})\n\nconst pageElements = useTemplateRef('_pageElements')\n\nconst limitNumber = useToNumber(() => props.limit, {nanToZero: true, method: 'parseInt'})\nconst perPageNumber = useToNumber(() => props.perPage, {nanToZero: true, method: 'parseInt'})\nconst totalRowsNumber = useToNumber(() => props.totalRows, {nanToZero: true, method: 'parseInt'})\nconst modelValueNumber = useToNumber(modelValue, {nanToZero: true, method: 'parseInt'})\n\nconst perPageSanitized = computed(() => Math.max(perPageNumber.value || DEFAULT_PER_PAGE, 1))\nconst totalRowsSanitized = computed(() => Math.max(totalRowsNumber.value || DEFAULT_TOTAL_ROWS, 0))\n// Use Active to on page-item to denote active tab\nconst numberOfPages = computed(() => Math.ceil(totalRowsSanitized.value / perPageSanitized.value))\nconst computedFill = computed(() => props.align === 'fill')\n// This doesn't use the computedFill util because TS cannot infer that it would never be 'fill'\nconst justifyAlign = computed(() => (props.align === 'fill' ? 'start' : props.align))\n\nconst alignment = useAlignment(justifyAlign)\n\nconst isActivePage = (pageNumber: number) => pageNumber === computedModelValue.value\nconst getTabIndex = (num: number) => (props.disabled ? null : isActivePage(num) ? '0' : '-1')\n\nconst checkDisabled = (num: number) =>\n props.disabled ||\n isActivePage(num) ||\n computedModelValue.value < 1 ||\n // Check if the number is out of bounds\n num < 1 ||\n num > numberOfPages.value\n\nconst firstDisabled = computed(() => checkDisabled(1))\nconst prevDisabled = computed(() => checkDisabled(computedModelValue.value - 1))\nconst lastDisabled = computed(() => checkDisabled(numberOfPages.value))\nconst nextDisabled = computed(() => checkDisabled(computedModelValue.value + 1))\n\nconst getBaseButtonProps = ({\n page,\n classVal,\n disabled,\n slotName,\n textValue,\n tabIndex,\n label,\n position,\n isActive,\n hidden,\n isSmHidden,\n}: {\n page: number\n disabled: boolean\n classVal: ClassValue\n slotName: 'first-text' | 'prev-text' | 'next-text' | 'last-text' | 'page'\n textValue?: string\n tabIndex?: string\n label?: string\n position?: number\n isActive?: boolean\n hidden?: boolean\n isSmHidden?: boolean\n}) => ({\n li: {\n 'class': [\n 'page-item',\n {\n 'active': isActive,\n disabled,\n 'bv-d-sm-down-none': isSmHidden,\n 'flex-fill': computedFill.value,\n 'd-flex': computedFill.value && !disabled,\n },\n classVal,\n ],\n 'role': 'presentation',\n 'aria-hidden': hidden,\n },\n button: {\n 'is': disabled ? 'span' : 'button',\n 'class': ['page-link', 'text-center', {'flex-grow-1': !disabled && computedFill.value}],\n 'aria-label': label,\n 'aria-controls': props.ariaControls || undefined,\n 'aria-disabled': disabled ? true : undefined,\n 'aria-posinset': position,\n 'aria-setsize': position ? numberOfPages.value : undefined,\n 'role': 'menuitem',\n 'type': disabled ? undefined : 'button',\n 'tabindex': disabled ? undefined : tabIndex,\n },\n text: {\n name: slotName,\n active: isActive,\n value: textValue ?? page,\n page,\n disabled,\n index: page - 1,\n content: textValue ? undefined : String(page),\n },\n clickHandler: (e: Readonly<MouseEvent>) => pageClick(e, page),\n})\n\nconst getButtonProps = ({\n page,\n classVal,\n disabled,\n slotName,\n textValue,\n label,\n}: {\n page: number\n disabled: boolean\n classVal: ClassValue\n slotName: 'first-text' | 'prev-text' | 'next-text' | 'last-text' | 'page'\n textValue?: string\n label: string\n}) => getBaseButtonProps({page, classVal, disabled, slotName, textValue, label, tabIndex: '-1'})\n\nconst getPageButtonProps = (page: number, isSmHidden?: boolean) =>\n getBaseButtonProps({\n page,\n disabled: props.disabled,\n classVal: props.pageClass,\n slotName: 'page',\n label: props.labelPage ? `${props.labelPage} ${page}` : undefined,\n tabIndex: getTabIndex(page) ?? undefined,\n position: page,\n isActive: isActivePage(page),\n isSmHidden,\n })\n\nconst firstButtonProps = computed(() =>\n getButtonProps({\n page: 1,\n disabled: firstDisabled.value,\n classVal: props.firstClass,\n slotName: 'first-text',\n textValue: props.firstText,\n label: props.labelFirstPage,\n })\n)\nconst prevButtonProps = computed(() =>\n getButtonProps({\n page: Math.max(computedModelValue.value - 1, 1),\n disabled: prevDisabled.value,\n classVal: props.prevClass,\n slotName: 'prev-text',\n textValue: props.prevText,\n label: props.labelPrevPage,\n })\n)\nconst nextButtonProps = computed(() =>\n getButtonProps({\n page: Math.min(computedModelValue.value + 1, numberOfPages.value),\n disabled: nextDisabled.value,\n classVal: props.nextClass,\n slotName: 'next-text',\n textValue: props.nextText,\n label: props.labelNextPage,\n })\n)\nconst lastButtonProps = computed(() =>\n getButtonProps({\n page: numberOfPages.value,\n disabled: lastDisabled.value,\n classVal: props.lastClass,\n slotName: 'last-text',\n textValue: props.lastText,\n label: props.labelLastPage,\n })\n)\n\nconst ellipsisProps = computed(() => ({\n li: {\n class: [\n 'page-item',\n 'disabled',\n 'text-center',\n 'bv-d-sm-down-none',\n computedFill.value ? 'flex-fill' : '',\n props.ellipsisClass,\n ],\n role: 'separator',\n },\n span: {\n class: ['page-link'],\n },\n}))\n\nconst computedWrapperClasses = computed(() => [\n alignment.value,\n {\n [`pagination-${props.size}`]: props.size !== undefined,\n 'b-pagination-pills': props.pills,\n },\n])\n\nconst pagination = computed(() => ({\n pageSize: perPageSanitized.value,\n totalRows: totalRowsNumber.value,\n numberOfPages: numberOfPages.value,\n}))\n\nconst pageClick = (event: Readonly<MouseEvent>, pageNumber: number) => {\n if (pageNumber === computedModelValue.value) return\n const clickEvent = new BvEvent('page-click', {\n cancelable: true,\n target: event.target,\n })\n emit('page-click', clickEvent, pageNumber)\n\n if (clickEvent.defaultPrevented) return\n\n modelValue.value = pageNumber\n\n nextTick(() => {\n if (pageNumber === 1) {\n focusFirst()\n } else if (pageNumber === pagination.value.numberOfPages) {\n focusLast()\n }\n })\n // nextTick(() => {\n // if (isVisible(target) && un_element.contains(target)) {\n // attemptFocus(target)\n //} else {\n //this.focusCurrent()\n //}\n // })\n}\n\nconst isDisabled = (el: HTMLButtonElement) => {\n const isElement = el && el.nodeType === Node.ELEMENT_NODE\n const hasAttr = isElement ? el.hasAttribute('disabled') : null\n const hasClass = isElement && el.classList ? el.classList.contains('disabled') : false\n\n return !isElement || el.disabled || hasAttr || hasClass\n}\n\nconst getButtons = (): HTMLButtonElement[] =>\n [...(pageElements.value ?? [])]\n .sort(\n (a, b) =>\n Number.parseInt(a.getAttribute(dataDisplayNameCustomAttribute) || '0') -\n Number.parseInt(b.getAttribute(dataDisplayNameCustomAttribute) || '0')\n )\n .map((page) => page.children[0])\n .filter((el) => {\n if (el?.getAttribute('display') === 'none' || el?.tagName.toUpperCase() !== 'BUTTON') {\n return false\n }\n\n const bcr = el?.getBoundingClientRect()\n\n return !!(bcr && bcr.height > 0 && bcr.width > 0)\n })\n .map((el) => el as HTMLButtonElement)\n\nconst focusFirst = () => {\n nextTick(() => {\n const btn = getButtons().find((el) => !isDisabled(el))\n btn?.focus()\n })\n}\n\nconst focusPrev = () => {\n nextTick(() => {\n const buttons = getButtons()\n const index = buttons.indexOf(getActiveElement() as HTMLButtonElement)\n\n const button = buttons[index - 1]\n if (index > 0 && button !== undefined && !isDisabled(button)) {\n buttons[index - 1]?.focus()\n }\n })\n}\n\nconst focusLast = () => {\n nextTick(() => {\n const btn = getButtons()\n .reverse()\n .find((el) => !isDisabled(el))\n btn?.focus()\n })\n}\n\nconst focusNext = () => {\n nextTick(() => {\n const buttons = getButtons()\n const index = buttons.indexOf(getActiveElement() as HTMLButtonElement)\n const button = buttons[index + 1]\n if (index < buttons.length - 1 && button !== undefined && !isDisabled(button)) {\n buttons[index + 1]?.focus()\n }\n })\n}\n\nconst handleKeyNav = (event: KeyboardEvent) => {\n const {code, shiftKey} = event\n if (code === CODE_LEFT || code === CODE_UP) {\n event.preventDefault()\n if (shiftKey) {\n focusFirst()\n } else {\n focusPrev()\n }\n } else if (code === CODE_RIGHT || code === CODE_DOWN) {\n event.preventDefault()\n if (shiftKey) {\n focusLast()\n } else {\n focusNext()\n }\n }\n}\n\nconst computedModelValue = computed(() => {\n const page = modelValueNumber.value || 1\n return page > numberOfPages.value ? numberOfPages.value : page < 1 ? 1 : page\n})\n\nwatch(pagination, (oldValue, newValue) => {\n if (newValue.pageSize !== oldValue.pageSize && newValue.totalRows === oldValue.totalRows) {\n // If the page size changes, reset to page 1\n modelValue.value = 1\n }\n})\n\nconst noFirstButton = computed(() => (props.noGotoEndButtons && !props.firstNumber ? 1 : 0))\nconst noLastButton = computed(() => (props.noGotoEndButtons && !props.lastNumber ? 1 : 0))\nconst showFirstButton = computed(() => (noFirstButton.value ? 0 : 1))\nconst showLastButton = computed(() => (noLastButton.value ? 0 : 1))\nconst firstPage = computed(() => (props.firstNumber ? 1 : 0))\nconst lastPage = computed(() => (props.lastNumber ? 1 : 0))\nconst halfLimit = computed(() => Math.floor(limitNumber.value / 2))\n\nconst pages = computed(() => {\n const {value} = computedModelValue\n\n const els = elements.value.map((p) => {\n switch (p) {\n case FIRST_BUTTON:\n return {id: p, ...firstButtonProps.value}\n case PREV_BUTTON:\n return {id: p, ...prevButtonProps.value}\n case NEXT_BUTTON:\n return {id: p, ...nextButtonProps.value}\n case LAST_BUTTON:\n return {id: p, ...lastButtonProps.value}\n case FIRST_ELLIPSIS:\n case LAST_ELLIPSIS:\n return {id: p, ...ellipsisProps.value}\n default:\n return {id: p, ...getPageButtonProps(p)}\n }\n })\n\n if (numberOfPages.value > 3) {\n if (value > numberOfPages.value - halfLimit.value - lastPage.value) {\n const idx = 2 + showFirstButton.value\n const el = els[idx]\n if (el !== undefined) {\n els[idx] = {id: el.id, ...getPageButtonProps(el.id, true)}\n }\n }\n\n if (value <= halfLimit.value + firstPage.value) {\n const idx = els.length - (3 + showLastButton.value)\n const el = els[idx]\n if (el !== undefined) {\n els[idx] = {id: el.id, ...getPageButtonProps(el.id, true)}\n }\n }\n }\n\n return els\n})\n\nconst elements = computed(() => {\n // The idea here is to create an array of all the buttons on the page control.\n // This way we can keep the invariants in one place and the template code just\n // iterates over the array.\n\n const pages = numberOfPages.value\n const {value} = computedModelValue\n const limit = limitNumber.value\n const noEllipsis = props.noEllipsis || limit <= ELLIPSIS_THRESHOLD\n\n // The first case is when all the page buttons fit on the control, this is\n // the simplest case and the only one that will create an array smaller than\n // Limit + 4 - noEndButtons * 2 (the [first, last,] prev, next buttons)\n\n if (pages < limit + firstPage.value + lastPage.value) {\n return [\n !firstPage.value && !noFirstButton.value ? FIRST_BUTTON : null,\n PREV_BUTTON,\n ...Array.from({length: pages}, (_, index) => index + 1),\n NEXT_BUTTON,\n !lastPage.value && !noLastButton.value ? LAST_BUTTON : null,\n ].filter((x) => x !== null) as number[]\n }\n\n // All the remaining cases result in an array that is exactly limit + 4 - noEndButtons * 2 in length, so create\n // the array upfront and set up the beginning and end buttons, then fill the rest for each case\n\n const buttons = Array.from({length: limit + 4 - (noFirstButton.value + noLastButton.value)})\n if (!noFirstButton.value) {\n if (!firstPage.value) {\n buttons[0] = FIRST_BUTTON\n buttons[1] = PREV_BUTTON\n } else {\n buttons[0] = PREV_BUTTON\n buttons[1] = 1\n }\n } else {\n buttons[0] = PREV_BUTTON\n }\n\n if (!noLastButton.value) {\n if (!lastPage.value) {\n buttons[buttons.length - 1] = LAST_BUTTON\n buttons[buttons.length - 2] = NEXT_BUTTON\n } else {\n buttons[buttons.length - 1] = NEXT_BUTTON\n buttons[buttons.length - 2] = pages\n }\n } else {\n buttons[buttons.length - 1] = NEXT_BUTTON\n }\n\n // The next case is where the page buttons start at the beginning, with\n // no ellipsis at the beginning, but one at the end\n\n if (value <= halfLimit.value + firstPage.value) {\n for (let index = 1; index <= limit; index++) {\n buttons[index + 1 - noFirstButton.value] = index + firstPage.value\n }\n\n if (!noEllipsis) {\n buttons[buttons.length - (2 + showLastButton.value)] = LAST_ELLIPSIS\n }\n }\n\n // And then we have the case where the page buttons go up to the end, with no\n // ellipsis at the end, but one at the beginning\n\n if (value > pages - halfLimit.value - lastPage.value) {\n const start = pages - (limit - 1) - lastPage.value\n for (let index = 0; index < limit; index++) {\n buttons[index + 2 - noFirstButton.value] = start + index\n }\n\n if (!noEllipsis) {\n buttons[1 + showFirstButton.value] = FIRST_ELLIPSIS\n }\n }\n\n // Finally we have the case where we have ellipsis at both ends\n if (!buttons[2]) {\n // Is there a more elegant way to check that we're in the final case?\n const start = value - Math.floor(limit / 2)\n for (let index = 0; index < limit; index++) {\n buttons[index + 2 - noFirstButton.value] = start + index\n }\n\n if (!noEllipsis) {\n buttons[1 + showFirstButton.value] = FIRST_ELLIPSIS\n buttons[buttons.length - (2 + showLastButton.value)] = LAST_ELLIPSIS\n }\n }\n\n //Enable sanity check for debugging purposes\n // for (let i = 0; i < buttons.length; i++) {\n // if (!buttons[i]) {\n // // eslint-disable-next-line no-console\n // console.log(\n // `Failed: button == ${i}, limit=${limit}, pages=${pages}, firstPage=${firstPage}, lastPage=${lastPage}, value=${value}`\n // )\n // }\n // }\n\n return buttons.filter((x) => x !== null) as number[]\n})\n</script>\n\n<script lang=\"ts\">\nconst DEFAULT_PER_PAGE = 20\nconst DEFAULT_TOTAL_ROWS = 0\n</script>\n","<template>\n <ul\n class=\"pagination\"\n :class=\"computedWrapperClasses\"\n role=\"menubar\"\n :aria-disabled=\"props.disabled\"\n :aria-label=\"props.ariaLabel || undefined\"\n @keydown=\"handleKeyNav\"\n >\n <li\n v-for=\"(page, index) in pages\"\n :key=\"`page-${page.id}`\"\n v-bind=\"page.li\"\n ref=\"_pageElements\"\n :[dataDisplayNameCustomAttribute]=\"index\"\n >\n <span\n v-if=\"page.id === FIRST_ELLIPSIS || page.id === LAST_ELLIPSIS\"\n v-bind=\"ellipsisProps.span\"\n >\n <slot name=\"ellipsis-text\">\n {{ props.ellipsisText || '...' }}\n </slot>\n </span>\n <component\n v-bind=\"page.button\"\n :is=\"page.button.is\"\n v-else-if=\"'button' in page\"\n @click=\"page.clickHandler\"\n >\n <slot\n :name=\"page.text.name\"\n :disabled=\"page.text.disabled\"\n :page=\"page.text.page\"\n :index=\"page.text.index\"\n :active=\"page.text.active ?? false\"\n :content=\"page.text.value\"\n >\n {{ page.text.value }}\n </slot>\n </component>\n </li>\n </ul>\n</template>\n\n<script setup lang=\"ts\">\nimport {BvEvent} from '../../utils'\nimport {computed, nextTick, useTemplateRef, watch} from 'vue'\nimport {useAlignment} from '../../composables/useAlignment'\nimport {useToNumber} from '@vueuse/core'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {ClassValue} from '../../types/AnyValuedAttributes'\nimport {CODE_DOWN, CODE_LEFT, CODE_RIGHT, CODE_UP} from '../../utils/constants'\nimport {getActiveElement} from '../../utils/dom'\nimport {type BPaginationEmits, type BPaginationProps, type BPaginationSlots} from '../../types'\n\n// Threshold of limit size when we start/stop showing ellipsis\nconst ELLIPSIS_THRESHOLD = 3\n\nconst FIRST_BUTTON = -1\nconst PREV_BUTTON = -2\nconst NEXT_BUTTON = -3\nconst LAST_BUTTON = -4\nconst FIRST_ELLIPSIS = -5\nconst LAST_ELLIPSIS = -6\n\nconst dataDisplayNameCustomAttribute = 'data-display-name'\n\nconst _props = withDefaults(defineProps<Omit<BPaginationProps, 'modelValue'>>(), {\n align: 'start',\n ariaControls: undefined,\n ariaLabel: 'Pagination',\n disabled: false,\n ellipsisClass: undefined,\n ellipsisText: '\\u2026',\n firstClass: undefined,\n firstNumber: false,\n firstText: '\\u00AB',\n noEllipsis: false,\n noGotoEndButtons: false,\n labelFirstPage: 'Go to first page',\n labelLastPage: 'Go to last page',\n labelNextPage: 'Go to next page',\n labelPage: 'Go to page',\n labelPrevPage: 'Go to previous page',\n lastClass: undefined,\n lastNumber: false,\n lastText: '\\u00BB',\n limit: 5,\n nextClass: undefined,\n nextText: '\\u203A',\n pageClass: undefined,\n perPage: DEFAULT_PER_PAGE,\n pills: false,\n prevClass: undefined,\n prevText: '\\u2039',\n size: undefined,\n totalRows: DEFAULT_TOTAL_ROWS,\n})\nconst props = useDefaults(_props, 'BPagination')\nconst emit = defineEmits<BPaginationEmits>()\ndefineSlots<BPaginationSlots>()\n\nconst modelValue = defineModel<Exclude<BPaginationProps['modelValue'], undefined>>({\n default: 1,\n})\n\nconst pageElements = useTemplateRef('_pageElements')\n\nconst limitNumber = useToNumber(() => props.limit, {nanToZero: true, method: 'parseInt'})\nconst perPageNumber = useToNumber(() => props.perPage, {nanToZero: true, method: 'parseInt'})\nconst totalRowsNumber = useToNumber(() => props.totalRows, {nanToZero: true, method: 'parseInt'})\nconst modelValueNumber = useToNumber(modelValue, {nanToZero: true, method: 'parseInt'})\n\nconst perPageSanitized = computed(() => Math.max(perPageNumber.value || DEFAULT_PER_PAGE, 1))\nconst totalRowsSanitized = computed(() => Math.max(totalRowsNumber.value || DEFAULT_TOTAL_ROWS, 0))\n// Use Active to on page-item to denote active tab\nconst numberOfPages = computed(() => Math.ceil(totalRowsSanitized.value / perPageSanitized.value))\nconst computedFill = computed(() => props.align === 'fill')\n// This doesn't use the computedFill util because TS cannot infer that it would never be 'fill'\nconst justifyAlign = computed(() => (props.align === 'fill' ? 'start' : props.align))\n\nconst alignment = useAlignment(justifyAlign)\n\nconst isActivePage = (pageNumber: number) => pageNumber === computedModelValue.value\nconst getTabIndex = (num: number) => (props.disabled ? null : isActivePage(num) ? '0' : '-1')\n\nconst checkDisabled = (num: number) =>\n props.disabled ||\n isActivePage(num) ||\n computedModelValue.value < 1 ||\n // Check if the number is out of bounds\n num < 1 ||\n num > numberOfPages.value\n\nconst firstDisabled = computed(() => checkDisabled(1))\nconst prevDisabled = computed(() => checkDisabled(computedModelValue.value - 1))\nconst lastDisabled = computed(() => checkDisabled(numberOfPages.value))\nconst nextDisabled = computed(() => checkDisabled(computedModelValue.value + 1))\n\nconst getBaseButtonProps = ({\n page,\n classVal,\n disabled,\n slotName,\n textValue,\n tabIndex,\n label,\n position,\n isActive,\n hidden,\n isSmHidden,\n}: {\n page: number\n disabled: boolean\n classVal: ClassValue\n slotName: 'first-text' | 'prev-text' | 'next-text' | 'last-text' | 'page'\n textValue?: string\n tabIndex?: string\n label?: string\n position?: number\n isActive?: boolean\n hidden?: boolean\n isSmHidden?: boolean\n}) => ({\n li: {\n 'class': [\n 'page-item',\n {\n 'active': isActive,\n disabled,\n 'bv-d-sm-down-none': isSmHidden,\n 'flex-fill': computedFill.value,\n 'd-flex': computedFill.value && !disabled,\n },\n classVal,\n ],\n 'role': 'presentation',\n 'aria-hidden': hidden,\n },\n button: {\n 'is': disabled ? 'span' : 'button',\n 'class': ['page-link', 'text-center', {'flex-grow-1': !disabled && computedFill.value}],\n 'aria-label': label,\n 'aria-controls': props.ariaControls || undefined,\n 'aria-disabled': disabled ? true : undefined,\n 'aria-posinset': position,\n 'aria-setsize': position ? numberOfPages.value : undefined,\n 'role': 'menuitem',\n 'type': disabled ? undefined : 'button',\n 'tabindex': disabled ? undefined : tabIndex,\n },\n text: {\n name: slotName,\n active: isActive,\n value: textValue ?? page,\n page,\n disabled,\n index: page - 1,\n content: textValue ? undefined : String(page),\n },\n clickHandler: (e: Readonly<MouseEvent>) => pageClick(e, page),\n})\n\nconst getButtonProps = ({\n page,\n classVal,\n disabled,\n slotName,\n textValue,\n label,\n}: {\n page: number\n disabled: boolean\n classVal: ClassValue\n slotName: 'first-text' | 'prev-text' | 'next-text' | 'last-text' | 'page'\n textValue?: string\n label: string\n}) => getBaseButtonProps({page, classVal, disabled, slotName, textValue, label, tabIndex: '-1'})\n\nconst getPageButtonProps = (page: number, isSmHidden?: boolean) =>\n getBaseButtonProps({\n page,\n disabled: props.disabled,\n classVal: props.pageClass,\n slotName: 'page',\n label: props.labelPage ? `${props.labelPage} ${page}` : undefined,\n tabIndex: getTabIndex(page) ?? undefined,\n position: page,\n isActive: isActivePage(page),\n isSmHidden,\n })\n\nconst firstButtonProps = computed(() =>\n getButtonProps({\n page: 1,\n disabled: firstDisabled.value,\n classVal: props.firstClass,\n slotName: 'first-text',\n textValue: props.firstText,\n label: props.labelFirstPage,\n })\n)\nconst prevButtonProps = computed(() =>\n getButtonProps({\n page: Math.max(computedModelValue.value - 1, 1),\n disabled: prevDisabled.value,\n classVal: props.prevClass,\n slotName: 'prev-text',\n textValue: props.prevText,\n label: props.labelPrevPage,\n })\n)\nconst nextButtonProps = computed(() =>\n getButtonProps({\n page: Math.min(computedModelValue.value + 1, numberOfPages.value),\n disabled: nextDisabled.value,\n classVal: props.nextClass,\n slotName: 'next-text',\n textValue: props.nextText,\n label: props.labelNextPage,\n })\n)\nconst lastButtonProps = computed(() =>\n getButtonProps({\n page: numberOfPages.value,\n disabled: lastDisabled.value,\n classVal: props.lastClass,\n slotName: 'last-text',\n textValue: props.lastText,\n label: props.labelLastPage,\n })\n)\n\nconst ellipsisProps = computed(() => ({\n li: {\n class: [\n 'page-item',\n 'disabled',\n 'text-center',\n 'bv-d-sm-down-none',\n computedFill.value ? 'flex-fill' : '',\n props.ellipsisClass,\n ],\n role: 'separator',\n },\n span: {\n class: ['page-link'],\n },\n}))\n\nconst computedWrapperClasses = computed(() => [\n alignment.value,\n {\n [`pagination-${props.size}`]: props.size !== undefined,\n 'b-pagination-pills': props.pills,\n },\n])\n\nconst pagination = computed(() => ({\n pageSize: perPageSanitized.value,\n totalRows: totalRowsNumber.value,\n numberOfPages: numberOfPages.value,\n}))\n\nconst pageClick = (event: Readonly<MouseEvent>, pageNumber: number) => {\n if (pageNumber === computedModelValue.value) return\n const clickEvent = new BvEvent('page-click', {\n cancelable: true,\n target: event.target,\n })\n emit('page-click', clickEvent, pageNumber)\n\n if (clickEvent.defaultPrevented) return\n\n modelValue.value = pageNumber\n\n nextTick(() => {\n if (pageNumber === 1) {\n focusFirst()\n } else if (pageNumber === pagination.value.numberOfPages) {\n focusLast()\n }\n })\n // nextTick(() => {\n // if (isVisible(target) && un_element.contains(target)) {\n // attemptFocus(target)\n //} else {\n //this.focusCurrent()\n //}\n // })\n}\n\nconst isDisabled = (el: HTMLButtonElement) => {\n const isElement = el && el.nodeType === Node.ELEMENT_NODE\n const hasAttr = isElement ? el.hasAttribute('disabled') : null\n const hasClass = isElement && el.classList ? el.classList.contains('disabled') : false\n\n return !isElement || el.disabled || hasAttr || hasClass\n}\n\nconst getButtons = (): HTMLButtonElement[] =>\n [...(pageElements.value ?? [])]\n .sort(\n (a, b) =>\n Number.parseInt(a.getAttribute(dataDisplayNameCustomAttribute) || '0') -\n Number.parseInt(b.getAttribute(dataDisplayNameCustomAttribute) || '0')\n )\n .map((page) => page.children[0])\n .filter((el) => {\n if (el?.getAttribute('display') === 'none' || el?.tagName.toUpperCase() !== 'BUTTON') {\n return false\n }\n\n const bcr = el?.getBoundingClientRect()\n\n return !!(bcr && bcr.height > 0 && bcr.width > 0)\n })\n .map((el) => el as HTMLButtonElement)\n\nconst focusFirst = () => {\n nextTick(() => {\n const btn = getButtons().find((el) => !isDisabled(el))\n btn?.focus()\n })\n}\n\nconst focusPrev = () => {\n nextTick(() => {\n const buttons = getButtons()\n const index = buttons.indexOf(getActiveElement() as HTMLButtonElement)\n\n const button = buttons[index - 1]\n if (index > 0 && button !== undefined && !isDisabled(button)) {\n buttons[index - 1]?.focus()\n }\n })\n}\n\nconst focusLast = () => {\n nextTick(() => {\n const btn = getButtons()\n .reverse()\n .find((el) => !isDisabled(el))\n btn?.focus()\n })\n}\n\nconst focusNext = () => {\n nextTick(() => {\n const buttons = getButtons()\n const index = buttons.indexOf(getActiveElement() as HTMLButtonElement)\n const button = buttons[index + 1]\n if (index < buttons.length - 1 && button !== undefined && !isDisabled(button)) {\n buttons[index + 1]?.focus()\n }\n })\n}\n\nconst handleKeyNav = (event: KeyboardEvent) => {\n const {code, shiftKey} = event\n if (code === CODE_LEFT || code === CODE_UP) {\n event.preventDefault()\n if (shiftKey) {\n focusFirst()\n } else {\n focusPrev()\n }\n } else if (code === CODE_RIGHT || code === CODE_DOWN) {\n event.preventDefault()\n if (shiftKey) {\n focusLast()\n } else {\n focusNext()\n }\n }\n}\n\nconst computedModelValue = computed(() => {\n const page = modelValueNumber.value || 1\n return page > numberOfPages.value ? numberOfPages.value : page < 1 ? 1 : page\n})\n\nwatch(pagination, (oldValue, newValue) => {\n if (newValue.pageSize !== oldValue.pageSize && newValue.totalRows === oldValue.totalRows) {\n // If the page size changes, reset to page 1\n modelValue.value = 1\n }\n})\n\nconst noFirstButton = computed(() => (props.noGotoEndButtons && !props.firstNumber ? 1 : 0))\nconst noLastButton = computed(() => (props.noGotoEndButtons && !props.lastNumber ? 1 : 0))\nconst showFirstButton = computed(() => (noFirstButton.value ? 0 : 1))\nconst showLastButton = computed(() => (noLastButton.value ? 0 : 1))\nconst firstPage = computed(() => (props.firstNumber ? 1 : 0))\nconst lastPage = computed(() => (props.lastNumber ? 1 : 0))\nconst halfLimit = computed(() => Math.floor(limitNumber.value / 2))\n\nconst pages = computed(() => {\n const {value} = computedModelValue\n\n const els = elements.value.map((p) => {\n switch (p) {\n case FIRST_BUTTON:\n return {id: p, ...firstButtonProps.value}\n case PREV_BUTTON:\n return {id: p, ...prevButtonProps.value}\n case NEXT_BUTTON:\n return {id: p, ...nextButtonProps.value}\n case LAST_BUTTON:\n return {id: p, ...lastButtonProps.value}\n case FIRST_ELLIPSIS:\n case LAST_ELLIPSIS:\n return {id: p, ...ellipsisProps.value}\n default:\n return {id: p, ...getPageButtonProps(p)}\n }\n })\n\n if (numberOfPages.value > 3) {\n if (value > numberOfPages.value - halfLimit.value - lastPage.value) {\n const idx = 2 + showFirstButton.value\n const el = els[idx]\n if (el !== undefined) {\n els[idx] = {id: el.id, ...getPageButtonProps(el.id, true)}\n }\n }\n\n if (value <= halfLimit.value + firstPage.value) {\n const idx = els.length - (3 + showLastButton.value)\n const el = els[idx]\n if (el !== undefined) {\n els[idx] = {id: el.id, ...getPageButtonProps(el.id, true)}\n }\n }\n }\n\n return els\n})\n\nconst elements = computed(() => {\n // The idea here is to create an array of all the buttons on the page control.\n // This way we can keep the invariants in one place and the template code just\n // iterates over the array.\n\n const pages = numberOfPages.value\n const {value} = computedModelValue\n const limit = limitNumber.value\n const noEllipsis = props.noEllipsis || limit <= ELLIPSIS_THRESHOLD\n\n // The first case is when all the page buttons fit on the control, this is\n // the simplest case and the only one that will create an array smaller than\n // Limit + 4 - noEndButtons * 2 (the [first, last,] prev, next buttons)\n\n if (pages < limit + firstPage.value + lastPage.value) {\n return [\n !firstPage.value && !noFirstButton.value ? FIRST_BUTTON : null,\n PREV_BUTTON,\n ...Array.from({length: pages}, (_, index) => index + 1),\n NEXT_BUTTON,\n !lastPage.value && !noLastButton.value ? LAST_BUTTON : null,\n ].filter((x) => x !== null) as number[]\n }\n\n // All the remaining cases result in an array that is exactly limit + 4 - noEndButtons * 2 in length, so create\n // the array upfront and set up the beginning and end buttons, then fill the rest for each case\n\n const buttons = Array.from({length: limit + 4 - (noFirstButton.value + noLastButton.value)})\n if (!noFirstButton.value) {\n if (!firstPage.value) {\n buttons[0] = FIRST_BUTTON\n buttons[1] = PREV_BUTTON\n } else {\n buttons[0] = PREV_BUTTON\n buttons[1] = 1\n }\n } else {\n buttons[0] = PREV_BUTTON\n }\n\n if (!noLastButton.value) {\n if (!lastPage.value) {\n buttons[buttons.length - 1] = LAST_BUTTON\n buttons[buttons.length - 2] = NEXT_BUTTON\n } else {\n buttons[buttons.length - 1] = NEXT_BUTTON\n buttons[buttons.length - 2] = pages\n }\n } else {\n buttons[buttons.length - 1] = NEXT_BUTTON\n }\n\n // The next case is where the page buttons start at the beginning, with\n // no ellipsis at the beginning, but one at the end\n\n if (value <= halfLimit.value + firstPage.value) {\n for (let index = 1; index <= limit; index++) {\n buttons[index + 1 - noFirstButton.value] = index + firstPage.value\n }\n\n if (!noEllipsis) {\n buttons[buttons.length - (2 + showLastButton.value)] = LAST_ELLIPSIS\n }\n }\n\n // And then we have the case where the page buttons go up to the end, with no\n // ellipsis at the end, but one at the beginning\n\n if (value > pages - halfLimit.value - lastPage.value) {\n const start = pages - (limit - 1) - lastPage.value\n for (let index = 0; index < limit; index++) {\n buttons[index + 2 - noFirstButton.value] = start + index\n }\n\n if (!noEllipsis) {\n buttons[1 + showFirstButton.value] = FIRST_ELLIPSIS\n }\n }\n\n // Finally we have the case where we have ellipsis at both ends\n if (!buttons[2]) {\n // Is there a more elegant way to check that we're in the final case?\n const start = value - Math.floor(limit / 2)\n for (let index = 0; index < limit; index++) {\n buttons[index + 2 - noFirstButton.value] = start + index\n }\n\n if (!noEllipsis) {\n buttons[1 + showFirstButton.value] = FIRST_ELLIPSIS\n buttons[buttons.length - (2 + showLastButton.value)] = LAST_ELLIPSIS\n }\n }\n\n //Enable sanity check for debugging purposes\n // for (let i = 0; i < buttons.length; i++) {\n // if (!buttons[i]) {\n // // eslint-disable-next-line no-console\n // console.log(\n // `Failed: button == ${i}, limit=${limit}, pages=${pages}, firstPage=${firstPage}, lastPage=${lastPage}, value=${value}`\n // )\n // }\n // }\n\n return buttons.filter((x) => x !== null) as number[]\n})\n</script>\n\n<script lang=\"ts\">\nconst DEFAULT_PER_PAGE = 20\nconst DEFAULT_TOTAL_ROWS = 0\n</script>\n"],"mappings":";;;;;;;;;;;AA4kBA,IAAM,mBAAmB;AACzB,IAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAphB3B,MAAM,qBAAqB;EAE3B,MAAM,eAAe;EACrB,MAAM,cAAc;EACpB,MAAM,cAAc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kBAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,OADF,MAAK,CAAC,gBAAY,MAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAAA,GAAA,IAAA,YAMA,SAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,cAAA,GAAA,IAAA,yBADlB,KAAK,OAAO,GAAE,GAAA,GAAA,IAAA,YAcT;;;OAfF,KAAK,QAAM,EAGlB,SAAO,KAAK,cAAA,CAAA,EAAA;qCAWN,EAAA,GAAA,IAAA,YAAA,KAAA,QARE,KAAK,KAAK,MAAI;MACpB,UAAU,KAAK,KAAK;MACpB,MAAM,KAAK,KAAK;MAChB,OAAO,KAAK,KAAK;MACjB,QAAQ,KAAK,KAAK,UAAM;MACxB,SAAS,KAAK,KAAK;cAGf,EAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,iBADF,KAAK,KAAK,MAAK,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
require("./chunk-CoQrYLCe.js");
|
|
2
2
|
const require_dist = require("./dist-DiXKLh_W.js");
|
|
3
|
-
const require_useDefaults = require("./useDefaults-
|
|
3
|
+
const require_useDefaults = require("./useDefaults-C0CYry78.js");
|
|
4
4
|
const require_useColorVariantClasses = require("./useColorVariantClasses-Dq0sOYDL.js");
|
|
5
|
-
const require_BCard = require("./BCard-
|
|
6
|
-
const require_BTableSimple = require("./BTableSimple-
|
|
5
|
+
const require_BCard = require("./BCard-DwNYhVmg.js");
|
|
6
|
+
const require_BTableSimple = require("./BTableSimple-BkdGAAKb.js");
|
|
7
7
|
let vue = require("vue");
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/components/BPlaceholder/BPlaceholder.vue
|
|
@@ -323,4 +323,4 @@ Object.defineProperty(exports, "BPlaceholder_default", {
|
|
|
323
323
|
}
|
|
324
324
|
});
|
|
325
325
|
|
|
326
|
-
//# sourceMappingURL=BPlaceholder-
|
|
326
|
+
//# sourceMappingURL=BPlaceholder-B3rs_39w.js.map
|