@vue-interface/btn-activity 2.0.0-beta.9 → 3.0.1
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/LICENSE +22 -0
- package/README.md +30 -0
- package/dist/btn-activity.js +73 -387
- package/dist/btn-activity.js.map +1 -0
- package/dist/btn-activity.umd.cjs +2 -1
- package/dist/btn-activity.umd.cjs.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/src/BtnActivity.vue.d.ts +46 -167
- package/index.css +3 -0
- package/package.json +26 -43
- package/dist/style.css +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Justin Kimbrell
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Button Activity
|
|
2
|
+
|
|
3
|
+
The `btn-activity` component provides an interactive button with built-in activity indicators for async operations. It extends the standard button and combines activity indicators.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm i @vue-interface/btn-activity
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
yarn add @vue-interface/btn-activity
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm i @vue-interface/btn-activity
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
bun i @vue-interface/btn-activity
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Basic Usage
|
|
24
|
+
|
|
25
|
+
```vue
|
|
26
|
+
<BtnActivity :indicator="Dots" @click="onClick">Dots</BtnActivity>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
For more comprehensive documentation and examples, please visit the [online documentation](https://vue-interface.github.io/packages/btn-activity/).
|
|
30
|
+
|
package/dist/btn-activity.js
CHANGED
|
@@ -1,397 +1,83 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const V = b({
|
|
1
|
+
import { defineComponent as f, ref as y, watchEffect as v, watch as m, createElementBlock as b, openBlock as l, normalizeClass as c, renderSlot as x, createVNode as h, createTextVNode as k, toDisplayString as z, Transition as g, withCtx as w, createBlock as B, createCommentVNode as S, unref as C } from "vue";
|
|
2
|
+
import { ActivityIndicator as A } from "@vue-interface/activity-indicator";
|
|
3
|
+
const N = ["disabled"], T = /* @__PURE__ */ f({
|
|
4
|
+
__name: "BtnActivity",
|
|
6
5
|
props: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
default: "indicators"
|
|
17
|
-
},
|
|
18
|
-
type: {
|
|
19
|
-
type: String,
|
|
20
|
-
required: !0
|
|
21
|
-
},
|
|
22
|
-
height: [String, Number],
|
|
23
|
-
maxHeight: [String, Number],
|
|
24
|
-
minHeight: [String, Number],
|
|
25
|
-
width: [String, Number],
|
|
26
|
-
maxWidth: [String, Number],
|
|
27
|
-
minWidth: [String, Number]
|
|
6
|
+
activity: { type: Boolean },
|
|
7
|
+
indicator: {},
|
|
8
|
+
indicatorSize: { default: "xs" },
|
|
9
|
+
label: { default: void 0 },
|
|
10
|
+
orientation: { default: "right" },
|
|
11
|
+
variant: { default: "btn-primary" },
|
|
12
|
+
size: { default: "btn-md" },
|
|
13
|
+
block: { type: Boolean },
|
|
14
|
+
disabled: { type: Boolean }
|
|
28
15
|
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
computed: {
|
|
38
|
-
classes() {
|
|
39
|
-
return {
|
|
40
|
-
"activity-indicator-center": this.center,
|
|
41
|
-
"activity-indicator-absolute": this.absolute,
|
|
42
|
-
[this.size && `activity-indicator-${this.size}`]: !!this.size
|
|
43
|
-
};
|
|
44
|
-
},
|
|
45
|
-
style() {
|
|
46
|
-
return {
|
|
47
|
-
width: r(this.width),
|
|
48
|
-
maxWidth: r(this.maxWidth),
|
|
49
|
-
minWidth: r(this.minWidth),
|
|
50
|
-
height: r(this.height),
|
|
51
|
-
maxHeight: r(this.maxHeight),
|
|
52
|
-
minHeight: r(this.minHeight)
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
async mounted() {
|
|
57
|
-
const t = await this.component();
|
|
58
|
-
this.is = () => t;
|
|
59
|
-
},
|
|
60
|
-
methods: {
|
|
61
|
-
async component() {
|
|
62
|
-
let t = this.registryInstance.get(this.type);
|
|
63
|
-
return t instanceof Promise ? t : (typeof t == "function" && (t = await t()), t.default ? t.default : t);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}), W = (t, i) => {
|
|
67
|
-
const e = t.__vccOpts || t;
|
|
68
|
-
for (const [n, s] of i)
|
|
69
|
-
e[n] = s;
|
|
70
|
-
return e;
|
|
71
|
-
}, D = { class: "activity-indicator-content" }, L = {
|
|
72
|
-
key: 1,
|
|
73
|
-
class: "activity-indicator-label"
|
|
74
|
-
};
|
|
75
|
-
function I(t, i, e, n, s, o) {
|
|
76
|
-
return a(), g("div", {
|
|
77
|
-
class: j(["activity-indicator", t.classes]),
|
|
78
|
-
style: N(t.style)
|
|
79
|
-
}, [
|
|
80
|
-
E("div", D, [
|
|
81
|
-
t.is ? (a(), y(x(t.is()), {
|
|
82
|
-
key: 0,
|
|
83
|
-
class: "mx-auto"
|
|
84
|
-
})) : $("", !0),
|
|
85
|
-
t.label ? (a(), g("div", L, f(t.label), 1)) : $("", !0)
|
|
86
|
-
])
|
|
87
|
-
], 6);
|
|
88
|
-
}
|
|
89
|
-
const Z = /* @__PURE__ */ W(V, [["render", I]]);
|
|
90
|
-
var F = Object.defineProperty, M = (t, i, e) => i in t ? F(t, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[i] = e, T = (t, i, e) => (M(t, typeof i != "symbol" ? i + "" : i, e), e), u = function() {
|
|
91
|
-
return u = Object.assign || function(t) {
|
|
92
|
-
for (var i, e = 1, n = arguments.length; e < n; e++) {
|
|
93
|
-
i = arguments[e];
|
|
94
|
-
for (var s in i)
|
|
95
|
-
Object.prototype.hasOwnProperty.call(i, s) && (t[s] = i[s]);
|
|
96
|
-
}
|
|
97
|
-
return t;
|
|
98
|
-
}, u.apply(this, arguments);
|
|
99
|
-
};
|
|
100
|
-
function q(t) {
|
|
101
|
-
return t.toLowerCase();
|
|
102
|
-
}
|
|
103
|
-
var G = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g], J = /[^A-Z0-9]+/gi;
|
|
104
|
-
function K(t, i) {
|
|
105
|
-
i === void 0 && (i = {});
|
|
106
|
-
for (var e = i.splitRegexp, n = e === void 0 ? G : e, s = i.stripRegexp, o = s === void 0 ? J : s, c = i.transform, v = c === void 0 ? q : c, l = i.delimiter, B = l === void 0 ? " " : l, h = S(S(t, n, "$1\0$2"), o, "\0"), p = 0, m = h.length; h.charAt(p) === "\0"; )
|
|
107
|
-
p++;
|
|
108
|
-
for (; h.charAt(m - 1) === "\0"; )
|
|
109
|
-
m--;
|
|
110
|
-
return h.slice(p, m).split("\0").map(v).join(B);
|
|
111
|
-
}
|
|
112
|
-
function S(t, i, e) {
|
|
113
|
-
return i instanceof RegExp ? t.replace(i, e) : i.reduce(function(n, s) {
|
|
114
|
-
return n.replace(s, e);
|
|
115
|
-
}, t);
|
|
116
|
-
}
|
|
117
|
-
function Q(t, i) {
|
|
118
|
-
return i === void 0 && (i = {}), K(t, u({ delimiter: "." }, i));
|
|
119
|
-
}
|
|
120
|
-
function d(t, i) {
|
|
121
|
-
return i === void 0 && (i = {}), Q(t, u({ delimiter: "-" }, i));
|
|
122
|
-
}
|
|
123
|
-
class U {
|
|
124
|
-
constructor(i = {}) {
|
|
125
|
-
T(this, "components"), this.components = /* @__PURE__ */ new Map(), Object.entries(i).forEach(([e, n]) => {
|
|
126
|
-
this.register(e, n);
|
|
16
|
+
emits: ["click", "hide-activity", "show-activity"],
|
|
17
|
+
setup(t, { emit: r }) {
|
|
18
|
+
const n = t, i = r, e = y(n.activity);
|
|
19
|
+
v(() => {
|
|
20
|
+
e.value = n.activity;
|
|
21
|
+
}), m(e, (a) => {
|
|
22
|
+
i(a ? "show-activity" : "hide-activity");
|
|
127
23
|
});
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
const e = this.components.get(
|
|
131
|
-
i = d(i)
|
|
132
|
-
);
|
|
133
|
-
if (e)
|
|
134
|
-
return e;
|
|
135
|
-
throw new Error(`"${i}" has not been registered yet!`);
|
|
136
|
-
}
|
|
137
|
-
register(i, e) {
|
|
138
|
-
return typeof i == "object" ? (Object.entries(i).forEach(([n, s]) => {
|
|
139
|
-
this.register(d(n), s);
|
|
140
|
-
}), this) : (this.components.set(d(i), e), this);
|
|
141
|
-
}
|
|
142
|
-
remove(i) {
|
|
143
|
-
return this.components.delete(d(i)), this;
|
|
144
|
-
}
|
|
145
|
-
reset() {
|
|
146
|
-
return this.components = /* @__PURE__ */ new Map(), this;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
function X(t = {}) {
|
|
150
|
-
return new U(t);
|
|
151
|
-
}
|
|
152
|
-
X();
|
|
153
|
-
const Y = {
|
|
154
|
-
props: {
|
|
155
|
-
componentPrefix: String,
|
|
156
|
-
size: String,
|
|
157
|
-
sizePrefix: String
|
|
158
|
-
},
|
|
159
|
-
computed: {
|
|
160
|
-
sizeableClassPrefix() {
|
|
161
|
-
return this.sizePrefix || this.componentPrefix;
|
|
162
|
-
},
|
|
163
|
-
hasSizeablePrefix() {
|
|
164
|
-
return this.size === void 0 ? !1 : !!this.size.match(new RegExp(`^${this.sizeableClassPrefix}`));
|
|
165
|
-
},
|
|
166
|
-
sizeableClass() {
|
|
167
|
-
return this.size ? !this.sizeableClassPrefix || this.hasSizeablePrefix ? this.size : `${this.sizeableClassPrefix}-${this.size}` : "";
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}, tt = {
|
|
171
|
-
props: {
|
|
172
|
-
componentPrefix: String,
|
|
173
|
-
variant: String,
|
|
174
|
-
variantPrefix: String
|
|
175
|
-
},
|
|
176
|
-
computed: {
|
|
177
|
-
variantClassPrefix() {
|
|
178
|
-
return this.variantPrefix || this.componentPrefix;
|
|
179
|
-
},
|
|
180
|
-
hasVariantPrefix() {
|
|
181
|
-
return this.variant === void 0 ? !1 : !!this.variant.match(new RegExp(`^${this.variantClassPrefix}`));
|
|
182
|
-
},
|
|
183
|
-
variantClass() {
|
|
184
|
-
return this.variant ? !this.variantClassPrefix || this.hasVariantPrefix ? this.variant : `${this.variantClassPrefix}-${this.variant}` : "";
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}, it = b({
|
|
188
|
-
mixins: [
|
|
189
|
-
Y,
|
|
190
|
-
tt
|
|
191
|
-
],
|
|
192
|
-
props: {
|
|
193
|
-
active: Boolean,
|
|
194
|
-
block: Boolean,
|
|
195
|
-
componentPrefix: {
|
|
196
|
-
type: String,
|
|
197
|
-
default: "btn"
|
|
198
|
-
},
|
|
199
|
-
disabled: Boolean,
|
|
200
|
-
label: String,
|
|
201
|
-
outline: Boolean,
|
|
202
|
-
tag: String,
|
|
203
|
-
variant: {
|
|
204
|
-
type: String,
|
|
205
|
-
default: "primary"
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
|
-
computed: {
|
|
209
|
-
classes() {
|
|
210
|
-
return [
|
|
211
|
-
"btn",
|
|
212
|
-
this.variantClass,
|
|
213
|
-
this.sizeableClass,
|
|
214
|
-
this.active && "active",
|
|
215
|
-
this.block && "btn-block",
|
|
216
|
-
this.disabled && "disabled"
|
|
217
|
-
];
|
|
218
|
-
},
|
|
219
|
-
component() {
|
|
220
|
-
return this.tag ? this.tag : this.$attrs.href ? "a" : "button";
|
|
221
|
-
},
|
|
222
|
-
variantClassPrefix() {
|
|
223
|
-
return (this.variantPrefix || this.componentPrefix) + (this.outline ? "-outline" : "");
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}), et = (t, i) => {
|
|
227
|
-
const e = t.__vccOpts || t;
|
|
228
|
-
for (const [n, s] of i)
|
|
229
|
-
e[n] = s;
|
|
230
|
-
return e;
|
|
231
|
-
};
|
|
232
|
-
function st(t, i, e, n, s, o) {
|
|
233
|
-
return a(), y(x(t.component), w(t.$attrs, {
|
|
234
|
-
disabled: t.disabled,
|
|
235
|
-
class: t.classes,
|
|
236
|
-
role: "button"
|
|
237
|
-
}), {
|
|
238
|
-
default: A(() => [
|
|
239
|
-
C(t.$slots, "default", {}, () => [
|
|
240
|
-
k(f(t.label), 1)
|
|
241
|
-
])
|
|
242
|
-
]),
|
|
243
|
-
_: 3
|
|
244
|
-
}, 16, ["disabled", "class"]);
|
|
245
|
-
}
|
|
246
|
-
const nt = /* @__PURE__ */ et(it, [["render", st]]), rt = function(t) {
|
|
247
|
-
const i = parseFloat(t || 0), e = t && t.match(/m?s/), n = e ? e[0] : !1;
|
|
248
|
-
let s;
|
|
249
|
-
switch (n) {
|
|
250
|
-
case "s":
|
|
251
|
-
s = i * 1e3;
|
|
252
|
-
break;
|
|
253
|
-
case "ms":
|
|
254
|
-
default:
|
|
255
|
-
s = i;
|
|
256
|
-
break;
|
|
257
|
-
}
|
|
258
|
-
return s || 0;
|
|
259
|
-
}, z = function(t, i) {
|
|
260
|
-
const e = (t.ownerDocument || document).defaultView;
|
|
261
|
-
setTimeout(
|
|
262
|
-
i,
|
|
263
|
-
rt(
|
|
264
|
-
e == null ? void 0 : e.getComputedStyle(t).animationDuration
|
|
265
|
-
)
|
|
266
|
-
);
|
|
267
|
-
}, at = b({
|
|
268
|
-
components: {
|
|
269
|
-
ActivityIndicator: Z,
|
|
270
|
-
Btn: nt
|
|
271
|
-
},
|
|
272
|
-
inheritAttrs: !1,
|
|
273
|
-
props: {
|
|
274
|
-
active: Boolean,
|
|
275
|
-
activity: Boolean,
|
|
276
|
-
block: Boolean,
|
|
277
|
-
disabled: Boolean,
|
|
278
|
-
indicator: {
|
|
279
|
-
type: [Object, String],
|
|
280
|
-
default: "spinner"
|
|
281
|
-
},
|
|
282
|
-
label: {
|
|
283
|
-
type: String,
|
|
284
|
-
default: void 0
|
|
285
|
-
},
|
|
286
|
-
orientation: {
|
|
287
|
-
type: String,
|
|
288
|
-
default: "right"
|
|
289
|
-
},
|
|
290
|
-
size: {
|
|
291
|
-
type: String,
|
|
292
|
-
default: "md"
|
|
293
|
-
},
|
|
294
|
-
tag: {
|
|
295
|
-
type: String,
|
|
296
|
-
default: void 0
|
|
297
|
-
},
|
|
298
|
-
variant: {
|
|
299
|
-
type: String,
|
|
300
|
-
default: "primary"
|
|
24
|
+
function s() {
|
|
25
|
+
e.value = !e.value;
|
|
301
26
|
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
return {
|
|
306
|
-
currentActivity: this.activity
|
|
27
|
+
const d = {
|
|
28
|
+
status: e,
|
|
29
|
+
toggle: s
|
|
307
30
|
};
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
[`btn-activity-${this.orientation.replace("btn-activity-", "")}`]: !!this.orientation,
|
|
316
|
-
[`btn-activity-indicator-${this.indicatorProps.type.replace("btn-activity-indicator-", "")}`]: !!this.indicatorProps.type
|
|
317
|
-
};
|
|
318
|
-
},
|
|
319
|
-
indicatorProps() {
|
|
320
|
-
return Object.assign(
|
|
31
|
+
return (a, o) => (l(), b("button", {
|
|
32
|
+
type: "button",
|
|
33
|
+
disabled: t.disabled,
|
|
34
|
+
class: c([
|
|
35
|
+
"btn",
|
|
36
|
+
t.variant,
|
|
37
|
+
t.size,
|
|
321
38
|
{
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
39
|
+
"w-full": t.block,
|
|
40
|
+
"gap-1": ["xs", "sm"].includes(t.indicatorSize),
|
|
41
|
+
"gap-2": ["md", "lg", "xl"].includes(t.indicatorSize),
|
|
42
|
+
"flex-col-reverse": t.orientation === "top",
|
|
43
|
+
"flex-col": t.orientation === "bottom",
|
|
44
|
+
"flex-row-reverse": t.orientation === "left",
|
|
45
|
+
"inline-flex items-center justify-center": !0,
|
|
46
|
+
"opacity-50 cursor-not-allowed": t.disabled
|
|
47
|
+
}
|
|
48
|
+
]),
|
|
49
|
+
onClick: o[0] || (o[0] = (u) => i("click", u, d))
|
|
50
|
+
}, [
|
|
51
|
+
x(a.$slots, "default", {}, () => [
|
|
52
|
+
k(z(t.label), 1)
|
|
53
|
+
]),
|
|
54
|
+
h(g, {
|
|
55
|
+
"enter-active-class": "transition-all ease-out duration-250",
|
|
56
|
+
"enter-from-class": "opacity-0",
|
|
57
|
+
"enter-to-class": "opacity-100",
|
|
58
|
+
"leave-active-class": "transition-all ease-in duration-250",
|
|
59
|
+
"leave-from-class": "opacity-100",
|
|
60
|
+
"leave-to-class": "opacity-0"
|
|
61
|
+
}, {
|
|
62
|
+
default: w(() => [
|
|
63
|
+
e.value ? (l(), B(C(A), {
|
|
64
|
+
key: 0,
|
|
65
|
+
type: t.indicator,
|
|
66
|
+
size: t.indicatorSize,
|
|
67
|
+
class: c({
|
|
68
|
+
"pt-1": t.orientation === "top",
|
|
69
|
+
"pb-1": t.orientation === "bottom",
|
|
70
|
+
"pr-1": t.orientation === "left",
|
|
71
|
+
"pl-1": t.orientation === "right"
|
|
72
|
+
})
|
|
73
|
+
}, null, 8, ["type", "size", "class"])) : S("", !0)
|
|
74
|
+
]),
|
|
75
|
+
_: 1
|
|
76
|
+
})
|
|
77
|
+
], 10, N));
|
|
358
78
|
}
|
|
359
79
|
});
|
|
360
|
-
const ot = (t, i) => {
|
|
361
|
-
const e = t.__vccOpts || t;
|
|
362
|
-
for (const [n, s] of i)
|
|
363
|
-
e[n] = s;
|
|
364
|
-
return e;
|
|
365
|
-
};
|
|
366
|
-
function ct(t, i, e, n, s, o) {
|
|
367
|
-
const c = P("activity-indicator"), v = P("btn");
|
|
368
|
-
return a(), y(v, w({
|
|
369
|
-
active: t.active,
|
|
370
|
-
block: t.block,
|
|
371
|
-
disabled: t.disabled,
|
|
372
|
-
size: t.size,
|
|
373
|
-
tag: t.tag,
|
|
374
|
-
variant: t.variant,
|
|
375
|
-
class: t.classes
|
|
376
|
-
}, Object.assign({}, t.$attrs, { onClick: void 0 }), {
|
|
377
|
-
onClick: i[0] || (i[0] = (l) => !t.disabled && t.$emit("click", l, {
|
|
378
|
-
disable: t.disable,
|
|
379
|
-
enable: t.enable,
|
|
380
|
-
toggle: t.toggle,
|
|
381
|
-
showActivity: t.showActivity,
|
|
382
|
-
hideActivity: t.hideActivity
|
|
383
|
-
}))
|
|
384
|
-
}), {
|
|
385
|
-
default: A(() => [
|
|
386
|
-
C(t.$slots, "default", {}, () => [
|
|
387
|
-
k(f(t.label), 1)
|
|
388
|
-
]),
|
|
389
|
-
_(c, H(R(t.indicatorProps)), null, 16)
|
|
390
|
-
]),
|
|
391
|
-
_: 3
|
|
392
|
-
}, 16, ["active", "block", "disabled", "size", "tag", "variant", "class"]);
|
|
393
|
-
}
|
|
394
|
-
const ht = /* @__PURE__ */ ot(at, [["render", ct]]);
|
|
395
80
|
export {
|
|
396
|
-
|
|
81
|
+
T as BtnActivity
|
|
397
82
|
};
|
|
83
|
+
//# sourceMappingURL=btn-activity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"btn-activity.js","sources":["../src/BtnActivity.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ActivityIndicator } from '@vue-interface/activity-indicator';\nimport { ref, watch, watchEffect, type Component, type Ref } from 'vue';\nimport { ActivityIndicatorSize } from '../../activity-indicator/src/ActivityIndicator.vue';\n\nexport type BtnActivityProps = {\n activity?: boolean;\n indicator: Component;\n indicatorSize?: ActivityIndicatorSize;\n label?: string;\n orientation?: 'top' | 'bottom' | 'left' | 'right';\n variant?: string;\n size?: string;\n block?: boolean; \n disabled?: boolean;\n};\n\nconst props = withDefaults(defineProps<BtnActivityProps>(), {\n indicatorSize: 'xs',\n label: undefined,\n orientation: 'right',\n variant: 'btn-primary',\n size: 'btn-md'\n});\n\nexport type BtnActivityContext = {\n status: Ref<boolean>;\n toggle: () => void;\n}\n\nconst emit = defineEmits<{\n click: [event: MouseEvent, context: BtnActivityContext];\n 'hide-activity': [];\n 'show-activity': [];\n}>();\n\nconst status = ref(props.activity);\n\nwatchEffect(() => {\n status.value = props.activity;\n});\n\nwatch(status, (value) => {\n if(value) {\n emit('show-activity');\n } \n else {\n emit('hide-activity');\n }\n});\n\nfunction toggle() {\n status.value = !status.value;\n}\n\nconst context = {\n status,\n toggle,\n};\n</script>\n\n<template>\n <button\n type=\"button\"\n :disabled=\"disabled\"\n :class=\"[\n 'btn',\n variant,\n size,\n {\n 'w-full': block,\n 'gap-1': ['xs', 'sm'].includes(indicatorSize),\n 'gap-2': ['md', 'lg', 'xl'].includes(indicatorSize),\n 'flex-col-reverse': orientation === 'top',\n 'flex-col': orientation === 'bottom',\n 'flex-row-reverse': orientation === 'left',\n 'inline-flex items-center justify-center': true,\n 'opacity-50 cursor-not-allowed': disabled,\n }\n ]\"\n @click=\"emit('click', $event, context)\"> \n <slot>{{ label }}</slot>\n <Transition\n enter-active-class=\"transition-all ease-out duration-250\"\n enter-from-class=\"opacity-0\"\n enter-to-class=\"opacity-100\"\n leave-active-class=\"transition-all ease-in duration-250\"\n leave-from-class=\"opacity-100\"\n leave-to-class=\"opacity-0\">\n <ActivityIndicator\n v-if=\"status\"\n :type=\"indicator\"\n :size=\"indicatorSize\"\n :class=\"{\n 'pt-1': orientation === 'top',\n 'pb-1': orientation === 'bottom',\n 'pr-1': orientation === 'left',\n 'pl-1': orientation === 'right',\n }\" />\n </Transition>\n </button>\n</template>"],"names":["props","__props","emit","__emit","status","ref","watchEffect","watch","value","toggle","context","_createElementBlock","_normalizeClass","_cache","$event","_renderSlot","_ctx","_createVNode","_Transition","_createBlock","_unref","ActivityIndicator"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,UAAMA,IAAQC,GAaRC,IAAOC,GAMPC,IAASC,EAAIL,EAAM,QAAQ;AAEjC,IAAAM,EAAY,MAAM;AACd,MAAAF,EAAO,QAAQJ,EAAM;AAAA,IACzB,CAAC,GAEDO,EAAMH,GAAQ,CAACI,MAAU;AACrB,MACIN,EADDM,IACM,kBAGA,eAHe;AAAA,IAK5B,CAAC;AAED,aAASC,IAAS;AACd,MAAAL,EAAO,QAAQ,CAACA,EAAO;AAAA,IAC3B;AAEA,UAAMM,IAAU;AAAA,MACZ,QAAAN;AAAA,MACA,QAAAK;AAAA,IAAA;2BAKAE,EAsCS,UAAA;AAAA,MArCL,MAAK;AAAA,MACJ,UAAUV,EAAA;AAAA,MACV,OAAKW,EAAA;AAAA;QAAmCX,EAAA;AAAA,QAAqBA,EAAA;AAAA;oBAA8CA,EAAA;AAAA,UAA6C,SAAA,CAAA,MAAA,IAAA,EAAA,SAASA,EAAA,aAAa;AAAA,UAA+C,SAAA,CAAA,MAAA,MAAA,IAAA,EAAA,SAASA,EAAA,aAAa;AAAA,8BAAuCA,EAAA,gBAAW;AAAA,sBAAwCA,EAAA,gBAAW;AAAA,8BAAmDA,EAAA,gBAAW;AAAA;2CAA+HA,EAAA;AAAA,QAAA;AAAA;MAerhB,SAAKY,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAEZ,EAAI,SAAUY,GAAQJ,CAAO;AAAA,IAAA;MACrCK,EAAwBC,yBAAxB,MAAwB;AAAA,YAAff,EAAA,KAAK,GAAA,CAAA;AAAA,MAAA;MACdgB,EAiBaC,GAAA;AAAA,QAhBT,sBAAmB;AAAA,QACnB,oBAAiB;AAAA,QACjB,kBAAe;AAAA,QACf,sBAAmB;AAAA,QACnB,oBAAiB;AAAA,QACjB,kBAAe;AAAA,MAAA;;UAELd,EAAA,cADVe,EASSC,EAAAC,CAAA,GAAA;AAAA;YAPJ,MAAMpB,EAAA;AAAA,YACN,MAAMA,EAAA;AAAA,YACN,OAAKW,EAAA;AAAA,sBAAgCX,EAAA,gBAAW;AAAA,sBAAwCA,EAAA,gBAAW;AAAA,sBAA2CA,EAAA,gBAAW;AAAA,sBAAyCA,EAAA,gBAAW;AAAA,YAAA;;;;;;;;"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(i,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@vue-interface/activity-indicator")):typeof define=="function"&&define.amd?define(["exports","vue","@vue-interface/activity-indicator"],t):(i=typeof globalThis<"u"?globalThis:i||self,t(i.BtnActivity={},i.Vue,i.VueInterfaceActivityIndicator))})(this,(function(i,t,r){"use strict";const s=["disabled"],d=t.defineComponent({__name:"BtnActivity",props:{activity:{type:Boolean},indicator:{},indicatorSize:{default:"xs"},label:{default:void 0},orientation:{default:"right"},variant:{default:"btn-primary"},size:{default:"btn-md"},block:{type:Boolean},disabled:{type:Boolean}},emits:["click","hide-activity","show-activity"],setup(e,{emit:f}){const c=e,a=f,n=t.ref(c.activity);t.watchEffect(()=>{n.value=c.activity}),t.watch(n,o=>{a(o?"show-activity":"hide-activity")});function y(){n.value=!n.value}const u={status:n,toggle:y};return(o,l)=>(t.openBlock(),t.createElementBlock("button",{type:"button",disabled:e.disabled,class:t.normalizeClass(["btn",e.variant,e.size,{"w-full":e.block,"gap-1":["xs","sm"].includes(e.indicatorSize),"gap-2":["md","lg","xl"].includes(e.indicatorSize),"flex-col-reverse":e.orientation==="top","flex-col":e.orientation==="bottom","flex-row-reverse":e.orientation==="left","inline-flex items-center justify-center":!0,"opacity-50 cursor-not-allowed":e.disabled}]),onClick:l[0]||(l[0]=m=>a("click",m,u))},[t.renderSlot(o.$slots,"default",{},()=>[t.createTextVNode(t.toDisplayString(e.label),1)]),t.createVNode(t.Transition,{"enter-active-class":"transition-all ease-out duration-250","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-all ease-in duration-250","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:t.withCtx(()=>[n.value?(t.openBlock(),t.createBlock(t.unref(r.ActivityIndicator),{key:0,type:e.indicator,size:e.indicatorSize,class:t.normalizeClass({"pt-1":e.orientation==="top","pb-1":e.orientation==="bottom","pr-1":e.orientation==="left","pl-1":e.orientation==="right"})},null,8,["type","size","class"])):t.createCommentVNode("",!0)]),_:1})],10,s))}});i.BtnActivity=d,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})}));
|
|
2
|
+
//# sourceMappingURL=btn-activity.umd.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"btn-activity.umd.cjs","sources":["../src/BtnActivity.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ActivityIndicator } from '@vue-interface/activity-indicator';\nimport { ref, watch, watchEffect, type Component, type Ref } from 'vue';\nimport { ActivityIndicatorSize } from '../../activity-indicator/src/ActivityIndicator.vue';\n\nexport type BtnActivityProps = {\n activity?: boolean;\n indicator: Component;\n indicatorSize?: ActivityIndicatorSize;\n label?: string;\n orientation?: 'top' | 'bottom' | 'left' | 'right';\n variant?: string;\n size?: string;\n block?: boolean; \n disabled?: boolean;\n};\n\nconst props = withDefaults(defineProps<BtnActivityProps>(), {\n indicatorSize: 'xs',\n label: undefined,\n orientation: 'right',\n variant: 'btn-primary',\n size: 'btn-md'\n});\n\nexport type BtnActivityContext = {\n status: Ref<boolean>;\n toggle: () => void;\n}\n\nconst emit = defineEmits<{\n click: [event: MouseEvent, context: BtnActivityContext];\n 'hide-activity': [];\n 'show-activity': [];\n}>();\n\nconst status = ref(props.activity);\n\nwatchEffect(() => {\n status.value = props.activity;\n});\n\nwatch(status, (value) => {\n if(value) {\n emit('show-activity');\n } \n else {\n emit('hide-activity');\n }\n});\n\nfunction toggle() {\n status.value = !status.value;\n}\n\nconst context = {\n status,\n toggle,\n};\n</script>\n\n<template>\n <button\n type=\"button\"\n :disabled=\"disabled\"\n :class=\"[\n 'btn',\n variant,\n size,\n {\n 'w-full': block,\n 'gap-1': ['xs', 'sm'].includes(indicatorSize),\n 'gap-2': ['md', 'lg', 'xl'].includes(indicatorSize),\n 'flex-col-reverse': orientation === 'top',\n 'flex-col': orientation === 'bottom',\n 'flex-row-reverse': orientation === 'left',\n 'inline-flex items-center justify-center': true,\n 'opacity-50 cursor-not-allowed': disabled,\n }\n ]\"\n @click=\"emit('click', $event, context)\"> \n <slot>{{ label }}</slot>\n <Transition\n enter-active-class=\"transition-all ease-out duration-250\"\n enter-from-class=\"opacity-0\"\n enter-to-class=\"opacity-100\"\n leave-active-class=\"transition-all ease-in duration-250\"\n leave-from-class=\"opacity-100\"\n leave-to-class=\"opacity-0\">\n <ActivityIndicator\n v-if=\"status\"\n :type=\"indicator\"\n :size=\"indicatorSize\"\n :class=\"{\n 'pt-1': orientation === 'top',\n 'pb-1': orientation === 'bottom',\n 'pr-1': orientation === 'left',\n 'pl-1': orientation === 'right',\n }\" />\n </Transition>\n </button>\n</template>"],"names":["props","__props","emit","__emit","status","ref","watchEffect","watch","value","toggle","context","_createElementBlock","_normalizeClass","_cache","$event","_renderSlot","_ctx","_createVNode","_Transition","_createBlock","_unref","ActivityIndicator"],"mappings":"ytBAiBA,MAAMA,EAAQC,EAaRC,EAAOC,EAMPC,EAASC,EAAAA,IAAIL,EAAM,QAAQ,EAEjCM,EAAAA,YAAY,IAAM,CACdF,EAAO,MAAQJ,EAAM,QACzB,CAAC,EAEDO,QAAMH,EAASI,GAAU,CAEjBN,EADDM,EACM,gBAGA,eAHe,CAK5B,CAAC,EAED,SAASC,GAAS,CACdL,EAAO,MAAQ,CAACA,EAAO,KAC3B,CAEA,MAAMM,EAAU,CACZ,OAAAN,EACA,OAAAK,CAAA,8BAKAE,EAAAA,mBAsCS,SAAA,CArCL,KAAK,SACJ,SAAUV,EAAA,SACV,MAAKW,EAAAA,eAAA,OAAmCX,EAAA,QAAqBA,EAAA,eAA8CA,EAAA,MAA6C,QAAA,CAAA,KAAA,IAAA,EAAA,SAASA,EAAA,aAAa,EAA+C,QAAA,CAAA,KAAA,KAAA,IAAA,EAAA,SAASA,EAAA,aAAa,qBAAuCA,EAAA,cAAW,iBAAwCA,EAAA,cAAW,4BAAmDA,EAAA,cAAW,oFAA+HA,EAAA,QAAA,IAerhB,QAAKY,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAEZ,EAAI,QAAUY,EAAQJ,CAAO,EAAA,GACrCK,EAAAA,WAAwBC,sBAAxB,IAAwB,qCAAff,EAAA,KAAK,EAAA,CAAA,CAAA,GACdgB,EAAAA,YAiBaC,EAAAA,WAAA,CAhBT,qBAAmB,uCACnB,mBAAiB,YACjB,iBAAe,cACf,qBAAmB,sCACnB,mBAAiB,cACjB,iBAAe,WAAA,0BAELd,EAAA,qBADVe,EAAAA,YASSC,EAAAA,MAAAC,EAAAA,iBAAA,EAAA,OAPJ,KAAMpB,EAAA,UACN,KAAMA,EAAA,cACN,MAAKW,EAAAA,eAAA,QAAgCX,EAAA,cAAW,aAAwCA,EAAA,cAAW,gBAA2CA,EAAA,cAAW,cAAyCA,EAAA,cAAW,OAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import BtnActivity from './src/BtnActivity.vue';
|
|
1
|
+
import { default as BtnActivity } from './src/BtnActivity.vue';
|
|
2
2
|
export { BtnActivity };
|
|
@@ -1,169 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
type: StringConstructor;
|
|
37
|
-
default: string;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* The size of the button.
|
|
41
|
-
*/
|
|
42
|
-
size: {
|
|
43
|
-
type: StringConstructor;
|
|
44
|
-
default: string;
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* The HTML tag.
|
|
48
|
-
*/
|
|
49
|
-
tag: {
|
|
50
|
-
type: StringConstructor;
|
|
51
|
-
default: undefined;
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* The variant of the button.
|
|
55
|
-
*/
|
|
56
|
-
variant: {
|
|
57
|
-
type: StringConstructor;
|
|
58
|
-
default: string;
|
|
59
|
-
};
|
|
60
|
-
}, unknown, {
|
|
61
|
-
currentActivity: boolean;
|
|
62
|
-
}, {
|
|
63
|
-
/**
|
|
64
|
-
* An object of classes to append to the button.
|
|
65
|
-
*/
|
|
66
|
-
classes(): {
|
|
67
|
-
[x: string]: any;
|
|
68
|
-
disabled: any;
|
|
69
|
-
active: any;
|
|
70
|
-
'btn-activity': any;
|
|
71
|
-
};
|
|
72
|
-
indicatorProps(): any;
|
|
73
|
-
}, {
|
|
74
|
-
/**
|
|
75
|
-
* Disable the button.
|
|
76
|
-
*/
|
|
77
|
-
disable(): void;
|
|
78
|
-
/**
|
|
79
|
-
* Enable the button.
|
|
80
|
-
*/
|
|
81
|
-
enable(): void;
|
|
82
|
-
/**
|
|
83
|
-
* Hide the activity indicator inside the button.
|
|
84
|
-
*/
|
|
85
|
-
hideActivity(): void;
|
|
86
|
-
/**
|
|
87
|
-
* Show the activity indicator inside the button.
|
|
88
|
-
*/
|
|
89
|
-
showActivity(): void;
|
|
90
|
-
/**
|
|
91
|
-
* Show the activity indicator inside the button.
|
|
92
|
-
*/
|
|
93
|
-
toggle(): void;
|
|
94
|
-
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "hide-activity" | "show-activity")[], "click" | "hide-activity" | "show-activity", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
95
|
-
/**
|
|
96
|
-
* Make the button appear with the active state.
|
|
97
|
-
*/
|
|
98
|
-
active: BooleanConstructor;
|
|
99
|
-
/**
|
|
100
|
-
* Show the activity indicator inside the button.
|
|
101
|
-
*/
|
|
102
|
-
activity: BooleanConstructor;
|
|
103
|
-
/**
|
|
104
|
-
* Display the button as block width.
|
|
105
|
-
*/
|
|
106
|
-
block: BooleanConstructor;
|
|
107
|
-
/**
|
|
108
|
-
* Disable the button.
|
|
109
|
-
*/
|
|
110
|
-
disabled: BooleanConstructor;
|
|
111
|
-
/**
|
|
112
|
-
* The type of activity indicator inside the button.
|
|
113
|
-
*/
|
|
114
|
-
indicator: {
|
|
115
|
-
type: (StringConstructor | ObjectConstructor)[];
|
|
116
|
-
default: string;
|
|
117
|
-
};
|
|
118
|
-
/**
|
|
119
|
-
* The button label.
|
|
120
|
-
*/
|
|
121
|
-
label: {
|
|
122
|
-
type: StringConstructor;
|
|
123
|
-
default: undefined;
|
|
124
|
-
};
|
|
125
|
-
/**
|
|
126
|
-
* The orientation of the activity button inside the button.
|
|
127
|
-
*/
|
|
128
|
-
orientation: {
|
|
129
|
-
type: StringConstructor;
|
|
130
|
-
default: string;
|
|
131
|
-
};
|
|
132
|
-
/**
|
|
133
|
-
* The size of the button.
|
|
134
|
-
*/
|
|
135
|
-
size: {
|
|
136
|
-
type: StringConstructor;
|
|
137
|
-
default: string;
|
|
138
|
-
};
|
|
139
|
-
/**
|
|
140
|
-
* The HTML tag.
|
|
141
|
-
*/
|
|
142
|
-
tag: {
|
|
143
|
-
type: StringConstructor;
|
|
144
|
-
default: undefined;
|
|
145
|
-
};
|
|
146
|
-
/**
|
|
147
|
-
* The variant of the button.
|
|
148
|
-
*/
|
|
149
|
-
variant: {
|
|
150
|
-
type: StringConstructor;
|
|
151
|
-
default: string;
|
|
152
|
-
};
|
|
153
|
-
}>> & {
|
|
154
|
-
onClick?: ((...args: any[]) => any) | undefined;
|
|
155
|
-
"onHide-activity"?: ((...args: any[]) => any) | undefined;
|
|
156
|
-
"onShow-activity"?: ((...args: any[]) => any) | undefined;
|
|
157
|
-
}, {
|
|
158
|
-
label: string;
|
|
1
|
+
import { Component, Ref } from 'vue';
|
|
2
|
+
import { ActivityIndicatorSize } from '../../activity-indicator/src/ActivityIndicator.vue';
|
|
3
|
+
export type BtnActivityProps = {
|
|
4
|
+
activity?: boolean;
|
|
5
|
+
indicator: Component;
|
|
6
|
+
indicatorSize?: ActivityIndicatorSize;
|
|
7
|
+
label?: string;
|
|
8
|
+
orientation?: 'top' | 'bottom' | 'left' | 'right';
|
|
9
|
+
variant?: string;
|
|
10
|
+
size?: string;
|
|
11
|
+
block?: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type BtnActivityContext = {
|
|
15
|
+
status: Ref<boolean>;
|
|
16
|
+
toggle: () => void;
|
|
17
|
+
};
|
|
18
|
+
declare function __VLS_template(): {
|
|
19
|
+
attrs: Partial<{}>;
|
|
20
|
+
slots: {
|
|
21
|
+
default?(_: {}): any;
|
|
22
|
+
};
|
|
23
|
+
refs: {};
|
|
24
|
+
rootEl: HTMLButtonElement;
|
|
25
|
+
};
|
|
26
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
27
|
+
declare const __VLS_component: import('vue').DefineComponent<BtnActivityProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
28
|
+
click: (event: MouseEvent, context: BtnActivityContext) => any;
|
|
29
|
+
"hide-activity": () => any;
|
|
30
|
+
"show-activity": () => any;
|
|
31
|
+
}, string, import('vue').PublicProps, Readonly<BtnActivityProps> & Readonly<{
|
|
32
|
+
onClick?: ((event: MouseEvent, context: BtnActivityContext) => any) | undefined;
|
|
33
|
+
"onHide-activity"?: (() => any) | undefined;
|
|
34
|
+
"onShow-activity"?: (() => any) | undefined;
|
|
35
|
+
}>, {
|
|
159
36
|
size: string;
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
tag: string;
|
|
37
|
+
label: string;
|
|
38
|
+
indicatorSize: ActivityIndicatorSize;
|
|
39
|
+
orientation: "top" | "bottom" | "left" | "right";
|
|
164
40
|
variant: string;
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
41
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLButtonElement>;
|
|
42
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
43
|
+
export default _default;
|
|
44
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
45
|
+
new (): {
|
|
46
|
+
$slots: S;
|
|
47
|
+
};
|
|
48
|
+
};
|
package/index.css
ADDED
package/package.json
CHANGED
|
@@ -1,37 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-interface/btn-activity",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "A Vue activity button component.",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"files": [
|
|
7
|
-
"dist"
|
|
8
|
-
],
|
|
9
6
|
"main": "./dist/btn-activity.umd.cjs",
|
|
10
7
|
"module": "./dist/btn-activity.js",
|
|
11
|
-
"style": "./dist/style.css",
|
|
12
8
|
"types": "./dist/index.d.ts",
|
|
13
9
|
"exports": {
|
|
14
10
|
".": {
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
"source": "./index.ts",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"require": "./dist/btn-activity.umd.js",
|
|
14
|
+
"import": "./dist/btn-activity.js"
|
|
15
|
+
}
|
|
20
16
|
},
|
|
21
17
|
"browserslist": "last 2 versions, > 0.5%, ie >= 11",
|
|
22
|
-
"scripts": {
|
|
23
|
-
"dev": "vite",
|
|
24
|
-
"build": "vite build",
|
|
25
|
-
"preview": "vite preview",
|
|
26
|
-
"pre-release": "npm run build; git add . -A; git commit -m 'pre-release commit'",
|
|
27
|
-
"release-patch": "npm run pre-release && npm version patch -m \"%s\" && npm run release;",
|
|
28
|
-
"release-minor": "npm run pre-release && npm version minor -m \"%s\" && npm run release;",
|
|
29
|
-
"release-major": "npm run pre-release && npm version major -m \"%s\" && npm run release;",
|
|
30
|
-
"release": "git add . -A; git commit; git push --tags origin; npm publish;"
|
|
31
|
-
},
|
|
32
18
|
"repository": {
|
|
33
19
|
"type": "git",
|
|
34
|
-
"url": "git+https://github.com/vue-interface/
|
|
20
|
+
"url": "git+https://github.com/vue-interface/vue-interface.github.io"
|
|
35
21
|
},
|
|
36
22
|
"keywords": [
|
|
37
23
|
"Form",
|
|
@@ -42,29 +28,26 @@
|
|
|
42
28
|
"Bootstrap"
|
|
43
29
|
],
|
|
44
30
|
"author": "Justin Kimbrell",
|
|
45
|
-
"license": "
|
|
31
|
+
"license": "MIT",
|
|
46
32
|
"bugs": {
|
|
47
|
-
"url": "https://github.com/vue-interface/
|
|
33
|
+
"url": "https://github.com/vue-interface/vue-interface.github.io"
|
|
48
34
|
},
|
|
49
|
-
"homepage": "https://github.com/vue-interface/
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
"
|
|
35
|
+
"homepage": "https://github.com/vue-interface/vue-interface",
|
|
36
|
+
"readme": "README.md",
|
|
37
|
+
"files": [
|
|
38
|
+
"dist",
|
|
39
|
+
"index.css",
|
|
40
|
+
"README.md",
|
|
41
|
+
"LICENSE"
|
|
42
|
+
],
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"vue": "^3.3.4",
|
|
45
|
+
"@vue-interface/activity-indicator": "3.0.1",
|
|
46
|
+
"@vue-interface/btn": "4.0.1"
|
|
53
47
|
},
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"babel-eslint": "^10.1.0",
|
|
59
|
-
"babel-preset-vue": "^2.0.2",
|
|
60
|
-
"change-case": "^4.1.2",
|
|
61
|
-
"eslint": "^8.25.0",
|
|
62
|
-
"eslint-plugin-vue": "^9.6.0",
|
|
63
|
-
"pascalcase": "^2.0.0",
|
|
64
|
-
"postcss": "^8.4.6",
|
|
65
|
-
"tailwindcss": "^3.0.18",
|
|
66
|
-
"vite": "^3.1.7",
|
|
67
|
-
"vite-plugin-dts": "^1.7.1",
|
|
68
|
-
"vue": "^3.2.40"
|
|
48
|
+
"scripts": {
|
|
49
|
+
"dev": "vite",
|
|
50
|
+
"build": "vue-tsc && vite build",
|
|
51
|
+
"preview": "vite preview"
|
|
69
52
|
}
|
|
70
|
-
}
|
|
53
|
+
}
|
package/dist/style.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@-webkit-keyframes btn-activity-in{0%,to{-webkit-transform:scale(1);transform:scale(1)}30%{-webkit-transform:scale(.98);transform:scale(.98)}}@keyframes btn-activity-in{0%,to{-webkit-transform:scale(1);transform:scale(1)}30%{-webkit-transform:scale(.98);transform:scale(.98)}}@-webkit-keyframes btn-activity-out{0%,to{-webkit-transform:scale(1);transform:scale(1)}70%{-webkit-transform:scale(.98);transform:scale(.98)}}@keyframes btn-activity-out{0%,to{-webkit-transform:scale(1);transform:scale(1)}70%{-webkit-transform:scale(.98);transform:scale(.98)}}.btn-activity-top,.btn.btn-activity-top,.btn-activity-bottom,.btn.btn-activity-bottom,.btn-activity-left,.btn.btn-activity-left,.btn-activity-right,.btn.btn-activity-right{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;position:relative;-webkit-transition:all 166.5ms ease-in;transition:all 166.5ms ease-in}.btn-activity-top .activity-indicator,.btn-activity-bottom .activity-indicator,.btn-activity-left .activity-indicator,.btn-activity-right .activity-indicator{opacity:0;position:absolute;visibility:hidden;-webkit-transition:opacity 333ms ease-in;transition:opacity 333ms ease-in}.btn-activity-top,.btn-activity-bottom{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.btn-activity-top .activity-indicator,.btn-activity-bottom .activity-indicator{margin-left:auto;margin-right:auto}.btn-activity-top{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.btn-activity-top .activity-indicator{padding-bottom:1em}.btn-activity-bottom .activity-indicator{padding-top:1em}.btn-activity-left,.btn-activity-right{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.btn-activity-left{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.btn-activity-left .activity-indicator{padding-right:1em}.btn-activity-right .activity-indicator{padding-left:1em}.btn-activity:not(.btn-link){-webkit-animation:btn-activity-in 333ms;animation:btn-activity-in 333ms}.btn-hide-activity:not(.btn-link){-webkit-animation:btn-activity-out 333ms;animation:btn-activity-out 333ms}.btn-activity.btn-hide-activity .activity-indicator{opacity:0}.btn-activity .activity-indicator{opacity:1;visibility:visible;position:relative;font-size:.55em}
|