bitboss-ui 2.0.5 → 2.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/BaseDialog/BaseDialog.vue.d.ts +1 -3
- package/dist/composables/useOptions.d.ts +1 -1
- package/dist/index.js +89 -87
- package/dist/index.js.map +1 -1
- package/dist/index10.js +7 -39
- package/dist/index10.js.map +1 -1
- package/dist/index101.js +60 -87
- package/dist/index101.js.map +1 -1
- package/dist/index103.js +113 -258
- package/dist/index103.js.map +1 -1
- package/dist/index105.js +254 -388
- package/dist/index105.js.map +1 -1
- package/dist/index107.js +387 -98
- package/dist/index107.js.map +1 -1
- package/dist/index109.js +52 -48
- package/dist/index109.js.map +1 -1
- package/dist/index11.js +74 -188
- package/dist/index11.js.map +1 -1
- package/dist/index111.js +35 -34
- package/dist/index111.js.map +1 -1
- package/dist/index113.js +105 -23
- package/dist/index113.js.map +1 -1
- package/dist/index115.js +23 -156
- package/dist/index115.js.map +1 -1
- package/dist/index117.js +153 -112
- package/dist/index117.js.map +1 -1
- package/dist/index119.js +115 -39
- package/dist/index119.js.map +1 -1
- package/dist/index12.js +38 -80
- package/dist/index12.js.map +1 -1
- package/dist/index121.js +36 -40
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +34 -37
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +30 -21
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +47 -2
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +35 -21
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +2 -2
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +21 -312
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +2 -24
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +312 -2
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +196 -0
- package/dist/index13.js.map +1 -0
- package/dist/index130.js +24 -5
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +2 -9
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +5 -6
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +9 -3
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +6 -3
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +1 -1
- package/dist/index136.js +1 -1
- package/dist/index137.js +1 -1
- package/dist/index138.js +1 -1
- package/dist/index139.js +1 -1
- package/dist/index14.js +73 -121
- package/dist/index14.js.map +1 -1
- package/dist/index140.js +1 -1
- package/dist/index141.js +1 -1
- package/dist/index142.js +1 -1
- package/dist/index143.js +1 -1
- package/dist/index144.js +1 -1
- package/dist/index145.js +1 -1
- package/dist/index146.js +1 -1
- package/dist/index147.js +1 -1
- package/dist/index148.js +1 -1
- package/dist/index149.js +1 -1
- package/dist/index150.js +1 -1
- package/dist/index151.js +1 -1
- package/dist/index152.js +1 -1
- package/dist/index153.js +1 -1
- package/dist/index154.js +1 -1
- package/dist/index155.js +1 -1
- package/dist/index156.js +1 -1
- package/dist/index157.js +1 -1
- package/dist/index158.js +1 -1
- package/dist/index159.js +2 -2
- package/dist/index16.js +119 -118
- package/dist/index16.js.map +1 -1
- package/dist/index160.js +6 -0
- package/dist/index160.js.map +1 -0
- package/dist/index161.js +1 -1
- package/dist/index163.js +2 -2
- package/dist/index165.js +1 -1
- package/dist/index166.js +1 -1
- package/dist/index167.js +1 -1
- package/dist/index168.js +1 -1
- package/dist/index169.js +2 -2
- package/dist/index170.js +6 -0
- package/dist/index170.js.map +1 -0
- package/dist/index171.js +3 -2
- package/dist/index171.js.map +1 -1
- package/dist/index173.js +2 -3
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +1 -1
- package/dist/index175.js +1 -1
- package/dist/index176.js +1 -1
- package/dist/index177.js +1 -1
- package/dist/index178.js +1 -1
- package/dist/index179.js +1 -1
- package/dist/index18.js +120 -208
- package/dist/index18.js.map +1 -1
- package/dist/index180.js +1 -1
- package/dist/index181.js +1 -1
- package/dist/index182.js +1 -1
- package/dist/index183.js +2 -2
- package/dist/index184.js +6 -0
- package/dist/index184.js.map +1 -0
- package/dist/index185.js +1 -1
- package/dist/index187.js +1 -1
- package/dist/index189.js +1 -1
- package/dist/index190.js +1 -1
- package/dist/index191.js +1 -1
- package/dist/index192.js +1 -1
- package/dist/index193.js +1 -1
- package/dist/index194.js +1 -1
- package/dist/index195.js +1 -1
- package/dist/index196.js +1 -1
- package/dist/index197.js +3 -81
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +3 -3
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +81 -5
- package/dist/index199.js.map +1 -1
- package/dist/index20.js +193 -275
- package/dist/index20.js.map +1 -1
- package/dist/index200.js +2 -16
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +3 -16
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +124 -17
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +5 -19
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +119 -23
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +19 -3
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +16 -2
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +16 -8
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +2 -249
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +5 -0
- package/dist/index209.js.map +1 -0
- package/dist/index210.js +35 -52
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +173 -36
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +6 -5
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +39 -36
- package/dist/index213.js.map +1 -1
- package/dist/index215.js +13 -4
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +5 -2
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +369 -2
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +6 -40
- package/dist/index218.js.map +1 -1
- package/dist/{index214.js → index219.js} +1 -1
- package/dist/{index214.js.map → index219.js.map} +1 -1
- package/dist/index22.js +287 -247
- package/dist/index22.js.map +1 -1
- package/dist/index220.js +4 -13
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +2 -158
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +3 -84
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +10 -0
- package/dist/index223.js.map +1 -0
- package/dist/index224.js +19 -3
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +26 -34
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +3 -6
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +249 -7
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +49 -123
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +44 -123
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +5 -2
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +49 -174
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +158 -5
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +83 -368
- package/dist/index233.js.map +1 -1
- package/dist/index235.js +2 -18
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +17 -105
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +109 -0
- package/dist/index237.js.map +1 -0
- package/dist/{index238.js → index239.js} +3 -3
- package/dist/{index238.js.map → index239.js.map} +1 -1
- package/dist/index24.js +249 -120
- package/dist/index24.js.map +1 -1
- package/dist/index241.js +2 -10
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +9 -2
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +3 -224
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +9 -281
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +23 -6
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +6 -2
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +16 -2
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +224 -2
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +281 -2
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +6 -2
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +2 -2
- package/dist/index252.js +2 -3
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +2 -2
- package/dist/index254.js +2 -2
- package/dist/index255.js +2 -2
- package/dist/index256.js +122 -24
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +429 -20
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +6 -0
- package/dist/index258.js.map +1 -0
- package/dist/index26.js +119 -142
- package/dist/index26.js.map +1 -1
- package/dist/index260.js +6 -3
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +21 -8
- package/dist/index261.js.map +1 -1
- package/dist/index263.js +9 -3
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +439 -0
- package/dist/index264.js.map +1 -0
- package/dist/index265.js +127 -6
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +199 -15
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +4 -9
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +89 -3
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +2 -12
- package/dist/index269.js.map +1 -1
- package/dist/index270.js +2 -9
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +2 -9
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +2 -17
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +2 -431
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +2 -89
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +28 -2
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +17 -64
- package/dist/index276.js.map +1 -1
- package/dist/index278.js +3 -200
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +12 -2
- package/dist/index279.js.map +1 -1
- package/dist/index28.js +138 -83
- package/dist/index28.js.map +1 -1
- package/dist/index280.js +7 -124
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +7 -20
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +20 -0
- package/dist/index282.js.map +1 -0
- package/dist/index283.js +2 -436
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +68 -126
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +5 -3
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +1 -1
- package/dist/index287.js +3 -211
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +214 -0
- package/dist/index288.js.map +1 -0
- package/dist/index290.js +4 -7
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +4 -19
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +58 -6
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +35 -4
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +7 -4
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +6 -58
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +18 -34
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +2 -11
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +47 -2
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +10 -46
- package/dist/index299.js.map +1 -1
- package/dist/index30.js +85 -115
- package/dist/index30.js.map +1 -1
- package/dist/index32.js +111 -112
- package/dist/index32.js.map +1 -1
- package/dist/index34.js +114 -365
- package/dist/index34.js.map +1 -1
- package/dist/index36.js +361 -283
- package/dist/index36.js.map +1 -1
- package/dist/index38.js +288 -106
- package/dist/index38.js.map +1 -1
- package/dist/index40.js +114 -121
- package/dist/index40.js.map +1 -1
- package/dist/index42.js +113 -200
- package/dist/index42.js.map +1 -1
- package/dist/index44.js +180 -90
- package/dist/index44.js.map +1 -1
- package/dist/index46.js +110 -78
- package/dist/index46.js.map +1 -1
- package/dist/index48.js +89 -54
- package/dist/index48.js.map +1 -1
- package/dist/index5.js +14 -78
- package/dist/index5.js.map +1 -1
- package/dist/index50.js +54 -84
- package/dist/index50.js.map +1 -1
- package/dist/index52.js +86 -60
- package/dist/index52.js.map +1 -1
- package/dist/index54.js +59 -40
- package/dist/index54.js.map +1 -1
- package/dist/index56.js +42 -55
- package/dist/index56.js.map +1 -1
- package/dist/index58.js +53 -103
- package/dist/index58.js.map +1 -1
- package/dist/index6.js +36 -58
- package/dist/index6.js.map +1 -1
- package/dist/index60.js +103 -89
- package/dist/index60.js.map +1 -1
- package/dist/index62.js +61 -88
- package/dist/index62.js.map +1 -1
- package/dist/index64.js +119 -77
- package/dist/index64.js.map +1 -1
- package/dist/index66.js +77 -91
- package/dist/index66.js.map +1 -1
- package/dist/index68.js +88 -49
- package/dist/index68.js.map +1 -1
- package/dist/index7.js +78 -20
- package/dist/index7.js.map +1 -1
- package/dist/index70.js +51 -304
- package/dist/index70.js.map +1 -1
- package/dist/index72.js +299 -115
- package/dist/index72.js.map +1 -1
- package/dist/index74.js +120 -214
- package/dist/index74.js.map +1 -1
- package/dist/index76.js +213 -36
- package/dist/index76.js.map +1 -1
- package/dist/index78.js +47 -0
- package/dist/index78.js.map +1 -0
- package/dist/index79.js +119 -230
- package/dist/index79.js.map +1 -1
- package/dist/index8.js +61 -7
- package/dist/index8.js.map +1 -1
- package/dist/index81.js +227 -154
- package/dist/index81.js.map +1 -1
- package/dist/index83.js +154 -207
- package/dist/index83.js.map +1 -1
- package/dist/index85.js +215 -26
- package/dist/index85.js.map +1 -1
- package/dist/index87.js +27 -88
- package/dist/index87.js.map +1 -1
- package/dist/index89.js +53 -88
- package/dist/index89.js.map +1 -1
- package/dist/index9.js +17 -76
- package/dist/index9.js.map +1 -1
- package/dist/index91.js +75 -44
- package/dist/index91.js.map +1 -1
- package/dist/index93.js +89 -15
- package/dist/index93.js.map +1 -1
- package/dist/index95.js +15 -166
- package/dist/index95.js.map +1 -1
- package/dist/index97.js +120 -59
- package/dist/index97.js.map +1 -1
- package/dist/index99.js +66 -52
- package/dist/index99.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/dist/index120.js +0 -47
- package/dist/index120.js.map +0 -1
- package/dist/index164.js +0 -6
- package/dist/index164.js.map +0 -1
- package/dist/index172.js +0 -6
- package/dist/index172.js.map +0 -1
- package/dist/index188.js +0 -6
- package/dist/index188.js.map +0 -1
- package/dist/index234.js +0 -6
- package/dist/index234.js.map +0 -1
- package/dist/index240.js +0 -5
- package/dist/index240.js.map +0 -1
- package/dist/index259.js +0 -10
- package/dist/index259.js.map +0 -1
- package/dist/index262.js +0 -26
- package/dist/index262.js.map +0 -1
- package/dist/index277.js +0 -8
- package/dist/index277.js.map +0 -1
- package/dist/index3.js +0 -17
- package/dist/index3.js.map +0 -1
- package/dist/index4.js +0 -43
- package/dist/index4.js.map +0 -1
- package/dist/index77.js +0 -130
- package/dist/index77.js.map +0 -1
package/dist/index66.js
CHANGED
|
@@ -1,100 +1,86 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as k, computed as _, openBlock as n, createBlock as l, unref as e, createSlots as h, withCtx as s, createElementBlock as f, toDisplayString as c, createCommentVNode as m, renderSlot as d, createElementVNode as g, createVNode as C, renderList as $, normalizeProps as x, guardReactiveProps as V, mergeProps as z, createTextVNode as u } from "vue";
|
|
2
|
+
import { actions as p, state as o } from "./index7.js";
|
|
3
|
+
import v from "./index14.js";
|
|
3
4
|
/* empty css */
|
|
4
|
-
import
|
|
5
|
+
import A from "./index24.js";
|
|
5
6
|
/* empty css */
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
hint: {},
|
|
20
|
-
id: {},
|
|
21
|
-
label: {},
|
|
22
|
-
labelPosition: {},
|
|
23
|
-
loading: { type: Boolean },
|
|
24
|
-
max: {},
|
|
25
|
-
min: {},
|
|
26
|
-
modelValue: {},
|
|
27
|
-
name: {},
|
|
28
|
-
persistentHint: { type: Boolean },
|
|
29
|
-
placeholder: {},
|
|
30
|
-
"prepend:icon": {},
|
|
31
|
-
range: { type: Boolean },
|
|
32
|
-
readonly: { type: Boolean },
|
|
33
|
-
required: { type: Boolean },
|
|
34
|
-
reverse: { type: Boolean },
|
|
35
|
-
selectable: {},
|
|
36
|
-
width: {}
|
|
37
|
-
},
|
|
38
|
-
emits: ["active", "error", "focus", "inactive", "update:modelValue"],
|
|
39
|
-
setup(i, { emit: n }) {
|
|
40
|
-
const t = i, o = n, a = c(!1), s = h(() => t.persistentHint || a.value), d = {
|
|
41
|
-
onError: (e) => o("error", e),
|
|
42
|
-
onFocus: (e) => o("focus", e),
|
|
43
|
-
onActive: () => {
|
|
44
|
-
a.value = !0, o("active");
|
|
45
|
-
},
|
|
46
|
-
onInactive: () => {
|
|
47
|
-
a.value = !1, o("inactive");
|
|
48
|
-
},
|
|
49
|
-
"onUpdate:modelValue": (e) => o("update:modelValue", e)
|
|
7
|
+
import B from "./index125.js";
|
|
8
|
+
/* empty css */
|
|
9
|
+
const N = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "bb-confirm__content"
|
|
12
|
+
}, P = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "bb-confirm__text"
|
|
15
|
+
}, S = { class: "bb-confirm__spinner" }, F = /* @__PURE__ */ k({
|
|
16
|
+
__name: "BbConfirm",
|
|
17
|
+
setup(E) {
|
|
18
|
+
const i = _(() => p.value[0]), r = _(() => p.value[1]), b = (t) => {
|
|
19
|
+
t ? r.value.handler() : i.value.handler();
|
|
50
20
|
};
|
|
51
|
-
return (
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
label: l((r) => [
|
|
67
|
-
v(e.$slots, "label", y(w(r)))
|
|
21
|
+
return (t, U) => (n(), l(A, {
|
|
22
|
+
"model-value": e(o).open || e(o).loading,
|
|
23
|
+
"overlay-classes": ["bb-confirm", `bb-confirm--${e(o).theme}`],
|
|
24
|
+
size: e(o).size,
|
|
25
|
+
title: e(o).title,
|
|
26
|
+
"onUpdate:modelValue": b
|
|
27
|
+
}, h({
|
|
28
|
+
default: s(() => [
|
|
29
|
+
e(o).loading ? d(t.$slots, "spinner", { key: 1 }, () => [
|
|
30
|
+
g("div", S, [
|
|
31
|
+
C(B, { size: "36" })
|
|
32
|
+
])
|
|
33
|
+
]) : (n(), f("div", N, [
|
|
34
|
+
e(o).text ? (n(), f("div", P, c(e(o).text), 1)) : m("", !0)
|
|
35
|
+
]))
|
|
68
36
|
]),
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
37
|
+
_: 2
|
|
38
|
+
}, [
|
|
39
|
+
$(["header", "title", "close", "description"], (a) => ({
|
|
40
|
+
name: a,
|
|
41
|
+
fn: s((y) => [
|
|
42
|
+
d(t.$slots, a, x(V(y)))
|
|
43
|
+
])
|
|
44
|
+
})),
|
|
45
|
+
!e(o).loading && e(o).actions ? {
|
|
46
|
+
name: "footer",
|
|
47
|
+
fn: s((a) => [
|
|
48
|
+
d(t.$slots, "footer", z({
|
|
49
|
+
actions: e(o).actions,
|
|
50
|
+
loading: e(o).loading,
|
|
51
|
+
no: e(o).no,
|
|
52
|
+
noAction: i.value,
|
|
53
|
+
yes: e(o).yes,
|
|
54
|
+
yesAction: r.value
|
|
55
|
+
}, a), () => [
|
|
56
|
+
e(o).no ? (n(), l(v, {
|
|
57
|
+
key: 0,
|
|
58
|
+
class: "bb-confirm__no",
|
|
59
|
+
onClick: i.value.handler
|
|
60
|
+
}, {
|
|
61
|
+
default: s(() => [
|
|
62
|
+
u(c(i.value.text), 1)
|
|
63
|
+
]),
|
|
64
|
+
_: 1
|
|
65
|
+
}, 8, ["onClick"])) : m("", !0),
|
|
66
|
+
e(o).yes ? (n(), l(v, {
|
|
67
|
+
key: 1,
|
|
68
|
+
class: "bb-confirm__yes",
|
|
69
|
+
onClick: r.value.handler
|
|
70
|
+
}, {
|
|
71
|
+
default: s(() => [
|
|
72
|
+
u(c(r.value.text), 1)
|
|
73
|
+
]),
|
|
74
|
+
_: 1
|
|
75
|
+
}, 8, ["onClick"])) : m("", !0)
|
|
76
|
+
])
|
|
77
|
+
]),
|
|
78
|
+
key: "0"
|
|
79
|
+
} : void 0
|
|
80
|
+
]), 1032, ["model-value", "overlay-classes", "size", "title"]));
|
|
95
81
|
}
|
|
96
82
|
});
|
|
97
83
|
export {
|
|
98
|
-
|
|
84
|
+
F as default
|
|
99
85
|
};
|
|
100
86
|
//# sourceMappingURL=index66.js.map
|
package/dist/index66.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index66.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index66.js","sources":["../src/components/BbConfirm/BbConfirm.vue"],"sourcesContent":["<template>\n\t<BaseDialog\n\t\t:model-value=\"state.open || state.loading\"\n\t\t:overlay-classes=\"['bb-confirm', `bb-confirm--${state.theme}`]\"\n\t\t:size=\"state.size\"\n\t\t:title=\"state.title\"\n\t\t@update:model-value=\"onModelValueUpdate\"\n\t>\n\t\t<!-- Transparently pass all slots that are not customized -->\n\t\t<template\n\t\t\tv-for=\"name in ['header', 'title', 'close', 'description']\"\n\t\t\t#[name]=\"data\"\n\t\t>\n\t\t\t<slot :name=\"name\" v-bind=\"data\"> </slot>\n\t\t</template>\n\t\t<div v-if=\"!state.loading\" class=\"bb-confirm__content\">\n\t\t\t<div v-if=\"state.text\" class=\"bb-confirm__text\">{{ state.text }}</div>\n\t\t</div>\n\t\t<slot v-else name=\"spinner\">\n\t\t\t<div class=\"bb-confirm__spinner\">\n\t\t\t\t<BbSpinner size=\"36\" />\n\t\t\t</div>\n\t\t</slot>\n\t\t<template v-if=\"!state.loading && state.actions\" #footer=\"data\">\n\t\t\t<slot\n\t\t\t\t:actions=\"state.actions\"\n\t\t\t\t:loading=\"state.loading\"\n\t\t\t\tname=\"footer\"\n\t\t\t\t:no=\"state.no\"\n\t\t\t\t:no-action=\"noAction\"\n\t\t\t\t:yes=\"state.yes\"\n\t\t\t\t:yes-action=\"yesAction\"\n\t\t\t\tv-bind=\"data\"\n\t\t\t>\n\t\t\t\t<BaseButton\n\t\t\t\t\tv-if=\"state.no\"\n\t\t\t\t\tclass=\"bb-confirm__no\"\n\t\t\t\t\t@click=\"noAction.handler\"\n\t\t\t\t>\n\t\t\t\t\t{{ noAction.text }}\n\t\t\t\t</BaseButton>\n\n\t\t\t\t<BaseButton\n\t\t\t\t\tv-if=\"state.yes\"\n\t\t\t\t\tclass=\"bb-confirm__yes\"\n\t\t\t\t\t@click=\"yesAction.handler\"\n\t\t\t\t>\n\t\t\t\t\t{{ yesAction.text }}\n\t\t\t\t</BaseButton>\n\t\t\t</slot>\n\t\t</template>\n\t</BaseDialog>\n</template>\n\n<script setup lang=\"ts\">\nimport { actions, state } from '@/composables/useConfirm';\nimport { computed } from 'vue';\nimport BaseButton from '../BaseButton/BaseButton.vue';\nimport BaseDialog from '../BaseDialog/BaseDialog.vue';\nimport BbSpinner from '../BbSpinner/BbSpinner.vue';\n\nconst noAction = computed(() => actions.value[0]);\nconst yesAction = computed(() => actions.value[1]);\nconst onModelValueUpdate = (value: boolean) => {\n\tif (value) yesAction.value.handler();\n\telse noAction.value.handler();\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbConfirm';\n</style>\n"],"names":["noAction","computed","actions","yesAction","onModelValueUpdate","value"],"mappings":";;;;;;;;;;;;;;;;;AA6DA,UAAMA,IAAWC,EAAS,MAAMC,EAAQ,MAAM,CAAC,CAAC,GAC1CC,IAAYF,EAAS,MAAMC,EAAQ,MAAM,CAAC,CAAC,GAC3CE,IAAqB,CAACC,MAAmB;AAC1C,MAAAA,IAAiBF,EAAA,MAAM,QAAQ,IAC9BH,EAAS,MAAM;IAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index68.js
CHANGED
|
@@ -1,61 +1,100 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as m, ref as c, computed as h, openBlock as f, createBlock as b, withCtx as l, renderSlot as v, normalizeProps as y, guardReactiveProps as w, createVNode as g, mergeProps as B } from "vue";
|
|
2
|
+
import k from "./index22.js";
|
|
3
3
|
/* empty css */
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import V from "./index26.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
const H = /* @__PURE__ */ m({
|
|
7
|
+
__name: "BbDatePickerInput",
|
|
6
8
|
props: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
allowWriting: { type: [Boolean, String], default: !0 },
|
|
10
|
+
"append:icon": {},
|
|
11
|
+
autocomplete: {},
|
|
12
|
+
autofocus: {},
|
|
13
|
+
direction: {},
|
|
9
14
|
disabled: { type: Boolean },
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
errors: {},
|
|
16
|
+
firstDayOfWeek: {},
|
|
17
|
+
hasErrors: { type: Boolean },
|
|
18
|
+
hideLabel: { type: Boolean },
|
|
19
|
+
hint: {},
|
|
20
|
+
id: {},
|
|
21
|
+
label: {},
|
|
22
|
+
labelPosition: {},
|
|
23
|
+
loading: { type: Boolean },
|
|
24
|
+
max: {},
|
|
25
|
+
min: {},
|
|
26
|
+
modelValue: {},
|
|
27
|
+
name: {},
|
|
28
|
+
persistentHint: { type: Boolean },
|
|
29
|
+
placeholder: {},
|
|
30
|
+
"prepend:icon": {},
|
|
31
|
+
range: { type: Boolean },
|
|
32
|
+
readonly: { type: Boolean },
|
|
33
|
+
required: { type: Boolean },
|
|
34
|
+
reverse: { type: Boolean },
|
|
35
|
+
selectable: {},
|
|
36
|
+
width: {}
|
|
23
37
|
},
|
|
24
|
-
emits: ["
|
|
25
|
-
setup(i) {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
38
|
+
emits: ["active", "error", "focus", "inactive", "update:modelValue"],
|
|
39
|
+
setup(i, { emit: n }) {
|
|
40
|
+
const t = i, o = n, a = c(!1), s = h(() => t.persistentHint || a.value), d = {
|
|
41
|
+
onError: (e) => o("error", e),
|
|
42
|
+
onFocus: (e) => o("focus", e),
|
|
43
|
+
onActive: () => {
|
|
44
|
+
a.value = !0, o("active");
|
|
45
|
+
},
|
|
46
|
+
onInactive: () => {
|
|
47
|
+
a.value = !1, o("inactive");
|
|
48
|
+
},
|
|
49
|
+
"onUpdate:modelValue": (e) => o("update:modelValue", e)
|
|
50
|
+
};
|
|
51
|
+
return (e, P) => (f(), b(V, {
|
|
52
|
+
id: e.id,
|
|
53
|
+
class: "bb-date-picker-input",
|
|
54
|
+
direction: e.direction,
|
|
55
|
+
errors: e.errors,
|
|
56
|
+
"has-errors": e.hasErrors,
|
|
57
|
+
"hide-label": e.hideLabel,
|
|
58
|
+
hint: e.hint,
|
|
59
|
+
label: e.label,
|
|
60
|
+
"label-position": e.labelPosition,
|
|
61
|
+
"model-value": e.modelValue,
|
|
62
|
+
name: e.name,
|
|
63
|
+
reverse: e.reverse,
|
|
64
|
+
"show-hint": s.value
|
|
65
|
+
}, {
|
|
66
|
+
label: l((r) => [
|
|
67
|
+
v(e.$slots, "label", y(w(r)))
|
|
50
68
|
]),
|
|
51
|
-
|
|
52
|
-
|
|
69
|
+
input: l(({ id: r, name: p, hasErrors: u }) => [
|
|
70
|
+
g(k, B({
|
|
71
|
+
id: r,
|
|
72
|
+
"allow-writing": e.allowWriting,
|
|
73
|
+
"append:icon": e.$props["append:icon"],
|
|
74
|
+
autocomplete: e.autocomplete,
|
|
75
|
+
autofocus: e.autofocus,
|
|
76
|
+
disabled: e.disabled,
|
|
77
|
+
"first-day-of-week": e.firstDayOfWeek,
|
|
78
|
+
"has-errors": u,
|
|
79
|
+
loading: e.loading,
|
|
80
|
+
max: e.max,
|
|
81
|
+
min: e.min,
|
|
82
|
+
"model-value": e.modelValue,
|
|
83
|
+
name: p,
|
|
84
|
+
placeholder: e.placeholder,
|
|
85
|
+
"prepend:icon": e.$props["prepend:icon"],
|
|
86
|
+
range: e.range,
|
|
87
|
+
readonly: e.readonly,
|
|
88
|
+
required: e.required,
|
|
89
|
+
selectable: e.selectable,
|
|
90
|
+
width: e.width
|
|
91
|
+
}, d), null, 16, ["id", "allow-writing", "append:icon", "autocomplete", "autofocus", "disabled", "first-day-of-week", "has-errors", "loading", "max", "min", "model-value", "name", "placeholder", "prepend:icon", "range", "readonly", "required", "selectable", "width"])
|
|
53
92
|
]),
|
|
54
93
|
_: 3
|
|
55
|
-
},
|
|
94
|
+
}, 8, ["id", "direction", "errors", "has-errors", "hide-label", "hint", "label", "label-position", "model-value", "name", "reverse", "show-hint"]));
|
|
56
95
|
}
|
|
57
96
|
});
|
|
58
97
|
export {
|
|
59
|
-
|
|
98
|
+
H as default
|
|
60
99
|
};
|
|
61
100
|
//# sourceMappingURL=index68.js.map
|
package/dist/index68.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index68.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index68.js","sources":["../src/components/BbDatePickerInput/BbDatePickerInput.vue"],"sourcesContent":["<template>\n\t<BaseInputContainer\n\t\t:id=\"id\"\n\t\tclass=\"bb-date-picker-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 }\">\n\t\t\t<BaseDatePickerInput\n\t\t\t\t:id=\"id\"\n\t\t\t\t:allow-writing=\"allowWriting\"\n\t\t\t\t:append:icon=\"$props['append:icon']\"\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:first-day-of-week=\"firstDayOfWeek\"\n\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t:loading=\"loading\"\n\t\t\t\t:max=\"max\"\n\t\t\t\t:min=\"min\"\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:range=\"range\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t:required=\"required\"\n\t\t\t\t:selectable=\"selectable\"\n\t\t\t\t:width=\"width\"\n\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t>\n\t\t\t</BaseDatePickerInput>\n\t\t</template>\n\t</BaseInputContainer>\n</template>\n\n<script setup lang=\"ts\">\nimport BaseDatePickerInput from '../BaseDatePickerInput/BaseDatePickerInput.vue';\nimport BaseInputContainer from '../BaseInputContainer/BaseInputContainer.vue';\nimport type { BaseDatePickerInputEvents } from '../BaseDatePickerInput/BaseDatePickerInput.vue';\nimport {\n\tref,\n\ttype HTMLAttributes,\n\ttype InputHTMLAttributes,\n\tcomputed,\n} from 'vue';\nimport type { Locale } from 'dayjs/locale/it';\n\nexport type BbDatePickerInputProps = {\n\t/**\n\t * Allows typing into the input.\n\t */\n\tallowWriting?: boolean | 'not-mobile';\n\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\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 * Defines the first day of the week with `0` meaning Sunday and `6` meaning Saturday\n\t */\n\tfirstDayOfWeek?: Locale['weekStart'];\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 * Maximum selectable date\n\t */\n\tmax?: Date | string | number;\n\n\t/**\n\t * Minimum selectable date\n\t */\n\tmin?: Date | string | number;\n\n\t/**\n\t * Used by v-model. Can be null, a single string, or an array of strings based on whether a range or single date is needed\n\t */\n\tmodelValue: string | 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 * Selects a range of dates between two dates. It selects all of the days between start and end\n\t */\n\trange?: boolean;\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: boolean;\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 * Function that accepts a `Date` object and returns a boolean. `false` meaning the date cannot be selected\n\t * @param date\n\t */\n\tselectable?: (date: Date) => boolean;\n\n\t/**\n\t * Width of the calendar\n\t */\n\twidth?: number | string;\n};\n\nconst props = withDefaults(defineProps<BbDatePickerInputProps>(), {\n\tallowWriting: true,\n});\n\nexport type BbDatePickerInputEvents = BaseDatePickerInputEvents;\n\nconst emit = defineEmits<BbDatePickerInputEvents>();\n\ndefineSlots<{\n\t'prepend-outer'?: (props: object) => any;\n\tprepend?: (props: object) => any;\n\tappend?: (props: object) => any;\n\t'append-outer'?: (props: object) => any;\n\tlabel?: (props: { text: string; hasErrors: boolean }) => any;\n}>();\n\nconst active = ref(false);\nconst showHint = computed(() => props.persistentHint || active.value);\n\n/**\n * These events are just propagated\n */\nconst eventListeners = {\n\tonError: (message: string) => emit('error', message),\n\tonFocus: (event: FocusEvent) => emit('focus', event),\n\tonActive: () => {\n\t\tactive.value = true;\n\t\temit('active');\n\t},\n\tonInactive: () => {\n\t\tactive.value = false;\n\t\temit('inactive');\n\t},\n\t'onUpdate:modelValue': (value: BbDatePickerInputProps['modelValue']) =>\n\t\temit('update:modelValue', value),\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbDatePickerInput';\n</style>\n"],"names":["props","__props","emit","__emit","active","ref","showHint","computed","eventListeners","message","event","value"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4MA,UAAMA,IAAQC,GAMRC,IAAOC,GAUPC,IAASC,EAAI,EAAK,GAClBC,IAAWC,EAAS,MAAMP,EAAM,kBAAkBI,EAAO,KAAK,GAK9DI,IAAiB;AAAA,MACtB,SAAS,CAACC,MAAoBP,EAAK,SAASO,CAAO;AAAA,MACnD,SAAS,CAACC,MAAsBR,EAAK,SAASQ,CAAK;AAAA,MACnD,UAAU,MAAM;AACf,QAAAN,EAAO,QAAQ,IACfF,EAAK,QAAQ;AAAA,MACd;AAAA,MACA,YAAY,MAAM;AACjB,QAAAE,EAAO,QAAQ,IACfF,EAAK,UAAU;AAAA,MAChB;AAAA,MACA,uBAAuB,CAACS,MACvBT,EAAK,qBAAqBS,CAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index7.js
CHANGED
|
@@ -1,23 +1,81 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { ref as u, watch as c, reactive as x, computed as f } from "vue";
|
|
2
|
+
import { isNil as l } from "./index126.js";
|
|
3
|
+
let r = [];
|
|
4
|
+
const i = u(null);
|
|
5
|
+
c(
|
|
6
|
+
() => i.value,
|
|
7
|
+
() => {
|
|
8
|
+
typeof i.value == "boolean" && (r.forEach((s) => s()), r = []);
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
const o = {
|
|
12
|
+
actions: !0,
|
|
13
|
+
description: "",
|
|
14
|
+
loading: !1,
|
|
15
|
+
no: !0,
|
|
16
|
+
noText: "",
|
|
17
|
+
open: !1,
|
|
18
|
+
size: "sm",
|
|
19
|
+
text: "",
|
|
20
|
+
theme: "default",
|
|
21
|
+
title: "",
|
|
22
|
+
yes: !0,
|
|
23
|
+
yesText: ""
|
|
24
|
+
}, d = {
|
|
25
|
+
actions: !0,
|
|
26
|
+
description: "",
|
|
27
|
+
no: !0,
|
|
28
|
+
noText: "Annulla",
|
|
29
|
+
text: "",
|
|
30
|
+
theme: "default",
|
|
31
|
+
title: "",
|
|
32
|
+
yes: !0,
|
|
33
|
+
yesText: "OK"
|
|
34
|
+
}, e = x({
|
|
35
|
+
...o
|
|
36
|
+
}), m = f(() => [
|
|
37
|
+
{
|
|
38
|
+
text: e.noText,
|
|
39
|
+
handler: () => {
|
|
40
|
+
i.value = !1;
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
text: e.yesText,
|
|
45
|
+
handler: () => {
|
|
46
|
+
i.value = !0;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
]), y = () => ({
|
|
50
|
+
/**
|
|
51
|
+
* The confirm function. It accepts a set of options defining
|
|
52
|
+
* the behavior of the modal and returns `Promise<boolean>`
|
|
53
|
+
* when the user accepts, declines, or ignores the modal.
|
|
54
|
+
*/
|
|
55
|
+
confirm: (s) => {
|
|
56
|
+
i.value = null;
|
|
57
|
+
const n = { ...d, ...s }, t = { ...o };
|
|
58
|
+
return t.title = n.title, t.text = n.text, n.description && (t.description = n.description), n.noText && (t.noText = n.noText), n.yesText && (t.yesText = n.yesText), n.size && (t.size = n.size), n.theme && (t.theme = n.theme), l(n.yes) || (t.yes = !!n.yes), l(n.no) || (t.no = !!n.no), l(n.actions) || (t.actions = !!n.actions), e.actions = t.actions, e.description = t.description, e.no = t.no, e.noText = t.noText, e.open = !0, e.size = t.size, e.text = t.text, e.theme = t.theme, e.title = t.title, e.yes = t.yes, e.yesText = t.yesText, new Promise((a) => {
|
|
59
|
+
r.push(() => a(i.value));
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
/**
|
|
63
|
+
* Sets the state of the confirm to loading and displays a spinner.
|
|
64
|
+
*/
|
|
65
|
+
setLoading: (s = !0) => {
|
|
66
|
+
e.loading = s;
|
|
67
|
+
},
|
|
68
|
+
/**
|
|
69
|
+
* Closes the confirmation modal. It is a manual operation
|
|
70
|
+
* so you can update the state while the modal is still open.
|
|
71
|
+
*/
|
|
72
|
+
close: () => (e.description = o.description, e.loading = o.loading, e.noText = o.noText, e.open = o.open, e.text = o.text, e.theme = o.theme, e.title = o.title, e.yesText = o.yesText, i.value = !1, Promise.resolve().then(() => {
|
|
73
|
+
i.value = null;
|
|
74
|
+
}))
|
|
75
|
+
});
|
|
20
76
|
export {
|
|
21
|
-
|
|
77
|
+
m as actions,
|
|
78
|
+
e as state,
|
|
79
|
+
y as useConfirm
|
|
22
80
|
};
|
|
23
81
|
//# sourceMappingURL=index7.js.map
|
package/dist/index7.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index7.js","sources":["../src/composables/
|
|
1
|
+
{"version":3,"file":"index7.js","sources":["../src/composables/useConfirm.ts"],"sourcesContent":["import { computed, reactive, ref, watch } from 'vue';\nimport { isNil } from '@/utilities/functions/isNil';\nimport type { Sizes } from '@/components/BaseDialog/BaseDialog.vue';\n\ntype State = {\n\tdescription: string;\n\ttheme: string;\n\tloading: boolean;\n\tnoText: string;\n\topen: boolean;\n\ttext: string;\n\ttitle: string;\n\tyesText: string;\n\tyes: boolean;\n\tno: boolean;\n\tactions: boolean;\n\tsize: keyof Sizes;\n};\n\ntype UserOptions = {\n\t/**\n\t * Boolean that sets whether to display or hide the buttons.\n\t * Confirms without actions can only be dismissed by clicking on the overlay or the close button.\n\t */\n\tactions?: State['actions'];\n\t/**\n\t * Description of the content of the modal for accessibility purposes.\n\t */\n\tdescription?: State['description'];\n\t/**\n\t * Boolean that defines whether to display or hide the \"No\" action.\n\t */\n\tno?: State['no'];\n\t/**\n\t * Text content of the \"No\" action.\n\t */\n\tnoText?: State['noText'];\n\t/**\n\t * Text content of the modal.\n\t */\n\ttext: State['text'];\n\t/**\n\t * The name of the theme it applies a css class to BbConfirm for styling.\n\t */\n\ttheme?: State['theme'];\n\t/**\n\t * Tittle of the modal\n\t */\n\ttitle: State['title'];\n\t/**\n\t * Boolean that defines whether to display or hide the \"Yes\" action.\n\t */\n\tyes?: State['yes'];\n\t/**\n\t * Text content of the \"Yes\" action.\n\t */\n\tyesText?: State['yesText'];\n\t/**\n\t * Size of the confirm modal. Use any sizes valid for `BbModal`.\n\t */\n\tsize?: State['size'];\n};\n\n// Stash all instances of current dialogs\nlet subscribers: ((...args: any[]) => any)[] = [];\n\nconst value = ref<boolean | null>(null);\n\nwatch(\n\t() => value.value,\n\t() => {\n\t\tif (typeof value.value === 'boolean') {\n\t\t\t// Every time a dialog is resolved resolve all dialogs\n\t\t\tsubscribers.forEach((fn) => fn());\n\t\t\tsubscribers = [];\n\t\t}\n\t}\n);\n\nconst defaultState: State = {\n\tactions: true,\n\tdescription: '',\n\tloading: false,\n\tno: true,\n\tnoText: '',\n\topen: false,\n\tsize: 'sm',\n\ttext: '',\n\ttheme: 'default',\n\ttitle: '',\n\tyes: true,\n\tyesText: '',\n};\nconst defaultOption: UserOptions = {\n\tactions: true,\n\tdescription: '',\n\tno: true,\n\tnoText: 'Annulla',\n\ttext: '',\n\ttheme: 'default',\n\ttitle: '',\n\tyes: true,\n\tyesText: 'OK',\n};\n\nexport const state = reactive<State>({\n\t...defaultState,\n});\n\nexport const actions = computed(() => [\n\t{\n\t\ttext: state.noText,\n\t\thandler: () => {\n\t\t\tvalue.value = false;\n\t\t},\n\t},\n\t{\n\t\ttext: state.yesText,\n\t\thandler: () => {\n\t\t\tvalue.value = true;\n\t\t},\n\t},\n]);\n\nexport const useConfirm = () => {\n\treturn {\n\t\t/**\n\t\t * The confirm function. It accepts a set of options defining\n\t\t * the behavior of the modal and returns `Promise<boolean>`\n\t\t * when the user accepts, declines, or ignores the modal.\n\t\t */\n\t\tconfirm: (options: UserOptions) => {\n\t\t\tvalue.value = null;\n\t\t\tconst newOptions = { ...defaultOption, ...options };\n\t\t\tconst newState = { ...defaultState };\n\t\t\tnewState.title = newOptions.title;\n\t\t\tnewState.text = newOptions.text;\n\t\t\tif (newOptions.description) newState.description = newOptions.description;\n\t\t\tif (newOptions.noText) newState.noText = newOptions.noText;\n\t\t\tif (newOptions.yesText) newState.yesText = newOptions.yesText;\n\t\t\tif (newOptions.size) newState.size = newOptions.size;\n\t\t\tif (newOptions.theme) newState.theme = newOptions.theme;\n\t\t\tif (!isNil(newOptions.yes)) newState.yes = !!newOptions.yes;\n\t\t\tif (!isNil(newOptions.no)) newState.no = !!newOptions.no;\n\t\t\tif (!isNil(newOptions.actions)) newState.actions = !!newOptions.actions;\n\n\t\t\tstate.actions = newState.actions;\n\t\t\tstate.description = newState.description;\n\t\t\tstate.no = newState.no;\n\t\t\tstate.noText = newState.noText;\n\t\t\tstate.open = true;\n\t\t\tstate.size = newState.size;\n\t\t\tstate.text = newState.text;\n\t\t\tstate.theme = newState.theme;\n\t\t\tstate.title = newState.title;\n\t\t\tstate.yes = newState.yes;\n\t\t\tstate.yesText = newState.yesText;\n\n\t\t\treturn new Promise<boolean>((resolve) => {\n\t\t\t\tsubscribers.push(() => resolve(value.value as boolean));\n\t\t\t});\n\t\t},\n\t\t/**\n\t\t * Sets the state of the confirm to loading and displays a spinner.\n\t\t */\n\t\tsetLoading: (value: boolean = true) => {\n\t\t\tstate.loading = value;\n\t\t},\n\t\t/**\n\t\t * Closes the confirmation modal. It is a manual operation\n\t\t * so you can update the state while the modal is still open.\n\t\t */\n\t\tclose: () => {\n\t\t\tstate.description = defaultState.description;\n\t\t\tstate.loading = defaultState.loading;\n\t\t\tstate.noText = defaultState.noText;\n\t\t\tstate.open = defaultState.open;\n\t\t\tstate.text = defaultState.text;\n\t\t\tstate.theme = defaultState.theme;\n\t\t\tstate.title = defaultState.title;\n\t\t\tstate.yesText = defaultState.yesText;\n\t\t\tvalue.value = false;\n\t\t\treturn Promise.resolve().then(() => {\n\t\t\t\tvalue.value = null;\n\t\t\t});\n\t\t},\n\t};\n};\n"],"names":["subscribers","value","ref","watch","fn","defaultState","defaultOption","state","reactive","actions","computed","useConfirm","options","newOptions","newState","isNil","resolve"],"mappings":"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"}
|