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/index101.js
CHANGED
|
@@ -1,438 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { add as me } from "./index227.js";
|
|
3
|
-
import { clamp as ye } from "./index197.js";
|
|
4
|
-
import { deepEqual as he } from "./index123.js";
|
|
5
|
-
import { isNil as j } from "./index120.js";
|
|
6
|
-
import { isNotNil as _e } from "./index124.js";
|
|
7
|
-
import { useId as ke } from "./index7.js";
|
|
8
|
-
import { useItemValue as ge } from "./index126.js";
|
|
9
|
-
import { when as ve } from "./index220.js";
|
|
10
|
-
import G from "./index11.js";
|
|
11
|
-
import "./index12.js";
|
|
12
|
-
import Ce from "./index25.js";
|
|
13
|
-
import "./index26.js";
|
|
14
|
-
const we = { key: 0 }, Ve = { class: "bb-table-header-row" }, Ne = { class: "bb-table-header__content" }, Te = { class: "bb-table-check__label-text" }, Ae = {
|
|
15
|
-
key: 1,
|
|
16
|
-
class: "bb-table-radio__label-text"
|
|
17
|
-
}, Se = { class: "bb-table-header__content" }, $e = { class: "bb-table-header__content" }, Be = { class: "bb-table-loading__row" }, De = ["colspan"], Ie = { class: "bb-table-loading__text" }, Le = {
|
|
18
|
-
class: "bb-table-skeleton__container",
|
|
19
|
-
role: "status"
|
|
20
|
-
}, Re = /* @__PURE__ */ o("div", { class: "bb-table-skeleton-item__avatar-container" }, [
|
|
21
|
-
/* @__PURE__ */ o("div", { class: "bb-table-skeleton-item__avatar" })
|
|
22
|
-
], -1), xe = /* @__PURE__ */ o("div", { class: "bb-table-skeleton-item__text" }, [
|
|
23
|
-
/* @__PURE__ */ o("div", { class: "bb-table-skeleton-item__line" }),
|
|
24
|
-
/* @__PURE__ */ o("div", { class: "bb-table-skeleton-item__line" })
|
|
25
|
-
], -1), Ee = [
|
|
26
|
-
Re,
|
|
27
|
-
xe
|
|
28
|
-
], ze = { class: "bb-table-no-data__row" }, Oe = ["colspan"], qe = { class: "bb-table-no-data__text" }, Je = ["onClick", "onContextmenu", "onDblclick"], je = { class: "bb-table-check__label-text" }, Me = { class: "bb-table-radio__label-text" }, al = /* @__PURE__ */ ie({
|
|
29
|
-
__name: "BbTable",
|
|
30
|
-
props: {
|
|
31
|
-
accessibleLabel: { type: Function, default: ($) => ["Seleziona"].concat($.map((B) => B.content)).join(" ") },
|
|
32
|
-
actions: { type: Boolean },
|
|
33
|
-
actionsText: { default: "Azioni" },
|
|
34
|
-
align: { default: "left" },
|
|
35
|
-
allowSelectAll: { type: Boolean, default: !0 },
|
|
36
|
-
caption: {},
|
|
37
|
-
columns: { default: () => [] },
|
|
38
|
-
compact: { type: Boolean },
|
|
39
|
-
dependencies: { default: () => [] },
|
|
40
|
-
depsDebounceTime: { default: 0 },
|
|
41
|
-
disabled: { type: Boolean },
|
|
42
|
-
displayCaption: { type: Boolean },
|
|
43
|
-
fixed: { type: Boolean },
|
|
44
|
-
fixedColumns: { default: () => [] },
|
|
45
|
-
fixedHeader: { type: Boolean },
|
|
46
|
-
items: { type: [Array, Function], default: () => [] },
|
|
47
|
-
itemValue: {},
|
|
48
|
-
legend: {},
|
|
49
|
-
loading: { type: Boolean },
|
|
50
|
-
loadingText: { default: "Caricamento" },
|
|
51
|
-
matchStrategy: { default: "string" },
|
|
52
|
-
modelValue: {},
|
|
53
|
-
multiple: { type: Boolean, default: !0 },
|
|
54
|
-
name: {},
|
|
55
|
-
noDataText: { default: "Non ci sono elementi da visualizzare" },
|
|
56
|
-
readonly: {},
|
|
57
|
-
selectable: { type: [Boolean, Function] },
|
|
58
|
-
selectAll: { type: Boolean },
|
|
59
|
-
selectAllText: { default: "Seleziona tutti gli elementi di questa pagina" },
|
|
60
|
-
selectText: { default: "Seleziona un elemento" },
|
|
61
|
-
tdClass: {},
|
|
62
|
-
thClass: {}
|
|
63
|
-
},
|
|
64
|
-
emits: ["click:row", "contextmenu:row", "dblclick:row", "update:modelValue", "update:selectAll"],
|
|
65
|
-
setup($, { emit: B }) {
|
|
66
|
-
const { getItemValue: M } = ge(), D = ke().id.value, t = $, r = B, A = O(), K = t.accessibleLabel, Q = t.loadingText, X = t.noDataText, Y = t.selectAllText, Z = t.selectText, ee = p(() => t.selectable ? "fieldset" : "div"), I = O(!1), F = p(() => t.loading || I.value), H = p(() => [!!t.selectable, !!t.actions].reduce(
|
|
67
|
-
(e, a) => e + +!!a,
|
|
68
|
-
t.columns.length
|
|
69
|
-
)), le = p(() => {
|
|
70
|
-
if (t.matchStrategy === "string") {
|
|
71
|
-
let e = {};
|
|
72
|
-
return [].concat(t.modelValue).forEach((a, l) => {
|
|
73
|
-
e[JSON.stringify(a)] = l;
|
|
74
|
-
}), {
|
|
75
|
-
get: (a) => e[JSON.stringify(a)]
|
|
76
|
-
};
|
|
77
|
-
} else if (t.matchStrategy === "equality") {
|
|
78
|
-
const e = [].concat(t.modelValue).map((a, l) => [a, l]);
|
|
79
|
-
return {
|
|
80
|
-
get: (a) => {
|
|
81
|
-
var l;
|
|
82
|
-
return (l = e.find((c) => he(c[0], a))) == null ? void 0 : l[1];
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
} else
|
|
86
|
-
throw new Error("No match strategy has been defined");
|
|
87
|
-
}), P = p(
|
|
88
|
-
() => t.columns.reduce((e, a) => {
|
|
89
|
-
const l = a.key.split(/\W+/g).join("_");
|
|
90
|
-
return e[a.key] = l, e;
|
|
91
|
-
}, {})
|
|
92
|
-
), g = O([]), L = async () => {
|
|
93
|
-
let e = [];
|
|
94
|
-
Array.isArray(t.items) ? e = t.items : typeof t.items == "function" && (I.value = !0, e = await t.items(!0), I.value = !1), g.value = e;
|
|
95
|
-
};
|
|
96
|
-
de(L), q(
|
|
97
|
-
() => t.items,
|
|
98
|
-
async () => {
|
|
99
|
-
await L(), t.multiple ? r("update:modelValue", []) : r("update:modelValue", null);
|
|
100
|
-
}
|
|
101
|
-
);
|
|
102
|
-
let R;
|
|
103
|
-
q(() => t.dependencies, async (e, a) => {
|
|
104
|
-
JSON.stringify(e) !== JSON.stringify(a) && (R && clearTimeout(R), R = setTimeout(async () => {
|
|
105
|
-
await L(), t.multiple ? r("update:modelValue", []) : r("update:modelValue", null);
|
|
106
|
-
}, t.depsDebounceTime));
|
|
107
|
-
});
|
|
108
|
-
const te = p(
|
|
109
|
-
() => t.columns.map((e) => {
|
|
110
|
-
const a = e.align || "left", { label: l, key: c } = e, h = `header_${P.value[e.key]}`;
|
|
111
|
-
let i = [`bb-table-header--${a}`];
|
|
112
|
-
return t.thClass && (i = i.concat(t.thClass)), e.thClass && (i = i.concat(e.thClass)), {
|
|
113
|
-
align: a,
|
|
114
|
-
key: c,
|
|
115
|
-
label: l,
|
|
116
|
-
slotName: h,
|
|
117
|
-
classes: i
|
|
118
|
-
};
|
|
119
|
-
})
|
|
120
|
-
), w = p(() => g.value.map((e) => {
|
|
121
|
-
const a = M(e, t.itemValue), l = JSON.stringify(a);
|
|
122
|
-
let c = !!t.selectable;
|
|
123
|
-
typeof t.selectable == "function" && (c = !!t.selectable(e)), c = c && !t.disabled;
|
|
124
|
-
const h = le.value.get(a), i = !j(h), b = t.columns.map((s) => {
|
|
125
|
-
const x = P.value[s.key], S = s.align || "left", { label: E, key: z } = s;
|
|
126
|
-
let u = M(e, s.key);
|
|
127
|
-
s.formatter && // By default the formatter runs anyway
|
|
128
|
-
(!j(u) || s.formatOnNull !== !1) && (u = s.formatter(u, s.key, e)), s.placeholder && j(u) && (u = s.placeholder);
|
|
129
|
-
let k = [`bb-table-data__cell--${S}`];
|
|
130
|
-
if (t.tdClass)
|
|
131
|
-
if (typeof t.tdClass == "function") {
|
|
132
|
-
let V = t.tdClass(u, s.key, e);
|
|
133
|
-
V && (k = k.concat(V));
|
|
134
|
-
} else
|
|
135
|
-
k = k.concat(t.tdClass);
|
|
136
|
-
if (s.tdClass)
|
|
137
|
-
if (typeof s.tdClass == "function") {
|
|
138
|
-
let V = s.tdClass(u, s.key, e);
|
|
139
|
-
V && (k = k.concat(V));
|
|
140
|
-
} else
|
|
141
|
-
k = k.concat(s.tdClass);
|
|
142
|
-
return {
|
|
143
|
-
align: S,
|
|
144
|
-
classes: k,
|
|
145
|
-
content: u,
|
|
146
|
-
key: z,
|
|
147
|
-
label: E,
|
|
148
|
-
slotName: x
|
|
149
|
-
};
|
|
150
|
-
}), _ = K(b, e);
|
|
151
|
-
return _e(h) ? {
|
|
152
|
-
accessibleLabel: _,
|
|
153
|
-
cols: b,
|
|
154
|
-
jsonValue: l,
|
|
155
|
-
original: e,
|
|
156
|
-
selectable: c,
|
|
157
|
-
selected: !0,
|
|
158
|
-
selectedIndex: h,
|
|
159
|
-
value: a,
|
|
160
|
-
onRowClick: (s) => r("click:row", s, e, i),
|
|
161
|
-
onRowContextMenu: (s) => r("contextmenu:row", s, e, i),
|
|
162
|
-
onRowDblClick: (s) => r("dblclick:row", s, e, i)
|
|
163
|
-
} : {
|
|
164
|
-
accessibleLabel: _,
|
|
165
|
-
cols: b,
|
|
166
|
-
jsonValue: l,
|
|
167
|
-
original: e,
|
|
168
|
-
selectable: c,
|
|
169
|
-
selected: !1,
|
|
170
|
-
selectedIndex: h,
|
|
171
|
-
value: a,
|
|
172
|
-
onRowClick: (s) => r("click:row", s, e, i),
|
|
173
|
-
onRowContextMenu: (s) => r("contextmenu:row", s, e, i),
|
|
174
|
-
onRowDblClick: (s) => r("dblclick:row", s, e, i)
|
|
175
|
-
};
|
|
176
|
-
})), ae = (e) => {
|
|
177
|
-
let a = e, l = [];
|
|
178
|
-
a && (l = w.value.reduce((c, h) => (h.selectable && c.push(h.value), c), [])), r("update:modelValue", l), r("update:selectAll", e);
|
|
179
|
-
}, U = p(
|
|
180
|
-
() => !!(w.value.length && w.value.every((e) => e.selectable && e.selected))
|
|
181
|
-
), se = p(
|
|
182
|
-
() => {
|
|
183
|
-
var e;
|
|
184
|
-
return w.value.some((a) => !a.selected) && !!((e = t.modelValue) != null && e.length);
|
|
185
|
-
}
|
|
186
|
-
), W = (e) => {
|
|
187
|
-
let a;
|
|
188
|
-
t.multiple ? e.selected ? a = t.modelValue.slice(0, e.selectedIndex).concat(t.modelValue.slice([e.selectedIndex + 1])) : a = t.modelValue.concat(e.value) : a = e.value, r("update:modelValue", a);
|
|
189
|
-
}, oe = ve(
|
|
190
|
-
(e) => typeof e != "string",
|
|
191
|
-
JSON.stringify
|
|
192
|
-
), ne = p(() => [].concat(t.modelValue).map((e) => {
|
|
193
|
-
const a = oe(e);
|
|
194
|
-
return {
|
|
195
|
-
disabled: t.disabled,
|
|
196
|
-
name: t.name,
|
|
197
|
-
type: "hidden",
|
|
198
|
-
value: a
|
|
199
|
-
};
|
|
200
|
-
})), ce = p(() => ye(g.value.length, 4, 10));
|
|
201
|
-
return q(
|
|
202
|
-
() => w.value,
|
|
203
|
-
() => {
|
|
204
|
-
var e;
|
|
205
|
-
if (t.fixedColumns.length && t.items && A.value) {
|
|
206
|
-
const a = Array.from(
|
|
207
|
-
A.value.querySelectorAll("thead th")
|
|
208
|
-
), l = t.fixedColumns.reduce((i, b) => {
|
|
209
|
-
const _ = typeof b == "number" ? b : b.index, s = typeof b == "number" ? "left" : b.position, x = a[_].getBoundingClientRect(), S = Math.floor(x.width), E = i.filter((u) => u.position === s).map((u) => u.width).reduce(me, 0), z = {
|
|
210
|
-
index: _,
|
|
211
|
-
position: s,
|
|
212
|
-
width: S,
|
|
213
|
-
offset: E
|
|
214
|
-
};
|
|
215
|
-
return i.push(z), i;
|
|
216
|
-
}, []);
|
|
217
|
-
Array.from((e = A.value) == null ? void 0 : e.querySelectorAll("tr")).map(
|
|
218
|
-
(i) => Array.from(
|
|
219
|
-
i.querySelectorAll(
|
|
220
|
-
l.map((b) => `:scope > :nth-child(${b.index + 1})`).join(", ")
|
|
221
|
-
)
|
|
222
|
-
)
|
|
223
|
-
).forEach((i) => {
|
|
224
|
-
i.forEach((b, _) => {
|
|
225
|
-
b.style.position = "sticky", l[_].position === "left" ? b.style.left = `${l[_].offset}px` : b.style.right = `${l[_].offset}px`;
|
|
226
|
-
});
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
flush: "post"
|
|
232
|
-
}
|
|
233
|
-
), (e, a) => (n(), be(re(ee.value), {
|
|
234
|
-
ref_key: "container",
|
|
235
|
-
ref: A,
|
|
236
|
-
class: f({
|
|
237
|
-
"bb-table": !0,
|
|
238
|
-
[`bb-table--align-${e.align}`]: !0,
|
|
239
|
-
"bb-table--compact": e.compact,
|
|
240
|
-
"bb-table--fixed": e.fixed,
|
|
241
|
-
"bb-table--fixed-header": e.fixedHeader,
|
|
242
|
-
"bb-table--loading": F.value,
|
|
243
|
-
"bb-table--empty": !g.value.length,
|
|
244
|
-
"bb-table--selectable": e.selectable
|
|
245
|
-
})
|
|
246
|
-
}, {
|
|
247
|
-
default: ue(() => [
|
|
248
|
-
e.selectable ? (n(), d("legend", we, m(e.legend), 1)) : v("", !0),
|
|
249
|
-
o("table", null, [
|
|
250
|
-
e.caption ? (n(), d("caption", {
|
|
251
|
-
key: 0,
|
|
252
|
-
class: f({
|
|
253
|
-
"bb-table-caption": !0,
|
|
254
|
-
"bb-table-caption--hidden": !e.displayCaption
|
|
255
|
-
})
|
|
256
|
-
}, m(e.caption), 3)) : v("", !0),
|
|
257
|
-
o("thead", null, [
|
|
258
|
-
y(e.$slots, "thead", {}, () => [
|
|
259
|
-
o("tr", Ve, [
|
|
260
|
-
e.selectable ? (n(), d("th", {
|
|
261
|
-
key: 0,
|
|
262
|
-
class: f(["bb-table-header bb-table-header--select", e.thClass]),
|
|
263
|
-
scope: "col"
|
|
264
|
-
}, [
|
|
265
|
-
y(e.$slots, "header_select", {
|
|
266
|
-
multiple: e.multiple,
|
|
267
|
-
selectAll: !!e.selectAll
|
|
268
|
-
}, () => [
|
|
269
|
-
o("span", Ne, [
|
|
270
|
-
e.allowSelectAll && e.multiple ? (n(), d("label", {
|
|
271
|
-
key: 0,
|
|
272
|
-
class: f(["bb-table-check__label", {
|
|
273
|
-
"bb-table-check__label--disabled": e.disabled
|
|
274
|
-
}])
|
|
275
|
-
}, [
|
|
276
|
-
J(G, {
|
|
277
|
-
class: "bb-table-check",
|
|
278
|
-
disabled: e.disabled,
|
|
279
|
-
indeterminate: se.value,
|
|
280
|
-
"model-value": U.value,
|
|
281
|
-
name: `select_all_${e.name || ""}`,
|
|
282
|
-
readonly: e.readonly,
|
|
283
|
-
"onUpdate:modelValue": ae
|
|
284
|
-
}, null, 8, ["disabled", "indeterminate", "model-value", "name", "readonly"]),
|
|
285
|
-
o("span", Te, m(C(Y)), 1)
|
|
286
|
-
], 2)) : e.multiple ? v("", !0) : (n(), d("span", Ae, m(C(Z)), 1))
|
|
287
|
-
])
|
|
288
|
-
])
|
|
289
|
-
], 2)) : v("", !0),
|
|
290
|
-
(n(!0), d(N, null, T(te.value, (l) => (n(), d("th", {
|
|
291
|
-
key: l.key,
|
|
292
|
-
class: f(["bb-table-header", l.classes]),
|
|
293
|
-
scope: "col"
|
|
294
|
-
}, [
|
|
295
|
-
y(e.$slots, l.slotName, {
|
|
296
|
-
classes: l.classes,
|
|
297
|
-
item: void 0,
|
|
298
|
-
items: g.value,
|
|
299
|
-
label: l.label
|
|
300
|
-
}, () => [
|
|
301
|
-
o("span", Se, m(l.label), 1)
|
|
302
|
-
])
|
|
303
|
-
], 2))), 128)),
|
|
304
|
-
e.actions ? (n(), d("th", {
|
|
305
|
-
key: 1,
|
|
306
|
-
class: f(["bb-table-header bb-table-header--actions", e.thClass]),
|
|
307
|
-
scope: "col"
|
|
308
|
-
}, [
|
|
309
|
-
y(e.$slots, "header_actions", { text: e.actionsText }, () => [
|
|
310
|
-
o("span", $e, m(e.actionsText), 1)
|
|
311
|
-
])
|
|
312
|
-
], 2)) : v("", !0)
|
|
313
|
-
])
|
|
314
|
-
])
|
|
315
|
-
]),
|
|
316
|
-
o("tbody", null, [
|
|
317
|
-
F.value ? y(e.$slots, "loading", {
|
|
318
|
-
key: 0,
|
|
319
|
-
items: g.value
|
|
320
|
-
}, () => [
|
|
321
|
-
o("tr", Be, [
|
|
322
|
-
o("td", {
|
|
323
|
-
class: "bb-table-loading__cell",
|
|
324
|
-
colspan: H.value
|
|
325
|
-
}, [
|
|
326
|
-
o("span", Ie, m(C(Q)), 1),
|
|
327
|
-
o("div", Le, [
|
|
328
|
-
(n(!0), d(N, null, T(ce.value, (l) => (n(), d("div", {
|
|
329
|
-
key: l,
|
|
330
|
-
class: "bb-table-skeleton-item"
|
|
331
|
-
}, Ee))), 128))
|
|
332
|
-
])
|
|
333
|
-
], 8, De)
|
|
334
|
-
])
|
|
335
|
-
]) : g.value.length ? y(e.$slots, "tbody", { key: 2 }, () => [
|
|
336
|
-
(n(!0), d(N, null, T(w.value, (l) => (n(), d("tr", {
|
|
337
|
-
key: l.jsonValue,
|
|
338
|
-
class: "bb-table-data__row",
|
|
339
|
-
onClick: l.onRowClick,
|
|
340
|
-
onContextmenu: l.onRowContextMenu,
|
|
341
|
-
onDblclick: l.onRowDblClick
|
|
342
|
-
}, [
|
|
343
|
-
e.selectable ? (n(), d("td", {
|
|
344
|
-
key: 0,
|
|
345
|
-
class: f(["bb-table-data__cell bb-table-data__cell--select", e.tdClass])
|
|
346
|
-
}, [
|
|
347
|
-
y(e.$slots, "select", {
|
|
348
|
-
checked: l.selected,
|
|
349
|
-
disabled: !l.selectable,
|
|
350
|
-
inputName: C(D),
|
|
351
|
-
item: l.original,
|
|
352
|
-
readonly: !!e.readonly,
|
|
353
|
-
value: l.value
|
|
354
|
-
}, () => [
|
|
355
|
-
e.multiple ? (n(), d("label", {
|
|
356
|
-
key: 0,
|
|
357
|
-
class: f(["bb-table-check__label", {
|
|
358
|
-
"bb-table-check__label--disabled": !l.selectable
|
|
359
|
-
}])
|
|
360
|
-
}, [
|
|
361
|
-
J(G, {
|
|
362
|
-
checked: l.selected || U.value,
|
|
363
|
-
class: "bb-table-check",
|
|
364
|
-
disabled: !l.selectable,
|
|
365
|
-
name: C(D),
|
|
366
|
-
readonly: e.readonly,
|
|
367
|
-
onChange: () => W(l)
|
|
368
|
-
}, null, 8, ["checked", "disabled", "name", "readonly", "onChange"]),
|
|
369
|
-
o("span", je, m(l.accessibleLabel), 1)
|
|
370
|
-
], 2)) : (n(), d("label", {
|
|
371
|
-
key: 1,
|
|
372
|
-
class: f(["bb-table-radio__label", {
|
|
373
|
-
"bb-table-radio__label--disabled": !l.selectable
|
|
374
|
-
}])
|
|
375
|
-
}, [
|
|
376
|
-
J(Ce, {
|
|
377
|
-
checked: l.selected,
|
|
378
|
-
class: "bb-table-radio",
|
|
379
|
-
disabled: !l.selectable,
|
|
380
|
-
name: C(D),
|
|
381
|
-
readonly: e.readonly,
|
|
382
|
-
value: l.value,
|
|
383
|
-
onChange: () => W(l)
|
|
384
|
-
}, null, 8, ["checked", "disabled", "name", "readonly", "value", "onChange"]),
|
|
385
|
-
o("span", Me, m(l.accessibleLabel), 1)
|
|
386
|
-
], 2))
|
|
387
|
-
])
|
|
388
|
-
], 2)) : v("", !0),
|
|
389
|
-
(n(!0), d(N, null, T(l.cols, (c) => (n(), d("td", {
|
|
390
|
-
key: c.key,
|
|
391
|
-
class: f(["bb-table-data__cell", c.classes])
|
|
392
|
-
}, [
|
|
393
|
-
y(e.$slots, c.slotName, {
|
|
394
|
-
classes: c.classes,
|
|
395
|
-
content: c.content,
|
|
396
|
-
item: l.original,
|
|
397
|
-
value: l.value
|
|
398
|
-
}, () => [
|
|
399
|
-
pe(m(c.content), 1)
|
|
400
|
-
])
|
|
401
|
-
], 2))), 128)),
|
|
402
|
-
e.actions ? (n(), d("td", {
|
|
403
|
-
key: 1,
|
|
404
|
-
class: f(["bb-table__cell bb-table__cell--actions", e.tdClass])
|
|
405
|
-
}, [
|
|
406
|
-
y(e.$slots, "actions", {
|
|
407
|
-
item: l.original,
|
|
408
|
-
value: l.value
|
|
409
|
-
})
|
|
410
|
-
], 2)) : v("", !0)
|
|
411
|
-
], 40, Je))), 128))
|
|
412
|
-
]) : y(e.$slots, "no-data", { key: 1 }, () => [
|
|
413
|
-
o("tr", ze, [
|
|
414
|
-
o("td", {
|
|
415
|
-
class: "bb-table-no-data__cell",
|
|
416
|
-
colspan: H.value
|
|
417
|
-
}, [
|
|
418
|
-
o("span", qe, m(C(X)), 1)
|
|
419
|
-
], 8, Oe)
|
|
420
|
-
])
|
|
421
|
-
])
|
|
422
|
-
]),
|
|
423
|
-
o("tfoot", null, [
|
|
424
|
-
y(e.$slots, "tfoot")
|
|
425
|
-
])
|
|
426
|
-
]),
|
|
427
|
-
(n(!0), d(N, null, T(ne.value, (l) => (n(), d("input", fe({
|
|
428
|
-
key: l.value
|
|
429
|
-
}, l), null, 16))), 128))
|
|
430
|
-
]),
|
|
431
|
-
_: 3
|
|
432
|
-
}, 8, ["class"]));
|
|
433
|
-
}
|
|
434
|
-
});
|
|
435
|
-
export {
|
|
436
|
-
al as default
|
|
437
|
-
};
|
|
1
|
+
|
|
438
2
|
//# sourceMappingURL=index101.js.map
|
package/dist/index101.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index101.js","sources":["../src/components/BbTable/BbTable.vue"],"sourcesContent":["<template>\n\t<component\n\t\t:is=\"containerTag\"\n\t\tref=\"container\"\n\t\t:class=\"{\n\t\t\t'bb-table': true,\n\t\t\t[`bb-table--align-${align}`]: true,\n\t\t\t'bb-table--compact': compact,\n\t\t\t'bb-table--fixed': fixed,\n\t\t\t'bb-table--fixed-header': fixedHeader,\n\t\t\t'bb-table--loading': loading,\n\t\t\t'bb-table--empty': !internalItems.length,\n\t\t\t'bb-table--selectable': selectable,\n\t\t}\"\n\t>\n\t\t<legend v-if=\"selectable\">{{ legend }}</legend>\n\t\t<table>\n\t\t\t<caption\n\t\t\t\tv-if=\"caption\"\n\t\t\t\t:class=\"{\n\t\t\t\t\t'bb-table-caption': true,\n\t\t\t\t\t'bb-table-caption--hidden': !displayCaption,\n\t\t\t\t}\"\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\tcaption\n\t\t\t\t}}\n\t\t\t</caption>\n\t\t\t<thead>\n\t\t\t\t<slot name=\"thead\">\n\t\t\t\t\t<tr class=\"bb-table-header-row\">\n\t\t\t\t\t\t<th\n\t\t\t\t\t\t\tv-if=\"selectable\"\n\t\t\t\t\t\t\tclass=\"bb-table-header bb-table-header--select\"\n\t\t\t\t\t\t\t:class=\"thClass\"\n\t\t\t\t\t\t\tscope=\"col\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:multiple=\"multiple\"\n\t\t\t\t\t\t\t\t:name=\"'header_select'\"\n\t\t\t\t\t\t\t\t:select-all=\"!!selectAll\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<span class=\"bb-table-header__content\">\n\t\t\t\t\t\t\t\t\t<label\n\t\t\t\t\t\t\t\t\t\tv-if=\"allowSelectAll && multiple\"\n\t\t\t\t\t\t\t\t\t\tclass=\"bb-table-check__label\"\n\t\t\t\t\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t\t\t\t\t'bb-table-check__label--disabled': disabled,\n\t\t\t\t\t\t\t\t\t\t}\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<BaseCheckbox\n\t\t\t\t\t\t\t\t\t\t\tclass=\"bb-table-check\"\n\t\t\t\t\t\t\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t\t\t\t\t\t\t:indeterminate=\"indeterminate\"\n\t\t\t\t\t\t\t\t\t\t\t:model-value=\"allSelected\"\n\t\t\t\t\t\t\t\t\t\t\t:name=\"`select_all_${name || ''}`\"\n\t\t\t\t\t\t\t\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t\t\t\t\t\t\t\t@update:model-value=\"onChangeSelectAll\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<span class=\"bb-table-check__label-text\"\n\t\t\t\t\t\t\t\t\t\t\t>{{ selectAllText }}\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tv-else-if=\"!multiple\"\n\t\t\t\t\t\t\t\t\t\tclass=\"bb-table-radio__label-text\"\n\t\t\t\t\t\t\t\t\t\t>{{ selectText }}</span\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th\n\t\t\t\t\t\t\tv-for=\"header in mappedHeaders\"\n\t\t\t\t\t\t\t:key=\"header.key\"\n\t\t\t\t\t\t\tclass=\"bb-table-header\"\n\t\t\t\t\t\t\t:class=\"header.classes\"\n\t\t\t\t\t\t\tscope=\"col\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:classes=\"header.classes\"\n\t\t\t\t\t\t\t\t:item=\"undefined as unknown\"\n\t\t\t\t\t\t\t\t:items=\"internalItems\"\n\t\t\t\t\t\t\t\t:label=\"header.label\"\n\t\t\t\t\t\t\t\t:name=\"header.slotName\"\n\t\t\t\t\t\t\t\t><span class=\"bb-table-header__content\">{{\n\t\t\t\t\t\t\t\t\theader.label\n\t\t\t\t\t\t\t\t}}</span></slot\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th\n\t\t\t\t\t\t\tv-if=\"actions\"\n\t\t\t\t\t\t\tclass=\"bb-table-header bb-table-header--actions\"\n\t\t\t\t\t\t\t:class=\"thClass\"\n\t\t\t\t\t\t\tscope=\"col\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot name=\"header_actions\" :text=\"actionsText\">\n\t\t\t\t\t\t\t\t<span class=\"bb-table-header__content\">\n\t\t\t\t\t\t\t\t\t{{ actionsText }}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</slot>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t\t<slot v-if=\"loading\" :items=\"internalItems\" name=\"loading\">\n\t\t\t\t\t<tr class=\"bb-table-loading__row\">\n\t\t\t\t\t\t<td\n\t\t\t\t\t\t\tclass=\"bb-table-loading__cell\"\n\t\t\t\t\t\t\t:colspan=\"replacementContentSpan\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span class=\"bb-table-loading__text\">{{ loadingText }}</span>\n\n\t\t\t\t\t\t\t<div class=\"bb-table-skeleton__container\" role=\"status\">\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tv-for=\"item in skeletonLength\"\n\t\t\t\t\t\t\t\t\t:key=\"item\"\n\t\t\t\t\t\t\t\t\tclass=\"bb-table-skeleton-item\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<div class=\"bb-table-skeleton-item__avatar-container\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"bb-table-skeleton-item__avatar\"></div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"bb-table-skeleton-item__text\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"bb-table-skeleton-item__line\"></div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"bb-table-skeleton-item__line\"></div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</slot>\n\t\t\t\t<slot v-else-if=\"!internalItems.length\" :name=\"'no-data'\">\n\t\t\t\t\t<tr class=\"bb-table-no-data__row\">\n\t\t\t\t\t\t<td\n\t\t\t\t\t\t\tclass=\"bb-table-no-data__cell\"\n\t\t\t\t\t\t\t:colspan=\"replacementContentSpan\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span class=\"bb-table-no-data__text\">{{ noDataText }}</span>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</slot>\n\t\t\t\t<slot v-else name=\"tbody\">\n\t\t\t\t\t<tr\n\t\t\t\t\t\tv-for=\"item in mappedItems\"\n\t\t\t\t\t\t:key=\"item.jsonValue\"\n\t\t\t\t\t\tclass=\"bb-table-data__row\"\n\t\t\t\t\t\t@click=\"item.onRowClick\"\n\t\t\t\t\t\t@contextmenu=\"item.onRowContextMenu\"\n\t\t\t\t\t\t@dblclick=\"item.onRowDblClick\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<td\n\t\t\t\t\t\t\tv-if=\"selectable\"\n\t\t\t\t\t\t\tclass=\"bb-table-data__cell bb-table-data__cell--select\"\n\t\t\t\t\t\t\t:class=\"tdClass\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:checked=\"item.selected\"\n\t\t\t\t\t\t\t\t:disabled=\"!item.selectable\"\n\t\t\t\t\t\t\t\t:input-name=\"randomName\"\n\t\t\t\t\t\t\t\t:item=\"item.original\"\n\t\t\t\t\t\t\t\t:name=\"'select'\"\n\t\t\t\t\t\t\t\t:readonly=\"!!readonly\"\n\t\t\t\t\t\t\t\t:value=\"item.value\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<!-- We use temp names for these inputs because we don't submit them -->\n\t\t\t\t\t\t\t\t<label\n\t\t\t\t\t\t\t\t\tv-if=\"multiple\"\n\t\t\t\t\t\t\t\t\tclass=\"bb-table-check__label\"\n\t\t\t\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t\t\t\t'bb-table-check__label--disabled': !item.selectable,\n\t\t\t\t\t\t\t\t\t}\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<BaseCheckbox\n\t\t\t\t\t\t\t\t\t\t:checked=\"item.selected || allSelected\"\n\t\t\t\t\t\t\t\t\t\tclass=\"bb-table-check\"\n\t\t\t\t\t\t\t\t\t\t:disabled=\"!item.selectable\"\n\t\t\t\t\t\t\t\t\t\t:name=\"randomName\"\n\t\t\t\t\t\t\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t\t\t\t\t\t\t@change=\"() => onInputChange(item)\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<span class=\"bb-table-check__label-text\">{{\n\t\t\t\t\t\t\t\t\t\titem.accessibleLabel\n\t\t\t\t\t\t\t\t\t}}</span>\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t<label\n\t\t\t\t\t\t\t\t\tv-else\n\t\t\t\t\t\t\t\t\tclass=\"bb-table-radio__label\"\n\t\t\t\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t\t\t\t'bb-table-radio__label--disabled': !item.selectable,\n\t\t\t\t\t\t\t\t\t}\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<BaseRadio\n\t\t\t\t\t\t\t\t\t\t:checked=\"item.selected\"\n\t\t\t\t\t\t\t\t\t\tclass=\"bb-table-radio\"\n\t\t\t\t\t\t\t\t\t\t:disabled=\"!item.selectable\"\n\t\t\t\t\t\t\t\t\t\t:name=\"randomName\"\n\t\t\t\t\t\t\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t\t\t\t\t\t\t:value=\"item.value\"\n\t\t\t\t\t\t\t\t\t\t@change=\"() => onInputChange(item)\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<span class=\"bb-table-radio__label-text\">{{\n\t\t\t\t\t\t\t\t\t\titem.accessibleLabel\n\t\t\t\t\t\t\t\t\t}}</span>\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td\n\t\t\t\t\t\t\tv-for=\"col in item.cols\"\n\t\t\t\t\t\t\t:key=\"col.key\"\n\t\t\t\t\t\t\tclass=\"bb-table-data__cell\"\n\t\t\t\t\t\t\t:class=\"col.classes\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:classes=\"col.classes\"\n\t\t\t\t\t\t\t\t:content=\"col.content\"\n\t\t\t\t\t\t\t\t:item=\"item.original\"\n\t\t\t\t\t\t\t\t:name=\"col.slotName\"\n\t\t\t\t\t\t\t\t:value=\"item.value\"\n\t\t\t\t\t\t\t\t>{{ col.content }}</slot\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td\n\t\t\t\t\t\t\tv-if=\"actions\"\n\t\t\t\t\t\t\tclass=\"bb-table__cell bb-table__cell--actions\"\n\t\t\t\t\t\t\t:class=\"tdClass\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:item=\"item.original\"\n\t\t\t\t\t\t\t\t:name=\"'actions'\"\n\t\t\t\t\t\t\t\t:value=\"item.value\"\n\t\t\t\t\t\t\t></slot>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</slot>\n\t\t\t</tbody>\n\t\t\t<tfoot>\n\t\t\t\t<slot name=\"tfoot\"></slot>\n\t\t\t</tfoot>\n\t\t</table>\n\t\t<input v-for=\"input in hiddenInputs\" :key=\"input.value\" v-bind=\"input\" />\n\t</component>\n</template>\n\n<script setup lang=\"ts\">\nimport { add } from '@/utilities/functions/add';\nimport { clamp } from '@/utilities/functions/clamp';\nimport { deepEqual } from 'fast-equals';\nimport { isNil } from '@/utilities/functions/isNil';\nimport { isNotNil } from '@/utilities/functions/isNotNil';\nimport { computed, onMounted, ref, watch } from 'vue';\nimport { useId } from '@/composables/useId';\nimport { useItemValue } from '@/composables/useItemValue';\nimport { when } from '@/utilities/functions/when';\nimport BaseCheckbox from '../BaseCheckbox/BaseCheckbox.vue';\nimport BaseRadio from '../BaseRadio/BaseRadio.vue';\nimport type {\n\tBbTableProps,\n\tMappedCell,\n\tMappedHeader,\n\tMappedItem,\n\tTableColumn,\n\tBbTableEvents,\n\tBbTableSlots,\n} from './types';\nimport type { Classes } from '@/types/Classes';\n\nconst { getItemValue } = useItemValue();\n\n/**\n * We do not allow the use of the checkbox or radio themselves as\n * they would not be submitted if the user has changed\n * page in the meantime, rather we provide a temporary\n * name so radio still work but we later add hidden inputs for submission\n */\nconst randomName = useId().id.value;\n\nconst props = withDefaults(defineProps<BbTableProps>(), {\n\talign: 'left',\n\taccessibleLabel: (columns: MappedCell[]) =>\n\t\t['Seleziona'].concat(columns.map((col) => col.content)).join(' '),\n\tactionsText: 'Azioni',\n\tallowSelectAll: true,\n\tcolumns: () => [],\n\tdependencies: () => [],\n\tdepsDebounceTime: 0,\n\tfixedColumns: () => [],\n\titems: () => [],\n\tloadingText: 'Caricamento',\n\tmatchStrategy: 'string',\n\tmultiple: true,\n\tnoDataText: 'Non ci sono elementi da visualizzare',\n\tselectAllText: 'Seleziona tutti gli elementi di questa pagina',\n\tselectText: 'Seleziona un elemento',\n});\n\nconst emit = defineEmits<BbTableEvents>();\n\ndefineSlots<BbTableSlots>();\n\nconst container = ref<HTMLElement>();\n\nconst accessibleLabel = props.accessibleLabel;\nconst loadingText = props.loadingText;\nconst noDataText = props.noDataText;\nconst selectAllText = props.selectAllText;\nconst selectText = props.selectText;\n\n// We render the table in a fieldset to group checkbox / radios if the table is selectable\nconst containerTag = computed(() => (props.selectable ? 'fieldset' : 'div'));\nconst internalLoading = ref(false);\nconst loading = computed(() => props.loading || internalLoading.value);\n\nconst replacementContentSpan = computed(() => {\n\treturn [!!props.selectable, !!props.actions].reduce(\n\t\t(acc: number, current) => acc + Number(!!current),\n\t\tprops.columns.length\n\t);\n});\n\n/**\n * Indexes modelValue to a map so when can easily know which values are selected\n * (using JSON to circumvent identical object not being equal in JS)\n */\nconst modelValueIndexed = computed(() => {\n\tif (props.matchStrategy === 'string') {\n\t\tlet map: { [key: string]: number } = {};\n\t\t[].concat(props.modelValue).forEach((value: any, index: number) => {\n\t\t\tmap[JSON.stringify(value)] = index;\n\t\t});\n\t\treturn {\n\t\t\tget: (value: any) => map[JSON.stringify(value)],\n\t\t};\n\t} else if (props.matchStrategy === 'equality') {\n\t\tconst map = []\n\t\t\t.concat(props.modelValue)\n\t\t\t.map((value, index) => [value, index]);\n\n\t\treturn {\n\t\t\tget: (key: any) => {\n\t\t\t\treturn map.find((pairs) => deepEqual(pairs[0], key))?.[1];\n\t\t\t},\n\t\t};\n\t} else {\n\t\tthrow new Error('No match strategy has been defined');\n\t}\n});\n\n/**\n * Map column identifiers to slot names\n */\nconst slotNames = computed(() =>\n\tprops.columns.reduce((acc: { [key: string]: string }, curr: TableColumn) => {\n\t\tconst mapped = curr.key.split(/\\W+/g).join('_');\n\t\tacc[curr.key] = mapped;\n\t\treturn acc;\n\t}, {})\n);\n\n/**\n * Items as loaded from the function or from the outside\n */\nconst internalItems = ref<any[]>([]);\n\nconst getItems = async () => {\n\tlet items: any[] = [];\n\tif (Array.isArray(props.items)) {\n\t\titems = props.items;\n\t} else {\n\t\tif (typeof props.items === 'function') {\n\t\t\tinternalLoading.value = true;\n\t\t\titems = await props.items(true);\n\t\t\tinternalLoading.value = false;\n\t\t}\n\t}\n\tinternalItems.value = items;\n};\n\nonMounted(getItems);\n\n/**\n * When item changes update internal items and\n * deselect everything\n */\nwatch(\n\t() => props.items,\n\tasync () => {\n\t\tawait getItems();\n\t\tif (props.multiple) {\n\t\t\temit('update:modelValue', []);\n\t\t} else {\n\t\t\temit('update:modelValue', null);\n\t\t}\n\t}\n);\n/* Prevent vue from sharing this function across instances */\nlet timeout: ReturnType<typeof setTimeout>;\nconst onDependencyChange = async (curr: any[], previous?: any[]) => {\n\tif (JSON.stringify(curr) !== JSON.stringify(previous)) {\n\t\tif (timeout) {\n\t\t\tclearTimeout(timeout);\n\t\t}\n\t\ttimeout = setTimeout(async () => {\n\t\t\tawait getItems();\n\t\t\tif (props.multiple) {\n\t\t\t\temit('update:modelValue', []);\n\t\t\t} else {\n\t\t\t\temit('update:modelValue', null);\n\t\t\t}\n\t\t}, props.depsDebounceTime);\n\t}\n};\nwatch(() => props.dependencies, onDependencyChange);\n\n/**\n * Take the columns and generate a simplified array for headers display\n */\nconst mappedHeaders = computed(() =>\n\tprops.columns.map((column: TableColumn): MappedHeader => {\n\t\tconst align = column.align || 'left';\n\t\tconst { label, key } = column;\n\t\tconst slotName = `header_${slotNames.value[column.key]}`;\n\t\t// Create a single merged array of all the passed classes\n\t\tlet classes: Classes = [`bb-table-header--${align}`];\n\t\tif (props.thClass) {\n\t\t\tclasses = classes.concat(props.thClass);\n\t\t}\n\t\tif (column.thClass) {\n\t\t\tclasses = classes.concat(column.thClass);\n\t\t}\n\t\treturn {\n\t\t\talign,\n\t\t\tkey,\n\t\t\tlabel,\n\t\t\tslotName,\n\t\t\tclasses,\n\t\t};\n\t})\n);\n\n/**\n * Map items to an an array that represents the entire row.\n * Track every logic here so we don't have inline callbacks in the template.\n */\nconst mappedItems = computed<MappedItem[]>(() => {\n\treturn internalItems.value.map((item: any) => {\n\t\t// By default the value if the item is the item.\n\t\tconst value = getItemValue(item, props.itemValue);\n\t\tconst jsonValue = JSON.stringify(value);\n\n\t\t/**\n\t\t * Item is selectable only if the table allows or item\n\t\t * passes iteratee and the selection is not disabled\n\t\t */\n\t\tlet selectable = !!props.selectable;\n\t\tif (typeof props.selectable === 'function') {\n\t\t\tselectable = !!props.selectable(item);\n\t\t}\n\t\tselectable = selectable && !props.disabled;\n\n\t\t//Track the index at which the item has been selected for easy of removal\n\t\tconst selectedIndex = modelValueIndexed.value.get(value);\n\t\tconst selected = !isNil(selectedIndex);\n\n\t\t// Create a projection of the columns and run all formatter logic so\n\t\t// we just display content in the template\n\t\tconst cols: MappedCell[] = props.columns.map((column) => {\n\t\t\t// Slot identifier\n\t\t\tconst slotName = slotNames.value[column.key];\n\t\t\tconst align = column.align || 'left';\n\t\t\tconst { label, key } = column;\n\t\t\t// The content\n\t\t\tlet content = getItemValue(item, column.key);\n\t\t\tif (\n\t\t\t\tcolumn.formatter &&\n\t\t\t\t// By default the formatter runs anyway\n\t\t\t\t(!isNil(content) || column.formatOnNull !== false)\n\t\t\t) {\n\t\t\t\tcontent = column.formatter(content, column.key, item);\n\t\t\t}\n\t\t\tif (column.placeholder && isNil(content)) {\n\t\t\t\tcontent = column.placeholder;\n\t\t\t}\n\n\t\t\t// Merge global and specific classes\n\t\t\tlet classes: Classes = [`bb-table-data__cell--${align}`];\n\t\t\tif (props.tdClass) {\n\t\t\t\tif (typeof props.tdClass === 'function') {\n\t\t\t\t\tlet temp = props.tdClass(content, column.key, item);\n\t\t\t\t\tif (temp) {\n\t\t\t\t\t\tclasses = classes.concat(temp);\n\t\t\t\t\t}\n\t\t\t\t} else classes = classes.concat(props.tdClass);\n\t\t\t}\n\t\t\tif (column.tdClass) {\n\t\t\t\tif (typeof column.tdClass === 'function') {\n\t\t\t\t\tlet temp = column.tdClass(content, column.key, item);\n\t\t\t\t\tif (temp) {\n\t\t\t\t\t\tclasses = classes.concat(temp);\n\t\t\t\t\t}\n\t\t\t\t} else classes = classes.concat(column.tdClass);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\talign,\n\t\t\t\tclasses,\n\t\t\t\tcontent,\n\t\t\t\tkey,\n\t\t\t\tlabel,\n\t\t\t\tslotName,\n\t\t\t};\n\t\t});\n\n\t\tconst accessibleLabelText = accessibleLabel(cols, item);\n\n\t\tif (isNotNil(selectedIndex)) {\n\t\t\treturn {\n\t\t\t\taccessibleLabel: accessibleLabelText,\n\t\t\t\tcols,\n\t\t\t\tjsonValue,\n\t\t\t\toriginal: item,\n\t\t\t\tselectable,\n\t\t\t\tselected: true,\n\t\t\t\tselectedIndex,\n\t\t\t\tvalue,\n\t\t\t\tonRowClick: (event: MouseEvent) =>\n\t\t\t\t\temit('click:row', event, item, selected),\n\t\t\t\tonRowContextMenu: (event: MouseEvent) =>\n\t\t\t\t\temit('contextmenu:row', event, item, selected),\n\t\t\t\tonRowDblClick: (event: MouseEvent) =>\n\t\t\t\t\temit('dblclick:row', event, item, selected),\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\taccessibleLabel: accessibleLabelText,\n\t\t\tcols,\n\t\t\tjsonValue,\n\t\t\toriginal: item,\n\t\t\tselectable,\n\t\t\tselected: false,\n\t\t\tselectedIndex,\n\t\t\tvalue,\n\t\t\tonRowClick: (event: MouseEvent) =>\n\t\t\t\temit('click:row', event, item, selected),\n\t\t\tonRowContextMenu: (event: MouseEvent) =>\n\t\t\t\temit('contextmenu:row', event, item, selected),\n\t\t\tonRowDblClick: (event: MouseEvent) =>\n\t\t\t\temit('dblclick:row', event, item, selected),\n\t\t};\n\t});\n});\n\n/**\n * Same behavior as GMail.\n * If anything is selected remove it.\n * Then when empty you select all items of this page\n */\nconst onChangeSelectAll = (value: boolean) => {\n\tlet selectAllValue = value;\n\tlet modelValue: any[] = [];\n\n\tif (selectAllValue) {\n\t\tmodelValue = mappedItems.value.reduce((acc: any[], curr) => {\n\t\t\tif (curr.selectable) acc.push(curr.value);\n\t\t\treturn acc;\n\t\t}, []);\n\t}\n\temit('update:modelValue', modelValue);\n\temit('update:selectAll', value);\n};\n\nconst allSelected = computed(\n\t() =>\n\t\t!!(\n\t\t\tmappedItems.value.length &&\n\t\t\tmappedItems.value.every((item) => item.selectable && item.selected)\n\t\t)\n);\nconst indeterminate = computed(\n\t() =>\n\t\tmappedItems.value.some((item) => !item.selected) &&\n\t\t!!props.modelValue?.length\n);\n/**\n * Whenever an input changes update modelValue if any\n */\nconst onInputChange = (item: MappedItem) => {\n\tlet valueToEmit;\n\tif (props.multiple) {\n\t\tif (item.selected) {\n\t\t\tvalueToEmit = props.modelValue\n\t\t\t\t.slice(0, item.selectedIndex)\n\t\t\t\t.concat(props.modelValue.slice([item.selectedIndex + 1]));\n\t\t} else {\n\t\t\tvalueToEmit = props.modelValue.concat(item.value);\n\t\t}\n\t} else {\n\t\tvalueToEmit = item.value;\n\t}\n\temit('update:modelValue', valueToEmit);\n};\n\n/**\n * When using this component for submission we add a bunch of hidden inputs\n * so the submitted inputs is on par with v-model\n */\n\n/**\n * This is used to keep the value compatible to common html expected values.\n * Convert to string everything that's not but do not double encode strings\n */\nconst makeInputValue = when(\n\t(item: unknown) => typeof item !== 'string',\n\tJSON.stringify\n);\nconst hiddenInputs = computed(() => {\n\treturn [].concat(props.modelValue).map((current) => {\n\t\tconst value = makeInputValue(current);\n\t\treturn {\n\t\t\tdisabled: props.disabled,\n\t\t\tname: props.name,\n\t\t\ttype: 'hidden',\n\t\t\tvalue: value,\n\t\t};\n\t});\n});\n\nconst skeletonLength = computed(() => {\n\treturn clamp(internalItems.value.length, 4, 10);\n});\n\nwatch(\n\t() => mappedItems.value,\n\t() => {\n\t\tif (props.fixedColumns.length && props.items) {\n\t\t\tif (container.value) {\n\t\t\t\t// Get all the headers\n\t\t\t\tconst headers = Array.from(\n\t\t\t\t\tcontainer.value.querySelectorAll<HTMLElement>('thead th')\n\t\t\t\t);\n\n\t\t\t\ttype MappedColumn = {\n\t\t\t\t\tindex: number;\n\t\t\t\t\tposition: 'left' | 'right';\n\t\t\t\t\twidth: number;\n\t\t\t\t\toffset: number;\n\t\t\t\t};\n\n\t\t\t\t/**\n\t\t\t\t * For each of the columns to fix create an helper object\n\t\t\t\t */\n\t\t\t\tconst mappedColumns = props.fixedColumns.reduce((acc, curr) => {\n\t\t\t\t\tconst index = typeof curr === 'number' ? curr : curr.index;\n\t\t\t\t\tconst position = typeof curr === 'number' ? 'left' : curr.position;\n\t\t\t\t\tconst clientRect = headers[index].getBoundingClientRect();\n\t\t\t\t\tconst width = Math.floor(clientRect.width);\n\t\t\t\t\tconst offset = acc\n\t\t\t\t\t\t.filter((el) => el.position === position)\n\t\t\t\t\t\t.map((el) => el.width)\n\t\t\t\t\t\t.reduce(add, 0);\n\n\t\t\t\t\tconst mapped: MappedColumn = {\n\t\t\t\t\t\tindex: index,\n\t\t\t\t\t\tposition: position,\n\t\t\t\t\t\twidth: width,\n\t\t\t\t\t\toffset: offset,\n\t\t\t\t\t};\n\t\t\t\t\tacc.push(mapped);\n\t\t\t\t\treturn acc;\n\t\t\t\t}, [] as MappedColumn[]);\n\n\t\t\t\tconst rows = Array.from(container.value?.querySelectorAll('tr'));\n\t\t\t\tconst affectedCells = rows.map((row) =>\n\t\t\t\t\tArray.from(\n\t\t\t\t\t\trow.querySelectorAll<HTMLElement>(\n\t\t\t\t\t\t\tmappedColumns\n\t\t\t\t\t\t\t\t.map((el) => `:scope > :nth-child(${el.index + 1})`)\n\t\t\t\t\t\t\t\t.join(', ')\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\taffectedCells.forEach((row) => {\n\t\t\t\t\trow.forEach((cell, index) => {\n\t\t\t\t\t\tcell.style.position = 'sticky';\n\n\t\t\t\t\t\tif (mappedColumns[index].position === 'left') {\n\t\t\t\t\t\t\tcell.style.left = `${mappedColumns[index].offset}px`;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcell.style.right = `${mappedColumns[index].offset}px`;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\tflush: 'post',\n\t}\n);\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbTable';\n</style>\n"],"names":["getItemValue","useItemValue","randomName","useId","props","__props","emit","__emit","container","ref","accessibleLabel","loadingText","noDataText","selectAllText","selectText","containerTag","computed","internalLoading","loading","replacementContentSpan","acc","current","modelValueIndexed","map","value","index","key","_a","pairs","deepEqual","slotNames","curr","mapped","internalItems","getItems","items","onMounted","watch","timeout","previous","mappedHeaders","column","align","label","slotName","classes","mappedItems","item","jsonValue","selectable","selectedIndex","selected","isNil","cols","content","temp","accessibleLabelText","isNotNil","event","onChangeSelectAll","selectAllValue","modelValue","allSelected","indeterminate","onInputChange","valueToEmit","makeInputValue","when","hiddenInputs","skeletonLength","clamp","headers","mappedColumns","position","clientRect","width","offset","el","add","row","cell"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0QM,UAAA,EAAE,cAAAA,MAAiBC,MAQnBC,IAAaC,KAAQ,GAAG,OAExBC,IAAQC,GAmBRC,IAAOC,GAIPC,IAAYC,KAEZC,IAAkBN,EAAM,iBACxBO,IAAcP,EAAM,aACpBQ,IAAaR,EAAM,YACnBS,IAAgBT,EAAM,eACtBU,IAAaV,EAAM,YAGnBW,KAAeC,EAAS,MAAOZ,EAAM,aAAa,aAAa,KAAM,GACrEa,IAAkBR,EAAI,EAAK,GAC3BS,IAAUF,EAAS,MAAMZ,EAAM,WAAWa,EAAgB,K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