@vue-interface/btn-activity 1.1.0 → 2.0.0-beta.0
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 +170 -605
- package/dist/btn-activity.umd.js +2 -3
- package/package.json +9 -9
- package/src/BtnActivity.vue +51 -65
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 d, normalizeClass as m, normalizeStyle as $, createElementVNode as k, createBlock as P, resolveDynamicComponent as z, createCommentVNode as p, toDisplayString as S, resolveComponent as B, createTextVNode as E, renderSlot as D, createVNode as N, normalizeProps as O, guardReactiveProps as R } 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 u = function() {
|
|
17
|
+
return u = Object.assign || function(e) {
|
|
18
|
+
for (var i, n = 1, s = arguments.length; n < s; n++) {
|
|
19
|
+
i = arguments[n];
|
|
20
|
+
for (var r in i)
|
|
21
|
+
Object.prototype.hasOwnProperty.call(i, r) && (e[r] = i[r]);
|
|
138
22
|
}
|
|
139
|
-
return
|
|
140
|
-
};
|
|
141
|
-
return _assign.apply(this, arguments);
|
|
23
|
+
return e;
|
|
24
|
+
}, u.apply(this, arguments);
|
|
142
25
|
};
|
|
143
|
-
function
|
|
144
|
-
return
|
|
26
|
+
function j(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 T = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g], F = /[^A-Z0-9]+/gi;
|
|
30
|
+
function L(t, e) {
|
|
31
|
+
e === void 0 && (e = {});
|
|
32
|
+
for (var i = e.splitRegexp, n = i === void 0 ? T : i, s = e.stripRegexp, r = s === void 0 ? F : s, o = e.transform, h = o === void 0 ? j : o, g = e.delimiter, C = g === void 0 ? " " : g, l = f(f(t, n, "$1\0$2"), r, "\0"), y = 0, v = l.length; l.charAt(y) === "\0"; )
|
|
33
|
+
y++;
|
|
34
|
+
for (; l.charAt(v - 1) === "\0"; )
|
|
35
|
+
v--;
|
|
36
|
+
return l.slice(y, v).split("\0").map(h).join(C);
|
|
163
37
|
}
|
|
164
|
-
function
|
|
165
|
-
|
|
166
|
-
return
|
|
167
|
-
|
|
168
|
-
return input2.replace(re2, value);
|
|
169
|
-
}, input);
|
|
38
|
+
function f(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 H(t, e) {
|
|
44
|
+
return e === void 0 && (e = {}), L(t, u({
|
|
176
45
|
delimiter: "."
|
|
177
|
-
},
|
|
46
|
+
}, e));
|
|
178
47
|
}
|
|
179
|
-
function
|
|
180
|
-
|
|
181
|
-
options = {};
|
|
182
|
-
}
|
|
183
|
-
return dotCase$1(input, _assign({
|
|
48
|
+
function _(t, e) {
|
|
49
|
+
return e === void 0 && (e = {}), H(t, u({
|
|
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 w {
|
|
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 = _(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;
|
|
257
|
-
}
|
|
258
|
-
if (functionalTemplate) {
|
|
259
|
-
options.functional = true;
|
|
65
|
+
register(e, i) {
|
|
66
|
+
return typeof e == "object" ? (Object.entries(e).forEach(([n, s]) => {
|
|
67
|
+
this.register(_(n), s);
|
|
68
|
+
}), this) : (this.components.set(_(e), i), this);
|
|
260
69
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
}
|
|
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;
|
|
70
|
+
remove(e) {
|
|
71
|
+
return this.components.delete(_(e)), this;
|
|
283
72
|
}
|
|
284
|
-
|
|
285
|
-
|
|
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
|
-
}
|
|
73
|
+
reset() {
|
|
74
|
+
return this.components = /* @__PURE__ */ new Map(), this;
|
|
296
75
|
}
|
|
297
|
-
return {
|
|
298
|
-
exports: scriptExports,
|
|
299
|
-
options
|
|
300
|
-
};
|
|
301
76
|
}
|
|
302
|
-
function
|
|
303
|
-
return
|
|
77
|
+
function I(...t) {
|
|
78
|
+
return new w(...t);
|
|
79
|
+
}
|
|
80
|
+
const b = I();
|
|
81
|
+
const A = (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 a(t, e = "px") {
|
|
88
|
+
return t != null && t !== !1 && isFinite(t) ? `${t}${e}` : t;
|
|
304
89
|
}
|
|
305
|
-
const
|
|
90
|
+
const V = {
|
|
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: w,
|
|
317
102
|
default() {
|
|
318
|
-
return
|
|
103
|
+
return b;
|
|
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,377 +127,154 @@ 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: a(this.width),
|
|
131
|
+
maxWidth: a(this.maxWidth),
|
|
132
|
+
minWidth: a(this.minWidth),
|
|
133
|
+
height: a(this.height),
|
|
134
|
+
maxHeight: a(this.maxHeight),
|
|
135
|
+
minHeight: a(this.minHeight)
|
|
360
136
|
};
|
|
361
137
|
}
|
|
362
|
-
}
|
|
363
|
-
};
|
|
364
|
-
const __cssModules$2 = {};
|
|
365
|
-
var __component__$2 = /* @__PURE__ */ normalizeComponent(__vue2_script$2, render$2, staticRenderFns$2, false, __vue2_injectStyles$2, null, null, null);
|
|
366
|
-
function __vue2_injectStyles$2(context) {
|
|
367
|
-
for (let o in __cssModules$2) {
|
|
368
|
-
this[o] = __cssModules$2[o];
|
|
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];
|
|
409
|
-
}
|
|
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
|
-
}
|
|
444
|
-
return noCase(input, __assign2({
|
|
445
|
-
delimiter: "."
|
|
446
|
-
}, options));
|
|
447
|
-
}
|
|
448
|
-
function paramCase(input, options) {
|
|
449
|
-
if (options === void 0) {
|
|
450
|
-
options = {};
|
|
451
|
-
}
|
|
452
|
-
return dotCase(input, __assign2({
|
|
453
|
-
delimiter: "-"
|
|
454
|
-
}, options));
|
|
455
|
-
}
|
|
456
|
-
var Sizeable = {
|
|
457
|
-
props: {
|
|
458
|
-
size: String,
|
|
459
|
-
sizePrefix: {
|
|
460
|
-
type: String,
|
|
461
|
-
default() {
|
|
462
|
-
return this.$options.name;
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
138
|
},
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
},
|
|
470
|
-
sizeableClass() {
|
|
471
|
-
if (!this.size || !this.sizeableClassPrefix) {
|
|
472
|
-
return "";
|
|
473
|
-
}
|
|
474
|
-
return `${this.sizeableClassPrefix}-${this.size}`;
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
};
|
|
478
|
-
var Variant = {
|
|
479
|
-
props: {
|
|
480
|
-
variant: String,
|
|
481
|
-
variantPrefix: {
|
|
482
|
-
type: String,
|
|
483
|
-
default() {
|
|
484
|
-
return this.$options.name && this.$options.name.toLowerCase();
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
},
|
|
488
|
-
computed: {
|
|
489
|
-
variantClassPrefix() {
|
|
490
|
-
return this.variantPrefix;
|
|
491
|
-
},
|
|
492
|
-
variantClass() {
|
|
493
|
-
if (!this.variant || !this.variantClassPrefix) {
|
|
494
|
-
return "";
|
|
495
|
-
}
|
|
496
|
-
return `${this.variantClassPrefix}-${this.variant}`;
|
|
497
|
-
}
|
|
498
|
-
}
|
|
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 = {
|
|
512
|
-
name: "Btn",
|
|
513
|
-
mixins: [
|
|
514
|
-
Sizeable,
|
|
515
|
-
Variant
|
|
516
|
-
],
|
|
517
|
-
props: {
|
|
518
|
-
active: Boolean,
|
|
519
|
-
block: Boolean,
|
|
520
|
-
disabled: Boolean,
|
|
521
|
-
label: String,
|
|
522
|
-
outline: Boolean,
|
|
523
|
-
tag: String,
|
|
524
|
-
variant: {
|
|
525
|
-
type: String,
|
|
526
|
-
default: "primary"
|
|
527
|
-
}
|
|
139
|
+
async mounted() {
|
|
140
|
+
const t = await this.component();
|
|
141
|
+
this.is = () => t;
|
|
528
142
|
},
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
this.variantClass,
|
|
534
|
-
this.sizeableClass,
|
|
535
|
-
this.active && "active",
|
|
536
|
-
this.block && "btn-block",
|
|
537
|
-
this.disabled && "disabled"
|
|
538
|
-
];
|
|
539
|
-
},
|
|
540
|
-
component() {
|
|
541
|
-
if (this.tag) {
|
|
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";
|
|
551
|
-
},
|
|
552
|
-
variantClassPrefix() {
|
|
553
|
-
return this.variantPrefix + (this.outline ? "-outline" : "");
|
|
143
|
+
methods: {
|
|
144
|
+
async component() {
|
|
145
|
+
let t = b.get(this.type);
|
|
146
|
+
return t instanceof Promise ? t : (typeof t == "function" && (t = await t()), t.default ? t.default : t);
|
|
554
147
|
}
|
|
555
148
|
}
|
|
149
|
+
}, W = { class: "activity-indicator-content" }, q = {
|
|
150
|
+
key: 1,
|
|
151
|
+
class: "activity-indicator-label"
|
|
556
152
|
};
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
153
|
+
function Z(t, e, i, n, s, r) {
|
|
154
|
+
return c(), d("div", {
|
|
155
|
+
class: m(["activity-indicator", r.classes]),
|
|
156
|
+
style: $(r.style)
|
|
157
|
+
}, [
|
|
158
|
+
k("div", W, [
|
|
159
|
+
t.is ? (c(), P(z(t.is()), {
|
|
160
|
+
key: 0,
|
|
161
|
+
class: "mx-auto"
|
|
162
|
+
})) : p("", !0),
|
|
163
|
+
i.label ? (c(), d("div", q, S(i.label), 1)) : p("", !0)
|
|
164
|
+
])
|
|
165
|
+
], 6);
|
|
563
166
|
}
|
|
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) {
|
|
167
|
+
const G = /* @__PURE__ */ A(V, [["render", Z]]);
|
|
168
|
+
const M = function(t) {
|
|
169
|
+
const e = parseFloat(t || 0, 10), i = t && t.match(/m?s/), n = i ? i[0] : !1;
|
|
170
|
+
let s;
|
|
171
|
+
switch (n) {
|
|
586
172
|
case "s":
|
|
587
|
-
|
|
173
|
+
s = e * 1e3;
|
|
588
174
|
break;
|
|
589
175
|
case "ms":
|
|
590
176
|
default:
|
|
591
|
-
|
|
177
|
+
s = e;
|
|
592
178
|
break;
|
|
593
179
|
}
|
|
594
|
-
return
|
|
595
|
-
}
|
|
596
|
-
const
|
|
597
|
-
const defaultView = (el.ownerDocument || document).defaultView;
|
|
180
|
+
return s || 0;
|
|
181
|
+
}, x = function(t, e) {
|
|
182
|
+
const i = (t.ownerDocument || document).defaultView;
|
|
598
183
|
setTimeout(() => {
|
|
599
|
-
|
|
600
|
-
},
|
|
601
|
-
}
|
|
602
|
-
const __vue2_script = {
|
|
184
|
+
e.apply();
|
|
185
|
+
}, M(i.getComputedStyle(t).animationDuration));
|
|
186
|
+
}, U = {
|
|
603
187
|
name: "BtnActivity",
|
|
604
188
|
components: {
|
|
605
|
-
ActivityIndicator
|
|
606
|
-
Btn
|
|
189
|
+
ActivityIndicator: G
|
|
607
190
|
},
|
|
608
191
|
props: {
|
|
609
192
|
active: Boolean,
|
|
610
193
|
activity: Boolean,
|
|
611
194
|
block: Boolean,
|
|
612
195
|
disabled: Boolean,
|
|
613
|
-
indicator: {
|
|
614
|
-
type: [Object, String],
|
|
615
|
-
default: "spinner"
|
|
616
|
-
},
|
|
617
196
|
label: String,
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
default: "right"
|
|
621
|
-
},
|
|
197
|
+
icon: String,
|
|
198
|
+
type: String,
|
|
622
199
|
size: {
|
|
623
200
|
type: String,
|
|
624
201
|
default: "md"
|
|
625
202
|
},
|
|
626
|
-
tag: String,
|
|
627
203
|
variant: {
|
|
628
204
|
type: String,
|
|
629
205
|
default: "primary"
|
|
206
|
+
},
|
|
207
|
+
indicator: {
|
|
208
|
+
type: [Object, String],
|
|
209
|
+
default: "spinner"
|
|
210
|
+
},
|
|
211
|
+
orientation: {
|
|
212
|
+
type: String,
|
|
213
|
+
default: "right"
|
|
630
214
|
}
|
|
631
215
|
},
|
|
632
|
-
data() {
|
|
633
|
-
return {
|
|
634
|
-
currentActivity: this.activity
|
|
635
|
-
};
|
|
636
|
-
},
|
|
637
216
|
computed: {
|
|
638
217
|
classes() {
|
|
639
|
-
const
|
|
640
|
-
|
|
641
|
-
|
|
218
|
+
const t = {
|
|
219
|
+
disabled: this.disabled,
|
|
220
|
+
active: this.active,
|
|
221
|
+
"btn-block": this.block,
|
|
642
222
|
"btn-activity": this.activity
|
|
643
223
|
};
|
|
644
|
-
|
|
645
|
-
classes["btn-activity-indicator-" + this.indicatorProps.type.replace("btn-activity-indicator-", "")] = !!this.indicatorProps.type;
|
|
646
|
-
return classes;
|
|
224
|
+
return t["btn-" + this.size.replace("btn-", "")] = !!this.size, t["btn-" + this.variant.replace("btn-", "")] = !!this.variant, 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
225
|
},
|
|
648
226
|
indicatorProps() {
|
|
649
227
|
return Object.assign({
|
|
650
228
|
type: "spinner"
|
|
651
|
-
}, (typeof this.indicator
|
|
229
|
+
}, (typeof this.indicator == "string" ? {
|
|
652
230
|
type: this.indicator
|
|
653
231
|
} : this.indicator) || {});
|
|
654
232
|
}
|
|
655
233
|
},
|
|
656
234
|
watch: {
|
|
657
|
-
activity(
|
|
658
|
-
|
|
659
|
-
this.showActivity();
|
|
660
|
-
} else {
|
|
661
|
-
this.hideActivity();
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
},
|
|
665
|
-
mounted() {
|
|
666
|
-
if (this.activity) {
|
|
667
|
-
this.showActivity();
|
|
235
|
+
activity(t) {
|
|
236
|
+
t ? this.showActivity() : this.hideActivity();
|
|
668
237
|
}
|
|
669
238
|
},
|
|
670
239
|
methods: {
|
|
671
240
|
disable() {
|
|
672
|
-
this.$el.disabled =
|
|
673
|
-
this.$el.classList.add("disabled");
|
|
241
|
+
this.$el.disabled = !0;
|
|
674
242
|
},
|
|
675
243
|
enable() {
|
|
676
|
-
this.$el.disabled =
|
|
677
|
-
this.$el.classList.remove("disabled");
|
|
244
|
+
this.$el.disabled = !1;
|
|
678
245
|
},
|
|
679
|
-
|
|
680
|
-
this.$el
|
|
681
|
-
|
|
682
|
-
this.enable();
|
|
683
|
-
this.currentActivity = false;
|
|
684
|
-
this.$el.classList.remove("btn-activity", "btn-hide-activity");
|
|
685
|
-
this.$emit("hide-activity");
|
|
246
|
+
showActivity() {
|
|
247
|
+
this.disable(), x(this.$el, () => {
|
|
248
|
+
this.$el.classList.add("btn-activity"), this.$emit("show-activity");
|
|
686
249
|
});
|
|
687
250
|
},
|
|
688
|
-
|
|
689
|
-
this.
|
|
690
|
-
|
|
691
|
-
animated(this.$el, () => {
|
|
692
|
-
this.$el.classList.add("btn-activity");
|
|
693
|
-
this.$emit("show-activity");
|
|
251
|
+
hideActivity() {
|
|
252
|
+
this.$el.classList.add("btn-hide-activity"), x(this.$el, () => {
|
|
253
|
+
this.enable(), this.$el.classList.remove("btn-activity", "btn-hide-activity"), this.$emit("hide-activity");
|
|
694
254
|
});
|
|
695
255
|
},
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
this.showActivity();
|
|
699
|
-
} else {
|
|
700
|
-
this.hideActivity();
|
|
701
|
-
}
|
|
256
|
+
onClick(t) {
|
|
257
|
+
this.disabled ? t.preventDefault() : this.$emit("click", t);
|
|
702
258
|
}
|
|
703
259
|
}
|
|
704
|
-
};
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
260
|
+
}, X = ["type"];
|
|
261
|
+
function J(t, e, i, n, s, r) {
|
|
262
|
+
const o = B("activity-indicator");
|
|
263
|
+
return c(), d("button", {
|
|
264
|
+
type: i.type,
|
|
265
|
+
class: m(["btn", r.classes]),
|
|
266
|
+
onClick: e[0] || (e[0] = (...h) => r.onClick && r.onClick(...h))
|
|
267
|
+
}, [
|
|
268
|
+
i.icon ? (c(), d("i", {
|
|
269
|
+
key: 0,
|
|
270
|
+
class: m(i.icon)
|
|
271
|
+
}, null, 2)) : p("", !0),
|
|
272
|
+
E(" " + S(i.label) + " ", 1),
|
|
273
|
+
D(t.$slots, "default"),
|
|
274
|
+
N(o, O(R(r.indicatorProps)), null, 16)
|
|
275
|
+
], 10, X);
|
|
711
276
|
}
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
277
|
+
const Q = /* @__PURE__ */ A(U, [["render", J]]);
|
|
278
|
+
export {
|
|
279
|
+
Q as BtnActivity
|
|
280
|
+
};
|
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(c,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(c=typeof globalThis<"u"?globalThis:c||self,n(c.BtnActivity={},c.Vue))})(this,function(c,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,r=arguments.length;s<r;s++){i=arguments[s];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e},l.apply(this,arguments)};function S(t){return t.toLowerCase()}var w=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],C=/[^A-Z0-9]+/gi;function k(t,e){e===void 0&&(e={});for(var i=e.splitRegexp,s=i===void 0?w:i,r=e.stripRegexp,a=r===void 0?C:r,_=e.transform,h=_===void 0?S:_,x=e.delimiter,V=x===void 0?" ":x,u=p(p(t,s,"$1\0$2"),a,"\0"),y=0,m=u.length;u.charAt(y)==="\0";)y++;for(;u.charAt(m-1)==="\0";)m--;return u.slice(y,m).split("\0").map(h).join(V)}function p(t,e,i){return e instanceof RegExp?t.replace(e,i):e.reduce(function(s,r){return s.replace(r,i)},t)}function A(t,e){return e===void 0&&(e={}),k(t,l({delimiter:"."},e))}function d(t,e){return e===void 0&&(e={}),A(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,r])=>{this.register(d(s),r)}),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 B(...t){return new g(...t)}const f=B(),F="",v=(t,e)=>{const i=t.__vccOpts||t;for(const[s,r]of e)i[s]=r;return i};function o(t,e="px"){return t!=null&&t!==!1&&isFinite(t)?`${t}${e}`:t}const $={name:"ActivityIndicator",props:{absolute:Boolean,center:Boolean,label:String,size:{type:String,default:"md"},registry:{type:g,default(){return f}},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:o(this.width),maxWidth:o(this.maxWidth),minWidth:o(this.minWidth),height:o(this.height),maxHeight:o(this.maxHeight),minHeight:o(this.minHeight)}}},async mounted(){const t=await this.component();this.is=()=>t},methods:{async component(){let t=f.get(this.type);return t instanceof Promise?t:(typeof t=="function"&&(t=await t()),t.default?t.default:t)}}},E={class:"activity-indicator-content"},P={key:1,class:"activity-indicator-label"};function z(t,e,i,s,r,a){return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["activity-indicator",a.classes]),style:n.normalizeStyle(a.style)},[n.createElementVNode("div",E,[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",P,n.toDisplayString(i.label),1)):n.createCommentVNode("",!0)])],6)}const N=v($,[["render",z]]),L="",H="",I="",W="",q="",M="",Z="",G="",U="",X="",J="",K="",Q="",Y="",tt="",D=function(t){const e=parseFloat(t||0,10),i=t&&t.match(/m?s/),s=i?i[0]:!1;let r;switch(s){case"s":r=e*1e3;break;case"ms":default:r=e;break}return r||0},b=function(t,e){const i=(t.ownerDocument||document).defaultView;setTimeout(()=>{e.apply()},D(i.getComputedStyle(t).animationDuration))},O={name:"BtnActivity",components:{ActivityIndicator:N},props:{active:Boolean,activity:Boolean,block:Boolean,disabled:Boolean,label:String,icon:String,type:String,size:{type:String,default:"md"},variant:{type:String,default:"primary"},indicator:{type:[Object,String],default:"spinner"},orientation:{type:String,default:"right"}},computed:{classes(){const t={disabled:this.disabled,active:this.active,"btn-block":this.block,"btn-activity":this.activity};return t["btn-"+this.size.replace("btn-","")]=!!this.size,t["btn-"+this.variant.replace("btn-","")]=!!this.variant,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()}},methods:{disable(){this.$el.disabled=!0},enable(){this.$el.disabled=!1},showActivity(){this.disable(),b(this.$el,()=>{this.$el.classList.add("btn-activity"),this.$emit("show-activity")})},hideActivity(){this.$el.classList.add("btn-hide-activity"),b(this.$el,()=>{this.enable(),this.$el.classList.remove("btn-activity","btn-hide-activity"),this.$emit("hide-activity")})},onClick(t){this.disabled?t.preventDefault():this.$emit("click",t)}}},T=["type"];function j(t,e,i,s,r,a){const _=n.resolveComponent("activity-indicator");return n.openBlock(),n.createElementBlock("button",{type:i.type,class:n.normalizeClass(["btn",a.classes]),onClick:e[0]||(e[0]=(...h)=>a.onClick&&a.onClick(...h))},[i.icon?(n.openBlock(),n.createElementBlock("i",{key:0,class:n.normalizeClass(i.icon)},null,2)):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(i.label)+" ",1),n.renderSlot(t.$slots,"default"),n.createVNode(_,n.normalizeProps(n.guardReactiveProps(a.indicatorProps)),null,16)],10,T)}const R=v(O,[["render",j]]);c.BtnActivity=R,Object.defineProperties(c,{__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.0",
|
|
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
|
}
|
package/src/BtnActivity.vue
CHANGED
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<btn
|
|
3
|
-
:
|
|
4
|
-
|
|
5
|
-
:disabled="disabled"
|
|
6
|
-
:size="size"
|
|
7
|
-
:tag="tag"
|
|
8
|
-
:variant="variant"
|
|
9
|
-
:class="classes"
|
|
10
|
-
@click="(e) => !disabled && $emit('click', e, this)">
|
|
11
|
-
<slot>{{ label }}</slot>
|
|
2
|
+
<button :type="type" class="btn" :class="classes" @click="onClick">
|
|
3
|
+
<i v-if="icon" :class="icon" /> {{ label }}
|
|
4
|
+
<slot />
|
|
12
5
|
<activity-indicator v-bind="indicatorProps" />
|
|
13
|
-
</
|
|
6
|
+
</button>
|
|
14
7
|
</template>
|
|
15
8
|
|
|
16
9
|
<script>
|
|
17
10
|
import { ActivityIndicator } from '@vue-interface/activity-indicator';
|
|
18
|
-
import { Btn } from '@vue-interface/btn';
|
|
19
11
|
|
|
20
12
|
const convertAnimationDelayToInt = function(delay) {
|
|
21
13
|
const num = parseFloat(delay || 0, 10);
|
|
@@ -48,10 +40,9 @@ const animated = function(el, callback) {
|
|
|
48
40
|
export default {
|
|
49
41
|
|
|
50
42
|
name: 'BtnActivity',
|
|
51
|
-
|
|
43
|
+
|
|
52
44
|
components: {
|
|
53
|
-
ActivityIndicator
|
|
54
|
-
Btn
|
|
45
|
+
ActivityIndicator
|
|
55
46
|
},
|
|
56
47
|
|
|
57
48
|
props: {
|
|
@@ -78,38 +69,33 @@ export default {
|
|
|
78
69
|
block: Boolean,
|
|
79
70
|
|
|
80
71
|
/**
|
|
81
|
-
*
|
|
72
|
+
* Make the button appear with the disabled state.
|
|
82
73
|
*
|
|
83
74
|
* @property {Boolean}
|
|
84
75
|
*/
|
|
85
76
|
disabled: Boolean,
|
|
86
77
|
|
|
87
78
|
/**
|
|
88
|
-
* The
|
|
79
|
+
* The button label. If not passed as a property, label must be passed
|
|
80
|
+
* inside the element's html.
|
|
89
81
|
*
|
|
90
82
|
* @property {String}
|
|
91
83
|
*/
|
|
92
|
-
|
|
93
|
-
type: [Object, String],
|
|
94
|
-
default: 'spinner'
|
|
95
|
-
},
|
|
84
|
+
label: String,
|
|
96
85
|
|
|
97
86
|
/**
|
|
98
|
-
* The button
|
|
87
|
+
* The button icon
|
|
99
88
|
*
|
|
100
89
|
* @property {String}
|
|
101
90
|
*/
|
|
102
|
-
|
|
91
|
+
icon: String,
|
|
103
92
|
|
|
104
93
|
/**
|
|
105
|
-
* The
|
|
94
|
+
* The `type` attribute for the button element.
|
|
106
95
|
*
|
|
107
96
|
* @property {String}
|
|
108
97
|
*/
|
|
109
|
-
|
|
110
|
-
type: String,
|
|
111
|
-
default: 'right'
|
|
112
|
-
},
|
|
98
|
+
type: String,
|
|
113
99
|
|
|
114
100
|
/**
|
|
115
101
|
* The size of the button.
|
|
@@ -122,28 +108,35 @@ export default {
|
|
|
122
108
|
},
|
|
123
109
|
|
|
124
110
|
/**
|
|
125
|
-
* The
|
|
111
|
+
* The variant of the button.
|
|
112
|
+
*
|
|
113
|
+
* @property {String}
|
|
114
|
+
*/
|
|
115
|
+
variant: {
|
|
116
|
+
type: String,
|
|
117
|
+
default: 'primary'
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The type of activity indicator inside the button.
|
|
126
122
|
*
|
|
127
123
|
* @property {String}
|
|
128
124
|
*/
|
|
129
|
-
|
|
125
|
+
indicator: {
|
|
126
|
+
type: [Object, String],
|
|
127
|
+
default: 'spinner'
|
|
128
|
+
},
|
|
130
129
|
|
|
131
130
|
/**
|
|
132
|
-
* The
|
|
131
|
+
* The orientation of the activity button inside the button.
|
|
133
132
|
*
|
|
134
133
|
* @property {String}
|
|
135
134
|
*/
|
|
136
|
-
|
|
135
|
+
orientation: {
|
|
137
136
|
type: String,
|
|
138
|
-
default: '
|
|
137
|
+
default: 'right'
|
|
139
138
|
}
|
|
140
139
|
},
|
|
141
|
-
|
|
142
|
-
data() {
|
|
143
|
-
return {
|
|
144
|
-
currentActivity: this.activity
|
|
145
|
-
};
|
|
146
|
-
},
|
|
147
140
|
|
|
148
141
|
computed: {
|
|
149
142
|
|
|
@@ -156,9 +149,12 @@ export default {
|
|
|
156
149
|
const classes = {
|
|
157
150
|
'disabled': this.disabled,
|
|
158
151
|
'active': this.active,
|
|
152
|
+
'btn-block': this.block,
|
|
159
153
|
'btn-activity': this.activity
|
|
160
154
|
};
|
|
161
155
|
|
|
156
|
+
classes['btn-' + this.size.replace('btn-', '')] = !!this.size;
|
|
157
|
+
classes['btn-' + this.variant.replace('btn-', '')] = !!this.variant;
|
|
162
158
|
classes['btn-activity-' + this.orientation.replace('btn-activity-', '')] = !!this.orientation;
|
|
163
159
|
classes['btn-activity-indicator-' + this.indicatorProps.type.replace('btn-activity-indicator-', '')] = !!this.indicatorProps.type;
|
|
164
160
|
|
|
@@ -188,12 +184,6 @@ export default {
|
|
|
188
184
|
|
|
189
185
|
},
|
|
190
186
|
|
|
191
|
-
mounted() {
|
|
192
|
-
if(this.activity) {
|
|
193
|
-
this.showActivity();
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
|
|
197
187
|
methods: {
|
|
198
188
|
|
|
199
189
|
/**
|
|
@@ -203,7 +193,6 @@ export default {
|
|
|
203
193
|
*/
|
|
204
194
|
disable() {
|
|
205
195
|
this.$el.disabled = true;
|
|
206
|
-
this.$el.classList.add('disabled');
|
|
207
196
|
},
|
|
208
197
|
|
|
209
198
|
/**
|
|
@@ -213,51 +202,48 @@ export default {
|
|
|
213
202
|
*/
|
|
214
203
|
enable() {
|
|
215
204
|
this.$el.disabled = false;
|
|
216
|
-
this.$el.classList.remove('disabled');
|
|
217
205
|
},
|
|
218
206
|
|
|
219
207
|
/**
|
|
220
|
-
*
|
|
208
|
+
* Show the activity indicator inside the button.
|
|
221
209
|
*
|
|
222
210
|
* @return void
|
|
223
211
|
*/
|
|
224
|
-
|
|
225
|
-
this
|
|
212
|
+
showActivity() {
|
|
213
|
+
this.disable();
|
|
226
214
|
|
|
227
215
|
animated(this.$el, () => {
|
|
228
|
-
this.
|
|
229
|
-
this
|
|
230
|
-
this.$el.classList.remove('btn-activity', 'btn-hide-activity');
|
|
231
|
-
this.$emit('hide-activity');
|
|
216
|
+
this.$el.classList.add('btn-activity');
|
|
217
|
+
this.$emit('show-activity');
|
|
232
218
|
});
|
|
233
219
|
},
|
|
234
220
|
|
|
235
221
|
/**
|
|
236
|
-
*
|
|
222
|
+
* Hide the activity indicator inside the button.
|
|
237
223
|
*
|
|
238
224
|
* @return void
|
|
239
225
|
*/
|
|
240
|
-
|
|
241
|
-
this.
|
|
242
|
-
this.disable();
|
|
226
|
+
hideActivity() {
|
|
227
|
+
this.$el.classList.add('btn-hide-activity');
|
|
243
228
|
|
|
244
229
|
animated(this.$el, () => {
|
|
245
|
-
this
|
|
246
|
-
this.$
|
|
230
|
+
this.enable();
|
|
231
|
+
this.$el.classList.remove('btn-activity', 'btn-hide-activity');
|
|
232
|
+
this.$emit('hide-activity');
|
|
247
233
|
});
|
|
248
234
|
},
|
|
249
235
|
|
|
250
236
|
/**
|
|
251
|
-
*
|
|
237
|
+
* The click callback function
|
|
252
238
|
*
|
|
253
239
|
* @return void
|
|
254
240
|
*/
|
|
255
|
-
|
|
256
|
-
if(!this.
|
|
257
|
-
this
|
|
241
|
+
onClick(event) {
|
|
242
|
+
if(!this.disabled) {
|
|
243
|
+
this.$emit('click', event);
|
|
258
244
|
}
|
|
259
245
|
else {
|
|
260
|
-
|
|
246
|
+
event.preventDefault();
|
|
261
247
|
}
|
|
262
248
|
}
|
|
263
249
|
|