bitboss-ui 2.0.4 → 2.0.7
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 +138 -137
- package/dist/index.js.map +1 -1
- package/dist/index10.js +74 -35
- package/dist/index10.js.map +1 -1
- package/dist/{index99.js → index100.js} +3 -3
- package/dist/index100.js.map +1 -0
- package/dist/{index101.js → index102.js} +3 -3
- package/dist/{index101.js.map → index102.js.map} +1 -1
- package/dist/{index103.js → index104.js} +8 -8
- package/dist/{index103.js.map → index104.js.map} +1 -1
- package/dist/{index105.js → index106.js} +10 -10
- package/dist/{index105.js.map → index106.js.map} +1 -1
- package/dist/{index107.js → index108.js} +3 -3
- package/dist/{index107.js.map → index108.js.map} +1 -1
- package/dist/index11.js +36 -189
- package/dist/index11.js.map +1 -1
- package/dist/{index109.js → index110.js} +3 -3
- package/dist/{index109.js.map → index110.js.map} +1 -1
- package/dist/{index111.js → index112.js} +3 -3
- package/dist/{index111.js.map → index112.js.map} +1 -1
- package/dist/{index113.js → index114.js} +3 -3
- package/dist/{index113.js.map → index114.js.map} +1 -1
- package/dist/{index115.js → index116.js} +8 -8
- package/dist/{index115.js.map → index116.js.map} +1 -1
- package/dist/{index117.js → index118.js} +2 -2
- package/dist/{index117.js.map → index118.js.map} +1 -1
- package/dist/index12.js +189 -78
- package/dist/index12.js.map +1 -1
- package/dist/index120.js +34 -38
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +38 -38
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +39 -42
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +43 -31
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +35 -2
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +2 -21
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +21 -2
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +2 -312
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +309 -21
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +24 -2
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +85 -0
- package/dist/index13.js.map +1 -0
- package/dist/index130.js +2 -5
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +5 -9
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +8 -5
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +6 -3
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +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/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/{index14.js → index15.js} +4 -4
- package/dist/{index14.js.map → index15.js.map} +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/{index161.js → index160.js} +1 -1
- package/dist/index160.js.map +1 -0
- package/dist/index162.js +6 -0
- package/dist/index162.js.map +1 -0
- package/dist/index164.js +1 -1
- 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/{index16.js → index17.js} +4 -4
- package/dist/{index16.js.map → index17.js.map} +1 -1
- package/dist/index170.js +6 -0
- package/dist/index170.js.map +1 -0
- package/dist/index172.js +2 -3
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +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/index180.js +1 -1
- package/dist/index181.js +1 -1
- package/dist/index182.js +1 -1
- package/dist/index183.js +2 -2
- package/dist/{index185.js → index184.js} +1 -1
- package/dist/index184.js.map +1 -0
- package/dist/index186.js +6 -0
- package/dist/index186.js.map +1 -0
- package/dist/index188.js +1 -1
- package/dist/index189.js +1 -1
- package/dist/{index18.js → index19.js} +76 -74
- package/dist/index19.js.map +1 -0
- 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 -2
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +77 -154
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +2 -84
- package/dist/index199.js.map +1 -1
- package/dist/index200.js +5 -0
- package/dist/index200.js.map +1 -0
- package/dist/index201.js +4 -2
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +2 -4
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +8 -2
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +117 -72
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +5 -126
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +123 -5
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +17 -121
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +15 -18
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +10 -10
- package/dist/index209.js.map +1 -1
- package/dist/{index20.js → index21.js} +26 -27
- package/dist/index21.js.map +1 -0
- package/dist/index210.js +2 -16
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +2 -2
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +35 -2
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +172 -33
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +6 -174
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +42 -5
- package/dist/index215.js.map +1 -1
- package/dist/index217.js +16 -0
- package/dist/index217.js.map +1 -0
- package/dist/index218.js +4 -12
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +369 -5
- package/dist/index219.js.map +1 -1
- package/dist/index220.js +17 -367
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +27 -8
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +3 -3
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +249 -7
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +51 -18
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +44 -27
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +5 -3
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +43 -243
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +6 -0
- package/dist/{index233.js.map → index228.js.map} +1 -1
- package/dist/index229.js +3 -52
- package/dist/index229.js.map +1 -1
- package/dist/{index22.js → index23.js} +74 -76
- package/dist/index23.js.map +1 -0
- package/dist/index230.js +7 -37
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +158 -5
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +77 -34
- package/dist/index232.js.map +1 -1
- package/dist/index234.js +2 -2
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +18 -3
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +105 -17
- package/dist/index236.js.map +1 -1
- package/dist/{index239.js → index238.js} +3 -3
- package/dist/{index239.js.map → index238.js.map} +1 -1
- package/dist/index240.js +5 -0
- package/dist/index240.js.map +1 -0
- package/dist/index244.js +3 -3
- package/dist/index248.js +9 -3
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +281 -12
- package/dist/index249.js.map +1 -1
- package/dist/{index24.js → index25.js} +6 -6
- package/dist/{index24.js.map → index25.js.map} +1 -1
- package/dist/index250.js +5 -8
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +2 -9
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +2 -17
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +2 -281
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +2 -6
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +2 -2
- package/dist/index256.js +126 -2
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +431 -2
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +3 -2
- package/dist/index258.js.map +1 -1
- package/dist/index260.js +7 -126
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +20 -429
- package/dist/index261.js.map +1 -1
- package/dist/{index259.js → index263.js} +1 -1
- package/dist/index263.js.map +1 -0
- package/dist/index264.js +2 -7
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +1 -21
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +5 -0
- package/dist/index266.js.map +1 -0
- package/dist/index267.js +2 -9
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +2 -200
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +23 -431
- package/dist/index269.js.map +1 -1
- package/dist/{index26.js → index27.js} +4 -4
- package/dist/{index26.js.map → index27.js.map} +1 -1
- package/dist/index270.js +21 -126
- package/dist/index270.js.map +1 -1
- package/dist/index272.js +224 -2
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +89 -2
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +200 -3
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +436 -2
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +127 -2
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +5 -2
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +2 -28
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +7 -20
- package/dist/index279.js.map +1 -1
- package/dist/index280.js +72 -0
- package/dist/index280.js.map +1 -0
- package/dist/index281.js +3 -2
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +12 -5
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +8 -68
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +17 -224
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +1 -1
- package/dist/index286.js +1 -1
- package/dist/index287.js +12 -12
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +18 -0
- package/dist/index288.js.map +1 -0
- package/dist/index289.js +4 -15
- package/dist/index289.js.map +1 -1
- package/dist/{index28.js → index29.js} +19 -19
- package/dist/index29.js.map +1 -0
- package/dist/index290.js +4 -4
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +59 -4
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +34 -58
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +6 -10
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +18 -34
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +6 -6
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +2 -19
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +10 -6
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +47 -2
- package/dist/index298.js.map +1 -1
- package/dist/index300.js +424 -0
- package/dist/index300.js.map +1 -0
- package/dist/index301.js +42 -416
- package/dist/index301.js.map +1 -1
- package/dist/{index30.js → index31.js} +4 -4
- package/dist/{index30.js.map → index31.js.map} +1 -1
- package/dist/{index32.js → index33.js} +41 -40
- package/dist/index33.js.map +1 -0
- package/dist/{index34.js → index35.js} +23 -22
- package/dist/{index34.js.map → index35.js.map} +1 -1
- package/dist/{index36.js → index37.js} +9 -8
- package/dist/index37.js.map +1 -0
- package/dist/{index38.js → index39.js} +4 -3
- package/dist/index39.js.map +1 -0
- package/dist/index4.js +14 -40
- package/dist/index4.js.map +1 -1
- package/dist/{index40.js → index41.js} +4 -4
- package/dist/{index40.js.map → index41.js.map} +1 -1
- package/dist/{index42.js → index43.js} +34 -33
- package/dist/{index42.js.map → index43.js.map} +1 -1
- package/dist/{index44.js → index45.js} +9 -9
- package/dist/index45.js.map +1 -0
- package/dist/{index46.js → index47.js} +3 -3
- package/dist/{index46.js.map → index47.js.map} +1 -1
- package/dist/{index48.js → index49.js} +4 -4
- package/dist/{index48.js.map → index49.js.map} +1 -1
- package/dist/index5.js +38 -76
- package/dist/index5.js.map +1 -1
- package/dist/index51.js +95 -0
- package/dist/index51.js.map +1 -0
- package/dist/{index52.js → index53.js} +3 -3
- package/dist/{index52.js.map → index53.js.map} +1 -1
- package/dist/{index54.js → index55.js} +3 -3
- package/dist/{index54.js.map → index55.js.map} +1 -1
- package/dist/{index56.js → index57.js} +2 -2
- package/dist/{index56.js.map → index57.js.map} +1 -1
- package/dist/{index58.js → index59.js} +7 -6
- package/dist/{index58.js.map → index59.js.map} +1 -1
- package/dist/index6.js +78 -62
- package/dist/index6.js.map +1 -1
- package/dist/{index60.js → index61.js} +3 -3
- package/dist/{index60.js.map → index61.js.map} +1 -1
- package/dist/{index62.js → index63.js} +3 -3
- package/dist/{index62.js.map → index63.js.map} +1 -1
- package/dist/{index64.js → index65.js} +5 -5
- package/dist/{index64.js.map → index65.js.map} +1 -1
- package/dist/{index66.js → index67.js} +3 -3
- package/dist/{index66.js.map → index67.js.map} +1 -1
- package/dist/{index68.js → index69.js} +2 -2
- package/dist/{index68.js.map → index69.js.map} +1 -1
- package/dist/index7.js +60 -18
- package/dist/index7.js.map +1 -1
- package/dist/{index70.js → index71.js} +7 -7
- package/dist/{index70.js.map → index71.js.map} +1 -1
- package/dist/{index72.js → index73.js} +3 -3
- package/dist/{index72.js.map → index73.js.map} +1 -1
- package/dist/{index74.js → index75.js} +3 -3
- package/dist/{index74.js.map → index75.js.map} +1 -1
- package/dist/index77.js +37 -120
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +130 -0
- package/dist/index78.js.map +1 -0
- package/dist/index8.js +19 -7
- package/dist/index8.js.map +1 -1
- package/dist/{index79.js → index80.js} +5 -5
- package/dist/{index79.js.map → index80.js.map} +1 -1
- package/dist/{index81.js → index82.js} +7 -6
- package/dist/{index81.js.map → index82.js.map} +1 -1
- package/dist/{index83.js → index84.js} +7 -7
- package/dist/{index83.js.map → index84.js.map} +1 -1
- package/dist/{index85.js → index86.js} +3 -3
- package/dist/{index85.js.map → index86.js.map} +1 -1
- package/dist/{index87.js → index88.js} +3 -3
- package/dist/{index87.js.map → index88.js.map} +1 -1
- package/dist/index9.js +7 -78
- package/dist/index9.js.map +1 -1
- package/dist/{index89.js → index90.js} +3 -3
- package/dist/{index89.js.map → index90.js.map} +1 -1
- package/dist/{index91.js → index92.js} +3 -3
- package/dist/{index91.js.map → index92.js.map} +1 -1
- package/dist/{index93.js → index94.js} +1 -1
- package/dist/index94.js.map +1 -0
- package/dist/{index95.js → index96.js} +3 -3
- package/dist/{index95.js.map → index96.js.map} +1 -1
- package/dist/{index97.js → index98.js} +3 -3
- package/dist/{index97.js.map → index98.js.map} +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/index119.js +0 -47
- package/dist/index119.js.map +0 -1
- package/dist/index161.js.map +0 -1
- package/dist/index163.js +0 -6
- package/dist/index163.js.map +0 -1
- package/dist/index171.js +0 -5
- package/dist/index171.js.map +0 -1
- package/dist/index18.js.map +0 -1
- package/dist/index185.js.map +0 -1
- package/dist/index187.js +0 -6
- package/dist/index187.js.map +0 -1
- package/dist/index20.js.map +0 -1
- package/dist/index216.js +0 -45
- package/dist/index216.js.map +0 -1
- package/dist/index22.js.map +0 -1
- package/dist/index233.js +0 -6
- package/dist/index237.js +0 -109
- package/dist/index237.js.map +0 -1
- package/dist/index259.js.map +0 -1
- package/dist/index262.js +0 -6
- package/dist/index262.js.map +0 -1
- package/dist/index271.js +0 -92
- package/dist/index271.js.map +0 -1
- package/dist/index28.js.map +0 -1
- package/dist/index299.js +0 -50
- package/dist/index299.js.map +0 -1
- package/dist/index3.js +0 -17
- package/dist/index3.js.map +0 -1
- package/dist/index302.js +0 -50
- package/dist/index302.js.map +0 -1
- package/dist/index32.js.map +0 -1
- package/dist/index36.js.map +0 -1
- package/dist/index38.js.map +0 -1
- package/dist/index44.js.map +0 -1
- package/dist/index50.js +0 -97
- package/dist/index50.js.map +0 -1
- package/dist/index76.js +0 -47
- package/dist/index76.js.map +0 -1
- package/dist/index93.js.map +0 -1
- package/dist/index99.js.map +0 -1
package/dist/index299.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { observeElementRect as f, observeElementOffset as s, elementScroll as d, Virtualizer as p } from "./index301.js";
|
|
2
|
-
import { defaultKeyExtractor as S, defaultRangeExtractor as V, measureElement as b } from "./index301.js";
|
|
3
|
-
import { computed as g, unref as l, shallowRef as E, watch as o, triggerRef as i, onScopeDispose as v } from "vue";
|
|
4
|
-
function w(e) {
|
|
5
|
-
const t = new p(l(e)), a = E(t), u = t._didMount();
|
|
6
|
-
return o(
|
|
7
|
-
() => l(e).getScrollElement(),
|
|
8
|
-
(r) => {
|
|
9
|
-
r && t._willUpdate();
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
immediate: !0
|
|
13
|
-
}
|
|
14
|
-
), o(
|
|
15
|
-
() => l(e),
|
|
16
|
-
(r) => {
|
|
17
|
-
t.setOptions({
|
|
18
|
-
...r,
|
|
19
|
-
onChange: (c, m) => {
|
|
20
|
-
var n;
|
|
21
|
-
i(a), (n = r.onChange) == null || n.call(r, c, m);
|
|
22
|
-
}
|
|
23
|
-
}), t._willUpdate(), i(a);
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
immediate: !0
|
|
27
|
-
}
|
|
28
|
-
), v(u), a;
|
|
29
|
-
}
|
|
30
|
-
function z(e) {
|
|
31
|
-
return w(
|
|
32
|
-
g(() => ({
|
|
33
|
-
observeElementRect: f,
|
|
34
|
-
observeElementOffset: s,
|
|
35
|
-
scrollToFn: d,
|
|
36
|
-
...l(e)
|
|
37
|
-
}))
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
export {
|
|
41
|
-
p as Virtualizer,
|
|
42
|
-
S as defaultKeyExtractor,
|
|
43
|
-
V as defaultRangeExtractor,
|
|
44
|
-
d as elementScroll,
|
|
45
|
-
b as measureElement,
|
|
46
|
-
s as observeElementOffset,
|
|
47
|
-
f as observeElementRect,
|
|
48
|
-
z as useVirtualizer
|
|
49
|
-
};
|
|
50
|
-
//# sourceMappingURL=index299.js.map
|
package/dist/index299.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index299.js","sources":["../node_modules/@tanstack/vue-virtual/dist/esm/index.js"],"sourcesContent":["import { observeElementRect, observeElementOffset, elementScroll, observeWindowRect, observeWindowOffset, windowScroll, Virtualizer } from \"@tanstack/virtual-core\";\nexport * from \"@tanstack/virtual-core\";\nimport { computed, unref, shallowRef, watch, triggerRef, onScopeDispose } from \"vue\";\nfunction useVirtualizerBase(options) {\n const virtualizer = new Virtualizer(unref(options));\n const state = shallowRef(virtualizer);\n const cleanup = virtualizer._didMount();\n watch(\n () => unref(options).getScrollElement(),\n (el) => {\n if (el) {\n virtualizer._willUpdate();\n }\n },\n {\n immediate: true\n }\n );\n watch(\n () => unref(options),\n (options2) => {\n virtualizer.setOptions({\n ...options2,\n onChange: (instance, sync) => {\n var _a;\n triggerRef(state);\n (_a = options2.onChange) == null ? void 0 : _a.call(options2, instance, sync);\n }\n });\n virtualizer._willUpdate();\n triggerRef(state);\n },\n {\n immediate: true\n }\n );\n onScopeDispose(cleanup);\n return state;\n}\nfunction useVirtualizer(options) {\n return useVirtualizerBase(\n computed(() => ({\n observeElementRect,\n observeElementOffset,\n scrollToFn: elementScroll,\n ...unref(options)\n }))\n );\n}\nfunction useWindowVirtualizer(options) {\n return useVirtualizerBase(\n computed(() => ({\n getScrollElement: () => typeof document !== \"undefined\" ? window : null,\n observeElementRect: observeWindowRect,\n observeElementOffset: observeWindowOffset,\n scrollToFn: windowScroll,\n initialOffset: () => typeof document !== \"undefined\" ? window.scrollY : 0,\n ...unref(options)\n }))\n );\n}\nexport {\n useVirtualizer,\n useWindowVirtualizer\n};\n//# sourceMappingURL=index.js.map\n"],"names":["useVirtualizerBase","options","virtualizer","Virtualizer","unref","state","shallowRef","cleanup","watch","el","options2","instance","sync","_a","triggerRef","onScopeDispose","useVirtualizer","computed","observeElementRect","observeElementOffset","elementScroll"],"mappings":";;;AAGA,SAASA,EAAmBC,GAAS;AACnC,QAAMC,IAAc,IAAIC,EAAYC,EAAMH,CAAO,CAAC,GAC5CI,IAAQC,EAAWJ,CAAW,GAC9BK,IAAUL,EAAY;AAC5B,SAAAM;AAAA,IACE,MAAMJ,EAAMH,CAAO,EAAE,iBAAkB;AAAA,IACvC,CAACQ,MAAO;AACN,MAAIA,KACFP,EAAY,YAAW;AAAA,IAE1B;AAAA,IACD;AAAA,MACE,WAAW;AAAA,IACZ;AAAA,EACL,GACEM;AAAA,IACE,MAAMJ,EAAMH,CAAO;AAAA,IACnB,CAACS,MAAa;AACZ,MAAAR,EAAY,WAAW;AAAA,QACrB,GAAGQ;AAAA,QACH,UAAU,CAACC,GAAUC,MAAS;AAC5B,cAAIC;AACJ,UAAAC,EAAWT,CAAK,IACfQ,IAAKH,EAAS,aAAa,QAAgBG,EAAG,KAAKH,GAAUC,GAAUC,CAAI;AAAA,QAC7E;AAAA,MACT,CAAO,GACDV,EAAY,YAAW,GACvBY,EAAWT,CAAK;AAAA,IACjB;AAAA,IACD;AAAA,MACE,WAAW;AAAA,IACZ;AAAA,EACL,GACEU,EAAeR,CAAO,GACfF;AACT;AACA,SAASW,EAAef,GAAS;AAC/B,SAAOD;AAAA,IACLiB,EAAS,OAAO;AAAA,MACd,oBAAAC;AAAA,MACA,sBAAAC;AAAA,MACA,YAAYC;AAAA,MACZ,GAAGhB,EAAMH,CAAO;AAAA,IACtB,EAAM;AAAA,EACN;AACA;","x_google_ignoreList":[0]}
|
package/dist/index3.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { reactive as i } from "vue";
|
|
2
|
-
const c = i({
|
|
3
|
-
inertiaLinkName: "Link",
|
|
4
|
-
nuxtLinkName: "NuxtLink",
|
|
5
|
-
mobileMaxWidth: 768,
|
|
6
|
-
documentationURL: "https://ui-components-docs.vercel.app/it"
|
|
7
|
-
}), s = (t) => {
|
|
8
|
-
Object.keys(t).forEach((e) => {
|
|
9
|
-
const n = e, o = t[n];
|
|
10
|
-
c[n] = o;
|
|
11
|
-
});
|
|
12
|
-
}, r = () => ({ setConfig: s });
|
|
13
|
-
export {
|
|
14
|
-
c as _config,
|
|
15
|
-
r as useBbConfig
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=index3.js.map
|
package/dist/index3.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index3.js","sources":["../src/composables/useBbConfig.ts"],"sourcesContent":["import { reactive } from 'vue';\n\ntype Config = {\n\tinertiaLinkName: string;\n\tnuxtLinkName: string;\n\tmobileMaxWidth: number;\n};\n\nexport const _config = reactive<Config & Record<string, any>>({\n\tinertiaLinkName: 'Link',\n\tnuxtLinkName: 'NuxtLink',\n\tmobileMaxWidth: 768,\n\tdocumentationURL: 'https://ui-components-docs.vercel.app/it',\n});\n\nconst setConfig = (config: Partial<Config>) => {\n\tObject.keys(config).forEach((k) => {\n\t\tconst _k = k as keyof Config;\n\t\tconst value = config[_k]!;\n\t\t// @ts-expect-error this breaks in TS\n\t\t_config[_k] = value;\n\t});\n};\nexport const useBbConfig = () => {\n\treturn { setConfig };\n};\n"],"names":["_config","reactive","setConfig","config","k","_k","value","useBbConfig"],"mappings":";AAQO,MAAMA,IAAUC,EAAuC;AAAA,EAC7D,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,kBAAkB;AACnB,CAAC,GAEKC,IAAY,CAACC,MAA4B;AAC9C,SAAO,KAAKA,CAAM,EAAE,QAAQ,CAACC,MAAM;AAClC,UAAMC,IAAKD,GACLE,IAAQH,EAAOE,CAAE;AAEvB,IAAAL,EAAQK,CAAE,IAAIC;AAAA,EAAA,CACd;AACF,GACaC,IAAc,OACnB,EAAE,WAAAL,EAAU;"}
|
package/dist/index302.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
function D(n, l, e) {
|
|
2
|
-
let i = e.initialDeps ?? [], t;
|
|
3
|
-
return () => {
|
|
4
|
-
var r, c, h, m;
|
|
5
|
-
let f;
|
|
6
|
-
e.key && ((r = e.debug) != null && r.call(e)) && (f = Date.now());
|
|
7
|
-
const o = n();
|
|
8
|
-
if (!(o.length !== i.length || o.some((a, u) => i[u] !== a)))
|
|
9
|
-
return t;
|
|
10
|
-
i = o;
|
|
11
|
-
let g;
|
|
12
|
-
if (e.key && ((c = e.debug) != null && c.call(e)) && (g = Date.now()), t = l(...o), e.key && ((h = e.debug) != null && h.call(e))) {
|
|
13
|
-
const a = Math.round((Date.now() - f) * 100) / 100, u = Math.round((Date.now() - g) * 100) / 100, w = u / 16, s = (d, b) => {
|
|
14
|
-
for (d = String(d); d.length < b; )
|
|
15
|
-
d = " " + d;
|
|
16
|
-
return d;
|
|
17
|
-
};
|
|
18
|
-
console.info(
|
|
19
|
-
`%c⏱ ${s(u, 5)} /${s(a, 5)} ms`,
|
|
20
|
-
`
|
|
21
|
-
font-size: .6rem;
|
|
22
|
-
font-weight: bold;
|
|
23
|
-
color: hsl(${Math.max(
|
|
24
|
-
0,
|
|
25
|
-
Math.min(120 - 120 * w, 120)
|
|
26
|
-
)}deg 100% 31%);`,
|
|
27
|
-
e == null ? void 0 : e.key
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
return (m = e == null ? void 0 : e.onChange) == null || m.call(e, t), t;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
function T(n, l) {
|
|
34
|
-
if (n === void 0)
|
|
35
|
-
throw new Error("Unexpected undefined");
|
|
36
|
-
return n;
|
|
37
|
-
}
|
|
38
|
-
const y = (n, l) => Math.abs(n - l) < 1, M = (n, l, e) => {
|
|
39
|
-
let i;
|
|
40
|
-
return function(...t) {
|
|
41
|
-
n.clearTimeout(i), i = n.setTimeout(() => l.apply(this, t), e);
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
export {
|
|
45
|
-
y as approxEqual,
|
|
46
|
-
M as debounce,
|
|
47
|
-
D as memo,
|
|
48
|
-
T as notUndefined
|
|
49
|
-
};
|
|
50
|
-
//# sourceMappingURL=index302.js.map
|
package/dist/index302.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index302.js","sources":["../node_modules/@tanstack/virtual-core/dist/esm/utils.js"],"sourcesContent":["function memo(getDeps, fn, opts) {\n let deps = opts.initialDeps ?? [];\n let result;\n return () => {\n var _a, _b, _c, _d;\n let depTime;\n if (opts.key && ((_a = opts.debug) == null ? void 0 : _a.call(opts))) depTime = Date.now();\n const newDeps = getDeps();\n const depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep);\n if (!depsChanged) {\n return result;\n }\n deps = newDeps;\n let resultTime;\n if (opts.key && ((_b = opts.debug) == null ? void 0 : _b.call(opts))) resultTime = Date.now();\n result = fn(...newDeps);\n if (opts.key && ((_c = opts.debug) == null ? void 0 : _c.call(opts))) {\n const depEndTime = Math.round((Date.now() - depTime) * 100) / 100;\n const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100;\n const resultFpsPercentage = resultEndTime / 16;\n const pad = (str, num) => {\n str = String(str);\n while (str.length < num) {\n str = \" \" + str;\n }\n return str;\n };\n console.info(\n `%c⏱ ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`,\n `\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(\n 0,\n Math.min(120 - 120 * resultFpsPercentage, 120)\n )}deg 100% 31%);`,\n opts == null ? void 0 : opts.key\n );\n }\n (_d = opts == null ? void 0 : opts.onChange) == null ? void 0 : _d.call(opts, result);\n return result;\n };\n}\nfunction notUndefined(value, msg) {\n if (value === void 0) {\n throw new Error(`Unexpected undefined${msg ? `: ${msg}` : \"\"}`);\n } else {\n return value;\n }\n}\nconst approxEqual = (a, b) => Math.abs(a - b) < 1;\nconst debounce = (targetWindow, fn, ms) => {\n let timeoutId;\n return function(...args) {\n targetWindow.clearTimeout(timeoutId);\n timeoutId = targetWindow.setTimeout(() => fn.apply(this, args), ms);\n };\n};\nexport {\n approxEqual,\n debounce,\n memo,\n notUndefined\n};\n//# sourceMappingURL=utils.js.map\n"],"names":["memo","getDeps","fn","opts","deps","result","_a","_b","_c","_d","depTime","newDeps","dep","index","resultTime","depEndTime","resultEndTime","resultFpsPercentage","pad","str","num","notUndefined","value","msg","approxEqual","a","b","debounce","targetWindow","ms","timeoutId","args"],"mappings":"AAAA,SAASA,EAAKC,GAASC,GAAIC,GAAM;AAC/B,MAAIC,IAAOD,EAAK,eAAe,IAC3BE;AACJ,SAAO,MAAM;AACX,QAAIC,GAAIC,GAAIC,GAAIC;AAChB,QAAIC;AACJ,IAAIP,EAAK,SAASG,IAAKH,EAAK,UAAU,QAAgBG,EAAG,KAAKH,CAAI,OAAIO,IAAU,KAAK;AACrF,UAAMC,IAAUV;AAEhB,QAAI,EADgBU,EAAQ,WAAWP,EAAK,UAAUO,EAAQ,KAAK,CAACC,GAAKC,MAAUT,EAAKS,CAAK,MAAMD,CAAG;AAEpG,aAAOP;AAET,IAAAD,IAAOO;AACP,QAAIG;AAGJ,QAFIX,EAAK,SAASI,IAAKJ,EAAK,UAAU,QAAgBI,EAAG,KAAKJ,CAAI,OAAIW,IAAa,KAAK,QACxFT,IAASH,EAAG,GAAGS,CAAO,GAClBR,EAAK,SAASK,IAAKL,EAAK,UAAU,QAAgBK,EAAG,KAAKL,CAAI,IAAI;AACpE,YAAMY,IAAa,KAAK,OAAO,KAAK,IAAG,IAAKL,KAAW,GAAG,IAAI,KACxDM,IAAgB,KAAK,OAAO,KAAK,IAAG,IAAKF,KAAc,GAAG,IAAI,KAC9DG,IAAsBD,IAAgB,IACtCE,IAAM,CAACC,GAAKC,MAAQ;AAExB,aADAD,IAAM,OAAOA,CAAG,GACTA,EAAI,SAASC;AAClB,UAAAD,IAAM,MAAMA;AAEd,eAAOA;AAAA,MACf;AACM,cAAQ;AAAA,QACN,OAAOD,EAAIF,GAAe,CAAC,CAAC,KAAKE,EAAIH,GAAY,CAAC,CAAC;AAAA,QACnD;AAAA;AAAA;AAAA,yBAGiB,KAAK;AAAA,UACpB;AAAA,UACA,KAAK,IAAI,MAAM,MAAME,GAAqB,GAAG;AAAA,QAC9C,CAAA;AAAA,QACDd,KAAQ,OAAO,SAASA,EAAK;AAAA,MACrC;AAAA,IACK;AACD,YAACM,IAAKN,KAAQ,OAAO,SAASA,EAAK,aAAa,QAAgBM,EAAG,KAAKN,GAAME,CAAM,GAC7EA;AAAA,EACX;AACA;AACA,SAASgB,EAAaC,GAAOC,GAAK;AAChC,MAAID,MAAU;AACZ,UAAM,IAAI,MAAM,sBAA8C;AAE9D,SAAOA;AAEX;AACK,MAACE,IAAc,CAACC,GAAGC,MAAM,KAAK,IAAID,IAAIC,CAAC,IAAI,GAC1CC,IAAW,CAACC,GAAc1B,GAAI2B,MAAO;AACzC,MAAIC;AACJ,SAAO,YAAYC,GAAM;AACvB,IAAAH,EAAa,aAAaE,CAAS,GACnCA,IAAYF,EAAa,WAAW,MAAM1B,EAAG,MAAM,MAAM6B,CAAI,GAAGF,CAAE;AAAA,EACtE;AACA;","x_google_ignoreList":[0]}
|
package/dist/index32.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index32.js","sources":["../src/components/BaseRating/BaseRating.vue"],"sourcesContent":["<template>\n\t<span v-bind=\"outerContainerAttributes\" ref=\"container\">\n\t\t<span class=\"bb-base-rating__inner-container\">\n\t\t\t<slot name=\"prepend\"></slot>\n\t\t\t<label\n\t\t\t\tv-for=\"(option, index) in options\"\n\t\t\t\t:key=\"option.value\"\n\t\t\t\tclass=\"bb-base-rating__option\"\n\t\t\t\t:class=\"{ 'bb-base-rating__option--highlighted': option.highlighted }\"\n\t\t\t>\n\t\t\t\t<span class=\"bb-base-rating__label-text\">{{ option.value }}</span>\n\t\t\t\t<input\n\t\t\t\t\t:id=\"option.id\"\n\t\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t\t:autofocus=\"autofocus && !index\"\n\t\t\t\t\t:checked=\"option.checked\"\n\t\t\t\t\t:disabled=\"option.disabled\"\n\t\t\t\t\t:name=\"option.name\"\n\t\t\t\t\t:required=\"required\"\n\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t:value=\"option.value\"\n\t\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t\t/>\n\t\t\t\t<slot\n\t\t\t\t\t:id=\"option.id\"\n\t\t\t\t\t:checked=\"option.checked\"\n\t\t\t\t\t:disabled=\"option.disabled\"\n\t\t\t\t\tname=\"icon\"\n\t\t\t\t\t:size=\"option.size\"\n\t\t\t\t\t:value=\"option.value\"\n\t\t\t\t>\n\t\t\t\t\t<svg\n\t\t\t\t\t\t:height=\"option.size\"\n\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t:width=\"option.size\"\n\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<path\n\t\t\t\t\t\t\td=\"m8.243 7.34l-6.38.925l-.113.023a1 1 0 0 0-.44 1.684l4.622 4.499l-1.09 6.355l-.013.11a1 1 0 0 0 1.464.944l5.706-3l5.693 3l.1.046a1 1 0 0 0 1.352-1.1l-1.091-6.355l4.624-4.5l.078-.085a1 1 0 0 0-.633-1.62l-6.38-.926l-2.852-5.78a1 1 0 0 0-1.794 0L8.243 7.34z\"\n\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</svg>\n\t\t\t\t</slot>\n\t\t\t</label>\n\t\t\t<slot name=\"append\"></slot>\n\t\t</span>\n\t</span>\n</template>\n\n<script setup lang=\"ts\">\nimport { booleanishToBoolean } from '@/utilities/functions/booleanishToBoolean';\nimport { computed, ref } from 'vue';\nimport { identity } from '@/utilities/functions/identity';\nimport { isCssColor } from '@/utilities/functions/isCssColor';\nimport { isNotNil } from '@/utilities/functions/isNotNil';\nimport type { InputHTMLAttributes, HTMLAttributes } from 'vue';\nimport type { Size, BbIconProps } from '../BbIcon/BbIcon.vue';\n\nexport type BaseRatingProps = {\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tariaDescribedby?: InputHTMLAttributes['aria-describedby'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Define a color for the component.\n\t *\n\t * Either a custom color or a coded color in common HEX, RGB, etc... format.\n\t */\n\tcolor?: string;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\t/**\n\t * Used by v-model\n\t */\n\tmodelValue: null | number;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname: Exclude<InputHTMLAttributes['name'], undefined>;\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n\n\t/**\n\t * Sets the input as required.\n\t */\n\trequired?: boolean;\n\n\t/**\n\t * Maximum number of stars to render and maximum value of the component\n\t */\n\tstars?: number;\n} & Pick<BbIconProps, 'size'>;\n\ntype Option = {\n\tchecked: boolean;\n\tdisabled: boolean;\n\thighlighted: boolean;\n\tid?: string;\n\tname: string;\n\tsize: number | undefined;\n\tvalue: number;\n};\n\nconst props = withDefaults(defineProps<BaseRatingProps>(), {\n\tstars: 5,\n});\n\nexport type BaseRatingEvents = {\n\t(e: 'blur', event: FocusEvent): void;\n\t(e: 'change', event: Event): void;\n\t(e: 'click', event: MouseEvent): void;\n\t(e: 'focus', event: FocusEvent): void;\n\t(e: 'inactive'): void;\n\t(e: 'input', event: Event): void;\n\t(e: 'keydown', event: KeyboardEvent): void;\n\t(e: 'mousedown', event: MouseEvent): void;\n\t(e: 'mouseup', event: MouseEvent): void;\n\t(e: 'update:modelValue', value: number | null): void;\n};\n\nexport type BaseRatingSlots = {\n\ticon?: (props: {\n\t\tchecked: boolean;\n\t\tdisabled: boolean;\n\t\tid?: string;\n\t\tsize: number | undefined;\n\t\tvalue: number;\n\t}) => any;\n\tprepend?: (props: object) => any;\n\tappend?: (props: object) => any;\n};\n\ndefineSlots<BaseRatingSlots>();\n\nconst emit = defineEmits<BaseRatingEvents>();\n\nconst container = ref<HTMLElement>();\nconst active = ref(false);\n\nconst onInputChange = (event: Event) => {\n\temit('change', event);\n\tif (event.target instanceof HTMLInputElement) {\n\t\tif (event.target.checked) {\n\t\t\temit('update:modelValue', +event.target.value);\n\t\t}\n\t}\n};\n\nconst onInputClick = (event: MouseEvent) => {\n\temit('click', event);\n\tif (event.target instanceof HTMLInputElement) {\n\t\tif (event.target.checked) {\n\t\t\tif (+event.target.value === props.modelValue) {\n\t\t\t\temit('update:modelValue', null);\n\t\t\t}\n\t\t}\n\t}\n};\n\nconst onInputFocus = (event: FocusEvent) => {\n\temit('focus', event);\n\tif (!active.value) {\n\t\tdocument.addEventListener('focusin', onDocumentFocus, { passive: true });\n\t\tdocument.addEventListener('click', onDocumentClick, { passive: true });\n\t\tactive.value = true;\n\t}\n};\n\nconst eventListeners = {\n\tonBlur: (event: FocusEvent) => emit('blur', event),\n\tonChange: onInputChange,\n\tonClick: onInputClick,\n\tonFocus: onInputFocus,\n\tonInput: (event: Event) => emit('input', event),\n\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n};\n\nconst onDocumentFocus = (event: FocusEvent) => {\n\tif (event.target instanceof HTMLElement) {\n\t\tif (!container.value?.contains(event.target)) {\n\t\t\temit('inactive');\n\t\t\tactive.value = false;\n\t\t\tdocument.removeEventListener('focusin', onDocumentFocus);\n\t\t\tdocument.removeEventListener('click', onDocumentClick);\n\t\t}\n\t}\n};\n\nconst onDocumentClick = (event: MouseEvent) => {\n\tif (event.target instanceof HTMLElement) {\n\t\tif (!container.value?.contains(event.target)) {\n\t\t\temit('inactive');\n\t\t\tactive.value = false;\n\t\t\tdocument.removeEventListener('focusin', onDocumentFocus);\n\t\t\tdocument.removeEventListener('click', onDocumentClick);\n\t\t}\n\t}\n};\n\nconst sizeMap: Size = {\n\txs: 12,\n\tsm: 16,\n\tmd: 24,\n\tlg: 28,\n\txl: 36,\n\txxl: 40,\n};\n\nconst size = computed(() => {\n\tlet dimension: number | undefined;\n\tif (typeof props.size === 'string') {\n\t\tdimension = sizeMap[props.size as keyof Size] ?? parseInt(props.size, 10);\n\t} else {\n\t\tdimension = props.size;\n\t}\n\treturn dimension;\n});\n\nconst options = computed(() => {\n\treturn new Array(props.stars)\n\t\t.fill(0)\n\t\t.map((_, index) => index + 1)\n\t\t.map((number): Option => {\n\t\t\tconst id = props.id\n\t\t\t\t? [props.id, number].filter(identity).join('_')\n\t\t\t\t: undefined;\n\n\t\t\tconst checked = number === props.modelValue;\n\t\t\tconst highlighted = !!(props.modelValue && number <= props.modelValue);\n\n\t\t\tconst disabled = !!(\n\t\t\t\tprops.disabled ||\n\t\t\t\t(isNotNil(props.readonly) ? booleanishToBoolean(props.readonly) : false)\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tchecked,\n\t\t\t\tdisabled,\n\t\t\t\thighlighted,\n\t\t\t\tid,\n\t\t\t\tname: props.name,\n\t\t\t\tsize: size.value,\n\t\t\t\tvalue: number,\n\t\t\t};\n\t\t});\n});\n\nconst outerContainerAttributes = computed(() => {\n\tlet style: { [key: string]: string } = {};\n\tif (props.color && isCssColor(props.color)) {\n\t\tstyle['--color'] = props.color;\n\t}\n\tif (size.value) {\n\t\tstyle['--size'] = `${size.value}px`;\n\t}\n\treturn {\n\t\tclass: {\n\t\t\t'bb-base-rating': true,\n\t\t\t'bb-base-rating--has-value': props.modelValue,\n\t\t\t'bb-base-rating--disabled': props.disabled,\n\t\t\t'bb-base-rating--errors': props.hasErrors,\n\t\t\t'bb-base-rating--readonly': props.readonly,\n\t\t\t[`bb-base-rating--${props.color}`]:\n\t\t\t\tprops.color && !isCssColor(props.color),\n\t\t},\n\t\tstyle,\n\t};\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BaseRating';\n</style>\n"],"names":["props","__props","emit","__emit","container","ref","active","eventListeners","event","onDocumentFocus","onDocumentClick","_a","sizeMap","size","computed","dimension","options","_","index","number","id","identity","checked","highlighted","disabled","isNotNil","booleanishToBoolean","outerContainerAttributes","style","isCssColor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgIA,UAAMA,IAAQC,GA+BRC,IAAOC,GAEPC,IAAYC,KACZC,IAASD,EAAI,EAAK,GA+BlBE,IAAiB;AAAA,MACtB,QAAQ,CAACC,MAAsBN,EAAK,QAAQM,CAAK;AAAA,MACjD,UA/BqB,CAACA,MAAiB;AACvC,QAAAN,EAAK,UAAUM,CAAK,GAChBA,EAAM,kBAAkB,oBACvBA,EAAM,OAAO,WAChBN,EAAK,qBAAqB,CAACM,EAAM,OAAO,KAAK;AAAA,MAE/C;AAAA,MA0BA,SAvBoB,CAACA,MAAsB;AAC3C,QAAAN,EAAK,SAASM,CAAK,GACfA,EAAM,kBAAkB,oBACvBA,EAAM,OAAO,WACZ,CAACA,EAAM,OAAO,UAAUR,EAAM,cACjCE,EAAK,qBAAqB,IAAI;AAAA,MAGjC;AAAA,MAgBA,SAboB,CAACM,MAAsB;AAC3C,QAAAN,EAAK,SAASM,CAAK,GACdF,EAAO,UACX,SAAS,iBAAiB,WAAWG,GAAiB,EAAE,SAAS,IAAM,GACvE,SAAS,iBAAiB,SAASC,GAAiB,EAAE,SAAS,IAAM,GACrEJ,EAAO,QAAQ;AA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E,KAAK,GAAG,IAC5C,QAEGC,IAAUH,MAAWnB,EAAM,YAC3BuB,IAAc,CAAC,EAAEvB,EAAM,cAAcmB,KAAUnB,EAAM,aAErDwB,IAAW,CAAC,EACjBxB,EAAM,YACLyB,EAASzB,EAAM,QAAQ,KAAI0B,EAAoB1B,EAAM,QAAQ;AAGxD,aAAA;AAAA,QACN,SAAAsB;AAAA,QACA,UAAAE;AAAA,QACA,aAAAD;AAAA,QACA,IAAAH;AAAA,QACA,MAAMpB,EAAM;AAAA,QACZ,MAAMa,EAAK;AAAA,QACX,OAAOM;AAAA,MAAA;AAAA,IACR,CACA,CACF,GAEKQ,IAA2Bb,EAAS,MAAM;AAC/C,UAAIc,IAAmC,CAAA;AACvC,aAAI5B,EAAM,SAAS6B,EAAW7B,EAAM,KAAK,MAClC4B,EAAA,SAAS,IAAI5B,EAAM,QAEtBa,EAAK,UACRe,EAAM,QAAQ,IAAI,GAAGf,EAAK,KAAK,OAEzB;AAAA,QACN,OAAO;AAAA,UACN,kBAAkB;AAAA,UAClB,6BAA6Bb,EAAM;AAAA,UACnC,4BAA4BA,EAAM;AAAA,UAClC,0BAA0BA,EAAM;AAAA,UAChC,4BAA4BA,EAAM;AAAA,UAClC,CAAC,mBAAmBA,EAAM,KAAK,EAAE,GAChCA,EAAM,SAAS,CAAC6B,EAAW7B,EAAM,KAAK;AAAA,QACxC;AAAA,QACA,OAAA4B;AAAA,MAAA;AAAA,IACD,CACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index36.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index36.js","sources":["../src/components/BaseSlider/BaseSlider.vue"],"sourcesContent":["<template>\n\t<span v-bind=\"containerAttributes\" ref=\"container\">\n\t\t<slot name=\"prepend\"></slot>\n\t\t<span class=\"bb-base-slider__slider-container\">\n\t\t\t<span v-if=\"ticks.length\" class=\"bb-base-slider__ticks-container\">\n\t\t\t\t<span\n\t\t\t\t\tv-for=\"tick in ticks\"\n\t\t\t\t\t:key=\"tick.value\"\n\t\t\t\t\tclass=\"bb-base-slider__tick\"\n\t\t\t\t\t><slot\n\t\t\t\t\t\t:active=\"tick.active\"\n\t\t\t\t\t\tname=\"tick\"\n\t\t\t\t\t\t:percent=\"tick.percent\"\n\t\t\t\t\t\t:value=\"tick.value\"\n\t\t\t\t/></span>\n\t\t\t</span>\n\t\t\t<input\n\t\t\t\t:id=\"id\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t:required=\"required\"\n\t\t\t\t:tabindex=\"-1\"\n\t\t\t\t:type=\"'number'\"\n\t\t\t\t:value=\"JSON.stringify(modelValue)\"\n\t\t\t/>\n\t\t\t<span ref=\"track\" class=\"bb-base-slider__track-container\">\n\t\t\t\t<span class=\"bb-base-slider__track-fill\"></span>\n\t\t\t\t<span v-bind=\"sliderBackgroundAttributes\"></span>\n\t\t\t</span>\n\t\t\t<span\n\t\t\t\tv-if=\"props.range\"\n\t\t\t\tv-bind=\"listeners\"\n\t\t\t\tkey=\"thumblower\"\n\t\t\t\tref=\"thumblower\"\n\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t:aria-orientation=\"'horizontal'\"\n\t\t\t\t:aria-readonly=\"!readonly\"\n\t\t\t\t:aria-valuemax=\"max\"\n\t\t\t\t:aria-valuemin=\"min\"\n\t\t\t\t:aria-valuenow=\"valueNowLower\"\n\t\t\t\t:class=\"'bb-base-slider__thumb-container'\"\n\t\t\t\tdata-thumb=\"lower\"\n\t\t\t\t:role=\"'slider'\"\n\t\t\t\t:style=\"{ left: `${internalValueLower}%` }\"\n\t\t\t\t:tabindex=\"disabled ? -1 : 0\"\n\t\t\t\t@focus=\"onFocus\"\n\t\t\t\t@keydown=\"onKeydown\"\n\t\t\t>\n\t\t\t\t<span\n\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t'bb-base-slider__thumb': true,\n\t\t\t\t\t\t'bb-base-slider__thumb--lower': true,\n\t\t\t\t\t\t'bb-base-slider__thumb--focused': targetThumb === 'lower',\n\t\t\t\t\t}\"\n\t\t\t\t\t:style=\"{\n\t\t\t\t\t\ttransform: `translateY(-50%) ${thumbTranslate ? `translateX(-${internalValueLower}%)` : `translateX(-50%)`}`,\n\t\t\t\t\t\tleft: `${internalValueLower}%`,\n\t\t\t\t\t}\"\n\t\t\t\t\t><slot\n\t\t\t\t\t\t:focused=\"targetThumb === 'lower'\"\n\t\t\t\t\t\tname=\"thumb:lower\"\n\t\t\t\t\t\t:percent=\"internalValueLower\"\n\t\t\t\t\t\t:value=\"valueNowLower\"\n\t\t\t\t\t\t><slot\n\t\t\t\t\t\t\t:focused=\"targetThumb === 'lower'\"\n\t\t\t\t\t\t\tname=\"thumb\"\n\t\t\t\t\t\t\t:percent=\"internalValueLower\"\n\t\t\t\t\t\t\t:value=\"valueNowLower\" /></slot\n\t\t\t\t></span>\n\t\t\t</span>\n\t\t\t<span\n\t\t\t\tv-bind=\"listeners\"\n\t\t\t\tkey=\"thumbhigher\"\n\t\t\t\tref=\"thumbhigher\"\n\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t:aria-orientation=\"'horizontal'\"\n\t\t\t\t:aria-readonly=\"!readonly\"\n\t\t\t\t:aria-valuemax=\"max\"\n\t\t\t\t:aria-valuemin=\"min\"\n\t\t\t\t:aria-valuenow=\"valueNowHigher\"\n\t\t\t\t:class=\"'bb-base-slider__thumb-container'\"\n\t\t\t\tdata-thumb=\"higher\"\n\t\t\t\t:role=\"'slider'\"\n\t\t\t\t:style=\"{ left: `${internalValueHigher}%` }\"\n\t\t\t\t:tabindex=\"disabled ? -1 : 0\"\n\t\t\t\t@focus=\"onFocus\"\n\t\t\t\t@keydown=\"onKeydown\"\n\t\t\t>\n\t\t\t\t<span\n\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t'bb-base-slider__thumb': true,\n\t\t\t\t\t\t'bb-base-slider__thumb--higher': true,\n\t\t\t\t\t\t'bb-base-slider__thumb--focused': targetThumb === 'higher',\n\t\t\t\t\t}\"\n\t\t\t\t\t:style=\"{\n\t\t\t\t\t\ttransform: `translateY(-50%) ${thumbTranslate ? `translateX(-${internalValueHigher}%)` : `translateX(-50%)`}`,\n\t\t\t\t\t\tleft: `${internalValueHigher}%`,\n\t\t\t\t\t}\"\n\t\t\t\t\t><slot\n\t\t\t\t\t\t:focused=\"targetThumb === 'higher'\"\n\t\t\t\t\t\tname=\"thumb:higher\"\n\t\t\t\t\t\t:percent=\"internalValueHigher\"\n\t\t\t\t\t\t:value=\"valueNowHigher\"\n\t\t\t\t\t\t><slot\n\t\t\t\t\t\t\t:focused=\"targetThumb === 'higher'\"\n\t\t\t\t\t\t\tname=\"thumb\"\n\t\t\t\t\t\t\t:percent=\"internalValueHigher\"\n\t\t\t\t\t\t\t:value=\"valueNowHigher\" /></slot\n\t\t\t\t></span>\n\t\t\t</span>\n\t\t</span>\n\t\t<slot name=\"append\"></slot>\n\t</span>\n</template>\n\n<script setup lang=\"ts\">\nimport { clamp } from '@/utilities/functions/clamp';\nimport { computed, onMounted, ref, watch } from 'vue';\nimport { head } from '@/utilities/functions/head';\nimport { isCssColor } from '@/utilities/functions/isCssColor';\nimport { isNil } from '@/utilities/functions/isNil';\nimport { isNotNil } from '@/utilities/functions/isNotNil';\nimport { transposeValue } from '@/utilities/functions/percentage';\nimport type { InputHTMLAttributes, HTMLAttributes } from 'vue';\nimport { hash } from '@/utilities/functions/hash';\n\nexport type BaseSliderProps = {\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tariaDescribedby?: InputHTMLAttributes['aria-describedby'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Define a color for the component.\n\t *\n\t * Either a custom color or a coded color in common HEX, RGB, etc... format.\n\t */\n\tcolor?: string;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Maximum value cap.\n\t */\n\tmax?: number;\n\n\t/**\n\t * Minimum value cap.\n\t */\n\tmin?: number;\n\n\t/**\n\t * Used by v-model.\n\t */\n\tmodelValue: number[] | number | string | null;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * Set the input as range.\n\t * modelValue must be an array\n\t */\n\trange?: boolean;\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n\n\t/**\n\t * Sets the input as required.\n\t */\n\trequired?: boolean;\n\n\t/**\n\t * The step attribute is a number that specifies the granularity that the value must adhere to.\n\t */\n\tstep?: number;\n\n\t/**\n\t * Displays ticks on step\n\t */\n\tticks?: boolean;\n\t/**\n\t * Proportionally translates the thumb so it remains on track. Set it to false when displaying ticks so they align with less effort.\n\t */\n\tthumbTranslate?: boolean;\n};\n\nconst props = withDefaults(defineProps<BaseSliderProps>(), {\n\tmax: 100,\n\tmin: 0,\n\tmodelValue: 0,\n\tstep: 1,\n\tthumbTranslate: true,\n});\n\nexport type BaseSliderEvents = {\n\t(e: 'click', event: MouseEvent): void;\n\t(e: 'focus', event: FocusEvent): void;\n\t(e: 'active'): void;\n\t(e: 'inactive'): void;\n\t(e: 'keydown', event: KeyboardEvent): void;\n\t(e: 'pointerdown', event: PointerEvent): void;\n\t(e: 'pointermove', event: PointerEvent): void;\n\t(e: 'pointerup', event: PointerEvent): void;\n\t(e: 'update:modelValue', event: number | number[]): void;\n};\n\nconst emit = defineEmits<BaseSliderEvents>();\n\nexport type BaseSliderSlots = {\n\t'thumb:higher': (props: {\n\t\tvalue: number | undefined;\n\t\tpercent: number;\n\t\tfocused: boolean;\n\t}) => any;\n\t'thumb:lower': (props: {\n\t\tvalue: number | undefined;\n\t\tpercent: number;\n\t\tfocused: boolean;\n\t}) => any;\n\tappend: (props: object) => any;\n\tprepend: (props: object) => any;\n\tthumb: (props: {\n\t\tvalue: number | undefined;\n\t\tpercent: number;\n\t\tfocused: boolean;\n\t}) => any;\n\ttick: (props: { value: number; percent: number; active: boolean }) => any;\n};\n\ndefineSlots<BaseSliderSlots>();\n\nconst container = ref<HTMLElement>();\nconst track = ref<HTMLElement>();\nconst thumblower = ref<HTMLElement>();\nconst thumbhigher = ref<HTMLElement>();\nconst internalValueLower = ref(0);\nconst internalValueHigher = ref(0);\nconst valueNowLower = computed(() => {\n\tif (Array.isArray(props.modelValue))\n\t\treturn head(props.modelValue) ?? undefined;\n\treturn isNil(props.modelValue) ? undefined : Number(props.modelValue);\n});\nconst valueNowHigher = computed(() => {\n\tif (Array.isArray(props.modelValue))\n\t\treturn head(props.modelValue) ?? undefined;\n\treturn isNil(props.modelValue) ? undefined : Number(props.modelValue);\n});\nconst sortedInternalValues = computed(() => {\n\treturn [internalValueLower.value, internalValueHigher.value].sort(\n\t\t(a, b) => a - b\n\t);\n});\n\nconst proportionalStep = transposeValue({\n\tvalue: props.min + props.step,\n\toriginalBounds: { min: props.min, max: props.max },\n\ttargetBounds: { min: 0, max: 100 },\n\tstep: 1,\n});\n\nconst active = ref(false);\n\nif (props.range && !Array.isArray(props.modelValue)) {\n\tthrow new TypeError(\n\t\t'BaseSlider mode is set as range but modelValue is not an array'\n\t);\n}\n\nonMounted(() => {\n\tif (props.autofocus) {\n\t\tthumbhigher.value?.focus();\n\t}\n});\n\n/**\n * When modelValue changes realign the internal positioning\n */\nwatch(\n\t() => props.modelValue,\n\t(value) => {\n\t\tlet values: number[];\n\t\tif (props.range) {\n\t\t\tconst [min = props.min, max = props.min] = value as number[];\n\t\t\tvalues = [min, max];\n\t\t} else {\n\t\t\tvalues = [props.min, isNotNil(value) ? Number(value) : props.min];\n\t\t}\n\t\tconst [lBound, uBound] = values.map((value) => {\n\t\t\t// Useful for ranges from negative to positive\n\t\t\tlet fallback = isNil(value) ? props.min : Number(value);\n\t\t\tconst transposedValue = transposeValue({\n\t\t\t\tvalue: fallback,\n\t\t\t\ttargetBounds: { min: 0, max: 100 },\n\t\t\t\toriginalBounds: { min: props.min, max: props.max },\n\t\t\t\tstep: 1,\n\t\t\t});\n\t\t\treturn transposedValue;\n\t\t});\n\t\tinternalValueLower.value = lBound;\n\t\tinternalValueHigher.value = uBound;\n\t},\n\t{ immediate: true }\n);\n\nlet thumbPressed = ref(false);\nlet targetThumb = ref<'higher' | 'lower' | null>(null);\n\nconst getTargetThumb = (event: FocusEvent) => {\n\tif (thumbhigher.value && thumbhigher.value.contains(event.target as Node))\n\t\treturn 'higher';\n\tif (thumblower.value && thumblower.value.contains(event.target as Node))\n\t\treturn 'lower';\n\tthrow new Error('Could not identify target thumb');\n};\n\nconst onPointerdown = (event: PointerEvent) => {\n\tif (props.disabled || props.readonly) return;\n\tif (!targetThumb.value) {\n\t\ttargetThumb.value = getTargetThumb(event);\n\t}\n\tthumbPressed.value = true;\n\tdocument.addEventListener('pointermove', onPointermove);\n\tdocument.addEventListener('pointerup', onPointerup);\n\temit('pointerdown', event);\n};\n\nlet listeners = computed(() => (thumbPressed.value ? {} : { onPointerdown }));\n\nconst onPointermove = (event: PointerEvent | MouseEvent) => {\n\tif (props.disabled || props.readonly) return;\n\tif (track.value) {\n\t\tconst trackPosition = track.value.getBoundingClientRect();\n\t\tconst clickOffset = event.clientX;\n\t\tconst trackStart = trackPosition.left;\n\t\tconst trackLength = trackPosition.width;\n\t\tif (event instanceof PointerEvent) {\n\t\t\temit('pointermove', event);\n\t\t} else {\n\t\t\temit('click', event);\n\t\t}\n\t\tconst position = transposeValue({\n\t\t\tvalue: clamp(clickOffset, trackStart, trackStart + trackLength),\n\t\t\toriginalBounds: { min: trackStart, max: trackStart + trackLength },\n\t\t\ttargetBounds: { min: 0, max: 100 },\n\t\t\tstep: proportionalStep,\n\t\t});\n\t\tif (targetThumb.value === 'higher') {\n\t\t\tinternalValueHigher.value = position;\n\t\t} else if (targetThumb.value === 'lower') {\n\t\t\tinternalValueLower.value = position;\n\t\t}\n\t}\n};\n\nconst getValueToEmit = () => {\n\tconst [min, max] = [internalValueLower.value, internalValueHigher.value].sort(\n\t\t(a, b) => a - b\n\t);\n\tconst refined = [min, max].map((value) =>\n\t\ttransposeValue({\n\t\t\tvalue,\n\t\t\toriginalBounds: { min: 0, max: 100 },\n\t\t\ttargetBounds: { min: props.min, max: props.max },\n\t\t\tstep: props.step,\n\t\t})\n\t);\n\tif (props.range) return refined;\n\treturn refined[1];\n};\n\nconst onPointerup = (event: PointerEvent) => {\n\tthumbPressed.value = false;\n\ttargetThumb.value = null;\n\tdocument.removeEventListener('pointermove', onPointermove);\n\tdocument.removeEventListener('pointerup', onPointerup);\n\temit('pointerup', event);\n\temit('update:modelValue', getValueToEmit());\n};\n\nconst onKeydown = (event: KeyboardEvent) => {\n\temit('keydown', event);\n\tif (\n\t\tprops.disabled ||\n\t\tprops.readonly ||\n\t\t(event.key !== 'ArrowLeft' && event.key !== 'ArrowRight')\n\t) {\n\t\treturn;\n\t}\n\n\tif (event.key === 'ArrowLeft') {\n\t\tif (\n\t\t\ttargetThumb.value === 'higher' ||\n\t\t\tdocument.activeElement === thumbhigher.value\n\t\t) {\n\t\t\tinternalValueHigher.value = Math.max(\n\t\t\t\tinternalValueHigher.value - proportionalStep,\n\t\t\t\tinternalValueLower.value\n\t\t\t);\n\t\t} else if (targetThumb.value === 'lower') {\n\t\t\tinternalValueLower.value = Math.max(\n\t\t\t\tinternalValueLower.value - proportionalStep,\n\t\t\t\t0\n\t\t\t);\n\t\t}\n\t} else if (event.key === 'ArrowRight') {\n\t\tif (\n\t\t\ttargetThumb.value === 'higher' ||\n\t\t\tdocument.activeElement === thumbhigher.value\n\t\t) {\n\t\t\tinternalValueHigher.value = Math.min(\n\t\t\t\tinternalValueHigher.value + proportionalStep,\n\t\t\t\t100\n\t\t\t);\n\t\t} else if (targetThumb.value === 'lower') {\n\t\t\tinternalValueLower.value = Math.min(\n\t\t\t\tinternalValueLower.value + proportionalStep,\n\t\t\t\tinternalValueHigher.value\n\t\t\t);\n\t\t}\n\t}\n\temit('update:modelValue', getValueToEmit());\n};\n\nconst onFocus = (event: FocusEvent) => {\n\temit('focus', event);\n\tconst found = getTargetThumb(event);\n\tif (found) targetThumb.value = found;\n\tif (!active.value) {\n\t\tactive.value = true;\n\t\temit('active');\n\t\tdocument.addEventListener('focusin', onDocumentInteraction);\n\t\tdocument.addEventListener('click', onDocumentInteraction);\n\t}\n};\n\nconst onDocumentInteraction = (event: FocusEvent) => {\n\tif (event.target instanceof HTMLElement) {\n\t\tif (!container.value?.contains(event.target)) {\n\t\t\tactive.value = false;\n\t\t\ttargetThumb.value = null;\n\t\t\temit('inactive');\n\t\t\tdocument.removeEventListener('focusin', onDocumentInteraction);\n\t\t\tdocument.removeEventListener('click', onDocumentInteraction);\n\t\t}\n\t}\n};\n\nconst containerAttributes: Record<string, any> = {\n\tclass: {\n\t\t'bb-base-slider': true,\n\t\t'bb-base-slider--disabled': props.disabled,\n\t\t'bb-base-slider--errors': props.hasErrors,\n\t\t'bb-base-slider--readonly': props.readonly,\n\t\t[`bb-base-slider--${props.color}`]: props.color && !isCssColor(props.color),\n\t},\n\tonClick: (event: MouseEvent) => {\n\t\tif (props.range) return;\n\t\tthumbhigher.value?.focus();\n\t\tonPointermove(event);\n\t\tconst valueToEmit = getValueToEmit();\n\t\t// Prevent emitting twice when clicking on the thumb directly\n\t\tif (hash(valueToEmit) === hash(props.modelValue)) return;\n\t\temit('update:modelValue', getValueToEmit());\n\t},\n\tstyle: {},\n};\n\nif (props.color && isCssColor(props.color)) {\n\tcontainerAttributes.style['--color'] = props.color;\n}\n\nconst sliderBackgroundAttributes = computed(() => {\n\tconst classes = 'bb-base-slider__track-background';\n\tconst style: Record<string, any> = {\n\t\twidth: `${sortedInternalValues.value[1] - sortedInternalValues.value[0]}%`,\n\t\tleft: `${sortedInternalValues.value[0]}%`,\n\t};\n\treturn {\n\t\tclass: classes,\n\t\tstyle,\n\t};\n});\n\ntype Tick = {\n\tvalue: number;\n\tpercent: number;\n\tactive: boolean;\n};\n\nconst ticks = computed<Tick[]>(() => {\n\tif (!props.ticks) return [] as Tick[];\n\tlet ticks: Tick[] = [];\n\tlet current = props.min;\n\twhile (current <= props.max) {\n\t\tlet value = current;\n\t\tlet percent = transposeValue({\n\t\t\tvalue,\n\t\t\toriginalBounds: { min: props.min, max: props.max },\n\t\t\ttargetBounds: { min: 0, max: 100 },\n\t\t\tstep: proportionalStep,\n\t\t});\n\t\tlet transposedValue = transposeValue({\n\t\t\tvalue: current,\n\t\t\toriginalBounds: { min: props.min, max: props.max },\n\t\t\ttargetBounds: { min: 0, max: 100 },\n\t\t\tstep: props.step,\n\t\t});\n\t\tconst active =\n\t\t\ttransposedValue >= internalValueLower.value &&\n\t\t\ttransposedValue <= internalValueHigher.value;\n\t\tticks.push({\n\t\t\tvalue,\n\t\t\tpercent,\n\t\t\tactive,\n\t\t});\n\t\tcurrent += props.step;\n\t}\n\treturn ticks;\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BaseSlider';\n</style>\n"],"names":["props","__props","emit","__emit","container","ref","track","thumblower","thumbhigher","internalValueLower","internalValueHigher","valueNowLower","computed","head","isNil","valueNowHigher","sortedInternalValues","a","b","proportionalStep","transposeValue","active","onMounted","_a","watch","value","values","min","max","isNotNil","lBound","uBound","fallback","thumbPressed","targetThumb","getTargetThumb","event","onPointerdown","onPointermove","onPointerup","listeners","trackPosition","clickOffset","trackStart","trackLength","position","clamp","getValueToEmit","refined","onKeydown","onFocus","found","onDocumentInteraction","containerAttributes","isCssColor","valueToEmit","hash","sliderBackgroundAttributes","classes","style","ticks","current","percent","transposedValue"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmNA,UAAMA,IAAQC,GAoBRC,IAAOC,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;AAAA,QAAA,CACN,GACG4C,IAAkB3C,EAAe;AAAA,UACpC,OAAOyC;AAAA,UACP,gBAAgB,EAAE,KAAK7D,EAAM,KAAK,KAAKA,EAAM,IAAI;AAAA,UACjD,cAAc,EAAE,KAAK,GAAG,KAAK,IAAI;AAAA,UACjC,MAAMA,EAAM;AAAA,QAAA,CACZ;AACD,cAAMqB,IACL0C,KAAmBtD,EAAmB,SACtCsD,KAAmBrD,EAAoB;AACxCkD,QAAAA,EAAM,KAAK;AAAA,UACV,OAAAnC;AAAA,UACA,SAAAqC;AAAA,UACA,QAAAzC;AAAAA,QAAA,CACA,GACDwC,KAAW7D,EAAM;AAAA,MAClB;AACO4D,aAAAA;AAAAA,IAAA,CACP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index38.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index38.js","sources":["../src/components/BaseSwitch/BaseSwitch.vue"],"sourcesContent":["<template>\n\t<span v-bind=\"containerAttributes\">\n\t\t<input v-if=\"!checked && submitWhenFalse\" v-bind=\"hiddenInputAttributes\" />\n\t\t<input v-bind=\"inputAttributes\" ref=\"checkboxInput\" />\n\t\t<span class=\"bb-base-switch-container\">\n\t\t\t<slot name=\"icon\" v-bind=\"slotAttributes\">\n\t\t\t\t<span v-bind=\"iconAttributes\">\n\t\t\t\t\t<span class=\"bb-base-switch-container__icon-thumb\"></span>\n\t\t\t\t</span>\n\t\t\t</slot>\n\t\t</span>\n\t</span>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue';\nimport { isCssColor } from '@/utilities/functions/isCssColor';\nimport { when } from '@/utilities/functions/when';\nimport type {\n\tBaseCheckboxEvents,\n\tBaseCheckboxProps,\n\tSlotAttributes,\n} from '../BaseCheckbox/BaseCheckbox.vue';\n\nexport type BaseSwitchProps = BaseCheckboxProps;\n\nexport type BaseSwitchEvents = BaseCheckboxEvents;\n\nconst props = withDefaults(defineProps<BaseSwitchProps>(), {\n\ttrueValue: true,\n\tfalseValue: false,\n});\n\nconst emit = defineEmits<BaseSwitchEvents>();\n\nexport type BaseSwitchSlots = {\n\ticon?: (props: SlotAttributes) => any;\n};\n\ndefineSlots<BaseSwitchSlots>();\n\nconst checkboxInput = ref<HTMLInputElement | null>(null);\n\nconst checked = computed(() => {\n\tif (props.checked) return true;\n\treturn JSON.stringify(props.trueValue) === JSON.stringify(props.modelValue);\n});\nconst hasFocus = ref(false);\n\nconst containerAttributes = computed(() => {\n\tconst attributes: Record<string, any> = {\n\t\tclass: {\n\t\t\t'bb-base-switch': true,\n\t\t\t'bb-base-switch--disabled': props.disabled,\n\t\t\t'bb-base-switch--errors': props.hasErrors,\n\t\t\t'bb-base-switch--indeterminate': props.indeterminate,\n\t\t\t'bb-base-switch--readonly': props.readonly,\n\t\t\t[`bb-base-switch--${props.color}`]:\n\t\t\t\tprops.color && !isCssColor(props.color),\n\t\t},\n\t};\n\tif (props.color && isCssColor(props.color)) {\n\t\tattributes['style'] = `--color: ${props.color}`;\n\t}\n\treturn attributes;\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);\n\nconst hiddenInputAttributes = computed(() => {\n\tconst value = makeInputValue(props.falseValue);\n\treturn {\n\t\tdisabled: props.disabled,\n\t\tname: props.name,\n\t\ttype: 'hidden',\n\t\tvalue: value,\n\t};\n});\n\nconst inputAttributes = computed(() => {\n\tconst value = makeInputValue(props.trueValue);\n\n\tconst onBlur = (event: FocusEvent): void => {\n\t\thasFocus.value = false;\n\t\temit('blur', event);\n\t};\n\n\tconst onChange = (event: Event): void => {\n\t\tif (event.target instanceof HTMLInputElement) {\n\t\t\tlet value = event.target.checked ? props.trueValue : props.falseValue;\n\n\t\t\temit('change', event);\n\t\t\temit('update:modelValue', value);\n\t\t}\n\t};\n\n\tconst onFocus = (event: FocusEvent): void => {\n\t\thasFocus.value = true;\n\t\temit('focus', event);\n\t};\n\n\tconst eventListeners = {\n\t\tonBlur,\n\t\tonChange,\n\t\tonClick: (event: MouseEvent) => emit('click', event),\n\t\tonFocus,\n\t\tonInput: (event: Event) => emit('input', event),\n\t\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\t\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\t\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n\t};\n\n\treturn {\n\t\t'aria-describedby': props.ariaDescribedby,\n\t\tautofocus: props.autofocus,\n\t\tchecked: checked.value,\n\t\t// There is no such thing as readonly checkbox so we disable and style it with css\n\t\tdisabled: props.disabled || props.readonly,\n\t\tid: props.id,\n\t\tindeterminate: props.indeterminate,\n\t\tname: props.name,\n\t\trequired: props.required,\n\t\ttabindex: props.disabled ? -1 : undefined,\n\t\ttype: 'checkbox',\n\t\tvalue: value,\n\t\t...eventListeners,\n\t};\n});\n\nconst slotAttributes = computed(() => ({\n\tchecked: checked.value,\n\tdisabled: props.disabled,\n\tfalseValue: props.falseValue,\n\tfocused: hasFocus.value,\n\thasErrors: props.hasErrors,\n\tid: props.id,\n\tname: props.name,\n\tparsedValue: inputAttributes.value.value,\n\treadonly: props.readonly,\n\trequired: props.required,\n\ttrueValue: props.trueValue,\n\tvalue: checked.value ? props.trueValue : props.falseValue,\n}));\n\nconst iconAttributes = computed(() => {\n\tlet style: { [key: string]: string } = {};\n\tif (props.color && isCssColor(props.color)) {\n\t\tstyle.color = props.color;\n\t}\n\treturn {\n\t\tclass: 'bb-base-switch-container__icon',\n\t\tstyle,\n\t};\n});\n\n/**\n * Indeterminate is a very volatile prop that is reset upon clicking,\n * this keeps the state and the prop aligned\n */\nwatch(\n\t() => [props.modelValue, props.checked, props.indeterminate],\n\t() => {\n\t\tif (checkboxInput.value) {\n\t\t\tcheckboxInput.value.indeterminate = !!props.indeterminate;\n\t\t}\n\t}\n);\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BaseSwitch';\n</style>\n"],"names":["props","__props","emit","__emit","checkboxInput","ref","checked","computed","hasFocus","containerAttributes","attributes","isCssColor","makeInputValue","when","item","hiddenInputAttributes","value","inputAttributes","eventListeners","event","slotAttributes","iconAttributes","style","watch"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,UAAMA,IAAQC,GAKRC,IAAOC,GAQPC,IAAgBC,EAA6B,IAAI,GAEjDC,IAAUC,EAAS,MACpBP,EAAM,UAAgB,KACnB,KAAK,UAAUA,EAAM,SAAS,MAAM,KAAK,UAAUA,EAAM,UAAU,CAC1E,GACKQ,IAAWH,EAAI,EAAK,GAEpBI,IAAsBF,EAAS,MAAM;AAC1C,YAAMG,IAAkC;AAAA,QACvC,OAAO;AAAA,UACN,kBAAkB;AAAA,UAClB,4BAA4BV,EAAM;AAAA,UAClC,0BAA0BA,EAAM;AAAA,UAChC,iCAAiCA,EAAM;AAAA,UACvC,4BAA4BA,EAAM;AAAA,UAClC,CAAC,mBAAmBA,EAAM,KAAK,EAAE,GAChCA,EAAM,SAAS,CAACW,EAAWX,EAAM,KAAK;AAAA,QACxC;AAAA,MAAA;AAED,aAAIA,EAAM,SAASW,EAAWX,EAAM,KAAK,MACxCU,EAAW,QAAW,YAAYV,EAAM,KAAK,KAEvCU;AAAA,IAAA,CACP,GAMKE,IAAiBC;AAAA,MACtB,CAACC,MAAkB,OAAOA,KAAS;AAAA,MACnC,KAAK;AAAA,IAAA,GAGAC,IAAwBR,EAAS,MAAM;AACtC,YAAAS,IAAQJ,EAAeZ,EAAM,UAAU;AACtC,aAAA;AAAA,QACN,UAAUA,EAAM;AAAA,QAChB,MAAMA,EAAM;AAAA,QACZ,MAAM;AAAA,QACN,OAAAgB;AAAA,MAAA;AAAA,IACD,CACA,GAEKC,IAAkBV,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,EAAM;AAAA,MAClB,SAASQ,EAAS;AAAA,MAClB,WAAWR,EAAM;AAAA,MACjB,IAAIA,EAAM;AAAA,MACV,MAAMA,EAAM;AAAA,MACZ,aAAaiB,EAAgB,MAAM;AAAA,MACnC,UAAUjB,EAAM;AAAA,MAChB,UAAUA,EAAM;AAAA,MAChB,WAAWA,EAAM;AAAA,MACjB,OAAOM,EAAQ,QAAQN,EAAM,YAAYA,EAAM;AAAA,IAC9C,EAAA,GAEIqB,IAAiBd,EAAS,MAAM;AACrC,UAAIe,IAAmC,CAAA;AACvC,aAAItB,EAAM,SAASW,EAAWX,EAAM,KAAK,MACxCsB,EAAM,QAAQtB,EAAM,QAEd;AAAA,QACN,OAAO;AAAA,QACP,OAAAsB;AAAA,MAAA;AAAA,IACD,CACA;AAMD,WAAAC;AAAA,MACC,MAAM,CAACvB,EAAM,YAAYA,EAAM,SAASA,EAAM,aAAa;AAAA,MAC3D,MAAM;AACL,QAAII,EAAc,UACjBA,EAAc,MAAM,gBAAgB,CAAC,CAACJ,EAAM;AAAA,MAE9C;AAAA,IAAA;;;;;;;;;;;;;;"}
|
package/dist/index44.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index44.js","sources":["../src/components/BaseTextarea/BaseTextarea.vue"],"sourcesContent":["<template>\n\t<CommonInputOuterContainer :class=\"classes\">\n\t\t<template #prepend-outer><slot name=\"prepend-outer\"></slot></template>\n\t\t<CommonInputInnerContainer\n\t\t\t:append:icon=\"props['append:icon']\"\n\t\t\t:prepend:icon=\"props['prepend:icon']\"\n\t\t>\n\t\t\t<template #prepend><slot name=\"prepend\" /></template>\n\t\t\t<template #prefix><slot name=\"prefix\" /></template>\n\t\t\t<BbSmoothHeight>\n\t\t\t\t<textarea\n\t\t\t\t\t:id=\"id\"\n\t\t\t\t\tref=\"textarea\"\n\t\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t\t:autocomplete=\"autocomplete\"\n\t\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t\t:class=\"'bb-base-textarea__input'\"\n\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t:name=\"name\"\n\t\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t\t:required=\"required\"\n\t\t\t\t\t:rows=\"rows\"\n\t\t\t\t\t:value=\"modelValueWithDefault\"\n\t\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t\t\t@input=\"onInput\"\n\t\t\t\t\t@keydown=\"onKeydown\"\n\t\t\t\t></textarea>\n\t\t\t</BbSmoothHeight>\n\t\t\t<template #append><slot name=\"append\" /></template>\n\t\t\t<template #suffix><slot name=\"suffix\" /></template>\n\t\t</CommonInputInnerContainer>\n\t\t<template #append-outer><slot name=\"append-outer\"></slot></template>\n\t</CommonInputOuterContainer>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, nextTick, onMounted, ref, watch } from 'vue';\nimport type { HTMLAttributes, InputHTMLAttributes, Ref } from 'vue';\nimport CommonInputOuterContainer from '../CommonInputOuterContainer.vue';\nimport CommonInputInnerContainer from '../CommonInputInnerContainer.vue';\nimport BbSmoothHeight from '../BbSmoothHeight/BbSmoothHeight.vue';\n\nexport type BaseTextareaProps = {\n\t/**\n\t * Name of the icon to be added at the end of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'append:icon'?: string;\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tariaDescribedby?: InputHTMLAttributes['aria-describedby'];\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tautocomplete?: InputHTMLAttributes['autocomplete'];\n\n\t/**\n\t * Expands the textarea to match its content\n\t */\n\tautoGrow?: boolean;\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Sets the component in a loading state, usually triggering some visual styles.\n\t */\n\tloading?: boolean;\n\n\t/**\n\t * Used by v-model\n\t */\n\tmodelValue: string | null;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Name of the icon to be added at the start of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'prepend:icon'?: string;\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n\n\t/**\n\t * Sets the input as required.\n\t */\n\trequired?: boolean;\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\trows?: string | number;\n};\nconst props = defineProps<BaseTextareaProps>();\n\nexport type BaseTextareaEvents = {\n\t(e: 'blur', event: FocusEvent): void;\n\t(e: 'change', event: Event): void;\n\t(e: 'click', event: MouseEvent): void;\n\t(e: 'focus', event: FocusEvent): void;\n\t(e: 'input', event: Event): void;\n\t(e: 'keydown', event: KeyboardEvent): void;\n\t(e: 'mousedown', event: MouseEvent): void;\n\t(e: 'mouseup', event: MouseEvent): void;\n\t(e: 'update:modelValue', value: string | null): void;\n};\nconst emit = defineEmits<BaseTextareaEvents>();\n\nexport type BaseTextareaSlots = {\n\t'prepend-outer'?: (props: object) => any;\n\tprepend?: (props: object) => any;\n\tappend?: (props: object) => any;\n\t'append-outer'?: (props: object) => any;\n\tprefix?: (props: object) => any;\n\tsuffix?: (props: object) => any;\n};\n\ndefineSlots<BaseTextareaSlots>();\n\nif (props.rows && props.autoGrow) {\n\tthrow new Error(\n\t\t'Textarea: You cannot set rows and auto-grow attributes together. You either use rows and let the user resize or define a minimum height in CSS with auto-grow.'\n\t);\n}\n\nconst textarea: Ref<HTMLTextAreaElement | null> = ref(null);\n\nconst classes = computed(() => ({\n\t'bb-base-textarea': true,\n\t'bb-base-textarea--auto-grow': props.autoGrow,\n\t'bb-base-textarea--disabled': props.disabled,\n\t'bb-base-textarea--errors': props.hasErrors,\n\t'bb-base-textarea--loading': props.loading,\n\t'bb-base-textarea--readonly': props.readonly,\n}));\n\n// Allow modelvalue to be reset to null\nconst modelValueWithDefault = computed(() =>\n\tprops.modelValue ? props.modelValue : ''\n);\nonMounted(() => {\n\tif (props.autoGrow && props.modelValue) {\n\t\tcomputeTextareaHeight();\n\t}\n});\nwatch(\n\t() => props.modelValue,\n\t() => {\n\t\tif (props.autoGrow) {\n\t\t\tnextTick(computeTextareaHeight);\n\t\t}\n\t}\n);\n\nfunction onInput(event: Event): void {\n\t// Prevent enter from triggering smt else\n\tevent.stopPropagation();\n\tif (event.target instanceof HTMLTextAreaElement) {\n\t\tlet value = event.target.value;\n\t\temit('input', event);\n\t\temit('update:modelValue', value || null);\n\t}\n}\nfunction onKeydown(event: KeyboardEvent): void {\n\t// Prevent enter from triggering smt else\n\tevent.stopPropagation();\n\tif (event.target instanceof HTMLTextAreaElement) {\n\t\temit('keydown', event);\n\t}\n}\n\n/**\n * These events are just propagated\n */\nconst eventListeners = {\n\tonBlur: (event: FocusEvent) => emit('blur', event),\n\tonChange: (event: Event) => emit('change', event),\n\tonClick: (event: MouseEvent) => emit('click', event),\n\tonFocus: (event: FocusEvent) => emit('focus', event),\n\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n};\n\n/* \nReset height and the apply scroll height otherwise it would not be able to shrink\n*/\nfunction computeTextareaHeight() {\n\tif (!textarea.value) return;\n\ttextarea.value.style.height = '0px';\n\n\ttextarea.value.style.height = `${textarea.value.scrollHeight}px`;\n}\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BaseTextarea';\n</style>\n"],"names":["props","__props","emit","__emit","textarea","ref","classes","computed","modelValueWithDefault","onMounted","computeTextareaHeight","watch","nextTick","onInput","event","value","onKeydown","eventListeners"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6HA,UAAMA,IAAQC,GAaRC,IAAOC;AAaT,QAAAH,EAAM,QAAQA,EAAM;AACvB,YAAM,IAAI;AAAA,QACT;AAAA,MAAA;AAII,UAAAI,IAA4CC,EAAI,IAAI,GAEpDC,IAAUC,EAAS,OAAO;AAAA,MAC/B,oBAAoB;AAAA,MACpB,+BAA+BP,EAAM;AAAA,MACrC,8BAA8BA,EAAM;AAAA,MACpC,4BAA4BA,EAAM;AAAA,MAClC,6BAA6BA,EAAM;AAAA,MACnC,8BAA8BA,EAAM;AAAA,IACnC,EAAA,GAGIQ,IAAwBD;AAAA,MAAS,MACtCP,EAAM,aAAaA,EAAM,aAAa;AAAA,IAAA;AAEvC,IAAAS,EAAU,MAAM;AACX,MAAAT,EAAM,YAAYA,EAAM,cACLU;IACvB,CACA,GACDC;AAAA,MACC,MAAMX,EAAM;AAAA,MACZ,MAAM;AACL,QAAIA,EAAM,YACTY,EAASF,CAAqB;AAAA,MAEhC;AAAA,IAAA;AAGD,aAASG,EAAQC,GAAoB;AAGhC,UADJA,EAAM,gBAAgB,GAClBA,EAAM,kBAAkB,qBAAqB;AAC5C,YAAAC,IAAQD,EAAM,OAAO;AACzB,QAAAZ,EAAK,SAASY,CAAK,GACdZ,EAAA,qBAAqBa,KAAS,IAAI;AAAA,MACxC;AAAA,IACD;AACA,aAASC,EAAUF,GAA4B;AAE9C,MAAAA,EAAM,gBAAgB,GAClBA,EAAM,kBAAkB,uBAC3BZ,EAAK,WAAWY,CAAK;AAAA,IAEvB;AAKA,UAAMG,IAAiB;AAAA,MACtB,QAAQ,CAACH,MAAsBZ,EAAK,QAAQY,CAAK;AAAA,MACjD,UAAU,CAACA,MAAiBZ,EAAK,UAAUY,CAAK;AAAA,MAChD,SAAS,CAACA,MAAsBZ,EAAK,SAASY,CAAK;AAAA,MACnD,SAAS,CAACA,MAAsBZ,EAAK,SAASY,CAAK;AAAA,MACnD,aAAa,CAACA,MAAsBZ,EAAK,aAAaY,CAAK;AAAA,MAC3D,WAAW,CAACA,MAAsBZ,EAAK,WAAWY,CAAK;AAAA,IAAA;AAMxD,aAASJ,IAAwB;AAC5B,MAACN,EAAS,UACLA,EAAA,MAAM,MAAM,SAAS,OAE9BA,EAAS,MAAM,MAAM,SAAS,GAAGA,EAAS,MAAM,YAAY;AAAA,IAC7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index50.js
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { defineComponent as h, ref as v, watch as C, openBlock as s, createBlock as a, normalizeClass as k, withCtx as i, createElementVNode as t, createCommentVNode as r, renderSlot as n, normalizeProps as c, guardReactiveProps as d, createTextVNode as m, toDisplayString as u } from "vue";
|
|
2
|
-
import w from "./index12.js";
|
|
3
|
-
/* empty css */
|
|
4
|
-
import V from "./index120.js";
|
|
5
|
-
/* empty css */
|
|
6
|
-
import y from "./index121.js";
|
|
7
|
-
/* empty css */
|
|
8
|
-
const z = {
|
|
9
|
-
class: "bb-alert__inner-container",
|
|
10
|
-
role: "alert"
|
|
11
|
-
}, $ = { class: "bb-alert__icon-container" }, g = { class: "bb-alert__content" }, B = { class: "bb-alert__title" }, L = { class: "bb-alert__text" }, S = { class: "bb-alert__close" }, N = /* @__PURE__ */ t("svg", {
|
|
12
|
-
fill: "none",
|
|
13
|
-
viewBox: "0 0 24 24",
|
|
14
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
15
|
-
}, [
|
|
16
|
-
/* @__PURE__ */ t("path", {
|
|
17
|
-
d: "M23 23L1 1M23 1L1 23",
|
|
18
|
-
stroke: "currentColor",
|
|
19
|
-
"stroke-linecap": "round",
|
|
20
|
-
"stroke-width": "2"
|
|
21
|
-
})
|
|
22
|
-
], -1), q = /* @__PURE__ */ h({
|
|
23
|
-
__name: "BbAlert",
|
|
24
|
-
props: {
|
|
25
|
-
closeLabel: { default: "Chiudi" },
|
|
26
|
-
showClose: { type: Boolean },
|
|
27
|
-
text: {},
|
|
28
|
-
theme: { default: "default" },
|
|
29
|
-
title: {},
|
|
30
|
-
icon: {},
|
|
31
|
-
iconSize: {},
|
|
32
|
-
modelValue: {}
|
|
33
|
-
},
|
|
34
|
-
emits: ["update:modelValue"],
|
|
35
|
-
setup(_, { emit: p }) {
|
|
36
|
-
const l = _, b = p, o = v(
|
|
37
|
-
l.modelValue === void 0 ? !0 : !!l.modelValue
|
|
38
|
-
);
|
|
39
|
-
C(
|
|
40
|
-
() => l.modelValue,
|
|
41
|
-
(e) => {
|
|
42
|
-
o.value !== !!e && (o.value = !!e);
|
|
43
|
-
}
|
|
44
|
-
);
|
|
45
|
-
const f = () => {
|
|
46
|
-
o.value = !1, b("update:modelValue", !1);
|
|
47
|
-
};
|
|
48
|
-
return (e, M) => (s(), a(V, {
|
|
49
|
-
class: k(["bb-alert", { [`bb-alert--${e.theme}`]: e.theme }]),
|
|
50
|
-
"model-value": o.value
|
|
51
|
-
}, {
|
|
52
|
-
default: i(() => [
|
|
53
|
-
t("div", z, [
|
|
54
|
-
t("div", $, [
|
|
55
|
-
e.icon ? (s(), a(y, {
|
|
56
|
-
key: 0,
|
|
57
|
-
class: "bb-alert__icon",
|
|
58
|
-
size: e.iconSize,
|
|
59
|
-
type: e.icon
|
|
60
|
-
}, null, 8, ["size", "type"])) : r("", !0)
|
|
61
|
-
]),
|
|
62
|
-
t("div", g, [
|
|
63
|
-
t("p", B, [
|
|
64
|
-
n(e.$slots, "title", c(d({ text: e.title })), () => [
|
|
65
|
-
m(u(e.title), 1)
|
|
66
|
-
])
|
|
67
|
-
]),
|
|
68
|
-
t("p", L, [
|
|
69
|
-
n(e.$slots, "text", c(d({ text: e.text })), () => [
|
|
70
|
-
m(u(e.text), 1)
|
|
71
|
-
])
|
|
72
|
-
])
|
|
73
|
-
]),
|
|
74
|
-
t("div", S, [
|
|
75
|
-
e.showClose ? (s(), a(w, {
|
|
76
|
-
key: 0,
|
|
77
|
-
"aria-label": e.closeLabel,
|
|
78
|
-
block: "",
|
|
79
|
-
class: "bb-alert__close-btn",
|
|
80
|
-
onClick: f
|
|
81
|
-
}, {
|
|
82
|
-
default: i(() => [
|
|
83
|
-
N
|
|
84
|
-
]),
|
|
85
|
-
_: 1
|
|
86
|
-
}, 8, ["aria-label"])) : r("", !0)
|
|
87
|
-
])
|
|
88
|
-
])
|
|
89
|
-
]),
|
|
90
|
-
_: 3
|
|
91
|
-
}, 8, ["class", "model-value"]));
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
export {
|
|
95
|
-
q as default
|
|
96
|
-
};
|
|
97
|
-
//# sourceMappingURL=index50.js.map
|
package/dist/index50.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index50.js","sources":["../src/components/BbAlert/BbAlert.vue"],"sourcesContent":["<template>\n\t<BbCollapsible\n\t\tclass=\"bb-alert\"\n\t\t:class=\"{ [`bb-alert--${theme}`]: theme }\"\n\t\t:model-value=\"innerValue\"\n\t>\n\t\t<div class=\"bb-alert__inner-container\" role=\"alert\">\n\t\t\t<div class=\"bb-alert__icon-container\">\n\t\t\t\t<BbIcon\n\t\t\t\t\tv-if=\"icon\"\n\t\t\t\t\tclass=\"bb-alert__icon\"\n\t\t\t\t\t:size=\"iconSize\"\n\t\t\t\t\t:type=\"icon\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div class=\"bb-alert__content\">\n\t\t\t\t<p class=\"bb-alert__title\">\n\t\t\t\t\t<slot name=\"title\" v-bind=\"{ text: title }\">{{ title }}</slot>\n\t\t\t\t</p>\n\t\t\t\t<p class=\"bb-alert__text\">\n\t\t\t\t\t<slot name=\"text\" v-bind=\"{ text: text }\">{{ text }}</slot>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t<div class=\"bb-alert__close\">\n\t\t\t\t<BaseButton\n\t\t\t\t\tv-if=\"showClose\"\n\t\t\t\t\t:aria-label=\"closeLabel\"\n\t\t\t\t\tblock\n\t\t\t\t\tclass=\"bb-alert__close-btn\"\n\t\t\t\t\t@click=\"onClickClose\"\n\t\t\t\t>\n\t\t\t\t\t<svg\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<path\n\t\t\t\t\t\t\td=\"M23 23L1 1M23 1L1 23\"\n\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</svg>\n\t\t\t\t</BaseButton>\n\t\t\t</div>\n\t\t</div>\n\t</BbCollapsible>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch } from 'vue';\nimport BaseButton from '../BaseButton/BaseButton.vue';\nimport BbCollapsible from '../BbCollapsible/BbCollapsible.vue';\nimport BbIcon from '../BbIcon/BbIcon.vue';\nimport type { BbIconProps } from '../BbIcon/BbIcon.vue';\nimport type { CommonProps } from '@/types/CommonProps';\n\nexport type BbAlertProps = Pick<\n\tCommonProps,\n\t'closeLabel' | 'showClose' | 'text' | 'theme' | 'title'\n> & {\n\t/**\n\t * Name of the icon to use\n\t */\n\ticon?: BbIconProps['type'];\n\t/**\n\t * Size of the icon to use\n\t */\n\ticonSize?: BbIconProps['size'];\n\t/**\n\t * Used by v-model, set type to any to avoid Vue casting it as false\n\t */\n\tmodelValue?: any;\n};\n\nconst props = withDefaults(defineProps<BbAlertProps>(), {\n\tcloseLabel: 'Chiudi',\n\ttheme: 'default',\n});\n\nexport type BbAlertEvents = {\n\t(e: 'update:modelValue', value: boolean): void;\n};\nconst emit = defineEmits<BbAlertEvents>();\n\ndefineSlots<{\n\ttitle?: (props: { text: BbAlertProps['title'] }) => any;\n\ttext?: (props: { text: BbAlertProps['title'] }) => any;\n}>();\n\nconst innerValue = ref(\n\tprops.modelValue === undefined ? true : !!props.modelValue\n);\n\nwatch(\n\t() => props.modelValue,\n\t(value) => {\n\t\tif (innerValue.value !== !!value) {\n\t\t\tinnerValue.value = !!value;\n\t\t}\n\t}\n);\n\nconst onClickClose = () => {\n\tinnerValue.value = false;\n\temit('update:modelValue', false);\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbAlert';\n</style>\n"],"names":["props","__props","emit","__emit","innerValue","ref","watch","value","onClickClose"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EA,UAAMA,IAAQC,GAQRC,IAAOC,GAOPC,IAAaC;AAAA,MAClBL,EAAM,eAAe,SAAY,KAAO,CAAC,CAACA,EAAM;AAAA,IAAA;AAGjD,IAAAM;AAAA,MACC,MAAMN,EAAM;AAAA,MACZ,CAACO,MAAU;AACV,QAAIH,EAAW,UAAU,CAAC,CAACG,MACfH,EAAA,QAAQ,CAAC,CAACG;AAAA,MAEvB;AAAA,IAAA;AAGD,UAAMC,IAAe,MAAM;AAC1B,MAAAJ,EAAW,QAAQ,IACnBF,EAAK,qBAAqB,EAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index76.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { defineComponent as h, ref as t, onMounted as m, onBeforeUnmount as p, openBlock as g, createBlock as b, resolveDynamicComponent as w, withCtx as _, renderSlot as I } from "vue";
|
|
2
|
-
import { throttle as c } from "./index222.js";
|
|
3
|
-
const M = /* @__PURE__ */ h({
|
|
4
|
-
__name: "BbIntersection",
|
|
5
|
-
props: {
|
|
6
|
-
debounceTime: { default: 0 },
|
|
7
|
-
options: { default: () => ({
|
|
8
|
-
root: null,
|
|
9
|
-
threshold: [0, 0.2, 0.4, 0.6, 0.8, 1]
|
|
10
|
-
}) },
|
|
11
|
-
tag: { default: "div" }
|
|
12
|
-
},
|
|
13
|
-
emits: ["shown", "hidden", "intersected"],
|
|
14
|
-
setup(u, { emit: d }) {
|
|
15
|
-
const r = u, i = d, n = t(null), l = t(null), o = t(!1), s = t(!0), a = t(0);
|
|
16
|
-
m(() => {
|
|
17
|
-
n.value = new IntersectionObserver((e) => {
|
|
18
|
-
f(e[0]);
|
|
19
|
-
}, r.options), l.value && n.value.observe(l.value);
|
|
20
|
-
}), p(() => {
|
|
21
|
-
n.value && n.value.disconnect();
|
|
22
|
-
});
|
|
23
|
-
const f = c((e) => {
|
|
24
|
-
e.isIntersecting ? (a.value = Math.trunc(e.intersectionRatio * 100), e.intersectionRatio === 1 ? (o.value = !0, s.value = !1, i("shown")) : (o.value = !1, s.value = !1, v(Math.trunc(e.intersectionRatio * 100)))) : (o.value = !1, s.value = !0, i("hidden"));
|
|
25
|
-
}), v = c((e) => {
|
|
26
|
-
i("intersected", e);
|
|
27
|
-
}, r.debounceTime);
|
|
28
|
-
return (e, B) => (g(), b(w(e.tag), {
|
|
29
|
-
ref_key: "infinitescrolltrigger",
|
|
30
|
-
ref: l,
|
|
31
|
-
class: "bb-intersection"
|
|
32
|
-
}, {
|
|
33
|
-
default: _(() => [
|
|
34
|
-
I(e.$slots, "default", {
|
|
35
|
-
hidden: s.value,
|
|
36
|
-
percentage: a.value,
|
|
37
|
-
shown: o.value
|
|
38
|
-
})
|
|
39
|
-
]),
|
|
40
|
-
_: 3
|
|
41
|
-
}, 512));
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
export {
|
|
45
|
-
M as default
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=index76.js.map
|
package/dist/index76.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index76.js","sources":["../src/components/BbIntersection/BbIntersection.vue"],"sourcesContent":["<template>\n\t<component :is=\"tag\" ref=\"infinitescrolltrigger\" class=\"bb-intersection\">\n\t\t<slot :hidden=\"hidden\" :percentage=\"percentage\" :shown=\"shown\"></slot>\n\t</component>\n</template>\n\n<script setup lang=\"ts\">\nimport type { NonVoidElementTag } from '@/types/CommonProps';\nimport { throttle } from '@/utilities/functions/throttle';\nimport { onBeforeUnmount, onMounted, ref } from 'vue';\n\nexport type BbIntersectionProps = {\n\t/**\n\t * Time to wait before emitting intersection value\n\t */\n\tdebounceTime?: number;\n\t/**\n\t * Options used to confgiure the IntersectionObserver\n\t */\n\toptions?: IntersectionObserverInit; // eslint-disable-line no-undef\n} & NonVoidElementTag;\n\nconst props = withDefaults(defineProps<BbIntersectionProps>(), {\n\tdebounceTime: 0,\n\toptions: () => ({\n\t\troot: null,\n\t\tthreshold: [0, 0.2, 0.4, 0.6, 0.8, 1],\n\t}),\n\ttag: 'div',\n});\n\nexport type BbIntersectionEvents = {\n\t(e: 'shown'): void;\n\t(e: 'hidden'): void;\n\t(e: 'intersected', value: number): void;\n};\n\nconst emit = defineEmits<BbIntersectionEvents>();\n\ndefineSlots<{\n\tdefault?: (props: {\n\t\thidden: boolean;\n\t\tpercentage: number;\n\t\tshown: boolean;\n\t}) => any;\n}>();\n\nconst observer = ref<IntersectionObserver | null>(null);\nconst infinitescrolltrigger = ref<Element | null>(null);\nconst shown = ref(false);\nconst hidden = ref(true);\nconst percentage = ref(0);\n\nonMounted(() => {\n\tobserver.value = new IntersectionObserver((entries) => {\n\t\thandleIntersect(entries[0]);\n\t}, props.options);\n\tif (infinitescrolltrigger.value) {\n\t\tobserver.value.observe(infinitescrolltrigger.value);\n\t}\n});\nonBeforeUnmount(() => {\n\tif (observer.value) observer.value.disconnect();\n});\n\nconst handleIntersect = throttle((entry: IntersectionObserverEntry) => {\n\tif (entry.isIntersecting) {\n\t\tpercentage.value = Math.trunc(entry.intersectionRatio * 100);\n\t\tif (entry.intersectionRatio === 1) {\n\t\t\tshown.value = true;\n\t\t\thidden.value = false;\n\t\t\temit('shown');\n\t\t} else {\n\t\t\tshown.value = false;\n\t\t\thidden.value = false;\n\t\t\temitIntersected(Math.trunc(entry.intersectionRatio * 100));\n\t\t}\n\t} else {\n\t\tshown.value = false;\n\t\thidden.value = true;\n\t\temit('hidden');\n\t}\n});\n\nconst emitIntersected = throttle((percentage: number) => {\n\temit('intersected', percentage);\n}, props.debounceTime);\n</script>\n"],"names":["props","__props","emit","__emit","observer","ref","infinitescrolltrigger","shown","hidden","percentage","onMounted","entries","handleIntersect","onBeforeUnmount","throttle","entry","emitIntersected"],"mappings":";;;;;;;;;;;;;;AAsBA,UAAMA,IAAQC,GAeRC,IAAOC,GAUPC,IAAWC,EAAiC,IAAI,GAChDC,IAAwBD,EAAoB,IAAI,GAChDE,IAAQF,EAAI,EAAK,GACjBG,IAASH,EAAI,EAAI,GACjBI,IAAaJ,EAAI,CAAC;AAExB,IAAAK,EAAU,MAAM;AACf,MAAAN,EAAS,QAAQ,IAAI,qBAAqB,CAACO,MAAY;AACtC,QAAAC,EAAAD,EAAQ,CAAC,CAAC;AAAA,MAAA,GACxBX,EAAM,OAAO,GACZM,EAAsB,SAChBF,EAAA,MAAM,QAAQE,EAAsB,KAAK;AAAA,IACnD,CACA,GACDO,EAAgB,MAAM;AACrB,MAAIT,EAAS,SAAgBA,EAAA,MAAM,WAAW;AAAA,IAAA,CAC9C;AAEK,UAAAQ,IAAkBE,EAAS,CAACC,MAAqC;AACtE,MAAIA,EAAM,kBACTN,EAAW,QAAQ,KAAK,MAAMM,EAAM,oBAAoB,GAAG,GACvDA,EAAM,sBAAsB,KAC/BR,EAAM,QAAQ,IACdC,EAAO,QAAQ,IACfN,EAAK,OAAO,MAEZK,EAAM,QAAQ,IACdC,EAAO,QAAQ,IACfQ,EAAgB,KAAK,MAAMD,EAAM,oBAAoB,GAAG,CAAC,OAG1DR,EAAM,QAAQ,IACdC,EAAO,QAAQ,IACfN,EAAK,QAAQ;AAAA,IACd,CACA,GAEKc,IAAkBF,EAAS,CAACL,MAAuB;AACxD,MAAAP,EAAK,eAAeO,CAAU;AAAA,IAAA,GAC5BT,EAAM,YAAY;;;;;;;;;;;;;;;;;"}
|
package/dist/index93.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index93.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index99.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index99.js","sources":["../src/components/BbSwitch/BbSwitch.vue"],"sourcesContent":["<template>\n\t<BaseInputContainer\n\t\t:id=\"id\"\n\t\tclass=\"bb-switch\"\n\t\t:direction=\"direction\"\n\t\t:errors=\"errors\"\n\t\t:has-errors=\"hasErrors\"\n\t\t:hide-label=\"hideLabel\"\n\t\t:hint=\"hint\"\n\t\t:input-position=\"inputPosition\"\n\t\t:label=\"label\"\n\t\t:label-position=\"labelPosition\"\n\t\t:label-tag=\"'span'\"\n\t\t:name=\"name\"\n\t\t:reverse=\"reverse\"\n\t\t:show-hint=\"showHint\"\n\t\t:tag=\"'label'\"\n\t>\n\t\t<template #label=\"data\"><slot name=\"label\" v-bind=\"data\"></slot></template>\n\t\t<template #input=\"{ id, name, hasErrors, ariaDescribedby }\">\n\t\t\t<BaseSwitch\n\t\t\t\t:id=\"id\"\n\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t:checked=\"checked\"\n\t\t\t\t:color=\"color\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:false-value=\"falseValue\"\n\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t:indeterminate=\"indeterminate\"\n\t\t\t\t:model-value=\"modelValue\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t:required=\"required\"\n\t\t\t\t:submit-when-false=\"submitWhenFalse\"\n\t\t\t\t:true-value=\"trueValue\"\n\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t>\n\t\t\t\t<template #icon=\"data\"\n\t\t\t\t\t><slot name=\"icon\" v-bind=\"data\" :text=\"label\"\n\t\t\t\t/></template>\n\t\t\t</BaseSwitch>\n\t\t</template>\n\t</BaseInputContainer>\n</template>\n\n<script setup lang=\"ts\">\nimport BaseInputContainer from '../BaseInputContainer/BaseInputContainer.vue';\nimport BaseSwitch from '../BaseSwitch/BaseSwitch.vue';\nimport { computed, ref } from 'vue';\nimport type { SlotAttributes } from '../BaseCheckbox/BaseCheckbox.vue';\nimport type {\n\tBbCheckboxEvents,\n\tBbCheckboxProps,\n} from '../BbCheckbox/BbCheckbox.vue';\n\nexport type BbSwitchProps = BbCheckboxProps;\n\nexport type BbSwitchEvents = BbCheckboxEvents;\n\nconst props = withDefaults(defineProps<BbSwitchProps>(), {\n\tdirection: 'auto',\n\treverse: true,\n});\n\nconst emit = defineEmits<BbSwitchEvents>();\n\ndefineSlots<{\n\tlabel?: (props: { text: string; hasErrors: boolean }) => any;\n\ticon?: (props: SlotAttributes & { text: string }) => any;\n}>();\n\nconst active = ref(false);\nconst showHint = computed(() => props.persistentHint || active.value);\n\nconst eventListeners = {\n\tonBlur: (event: FocusEvent) => {\n\t\tactive.value = false;\n\t\temit('blur', event);\n\t},\n\tonChange: (event: Event) => emit('change', event),\n\tonClick: (event: MouseEvent) => emit('click', event),\n\tonFocus: (event: FocusEvent) => {\n\t\tactive.value = true;\n\t\temit('focus', event);\n\t},\n\tonInput: (event: Event) => emit('input', event),\n\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n\t'onUpdate:modelValue': (value: any) => emit('update:modelValue', value),\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbSwitch';\n</style>\n"],"names":["props","__props","emit","__emit","active","ref","showHint","computed","eventListeners","event","value"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA,UAAMA,IAAQC,GAKRC,IAAOC,GAOPC,IAASC,EAAI,EAAK,GAClBC,IAAWC,EAAS,MAAMP,EAAM,kBAAkBI,EAAO,KAAK,GAE9DI,IAAiB;AAAA,MACtB,QAAQ,CAACC,MAAsB;AAC9B,QAAAL,EAAO,QAAQ,IACfF,EAAK,QAAQO,CAAK;AAAA,MACnB;AAAA,MACA,UAAU,CAACA,MAAiBP,EAAK,UAAUO,CAAK;AAAA,MAChD,SAAS,CAACA,MAAsBP,EAAK,SAASO,CAAK;AAAA,MACnD,SAAS,CAACA,MAAsB;AAC/B,QAAAL,EAAO,QAAQ,IACfF,EAAK,SAASO,CAAK;AAAA,MACpB;AAAA,MACA,SAAS,CAACA,MAAiBP,EAAK,SAASO,CAAK;AAAA,MAC9C,WAAW,CAACA,MAAyBP,EAAK,WAAWO,CAAK;AAAA,MAC1D,aAAa,CAACA,MAAsBP,EAAK,aAAaO,CAAK;AAAA,MAC3D,WAAW,CAACA,MAAsBP,EAAK,WAAWO,CAAK;AAAA,MACvD,uBAAuB,CAACC,MAAeR,EAAK,qBAAqBQ,CAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|