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/index38.js
CHANGED
|
@@ -1,2 +1,157 @@
|
|
|
1
|
-
|
|
1
|
+
import { defineComponent as S, ref as V, toRef as i, openBlock as l, createElementBlock as r, normalizeClass as h, createElementVNode as g, renderSlot as s, unref as d, createTextVNode as v, toDisplayString as y, createCommentVNode as _, Fragment as k, renderList as z, createVNode as F, mergeProps as w, createSlots as N, withCtx as I } from "vue";
|
|
2
|
+
import { useOptions as M } from "./index7.js";
|
|
3
|
+
import H from "./index36.js";
|
|
4
|
+
import "./index37.js";
|
|
5
|
+
const O = { class: "bb-base-switch-group__container" }, j = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "bb-base-switch-group__loading-container"
|
|
8
|
+
}, A = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "bb-base-switch-group__no-data-container"
|
|
11
|
+
}, J = /* @__PURE__ */ S({
|
|
12
|
+
__name: "BaseSwitchGroup",
|
|
13
|
+
props: {
|
|
14
|
+
ariaDescribedby: {},
|
|
15
|
+
autofocus: {},
|
|
16
|
+
color: {},
|
|
17
|
+
dependencies: {},
|
|
18
|
+
depsDebounceTime: { default: 0 },
|
|
19
|
+
direction: { default: "horizontal" },
|
|
20
|
+
disabled: { type: Boolean },
|
|
21
|
+
enforceCoherence: { type: Boolean },
|
|
22
|
+
hasErrors: { type: Boolean },
|
|
23
|
+
hideLabel: { type: Boolean },
|
|
24
|
+
id: {},
|
|
25
|
+
items: { type: [Array, Function], default: () => [] },
|
|
26
|
+
itemText: {},
|
|
27
|
+
itemValue: {},
|
|
28
|
+
loadingText: { default: "Caricamento..." },
|
|
29
|
+
matchStrategy: { default: "string" },
|
|
30
|
+
modelValue: {},
|
|
31
|
+
modelValueDebounceTime: { default: 0 },
|
|
32
|
+
name: {},
|
|
33
|
+
noDataText: { default: "Nessun elemento da visualizzare" },
|
|
34
|
+
readonly: {}
|
|
35
|
+
},
|
|
36
|
+
emits: ["blur", "change", "click", "focus", "inactive", "input", "keydown", "mousedown", "mouseup", "update:modelValue"],
|
|
37
|
+
setup(T, { emit: E }) {
|
|
38
|
+
const a = T, o = E, u = V(), c = V(!1), { loading: C, options: m } = M({
|
|
39
|
+
dependencies: i(() => a.dependencies),
|
|
40
|
+
depsDebounceTime: a.depsDebounceTime,
|
|
41
|
+
disabled: i(() => a.disabled),
|
|
42
|
+
emitter: (e) => o("update:modelValue", e),
|
|
43
|
+
enforceCoherence: i(() => a.enforceCoherence),
|
|
44
|
+
id: a.id,
|
|
45
|
+
immediate: !0,
|
|
46
|
+
initialItems: i(() => a.items),
|
|
47
|
+
itemText: a.itemText,
|
|
48
|
+
itemValue: a.itemValue,
|
|
49
|
+
matchStrategy: "string",
|
|
50
|
+
modelValue: i(() => a.modelValue),
|
|
51
|
+
modelValueDebounceTime: a.modelValueDebounceTime,
|
|
52
|
+
multiple: !0
|
|
53
|
+
}), D = (e) => {
|
|
54
|
+
let n;
|
|
55
|
+
e.selected ? n = a.modelValue.slice(0, e.selectedIndex).concat(a.modelValue.slice(e.selectedIndex + 1)) : n = a.modelValue.concat(e.value), o("update:modelValue", n);
|
|
56
|
+
}, L = (e, n) => {
|
|
57
|
+
o("change", e), D(n);
|
|
58
|
+
}, $ = {
|
|
59
|
+
onBlur: (e) => o("blur", e),
|
|
60
|
+
onClick: (e) => o("click", e),
|
|
61
|
+
onFocus: (e) => {
|
|
62
|
+
o("focus", e), c.value || (document.addEventListener("focusin", b, { passive: !0 }), document.addEventListener("click", p, { passive: !0 }), c.value = !0);
|
|
63
|
+
},
|
|
64
|
+
onInput: (e) => o("input", e),
|
|
65
|
+
onKeydown: (e) => o("keydown", e),
|
|
66
|
+
onMousedown: (e) => o("mousedown", e),
|
|
67
|
+
onMouseup: (e) => o("mouseup", e)
|
|
68
|
+
}, b = (e) => {
|
|
69
|
+
var n;
|
|
70
|
+
e.target instanceof HTMLElement && ((n = u.value) != null && n.contains(e.target) || (o("inactive"), c.value = !1, document.removeEventListener("focusin", b), document.removeEventListener("click", p)));
|
|
71
|
+
}, p = (e) => {
|
|
72
|
+
var n;
|
|
73
|
+
e.target instanceof HTMLElement && ((n = u.value) != null && n.contains(e.target) || (o("inactive"), c.value = !1, document.removeEventListener("focusin", b), document.removeEventListener("click", p)));
|
|
74
|
+
};
|
|
75
|
+
return (e, n) => (l(), r("span", {
|
|
76
|
+
ref_key: "container",
|
|
77
|
+
ref: u,
|
|
78
|
+
class: h(["bb-base-switch-group", {
|
|
79
|
+
"bb-base-switch-group--errors": e.hasErrors,
|
|
80
|
+
"bb-base-switch-group--horizontal": e.direction === "horizontal",
|
|
81
|
+
"bb-base-switch-group--vertical": e.direction === "vertical"
|
|
82
|
+
}])
|
|
83
|
+
}, [
|
|
84
|
+
g("span", O, [
|
|
85
|
+
s(e.$slots, "prepend"),
|
|
86
|
+
!d(m).length && d(C) ? (l(), r("span", j, [
|
|
87
|
+
s(e.$slots, "loading", {}, () => [
|
|
88
|
+
v(y(e.loadingText), 1)
|
|
89
|
+
])
|
|
90
|
+
])) : d(m).length ? _("", !0) : (l(), r("span", A, [
|
|
91
|
+
s(e.$slots, "no-data", {}, () => [
|
|
92
|
+
v(y(e.noDataText), 1)
|
|
93
|
+
])
|
|
94
|
+
])),
|
|
95
|
+
(l(!0), r(k, null, z(d(m), (t, B) => (l(), r(k, {
|
|
96
|
+
key: (t == null ? void 0 : t.id) || t.jsonValue
|
|
97
|
+
}, [
|
|
98
|
+
s(e.$slots, "option:prepend", {
|
|
99
|
+
item: t.original
|
|
100
|
+
}),
|
|
101
|
+
g("label", {
|
|
102
|
+
class: h(["bb-base-switch-group-option", {
|
|
103
|
+
"bb-base-switch-group-option__selected": t.selected
|
|
104
|
+
}])
|
|
105
|
+
}, [
|
|
106
|
+
F(H, w({
|
|
107
|
+
"aria-describedby": e.ariaDescribedby,
|
|
108
|
+
autofocus: e.autofocus && !B,
|
|
109
|
+
checked: t.selected,
|
|
110
|
+
color: e.color,
|
|
111
|
+
disabled: t.disabled,
|
|
112
|
+
"has-errors": e.hasErrors,
|
|
113
|
+
id: t.id,
|
|
114
|
+
name: e.name,
|
|
115
|
+
onChange: (f) => L(f, t),
|
|
116
|
+
readonly: e.readonly,
|
|
117
|
+
"true-value": t.value
|
|
118
|
+
}, $), N({ _: 2 }, [
|
|
119
|
+
e.$slots.icon ? {
|
|
120
|
+
name: "icon",
|
|
121
|
+
fn: I((f) => [
|
|
122
|
+
s(e.$slots, "icon", w({
|
|
123
|
+
item: t.original,
|
|
124
|
+
text: t.text
|
|
125
|
+
}, f))
|
|
126
|
+
]),
|
|
127
|
+
key: "0"
|
|
128
|
+
} : void 0
|
|
129
|
+
]), 1040, ["aria-describedby", "autofocus", "checked", "color", "disabled", "has-errors", "id", "name", "onChange", "readonly", "true-value"]),
|
|
130
|
+
g("span", {
|
|
131
|
+
class: h({
|
|
132
|
+
"bb-base-switch-group-option__text": !0,
|
|
133
|
+
"bb-base-switch-group-option__text--hidden": e.hideLabel
|
|
134
|
+
})
|
|
135
|
+
}, [
|
|
136
|
+
s(e.$slots, "label", {
|
|
137
|
+
checked: t.selected,
|
|
138
|
+
item: t.original,
|
|
139
|
+
text: t.text
|
|
140
|
+
}, () => [
|
|
141
|
+
v(y(t.text), 1)
|
|
142
|
+
])
|
|
143
|
+
], 2)
|
|
144
|
+
], 2),
|
|
145
|
+
s(e.$slots, "option:append", {
|
|
146
|
+
item: t.original
|
|
147
|
+
})
|
|
148
|
+
], 64))), 128)),
|
|
149
|
+
s(e.$slots, "append")
|
|
150
|
+
])
|
|
151
|
+
], 2));
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
export {
|
|
155
|
+
J as default
|
|
156
|
+
};
|
|
2
157
|
//# sourceMappingURL=index38.js.map
|
package/dist/index38.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index38.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index38.js","sources":["../src/components/BaseSwitchGroup/BaseSwitchGroup.vue"],"sourcesContent":["<template>\n\t<span\n\t\tref=\"container\"\n\t\tclass=\"bb-base-switch-group\"\n\t\t:class=\"{\n\t\t\t'bb-base-switch-group--errors': hasErrors,\n\t\t\t'bb-base-switch-group--horizontal': direction === 'horizontal',\n\t\t\t'bb-base-switch-group--vertical': direction === 'vertical',\n\t\t}\"\n\t>\n\t\t<span class=\"bb-base-switch-group__container\">\n\t\t\t<slot name=\"prepend\"></slot>\n\t\t\t<span\n\t\t\t\tv-if=\"!options.length && loading\"\n\t\t\t\tclass=\"bb-base-switch-group__loading-container\"\n\t\t\t>\n\t\t\t\t<slot :name=\"'loading'\">{{ loadingText }}</slot>\n\t\t\t</span>\n\t\t\t<span\n\t\t\t\tv-else-if=\"!options.length\"\n\t\t\t\tclass=\"bb-base-switch-group__no-data-container\"\n\t\t\t>\n\t\t\t\t<slot :name=\"'no-data'\">{{ noDataText }}</slot>\n\t\t\t</span>\n\t\t\t<template\n\t\t\t\tv-for=\"(option, index) in options\"\n\t\t\t\t:key=\"option?.id || option.jsonValue\"\n\t\t\t>\n\t\t\t\t<slot :item=\"option.original\" name=\"option:prepend\"></slot>\n\t\t\t\t<label\n\t\t\t\t\tclass=\"bb-base-switch-group-option\"\n\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t'bb-base-switch-group-option__selected': option.selected,\n\t\t\t\t\t}\"\n\t\t\t\t>\n\t\t\t\t\t<BaseSwitch\n\t\t\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t\t\t:autofocus=\"autofocus && !index\"\n\t\t\t\t\t\t:checked=\"option.selected\"\n\t\t\t\t\t\t:color=\"color\"\n\t\t\t\t\t\t:disabled=\"option.disabled\"\n\t\t\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t\t\t:id=\"option.id\"\n\t\t\t\t\t\t:name=\"name\"\n\t\t\t\t\t\t:onChange=\"(event: Event) => onChange(event, option)\"\n\t\t\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t\t\t:true-value=\"option.value\"\n\t\t\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<template v-if=\"$slots.icon\" #icon=\"data\">\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:item=\"option.original\"\n\t\t\t\t\t\t\t\tname=\"icon\"\n\t\t\t\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t\t\t\t\tv-bind=\"data\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</BaseSwitch>\n\t\t\t\t\t<span\n\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t'bb-base-switch-group-option__text': true,\n\t\t\t\t\t\t\t'bb-base-switch-group-option__text--hidden': hideLabel,\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\t><slot\n\t\t\t\t\t\t\t:checked=\"option.selected\"\n\t\t\t\t\t\t\t:item=\"option.original\"\n\t\t\t\t\t\t\tname=\"label\"\n\t\t\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t\t\t\t>{{ option.text }}</slot\n\t\t\t\t\t\t></span\n\t\t\t\t\t>\n\t\t\t\t</label>\n\t\t\t\t<slot :item=\"option.original\" name=\"option:append\"></slot>\n\t\t\t</template>\n\t\t\t<slot name=\"append\"></slot>\n\t\t</span>\n\t</span>\n</template>\n\n<script setup lang=\"ts\" generic=\"T = any\">\nimport { ref, toRef } from 'vue';\nimport { useOptions } from '@/composables/useOptions';\nimport BaseSwitch from '../BaseSwitch/BaseSwitch.vue';\nimport type { Option } from '@/composables/useOptions';\nimport type { SlotAttributes } from '../BaseCheckbox/BaseCheckbox.vue';\nimport type {\n\tBaseCheckboxGroupEvents,\n\tBaseCheckboxGroupProps,\n} from '../BaseCheckboxGroup/BaseCheckboxGroup.vue';\n\nexport type BaseSwitchGroupEvents = BaseCheckboxGroupEvents;\n\nexport type BaseSwitchGroupProps<T> = BaseCheckboxGroupProps<T>;\n\nconst props = withDefaults(defineProps<BaseSwitchGroupProps<T>>(), {\n\tdepsDebounceTime: 0,\n\tdirection: 'horizontal',\n\titems: () => [],\n\tloadingText: 'Caricamento...',\n\tmatchStrategy: 'string',\n\tmodelValueDebounceTime: 0,\n\tnoDataText: 'Nessun elemento da visualizzare',\n});\n\nconst emit = defineEmits<BaseSwitchGroupEvents>();\n\ndefineSlots<{\n\tprepend?: (props: object) => any;\n\tloading?: (props: object) => any;\n\t'no-data'?: (props: object) => any;\n\t'option:prepend'?: (props: { item: T }) => any;\n\ticon?: (\n\t\tprops: SlotAttributes & {\n\t\t\titem: T;\n\t\t\ttext: string;\n\t\t}\n\t) => any;\n\tlabel?: (props: { item: T; text: string; checked: boolean }) => any;\n\t'option:append'?: (props: { item: T }) => any;\n\tappend?: (props: object) => any;\n}>();\n\nconst container = ref<HTMLElement>();\nconst active = ref(false);\n\nconst { loading, options } = useOptions({\n\tdependencies: toRef(() => props.dependencies),\n\tdepsDebounceTime: props.depsDebounceTime,\n\tdisabled: toRef(() => props.disabled),\n\temitter: (value) => emit('update:modelValue', value),\n\tenforceCoherence: toRef(() => props.enforceCoherence),\n\tid: props.id,\n\timmediate: true,\n\tinitialItems: toRef(() => props.items),\n\titemText: props.itemText,\n\titemValue: props.itemValue,\n\tmatchStrategy: 'string',\n\tmodelValue: toRef(() => props.modelValue),\n\tmodelValueDebounceTime: props.modelValueDebounceTime,\n\tmultiple: true,\n});\n\n/**\n * When selecting an option split behavior based on single or multiple selection\n */\nconst onOptionSelected = (option: Option) => {\n\tlet valueToEmit;\n\tif (option.selected) {\n\t\tvalueToEmit = props.modelValue\n\t\t\t.slice(0, option.selectedIndex)\n\t\t\t.concat(props.modelValue.slice(option.selectedIndex + 1));\n\t} else {\n\t\tvalueToEmit = props.modelValue.concat(option.value);\n\t}\n\temit('update:modelValue', valueToEmit);\n};\n\nconst onChange = (event: Event, option: Option) => {\n\temit('change', event);\n\tonOptionSelected(option);\n};\n\nconst onFocus = (event: FocusEvent) => {\n\temit('focus', event);\n\tif (!active.value) {\n\t\tdocument.addEventListener('focusin', onDocumentFocus, { passive: true });\n\t\tdocument.addEventListener('click', onDocumentClick, { passive: true });\n\t\tactive.value = true;\n\t}\n};\n\nconst eventListeners = {\n\tonBlur: (event: FocusEvent) => emit('blur', event),\n\tonClick: (event: MouseEvent) => emit('click', event),\n\tonFocus,\n\tonInput: (event: Event) => emit('input', event),\n\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n};\n\nconst onDocumentFocus = (event: FocusEvent) => {\n\tif (event.target instanceof HTMLElement) {\n\t\tif (!container.value?.contains(event.target)) {\n\t\t\temit('inactive');\n\t\t\tactive.value = false;\n\t\t\tdocument.removeEventListener('focusin', onDocumentFocus);\n\t\t\tdocument.removeEventListener('click', onDocumentClick);\n\t\t}\n\t}\n};\n\nconst onDocumentClick = (event: MouseEvent) => {\n\tif (event.target instanceof HTMLElement) {\n\t\tif (!container.value?.contains(event.target)) {\n\t\t\temit('inactive');\n\t\t\tactive.value = false;\n\t\t\tdocument.removeEventListener('focusin', onDocumentFocus);\n\t\t\tdocument.removeEventListener('click', onDocumentClick);\n\t\t}\n\t}\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BaseSwitchGroup';\n</style>\n"],"names":["props","__props","emit","__emit","container","ref","active","loading","options","useOptions","toRef","value","onOptionSelected","option","valueToEmit","onChange","event","eventListeners","onDocumentFocus","onDocumentClick","_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8FA,UAAMA,IAAQC,GAURC,IAAOC,GAkBPC,IAAYC,KACZC,IAASD,EAAI,EAAK,GAElB,EAAE,SAAAE,GAAS,SAAAC,EAAQ,IAAIC,EAAW;AAAA,MACvC,cAAcC,EAAM,MAAMV,EAAM,YAAY;AAAA,MAC5C,kBAAkBA,EAAM;AAAA,MACxB,UAAUU,EAAM,MAAMV,EAAM,QAAQ;AAAA,MACpC,SAAS,CAACW,MAAUT,EAAK,qBAAqBS,CAAK;AAAA,MACnD,kBAAkBD,EAAM,MAAMV,EAAM,gBAAgB;AAAA,MACpD,IAAIA,EAAM;AAAA,MACV,WAAW;AAAA,MACX,cAAcU,EAAM,MAAMV,EAAM,KAAK;AAAA,MACrC,UAAUA,EAAM;AAAA,MAChB,WAAWA,EAAM;AAAA,MACjB,eAAe;AAAA,MACf,YAAYU,EAAM,MAAMV,EAAM,UAAU;AAAA,MACxC,wBAAwBA,EAAM;AAAA,MAC9B,UAAU;AAAA,IAAA,CACV,GAKKY,IAAmB,CAACC,MAAmB;AACxC,UAAAC;AACJ,MAAID,EAAO,WACVC,IAAcd,EAAM,WAClB,MAAM,GAAGa,EAAO,aAAa,EAC7B,OAAOb,EAAM,WAAW,MAAMa,EAAO,gBAAgB,CAAC,CAAC,IAEzDC,IAAcd,EAAM,WAAW,OAAOa,EAAO,KAAK,GAEnDX,EAAK,qBAAqBY,CAAW;AAAA,IAAA,GAGhCC,IAAW,CAACC,GAAcH,MAAmB;AAClD,MAAAX,EAAK,UAAUc,CAAK,GACpBJ,EAAiBC,CAAM;AAAA,IAAA,GAYlBI,IAAiB;AAAA,MACtB,QAAQ,CAACD,MAAsBd,EAAK,QAAQc,CAAK;AAAA,MACjD,SAAS,CAACA,MAAsBd,EAAK,SAASc,CAAK;AAAA,MACnD,SAZe,CAACA,MAAsB;AACtC,QAAAd,EAAK,SAASc,CAAK,GACdV,EAAO,UACX,SAAS,iBAAiB,WAAWY,GAAiB,EAAE,SAAS,IAAM,GACvE,SAAS,iBAAiB,SAASC,GAAiB,EAAE,SAAS,IAAM,GACrEb,EAAO,QAAQ;AAAA,MAChB;AAAA,MAOA,SAAS,CAACU,MAAiBd,EAAK,SAASc,CAAK;AAAA,MAC9C,WAAW,CAACA,MAAyBd,EAAK,WAAWc,CAAK;AAAA,MAC1D,aAAa,CAACA,MAAsBd,EAAK,aAAac,CAAK;AAAA,MAC3D,WAAW,CAACA,MAAsBd,EAAK,WAAWc,CAAK;AAAA,IAAA,GAGlDE,IAAkB,CAACF,MAAsB;;AAC1C,MAAAA,EAAM,kBAAkB,iBACtBI,IAAAhB,EAAU,UAAV,QAAAgB,EAAiB,SAASJ,EAAM,YACpCd,EAAK,UAAU,GACfI,EAAO,QAAQ,IACN,SAAA,oBAAoB,WAAWY,CAAe,GAC9C,SAAA,oBAAoB,SAASC,CAAe;AAAA,IAEvD,GAGKA,IAAkB,CAACH,MAAsB;;AAC1C,MAAAA,EAAM,kBAAkB,iBACtBI,IAAAhB,EAAU,UAAV,QAAAgB,EAAiB,SAASJ,EAAM,YACpCd,EAAK,UAAU,GACfI,EAAO,QAAQ,IACN,SAAA,oBAAoB,WAAWY,CAAe,GAC9C,SAAA,oBAAoB,SAASC,CAAe;AAAA,IAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index39.js
CHANGED
|
@@ -1,84 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
const v = { class: "bb-base-textarea__inner-container" }, E = ["id", "autocomplete", "autofocus", "disabled", "name", "placeholder", "readonly", "value"], M = /* @__PURE__ */ h({
|
|
3
|
-
__name: "BaseTextarea",
|
|
4
|
-
props: {
|
|
5
|
-
autocomplete: {},
|
|
6
|
-
autofocus: {},
|
|
7
|
-
disabled: { type: Boolean },
|
|
8
|
-
hasErrors: { type: Boolean },
|
|
9
|
-
id: {},
|
|
10
|
-
name: {},
|
|
11
|
-
placeholder: {},
|
|
12
|
-
readonly: {},
|
|
13
|
-
autoGrow: { type: Boolean },
|
|
14
|
-
modelValue: {}
|
|
15
|
-
},
|
|
16
|
-
emits: ["blur", "change", "click", "focus", "input", "keydown", "mousedown", "mouseup", "update:modelValue"],
|
|
17
|
-
setup(d, { emit: p }) {
|
|
18
|
-
const a = d, o = p, t = y(null), i = r(() => ({
|
|
19
|
-
"bb-base-textarea": !0,
|
|
20
|
-
"bb-base-textarea--auto-grow": a.autoGrow,
|
|
21
|
-
"bb-base-textarea--disabled": a.disabled,
|
|
22
|
-
"bb-base-textarea--errors": a.hasErrors,
|
|
23
|
-
"bb-base-textarea--readonly": a.readonly
|
|
24
|
-
})), c = r(
|
|
25
|
-
() => a.modelValue ? a.modelValue : ""
|
|
26
|
-
);
|
|
27
|
-
g(() => {
|
|
28
|
-
a.autoGrow && n();
|
|
29
|
-
}), w(
|
|
30
|
-
() => a.modelValue,
|
|
31
|
-
() => {
|
|
32
|
-
a.autoGrow && k(n);
|
|
33
|
-
}
|
|
34
|
-
);
|
|
35
|
-
function m(e) {
|
|
36
|
-
if (e.stopPropagation(), e.target instanceof HTMLTextAreaElement) {
|
|
37
|
-
let s = e.target.value;
|
|
38
|
-
o("input", e), o("update:modelValue", s);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
function b(e) {
|
|
42
|
-
e.stopPropagation(), e.target instanceof HTMLTextAreaElement && o("keydown", e);
|
|
43
|
-
}
|
|
44
|
-
const f = {
|
|
45
|
-
onBlur: (e) => o("blur", e),
|
|
46
|
-
onChange: (e) => o("change", e),
|
|
47
|
-
onClick: (e) => o("click", e),
|
|
48
|
-
onFocus: (e) => o("focus", e),
|
|
49
|
-
onMousedown: (e) => o("mousedown", e),
|
|
50
|
-
onMouseup: (e) => o("mouseup", e)
|
|
51
|
-
};
|
|
52
|
-
function n() {
|
|
53
|
-
t.value && (t.value.style.height = "0px", t.value.style.height = `${t.value.scrollHeight}px`);
|
|
54
|
-
}
|
|
55
|
-
return (e, s) => (x(), V("span", {
|
|
56
|
-
class: B(["bb-base-textarea__container", i.value])
|
|
57
|
-
}, [
|
|
58
|
-
l(e.$slots, "prepend-outer"),
|
|
59
|
-
u("span", v, [
|
|
60
|
-
l(e.$slots, "prepend"),
|
|
61
|
-
u("textarea", T({ id: e.id }, f, {
|
|
62
|
-
ref_key: "textarea",
|
|
63
|
-
ref: t,
|
|
64
|
-
autocomplete: e.autocomplete,
|
|
65
|
-
autofocus: e.autofocus,
|
|
66
|
-
class: "bb-base-textarea__input",
|
|
67
|
-
disabled: e.disabled,
|
|
68
|
-
name: e.name,
|
|
69
|
-
placeholder: e.placeholder,
|
|
70
|
-
readonly: e.readonly,
|
|
71
|
-
value: c.value,
|
|
72
|
-
onInput: m,
|
|
73
|
-
onKeydown: b
|
|
74
|
-
}), null, 16, E),
|
|
75
|
-
l(e.$slots, "append")
|
|
76
|
-
]),
|
|
77
|
-
l(e.$slots, "append-outer")
|
|
78
|
-
], 2));
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
export {
|
|
82
|
-
M as default
|
|
83
|
-
};
|
|
1
|
+
|
|
84
2
|
//# sourceMappingURL=index39.js.map
|
package/dist/index39.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index39.js","sources":[
|
|
1
|
+
{"version":3,"file":"index39.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/index4.js
CHANGED
|
@@ -1,65 +1,81 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
1
|
+
import { ref as u, watch as c, reactive as x, computed as f } from "vue";
|
|
2
|
+
import { isNil as l } from "./index121.js";
|
|
3
|
+
let r = [];
|
|
4
|
+
const i = u(null);
|
|
5
|
+
c(
|
|
6
|
+
() => i.value,
|
|
7
|
+
() => {
|
|
8
|
+
typeof i.value == "boolean" && (r.forEach((s) => s()), r = []);
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
const o = {
|
|
12
|
+
actions: !0,
|
|
13
|
+
description: "",
|
|
14
|
+
loading: !1,
|
|
15
|
+
no: !0,
|
|
16
|
+
noText: "",
|
|
17
|
+
open: !1,
|
|
18
|
+
size: "sm",
|
|
19
|
+
text: "",
|
|
20
|
+
theme: "default",
|
|
21
|
+
title: "",
|
|
22
|
+
yes: !0,
|
|
23
|
+
yesText: ""
|
|
24
|
+
}, d = {
|
|
25
|
+
actions: !0,
|
|
26
|
+
description: "",
|
|
27
|
+
no: !0,
|
|
28
|
+
noText: "Annulla",
|
|
29
|
+
text: "",
|
|
30
|
+
theme: "default",
|
|
31
|
+
title: "",
|
|
32
|
+
yes: !0,
|
|
33
|
+
yesText: "OK"
|
|
34
|
+
}, e = x({
|
|
35
|
+
...o
|
|
36
|
+
}), m = f(() => [
|
|
37
|
+
{
|
|
38
|
+
text: e.noText,
|
|
39
|
+
handler: () => {
|
|
40
|
+
i.value = !1;
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
text: e.yesText,
|
|
45
|
+
handler: () => {
|
|
46
|
+
i.value = !0;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
]), y = () => ({
|
|
50
|
+
/**
|
|
51
|
+
* The confirm function. It accepts a set of options defining
|
|
52
|
+
* the behavior of the modal and returns `Promise<boolean>`
|
|
53
|
+
* when the user accepts, declines, or ignores the modal.
|
|
54
|
+
*/
|
|
55
|
+
confirm: (s) => {
|
|
56
|
+
i.value = null;
|
|
57
|
+
const n = { ...d, ...s }, t = { ...o };
|
|
58
|
+
return t.title = n.title, t.text = n.text, n.description && (t.description = n.description), n.noText && (t.noText = n.noText), n.yesText && (t.yesText = n.yesText), n.size && (t.size = n.size), n.theme && (t.theme = n.theme), l(n.yes) || (t.yes = !!n.yes), l(n.no) || (t.no = !!n.no), l(n.actions) || (t.actions = !!n.actions), e.actions = t.actions, e.description = t.description, e.no = t.no, e.noText = t.noText, e.open = !0, e.size = t.size, e.text = t.text, e.theme = t.theme, e.title = t.title, e.yes = t.yes, e.yesText = t.yesText, new Promise((a) => {
|
|
59
|
+
r.push(() => a(i.value));
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
/**
|
|
63
|
+
* Sets the state of the confirm to loading and displays a spinner.
|
|
64
|
+
*/
|
|
65
|
+
setLoading: (s = !0) => {
|
|
66
|
+
e.loading = s;
|
|
67
|
+
},
|
|
68
|
+
/**
|
|
69
|
+
* Closes the confirmation modal. It is a manual operation
|
|
70
|
+
* so you can update the state while the modal is still open.
|
|
71
|
+
*/
|
|
72
|
+
close: () => (e.description = o.description, e.loading = o.loading, e.noText = o.noText, e.open = o.open, e.text = o.text, e.theme = o.theme, e.title = o.title, e.yesText = o.yesText, i.value = !1, Promise.resolve().then(() => {
|
|
73
|
+
i.value = null;
|
|
74
|
+
}))
|
|
75
|
+
});
|
|
62
76
|
export {
|
|
63
|
-
|
|
77
|
+
m as actions,
|
|
78
|
+
e as state,
|
|
79
|
+
y as useConfirm
|
|
64
80
|
};
|
|
65
81
|
//# sourceMappingURL=index4.js.map
|
package/dist/index4.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index4.js","sources":["../src/composables/
|
|
1
|
+
{"version":3,"file":"index4.js","sources":["../src/composables/useConfirm.ts"],"sourcesContent":["import { computed, reactive, ref, watch } from 'vue';\nimport { isNil } from '@/utilities/functions/isNil';\nimport type { Sizes } from '@/components/BaseDialog/BaseDialog.vue';\n\ntype State = {\n\tdescription: string;\n\ttheme: string;\n\tloading: boolean;\n\tnoText: string;\n\topen: boolean;\n\ttext: string;\n\ttitle: string;\n\tyesText: string;\n\tyes: boolean;\n\tno: boolean;\n\tactions: boolean;\n\tsize: keyof Sizes;\n};\n\ntype UserOptions = {\n\t/**\n\t * Boolean that sets whether to display or hide the buttons.\n\t * Confirms without actions can only be dismissed by clicking on the overlay or the close button.\n\t */\n\tactions?: State['actions'];\n\t/**\n\t * Description of the content of the modal for accessibility purposes.\n\t */\n\tdescription?: State['description'];\n\t/**\n\t * Boolean that defines whether to display or hide the \"No\" action.\n\t */\n\tno?: State['no'];\n\t/**\n\t * Text content of the \"No\" action.\n\t */\n\tnoText?: State['noText'];\n\t/**\n\t * Text content of the modal.\n\t */\n\ttext: State['text'];\n\t/**\n\t * The name of the theme it applies a css class to BbConfirm for styling.\n\t */\n\ttheme?: State['theme'];\n\t/**\n\t * Tittle of the modal\n\t */\n\ttitle: State['title'];\n\t/**\n\t * Boolean that defines whether to display or hide the \"Yes\" action.\n\t */\n\tyes?: State['yes'];\n\t/**\n\t * Text content of the \"Yes\" action.\n\t */\n\tyesText?: State['yesText'];\n\t/**\n\t * Size of the confirm modal. Use any sizes valid for `BbModal`.\n\t */\n\tsize?: State['size'];\n};\n\n// Stash all instances of current dialogs\nlet subscribers: ((...args: any[]) => any)[] = [];\n\nconst value = ref<boolean | null>(null);\n\nwatch(\n\t() => value.value,\n\t() => {\n\t\tif (typeof value.value === 'boolean') {\n\t\t\t// Every time a dialog is resolved resolve all dialogs\n\t\t\tsubscribers.forEach((fn) => fn());\n\t\t\tsubscribers = [];\n\t\t}\n\t}\n);\n\nconst defaultState: State = {\n\tactions: true,\n\tdescription: '',\n\tloading: false,\n\tno: true,\n\tnoText: '',\n\topen: false,\n\tsize: 'sm',\n\ttext: '',\n\ttheme: 'default',\n\ttitle: '',\n\tyes: true,\n\tyesText: '',\n};\nconst defaultOption: UserOptions = {\n\tactions: true,\n\tdescription: '',\n\tno: true,\n\tnoText: 'Annulla',\n\ttext: '',\n\ttheme: 'default',\n\ttitle: '',\n\tyes: true,\n\tyesText: 'OK',\n};\n\nexport const state = reactive<State>({\n\t...defaultState,\n});\n\nexport const actions = computed(() => [\n\t{\n\t\ttext: state.noText,\n\t\thandler: () => {\n\t\t\tvalue.value = false;\n\t\t},\n\t},\n\t{\n\t\ttext: state.yesText,\n\t\thandler: () => {\n\t\t\tvalue.value = true;\n\t\t},\n\t},\n]);\n\nexport const useConfirm = () => {\n\treturn {\n\t\t/**\n\t\t * The confirm function. It accepts a set of options defining\n\t\t * the behavior of the modal and returns `Promise<boolean>`\n\t\t * when the user accepts, declines, or ignores the modal.\n\t\t */\n\t\tconfirm: (options: UserOptions) => {\n\t\t\tvalue.value = null;\n\t\t\tconst newOptions = { ...defaultOption, ...options };\n\t\t\tconst newState = { ...defaultState };\n\t\t\tnewState.title = newOptions.title;\n\t\t\tnewState.text = newOptions.text;\n\t\t\tif (newOptions.description) newState.description = newOptions.description;\n\t\t\tif (newOptions.noText) newState.noText = newOptions.noText;\n\t\t\tif (newOptions.yesText) newState.yesText = newOptions.yesText;\n\t\t\tif (newOptions.size) newState.size = newOptions.size;\n\t\t\tif (newOptions.theme) newState.theme = newOptions.theme;\n\t\t\tif (!isNil(newOptions.yes)) newState.yes = !!newOptions.yes;\n\t\t\tif (!isNil(newOptions.no)) newState.no = !!newOptions.no;\n\t\t\tif (!isNil(newOptions.actions)) newState.actions = !!newOptions.actions;\n\n\t\t\tstate.actions = newState.actions;\n\t\t\tstate.description = newState.description;\n\t\t\tstate.no = newState.no;\n\t\t\tstate.noText = newState.noText;\n\t\t\tstate.open = true;\n\t\t\tstate.size = newState.size;\n\t\t\tstate.text = newState.text;\n\t\t\tstate.theme = newState.theme;\n\t\t\tstate.title = newState.title;\n\t\t\tstate.yes = newState.yes;\n\t\t\tstate.yesText = newState.yesText;\n\n\t\t\treturn new Promise<boolean>((resolve) => {\n\t\t\t\tsubscribers.push(() => resolve(value.value as boolean));\n\t\t\t});\n\t\t},\n\t\t/**\n\t\t * Sets the state of the confirm to loading and displays a spinner.\n\t\t */\n\t\tsetLoading: (value: boolean = true) => {\n\t\t\tstate.loading = value;\n\t\t},\n\t\t/**\n\t\t * Closes the confirmation modal. It is a manual operation\n\t\t * so you can update the state while the modal is still open.\n\t\t */\n\t\tclose: () => {\n\t\t\tstate.description = defaultState.description;\n\t\t\tstate.loading = defaultState.loading;\n\t\t\tstate.noText = defaultState.noText;\n\t\t\tstate.open = defaultState.open;\n\t\t\tstate.text = defaultState.text;\n\t\t\tstate.theme = defaultState.theme;\n\t\t\tstate.title = defaultState.title;\n\t\t\tstate.yesText = defaultState.yesText;\n\t\t\tvalue.value = false;\n\t\t\treturn Promise.resolve().then(() => {\n\t\t\t\tvalue.value = null;\n\t\t\t});\n\t\t},\n\t};\n};\n"],"names":["subscribers","value","ref","watch","fn","defaultState","defaultOption","state","reactive","actions","computed","useConfirm","options","newOptions","newState","isNil","resolve"],"mappings":";;AAgEA,IAAIA,IAA2C,CAAA;AAE/C,MAAMC,IAAQC,EAAoB,IAAI;AAEtCC;AAAA,EACC,MAAMF,EAAM;AAAA,EACZ,MAAM;AACD,IAAA,OAAOA,EAAM,SAAU,cAE1BD,EAAY,QAAQ,CAACI,MAAOA,EAAI,CAAA,GAChCJ,IAAc,CAAA;AAAA,EAEhB;AACD;AAEA,MAAMK,IAAsB;AAAA,EAC3B,SAAS;AAAA,EACT,aAAa;AAAA,EACb,SAAS;AAAA,EACT,IAAI;AAAA,EACJ,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,KAAK;AAAA,EACL,SAAS;AACV,GACMC,IAA6B;AAAA,EAClC,SAAS;AAAA,EACT,aAAa;AAAA,EACb,IAAI;AAAA,EACJ,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,KAAK;AAAA,EACL,SAAS;AACV,GAEaC,IAAQC,EAAgB;AAAA,EACpC,GAAGH;AACJ,CAAC,GAEYI,IAAUC,EAAS,MAAM;AAAA,EACrC;AAAA,IACC,MAAMH,EAAM;AAAA,IACZ,SAAS,MAAM;AACd,MAAAN,EAAM,QAAQ;AAAA,IACf;AAAA,EACD;AAAA,EACA;AAAA,IACC,MAAMM,EAAM;AAAA,IACZ,SAAS,MAAM;AACd,MAAAN,EAAM,QAAQ;AAAA,IACf;AAAA,EACD;AACD,CAAC,GAEYU,IAAa,OAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMN,SAAS,CAACC,MAAyB;AAClC,IAAAX,EAAM,QAAQ;AACd,UAAMY,IAAa,EAAE,GAAGP,GAAe,GAAGM,EAAQ,GAC5CE,IAAW,EAAE,GAAGT;AACtB,WAAAS,EAAS,QAAQD,EAAW,OAC5BC,EAAS,OAAOD,EAAW,MACvBA,EAAW,gBAAaC,EAAS,cAAcD,EAAW,cAC1DA,EAAW,WAAQC,EAAS,SAASD,EAAW,SAChDA,EAAW,YAASC,EAAS,UAAUD,EAAW,UAClDA,EAAW,SAAMC,EAAS,OAAOD,EAAW,OAC5CA,EAAW,UAAOC,EAAS,QAAQD,EAAW,QAC7CE,EAAMF,EAAW,GAAG,MAAYC,EAAA,MAAM,CAAC,CAACD,EAAW,MACnDE,EAAMF,EAAW,EAAE,MAAYC,EAAA,KAAK,CAAC,CAACD,EAAW,KACjDE,EAAMF,EAAW,OAAO,MAAYC,EAAA,UAAU,CAAC,CAACD,EAAW,UAEhEN,EAAM,UAAUO,EAAS,SACzBP,EAAM,cAAcO,EAAS,aAC7BP,EAAM,KAAKO,EAAS,IACpBP,EAAM,SAASO,EAAS,QACxBP,EAAM,OAAO,IACbA,EAAM,OAAOO,EAAS,MACtBP,EAAM,OAAOO,EAAS,MACtBP,EAAM,QAAQO,EAAS,OACvBP,EAAM,QAAQO,EAAS,OACvBP,EAAM,MAAMO,EAAS,KACrBP,EAAM,UAAUO,EAAS,SAElB,IAAI,QAAiB,CAACE,MAAY;AACxC,MAAAhB,EAAY,KAAK,MAAMgB,EAAQf,EAAM,KAAgB,CAAC;AAAA,IAAA,CACtD;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAIA,YAAY,CAACA,IAAiB,OAAS;AACtC,IAAAM,EAAM,UAAUN;AAAAA,EACjB;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,OACNM,EAAM,cAAcF,EAAa,aACjCE,EAAM,UAAUF,EAAa,SAC7BE,EAAM,SAASF,EAAa,QAC5BE,EAAM,OAAOF,EAAa,MAC1BE,EAAM,OAAOF,EAAa,MAC1BE,EAAM,QAAQF,EAAa,OAC3BE,EAAM,QAAQF,EAAa,OAC3BE,EAAM,UAAUF,EAAa,SAC7BJ,EAAM,QAAQ,IACP,QAAQ,UAAU,KAAK,MAAM;AACnC,IAAAA,EAAM,QAAQ;AAAA,EAAA,CACd;AACF;"}
|
package/dist/index40.js
CHANGED
|
@@ -1,2 +1,88 @@
|
|
|
1
|
-
|
|
1
|
+
import { defineComponent as h, ref as y, computed as n, onMounted as g, watch as w, nextTick as k, openBlock as V, createElementBlock as x, normalizeClass as B, renderSlot as l, createElementVNode as u, mergeProps as T } from "vue";
|
|
2
|
+
const v = { class: "bb-base-textarea__inner-container" }, E = ["aria-describedby", "autocomplete", "autofocus", "disabled", "id", "name", "placeholder", "readonly", "value"], _ = /* @__PURE__ */ h({
|
|
3
|
+
__name: "BaseTextarea",
|
|
4
|
+
props: {
|
|
5
|
+
ariaDescribedby: {},
|
|
6
|
+
autocomplete: {},
|
|
7
|
+
autofocus: {},
|
|
8
|
+
disabled: { type: Boolean },
|
|
9
|
+
hasErrors: { type: Boolean },
|
|
10
|
+
id: {},
|
|
11
|
+
name: {},
|
|
12
|
+
placeholder: {},
|
|
13
|
+
readonly: {},
|
|
14
|
+
autoGrow: { type: Boolean },
|
|
15
|
+
modelValue: {}
|
|
16
|
+
},
|
|
17
|
+
emits: ["blur", "change", "click", "focus", "input", "keydown", "mousedown", "mouseup", "update:modelValue"],
|
|
18
|
+
setup(d, { emit: i }) {
|
|
19
|
+
const a = d, o = i, t = y(null), p = n(() => ({
|
|
20
|
+
"bb-base-textarea": !0,
|
|
21
|
+
"bb-base-textarea--auto-grow": a.autoGrow,
|
|
22
|
+
"bb-base-textarea--disabled": a.disabled,
|
|
23
|
+
"bb-base-textarea--errors": a.hasErrors,
|
|
24
|
+
"bb-base-textarea--readonly": a.readonly
|
|
25
|
+
})), c = n(
|
|
26
|
+
() => a.modelValue ? a.modelValue : ""
|
|
27
|
+
);
|
|
28
|
+
g(() => {
|
|
29
|
+
a.autoGrow && a.modelValue && r();
|
|
30
|
+
}), w(
|
|
31
|
+
() => a.modelValue,
|
|
32
|
+
() => {
|
|
33
|
+
a.autoGrow && k(r);
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
function b(e) {
|
|
37
|
+
if (e.stopPropagation(), e.target instanceof HTMLTextAreaElement) {
|
|
38
|
+
let s = e.target.value;
|
|
39
|
+
o("input", e), o("update:modelValue", s);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function m(e) {
|
|
43
|
+
e.stopPropagation(), e.target instanceof HTMLTextAreaElement && o("keydown", e);
|
|
44
|
+
}
|
|
45
|
+
const f = {
|
|
46
|
+
onBlur: (e) => o("blur", e),
|
|
47
|
+
onChange: (e) => o("change", e),
|
|
48
|
+
onClick: (e) => o("click", e),
|
|
49
|
+
onFocus: (e) => o("focus", e),
|
|
50
|
+
onMousedown: (e) => o("mousedown", e),
|
|
51
|
+
onMouseup: (e) => o("mouseup", e)
|
|
52
|
+
};
|
|
53
|
+
function r() {
|
|
54
|
+
t.value && (t.value.style.height = "0px", t.value.style.height = `${t.value.scrollHeight}px`);
|
|
55
|
+
}
|
|
56
|
+
return (e, s) => (V(), x("span", {
|
|
57
|
+
class: B(["bb-base-textarea__container", p.value])
|
|
58
|
+
}, [
|
|
59
|
+
l(e.$slots, "prepend-outer"),
|
|
60
|
+
u("span", v, [
|
|
61
|
+
l(e.$slots, "prepend"),
|
|
62
|
+
u("textarea", T({
|
|
63
|
+
"aria-describedby": e.ariaDescribedby,
|
|
64
|
+
autocomplete: e.autocomplete,
|
|
65
|
+
autofocus: e.autofocus,
|
|
66
|
+
class: "bb-base-textarea__input",
|
|
67
|
+
disabled: e.disabled,
|
|
68
|
+
id: e.id,
|
|
69
|
+
name: e.name,
|
|
70
|
+
placeholder: e.placeholder,
|
|
71
|
+
readonly: e.readonly,
|
|
72
|
+
value: c.value,
|
|
73
|
+
ref_key: "textarea",
|
|
74
|
+
ref: t
|
|
75
|
+
}, f, {
|
|
76
|
+
onInput: b,
|
|
77
|
+
onKeydown: m
|
|
78
|
+
}), null, 16, E),
|
|
79
|
+
l(e.$slots, "append")
|
|
80
|
+
]),
|
|
81
|
+
l(e.$slots, "append-outer")
|
|
82
|
+
], 2));
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
export {
|
|
86
|
+
_ as default
|
|
87
|
+
};
|
|
2
88
|
//# sourceMappingURL=index40.js.map
|
package/dist/index40.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index40.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index40.js","sources":["../src/components/BaseTextarea/BaseTextarea.vue"],"sourcesContent":["<template>\n\t<span class=\"bb-base-textarea__container\" :class=\"classes\">\n\t\t<slot name=\"prepend-outer\"></slot>\n\t\t<span class=\"bb-base-textarea__inner-container\">\n\t\t\t<slot name=\"prepend\"></slot>\n\t\t\t<textarea\n\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t:autocomplete=\"autocomplete\"\n\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t:class=\"'bb-base-textarea__input'\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:id=\"id\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t:value=\"modelValueWithDefault\"\n\t\t\t\tref=\"textarea\"\n\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t\t@input=\"onInput\"\n\t\t\t\t@keydown=\"onKeydown\"\n\t\t\t></textarea>\n\t\t\t<slot name=\"append\"></slot>\n\t\t</span>\n\t\t<slot name=\"append-outer\"></slot>\n\t</span>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, nextTick, onMounted, ref, watch } from 'vue';\nimport type { HTMLAttributes, InputHTMLAttributes, Ref } from 'vue';\n\nexport type BaseTextareaProps = {\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tariaDescribedby?: InputHTMLAttributes['aria-describedby'];\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tautocomplete?: InputHTMLAttributes['autocomplete'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n\n\t/**\n\t * Expands the textarea to match its content\n\t */\n\tautoGrow?: boolean;\n\t/**\n\t * Used by v-model\n\t */\n\tmodelValue: string | null;\n};\nconst props = defineProps<BaseTextareaProps>();\n\nexport type BaseTextareaEvents = {\n\t(e: 'blur', event: FocusEvent): void;\n\t(e: 'change', event: Event): void;\n\t(e: 'click', event: MouseEvent): void;\n\t(e: 'focus', event: FocusEvent): void;\n\t(e: 'input', event: Event): void;\n\t(e: 'keydown', event: KeyboardEvent): void;\n\t(e: 'mousedown', event: MouseEvent): void;\n\t(e: 'mouseup', event: MouseEvent): void;\n\t(e: 'update:modelValue', value: string | null): void;\n};\nconst emit = defineEmits<BaseTextareaEvents>();\n\nexport type BaseTextareaSlots = {\n\t'prepend-outer'?: (props: object) => any;\n\tprepend?: (props: object) => any;\n\tappend?: (props: object) => any;\n\t'append-outer'?: (props: object) => any;\n};\n\ndefineSlots<BaseTextareaSlots>();\n\nconst textarea: Ref<HTMLTextAreaElement | null> = ref(null);\n\nconst classes = computed(() => ({\n\t'bb-base-textarea': true,\n\t'bb-base-textarea--auto-grow': props.autoGrow,\n\t'bb-base-textarea--disabled': props.disabled,\n\t'bb-base-textarea--errors': props.hasErrors,\n\t'bb-base-textarea--readonly': props.readonly,\n}));\n\n// Allow modelvalue to be reset to null\nconst modelValueWithDefault = computed(() =>\n\tprops.modelValue ? props.modelValue : ''\n);\nonMounted(() => {\n\tif (props.autoGrow && props.modelValue) {\n\t\tcomputeTextareaHeight();\n\t}\n});\nwatch(\n\t() => props.modelValue,\n\t() => {\n\t\tif (props.autoGrow) {\n\t\t\tnextTick(computeTextareaHeight);\n\t\t}\n\t}\n);\n\nfunction onInput(event: Event): void {\n\t// Prevemt enter from triggering smt else\n\tevent.stopPropagation();\n\tif (event.target instanceof HTMLTextAreaElement) {\n\t\tlet value = event.target.value;\n\t\temit('input', event);\n\t\temit('update:modelValue', value);\n\t}\n}\nfunction onKeydown(event: KeyboardEvent): void {\n\t// Prevent enter from triggering smt else\n\tevent.stopPropagation();\n\tif (event.target instanceof HTMLTextAreaElement) {\n\t\temit('keydown', event);\n\t}\n}\n\n/**\n * These events are just propagated\n */\nconst eventListeners = {\n\tonBlur: (event: FocusEvent) => emit('blur', event),\n\tonChange: (event: Event) => emit('change', event),\n\tonClick: (event: MouseEvent) => emit('click', event),\n\tonFocus: (event: FocusEvent) => emit('focus', event),\n\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n};\n\n/* \nReset height and the apply scroll height otherwise it would not be able to shrink\n*/\nfunction computeTextareaHeight() {\n\tif (!textarea.value) return;\n\ttextarea.value.style.height = '0px';\n\n\ttextarea.value.style.height = `${textarea.value.scrollHeight}px`;\n}\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BaseTextarea';\n</style>\n"],"names":["props","__props","emit","__emit","textarea","ref","classes","computed","modelValueWithDefault","onMounted","computeTextareaHeight","watch","nextTick","onInput","event","value","onKeydown","eventListeners"],"mappings":";;;;;;;;;;;;;;;;;;AAsFA,UAAMA,IAAQC,GAaRC,IAAOC,GAWPC,IAA4CC,EAAI,IAAI,GAEpDC,IAAUC,EAAS,OAAO;AAAA,MAC/B,oBAAoB;AAAA,MACpB,+BAA+BP,EAAM;AAAA,MACrC,8BAA8BA,EAAM;AAAA,MACpC,4BAA4BA,EAAM;AAAA,MAClC,8BAA8BA,EAAM;AAAA,IACnC,EAAA,GAGIQ,IAAwBD;AAAA,MAAS,MACtCP,EAAM,aAAaA,EAAM,aAAa;AAAA,IAAA;AAEvC,IAAAS,EAAU,MAAM;AACX,MAAAT,EAAM,YAAYA,EAAM,cACLU;IACvB,CACA,GACDC;AAAA,MACC,MAAMX,EAAM;AAAA,MACZ,MAAM;AACL,QAAIA,EAAM,YACTY,EAASF,CAAqB;AAAA,MAEhC;AAAA,IAAA;AAGD,aAASG,EAAQC,GAAoB;AAGhC,UADJA,EAAM,gBAAgB,GAClBA,EAAM,kBAAkB,qBAAqB;AAC5C,YAAAC,IAAQD,EAAM,OAAO;AACzB,QAAAZ,EAAK,SAASY,CAAK,GACnBZ,EAAK,qBAAqBa,CAAK;AAAA,MAChC;AAAA,IACD;AACA,aAASC,EAAUF,GAA4B;AAE9C,MAAAA,EAAM,gBAAgB,GAClBA,EAAM,kBAAkB,uBAC3BZ,EAAK,WAAWY,CAAK;AAAA,IAEvB;AAKA,UAAMG,IAAiB;AAAA,MACtB,QAAQ,CAACH,MAAsBZ,EAAK,QAAQY,CAAK;AAAA,MACjD,UAAU,CAACA,MAAiBZ,EAAK,UAAUY,CAAK;AAAA,MAChD,SAAS,CAACA,MAAsBZ,EAAK,SAASY,CAAK;AAAA,MACnD,SAAS,CAACA,MAAsBZ,EAAK,SAASY,CAAK;AAAA,MACnD,aAAa,CAACA,MAAsBZ,EAAK,aAAaY,CAAK;AAAA,MAC3D,WAAW,CAACA,MAAsBZ,EAAK,WAAWY,CAAK;AAAA,IAAA;AAMxD,aAASJ,IAAwB;AAChC,MAAKN,EAAS,UACLA,EAAA,MAAM,MAAM,SAAS,OAE9BA,EAAS,MAAM,MAAM,SAAS,GAAGA,EAAS,MAAM,YAAY;AAAA,IAC7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|