@vue-interface/btn-activity 1.1.0 → 2.0.0-beta.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/dist/btn-activity.es.js +208 -537
- package/dist/btn-activity.umd.js +2 -3
- package/package.json +9 -9
package/dist/btn-activity.es.js
CHANGED
|
@@ -1,308 +1,93 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
|
25
|
-
if (protoProps)
|
|
26
|
-
_defineProperties(Constructor.prototype, protoProps);
|
|
27
|
-
if (staticProps)
|
|
28
|
-
_defineProperties(Constructor, staticProps);
|
|
29
|
-
Object.defineProperty(Constructor, "prototype", {
|
|
30
|
-
writable: false
|
|
31
|
-
});
|
|
32
|
-
return Constructor;
|
|
33
|
-
}
|
|
34
|
-
function _setPrototypeOf(o, p) {
|
|
35
|
-
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
|
|
36
|
-
o2.__proto__ = p2;
|
|
37
|
-
return o2;
|
|
38
|
-
};
|
|
39
|
-
return _setPrototypeOf(o, p);
|
|
40
|
-
}
|
|
41
|
-
function _isNativeReflectConstruct() {
|
|
42
|
-
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
43
|
-
return false;
|
|
44
|
-
if (Reflect.construct.sham)
|
|
45
|
-
return false;
|
|
46
|
-
if (typeof Proxy === "function")
|
|
47
|
-
return true;
|
|
48
|
-
try {
|
|
49
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
50
|
-
}));
|
|
51
|
-
return true;
|
|
52
|
-
} catch (e) {
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
function _construct(Parent, args, Class) {
|
|
57
|
-
if (_isNativeReflectConstruct()) {
|
|
58
|
-
_construct = Reflect.construct;
|
|
59
|
-
} else {
|
|
60
|
-
_construct = function _construct2(Parent2, args2, Class2) {
|
|
61
|
-
var a = [null];
|
|
62
|
-
a.push.apply(a, args2);
|
|
63
|
-
var Constructor = Function.bind.apply(Parent2, a);
|
|
64
|
-
var instance = new Constructor();
|
|
65
|
-
if (Class2)
|
|
66
|
-
_setPrototypeOf(instance, Class2.prototype);
|
|
67
|
-
return instance;
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
return _construct.apply(null, arguments);
|
|
71
|
-
}
|
|
72
|
-
function _slicedToArray(arr, i) {
|
|
73
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
74
|
-
}
|
|
75
|
-
function _arrayWithHoles(arr) {
|
|
76
|
-
if (Array.isArray(arr))
|
|
77
|
-
return arr;
|
|
78
|
-
}
|
|
79
|
-
function _iterableToArrayLimit(arr, i) {
|
|
80
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
81
|
-
if (_i == null)
|
|
82
|
-
return;
|
|
83
|
-
var _arr = [];
|
|
84
|
-
var _n = true;
|
|
85
|
-
var _d = false;
|
|
86
|
-
var _s, _e;
|
|
87
|
-
try {
|
|
88
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
89
|
-
_arr.push(_s.value);
|
|
90
|
-
if (i && _arr.length === i)
|
|
91
|
-
break;
|
|
92
|
-
}
|
|
93
|
-
} catch (err) {
|
|
94
|
-
_d = true;
|
|
95
|
-
_e = err;
|
|
96
|
-
} finally {
|
|
97
|
-
try {
|
|
98
|
-
if (!_n && _i["return"] != null)
|
|
99
|
-
_i["return"]();
|
|
100
|
-
} finally {
|
|
101
|
-
if (_d)
|
|
102
|
-
throw _e;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return _arr;
|
|
106
|
-
}
|
|
107
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
108
|
-
if (!o)
|
|
109
|
-
return;
|
|
110
|
-
if (typeof o === "string")
|
|
111
|
-
return _arrayLikeToArray(o, minLen);
|
|
112
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
113
|
-
if (n === "Object" && o.constructor)
|
|
114
|
-
n = o.constructor.name;
|
|
115
|
-
if (n === "Map" || n === "Set")
|
|
116
|
-
return Array.from(o);
|
|
117
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
118
|
-
return _arrayLikeToArray(o, minLen);
|
|
119
|
-
}
|
|
120
|
-
function _arrayLikeToArray(arr, len) {
|
|
121
|
-
if (len == null || len > arr.length)
|
|
122
|
-
len = arr.length;
|
|
123
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
124
|
-
arr2[i] = arr[i];
|
|
125
|
-
return arr2;
|
|
126
|
-
}
|
|
127
|
-
function _nonIterableRest() {
|
|
128
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
129
|
-
}
|
|
130
|
-
var _assign = function __assign() {
|
|
131
|
-
_assign = Object.assign || function __assign22(t) {
|
|
132
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
133
|
-
s = arguments[i];
|
|
134
|
-
for (var p in s) {
|
|
135
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
136
|
-
t[p] = s[p];
|
|
137
|
-
}
|
|
1
|
+
import { openBlock as c, createElementBlock as p, normalizeClass as z, normalizeStyle as R, createElementVNode as N, createBlock as m, resolveDynamicComponent as w, createCommentVNode as b, toDisplayString as f, mergeProps as O, withCtx as $, renderSlot as A, createTextVNode as B, resolveComponent as x, createVNode as D, normalizeProps as L, guardReactiveProps as j } from "vue";
|
|
2
|
+
/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
***************************************************************************** */
|
|
16
|
+
var h = function() {
|
|
17
|
+
return h = Object.assign || function(e) {
|
|
18
|
+
for (var i, n = 1, s = arguments.length; n < s; n++) {
|
|
19
|
+
i = arguments[n];
|
|
20
|
+
for (var a in i)
|
|
21
|
+
Object.prototype.hasOwnProperty.call(i, a) && (e[a] = i[a]);
|
|
138
22
|
}
|
|
139
|
-
return
|
|
140
|
-
};
|
|
141
|
-
return _assign.apply(this, arguments);
|
|
23
|
+
return e;
|
|
24
|
+
}, h.apply(this, arguments);
|
|
142
25
|
};
|
|
143
|
-
function
|
|
144
|
-
return
|
|
26
|
+
function T(t) {
|
|
27
|
+
return t.toLowerCase();
|
|
145
28
|
}
|
|
146
|
-
var
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
var start = 0;
|
|
155
|
-
var end = result.length;
|
|
156
|
-
while (result.charAt(start) === "\0") {
|
|
157
|
-
start++;
|
|
158
|
-
}
|
|
159
|
-
while (result.charAt(end - 1) === "\0") {
|
|
160
|
-
end--;
|
|
161
|
-
}
|
|
162
|
-
return result.slice(start, end).split("\0").map(transform).join(delimiter);
|
|
29
|
+
var V = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g], F = /[^A-Z0-9]+/gi;
|
|
30
|
+
function H(t, e) {
|
|
31
|
+
e === void 0 && (e = {});
|
|
32
|
+
for (var i = e.splitRegexp, n = i === void 0 ? V : i, s = e.stripRegexp, a = s === void 0 ? F : s, o = e.transform, _ = o === void 0 ? T : o, l = e.delimiter, E = l === void 0 ? " " : l, d = P(P(t, n, "$1\0$2"), a, "\0"), v = 0, y = d.length; d.charAt(v) === "\0"; )
|
|
33
|
+
v++;
|
|
34
|
+
for (; d.charAt(y - 1) === "\0"; )
|
|
35
|
+
y--;
|
|
36
|
+
return d.slice(v, y).split("\0").map(_).join(E);
|
|
163
37
|
}
|
|
164
|
-
function
|
|
165
|
-
|
|
166
|
-
return
|
|
167
|
-
|
|
168
|
-
return input2.replace(re2, value);
|
|
169
|
-
}, input);
|
|
38
|
+
function P(t, e, i) {
|
|
39
|
+
return e instanceof RegExp ? t.replace(e, i) : e.reduce(function(n, s) {
|
|
40
|
+
return n.replace(s, i);
|
|
41
|
+
}, t);
|
|
170
42
|
}
|
|
171
|
-
function
|
|
172
|
-
|
|
173
|
-
options = {};
|
|
174
|
-
}
|
|
175
|
-
return noCase$1(input, _assign({
|
|
43
|
+
function I(t, e) {
|
|
44
|
+
return e === void 0 && (e = {}), H(t, h({
|
|
176
45
|
delimiter: "."
|
|
177
|
-
},
|
|
46
|
+
}, e));
|
|
178
47
|
}
|
|
179
|
-
function
|
|
180
|
-
|
|
181
|
-
options = {};
|
|
182
|
-
}
|
|
183
|
-
return dotCase$1(input, _assign({
|
|
48
|
+
function u(t, e) {
|
|
49
|
+
return e === void 0 && (e = {}), I(t, h({
|
|
184
50
|
delimiter: "-"
|
|
185
|
-
},
|
|
51
|
+
}, e));
|
|
186
52
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
_classCallCheck(this, ComponentRegistry2);
|
|
192
|
-
this.components = {};
|
|
193
|
-
Object.entries(components).forEach(function(_ref) {
|
|
194
|
-
var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], value = _ref2[1];
|
|
195
|
-
_this.register(key, value);
|
|
53
|
+
class k {
|
|
54
|
+
constructor(e = {}) {
|
|
55
|
+
this.components = /* @__PURE__ */ new Map(), Object.entries(e).forEach(([i, n]) => {
|
|
56
|
+
this.register(i, n);
|
|
196
57
|
});
|
|
197
58
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
return match;
|
|
204
|
-
}
|
|
205
|
-
throw new Error('"'.concat(name, '" has not been registered yet!'));
|
|
206
|
-
}
|
|
207
|
-
}, {
|
|
208
|
-
key: "register",
|
|
209
|
-
value: function register(name, value) {
|
|
210
|
-
var _this2 = this;
|
|
211
|
-
if (_typeof(name) === "object") {
|
|
212
|
-
Object.entries(name).forEach(function(_ref3) {
|
|
213
|
-
var _ref4 = _slicedToArray(_ref3, 2), name2 = _ref4[0], module = _ref4[1];
|
|
214
|
-
_this2.register(paramCase$1(name2), module);
|
|
215
|
-
});
|
|
216
|
-
return this;
|
|
217
|
-
}
|
|
218
|
-
this.components[paramCase$1(name)] = value;
|
|
219
|
-
return this;
|
|
220
|
-
}
|
|
221
|
-
}, {
|
|
222
|
-
key: "remove",
|
|
223
|
-
value: function remove(name) {
|
|
224
|
-
delete this.components[paramCase$1(name)];
|
|
225
|
-
return this;
|
|
226
|
-
}
|
|
227
|
-
}, {
|
|
228
|
-
key: "reset",
|
|
229
|
-
value: function reset() {
|
|
230
|
-
this.components = {};
|
|
231
|
-
return this;
|
|
232
|
-
}
|
|
233
|
-
}]);
|
|
234
|
-
return ComponentRegistry2;
|
|
235
|
-
}();
|
|
236
|
-
function factory() {
|
|
237
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
238
|
-
args[_key] = arguments[_key];
|
|
59
|
+
get(e) {
|
|
60
|
+
const i = this.components.get(e = u(e));
|
|
61
|
+
if (i)
|
|
62
|
+
return i;
|
|
63
|
+
throw new Error(`"${e}" has not been registered yet!`);
|
|
239
64
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
var _vm = this;
|
|
245
|
-
var _h = _vm.$createElement;
|
|
246
|
-
var _c = _vm._self._c || _h;
|
|
247
|
-
return _c("div", { staticClass: "activity-indicator", class: _vm.classes, style: _vm.style }, [_c("div", { staticClass: "activity-indicator-content" }, [_c(_vm.component, { tag: "component", staticClass: "mx-auto" }), _vm.label ? _c("div", { staticClass: "activity-indicator-label" }, [_vm._v(" " + _vm._s(_vm.label) + " ")]) : _vm._e()], 1)]);
|
|
248
|
-
};
|
|
249
|
-
var staticRenderFns$2 = [];
|
|
250
|
-
var ActivityIndicator_vue_vue_type_style_index_0_lang = "";
|
|
251
|
-
function normalizeComponent(scriptExports, render2, staticRenderFns2, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
|
|
252
|
-
var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
|
|
253
|
-
if (render2) {
|
|
254
|
-
options.render = render2;
|
|
255
|
-
options.staticRenderFns = staticRenderFns2;
|
|
256
|
-
options._compiled = true;
|
|
65
|
+
register(e, i) {
|
|
66
|
+
return typeof e == "object" ? (Object.entries(e).forEach(([n, s]) => {
|
|
67
|
+
this.register(u(n), s);
|
|
68
|
+
}), this) : (this.components.set(u(e), i), this);
|
|
257
69
|
}
|
|
258
|
-
|
|
259
|
-
|
|
70
|
+
remove(e) {
|
|
71
|
+
return this.components.delete(u(e)), this;
|
|
260
72
|
}
|
|
261
|
-
|
|
262
|
-
|
|
73
|
+
reset() {
|
|
74
|
+
return this.components = /* @__PURE__ */ new Map(), this;
|
|
263
75
|
}
|
|
264
|
-
var hook;
|
|
265
|
-
if (moduleIdentifier) {
|
|
266
|
-
hook = function(context) {
|
|
267
|
-
context = context || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
|
|
268
|
-
if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") {
|
|
269
|
-
context = __VUE_SSR_CONTEXT__;
|
|
270
|
-
}
|
|
271
|
-
if (injectStyles) {
|
|
272
|
-
injectStyles.call(this, context);
|
|
273
|
-
}
|
|
274
|
-
if (context && context._registeredComponents) {
|
|
275
|
-
context._registeredComponents.add(moduleIdentifier);
|
|
276
|
-
}
|
|
277
|
-
};
|
|
278
|
-
options._ssrRegister = hook;
|
|
279
|
-
} else if (injectStyles) {
|
|
280
|
-
hook = shadowMode ? function() {
|
|
281
|
-
injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot);
|
|
282
|
-
} : injectStyles;
|
|
283
|
-
}
|
|
284
|
-
if (hook) {
|
|
285
|
-
if (options.functional) {
|
|
286
|
-
options._injectStyles = hook;
|
|
287
|
-
var originalRender = options.render;
|
|
288
|
-
options.render = function renderWithStyleInjection(h, context) {
|
|
289
|
-
hook.call(context);
|
|
290
|
-
return originalRender(h, context);
|
|
291
|
-
};
|
|
292
|
-
} else {
|
|
293
|
-
var existing = options.beforeCreate;
|
|
294
|
-
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
return {
|
|
298
|
-
exports: scriptExports,
|
|
299
|
-
options
|
|
300
|
-
};
|
|
301
76
|
}
|
|
302
|
-
function
|
|
303
|
-
return
|
|
77
|
+
function W(...t) {
|
|
78
|
+
return new k(...t);
|
|
304
79
|
}
|
|
305
|
-
const
|
|
80
|
+
const S = W();
|
|
81
|
+
const g = (t, e) => {
|
|
82
|
+
const i = t.__vccOpts || t;
|
|
83
|
+
for (const [n, s] of e)
|
|
84
|
+
i[n] = s;
|
|
85
|
+
return i;
|
|
86
|
+
};
|
|
87
|
+
function r(t, e = "px") {
|
|
88
|
+
return t != null && t !== !1 && isFinite(t) ? `${t}${e}` : t;
|
|
89
|
+
}
|
|
90
|
+
const q = {
|
|
306
91
|
name: "ActivityIndicator",
|
|
307
92
|
props: {
|
|
308
93
|
absolute: Boolean,
|
|
@@ -313,14 +98,14 @@ const __vue2_script$2 = {
|
|
|
313
98
|
default: "md"
|
|
314
99
|
},
|
|
315
100
|
registry: {
|
|
316
|
-
type:
|
|
101
|
+
type: k,
|
|
317
102
|
default() {
|
|
318
|
-
return
|
|
103
|
+
return S;
|
|
319
104
|
}
|
|
320
105
|
},
|
|
321
106
|
type: {
|
|
322
107
|
type: String,
|
|
323
|
-
required:
|
|
108
|
+
required: !0
|
|
324
109
|
},
|
|
325
110
|
height: [String, Number],
|
|
326
111
|
maxHeight: [String, Number],
|
|
@@ -329,6 +114,9 @@ const __vue2_script$2 = {
|
|
|
329
114
|
maxWidth: [String, Number],
|
|
330
115
|
minWidth: [String, Number]
|
|
331
116
|
},
|
|
117
|
+
data: () => ({
|
|
118
|
+
is: null
|
|
119
|
+
}),
|
|
332
120
|
computed: {
|
|
333
121
|
classes() {
|
|
334
122
|
return {
|
|
@@ -339,184 +127,95 @@ const __vue2_script$2 = {
|
|
|
339
127
|
},
|
|
340
128
|
style() {
|
|
341
129
|
return {
|
|
342
|
-
width:
|
|
343
|
-
maxWidth:
|
|
344
|
-
minWidth:
|
|
345
|
-
height:
|
|
346
|
-
maxHeight:
|
|
347
|
-
minHeight:
|
|
348
|
-
};
|
|
349
|
-
},
|
|
350
|
-
component() {
|
|
351
|
-
return () => {
|
|
352
|
-
const component = registry.get(this.type);
|
|
353
|
-
if (component instanceof Promise) {
|
|
354
|
-
return component;
|
|
355
|
-
}
|
|
356
|
-
if (typeof component === "function") {
|
|
357
|
-
return component();
|
|
358
|
-
}
|
|
359
|
-
return Promise.resolve(component);
|
|
130
|
+
width: r(this.width),
|
|
131
|
+
maxWidth: r(this.maxWidth),
|
|
132
|
+
minWidth: r(this.minWidth),
|
|
133
|
+
height: r(this.height),
|
|
134
|
+
maxHeight: r(this.maxHeight),
|
|
135
|
+
minHeight: r(this.minHeight)
|
|
360
136
|
};
|
|
361
137
|
}
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
var ActivityIndicator = /* @__PURE__ */ function() {
|
|
372
|
-
return __component__$2.exports;
|
|
373
|
-
}();
|
|
374
|
-
var Chase_vue_vue_type_style_index_0_lang = "";
|
|
375
|
-
var CircleFade_vue_vue_type_style_index_0_lang = "";
|
|
376
|
-
var CircleOrbit_vue_vue_type_style_index_0_lang = "";
|
|
377
|
-
var CircleTrail_vue_vue_type_style_index_0_lang = "";
|
|
378
|
-
var Dots_vue_vue_type_style_index_0_lang = "";
|
|
379
|
-
var DoublePulse_vue_vue_type_style_index_0_lang = "";
|
|
380
|
-
var Facebook_vue_vue_type_style_index_0_lang = "";
|
|
381
|
-
var Grid_vue_vue_type_style_index_0_lang = "";
|
|
382
|
-
var Pulse_vue_vue_type_style_index_0_lang = "";
|
|
383
|
-
var Spinner_vue_vue_type_style_index_0_lang = "";
|
|
384
|
-
var Spotify_vue_vue_type_style_index_0_lang = "";
|
|
385
|
-
var Square_vue_vue_type_style_index_0_lang = "";
|
|
386
|
-
var SquareFold_vue_vue_type_style_index_0_lang = "";
|
|
387
|
-
var SquareOrbit_vue_vue_type_style_index_0_lang = "";
|
|
388
|
-
/*! *****************************************************************************
|
|
389
|
-
Copyright (c) Microsoft Corporation.
|
|
390
|
-
|
|
391
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
392
|
-
purpose with or without fee is hereby granted.
|
|
393
|
-
|
|
394
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
395
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
396
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
397
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
398
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
399
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
400
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
401
|
-
***************************************************************************** */
|
|
402
|
-
var __assign2 = function() {
|
|
403
|
-
__assign2 = Object.assign || function __assign22(t) {
|
|
404
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
405
|
-
s = arguments[i];
|
|
406
|
-
for (var p in s)
|
|
407
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
408
|
-
t[p] = s[p];
|
|
138
|
+
},
|
|
139
|
+
async mounted() {
|
|
140
|
+
const t = await this.component();
|
|
141
|
+
this.is = () => t;
|
|
142
|
+
},
|
|
143
|
+
methods: {
|
|
144
|
+
async component() {
|
|
145
|
+
let t = S.get(this.type);
|
|
146
|
+
return t instanceof Promise ? t : (typeof t == "function" && (t = await t()), t.default ? t.default : t);
|
|
409
147
|
}
|
|
410
|
-
return t;
|
|
411
|
-
};
|
|
412
|
-
return __assign2.apply(this, arguments);
|
|
413
|
-
};
|
|
414
|
-
function lowerCase(str) {
|
|
415
|
-
return str.toLowerCase();
|
|
416
|
-
}
|
|
417
|
-
var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
|
|
418
|
-
var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
|
|
419
|
-
function noCase(input, options) {
|
|
420
|
-
if (options === void 0) {
|
|
421
|
-
options = {};
|
|
422
|
-
}
|
|
423
|
-
var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
|
|
424
|
-
var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
|
|
425
|
-
var start = 0;
|
|
426
|
-
var end = result.length;
|
|
427
|
-
while (result.charAt(start) === "\0")
|
|
428
|
-
start++;
|
|
429
|
-
while (result.charAt(end - 1) === "\0")
|
|
430
|
-
end--;
|
|
431
|
-
return result.slice(start, end).split("\0").map(transform).join(delimiter);
|
|
432
|
-
}
|
|
433
|
-
function replace(input, re, value) {
|
|
434
|
-
if (re instanceof RegExp)
|
|
435
|
-
return input.replace(re, value);
|
|
436
|
-
return re.reduce(function(input2, re2) {
|
|
437
|
-
return input2.replace(re2, value);
|
|
438
|
-
}, input);
|
|
439
|
-
}
|
|
440
|
-
function dotCase(input, options) {
|
|
441
|
-
if (options === void 0) {
|
|
442
|
-
options = {};
|
|
443
148
|
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
}
|
|
448
|
-
function
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
149
|
+
}, Z = { class: "activity-indicator-content" }, G = {
|
|
150
|
+
key: 1,
|
|
151
|
+
class: "activity-indicator-label"
|
|
152
|
+
};
|
|
153
|
+
function M(t, e, i, n, s, a) {
|
|
154
|
+
return c(), p("div", {
|
|
155
|
+
class: z(["activity-indicator", a.classes]),
|
|
156
|
+
style: R(a.style)
|
|
157
|
+
}, [
|
|
158
|
+
N("div", Z, [
|
|
159
|
+
t.is ? (c(), m(w(t.is()), {
|
|
160
|
+
key: 0,
|
|
161
|
+
class: "mx-auto"
|
|
162
|
+
})) : b("", !0),
|
|
163
|
+
i.label ? (c(), p("div", G, f(i.label), 1)) : b("", !0)
|
|
164
|
+
])
|
|
165
|
+
], 6);
|
|
455
166
|
}
|
|
456
|
-
|
|
167
|
+
const U = /* @__PURE__ */ g(q, [["render", M]]);
|
|
168
|
+
const X = {
|
|
457
169
|
props: {
|
|
170
|
+
componentPrefix: String,
|
|
458
171
|
size: String,
|
|
459
|
-
sizePrefix:
|
|
460
|
-
type: String,
|
|
461
|
-
default() {
|
|
462
|
-
return this.$options.name;
|
|
463
|
-
}
|
|
464
|
-
}
|
|
172
|
+
sizePrefix: String
|
|
465
173
|
},
|
|
466
174
|
computed: {
|
|
467
175
|
sizeableClassPrefix() {
|
|
468
|
-
return this.sizePrefix
|
|
176
|
+
return this.sizePrefix || this.componentPrefix;
|
|
177
|
+
},
|
|
178
|
+
hasSizeablePrefix() {
|
|
179
|
+
return this.size && !!this.size.match(
|
|
180
|
+
new RegExp(`^${this.sizeableClassPrefix}`)
|
|
181
|
+
);
|
|
469
182
|
},
|
|
470
183
|
sizeableClass() {
|
|
471
|
-
|
|
472
|
-
return "";
|
|
473
|
-
}
|
|
474
|
-
return `${this.sizeableClassPrefix}-${this.size}`;
|
|
184
|
+
return this.size ? !this.sizeableClassPrefix || this.hasSizeablePrefix ? this.size : `${this.sizeableClassPrefix}-${this.size}` : "";
|
|
475
185
|
}
|
|
476
186
|
}
|
|
477
|
-
}
|
|
478
|
-
var Variant = {
|
|
187
|
+
}, J = {
|
|
479
188
|
props: {
|
|
189
|
+
componentPrefix: String,
|
|
480
190
|
variant: String,
|
|
481
|
-
variantPrefix:
|
|
482
|
-
type: String,
|
|
483
|
-
default() {
|
|
484
|
-
return this.$options.name && this.$options.name.toLowerCase();
|
|
485
|
-
}
|
|
486
|
-
}
|
|
191
|
+
variantPrefix: String
|
|
487
192
|
},
|
|
488
193
|
computed: {
|
|
489
194
|
variantClassPrefix() {
|
|
490
|
-
return this.variantPrefix;
|
|
195
|
+
return this.variantPrefix || this.componentPrefix;
|
|
196
|
+
},
|
|
197
|
+
hasVariantPrefix() {
|
|
198
|
+
return this.variant && !!this.variant.match(
|
|
199
|
+
new RegExp(`^${this.variantClassPrefix}`)
|
|
200
|
+
);
|
|
491
201
|
},
|
|
492
202
|
variantClass() {
|
|
493
|
-
|
|
494
|
-
return "";
|
|
495
|
-
}
|
|
496
|
-
return `${this.variantClassPrefix}-${this.variant}`;
|
|
203
|
+
return this.variant ? !this.variantClassPrefix || this.hasVariantPrefix ? this.variant : `${this.variantClassPrefix}-${this.variant}` : "";
|
|
497
204
|
}
|
|
498
205
|
}
|
|
499
|
-
}
|
|
500
|
-
var render$1 = function() {
|
|
501
|
-
var _vm = this;
|
|
502
|
-
var _h = _vm.$createElement;
|
|
503
|
-
var _c = _vm._self._c || _h;
|
|
504
|
-
return _c(_vm.component, { tag: "component", class: _vm.classes, attrs: { "disabled": _vm.disabled, "role": "button" }, on: { "click": function($event) {
|
|
505
|
-
!_vm.disabled && _vm.$emit("click", $event);
|
|
506
|
-
} } }, [_vm._t("default", function() {
|
|
507
|
-
return [_vm._v(_vm._s(_vm.label))];
|
|
508
|
-
})], 2);
|
|
509
|
-
};
|
|
510
|
-
var staticRenderFns$1 = [];
|
|
511
|
-
const __vue2_script$1 = {
|
|
206
|
+
}, K = {
|
|
512
207
|
name: "Btn",
|
|
513
208
|
mixins: [
|
|
514
|
-
|
|
515
|
-
|
|
209
|
+
X,
|
|
210
|
+
J
|
|
516
211
|
],
|
|
517
212
|
props: {
|
|
518
213
|
active: Boolean,
|
|
519
214
|
block: Boolean,
|
|
215
|
+
componentPrefix: {
|
|
216
|
+
type: String,
|
|
217
|
+
default: "btn"
|
|
218
|
+
},
|
|
520
219
|
disabled: Boolean,
|
|
521
220
|
label: String,
|
|
522
221
|
outline: Boolean,
|
|
@@ -538,72 +237,51 @@ const __vue2_script$1 = {
|
|
|
538
237
|
];
|
|
539
238
|
},
|
|
540
239
|
component() {
|
|
541
|
-
|
|
542
|
-
return this.tag;
|
|
543
|
-
}
|
|
544
|
-
if (this.$attrs.to) {
|
|
545
|
-
return "router-link";
|
|
546
|
-
}
|
|
547
|
-
if (this.$attrs.href) {
|
|
548
|
-
return "a";
|
|
549
|
-
}
|
|
550
|
-
return "button";
|
|
240
|
+
return this.tag ? this.tag : this.$attrs.href ? "a" : "button";
|
|
551
241
|
},
|
|
552
242
|
variantClassPrefix() {
|
|
553
|
-
return this.variantPrefix + (this.outline ? "-outline" : "");
|
|
243
|
+
return (this.variantPrefix || this.componentPrefix) + (this.outline ? "-outline" : "");
|
|
554
244
|
}
|
|
555
245
|
}
|
|
556
246
|
};
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
}
|
|
247
|
+
function Q(t, e, i, n, s, a) {
|
|
248
|
+
return c(), m(w(a.component), O(t.$attrs, {
|
|
249
|
+
disabled: i.disabled,
|
|
250
|
+
class: a.classes,
|
|
251
|
+
role: "button"
|
|
252
|
+
}), {
|
|
253
|
+
default: $(() => [
|
|
254
|
+
A(t.$slots, "default", {}, () => [
|
|
255
|
+
B(f(i.label), 1)
|
|
256
|
+
])
|
|
257
|
+
]),
|
|
258
|
+
_: 3
|
|
259
|
+
}, 16, ["disabled", "class"]);
|
|
563
260
|
}
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
var _vm = this;
|
|
570
|
-
var _h = _vm.$createElement;
|
|
571
|
-
var _c = _vm._self._c || _h;
|
|
572
|
-
return _c("btn", { class: _vm.classes, attrs: { "active": _vm.active, "block": _vm.block, "disabled": _vm.disabled, "size": _vm.size, "tag": _vm.tag, "variant": _vm.variant }, on: { "click": function(e) {
|
|
573
|
-
return !_vm.disabled && _vm.$emit("click", e, this$1$1);
|
|
574
|
-
} } }, [_vm._t("default", function() {
|
|
575
|
-
return [_vm._v(_vm._s(_vm.label))];
|
|
576
|
-
}), _c("activity-indicator", _vm._b({}, "activity-indicator", _vm.indicatorProps, false))], 2);
|
|
577
|
-
};
|
|
578
|
-
var staticRenderFns = [];
|
|
579
|
-
var BtnActivity_vue_vue_type_style_index_0_lang = "";
|
|
580
|
-
const convertAnimationDelayToInt = function(delay) {
|
|
581
|
-
const num = parseFloat(delay || 0, 10);
|
|
582
|
-
const matches = delay && delay.match(/m?s/);
|
|
583
|
-
const unit2 = matches ? matches[0] : false;
|
|
584
|
-
let milliseconds;
|
|
585
|
-
switch (unit2) {
|
|
261
|
+
const Y = /* @__PURE__ */ g(K, [["render", Q]]);
|
|
262
|
+
const tt = function(t) {
|
|
263
|
+
const e = parseFloat(t || 0, 10), i = t && t.match(/m?s/), n = i ? i[0] : !1;
|
|
264
|
+
let s;
|
|
265
|
+
switch (n) {
|
|
586
266
|
case "s":
|
|
587
|
-
|
|
267
|
+
s = e * 1e3;
|
|
588
268
|
break;
|
|
589
269
|
case "ms":
|
|
590
270
|
default:
|
|
591
|
-
|
|
271
|
+
s = e;
|
|
592
272
|
break;
|
|
593
273
|
}
|
|
594
|
-
return
|
|
595
|
-
}
|
|
596
|
-
const
|
|
597
|
-
const defaultView = (el.ownerDocument || document).defaultView;
|
|
274
|
+
return s || 0;
|
|
275
|
+
}, C = function(t, e) {
|
|
276
|
+
const i = (t.ownerDocument || document).defaultView;
|
|
598
277
|
setTimeout(() => {
|
|
599
|
-
|
|
600
|
-
},
|
|
601
|
-
}
|
|
602
|
-
const __vue2_script = {
|
|
278
|
+
e.apply();
|
|
279
|
+
}, tt(i.getComputedStyle(t).animationDuration));
|
|
280
|
+
}, et = {
|
|
603
281
|
name: "BtnActivity",
|
|
604
282
|
components: {
|
|
605
|
-
ActivityIndicator,
|
|
606
|
-
Btn
|
|
283
|
+
ActivityIndicator: U,
|
|
284
|
+
Btn: Y
|
|
607
285
|
},
|
|
608
286
|
props: {
|
|
609
287
|
active: Boolean,
|
|
@@ -636,80 +314,73 @@ const __vue2_script = {
|
|
|
636
314
|
},
|
|
637
315
|
computed: {
|
|
638
316
|
classes() {
|
|
639
|
-
const
|
|
640
|
-
|
|
641
|
-
|
|
317
|
+
const t = {
|
|
318
|
+
disabled: this.disabled,
|
|
319
|
+
active: this.active,
|
|
642
320
|
"btn-activity": this.activity
|
|
643
321
|
};
|
|
644
|
-
|
|
645
|
-
classes["btn-activity-indicator-" + this.indicatorProps.type.replace("btn-activity-indicator-", "")] = !!this.indicatorProps.type;
|
|
646
|
-
return classes;
|
|
322
|
+
return t["btn-activity-" + this.orientation.replace("btn-activity-", "")] = !!this.orientation, t["btn-activity-indicator-" + this.indicatorProps.type.replace("btn-activity-indicator-", "")] = !!this.indicatorProps.type, t;
|
|
647
323
|
},
|
|
648
324
|
indicatorProps() {
|
|
649
325
|
return Object.assign({
|
|
650
326
|
type: "spinner"
|
|
651
|
-
}, (typeof this.indicator
|
|
327
|
+
}, (typeof this.indicator == "string" ? {
|
|
652
328
|
type: this.indicator
|
|
653
329
|
} : this.indicator) || {});
|
|
654
330
|
}
|
|
655
331
|
},
|
|
656
332
|
watch: {
|
|
657
|
-
activity(
|
|
658
|
-
|
|
659
|
-
this.showActivity();
|
|
660
|
-
} else {
|
|
661
|
-
this.hideActivity();
|
|
662
|
-
}
|
|
333
|
+
activity(t) {
|
|
334
|
+
t ? this.showActivity() : this.hideActivity();
|
|
663
335
|
}
|
|
664
336
|
},
|
|
665
337
|
mounted() {
|
|
666
|
-
|
|
667
|
-
this.showActivity();
|
|
668
|
-
}
|
|
338
|
+
this.activity && this.showActivity();
|
|
669
339
|
},
|
|
670
340
|
methods: {
|
|
671
341
|
disable() {
|
|
672
|
-
this.$el.disabled =
|
|
673
|
-
this.$el.classList.add("disabled");
|
|
342
|
+
this.$el.disabled = !0, this.$el.classList.add("disabled");
|
|
674
343
|
},
|
|
675
344
|
enable() {
|
|
676
|
-
this.$el.disabled =
|
|
677
|
-
this.$el.classList.remove("disabled");
|
|
345
|
+
this.$el.disabled = !1, this.$el.classList.remove("disabled");
|
|
678
346
|
},
|
|
679
347
|
hideActivity() {
|
|
680
|
-
this.$el.classList.add("btn-hide-activity")
|
|
681
|
-
|
|
682
|
-
this.enable();
|
|
683
|
-
this.currentActivity = false;
|
|
684
|
-
this.$el.classList.remove("btn-activity", "btn-hide-activity");
|
|
685
|
-
this.$emit("hide-activity");
|
|
348
|
+
this.$el.classList.add("btn-hide-activity"), C(this.$el, () => {
|
|
349
|
+
this.enable(), this.currentActivity = !1, this.$el.classList.remove("btn-activity", "btn-hide-activity"), this.$emit("hide-activity");
|
|
686
350
|
});
|
|
687
351
|
},
|
|
688
352
|
showActivity() {
|
|
689
|
-
this.currentActivity =
|
|
690
|
-
|
|
691
|
-
animated(this.$el, () => {
|
|
692
|
-
this.$el.classList.add("btn-activity");
|
|
693
|
-
this.$emit("show-activity");
|
|
353
|
+
this.currentActivity = !0, this.disable(), C(this.$el, () => {
|
|
354
|
+
this.$el.classList.add("btn-activity"), this.$emit("show-activity");
|
|
694
355
|
});
|
|
695
356
|
},
|
|
696
357
|
toggle() {
|
|
697
|
-
|
|
698
|
-
this.showActivity();
|
|
699
|
-
} else {
|
|
700
|
-
this.hideActivity();
|
|
701
|
-
}
|
|
358
|
+
this.currentActivity ? this.hideActivity() : this.showActivity();
|
|
702
359
|
}
|
|
703
360
|
}
|
|
704
361
|
};
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
362
|
+
function it(t, e, i, n, s, a) {
|
|
363
|
+
const o = x("activity-indicator"), _ = x("btn");
|
|
364
|
+
return c(), m(_, {
|
|
365
|
+
active: i.active,
|
|
366
|
+
block: i.block,
|
|
367
|
+
disabled: i.disabled,
|
|
368
|
+
size: i.size,
|
|
369
|
+
tag: i.tag,
|
|
370
|
+
variant: i.variant,
|
|
371
|
+
class: z(a.classes),
|
|
372
|
+
onClick: e[0] || (e[0] = (l) => !i.disabled && t.$emit("click", l, this))
|
|
373
|
+
}, {
|
|
374
|
+
default: $(() => [
|
|
375
|
+
A(t.$slots, "default", {}, () => [
|
|
376
|
+
B(f(i.label), 1)
|
|
377
|
+
]),
|
|
378
|
+
D(o, L(j(a.indicatorProps)), null, 16)
|
|
379
|
+
]),
|
|
380
|
+
_: 3
|
|
381
|
+
}, 8, ["active", "block", "disabled", "size", "tag", "variant", "class"]);
|
|
711
382
|
}
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
383
|
+
const st = /* @__PURE__ */ g(et, [["render", it]]);
|
|
384
|
+
export {
|
|
385
|
+
st as BtnActivity
|
|
386
|
+
};
|
package/dist/btn-activity.umd.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var p=function(){return p=Object.assign||function(i){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])}return i},p.apply(this,arguments)};function W(t){return t.toLowerCase()}var Z=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],H=/[^A-Z0-9]+/gi;function U(t,e){e===void 0&&(e={});for(var i=e.splitRegexp,n=i===void 0?Z:i,r=e.stripRegexp,o=r===void 0?H:r,s=e.transform,u=s===void 0?W:s,a=e.delimiter,c=a===void 0?" ":a,f=C(C(t,n,"$1\0$2"),o,"\0"),_=0,l=f.length;f.charAt(_)==="\0";)_++;for(;f.charAt(l-1)==="\0";)l--;return f.slice(_,l).split("\0").map(u).join(c)}function C(t,e,i){return e instanceof RegExp?t.replace(e,i):e.reduce(function(n,r){return n.replace(r,i)},t)}function M(t,e){return e===void 0&&(e={}),U(t,p({delimiter:"."},e))}function m(t,e){return e===void 0&&(e={}),M(t,p({delimiter:"-"},e))}var P=function(){function t(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};B(this,t),this.components={},Object.entries(i).forEach(function(n){var r=x(n,2),o=r[0],s=r[1];e.register(o,s)})}return j(t,[{key:"get",value:function(i){var n=this.components[i=m(i)];if(n)return n;throw new Error('"'.concat(i,'" has not been registered yet!'))}},{key:"register",value:function(i,n){var r=this;return v(i)==="object"?(Object.entries(i).forEach(function(o){var s=x(o,2),u=s[0],a=s[1];r.register(m(u),a)}),this):(this.components[m(i)]=n,this)}},{key:"remove",value:function(i){return delete this.components[m(i)],this}},{key:"reset",value:function(){return this.components={},this}}]),t}();function X(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return y(P,e)}const w=X();var G=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"activity-indicator",class:t.classes,style:t.style},[i("div",{staticClass:"activity-indicator-content"},[i(t.component,{tag:"component",staticClass:"mx-auto"}),t.label?i("div",{staticClass:"activity-indicator-label"},[t._v(" "+t._s(t.label)+" ")]):t._e()],1)])},V=[],$t="";function $(t,e,i,n,r,o,s,u){var a=typeof t=="function"?t.options:t;e&&(a.render=e,a.staticRenderFns=i,a._compiled=!0),n&&(a.functional=!0),o&&(a._scopeId="data-v-"+o);var c;if(s?(c=function(l){l=l||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!l&&typeof __VUE_SSR_CONTEXT__!="undefined"&&(l=__VUE_SSR_CONTEXT__),r&&r.call(this,l),l&&l._registeredComponents&&l._registeredComponents.add(s)},a._ssrRegister=c):r&&(c=u?function(){r.call(this,(a.functional?this.parent:this).$root.$options.shadowRoot)}:r),c)if(a.functional){a._injectStyles=c;var f=a.render;a.render=function(bt,k){return c.call(k),f(bt,k)}}else{var _=a.beforeCreate;a.beforeCreate=_?[].concat(_,c):[c]}return{exports:t,options:a}}function h(t,e="px"){return t!=null&&t!==!1&&isFinite(t)?`${t}${e}`:t}const q={name:"ActivityIndicator",props:{absolute:Boolean,center:Boolean,label:String,size:{type:String,default:"md"},registry:{type:P,default(){return w}},type:{type:String,required:!0},height:[String,Number],maxHeight:[String,Number],minHeight:[String,Number],width:[String,Number],maxWidth:[String,Number],minWidth:[String,Number]},computed:{classes(){return{"activity-indicator-center":this.center,"activity-indicator-absolute":this.absolute,[this.size&&`activity-indicator-${this.size}`]:!!this.size}},style(){return{width:h(this.width),maxWidth:h(this.maxWidth),minWidth:h(this.minWidth),height:h(this.height),maxHeight:h(this.maxHeight),minHeight:h(this.minHeight)}},component(){return()=>{const t=w.get(this.type);return t instanceof Promise?t:typeof t=="function"?t():Promise.resolve(t)}}}},R={};var J=$(q,G,V,!1,K,null,null,null);function K(t){for(let e in R)this[e]=R[e]}var Q=function(){return J.exports}(),St="",xt="",At="",Ct="",Pt="",wt="",Rt="",zt="",Ot="",Tt="",Et="",kt="",Bt="",jt="";/*! *****************************************************************************
|
|
1
|
+
(function(o,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(o=typeof globalThis<"u"?globalThis:o||self,n(o.BtnActivity={},o.Vue))})(this,function(o,n){"use strict";/*! *****************************************************************************
|
|
3
2
|
Copyright (c) Microsoft Corporation.
|
|
4
3
|
|
|
5
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -12,4 +11,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
12
11
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
12
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
13
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */var
|
|
14
|
+
***************************************************************************** */var l=function(){return l=Object.assign||function(e){for(var i,s=1,a=arguments.length;s<a;s++){i=arguments[s];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},l.apply(this,arguments)};function S(t){return t.toLowerCase()}var P=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],C=/[^A-Z0-9]+/gi;function z(t,e){e===void 0&&(e={});for(var i=e.splitRegexp,s=i===void 0?P:i,a=e.stripRegexp,r=a===void 0?C:a,h=e.transform,m=h===void 0?S:h,_=e.delimiter,F=_===void 0?" ":_,u=v(v(t,s,"$1\0$2"),r,"\0"),y=0,p=u.length;u.charAt(y)==="\0";)y++;for(;u.charAt(p-1)==="\0";)p--;return u.slice(y,p).split("\0").map(m).join(F)}function v(t,e,i){return e instanceof RegExp?t.replace(e,i):e.reduce(function(s,a){return s.replace(a,i)},t)}function $(t,e){return e===void 0&&(e={}),z(t,l({delimiter:"."},e))}function d(t,e){return e===void 0&&(e={}),$(t,l({delimiter:"-"},e))}class g{constructor(e={}){this.components=new Map,Object.entries(e).forEach(([i,s])=>{this.register(i,s)})}get(e){const i=this.components.get(e=d(e));if(i)return i;throw new Error(`"${e}" has not been registered yet!`)}register(e,i){return typeof e=="object"?(Object.entries(e).forEach(([s,a])=>{this.register(d(s),a)}),this):(this.components.set(d(e),i),this)}remove(e){return this.components.delete(d(e)),this}reset(){return this.components=new Map,this}}function w(...t){return new g(...t)}const b=w(),H="",f=(t,e)=>{const i=t.__vccOpts||t;for(const[s,a]of e)i[s]=a;return i};function c(t,e="px"){return t!=null&&t!==!1&&isFinite(t)?`${t}${e}`:t}const A={name:"ActivityIndicator",props:{absolute:Boolean,center:Boolean,label:String,size:{type:String,default:"md"},registry:{type:g,default(){return b}},type:{type:String,required:!0},height:[String,Number],maxHeight:[String,Number],minHeight:[String,Number],width:[String,Number],maxWidth:[String,Number],minWidth:[String,Number]},data:()=>({is:null}),computed:{classes(){return{"activity-indicator-center":this.center,"activity-indicator-absolute":this.absolute,[this.size&&`activity-indicator-${this.size}`]:!!this.size}},style(){return{width:c(this.width),maxWidth:c(this.maxWidth),minWidth:c(this.minWidth),height:c(this.height),maxHeight:c(this.maxHeight),minHeight:c(this.minHeight)}}},async mounted(){const t=await this.component();this.is=()=>t},methods:{async component(){let t=b.get(this.type);return t instanceof Promise?t:(typeof t=="function"&&(t=await t()),t.default?t.default:t)}}},B={class:"activity-indicator-content"},k={key:1,class:"activity-indicator-label"};function E(t,e,i,s,a,r){return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["activity-indicator",r.classes]),style:n.normalizeStyle(r.style)},[n.createElementVNode("div",B,[t.is?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(t.is()),{key:0,class:"mx-auto"})):n.createCommentVNode("",!0),i.label?(n.openBlock(),n.createElementBlock("div",k,n.toDisplayString(i.label),1)):n.createCommentVNode("",!0)])],6)}const D=f(A,[["render",E]]),I="",W="",q="",M="",Z="",G="",U="",X="",J="",K="",Q="",Y="",tt="",et="",N={name:"Btn",mixins:[{props:{componentPrefix:String,size:String,sizePrefix:String},computed:{sizeableClassPrefix(){return this.sizePrefix||this.componentPrefix},hasSizeablePrefix(){return this.size&&!!this.size.match(new RegExp(`^${this.sizeableClassPrefix}`))},sizeableClass(){return this.size?!this.sizeableClassPrefix||this.hasSizeablePrefix?this.size:`${this.sizeableClassPrefix}-${this.size}`:""}}},{props:{componentPrefix:String,variant:String,variantPrefix:String},computed:{variantClassPrefix(){return this.variantPrefix||this.componentPrefix},hasVariantPrefix(){return this.variant&&!!this.variant.match(new RegExp(`^${this.variantClassPrefix}`))},variantClass(){return this.variant?!this.variantClassPrefix||this.hasVariantPrefix?this.variant:`${this.variantClassPrefix}-${this.variant}`:""}}}],props:{active:Boolean,block:Boolean,componentPrefix:{type:String,default:"btn"},disabled:Boolean,label:String,outline:Boolean,tag:String,variant:{type:String,default:"primary"}},computed:{classes(){return["btn",this.variantClass,this.sizeableClass,this.active&&"active",this.block&&"btn-block",this.disabled&&"disabled"]},component(){return this.tag?this.tag:this.$attrs.href?"a":"button"},variantClassPrefix(){return(this.variantPrefix||this.componentPrefix)+(this.outline?"-outline":"")}}};function R(t,e,i,s,a,r){return n.openBlock(),n.createBlock(n.resolveDynamicComponent(r.component),n.mergeProps(t.$attrs,{disabled:i.disabled,class:r.classes,role:"button"}),{default:n.withCtx(()=>[n.renderSlot(t.$slots,"default",{},()=>[n.createTextVNode(n.toDisplayString(i.label),1)])]),_:3},16,["disabled","class"])}const T=f(N,[["render",R]]),st="",O=function(t){const e=parseFloat(t||0,10),i=t&&t.match(/m?s/),s=i?i[0]:!1;let a;switch(s){case"s":a=e*1e3;break;case"ms":default:a=e;break}return a||0},x=function(t,e){const i=(t.ownerDocument||document).defaultView;setTimeout(()=>{e.apply()},O(i.getComputedStyle(t).animationDuration))},V={name:"BtnActivity",components:{ActivityIndicator:D,Btn:T},props:{active:Boolean,activity:Boolean,block:Boolean,disabled:Boolean,indicator:{type:[Object,String],default:"spinner"},label:String,orientation:{type:String,default:"right"},size:{type:String,default:"md"},tag:String,variant:{type:String,default:"primary"}},data(){return{currentActivity:this.activity}},computed:{classes(){const t={disabled:this.disabled,active:this.active,"btn-activity":this.activity};return t["btn-activity-"+this.orientation.replace("btn-activity-","")]=!!this.orientation,t["btn-activity-indicator-"+this.indicatorProps.type.replace("btn-activity-indicator-","")]=!!this.indicatorProps.type,t},indicatorProps(){return Object.assign({type:"spinner"},(typeof this.indicator=="string"?{type:this.indicator}:this.indicator)||{})}},watch:{activity(t){t?this.showActivity():this.hideActivity()}},mounted(){this.activity&&this.showActivity()},methods:{disable(){this.$el.disabled=!0,this.$el.classList.add("disabled")},enable(){this.$el.disabled=!1,this.$el.classList.remove("disabled")},hideActivity(){this.$el.classList.add("btn-hide-activity"),x(this.$el,()=>{this.enable(),this.currentActivity=!1,this.$el.classList.remove("btn-activity","btn-hide-activity"),this.$emit("hide-activity")})},showActivity(){this.currentActivity=!0,this.disable(),x(this.$el,()=>{this.$el.classList.add("btn-activity"),this.$emit("show-activity")})},toggle(){this.currentActivity?this.hideActivity():this.showActivity()}}};function j(t,e,i,s,a,r){const h=n.resolveComponent("activity-indicator"),m=n.resolveComponent("btn");return n.openBlock(),n.createBlock(m,{active:i.active,block:i.block,disabled:i.disabled,size:i.size,tag:i.tag,variant:i.variant,class:n.normalizeClass(r.classes),onClick:e[0]||(e[0]=_=>!i.disabled&&t.$emit("click",_,this))},{default:n.withCtx(()=>[n.renderSlot(t.$slots,"default",{},()=>[n.createTextVNode(n.toDisplayString(i.label),1)]),n.createVNode(h,n.normalizeProps(n.guardReactiveProps(r.indicatorProps)),null,16)]),_:3},8,["active","block","disabled","size","tag","variant","class"])}const L=f(V,[["render",j]]);o.BtnActivity=L,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-interface/btn-activity",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-beta.1",
|
|
4
4
|
"description": "A Vue activity button component.",
|
|
5
5
|
"files": [
|
|
6
6
|
"index.js",
|
|
@@ -39,22 +39,22 @@
|
|
|
39
39
|
},
|
|
40
40
|
"homepage": "https://github.com/vue-interface/btn-activity/docs#readme",
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@vue-interface/activity-indicator": "^
|
|
43
|
-
"@vue-interface/btn": "^
|
|
44
|
-
"vue": "^2.6.14"
|
|
42
|
+
"@vue-interface/activity-indicator": "^2.0.0-beta.0",
|
|
43
|
+
"@vue-interface/btn": "^3.0.0-beta.1"
|
|
45
44
|
},
|
|
46
45
|
"devDependencies": {
|
|
47
|
-
"@rollup/plugin-babel": "^
|
|
46
|
+
"@rollup/plugin-babel": "^6.0.0",
|
|
47
|
+
"@vitejs/plugin-vue": "^3.1.2",
|
|
48
48
|
"autoprefixer": "^10.4.2",
|
|
49
49
|
"babel-eslint": "^10.1.0",
|
|
50
50
|
"babel-preset-vue": "^2.0.2",
|
|
51
51
|
"change-case": "^4.1.2",
|
|
52
|
-
"eslint": "^
|
|
53
|
-
"eslint-plugin-vue": "^6.
|
|
52
|
+
"eslint": "^8.25.0",
|
|
53
|
+
"eslint-plugin-vue": "^9.6.0",
|
|
54
54
|
"pascalcase": "^2.0.0",
|
|
55
55
|
"postcss": "^8.4.6",
|
|
56
56
|
"tailwindcss": "^3.0.18",
|
|
57
|
-
"vite": "^
|
|
58
|
-
"
|
|
57
|
+
"vite": "^3.1.7",
|
|
58
|
+
"vue": "^3.2.40"
|
|
59
59
|
}
|
|
60
60
|
}
|