bitboss-ui 2.0.5 → 2.0.8
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/BaseDialog/BaseDialog.vue.d.ts +1 -3
- package/dist/composables/useOptions.d.ts +1 -1
- package/dist/index.js +89 -87
- package/dist/index.js.map +1 -1
- package/dist/index10.js +7 -39
- package/dist/index10.js.map +1 -1
- package/dist/index101.js +60 -87
- package/dist/index101.js.map +1 -1
- package/dist/index103.js +113 -258
- package/dist/index103.js.map +1 -1
- package/dist/index105.js +254 -388
- package/dist/index105.js.map +1 -1
- package/dist/index107.js +387 -98
- package/dist/index107.js.map +1 -1
- package/dist/index109.js +52 -48
- package/dist/index109.js.map +1 -1
- package/dist/index11.js +74 -188
- package/dist/index11.js.map +1 -1
- package/dist/index111.js +35 -34
- package/dist/index111.js.map +1 -1
- package/dist/index113.js +105 -23
- package/dist/index113.js.map +1 -1
- package/dist/index115.js +23 -156
- package/dist/index115.js.map +1 -1
- package/dist/index117.js +153 -112
- package/dist/index117.js.map +1 -1
- package/dist/index119.js +115 -39
- package/dist/index119.js.map +1 -1
- package/dist/index12.js +38 -80
- package/dist/index12.js.map +1 -1
- package/dist/index121.js +36 -40
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +34 -37
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +30 -21
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +47 -2
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +35 -21
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +2 -2
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +21 -312
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +2 -24
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +312 -2
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +196 -0
- package/dist/index13.js.map +1 -0
- package/dist/index130.js +24 -5
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +2 -9
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +5 -6
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +9 -3
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +6 -3
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +1 -1
- package/dist/index136.js +1 -1
- package/dist/index137.js +1 -1
- package/dist/index138.js +1 -1
- package/dist/index139.js +1 -1
- package/dist/index14.js +73 -121
- package/dist/index14.js.map +1 -1
- package/dist/index140.js +1 -1
- package/dist/index141.js +1 -1
- package/dist/index142.js +1 -1
- package/dist/index143.js +1 -1
- package/dist/index144.js +1 -1
- package/dist/index145.js +1 -1
- package/dist/index146.js +1 -1
- package/dist/index147.js +1 -1
- package/dist/index148.js +1 -1
- package/dist/index149.js +1 -1
- package/dist/index150.js +1 -1
- package/dist/index151.js +1 -1
- package/dist/index152.js +1 -1
- package/dist/index153.js +1 -1
- package/dist/index154.js +1 -1
- package/dist/index155.js +1 -1
- package/dist/index156.js +1 -1
- package/dist/index157.js +1 -1
- package/dist/index158.js +1 -1
- package/dist/index159.js +2 -2
- package/dist/index16.js +119 -118
- package/dist/index16.js.map +1 -1
- package/dist/index160.js +6 -0
- package/dist/index160.js.map +1 -0
- package/dist/index161.js +1 -1
- package/dist/index163.js +2 -2
- package/dist/index165.js +1 -1
- package/dist/index166.js +1 -1
- package/dist/index167.js +1 -1
- package/dist/index168.js +1 -1
- package/dist/index169.js +2 -2
- package/dist/index170.js +6 -0
- package/dist/index170.js.map +1 -0
- package/dist/index171.js +3 -2
- package/dist/index171.js.map +1 -1
- package/dist/index173.js +2 -3
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +1 -1
- package/dist/index175.js +1 -1
- package/dist/index176.js +1 -1
- package/dist/index177.js +1 -1
- package/dist/index178.js +1 -1
- package/dist/index179.js +1 -1
- package/dist/index18.js +120 -208
- package/dist/index18.js.map +1 -1
- package/dist/index180.js +1 -1
- package/dist/index181.js +1 -1
- package/dist/index182.js +1 -1
- package/dist/index183.js +2 -2
- package/dist/index184.js +6 -0
- package/dist/index184.js.map +1 -0
- package/dist/index185.js +1 -1
- package/dist/index187.js +1 -1
- package/dist/index189.js +1 -1
- package/dist/index190.js +1 -1
- package/dist/index191.js +1 -1
- package/dist/index192.js +1 -1
- package/dist/index193.js +1 -1
- package/dist/index194.js +1 -1
- package/dist/index195.js +1 -1
- package/dist/index196.js +1 -1
- package/dist/index197.js +3 -81
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +3 -3
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +81 -5
- package/dist/index199.js.map +1 -1
- package/dist/index20.js +193 -275
- package/dist/index20.js.map +1 -1
- package/dist/index200.js +2 -16
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +3 -16
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +124 -17
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +5 -19
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +119 -23
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +19 -3
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +16 -2
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +16 -8
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +2 -249
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +5 -0
- package/dist/index209.js.map +1 -0
- package/dist/index210.js +35 -52
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +173 -36
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +6 -5
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +39 -36
- package/dist/index213.js.map +1 -1
- package/dist/index215.js +13 -4
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +5 -2
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +369 -2
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +6 -40
- package/dist/index218.js.map +1 -1
- package/dist/{index214.js → index219.js} +1 -1
- package/dist/{index214.js.map → index219.js.map} +1 -1
- package/dist/index22.js +287 -247
- package/dist/index22.js.map +1 -1
- package/dist/index220.js +4 -13
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +2 -158
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +3 -84
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +10 -0
- package/dist/index223.js.map +1 -0
- package/dist/index224.js +19 -3
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +26 -34
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +3 -6
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +249 -7
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +49 -123
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +44 -123
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +5 -2
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +49 -174
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +158 -5
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +83 -368
- package/dist/index233.js.map +1 -1
- package/dist/index235.js +2 -18
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +17 -105
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +109 -0
- package/dist/index237.js.map +1 -0
- package/dist/{index238.js → index239.js} +3 -3
- package/dist/{index238.js.map → index239.js.map} +1 -1
- package/dist/index24.js +249 -120
- package/dist/index24.js.map +1 -1
- package/dist/index241.js +2 -10
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +9 -2
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +3 -224
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +9 -281
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +23 -6
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +6 -2
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +16 -2
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +224 -2
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +281 -2
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +6 -2
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +2 -2
- package/dist/index252.js +2 -3
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +2 -2
- package/dist/index254.js +2 -2
- package/dist/index255.js +2 -2
- package/dist/index256.js +122 -24
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +429 -20
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +6 -0
- package/dist/index258.js.map +1 -0
- package/dist/index26.js +119 -142
- package/dist/index26.js.map +1 -1
- package/dist/index260.js +6 -3
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +21 -8
- package/dist/index261.js.map +1 -1
- package/dist/index263.js +9 -3
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +439 -0
- package/dist/index264.js.map +1 -0
- package/dist/index265.js +127 -6
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +199 -15
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +4 -9
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +89 -3
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +2 -12
- package/dist/index269.js.map +1 -1
- package/dist/index270.js +2 -9
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +2 -9
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +2 -17
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +2 -431
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +2 -89
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +28 -2
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +17 -64
- package/dist/index276.js.map +1 -1
- package/dist/index278.js +3 -200
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +12 -2
- package/dist/index279.js.map +1 -1
- package/dist/index28.js +138 -83
- package/dist/index28.js.map +1 -1
- package/dist/index280.js +7 -124
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +7 -20
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +20 -0
- package/dist/index282.js.map +1 -0
- package/dist/index283.js +2 -436
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +68 -126
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +5 -3
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +1 -1
- package/dist/index287.js +3 -211
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +214 -0
- package/dist/index288.js.map +1 -0
- package/dist/index290.js +4 -7
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +4 -19
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +58 -6
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +35 -4
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +7 -4
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +6 -58
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +18 -34
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +2 -11
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +47 -2
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +10 -46
- package/dist/index299.js.map +1 -1
- package/dist/index30.js +85 -115
- package/dist/index30.js.map +1 -1
- package/dist/index32.js +111 -112
- package/dist/index32.js.map +1 -1
- package/dist/index34.js +114 -365
- package/dist/index34.js.map +1 -1
- package/dist/index36.js +361 -283
- package/dist/index36.js.map +1 -1
- package/dist/index38.js +288 -106
- package/dist/index38.js.map +1 -1
- package/dist/index40.js +114 -121
- package/dist/index40.js.map +1 -1
- package/dist/index42.js +113 -200
- package/dist/index42.js.map +1 -1
- package/dist/index44.js +180 -90
- package/dist/index44.js.map +1 -1
- package/dist/index46.js +110 -78
- package/dist/index46.js.map +1 -1
- package/dist/index48.js +89 -54
- package/dist/index48.js.map +1 -1
- package/dist/index5.js +14 -78
- package/dist/index5.js.map +1 -1
- package/dist/index50.js +54 -84
- package/dist/index50.js.map +1 -1
- package/dist/index52.js +86 -60
- package/dist/index52.js.map +1 -1
- package/dist/index54.js +59 -40
- package/dist/index54.js.map +1 -1
- package/dist/index56.js +42 -55
- package/dist/index56.js.map +1 -1
- package/dist/index58.js +53 -103
- package/dist/index58.js.map +1 -1
- package/dist/index6.js +36 -58
- package/dist/index6.js.map +1 -1
- package/dist/index60.js +103 -89
- package/dist/index60.js.map +1 -1
- package/dist/index62.js +61 -88
- package/dist/index62.js.map +1 -1
- package/dist/index64.js +119 -77
- package/dist/index64.js.map +1 -1
- package/dist/index66.js +77 -91
- package/dist/index66.js.map +1 -1
- package/dist/index68.js +88 -49
- package/dist/index68.js.map +1 -1
- package/dist/index7.js +78 -20
- package/dist/index7.js.map +1 -1
- package/dist/index70.js +51 -304
- package/dist/index70.js.map +1 -1
- package/dist/index72.js +299 -115
- package/dist/index72.js.map +1 -1
- package/dist/index74.js +120 -214
- package/dist/index74.js.map +1 -1
- package/dist/index76.js +213 -36
- package/dist/index76.js.map +1 -1
- package/dist/index78.js +47 -0
- package/dist/index78.js.map +1 -0
- package/dist/index79.js +119 -230
- package/dist/index79.js.map +1 -1
- package/dist/index8.js +61 -7
- package/dist/index8.js.map +1 -1
- package/dist/index81.js +227 -154
- package/dist/index81.js.map +1 -1
- package/dist/index83.js +154 -207
- package/dist/index83.js.map +1 -1
- package/dist/index85.js +215 -26
- package/dist/index85.js.map +1 -1
- package/dist/index87.js +27 -88
- package/dist/index87.js.map +1 -1
- package/dist/index89.js +53 -88
- package/dist/index89.js.map +1 -1
- package/dist/index9.js +17 -76
- package/dist/index9.js.map +1 -1
- package/dist/index91.js +75 -44
- package/dist/index91.js.map +1 -1
- package/dist/index93.js +89 -15
- package/dist/index93.js.map +1 -1
- package/dist/index95.js +15 -166
- package/dist/index95.js.map +1 -1
- package/dist/index97.js +120 -59
- package/dist/index97.js.map +1 -1
- package/dist/index99.js +66 -52
- package/dist/index99.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/dist/index120.js +0 -47
- package/dist/index120.js.map +0 -1
- package/dist/index164.js +0 -6
- package/dist/index164.js.map +0 -1
- package/dist/index172.js +0 -6
- package/dist/index172.js.map +0 -1
- package/dist/index188.js +0 -6
- package/dist/index188.js.map +0 -1
- package/dist/index234.js +0 -6
- package/dist/index234.js.map +0 -1
- package/dist/index240.js +0 -5
- package/dist/index240.js.map +0 -1
- package/dist/index259.js +0 -10
- package/dist/index259.js.map +0 -1
- package/dist/index262.js +0 -26
- package/dist/index262.js.map +0 -1
- package/dist/index277.js +0 -8
- package/dist/index277.js.map +0 -1
- package/dist/index3.js +0 -17
- package/dist/index3.js.map +0 -1
- package/dist/index4.js +0 -43
- package/dist/index4.js.map +0 -1
- package/dist/index77.js +0 -130
- package/dist/index77.js.map +0 -1
package/dist/index105.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index105.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': fixedHeaders,\n\t\t\t'bb-table--loading': loading,\n\t\t\t'bb-table--empty': !options.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\t:text=\"selectText\"\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>{{ selectAllLabel }}\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=\"!options.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.valueHash\"\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.disabled\"\n\t\t\t\t\t\t\t\t:input-name=\"randomName\"\n\t\t\t\t\t\t\t\t:item=\"item.item\"\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.disabled,\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.disabled\"\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\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.disabled,\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.disabled\"\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.item\"\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.item\"\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 { isNil } from '@/utilities/functions/isNil';\nimport { computed, ref, toRef, 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 { useOptions } from '@/composables/useOptions';\nimport type { Option as BaseOption } from '@/types/Option';\nimport type {\n\tBbTableProps,\n\tMappedCell,\n\tMappedHeader,\n\tMappedItem,\n\tBbTableColumn,\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\tmultiple: true,\n\tmodelValue: () => [],\n\tnoDataText: 'Non ci sono elementi da visualizzare',\n\tselectAllLabel: '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 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 * Map column identifiers to slot names\n */\nconst slotNames = computed(() =>\n\tprops.columns.reduce(\n\t\t(acc: { [key: string]: string }, curr: BbTableColumn) => {\n\t\t\tconst mapped = curr.key.split(/\\W+/g).join('_');\n\t\t\tacc[curr.key] = mapped;\n\t\t\treturn acc;\n\t\t},\n\t\t{}\n\t)\n);\n\nconst { options, selectOption, unselectOption, internalItems } = useOptions({\n\temit,\n\titemText: undefined,\n\titemValue: props.itemValue,\n\tmodelValue: toRef(props, 'modelValue'),\n\tmultiple: props.multiple,\n\tresetQueryOnOptionSelected: false,\n\tstash: false,\n\titems: toRef(props, 'items'),\n\tenforceCoherence: true,\n\tprefill: true,\n\tmodelValueDebounceTime: 0,\n\tdependencies: toRef(props, 'dependencies'),\n\tdepsDebounceTime: props.depsDebounceTime,\n\tqueryDebounceTime: 0,\n\tdisabled: toRef(props, 'disabled'),\n});\n\n/**\n * Take the columns and generate a simplified array for headers display\n */\nconst mappedHeaders = computed(() =>\n\tprops.columns.map((column: BbTableColumn): 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 options.value.map((item: BaseOption): MappedItem => {\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 disabled = !props.selectable;\n\t\tif (typeof props.selectable === 'function') {\n\t\t\tdisabled = !props.selectable(item);\n\t\t}\n\t\tdisabled = disabled || !!item.disabled;\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.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.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.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.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\t\tconst accessibleLabelText = accessibleLabel(cols, item.item);\n\t\tconst res = {\n\t\t\taccessibleLabel: accessibleLabelText,\n\t\t\tcols,\n\t\t\tonRowClick: (event: MouseEvent) =>\n\t\t\t\temit('click:row', event, item, !!item.selected),\n\t\t\tonRowContextMenu: (event: MouseEvent) =>\n\t\t\t\temit('contextmenu:row', event, item, !!item.selected),\n\t\t\tonRowDblClick: (event: MouseEvent) =>\n\t\t\t\temit('dblclick:row', event, item, !!item.selected),\n\t\t\titem: item.item,\n\t\t\ttext: item.text,\n\t\t\tvalueHash: item.valueHash,\n\t\t\tvalue: item.value,\n\t\t\tselected: item.selected,\n\t\t\tdisabled,\n\t\t};\n\t\treturn res;\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.disabled) 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\n\t\t\t\t.filter((item) => !item.disabled)\n\t\t\t\t.every((item) => 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\tif (item.selected) {\n\t\tunselectOption(item);\n\t} else {\n\t\tselectOption(item);\n\t}\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(options.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\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","selectText","containerTag","computed","internalLoading","loading","replacementContentSpan","acc","current","slotNames","curr","mapped","options","selectOption","unselectOption","internalItems","useOptions","toRef","mappedHeaders","column","align","label","key","slotName","classes","mappedItems","item","disabled","cols","content","isNil","temp","event","onChangeSelectAll","value","selectAllValue","modelValue","allSelected","indeterminate","_a","onInputChange","makeInputValue","when","hiddenInputs","skeletonLength","clamp","watch","headers","mappedColumns","index","position","clientRect","width","offset","el","add","row","cell"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4QM,UAAA,EAAE,cAAAA,MAAiBC,MAQnBC,IAAaC,KAAQ,GAAG,OAExBC,IAAQC,GAmBRC,IAAOC,GAIPC,IAAYC,KAEZC,IAAkBN,EAAM,iBACxBO,IAAcP,EAAM,aACpBQ,IAAaR,EAAM,YACnBS,IAAaT,EAAM,YAGnBU,IAAeC,EAAS,MAAOX,EAAM,aAAa,aAAa,KAAM,GACrEY,IAAkBP,EAAI,EAAK,GAC3BQ,IAAUF,EAAS,MAAMX,EAAM,WAAWY,EAAgB,KAAK,GAE/DE,IAAyBH,EAAS,MAChC,CAAC,CAAC,CAACX,EAAM,YAAY,CAAC,CAACA,EAAM,OAAO,EAAE;AAAA,MAC5C,CAACe,GAAaC,MAAYD,IAAM,CAAO,CAAC,CAACC;AAAA,MACzChB,EAAM,QAAQ;AAAA,IAAA,CAEf,GAKKiB,IAAYN;AAAA,MAAS,MAC1BX,EAAM,QAAQ;AAAA,QACb,CAACe,GAAgCG,MAAwB;AACxD,gBAAMC,IAASD,EAAK,IAAI,MAAM,MAAM,EAAE,KAAK,GAAG;AAC1C,iBAAAH,EAAAG,EAAK,GAAG,IAAIC,GACTJ;AAAA,QACR;AAAA,QACA,CAAC;AAAA,MACF;AAAA,IAAA,GAGK,EAAE,SAAAK,GAAS,cAAAC,GAAc,gBAAAC,GAAgB,eAAAC,EAAA,IAAkBC,GA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MR,MAAU;AAC5B,cAAAQ,EAAK,MAAM,WAAW,UAElBT,EAAcC,CAAK,EAAE,aAAa,SACrCQ,EAAK,MAAM,OAAO,GAAGT,EAAcC,CAAK,EAAE,MAAM,OAEhDQ,EAAK,MAAM,QAAQ,GAAGT,EAAcC,CAAK,EAAE,MAAM;AAAA,YAClD,CACA;AAAA,UAAA,CACD;AAAA,QACF;AAAA,MAEF;AAAA,MACA;AAAA,QACC,OAAO;AAAA,MACR;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index105.js","sources":["../src/components/BbTab/BbTab.vue"],"sourcesContent":["<template>\n\t<div\n\t\t:id=\"id\"\n\t\tref=\"tabs\"\n\t\tclass=\"bb-tab\"\n\t\t:class=\"{\n\t\t\t[`bb-tab--${direction}`]: true,\n\t\t\t'bb-tab--disabled': true,\n\t\t}\"\n\t>\n\t\t<div class=\"bb-tab__label-boundary\">\n\t\t\t<span><slot name=\"header:prepend\" v-bind=\"scrollStatus\"></slot></span>\n\t\t\t<ul ref=\"tablist\" class=\"bb-tab__label-container\" role=\"tablist\">\n\t\t\t\t<li v-for=\"tab in items\" :key=\"tab.key\" role=\"presentation\">\n\t\t\t\t\t<BaseButton\n\t\t\t\t\t\t:id=\"`${instanceid}_tab_${tab.key}`\"\n\t\t\t\t\t\t:aria-selected=\"selectedTab === tab.key\"\n\t\t\t\t\t\tclass=\"bb-tab__btn\"\n\t\t\t\t\t\t:class=\"{ 'bb-tab__btn--active': selectedTab === tab.key }\"\n\t\t\t\t\t\t:disabled=\"tab.disabled || disabled\"\n\t\t\t\t\t\t:role=\"'tab'\"\n\t\t\t\t\t\t:tabindex=\"selectedTab === tab.key ? 0 : -1\"\n\t\t\t\t\t\t@click=\"onTabSelected(tab.key, props.replace)\"\n\t\t\t\t\t\t@keydown=\"onKeydown\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t:current=\"selectedTab\"\n\t\t\t\t\t\t\t:current-index=\"currentTabIndex\"\n\t\t\t\t\t\t\t:disabled=\"!!(tab.disabled || disabled)\"\n\t\t\t\t\t\t\t:go-to=\"goTo\"\n\t\t\t\t\t\t\t:is-first=\"isFirst\"\n\t\t\t\t\t\t\t:is-last=\"isLast\"\n\t\t\t\t\t\t\t:name=\"`label-${tab.key}`\"\n\t\t\t\t\t\t\t:selected=\"selectedTab === tab.key\"\n\t\t\t\t\t\t\t:text=\"tab.label\"\n\t\t\t\t\t\t\t:value=\"tab.key\"\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:current=\"selectedTab\"\n\t\t\t\t\t\t\t\t:current-index=\"currentTabIndex\"\n\t\t\t\t\t\t\t\t:disabled=\"!!(tab.disabled || disabled)\"\n\t\t\t\t\t\t\t\t:go-to=\"goTo\"\n\t\t\t\t\t\t\t\t:is-first=\"isFirst\"\n\t\t\t\t\t\t\t\t:is-last=\"isLast\"\n\t\t\t\t\t\t\t\tname=\"label\"\n\t\t\t\t\t\t\t\t:selected=\"selectedTab === tab.key\"\n\t\t\t\t\t\t\t\t:text=\"tab.label\"\n\t\t\t\t\t\t\t\t:value=\"tab.key\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<span class=\"bb-tab__label\">{{ tab.label }}</span>\n\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t</slot>\n\t\t\t\t\t</BaseButton>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t\t<span><slot name=\"header:append\" v-bind=\"scrollStatus\"></slot></span>\n\t\t</div>\n\t\t<div class=\"bb-tab__panes-container\">\n\t\t\t<BbSmoothHeight>\n\t\t\t\t<template v-for=\"tab in items\" :key=\"tab.key\">\n\t\t\t\t\t<Transition :css=\"animate\" :name=\"`tab-slide-${animationDirection}`\">\n\t\t\t\t\t\t<section\n\t\t\t\t\t\t\tv-if=\"selectedTab === tab.key || eager || tab.eager\"\n\t\t\t\t\t\t\t:id=\"`${instanceid}_tabpanel_${tab.key}`\"\n\t\t\t\t\t\t\t:aria-labelledby=\"`${instanceid}_tab_${tab.key}`\"\n\t\t\t\t\t\t\tclass=\"bb-tab__pane\"\n\t\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t\t'bb-tab__pane--shown': selectedTab === tab.key,\n\t\t\t\t\t\t\t}\"\n\t\t\t\t\t\t\trole=\"tabpanel\"\n\t\t\t\t\t\t\ttabindex=\"0\"\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:current=\"selectedTab\"\n\t\t\t\t\t\t\t\t:current-index=\"currentTabIndex\"\n\t\t\t\t\t\t\t\t:disabled=\"!!(tab.disabled || disabled)\"\n\t\t\t\t\t\t\t\t:go-to=\"goTo\"\n\t\t\t\t\t\t\t\t:is-first=\"isFirst\"\n\t\t\t\t\t\t\t\t:is-last=\"isLast\"\n\t\t\t\t\t\t\t\t:name=\"tab.key\"\n\t\t\t\t\t\t\t\t:selected=\"selectedTab === tab.key\"\n\t\t\t\t\t\t\t\t:text=\"tab.label\"\n\t\t\t\t\t\t\t\t:value=\"tab.key\"\n\t\t\t\t\t\t\t></slot>\n\t\t\t\t\t\t</section>\n\t\t\t\t\t</Transition>\n\t\t\t\t</template>\n\t\t\t</BbSmoothHeight>\n\t\t</div>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, getCurrentInstance, computed, nextTick } from 'vue';\nimport { useId } from '@/composables/useId';\nimport { useRoute } from '@/composables/useRoute';\nimport { useRouter } from '@/composables/useRouter';\nimport { wait } from '@/utilities/functions/wait';\nimport { useScroll } from '@vueuse/core';\nimport BaseButton from '../BaseButton/BaseButton.vue';\nimport type { CommonProps } from '@/types/CommonProps';\nimport BbSmoothHeight from '../BbSmoothHeight/BbSmoothHeight.vue';\n\nexport type BbTabItem = Pick<CommonProps, 'disabled'> & {\n\t/**\n\t * Used to render a tab even when not visible.\n\t * It's useful if you want the content of a tab in the DOM\n\t * immediately rendered\n\t * even when not visible for SEO purposes.\n\t */\n\teager?: boolean;\n\t/**\n\t * String that identifies the tab.\n\t */\n\tkey: string;\n\t/**\n\t * Label to use as the tab text.\n\t */\n\tlabel?: string;\n};\n\nexport type BbTabProps = Pick<CommonProps, 'disabled' | 'eager' | 'id'> & {\n\t/**\n\t * Enables transitions\n\t */\n\tanimate?: boolean;\n\t/**\n\t * Direction of the tabs component\n\t */\n\tdirection?: 'horizontal' | 'vertical';\n\t/**\n\t * Array of items that define the tabs in the component.\n\t */\n\titems: BbTabItem[];\n\t/**\n\t * The current tab. Used by v-model.\n\t */\n\tmodelValue?: null | BbTabItem['key'];\n\t/**\n\t * Synchronizes the current tab with the url.\n\t */\n\tnavigation?: boolean;\n\t/**\n\t * Defines the query key to reference for maintaining navigation\n\t */\n\tquerykey?: string;\n\n\t/**\n\t * Replaces history rather than pushing it when changing tab.\n\t */\n\treplace?: boolean;\n};\n\nconst props = withDefaults(defineProps<BbTabProps>(), {\n\tanimate: true,\n\tdirection: 'horizontal',\n\tquerykey: 'tab',\n});\n\nexport type BbTabEvents = {\n\t(e: 'update:modelValue', value: (typeof props.items)[number]['key']): void;\n};\nconst emit = defineEmits<BbTabEvents>();\n\ntype BbStepSlots = {\n\t'header:prepend'?: (props: {\n\t\tisScrolling: boolean;\n\t\tleft: boolean;\n\t\tright: boolean;\n\t}) => any;\n\t'header:append'?: (props: {\n\t\tisScrolling: boolean;\n\t\tleft: boolean;\n\t\tright: boolean;\n\t}) => any;\n\tlabel?: (props: {\n\t\tcurrent: string | null;\n\t\tcurrentIndex: number;\n\t\tdisabled: boolean;\n\t\tisFirst: boolean;\n\t\tisLast: boolean;\n\t\tselected: boolean;\n\t\ttext: BbTabItem['label'];\n\t\tvalue: string;\n\t\tgoTo: typeof goTo;\n\t}) => any;\n} & {\n\t[key: string]: (props: {\n\t\tcurrent: string | null;\n\t\tcurrentIndex: number;\n\t\tdisabled: boolean;\n\t\tisFirst: boolean;\n\t\tisLast: boolean;\n\t\tselected: boolean;\n\t\ttext: BbTabItem['label'];\n\t\tvalue: string;\n\t\tgoTo: typeof goTo;\n\t}) => any;\n};\n\ndefineSlots<BbStepSlots>();\n\nconst route = useRoute();\nconst router = useRouter();\n\nconst tabs = ref();\n\nconst id = props.id ?? useId().id.value;\nconst instanceid = `bb-tab_${id}`;\n\nconst tablist = ref();\nconst { isScrolling, arrivedState } = useScroll(tablist);\nconst scrollStatus = computed(() => ({\n\tisScrolling: isScrolling.value,\n\tleft: arrivedState.left,\n\tright: arrivedState.right,\n}));\n\n/* Ignore because possibly undefined */\n// @ts-expect-error possibly undef\nconst isInertia = !!getCurrentInstance()?.proxy?.$inertia;\n\nconst selectedTab = ref<BbTabItem['key'] | null>(null);\n\nconst currentTabIndex = computed(() =>\n\tprops.items.findIndex((el) => el.key === selectedTab.value)\n);\nconst isFirst = computed(() => currentTabIndex.value === 0);\nconst isLast = computed(() => currentTabIndex.value === props.items.length - 1);\n\nprops.items.forEach((item) => {\n\tif (!item.key) {\n\t\tconsole.error(`A tab item has no key`, item);\n\t\tthrow new Error('A tab item has no key ' + JSON.stringify(item));\n\t}\n});\n\n/* \nThis section retrieves the current tab that should be selected\n*/\n// Retrieve tab from url on load for vue apps\nif (props.navigation && route.value?.query?.[props.querykey]) {\n\tselectedTab.value = route.value?.query?.[props.querykey] as string;\n\t// Retrieve tab from url on load for inertia app\n} else if (\n\tprops.navigation &&\n\tisInertia &&\n\tglobalThis?.location?.href &&\n\tnew URL(globalThis.location.href).searchParams.get(props.querykey)\n) {\n\tselectedTab.value = new URL(globalThis.location.href).searchParams.get(\n\t\tprops.querykey\n\t) as string;\n\t// Else whatever tab is passed first\n} else if (props.modelValue) {\n\tselectedTab.value = props.modelValue;\n\t// Else whatever tab is passed first\n} else if (props.items[0]) {\n\tconst firstSelectableTab = props.items.find((item) => !item.disabled);\n\tif (!firstSelectableTab) {\n\t\tthrow new Error(\n\t\t\t'No tab has been selected so it defaulted to the first available. Still, all the tabs are disabled so no tab can be selected.'\n\t\t);\n\t}\n\tconst key = firstSelectableTab.key;\n\tselectedTab.value = key;\n}\n/* \nOnce the current tab is found update external variables\n*/\n\nconst onTabSelected = async (tab: BbTabItem['key'], replace = false) => {\n\t/* For Vue or Nuxt context */\n\tif (\n\t\tprops.navigation &&\n\t\troute.value &&\n\t\troute.value?.query?.[props.querykey] !== tab\n\t) {\n\t\trouter?.push({\n\t\t\t...route,\n\t\t\tquery: { ...route.value?.query, [props.querykey]: tab },\n\t\t\treplace,\n\t\t});\n\t\t/* Inertia context */\n\t} else if (\n\t\tprops.navigation &&\n\t\tisInertia &&\n\t\tglobalThis?.location?.href &&\n\t\tnew URL(globalThis.location.href).searchParams.get(props.querykey) !== tab\n\t) {\n\t\tconst url = new URL(globalThis.location.href);\n\t\turl.searchParams.set(props.querykey, tab);\n\t\twait(0).then(() => {\n\t\t\tif (replace) {\n\t\t\t\thistory.replaceState({}, '', url.toString());\n\t\t\t} else {\n\t\t\t\thistory.pushState({}, '', url.toString());\n\t\t\t}\n\t\t});\n\t}\n\tif (props.modelValue !== tab) {\n\t\temit('update:modelValue', tab);\n\t}\n\tselectedTab.value = tab;\n};\n\nif (selectedTab.value) {\n\tonTabSelected(selectedTab.value, true);\n}\n\nconst goTo = (target: 'first' | 'previous' | 'next' | 'last') => {\n\tvar nextTabIndex: number | null = null;\n\tswitch (target) {\n\t\tcase 'first':\n\t\t\tnextTabIndex = 0;\n\t\t\twhile (nextTabIndex < props.items.length - 1) {\n\t\t\t\tif (props.items[nextTabIndex].disabled) {\n\t\t\t\t\tnextTabIndex++;\n\t\t\t\t} else break;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'previous': {\n\t\t\tlet offset = 1;\n\t\t\twhile (offset < props.items.length) {\n\t\t\t\tnextTabIndex =\n\t\t\t\t\t(currentTabIndex.value + props.items.length - offset) %\n\t\t\t\t\tprops.items.length;\n\t\t\t\tif (props.items[nextTabIndex].disabled) {\n\t\t\t\t\toffset++;\n\t\t\t\t} else break;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase 'next': {\n\t\t\tlet offset = 1;\n\t\t\twhile (offset < props.items.length) {\n\t\t\t\tnextTabIndex = (currentTabIndex.value + offset) % props.items.length;\n\t\t\t\tif (props.items[nextTabIndex].disabled) {\n\t\t\t\t\toffset++;\n\t\t\t\t} else break;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase 'last':\n\t\t\tnextTabIndex = props.items.length - 1;\n\t\t\twhile (nextTabIndex >= 0) {\n\t\t\t\tif (props.items[nextTabIndex].disabled) {\n\t\t\t\t\tnextTabIndex--;\n\t\t\t\t} else break;\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\tif (nextTabIndex === null) {\n\t\tthrow new Error('Could not navigate to next tab');\n\t}\n\tif (props.items[nextTabIndex].disabled) return;\n\tconst targetKey = props.items[nextTabIndex].key;\n\tconst button: HTMLButtonElement | null = document.querySelector(\n\t\t`#${instanceid}_tab_${targetKey}`\n\t);\n\tbutton?.focus();\n\tonTabSelected(targetKey, props.replace);\n};\n\nconst onKeydown = (event: KeyboardEvent) => {\n\tif (props.disabled) return;\n\tif (event.key === 'ArrowRight') {\n\t\tgoTo('next');\n\t} else if (event.key === 'ArrowLeft') {\n\t\tgoTo('previous');\n\t} else if (event.key === 'Home') {\n\t\tevent.preventDefault();\n\t\tgoTo('first');\n\t} else if (event.key === 'End') {\n\t\tevent.preventDefault();\n\t\tgoTo('last');\n\t} else {\n\t\treturn;\n\t}\n};\n\nwatch(\n\t() => props.modelValue,\n\t(value) => {\n\t\tif (value) {\n\t\t\tonTabSelected(value, props.replace);\n\t\t}\n\t}\n);\n\nwatch(\n\t() => route.value?.query?.[props.querykey],\n\t(value) => {\n\t\tif (value && typeof value === 'string') {\n\t\t\tonTabSelected(value, props.replace);\n\t\t}\n\t}\n);\n\nwatch(\n\tselectedTab,\n\tasync () => {\n\t\tif (tabs.value) {\n\t\t\tconst element = tabs.value.querySelector(\n\t\t\t\t`[role=tablist] .bb-tab__btn--active`\n\t\t\t);\n\t\t\tif (element) {\n\t\t\t\tawait nextTick();\n\t\t\t\telement.scrollIntoView({\n\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\tinline: 'nearest',\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t},\n\t{ flush: 'post' }\n);\n\nconst animationDirection = ref<'left' | 'right'>('right');\nwatch(\n\tselectedTab,\n\t(current, previous) => {\n\t\tif (current && previous) {\n\t\t\tconst indexCurrent = props.items.findIndex((i) => i.key === current);\n\t\t\tconst indexPrevious = props.items.findIndex((i) => i.key === previous);\n\t\t\tanimationDirection.value =\n\t\t\t\tindexCurrent > indexPrevious ? 'right' : 'left';\n\t\t}\n\t},\n\t{ flush: 'sync' }\n);\n\ndefineExpose({\n\tisFirst,\n\tisLast,\n\tcurrent: selectedTab,\n\tcurrentIndex: currentTabIndex,\n\tgoTo,\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbTab';\n</style>\n"],"names":["props","__props","emit","__emit","route","useRoute","router","useRouter","tabs","ref","id","useId","instanceid","tablist","isScrolling","arrivedState","useScroll","scrollStatus","computed","isInertia","_b","_a","getCurrentInstance","selectedTab","currentTabIndex","el","isFirst","isLast","item","_d","_c","_f","_e","_g","firstSelectableTab","key","onTabSelected","tab","replace","url","wait","goTo","target","nextTabIndex","offset","targetKey","button","onKeydown","event","watch","value","element","nextTick","animationDirection","current","previous","indexCurrent","indexPrevious","__expose"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAyJA,UAAMA,IAAQC,GASR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OAAO;AAAA,IAAA,GAGJC,EAAA;AAAA,MACZ,SAAAhC;AAAA,MACA,QAAAC;AAAA,MACA,SAASJ;AAAA,MACT,cAAcC;AAAA,MACd,MAAAiB;AAAA,IAAA,CACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index107.js
CHANGED
|
@@ -1,118 +1,407 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as oe, ref as x, computed as h, toRef as B, watch as ne, openBlock as n, createBlock as de, resolveDynamicComponent as ce, normalizeClass as r, unref as u, withCtx as ie, createElementBlock as d, toDisplayString as p, createCommentVNode as k, createElementVNode as s, renderSlot as f, createVNode as I, Fragment as w, renderList as T, createTextVNode as be, mergeProps as re } from "vue";
|
|
2
|
+
import { add as ue } from "./index283.js";
|
|
3
|
+
import { clamp as pe } from "./index200.js";
|
|
4
|
+
import { isNil as M } from "./index126.js";
|
|
5
|
+
import { useId as fe } from "./index9.js";
|
|
6
|
+
import { useItemValue as me } from "./index281.js";
|
|
7
|
+
import { when as he } from "./index220.js";
|
|
8
|
+
import J from "./index16.js";
|
|
3
9
|
/* empty css */
|
|
4
|
-
import
|
|
10
|
+
import ye from "./index30.js";
|
|
5
11
|
/* empty css */
|
|
6
|
-
|
|
7
|
-
|
|
12
|
+
import { useOptions as _e } from "./index232.js";
|
|
13
|
+
const ke = { key: 0 }, ve = { class: "bb-table-header-row" }, Ce = { class: "bb-table-header__content" }, ge = { class: "bb-table-check__label-text" }, we = {
|
|
14
|
+
key: 1,
|
|
15
|
+
class: "bb-table-radio__label-text"
|
|
16
|
+
}, Te = { class: "bb-table-header__content" }, Ve = { class: "bb-table-header__content" }, $e = { class: "bb-table-loading__row" }, Ae = ["colspan"], Be = { class: "bb-table-loading__text" }, Ne = {
|
|
17
|
+
class: "bb-table-skeleton__container",
|
|
18
|
+
role: "status"
|
|
19
|
+
}, Se = /* @__PURE__ */ s("div", { class: "bb-table-skeleton-item__avatar-container" }, [
|
|
20
|
+
/* @__PURE__ */ s("div", { class: "bb-table-skeleton-item__avatar" })
|
|
21
|
+
], -1), De = /* @__PURE__ */ s("div", { class: "bb-table-skeleton-item__text" }, [
|
|
22
|
+
/* @__PURE__ */ s("div", { class: "bb-table-skeleton-item__line" }),
|
|
23
|
+
/* @__PURE__ */ s("div", { class: "bb-table-skeleton-item__line" })
|
|
24
|
+
], -1), Le = [
|
|
25
|
+
Se,
|
|
26
|
+
De
|
|
27
|
+
], Re = { class: "bb-table-no-data__row" }, Ie = ["colspan"], ze = { class: "bb-table-no-data__text" }, Oe = ["onClick", "onContextmenu", "onDblclick"], He = { class: "bb-table-check__label-text" }, qe = { class: "bb-table-radio__label-text" }, Xe = /* @__PURE__ */ oe({
|
|
28
|
+
__name: "BbTable",
|
|
8
29
|
props: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
30
|
+
accessibleLabel: { type: Function, default: (N) => ["Seleziona"].concat(N.map((S) => S.content)).join(" ") },
|
|
31
|
+
actions: { type: Boolean },
|
|
32
|
+
actionsText: { default: "Azioni" },
|
|
33
|
+
align: { default: "left" },
|
|
34
|
+
allowSelectAll: { type: Boolean, default: !0 },
|
|
35
|
+
caption: {},
|
|
36
|
+
columns: { default: () => [] },
|
|
37
|
+
compact: { type: Boolean },
|
|
38
|
+
dependencies: { default: () => [] },
|
|
39
|
+
depsDebounceTime: { default: 0 },
|
|
14
40
|
disabled: { type: Boolean },
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
labelPosition: {},
|
|
41
|
+
displayCaption: { type: Boolean },
|
|
42
|
+
fixed: { type: Boolean },
|
|
43
|
+
fixedColumns: { default: () => [] },
|
|
44
|
+
fixedHeaders: { type: Boolean },
|
|
45
|
+
items: { type: [Array, Function], default: () => [] },
|
|
46
|
+
itemValue: {},
|
|
47
|
+
legend: {},
|
|
23
48
|
loading: { type: Boolean },
|
|
24
|
-
|
|
49
|
+
loadingText: { default: "Caricamento" },
|
|
50
|
+
modelValue: { default: () => [] },
|
|
25
51
|
multiple: { type: Boolean, default: !0 },
|
|
26
52
|
name: {},
|
|
27
|
-
|
|
28
|
-
placeholder: {},
|
|
29
|
-
"prepend:icon": {},
|
|
53
|
+
noDataText: { default: "Non ci sono elementi da visualizzare" },
|
|
30
54
|
readonly: {},
|
|
31
|
-
|
|
32
|
-
|
|
55
|
+
selectable: { type: [Boolean, Function] },
|
|
56
|
+
selectAll: { type: Boolean },
|
|
57
|
+
selectAllLabel: { default: "Seleziona tutti gli elementi di questa pagina" },
|
|
58
|
+
selectText: { default: "Seleziona un elemento" },
|
|
59
|
+
tdClass: {},
|
|
60
|
+
thClass: {}
|
|
33
61
|
},
|
|
34
|
-
emits: ["
|
|
35
|
-
setup(
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
62
|
+
emits: ["click:row", "contextmenu:row", "dblclick:row", "update:modelValue", "update:selectAll"],
|
|
63
|
+
setup(N, { emit: S }) {
|
|
64
|
+
const { getItemValue: P } = me(), D = fe().id.value, a = N, v = S, V = x(), Q = a.accessibleLabel, U = a.loadingText, W = a.noDataText, z = a.selectText, G = h(() => a.selectable ? "fieldset" : "div"), K = x(!1), O = h(() => a.loading || K.value), H = h(() => [!!a.selectable, !!a.actions].reduce(
|
|
65
|
+
(e, o) => e + +!!o,
|
|
66
|
+
a.columns.length
|
|
67
|
+
)), q = h(
|
|
68
|
+
() => a.columns.reduce(
|
|
69
|
+
(e, o) => {
|
|
70
|
+
const l = o.key.split(/\W+/g).join("_");
|
|
71
|
+
return e[o.key] = l, e;
|
|
72
|
+
},
|
|
73
|
+
{}
|
|
74
|
+
)
|
|
75
|
+
), { options: $, selectOption: X, unselectOption: Y, internalItems: E } = _e({
|
|
76
|
+
emit: v,
|
|
77
|
+
itemText: void 0,
|
|
78
|
+
itemValue: a.itemValue,
|
|
79
|
+
modelValue: B(a, "modelValue"),
|
|
80
|
+
multiple: a.multiple,
|
|
81
|
+
resetQueryOnOptionSelected: !1,
|
|
82
|
+
stash: !1,
|
|
83
|
+
items: B(a, "items"),
|
|
84
|
+
enforceCoherence: !0,
|
|
85
|
+
prefill: !0,
|
|
86
|
+
modelValueDebounceTime: 0,
|
|
87
|
+
dependencies: B(a, "dependencies"),
|
|
88
|
+
depsDebounceTime: a.depsDebounceTime,
|
|
89
|
+
queryDebounceTime: 0,
|
|
90
|
+
disabled: B(a, "disabled")
|
|
91
|
+
}), Z = h(
|
|
92
|
+
() => a.columns.map((e) => {
|
|
93
|
+
const o = e.align || "left", { label: l, key: c } = e, g = `header:${q.value[e.key]}`;
|
|
94
|
+
let t = [`bb-table-header--${o}`];
|
|
95
|
+
return a.thClass && (t = t.concat(a.thClass)), e.thClass && (t = t.concat(e.thClass)), {
|
|
96
|
+
align: o,
|
|
97
|
+
key: c,
|
|
98
|
+
label: l,
|
|
99
|
+
slotName: g,
|
|
100
|
+
classes: t
|
|
101
|
+
};
|
|
102
|
+
})
|
|
103
|
+
), C = h(() => $.value.map((e) => {
|
|
104
|
+
let o = !a.selectable;
|
|
105
|
+
typeof a.selectable == "function" && (o = !a.selectable(e)), o = o || !!e.disabled;
|
|
106
|
+
const l = a.columns.map((t) => {
|
|
107
|
+
const i = q.value[t.key], y = t.align || "left", { label: A, key: L } = t;
|
|
108
|
+
let m = P(e.item, t.key);
|
|
109
|
+
t.formatter && // By default the formatter runs anyway
|
|
110
|
+
(!M(m) || t.formatOnNull !== !1) && (m = t.formatter(m, t.key, e.item)), t.placeholder && M(m) && (m = t.placeholder);
|
|
111
|
+
let b = [`bb-table-data__cell--${y}`];
|
|
112
|
+
if (a.tdClass)
|
|
113
|
+
if (typeof a.tdClass == "function") {
|
|
114
|
+
let _ = a.tdClass(m, t.key, e.item);
|
|
115
|
+
_ && (b = b.concat(_));
|
|
116
|
+
} else b = b.concat(a.tdClass);
|
|
117
|
+
if (t.tdClass)
|
|
118
|
+
if (typeof t.tdClass == "function") {
|
|
119
|
+
let _ = t.tdClass(m, t.key, e.item);
|
|
120
|
+
_ && (b = b.concat(_));
|
|
121
|
+
} else b = b.concat(t.tdClass);
|
|
122
|
+
return {
|
|
123
|
+
align: y,
|
|
124
|
+
classes: b,
|
|
125
|
+
content: m,
|
|
126
|
+
key: L,
|
|
127
|
+
label: A,
|
|
128
|
+
slotName: i
|
|
129
|
+
};
|
|
130
|
+
});
|
|
131
|
+
return {
|
|
132
|
+
accessibleLabel: Q(l, e.item),
|
|
133
|
+
cols: l,
|
|
134
|
+
onRowClick: (t) => v("click:row", t, e, !!e.selected),
|
|
135
|
+
onRowContextMenu: (t) => v("contextmenu:row", t, e, !!e.selected),
|
|
136
|
+
onRowDblClick: (t) => v("dblclick:row", t, e, !!e.selected),
|
|
137
|
+
item: e.item,
|
|
138
|
+
text: e.text,
|
|
139
|
+
valueHash: e.valueHash,
|
|
140
|
+
value: e.value,
|
|
141
|
+
selected: e.selected,
|
|
142
|
+
disabled: o
|
|
143
|
+
};
|
|
144
|
+
})), ee = (e) => {
|
|
145
|
+
let o = e, l = [];
|
|
146
|
+
o && (l = C.value.reduce((c, g) => (g.disabled || c.push(g.value), c), [])), v("update:modelValue", l), v("update:selectAll", e);
|
|
147
|
+
}, F = h(
|
|
148
|
+
() => !!(C.value.length && C.value.filter((e) => !e.disabled).every((e) => e.selected))
|
|
149
|
+
), le = h(
|
|
150
|
+
() => {
|
|
151
|
+
var e;
|
|
152
|
+
return C.value.some((o) => !o.selected) && !!((e = a.modelValue) != null && e.length);
|
|
153
|
+
}
|
|
154
|
+
), j = (e) => {
|
|
155
|
+
e.selected ? Y(e) : X(e);
|
|
156
|
+
}, te = he(
|
|
157
|
+
(e) => typeof e != "string",
|
|
158
|
+
JSON.stringify
|
|
159
|
+
), ae = h(() => [].concat(a.modelValue).map((e) => {
|
|
160
|
+
const o = te(e);
|
|
161
|
+
return {
|
|
162
|
+
disabled: a.disabled,
|
|
163
|
+
name: a.name,
|
|
164
|
+
type: "hidden",
|
|
165
|
+
value: o
|
|
166
|
+
};
|
|
167
|
+
})), se = h(() => pe($.value.length, 4, 10));
|
|
168
|
+
return ne(
|
|
169
|
+
() => C.value,
|
|
170
|
+
() => {
|
|
171
|
+
var e;
|
|
172
|
+
if (a.fixedColumns.length && a.items && V.value) {
|
|
173
|
+
const o = Array.from(
|
|
174
|
+
V.value.querySelectorAll("thead th")
|
|
175
|
+
), l = a.fixedColumns.reduce((t, i) => {
|
|
176
|
+
const y = typeof i == "number" ? i : i.index, A = typeof i == "number" ? "left" : i.position, L = o[y].getBoundingClientRect(), m = Math.floor(L.width), b = t.filter((R) => R.position === A).map((R) => R.width).reduce(ue, 0), _ = {
|
|
177
|
+
index: y,
|
|
178
|
+
position: A,
|
|
179
|
+
width: m,
|
|
180
|
+
offset: b
|
|
181
|
+
};
|
|
182
|
+
return t.push(_), t;
|
|
183
|
+
}, []);
|
|
184
|
+
Array.from((e = V.value) == null ? void 0 : e.querySelectorAll("tr")).map(
|
|
185
|
+
(t) => Array.from(
|
|
186
|
+
t.querySelectorAll(
|
|
187
|
+
l.map((i) => `:scope > :nth-child(${i.index + 1})`).join(", ")
|
|
188
|
+
)
|
|
189
|
+
)
|
|
190
|
+
).forEach((t) => {
|
|
191
|
+
t.forEach((i, y) => {
|
|
192
|
+
i.style.position = "sticky", l[y].position === "left" ? i.style.left = `${l[y].offset}px` : i.style.right = `${l[y].offset}px`;
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
}
|
|
43
196
|
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
label: e.label,
|
|
61
|
-
"label-position": e.labelPosition,
|
|
62
|
-
"model-value": e.modelValue,
|
|
63
|
-
name: e.name,
|
|
64
|
-
reverse: e.reverse,
|
|
65
|
-
"show-hint": m.value
|
|
197
|
+
{
|
|
198
|
+
flush: "post"
|
|
199
|
+
}
|
|
200
|
+
), (e, o) => (n(), de(ce(G.value), {
|
|
201
|
+
ref_key: "container",
|
|
202
|
+
ref: V,
|
|
203
|
+
class: r({
|
|
204
|
+
"bb-table": !0,
|
|
205
|
+
[`bb-table--align-${e.align}`]: !0,
|
|
206
|
+
"bb-table--compact": e.compact,
|
|
207
|
+
"bb-table--fixed": e.fixed,
|
|
208
|
+
"bb-table--fixed-header": e.fixedHeaders,
|
|
209
|
+
"bb-table--loading": O.value,
|
|
210
|
+
"bb-table--empty": !u($).length,
|
|
211
|
+
"bb-table--selectable": e.selectable
|
|
212
|
+
})
|
|
66
213
|
}, {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
214
|
+
default: ie(() => [
|
|
215
|
+
e.selectable ? (n(), d("legend", ke, p(e.legend), 1)) : k("", !0),
|
|
216
|
+
s("table", null, [
|
|
217
|
+
e.caption ? (n(), d("caption", {
|
|
218
|
+
key: 0,
|
|
219
|
+
class: r({
|
|
220
|
+
"bb-table-caption": !0,
|
|
221
|
+
"bb-table-caption--hidden": !e.displayCaption
|
|
222
|
+
})
|
|
223
|
+
}, p(e.caption), 3)) : k("", !0),
|
|
224
|
+
s("thead", null, [
|
|
225
|
+
f(e.$slots, "thead", {}, () => [
|
|
226
|
+
s("tr", ve, [
|
|
227
|
+
e.selectable ? (n(), d("th", {
|
|
228
|
+
key: 0,
|
|
229
|
+
class: r(["bb-table-header bb-table-header--select", e.thClass]),
|
|
230
|
+
scope: "col"
|
|
231
|
+
}, [
|
|
232
|
+
f(e.$slots, "header:select", {
|
|
233
|
+
multiple: e.multiple,
|
|
234
|
+
selectAll: !!e.selectAll,
|
|
235
|
+
text: u(z)
|
|
236
|
+
}, () => [
|
|
237
|
+
s("span", Ce, [
|
|
238
|
+
e.allowSelectAll && e.multiple ? (n(), d("label", {
|
|
239
|
+
key: 0,
|
|
240
|
+
class: r(["bb-table-check__label", {
|
|
241
|
+
"bb-table-check__label--disabled": e.disabled
|
|
242
|
+
}])
|
|
243
|
+
}, [
|
|
244
|
+
I(J, {
|
|
245
|
+
class: "bb-table-check",
|
|
246
|
+
disabled: e.disabled,
|
|
247
|
+
indeterminate: le.value,
|
|
248
|
+
"model-value": F.value,
|
|
249
|
+
name: `select_all_${e.name || ""}`,
|
|
250
|
+
readonly: e.readonly,
|
|
251
|
+
"onUpdate:modelValue": ee
|
|
252
|
+
}, null, 8, ["disabled", "indeterminate", "model-value", "name", "readonly"]),
|
|
253
|
+
s("span", ge, p(e.selectAllLabel), 1)
|
|
254
|
+
], 2)) : e.multiple ? k("", !0) : (n(), d("span", we, p(u(z)), 1))
|
|
255
|
+
])
|
|
256
|
+
])
|
|
257
|
+
], 2)) : k("", !0),
|
|
258
|
+
(n(!0), d(w, null, T(Z.value, (l) => (n(), d("th", {
|
|
259
|
+
key: l.key,
|
|
260
|
+
class: r(["bb-table-header", l.classes]),
|
|
261
|
+
scope: "col"
|
|
262
|
+
}, [
|
|
263
|
+
f(e.$slots, l.slotName, {
|
|
264
|
+
classes: l.classes,
|
|
265
|
+
item: void 0,
|
|
266
|
+
items: u(E),
|
|
267
|
+
label: l.label
|
|
268
|
+
}, () => [
|
|
269
|
+
s("span", Te, p(l.label), 1)
|
|
270
|
+
])
|
|
271
|
+
], 2))), 128)),
|
|
272
|
+
e.actions ? (n(), d("th", {
|
|
273
|
+
key: 1,
|
|
274
|
+
class: r(["bb-table-header bb-table-header--actions", e.thClass]),
|
|
275
|
+
scope: "col"
|
|
276
|
+
}, [
|
|
277
|
+
f(e.$slots, "header:actions", { text: e.actionsText }, () => [
|
|
278
|
+
s("span", Ve, p(e.actionsText), 1)
|
|
279
|
+
])
|
|
280
|
+
], 2)) : k("", !0)
|
|
281
|
+
])
|
|
282
|
+
])
|
|
104
283
|
]),
|
|
105
|
-
"
|
|
106
|
-
|
|
284
|
+
s("tbody", null, [
|
|
285
|
+
O.value ? f(e.$slots, "loading", {
|
|
286
|
+
key: 0,
|
|
287
|
+
items: u(E)
|
|
288
|
+
}, () => [
|
|
289
|
+
s("tr", $e, [
|
|
290
|
+
s("td", {
|
|
291
|
+
class: "bb-table-loading__cell",
|
|
292
|
+
colspan: H.value
|
|
293
|
+
}, [
|
|
294
|
+
s("span", Be, p(u(U)), 1),
|
|
295
|
+
s("div", Ne, [
|
|
296
|
+
(n(!0), d(w, null, T(se.value, (l) => (n(), d("div", {
|
|
297
|
+
key: l,
|
|
298
|
+
class: "bb-table-skeleton-item"
|
|
299
|
+
}, Le))), 128))
|
|
300
|
+
])
|
|
301
|
+
], 8, Ae)
|
|
302
|
+
])
|
|
303
|
+
]) : u($).length ? f(e.$slots, "tbody", { key: 2 }, () => [
|
|
304
|
+
(n(!0), d(w, null, T(C.value, (l) => (n(), d("tr", {
|
|
305
|
+
key: l.valueHash,
|
|
306
|
+
class: "bb-table-data__row",
|
|
307
|
+
onClick: l.onRowClick,
|
|
308
|
+
onContextmenu: l.onRowContextMenu,
|
|
309
|
+
onDblclick: l.onRowDblClick
|
|
310
|
+
}, [
|
|
311
|
+
e.selectable ? (n(), d("td", {
|
|
312
|
+
key: 0,
|
|
313
|
+
class: r(["bb-table-data__cell bb-table-data__cell--select", e.tdClass])
|
|
314
|
+
}, [
|
|
315
|
+
f(e.$slots, "select", {
|
|
316
|
+
checked: !!l.selected,
|
|
317
|
+
disabled: !!l.disabled,
|
|
318
|
+
inputName: u(D),
|
|
319
|
+
item: l.item,
|
|
320
|
+
readonly: !!e.readonly,
|
|
321
|
+
value: l.value
|
|
322
|
+
}, () => [
|
|
323
|
+
e.multiple ? (n(), d("label", {
|
|
324
|
+
key: 0,
|
|
325
|
+
class: r(["bb-table-check__label", {
|
|
326
|
+
"bb-table-check__label--disabled": l.disabled
|
|
327
|
+
}])
|
|
328
|
+
}, [
|
|
329
|
+
I(J, {
|
|
330
|
+
checked: l.selected || F.value,
|
|
331
|
+
class: "bb-table-check",
|
|
332
|
+
disabled: l.disabled,
|
|
333
|
+
name: u(D),
|
|
334
|
+
readonly: e.readonly,
|
|
335
|
+
onChange: () => j(l)
|
|
336
|
+
}, null, 8, ["checked", "disabled", "name", "readonly", "onChange"]),
|
|
337
|
+
s("span", He, p(l.accessibleLabel), 1)
|
|
338
|
+
], 2)) : (n(), d("label", {
|
|
339
|
+
key: 1,
|
|
340
|
+
class: r(["bb-table-radio__label", {
|
|
341
|
+
"bb-table-radio__label--disabled": l.disabled
|
|
342
|
+
}])
|
|
343
|
+
}, [
|
|
344
|
+
I(ye, {
|
|
345
|
+
checked: l.selected,
|
|
346
|
+
class: "bb-table-radio",
|
|
347
|
+
disabled: l.disabled,
|
|
348
|
+
name: u(D),
|
|
349
|
+
readonly: e.readonly,
|
|
350
|
+
value: l.value,
|
|
351
|
+
onChange: () => j(l)
|
|
352
|
+
}, null, 8, ["checked", "disabled", "name", "readonly", "value", "onChange"]),
|
|
353
|
+
s("span", qe, p(l.accessibleLabel), 1)
|
|
354
|
+
], 2))
|
|
355
|
+
])
|
|
356
|
+
], 2)) : k("", !0),
|
|
357
|
+
(n(!0), d(w, null, T(l.cols, (c) => (n(), d("td", {
|
|
358
|
+
key: c.key,
|
|
359
|
+
class: r(["bb-table-data__cell", c.classes])
|
|
360
|
+
}, [
|
|
361
|
+
f(e.$slots, c.slotName, {
|
|
362
|
+
classes: c.classes,
|
|
363
|
+
content: c.content,
|
|
364
|
+
item: l.item,
|
|
365
|
+
value: l.value
|
|
366
|
+
}, () => [
|
|
367
|
+
be(p(c.content), 1)
|
|
368
|
+
])
|
|
369
|
+
], 2))), 128)),
|
|
370
|
+
e.actions ? (n(), d("td", {
|
|
371
|
+
key: 1,
|
|
372
|
+
class: r(["bb-table__cell bb-table__cell--actions", e.tdClass])
|
|
373
|
+
}, [
|
|
374
|
+
f(e.$slots, "actions", {
|
|
375
|
+
item: l.item,
|
|
376
|
+
value: l.value
|
|
377
|
+
})
|
|
378
|
+
], 2)) : k("", !0)
|
|
379
|
+
], 40, Oe))), 128))
|
|
380
|
+
]) : f(e.$slots, "no-data", { key: 1 }, () => [
|
|
381
|
+
s("tr", Re, [
|
|
382
|
+
s("td", {
|
|
383
|
+
class: "bb-table-no-data__cell",
|
|
384
|
+
colspan: H.value
|
|
385
|
+
}, [
|
|
386
|
+
s("span", ze, p(u(W)), 1)
|
|
387
|
+
], 8, Ie)
|
|
388
|
+
])
|
|
389
|
+
])
|
|
107
390
|
]),
|
|
108
|
-
|
|
109
|
-
|
|
391
|
+
s("tfoot", null, [
|
|
392
|
+
f(e.$slots, "tfoot")
|
|
393
|
+
])
|
|
394
|
+
]),
|
|
395
|
+
(n(!0), d(w, null, T(ae.value, (l) => (n(), d("input", re({
|
|
396
|
+
key: l.value,
|
|
397
|
+
ref_for: !0
|
|
398
|
+
}, l), null, 16))), 128))
|
|
110
399
|
]),
|
|
111
400
|
_: 3
|
|
112
|
-
}, 8, ["
|
|
401
|
+
}, 8, ["class"]));
|
|
113
402
|
}
|
|
114
403
|
});
|
|
115
404
|
export {
|
|
116
|
-
|
|
405
|
+
Xe as default
|
|
117
406
|
};
|
|
118
407
|
//# sourceMappingURL=index107.js.map
|