@vue-interface/btn-activity 0.9.12 → 1.1.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.
Files changed (47) hide show
  1. package/dist/btn-activity.css +1 -0
  2. package/dist/btn-activity.es.js +715 -0
  3. package/dist/btn-activity.umd.js +15 -0
  4. package/index.js +5 -2
  5. package/package.json +28 -33
  6. package/src/BtnActivity.vue +67 -61
  7. package/.eslintrc.js +0 -53
  8. package/babel.config.js +0 -11
  9. package/dist/BtnActivity.common.js +0 -8819
  10. package/dist/BtnActivity.common.js.map +0 -1
  11. package/dist/BtnActivity.css +0 -1
  12. package/dist/BtnActivity.umd.js +0 -8829
  13. package/dist/BtnActivity.umd.js.map +0 -1
  14. package/dist/BtnActivity.umd.min.js +0 -2
  15. package/dist/BtnActivity.umd.min.js.map +0 -1
  16. package/dist/demo.html +0 -19
  17. package/docs/.vuepress/config.js +0 -44
  18. package/docs/.vuepress/dist/404.html +0 -19
  19. package/docs/.vuepress/dist/assets/css/0.styles.275ee968.css +0 -1
  20. package/docs/.vuepress/dist/assets/img/search.83621669.svg +0 -1
  21. package/docs/.vuepress/dist/assets/js/10.5d93d289.js +0 -1
  22. package/docs/.vuepress/dist/assets/js/11.97ab3884.js +0 -1
  23. package/docs/.vuepress/dist/assets/js/2.f3d148c3.js +0 -1
  24. package/docs/.vuepress/dist/assets/js/3.81681fff.js +0 -1
  25. package/docs/.vuepress/dist/assets/js/4.82fa7382.js +0 -1
  26. package/docs/.vuepress/dist/assets/js/5.3dae6ad4.js +0 -1
  27. package/docs/.vuepress/dist/assets/js/6.6a04f815.js +0 -1
  28. package/docs/.vuepress/dist/assets/js/7.c033cb49.js +0 -1
  29. package/docs/.vuepress/dist/assets/js/8.6d6eb599.js +0 -1
  30. package/docs/.vuepress/dist/assets/js/9.eaefe866.js +0 -1
  31. package/docs/.vuepress/dist/assets/js/app.7ed065d3.js +0 -13
  32. package/docs/.vuepress/dist/examples/index.html +0 -21
  33. package/docs/.vuepress/dist/examples/test.html +0 -17
  34. package/docs/.vuepress/dist/index.html +0 -53
  35. package/docs/.vuepress/dist/options.html +0 -41
  36. package/docs/.vuepress/dist/tailwindcss.html +0 -85
  37. package/docs/README.md +0 -17
  38. package/docs/examples/README.md +0 -3
  39. package/docs/options.md +0 -44
  40. package/index.html +0 -177
  41. package/main.vue +0 -5
  42. package/postcss.config.js +0 -1
  43. package/public/favicon.ico +0 -0
  44. package/public/index.html +0 -17
  45. package/src/css/BtnActivity.css +0 -1
  46. package/tailwind.config.js +0 -19
  47. package/vue.config.js +0 -12
