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/index198.js
CHANGED
package/dist/index198.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index198.js","sources":["../src/utilities/functions/
|
|
1
|
+
{"version":3,"file":"index198.js","sources":["../src/utilities/functions/isCssColor.ts"],"sourcesContent":["/**\n * Taken from vuetify colorable mixin\n * https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/mixins/colorable/index.ts\n */\nexport const isCssColor = (color: string): boolean => {\n\treturn !!color && !!color.match(/^(#|var\\(--|(rgb|hsl)a?\\()/);\n};\n"],"names":["isCssColor","color"],"mappings":"AAIa,MAAAA,IAAa,CAACC,MACnB,CAAC,CAACA,KAAS,CAAC,CAACA,EAAM,MAAM,4BAA4B;"}
|
package/dist/index199.js
CHANGED
package/dist/index199.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index199.js","sources":["../src/utilities/functions/
|
|
1
|
+
{"version":3,"file":"index199.js","sources":["../src/utilities/functions/when.ts"],"sourcesContent":["import { curry } from './curry';\n/**\n * Runs fn on item if iteratee(item) is thruthy\n * @param iteratee The test\n * @param item The item to test\n * @param fn The transformer function\n * @returns\n */\nexport const baseWhen = <T, U>(\n\titeratee: (item: T) => boolean,\n\tfn: (item: T) => U,\n\titem: T\n) => {\n\tif (iteratee(item)) return fn(item);\n\treturn item;\n};\n\nexport const when = curry(baseWhen);\n"],"names":["baseWhen","iteratee","fn","item","when","curry"],"mappings":";AAQO,MAAMA,IAAW,CACvBC,GACAC,GACAC,MAEIF,EAASE,CAAI,IAAUD,EAAGC,CAAI,IAC3BA,GAGKC,IAAOC,EAAML,CAAQ;"}
|
package/dist/index2.js
CHANGED
|
@@ -1,43 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
const b = (l = "bitboss-ui") => {
|
|
3
|
-
let r = 0;
|
|
4
|
-
return { useBroadCastChannel: () => {
|
|
5
|
-
r++;
|
|
6
|
-
const f = i(!1), o = i(), s = {};
|
|
7
|
-
function d(e, n = void 0) {
|
|
8
|
-
o.value && o.value.postMessage({ type: e, params: n });
|
|
9
|
-
}
|
|
10
|
-
const v = () => {
|
|
11
|
-
r--, o.value && !r && o.value.close(), f.value = !0;
|
|
12
|
-
}, p = (e, n, a = {
|
|
13
|
-
removeonUnmount: !0
|
|
14
|
-
}) => {
|
|
15
|
-
var t;
|
|
16
|
-
s[e] === void 0 && (s[e] = []), (t = s[e]) == null || t.push(n), a.removeonUnmount && s[e] && h(() => {
|
|
17
|
-
const c = s[e], u = c.indexOf(n);
|
|
18
|
-
u !== -1 && c.splice(u, 1);
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
try {
|
|
22
|
-
o.value = new BroadcastChannel(l), o.value.addEventListener(
|
|
23
|
-
"message",
|
|
24
|
-
(e) => {
|
|
25
|
-
const n = e.data, a = s[n.type] ?? [];
|
|
26
|
-
"params" in n ? a.forEach((t) => t(n.params)) : a.forEach((t) => t());
|
|
27
|
-
},
|
|
28
|
-
{ passive: !0 }
|
|
29
|
-
);
|
|
30
|
-
} catch (e) {
|
|
31
|
-
console.error(e);
|
|
32
|
-
}
|
|
33
|
-
return {
|
|
34
|
-
on: p,
|
|
35
|
-
post: d,
|
|
36
|
-
close: v
|
|
37
|
-
};
|
|
38
|
-
} };
|
|
39
|
-
};
|
|
40
|
-
export {
|
|
41
|
-
b as useBroadcastChannelInstance
|
|
42
|
-
};
|
|
1
|
+
|
|
43
2
|
//# sourceMappingURL=index2.js.map
|
package/dist/index2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index2.js","sources":[
|
|
1
|
+
{"version":3,"file":"index2.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/index20.js
CHANGED
|
@@ -1,2 +1,240 @@
|
|
|
1
|
-
|
|
1
|
+
import { defineComponent as J, ref as o, useAttrs as Q, computed as h, onMounted as X, onBeforeUnmount as E, watchPostEffect as Y, openBlock as _, createBlock as Z, Teleport as ee, createElementVNode as l, mergeProps as N, createElementBlock as B, renderSlot as i, createTextVNode as te, toDisplayString as V, createCommentVNode as D, nextTick as T } from "vue";
|
|
2
|
+
import { throttle as oe } from "./index219.js";
|
|
3
|
+
import { useFocusTrap as le } from "./index211.js";
|
|
4
|
+
import { useId as A } from "./index8.js";
|
|
5
|
+
import { wait as L } from "./index123.js";
|
|
6
|
+
import { waitFor as ae } from "./index213.js";
|
|
7
|
+
const se = { class: "bb-base-dialog-close" }, ne = { class: "bb-base-dialog-close__content" }, ie = { class: "bb-base-dialog-close__label" }, re = /* @__PURE__ */ l("span", { class: "bb-base-dialog-close__icon" }, [
|
|
8
|
+
/* @__PURE__ */ l("svg", {
|
|
9
|
+
"aria-hidden": "true",
|
|
10
|
+
fill: "none",
|
|
11
|
+
viewBox: "0 0 24 24",
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
13
|
+
}, [
|
|
14
|
+
/* @__PURE__ */ l("path", {
|
|
15
|
+
d: "M23 23L1 1M23 1L1 23",
|
|
16
|
+
stroke: "currentColor",
|
|
17
|
+
"stroke-linecap": "round",
|
|
18
|
+
"stroke-width": "2"
|
|
19
|
+
})
|
|
20
|
+
])
|
|
21
|
+
], -1), de = /* @__PURE__ */ l("div", { style: { flex: "10000 10000 0%" } }, null, -1), me = /* @__PURE__ */ J({
|
|
22
|
+
__name: "BaseDialog",
|
|
23
|
+
props: {
|
|
24
|
+
closeLabel: { default: "Chiudi modale" },
|
|
25
|
+
compact: { type: Boolean },
|
|
26
|
+
disabled: { type: Boolean },
|
|
27
|
+
eager: { type: Boolean },
|
|
28
|
+
panelClasses: { default: () => [] },
|
|
29
|
+
overlayClasses: { default: () => [] },
|
|
30
|
+
persistent: { type: Boolean },
|
|
31
|
+
showClose: { type: Boolean, default: !0 },
|
|
32
|
+
title: {},
|
|
33
|
+
transition: { default: "fade" },
|
|
34
|
+
transitionDuration: { default: 350 },
|
|
35
|
+
size: { default: "sm" },
|
|
36
|
+
description: {},
|
|
37
|
+
fullscreen: { type: Boolean },
|
|
38
|
+
modelValue: { type: [Boolean, null] }
|
|
39
|
+
},
|
|
40
|
+
emits: ["shown", "hidden", "update:modelValue"],
|
|
41
|
+
setup(W, { emit: R }) {
|
|
42
|
+
const t = W, r = R, w = `title_${A().id.value}`, k = `description_${A().id.value}`, p = o(null), m = o(null), $ = o(null), y = o(null), d = o(null), a = o(null), u = o(null), I = o(null), { activate: F, deactivate: z } = le($, {
|
|
43
|
+
clickOutsideDeactivates: !0,
|
|
44
|
+
/* On esc deactivate the trap, return focus and then close the modal */
|
|
45
|
+
escapeDeactivates: () => (T(() => {
|
|
46
|
+
r("update:modelValue", !1);
|
|
47
|
+
}), !0)
|
|
48
|
+
}), P = Q(), H = h(() => t.closeLabel);
|
|
49
|
+
X(async () => {
|
|
50
|
+
a.value && (p.value = new MutationObserver(f), p.value.observe(a.value, { childList: !0, subtree: !0 })), window.addEventListener("resize", f);
|
|
51
|
+
}), E(() => {
|
|
52
|
+
window.removeEventListener("resize", f);
|
|
53
|
+
});
|
|
54
|
+
const C = o(!1), c = o(!1), M = o(!0), b = o(!1), v = o(t.eager || t.modelValue), O = h(() => c.value || b.value);
|
|
55
|
+
E(() => {
|
|
56
|
+
if (t.modelValue) {
|
|
57
|
+
let e = Number(
|
|
58
|
+
document.body.dataset.openModals ?? "0"
|
|
59
|
+
);
|
|
60
|
+
e--, document.body.dataset.openModals = e.toString(), e || (document.body.style.overflow = "auto", document.body.style.paddingRight = "0px");
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
const G = async () => {
|
|
64
|
+
if (t.modelValue) {
|
|
65
|
+
v.value || (v.value = !0, await ae(() => !!a.value), await T(), a.value && (p.value = new MutationObserver(f), p.value.observe(a.value, { childList: !0, subtree: !0 }))), M.value = !1, b.value = !1, c.value = !0;
|
|
66
|
+
let e = Number(
|
|
67
|
+
document.body.dataset.openModals ?? "0"
|
|
68
|
+
);
|
|
69
|
+
e++, document.body.dataset.openModals = e.toString();
|
|
70
|
+
const s = window.innerWidth - document.documentElement.clientWidth;
|
|
71
|
+
document.body.style.overflow = "hidden", document.body.style.paddingRight = `${s}px`, await L(t.transitionDuration), c.value = !1, C.value = !0, r("shown"), F();
|
|
72
|
+
} else {
|
|
73
|
+
z(), c.value = !1, C.value = !1, b.value = !0, await L(t.transitionDuration);
|
|
74
|
+
let e = Number(
|
|
75
|
+
document.body.dataset.openModals ?? "0"
|
|
76
|
+
);
|
|
77
|
+
e--, document.body.dataset.openModals = e.toString(), e || (document.body.style.overflow = "auto", document.body.style.paddingRight = "0px"), b.value = !1, M.value = !0, r("hidden");
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
Y(() => {
|
|
81
|
+
!t.modelValue && !v.value || G();
|
|
82
|
+
});
|
|
83
|
+
const g = (e) => {
|
|
84
|
+
e.target === m.value && e.preventDefault();
|
|
85
|
+
}, K = (e) => {
|
|
86
|
+
t.disabled || O.value || m.value && e.target === m.value && (t.persistent || r("update:modelValue", !1));
|
|
87
|
+
}, S = () => {
|
|
88
|
+
t.disabled || O.value || (z(), r("update:modelValue", !1));
|
|
89
|
+
}, U = h(() => {
|
|
90
|
+
const e = [
|
|
91
|
+
{
|
|
92
|
+
"bb-base-dialog bb-base-dialog__overlay": !0,
|
|
93
|
+
"bb-base-dialog--fullscreen": t.fullscreen,
|
|
94
|
+
"bb-base-dialog--open": C.value,
|
|
95
|
+
"bb-base-dialog--opening": c.value,
|
|
96
|
+
"bb-base-dialog--closed": M.value,
|
|
97
|
+
"bb-base-dialog--closing": b.value,
|
|
98
|
+
[`bb-base-dialog--transition-${t.transition}`]: !0
|
|
99
|
+
},
|
|
100
|
+
t.overlayClasses
|
|
101
|
+
].flat(), s = {
|
|
102
|
+
onClick: K,
|
|
103
|
+
onScroll: g,
|
|
104
|
+
onTouchmove: g,
|
|
105
|
+
onWheel: g,
|
|
106
|
+
onKeydown: g
|
|
107
|
+
}, n = {
|
|
108
|
+
transitionDuration: t.transitionDuration / 1e3 + "s"
|
|
109
|
+
};
|
|
110
|
+
return {
|
|
111
|
+
class: e,
|
|
112
|
+
style: n,
|
|
113
|
+
...s,
|
|
114
|
+
...P
|
|
115
|
+
};
|
|
116
|
+
}), j = h(() => {
|
|
117
|
+
const e = [
|
|
118
|
+
{
|
|
119
|
+
"bb-base-dialog__panel": !0,
|
|
120
|
+
"bb-base-dialog__panel--compact": t.compact
|
|
121
|
+
},
|
|
122
|
+
t.panelClasses
|
|
123
|
+
].flat(), s = {
|
|
124
|
+
role: "dialog",
|
|
125
|
+
"aria-modal": !0
|
|
126
|
+
};
|
|
127
|
+
v.value && (t.title && (s["aria-labelledby"] = w), t.description && (s["aria-describedby"] = k));
|
|
128
|
+
let n;
|
|
129
|
+
const x = {
|
|
130
|
+
sm: 384,
|
|
131
|
+
md: 652,
|
|
132
|
+
lg: 896
|
|
133
|
+
};
|
|
134
|
+
t.fullscreen ? n = "100%" : typeof t.size == "number" ? n = t.size + "px" : t.size in x ? n = x[t.size] + "px" : n = t.size + "px";
|
|
135
|
+
const q = {
|
|
136
|
+
maxWidth: n,
|
|
137
|
+
transitionDuration: t.transitionDuration / 1e3 + "s"
|
|
138
|
+
};
|
|
139
|
+
return {
|
|
140
|
+
class: e,
|
|
141
|
+
style: q,
|
|
142
|
+
...s
|
|
143
|
+
};
|
|
144
|
+
}), f = oe(async () => {
|
|
145
|
+
if (t.fullscreen) {
|
|
146
|
+
I.value = window.innerHeight;
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
if (d.value && a.value && u.value) {
|
|
150
|
+
const e = d.value.scrollHeight + a.value.scrollHeight + u.value.scrollHeight + 2;
|
|
151
|
+
if (y.value && (y.value.style.height = "0px", y.value.style.height = `${e + 10}px`, await L(30), d.value && a.value && u.value)) {
|
|
152
|
+
const s = d.value.scrollHeight + a.value.scrollHeight + u.value.scrollHeight + 20;
|
|
153
|
+
e !== s && f();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}, 200);
|
|
157
|
+
return (e, s) => (_(), Z(ee, { to: "body" }, [
|
|
158
|
+
l("div", N(U.value, {
|
|
159
|
+
ref_key: "overlay",
|
|
160
|
+
ref: m
|
|
161
|
+
}), [
|
|
162
|
+
l("div", N(j.value, {
|
|
163
|
+
ref_key: "panel",
|
|
164
|
+
ref: $
|
|
165
|
+
}), [
|
|
166
|
+
v.value ? (_(), B("div", {
|
|
167
|
+
key: 0,
|
|
168
|
+
ref_key: "content",
|
|
169
|
+
ref: y,
|
|
170
|
+
class: "bb-base-dialog__content"
|
|
171
|
+
}, [
|
|
172
|
+
l("div", {
|
|
173
|
+
ref_key: "header",
|
|
174
|
+
ref: d,
|
|
175
|
+
class: "bb-base-dialog__header"
|
|
176
|
+
}, [
|
|
177
|
+
i(e.$slots, "header", {
|
|
178
|
+
close: S,
|
|
179
|
+
title: e.title,
|
|
180
|
+
titleId: w
|
|
181
|
+
}, () => [
|
|
182
|
+
l("span", {
|
|
183
|
+
id: w,
|
|
184
|
+
class: "bb-base-dialog__title"
|
|
185
|
+
}, [
|
|
186
|
+
i(e.$slots, "title", { text: e.title }, () => [
|
|
187
|
+
te(V(e.title), 1)
|
|
188
|
+
])
|
|
189
|
+
]),
|
|
190
|
+
l("span", se, [
|
|
191
|
+
e.showClose ? (_(), B("button", {
|
|
192
|
+
key: 0,
|
|
193
|
+
type: "button",
|
|
194
|
+
onClick: S
|
|
195
|
+
}, [
|
|
196
|
+
i(e.$slots, "close", { text: H.value }, () => [
|
|
197
|
+
l("span", ne, [
|
|
198
|
+
l("span", ie, V(H.value), 1),
|
|
199
|
+
re
|
|
200
|
+
])
|
|
201
|
+
])
|
|
202
|
+
])) : D("", !0)
|
|
203
|
+
])
|
|
204
|
+
])
|
|
205
|
+
], 512),
|
|
206
|
+
l("div", {
|
|
207
|
+
ref_key: "body",
|
|
208
|
+
ref: a,
|
|
209
|
+
class: "bb-base-dialog__body"
|
|
210
|
+
}, [
|
|
211
|
+
i(e.$slots, "description", {
|
|
212
|
+
descriptionId: k,
|
|
213
|
+
text: e.description
|
|
214
|
+
}, () => [
|
|
215
|
+
e.description ? (_(), B("div", {
|
|
216
|
+
key: 0,
|
|
217
|
+
id: k,
|
|
218
|
+
class: "bb-base-dialog__description"
|
|
219
|
+
}, V(e.description), 1)) : D("", !0)
|
|
220
|
+
]),
|
|
221
|
+
i(e.$slots, "default")
|
|
222
|
+
], 512),
|
|
223
|
+
de,
|
|
224
|
+
l("div", {
|
|
225
|
+
ref_key: "footer",
|
|
226
|
+
ref: u,
|
|
227
|
+
class: "bb-base-dialog__footer"
|
|
228
|
+
}, [
|
|
229
|
+
i(e.$slots, "footer")
|
|
230
|
+
], 512)
|
|
231
|
+
], 512)) : D("", !0)
|
|
232
|
+
], 16)
|
|
233
|
+
], 16)
|
|
234
|
+
]));
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
export {
|
|
238
|
+
me as default
|
|
239
|
+
};
|
|
2
240
|
//# sourceMappingURL=index20.js.map
|
package/dist/index20.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index20.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index20.js","sources":["../src/components/BaseDialog/BaseDialog.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-base-dialog__content\"\n\t\t\t\t>\n\t\t\t\t\t<div ref=\"header\" class=\"bb-base-dialog__header\">\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t:close=\"onCloseClick\"\n\t\t\t\t\t\t\tname=\"header\"\n\t\t\t\t\t\t\t:title=\"title\"\n\t\t\t\t\t\t\t:title-id=\"titleId\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span :id=\"titleId\" class=\"bb-base-dialog__title\">\n\t\t\t\t\t\t\t\t<slot name=\"title\" :text=\"title\">{{ title }}</slot>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span class=\"bb-base-dialog-close\">\n\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<slot name=\"close\" :text=\"closeLabel\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"bb-base-dialog-close__content\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"bb-base-dialog-close__label\">{{\n\t\t\t\t\t\t\t\t\t\t\t\tcloseLabel\n\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 class=\"bb-base-dialog-close__icon\"\n\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\taria-hidden=\"true\"\n\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\tviewBox=\"0 0 24 24\"\n\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>\n\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\td=\"M23 23L1 1M23 1L1 23\"\n\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\tstroke-linecap=\"round\"\n\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/>\n\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</span>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</slot>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div ref=\"body\" class=\"bb-base-dialog__body\">\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t:description-id=\"descriptionId\"\n\t\t\t\t\t\t\tname=\"description\"\n\t\t\t\t\t\t\t:text=\"description\"\n\t\t\t\t\t\t\t><div\n\t\t\t\t\t\t\t\tv-if=\"description\"\n\t\t\t\t\t\t\t\t:id=\"descriptionId\"\n\t\t\t\t\t\t\t\tclass=\"bb-base-dialog__description\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{{ description }}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style=\"flex: 10000 10000 0%\"></div>\n\t\t\t\t\t<div ref=\"footer\" class=\"bb-base-dialog__footer\">\n\t\t\t\t\t\t<slot name=\"footer\"></slot>\n\t\t\t\t\t</div>\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\tonBeforeUnmount,\n\tonMounted,\n\tref,\n\tuseAttrs,\n\tnextTick,\n\twatchPostEffect,\n} from 'vue';\nimport { throttle } from '@/utilities/functions/throttle';\nimport { useFocusTrap } from '@vueuse/integrations/useFocusTrap';\nimport { useId } from '@/composables/useId';\nimport { wait } from '@/utilities/functions/wait';\nimport { waitFor } from '@/utilities/functions/waitFor';\nimport type { CommonProps, Size } from '@/types/CommonProps';\n\nexport type Sizes = {\n\tsm: number;\n\tmd: number;\n\tlg: number;\n};\n\nexport type BaseDialogProps = 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};\n\nconst props = withDefaults(defineProps<BaseDialogProps>(), {\n\tcloseLabel: 'Chiudi modale',\n\tshowClose: true,\n\tsize: 'sm',\n\ttransition: 'fade',\n\ttransitionDuration: 350,\n\tpanelClasses: () => [],\n\toverlayClasses: () => [],\n});\n\nexport type BaseDialogSlots = {\n\theader?: (props: {\n\t\ttitleId: typeof titleId;\n\t\tclose: typeof onCloseClick;\n\t\ttitle: BaseDialogProps['title'];\n\t}) => any;\n\ttitle?: (props: { text: BaseDialogProps['title'] }) => any;\n\tclose?: (props: { text: BaseDialogProps['closeLabel'] }) => any;\n\tdescription?: (props: {\n\t\tdescriptionId: typeof descriptionId;\n\t\ttext: BaseDialogProps['description'];\n\t}) => any;\n\tdefault?: (props: object) => any;\n\tfooter?: (props: object) => any;\n};\n\ndefineSlots<BaseDialogSlots>();\n\nexport type BaseDialogEvents = {\n\t(e: 'shown'): void;\n\t(e: 'hidden'): void;\n\t(e: 'update:modelValue', value: boolean): void;\n};\n\nconst emit = defineEmits<BaseDialogEvents>();\n\nconst titleId = `title_${useId().id.value}`;\nconst descriptionId = `description_${useId().id.value}`;\n\nconst observer = ref<MutationObserver | null>(null);\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 height = ref<number | null>(null);\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 attrs = useAttrs();\n\nconst closeLabel = computed(() => props.closeLabel);\n\nonMounted(async () => {\n\tif (body.value) {\n\t\tobserver.value = new MutationObserver(onContentGrow);\n\t\tobserver.value.observe(body.value, { childList: true, subtree: true });\n\t}\n\twindow.addEventListener('resize', onContentGrow);\n});\nonBeforeUnmount(() => {\n\twindow.removeEventListener('resize', onContentGrow);\n});\n\nconst open = ref(false);\nconst opening = ref(false);\nconst closed = ref(true);\nconst closing = ref(false);\nconst hasRenderedAtLeastOnce = ref(props.eager || props.modelValue);\n\nconst busy = computed(() => opening.value || closing.value);\n\nonBeforeUnmount(() => {\n\tif (props.modelValue) {\n\t\tlet currentlyOpenModals = Number(\n\t\t\tdocument.body.dataset['openModals'] ?? '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\tcurrentlyOpenModals--;\n\t\tdocument.body.dataset['openModals'] = currentlyOpenModals.toString();\n\t\tif (!currentlyOpenModals) {\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\tawait waitFor(() => !!body.value);\n\t\t\tawait nextTick();\n\t\t\tif (body.value) {\n\t\t\t\tobserver.value = new MutationObserver(onContentGrow);\n\t\t\t\tobserver.value.observe(body.value, { childList: true, subtree: true });\n\t\t\t}\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 currentlyOpenModals = Number(\n\t\t\tdocument.body.dataset['openModals'] ?? '0'\n\t\t);\n\t\tcurrentlyOpenModals++;\n\t\tdocument.body.dataset['openModals'] = currentlyOpenModals.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\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 currentlyOpenModals = Number(\n\t\t\tdocument.body.dataset['openModals'] ?? '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\tcurrentlyOpenModals--;\n\t\tdocument.body.dataset['openModals'] = currentlyOpenModals.toString();\n\t\tif (!currentlyOpenModals) {\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}\n};\n\n/**\n * Every time modelValue changes align the display to it\n */\nwatchPostEffect(() => {\n\tif (!props.modelValue && !hasRenderedAtLeastOnce.value) return;\n\talignToModelValue();\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 || busy.value) return;\n\tdeactivate();\n\temit('update:modelValue', false);\n};\n\nconst overlayAttributes = computed(() => {\n\tconst classes = [\n\t\t{\n\t\t\t'bb-base-dialog bb-base-dialog__overlay': true,\n\t\t\t'bb-base-dialog--fullscreen': props.fullscreen,\n\t\t\t'bb-base-dialog--open': open.value,\n\t\t\t'bb-base-dialog--opening': opening.value,\n\t\t\t'bb-base-dialog--closed': closed.value,\n\t\t\t'bb-base-dialog--closing': closing.value,\n\t\t\t[`bb-base-dialog--transition-${props.transition}`]: 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-base-dialog__panel': true,\n\t\t\t'bb-base-dialog__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\tif (props.title) {\n\t\t\taccessibilityAttrs['aria-labelledby'] = titleId;\n\t\t}\n\n\t\tif (props.description)\n\t\t\taccessibilityAttrs['aria-describedby'] = descriptionId;\n\t}\n\n\tlet maxWidth;\n\tconst sizes: Sizes = {\n\t\tsm: 384,\n\t\tmd: 652,\n\t\tlg: 896,\n\t};\n\tif (props.fullscreen) maxWidth = '100%';\n\telse if (typeof props.size === 'number') maxWidth = props.size + 'px';\n\telse if (props.size in sizes)\n\t\tmaxWidth = sizes[props.size as keyof Sizes] + 'px';\n\telse maxWidth = props.size + 'px';\n\n\tconst style = {\n\t\tmaxWidth,\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\n/**\n * This is called when content inside body changes.\n * Gets the total height the panel needs to be\n * It could be called numerous times so throttle every 300ms\n */\nconst onContentGrow = throttle(async () => {\n\tif (props.fullscreen) {\n\t\theight.value = window.innerHeight;\n\t\treturn;\n\t}\n\tif (header.value && body.value && footer.value) {\n\t\tconst contentHeight =\n\t\t\theader.value.scrollHeight +\n\t\t\tbody.value.scrollHeight +\n\t\t\tfooter.value.scrollHeight +\n\t\t\t2;\n\t\t/* Add two so renderless elements at the bottom are not cut off */\n\t\tif (content.value) {\n\t\t\tcontent.value.style.height = '0px';\n\t\t\tcontent.value.style.height = `${contentHeight + 10}px`;\n\t\t\t/**\n\t\t\t * Run until all transitions inside have completed\n\t\t\t */\n\t\t\tawait wait(30);\n\t\t\tif (header.value && body.value && footer.value) {\n\t\t\t\tconst contentHeight2 =\n\t\t\t\t\theader.value.scrollHeight +\n\t\t\t\t\tbody.value.scrollHeight +\n\t\t\t\t\tfooter.value.scrollHeight +\n\t\t\t\t\t20;\n\t\t\t\tif (contentHeight !== contentHeight2) onContentGrow();\n\t\t\t}\n\t\t}\n\t}\n}, 200);\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BaseDialog';\n</style>\n"],"names":["props","__props","emit","__emit","titleId","useId","descriptionId","observer","ref","overlay","panel","content","header","body","footer","height","activate","deactivate","useFocusTrap","nextTick","attrs","useAttrs","closeLabel","computed","onMounted","onContentGrow","onBeforeUnmount","open","opening","closed","closing","hasRenderedAtLeastOnce","busy","currentlyOpenModals","alignToModelValue","waitFor","scrollBarWidth","wait","watchPostEffect","onOverlayScroll","event","onOverlayClick","onCloseClick","overlayAttributes","classes","eventListeners","style","panelAttributes","accessibilityAttrs","maxWidth","sizes","throttle","contentHeight","contentHeight2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4HA,UAAMA,IAAQC,GAkCRC,IAAOC,GAEPC,IAAU,SAASC,EAAM,EAAE,GAAG,KAAK,IACnCC,IAAgB,eAAeD,EAAM,EAAE,GAAG,KAAK,IAE/CE,IAAWC,EAA6B,IAAI,GAC5CC,IAAUD,EAAwB,IAAI,GACtCE,IAAQF,EAAwB,IAAI,G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