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/index70.js
CHANGED
|
@@ -1,2 +1,226 @@
|
|
|
1
|
-
|
|
1
|
+
import { defineComponent as j, ref as g, watch as x, computed as m, openBlock as V, createBlock as G, resolveDynamicComponent as K, normalizeClass as O, withCtx as M, createElementVNode as c, withModifiers as y, renderSlot as U, normalizeProps as Y, guardReactiveProps as Z, createTextVNode as J, unref as Q, createVNode as W, createElementBlock as F, Fragment as X, renderList as ee, toDisplayString as te } from "vue";
|
|
2
|
+
import { findInTree as ae } from "./index236.js";
|
|
3
|
+
import { useId as re } from "./index8.js";
|
|
4
|
+
import oe from "./index119.js";
|
|
5
|
+
import "./index184.js";
|
|
6
|
+
const le = ["accept", "autofocus", "disabled", "multiple"], se = {
|
|
7
|
+
"aria-hidden": "true",
|
|
8
|
+
class: "bb-dropzone__submittable-label"
|
|
9
|
+
}, ne = ["id", "disabled", "multiple", "name"], ie = { class: "bb-dropzone__errors" }, fe = /* @__PURE__ */ j({
|
|
10
|
+
__name: "BbDropzone",
|
|
11
|
+
props: {
|
|
12
|
+
autofocus: {},
|
|
13
|
+
disabled: { type: Boolean },
|
|
14
|
+
errors: {},
|
|
15
|
+
hasErrors: { type: Boolean },
|
|
16
|
+
id: {},
|
|
17
|
+
multiple: { type: Boolean },
|
|
18
|
+
name: {},
|
|
19
|
+
accept: {},
|
|
20
|
+
maxFiles: {},
|
|
21
|
+
maxSize: {},
|
|
22
|
+
modelValue: {},
|
|
23
|
+
tag: { default: "div" }
|
|
24
|
+
},
|
|
25
|
+
emits: ["blur", "error", "focus", "update:modelValue"],
|
|
26
|
+
setup(D, { emit: C }) {
|
|
27
|
+
let b;
|
|
28
|
+
const t = D, l = C, d = g(null);
|
|
29
|
+
if (t.accept && !Array.isArray(t.accept))
|
|
30
|
+
throw new Error("Property accept is not an array");
|
|
31
|
+
if (t.multiple && !Array.isArray(t.modelValue))
|
|
32
|
+
throw new Error(
|
|
33
|
+
"Component is set to multiple but modelValue is not an array"
|
|
34
|
+
);
|
|
35
|
+
const h = g(!1), I = (e) => {
|
|
36
|
+
h.value = !0, l("focus", e);
|
|
37
|
+
}, L = (e) => {
|
|
38
|
+
h.value = !1, l("blur", e);
|
|
39
|
+
};
|
|
40
|
+
x(
|
|
41
|
+
() => t.modelValue,
|
|
42
|
+
() => {
|
|
43
|
+
let e = new DataTransfer();
|
|
44
|
+
Array.isArray(t.modelValue) ? t.modelValue.length && t.modelValue.forEach((a) => e.items.add(a)) : t.modelValue && e.items.add(t.modelValue), d.value && (e.items.length ? d.value.files = e.files : d.value.files = null);
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
const p = g([]), P = m(
|
|
48
|
+
() => p.value.join(",")
|
|
49
|
+
);
|
|
50
|
+
x(
|
|
51
|
+
() => t.accept,
|
|
52
|
+
async () => {
|
|
53
|
+
if (t.accept) {
|
|
54
|
+
let e = [];
|
|
55
|
+
for (let a = 0; a < t.accept.length; a++) {
|
|
56
|
+
const r = t.accept[a];
|
|
57
|
+
if (r.includes("/"))
|
|
58
|
+
e.push(r);
|
|
59
|
+
else {
|
|
60
|
+
b || (b = (await import("./index235.js")).default);
|
|
61
|
+
const o = b.getType(r);
|
|
62
|
+
if (!o)
|
|
63
|
+
throw new Error(
|
|
64
|
+
`Could not detect the correct mime associated with ${r}`
|
|
65
|
+
);
|
|
66
|
+
e.push(o);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
p.value = e;
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{ immediate: !0 }
|
|
73
|
+
);
|
|
74
|
+
const z = t.id || `${re().id.value}`, v = `bb_dz_${z}`, i = g(!1);
|
|
75
|
+
let T;
|
|
76
|
+
const k = m(() => ({
|
|
77
|
+
"bb-dropzone": !0,
|
|
78
|
+
"bb-dropzone--errors": R.value,
|
|
79
|
+
"bb-dropzone--dragging": i.value
|
|
80
|
+
})), q = m(() => ({
|
|
81
|
+
dragging: i.value,
|
|
82
|
+
focused: h.value,
|
|
83
|
+
id: z
|
|
84
|
+
})), $ = (e) => {
|
|
85
|
+
if (i.value = !1, e.dataTransfer) {
|
|
86
|
+
e.stopImmediatePropagation();
|
|
87
|
+
let a;
|
|
88
|
+
if (a = Array.from(e.dataTransfer.files), a = _(a), t.multiple ? Array.isArray(t.modelValue) && l("update:modelValue", [...t.modelValue, ...a]) : (a = a[0], l("update:modelValue", a)), e.currentTarget instanceof HTMLLabelElement) {
|
|
89
|
+
const r = e.currentTarget.querySelector("input[type=file]");
|
|
90
|
+
r instanceof HTMLInputElement && r.focus();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}, H = (e) => {
|
|
94
|
+
if (e.target instanceof HTMLInputElement) {
|
|
95
|
+
if (e.target.files) {
|
|
96
|
+
let a;
|
|
97
|
+
a = _(Array.from(e.target.files)), t.multiple ? Array.isArray(t.modelValue) && l("update:modelValue", [...t.modelValue, ...a]) : (a = a[0], l("update:modelValue", a));
|
|
98
|
+
}
|
|
99
|
+
e.target.value = "", e.target.files = null;
|
|
100
|
+
}
|
|
101
|
+
}, _ = (e) => e.filter((a, r) => {
|
|
102
|
+
if (t.maxSize && !(a.size <= t.maxSize))
|
|
103
|
+
return l("error", f.maxSize(a)), !1;
|
|
104
|
+
let o = !1;
|
|
105
|
+
return t.modelValue && (Array.isArray(t.modelValue) ? o = t.modelValue.some(
|
|
106
|
+
(s) => S(s, a)
|
|
107
|
+
) : o = S(t.modelValue, a)), o ? (l("error", f.uniqueness(a)), !1) : t.accept && !p.value.some((n) => {
|
|
108
|
+
let u = !1;
|
|
109
|
+
return n.includes("*") ? u = u || n.split("/")[0] === a.type.split("/")[0] : u = u || n === a.type, u;
|
|
110
|
+
}) ? (l("error", f.accept(a)), !1) : t.maxFiles && Array.isArray(t.modelValue) && t.modelValue.length + r + 1 > t.maxFiles ? (l(
|
|
111
|
+
"error",
|
|
112
|
+
f.maxFiles(a, t.modelValue.length + r + 1)
|
|
113
|
+
), !1) : !0;
|
|
114
|
+
}), N = (e) => {
|
|
115
|
+
const a = e.target;
|
|
116
|
+
if (a instanceof HTMLElement) {
|
|
117
|
+
const r = ae(
|
|
118
|
+
[a],
|
|
119
|
+
"parentElement",
|
|
120
|
+
(o) => o.classList.contains("bb-dropzone")
|
|
121
|
+
);
|
|
122
|
+
r && (r.id === v ? B() : E());
|
|
123
|
+
}
|
|
124
|
+
}, B = () => {
|
|
125
|
+
clearTimeout(T), i.value = !0;
|
|
126
|
+
}, E = () => {
|
|
127
|
+
T = setTimeout(() => {
|
|
128
|
+
i.value = !1;
|
|
129
|
+
}, 100);
|
|
130
|
+
}, A = (e, a = 2) => {
|
|
131
|
+
if (!e)
|
|
132
|
+
return "0 B";
|
|
133
|
+
const r = 1024, o = a || 0, s = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], n = Math.floor(Math.log(e) / Math.log(r));
|
|
134
|
+
return parseFloat((e / Math.pow(r, n)).toFixed(o)) + " " + s[n];
|
|
135
|
+
}, S = (e, a) => !["name", "size", "lastModified", "type"].some((o) => e[o] !== a[o]), f = {
|
|
136
|
+
maxSize: (e) => {
|
|
137
|
+
if (t.maxSize)
|
|
138
|
+
return {
|
|
139
|
+
type: "maxSize",
|
|
140
|
+
file: e,
|
|
141
|
+
formattedMaxSize: A(+t.maxSize),
|
|
142
|
+
formattedSize: A(e.size),
|
|
143
|
+
filename: e.name
|
|
144
|
+
};
|
|
145
|
+
throw new Error(
|
|
146
|
+
"Requested to create an error for maxSize without providing a maxSize."
|
|
147
|
+
);
|
|
148
|
+
},
|
|
149
|
+
uniqueness: (e) => ({
|
|
150
|
+
type: "uniqueness",
|
|
151
|
+
file: e,
|
|
152
|
+
filename: e.name
|
|
153
|
+
}),
|
|
154
|
+
accept: (e) => ({
|
|
155
|
+
type: "accept",
|
|
156
|
+
file: e,
|
|
157
|
+
acceptedMimeTypes: p.value,
|
|
158
|
+
mimeType: e.type,
|
|
159
|
+
filename: e.name
|
|
160
|
+
}),
|
|
161
|
+
maxFiles: (e, a) => ({
|
|
162
|
+
type: "maxFiles",
|
|
163
|
+
file: e,
|
|
164
|
+
maxFiles: t.maxFiles,
|
|
165
|
+
totalFiles: a,
|
|
166
|
+
filename: e.name
|
|
167
|
+
})
|
|
168
|
+
}, w = m(() => t.errors ? [].concat(t.errors) : []), R = m(
|
|
169
|
+
() => !!w.value.length || t.hasErrors
|
|
170
|
+
);
|
|
171
|
+
return (e, a) => (V(), G(K(e.tag), {
|
|
172
|
+
id: v,
|
|
173
|
+
class: O(k.value)
|
|
174
|
+
}, {
|
|
175
|
+
default: M(() => [
|
|
176
|
+
c("label", {
|
|
177
|
+
onDragenter: y(B, ["prevent"]),
|
|
178
|
+
onDragleave: y(E, ["prevent"]),
|
|
179
|
+
onDragover: y(N, ["prevent"]),
|
|
180
|
+
onDrop: y($, ["prevent"])
|
|
181
|
+
}, [
|
|
182
|
+
c("input", {
|
|
183
|
+
accept: P.value,
|
|
184
|
+
autofocus: e.autofocus,
|
|
185
|
+
disabled: e.disabled,
|
|
186
|
+
multiple: e.multiple,
|
|
187
|
+
type: "file",
|
|
188
|
+
onBlur: L,
|
|
189
|
+
onChange: H,
|
|
190
|
+
onFocus: I
|
|
191
|
+
}, null, 40, le),
|
|
192
|
+
U(e.$slots, "default", Y(Z(q.value)))
|
|
193
|
+
], 32),
|
|
194
|
+
c("label", se, [
|
|
195
|
+
J(" Server files "),
|
|
196
|
+
c("input", {
|
|
197
|
+
id: Q(z),
|
|
198
|
+
ref_key: "submittable",
|
|
199
|
+
ref: d,
|
|
200
|
+
class: "bb-dropzone__submittable-input",
|
|
201
|
+
disabled: e.disabled,
|
|
202
|
+
multiple: e.multiple,
|
|
203
|
+
name: e.name,
|
|
204
|
+
type: "file"
|
|
205
|
+
}, null, 8, ne)
|
|
206
|
+
]),
|
|
207
|
+
c("span", ie, [
|
|
208
|
+
W(oe, { tag: "span" }, {
|
|
209
|
+
default: M(() => [
|
|
210
|
+
(V(!0), F(X, null, ee(w.value, (r) => (V(), F("span", {
|
|
211
|
+
key: r,
|
|
212
|
+
class: "bb-dropzone__error"
|
|
213
|
+
}, te(r), 1))), 128))
|
|
214
|
+
]),
|
|
215
|
+
_: 1
|
|
216
|
+
})
|
|
217
|
+
])
|
|
218
|
+
]),
|
|
219
|
+
_: 3
|
|
220
|
+
}, 8, ["class"]));
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
export {
|
|
224
|
+
fe as default
|
|
225
|
+
};
|
|
2
226
|
//# sourceMappingURL=index70.js.map
|
package/dist/index70.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index70.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index70.js","sources":["../src/components/BbDropzone/BbDropzone.vue"],"sourcesContent":["<template>\n\t<component :is=\"tag\" :id=\"containerId\" :class=\"classes\">\n\t\t<label\n\t\t\t@dragenter.prevent=\"setDragging\"\n\t\t\t@dragleave.prevent=\"unsetDragging\"\n\t\t\t@dragover.prevent=\"onDragOver\"\n\t\t\t@drop.prevent=\"onDrop\"\n\t\t>\n\t\t\t<input\n\t\t\t\t:accept=\"acceptedMimeTypesString\"\n\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:multiple=\"multiple\"\n\t\t\t\ttype=\"file\"\n\t\t\t\t@blur=\"onBlur\"\n\t\t\t\t@change=\"onChange\"\n\t\t\t\t@focus=\"onFocus\"\n\t\t\t/>\n\t\t\t<slot v-bind=\"slotAttributes\"></slot>\n\t\t</label>\n\t\t<label aria-hidden=\"true\" class=\"bb-dropzone__submittable-label\">\n\t\t\tServer files\n\t\t\t<input\n\t\t\t\t:id=\"id\"\n\t\t\t\tref=\"submittable\"\n\t\t\t\tclass=\"bb-dropzone__submittable-input\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:multiple=\"multiple\"\n\t\t\t\t:name=\"name\"\n\t\t\t\ttype=\"file\"\n\t\t\t/>\n\t\t</label>\n\n\t\t<span class=\"bb-dropzone__errors\">\n\t\t\t<BbSmoothHeight tag=\"span\">\n\t\t\t\t<span\n\t\t\t\t\tv-for=\"error in computedErrors\"\n\t\t\t\t\t:key=\"error\"\n\t\t\t\t\tclass=\"bb-dropzone__error\"\n\t\t\t\t\t>{{ error }}</span\n\t\t\t\t>\n\t\t\t</BbSmoothHeight>\n\t\t</span>\n\t</component>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue';\nimport { findInTree } from '@/utilities/functions/findInTree';\nimport { useId } from '@/composables/useId';\nimport BbSmoothHeight from '../BbSmoothHeight/BbSmoothHeight.vue';\nimport type { CommonProps, NonVoidElementTag } from '@/types/CommonProps';\n\nexport type DropZoneError = ReturnType<\n\t(typeof createError)[keyof typeof createError]\n>;\n\nexport type BbDropzoneProps = Pick<\n\tCommonProps,\n\t'autofocus' | 'disabled' | 'errors' | 'hasErrors' | 'id' | 'multiple' | 'name'\n> & {\n\t/**\n\t * Array of mime-types or extensions to filter selectable files.\n\t */\n\taccept?: string[];\n\t/**\n\t * Maximum number of acceptable files\n\t */\n\tmaxFiles?: number;\n\t/**\n\t * Max size of the files in bytes.\n\t */\n\tmaxSize?: number;\n\t/**\n\t * Used by v-model.\n\t */\n\tmodelValue: any;\n} & NonVoidElementTag;\n\n// This is the dynamic import for mime\nlet mime: any;\n\nconst props = withDefaults(defineProps<BbDropzoneProps>(), {\n\ttag: 'div',\n});\n\nexport type BbDropzoneEvents = {\n\t(e: 'blur', event: FocusEvent): void;\n\t(e: 'error', data: DropZoneError): void;\n\t(e: 'focus', event: FocusEvent): void;\n\t(e: 'update:modelValue', data: any): void;\n};\nconst emit = defineEmits<BbDropzoneEvents>();\n\ndefineSlots<{\n\tdefault?: (props: { dragging: boolean; focused: boolean; id: string }) => any;\n}>();\n\nconst submittable = ref<any | null>(null);\n\nif (props.accept) {\n\tif (!Array.isArray(props.accept)) {\n\t\tthrow new Error('Property accept is not an array');\n\t}\n}\nif (props.multiple) {\n\tif (!Array.isArray(props.modelValue)) {\n\t\tthrow new Error(\n\t\t\t'Component is set to multiple but modelValue is not an array'\n\t\t);\n\t}\n}\n\nconst hasFocus = ref(false);\nconst onFocus = (event: FocusEvent) => {\n\thasFocus.value = true;\n\temit('focus', event);\n};\nconst onBlur = (event: FocusEvent) => {\n\thasFocus.value = false;\n\temit('blur', event);\n};\n\n/** Allow dropzone to be submittable (this is flimsy and might break) */\nwatch(\n\t() => props.modelValue,\n\t() => {\n\t\tlet container = new DataTransfer();\n\t\tif (Array.isArray(props.modelValue)) {\n\t\t\tif (props.modelValue.length) {\n\t\t\t\tprops.modelValue.forEach((file) => container.items.add(file));\n\t\t\t}\n\t\t} else {\n\t\t\tif (props.modelValue) container.items.add(props.modelValue);\n\t\t}\n\t\tif (submittable.value) {\n\t\t\tif (container.items.length) {\n\t\t\t\tsubmittable.value.files = container.files;\n\t\t\t} else {\n\t\t\t\tsubmittable.value.files = null;\n\t\t\t}\n\t\t}\n\t}\n);\n\nconst acceptedMimeTypes = ref<string[]>([]);\nconst acceptedMimeTypesString = computed(() =>\n\tacceptedMimeTypes.value.join(',')\n);\nwatch(\n\t() => props.accept,\n\tasync () => {\n\t\tif (props.accept) {\n\t\t\tlet accumulated = [];\n\t\t\tfor (let i = 0; i < props.accept.length; i++) {\n\t\t\t\tconst element = props.accept[i];\n\t\t\t\tif (element.includes('/')) accumulated.push(element);\n\t\t\t\telse {\n\t\t\t\t\tif (!mime) {\n\t\t\t\t\t\tconst mod = await import('mime');\n\t\t\t\t\t\tmime = mod.default;\n\t\t\t\t\t}\n\t\t\t\t\tconst foundMime = mime.getType(element);\n\t\t\t\t\tif (!foundMime) {\n\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t`Could not detect the correct mime associated with ${element}`\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\taccumulated.push(foundMime);\n\t\t\t\t}\n\t\t\t}\n\t\t\tacceptedMimeTypes.value = accumulated;\n\t\t}\n\t},\n\t{ immediate: true }\n);\n\n/**\n * Component state\n */\nconst id = props.id || `${useId().id.value}`;\nconst containerId = `bb_dz_${id}`;\n\nconst dragging = ref(false);\n// Add a timeout to prevent browser flickering\nlet draggingTimeout: ReturnType<typeof setTimeout>;\n\nconst classes = computed(() => {\n\treturn {\n\t\t'bb-dropzone': true,\n\t\t'bb-dropzone--errors': hasErrors.value,\n\t\t'bb-dropzone--dragging': dragging.value,\n\t};\n});\nconst slotAttributes = computed(() => {\n\treturn {\n\t\tdragging: dragging.value,\n\t\tfocused: hasFocus.value,\n\t\tid: id,\n\t};\n});\n\n/**\n * Component handlers\n */\nconst onDrop = (event: DragEvent) => {\n\tdragging.value = false;\n\n\tif (event.dataTransfer) {\n\t\tevent.stopImmediatePropagation();\n\t\tlet files;\n\t\tfiles = Array.from(event.dataTransfer.files);\n\t\tfiles = parseFiles(files);\n\t\tif (props.multiple) {\n\t\t\tif (Array.isArray(props.modelValue)) {\n\t\t\t\temit('update:modelValue', [...props.modelValue, ...files]);\n\t\t\t}\n\t\t} else {\n\t\t\tfiles = files[0];\n\t\t\temit('update:modelValue', files);\n\t\t}\n\t\tif (event.currentTarget instanceof HTMLLabelElement) {\n\t\t\tconst innerInput = event.currentTarget.querySelector('input[type=file]');\n\t\t\tif (innerInput instanceof HTMLInputElement) {\n\t\t\t\tinnerInput.focus();\n\t\t\t}\n\t\t}\n\t}\n};\nconst onChange = (event: Event) => {\n\tif (event.target instanceof HTMLInputElement) {\n\t\tif (event.target.files) {\n\t\t\tlet files;\n\t\t\tfiles = parseFiles(Array.from(event.target.files));\n\t\t\tif (props.multiple) {\n\t\t\t\tif (Array.isArray(props.modelValue)) {\n\t\t\t\t\temit('update:modelValue', [...props.modelValue, ...files]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfiles = files[0];\n\t\t\t\temit('update:modelValue', files);\n\t\t\t}\n\t\t}\n\t\tevent.target.value = '';\n\t\tevent.target.files = null;\n\t}\n};\n\nconst parseFiles = (files: File[]) => {\n\treturn files.filter((file, index) => {\n\t\t// Sizecheck\n\t\tif (props.maxSize) {\n\t\t\tlet passing = file.size <= props.maxSize;\n\t\t\tif (!passing) {\n\t\t\t\temit('error', createError.maxSize(file));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// Uniqueness check\n\t\tlet alreadyExists = false;\n\t\tif (props.modelValue) {\n\t\t\tif (Array.isArray(props.modelValue)) {\n\t\t\t\talreadyExists = props.modelValue.some((current) =>\n\t\t\t\t\tcompareFiles(current, file)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\talreadyExists = compareFiles(props.modelValue, file);\n\t\t\t}\n\t\t}\n\t\tif (alreadyExists) {\n\t\t\temit('error', createError.uniqueness(file));\n\t\t\treturn false;\n\t\t}\n\t\t// Mime type check\n\t\tif (props.accept) {\n\t\t\tconst mimePassed = acceptedMimeTypes.value.some((mime) => {\n\t\t\t\tlet found = false;\n\t\t\t\tif (mime.includes('*'))\n\t\t\t\t\tfound = found || mime.split('/')[0] === file.type.split('/')[0];\n\t\t\t\telse found = found || mime === file.type;\n\t\t\t\treturn found;\n\t\t\t});\n\t\t\tif (!mimePassed) {\n\t\t\t\temit('error', createError.accept(file));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// Max files check\n\t\tif (props.maxFiles) {\n\t\t\tif (Array.isArray(props.modelValue)) {\n\t\t\t\tif (props.modelValue.length + index + 1 > props.maxFiles) {\n\t\t\t\t\temit(\n\t\t\t\t\t\t'error',\n\t\t\t\t\t\tcreateError.maxFiles(file, props.modelValue.length + index + 1)\n\t\t\t\t\t);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t});\n};\n\nconst onDragOver = (event: Event) => {\n\t// Find the closest dropzone in case of nested dropzones\n\tconst target = event.target;\n\tif (target instanceof HTMLElement) {\n\t\tconst closestDropzone = findInTree([target], 'parentElement', (el) =>\n\t\t\tel.classList.contains('bb-dropzone')\n\t\t);\n\t\tif (closestDropzone) {\n\t\t\t/* When dragging over this dropzone set as dragging */\n\t\t\tif (closestDropzone.id === containerId) {\n\t\t\t\tsetDragging();\n\t\t\t\t/* When dragging over a nested dropzone do not highlight this dropzone */\n\t\t\t} else {\n\t\t\t\tunsetDragging();\n\t\t\t}\n\t\t}\n\t}\n};\n\nconst setDragging = () => {\n\tclearTimeout(draggingTimeout);\n\tdragging.value = true;\n};\n\nconst unsetDragging = () => {\n\tdraggingTimeout = setTimeout(() => {\n\t\tdragging.value = false;\n\t}, 100);\n};\n\nconst bytesToUnit = (bytes: number, decimals = 2) => {\n\tif (!bytes) return '0 B';\n\tconst k = 1024;\n\tconst dm = decimals || 0;\n\tconst sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n\tconst i = Math.floor(Math.log(bytes) / Math.log(k));\n\treturn parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];\n};\n\n/**\n * Returns true if files are identical by the properties that are accessible\n * @param file The file to check\n * @param otherFile The file to check against\n */\nconst compareFiles = (file: File, otherFile: File) => {\n\tconst properties: (keyof File)[] = ['name', 'size', 'lastModified', 'type'];\n\treturn !properties.some((key) => file[key] !== otherFile[key]);\n};\n\n/**\n * Helper that creates errors based on component properties\n */\nconst createError = {\n\tmaxSize: (file: File) => {\n\t\t// Todo update to isNil\n\t\tif (props.maxSize) {\n\t\t\treturn {\n\t\t\t\ttype: 'maxSize',\n\t\t\t\tfile: file,\n\t\t\t\tformattedMaxSize: bytesToUnit(+props.maxSize),\n\t\t\t\tformattedSize: bytesToUnit(file.size),\n\t\t\t\tfilename: file.name,\n\t\t\t} as const;\n\t\t} else\n\t\t\tthrow new Error(\n\t\t\t\t'Requested to create an error for maxSize without providing a maxSize.'\n\t\t\t);\n\t},\n\tuniqueness: (file: File) => {\n\t\treturn {\n\t\t\ttype: 'uniqueness',\n\t\t\tfile: file,\n\t\t\tfilename: file.name,\n\t\t} as const;\n\t},\n\taccept: (file: File) => {\n\t\treturn {\n\t\t\ttype: 'accept',\n\t\t\tfile: file,\n\t\t\tacceptedMimeTypes: acceptedMimeTypes.value,\n\t\t\tmimeType: file.type,\n\t\t\tfilename: file.name,\n\t\t} as const;\n\t},\n\tmaxFiles: (file: File, totalFiles: number) => {\n\t\treturn {\n\t\t\ttype: 'maxFiles',\n\t\t\tfile: file,\n\t\t\tmaxFiles: props.maxFiles,\n\t\t\ttotalFiles,\n\t\t\tfilename: file.name,\n\t\t} as const;\n\t},\n};\n\nconst computedErrors = computed(() => {\n\treturn props.errors ? ([] as string[]).concat(props.errors) : [];\n});\n\nconst hasErrors = computed(\n\t() => Boolean(computedErrors.value.length) || props.hasErrors\n);\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbDropzone';\n</style>\n"],"names":["mime","props","__props","emit","__emit","submittable","ref","hasFocus","onFocus","event","onBlur","watch","container","file","acceptedMimeTypes","acceptedMimeTypesString","computed","accumulated","i","element","foundMime","id","useId","containerId","dragging","draggingTimeout","classes","hasErrors","slotAttributes","onDrop","files","parseFiles","innerInput","onChange","index","createError","alreadyExists","current","compareFiles","found","onDragOver","target","closestDropzone","findInTree","el","setDragging","unsetDragging","bytesToUnit","bytes","decimals","k","dm","sizes","otherFile","key","totalFiles","computedErrors"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAgFI,QAAAA;AAEJ,UAAMC,IAAQC,GAURC,IAAOC,GAMPC,IAAcC,EAAgB,IAAI;AAExC,QAAIL,EAAM,UACL,CAAC,MAAM,QAAQA,EAAM,MAAM;AACxB,YAAA,IAAI,MAAM,iCAAiC;AAGnD,QAAIA,EAAM,YACL,CAAC,MAAM,QAAQA,EAAM,UAAU;AAClC,YAAM,IAAI;AAAA,QACT;AAAA,MAAA;AAKG,UAAAM,IAAWD,EAAI,EAAK,GACpBE,IAAU,CAACC,MAAsB;AACtC,MAAAF,EAAS,QAAQ,IACjBJ,EAAK,SAASM,CAAK;AAAA,IAAA,GAEdC,IAAS,CAACD,MAAsB;AACrC,MAAAF,EAAS,QAAQ,IACjBJ,EAAK,QAAQM,CAAK;AAAA,IAAA;AAInB,IAAAE;AAAA,MACC,MAAMV,EAAM;AAAA,MACZ,MAAM;AACD,YAAAW,IAAY,IAAI;AACpB,QAAI,MAAM,QAAQX,EAAM,UAAU,IAC7BA,EAAM,WAAW,UACdA,EAAA,WAAW,QAAQ,CAACY,MAASD,EAAU,MAAM,IAAIC,CAAI,CAAC,IAGzDZ,EAAM,cAAsBW,E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C,EAAS,MACxBf,EAAM,SAAU,CAAC,EAAe,OAAOA,EAAM,MAAM,IAAI,EAC9D,GAEK0B,IAAYX;AAAA,MACjB,MAAM,EAAQwC,EAAe,MAAM,UAAWvD,EAAM;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index71.js
CHANGED
|
@@ -1,25 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
const v = /* @__PURE__ */ u({
|
|
3
|
-
__name: "BbHover",
|
|
4
|
-
setup(f) {
|
|
5
|
-
const e = i(!1), s = (t) => {
|
|
6
|
-
const n = t.target;
|
|
7
|
-
if (n instanceof HTMLElement) {
|
|
8
|
-
e.value = !0;
|
|
9
|
-
const o = (a) => {
|
|
10
|
-
const r = a.target;
|
|
11
|
-
r instanceof HTMLElement && (n.contains(r) || (e.value = !1, document.removeEventListener("mouseover", o)));
|
|
12
|
-
};
|
|
13
|
-
document.addEventListener("mouseover", o);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
return (t, n) => c(t.$slots, "default", {
|
|
17
|
-
isHovering: e.value,
|
|
18
|
-
props: { onMouseenter: s }
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
export {
|
|
23
|
-
v as default
|
|
24
|
-
};
|
|
1
|
+
|
|
25
2
|
//# sourceMappingURL=index71.js.map
|
package/dist/index71.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index71.js","sources":[
|
|
1
|
+
{"version":3,"file":"index71.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/index72.js
CHANGED
|
@@ -1,47 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}, r.options), l.value && n.value.observe(l.value);
|
|
20
|
-
}), p(() => {
|
|
21
|
-
n.value && n.value.disconnect();
|
|
1
|
+
import { defineComponent as u, ref as i, renderSlot as c } from "vue";
|
|
2
|
+
const v = /* @__PURE__ */ u({
|
|
3
|
+
__name: "BbHover",
|
|
4
|
+
setup(f) {
|
|
5
|
+
const e = i(!1), s = (t) => {
|
|
6
|
+
const n = t.target;
|
|
7
|
+
if (n instanceof HTMLElement) {
|
|
8
|
+
e.value = !0;
|
|
9
|
+
const o = (a) => {
|
|
10
|
+
const r = a.target;
|
|
11
|
+
r instanceof HTMLElement && (n.contains(r) || (e.value = !1, document.removeEventListener("mouseover", o)));
|
|
12
|
+
};
|
|
13
|
+
document.addEventListener("mouseover", o);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
return (t, n) => c(t.$slots, "default", {
|
|
17
|
+
isHovering: e.value,
|
|
18
|
+
props: { onMouseenter: s }
|
|
22
19
|
});
|
|
23
|
-
const f = c((e) => {
|
|
24
|
-
e.isIntersecting ? (a.value = Math.trunc(e.intersectionRatio * 100), e.intersectionRatio === 1 ? (o.value = !0, s.value = !1, i("shown")) : (o.value = !1, s.value = !1, v(Math.trunc(e.intersectionRatio * 100)))) : (o.value = !1, s.value = !0, i("hidden"));
|
|
25
|
-
}), v = c((e) => {
|
|
26
|
-
i("intersected", e);
|
|
27
|
-
}, r.debounceTime);
|
|
28
|
-
return (e, B) => (g(), b(w(e.tag), {
|
|
29
|
-
ref_key: "infinitescrolltrigger",
|
|
30
|
-
ref: l,
|
|
31
|
-
class: "bb-intersection"
|
|
32
|
-
}, {
|
|
33
|
-
default: _(() => [
|
|
34
|
-
I(e.$slots, "default", {
|
|
35
|
-
hidden: s.value,
|
|
36
|
-
percentage: a.value,
|
|
37
|
-
shown: o.value
|
|
38
|
-
})
|
|
39
|
-
]),
|
|
40
|
-
_: 3
|
|
41
|
-
}, 512));
|
|
42
20
|
}
|
|
43
21
|
});
|
|
44
22
|
export {
|
|
45
|
-
|
|
23
|
+
v as default
|
|
46
24
|
};
|
|
47
25
|
//# sourceMappingURL=index72.js.map
|
package/dist/index72.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index72.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index72.js","sources":["../src/components/BbHover/BbHover.vue"],"sourcesContent":["<template>\n\t<slot :is-hovering=\"isHovering\" :props=\"{ onMouseenter }\"></slot>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue';\n\ndefineSlots<{\n\tdefault?: (props: {\n\t\tprops: {\n\t\t\tonMouseenter: typeof onMouseenter;\n\t\t};\n\t\tisHovering: boolean;\n\t}) => any;\n}>();\nconst isHovering = ref(false);\n\nconst onMouseenter = (event: MouseEvent) => {\n\tconst outerTarget = event.target;\n\tif (outerTarget instanceof HTMLElement) {\n\t\tisHovering.value = true;\n\t\tconst onDocumentMouseover = (event: MouseEvent) => {\n\t\t\tconst innerTarget = event.target;\n\t\t\tif (innerTarget instanceof HTMLElement) {\n\t\t\t\tif (!outerTarget.contains(innerTarget)) {\n\t\t\t\t\tisHovering.value = false;\n\t\t\t\t\tdocument.removeEventListener('mouseover', onDocumentMouseover);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tdocument.addEventListener('mouseover', onDocumentMouseover);\n\t}\n};\n</script>\n\n<style scoped></style>\n"],"names":["isHovering","ref","onMouseenter","event","outerTarget","onDocumentMouseover","innerTarget"],"mappings":";;;;AAeM,UAAAA,IAAaC,EAAI,EAAK,GAEtBC,IAAe,CAACC,MAAsB;AAC3C,YAAMC,IAAcD,EAAM;AAC1B,UAAIC,aAAuB,aAAa;AACvC,QAAAJ,EAAW,QAAQ;AACb,cAAAK,IAAsB,CAACF,MAAsB;AAClD,gBAAMG,IAAcH,EAAM;AAC1B,UAAIG,aAAuB,gBACrBF,EAAY,SAASE,CAAW,MACpCN,EAAW,QAAQ,IACV,SAAA,oBAAoB,aAAaK,CAAmB;AAAA,QAE/D;AAEQ,iBAAA,iBAAiB,aAAaA,CAAmB;AAAA,MAC3D;AAAA,IAAA;;;;;;;"}
|
package/dist/index73.js
CHANGED
|
@@ -1,96 +1,47 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import "./index24.js";
|
|
6
|
-
const C = /* @__PURE__ */ t({
|
|
7
|
-
__name: "BbNumberInput",
|
|
1
|
+
import { defineComponent as h, ref as t, onMounted as m, onBeforeUnmount as p, openBlock as g, createBlock as b, resolveDynamicComponent as w, withCtx as _, renderSlot as I } from "vue";
|
|
2
|
+
import { throttle as c } from "./index219.js";
|
|
3
|
+
const M = /* @__PURE__ */ h({
|
|
4
|
+
__name: "BbIntersection",
|
|
8
5
|
props: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
min: {},
|
|
16
|
-
modelValue: {},
|
|
17
|
-
name: {},
|
|
18
|
-
placeholder: {},
|
|
19
|
-
readonly: {},
|
|
20
|
-
step: {},
|
|
21
|
-
direction: {},
|
|
22
|
-
errors: {},
|
|
23
|
-
hideLabel: { type: Boolean },
|
|
24
|
-
label: {},
|
|
25
|
-
labelPosition: {},
|
|
26
|
-
reverse: { type: Boolean }
|
|
6
|
+
debounceTime: { default: 0 },
|
|
7
|
+
options: { default: () => ({
|
|
8
|
+
root: null,
|
|
9
|
+
threshold: [0, 0.2, 0.4, 0.6, 0.8, 1]
|
|
10
|
+
}) },
|
|
11
|
+
tag: { default: "div" }
|
|
27
12
|
},
|
|
28
|
-
emits: ["
|
|
29
|
-
setup(
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
};
|
|
43
|
-
return (e,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
errors: e.errors,
|
|
48
|
-
"has-errors": e.hasErrors,
|
|
49
|
-
"hide-label": e.hideLabel,
|
|
50
|
-
label: e.label,
|
|
51
|
-
"label-position": e.labelPosition,
|
|
52
|
-
"model-value": e.modelValue,
|
|
53
|
-
name: e.name,
|
|
54
|
-
reverse: e.reverse
|
|
13
|
+
emits: ["shown", "hidden", "intersected"],
|
|
14
|
+
setup(u, { emit: d }) {
|
|
15
|
+
const r = u, i = d, n = t(null), l = t(null), o = t(!1), s = t(!0), a = t(0);
|
|
16
|
+
m(() => {
|
|
17
|
+
n.value = new IntersectionObserver((e) => {
|
|
18
|
+
f(e[0]);
|
|
19
|
+
}, r.options), l.value && n.value.observe(l.value);
|
|
20
|
+
}), p(() => {
|
|
21
|
+
n.value && n.value.disconnect();
|
|
22
|
+
});
|
|
23
|
+
const f = c((e) => {
|
|
24
|
+
e.isIntersecting ? (a.value = Math.trunc(e.intersectionRatio * 100), e.intersectionRatio === 1 ? (o.value = !0, s.value = !1, i("shown")) : (o.value = !1, s.value = !1, v(Math.trunc(e.intersectionRatio * 100)))) : (o.value = !1, s.value = !0, i("hidden"));
|
|
25
|
+
}), v = c((e) => {
|
|
26
|
+
i("intersected", e);
|
|
27
|
+
}, r.debounceTime);
|
|
28
|
+
return (e, B) => (g(), b(w(e.tag), {
|
|
29
|
+
ref_key: "infinitescrolltrigger",
|
|
30
|
+
ref: l,
|
|
31
|
+
class: "bb-intersection"
|
|
55
32
|
}, {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
autocomplete: e.autocomplete,
|
|
63
|
-
autofocus: e.autofocus,
|
|
64
|
-
disabled: e.disabled,
|
|
65
|
-
"has-errors": m,
|
|
66
|
-
max: e.max,
|
|
67
|
-
min: e.min,
|
|
68
|
-
"model-value": e.modelValue,
|
|
69
|
-
name: u,
|
|
70
|
-
placeholder: e.placeholder,
|
|
71
|
-
readonly: e.readonly,
|
|
72
|
-
step: e.step
|
|
73
|
-
}, i), {
|
|
74
|
-
"append-outer": a((r) => [
|
|
75
|
-
l(e.$slots, "append-outer", n(s(r)))
|
|
76
|
-
]),
|
|
77
|
-
append: a((r) => [
|
|
78
|
-
l(e.$slots, "append", n(s(r)))
|
|
79
|
-
]),
|
|
80
|
-
prepend: a((r) => [
|
|
81
|
-
l(e.$slots, "prepend", n(s(r)))
|
|
82
|
-
]),
|
|
83
|
-
"prepend-outer": a((r) => [
|
|
84
|
-
l(e.$slots, "prepend-outer", n(s(r)))
|
|
85
|
-
]),
|
|
86
|
-
_: 2
|
|
87
|
-
}, 1040, ["id", "autocomplete", "autofocus", "disabled", "has-errors", "max", "min", "model-value", "name", "placeholder", "readonly", "step"])
|
|
33
|
+
default: _(() => [
|
|
34
|
+
I(e.$slots, "default", {
|
|
35
|
+
hidden: s.value,
|
|
36
|
+
percentage: a.value,
|
|
37
|
+
shown: o.value
|
|
38
|
+
})
|
|
88
39
|
]),
|
|
89
40
|
_: 3
|
|
90
|
-
},
|
|
41
|
+
}, 512));
|
|
91
42
|
}
|
|
92
43
|
});
|
|
93
44
|
export {
|
|
94
|
-
|
|
45
|
+
M as default
|
|
95
46
|
};
|
|
96
47
|
//# sourceMappingURL=index73.js.map
|
package/dist/index73.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index73.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index73.js","sources":["../src/components/BbIntersection/BbIntersection.vue"],"sourcesContent":["<template>\n\t<component :is=\"tag\" ref=\"infinitescrolltrigger\" class=\"bb-intersection\">\n\t\t<slot :hidden=\"hidden\" :percentage=\"percentage\" :shown=\"shown\"></slot>\n\t</component>\n</template>\n\n<script setup lang=\"ts\">\nimport type { NonVoidElementTag } from '@/types/CommonProps';\nimport { throttle } from '@/utilities/functions/throttle';\nimport { onBeforeUnmount, onMounted, ref } from 'vue';\n\nexport type BbIntersectionProps = {\n\t/**\n\t * Time to wait before emitting intersection value\n\t */\n\tdebounceTime?: number;\n\t/**\n\t * Options used to confgiure the IntersectionObserver\n\t */\n\toptions?: IntersectionObserverInit; // eslint-disable-line no-undef\n} & NonVoidElementTag;\n\nconst props = withDefaults(defineProps<BbIntersectionProps>(), {\n\tdebounceTime: 0,\n\toptions: () => ({\n\t\troot: null,\n\t\tthreshold: [0, 0.2, 0.4, 0.6, 0.8, 1],\n\t}),\n\ttag: 'div',\n});\n\nexport type BbIntersectionEvents = {\n\t(e: 'shown'): void;\n\t(e: 'hidden'): void;\n\t(e: 'intersected', value: number): void;\n};\n\nconst emit = defineEmits<BbIntersectionEvents>();\n\ndefineSlots<{\n\tdefault?: (props: {\n\t\thidden: boolean;\n\t\tpercentage: number;\n\t\tshown: boolean;\n\t}) => any;\n}>();\n\nconst observer = ref<IntersectionObserver | null>(null);\nconst infinitescrolltrigger = ref<Element | null>(null);\nconst shown = ref(false);\nconst hidden = ref(true);\nconst percentage = ref(0);\n\nonMounted(() => {\n\tobserver.value = new IntersectionObserver((entries) => {\n\t\thandleIntersect(entries[0]);\n\t}, props.options);\n\tif (infinitescrolltrigger.value) {\n\t\tobserver.value.observe(infinitescrolltrigger.value);\n\t}\n});\nonBeforeUnmount(() => {\n\tif (observer.value) observer.value.disconnect();\n});\n\nconst handleIntersect = throttle((entry: IntersectionObserverEntry) => {\n\tif (entry.isIntersecting) {\n\t\tpercentage.value = Math.trunc(entry.intersectionRatio * 100);\n\t\tif (entry.intersectionRatio === 1) {\n\t\t\tshown.value = true;\n\t\t\thidden.value = false;\n\t\t\temit('shown');\n\t\t} else {\n\t\t\tshown.value = false;\n\t\t\thidden.value = false;\n\t\t\temitIntersected(Math.trunc(entry.intersectionRatio * 100));\n\t\t}\n\t} else {\n\t\tshown.value = false;\n\t\thidden.value = true;\n\t\temit('hidden');\n\t}\n});\n\nconst emitIntersected = throttle((percentage: number) => {\n\temit('intersected', percentage);\n}, props.debounceTime);\n</script>\n"],"names":["props","__props","emit","__emit","observer","ref","infinitescrolltrigger","shown","hidden","percentage","onMounted","entries","handleIntersect","onBeforeUnmount","throttle","entry","emitIntersected"],"mappings":";;;;;;;;;;;;;;AAsBA,UAAMA,IAAQC,GAeRC,IAAOC,GAUPC,IAAWC,EAAiC,IAAI,GAChDC,IAAwBD,EAAoB,IAAI,GAChDE,IAAQF,EAAI,EAAK,GACjBG,IAASH,EAAI,EAAI,GACjBI,IAAaJ,EAAI,CAAC;AAExB,IAAAK,EAAU,MAAM;AACf,MAAAN,EAAS,QAAQ,IAAI,qBAAqB,CAACO,MAAY;AACtC,QAAAC,EAAAD,EAAQ,CAAC,CAAC;AAAA,MAAA,GACxBX,EAAM,OAAO,GACZM,EAAsB,SAChBF,EAAA,MAAM,QAAQE,EAAsB,KAAK;AAAA,IACnD,CACA,GACDO,EAAgB,MAAM;AACrB,MAAIT,EAAS,SAAOA,EAAS,MAAM;IAAW,CAC9C;AAEK,UAAAQ,IAAkBE,EAAS,CAACC,MAAqC;AACtE,MAAIA,EAAM,kBACTN,EAAW,QAAQ,KAAK,MAAMM,EAAM,oBAAoB,GAAG,GACvDA,EAAM,sBAAsB,KAC/BR,EAAM,QAAQ,IACdC,EAAO,QAAQ,IACfN,EAAK,OAAO,MAEZK,EAAM,QAAQ,IACdC,EAAO,QAAQ,IACfQ,EAAgB,KAAK,MAAMD,EAAM,oBAAoB,GAAG,CAAC,OAG1DR,EAAM,QAAQ,IACdC,EAAO,QAAQ,IACfN,EAAK,QAAQ;AAAA,IACd,CACA,GAEKc,IAAkBF,EAAS,CAACL,MAAuB;AACxD,MAAAP,EAAK,eAAeO,CAAU;AAAA,IAAA,GAC5BT,EAAM,YAAY;;;;;;;;;;;;;;;;;"}
|