@@ -0,0 +1,715 @@
1
+ function _typeof(obj) {
2
+ "@babel/helpers - typeof";
3
+ return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) {
4
+ return typeof obj2;
5
+ } : function(obj2) {
6
+ return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
7
+ }, _typeof(obj);
8
+ }
9
+ function _classCallCheck(instance, Constructor) {
10
+ if (!(instance instanceof Constructor)) {
11
+ throw new TypeError("Cannot call a class as a function");
12
+ }
13
+ }
14
+ function _defineProperties(target, props) {
15
+ for (var i = 0; i < props.length; i++) {
16
+ var descriptor = props[i];
17
+ descriptor.enumerable = descriptor.enumerable || false;
18
+ descriptor.configurable = true;
19
+ if ("value" in descriptor)
20
+ descriptor.writable = true;
21
+ Object.defineProperty(target, descriptor.key, descriptor);
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
+ }
138
+ }
139
+ return t;
140
+ };
141
+ return _assign.apply(this, arguments);
142
+ };
143
+ function lowerCase$1(str) {
144
+ return str.toLowerCase();
145
+ }
146
+ var DEFAULT_SPLIT_REGEXP$1 = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
147
+ var DEFAULT_STRIP_REGEXP$1 = /[^A-Z0-9]+/gi;
148
+ function noCase$1(input, options) {
149
+ if (options === void 0) {
150
+ options = {};
151
+ }
152
+ var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP$1 : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP$1 : _b, _c = options.transform, transform = _c === void 0 ? lowerCase$1 : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
153
+ var result = replace$1(replace$1(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
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);
163
+ }
164
+ function replace$1(input, re, value) {
165
+ if (re instanceof RegExp)
166
+ return input.replace(re, value);
167
+ return re.reduce(function(input2, re2) {
168
+ return input2.replace(re2, value);
169
+ }, input);
170
+ }
171
+ function dotCase$1(input, options) {
172
+ if (options === void 0) {
173
+ options = {};
174
+ }
175
+ return noCase$1(input, _assign({
176
+ delimiter: "."
177
+ }, options));
178
+ }
179
+ function paramCase$1(input, options) {
180
+ if (options === void 0) {
181
+ options = {};
182
+ }
183
+ return dotCase$1(input, _assign({
184
+ delimiter: "-"
185
+ }, options));
186
+ }
187
+ var ComponentRegistry = /* @__PURE__ */ function() {
188
+ function ComponentRegistry2() {
189
+ var _this = this;
190
+ var components = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
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);
196
+ });
197
+ }
198
+ _createClass(ComponentRegistry2, [{
199
+ key: "get",
200
+ value: function get(name) {
201
+ var match = this.components[name = paramCase$1(name)];
202
+ if (match) {
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];
239
+ }
240
+ return _construct(ComponentRegistry, args);
241
+ }
242
+ const registry = factory();
243
+ var render$2 = function() {
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;
260
+ }
261
+ if (scopeId) {
262
+ options._scopeId = "data-v-" + scopeId;
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;
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
+ }
302
+ function unit(value, uom = "px") {
303
+ return value !== null && value !== void 0 && value !== false && isFinite(value) ? `${value}${uom}` : value;
304
+ }
305
+ const __vue2_script$2 = {
306
+ name: "ActivityIndicator",
307
+ props: {
308
+ absolute: Boolean,
309
+ center: Boolean,
310
+ label: String,
311
+ size: {
312
+ type: String,
313
+ default: "md"
314
+ },
315
+ registry: {
316
+ type: ComponentRegistry,
317
+ default() {
318
+ return registry;
319
+ }
320
+ },
321
+ type: {
322
+ type: String,
323
+ required: true
324
+ },
325
+ height: [String, Number],
326
+ maxHeight: [String, Number],
327
+ minHeight: [String, Number],
328
+ width: [String, Number],
329
+ maxWidth: [String, Number],
330
+ minWidth: [String, Number]
331
+ },
332
+ computed: {
333
+ classes() {
334
+ return {
335
+ "activity-indicator-center": this.center,
336
+ "activity-indicator-absolute": this.absolute,
337
+ [this.size && `activity-indicator-${this.size}`]: !!this.size
338
+ };
339
+ },
340
+ style() {
341
+ return {
342
+ width: unit(this.width),
343
+ maxWidth: unit(this.maxWidth),
344
+ minWidth: unit(this.minWidth),
345
+ height: unit(this.height),
346
+ maxHeight: unit(this.maxHeight),
347
+ minHeight: unit(this.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);
360
+ };
361
+ }
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
+ },
466
+ computed: {
467
+ sizeableClassPrefix() {
468
+ return this.sizePrefix && paramCase(this.sizePrefix);
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
+ }
528
+ },
529
+ computed: {
530
+ classes() {
531
+ return [
532
+ "btn",
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" : "");
554
+ }
555
+ }
556
+ };
557
+ const __cssModules$1 = {};
558
+ var __component__$1 = /* @__PURE__ */ normalizeComponent(__vue2_script$1, render$1, staticRenderFns$1, false, __vue2_injectStyles$1, null, null, null);
559
+ function __vue2_injectStyles$1(context) {
560
+ for (let o in __cssModules$1) {
561
+ this[o] = __cssModules$1[o];
562
+ }
563
+ }
564
+ var Btn = /* @__PURE__ */ function() {
565
+ return __component__$1.exports;
566
+ }();
567
+ var render = function() {
568
+ var this$1$1 = this;
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) {
586
+ case "s":
587
+ milliseconds = num * 1e3;
588
+ break;
589
+ case "ms":
590
+ default:
591
+ milliseconds = num;
592
+ break;
593
+ }
594
+ return milliseconds || 0;
595
+ };
596
+ const animated = function(el, callback) {
597
+ const defaultView = (el.ownerDocument || document).defaultView;
598
+ setTimeout(() => {
599
+ callback.apply();
600
+ }, convertAnimationDelayToInt(defaultView.getComputedStyle(el).animationDuration));
601
+ };
602
+ const __vue2_script = {
603
+ name: "BtnActivity",
604
+ components: {
605
+ ActivityIndicator,
606
+ Btn
607
+ },
608
+ props: {
609
+ active: Boolean,
610
+ activity: Boolean,
611
+ block: Boolean,
612
+ disabled: Boolean,
613
+ indicator: {
614
+ type: [Object, String],
615
+ default: "spinner"
616
+ },
617
+ label: String,
618
+ orientation: {
619
+ type: String,
620
+ default: "right"
621
+ },
622
+ size: {
623
+ type: String,
624
+ default: "md"
625
+ },
626
+ tag: String,
627
+ variant: {
628
+ type: String,
629
+ default: "primary"
630
+ }
631
+ },
632
+ data() {
633
+ return {
634
+ currentActivity: this.activity
635
+ };
636
+ },
637
+ computed: {
638
+ classes() {
639
+ const classes = {
640
+ "disabled": this.disabled,
641
+ "active": this.active,
642
+ "btn-activity": this.activity
643
+ };
644
+ classes["btn-activity-" + this.orientation.replace("btn-activity-", "")] = !!this.orientation;
645
+ classes["btn-activity-indicator-" + this.indicatorProps.type.replace("btn-activity-indicator-", "")] = !!this.indicatorProps.type;
646
+ return classes;
647
+ },
648
+ indicatorProps() {
649
+ return Object.assign({
650
+ type: "spinner"
651
+ }, (typeof this.indicator === "string" ? {
652
+ type: this.indicator
653
+ } : this.indicator) || {});
654
+ }
655
+ },
656
+ watch: {
657
+ activity(value) {
658
+ if (value) {
659
+ this.showActivity();
660
+ } else {
661
+ this.hideActivity();
662
+ }
663
+ }
664
+ },
665
+ mounted() {
666
+ if (this.activity) {
667
+ this.showActivity();
668
+ }
669
+ },
670
+ methods: {
671
+ disable() {
672
+ this.$el.disabled = true;
673
+ this.$el.classList.add("disabled");
674
+ },
675
+ enable() {
676
+ this.$el.disabled = false;
677
+ this.$el.classList.remove("disabled");
678
+ },
679
+ hideActivity() {
680
+ this.$el.classList.add("btn-hide-activity");
681
+ animated(this.$el, () => {
682
+ this.enable();
683
+ this.currentActivity = false;
684
+ this.$el.classList.remove("btn-activity", "btn-hide-activity");
685
+ this.$emit("hide-activity");
686
+ });
687
+ },
688
+ showActivity() {
689
+ this.currentActivity = true;
690
+ this.disable();
691
+ animated(this.$el, () => {
692
+ this.$el.classList.add("btn-activity");
693
+ this.$emit("show-activity");
694
+ });
695
+ },
696
+ toggle() {
697
+ if (!this.currentActivity) {
698
+ this.showActivity();
699
+ } else {
700
+ this.hideActivity();
701
+ }
702
+ }
703
+ }
704
+ };
705
+ const __cssModules = {};
706
+ var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles, null, null, null);
707
+ function __vue2_injectStyles(context) {
708
+ for (let o in __cssModules) {
709
+ this[o] = __cssModules[o];
710
+ }
711
+ }
712
+ var BtnActivity = /* @__PURE__ */ function() {
713
+ return __component__.exports;
714
+ }();
715
+ export { BtnActivity };