@7pmlabs/design-system 1.0.10 → 1.0.11
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/README.md +57 -6
- package/dist/design-system.css +1 -1
- package/dist/design-system.js +66 -60
- package/dist/design-system100.js +4 -5
- package/dist/design-system100.js.map +1 -1
- package/dist/design-system101.js +53 -506
- package/dist/design-system101.js.map +1 -1
- package/dist/{design-system93.js → design-system102.js} +1 -1
- package/dist/design-system102.js.map +1 -0
- package/dist/design-system103.js +13 -5
- package/dist/design-system103.js.map +1 -1
- package/dist/design-system104.js +109 -7
- package/dist/design-system104.js.map +1 -1
- package/dist/design-system106.js +9 -0
- package/dist/design-system106.js.map +1 -0
- package/dist/design-system107.js +206 -6
- package/dist/design-system107.js.map +1 -1
- package/dist/design-system109.js +9 -0
- package/dist/design-system109.js.map +1 -0
- package/dist/design-system110.js +507 -6
- package/dist/design-system110.js.map +1 -1
- package/dist/design-system112.js +8 -0
- package/dist/design-system112.js.map +1 -0
- package/dist/design-system113.js +7 -5
- package/dist/design-system113.js.map +1 -1
- package/dist/design-system114.js +209 -9
- package/dist/design-system114.js.map +1 -1
- package/dist/design-system116.js +9 -0
- package/dist/design-system116.js.map +1 -0
- package/dist/design-system117.js +224 -6
- package/dist/design-system117.js.map +1 -1
- package/dist/design-system119.js +9 -0
- package/dist/design-system119.js.map +1 -0
- package/dist/design-system12.js.map +1 -1
- package/dist/design-system120.js +163 -5
- package/dist/design-system120.js.map +1 -1
- package/dist/design-system122.js +5 -90
- package/dist/design-system122.js.map +1 -1
- package/dist/design-system123.js +12 -0
- package/dist/design-system123.js.map +1 -0
- package/dist/design-system124.js +274 -5
- package/dist/design-system124.js.map +1 -1
- package/dist/design-system126.js +9 -0
- package/dist/design-system126.js.map +1 -0
- package/dist/design-system127.js +16 -5
- package/dist/design-system127.js.map +1 -1
- package/dist/design-system129.js +8 -0
- package/dist/design-system129.js.map +1 -0
- package/dist/design-system130.js +12 -5
- package/dist/design-system130.js.map +1 -1
- package/dist/design-system131.js +76 -137
- package/dist/design-system131.js.map +1 -1
- package/dist/design-system133.js +1 -1
- package/dist/design-system133.js.map +1 -1
- package/dist/design-system134.js +37 -90
- package/dist/design-system134.js.map +1 -1
- package/dist/design-system136.js +1 -1
- package/dist/design-system136.js.map +1 -1
- package/dist/design-system137.js +226 -20
- package/dist/design-system137.js.map +1 -1
- package/dist/design-system139.js +4 -5
- package/dist/design-system139.js.map +1 -1
- package/dist/design-system140.js +151 -9
- package/dist/design-system140.js.map +1 -1
- package/dist/design-system142.js +3 -2
- package/dist/design-system142.js.map +1 -1
- package/dist/design-system143.js +93 -19
- package/dist/design-system143.js.map +1 -1
- package/dist/design-system145.js +5 -158
- package/dist/design-system145.js.map +1 -1
- package/dist/design-system146.js +12 -0
- package/dist/design-system146.js.map +1 -0
- package/dist/design-system147.js +37 -5
- package/dist/design-system147.js.map +1 -1
- package/dist/design-system148.js +4 -307
- package/dist/design-system148.js.map +1 -1
- package/dist/design-system149.js +24 -0
- package/dist/{design-system144.js.map → design-system149.js.map} +1 -1
- package/dist/design-system150.js +2 -3
- package/dist/design-system150.js.map +1 -1
- package/dist/design-system151.js +131 -213
- package/dist/design-system151.js.map +1 -1
- package/dist/design-system153.js +1 -1
- package/dist/design-system153.js.map +1 -1
- package/dist/design-system154.js +278 -160
- package/dist/design-system154.js.map +1 -1
- package/dist/design-system156.js +1 -1
- package/dist/design-system156.js.map +1 -1
- package/dist/design-system157.js +240 -3
- package/dist/design-system157.js.map +1 -1
- package/dist/design-system159.js +8 -0
- package/dist/design-system159.js.map +1 -0
- package/dist/design-system16.js.map +1 -1
- package/dist/design-system160.js +189 -6
- package/dist/design-system160.js.map +1 -1
- package/dist/design-system162.js +8 -0
- package/dist/design-system162.js.map +1 -0
- package/dist/design-system163.js +3 -6
- package/dist/design-system163.js.map +1 -1
- package/dist/design-system164.js +46 -57
- package/dist/design-system164.js.map +1 -1
- package/dist/design-system166.js +2 -2
- package/dist/design-system166.js.map +1 -1
- package/dist/design-system167.js +44 -170
- package/dist/design-system167.js.map +1 -1
- package/dist/design-system169.js +2 -2
- package/dist/design-system169.js.map +1 -1
- package/dist/design-system170.js +55 -101
- package/dist/design-system170.js.map +1 -1
- package/dist/design-system172.js +5 -4
- package/dist/design-system172.js.map +1 -1
- package/dist/design-system173.js +182 -11
- package/dist/design-system173.js.map +1 -1
- package/dist/design-system175.js +9 -0
- package/dist/design-system175.js.map +1 -0
- package/dist/design-system176.js +115 -6
- package/dist/design-system176.js.map +1 -1
- package/dist/design-system178.js +8 -0
- package/dist/design-system178.js.map +1 -0
- package/dist/design-system179.js +11 -5
- package/dist/design-system179.js.map +1 -1
- package/dist/design-system180.js +444 -70
- package/dist/design-system180.js.map +1 -1
- package/dist/design-system182.js +5 -4
- package/dist/design-system182.js.map +1 -1
- package/dist/design-system183.js +21 -21
- package/dist/design-system183.js.map +1 -1
- package/dist/design-system185.js +1 -1
- package/dist/design-system185.js.map +1 -1
- package/dist/design-system186.js +85 -25
- package/dist/design-system186.js.map +1 -1
- package/dist/design-system188.js +1 -1
- package/dist/design-system188.js.map +1 -1
- package/dist/design-system189.js +7 -5
- package/dist/design-system189.js.map +1 -1
- package/dist/design-system19.js.map +1 -1
- package/dist/design-system191.js +1 -1
- package/dist/design-system191.js.map +1 -1
- package/dist/design-system192.js +20 -23
- package/dist/design-system192.js.map +1 -1
- package/dist/design-system194.js +1 -1
- package/dist/design-system194.js.map +1 -1
- package/dist/design-system195.js +24 -323
- package/dist/design-system195.js.map +1 -1
- package/dist/design-system197.js +1 -1
- package/dist/design-system197.js.map +1 -1
- package/dist/design-system198.js +19 -88
- package/dist/design-system198.js.map +1 -1
- package/dist/design-system200.js +1 -1
- package/dist/design-system200.js.map +1 -1
- package/dist/design-system201.js +330 -17
- package/dist/design-system201.js.map +1 -1
- package/dist/design-system203.js +5 -3
- package/dist/design-system203.js.map +1 -1
- package/dist/design-system204.js +88 -407
- package/dist/design-system204.js.map +1 -1
- package/dist/design-system206.js +1 -1
- package/dist/design-system206.js.map +1 -1
- package/dist/design-system207.js +17 -106
- package/dist/design-system207.js.map +1 -1
- package/dist/{design-system202.js → design-system208.js} +2 -2
- package/dist/{design-system202.js.map → design-system208.js.map} +1 -1
- package/dist/design-system209.js +3 -6
- package/dist/design-system209.js.map +1 -1
- package/dist/design-system210.js +403 -90
- package/dist/design-system210.js.map +1 -1
- package/dist/design-system212.js +4 -5
- package/dist/design-system212.js.map +1 -1
- package/dist/design-system213.js +45 -723
- package/dist/design-system213.js.map +1 -1
- package/dist/design-system215.js +1 -1
- package/dist/design-system215.js.map +1 -1
- package/dist/design-system216.js +88 -11
- package/dist/design-system216.js.map +1 -1
- package/dist/design-system217.js +4 -525
- package/dist/design-system217.js.map +1 -1
- package/dist/design-system218.js +111 -0
- package/dist/design-system218.js.map +1 -0
- package/dist/design-system22.js.map +1 -1
- package/dist/design-system220.js +6 -3
- package/dist/design-system220.js.map +1 -1
- package/dist/design-system221.js +103 -43
- package/dist/design-system221.js.map +1 -1
- package/dist/design-system223.js +6 -283
- package/dist/design-system223.js.map +1 -1
- package/dist/design-system224.js +740 -0
- package/dist/design-system224.js.map +1 -0
- package/dist/design-system226.js +5 -119
- package/dist/design-system226.js.map +1 -1
- package/dist/{design-system60.js → design-system227.js} +6 -8
- package/dist/design-system227.js.map +1 -0
- package/dist/design-system228.js +525 -5
- package/dist/design-system228.js.map +1 -1
- package/dist/{design-system219.js → design-system230.js} +2 -2
- package/dist/{design-system219.js.map → design-system230.js.map} +1 -1
- package/dist/design-system231.js +3 -5
- package/dist/design-system231.js.map +1 -1
- package/dist/design-system232.js +42 -50
- package/dist/design-system232.js.map +1 -1
- package/dist/design-system233.js +1 -1
- package/dist/design-system233.js.map +1 -1
- package/dist/design-system234.js +254 -141
- package/dist/design-system234.js.map +1 -1
- package/dist/design-system236.js +1 -1
- package/dist/design-system236.js.map +1 -1
- package/dist/design-system237.js +119 -7
- package/dist/design-system237.js.map +1 -1
- package/dist/design-system239.js +8 -0
- package/dist/design-system239.js.map +1 -0
- package/dist/design-system240.js +112 -5
- package/dist/design-system240.js.map +1 -1
- package/dist/design-system242.js +8 -0
- package/dist/design-system242.js.map +1 -0
- package/dist/design-system243.js +54 -6
- package/dist/design-system243.js.map +1 -1
- package/dist/design-system244.js +4 -7
- package/dist/design-system244.js.map +1 -1
- package/dist/design-system245.js +139 -343
- package/dist/design-system245.js.map +1 -1
- package/dist/design-system247.js +4 -5
- package/dist/design-system247.js.map +1 -1
- package/dist/design-system248.js +10 -0
- package/dist/design-system248.js.map +1 -0
- package/dist/{design-system238.js → design-system249.js} +2 -2
- package/dist/design-system249.js.map +1 -0
- package/dist/design-system25.js.map +1 -1
- package/dist/design-system251.js +8 -0
- package/dist/design-system251.js.map +1 -0
- package/dist/{design-system241.js → design-system252.js} +1 -1
- package/dist/design-system252.js.map +1 -0
- package/dist/design-system254.js +9 -0
- package/dist/design-system254.js.map +1 -0
- package/dist/design-system255.js +12 -0
- package/dist/design-system255.js.map +1 -0
- package/dist/design-system256.js +769 -0
- package/dist/design-system256.js.map +1 -0
- package/dist/design-system258.js +9 -0
- package/dist/design-system258.js.map +1 -0
- package/dist/design-system259.js +10 -0
- package/dist/design-system259.js.map +1 -0
- package/dist/design-system260.js +377 -0
- package/dist/design-system260.js.map +1 -0
- package/dist/design-system262.js +9 -0
- package/dist/design-system262.js.map +1 -0
- package/dist/design-system28.js.map +1 -1
- package/dist/design-system3.js.map +1 -1
- package/dist/design-system30.js +21 -138
- package/dist/design-system30.js.map +1 -1
- package/dist/design-system32.js +5 -4
- package/dist/design-system32.js.map +1 -1
- package/dist/design-system33.js +488 -14
- package/dist/design-system33.js.map +1 -1
- package/dist/design-system35.js +1 -1
- package/dist/design-system35.js.map +1 -1
- package/dist/design-system36.js +135 -17
- package/dist/design-system36.js.map +1 -1
- package/dist/design-system38.js +1 -1
- package/dist/design-system38.js.map +1 -1
- package/dist/design-system39.js +16 -11
- package/dist/design-system39.js.map +1 -1
- package/dist/design-system4.js.map +1 -1
- package/dist/design-system41.js +8 -0
- package/dist/design-system41.js.map +1 -0
- package/dist/design-system42.js +26 -5
- package/dist/design-system42.js.map +1 -1
- package/dist/design-system44.js +5 -71
- package/dist/design-system44.js.map +1 -1
- package/dist/design-system45.js +353 -0
- package/dist/design-system45.js.map +1 -0
- package/dist/design-system47.js +5 -50
- package/dist/design-system47.js.map +1 -1
- package/dist/design-system48.js +11 -4
- package/dist/design-system48.js.map +1 -1
- package/dist/design-system49.js +476 -3
- package/dist/design-system49.js.map +1 -1
- package/dist/design-system51.js +8 -0
- package/dist/design-system51.js.map +1 -0
- package/dist/design-system52.js +3 -5
- package/dist/design-system52.js.map +1 -1
- package/dist/design-system53.js +56 -83
- package/dist/design-system53.js.map +1 -1
- package/dist/design-system55.js +5 -4
- package/dist/design-system55.js.map +1 -1
- package/dist/design-system56.js +50 -11
- package/dist/design-system56.js.map +1 -1
- package/dist/design-system57.js +4 -591
- package/dist/design-system57.js.map +1 -1
- package/dist/design-system58.js +6 -0
- package/dist/design-system58.js.map +1 -0
- package/dist/design-system59.js +64 -5
- package/dist/design-system59.js.map +1 -1
- package/dist/design-system61.js +5 -696
- package/dist/design-system61.js.map +1 -1
- package/dist/design-system62.js +101 -0
- package/dist/design-system62.js.map +1 -0
- package/dist/design-system64.js +5 -158
- package/dist/design-system64.js.map +1 -1
- package/dist/design-system65.js +14 -0
- package/dist/design-system65.js.map +1 -0
- package/dist/design-system66.js +591 -5
- package/dist/design-system66.js.map +1 -1
- package/dist/design-system68.js +3 -2
- package/dist/design-system68.js.map +1 -1
- package/dist/design-system69.js +13 -49
- package/dist/design-system69.js.map +1 -1
- package/dist/design-system7.js.map +1 -1
- package/dist/design-system70.js +699 -0
- package/dist/{design-system63.js.map → design-system70.js.map} +1 -1
- package/dist/design-system72.js +5 -199
- package/dist/design-system72.js.map +1 -1
- package/dist/design-system73.js +161 -0
- package/dist/design-system73.js.map +1 -0
- package/dist/design-system75.js +5 -7
- package/dist/design-system75.js.map +1 -1
- package/dist/design-system76.js +25 -269
- package/dist/design-system76.js.map +1 -1
- package/dist/design-system77.js +7 -0
- package/dist/design-system77.js.map +1 -0
- package/dist/design-system78.js +49 -5
- package/dist/design-system78.js.map +1 -1
- package/dist/{design-system71.js → design-system80.js} +2 -2
- package/dist/{design-system71.js.map → design-system80.js.map} +1 -1
- package/dist/design-system81.js +199 -5
- package/dist/design-system81.js.map +1 -1
- package/dist/design-system83.js +5 -99
- package/dist/design-system83.js.map +1 -1
- package/dist/design-system84.js +10 -0
- package/dist/design-system84.js.map +1 -0
- package/dist/design-system85.js +273 -5
- package/dist/design-system85.js.map +1 -1
- package/dist/design-system87.js +8 -0
- package/dist/design-system87.js.map +1 -0
- package/dist/design-system88.js +57 -5
- package/dist/design-system88.js.map +1 -1
- package/dist/design-system90.js +8 -0
- package/dist/design-system90.js.map +1 -0
- package/dist/design-system91.js +11 -5
- package/dist/design-system91.js.map +1 -1
- package/dist/design-system92.js +98 -53
- package/dist/design-system92.js.map +1 -1
- package/dist/design-system94.js +5 -13
- package/dist/design-system94.js.map +1 -1
- package/dist/design-system95.js +61 -104
- package/dist/design-system95.js.map +1 -1
- package/dist/design-system97.js +4 -5
- package/dist/design-system97.js.map +1 -1
- package/dist/design-system98.js +80 -198
- package/dist/design-system98.js.map +1 -1
- package/dist/types/components/BCalendar/BCalendar.spec.d.ts +1 -0
- package/dist/types/components/BCalendar/BCalendar.vue.d.ts +114 -0
- package/dist/types/components/BCalendar/index.d.ts +2 -0
- package/dist/types/components/BCalendar/types.d.ts +54 -0
- package/dist/types/components/BCarousel/BCarousel.spec.d.ts +1 -0
- package/dist/types/components/BCarousel/BCarousel.vue.d.ts +133 -0
- package/dist/types/components/BCarousel/index.d.ts +2 -0
- package/dist/types/components/BCarousel/types.d.ts +15 -0
- package/dist/types/components/BPagination/BPagination.vue.d.ts +1 -1
- package/dist/types/components/BStatistic/BStatistic.spec.d.ts +1 -0
- package/dist/types/components/BStatistic/BStatistic.vue.d.ts +44 -0
- package/dist/types/components/BStatistic/BStatisticTimer.vue.d.ts +50 -0
- package/dist/types/components/BStatistic/index.d.ts +3 -0
- package/dist/types/components/BStatistic/types.d.ts +6 -0
- package/dist/types/components/BTreeSelect/BTreeSelect.spec.d.ts +1 -0
- package/dist/types/components/BTreeSelect/BTreeSelect.vue.d.ts +143 -0
- package/dist/types/components/BTreeSelect/index.d.ts +2 -0
- package/dist/types/components/BTreeSelect/types.d.ts +77 -0
- package/dist/types/components/index.d.ts +4 -0
- package/dist/types/types.d.ts +3 -0
- package/package.json +6 -3
- package/dist/design-system105.js +0 -212
- package/dist/design-system105.js.map +0 -1
- package/dist/design-system108.js +0 -227
- package/dist/design-system108.js.map +0 -1
- package/dist/design-system111.js +0 -166
- package/dist/design-system111.js.map +0 -1
- package/dist/design-system115.js +0 -277
- package/dist/design-system115.js.map +0 -1
- package/dist/design-system118.js +0 -19
- package/dist/design-system118.js.map +0 -1
- package/dist/design-system121.js +0 -15
- package/dist/design-system121.js.map +0 -1
- package/dist/design-system125.js +0 -45
- package/dist/design-system125.js.map +0 -1
- package/dist/design-system128.js +0 -236
- package/dist/design-system128.js.map +0 -1
- package/dist/design-system141.js +0 -40
- package/dist/design-system141.js.map +0 -1
- package/dist/design-system144.js +0 -7
- package/dist/design-system158.js +0 -61
- package/dist/design-system158.js.map +0 -1
- package/dist/design-system161.js +0 -59
- package/dist/design-system161.js.map +0 -1
- package/dist/design-system174.js +0 -465
- package/dist/design-system174.js.map +0 -1
- package/dist/design-system177.js +0 -38
- package/dist/design-system177.js.map +0 -1
- package/dist/design-system222.js +0 -7
- package/dist/design-system222.js.map +0 -1
- package/dist/design-system225.js +0 -8
- package/dist/design-system225.js.map +0 -1
- package/dist/design-system229.js +0 -115
- package/dist/design-system229.js.map +0 -1
- package/dist/design-system238.js.map +0 -1
- package/dist/design-system241.js.map +0 -1
- package/dist/design-system40.js +0 -479
- package/dist/design-system40.js.map +0 -1
- package/dist/design-system43.js +0 -6
- package/dist/design-system43.js.map +0 -1
- package/dist/design-system46.js +0 -9
- package/dist/design-system46.js.map +0 -1
- package/dist/design-system50.js +0 -67
- package/dist/design-system50.js.map +0 -1
- package/dist/design-system60.js.map +0 -1
- package/dist/design-system63.js +0 -8
- package/dist/design-system67.js +0 -32
- package/dist/design-system67.js.map +0 -1
- package/dist/design-system74.js +0 -8
- package/dist/design-system74.js.map +0 -1
- package/dist/design-system79.js +0 -60
- package/dist/design-system79.js.map +0 -1
- package/dist/design-system82.js +0 -14
- package/dist/design-system82.js.map +0 -1
- package/dist/design-system86.js +0 -69
- package/dist/design-system86.js.map +0 -1
- package/dist/design-system89.js +0 -91
- package/dist/design-system89.js.map +0 -1
- package/dist/design-system93.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"design-system153.js","names":[],"sources":["../src/components/BPopconfirm/BPopconfirm.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useComponentId } from '@/composables/useComponentId.ts';\nimport { BPopconfirmPlacement, BPopconfirmTrigger } from '@/types.ts';\nimport { computed, nextTick, onBeforeUnmount, onMounted, ref, useId, watch } from 'vue';\n\n// ─────────────────────────────────────────────\n// Props & emits\n// ─────────────────────────────────────────────\nconst {\n title,\n description,\n okText = 'Yes',\n cancelText = 'No',\n okType = 'primary',\n disabled = false,\n icon: _icon,\n showCancel = true,\n trigger = BPopconfirmTrigger.Click,\n placement = BPopconfirmPlacement.TopCenter,\n arrow = true,\n mouseEnterDelay = 100,\n mouseLeaveDelay = 100,\n destroyTooltipOnHide = false,\n zIndex = 1060,\n modelValue = undefined,\n} = defineProps<{\n /** The confirmation question or text shown in the popconfirm. Also accepts the `title` slot. */\n title?: string;\n /** Additional description below the title. Also accepts the `description` slot. */\n description?: string;\n /** Text of the confirm button. */\n okText?: string;\n /** Text of the cancel button. */\n cancelText?: string;\n /** Button type of the confirm button: 'primary' | 'default' | 'dashed' | 'text' | 'link'. */\n okType?: 'primary' | 'default' | 'dashed' | 'text' | 'link';\n /** Whether the popconfirm is disabled (clicking trigger does nothing). */\n disabled?: boolean;\n /** Custom icon slot name override. When not provided, a default warning icon is used. */\n icon?: string;\n /** Whether to show the cancel button. */\n showCancel?: boolean;\n /** The event that triggers the popconfirm to open. */\n trigger?: `${BPopconfirmTrigger}`;\n /** Placement of the popconfirm relative to the target element. */\n placement?: `${BPopconfirmPlacement}`;\n /** Whether the popconfirm has an arrow pointing to the target. */\n arrow?: boolean;\n /** Delay in ms before showing on mouseenter. */\n mouseEnterDelay?: number;\n /** Delay in ms before hiding on mouseleave. */\n mouseLeaveDelay?: number;\n /** Whether to destroy the popconfirm DOM when hidden. */\n destroyTooltipOnHide?: boolean;\n /** z-index of the popconfirm. */\n zIndex?: number;\n /** Controlled visibility - bind with `v-model`. */\n modelValue?: boolean;\n}>();\n\nconst emit = defineEmits<{\n /** Emitted when the confirm button is clicked. Receives a callback to close programmatically. */\n (e: 'confirm', event: MouseEvent): void;\n /** Emitted when the cancel button is clicked. Receives a callback to close programmatically. */\n (e: 'cancel', event: MouseEvent): void;\n /** Emitted when the popconfirm visibility changes. */\n (e: 'openChange', open: boolean): void;\n /** v-model support. */\n (e: 'update:modelValue', value: boolean): void;\n}>();\n\ndefineSlots<{\n /** The target element that triggers the popconfirm. */\n default?(): unknown;\n /** Overrides the `title` prop with custom content. */\n title?(): unknown;\n /** Overrides the `description` prop with custom content. */\n description?(): unknown;\n /** Overrides the default warning icon. */\n icon?(): unknown;\n /** Overrides the confirm button. */\n okButton?(): unknown;\n /** Overrides the cancel button. */\n cancelButton?(): unknown;\n}>();\n\n// ─────────────────────────────────────────────\n// Internal state\n// ─────────────────────────────────────────────\nconst { componentUID } = useComponentId();\nconst popconfirmId = useId();\nconst titleId = `${popconfirmId}-title`;\nconst descId = `${popconfirmId}-desc`;\n\nconst internalOpen = ref(false);\nconst isOpen = computed(() => (modelValue !== undefined ? modelValue : internalOpen.value));\n\nconst hasBeenOpened = ref(false);\nconst shouldRender = computed(() => {\n if (destroyTooltipOnHide) return isOpen.value;\n return hasBeenOpened.value || isOpen.value;\n});\n\nwatch(isOpen, (val) => {\n if (val) hasBeenOpened.value = true;\n});\n\n// ─────────────────────────────────────────────\n// Visibility control\n// ─────────────────────────────────────────────\nlet showTimer: ReturnType<typeof setTimeout> | null = null;\nlet hideTimer: ReturnType<typeof setTimeout> | null = null;\n\nfunction clearTimers() {\n if (showTimer) {\n clearTimeout(showTimer);\n showTimer = null;\n }\n if (hideTimer) {\n clearTimeout(hideTimer);\n hideTimer = null;\n }\n}\n\nfunction requestOpen(delay = 0) {\n if (disabled) return;\n clearTimers();\n if (isOpen.value) return;\n if (delay > 0) {\n showTimer = setTimeout(() => doOpen(), delay);\n } else {\n doOpen();\n }\n}\n\nfunction requestClose(delay = 0) {\n clearTimers();\n if (!isOpen.value) return;\n if (delay > 0) {\n hideTimer = setTimeout(() => doClose(), delay);\n } else {\n doClose();\n }\n}\n\nfunction doOpen() {\n popconfirmRef.value?.showPopover();\n}\n\nfunction doClose() {\n popconfirmRef.value?.hidePopover();\n}\n\nfunction setOpen(val: boolean) {\n if (modelValue !== undefined) {\n emit('update:modelValue', val);\n } else {\n internalOpen.value = val;\n }\n emit('openChange', val);\n}\n\n// ─────────────────────────────────────────────\n// Popover toggle event\n// ─────────────────────────────────────────────\nconst onPopoverToggle = ({ newState }: ToggleEvent) => {\n setOpen(newState === 'open');\n};\n\n// ─────────────────────────────────────────────\n// Refs\n// ─────────────────────────────────────────────\nconst popconfirmRef = ref<HTMLDivElement | null>(null);\nconst toggleRef = ref<HTMLDivElement | null>(null);\n\n// ─────────────────────────────────────────────\n// Focus management\n// ─────────────────────────────────────────────\nlet previouslyFocusedElement: HTMLElement | null = null;\n\nconst focusableSelector =\n 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex=\"-1\"])';\n\nfunction focusFirstButton() {\n nextTick(() => {\n if (!popconfirmRef.value) return;\n const first = popconfirmRef.value.querySelector<HTMLElement>(focusableSelector);\n if (first) {\n first.focus();\n } else {\n popconfirmRef.value.focus();\n }\n });\n}\n\nfunction trapFocus(event: KeyboardEvent) {\n if (event.key !== 'Tab' || !popconfirmRef.value) return;\n\n const focusable = Array.from(\n popconfirmRef.value.querySelectorAll<HTMLElement>(focusableSelector),\n );\n if (focusable.length === 0) {\n event.preventDefault();\n return;\n }\n\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n\n if (event.shiftKey) {\n if (document.activeElement === first) {\n event.preventDefault();\n last.focus();\n }\n } else {\n if (document.activeElement === last) {\n event.preventDefault();\n first.focus();\n }\n }\n}\n\nwatch(isOpen, (val) => {\n if (val) {\n previouslyFocusedElement = document.activeElement as HTMLElement | null;\n focusFirstButton();\n } else {\n if (previouslyFocusedElement) {\n nextTick(() => previouslyFocusedElement?.focus());\n }\n }\n});\n\n// ─────────────────────────────────────────────\n// Button handlers\n// ─────────────────────────────────────────────\nfunction onConfirm(event: MouseEvent) {\n emit('confirm', event);\n requestClose();\n}\n\nfunction onCancel(event: MouseEvent) {\n emit('cancel', event);\n requestClose();\n}\n\n// ─────────────────────────────────────────────\n// Event handlers\n// ─────────────────────────────────────────────\nfunction onClick() {\n if (disabled) return;\n if (isOpen.value) {\n requestClose();\n } else {\n requestOpen();\n }\n}\n\nfunction onMouseEnter() {\n requestOpen(mouseEnterDelay);\n}\n\nfunction onMouseLeave() {\n requestClose(mouseLeaveDelay);\n}\n\nfunction onFocusIn() {\n requestOpen();\n}\n\nfunction onFocusOut() {\n requestClose();\n}\n\nfunction onKeydown(event: KeyboardEvent) {\n if (event.key === 'Escape' && isOpen.value) {\n event.preventDefault();\n requestClose();\n }\n}\n\nfunction onPopconfirmKeydown(event: KeyboardEvent) {\n if (event.key === 'Escape') {\n event.preventDefault();\n requestClose();\n }\n trapFocus(event);\n}\n\n// ─────────────────────────────────────────────\n// Popconfirm hover (keep open when hovering content)\n// ─────────────────────────────────────────────\nfunction onPopconfirmMouseEnter() {\n if (trigger === BPopconfirmTrigger.Hover) {\n clearTimers();\n }\n}\n\nfunction onPopconfirmMouseLeave() {\n if (trigger === BPopconfirmTrigger.Hover) {\n requestClose(mouseLeaveDelay);\n }\n}\n\n// ─────────────────────────────────────────────\n// Event listener management\n// ─────────────────────────────────────────────\nfunction attachListeners() {\n const el = toggleRef.value;\n if (!el) return;\n\n el.addEventListener('keydown', onKeydown);\n\n switch (trigger) {\n case BPopconfirmTrigger.Click:\n el.addEventListener('click', onClick);\n break;\n case BPopconfirmTrigger.Focus:\n el.addEventListener('focusin', onFocusIn);\n el.addEventListener('focusout', onFocusOut);\n break;\n case BPopconfirmTrigger.Hover:\n default:\n el.addEventListener('mouseenter', onMouseEnter);\n el.addEventListener('mouseleave', onMouseLeave);\n el.addEventListener('focusin', onFocusIn);\n el.addEventListener('focusout', onFocusOut);\n break;\n }\n}\n\nfunction detachListeners() {\n const el = toggleRef.value;\n if (!el) return;\n\n el.removeEventListener('keydown', onKeydown);\n el.removeEventListener('click', onClick);\n el.removeEventListener('focusin', onFocusIn);\n el.removeEventListener('focusout', onFocusOut);\n el.removeEventListener('mouseenter', onMouseEnter);\n el.removeEventListener('mouseleave', onMouseLeave);\n}\n\nonMounted(() => {\n attachListeners();\n});\n\nonBeforeUnmount(() => {\n detachListeners();\n clearTimers();\n});\n\nwatch(\n () => trigger,\n () => {\n detachListeners();\n attachListeners();\n },\n);\n\n// Sync controlled v-model → popover state\nwatch(\n () => modelValue,\n (val) => {\n if (val === undefined) return;\n if (val) {\n popconfirmRef.value?.showPopover();\n } else {\n popconfirmRef.value?.hidePopover();\n }\n },\n);\n\n// ─────────────────────────────────────────────\n// Computed styles\n// ─────────────────────────────────────────────\nconst anchorName = computed(() => `--b-popconfirm-anchor-${componentUID.value}`);\n\nconst placementClass = computed(() => {\n const map: Record<string, string> = {\n [BPopconfirmPlacement.TopLeft]: 'top-left',\n [BPopconfirmPlacement.TopCenter]: 'top-center',\n [BPopconfirmPlacement.TopRight]: 'top-right',\n [BPopconfirmPlacement.RightTop]: 'right-top',\n [BPopconfirmPlacement.RightCenter]: 'right-center',\n [BPopconfirmPlacement.RightBottom]: 'right-bottom',\n [BPopconfirmPlacement.BottomRight]: 'bottom-right',\n [BPopconfirmPlacement.BottomCenter]: 'bottom-center',\n [BPopconfirmPlacement.BottomLeft]: 'bottom-left',\n [BPopconfirmPlacement.LeftBottom]: 'left-bottom',\n [BPopconfirmPlacement.LeftCenter]: 'left-center',\n [BPopconfirmPlacement.LeftTop]: 'left-top',\n };\n return map[placement] ?? 'top-center';\n});\n\nconst okButtonClass = computed(() => {\n const map: Record<string, string> = {\n primary: 'b-popconfirm__btn--primary',\n default: 'b-popconfirm__btn--default',\n dashed: 'b-popconfirm__btn--dashed',\n text: 'b-popconfirm__btn--text',\n link: 'b-popconfirm__btn--link',\n };\n return map[okType] ?? 'b-popconfirm__btn--primary';\n});\n\n// ─────────────────────────────────────────────\n// Public API\n// ─────────────────────────────────────────────\ndefineExpose({ open: doOpen, close: doClose });\n</script>\n\n<template>\n <div ref=\"toggleRef\" class=\"b-popconfirm__toggle\" :style=\"{ anchorName: anchorName }\">\n <slot />\n </div>\n\n <div\n ref=\"popconfirmRef\"\n popover=\"manual\"\n :class=\"[\n 'b-popconfirm__content',\n placementClass,\n { 'b-popconfirm__content--no-arrow': !arrow },\n ]\"\n :style=\"{ zIndex, positionAnchor: anchorName }\"\n role=\"dialog\"\n aria-modal=\"false\"\n :aria-labelledby=\"titleId\"\n :aria-describedby=\"description ? descId : undefined\"\n :id=\"popconfirmId\"\n tabindex=\"-1\"\n @toggle=\"onPopoverToggle\"\n @keydown=\"onPopconfirmKeydown\"\n @mouseenter=\"onPopconfirmMouseEnter\"\n @mouseleave=\"onPopconfirmMouseLeave\"\n >\n <template v-if=\"shouldRender || !destroyTooltipOnHide\">\n <div v-if=\"arrow\" class=\"b-popconfirm__arrow\" aria-hidden=\"true\" />\n <div class=\"b-popconfirm__inner\">\n <div class=\"b-popconfirm__message\">\n <span class=\"b-popconfirm__icon\" aria-hidden=\"true\">\n <slot name=\"icon\">\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n width=\"16\"\n height=\"16\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z\"\n />\n </svg>\n </slot>\n </span>\n <div class=\"b-popconfirm__text\">\n <div :id=\"titleId\" class=\"b-popconfirm__title\">\n <slot name=\"title\">{{ title }}</slot>\n </div>\n <div\n v-if=\"description || $slots.description\"\n :id=\"descId\"\n class=\"b-popconfirm__description\"\n >\n <slot name=\"description\">{{ description }}</slot>\n </div>\n </div>\n </div>\n <div class=\"b-popconfirm__buttons\" role=\"group\">\n <slot name=\"cancelButton\">\n <button\n v-if=\"showCancel\"\n type=\"button\"\n class=\"b-popconfirm__btn b-popconfirm__btn--default\"\n @click=\"onCancel\"\n >\n {{ cancelText }}\n </button>\n </slot>\n <slot name=\"okButton\">\n <button type=\"button\" :class=\"['b-popconfirm__btn', okButtonClass]\" @click=\"onConfirm\">\n {{ okText }}\n </button>\n </slot>\n </div>\n </div>\n </template>\n </div>\n</template>\n\n<style>\n/* ────────────────────────────────────────────\n CSS Custom Properties (tokens)\n ──────────────────────────────────────────── */\n:root {\n --b-popconfirm-bg: #fff;\n --b-popconfirm-color: oklch(25% 0 0);\n --b-popconfirm-font-size: 0.875rem;\n --b-popconfirm-line-height: 1.5;\n --b-popconfirm-padding-x: 0.75rem;\n --b-popconfirm-padding-y: 0.75rem;\n --b-popconfirm-border-radius: 0.5rem;\n --b-popconfirm-max-width: 320px;\n --b-popconfirm-arrow-size: 8px;\n --b-popconfirm-arrow-color: #fff;\n --b-popconfirm-gap: 8px;\n --b-popconfirm-transition-duration: 200ms;\n --b-popconfirm-shadow:\n 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 9px 28px 8px rgba(0, 0, 0, 0.05);\n --b-popconfirm-icon-color: oklch(75% 0.15 85);\n --b-popconfirm-title-font-weight: 600;\n --b-popconfirm-description-color: oklch(45% 0 0);\n --b-popconfirm-btn-font-size: 0.8125rem;\n --b-popconfirm-btn-padding-x: 0.5rem;\n --b-popconfirm-btn-padding-y: 0.125rem;\n --b-popconfirm-btn-border-radius: 0.25rem;\n --b-popconfirm-btn-primary-bg: oklch(55% 0.2 260);\n --b-popconfirm-btn-primary-color: #fff;\n --b-popconfirm-btn-default-bg: transparent;\n --b-popconfirm-btn-default-color: oklch(25% 0 0);\n --b-popconfirm-btn-default-border: oklch(80% 0 0);\n}\n\n/* ── Dark mode ── */\n[data-prefers-color='dark'] {\n --b-popconfirm-bg: oklch(22% 0 0);\n --b-popconfirm-color: oklch(90% 0 0);\n --b-popconfirm-arrow-color: oklch(22% 0 0);\n --b-popconfirm-shadow:\n 0 6px 16px 0 rgba(0, 0, 0, 0.24), 0 3px 6px -4px rgba(0, 0, 0, 0.36),\n 0 9px 28px 8px rgba(0, 0, 0, 0.2);\n --b-popconfirm-icon-color: oklch(80% 0.15 85);\n --b-popconfirm-description-color: oklch(65% 0 0);\n --b-popconfirm-btn-primary-bg: oklch(55% 0.2 260);\n --b-popconfirm-btn-default-color: oklch(90% 0 0);\n --b-popconfirm-btn-default-border: oklch(40% 0 0);\n}\n\n@media (prefers-color-scheme: dark) {\n [data-prefers-color='system'] {\n --b-popconfirm-bg: oklch(22% 0 0);\n --b-popconfirm-color: oklch(90% 0 0);\n --b-popconfirm-arrow-color: oklch(22% 0 0);\n --b-popconfirm-shadow:\n 0 6px 16px 0 rgba(0, 0, 0, 0.24), 0 3px 6px -4px rgba(0, 0, 0, 0.36),\n 0 9px 28px 8px rgba(0, 0, 0, 0.2);\n --b-popconfirm-icon-color: oklch(80% 0.15 85);\n --b-popconfirm-description-color: oklch(65% 0 0);\n --b-popconfirm-btn-primary-bg: oklch(55% 0.2 260);\n --b-popconfirm-btn-default-color: oklch(90% 0 0);\n --b-popconfirm-btn-default-border: oklch(40% 0 0);\n }\n}\n\n/* ─────────────────────────────────────────────\n Toggle wrapper\n ───────────────────────────────────────────── */\n.b-popconfirm__toggle {\n display: inline-block;\n}\n\n/* ─────────────────────────────────────────────\n Popconfirm content (popover)\n ───────────────────────────────────────────── */\n.b-popconfirm__content {\n /* Reset popover defaults */\n position: absolute;\n border: none;\n padding: 0;\n margin: 0;\n background: transparent;\n overflow: visible;\n max-width: var(--b-popconfirm-max-width);\n box-sizing: border-box;\n pointer-events: auto;\n\n /* Animation and visibility */\n transition:\n display var(--b-popconfirm-transition-duration),\n opacity var(--b-popconfirm-transition-duration);\n transition-behavior: allow-discrete;\n opacity: 0;\n\n &:popover-open {\n opacity: 1;\n\n @starting-style {\n opacity: 0;\n }\n }\n\n /* ── Placement: Top ── */\n &.top-left {\n inset: auto;\n bottom: anchor(top);\n left: anchor(left);\n margin-bottom: var(--b-popconfirm-gap);\n }\n &.top-center {\n inset: auto;\n bottom: anchor(top);\n justify-self: anchor-center;\n margin-bottom: var(--b-popconfirm-gap);\n }\n &.top-right {\n inset: auto;\n bottom: anchor(top);\n right: anchor(right);\n margin-bottom: var(--b-popconfirm-gap);\n }\n\n /* ── Placement: Right ── */\n &.right-top {\n inset: auto;\n top: anchor(top);\n left: anchor(right);\n margin-left: var(--b-popconfirm-gap);\n }\n &.right-center {\n inset: auto;\n align-self: anchor-center;\n left: anchor(right);\n margin-left: var(--b-popconfirm-gap);\n }\n &.right-bottom {\n inset: auto;\n bottom: anchor(bottom);\n left: anchor(right);\n margin-left: var(--b-popconfirm-gap);\n }\n\n /* ── Placement: Bottom ── */\n &.bottom-right {\n inset: auto;\n top: anchor(bottom);\n right: anchor(right);\n margin-top: var(--b-popconfirm-gap);\n }\n &.bottom-center {\n inset: auto;\n top: anchor(bottom);\n justify-self: anchor-center;\n margin-top: var(--b-popconfirm-gap);\n }\n &.bottom-left {\n inset: auto;\n top: anchor(bottom);\n left: anchor(left);\n margin-top: var(--b-popconfirm-gap);\n }\n\n /* ── Placement: Left ── */\n &.left-bottom {\n inset: auto;\n bottom: anchor(bottom);\n right: anchor(left);\n margin-right: var(--b-popconfirm-gap);\n }\n &.left-center {\n inset: auto;\n align-self: anchor-center;\n right: anchor(left);\n margin-right: var(--b-popconfirm-gap);\n }\n &.left-top {\n inset: auto;\n top: anchor(top);\n right: anchor(left);\n margin-right: var(--b-popconfirm-gap);\n }\n}\n\n/* ─────────────────────────────────────────────\n Inner content\n ───────────────────────────────────────────── */\n.b-popconfirm__inner {\n background: var(--b-popconfirm-bg);\n color: var(--b-popconfirm-color);\n font-size: var(--b-popconfirm-font-size);\n line-height: var(--b-popconfirm-line-height);\n padding: var(--b-popconfirm-padding-y) var(--b-popconfirm-padding-x);\n border-radius: var(--b-popconfirm-border-radius);\n box-shadow: var(--b-popconfirm-shadow);\n word-wrap: break-word;\n}\n\n/* ─────────────────────────────────────────────\n Message row (icon + text)\n ───────────────────────────────────────────── */\n.b-popconfirm__message {\n display: flex;\n align-items: flex-start;\n gap: 0.5rem;\n margin-bottom: 0.5rem;\n}\n\n.b-popconfirm__icon {\n flex-shrink: 0;\n color: var(--b-popconfirm-icon-color);\n line-height: 1;\n margin-top: 0.125rem;\n}\n\n.b-popconfirm__text {\n flex: 1;\n min-width: 0;\n}\n\n.b-popconfirm__title {\n font-weight: var(--b-popconfirm-title-font-weight);\n}\n\n.b-popconfirm__description {\n color: var(--b-popconfirm-description-color);\n margin-top: 0.25rem;\n font-size: 0.8125rem;\n}\n\n/* ─────────────────────────────────────────────\n Buttons\n ───────────────────────────────────────────── */\n.b-popconfirm__buttons {\n display: flex;\n justify-content: flex-end;\n gap: 0.5rem;\n}\n\n.b-popconfirm__btn {\n cursor: pointer;\n font-size: var(--b-popconfirm-btn-font-size);\n line-height: 1.5;\n padding: var(--b-popconfirm-btn-padding-y) var(--b-popconfirm-btn-padding-x);\n border-radius: var(--b-popconfirm-btn-border-radius);\n border: 1px solid transparent;\n font-family: inherit;\n transition: opacity 150ms;\n\n &:hover {\n opacity: 0.85;\n }\n\n &:focus-visible {\n outline: 2px solid oklch(55% 0.2 260);\n outline-offset: 1px;\n }\n}\n\n.b-popconfirm__btn--primary {\n background: var(--b-popconfirm-btn-primary-bg);\n color: var(--b-popconfirm-btn-primary-color);\n}\n\n.b-popconfirm__btn--default {\n background: var(--b-popconfirm-btn-default-bg);\n color: var(--b-popconfirm-btn-default-color);\n border-color: var(--b-popconfirm-btn-default-border);\n}\n\n.b-popconfirm__btn--dashed {\n background: var(--b-popconfirm-btn-default-bg);\n color: var(--b-popconfirm-btn-default-color);\n border-color: var(--b-popconfirm-btn-default-border);\n border-style: dashed;\n}\n\n.b-popconfirm__btn--text {\n background: transparent;\n color: var(--b-popconfirm-btn-default-color);\n border: none;\n}\n\n.b-popconfirm__btn--link {\n background: transparent;\n color: var(--b-popconfirm-btn-primary-bg);\n border: none;\n text-decoration: underline;\n}\n\n/* ─────────────────────────────────────────────\n Arrow\n ───────────────────────────────────────────── */\n.b-popconfirm__arrow {\n position: absolute;\n width: var(--b-popconfirm-arrow-size);\n height: var(--b-popconfirm-arrow-size);\n background: var(--b-popconfirm-arrow-color);\n transform: rotate(45deg);\n pointer-events: none;\n}\n\n/* Arrow positioning for top placements */\n.b-popconfirm__content.top-left .b-popconfirm__arrow,\n.b-popconfirm__content.top-center .b-popconfirm__arrow,\n.b-popconfirm__content.top-right .b-popconfirm__arrow {\n bottom: calc(var(--b-popconfirm-arrow-size) / -2);\n left: 50%;\n margin-left: calc(var(--b-popconfirm-arrow-size) / -2);\n}\n\n/* Arrow positioning for bottom placements */\n.b-popconfirm__content.bottom-left .b-popconfirm__arrow,\n.b-popconfirm__content.bottom-center .b-popconfirm__arrow,\n.b-popconfirm__content.bottom-right .b-popconfirm__arrow {\n top: calc(var(--b-popconfirm-arrow-size) / -2);\n left: 50%;\n margin-left: calc(var(--b-popconfirm-arrow-size) / -2);\n}\n\n/* Arrow positioning for right placements */\n.b-popconfirm__content.right-top .b-popconfirm__arrow,\n.b-popconfirm__content.right-center .b-popconfirm__arrow,\n.b-popconfirm__content.right-bottom .b-popconfirm__arrow {\n left: calc(var(--b-popconfirm-arrow-size) / -2);\n top: 50%;\n margin-top: calc(var(--b-popconfirm-arrow-size) / -2);\n}\n\n/* Arrow positioning for left placements */\n.b-popconfirm__content.left-top .b-popconfirm__arrow,\n.b-popconfirm__content.left-center .b-popconfirm__arrow,\n.b-popconfirm__content.left-bottom .b-popconfirm__arrow {\n right: calc(var(--b-popconfirm-arrow-size) / -2);\n top: 50%;\n margin-top: calc(var(--b-popconfirm-arrow-size) / -2);\n}\n\n/* ─────────────────────────────────────────────\n Position fallbacks (auto-adjust overflow)\n ───────────────────────────────────────────── */\n@position-try --b-popconfirm-top-center {\n inset: auto;\n bottom: anchor(top);\n justify-self: anchor-center;\n margin-bottom: var(--b-popconfirm-gap);\n}\n\n@position-try --b-popconfirm-bottom-center {\n inset: auto;\n top: anchor(bottom);\n justify-self: anchor-center;\n margin-top: var(--b-popconfirm-gap);\n}\n\n@position-try --b-popconfirm-right-center {\n inset: auto;\n align-self: anchor-center;\n left: anchor(right);\n margin-left: var(--b-popconfirm-gap);\n}\n\n@position-try --b-popconfirm-left-center {\n inset: auto;\n align-self: anchor-center;\n right: anchor(left);\n margin-right: var(--b-popconfirm-gap);\n}\n\n/* ── Reduced motion ── */\n@media (prefers-reduced-motion: reduce) {\n .b-popconfirm__content {\n transition-duration: 0ms;\n }\n\n .b-popconfirm__btn {\n transition-duration: 0ms;\n }\n}\n</style>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"design-system153.js","names":[],"sources":["../src/components/BNotification/BNotification.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { BNotificationPlacement, BNotificationType } from '@/types.ts';\nimport { computed, nextTick, onUnmounted, ref, useId, watch } from 'vue';\n\n// ─────────────────────────────────────────────\n// Props & emits\n// ─────────────────────────────────────────────\nconst {\n type = undefined,\n message = '',\n description = '',\n placement = BNotificationPlacement.TopRight,\n duration = 4.5,\n closable = true,\n showIcon = true,\n icon,\n closeIcon,\n btn,\n modelValue = undefined,\n} = defineProps<{\n /**\n * Notification type - controls the icon and colour scheme.\n * When omitted no type-colour is applied (plain notification).\n */\n type?: `${BNotificationType}`;\n /** Short title / heading of the notification. */\n message?: string;\n /** Optional detailed description below the title. */\n description?: string;\n /**\n * Placement of the notification on the viewport.\n * @default 'top-right'\n */\n placement?: `${BNotificationPlacement}`;\n /**\n * Auto-close delay in seconds. Set to `0` to disable auto-close.\n * @default 4.5\n */\n duration?: number;\n /** Show the close button. @default true */\n closable?: boolean;\n /** Show the built-in status icon when `type` is set. @default true */\n showIcon?: boolean;\n /**\n * Custom icon content - overrides the built-in type icon.\n * Also accepts the `icon` slot.\n */\n icon?: string;\n /**\n * Custom close-icon content.\n * Also accepts the `closeIcon` slot.\n */\n closeIcon?: string;\n /**\n * Custom action button area content.\n * Also accepts the `btn` slot.\n */\n btn?: string;\n /**\n * Controlled visibility - when provided the component operates in\n * controlled mode; otherwise it manages its own visibility.\n * Bind with `v-model`.\n */\n modelValue?: boolean;\n}>();\n\nconst emit = defineEmits<{\n /** Fired synchronously when the notification starts closing. */\n (e: 'close'): void;\n /** Fired after the leave-transition fully completes. */\n (e: 'afterClose'): void;\n /** v-model support */\n (e: 'update:modelValue', value: boolean): void;\n}>();\n\ndefineSlots<{\n /** Overrides the `message` prop - the notification title. */\n message?(): unknown;\n /** Overrides the `description` prop. */\n description?(): unknown;\n /** Overrides the built-in status icon. */\n icon?(): unknown;\n /** Overrides the default close icon. */\n closeIcon?(): unknown;\n /** Action button area rendered below the description. */\n btn?(): unknown;\n}>();\n\n// ─────────────────────────────────────────────\n// Internal state\n// ─────────────────────────────────────────────\nconst notificationId = useId();\nconst titleId = `${notificationId}-title`;\nconst descId = `${notificationId}-desc`;\n\n/** Uncontrolled visibility flag - default closed. */\nconst internalVisible = ref(false);\n\n/** Ref to the notification DOM element for focus return. */\nconst notificationRef = ref<HTMLElement | null>(null);\n\n/** Element that had focus before the notification appeared. */\nconst previousFocusRef = ref<HTMLElement | null>(null);\n\n/**\n * Effective visibility:\n * - controlled → honour `modelValue`\n * - uncontrolled → use `internalVisible`\n */\nconst isVisible = computed(() => (modelValue !== undefined ? modelValue : internalVisible.value));\n\nconst isControlled = computed(() => modelValue !== undefined);\n\n// ─────────────────────────────────────────────\n// Derived state\n// ─────────────────────────────────────────────\n/** ARIA role: 'alert' for error/warning (assertive), 'status' for others. */\nconst ariaRole = computed<'alert' | 'status'>(() =>\n type === BNotificationType.Error || type === BNotificationType.Warning ? 'alert' : 'status',\n);\n\n/** aria-live polarity mirrors the role. */\nconst ariaLive = computed(() => (ariaRole.value === 'alert' ? 'assertive' : 'polite'));\n\n/** Whether to show the icon area (needs type and showIcon). */\nconst showIconArea = computed(() => Boolean(type && showIcon) || Boolean(icon) || false);\n\n/** Whether the description is provided via prop or slot. */\nconst hasDescription = computed(() => Boolean(description));\n\n/** Built-in SVG path for the status icon. */\nconst iconPath = computed(() => {\n switch (type) {\n case BNotificationType.Success:\n return 'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 14.5-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z';\n case BNotificationType.Warning:\n return 'M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z';\n case BNotificationType.Error:\n return 'M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z';\n default:\n // info (also fallback)\n return 'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z';\n }\n});\n\n// Close icon SVG path (× mark)\nconst closeIconPath =\n 'M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z';\n\n// ─────────────────────────────────────────────\n// Auto-close timer\n// ─────────────────────────────────────────────\nlet timer: ReturnType<typeof setTimeout> | null = null;\n\nfunction startTimer() {\n clearTimer();\n if (duration > 0) {\n timer = setTimeout(() => {\n close();\n }, duration * 1000);\n }\n}\n\nfunction clearTimer() {\n if (timer !== null) {\n clearTimeout(timer);\n timer = null;\n }\n}\n\n// ─────────────────────────────────────────────\n// Behaviour\n// ─────────────────────────────────────────────\nfunction open() {\n if (isControlled.value) {\n emit('update:modelValue', true);\n } else {\n internalVisible.value = true;\n }\n}\n\nfunction close() {\n emit('close');\n if (isControlled.value) {\n emit('update:modelValue', false);\n } else {\n internalVisible.value = false;\n }\n}\n\nfunction onAfterLeave() {\n // Return focus to the previously-focused element\n if (previousFocusRef.value && document.contains(previousFocusRef.value)) {\n previousFocusRef.value.focus();\n previousFocusRef.value = null;\n }\n emit('afterClose');\n}\n\nfunction onMouseEnter() {\n clearTimer();\n}\n\nfunction onMouseLeave() {\n startTimer();\n}\n\nfunction onKeydown(event: KeyboardEvent) {\n if (event.key === 'Escape' && closable) {\n event.stopPropagation();\n close();\n }\n}\n\n// ─────────────────────────────────────────────\n// Visibility watcher - manage timer + focus\n// ─────────────────────────────────────────────\nwatch(\n isVisible,\n async (visible) => {\n if (visible) {\n // Capture current focus for return-on-close\n previousFocusRef.value = document.activeElement as HTMLElement | null;\n startTimer();\n // Focus the close button (if closable) once the DOM updates\n if (closable) {\n await nextTick();\n const closeBtn =\n notificationRef.value?.querySelector<HTMLElement>('.b-notification__close');\n closeBtn?.focus();\n }\n } else {\n clearTimer();\n }\n },\n { immediate: true },\n);\n\n// ─────────────────────────────────────────────\n// Lifecycle\n// ─────────────────────────────────────────────\nonUnmounted(() => {\n clearTimer();\n});\n\n// Expose open & close for imperative usage\ndefineExpose({ open, close });\n</script>\n\n<template>\n <Teleport to=\"body\">\n <Transition name=\"b-notification-fade\" @after-leave=\"onAfterLeave\">\n <div\n v-if=\"isVisible\"\n :id=\"notificationId\"\n ref=\"notificationRef\"\n class=\"b-notification\"\n :class=\"[\n placement && `b-notification--${placement}`,\n type && `b-notification--${type}`,\n {\n 'b-notification--with-icon': showIconArea,\n 'b-notification--with-description': hasDescription,\n },\n ]\"\n :role=\"ariaRole\"\n :aria-live=\"ariaLive\"\n :aria-atomic=\"true\"\n :aria-labelledby=\"titleId\"\n :aria-describedby=\"hasDescription ? descId : undefined\"\n @mouseenter=\"onMouseEnter\"\n @mouseleave=\"onMouseLeave\"\n @keydown=\"onKeydown\"\n >\n <!-- Icon area -->\n <span v-if=\"showIconArea\" class=\"b-notification__icon\" aria-hidden=\"true\">\n <slot name=\"icon\">\n <!-- Custom icon prop as raw HTML (consumer's responsibility) -->\n <span v-if=\"icon\" v-html=\"icon\" />\n <!-- Built-in type icon -->\n <svg\n v-else-if=\"type\"\n class=\"b-notification__icon-svg\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n focusable=\"false\"\n aria-hidden=\"true\"\n >\n <path :d=\"iconPath\" />\n </svg>\n </slot>\n </span>\n\n <!-- Body -->\n <div class=\"b-notification__body\">\n <!-- Title -->\n <div :id=\"titleId\" class=\"b-notification__message\">\n <slot name=\"message\">{{ message }}</slot>\n </div>\n\n <!-- Description -->\n <div\n v-if=\"hasDescription || $slots.description\"\n :id=\"descId\"\n class=\"b-notification__description\"\n >\n <slot name=\"description\">{{ description }}</slot>\n </div>\n\n <!-- Action button area -->\n <div v-if=\"btn || $slots.btn\" class=\"b-notification__btn\">\n <slot name=\"btn\">{{ btn }}</slot>\n </div>\n </div>\n\n <!-- Close button -->\n <button\n v-if=\"closable\"\n type=\"button\"\n class=\"b-notification__close\"\n aria-label=\"Close notification\"\n @click=\"close\"\n >\n <slot name=\"closeIcon\">\n <span v-if=\"closeIcon\" v-html=\"closeIcon\" />\n <svg\n v-else\n class=\"b-notification__close-svg\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n focusable=\"false\"\n aria-hidden=\"true\"\n >\n <path :d=\"closeIconPath\" />\n </svg>\n </slot>\n </button>\n </div>\n </Transition>\n </Teleport>\n</template>\n\n<style>\n/* ────────────────────────────────────────────\n CSS Custom Properties (tokens)\n ──────────────────────────────────────────── */\n.b-notification {\n /* Layout */\n --b-notification-width: 22rem;\n --b-notification-padding-v: 1rem;\n --b-notification-padding-h: 1.5rem;\n --b-notification-border-radius: 0.5rem;\n --b-notification-icon-size: 1.5rem;\n --b-notification-gap: 0.75rem;\n --b-notification-close-size: 1rem;\n --b-notification-font-size-title: 1rem;\n --b-notification-font-size-desc: 0.875rem;\n --b-notification-line-height: 1.5;\n --b-notification-z-index: 1010;\n\n /* Offset from viewport edge */\n --b-notification-offset: 1.5rem;\n\n /* Colours (default / plain) */\n --b-notification-bg: #ffffff;\n --b-notification-border-color: oklch(90% 0.02 240);\n --b-notification-title-color: oklch(20% 0.02 240);\n --b-notification-desc-color: oklch(45% 0.02 240);\n --b-notification-close-color: oklch(50% 0.02 240);\n --b-notification-close-hover-color: oklch(20% 0.02 240);\n --b-notification-icon-color: oklch(62.3% 0.214 259.815);\n --b-notification-shadow:\n 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 9px 28px 8px rgba(0, 0, 0, 0.05);\n\n /* Animation */\n --b-notification-transition-duration: 300ms;\n}\n\n/* ── Variant colour tokens ── */\n.b-notification--success {\n --b-notification-icon-color: oklch(72.3% 0.219 149.579);\n}\n\n.b-notification--info {\n --b-notification-icon-color: oklch(62.3% 0.214 259.815);\n}\n\n.b-notification--warning {\n --b-notification-icon-color: oklch(75% 0.183 55.934);\n}\n\n.b-notification--error {\n --b-notification-icon-color: oklch(63.7% 0.237 25.331);\n}\n\n/* ── Dark mode ── */\n[data-prefers-color='dark'] .b-notification {\n --b-notification-bg: oklch(22% 0.02 240);\n --b-notification-border-color: oklch(35% 0.03 240);\n --b-notification-title-color: oklch(92% 0.02 240);\n --b-notification-desc-color: oklch(70% 0.02 240);\n --b-notification-close-color: oklch(60% 0.02 240);\n --b-notification-close-hover-color: oklch(90% 0.02 240);\n --b-notification-shadow:\n 0 6px 16px 0 rgba(0, 0, 0, 0.32), 0 3px 6px -4px rgba(0, 0, 0, 0.48),\n 0 9px 28px 8px rgba(0, 0, 0, 0.2);\n}\n\n@media (prefers-color-scheme: dark) {\n [data-prefers-color='system'] .b-notification {\n --b-notification-bg: oklch(22% 0.02 240);\n --b-notification-border-color: oklch(35% 0.03 240);\n --b-notification-title-color: oklch(92% 0.02 240);\n --b-notification-desc-color: oklch(70% 0.02 240);\n --b-notification-close-color: oklch(60% 0.02 240);\n --b-notification-close-hover-color: oklch(90% 0.02 240);\n --b-notification-shadow:\n 0 6px 16px 0 rgba(0, 0, 0, 0.32), 0 3px 6px -4px rgba(0, 0, 0, 0.48),\n 0 9px 28px 8px rgba(0, 0, 0, 0.2);\n }\n}\n\n/* ─────────────────────────────────────────────\n Base layout\n ───────────────────────────────────────────── */\n.b-notification {\n position: fixed;\n z-index: var(--b-notification-z-index);\n display: flex;\n align-items: flex-start;\n gap: var(--b-notification-gap);\n width: var(--b-notification-width);\n max-width: calc(100vw - 2 * var(--b-notification-offset));\n padding: var(--b-notification-padding-v) var(--b-notification-padding-h);\n border-radius: var(--b-notification-border-radius);\n background-color: var(--b-notification-bg);\n box-shadow: var(--b-notification-shadow);\n box-sizing: border-box;\n word-break: break-word;\n pointer-events: auto;\n outline: none;\n}\n\n/* ── Placement ── */\n.b-notification--top-right {\n top: var(--b-notification-offset);\n right: var(--b-notification-offset);\n}\n\n.b-notification--top-left {\n top: var(--b-notification-offset);\n left: var(--b-notification-offset);\n}\n\n.b-notification--bottom-right {\n bottom: var(--b-notification-offset);\n right: var(--b-notification-offset);\n}\n\n.b-notification--bottom-left {\n bottom: var(--b-notification-offset);\n left: var(--b-notification-offset);\n}\n\n/* ── Icon area ── */\n.b-notification__icon {\n display: inline-flex;\n flex-shrink: 0;\n align-items: flex-start;\n padding-top: 0.125rem;\n color: var(--b-notification-icon-color);\n line-height: 1;\n}\n\n.b-notification__icon-svg {\n width: var(--b-notification-icon-size);\n height: var(--b-notification-icon-size);\n fill: currentColor;\n display: block;\n}\n\n/* ── Body ── */\n.b-notification__body {\n flex: 1;\n min-width: 0;\n}\n\n/* ── Title ── */\n.b-notification__message {\n font-size: var(--b-notification-font-size-title);\n font-weight: 600;\n line-height: var(--b-notification-line-height);\n color: var(--b-notification-title-color);\n padding-right: 1.5rem; /* space for close button */\n}\n\n/* When no close button, remove the padding */\n.b-notification:not(:has(.b-notification__close)) .b-notification__message {\n padding-right: 0;\n}\n\n/* ── Description ── */\n.b-notification__description {\n margin-top: 0.375rem;\n font-size: var(--b-notification-font-size-desc);\n line-height: var(--b-notification-line-height);\n color: var(--b-notification-desc-color);\n}\n\n/* ── Action button area ── */\n.b-notification__btn {\n margin-top: 0.75rem;\n}\n\n/* ── Close button ── */\n.b-notification__close {\n position: absolute;\n top: 0.875rem;\n right: 1rem;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0.125rem;\n background: transparent;\n border: none;\n border-radius: 0.25rem;\n cursor: pointer;\n color: var(--b-notification-close-color);\n line-height: 1;\n transition: color var(--b-notification-transition-duration) ease;\n}\n\n.b-notification__close:hover {\n color: var(--b-notification-close-hover-color);\n}\n\n.b-notification__close:focus-visible {\n outline: 2px solid oklch(62.3% 0.214 259.815);\n outline-offset: 2px;\n}\n\n.b-notification__close-svg {\n width: var(--b-notification-close-size);\n height: var(--b-notification-close-size);\n fill: currentColor;\n display: block;\n}\n\n/* ─────────────────────────────────────────────\n Transition – slide-in + fade per placement\n ───────────────────────────────────────────── */\n.b-notification-fade-enter-active,\n.b-notification-fade-leave-active {\n transition:\n opacity var(--b-notification-transition-duration, 300ms) ease,\n transform var(--b-notification-transition-duration, 300ms) ease;\n}\n\n/* top-right / bottom-right - slide in from right */\n.b-notification--top-right.b-notification-fade-enter-from,\n.b-notification--bottom-right.b-notification-fade-enter-from {\n opacity: 0;\n transform: translateX(100%);\n}\n\n.b-notification--top-right.b-notification-fade-enter-to,\n.b-notification--bottom-right.b-notification-fade-enter-to,\n.b-notification--top-right.b-notification-fade-leave-from,\n.b-notification--bottom-right.b-notification-fade-leave-from {\n opacity: 1;\n transform: translateX(0);\n}\n\n.b-notification--top-right.b-notification-fade-leave-to,\n.b-notification--bottom-right.b-notification-fade-leave-to {\n opacity: 0;\n transform: translateX(100%);\n}\n\n/* top-left / bottom-left - slide in from left */\n.b-notification--top-left.b-notification-fade-enter-from,\n.b-notification--bottom-left.b-notification-fade-enter-from {\n opacity: 0;\n transform: translateX(-100%);\n}\n\n.b-notification--top-left.b-notification-fade-enter-to,\n.b-notification--bottom-left.b-notification-fade-enter-to,\n.b-notification--top-left.b-notification-fade-leave-from,\n.b-notification--bottom-left.b-notification-fade-leave-from {\n opacity: 1;\n transform: translateX(0);\n}\n\n.b-notification--top-left.b-notification-fade-leave-to,\n.b-notification--bottom-left.b-notification-fade-leave-to {\n opacity: 0;\n transform: translateX(-100%);\n}\n\n/* Respect prefers-reduced-motion */\n@media (prefers-reduced-motion: reduce) {\n .b-notification-fade-enter-active,\n .b-notification-fade-leave-active {\n transition: opacity var(--b-notification-transition-duration, 300ms) ease;\n }\n\n .b-notification--top-right.b-notification-fade-enter-from,\n .b-notification--bottom-right.b-notification-fade-enter-from,\n .b-notification--top-left.b-notification-fade-enter-from,\n .b-notification--bottom-left.b-notification-fade-enter-from,\n .b-notification--top-right.b-notification-fade-leave-to,\n .b-notification--bottom-right.b-notification-fade-leave-to,\n .b-notification--top-left.b-notification-fade-leave-to,\n .b-notification--bottom-left.b-notification-fade-leave-to {\n transform: none;\n }\n}\n</style>\n"],"mappings":""}
|
package/dist/design-system154.js
CHANGED
|
@@ -1,192 +1,310 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var b = ["id"], x = {
|
|
1
|
+
import e from "./design-system27.js";
|
|
2
|
+
import { Fragment as t, computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, normalizeClass as c, openBlock as l, ref as u, renderList as d, toDisplayString as f, unref as p, watch as m } from "vue";
|
|
3
|
+
//#region src/components/BPagination/BPagination.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var h = ["aria-label"], g = {
|
|
6
5
|
key: 0,
|
|
7
|
-
class: "b-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
class: "b-pagination__total"
|
|
7
|
+
}, _ = [
|
|
8
|
+
"disabled",
|
|
9
|
+
"aria-disabled",
|
|
10
|
+
"title"
|
|
11
|
+
], v = { class: "b-pagination__simple-pager" }, y = [
|
|
12
|
+
"value",
|
|
13
|
+
"disabled",
|
|
14
|
+
"aria-label"
|
|
15
|
+
], b = {
|
|
16
|
+
key: 1,
|
|
17
|
+
class: "b-pagination__simple-current",
|
|
18
|
+
"aria-current": "page"
|
|
19
|
+
}, x = { class: "b-pagination__simple-total" }, S = [
|
|
20
|
+
"disabled",
|
|
21
|
+
"aria-disabled",
|
|
22
|
+
"title"
|
|
23
|
+
], C = [
|
|
24
|
+
"disabled",
|
|
25
|
+
"aria-disabled",
|
|
26
|
+
"title"
|
|
27
|
+
], w = [
|
|
28
|
+
"disabled",
|
|
29
|
+
"title",
|
|
30
|
+
"aria-label",
|
|
31
|
+
"onClick"
|
|
32
|
+
], ee = [
|
|
33
|
+
"disabled",
|
|
34
|
+
"aria-current",
|
|
35
|
+
"aria-label",
|
|
36
|
+
"title",
|
|
37
|
+
"onClick"
|
|
38
|
+
], T = [
|
|
39
|
+
"disabled",
|
|
40
|
+
"aria-disabled",
|
|
41
|
+
"title"
|
|
42
|
+
], E = ["value", "disabled"], D = ["value"], O = {
|
|
43
|
+
key: 4,
|
|
44
|
+
class: "b-pagination__quick-jumper"
|
|
45
|
+
}, k = ["value", "disabled"], A = /* @__PURE__ */ s({
|
|
46
|
+
__name: "BPagination",
|
|
11
47
|
props: {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
48
|
+
current: {},
|
|
49
|
+
defaultCurrent: { default: 1 },
|
|
50
|
+
defaultPageSize: { default: 10 },
|
|
51
|
+
pageSize: {},
|
|
52
|
+
pageSizeOptions: { default: () => [
|
|
53
|
+
10,
|
|
54
|
+
20,
|
|
55
|
+
50,
|
|
56
|
+
100
|
|
57
|
+
] },
|
|
58
|
+
total: { default: 0 },
|
|
59
|
+
disabled: {
|
|
17
60
|
type: Boolean,
|
|
18
|
-
default: !
|
|
61
|
+
default: !1
|
|
19
62
|
},
|
|
20
|
-
|
|
21
|
-
mouseLeaveDelay: { default: 100 },
|
|
22
|
-
destroyTooltipOnHide: {
|
|
63
|
+
hideOnSinglePage: {
|
|
23
64
|
type: Boolean,
|
|
24
65
|
default: !1
|
|
25
66
|
},
|
|
26
|
-
|
|
27
|
-
fresh: {
|
|
67
|
+
showLessItems: {
|
|
28
68
|
type: Boolean,
|
|
29
69
|
default: !1
|
|
30
70
|
},
|
|
31
|
-
|
|
71
|
+
showQuickJumper: {
|
|
72
|
+
type: [Boolean, Object],
|
|
73
|
+
default: !1
|
|
74
|
+
},
|
|
75
|
+
showSizeChanger: {
|
|
32
76
|
type: Boolean,
|
|
33
|
-
default:
|
|
34
|
-
}
|
|
77
|
+
default: void 0
|
|
78
|
+
},
|
|
79
|
+
showTitle: {
|
|
80
|
+
type: Boolean,
|
|
81
|
+
default: !0
|
|
82
|
+
},
|
|
83
|
+
showTotal: {},
|
|
84
|
+
simple: {
|
|
85
|
+
type: [Boolean, Object],
|
|
86
|
+
default: !1
|
|
87
|
+
},
|
|
88
|
+
size: { default: "default" },
|
|
89
|
+
align: { default: "start" },
|
|
90
|
+
totalBoundaryShowSizeChanger: { default: 50 },
|
|
91
|
+
ariaLabel: { default: "Pagination" }
|
|
35
92
|
},
|
|
36
|
-
emits: [
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
93
|
+
emits: [
|
|
94
|
+
"change",
|
|
95
|
+
"showSizeChange",
|
|
96
|
+
"update:current",
|
|
97
|
+
"update:pageSize"
|
|
98
|
+
],
|
|
99
|
+
setup(s, { emit: A }) {
|
|
100
|
+
let j = s, M = A, N = u(j.current ?? j.defaultCurrent), P = u(j.pageSize ?? j.defaultPageSize), F = n(() => j.current !== void 0), I = n(() => j.pageSize !== void 0);
|
|
101
|
+
m(() => j.current, (e) => {
|
|
102
|
+
e !== void 0 && (N.value = e);
|
|
103
|
+
}), m(() => j.pageSize, (e) => {
|
|
104
|
+
e !== void 0 && (P.value = e);
|
|
41
105
|
});
|
|
42
|
-
let
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
l.modelValue === void 0 ? A.value = e : E("update:modelValue", e), E("openChange", e);
|
|
60
|
-
}
|
|
61
|
-
let ae = ({ newState: e }) => {
|
|
62
|
-
ie(e === "open");
|
|
63
|
-
}, B = g(null), V = g(null), H = null;
|
|
64
|
-
function U() {
|
|
65
|
-
u(() => {
|
|
66
|
-
if (!B.value) return;
|
|
67
|
-
let e = B.value.querySelector(C);
|
|
68
|
-
e ? e.focus() : B.value.focus();
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
function W(e) {
|
|
72
|
-
if (e.key !== "Tab" || !B.value) return;
|
|
73
|
-
let t = Array.from(B.value.querySelectorAll(C));
|
|
74
|
-
if (t.length === 0) {
|
|
75
|
-
e.preventDefault();
|
|
76
|
-
return;
|
|
106
|
+
let L = n(() => F.value ? j.current : N.value), R = n(() => I.value ? j.pageSize : P.value), z = n(() => j.total <= 0 || R.value <= 0 ? 0 : Math.ceil(j.total / R.value)), B = n(() => j.hideOnSinglePage && z.value <= 1), V = n(() => j.showSizeChanger === void 0 ? j.total > j.totalBoundaryShowSizeChanger : j.showSizeChanger), H = n(() => !!j.simple), U = n(() => typeof j.simple == "object" && j.simple.readOnly === !0), W = n(() => {
|
|
107
|
+
if (!j.showTotal) return "";
|
|
108
|
+
let e = (L.value - 1) * R.value + 1, t = Math.min(L.value * R.value, j.total);
|
|
109
|
+
return j.showTotal(j.total, [e, t]);
|
|
110
|
+
}), G = n(() => {
|
|
111
|
+
let e = z.value;
|
|
112
|
+
if (e <= 0) return [];
|
|
113
|
+
let t = j.showLessItems ? 1 : 2, n = L.value, r = [];
|
|
114
|
+
if (r.push({
|
|
115
|
+
type: "page",
|
|
116
|
+
page: 1
|
|
117
|
+
}), e <= (j.showLessItems ? 4 : 6) + 2) {
|
|
118
|
+
for (let t = 2; t <= e; t++) r.push({
|
|
119
|
+
type: "page",
|
|
120
|
+
page: t
|
|
121
|
+
});
|
|
122
|
+
return r;
|
|
77
123
|
}
|
|
78
|
-
let
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
124
|
+
let i = Math.max(2, n - t), a = Math.min(e - 1, n + t);
|
|
125
|
+
i > 2 && r.push({
|
|
126
|
+
type: "prev-ellipsis",
|
|
127
|
+
page: Math.max(1, n - (j.showLessItems ? 3 : 5))
|
|
128
|
+
});
|
|
129
|
+
for (let e = i; e <= a; e++) r.push({
|
|
130
|
+
type: "page",
|
|
131
|
+
page: e
|
|
132
|
+
});
|
|
133
|
+
return a < e - 1 && r.push({
|
|
134
|
+
type: "next-ellipsis",
|
|
135
|
+
page: Math.min(e, n + (j.showLessItems ? 3 : 5))
|
|
136
|
+
}), e > 1 && r.push({
|
|
137
|
+
type: "page",
|
|
138
|
+
page: e
|
|
139
|
+
}), r;
|
|
83
140
|
});
|
|
84
|
-
function
|
|
85
|
-
j.
|
|
141
|
+
function K(e) {
|
|
142
|
+
if (j.disabled) return;
|
|
143
|
+
let t = Math.max(1, Math.min(e, z.value));
|
|
144
|
+
t !== L.value && (F.value || (N.value = t), M("update:current", t), M("change", t, R.value));
|
|
86
145
|
}
|
|
87
|
-
function
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
L(l.mouseLeaveDelay);
|
|
146
|
+
function q(e) {
|
|
147
|
+
if (j.disabled || e === R.value) return;
|
|
148
|
+
let t = Math.ceil(j.total / e), n = Math.min(L.value, t) || 1;
|
|
149
|
+
I.value || (P.value = e), F.value || (N.value = n), M("update:pageSize", e), M("update:current", n), M("showSizeChange", n, e), M("change", n, e);
|
|
92
150
|
}
|
|
93
151
|
function J() {
|
|
94
|
-
|
|
152
|
+
K(L.value - 1);
|
|
95
153
|
}
|
|
96
154
|
function Y() {
|
|
97
|
-
L
|
|
98
|
-
}
|
|
99
|
-
function X(e) {
|
|
100
|
-
e.key === "Escape" && j.value && (e.preventDefault(), L());
|
|
155
|
+
K(L.value + 1);
|
|
101
156
|
}
|
|
102
|
-
|
|
103
|
-
|
|
157
|
+
let X = u("");
|
|
158
|
+
function Z(e) {
|
|
159
|
+
e.key === "Enter" && Q();
|
|
104
160
|
}
|
|
105
|
-
function
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
function ce() {
|
|
109
|
-
l.trigger === t.Hover && L(l.mouseLeaveDelay);
|
|
161
|
+
function Q() {
|
|
162
|
+
let e = parseInt(X.value, 10);
|
|
163
|
+
!isNaN(e) && e >= 1 && e <= z.value && K(e), X.value = "";
|
|
110
164
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
break;
|
|
120
|
-
case t.Hover:
|
|
121
|
-
default:
|
|
122
|
-
e.addEventListener("mouseenter", K), e.addEventListener("mouseleave", q), e.addEventListener("focusin", J), e.addEventListener("focusout", Y);
|
|
123
|
-
break;
|
|
165
|
+
let $ = u(String(L.value));
|
|
166
|
+
m(L, (e) => {
|
|
167
|
+
$.value = String(e);
|
|
168
|
+
});
|
|
169
|
+
function te(e) {
|
|
170
|
+
if (e.key === "Enter") {
|
|
171
|
+
let e = parseInt($.value, 10);
|
|
172
|
+
isNaN(e) ? $.value = String(L.value) : K(e);
|
|
124
173
|
}
|
|
125
174
|
}
|
|
126
|
-
function
|
|
127
|
-
let e =
|
|
128
|
-
e &&
|
|
175
|
+
function ne() {
|
|
176
|
+
let e = parseInt($.value, 10);
|
|
177
|
+
!isNaN(e) && e >= 1 && e <= z.value ? K(e) : $.value = String(L.value);
|
|
129
178
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
[e.TopLeft]: "top-left",
|
|
141
|
-
[e.TopCenter]: "top-center",
|
|
142
|
-
[e.TopRight]: "top-right",
|
|
143
|
-
[e.RightTop]: "right-top",
|
|
144
|
-
[e.RightCenter]: "right-center",
|
|
145
|
-
[e.RightBottom]: "right-bottom",
|
|
146
|
-
[e.BottomRight]: "bottom-right",
|
|
147
|
-
[e.BottomCenter]: "bottom-center",
|
|
148
|
-
[e.BottomLeft]: "bottom-left",
|
|
149
|
-
[e.LeftBottom]: "left-bottom",
|
|
150
|
-
[e.LeftCenter]: "left-center",
|
|
151
|
-
[e.LeftTop]: "left-top"
|
|
152
|
-
})[l.placement] ?? "top-center");
|
|
153
|
-
return w({
|
|
154
|
-
open: R,
|
|
155
|
-
close: z
|
|
156
|
-
}), (e, t) => (h(), o(r, null, [s("div", {
|
|
157
|
-
ref_key: "toggleRef",
|
|
158
|
-
ref: V,
|
|
159
|
-
class: "b-popover__toggle",
|
|
160
|
-
style: f({ anchorName: $.value })
|
|
161
|
-
}, [_(e.$slots, "default")], 4), s("div", {
|
|
162
|
-
ref_key: "popoverRef",
|
|
163
|
-
ref: B,
|
|
164
|
-
popover: "manual",
|
|
165
|
-
class: d([
|
|
166
|
-
"b-popover__content",
|
|
167
|
-
le.value,
|
|
168
|
-
{ "b-popover__content--no-arrow": !l.arrow }
|
|
169
|
-
]),
|
|
170
|
-
style: f({
|
|
171
|
-
zIndex: l.zIndex,
|
|
172
|
-
positionAnchor: $.value
|
|
173
|
-
}),
|
|
174
|
-
role: "tooltip",
|
|
175
|
-
"aria-labelledby": k,
|
|
176
|
-
id: ee(O),
|
|
177
|
-
tabindex: "-1",
|
|
178
|
-
onToggle: ae,
|
|
179
|
-
onKeydown: oe,
|
|
180
|
-
onMouseenter: se,
|
|
181
|
-
onMouseleave: ce
|
|
182
|
-
}, [re.value || !l.destroyTooltipOnHide ? (h(), o(r, { key: 0 }, [l.arrow ? (h(), o("div", x)) : a("", !0), s("div", ne, [l.title || e.$slots.title ? (h(), o("div", {
|
|
179
|
+
let re = n(() => ["b-pagination", {
|
|
180
|
+
"b-pagination--disabled": j.disabled,
|
|
181
|
+
"b-pagination--simple": H.value,
|
|
182
|
+
"b-pagination--small": j.size === "small",
|
|
183
|
+
"b-pagination--large": j.size === "large",
|
|
184
|
+
"b-pagination--align-start": j.align === "start",
|
|
185
|
+
"b-pagination--align-center": j.align === "center",
|
|
186
|
+
"b-pagination--align-end": j.align === "end"
|
|
187
|
+
}]);
|
|
188
|
+
return (n, u) => B.value ? r("", !0) : (l(), i("nav", {
|
|
183
189
|
key: 0,
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
190
|
+
class: c(re.value),
|
|
191
|
+
role: "navigation",
|
|
192
|
+
"aria-label": j.ariaLabel
|
|
193
|
+
}, [
|
|
194
|
+
j.showTotal ? (l(), i("span", g, f(W.value), 1)) : r("", !0),
|
|
195
|
+
H.value ? (l(), i(t, { key: 1 }, [
|
|
196
|
+
a("button", {
|
|
197
|
+
class: "b-pagination__item b-pagination__prev",
|
|
198
|
+
type: "button",
|
|
199
|
+
disabled: j.disabled || L.value <= 1,
|
|
200
|
+
"aria-disabled": j.disabled || L.value <= 1 ? "true" : void 0,
|
|
201
|
+
title: j.showTitle ? "Previous Page" : void 0,
|
|
202
|
+
"aria-label": "Previous Page",
|
|
203
|
+
onClick: J
|
|
204
|
+
}, [o(p(e), {
|
|
205
|
+
icon: "chevron-left",
|
|
206
|
+
"aria-hidden": "true"
|
|
207
|
+
})], 8, _),
|
|
208
|
+
a("span", v, [
|
|
209
|
+
U.value ? (l(), i("span", b, f(L.value), 1)) : (l(), i("input", {
|
|
210
|
+
key: 0,
|
|
211
|
+
class: "b-pagination__simple-input",
|
|
212
|
+
type: "text",
|
|
213
|
+
inputmode: "numeric",
|
|
214
|
+
value: $.value,
|
|
215
|
+
disabled: j.disabled,
|
|
216
|
+
"aria-label": `Page ${L.value} of ${z.value}`,
|
|
217
|
+
onInput: u[0] ||= (e) => $.value = e.target.value,
|
|
218
|
+
onKeydown: te,
|
|
219
|
+
onBlur: ne
|
|
220
|
+
}, null, 40, y)),
|
|
221
|
+
u[3] ||= a("span", {
|
|
222
|
+
class: "b-pagination__simple-separator",
|
|
223
|
+
"aria-hidden": "true"
|
|
224
|
+
}, "/", -1),
|
|
225
|
+
a("span", x, f(z.value), 1)
|
|
226
|
+
]),
|
|
227
|
+
a("button", {
|
|
228
|
+
class: "b-pagination__item b-pagination__next",
|
|
229
|
+
type: "button",
|
|
230
|
+
disabled: j.disabled || L.value >= z.value,
|
|
231
|
+
"aria-disabled": j.disabled || L.value >= z.value ? "true" : void 0,
|
|
232
|
+
title: j.showTitle ? "Next Page" : void 0,
|
|
233
|
+
"aria-label": "Next Page",
|
|
234
|
+
onClick: Y
|
|
235
|
+
}, [o(p(e), {
|
|
236
|
+
icon: "chevron-right",
|
|
237
|
+
"aria-hidden": "true"
|
|
238
|
+
})], 8, S)
|
|
239
|
+
], 64)) : (l(), i(t, { key: 2 }, [
|
|
240
|
+
a("button", {
|
|
241
|
+
class: "b-pagination__item b-pagination__prev",
|
|
242
|
+
type: "button",
|
|
243
|
+
disabled: j.disabled || L.value <= 1,
|
|
244
|
+
"aria-disabled": j.disabled || L.value <= 1 ? "true" : void 0,
|
|
245
|
+
title: j.showTitle ? "Previous Page" : void 0,
|
|
246
|
+
"aria-label": "Previous Page",
|
|
247
|
+
onClick: J
|
|
248
|
+
}, [o(p(e), {
|
|
249
|
+
icon: "chevron-left",
|
|
250
|
+
"aria-hidden": "true"
|
|
251
|
+
})], 8, C),
|
|
252
|
+
(l(!0), i(t, null, d(G.value, (e) => (l(), i(t, { key: `${e.type}-${e.page}` }, [e.type === "prev-ellipsis" || e.type === "next-ellipsis" ? (l(), i("button", {
|
|
253
|
+
key: 0,
|
|
254
|
+
class: "b-pagination__item b-pagination__ellipsis",
|
|
255
|
+
type: "button",
|
|
256
|
+
disabled: j.disabled,
|
|
257
|
+
title: j.showTitle ? e.type === "prev-ellipsis" ? "Previous 5 Pages" : "Next 5 Pages" : void 0,
|
|
258
|
+
"aria-label": e.type === "prev-ellipsis" ? "Previous 5 Pages" : "Next 5 Pages",
|
|
259
|
+
onClick: (t) => K(e.page)
|
|
260
|
+
}, [...u[4] ||= [a("span", { "aria-hidden": "true" }, "•••", -1)]], 8, w)) : (l(), i("button", {
|
|
261
|
+
key: 1,
|
|
262
|
+
class: c(["b-pagination__item b-pagination__page", { "b-pagination__page--active": e.page === L.value }]),
|
|
263
|
+
type: "button",
|
|
264
|
+
disabled: j.disabled,
|
|
265
|
+
"aria-current": e.page === L.value ? "page" : void 0,
|
|
266
|
+
"aria-label": `Page ${e.page}`,
|
|
267
|
+
title: j.showTitle ? `${e.page}` : void 0,
|
|
268
|
+
onClick: (t) => K(e.page)
|
|
269
|
+
}, f(e.page), 11, ee))], 64))), 128)),
|
|
270
|
+
a("button", {
|
|
271
|
+
class: "b-pagination__item b-pagination__next",
|
|
272
|
+
type: "button",
|
|
273
|
+
disabled: j.disabled || L.value >= z.value,
|
|
274
|
+
"aria-disabled": j.disabled || L.value >= z.value ? "true" : void 0,
|
|
275
|
+
title: j.showTitle ? "Next Page" : void 0,
|
|
276
|
+
"aria-label": "Next Page",
|
|
277
|
+
onClick: Y
|
|
278
|
+
}, [o(p(e), {
|
|
279
|
+
icon: "chevron-right",
|
|
280
|
+
"aria-hidden": "true"
|
|
281
|
+
})], 8, T)
|
|
282
|
+
], 64)),
|
|
283
|
+
V.value && !H.value ? (l(), i("select", {
|
|
284
|
+
key: 3,
|
|
285
|
+
class: "b-pagination__size-changer",
|
|
286
|
+
value: R.value,
|
|
287
|
+
disabled: j.disabled,
|
|
288
|
+
"aria-label": "Items per page",
|
|
289
|
+
onChange: u[1] ||= (e) => q(Number(e.target.value))
|
|
290
|
+
}, [(l(!0), i(t, null, d(s.pageSizeOptions, (e) => (l(), i("option", {
|
|
291
|
+
key: e,
|
|
292
|
+
value: e
|
|
293
|
+
}, f(e) + " / page", 9, D))), 128))], 40, E)) : r("", !0),
|
|
294
|
+
j.showQuickJumper && !H.value ? (l(), i("span", O, [u[5] ||= a("span", null, "Go to", -1), a("input", {
|
|
295
|
+
class: "b-pagination__jumper-input",
|
|
296
|
+
type: "text",
|
|
297
|
+
inputmode: "numeric",
|
|
298
|
+
value: X.value,
|
|
299
|
+
disabled: j.disabled,
|
|
300
|
+
"aria-label": "Go to page",
|
|
301
|
+
onInput: u[2] ||= (e) => X.value = e.target.value,
|
|
302
|
+
onKeydown: Z
|
|
303
|
+
}, null, 40, k)])) : r("", !0)
|
|
304
|
+
], 10, h));
|
|
187
305
|
}
|
|
188
306
|
});
|
|
189
307
|
//#endregion
|
|
190
|
-
export {
|
|
308
|
+
export { A as default };
|
|
191
309
|
|
|
192
310
|
//# sourceMappingURL=design-system154.js.map
|