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/index12.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index12.js","sources":["../src/components/BaseButton/BaseButton.vue"],"sourcesContent":["<template>\n\t<component :is=\"tag\" :class=\"classes\" v-bind=\"attributes\">\n\t\t<slot>{{ text }}</slot>\n\t</component>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, getCurrentInstance, resolveComponent } from 'vue';\nimport type { RouteLocationRaw } from 'vue-router';\nimport { _config } from '@/composables/useBbConfig';\nimport { useLogger } from '@/composables/useLogger';\n\nexport type BaseButtonProps = {\n\t/**\n\t * Class to apply when the link is active\n\t */\n\tactiveClass?: string;\n\n\t/**\n\t * Value passed to the attribute `aria-current` when the link is exact active.\n\t *\n\t * @defaultValue `'page'`\n\t */\n\tariaCurrentValue?:\n\t\t| 'page'\n\t\t| 'step'\n\t\t| 'location'\n\t\t| 'date'\n\t\t| 'time'\n\t\t| 'true'\n\t\t| 'false';\n\n\t/**\n\t * Displays the component as full width.\n\t */\n\tblock?: boolean;\n\n\tdata?: object;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Class to apply when the link is exact active\n\t */\n\texactActiveClass?: string;\n\n\theaders?: object;\n\n\t/**\n\t * Returns the hyperlink's URL.\n\t *\n\t * Can be set, to change the URL.\n\t */\n\thref?: HTMLAnchorElement['href'];\n\n\tmethod?: 'get' | 'post' | 'put' | 'patch' | 'delete';\n\n\tonBefore?: () => void;\n\n\tonCancel?: () => void;\n\n\tonCancelToken?: (cancelToken: import('axios').CancelTokenSource) => void;\n\n\tonFinish?: () => void;\n\n\tonly?: string[];\n\n\tonProgress?: (progress: { percentage: number | undefined }) => void;\n\n\tonStart?: () => void;\n\n\tonSuccess?: () => void;\n\n\tpreserveScroll?: boolean | ((props: { [key: string]: unknown }) => boolean);\n\n\tpreserveState?:\n\t\t| boolean\n\t\t| ((props: { [key: string]: unknown }) => boolean)\n\t\t| null;\n\n\tqueryStringArrayFormat?: 'brackets' | 'indices';\n\n\t/**\n\t * Calls `router.replace` instead of `router.push`.\n\t */\n\treplace?: boolean;\n\n\t/**\n\t * Any HTML tag corresponding to a non-void HTMl element.\n\t */\n\ttag?: string;\n\n\t/**\n\t * Sets or retrieves the window or frame at which to target content.\n\t */\n\ttarget?: HTMLAnchorElement['target'];\n\n\t/**\n\t * Text content of the component.\n\t */\n\ttext?: string;\n\n\t/**\n\t * Route Location the link should navigate to when clicked on.\n\t */\n\tto?: RouteLocationRaw;\n\n\t/**\n\t * Gets the classification and default behavior of the button.\n\t */\n\ttype?: HTMLButtonElement['type'];\n};\n\nconst props = withDefaults(defineProps<BaseButtonProps>(), {\n\ttag: 'button',\n\ttype: 'button',\n});\n\ndefineSlots<{\n\tdefault?: (props: object) => any;\n}>();\n\n/* Ignore because possibly undefined */\n// @ts-expect-error possibly undef\nconst isInertia = !!getCurrentInstance()?.proxy?.$inertia;\n\n// @ts-expect-error possibly undef\nconst isNuxt = !!getCurrentInstance()?.proxy?.$nuxt;\n\nconst tag = computed(() => {\n\t// For disabled links always render a\n\tif (props.href || (props.to && props.disabled)) {\n\t\t// Prevent rendering inertia links if target is passed (inertia doesn't support external links)\n\t\tif (isInertia && !props.disabled && !props.target) {\n\t\t\tconst resolved = resolveComponent(_config.inertiaLinkName);\n\t\t\tif (typeof resolved === 'string') {\n\t\t\t\tconst { warn } = useLogger();\n\t\t\t\twarn(\n\t\t\t\t\t`Inertia link component \"${_config.inertiaLinkName}\" could not be resolved. Ensure you app registers a link component with the name \"${_config.inertiaLinkName}\" or set bitboss-ui config key \"inertiaLinkName\" to the correct value globally. Please visit ${_config.documentationURL}/getting-started to resolve setup issues in bitboss-ui.`\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn resolved;\n\t\t}\n\n\t\treturn 'a';\n\t}\n\tif (props.to) {\n\t\tif (isNuxt) {\n\t\t\tconst resolved = resolveComponent(_config.nuxtLinkName);\n\t\t\tif (typeof resolved === 'string') {\n\t\t\t\tconst { warn } = useLogger();\n\t\t\t\twarn(\n\t\t\t\t\t`Nuxt link component \"${_config.nuxtLinkName}\" could not be resolved. Ensure you app registers a link component with the name \"${_config.nuxtLinkName}\" or set bitboss-ui config key \"nuxtLInkName\" to the correct value globally. Please visit ${_config.documentationURL}/getting-started to resolve setup issues in bitboss-ui.`\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn resolved;\n\t\t}\n\t\treturn 'router-link';\n\t}\n\treturn props.tag;\n});\n\nconst classes = computed(() => ({\n\t'base-btn': true,\n\t'base-btn--block': props.block,\n\t'base-btn--disabled': props.disabled,\n}));\n\nconst attributes = computed(() => {\n\ttype PossibleAttributes = {\n\t\tactiveClass: BaseButtonProps['activeClass'];\n\t\t'aria-disabled': boolean;\n\t\tariaCurrentValue: BaseButtonProps['ariaCurrentValue'];\n\t\tdata: BaseButtonProps['data'];\n\t\tdisabled: boolean;\n\t\texactActiveClass: BaseButtonProps['exactActiveClass'];\n\t\theaders: BaseButtonProps['headers'];\n\t\thref: string;\n\t\tmethod: BaseButtonProps['method'];\n\t\tonBefore: BaseButtonProps['onBefore'];\n\t\tonCancel: BaseButtonProps['onCancel'];\n\t\tonCancelToken: BaseButtonProps['onCancelToken'];\n\t\tonFinish: BaseButtonProps['onFinish'];\n\t\tonly: BaseButtonProps['only'];\n\t\tonProgress: BaseButtonProps['onProgress'];\n\t\tonStart: BaseButtonProps['onStart'];\n\t\tonSuccess: BaseButtonProps['onSuccess'];\n\t\tpreserveScroll: BaseButtonProps['preserveScroll'];\n\t\tpreserveState: BaseButtonProps['preserveState'];\n\t\tqueryStringArrayFormat: BaseButtonProps['queryStringArrayFormat'];\n\t\treplace: BaseButtonProps['replace'];\n\t\trole: string;\n\t\tstyle: { [rule: string]: string };\n\t\ttarget: string;\n\t\tto: BaseButtonProps['to'];\n\t\ttype: string;\n\t};\n\tconst initial: Partial<PossibleAttributes> = {};\n\n\tif (tag.value === 'button') {\n\t\tinitial.disabled = props.disabled;\n\t\tinitial.type = props.type;\n\t} else if (\n\t\ttag.value === 'a' ||\n\t\t(isInertia && typeof tag.value !== 'string' && tag.value.name === 'Link')\n\t) {\n\t\t// When rendering as anchor prevent navigation if disabled\n\t\t// https://getbootstrap.com/docs/4.0/components/buttons/#disabled-state\n\t\tif (props.disabled) {\n\t\t\tinitial['aria-disabled'] = true;\n\t\t\tinitial.role = 'link';\n\t\t} else {\n\t\t\t// Only attach the href to active links\n\t\t\t// https://www.scottohara.me/blog/2021/05/28/disabled-links.html\n\t\t\tinitial.href = props.href;\n\t\t\tinitial.target = props.target;\n\n\t\t\tif (isInertia) {\n\t\t\t\tinitial.data = props.data;\n\t\t\t\tinitial.headers = props.headers;\n\t\t\t\tinitial.method = props.method;\n\t\t\t\tinitial.onBefore = props.onBefore;\n\t\t\t\tinitial.onCancel = props.onCancel;\n\t\t\t\tinitial.onCancelToken = props.onCancelToken;\n\t\t\t\tinitial.onFinish = props.onFinish;\n\t\t\t\tinitial.only = props.only;\n\t\t\t\tinitial.onProgress = props.onProgress;\n\t\t\t\tinitial.onStart = props.onStart;\n\t\t\t\tinitial.onSuccess = props.onSuccess;\n\t\t\t\tinitial.preserveScroll = props.preserveScroll;\n\t\t\t\tinitial.preserveState = props.preserveState;\n\t\t\t\tinitial.queryStringArrayFormat = props.queryStringArrayFormat;\n\t\t\t\tinitial.replace = props.replace;\n\t\t\t}\n\t\t}\n\t} else if (\n\t\ttag.value === 'router-link' ||\n\t\t(typeof tag.value !== 'string' && tag.value.name === 'NuxtLink')\n\t) {\n\t\tinitial.activeClass = props.activeClass;\n\t\tinitial.ariaCurrentValue = props.ariaCurrentValue;\n\t\tinitial.exactActiveClass = props.exactActiveClass;\n\t\tinitial.replace = props.replace;\n\t\tinitial.target = props.target;\n\t\tinitial.to = props.to;\n\t}\n\n\treturn initial;\n});\n</script>\n<style lang=\"postcss\">\n@import '@/assets/css/BaseButton';\n</style>\n"],"names":["props","__props","isInertia","_b","_a","getCurrentInstance","isNuxt","_d","_c","tag","computed","resolved","resolveComponent","_config","warn","useLogger","classes","attributes","initial"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoHA,UAAMA,IAAQC,GAWRC,IAAY,CAAC,GAACC,KAAAC,IAAAC,EAAA,MAAA,gBAAAD,EAAsB,UAAtB,QAAAD,EAA6B,WAG3CG,IAAS,CAAC,GAACC,KAAAC,IAAAH,EAAA,MAAA,gBAAAG,EAAsB,UAAtB,QAAAD,EAA6B,QAExCE,IAAMC,EAAS,MAAM;AAE1B,UAAIV,EAAM,QAASA,EAAM,MAAMA,EAAM,UAAW;AAE/C,YAAIE,KAAa,CAACF,EAAM,YAAY,CAACA,EAAM,QAAQ;AAC5C,gBAAAW,IAAWC,EAAiBC,EAAQ,eAAe;AACrD,cAAA,OAAOF,KAAa,UAAU;AAC3B,kBAAA,EAAE,MAAAG,MAASC;AACjB,YAAAD;AAAA,cACC,2BAA2BD,EAAQ,eAAe,qFAAqFA,EAAQ,eAAe,gGAAgGA,EAAQ,gBAAgB;AAAA,YAAA;AAAA,UAExR;AACO,iBAAAF;AAAA,QACR;AAEO,eAAA;AAAA,MACR;AACA,UAAIX,EAAM,IAAI;AACb,YAAIM,GAAQ;AACL,gBAAAK,IAAWC,EAAiBC,EAAQ,YAAY;AAClD,cAAA,OAAOF,KAAa,UAAU;AAC3B,kBAAA,EAAE,MAAAG,MAASC;AACjB,YAAAD;AAAA,cACC,wBAAwBD,EAAQ,YAAY,qFAAqFA,EAAQ,YAAY,6FAA6FA,EAAQ,gBAAgB;AAAA,YAAA;AAAA,UAE5Q;AACO,iBAAAF;AAAA,QACR;AACO,eAAA;AAAA,MACR;AACA,aAAOX,EAAM;AAAA,IAAA,CACb,GAEKgB,IAAUN,EAAS,OAAO;AAAA,MAC/B,YAAY;AAAA,MACZ,mBAAmBV,EAAM;AAAA,MACzB,sBAAsBA,EAAM;AAAA,IAC3B,EAAA,GAEIiB,IAAaP,EAAS,MAAM;AA6BjC,YAAMQ,IAAuC,CAAA;AAEzC,aAAAT,EAAI,UAAU,YACjBS,EAAQ,WAAWlB,EAAM,UACzBkB,EAAQ,OAAOlB,EAAM,QAErBS,EAAI,UAAU,OACbP,KAAa,OAAOO,EAAI,SAAU,YAAYA,EAAI,MAAM,SAAS,SAI9DT,EAAM,YACTkB,EAAQ,eAAe,IAAI,IAC3BA,EAAQ,OAAO,WAIfA,EAAQ,OAAOlB,EAAM,MACrBkB,EAAQ,SAASlB,EAAM,QAEnBE,MACHgB,EAAQ,OAAOlB,EAAM,MACrBkB,EAAQ,UAAUlB,EAAM,SACxBkB,EAAQ,SAASlB,EAAM,QACvBkB,EAAQ,WAAWlB,EAAM,UACzBkB,EAAQ,WAAWlB,EAAM,UACzBkB,EAAQ,gBAAgBlB,EAAM,eAC9BkB,EAAQ,WAAWlB,EAAM,UACzBkB,EAAQ,OAAOlB,EAAM,MACrBkB,EAAQ,aAAalB,EAAM,YAC3BkB,EAAQ,UAAUlB,EAAM,SACxBkB,EAAQ,YAAYlB,EAAM,WAC1BkB,EAAQ,iBAAiBlB,EAAM,gBAC/BkB,EAAQ,gBAAgBlB,EAAM,eAC9BkB,EAAQ,yBAAyBlB,EAAM,wBACvCkB,EAAQ,UAAUlB,EAAM,aAI1BS,EAAI,UAAU,iBACb,OAAOA,EAAI,SAAU,YAAYA,EAAI,MAAM,SAAS,gBAErDS,EAAQ,cAAclB,EAAM,aAC5BkB,EAAQ,mBAAmBlB,EAAM,kBACjCkB,EAAQ,mBAAmBlB,EAAM,kBACjCkB,EAAQ,UAAUlB,EAAM,SACxBkB,EAAQ,SAASlB,EAAM,QACvBkB,EAAQ,KAAKlB,EAAM,KAGbkB;AAAA,IAAA,CACP;;;;;;;;;;;"}
|
|
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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"}
|
package/dist/index120.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/index120.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index120.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index120.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;;;;;;;;;;;;;;;;;"}
|
package/dist/index121.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
__name: "BbIcon",
|
|
1
|
+
import { defineComponent as d, ref as s, watch as m, computed as b, openBlock as r, createBlock as u, resolveDynamicComponent as i, normalizeProps as f, guardReactiveProps as v, withCtx as c, normalizeStyle as y, renderSlot as g, createCommentVNode as V } from "vue";
|
|
2
|
+
const C = /* @__PURE__ */ d({
|
|
3
|
+
__name: "BbCollapsible",
|
|
5
4
|
props: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
type:
|
|
5
|
+
eager: { type: Boolean },
|
|
6
|
+
transitionDuration: { default: 250 },
|
|
7
|
+
modelValue: { type: Boolean },
|
|
8
|
+
tag: { default: "div" }
|
|
9
9
|
},
|
|
10
10
|
setup(p) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const u = {
|
|
16
|
-
xs: 12,
|
|
17
|
-
sm: 16,
|
|
18
|
-
md: 24,
|
|
19
|
-
lg: 28,
|
|
20
|
-
xl: 36,
|
|
21
|
-
xxl: 40
|
|
22
|
-
}, f = l(() => {
|
|
23
|
-
const s = {
|
|
24
|
-
"bb-icon": !0
|
|
25
|
-
};
|
|
26
|
-
let c = { width: l(() => {
|
|
27
|
-
let o;
|
|
28
|
-
return typeof e.size == "string" ? o = u[e.size] ?? parseInt(e.size, 10) : typeof e.size == "number" ? o = e.size : o = 24, o + "px";
|
|
29
|
-
}).value };
|
|
30
|
-
return e.color && (z(e.color) ? c.color = e.color : s[`bb-icon--${e.color}`] = !0), {
|
|
31
|
-
class: s,
|
|
32
|
-
style: c
|
|
33
|
-
};
|
|
34
|
-
}), n = y(null);
|
|
35
|
-
return _(async () => {
|
|
36
|
-
if (t) {
|
|
37
|
-
if (typeof t[e.type] > "u")
|
|
38
|
-
throw new Error(`Icon "${e.type}" does not exist.`);
|
|
39
|
-
n.value = await t[e.type]();
|
|
11
|
+
const l = p, t = s(l.modelValue), a = s(t.value), o = m(
|
|
12
|
+
() => l.modelValue,
|
|
13
|
+
(e) => {
|
|
14
|
+
e && (a.value = !0, o());
|
|
40
15
|
}
|
|
41
|
-
|
|
16
|
+
);
|
|
17
|
+
t.value && o();
|
|
18
|
+
const n = b(() => ({
|
|
19
|
+
class: {
|
|
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"]))
|
|
39
|
+
]),
|
|
40
|
+
_: 3
|
|
41
|
+
}, 16));
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
export {
|
|
45
|
-
|
|
45
|
+
C as default
|
|
46
46
|
};
|
|
47
47
|
//# sourceMappingURL=index121.js.map
|
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/BbCollapsible/BbCollapsible.vue"],"sourcesContent":["<template>\n\t<component v-bind=\"collapsibleAttributes\" :is=\"tag\">\n\t\t<component\n\t\t\t:is=\"tag\"\n\t\t\tclass=\"bb-collapsible__content\"\n\t\t\t:style=\"collapsibleAttributes.style\"\n\t\t>\n\t\t\t<slot v-if=\"eager || hasRenderedOnce\"></slot>\n\t\t</component>\n\t</component>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue';\n\nimport type { CommonProps } from '@/types/CommonProps';\n\nexport type BbCollapsibleProps = Pick<\n\tCommonProps,\n\t'eager' | 'transitionDuration'\n> & {\n\t/**\n\t * Used by v-model to trigger opening / closing the collapsible\n\t */\n\tmodelValue: boolean;\n\t/**\n\t * Any HTML tag corresponding to a non-void HTMl element.\n\t */\n\ttag?: string;\n};\n\nconst props = withDefaults(defineProps<BbCollapsibleProps>(), {\n\ttransitionDuration: 250,\n\ttag: 'div',\n});\n\ndefineSlots<{\n\tdefault?: (props: object) => any;\n}>();\n\nconst visible = ref(props.modelValue);\nconst hasRenderedOnce = ref(visible.value);\n\n/**\n * If the component is lazy render content on first time modelValue is true\n */\nconst cleanup = watch(\n\t() => props.modelValue,\n\t(value) => {\n\t\tif (value) {\n\t\t\thasRenderedOnce.value = true;\n\t\t\tcleanup();\n\t\t}\n\t}\n);\nif (visible.value) cleanup();\n\nconst collapsibleAttributes = computed(() => {\n\treturn {\n\t\tclass: {\n\t\t\t'bb-collapsible': true,\n\t\t\t'bb-collapsible--open': props.modelValue,\n\t\t\t'bb-collapsible--closed': !props.modelValue,\n\t\t},\n\t\tstyle: {\n\t\t\ttransitionDuration: props.transitionDuration + 'ms',\n\t\t},\n\t};\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbCollapsible';\n</style>\n"],"names":["props","__props","visible","ref","hasRenderedOnce","cleanup","watch","value","collapsibleAttributes","computed"],"mappings":";;;;;;;;;;AA+BA,UAAMA,IAAQC,GASRC,IAAUC,EAAIH,EAAM,UAAU,GAC9BI,IAAkBD,EAAID,EAAQ,KAAK,GAKnCG,IAAUC;AAAA,MACf,MAAMN,EAAM;AAAA,MACZ,CAACO,MAAU;AACV,QAAIA,MACHH,EAAgB,QAAQ,IAChBC;MAEV;AAAA,IAAA;AAEG,IAAAH,EAAQ,SAAeG;AAErB,UAAAG,IAAwBC,EAAS,OAC/B;AAAA,MACN,OAAO;AAAA,QACN,kBAAkB;AAAA,QAClB,wBAAwBT,EAAM;AAAA,QAC9B,0BAA0B,CAACA,EAAM;AAAA,MAClC;AAAA,MACA,OAAO;AAAA,QACN,oBAAoBA,EAAM,qBAAqB;AAAA,MAChD;AAAA,IAAA,EAED;;;;;;;;;;;;;;;;;"}
|
package/dist/index122.js
CHANGED
|
@@ -1,50 +1,47 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
__name: "
|
|
1
|
+
import { defineComponent as m, getCurrentInstance as d, inject as x, computed as l, ref as y, watchEffect as _, openBlock as b, createElementBlock as h, mergeProps as w } from "vue";
|
|
2
|
+
import { isCssColor as z } from "./index200.js";
|
|
3
|
+
const g = ["innerHTML"], $ = /* @__PURE__ */ m({
|
|
4
|
+
__name: "BbIcon",
|
|
5
5
|
props: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
tag: { default: "div" },
|
|
10
|
-
transitionDuration: { default: 200 }
|
|
6
|
+
size: { default: "md" },
|
|
7
|
+
color: {},
|
|
8
|
+
type: {}
|
|
11
9
|
},
|
|
12
|
-
setup(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
setup(p) {
|
|
11
|
+
var i, r;
|
|
12
|
+
const e = p;
|
|
13
|
+
let t;
|
|
14
|
+
!!((r = (i = d()) == null ? void 0 : i.proxy) != null && r.$nuxt) ? process.client && (t = useNuxtApp().$icons) : t = x("icons");
|
|
15
|
+
const u = {
|
|
16
|
+
xs: 12,
|
|
17
|
+
sm: 16,
|
|
18
|
+
md: 24,
|
|
19
|
+
lg: 28,
|
|
20
|
+
xl: 36,
|
|
21
|
+
xxl: 40
|
|
22
|
+
}, f = l(() => {
|
|
23
|
+
const s = {
|
|
24
|
+
"bb-icon": !0
|
|
25
|
+
};
|
|
26
|
+
let c = { width: l(() => {
|
|
27
|
+
let o;
|
|
28
|
+
return typeof e.size == "string" ? o = u[e.size] ?? parseInt(e.size, 10) : typeof e.size == "number" ? o = e.size : o = 24, o + "px";
|
|
29
|
+
}).value };
|
|
30
|
+
return e.color && (z(e.color) ? c.color = e.color : s[`bb-icon--${e.color}`] = !0), {
|
|
31
|
+
class: s,
|
|
32
|
+
style: c
|
|
33
|
+
};
|
|
34
|
+
}), n = y(null);
|
|
35
|
+
return _(async () => {
|
|
36
|
+
if (t) {
|
|
37
|
+
if (typeof t[e.type] > "u")
|
|
38
|
+
throw new Error(`Icon "${e.type}" does not exist.`);
|
|
39
|
+
n.value = await t[e.type]();
|
|
23
40
|
}
|
|
24
|
-
},
|
|
25
|
-
return (o, y) => (i(), l(u(o.tag), {
|
|
26
|
-
ref_key: "container",
|
|
27
|
-
ref: s,
|
|
28
|
-
class: "bb-smooth-height",
|
|
29
|
-
style: m({ "transition-duration": n.transitionDuration / 1e3 + "s" })
|
|
30
|
-
}, {
|
|
31
|
-
default: f(() => [
|
|
32
|
-
(i(), l(u(o.tag), {
|
|
33
|
-
ref_key: "content",
|
|
34
|
-
ref: e,
|
|
35
|
-
class: "content"
|
|
36
|
-
}, {
|
|
37
|
-
default: f(() => [
|
|
38
|
-
d(o.$slots, "default")
|
|
39
|
-
]),
|
|
40
|
-
_: 3
|
|
41
|
-
}, 512))
|
|
42
|
-
]),
|
|
43
|
-
_: 3
|
|
44
|
-
}, 8, ["style"]));
|
|
41
|
+
}), (s, a) => (b(), h("i", w(f.value, { innerHTML: n.value }), null, 16, g));
|
|
45
42
|
}
|
|
46
43
|
});
|
|
47
44
|
export {
|
|
48
|
-
|
|
45
|
+
$ as default
|
|
49
46
|
};
|
|
50
47
|
//# sourceMappingURL=index122.js.map
|
package/dist/index122.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index122.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index122.js","sources":["../src/components/BbIcon/BbIcon.vue"],"sourcesContent":["<template>\n\t<i v-bind=\"iconAttributes\" v-html=\"icon\"></i>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, getCurrentInstance, inject, ref, watchEffect } from 'vue';\nimport { isCssColor } from '@/utilities/functions/isCssColor';\nimport type { Size as S } from '@/types/CommonProps';\n\nexport type Size = {\n\txs: number;\n\tsm: number;\n\tmd: number;\n\tlg: number;\n\txl: number;\n\txxl: number;\n};\n\nexport type BbIconProps = S<Size> & {\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\t/**\n\t * Name of the icon to use\n\t */\n\ttype: string;\n};\nconst props = withDefaults(defineProps<BbIconProps>(), {\n\tsize: 'md',\n});\nlet icons: Record<string, () => Promise<string>> | undefined;\n// @ts-expect-error possibily undef\nconst isNuxt = !!getCurrentInstance()?.proxy?.$nuxt;\n\nif (isNuxt) {\n\t// @ts-expect-error possibily undef\n\tif (process.client) {\n\t\t// @ts-expect-error possibily undef\n\t\ticons = useNuxtApp()[`$icons`] as typeof icons; // eslint-disable-line no-undef\n\t}\n} else {\n\ticons = inject('icons');\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 iconAttributes = computed(() => {\n\tconst classes: any = {\n\t\t'bb-icon': true,\n\t};\n\tconst width = computed(() => {\n\t\tlet dimension: number;\n\t\tif (typeof props.size === 'string') {\n\t\t\tdimension = sizeMap[props.size as keyof Size] ?? parseInt(props.size, 10);\n\t\t} else if (typeof props.size === 'number') {\n\t\t\tdimension = props.size;\n\t\t} else {\n\t\t\tdimension = 24;\n\t\t}\n\t\treturn dimension + `px`;\n\t});\n\tlet style: { [key: string]: any } = { width: width.value };\n\n\tif (props.color) {\n\t\tif (isCssColor(props.color)) {\n\t\t\tstyle.color = props.color;\n\t\t} else {\n\t\t\tclasses[`bb-icon--${props.color}`] = true;\n\t\t}\n\t}\n\treturn {\n\t\tclass: classes,\n\t\tstyle,\n\t};\n});\n\nconst icon = ref<string | null>(null);\n\nwatchEffect(async () => {\n\tif (icons) {\n\t\tif (typeof icons[props.type] === 'undefined')\n\t\t\tthrow new Error(`Icon \"${props.type}\" does not exist.`);\n\t\ticon.value = await icons[props.type]();\n\t}\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbIcon';\n</style>\n"],"names":["props","__props","icons","_b","_a","getCurrentInstance","inject","sizeMap","iconAttributes","computed","classes","style","dimension","isCssColor","icon","ref","watchEffect"],"mappings":";;;;;;;;;;;AA8BA,UAAMA,IAAQC;AAGV,QAAAC;AAIJ,IAFe,CAAC,GAACC,KAAAC,IAAAC,EAAA,MAAA,gBAAAD,EAAsB,UAAtB,QAAAD,EAA6B,SAIzC,QAAQ,WAEHD,IAAA,WAAA,EAAa,UAGtBA,IAAQI,EAAO,OAAO;AAGvB,UAAMC,IAAgB;AAAA,MACrB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,KAAK;AAAA,IAAA,GAGAC,IAAiBC,EAAS,MAAM;AACrC,YAAMC,IAAe;AAAA,QACpB,WAAW;AAAA,MAAA;AAaZ,UAAIC,IAAgC,EAAE,OAXxBF,EAAS,MAAM;AACxB,YAAAG;AACA,eAAA,OAAOZ,EAAM,QAAS,WACzBY,IAAYL,EAAQP,EAAM,IAAkB,KAAK,SAASA,EAAM,MAAM,EAAE,IAC9D,OAAOA,EAAM,QAAS,WAChCY,IAAYZ,EAAM,OAENY,IAAA,IAENA,IAAY;AAAA,MAAA,CACnB,EACkD,MAAM;AAEzD,aAAIZ,EAAM,UACLa,EAAWb,EAAM,KAAK,IACzBW,EAAM,QAAQX,EAAM,QAEpBU,EAAQ,YAAYV,EAAM,KAAK,EAAE,IAAI,KAGhC;AAAA,QACN,OAAOU;AAAA,QACP,OAAAC;AAAA,MAAA;AAAA,IACD,CACA,GAEKG,IAAOC,EAAmB,IAAI;AAEpC,WAAAC,EAAY,YAAY;AACvB,UAAId,GAAO;AACV,YAAI,OAAOA,EAAMF,EAAM,IAAI,IAAM;AAChC,gBAAM,IAAI,MAAM,SAASA,EAAM,IAAI,mBAAmB;AACvD,QAAAc,EAAK,QAAQ,MAAMZ,EAAMF,EAAM,IAAI,EAAE;AAAA,MACtC;AAAA,IAAA,CACA;;;"}
|
package/dist/index123.js
CHANGED
|
@@ -1,38 +1,50 @@
|
|
|
1
|
-
import { defineComponent as p,
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
], g = /* @__PURE__ */ p({
|
|
6
|
-
__name: "BbSpinner",
|
|
1
|
+
import { defineComponent as v, ref as r, onMounted as p, onBeforeUnmount as h, openBlock as i, createBlock as l, resolveDynamicComponent as u, normalizeStyle as m, withCtx as f, renderSlot as d } from "vue";
|
|
2
|
+
import { throttle as g } from "./index229.js";
|
|
3
|
+
const O = /* @__PURE__ */ v({
|
|
4
|
+
__name: "BbSmoothHeight",
|
|
7
5
|
props: {
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
mutationOptions: { default: () => ({ childList: !0 }) },
|
|
7
|
+
resizeOptions: {},
|
|
8
|
+
strategy: { default: "resize" },
|
|
9
|
+
tag: { default: "div" },
|
|
10
|
+
transitionDuration: { default: 200 }
|
|
10
11
|
},
|
|
11
|
-
setup(
|
|
12
|
-
const c =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
12
|
+
setup(c) {
|
|
13
|
+
const n = c, s = r(null), e = r(null), t = r(null);
|
|
14
|
+
globalThis.ResizeObserver && (p(() => {
|
|
15
|
+
n.strategy === "resize" ? e.value && (t.value = new ResizeObserver(a), t.value.observe(e.value, n.resizeOptions)) : n.strategy === "mutation" && e.value && (t.value = new MutationObserver(a), t.value.observe(e.value, n.mutationOptions)), a();
|
|
16
|
+
}), h(() => {
|
|
17
|
+
t.value && t.value.disconnect();
|
|
18
|
+
}));
|
|
19
|
+
const a = g(() => {
|
|
20
|
+
if (s.value && e.value) {
|
|
21
|
+
const o = e.value.scrollHeight;
|
|
22
|
+
s.value.style.height = "0px", s.value.style.height = `${o}px`;
|
|
23
|
+
}
|
|
24
|
+
}, 200);
|
|
25
|
+
return (o, y) => (i(), l(u(o.tag), {
|
|
26
|
+
ref_key: "container",
|
|
27
|
+
ref: s,
|
|
28
|
+
class: "bb-smooth-height",
|
|
29
|
+
style: m({ "transition-duration": n.transitionDuration / 1e3 + "s" })
|
|
30
|
+
}, {
|
|
31
|
+
default: f(() => [
|
|
32
|
+
(i(), l(u(o.tag), {
|
|
33
|
+
ref_key: "content",
|
|
34
|
+
ref: e,
|
|
35
|
+
class: "content"
|
|
36
|
+
}, {
|
|
37
|
+
default: f(() => [
|
|
38
|
+
d(o.$slots, "default")
|
|
39
|
+
]),
|
|
40
|
+
_: 3
|
|
41
|
+
}, 512))
|
|
42
|
+
]),
|
|
43
|
+
_: 3
|
|
44
|
+
}, 8, ["style"]));
|
|
33
45
|
}
|
|
34
46
|
});
|
|
35
47
|
export {
|
|
36
|
-
|
|
48
|
+
O as default
|
|
37
49
|
};
|
|
38
50
|
//# sourceMappingURL=index123.js.map
|
package/dist/index123.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index123.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index123.js","sources":["../src/components/BbSmoothHeight/BbSmoothHeight.vue"],"sourcesContent":["<template>\n\t<component\n\t\t:is=\"tag\"\n\t\tref=\"container\"\n\t\tclass=\"bb-smooth-height\"\n\t\t:style=\"{ 'transition-duration': props.transitionDuration / 1000 + 's' }\"\n\t>\n\t\t<component :is=\"tag\" ref=\"content\" class=\"content\">\n\t\t\t<slot />\n\t\t</component>\n\t</component>\n</template>\n\n<script setup lang=\"ts\">\nimport type { CommonProps, NonVoidElementTag } from '@/types/CommonProps';\nimport { throttle } from '@/utilities/functions/throttle';\nimport { ref, onMounted, onBeforeUnmount } from 'vue';\n\nexport type BbSmoothHeightProps = {\n\t/**\n\t * Options to pass to the MutationObserver\n\t */\n\tmutationOptions?: MutationObserverInit; // eslint-disable-line no-undef\n\t/**\n\t * Options to pass to the ResizeObserver\n\t */\n\tresizeOptions?: ResizeObserverOptions; // eslint-disable-line no-undef\n\t/**\n\t * Define which strategy to use. By default is used 'resize' which means the\n\t * component will update on resizing.\n\t * You can also define 'mutation' to use a MutationObserver\n\t */\n\tstrategy?: 'resize' | 'mutation';\n} & NonVoidElementTag &\n\tPick<CommonProps, 'transitionDuration'>;\n\nconst props = withDefaults(defineProps<BbSmoothHeightProps>(), {\n\ttransitionDuration: 200,\n\tstrategy: 'resize',\n\tmutationOptions: () => ({ childList: true }),\n\ttag: 'div',\n});\n\nexport type BbSmoothHeightSlots = {\n\tdefault?: (props: object) => any;\n};\n\ndefineSlots<BbSmoothHeightSlots>();\n\nconst container = ref<HTMLElement | null>(null);\nconst content = ref<HTMLElement | null>(null);\nconst observer = ref<ResizeObserver | MutationObserver | null>(null);\n\nif (globalThis.ResizeObserver) {\n\tonMounted(() => {\n\t\tif (props.strategy === 'resize') {\n\t\t\tif (content.value) {\n\t\t\t\tobserver.value = new ResizeObserver(onContentGrow);\n\t\t\t\tobserver.value.observe(content.value, props.resizeOptions);\n\t\t\t}\n\t\t} else if (props.strategy === 'mutation') {\n\t\t\tif (content.value) {\n\t\t\t\tobserver.value = new MutationObserver(onContentGrow);\n\t\t\t\tobserver.value.observe(content.value, props.mutationOptions);\n\t\t\t}\n\t\t}\n\t\tonContentGrow();\n\t});\n\tonBeforeUnmount(() => {\n\t\tif (observer.value) {\n\t\t\tobserver.value.disconnect();\n\t\t}\n\t});\n}\n\n/**\n * This is called when content changes.\n * It could be called numerous times so throttle every 200ms\n */\nconst onContentGrow = throttle(() => {\n\tif (container.value && content.value) {\n\t\tconst contentHeight = content.value.scrollHeight;\n\t\tcontainer.value.style.height = '0px';\n\t\tcontainer.value.style.height = `${contentHeight}px`;\n\t}\n}, 200);\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbSmoothHeight';\n</style>\n"],"names":["props","__props","container","ref","content","observer","onMounted","onContentGrow","onBeforeUnmount","throttle","contentHeight"],"mappings":";;;;;;;;;;;;AAoCA,UAAMA,IAAQC,GAaRC,IAAYC,EAAwB,IAAI,GACxCC,IAAUD,EAAwB,IAAI,GACtCE,IAAWF,EAA8C,IAAI;AAEnE,IAAI,WAAW,mBACdG,EAAU,MAAM;AACX,MAAAN,EAAM,aAAa,WAClBI,EAAQ,UACFC,EAAA,QAAQ,IAAI,eAAeE,CAAa,GACjDF,EAAS,MAAM,QAAQD,EAAQ,OAAOJ,EAAM,aAAa,KAEhDA,EAAM,aAAa,cACzBI,EAAQ,UACFC,EAAA,QAAQ,IAAI,iBAAiBE,CAAa,GACnDF,EAAS,MAAM,QAAQD,EAAQ,OAAOJ,EAAM,eAAe,IAG/CO;IAAA,CACd,GACDC,EAAgB,MAAM;AACrB,MAAIH,EAAS,SACZA,EAAS,MAAM;IAChB,CACA;AAOI,UAAAE,IAAgBE,EAAS,MAAM;AAChC,UAAAP,EAAU,SAASE,EAAQ,OAAO;AAC/B,cAAAM,IAAgBN,EAAQ,MAAM;AAC1B,QAAAF,EAAA,MAAM,MAAM,SAAS,OAC/BA,EAAU,MAAM,MAAM,SAAS,GAAGQ,CAAa;AAAA,MAChD;AAAA,OACE,GAAG;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index124.js
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
|
-
|
|
1
|
+
import { defineComponent as p, computed as l, openBlock as _, createElementBlock as a, normalizeProps as b, guardReactiveProps as x, createStaticVNode as m } from "vue";
|
|
2
|
+
import { isCssColor as d } from "./index200.js";
|
|
3
|
+
const u = /* @__PURE__ */ m('<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle class="bb-spinner__circle" cx="12" cy="3" r="0"></circle><circle class="bb-spinner__circle circle--1" cx="16.50" cy="4.21" r="0"></circle><circle class="bb-spinner__circle circle--2" cx="7.50" cy="4.21" r="0"></circle><circle class="bb-spinner__circle circle--3" cx="19.79" cy="7.50" r="0"></circle><circle class="bb-spinner__circle circle--4" cx="4.21" cy="7.50" r="0"></circle><circle class="bb-spinner__circle circle--5" cx="21.00" cy="12.00" r="0"></circle><circle class="bb-spinner__circle circle--6" cx="3.00" cy="12.00" r="0"></circle><circle class="bb-spinner__circle circle--7" cx="19.79" cy="16.50" r="0"></circle><circle class="bb-spinner__circle circle--8" cx="4.21" cy="16.50" r="0"></circle><circle class="bb-spinner__circle circle--9" cx="16.50" cy="19.79" r="0"></circle><circle class="bb-spinner__circle circle--10" cx="7.50" cy="19.79" r="0"></circle><circle class="bb-spinner__circle circle--11" cx="12" cy="21" r="0"></circle></svg>', 1), y = [
|
|
4
|
+
u
|
|
5
|
+
], g = /* @__PURE__ */ p({
|
|
6
|
+
__name: "BbSpinner",
|
|
7
|
+
props: {
|
|
8
|
+
color: {},
|
|
9
|
+
size: { default: "md" }
|
|
10
|
+
},
|
|
11
|
+
setup(s) {
|
|
12
|
+
const c = s, n = {
|
|
13
|
+
xs: 12,
|
|
14
|
+
sm: 16,
|
|
15
|
+
md: 24,
|
|
16
|
+
lg: 28,
|
|
17
|
+
xl: 36,
|
|
18
|
+
xxl: 40
|
|
19
|
+
}, o = l(() => {
|
|
20
|
+
const e = {
|
|
21
|
+
"bb-spinner": !0
|
|
22
|
+
};
|
|
23
|
+
let i = { width: l(() => {
|
|
24
|
+
let r;
|
|
25
|
+
return typeof c.size == "string" ? r = n[c.size] ?? parseInt(c.size, 10) : r = c.size, r + "px";
|
|
26
|
+
}).value };
|
|
27
|
+
return c.color && (d(c.color) ? i.color = c.color : e[`bb-spinner--${c.color}`] = !0), {
|
|
28
|
+
class: e,
|
|
29
|
+
style: i
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
return (e, t) => (_(), a("span", b(x(o.value)), y, 16));
|
|
33
|
+
}
|
|
34
|
+
});
|
|
2
35
|
export {
|
|
3
|
-
|
|
36
|
+
g as default
|
|
4
37
|
};
|
|
5
38
|
//# sourceMappingURL=index124.js.map
|
package/dist/index124.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index124.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index124.js","sources":["../src/components/BbSpinner/BbSpinner.vue"],"sourcesContent":["<template>\n\t<span v-bind=\"iconAttributes\">\n\t\t<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t<circle class=\"bb-spinner__circle\" cx=\"12\" cy=\"3\" r=\"0\" />\n\t\t\t<circle class=\"bb-spinner__circle circle--1\" cx=\"16.50\" cy=\"4.21\" r=\"0\" />\n\t\t\t<circle class=\"bb-spinner__circle circle--2\" cx=\"7.50\" cy=\"4.21\" r=\"0\" />\n\t\t\t<circle class=\"bb-spinner__circle circle--3\" cx=\"19.79\" cy=\"7.50\" r=\"0\" />\n\t\t\t<circle class=\"bb-spinner__circle circle--4\" cx=\"4.21\" cy=\"7.50\" r=\"0\" />\n\t\t\t<circle\n\t\t\t\tclass=\"bb-spinner__circle circle--5\"\n\t\t\t\tcx=\"21.00\"\n\t\t\t\tcy=\"12.00\"\n\t\t\t\tr=\"0\"\n\t\t\t/>\n\t\t\t<circle class=\"bb-spinner__circle circle--6\" cx=\"3.00\" cy=\"12.00\" r=\"0\" />\n\t\t\t<circle\n\t\t\t\tclass=\"bb-spinner__circle circle--7\"\n\t\t\t\tcx=\"19.79\"\n\t\t\t\tcy=\"16.50\"\n\t\t\t\tr=\"0\"\n\t\t\t/>\n\t\t\t<circle class=\"bb-spinner__circle circle--8\" cx=\"4.21\" cy=\"16.50\" r=\"0\" />\n\t\t\t<circle\n\t\t\t\tclass=\"bb-spinner__circle circle--9\"\n\t\t\t\tcx=\"16.50\"\n\t\t\t\tcy=\"19.79\"\n\t\t\t\tr=\"0\"\n\t\t\t/>\n\t\t\t<circle\n\t\t\t\tclass=\"bb-spinner__circle circle--10\"\n\t\t\t\tcx=\"7.50\"\n\t\t\t\tcy=\"19.79\"\n\t\t\t\tr=\"0\"\n\t\t\t/>\n\t\t\t<circle class=\"bb-spinner__circle circle--11\" cx=\"12\" cy=\"21\" r=\"0\" />\n\t\t</svg>\n\t</span>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport { isCssColor } from '@/utilities/functions/isCssColor';\nimport type { Classes } from '@/types/Classes';\nimport type { CommonProps, Size as S } from '@/types/CommonProps';\nimport type { Size as IconSize } from '../BbIcon/BbIcon.vue';\n\nexport type Size = IconSize;\nexport type BbSpinnerProps = Pick<CommonProps, 'color'> & S<IconSize>;\n\nconst props = withDefaults(defineProps<BbSpinnerProps>(), {\n\tsize: 'md',\n});\n\nconst sizeMap: IconSize = {\n\txs: 12,\n\tsm: 16,\n\tmd: 24,\n\tlg: 28,\n\txl: 36,\n\txxl: 40,\n};\n\nconst iconAttributes = computed(() => {\n\tconst classes: Classes = {\n\t\t'bb-spinner': true,\n\t};\n\tconst width = computed(() => {\n\t\tlet dimension: number;\n\t\tif (typeof props.size === 'string') {\n\t\t\tdimension =\n\t\t\t\tsizeMap[props.size as keyof IconSize] ?? parseInt(props.size, 10);\n\t\t} else {\n\t\t\tdimension = props.size;\n\t\t}\n\t\treturn dimension + `px`;\n\t});\n\tlet style: { [key: string]: any } = { width: width.value };\n\n\tif (props.color) {\n\t\tif (isCssColor(props.color)) {\n\t\t\tstyle.color = props.color;\n\t\t} else {\n\t\t\tclasses[`bb-spinner--${props.color}`] = true;\n\t\t}\n\t}\n\treturn {\n\t\tclass: classes,\n\t\tstyle,\n\t};\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbSpinner';\n</style>\n"],"names":["props","__props","sizeMap","iconAttributes","computed","classes","style","dimension","isCssColor"],"mappings":";;;;;;;;;;;AAiDA,UAAMA,IAAQC,GAIRC,IAAoB;AAAA,MACzB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,KAAK;AAAA,IAAA,GAGAC,IAAiBC,EAAS,MAAM;AACrC,YAAMC,IAAmB;AAAA,QACxB,cAAc;AAAA,MAAA;AAYf,UAAIC,IAAgC,EAAE,OAVxBF,EAAS,MAAM;AACxB,YAAAG;AACA,eAAA,OAAOP,EAAM,QAAS,WACzBO,IACCL,EAAQF,EAAM,IAAsB,KAAK,SAASA,EAAM,MAAM,EAAE,IAEjEO,IAAYP,EAAM,MAEZO,IAAY;AAAA,MAAA,CACnB,EACkD,MAAM;AAEzD,aAAIP,EAAM,UACLQ,EAAWR,EAAM,KAAK,IACzBM,EAAM,QAAQN,EAAM,QAEpBK,EAAQ,eAAeL,EAAM,KAAK,EAAE,IAAI,KAGnC;AAAA,QACN,OAAOK;AAAA,QACP,OAAAC;AAAA,MAAA;AAAA,IACD,CACA;;;;"}
|
package/dist/index125.js
CHANGED
|
@@ -1,24 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
const r = (t, e) => t * 100 / e, p = (t, e) => t / 100 * e, l = (t, e, n) => r(t - e, n - e), P = ({
|
|
3
|
-
value: t = 0,
|
|
4
|
-
originalBounds: e,
|
|
5
|
-
targetBounds: n,
|
|
6
|
-
step: c = 1
|
|
7
|
-
}) => {
|
|
8
|
-
const a = l(
|
|
9
|
-
t,
|
|
10
|
-
e.min,
|
|
11
|
-
e.max
|
|
12
|
-
), m = p(
|
|
13
|
-
a,
|
|
14
|
-
n.max - n.min
|
|
15
|
-
) + n.min, s = Math.round(m / c) * c;
|
|
16
|
-
return o(s, n.min, n.max);
|
|
17
|
-
};
|
|
1
|
+
const r = (e) => typeof e > "u" || e === null;
|
|
18
2
|
export {
|
|
19
|
-
r as
|
|
20
|
-
l as getAsPercentageBetween,
|
|
21
|
-
p as getPercentageFrom,
|
|
22
|
-
P as transposeValue
|
|
3
|
+
r as isNil
|
|
23
4
|
};
|
|
24
5
|
//# sourceMappingURL=index125.js.map
|