bitboss-ui 0.2.76 → 1.0.0
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/components/BaseCheckbox/BaseCheckbox.vue.d.ts +4 -0
- package/dist/components/BaseCheckboxGroup/BaseCheckboxGroup.vue.d.ts +10 -3
- package/dist/components/BaseDatePicker/BaseDatePicker.vue.d.ts +4 -1
- package/dist/components/BaseDatePickerInput/BaseDatePickerInput.vue.d.ts +10 -4
- package/dist/components/BaseInputContainer/BaseInputContainer.vue.d.ts +9 -0
- package/dist/components/BaseNumberInput/BaseNumberInput.vue.d.ts +4 -0
- package/dist/components/BaseRadio/BaseRadio.vue.d.ts +4 -0
- package/dist/components/BaseRadioGroup/BaseRadioGroup.vue.d.ts +10 -3
- package/dist/components/BaseRating/BaseRating.vue.d.ts +5 -1
- package/dist/components/BaseSelect/BaseSelect.vue.d.ts +4 -0
- package/dist/components/BaseSlider/BaseSlider.vue.d.ts +48 -11
- package/dist/components/BaseSwitchGroup/BaseSwitchGroup.vue.d.ts +6 -3
- package/dist/components/BaseTag/BaseTag.vue.d.ts +4 -0
- package/dist/components/BaseTextInput/BaseTextInput.vue.d.ts +10 -6
- package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +4 -0
- package/dist/components/BbButton/BbButton.vue.d.ts +12 -0
- package/dist/components/BbCheckbox/BbCheckbox.vue.d.ts +35 -27
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +38 -24
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +15 -3
- package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +33 -25
- package/dist/components/BbRadio/BbRadio.vue.d.ts +33 -25
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +38 -24
- package/dist/components/BbRating/BbRating.vue.d.ts +9 -1
- package/dist/components/BbSelect/BbSelect.vue.d.ts +18 -4
- package/dist/components/BbSlider/BbSlider.vue.d.ts +44 -11
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +9 -3
- package/dist/components/BbTag/BbTag.vue.d.ts +11 -3
- package/dist/components/BbTextInput/BbTextInput.vue.d.ts +33 -25
- package/dist/components/BbTextarea/BbTextarea.vue.d.ts +9 -1
- package/dist/composables/useQueue.d.ts +58 -0
- package/dist/index.js +186 -185
- package/dist/index.js.map +1 -1
- package/dist/index10.js +65 -1
- package/dist/index10.js.map +1 -1
- package/dist/index100.js +227 -1
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +1 -437
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +437 -1
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +1 -94
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +103 -1
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +1 -88
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +97 -1
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +1 -89
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +98 -1
- package/dist/index108.js.map +1 -1
- package/dist/index109.js +1 -29
- package/dist/index109.js.map +1 -1
- package/dist/index11.js +1 -131
- package/dist/index11.js.map +1 -1
- package/dist/index110.js +29 -1
- package/dist/index110.js.map +1 -1
- package/dist/index111.js +1 -151
- package/dist/index111.js.map +1 -1
- package/dist/index112.js +151 -1
- package/dist/index112.js.map +1 -1
- package/dist/index113.js +1 -122
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +122 -1
- package/dist/index114.js.map +1 -1
- package/dist/index115.js +1 -46
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +40 -33
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +32 -39
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +39 -42
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +43 -39
- package/dist/index119.js.map +1 -1
- package/dist/index12.js +128 -1
- package/dist/index12.js.map +1 -1
- package/dist/index120.js +43 -2
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +2 -21
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +21 -2
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +2 -224
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +224 -2
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +2 -18
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +16 -10
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +12 -24
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +24 -5
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +5 -9
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +1 -159
- package/dist/index13.js.map +1 -1
- package/dist/index130.js +8 -5
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +5 -69
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +70 -3
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +2 -2
- package/dist/index134.js +2 -2
- package/dist/index135.js +2 -2
- package/dist/index136.js +2 -2
- package/dist/index137.js +2 -2
- package/dist/index138.js +2 -2
- package/dist/index139.js +2 -2
- package/dist/index14.js +161 -1
- package/dist/index14.js.map +1 -1
- package/dist/index140.js +2 -2
- package/dist/index141.js +2 -2
- package/dist/index142.js +2 -2
- package/dist/index143.js +2 -2
- package/dist/index144.js +2 -2
- package/dist/index145.js +2 -2
- package/dist/index146.js +2 -2
- package/dist/index147.js +2 -2
- package/dist/index148.js +2 -2
- package/dist/index149.js +2 -2
- package/dist/index15.js +1 -457
- package/dist/index15.js.map +1 -1
- package/dist/index150.js +2 -2
- package/dist/index151.js +2 -2
- package/dist/index152.js +2 -2
- package/dist/index153.js +2 -2
- package/dist/index154.js +2 -2
- package/dist/index155.js +2 -2
- package/dist/index156.js +2 -2
- package/dist/index157.js +2 -2
- package/dist/index158.js +5 -1
- package/dist/index158.js.map +1 -1
- package/dist/index159.js +1 -5
- package/dist/index159.js.map +1 -1
- package/dist/index16.js +514 -1
- package/dist/index16.js.map +1 -1
- package/dist/index160.js +5 -1
- package/dist/index160.js.map +1 -1
- package/dist/index161.js +1 -5
- package/dist/index161.js.map +1 -1
- package/dist/index162.js +2 -2
- package/dist/index163.js +2 -2
- package/dist/index164.js +2 -2
- package/dist/index165.js +2 -2
- package/dist/index166.js +2 -2
- package/dist/index167.js +3 -2
- package/dist/index167.js.map +1 -1
- package/dist/index168.js +2 -3
- package/dist/index168.js.map +1 -1
- package/dist/index169.js +5 -1
- package/dist/index169.js.map +1 -1
- package/dist/index17.js +1 -211
- package/dist/index17.js.map +1 -1
- package/dist/index170.js +1 -4
- package/dist/index170.js.map +1 -1
- package/dist/index171.js +2 -3
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +2 -2
- package/dist/index173.js +2 -2
- package/dist/index174.js +2 -2
- package/dist/index175.js +2 -2
- package/dist/index176.js +2 -2
- package/dist/index177.js +2 -2
- package/dist/index178.js +2 -2
- package/dist/index179.js +2 -2
- package/dist/index18.js +220 -1
- package/dist/index18.js.map +1 -1
- package/dist/index180.js +2 -2
- package/dist/index181.js +2 -2
- package/dist/index182.js +2 -2
- package/dist/index183.js +5 -1
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +1 -5
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +5 -1
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +1 -5
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +2 -2
- package/dist/index188.js +2 -2
- package/dist/index189.js +2 -2
- package/dist/index19.js +1 -239
- package/dist/index19.js.map +1 -1
- package/dist/index190.js +2 -2
- package/dist/index191.js +2 -2
- package/dist/index192.js +2 -2
- package/dist/index193.js +2 -2
- package/dist/index194.js +2 -2
- package/dist/index195.js +2 -2
- package/dist/index196.js +3 -10
- package/dist/index196.js.map +1 -1
- package/dist/index198.js +2 -3
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +4 -3
- package/dist/index199.js.map +1 -1
- package/dist/index2.js +1 -42
- package/dist/index2.js.map +1 -1
- package/dist/index20.js +239 -1
- package/dist/index20.js.map +1 -1
- package/dist/index200.js +5 -368
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +13 -131
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +16 -5
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +3 -3
- package/dist/index204.js +20 -2
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +29 -2
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +8 -174
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +2 -23
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +111 -363
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +131 -13
- package/dist/index209.js.map +1 -1
- package/dist/index21.js +1 -115
- package/dist/index21.js.map +1 -1
- package/dist/index210.js +2 -16
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +35 -20
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +172 -27
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +6 -8
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +346 -213
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +373 -3
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +3 -35
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +3 -6
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +235 -2
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +3 -2
- package/dist/index219.js.map +1 -1
- package/dist/index22.js +131 -1
- package/dist/index22.js.map +1 -1
- package/dist/index220.js +2 -4
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +8 -119
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +2 -2
- package/dist/index222.js.map +1 -1
- package/dist/index224.js +23 -6
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +4 -17
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +294 -78
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +6 -2
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +2 -160
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +4 -1
- package/dist/index229.js.map +1 -1
- package/dist/index23.js +1 -115
- package/dist/index23.js.map +1 -1
- package/dist/index230.js +2 -5
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +2 -69
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +2 -224
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +2 -258
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +78 -5
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +6 -2
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +17 -295
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +2 -2
- package/dist/index238.js +106 -2
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +428 -110
- package/dist/index239.js.map +1 -1
- package/dist/index24.js +119 -1
- package/dist/index24.js.map +1 -1
- package/dist/index240.js +218 -100
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +255 -12
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +117 -2
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +200 -2
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +2 -2
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +69 -2
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +5 -435
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +163 -88
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +1 -202
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +2 -4
- package/dist/index249.js.map +1 -1
- package/dist/index25.js +1 -92
- package/dist/index25.js.map +1 -1
- package/dist/index250.js +89 -2
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +15 -4
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +4 -4
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +4 -61
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +61 -2
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +2 -3
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +3 -2
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +5 -0
- package/dist/index257.js.map +1 -0
- package/dist/index26.js +94 -1
- package/dist/index26.js.map +1 -1
- package/dist/index27.js +1 -157
- package/dist/index27.js.map +1 -1
- package/dist/index28.js +160 -1
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +1 -124
- package/dist/index29.js.map +1 -1
- package/dist/index3.js +38 -76
- package/dist/index3.js.map +1 -1
- package/dist/index30.js +126 -1
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +1 -691
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +693 -1
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +1 -145
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +302 -1
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +1 -118
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +120 -1
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +1 -154
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +156 -1
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +1 -83
- package/dist/index39.js.map +1 -1
- package/dist/index4.js +78 -62
- package/dist/index4.js.map +1 -1
- package/dist/index40.js +87 -1
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +1 -61
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +64 -1
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +1 -65
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +65 -1
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +1 -96
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +96 -1
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +1 -61
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +61 -1
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +1 -49
- package/dist/index49.js.map +1 -1
- package/dist/index5.js +60 -38
- package/dist/index5.js.map +1 -1
- package/dist/index50.js +49 -1
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +1 -62
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +62 -1
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +1 -45
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +69 -1
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +1 -89
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +98 -1
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +1 -120
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +129 -1
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +1 -85
- package/dist/index59.js.map +1 -1
- package/dist/index6.js +37 -171
- package/dist/index6.js.map +1 -1
- package/dist/index60.js +85 -1
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +1 -88
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +98 -1
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +1 -59
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +59 -1
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +1 -313
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +313 -1
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +1 -129
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +129 -1
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +1 -225
- package/dist/index69.js.map +1 -1
- package/dist/index7.js +172 -18
- package/dist/index7.js.map +1 -1
- package/dist/index70.js +225 -1
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +1 -24
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +19 -41
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +37 -86
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +104 -1
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +1 -227
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +227 -1
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +1 -143
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +165 -1
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +1 -213
- package/dist/index79.js.map +1 -1
- package/dist/index8.js +18 -192
- package/dist/index8.js.map +1 -1
- package/dist/index80.js +213 -1
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +1 -35
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +35 -1
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +1 -83
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +92 -1
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +1 -120
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +129 -1
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +1 -83
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +92 -1
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +1 -30
- package/dist/index89.js.map +1 -1
- package/dist/index9.js +192 -61
- package/dist/index9.js.map +1 -1
- package/dist/index90.js +30 -1
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +1 -157
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +166 -1
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +1 -86
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +112 -1
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +1 -89
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +98 -1
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +1 -119
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +129 -1
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +1 -227
- package/dist/index99.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/utilities/functions/last.d.ts +1 -1
- package/package.json +1 -1
package/dist/index74.js
CHANGED
|
@@ -1,2 +1,105 @@
|
|
|
1
|
-
|
|
1
|
+
import { defineComponent as v, ref as y, computed as w, openBlock as B, createBlock as k, withCtx as r, renderSlot as n, normalizeProps as l, guardReactiveProps as s, createVNode as V, mergeProps as $ } from "vue";
|
|
2
|
+
import g from "./index22.js";
|
|
3
|
+
import "./index23.js";
|
|
4
|
+
import P from "./index24.js";
|
|
5
|
+
import "./index25.js";
|
|
6
|
+
const N = /* @__PURE__ */ v({
|
|
7
|
+
__name: "BbNumberInput",
|
|
8
|
+
props: {
|
|
9
|
+
autocomplete: {},
|
|
10
|
+
autofocus: {},
|
|
11
|
+
direction: {},
|
|
12
|
+
disabled: { type: Boolean },
|
|
13
|
+
errors: {},
|
|
14
|
+
hasErrors: { type: Boolean },
|
|
15
|
+
hideLabel: { type: Boolean },
|
|
16
|
+
hint: {},
|
|
17
|
+
id: {},
|
|
18
|
+
label: {},
|
|
19
|
+
labelPosition: {},
|
|
20
|
+
max: {},
|
|
21
|
+
min: {},
|
|
22
|
+
modelValue: {},
|
|
23
|
+
name: {},
|
|
24
|
+
persistentHint: { type: Boolean },
|
|
25
|
+
placeholder: {},
|
|
26
|
+
readonly: {},
|
|
27
|
+
reverse: { type: Boolean },
|
|
28
|
+
step: {}
|
|
29
|
+
},
|
|
30
|
+
emits: ["blur", "change", "click", "decrease", "focus", "increase", "input", "keydown", "mousedown", "mouseup", "update:modelValue"],
|
|
31
|
+
setup(t, { emit: p }) {
|
|
32
|
+
const u = t, o = p, i = y(!1), m = w(() => u.persistentHint || i.value), b = {
|
|
33
|
+
onBlur: (e) => {
|
|
34
|
+
i.value = !1, o("blur", e);
|
|
35
|
+
},
|
|
36
|
+
onChange: (e) => o("change", e),
|
|
37
|
+
onClick: (e) => o("click", e),
|
|
38
|
+
onDecrease: (e) => o("decrease", e),
|
|
39
|
+
onFocus: (e) => {
|
|
40
|
+
i.value = !0, o("focus", e);
|
|
41
|
+
},
|
|
42
|
+
onIncrease: (e) => o("increase", e),
|
|
43
|
+
onInput: (e) => o("input", e),
|
|
44
|
+
onKeydown: (e) => o("keydown", e),
|
|
45
|
+
onMousedown: (e) => o("mousedown", e),
|
|
46
|
+
onMouseup: (e) => o("mouseup", e),
|
|
47
|
+
"onUpdate:modelValue": (e) => o("update:modelValue", e)
|
|
48
|
+
};
|
|
49
|
+
return (e, C) => (B(), k(g, {
|
|
50
|
+
direction: e.direction,
|
|
51
|
+
errors: e.errors,
|
|
52
|
+
"has-errors": e.hasErrors,
|
|
53
|
+
"hide-label": e.hideLabel,
|
|
54
|
+
hint: e.hint,
|
|
55
|
+
id: e.id,
|
|
56
|
+
"label-position": e.labelPosition,
|
|
57
|
+
label: e.label,
|
|
58
|
+
"model-value": e.modelValue,
|
|
59
|
+
name: e.name,
|
|
60
|
+
reverse: e.reverse,
|
|
61
|
+
"show-hint": m.value,
|
|
62
|
+
class: "bb-number-input"
|
|
63
|
+
}, {
|
|
64
|
+
label: r((d) => [
|
|
65
|
+
n(e.$slots, "label", l(s(d)))
|
|
66
|
+
]),
|
|
67
|
+
input: r(({ id: d, name: c, hasErrors: h, ariaDescribedby: f }) => [
|
|
68
|
+
V(P, $({
|
|
69
|
+
"aria-describedby": f,
|
|
70
|
+
autocomplete: e.autocomplete,
|
|
71
|
+
autofocus: e.autofocus,
|
|
72
|
+
disabled: e.disabled,
|
|
73
|
+
"has-errors": h,
|
|
74
|
+
id: d,
|
|
75
|
+
max: e.max,
|
|
76
|
+
min: e.min,
|
|
77
|
+
"model-value": e.modelValue,
|
|
78
|
+
name: c,
|
|
79
|
+
placeholder: e.placeholder,
|
|
80
|
+
readonly: e.readonly,
|
|
81
|
+
step: e.step
|
|
82
|
+
}, b), {
|
|
83
|
+
"append-outer": r((a) => [
|
|
84
|
+
n(e.$slots, "append-outer", l(s(a)))
|
|
85
|
+
]),
|
|
86
|
+
append: r((a) => [
|
|
87
|
+
n(e.$slots, "append", l(s(a)))
|
|
88
|
+
]),
|
|
89
|
+
prepend: r((a) => [
|
|
90
|
+
n(e.$slots, "prepend", l(s(a)))
|
|
91
|
+
]),
|
|
92
|
+
"prepend-outer": r((a) => [
|
|
93
|
+
n(e.$slots, "prepend-outer", l(s(a)))
|
|
94
|
+
]),
|
|
95
|
+
_: 2
|
|
96
|
+
}, 1040, ["aria-describedby", "autocomplete", "autofocus", "disabled", "has-errors", "id", "max", "min", "model-value", "name", "placeholder", "readonly", "step"])
|
|
97
|
+
]),
|
|
98
|
+
_: 3
|
|
99
|
+
}, 8, ["direction", "errors", "has-errors", "hide-label", "hint", "id", "label-position", "label", "model-value", "name", "reverse", "show-hint"]));
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
export {
|
|
103
|
+
N as default
|
|
104
|
+
};
|
|
2
105
|
//# sourceMappingURL=index74.js.map
|
package/dist/index74.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index74.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index74.js","sources":["../src/components/BbNumberInput/BbNumberInput.vue"],"sourcesContent":["<template>\n\t<BaseInputContainer\n\t\t:direction=\"direction\"\n\t\t:errors=\"errors\"\n\t\t:has-errors=\"hasErrors\"\n\t\t:hide-label=\"hideLabel\"\n\t\t:hint=\"hint\"\n\t\t:id=\"id\"\n\t\t:label-position=\"labelPosition\"\n\t\t:label=\"label\"\n\t\t:model-value=\"modelValue\"\n\t\t:name=\"name\"\n\t\t:reverse=\"reverse\"\n\t\t:show-hint=\"showHint\"\n\t\tclass=\"bb-number-input\"\n\t>\n\t\t<template #label=\"data\"><slot name=\"label\" v-bind=\"data\"></slot></template>\n\t\t<template #input=\"{ id, name, hasErrors, ariaDescribedby }\">\n\t\t\t<BaseNumberInput\n\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t:autocomplete=\"autocomplete\"\n\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t:id=\"id\"\n\t\t\t\t:max=\"max\"\n\t\t\t\t:min=\"min\"\n\t\t\t\t:model-value=\"modelValue\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t:step=\"step\"\n\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t>\n\t\t\t\t<template #append-outer=\"data\"\n\t\t\t\t\t><slot name=\"append-outer\" v-bind=\"data\"\n\t\t\t\t/></template>\n\t\t\t\t<template #append=\"data\"><slot name=\"append\" v-bind=\"data\" /></template>\n\t\t\t\t<template #prepend=\"data\"\n\t\t\t\t\t><slot name=\"prepend\" v-bind=\"data\"\n\t\t\t\t/></template>\n\t\t\t\t<template #prepend-outer=\"data\"\n\t\t\t\t\t><slot name=\"prepend-outer\" v-bind=\"data\"\n\t\t\t\t/></template>\n\t\t\t</BaseNumberInput>\n\t\t</template>\n\t</BaseInputContainer>\n</template>\n\n<script setup lang=\"ts\">\nimport BaseInputContainer from '../BaseInputContainer/BaseInputContainer.vue';\nimport BaseNumberInput from '../BaseNumberInput/BaseNumberInput.vue';\nimport type {\n\tBaseNumberInputEvents,\n\tBaseNumberInputSlots,\n} from '../BaseNumberInput/BaseNumberInput.vue';\nimport {\n\tcomputed,\n\tref,\n\ttype HTMLAttributes,\n\ttype InputHTMLAttributes,\n} from 'vue';\n\nexport type BbNumberInputProps = {\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tautocomplete?: InputHTMLAttributes['autocomplete'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Direction of the layout of the component. Can either be a predefined value or a pattern separated by a space like `xx xxxxx`.\n\t */\n\tdirection?: 'horizontal' | 'vertical' | 'auto' | string;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Can be a string or an array of string containing the messages to display.\n\t */\n\terrors?: string | string[];\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * Visually hides the label of the input while maintaining accessibility.\n\t */\n\thideLabel?: boolean;\n\n\t/**\n\t * Text box to be displayed near the input, usually to indicate instructions.\n\t */\n\thint?: string;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Text content of the label of the element.\n\t */\n\tlabel: string;\n\n\t/**\n\t * Sets the text alignment of the label.\n\t */\n\tlabelPosition?: 'left' | 'center' | 'right';\n\n\t/**\n\t * Maximum value cap\n\t */\n\tmax?: number;\n\n\t/**\n\t * Minimum value cap\n\t */\n\tmin?: number;\n\n\t/**\n\t * Used by v-model\n\t */\n\tmodelValue: number | string | null;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * Keeps the hint displayed.\n\t */\n\tpersistentHint?: boolean;\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n\n\t/**\n\t * Reverses the layout. Applicable in every direction the order of the label and the input is swapped.\n\t */\n\treverse?: boolean;\n\n\t/**\n\t * Incremental unit used in the exposed `increase`\n\t * and `decrease` function. It's NOT APPLIED to manual input as a step of 5\n\t * will prevent the user from inserting a value like `115` because of rounding down.\n\t */\n\tstep?: number;\n};\n\nconst props = withDefaults(defineProps<BbNumberInputProps>(), {});\n\nexport type BbNumberInputEvents = BaseNumberInputEvents;\n\nconst emit = defineEmits<BbNumberInputEvents>();\n\ndefineSlots<\n\tBaseNumberInputSlots & {\n\t\tlabel?: (props: { text: string; hasErrors: boolean }) => any;\n\t}\n>();\n\nconst active = ref(false);\nconst showHint = computed(() => props.persistentHint || active.value);\n\n/**\n * These events are just propagated\n */\nconst eventListeners = {\n\tonBlur: (event: FocusEvent) => {\n\t\tactive.value = false;\n\t\temit('blur', event);\n\t},\n\tonChange: (event: Event) => emit('change', event),\n\tonClick: (event: MouseEvent) => emit('click', event),\n\tonDecrease: (event: number) => emit('decrease', event),\n\tonFocus: (event: FocusEvent) => {\n\t\tactive.value = true;\n\t\temit('focus', event);\n\t},\n\tonIncrease: (event: number) => emit('increase', event),\n\tonInput: (event: Event) => emit('input', event),\n\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n\t'onUpdate:modelValue': (value: number | null) =>\n\t\temit('update:modelValue', value),\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbNumberInput';\n</style>\n"],"names":["props","__props","emit","__emit","active","ref","showHint","computed","eventListeners","event","value"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwKA,UAAMA,IAAQC,GAIRC,IAAOC,GAQPC,IAASC,EAAI,EAAK,GAClBC,IAAWC,EAAS,MAAMP,EAAM,kBAAkBI,EAAO,KAAK,GAK9DI,IAAiB;AAAA,MACtB,QAAQ,CAACC,MAAsB;AAC9B,QAAAL,EAAO,QAAQ,IACfF,EAAK,QAAQO,CAAK;AAAA,MACnB;AAAA,MACA,UAAU,CAACA,MAAiBP,EAAK,UAAUO,CAAK;AAAA,MAChD,SAAS,CAACA,MAAsBP,EAAK,SAASO,CAAK;AAAA,MACnD,YAAY,CAACA,MAAkBP,EAAK,YAAYO,CAAK;AAAA,MACrD,SAAS,CAACA,MAAsB;AAC/B,QAAAL,EAAO,QAAQ,IACfF,EAAK,SAASO,CAAK;AAAA,MACpB;AAAA,MACA,YAAY,CAACA,MAAkBP,EAAK,YAAYO,CAAK;AAAA,MACrD,SAAS,CAACA,MAAiBP,EAAK,SAASO,CAAK;AAAA,MAC9C,WAAW,CAACA,MAAyBP,EAAK,WAAWO,CAAK;AAAA,MAC1D,aAAa,CAACA,MAAsBP,EAAK,aAAaO,CAAK;AAAA,MAC3D,WAAW,CAACA,MAAsBP,EAAK,WAAWO,CAAK;AAAA,MACvD,uBAAuB,CAACC,MACvBR,EAAK,qBAAqBQ,CAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index75.js
CHANGED
|
@@ -1,228 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { useFocusTrap as oe } from "./index216.js";
|
|
3
|
-
import { useId as L } from "./index7.js";
|
|
4
|
-
import { wait as O } from "./index122.js";
|
|
5
|
-
const se = { class: "bb-offcanvas-close" }, ae = { class: "bb-offcanvas-close__content" }, ne = { class: "bb-offcanvas-close__label" }, le = /* @__PURE__ */ o("span", { class: "bb-offcanvas-close__icon" }, [
|
|
6
|
-
/* @__PURE__ */ o("svg", {
|
|
7
|
-
fill: "none",
|
|
8
|
-
viewBox: "0 0 24 24",
|
|
9
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
10
|
-
}, [
|
|
11
|
-
/* @__PURE__ */ o("path", {
|
|
12
|
-
d: "M23 23L1 1M23 1L1 23",
|
|
13
|
-
stroke: "currentColor",
|
|
14
|
-
"stroke-linecap": "round",
|
|
15
|
-
"stroke-width": "2"
|
|
16
|
-
})
|
|
17
|
-
])
|
|
18
|
-
], -1), ie = /* @__PURE__ */ o("div", { style: { flex: "10000 10000 0%" } }, null, -1), fe = /* @__PURE__ */ q({
|
|
19
|
-
__name: "BbOffCanvas",
|
|
20
|
-
props: {
|
|
21
|
-
closeLabel: { default: "Chiudi" },
|
|
22
|
-
compact: { type: Boolean },
|
|
23
|
-
disabled: { type: Boolean },
|
|
24
|
-
eager: { type: Boolean },
|
|
25
|
-
panelClasses: { default: () => [] },
|
|
26
|
-
overlayClasses: { default: () => [] },
|
|
27
|
-
persistent: { type: Boolean },
|
|
28
|
-
showClose: { type: Boolean, default: !0 },
|
|
29
|
-
title: {},
|
|
30
|
-
transition: { default: "fade" },
|
|
31
|
-
transitionDuration: { default: 350 },
|
|
32
|
-
size: { default: "sm" },
|
|
33
|
-
description: {},
|
|
34
|
-
fullscreen: { type: Boolean },
|
|
35
|
-
modelValue: { type: [Boolean, null] },
|
|
36
|
-
direction: { default: "left" }
|
|
37
|
-
},
|
|
38
|
-
emits: ["shown", "hidden", "update:modelValue"],
|
|
39
|
-
setup(x, { emit: E }) {
|
|
40
|
-
const e = x, c = E, h = `title_${L().id.value}`, _ = `description_${L().id.value}`, d = s(null), V = s(null), S = s(null), T = s(null), A = s(null), M = s(null), W = G(), { activate: R, deactivate: I } = oe(V, {
|
|
41
|
-
clickOutsideDeactivates: !0,
|
|
42
|
-
/* On esc deactivate the trap, return focus and then close the modal */
|
|
43
|
-
escapeDeactivates: () => (te(() => {
|
|
44
|
-
c("update:modelValue", !1);
|
|
45
|
-
}), !0)
|
|
46
|
-
}), $ = m(() => e.closeLabel), f = s(!1), i = s(!1), g = s(!0), u = s(!1), v = s(e.eager || e.modelValue), C = s(null), F = m(() => i.value || u.value);
|
|
47
|
-
J(() => {
|
|
48
|
-
e.modelValue && !(f.value || i.value) && D();
|
|
49
|
-
}), Q(
|
|
50
|
-
() => e.modelValue,
|
|
51
|
-
() => {
|
|
52
|
-
D();
|
|
53
|
-
}
|
|
54
|
-
), X(() => {
|
|
55
|
-
if (e.modelValue) {
|
|
56
|
-
let t = Number(
|
|
57
|
-
document.body.dataset.openCanvases ?? "0"
|
|
58
|
-
);
|
|
59
|
-
t--, document.body.dataset.openCanvases = t.toString(), t || (document.body.style.overflow = "auto", document.body.style.paddingRight = "0px");
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
const D = async () => {
|
|
63
|
-
if (e.modelValue) {
|
|
64
|
-
v.value || (v.value = !0), document.activeElement && (C.value = document.activeElement), g.value = !1, u.value = !1, i.value = !0;
|
|
65
|
-
let t = Number(
|
|
66
|
-
document.body.dataset.openCanvases ?? "0"
|
|
67
|
-
);
|
|
68
|
-
t++, document.body.dataset.openCanvases = t.toString();
|
|
69
|
-
const a = window.innerWidth - document.documentElement.clientWidth;
|
|
70
|
-
document.body.style.overflow = "hidden", document.body.style.paddingRight = `${a}px`, await O(e.transitionDuration), i.value = !1, f.value = !0, c("shown"), R();
|
|
71
|
-
} else {
|
|
72
|
-
I(), i.value = !1, f.value = !1, u.value = !0, await O(e.transitionDuration);
|
|
73
|
-
let t = Number(
|
|
74
|
-
document.body.dataset.openCanvases ?? "0"
|
|
75
|
-
);
|
|
76
|
-
t--, document.body.dataset.openCanvases = t.toString(), t || (document.body.style.overflow = "auto", document.body.style.paddingRight = "0px"), u.value = !1, g.value = !0, c("hidden"), C.value instanceof HTMLElement && C.value.focus();
|
|
77
|
-
}
|
|
78
|
-
}, p = (t) => {
|
|
79
|
-
t.target === d.value && t.preventDefault();
|
|
80
|
-
}, H = (t) => {
|
|
81
|
-
e.disabled || F.value || d.value && t.target === d.value && (e.persistent || c("update:modelValue", !1));
|
|
82
|
-
}, k = () => {
|
|
83
|
-
e.disabled || c("update:modelValue", !1);
|
|
84
|
-
}, K = m(() => {
|
|
85
|
-
const t = [
|
|
86
|
-
{
|
|
87
|
-
"bb-offcanvas bb-offcanvas__overlay": !0,
|
|
88
|
-
"bb-offcanvas--fullscreen": e.fullscreen,
|
|
89
|
-
"bb-offcanvas--open": f.value,
|
|
90
|
-
"bb-offcanvas--opening": i.value,
|
|
91
|
-
"bb-offcanvas--closed": g.value,
|
|
92
|
-
"bb-offcanvas--closing": u.value,
|
|
93
|
-
[`bb-offcanvas--transition-${e.transition}`]: !0,
|
|
94
|
-
[`bb-offcanvas--${e.direction}`]: !0
|
|
95
|
-
},
|
|
96
|
-
e.overlayClasses
|
|
97
|
-
].flat(), a = {
|
|
98
|
-
onClick: H,
|
|
99
|
-
onScroll: p,
|
|
100
|
-
onTouchmove: p,
|
|
101
|
-
onWheel: p,
|
|
102
|
-
onKeydown: p
|
|
103
|
-
}, n = {
|
|
104
|
-
transitionDuration: e.transitionDuration / 1e3 + "s"
|
|
105
|
-
};
|
|
106
|
-
return {
|
|
107
|
-
class: t,
|
|
108
|
-
style: n,
|
|
109
|
-
...a,
|
|
110
|
-
...W
|
|
111
|
-
};
|
|
112
|
-
}), P = m(() => {
|
|
113
|
-
const t = [
|
|
114
|
-
{
|
|
115
|
-
"bb-offcanvas__panel": !0,
|
|
116
|
-
"bb-offcanvas__panel--compact": e.compact
|
|
117
|
-
},
|
|
118
|
-
e.panelClasses
|
|
119
|
-
].flat(), a = {
|
|
120
|
-
role: "dialog",
|
|
121
|
-
"aria-modal": !0
|
|
122
|
-
};
|
|
123
|
-
v.value && (a["aria-labelledby"] = h, e.description && (a["aria-describedby"] = _));
|
|
124
|
-
let n, U, r;
|
|
125
|
-
const b = {
|
|
126
|
-
sm: 384,
|
|
127
|
-
md: 652,
|
|
128
|
-
lg: 896
|
|
129
|
-
};
|
|
130
|
-
e.direction === "left" || e.direction === "right" ? e.fullscreen ? n = "100%" : typeof e.size == "number" ? n = e.size + "px" : e.size in b ? n = b[e.size] + "px" : n = e.size + "px" : e.fullscreen ? r = "100%" : typeof e.size == "number" ? r = e.size + "px" : e.size in b ? r = b[e.size] + "px" : Number.isNaN(Number(e.size)) ? e.size === "auto" && (r = "auto") : r = e.size + "px";
|
|
131
|
-
const j = {
|
|
132
|
-
maxWidth: n,
|
|
133
|
-
maxHeight: U,
|
|
134
|
-
height: r,
|
|
135
|
-
transitionDuration: e.transitionDuration / 1e3 + "s"
|
|
136
|
-
};
|
|
137
|
-
return {
|
|
138
|
-
class: t,
|
|
139
|
-
style: j,
|
|
140
|
-
...a
|
|
141
|
-
};
|
|
142
|
-
});
|
|
143
|
-
return (t, a) => (y(), Y(Z, { to: "body" }, [
|
|
144
|
-
o("div", N(K.value, {
|
|
145
|
-
ref_key: "overlay",
|
|
146
|
-
ref: d
|
|
147
|
-
}), [
|
|
148
|
-
o("div", N(P.value, {
|
|
149
|
-
ref_key: "panel",
|
|
150
|
-
ref: V
|
|
151
|
-
}), [
|
|
152
|
-
v.value ? (y(), w("div", {
|
|
153
|
-
key: 0,
|
|
154
|
-
ref_key: "content",
|
|
155
|
-
ref: S,
|
|
156
|
-
class: "bb-offcanvas__content"
|
|
157
|
-
}, [
|
|
158
|
-
l(t.$slots, "content", { close: k }, () => [
|
|
159
|
-
o("div", {
|
|
160
|
-
ref_key: "header",
|
|
161
|
-
ref: T,
|
|
162
|
-
class: "bb-offcanvas__header"
|
|
163
|
-
}, [
|
|
164
|
-
l(t.$slots, "header", {
|
|
165
|
-
close: k,
|
|
166
|
-
title: t.title,
|
|
167
|
-
titleId: h
|
|
168
|
-
}, () => [
|
|
169
|
-
o("span", {
|
|
170
|
-
id: h,
|
|
171
|
-
class: "bb-offcanvas__title"
|
|
172
|
-
}, [
|
|
173
|
-
l(t.$slots, "title", { text: t.title }, () => [
|
|
174
|
-
ee(z(t.title), 1)
|
|
175
|
-
])
|
|
176
|
-
]),
|
|
177
|
-
o("span", se, [
|
|
178
|
-
t.showClose ? (y(), w("button", {
|
|
179
|
-
key: 0,
|
|
180
|
-
type: "button",
|
|
181
|
-
onClick: k
|
|
182
|
-
}, [
|
|
183
|
-
l(t.$slots, "close", { text: $.value }, () => [
|
|
184
|
-
o("span", ae, [
|
|
185
|
-
o("span", ne, z($.value), 1),
|
|
186
|
-
le
|
|
187
|
-
])
|
|
188
|
-
])
|
|
189
|
-
])) : B("", !0)
|
|
190
|
-
])
|
|
191
|
-
])
|
|
192
|
-
], 512),
|
|
193
|
-
o("div", {
|
|
194
|
-
ref_key: "body",
|
|
195
|
-
ref: A,
|
|
196
|
-
class: "bb-offcanvas__body"
|
|
197
|
-
}, [
|
|
198
|
-
l(t.$slots, "description", {
|
|
199
|
-
descriptionId: _,
|
|
200
|
-
text: t.description
|
|
201
|
-
}, () => [
|
|
202
|
-
t.description ? (y(), w("div", {
|
|
203
|
-
key: 0,
|
|
204
|
-
id: _,
|
|
205
|
-
class: "bb-offcanvas__description"
|
|
206
|
-
}, z(t.description), 1)) : B("", !0)
|
|
207
|
-
]),
|
|
208
|
-
l(t.$slots, "default")
|
|
209
|
-
], 512),
|
|
210
|
-
ie,
|
|
211
|
-
o("div", {
|
|
212
|
-
ref_key: "footer",
|
|
213
|
-
ref: M,
|
|
214
|
-
class: "bb-offcanvas__footer"
|
|
215
|
-
}, [
|
|
216
|
-
l(t.$slots, "footer")
|
|
217
|
-
], 512)
|
|
218
|
-
])
|
|
219
|
-
], 512)) : B("", !0)
|
|
220
|
-
], 16)
|
|
221
|
-
], 16)
|
|
222
|
-
]));
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
|
-
export {
|
|
226
|
-
fe as default
|
|
227
|
-
};
|
|
1
|
+
|
|
228
2
|
//# sourceMappingURL=index75.js.map
|
package/dist/index75.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index75.js","sources":["../src/components/BbOffCanvas/BbOffCanvas.vue"],"sourcesContent":["<template>\n\t<teleport to=\"body\">\n\t\t<div v-bind=\"overlayAttributes\" ref=\"overlay\">\n\t\t\t<div v-bind=\"panelAttributes\" ref=\"panel\">\n\t\t\t\t<div\n\t\t\t\t\tv-if=\"hasRenderedAtLeastOnce\"\n\t\t\t\t\tref=\"content\"\n\t\t\t\t\tclass=\"bb-offcanvas__content\"\n\t\t\t\t>\n\t\t\t\t\t<slot :close=\"onCloseClick\" name=\"content\">\n\t\t\t\t\t\t<div ref=\"header\" class=\"bb-offcanvas__header\">\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:close=\"onCloseClick\"\n\t\t\t\t\t\t\t\tname=\"header\"\n\t\t\t\t\t\t\t\t:title=\"title\"\n\t\t\t\t\t\t\t\t:title-id=\"titleId\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<span :id=\"titleId\" class=\"bb-offcanvas__title\">\n\t\t\t\t\t\t\t\t\t<slot name=\"title\" :text=\"title\">{{ title }}</slot>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span class=\"bb-offcanvas-close\">\n\t\t\t\t\t\t\t\t\t<button v-if=\"showClose\" type=\"button\" @click=\"onCloseClick\">\n\t\t\t\t\t\t\t\t\t\t<slot name=\"close\" :text=\"closeLabel\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"bb-offcanvas-close__content\">\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"bb-offcanvas-close__label\">{{\n\t\t\t\t\t\t\t\t\t\t\t\t\tcloseLabel\n\t\t\t\t\t\t\t\t\t\t\t\t}}</span>\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"bb-offcanvas-close__icon\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t><svg\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\td=\"M23 23L1 1M23 1L1 23\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div ref=\"body\" class=\"bb-offcanvas__body\">\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:description-id=\"descriptionId\"\n\t\t\t\t\t\t\t\tname=\"description\"\n\t\t\t\t\t\t\t\t:text=\"description\"\n\t\t\t\t\t\t\t\t><div\n\t\t\t\t\t\t\t\t\tv-if=\"description\"\n\t\t\t\t\t\t\t\t\t:id=\"descriptionId\"\n\t\t\t\t\t\t\t\t\tclass=\"bb-offcanvas__description\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{{ description }}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style=\"flex: 10000 10000 0%\"></div>\n\t\t\t\t\t\t<div ref=\"footer\" class=\"bb-offcanvas__footer\">\n\t\t\t\t\t\t\t<slot name=\"footer\"></slot>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</slot>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</teleport>\n</template>\n\n<script setup lang=\"ts\">\nimport {\n\tcomputed,\n\tnextTick,\n\tonBeforeUnmount,\n\tonMounted,\n\tref,\n\tuseAttrs,\n\twatch,\n} from 'vue';\nimport { useFocusTrap } from '@vueuse/integrations/useFocusTrap';\nimport { useId } from '@/composables/useId';\nimport { wait } from '@/utilities/functions/wait';\nimport type { CommonProps, Size } from '@/types/CommonProps';\n\nexport type Sizes = {\n\tsm: number;\n\tmd: number;\n\tlg: number;\n};\n\nexport type BbOffCanvasProps = Pick<\n\tCommonProps,\n\t| 'closeLabel'\n\t| 'compact'\n\t| 'disabled'\n\t| 'eager'\n\t| 'panelClasses'\n\t| 'overlayClasses'\n\t| 'persistent'\n\t| 'showClose'\n\t| 'title'\n\t| 'transition'\n\t| 'transitionDuration'\n> &\n\tSize<Sizes> & {\n\t\t/**\n\t\t * Description of the content of the modal. Extremely useful for accessibility reasons.\n\t\t */\n\t\tdescription?: string;\n\t\t/**\n\t\t * Displays the modala as fulscreen with no margin to the page\n\t\t */\n\t\tfullscreen?: boolean;\n\t\t/**\n\t\t * Defines the state open / closed of the modal.\n\t\t */\n\t\tmodelValue?: boolean | null;\n\t\t/**\n\t\t * Defines the direction the offcanvas should appear from\n\t\t */\n\t\tdirection?: 'left' | 'top' | 'right' | 'bottom';\n\t};\n\nconst props = withDefaults(defineProps<BbOffCanvasProps>(), {\n\tcloseLabel: 'Chiudi',\n\tdirection: 'left',\n\tshowClose: true,\n\tsize: 'sm',\n\ttransition: 'fade',\n\ttransitionDuration: 350,\n\tpanelClasses: () => [],\n\toverlayClasses: () => [],\n});\n\nexport type BbOffCanvasEvents = {\n\t(e: 'shown'): void;\n\t(e: 'hidden'): void;\n\t(e: 'update:modelValue', value: boolean): void;\n};\n\nconst emit = defineEmits<BbOffCanvasEvents>();\n\nexport type BbOffCanvasSlots = {\n\theader?: (props: {\n\t\ttitleId: typeof titleId;\n\t\tclose: typeof onCloseClick;\n\t\ttitle: BbOffCanvasProps['title'];\n\t}) => any;\n\ttitle?: (props: { text: BbOffCanvasProps['title'] }) => any;\n\tclose?: (props: { text: BbOffCanvasProps['closeLabel'] }) => any;\n\tdescription?: (props: {\n\t\tdescriptionId: typeof descriptionId;\n\t\ttext: BbOffCanvasProps['description'];\n\t}) => any;\n\tdefault?: (props: object) => any;\n\tcontent?: (props: { close: typeof onCloseClick }) => any;\n\tfooter?: (props: object) => any;\n};\n\ndefineSlots<BbOffCanvasSlots>();\n\nconst titleId = `title_${useId().id.value}`;\nconst descriptionId = `description_${useId().id.value}`;\n\nconst overlay = ref<HTMLElement | null>(null);\nconst panel = ref<HTMLElement | null>(null);\nconst content = ref<HTMLElement | null>(null);\nconst header = ref<HTMLElement | null>(null);\nconst body = ref<HTMLElement | null>(null);\nconst footer = ref<HTMLElement | null>(null);\nconst attrs = useAttrs();\n\nconst { activate, deactivate } = useFocusTrap(panel, {\n\tclickOutsideDeactivates: true,\n\t/* On esc deactivate the trap, return focus and then close the modal */\n\tescapeDeactivates: () => {\n\t\tnextTick(() => {\n\t\t\temit('update:modelValue', false);\n\t\t});\n\t\treturn true;\n\t},\n});\n\nconst closeLabel = computed(() => props.closeLabel);\n\nconst open = ref(false);\nconst opening = ref(false);\nconst closed = ref(true);\nconst closing = ref(false);\nconst hasRenderedAtLeastOnce = ref(props.eager || props.modelValue);\nconst lastFocusedElement = ref<Element | null>(null);\n\nconst busy = computed(() => opening.value || closing.value);\n\nonMounted(() => {\n\t/**\n\t * Do not realign if open or opening\n\t */\n\tif (props.modelValue && !(open.value || opening.value)) {\n\t\talignToModelValue();\n\t}\n});\n\n/**\n * Every time modelValue changes align the display to it\n */\nwatch(\n\t() => props.modelValue,\n\t() => {\n\t\talignToModelValue();\n\t}\n);\nonBeforeUnmount(() => {\n\tif (props.modelValue) {\n\t\tlet currentlyOpenCanvases = Number(\n\t\t\tdocument.body.dataset['openCanvases'] ?? '0'\n\t\t);\n\t\t// This prevents overscroll chaining (additional scrolling to the body when the modal has been completely scrolled)\n\t\tcurrentlyOpenCanvases--;\n\t\tdocument.body.dataset['openCanvases'] = currentlyOpenCanvases.toString();\n\t\tif (!currentlyOpenCanvases) {\n\t\t\tdocument.body.style.overflow = 'auto';\n\t\t\tdocument.body.style.paddingRight = '0px';\n\t\t}\n\t}\n});\n\n/**\n * When modelValue becomes true if the component wasn't rendered render it\n * and wait for it to be on the page (or transitions would not work).\n * Stash the latest focused element so we can return it later when it closes.\n * Focus on the panel upon opening.\n * ---\n * Notice all interactions update modelValue and then this function aligns the display to it\n */\nconst alignToModelValue = async () => {\n\tif (props.modelValue) {\n\t\tif (!hasRenderedAtLeastOnce.value) {\n\t\t\thasRenderedAtLeastOnce.value = true;\n\t\t}\n\t\tif (document.activeElement) {\n\t\t\tlastFocusedElement.value = document.activeElement;\n\t\t}\n\n\t\tclosed.value = false;\n\t\tclosing.value = false;\n\t\topening.value = true;\n\n\t\t// This prevents overscroll chaining (additional scrolling to the body when the modal has been completely scrolled)\n\n\t\tlet currentlyOpenCanvases = Number(\n\t\t\tdocument.body.dataset['openCanvases'] ?? '0'\n\t\t);\n\t\tcurrentlyOpenCanvases++;\n\t\tdocument.body.dataset['openCanvases'] = currentlyOpenCanvases.toString();\n\t\tconst scrollBarWidth =\n\t\t\twindow.innerWidth - document.documentElement.clientWidth;\n\t\tdocument.body.style.overflow = 'hidden';\n\t\tdocument.body.style.paddingRight = `${scrollBarWidth}px`;\n\n\t\tawait wait(props.transitionDuration);\n\n\t\topening.value = false;\n\t\topen.value = true;\n\t\temit('shown');\n\t\tactivate();\n\t} else {\n\t\tdeactivate();\n\t\topening.value = false;\n\t\topen.value = false;\n\t\tclosing.value = true;\n\n\t\tawait wait(props.transitionDuration);\n\n\t\tlet currentlyOpenCanvases = Number(\n\t\t\tdocument.body.dataset['openCanvases'] ?? '0'\n\t\t);\n\t\t// This prevents overscroll chaining (additional scrolling to the body when the modal has been completely scrolled)\n\t\tcurrentlyOpenCanvases--;\n\t\tdocument.body.dataset['openCanvases'] = currentlyOpenCanvases.toString();\n\t\tif (!currentlyOpenCanvases) {\n\t\t\tdocument.body.style.overflow = 'auto';\n\t\t\tdocument.body.style.paddingRight = '0px';\n\t\t}\n\t\tclosing.value = false;\n\t\tclosed.value = true;\n\t\temit('hidden');\n\t\tif (lastFocusedElement.value instanceof HTMLElement) {\n\t\t\tlastFocusedElement.value.focus();\n\t\t}\n\t}\n};\n\n/**\n * Disable scrolling\n */\nconst onOverlayScroll = (event: UIEvent) => {\n\tif (event.target === overlay.value) {\n\t\tevent.preventDefault();\n\t}\n};\n\n/**\n * Close the modal on overlay click if not persistent\n */\nconst onOverlayClick = (event: MouseEvent) => {\n\tif (props.disabled || busy.value) return;\n\tif (overlay.value) {\n\t\tif (event.target === overlay.value) {\n\t\t\tif (!props.persistent) {\n\t\t\t\temit('update:modelValue', false);\n\t\t\t}\n\t\t}\n\t}\n};\n\n/**\n * On click on the X button\n */\nconst onCloseClick = () => {\n\tif (props.disabled) return;\n\temit('update:modelValue', false);\n};\n\nconst overlayAttributes = computed(() => {\n\tconst classes = [\n\t\t{\n\t\t\t'bb-offcanvas bb-offcanvas__overlay': true,\n\t\t\t'bb-offcanvas--fullscreen': props.fullscreen,\n\t\t\t'bb-offcanvas--open': open.value,\n\t\t\t'bb-offcanvas--opening': opening.value,\n\t\t\t'bb-offcanvas--closed': closed.value,\n\t\t\t'bb-offcanvas--closing': closing.value,\n\t\t\t[`bb-offcanvas--transition-${props.transition}`]: true,\n\t\t\t[`bb-offcanvas--${props.direction}`]: true,\n\t\t},\n\t\tprops.overlayClasses,\n\t].flat();\n\tconst eventListeners = {\n\t\tonClick: onOverlayClick,\n\t\tonScroll: onOverlayScroll,\n\t\tonTouchmove: onOverlayScroll,\n\t\tonWheel: onOverlayScroll,\n\t\tonKeydown: onOverlayScroll,\n\t};\n\n\tconst style = {\n\t\ttransitionDuration: props.transitionDuration / 1000 + 's',\n\t};\n\treturn {\n\t\tclass: classes,\n\t\tstyle,\n\t\t...eventListeners,\n\t\t...attrs,\n\t};\n});\n\nconst panelAttributes = computed(() => {\n\tconst classes = [\n\t\t{\n\t\t\t'bb-offcanvas__panel': true,\n\t\t\t'bb-offcanvas__panel--compact': props.compact,\n\t\t},\n\t\tprops.panelClasses,\n\t].flat();\n\n\tconst accessibilityAttrs: {\n\t\t[key: string]: string | boolean;\n\t} = {\n\t\trole: 'dialog',\n\t\t'aria-modal': true,\n\t};\n\n\tif (hasRenderedAtLeastOnce.value) {\n\t\taccessibilityAttrs['aria-labelledby'] = titleId;\n\n\t\tif (props.description)\n\t\t\taccessibilityAttrs['aria-describedby'] = descriptionId;\n\t}\n\n\tlet maxWidth;\n\tlet maxHeight;\n\tlet height;\n\tconst sizes: Sizes = {\n\t\tsm: 384,\n\t\tmd: 652,\n\t\tlg: 896,\n\t};\n\tif (props.direction === 'left' || props.direction === 'right') {\n\t\tif (props.fullscreen) maxWidth = '100%';\n\t\telse if (typeof props.size === 'number') maxWidth = props.size + 'px';\n\t\telse if (props.size in sizes)\n\t\t\tmaxWidth = sizes[props.size as keyof Sizes] + 'px';\n\t\telse maxWidth = props.size + 'px';\n\t} else {\n\t\tif (props.fullscreen) height = '100%';\n\t\telse if (typeof props.size === 'number') height = props.size + 'px';\n\t\telse if (props.size in sizes)\n\t\t\theight = sizes[props.size as keyof Sizes] + 'px';\n\t\telse if (!Number.isNaN(Number(props.size))) height = props.size + 'px';\n\t\telse if (props.size === 'auto') height = 'auto';\n\t}\n\n\tconst style = {\n\t\tmaxWidth,\n\t\tmaxHeight,\n\t\theight,\n\t\ttransitionDuration: props.transitionDuration / 1000 + 's',\n\t};\n\n\treturn {\n\t\tclass: classes,\n\t\tstyle,\n\t\t...accessibilityAttrs,\n\t};\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbOffCanvas';\n</style>\n"],"names":["props","__props","emit","__emit","titleId","useId","descriptionId","overlay","ref","panel","content","header","body","footer","attrs","useAttrs","activate","deactivate","useFocusTrap","nextTick","closeLabel","computed","open","opening","closed","closing","hasRenderedAtLeastOnce","lastFocusedElement","busy","onMounted","alignToModelValue","watch","onBeforeUnmount","currentlyOpenCanvases","scrollBarWidth","wait","onOverlayScroll","event","onOverlayClick","onCloseClick","overlayAttributes","classes","eventListeners","style","panelAttributes","accessibilityAttrs","maxWidth","maxHeight","height","sizes"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index75.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/index76.js
CHANGED
|
@@ -1,2 +1,228 @@
|
|
|
1
|
-
|
|
1
|
+
import { defineComponent as q, ref as s, useAttrs as G, computed as m, onMounted as J, watch as Q, onBeforeUnmount as X, openBlock as y, createBlock as Y, Teleport as Z, createElementVNode as o, mergeProps as N, createElementBlock as w, renderSlot as l, createTextVNode as ee, toDisplayString as z, createCommentVNode as B, nextTick as te } from "vue";
|
|
2
|
+
import { useFocusTrap as oe } from "./index211.js";
|
|
3
|
+
import { useId as L } from "./index8.js";
|
|
4
|
+
import { wait as O } from "./index123.js";
|
|
5
|
+
const se = { class: "bb-offcanvas-close" }, ae = { class: "bb-offcanvas-close__content" }, ne = { class: "bb-offcanvas-close__label" }, le = /* @__PURE__ */ o("span", { class: "bb-offcanvas-close__icon" }, [
|
|
6
|
+
/* @__PURE__ */ o("svg", {
|
|
7
|
+
fill: "none",
|
|
8
|
+
viewBox: "0 0 24 24",
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
10
|
+
}, [
|
|
11
|
+
/* @__PURE__ */ o("path", {
|
|
12
|
+
d: "M23 23L1 1M23 1L1 23",
|
|
13
|
+
stroke: "currentColor",
|
|
14
|
+
"stroke-linecap": "round",
|
|
15
|
+
"stroke-width": "2"
|
|
16
|
+
})
|
|
17
|
+
])
|
|
18
|
+
], -1), ie = /* @__PURE__ */ o("div", { style: { flex: "10000 10000 0%" } }, null, -1), fe = /* @__PURE__ */ q({
|
|
19
|
+
__name: "BbOffCanvas",
|
|
20
|
+
props: {
|
|
21
|
+
closeLabel: { default: "Chiudi" },
|
|
22
|
+
compact: { type: Boolean },
|
|
23
|
+
disabled: { type: Boolean },
|
|
24
|
+
eager: { type: Boolean },
|
|
25
|
+
panelClasses: { default: () => [] },
|
|
26
|
+
overlayClasses: { default: () => [] },
|
|
27
|
+
persistent: { type: Boolean },
|
|
28
|
+
showClose: { type: Boolean, default: !0 },
|
|
29
|
+
title: {},
|
|
30
|
+
transition: { default: "fade" },
|
|
31
|
+
transitionDuration: { default: 350 },
|
|
32
|
+
size: { default: "sm" },
|
|
33
|
+
description: {},
|
|
34
|
+
fullscreen: { type: Boolean },
|
|
35
|
+
modelValue: { type: [Boolean, null] },
|
|
36
|
+
direction: { default: "left" }
|
|
37
|
+
},
|
|
38
|
+
emits: ["shown", "hidden", "update:modelValue"],
|
|
39
|
+
setup(x, { emit: E }) {
|
|
40
|
+
const e = x, c = E, h = `title_${L().id.value}`, _ = `description_${L().id.value}`, d = s(null), V = s(null), S = s(null), T = s(null), A = s(null), M = s(null), W = G(), { activate: R, deactivate: I } = oe(V, {
|
|
41
|
+
clickOutsideDeactivates: !0,
|
|
42
|
+
/* On esc deactivate the trap, return focus and then close the modal */
|
|
43
|
+
escapeDeactivates: () => (te(() => {
|
|
44
|
+
c("update:modelValue", !1);
|
|
45
|
+
}), !0)
|
|
46
|
+
}), $ = m(() => e.closeLabel), f = s(!1), i = s(!1), g = s(!0), u = s(!1), v = s(e.eager || e.modelValue), C = s(null), F = m(() => i.value || u.value);
|
|
47
|
+
J(() => {
|
|
48
|
+
e.modelValue && !(f.value || i.value) && D();
|
|
49
|
+
}), Q(
|
|
50
|
+
() => e.modelValue,
|
|
51
|
+
() => {
|
|
52
|
+
D();
|
|
53
|
+
}
|
|
54
|
+
), X(() => {
|
|
55
|
+
if (e.modelValue) {
|
|
56
|
+
let t = Number(
|
|
57
|
+
document.body.dataset.openCanvases ?? "0"
|
|
58
|
+
);
|
|
59
|
+
t--, document.body.dataset.openCanvases = t.toString(), t || (document.body.style.overflow = "auto", document.body.style.paddingRight = "0px");
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
const D = async () => {
|
|
63
|
+
if (e.modelValue) {
|
|
64
|
+
v.value || (v.value = !0), document.activeElement && (C.value = document.activeElement), g.value = !1, u.value = !1, i.value = !0;
|
|
65
|
+
let t = Number(
|
|
66
|
+
document.body.dataset.openCanvases ?? "0"
|
|
67
|
+
);
|
|
68
|
+
t++, document.body.dataset.openCanvases = t.toString();
|
|
69
|
+
const a = window.innerWidth - document.documentElement.clientWidth;
|
|
70
|
+
document.body.style.overflow = "hidden", document.body.style.paddingRight = `${a}px`, await O(e.transitionDuration), i.value = !1, f.value = !0, c("shown"), R();
|
|
71
|
+
} else {
|
|
72
|
+
I(), i.value = !1, f.value = !1, u.value = !0, await O(e.transitionDuration);
|
|
73
|
+
let t = Number(
|
|
74
|
+
document.body.dataset.openCanvases ?? "0"
|
|
75
|
+
);
|
|
76
|
+
t--, document.body.dataset.openCanvases = t.toString(), t || (document.body.style.overflow = "auto", document.body.style.paddingRight = "0px"), u.value = !1, g.value = !0, c("hidden"), C.value instanceof HTMLElement && C.value.focus();
|
|
77
|
+
}
|
|
78
|
+
}, p = (t) => {
|
|
79
|
+
t.target === d.value && t.preventDefault();
|
|
80
|
+
}, H = (t) => {
|
|
81
|
+
e.disabled || F.value || d.value && t.target === d.value && (e.persistent || c("update:modelValue", !1));
|
|
82
|
+
}, k = () => {
|
|
83
|
+
e.disabled || c("update:modelValue", !1);
|
|
84
|
+
}, K = m(() => {
|
|
85
|
+
const t = [
|
|
86
|
+
{
|
|
87
|
+
"bb-offcanvas bb-offcanvas__overlay": !0,
|
|
88
|
+
"bb-offcanvas--fullscreen": e.fullscreen,
|
|
89
|
+
"bb-offcanvas--open": f.value,
|
|
90
|
+
"bb-offcanvas--opening": i.value,
|
|
91
|
+
"bb-offcanvas--closed": g.value,
|
|
92
|
+
"bb-offcanvas--closing": u.value,
|
|
93
|
+
[`bb-offcanvas--transition-${e.transition}`]: !0,
|
|
94
|
+
[`bb-offcanvas--${e.direction}`]: !0
|
|
95
|
+
},
|
|
96
|
+
e.overlayClasses
|
|
97
|
+
].flat(), a = {
|
|
98
|
+
onClick: H,
|
|
99
|
+
onScroll: p,
|
|
100
|
+
onTouchmove: p,
|
|
101
|
+
onWheel: p,
|
|
102
|
+
onKeydown: p
|
|
103
|
+
}, n = {
|
|
104
|
+
transitionDuration: e.transitionDuration / 1e3 + "s"
|
|
105
|
+
};
|
|
106
|
+
return {
|
|
107
|
+
class: t,
|
|
108
|
+
style: n,
|
|
109
|
+
...a,
|
|
110
|
+
...W
|
|
111
|
+
};
|
|
112
|
+
}), P = m(() => {
|
|
113
|
+
const t = [
|
|
114
|
+
{
|
|
115
|
+
"bb-offcanvas__panel": !0,
|
|
116
|
+
"bb-offcanvas__panel--compact": e.compact
|
|
117
|
+
},
|
|
118
|
+
e.panelClasses
|
|
119
|
+
].flat(), a = {
|
|
120
|
+
role: "dialog",
|
|
121
|
+
"aria-modal": !0
|
|
122
|
+
};
|
|
123
|
+
v.value && (a["aria-labelledby"] = h, e.description && (a["aria-describedby"] = _));
|
|
124
|
+
let n, U, r;
|
|
125
|
+
const b = {
|
|
126
|
+
sm: 384,
|
|
127
|
+
md: 652,
|
|
128
|
+
lg: 896
|
|
129
|
+
};
|
|
130
|
+
e.direction === "left" || e.direction === "right" ? e.fullscreen ? n = "100%" : typeof e.size == "number" ? n = e.size + "px" : e.size in b ? n = b[e.size] + "px" : n = e.size + "px" : e.fullscreen ? r = "100%" : typeof e.size == "number" ? r = e.size + "px" : e.size in b ? r = b[e.size] + "px" : Number.isNaN(Number(e.size)) ? e.size === "auto" && (r = "auto") : r = e.size + "px";
|
|
131
|
+
const j = {
|
|
132
|
+
maxWidth: n,
|
|
133
|
+
maxHeight: U,
|
|
134
|
+
height: r,
|
|
135
|
+
transitionDuration: e.transitionDuration / 1e3 + "s"
|
|
136
|
+
};
|
|
137
|
+
return {
|
|
138
|
+
class: t,
|
|
139
|
+
style: j,
|
|
140
|
+
...a
|
|
141
|
+
};
|
|
142
|
+
});
|
|
143
|
+
return (t, a) => (y(), Y(Z, { to: "body" }, [
|
|
144
|
+
o("div", N(K.value, {
|
|
145
|
+
ref_key: "overlay",
|
|
146
|
+
ref: d
|
|
147
|
+
}), [
|
|
148
|
+
o("div", N(P.value, {
|
|
149
|
+
ref_key: "panel",
|
|
150
|
+
ref: V
|
|
151
|
+
}), [
|
|
152
|
+
v.value ? (y(), w("div", {
|
|
153
|
+
key: 0,
|
|
154
|
+
ref_key: "content",
|
|
155
|
+
ref: S,
|
|
156
|
+
class: "bb-offcanvas__content"
|
|
157
|
+
}, [
|
|
158
|
+
l(t.$slots, "content", { close: k }, () => [
|
|
159
|
+
o("div", {
|
|
160
|
+
ref_key: "header",
|
|
161
|
+
ref: T,
|
|
162
|
+
class: "bb-offcanvas__header"
|
|
163
|
+
}, [
|
|
164
|
+
l(t.$slots, "header", {
|
|
165
|
+
close: k,
|
|
166
|
+
title: t.title,
|
|
167
|
+
titleId: h
|
|
168
|
+
}, () => [
|
|
169
|
+
o("span", {
|
|
170
|
+
id: h,
|
|
171
|
+
class: "bb-offcanvas__title"
|
|
172
|
+
}, [
|
|
173
|
+
l(t.$slots, "title", { text: t.title }, () => [
|
|
174
|
+
ee(z(t.title), 1)
|
|
175
|
+
])
|
|
176
|
+
]),
|
|
177
|
+
o("span", se, [
|
|
178
|
+
t.showClose ? (y(), w("button", {
|
|
179
|
+
key: 0,
|
|
180
|
+
type: "button",
|
|
181
|
+
onClick: k
|
|
182
|
+
}, [
|
|
183
|
+
l(t.$slots, "close", { text: $.value }, () => [
|
|
184
|
+
o("span", ae, [
|
|
185
|
+
o("span", ne, z($.value), 1),
|
|
186
|
+
le
|
|
187
|
+
])
|
|
188
|
+
])
|
|
189
|
+
])) : B("", !0)
|
|
190
|
+
])
|
|
191
|
+
])
|
|
192
|
+
], 512),
|
|
193
|
+
o("div", {
|
|
194
|
+
ref_key: "body",
|
|
195
|
+
ref: A,
|
|
196
|
+
class: "bb-offcanvas__body"
|
|
197
|
+
}, [
|
|
198
|
+
l(t.$slots, "description", {
|
|
199
|
+
descriptionId: _,
|
|
200
|
+
text: t.description
|
|
201
|
+
}, () => [
|
|
202
|
+
t.description ? (y(), w("div", {
|
|
203
|
+
key: 0,
|
|
204
|
+
id: _,
|
|
205
|
+
class: "bb-offcanvas__description"
|
|
206
|
+
}, z(t.description), 1)) : B("", !0)
|
|
207
|
+
]),
|
|
208
|
+
l(t.$slots, "default")
|
|
209
|
+
], 512),
|
|
210
|
+
ie,
|
|
211
|
+
o("div", {
|
|
212
|
+
ref_key: "footer",
|
|
213
|
+
ref: M,
|
|
214
|
+
class: "bb-offcanvas__footer"
|
|
215
|
+
}, [
|
|
216
|
+
l(t.$slots, "footer")
|
|
217
|
+
], 512)
|
|
218
|
+
])
|
|
219
|
+
], 512)) : B("", !0)
|
|
220
|
+
], 16)
|
|
221
|
+
], 16)
|
|
222
|
+
]));
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
export {
|
|
226
|
+
fe as default
|
|
227
|
+
};
|
|
2
228
|
//# sourceMappingURL=index76.js.map
|