bitboss-ui 2.0.7 → 2.0.9
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/index.js +139 -138
- package/dist/index.js.map +1 -1
- package/dist/index10.js +7 -78
- package/dist/index10.js.map +1 -1
- package/dist/{index100.js → index101.js} +3 -3
- package/dist/{index100.js.map → index101.js.map} +1 -1
- package/dist/{index102.js → index103.js} +3 -3
- package/dist/{index102.js.map → index103.js.map} +1 -1
- package/dist/{index104.js → index105.js} +8 -8
- package/dist/{index104.js.map → index105.js.map} +1 -1
- package/dist/{index106.js → index107.js} +9 -9
- package/dist/{index106.js.map → index107.js.map} +1 -1
- package/dist/{index108.js → index109.js} +3 -3
- package/dist/{index108.js.map → index109.js.map} +1 -1
- package/dist/index11.js +74 -35
- package/dist/index11.js.map +1 -1
- package/dist/{index110.js → index111.js} +3 -3
- package/dist/{index110.js.map → index111.js.map} +1 -1
- package/dist/{index112.js → index113.js} +3 -3
- package/dist/{index112.js.map → index113.js.map} +1 -1
- package/dist/{index114.js → index115.js} +3 -3
- package/dist/{index114.js.map → index115.js.map} +1 -1
- package/dist/{index116.js → index117.js} +8 -8
- package/dist/{index116.js.map → index117.js.map} +1 -1
- package/dist/{index118.js → index119.js} +2 -2
- package/dist/{index118.js.map → index119.js.map} +1 -1
- package/dist/index12.js +36 -189
- package/dist/index12.js.map +1 -1
- package/dist/index121.js +34 -38
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +38 -38
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +39 -42
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +43 -31
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +35 -2
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +2 -21
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +21 -2
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +2 -312
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +309 -21
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +189 -78
- package/dist/index13.js.map +1 -1
- package/dist/index130.js +24 -2
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +2 -5
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +5 -9
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +8 -5
- 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 +85 -0
- package/dist/index14.js.map +1 -0
- 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 +1 -1
- package/dist/{index15.js → index16.js} +4 -4
- package/dist/{index15.js.map → index16.js.map} +1 -1
- package/dist/index160.js +2 -2
- package/dist/{index162.js → index161.js} +1 -1
- package/dist/index161.js.map +1 -0
- package/dist/index163.js +6 -0
- package/dist/index163.js.map +1 -0
- 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 +1 -1
- package/dist/index170.js +2 -2
- package/dist/index171.js +6 -0
- package/dist/index171.js.map +1 -0
- 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/{index17.js → index18.js} +4 -4
- package/dist/{index17.js.map → 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 +1 -1
- package/dist/index184.js +1 -1
- package/dist/{index186.js → index185.js} +1 -1
- package/dist/index185.js.map +1 -0
- package/dist/index187.js +6 -0
- package/dist/index187.js.map +1 -0
- 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 +1 -1
- package/dist/index198.js +3 -81
- package/dist/index198.js.map +1 -1
- package/dist/{index19.js → index20.js} +19 -18
- package/dist/{index19.js.map → index20.js.map} +1 -1
- package/dist/index200.js +126 -2
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +5 -4
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +123 -2
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +19 -8
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +14 -124
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +16 -5
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +2 -123
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +2 -19
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +35 -16
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +172 -14
- package/dist/index209.js.map +1 -1
- package/dist/index210.js +6 -2
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +44 -2
- package/dist/index211.js.map +1 -1
- package/dist/index213.js +12 -173
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +5 -6
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +369 -43
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +161 -0
- package/dist/index216.js.map +1 -0
- package/dist/index217.js +84 -13
- package/dist/index217.js.map +1 -1
- package/dist/index219.js +67 -355
- package/dist/index219.js.map +1 -1
- package/dist/{index21.js → index22.js} +21 -21
- package/dist/{index21.js.map → index22.js.map} +1 -1
- package/dist/index220.js +8 -19
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +3 -27
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +2 -3
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +4 -249
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +2 -52
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +3 -44
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +7 -5
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +19 -49
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +27 -3
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +3 -3
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +249 -7
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +50 -156
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +38 -78
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +8 -0
- package/dist/index233.js.map +1 -0
- package/dist/index234.js +49 -2
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +2 -18
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +2 -106
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +21 -0
- package/dist/index237.js.map +1 -0
- package/dist/index238.js +53 -47
- package/dist/index238.js.map +1 -1
- package/dist/{index23.js → index24.js} +8 -8
- package/dist/{index23.js.map → index24.js.map} +1 -1
- package/dist/index240.js +100 -2
- package/dist/index240.js.map +1 -1
- package/dist/index242.js +9 -2
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +2 -3
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +3 -6
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +12 -16
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +8 -8
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +9 -23
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +17 -9
- package/dist/index248.js.map +1 -1
- package/dist/index257.js +1 -1
- package/dist/index258.js +1 -1
- package/dist/{index25.js → index26.js} +6 -6
- package/dist/{index25.js.map → index26.js.map} +1 -1
- package/dist/index263.js +224 -2
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +4 -2
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +9 -2
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +5 -1
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +16 -2
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +9 -2
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +23 -28
- package/dist/index269.js.map +1 -1
- package/dist/index270.js +199 -21
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +439 -0
- package/dist/index271.js.map +1 -0
- package/dist/index272.js +121 -218
- package/dist/index272.js.map +1 -1
- package/dist/index274.js +5 -200
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +2 -436
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +2 -127
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +2 -5
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +2 -2
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +2 -9
- package/dist/index279.js.map +1 -1
- package/dist/{index27.js → index28.js} +3 -3
- package/dist/{index27.js.map → index28.js.map} +1 -1
- package/dist/index280.js +2 -69
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +28 -3
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +22 -12
- package/dist/index282.js.map +1 -1
- package/dist/index284.js +2 -17
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +68 -2
- package/dist/index285.js.map +1 -1
- package/dist/index287.js +3 -211
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +211 -15
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +15 -4
- package/dist/index289.js.map +1 -1
- package/dist/index290.js +11 -4
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +34 -58
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +4 -35
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +4 -7
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +57 -17
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +2 -7
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +7 -2
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +6 -10
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +17 -45
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +50 -0
- package/dist/index299.js.map +1 -0
- package/dist/{index29.js → index30.js} +3 -3
- package/dist/{index29.js.map → index30.js.map} +1 -1
- package/dist/index301.js +416 -42
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +50 -0
- package/dist/index302.js.map +1 -0
- package/dist/{index31.js → index32.js} +4 -4
- package/dist/{index31.js.map → index32.js.map} +1 -1
- package/dist/{index33.js → index34.js} +5 -5
- package/dist/{index33.js.map → index34.js.map} +1 -1
- package/dist/{index35.js → index36.js} +23 -22
- package/dist/{index35.js.map → index36.js.map} +1 -1
- package/dist/{index37.js → index38.js} +7 -7
- package/dist/{index37.js.map → index38.js.map} +1 -1
- package/dist/{index39.js → index40.js} +3 -3
- package/dist/{index39.js.map → index40.js.map} +1 -1
- package/dist/{index41.js → index42.js} +4 -4
- package/dist/{index41.js.map → index42.js.map} +1 -1
- package/dist/{index43.js → index44.js} +12 -11
- package/dist/{index43.js.map → index44.js.map} +1 -1
- package/dist/{index45.js → index46.js} +4 -4
- package/dist/{index45.js.map → index46.js.map} +1 -1
- package/dist/{index47.js → index48.js} +3 -3
- package/dist/{index47.js.map → index48.js.map} +1 -1
- package/dist/index5.js +14 -40
- package/dist/index5.js.map +1 -1
- package/dist/{index49.js → index50.js} +4 -4
- package/dist/{index49.js.map → index50.js.map} +1 -1
- package/dist/{index51.js → index52.js} +3 -3
- package/dist/{index51.js.map → index52.js.map} +1 -1
- package/dist/{index53.js → index54.js} +3 -3
- package/dist/{index53.js.map → index54.js.map} +1 -1
- package/dist/{index55.js → index56.js} +3 -3
- package/dist/{index55.js.map → index56.js.map} +1 -1
- package/dist/{index57.js → index58.js} +2 -2
- package/dist/{index57.js.map → index58.js.map} +1 -1
- package/dist/index6.js +38 -76
- package/dist/index6.js.map +1 -1
- package/dist/{index59.js → index60.js} +14 -13
- package/dist/{index59.js.map → index60.js.map} +1 -1
- package/dist/{index61.js → index62.js} +3 -3
- package/dist/{index61.js.map → index62.js.map} +1 -1
- package/dist/{index63.js → index64.js} +3 -3
- package/dist/{index63.js.map → index64.js.map} +1 -1
- package/dist/{index65.js → index66.js} +5 -5
- package/dist/{index65.js.map → index66.js.map} +1 -1
- package/dist/{index67.js → index68.js} +3 -3
- package/dist/{index67.js.map → index68.js.map} +1 -1
- package/dist/index7.js +78 -62
- package/dist/index7.js.map +1 -1
- package/dist/{index69.js → index70.js} +2 -2
- package/dist/{index69.js.map → index70.js.map} +1 -1
- package/dist/{index71.js → index72.js} +9 -9
- package/dist/{index71.js.map → index72.js.map} +1 -1
- package/dist/{index73.js → index74.js} +3 -3
- package/dist/{index73.js.map → index74.js.map} +1 -1
- package/dist/{index75.js → index76.js} +5 -5
- package/dist/{index75.js.map → index76.js.map} +1 -1
- package/dist/index78.js +37 -120
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +130 -0
- package/dist/index79.js.map +1 -0
- package/dist/index8.js +60 -18
- package/dist/index8.js.map +1 -1
- package/dist/{index80.js → index81.js} +5 -5
- package/dist/{index80.js.map → index81.js.map} +1 -1
- package/dist/{index82.js → index83.js} +25 -24
- package/dist/{index82.js.map → index83.js.map} +1 -1
- package/dist/{index84.js → index85.js} +7 -7
- package/dist/{index84.js.map → index85.js.map} +1 -1
- package/dist/{index86.js → index87.js} +2 -2
- package/dist/{index86.js.map → index87.js.map} +1 -1
- package/dist/{index88.js → index89.js} +3 -3
- package/dist/{index88.js.map → index89.js.map} +1 -1
- package/dist/index9.js +19 -7
- package/dist/index9.js.map +1 -1
- package/dist/{index90.js → index91.js} +3 -3
- package/dist/{index90.js.map → index91.js.map} +1 -1
- package/dist/{index92.js → index93.js} +3 -3
- package/dist/{index92.js.map → index93.js.map} +1 -1
- package/dist/{index94.js → index95.js} +1 -1
- package/dist/index95.js.map +1 -0
- package/dist/{index96.js → index97.js} +3 -3
- package/dist/{index96.js.map → index97.js.map} +1 -1
- package/dist/{index98.js → index99.js} +3 -3
- package/dist/{index98.js.map → index99.js.map} +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/index120.js +0 -43
- package/dist/index120.js.map +0 -1
- package/dist/index162.js.map +0 -1
- package/dist/index164.js +0 -6
- package/dist/index164.js.map +0 -1
- package/dist/index172.js +0 -5
- package/dist/index172.js.map +0 -1
- package/dist/index186.js.map +0 -1
- package/dist/index188.js +0 -6
- package/dist/index188.js.map +0 -1
- package/dist/index212.js +0 -38
- package/dist/index212.js.map +0 -1
- package/dist/index218.js +0 -8
- package/dist/index218.js.map +0 -1
- package/dist/index241.js +0 -13
- package/dist/index241.js.map +0 -1
- package/dist/index283.js +0 -12
- package/dist/index283.js.map +0 -1
- package/dist/index300.js +0 -424
- package/dist/index300.js.map +0 -1
- package/dist/index4.js +0 -17
- package/dist/index4.js.map +0 -1
- package/dist/index77.js +0 -47
- package/dist/index77.js.map +0 -1
- package/dist/index94.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"index113.js","sources":["../src/components/BbTextInput/BbTextInput.vue"],"sourcesContent":["<template>\n\t<BaseInputContainer\n\t\t:id=\"id\"\n\t\tclass=\"bb-text-input\"\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:label=\"label\"\n\t\t:label-position=\"labelPosition\"\n\t\t:model-value=\"modelValue\"\n\t\t:name=\"name\"\n\t\t:reverse=\"reverse\"\n\t\t:show-hint=\"showHint\"\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<BaseTextInput\n\t\t\t\t:id=\"id\"\n\t\t\t\t:append:icon=\"props['append:icon']\"\n\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t:autocomplete=\"autocomplete\"\n\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t:loading=\"loading\"\n\t\t\t\t:model-value=\"modelValue\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t:prepend:icon=\"props['prepend:icon']\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t:required=\"required\"\n\t\t\t\t:type=\"type\"\n\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t>\n\t\t\t\t<template #append-outer><slot name=\"append-outer\" /></template>\n\t\t\t\t<template #append><slot name=\"append\" /></template>\n\t\t\t\t<template #prefix><slot name=\"prefix\" /></template>\n\t\t\t\t<template #suffix><slot name=\"suffix\" /></template>\n\t\t\t\t<template #prepend><slot name=\"prepend\" /></template>\n\t\t\t\t<template #prepend-outer><slot name=\"prepend-outer\" /></template>\n\t\t\t</BaseTextInput>\n\t\t</template>\n\t</BaseInputContainer>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed } from 'vue';\nimport BaseInputContainer from '../BaseInputContainer/BaseInputContainer.vue';\nimport BaseTextInput from '../BaseTextInput/BaseTextInput.vue';\nimport type {\n\tBaseTextInputEvents,\n\tBaseTextInputSlots,\n} from '../BaseTextInput/BaseTextInput.vue';\nimport type { HTMLAttributes, InputHTMLAttributes } from 'vue';\n\nexport type BbTextInputProps = {\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\tautocomplete?: InputHTMLAttributes['autocomplete'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Direction of the layout of the component. Can either be a predefined value or a pattern separated by a space like `xx xxxxx`.\n\t */\n\tdirection?: 'horizontal' | 'vertical' | 'auto' | string;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Can be a string or an array of string containing the messages to display.\n\t */\n\terrors?: string | string[];\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 * Visually hides the label of the input while maintaining accessibility.\n\t */\n\thideLabel?: boolean;\n\n\t/**\n\t * Text box to be displayed near the input, usually to indicate instructions.\n\t */\n\thint?: string;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Text content of the label of the element.\n\t */\n\tlabel: string;\n\n\t/**\n\t * Sets the text alignment of the label.\n\t */\n\tlabelPosition?: 'left' | 'center' | 'right';\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 my 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 * Keeps the hint displayed.\n\t */\n\tpersistentHint?: boolean;\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 * Reverses the layout. Applicable in every direction the order of the label and the input is swapped.\n\t */\n\treverse?: boolean;\n\n\t/**\n\t * Type of the input. Returns the content type of the object.\n\t */\n\ttype?: HTMLInputElement['type'];\n};\n\nconst props = defineProps<BbTextInputProps>();\n\nexport type BbTextInputEvents = BaseTextInputEvents;\nconst emit = defineEmits<BaseTextInputEvents>();\n\nexport type BbTextInputSlots = BaseTextInputSlots & {\n\tlabel?: (props: { text: string; hasErrors: boolean }) => any;\n};\n\ndefineSlots<BbTextInputSlots>();\n\nconst active = ref(false);\nconst showHint = computed(() => props.persistentHint || active.value);\n\n/**\n * These events are just propagated\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: string | null) =>\n\t\temit('update:modelValue', value),\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbTextInput';\n</style>\n"],"names":["props","__props","emit","__emit","active","ref","showHint","computed","eventListeners","event","value"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2KA,UAAMA,IAAQC,GAGRC,IAAOC,GAQPC,IAASC,EAAI,EAAK,GAClBC,IAAWC,EAAS,MAAMP,EAAM,kBAAkBI,EAAO,KAAK,GAK9DI,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,MACvBR,EAAK,qBAAqBQ,CAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as s, openBlock as e, createBlock as o, Teleport as l, createElementVNode as c, normalizeClass as m, createVNode as i, TransitionGroup as p, withCtx as u, createElementBlock as f, Fragment as d, renderList as _, unref as r, mergeProps as b } from "vue";
|
|
2
|
-
import { state as k, useToast as C } from "./
|
|
3
|
-
import B from "./
|
|
2
|
+
import { state as k, useToast as C } from "./index12.js";
|
|
3
|
+
import B from "./index285.js";
|
|
4
4
|
const N = /* @__PURE__ */ s({
|
|
5
5
|
__name: "BbToast",
|
|
6
6
|
props: {
|
|
@@ -28,4 +28,4 @@ const N = /* @__PURE__ */ s({
|
|
|
28
28
|
export {
|
|
29
29
|
N as default
|
|
30
30
|
};
|
|
31
|
-
//# sourceMappingURL=
|
|
31
|
+
//# sourceMappingURL=index115.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"index115.js","sources":["../src/components/BbToast/BbToast.vue"],"sourcesContent":["<template>\n\t<teleport to=\"body\">\n\t\t<div class=\"bb-toast\" :class=\"{ [`bb-toast--${placement}`]: true }\">\n\t\t\t<TransitionGroup name=\"toast\">\n\t\t\t\t<BbToastMessage\n\t\t\t\t\tv-for=\"message in state.stack\"\n\t\t\t\t\t:key=\"message.id\"\n\t\t\t\t\tv-bind=\"message\"\n\t\t\t\t\t@click:close=\"dismiss\"\n\t\t\t\t/>\n\t\t\t</TransitionGroup>\n\t\t</div>\n\t</teleport>\n</template>\n\n<script setup lang=\"ts\">\nimport { state, useToast } from '../../composables/useToast';\nconst { dismiss } = useToast();\n\nimport BbToastMessage from './BbToastMessage.vue';\nexport type BbToastProps = {\n\t/**\n\t * Placement of the messages on the screen.\n\t */\n\tplacement?:\n\t\t| 'bottom'\n\t\t| 'bottom-start'\n\t\t| 'bottom-end'\n\t\t| 'top'\n\t\t| 'top-start'\n\t\t| 'top-end';\n};\n\nwithDefaults(defineProps<BbToastProps>(), {\n\tplacement: 'bottom',\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbToast';\n</style>\n"],"names":["dismiss","useToast"],"mappings":";;;;;;;;;AAiBM,UAAA,EAAE,SAAAA,MAAYC;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineComponent as A, ref as o, computed as $, watch as I, openBlock as b, createElementBlock as D, mergeProps as L, createElementVNode as c, renderSlot as M, normalizeProps as R, guardReactiveProps as U, unref as u, createBlock as O, Teleport as W, normalizeClass as j, normalizeStyle as q, withCtx as G, createCommentVNode as P } from "vue";
|
|
2
|
-
import { useFloating as J, arrow as K } from "./
|
|
3
|
-
import { useId as Q } from "./
|
|
4
|
-
import { wait as T } from "./
|
|
5
|
-
import X from "./
|
|
2
|
+
import { useFloating as J, arrow as K } from "./index200.js";
|
|
3
|
+
import { useId as Q } from "./index9.js";
|
|
4
|
+
import { wait as T } from "./index128.js";
|
|
5
|
+
import X from "./index14.js";
|
|
6
6
|
/* empty css */
|
|
7
|
-
import { throttle as w } from "./
|
|
8
|
-
import { waitFor as Y } from "./
|
|
9
|
-
import { autoUpdate as Z, flip as ee, shift as te, hide as oe } from "./
|
|
7
|
+
import { throttle as w } from "./index225.js";
|
|
8
|
+
import { waitFor as Y } from "./index210.js";
|
|
9
|
+
import { autoUpdate as Z, flip as ee, shift as te, hide as oe } from "./index215.js";
|
|
10
10
|
const ae = { class: "bb-tooltip__bubble" }, ne = /* @__PURE__ */ c("svg", {
|
|
11
11
|
fill: "none",
|
|
12
12
|
viewBox: "0 0 24 24",
|
|
@@ -161,4 +161,4 @@ const ae = { class: "bb-tooltip__bubble" }, ne = /* @__PURE__ */ c("svg", {
|
|
|
161
161
|
export {
|
|
162
162
|
fe as default
|
|
163
163
|
};
|
|
164
|
-
//# sourceMappingURL=
|
|
164
|
+
//# sourceMappingURL=index117.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"index117.js","sources":["../src/components/BbTooltip/BbTooltip.vue"],"sourcesContent":["<template>\n\t<span class=\"bb-tooltip\" v-bind=\"attributes\">\n\t\t<span ref=\"wrapper\" class=\"bb-tooltip__wrapper\">\n\t\t\t<slot\n\t\t\t\tname=\"activator\"\n\t\t\t\tv-bind=\"{\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...(hasOpenedOnce ? { 'aria-describedby': id } : {}),\n\t\t\t\t\t\tonMouseenter,\n\t\t\t\t\t\tonFocus,\n\t\t\t\t\t\tonBlur: closeTooltip,\n\t\t\t\t\t\tdisabled: disabled,\n\t\t\t\t\t},\n\t\t\t\t\tclosed: closed,\n\t\t\t\t\tclosing: closing,\n\t\t\t\t\tdisabled: disabled,\n\t\t\t\t\topen: open,\n\t\t\t\t\topening: opening,\n\t\t\t\t\tplacement: placement,\n\t\t\t\t}\"\n\t\t\t></slot>\n\t\t</span>\n\t\t<teleport to=\"body\">\n\t\t\t<span\n\t\t\t\tv-if=\"hasOpenedOnce || eager\"\n\t\t\t\t:id=\"id\"\n\t\t\t\tref=\"content\"\n\t\t\t\tclass=\"bb-tooltip__bubble-container\"\n\t\t\t\t:class=\"{\n\t\t\t\t\t[`bb-tooltip__bubble-container--${placement}`]: true,\n\t\t\t\t\t[`bb-tooltip__bubble-container--${theme}`]: theme,\n\t\t\t\t\t'bb-tooltip__bubble-container--hidden': closed,\n\t\t\t\t\t'bb-tooltip__bubble-container--closing': closing,\n\t\t\t\t\t'bb-tooltip__bubble-container--opening': opening,\n\t\t\t\t\t'bb-tooltip__bubble-container--open': open,\n\t\t\t\t}\"\n\t\t\t\t:style=\"{\n\t\t\t\t\t...floatingStyles,\n\t\t\t\t\ttransitionDuration: `${props.transitionDuration}ms`,\n\t\t\t\t}\"\n\t\t\t>\n\t\t\t\t<span\n\t\t\t\t\tref=\"bubblearrow\"\n\t\t\t\t\tclass=\"bb-tooltip__arrow\"\n\t\t\t\t\tv-bind=\"arrowAttributes\"\n\t\t\t\t></span>\n\t\t\t\t<span class=\"bb-tooltip__bubble\">\n\t\t\t\t\t<BaseButton\n\t\t\t\t\t\tv-if=\"showClose\"\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\tclass=\"bb-tooltip__close\"\n\t\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\t\t@click=\"onClickClose\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\td=\"M23 23L1 1M23 1L1 23\"\n\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</BaseButton>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t</teleport>\n\t</span>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue';\nimport {\n\tuseFloating,\n\tautoUpdate,\n\tflip,\n\tshift,\n\tarrow,\n\thide,\n} from '@floating-ui/vue';\nimport { useId } from '@/composables/useId';\nimport { wait } from '@/utilities/functions/wait';\nimport BaseButton from '../BaseButton/BaseButton.vue';\nimport type { CommonProps } from '@/types/CommonProps';\nimport type { Placement } from '@floating-ui/vue';\nimport { throttle } from '@/utilities/functions/throttle';\nimport { waitFor } from '@/utilities/functions/waitFor';\n\nexport type BbTooltipProps = Pick<\n\tCommonProps,\n\t| 'arrowPadding'\n\t| 'block'\n\t| 'disabled'\n\t| 'eager'\n\t| 'id'\n\t| 'padding'\n\t| 'placement'\n\t| 'showClose'\n\t| 'theme'\n\t| 'transitionDuration'\n>;\n\nconst props = withDefaults(defineProps<BbTooltipProps>(), {\n\tarrowPadding: 10,\n\tpadding: 10,\n\tplacement: 'top',\n\tshowClose: true,\n\ttheme: 'default',\n\ttransitionDuration: 250,\n});\n\ntype BbTooltipSlots = {\n\tactivator?: (props: {\n\t\tprops: {\n\t\t\t'aria-describedby': string;\n\t\t\tonMouseenter: typeof onMouseenter;\n\t\t\tonFocus: typeof onFocus;\n\t\t\tonBlur: typeof closeTooltip;\n\t\t};\n\t\tclosed: boolean;\n\t\tclosing: boolean;\n\t\tdisabled?: boolean;\n\t\topen: boolean;\n\t\topening: boolean;\n\t\tplacement: Placement;\n\t}) => any;\n\tdefault?: (props: object) => any;\n};\n\ndefineSlots<BbTooltipSlots>();\n\nconst id = `bb_${props.id ?? useId().id.value}`;\n\nconst wrapper = ref<HTMLElement>();\nconst content = ref<HTMLElement>();\nconst bubblearrow = ref<HTMLElement>();\n\nconst { floatingStyles, placement, middlewareData } = useFloating(\n\twrapper,\n\tcontent,\n\t{\n\t\tplacement: props.placement,\n\t\twhileElementsMounted: autoUpdate,\n\t\tmiddleware: [\n\t\t\tflip(),\n\t\t\tshift({ padding: props.padding }),\n\t\t\tarrow({\n\t\t\t\telement: bubblearrow,\n\t\t\t\tpadding: props.arrowPadding,\n\t\t\t}),\n\t\t\thide(),\n\t\t],\n\t}\n);\n\nlet stopWatcher = () => {};\n\nconst canOpen = ref(true);\n\nconst opening = ref(false);\nconst open = ref(false);\nconst closing = ref(false);\nconst closed = ref(true);\n\nconst arrowAttributes = computed(() => {\n\tif (middlewareData.value.arrow) {\n\t\tconst { x, y } = middlewareData.value.arrow;\n\t\treturn {\n\t\t\tstyle: {\n\t\t\t\tleft: `${x}px`,\n\t\t\t\ttop: `${y}px`,\n\t\t\t},\n\t\t};\n\t}\n\treturn undefined;\n});\n\nconst onMouseenter = () => {\n\tif (open.value || opening.value || props.disabled) return;\n\topenTooltip();\n\tdocument.addEventListener('mouseover', onMouseOver, { passive: true });\n\tdocument.addEventListener('keydown', onEsc, { passive: true });\n};\n\nconst onFocus = onMouseenter;\n\nconst onMouseOver = throttle((event: Event) => {\n\tconst target = event.target;\n\tif (!target) return;\n\tif (target instanceof HTMLElement) {\n\t\tlet isOutside = true;\n\n\t\tif (wrapper.value) {\n\t\t\tif (wrapper.value.contains(target)) {\n\t\t\t\tisOutside = false;\n\t\t\t}\n\t\t}\n\t\tif (content.value) {\n\t\t\tif (content.value.contains(target)) {\n\t\t\t\tisOutside = false;\n\t\t\t}\n\t\t}\n\n\t\tif (isOutside) {\n\t\t\tcloseTooltip();\n\t\t}\n\t}\n}, props.transitionDuration);\n\nconst onEsc = (event: KeyboardEvent) => {\n\tif (open.value) {\n\t\tif (event.key === 'Escape') {\n\t\t\tcloseTooltip();\n\t\t}\n\t}\n};\n\n/* On click of close button tooltip is disallowed from reappearing */\nconst onClickClose = () => {\n\tcanOpen.value = false;\n\tcloseTooltip();\n};\n\nconst hasOpenedOnce = ref(false);\nconst openTooltip = throttle(async () => {\n\tif (!canOpen.value) return;\n\thasOpenedOnce.value = true;\n\tclosed.value = false;\n\tclosing.value = false;\n\topening.value = true;\n\tawait wait(50);\n\topen.value = true;\n\topening.value = false;\n\tstopWatcher = watch(\n\t\t() => middlewareData.value.hide?.referenceHidden,\n\t\tasync (value) => {\n\t\t\tif (!closing.value && !closed.value && value) {\n\t\t\t\tawait closeTooltip();\n\t\t\t}\n\t\t}\n\t);\n}, props.transitionDuration);\n\nconst closeTooltip = throttle(async () => {\n\tawait waitFor(() => !opening.value);\n\tdocument.removeEventListener('mouseover', onMouseOver);\n\tdocument.removeEventListener('keydown', onEsc);\n\topen.value = false;\n\topening.value = false;\n\tclosing.value = true;\n\tawait wait(props.transitionDuration);\n\tclosing.value = false;\n\tclosed.value = true;\n\tstopWatcher();\n}, props.transitionDuration);\n\nconst attributes = computed(() => {\n\tconst classes = {\n\t\t'bb-tooltip--block': props.block,\n\t\t[`bb-tooltip--theme-${props.theme}`]: props.theme,\n\t};\n\treturn {\n\t\tclass: classes,\n\t};\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbTooltip';\n</style>\n"],"names":["props","__props","id","useId","wrapper","ref","content","bubblearrow","floatingStyles","placement","middlewareData","useFloating","autoUpdate","flip","shift","arrow","hide","stopWatcher","canOpen","opening","open","closing","closed","arrowAttributes","computed","x","y","onMouseenter","openTooltip","onMouseOver","onEsc","onFocus","throttle","event","target","isOutside","closeTooltip","onClickClose","hasOpenedOnce","wait","watch","_a","value","waitFor","attributes"],"mappings":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as $, computed as g, resolveComponent as y, openBlock as f, createElementBlock as i, Fragment as k, renderList as h, normalizeClass as b, createElementVNode as s, renderSlot as t, createVNode as v, createSlots as B, withCtx as _, mergeProps as C } from "vue";
|
|
2
|
-
import { flattenTree as T } from "./
|
|
2
|
+
import { flattenTree as T } from "./index274.js";
|
|
3
3
|
const w = { class: "bb-tree-row" }, E = { class: "bb-tree-main-content" }, N = /* @__PURE__ */ $({
|
|
4
4
|
__name: "BbTree",
|
|
5
5
|
props: {
|
|
@@ -120,4 +120,4 @@ const w = { class: "bb-tree-row" }, E = { class: "bb-tree-main-content" }, N = /
|
|
|
120
120
|
export {
|
|
121
121
|
N as default
|
|
122
122
|
};
|
|
123
|
-
//# sourceMappingURL=
|
|
123
|
+
//# sourceMappingURL=index119.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"index119.js","sources":["../src/components/BbTree/BbTree.vue"],"sourcesContent":["<template>\n\t<div\n\t\tv-for=\"item in internalItems\"\n\t\t:key=\"item.identifier\"\n\t\tclass=\"bb-tree\"\n\t\t:class=\"{\n\t\t\t[`bb-tree--depth-${item.depth}`]: true,\n\t\t\t'bb-tree--open': item.open,\n\t\t}\"\n\t>\n\t\t<div class=\"bb-tree-row\">\n\t\t\t<div class=\"bb-tree-main-content\">\n\t\t\t\t<!-- Slot for a speciifc item -->\n\t\t\t\t<slot\n\t\t\t\t\tv-if=\"$slots[item.identifier]\"\n\t\t\t\t\t:depth=\"item.depth\"\n\t\t\t\t\t:expandable=\"item.expandable\"\n\t\t\t\t\t:identifier=\"item.identifier\"\n\t\t\t\t\t:index=\"item.index\"\n\t\t\t\t\t:item=\"item.original\"\n\t\t\t\t\t:name=\"item.identifier\"\n\t\t\t\t\t:offset=\"item.offset\"\n\t\t\t\t\t:open=\"item.open\"\n\t\t\t\t\t:parent=\"item.parent\"\n\t\t\t\t/>\n\t\t\t\t<!-- Slot for all items in this level -->\n\t\t\t\t<slot\n\t\t\t\t\tv-else-if=\"$slots[item.depth]\"\n\t\t\t\t\t:depth=\"item.depth\"\n\t\t\t\t\t:expandable=\"item.expandable\"\n\t\t\t\t\t:identifier=\"item.identifier\"\n\t\t\t\t\t:index=\"item.index\"\n\t\t\t\t\t:item=\"item.original\"\n\t\t\t\t\t:name=\"item.depth\"\n\t\t\t\t\t:offset=\"item.offset\"\n\t\t\t\t\t:open=\"item.open\"\n\t\t\t\t\t:parent=\"item.parent\"\n\t\t\t\t/>\n\t\t\t\t<!-- Default slot -->\n\t\t\t\t<slot\n\t\t\t\t\tv-else\n\t\t\t\t\t:depth=\"item.depth\"\n\t\t\t\t\t:expandable=\"item.expandable\"\n\t\t\t\t\t:identifier=\"item.identifier\"\n\t\t\t\t\t:index=\"item.index\"\n\t\t\t\t\t:item=\"item.original\"\n\t\t\t\t\t:name=\"'default'\"\n\t\t\t\t\t:offset=\"item.offset\"\n\t\t\t\t\t:open=\"item.open\"\n\t\t\t\t\t:parent=\"item.parent\"\n\t\t\t\t></slot>\n\t\t\t</div>\n\t\t</div>\n\t\t<div :class=\"`bb-tree--depth-${item.depth}-children`\">\n\t\t\t<slot\n\t\t\t\t:depth=\"item.depth\"\n\t\t\t\t:expandable=\"item.expandable\"\n\t\t\t\t:identifier=\"item.identifier\"\n\t\t\t\t:index=\"item.index\"\n\t\t\t\t:item=\"item.original\"\n\t\t\t\t:name=\"`${item.identifier}-children`\"\n\t\t\t\t:offset=\"item.offset\"\n\t\t\t\t:open=\"item.open\"\n\t\t\t\t:parent=\"item.parent\"\n\t\t\t>\n\t\t\t\t<slot\n\t\t\t\t\t:depth=\"item.depth\"\n\t\t\t\t\t:expandable=\"item.expandable\"\n\t\t\t\t\t:identifier=\"item.identifier\"\n\t\t\t\t\t:index=\"item.index\"\n\t\t\t\t\t:item=\"item.original\"\n\t\t\t\t\t:name=\"`${item.depth}-children`\"\n\t\t\t\t\t:offset=\"item.offset\"\n\t\t\t\t\t:open=\"item.open\"\n\t\t\t\t\t:parent=\"item.parent\"\n\t\t\t\t>\n\t\t\t\t\t<BbTree\n\t\t\t\t\t\t:depth=\"item.depth + 1\"\n\t\t\t\t\t\t:expandable=\"expandable\"\n\t\t\t\t\t\t:identifier=\"props.identifier\"\n\t\t\t\t\t\t:items=\"item.children\"\n\t\t\t\t\t\t:parent=\"item\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<template v-for=\"(_, name) in $slots\" #[name]=\"data: any\">\n\t\t\t\t\t\t\t<slot :name=\"name\" v-bind=\"data\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</BbTree>\n\t\t\t\t</slot>\n\t\t\t</slot>\n\t\t</div>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { flattenTree } from '@/utilities/functions/flattenTree';\nimport { computed } from 'vue';\n\nexport type TreeItem = {\n\t/**\n\t * Array of children of the current item. Is the key\n\t * with which we can identify whther the node is nested or not.\n\t */\n\tchildren?: TreeItem[];\n\t/**\n\t * Status of the current node. When a node is open\n\t * it's children are displayed. Otherwise its children\n\t * are hidden.\n\t */\n\topen?: boolean;\n\t[key: symbol | string]: any;\n} & Pick<BbTreeProps, 'expandable'>;\n\nexport type BbTreeProps = {\n\t/**\n\t * Array containing the tree like structure of the items.\n\t */\n\titems: TreeItem[];\n\t/**\n\t * Parent of the current node. `undefined` for the first level.\n\t */\n\tparent?: TreeItem;\n\t/**\n\t * Identifier of the item.\n\t */\n\tidentifier?: string | number;\n\t/**\n\t * Current depth of the tree. Starting at 0 for\n\t * the first level increasing at every level down.\n\t */\n\tdepth?: number;\n\t/**\n\t * Defines the item as expandable. It can be a\n\t * global boolean defining all items as expandable.\n\t * Or it can be a function that receives the item,\n\t * depth, and parent of the current node and returns a boolean.\n\t */\n\texpandable?:\n\t\t| boolean\n\t\t| ((item: TreeItem, depth: number, parent?: TreeItem) => boolean);\n};\n\nconst props = withDefaults(defineProps<BbTreeProps>(), {\n\tidentifier: 'id',\n\tdepth: 0,\n\toffset: 0,\n\titems: () => [] as TreeItem[],\n});\n\nexport type BbTreeSlots = {\n\t[key: string]: (props: {\n\t\titem: any;\n\t\tparent?: any;\n\t\tindex: number;\n\t\toffset: number;\n\t\topen: boolean;\n\t\tdepth: number;\n\t\tidentifier?: string | number;\n\t\texpandable: boolean;\n\t}) => any;\n};\ndefineSlots<BbTreeSlots>();\n\nconst itemIsOpen = (item: TreeItem) => {\n\t/* If the item is not expandable it must be open */\n\tif (typeof item.open === 'undefined') return true;\n\treturn item.open;\n};\n\ntype MappedItem = {\n\tchildren: TreeItem['children'];\n\tdepth: NonNullable<BbTreeProps['depth']>;\n\texpandable: boolean;\n\tidentifier: any;\n\tindex: number;\n\toffset: number;\n\topen: boolean;\n\toriginal: any;\n\tparent: BbTreeProps['parent'];\n};\n\nconst internalItems = computed<MappedItem[]>(() => {\n\tlet currentOffset = 0;\n\n\treturn props.items.map((item: TreeItem, index) => {\n\t\tconst open = itemIsOpen(item);\n\t\tconst expandableProp = item.expandable ?? props.expandable;\n\t\tconst offset = currentOffset + 1;\n\n\t\tcurrentOffset = currentOffset + flattenTree([item], 'children').length;\n\n\t\tlet expandable = false;\n\t\tif (typeof expandableProp !== 'undefined') {\n\t\t\tif (typeof expandableProp === 'function')\n\t\t\t\texpandable = expandableProp(item, props.depth, props.parent);\n\t\t\telse expandable = expandableProp;\n\t\t}\n\t\treturn {\n\t\t\tchildren: item.children,\n\t\t\tdepth: props.depth,\n\t\t\texpandable: expandable,\n\t\t\tidentifier: item[props.identifier],\n\t\t\toffset,\n\t\t\tindex,\n\t\t\topen,\n\t\t\toriginal: item,\n\t\t\tparent: props.parent,\n\t\t};\n\t});\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbTree';\n</style>\n"],"names":["props","__props","itemIsOpen","item","internalItems","computed","currentOffset","index","open","expandableProp","offset","flattenTree","expandable"],"mappings":";;;;;;;;;;;;AA6IA,UAAMA,IAAQC,GAqBRC,IAAa,CAACC,MAEf,OAAOA,EAAK,OAAS,MAAoB,KACtCA,EAAK,MAePC,IAAgBC,EAAuB,MAAM;AAClD,UAAIC,IAAgB;AAEpB,aAAON,EAAM,MAAM,IAAI,CAACG,GAAgBI,MAAU;AAC3C,cAAAC,IAAON,EAAWC,CAAI,GACtBM,IAAiBN,EAAK,cAAcH,EAAM,YAC1CU,IAASJ,IAAgB;AAE/B,QAAAA,IAAgBA,IAAgBK,EAAY,CAACR,CAAI,GAAG,UAAU,EAAE;AAEhE,YAAIS,IAAa;AACb,eAAA,OAAOH,IAAmB,QACzB,OAAOA,KAAmB,aAC7BG,IAAaH,EAAeN,GAAMH,EAAM,OAAOA,EAAM,MAAM,IAC1CY,IAAAH,IAEZ;AAAA,UACN,UAAUN,EAAK;AAAA,UACf,OAAOH,EAAM;AAAA,UACb,YAAAY;AAAA,UACA,YAAYT,EAAKH,EAAM,UAAU;AAAA,UACjC,QAAAU;AAAA,UACA,OAAAH;AAAA,UACA,MAAAC;AAAA,UACA,UAAUL;AAAA,UACV,QAAQH,EAAM;AAAA,QAAA;AAAA,MACf,CACA;AAAA,IAAA,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index12.js
CHANGED
|
@@ -1,196 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { reactive as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
throw new Error(
|
|
20
|
-
"Navigation is enabled but could not retrieve the router instance in useWizard."
|
|
21
|
-
);
|
|
22
|
-
const q = D(i.initialState), l = G(
|
|
23
|
-
V && sessionStorage.getItem(i.name) ? {
|
|
24
|
-
...q,
|
|
25
|
-
...JSON.parse(sessionStorage.getItem(i.name))
|
|
26
|
-
} : q
|
|
27
|
-
);
|
|
28
|
-
V && v(l, () => {
|
|
29
|
-
sessionStorage.setItem(i.name, JSON.stringify(l));
|
|
30
|
-
});
|
|
31
|
-
const w = H(i.steps), o = g(
|
|
32
|
-
() => Object.entries(w).reduce(
|
|
33
|
-
(t, [s, n]) => (n.condition && !n.condition(l) || (t[s] = { ...n, key: s }), t),
|
|
34
|
-
{}
|
|
35
|
-
)
|
|
36
|
-
), m = g(
|
|
37
|
-
() => X(
|
|
38
|
-
o.value,
|
|
39
|
-
(t) => typeof t.isValid == "function" ? {
|
|
40
|
-
...t,
|
|
41
|
-
isValid: t.isValid(l)
|
|
42
|
-
} : {
|
|
43
|
-
...t,
|
|
44
|
-
isValid: t.isValid ?? !0
|
|
1
|
+
import { wait as p } from "./index128.js";
|
|
2
|
+
import { reactive as d } from "vue";
|
|
3
|
+
import { useId as h } from "./index9.js";
|
|
4
|
+
const i = d({
|
|
5
|
+
stack: []
|
|
6
|
+
}), b = () => {
|
|
7
|
+
const c = (t) => i.stack = i.stack.filter((o) => o.id !== t);
|
|
8
|
+
return {
|
|
9
|
+
toast: (t) => {
|
|
10
|
+
const o = h().id.value;
|
|
11
|
+
let l, e, n, s, f;
|
|
12
|
+
const u = 6e3;
|
|
13
|
+
if (typeof t == "string")
|
|
14
|
+
e = t;
|
|
15
|
+
else {
|
|
16
|
+
if (typeof t.timeout == "number" && t.timeout <= 0)
|
|
17
|
+
throw new Error("Toast messages cannot have a zero or less timeout");
|
|
18
|
+
n = t.icon, f = t.showClose, e = t.text, s = t.theme, l = t.title;
|
|
45
19
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
if (p)
|
|
60
|
-
for (const t in o.value) {
|
|
61
|
-
if (t === p) break;
|
|
62
|
-
const s = m.value[t];
|
|
63
|
-
if (!s || !s.isValid) {
|
|
64
|
-
p = null;
|
|
65
|
-
break;
|
|
20
|
+
if (i.stack = i.stack.concat({
|
|
21
|
+
icon: n,
|
|
22
|
+
id: o,
|
|
23
|
+
showClose: f,
|
|
24
|
+
text: e,
|
|
25
|
+
theme: s,
|
|
26
|
+
title: l
|
|
27
|
+
}), typeof t == "object" && !t.persistent || typeof t == "string") {
|
|
28
|
+
let r;
|
|
29
|
+
typeof t == "object" && t.timeout ? r = t.timeout : r = u, p(r).then(() => {
|
|
30
|
+
c(o);
|
|
31
|
+
});
|
|
66
32
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
goToNext: j,
|
|
72
|
-
goToPrevious: A,
|
|
73
|
-
goTo: d,
|
|
74
|
-
index: K,
|
|
75
|
-
at: z,
|
|
76
|
-
get: F,
|
|
77
|
-
goBackTo: I,
|
|
78
|
-
isAfter: M,
|
|
79
|
-
isBefore: U,
|
|
80
|
-
isCurrent: B,
|
|
81
|
-
isFirst: C,
|
|
82
|
-
isLast: E,
|
|
83
|
-
isNext: J,
|
|
84
|
-
isPrevious: R,
|
|
85
|
-
next: W,
|
|
86
|
-
previous: $,
|
|
87
|
-
stepNames: L
|
|
88
|
-
} = ee(
|
|
89
|
-
m,
|
|
90
|
-
p || Object.values(o.value)[0].key
|
|
91
|
-
), c = g(() => Object.keys(o.value)[K.value]), T = {
|
|
92
|
-
at: z,
|
|
93
|
-
current: P,
|
|
94
|
-
data: l,
|
|
95
|
-
get: F,
|
|
96
|
-
goBackTo: I,
|
|
97
|
-
goTo: d,
|
|
98
|
-
goToNext: j,
|
|
99
|
-
goToPrevious: A,
|
|
100
|
-
isAfter: M,
|
|
101
|
-
isBefore: U,
|
|
102
|
-
isCurrent: B,
|
|
103
|
-
isFirst: C,
|
|
104
|
-
isLast: E,
|
|
105
|
-
isNext: J,
|
|
106
|
-
isPrevious: R,
|
|
107
|
-
key: c,
|
|
108
|
-
next: W,
|
|
109
|
-
previous: $,
|
|
110
|
-
stepNames: L,
|
|
111
|
-
steps: b
|
|
33
|
+
return o;
|
|
34
|
+
},
|
|
35
|
+
dismiss: c,
|
|
36
|
+
dismissAll: () => i.stack = []
|
|
112
37
|
};
|
|
113
|
-
if (Q(te, T), u)
|
|
114
|
-
if (h === "query")
|
|
115
|
-
v(
|
|
116
|
-
c,
|
|
117
|
-
() => {
|
|
118
|
-
a(r) && a(e.value) && r.push({
|
|
119
|
-
...e,
|
|
120
|
-
query: { ...e.value.query, step: c.value ?? null }
|
|
121
|
-
});
|
|
122
|
-
},
|
|
123
|
-
{ immediate: !0 }
|
|
124
|
-
), v(
|
|
125
|
-
() => {
|
|
126
|
-
var t;
|
|
127
|
-
return (t = e.value) == null ? void 0 : t.query.step;
|
|
128
|
-
},
|
|
129
|
-
(t) => {
|
|
130
|
-
if (t) {
|
|
131
|
-
const s = t;
|
|
132
|
-
if (s in o.value) {
|
|
133
|
-
const n = s, f = Object.keys(o.value);
|
|
134
|
-
f.slice(
|
|
135
|
-
0,
|
|
136
|
-
f.indexOf(n)
|
|
137
|
-
).every(
|
|
138
|
-
(N) => {
|
|
139
|
-
var y;
|
|
140
|
-
return (y = m.value[N]) == null ? void 0 : y.isValid;
|
|
141
|
-
}
|
|
142
|
-
) && d(n);
|
|
143
|
-
}
|
|
144
|
-
} else {
|
|
145
|
-
const s = Object.keys(b)[0];
|
|
146
|
-
d(s);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
);
|
|
150
|
-
else {
|
|
151
|
-
const t = g(() => {
|
|
152
|
-
if (a(e.value))
|
|
153
|
-
return O(e.value.fullPath);
|
|
154
|
-
});
|
|
155
|
-
v(
|
|
156
|
-
c,
|
|
157
|
-
(s) => {
|
|
158
|
-
a(e.value) && a(r) && s && (e.value.path.includes("step") ? r.push({
|
|
159
|
-
query: e.value.query,
|
|
160
|
-
path: e.value.path.replace(x, `step/${s}`)
|
|
161
|
-
}) : r.push({
|
|
162
|
-
query: e.value.query,
|
|
163
|
-
// Normalizes paths with / and without
|
|
164
|
-
path: (e.value.path + `/step/${s}`).replace("//", "/"),
|
|
165
|
-
replace: !0
|
|
166
|
-
}));
|
|
167
|
-
},
|
|
168
|
-
{ immediate: !0 }
|
|
169
|
-
), v(
|
|
170
|
-
() => t.value,
|
|
171
|
-
(s) => {
|
|
172
|
-
if (s && s !== c.value) {
|
|
173
|
-
const n = s;
|
|
174
|
-
if (n in o.value) {
|
|
175
|
-
const f = n, S = Object.keys(o.value);
|
|
176
|
-
S.slice(
|
|
177
|
-
0,
|
|
178
|
-
S.indexOf(f)
|
|
179
|
-
).every(
|
|
180
|
-
(y) => {
|
|
181
|
-
var k;
|
|
182
|
-
return (k = o.value[y]) == null ? void 0 : k.isValid;
|
|
183
|
-
}
|
|
184
|
-
) && d(f);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
return T;
|
|
191
38
|
};
|
|
192
39
|
export {
|
|
193
|
-
|
|
194
|
-
|
|
40
|
+
i as state,
|
|
41
|
+
b as useToast
|
|
195
42
|
};
|
|
196
43
|
//# sourceMappingURL=index12.js.map
|
package/dist/index12.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index12.js","sources":["../src/composables/useWizard.ts"],"sourcesContent":["import { cloneDeep } from '@/utilities/functions/cloneDeep';\nimport { computed, provide, reactive, watch, toValue } from 'vue';\nimport { isNotNil } from '@/utilities/functions/isNotNil';\nimport { mapValues } from '@/utilities/functions/mapValues';\nimport { useRoute } from './useRoute';\nimport { useRouter } from './useRouter';\nimport { useStepper } from '@vueuse/core';\nimport type { ComputedRef, MaybeRef } from 'vue';\n\nexport const wizardInjectionKey = Symbol();\nexport type Step<U> = {\n\t/**\n\t * Function that accepts a state object and returns a boolean.\n\t * When step are accessed at the end of the pipeline the result\n\t * is provided so you don't have to run the function yourself.\n\t * It determines if the validation has passed for the step.\n\t */\n\tisValid?: (state: U) => boolean | boolean;\n\t/**\n\t * Function that accepts a state object and returns a boolean.\n\t * When step are accessed at the end of the pipeline the result\n\t * is provided so you don't have to run the function yourself.\n\t * Steps that do not pass the condition are removed.\n\t */\n\tcondition?: (state: U) => boolean;\n\t[key: string]: any;\n};\nexport type WizardState<T extends Record<string, any>> = ReturnType<\n\ttypeof useWizard<T>\n>;\n\nconst regexMatchStep =\n\t/((step\\/)(?<step>[\\s\\S]+?)(?=[/?]))|((step\\/)(?<step2>[\\s\\S]+))/;\n/**\n * With a url that follows the rule xyz.com/anything/step/:nameofthestep[/?query]\n * will match the :nameofthestep substring\n */\nconst extractStepFromUrl = (url: string) => {\n\tconst match = url.match(regexMatchStep);\n\treturn match?.groups?.step ?? match?.groups?.step2 ?? null;\n};\nexport const useWizard = <T extends object>(params: {\n\t/**\n\t * The steps definition for the wizard\n\t */\n\tsteps: MaybeRef<Record<string, Step<T>>>;\n\t/**\n\t * Name of the wizard used to persist state\n\t */\n\tname: string;\n\t/**\n\t * Initial set of data to be made available throughout\n\t */\n\tinitialState: T;\n\t/**\n\t * When navogation is enabled, to whether use the query parameters or an entire substring of the URL like xyz/steps/....\n\t * The latter useful with nuxt so you can leverage the automatic import of components based on the URL.\n\t */\n\tnavigationMode?: 'query' | 'route';\n\t/**\n\t * Whether to use navigation at all. When disabled no query or URL is changed.\n\t */\n\tuseNavigation?: boolean;\n\t/**\n\t *\n\t */\n\tpersist?: boolean;\n}) => {\n\tif (!params.name) {\n\t\tthrow new Error(\n\t\t\t'You need to provide a unique name for the current wizard instance to be used to save data'\n\t\t);\n\t}\n\tconst route = useRoute();\n\tconst router = useRouter();\n\n\tconst useNavigation = params.useNavigation ?? true;\n\tconst navigationMode = params.navigationMode ?? 'query';\n\tconst persist = params.persist ?? true;\n\n\tif (useNavigation && (!route.value || !router)) {\n\t\tthrow new Error(\n\t\t\t'Navigation is enabled but could not retrieve the router instance in useWizard.'\n\t\t);\n\t}\n\n\tconst initialStateCopy = cloneDeep(params.initialState);\n\t/**\n\t * Initial state is either read from session storage or the one provided\n\t */\n\tconst innerState = reactive<typeof params.initialState>(\n\t\tpersist && sessionStorage.getItem(params.name)\n\t\t\t? {\n\t\t\t\t\t...initialStateCopy,\n\t\t\t\t\t...JSON.parse(sessionStorage.getItem(params.name)!),\n\t\t\t\t}\n\t\t\t: initialStateCopy\n\t);\n\n\tif (persist) {\n\t\t/**\n\t\t * Every time the state changes save it to sessionStorage\n\t\t */\n\t\twatch(innerState, () => {\n\t\t\tsessionStorage.setItem(params.name, JSON.stringify(innerState));\n\t\t});\n\t}\n\n\t/**\n\t * Steps can be passed as ref so we need to unwrap them\n\t */\n\tconst unwrappedSteps = toValue(params.steps);\n\tconst filteredSteps = computed(() =>\n\t\tObject.entries(unwrappedSteps).reduce(\n\t\t\t(acc: typeof unwrappedSteps, [key, step]) => {\n\t\t\t\tif (step.condition) {\n\t\t\t\t\tif (!step.condition(innerState as T)) {\n\t\t\t\t\t\treturn acc;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tacc[key] = { ...step, key };\n\t\t\t\treturn acc;\n\t\t\t},\n\t\t\t{}\n\t\t)\n\t);\n\n\t/**\n\t * Steps can have a isValid function that receives the current state\n\t * but we don't want to have to call it every single time so we call it once here\n\t */\n\tconst mappedSteps = computed(() =>\n\t\tmapValues(\n\t\t\tfilteredSteps.value,\n\t\t\t(step): Omit<Step<T>, 'isValid'> & { isValid: boolean } => {\n\t\t\t\tif (typeof step.isValid === 'function') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...step,\n\t\t\t\t\t\tisValid: step.isValid(innerState as T),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\t...step,\n\t\t\t\t\tisValid: step.isValid ?? true,\n\t\t\t\t};\n\t\t\t}\n\t\t)\n\t);\n\n\t/**\n\t * Get the initial step from the query.\n\t * If it exists check that every step before it is also valid\n\t * so user cannot manually jump by changing the URL\n\t */\n\tlet initialStep = null;\n\tif (useNavigation && isNotNil(route.value)) {\n\t\tlet step: string | null = null;\n\t\tif (navigationMode === 'query') {\n\t\t\tif (route.value.query.step) {\n\t\t\t\tstep = route.value.query.step as string;\n\t\t\t}\n\t\t} else {\n\t\t\tconst stepFromUrl = extractStepFromUrl(route.value.fullPath);\n\t\t\tif (stepFromUrl) {\n\t\t\t\tstep = stepFromUrl;\n\t\t\t}\n\t\t}\n\t\tinitialStep = step;\n\t}\n\n\tif (initialStep) {\n\t\tfor (const stepName in filteredSteps.value) {\n\t\t\tif (stepName === initialStep) break;\n\t\t\tconst current = mappedSteps.value[stepName];\n\t\t\tif (!current || !current.isValid) {\n\t\t\t\tinitialStep = null;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Define the state of the wizard\n\t * A few data come from useStepper\n\t */\n\tconst {\n\t\tsteps,\n\t\tcurrent,\n\t\tgoToNext,\n\t\tgoToPrevious,\n\t\tgoTo,\n\t\tindex,\n\t\tat,\n\t\tget,\n\t\tgoBackTo,\n\t\tisAfter,\n\t\tisBefore,\n\t\tisCurrent,\n\t\tisFirst,\n\t\tisLast,\n\t\tisNext,\n\t\tisPrevious,\n\t\tnext,\n\t\tprevious,\n\t\tstepNames,\n\t} = useStepper(\n\t\tmappedSteps,\n\t\tinitialStep || Object.values(filteredSteps.value)[0].key\n\t);\n\n\tconst key = computed(() => Object.keys(filteredSteps.value)[index.value]);\n\n\t/**\n\t * Complete state object\n\t */\n\tconst state = {\n\t\tat,\n\t\tcurrent: current as ComputedRef<Step<T> & { isValid: boolean }>,\n\t\tdata: innerState,\n\t\tget,\n\t\tgoBackTo,\n\t\tgoTo,\n\t\tgoToNext,\n\t\tgoToPrevious,\n\t\tisAfter,\n\t\tisBefore,\n\t\tisCurrent,\n\t\tisFirst,\n\t\tisLast,\n\t\tisNext,\n\t\tisPrevious,\n\t\tkey,\n\t\tnext,\n\t\tprevious,\n\t\tstepNames,\n\t\tsteps,\n\t};\n\n\tprovide(wizardInjectionKey, state);\n\n\tif (useNavigation) {\n\t\tif (navigationMode === 'query') {\n\t\t\t/**\n\t\t\t * Every time the current step changes update route\n\t\t\t */\n\t\t\twatch(\n\t\t\t\tkey,\n\t\t\t\t() => {\n\t\t\t\t\tif (isNotNil(router) && isNotNil(route.value)) {\n\t\t\t\t\t\trouter.push({\n\t\t\t\t\t\t\t...route,\n\t\t\t\t\t\t\tquery: { ...route.value.query, step: key.value ?? null },\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ immediate: true }\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Every time the route changes align the current step to the route\n\t\t\t */\n\t\t\twatch(\n\t\t\t\t() => route.value?.query.step,\n\t\t\t\t(value) => {\n\t\t\t\t\tif (value) {\n\t\t\t\t\t\tconst stepAsString = value as string;\n\t\t\t\t\t\tif (stepAsString in filteredSteps.value) {\n\t\t\t\t\t\t\tconst stepAsKey = stepAsString;\n\t\t\t\t\t\t\tconst stepKeys = Object.keys(filteredSteps.value);\n\t\t\t\t\t\t\tconst stepsPriorToTarget = stepKeys.slice(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tstepKeys.indexOf(stepAsKey)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tconst allValid = stepsPriorToTarget.every(\n\t\t\t\t\t\t\t\t(key) => mappedSteps.value[key]?.isValid\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (allValid) {\n\t\t\t\t\t\t\t\tgoTo(stepAsKey);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst key = Object.keys(steps)[0];\n\t\t\t\t\t\tgoTo(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t} else {\n\t\t\tconst stepFromUrl = computed(() => {\n\t\t\t\tif (isNotNil(route.value)) {\n\t\t\t\t\treturn extractStepFromUrl(route.value.fullPath);\n\t\t\t\t}\n\t\t\t\treturn undefined;\n\t\t\t});\n\n\t\t\t/**\n\t\t\t * Every time the current step changes update route\n\t\t\t */\n\t\t\twatch(\n\t\t\t\tkey,\n\t\t\t\t(value) => {\n\t\t\t\t\tif (isNotNil(route.value) && isNotNil(router) && value) {\n\t\t\t\t\t\tif (route.value.path.includes('step')) {\n\t\t\t\t\t\t\trouter.push({\n\t\t\t\t\t\t\t\tquery: route.value.query,\n\t\t\t\t\t\t\t\tpath: route.value.path.replace(regexMatchStep, `step/${value}`),\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\trouter.push({\n\t\t\t\t\t\t\t\tquery: route.value.query,\n\t\t\t\t\t\t\t\t// Normalizes paths with / and without\n\t\t\t\t\t\t\t\tpath: (route.value.path + `/step/${value}`).replace('//', '/'),\n\t\t\t\t\t\t\t\treplace: true,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ immediate: true }\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Every time the route changes align the current step to the route\n\t\t\t */\n\t\t\twatch(\n\t\t\t\t() => stepFromUrl.value,\n\t\t\t\t(value) => {\n\t\t\t\t\tif (value && value !== key.value) {\n\t\t\t\t\t\tconst stepAsString = value as string;\n\t\t\t\t\t\tif (stepAsString in filteredSteps.value) {\n\t\t\t\t\t\t\tconst stepAsKey = stepAsString;\n\t\t\t\t\t\t\tconst stepKeys = Object.keys(filteredSteps.value);\n\t\t\t\t\t\t\tconst stepsPriorToTarget = stepKeys.slice(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tstepKeys.indexOf(stepAsKey)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tconst allValid = stepsPriorToTarget.every(\n\t\t\t\t\t\t\t\t(key) => filteredSteps.value[key]?.isValid\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (allValid) {\n\t\t\t\t\t\t\t\tgoTo(stepAsKey);\n\t\t\t\t\t\t\t}\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\n\treturn state;\n};\n"],"names":["wizardInjectionKey","regexMatchStep","extractStepFromUrl","url","match","_a","_b","useWizard","params","route","useRoute","router","useRouter","useNavigation","navigationMode","persist","initialStateCopy","cloneDeep","innerState","reactive","watch","unwrappedSteps","toValue","filteredSteps","computed","acc","key","step","mappedSteps","mapValues","initialStep","isNotNil","stepFromUrl","stepName","current","steps","goToNext","goToPrevious","goTo","index","at","get","goBackTo","isAfter","isBefore","isCurrent","isFirst","isLast","isNext","isPrevious","next","previous","stepNames","useStepper","state","provide","value","stepAsString","stepAsKey","stepKeys"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index12.js","sources":["../src/composables/useToast.ts"],"sourcesContent":["import { wait } from '@/utilities/functions/wait';\nimport { reactive } from 'vue';\nimport { useId } from './useId';\nimport type { CommonProps } from '@/types/CommonProps';\n\nexport type Message = {\n\t/**\n\t * Title of the message. Displayed in a more prominant fashion.\n\t */\n\ttitle?: string;\n\t/**\n\t * Text content of the toast message.\n\t */\n\ttext: string;\n\t/**\n\t * Name of the icon to display.\n\t */\n\ticon?: string;\n\t/**\n\t * Theme of the toast message. By default the theme is `default`.\n\t */\n\ttheme?: string;\n\t/**\n\t * Identifier of the message\n\t */\n\tid: string;\n} & Pick<CommonProps, 'showClose'>;\n\ntype MessageParameter =\n\t| string\n\t| (Pick<Message, 'title' | 'text' | 'icon' | 'theme'> &\n\t\t\t/* These props are mutually exclusive */\n\t\t\t(| {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Time in milliseconds before the message disappears\n\t\t\t\t\t\t */\n\t\t\t\t\t\ttimeout?: undefined;\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Setting the message as persistent will prevent the message from being dismissed automatically\n\t\t\t\t\t\t */\n\t\t\t\t\t\tpersistent?: undefined | false;\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Whether to show the closing action to dismiss the message.\n\t\t\t\t\t\t * Show close is optional if the message is not persistent\n\t\t\t\t\t\t */\n\t\t\t\t\t\tshowClose?: Message['showClose'];\n\t\t\t\t }\n\t\t\t\t| {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Time in milliseconds before the message disappears\n\t\t\t\t\t\t */\n\t\t\t\t\t\ttimeout: number;\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Setting the message as persistent will prevent the message from being dismissed automatically\n\t\t\t\t\t\t */\n\t\t\t\t\t\tpersistent?: undefined | false;\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Whether to show the closing action to dismiss the message.\n\t\t\t\t\t\t * Show close is optional if the message is not persistent\n\t\t\t\t\t\t */\n\t\t\t\t\t\tshowClose?: Message['showClose'];\n\t\t\t\t }\n\t\t\t\t| {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Time in milliseconds before the message disappears\n\t\t\t\t\t\t */\n\t\t\t\t\t\ttimeout?: undefined;\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Setting the message as persistent will prevent the message from being dismissed automatically\n\t\t\t\t\t\t */\n\t\t\t\t\t\tpersistent: true;\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Whether to show the closing action to dismiss the message.\n\t\t\t\t\t\t * Show close is mandatory if the message is persistent\n\t\t\t\t\t\t */\n\t\t\t\t\t\tshowClose: true;\n\t\t\t\t }\n\t\t\t));\n\nexport const state = reactive({\n\tstack: [] as Message[],\n});\n\nexport const useToast = () => {\n\t/**\n\t * Dismisses a specific message\n\t */\n\tconst dismiss = (id: Message['id']) =>\n\t\t(state.stack = state.stack.filter((el) => el.id !== id));\n\tconst dismissAll = () => (state.stack = []);\n\tconst toast = (message: MessageParameter) => {\n\t\tconst id = useId().id.value;\n\t\tlet title: Message['title'];\n\t\tlet text: Message['text'];\n\t\tlet icon: Message['icon'];\n\t\tlet theme: Message['theme'];\n\t\tlet showClose: Message['showClose'];\n\t\tconst defaultTimeout = 6000;\n\n\t\tif (typeof message === 'string') {\n\t\t\ttext = message;\n\t\t} else {\n\t\t\tif (typeof message.timeout === 'number' && message.timeout <= 0) {\n\t\t\t\tthrow new Error(`Toast messages cannot have a zero or less timeout`);\n\t\t\t}\n\t\t\ticon = message.icon;\n\t\t\tshowClose = message.showClose;\n\t\t\ttext = message.text;\n\t\t\ttheme = message.theme;\n\t\t\ttitle = message.title;\n\t\t}\n\t\tstate.stack = state.stack.concat({\n\t\t\ticon,\n\t\t\tid,\n\t\t\tshowClose,\n\t\t\ttext,\n\t\t\ttheme,\n\t\t\ttitle,\n\t\t});\n\t\tif (\n\t\t\t(typeof message === 'object' && !message.persistent) ||\n\t\t\ttypeof message === 'string'\n\t\t) {\n\t\t\tlet timeout: number;\n\n\t\t\tif (typeof message === 'object' && message.timeout) {\n\t\t\t\ttimeout = message.timeout;\n\t\t\t} else timeout = defaultTimeout;\n\n\t\t\twait(timeout).then(() => {\n\t\t\t\tdismiss(id);\n\t\t\t});\n\t\t}\n\t\treturn id;\n\t};\n\treturn {\n\t\ttoast,\n\t\tdismiss,\n\t\tdismissAll,\n\t};\n};\n"],"names":["state","reactive","useToast","dismiss","id","el","message","useId","title","text","icon","theme","showClose","defaultTimeout","timeout","wait"],"mappings":";;;AA+EO,MAAMA,IAAQC,EAAS;AAAA,EAC7B,OAAO,CAAC;AACT,CAAC,GAEYC,IAAW,MAAM;AAI7B,QAAMC,IAAU,CAACC,MACfJ,EAAM,QAAQA,EAAM,MAAM,OAAO,CAACK,MAAOA,EAAG,OAAOD,CAAE;AA+ChD,SAAA;AAAA,IACN,OA9Ca,CAACE,MAA8B;AACtC,YAAAF,IAAKG,IAAQ,GAAG;AAClB,UAAAC,GACAC,GACAC,GACAC,GACAC;AACJ,YAAMC,IAAiB;AAEnB,UAAA,OAAOP,KAAY;AACf,QAAAG,IAAAH;AAAA,WACD;AACN,YAAI,OAAOA,EAAQ,WAAY,YAAYA,EAAQ,WAAW;AACvD,gBAAA,IAAI,MAAM,mDAAmD;AAEpE,QAAAI,IAAOJ,EAAQ,MACfM,IAAYN,EAAQ,WACpBG,IAAOH,EAAQ,MACfK,IAAQL,EAAQ,OAChBE,IAAQF,EAAQ;AAAA,MACjB;AAUE,UATIN,EAAA,QAAQA,EAAM,MAAM,OAAO;AAAA,QAChC,MAAAU;AAAA,QACA,IAAAN;AAAA,QACA,WAAAQ;AAAA,QACA,MAAAH;AAAA,QACA,OAAAE;AAAA,QACA,OAAAH;AAAA,MAAA,CACA,GAEC,OAAOF,KAAY,YAAY,CAACA,EAAQ,cACzC,OAAOA,KAAY,UAClB;AACG,YAAAQ;AAEJ,QAAI,OAAOR,KAAY,YAAYA,EAAQ,UAC1CQ,IAAUR,EAAQ,UACFQ,IAAAD,GAEZE,EAAAD,CAAO,EAAE,KAAK,MAAM;AACxB,UAAAX,EAAQC,CAAE;AAAA,QAAA,CACV;AAAA,MACF;AACO,aAAAA;AAAA,IAAA;AAAA,IAIP,SAAAD;AAAA,IACA,YAjDkB,MAAOH,EAAM,QAAQ,CAAA;AAAA,EAiDvC;AAEF;"}
|
package/dist/index121.js
CHANGED
|
@@ -1,44 +1,40 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
3
|
-
|
|
1
|
+
import { defineComponent as c, openBlock as l, createElementBlock as o, createElementVNode as t, renderSlot as r, createTextVNode as i, toDisplayString as p, withModifiers as b, createCommentVNode as _ } from "vue";
|
|
2
|
+
const d = { class: "bb-chip" }, m = { class: "bb-chip__content" }, h = ["aria-label"], u = /* @__PURE__ */ t("svg", {
|
|
3
|
+
viewBox: "0 0 24 24",
|
|
4
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
5
|
+
}, [
|
|
6
|
+
/* @__PURE__ */ t("path", {
|
|
7
|
+
d: "M6.4 19L5 17.6l5.6-5.6L5 6.4L6.4 5l5.6 5.6L17.6 5L19 6.4L13.4 12l5.6 5.6l-1.4 1.4l-5.6-5.6z",
|
|
8
|
+
fill: "currentColor"
|
|
9
|
+
})
|
|
10
|
+
], -1), f = [
|
|
11
|
+
u
|
|
12
|
+
], C = /* @__PURE__ */ c({
|
|
13
|
+
__name: "BbChip",
|
|
4
14
|
props: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
tag: { default: "div" }
|
|
15
|
+
text: {},
|
|
16
|
+
clearable: { type: Boolean, default: !0 },
|
|
17
|
+
clearableLabel: { default: "Elimina" }
|
|
9
18
|
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
(e)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"bb-collapsible": !0,
|
|
21
|
-
"bb-collapsible--open": l.modelValue,
|
|
22
|
-
"bb-collapsible--closed": !l.modelValue
|
|
23
|
-
},
|
|
24
|
-
style: {
|
|
25
|
-
transitionDuration: l.transitionDuration + "ms"
|
|
26
|
-
}
|
|
27
|
-
}));
|
|
28
|
-
return (e, _) => (r(), u(i(e.tag), f(v(n.value)), {
|
|
29
|
-
default: c(() => [
|
|
30
|
-
(r(), u(i(e.tag), {
|
|
31
|
-
class: "bb-collapsible__content",
|
|
32
|
-
style: y(n.value.style)
|
|
33
|
-
}, {
|
|
34
|
-
default: c(() => [
|
|
35
|
-
e.eager || a.value ? g(e.$slots, "default", { key: 0 }) : V("", !0)
|
|
36
|
-
]),
|
|
37
|
-
_: 3
|
|
38
|
-
}, 8, ["style"]))
|
|
19
|
+
emits: ["click:clear"],
|
|
20
|
+
setup(L, { emit: a }) {
|
|
21
|
+
const n = a, s = (e) => {
|
|
22
|
+
n("click:clear", e);
|
|
23
|
+
};
|
|
24
|
+
return (e, k) => (l(), o("span", d, [
|
|
25
|
+
t("span", m, [
|
|
26
|
+
r(e.$slots, "default", {}, () => [
|
|
27
|
+
i(p(e.text), 1)
|
|
28
|
+
])
|
|
39
29
|
]),
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
e.clearable ? (l(), o("button", {
|
|
31
|
+
key: 0,
|
|
32
|
+
"aria-label": e.clearableLabel,
|
|
33
|
+
class: "bb-chip__clear-button",
|
|
34
|
+
type: "button",
|
|
35
|
+
onClick: b(s, ["stop", "prevent"])
|
|
36
|
+
}, f, 8, h)) : _("", !0)
|
|
37
|
+
]));
|
|
42
38
|
}
|
|
43
39
|
});
|
|
44
40
|
export {
|
package/dist/index121.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index121.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index121.js","sources":["../src/components/BbChip/BbChip.vue"],"sourcesContent":["<template>\n\t<span class=\"bb-chip\"\n\t\t><span class=\"bb-chip__content\"\n\t\t\t><slot>{{ text }}</slot></span\n\t\t><button\n\t\t\tv-if=\"clearable\"\n\t\t\t:aria-label=\"clearableLabel\"\n\t\t\tclass=\"bb-chip__clear-button\"\n\t\t\ttype=\"button\"\n\t\t\t@click.stop.prevent=\"onClear\"\n\t\t>\n\t\t\t<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t\t<path\n\t\t\t\t\td=\"M6.4 19L5 17.6l5.6-5.6L5 6.4L6.4 5l5.6 5.6L17.6 5L19 6.4L13.4 12l5.6 5.6l-1.4 1.4l-5.6-5.6z\"\n\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t/>\n\t\t\t</svg></button\n\t></span>\n</template>\n\n<script setup lang=\"ts\">\nimport type { CommonProps } from '@/types/CommonProps';\n\nexport type BbChipProps = Pick<CommonProps, 'text'> & {\n\t/**\n\t * Renders a button with a close icon. Used to indicate the possibility of deleting the item.\n\t */\n\tclearable?: boolean;\n\t/**\n\t * The label the clearing button must have\n\t */\n\tclearableLabel?: string;\n};\n\nwithDefaults(defineProps<BbChipProps>(), {\n\tclearable: true,\n\tclearableLabel: 'Elimina',\n});\n\nexport type BbChipEvents = {\n\t(e: 'click:clear', event: MouseEvent): void;\n};\n\ndefineSlots<{\n\tdefault?: (props: object) => any;\n}>();\n\nconst emit = defineEmits(['click:clear']);\nconst onClear = (event: MouseEvent) => {\n\temit('click:clear', event);\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbChip';\n</style>\n"],"names":["emit","__emit","onClear","event"],"mappings":";;;;;;;;;;;;;;;;;;;;AA+CA,UAAMA,IAAOC,GACPC,IAAU,CAACC,MAAsB;AACtC,MAAAH,EAAK,eAAeG,CAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;"}
|