@vue-interface/btn-activity 2.0.0-beta.14 → 2.0.0-beta.16

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.
@@ -1,10 +1,10 @@
1
1
  import { ActivityIndicator as d } from "@vue-interface/activity-indicator";
2
- import { Btn as v } from "@vue-interface/btn";
3
- import { defineComponent as h, resolveComponent as n, openBlock as y, createBlock as p, mergeProps as b, withCtx as m, renderSlot as u, createTextVNode as f, toDisplayString as g, createVNode as A, normalizeProps as $, guardReactiveProps as k } from "vue";
2
+ import { Btn as h } from "@vue-interface/btn";
3
+ import { defineComponent as v, resolveComponent as a, openBlock as y, createBlock as p, mergeProps as b, withCtx as u, renderSlot as m, createTextVNode as f, toDisplayString as g, createVNode as A, normalizeProps as $, guardReactiveProps as k } from "vue";
4
4
  const w = function(t) {
5
- const e = parseFloat(t || 0), i = t && t.match(/m?s/), a = i ? i[0] : !1;
5
+ const e = parseFloat(t || 0), i = t && t.match(/m?s/), o = i ? i[0] : !1;
6
6
  let s;
7
- switch (a) {
7
+ switch (o) {
8
8
  case "s":
9
9
  s = e * 1e3;
10
10
  break;
@@ -14,7 +14,7 @@ const w = function(t) {
14
14
  break;
15
15
  }
16
16
  return s || 0;
17
- }, o = function(t, e) {
17
+ }, n = function(t, e) {
18
18
  const i = (t.ownerDocument || document).defaultView;
19
19
  setTimeout(
20
20
  e,
@@ -22,10 +22,10 @@ const w = function(t) {
22
22
  i == null ? void 0 : i.getComputedStyle(t).animationDuration
23
23
  )
24
24
  );
25
- }, B = h({
25
+ }, B = v({
26
26
  components: {
27
27
  ActivityIndicator: d,
28
- Btn: v
28
+ Btn: h
29
29
  },
30
30
  inheritAttrs: !1,
31
31
  props: {
@@ -49,8 +49,8 @@ const w = function(t) {
49
49
  * The type of activity indicator inside the button.
50
50
  */
51
51
  indicator: {
52
- type: [Object, String],
53
- default: "spinner"
52
+ type: Object,
53
+ required: !0
54
54
  },
55
55
  /**
56
56
  * The button label.
@@ -67,25 +67,11 @@ const w = function(t) {
67
67
  default: "right"
68
68
  },
69
69
  /**
70
- * The size of the button.
71
- */
72
- size: {
73
- type: String,
74
- default: "md"
75
- },
76
- /**
77
70
  * The HTML tag.
78
71
  */
79
72
  tag: {
80
73
  type: String,
81
74
  default: void 0
82
- },
83
- /**
84
- * The variant of the button.
85
- */
86
- variant: {
87
- type: String,
88
- default: "primary"
89
75
  }
90
76
  },
91
77
  emits: ["click", "hide-activity", "show-activity"],
@@ -100,8 +86,6 @@ const w = function(t) {
100
86
  */
101
87
  classes() {
102
88
  return {
103
- disabled: this.disabled,
104
- active: this.active,
105
89
  "btn-activity": this.activity,
106
90
  [`btn-activity-${this.orientation.replace("btn-activity-", "")}`]: !!this.orientation,
107
91
  [`btn-activity-indicator-${this.indicatorProps.type.replace("btn-activity-indicator-", "")}`]: !!this.indicatorProps.type
@@ -143,7 +127,7 @@ const w = function(t) {
143
127
  * Hide the activity indicator inside the button.
144
128
  */
145
129
  hideActivity() {
146
- this.$el.classList.add("btn-hide-activity"), o(this.$el, () => {
130
+ this.$el.classList.add("btn-hide-activity"), n(this.$el, () => {
147
131
  this.disabled || this.enable(), this.currentActivity = !1, this.$el.classList.remove("btn-activity", "btn-hide-activity"), this.$emit("hide-activity");
148
132
  });
149
133
  },
@@ -151,7 +135,7 @@ const w = function(t) {
151
135
  * Show the activity indicator inside the button.
152
136
  */
153
137
  showActivity() {
154
- this.currentActivity = !0, this.disable(), o(this.$el, () => {
138
+ this.currentActivity = !0, this.disable(), n(this.$el, () => {
155
139
  this.$el.classList.add("btn-activity"), this.$emit("show-activity");
156
140
  });
157
141
  },
@@ -163,21 +147,19 @@ const w = function(t) {
163
147
  }
164
148
  }
165
149
  });
166
- const S = (t, e) => {
150
+ const P = (t, e) => {
167
151
  const i = t.__vccOpts || t;
168
- for (const [a, s] of e)
169
- i[a] = s;
152
+ for (const [o, s] of e)
153
+ i[o] = s;
170
154
  return i;
171
155
  };
172
- function P(t, e, i, a, s, C) {
173
- const c = n("ActivityIndicator"), r = n("Btn");
156
+ function C(t, e, i, o, s, S) {
157
+ const c = a("ActivityIndicator"), r = a("Btn");
174
158
  return y(), p(r, b({
175
159
  active: t.active,
176
160
  block: t.block,
177
161
  disabled: t.disabled,
178
- size: t.size,
179
162
  tag: t.tag,
180
- variant: t.variant,
181
163
  class: t.classes
182
164
  }, Object.assign({}, t.$attrs, { onClick: void 0 }), {
183
165
  onClick: e[0] || (e[0] = (l) => !t.disabled && t.$emit("click", l, {
@@ -188,17 +170,17 @@ function P(t, e, i, a, s, C) {
188
170
  hideActivity: t.hideActivity
189
171
  }))
190
172
  }), {
191
- default: m(() => [
192
- u(t.$slots, "default", {}, () => [
173
+ default: u(() => [
174
+ m(t.$slots, "default", {}, () => [
193
175
  f(g(t.label), 1)
194
176
  ]),
195
177
  A(c, $(k(t.indicatorProps)), null, 16)
196
178
  ]),
197
179
  _: 3
198
- }, 16, ["active", "block", "disabled", "size", "tag", "variant", "class"]);
180
+ }, 16, ["active", "block", "disabled", "tag", "class"]);
199
181
  }
200
- const I = /* @__PURE__ */ S(B, [["render", P]]);
182
+ const O = /* @__PURE__ */ P(B, [["render", C]]);
201
183
  export {
202
- I as BtnActivity
184
+ O as BtnActivity
203
185
  };
204
186
  //# sourceMappingURL=btn-activity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"btn-activity.js","sources":["../src/BtnActivity.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { ActivityIndicator } from '@vue-interface/activity-indicator';\nimport { Btn } from '@vue-interface/btn';\nimport { defineComponent } from 'vue';\n\nconst convertAnimationDelayToInt = function (delay: any) {\n const num = parseFloat(delay || 0);\n const matches = delay && delay.match(/m?s/);\n const unit = matches ? matches[0] : false;\n\n let milliseconds;\n\n switch (unit) {\n case 's': // seconds\n milliseconds = num * 1000;\n break;\n case 'ms':\n default:\n milliseconds = num;\n break;\n }\n\n return milliseconds || 0;\n};\n\nconst animated = function (el: HTMLElement, callback: Function) {\n const defaultView = (el.ownerDocument || document).defaultView;\n\n setTimeout(\n callback,\n convertAnimationDelayToInt(\n defaultView?.getComputedStyle(el).animationDuration\n )\n );\n};\n\nexport default defineComponent({\n\n components: {\n ActivityIndicator,\n Btn,\n },\n\n inheritAttrs: false,\n\n props: {\n /**\n\t\t * Make the button appear with the active state.\n\t\t */\n active: Boolean,\n\n /**\n\t\t * Show the activity indicator inside the button.\n\t\t */\n activity: Boolean,\n\n /**\n\t\t * Display the button as block width.\n\t\t */\n block: Boolean,\n\n /**\n\t\t * Disable the button.\n\t\t */\n disabled: Boolean,\n\n /**\n\t\t * The type of activity indicator inside the button.\n\t\t */\n indicator: {\n type: [Object, String],\n default: 'spinner',\n },\n\n /**\n\t\t * The button label.\n\t\t */\n label: {\n type: String,\n default: undefined\n },\n\n /**\n\t\t * The orientation of the activity button inside the button.\n\t\t */\n orientation: {\n type: String,\n default: 'right',\n },\n\n /**\n\t\t * The size of the button.\n\t\t */\n size: {\n type: String,\n default: 'md',\n },\n\n /**\n\t\t * The HTML tag.\n\t\t */\n tag: {\n type: String,\n default: undefined\n },\n\n /**\n\t\t * The variant of the button.\n\t\t */\n variant: {\n type: String,\n default: 'primary',\n },\n },\n\n emits: ['click', 'hide-activity', 'show-activity'],\n\n data() {\n return {\n currentActivity: this.activity,\n };\n },\n\n computed: {\n /**\n\t\t * An object of classes to append to the button.\n\t\t */\n classes() {\n return {\n disabled: this.disabled,\n active: this.active,\n 'btn-activity': this.activity,\n [`btn-activity-${this.orientation.replace('btn-activity-', '')}`]: !!this.orientation,\n [`btn-activity-indicator-${this.indicatorProps.type.replace('btn-activity-indicator-', '')}`]: !!this.indicatorProps.type,\n };\n },\n\n indicatorProps() {\n return Object.assign(\n {\n type: 'spinner',\n },\n (typeof this.indicator === 'string'\n ? {\n type: this.indicator,\n }\n : this.indicator) || {}\n );\n },\n },\n\n watch: {\n activity(value: boolean) {\n if(value) {\n this.showActivity();\n } else {\n this.hideActivity();\n }\n },\n },\n\n mounted() {\n if(this.activity) {\n this.showActivity();\n }\n },\n\n methods: {\n /**\n\t\t * Disable the button.\n\t\t */\n disable(): void {\n this.$el.disabled = true;\n this.$el.classList.add('disabled');\n },\n\n /**\n\t\t * Enable the button.\n\t\t */\n enable(): void {\n this.$el.disabled = false;\n this.$el.classList.remove('disabled');\n },\n\n /**\n\t\t * Hide the activity indicator inside the button.\n\t\t */\n hideActivity(): void {\n this.$el.classList.add('btn-hide-activity');\n\n animated(this.$el, () => {\n if(!this.disabled) {\n \tthis.enable();\n }\n\t\t\t\t\n this.currentActivity = false;\n this.$el.classList.remove('btn-activity', 'btn-hide-activity');\n this.$emit('hide-activity');\n });\n },\n\n /**\n\t\t * Show the activity indicator inside the button.\n\t\t */\n showActivity(): void {\n this.currentActivity = true;\n this.disable();\n\n animated(this.$el, () => {\n this.$el.classList.add('btn-activity');\n this.$emit('show-activity');\n });\n },\n\n /**\n\t\t * Show the activity indicator inside the button.\n\t\t */\n toggle(): void {\n if(!this.currentActivity) {\n this.showActivity();\n } else {\n this.hideActivity();\n }\n },\n },\n});\n</script>\n\n<template>\n <Btn\n :active=\"active\"\n :block=\"block\"\n :disabled=\"disabled\"\n :size=\"size\"\n :tag=\"tag\"\n :variant=\"variant\"\n :class=\"classes\"\n v-bind=\"Object.assign({}, $attrs, { onClick: undefined })\"\n @click=\"!disabled && $emit('click', $event, {\n disable,\n enable,\n toggle,\n showActivity,\n hideActivity,\n })\">\n <slot>{{ label }}</slot>\n <ActivityIndicator v-bind=\"indicatorProps\" />\n </Btn>\n</template>\n\n<style>\n@keyframes btn-activity-in {\n\n\t0%,\n\t100% {\n\t\ttransform: scale(1);\n\t}\n\n\t30% {\n\t\ttransform: scale(0.98);\n\t}\n}\n\n@keyframes btn-activity-out {\n\n\t0%,\n\t100% {\n\t\ttransform: scale(1);\n\t}\n\n\t70% {\n\t\ttransform: scale(0.98);\n\t}\n}\n\n.btn-activity-top,\n.btn.btn-activity-top,\n.btn-activity-bottom,\n.btn.btn-activity-bottom,\n.btn-activity-left,\n.btn.btn-activity-left,\n.btn-activity-right,\n.btn.btn-activity-right {\n\tdisplay: inline-flex;\n\tposition: relative;\n\ttransition: all calc(333ms / 2) ease-in;\n}\n\n.btn-activity-top .activity-indicator,\n.btn-activity-bottom .activity-indicator,\n.btn-activity-left .activity-indicator,\n.btn-activity-right .activity-indicator {\n\topacity: 0;\n\tposition: absolute;\n\tvisibility: hidden;\n\ttransition: opacity 333ms ease-in;\n}\n\n.btn-activity-top,\n.btn-activity-bottom {\n\tflex-direction: column;\n\talign-items: center;\n}\n\n.btn-activity-top .activity-indicator,\n.btn-activity-bottom .activity-indicator {\n\tmargin-left: auto;\n\tmargin-right: auto;\n}\n\n.btn-activity-top {\n\tflex-direction: column-reverse;\n}\n\n.btn-activity-top .activity-indicator {\n\tpadding-bottom: 1em;\n}\n\n.btn-activity-bottom .activity-indicator {\n\tpadding-top: 1em;\n}\n\n.btn-activity-left,\n.btn-activity-right {\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.btn-activity-left {\n\tflex-direction: row-reverse;\n}\n\n.btn-activity-left .activity-indicator {\n\tpadding-right: 1em;\n}\n\n.btn-activity-right .activity-indicator {\n\tpadding-left: 1em;\n}\n\n.btn-activity:not(.btn-link) {\n\tanimation: btn-activity-in 333ms;\n}\n\n.btn-hide-activity:not(.btn-link) {\n\tanimation: btn-activity-out 333ms;\n}\n\n.btn-activity.btn-hide-activity .activity-indicator {\n\topacity: 0;\n}\n\n.btn-activity .activity-indicator {\n\topacity: 1;\n\tvisibility: visible;\n\tposition: relative;\n\tfont-size: 0.55em;\n}\n</style>\n"],"names":["convertAnimationDelayToInt","delay","num","matches","unit","milliseconds","animated","el","callback","defaultView","_sfc_main","defineComponent","ActivityIndicator","Btn","value","_resolveComponent","_openBlock","_createBlock","_component_Btn","_mergeProps","_ctx","_cache","$event","_withCtx","_createTextVNode","_toDisplayString"],"mappings":";;;AAKA,MAAMA,IAA6B,SAAUC,GAAY;AAC/C,QAAAC,IAAM,WAAW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C,KAAK,YACR,KAAK,OAAO,GAGb,KAAK,kBAAkB,IACvB,KAAK,IAAI,UAAU,OAAO,gBAAgB,mBAAmB,GAC7D,KAAK,MAAM,eAAe;AAAA,MAAA,CAC7B;AAAA,IACL;AAAA;AAAA;AAAA;AAAA,IAKA,eAAqB;AACjB,WAAK,kBAAkB,IACvB,KAAK,QAAQ,GAEJA,EAAA,KAAK,KAAK,MAAM;AAChB,aAAA,IAAI,UAAU,IAAI,cAAc,GACrC,KAAK,MAAM,eAAe;AAAA,MAAA,CAC7B;AAAA,IACL;AAAA;AAAA;AAAA;AAAA,IAKA,SAAe;AACR,MAAC,KAAK,kBAGL,KAAK,aAAa,IAFlB,KAAK,aAAa;AAAA,IAI1B;AAAA,EACJ;AACJ,CAAC;;;;;;;;wCAIGS,EAkBM,KAAA;SAhBIC,EAAO,GAAAC,EAAAC,GAAAC,EAAA;AAAA,IACZ,QAAQC,EAAE;AAAA,IACV,OAAMA,EAAA;AAAA,IACN,UAAKA,EAAG;AAAA,IACR,MAASA,EAAA;AAAA,IACT,KAAKA,EAAE;AAAA,IAAA,SACOA,EAAM;AAAA,IACpB,OAAKA,EAAA;AAAA,EAAA,GAAA,OAAA,OAAA,CAAA,GAAoDA,EAAO,QAAA,EAAA,SAAA,OAAA,CAAA,GAAA;AAAA,IAAA,SAAAC,EAAc,CAAM,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAA,CAAAF,EAAA,YAAAA,EAAA,MAAA,SAAAE,GAAA;AAAA,MAAc,SAAAF,EAAA;AAAA,MAAA,QAAAA,EAAA;AAAA;;;;EAOnG,CAAA,GAAA;AAAA,IAAA,SAAAG,EAAA,MAAA;AAAA;QACAC,EAA6CC,EAAAL,EAAA,KAAA,GAAA,CAAA;AAAA,MAAA,CAAA;AAAA;;;;;;"}
1
+ {"version":3,"file":"btn-activity.js","sources":["../src/BtnActivity.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { ActivityIndicator } from '@vue-interface/activity-indicator';\nimport { Btn } from '@vue-interface/btn';\nimport { defineComponent } from 'vue';\n\nconst convertAnimationDelayToInt = function (delay: any) {\n const num = parseFloat(delay || 0);\n const matches = delay && delay.match(/m?s/);\n const unit = matches ? matches[0] : false;\n\n let milliseconds;\n\n switch (unit) {\n case 's': // seconds\n milliseconds = num * 1000;\n break;\n case 'ms':\n default:\n milliseconds = num;\n break;\n }\n\n return milliseconds || 0;\n};\n\nconst animated = function (el: HTMLElement, callback: Function) {\n const defaultView = (el.ownerDocument || document).defaultView;\n\n setTimeout(\n callback,\n convertAnimationDelayToInt(\n defaultView?.getComputedStyle(el).animationDuration\n )\n );\n};\n\nexport default defineComponent({\n\n components: {\n ActivityIndicator,\n Btn,\n },\n\n inheritAttrs: false,\n\n props: {\n /**\n\t\t * Make the button appear with the active state.\n\t\t */\n active: Boolean,\n\n /**\n\t\t * Show the activity indicator inside the button.\n\t\t */\n activity: Boolean,\n\n /**\n\t\t * Display the button as block width.\n\t\t */\n block: Boolean,\n\n /**\n\t\t * Disable the button.\n\t\t */\n disabled: Boolean,\n\n /**\n\t\t * The type of activity indicator inside the button.\n\t\t */\n indicator: {\n type: Object,\n required: true\n },\n\n /**\n\t\t * The button label.\n\t\t */\n label: {\n type: String,\n default: undefined\n },\n\n /**\n\t\t * The orientation of the activity button inside the button.\n\t\t */\n orientation: {\n type: String,\n default: 'right',\n },\n\n /**\n\t\t * The HTML tag.\n\t\t */\n tag: {\n type: String,\n default: undefined\n },\n },\n\n emits: ['click', 'hide-activity', 'show-activity'],\n\n data() {\n return {\n currentActivity: this.activity,\n };\n },\n\n computed: {\n /**\n\t\t * An object of classes to append to the button.\n\t\t */\n classes() {\n return {\n 'btn-activity': this.activity,\n [`btn-activity-${this.orientation.replace('btn-activity-', '')}`]: !!this.orientation,\n [`btn-activity-indicator-${this.indicatorProps.type.replace('btn-activity-indicator-', '')}`]: !!this.indicatorProps.type,\n };\n },\n\n indicatorProps() {\n return Object.assign(\n {\n type: 'spinner',\n },\n (typeof this.indicator === 'string'\n ? {\n type: this.indicator,\n }\n : this.indicator) || {}\n );\n },\n },\n\n watch: {\n activity(value: boolean) {\n if(value) {\n this.showActivity();\n } else {\n this.hideActivity();\n }\n },\n },\n\n mounted() {\n if(this.activity) {\n this.showActivity();\n }\n },\n\n methods: {\n /**\n\t\t * Disable the button.\n\t\t */\n disable(): void {\n this.$el.disabled = true;\n this.$el.classList.add('disabled');\n },\n\n /**\n\t\t * Enable the button.\n\t\t */\n enable(): void {\n this.$el.disabled = false;\n this.$el.classList.remove('disabled');\n },\n\n /**\n\t\t * Hide the activity indicator inside the button.\n\t\t */\n hideActivity(): void {\n this.$el.classList.add('btn-hide-activity');\n\n animated(this.$el, () => {\n if(!this.disabled) {\n \tthis.enable();\n }\n\t\t\t\t\n this.currentActivity = false;\n this.$el.classList.remove('btn-activity', 'btn-hide-activity');\n this.$emit('hide-activity');\n });\n },\n\n /**\n\t\t * Show the activity indicator inside the button.\n\t\t */\n showActivity(): void {\n this.currentActivity = true;\n this.disable();\n\n animated(this.$el, () => {\n this.$el.classList.add('btn-activity');\n this.$emit('show-activity');\n });\n },\n\n /**\n\t\t * Show the activity indicator inside the button.\n\t\t */\n toggle(): void {\n if(!this.currentActivity) {\n this.showActivity();\n } else {\n this.hideActivity();\n }\n },\n },\n});\n</script>\n\n<template>\n <Btn\n :active=\"active\"\n :block=\"block\"\n :disabled=\"disabled\"\n :tag=\"tag\"\n :class=\"classes\"\n v-bind=\"Object.assign({}, $attrs, { onClick: undefined })\"\n @click=\"!disabled && $emit('click', $event, {\n disable,\n enable,\n toggle,\n showActivity,\n hideActivity,\n })\">\n <slot>{{ label }}</slot>\n <ActivityIndicator v-bind=\"indicatorProps\" />\n </Btn>\n</template>\n\n<style>\n@keyframes btn-activity-in {\n\n\t0%,\n\t100% {\n\t\ttransform: scale(1);\n\t}\n\n\t30% {\n\t\ttransform: scale(0.98);\n\t}\n}\n\n@keyframes btn-activity-out {\n\n\t0%,\n\t100% {\n\t\ttransform: scale(1);\n\t}\n\n\t70% {\n\t\ttransform: scale(0.98);\n\t}\n}\n\n.btn-activity-top,\n.btn.btn-activity-top,\n.btn-activity-bottom,\n.btn.btn-activity-bottom,\n.btn-activity-left,\n.btn.btn-activity-left,\n.btn-activity-right,\n.btn.btn-activity-right {\n\tdisplay: inline-flex;\n\tposition: relative;\n\ttransition: all calc(333ms / 2) ease-in;\n}\n\n.btn-activity-top .activity-indicator,\n.btn-activity-bottom .activity-indicator,\n.btn-activity-left .activity-indicator,\n.btn-activity-right .activity-indicator {\n\topacity: 0;\n\tposition: absolute;\n\tvisibility: hidden;\n\ttransition: opacity 333ms ease-in;\n}\n\n.btn-activity-top,\n.btn-activity-bottom {\n\tflex-direction: column;\n\talign-items: center;\n}\n\n.btn-activity-top .activity-indicator,\n.btn-activity-bottom .activity-indicator {\n\tmargin-left: auto;\n\tmargin-right: auto;\n}\n\n.btn-activity-top {\n\tflex-direction: column-reverse;\n}\n\n.btn-activity-top .activity-indicator {\n\tpadding-bottom: 1em;\n}\n\n.btn-activity-bottom .activity-indicator {\n\tpadding-top: 1em;\n}\n\n.btn-activity-left,\n.btn-activity-right {\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.btn-activity-left {\n\tflex-direction: row-reverse;\n}\n\n.btn-activity-left .activity-indicator {\n\tpadding-right: 1em;\n}\n\n.btn-activity-right .activity-indicator {\n\tpadding-left: 1em;\n}\n\n.btn-activity:not(.btn-link) {\n\tanimation: btn-activity-in 333ms;\n}\n\n.btn-hide-activity:not(.btn-link) {\n\tanimation: btn-activity-out 333ms;\n}\n\n.btn-activity.btn-hide-activity .activity-indicator {\n\topacity: 0;\n}\n\n.btn-activity .activity-indicator {\n\topacity: 1;\n\tvisibility: visible;\n\tposition: relative;\n\tfont-size: 0.55em;\n}\n</style>\n"],"names":["convertAnimationDelayToInt","delay","num","matches","unit","milliseconds","animated","el","callback","defaultView","_sfc_main","defineComponent","ActivityIndicator","Btn","value","_resolveComponent","_openBlock","_createBlock","_component_Btn","_mergePro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K,MAAM,eAAe;AAAA,MAAA,CAC7B;AAAA,IACL;AAAA;AAAA;AAAA;AAAA,IAKA,eAAqB;AACjB,WAAK,kBAAkB,IACvB,KAAK,QAAQ,GAEJA,EAAA,KAAK,KAAK,MAAM;AAChB,aAAA,IAAI,UAAU,IAAI,cAAc,GACrC,KAAK,MAAM,eAAe;AAAA,MAAA,CAC7B;AAAA,IACL;AAAA;AAAA;AAAA;AAAA,IAKA,SAAe;AACR,MAAC,KAAK,kBAGL,KAAK,aAAa,IAFlB,KAAK,aAAa;AAAA,IAI1B;AAAA,EACJ;AACJ,CAAC;;;;;;;;wCAIGS,EAgBM,KAAA;SAdIC,EAAO,GAAAC,EAAAC,GAAAC,EAAA;AAAA,IACZ,QAAQC,EAAE;AAAA,IACV,OAAKA,EAAA;AAAA,IACL,UAAOA,EAAA;AAAA,IAAA,KACAA,EAAO;AAAA,IACd,OAAKA,EAAA;AAAA,EAAA,GAAA,OAAA,OAAA,CAAA,GAAoDA,EAAO,QAAA,EAAA,SAAA,OAAA,CAAA,GAAA;AAAA,IAAA,SAAAC,EAAc,CAAM,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAA,CAAAF,EAAA,YAAAA,EAAA,MAAA,SAAAE,GAAA;AAAA,MAAc,SAAAF,EAAA;AAAA,MAAA,QAAAA,EAAA;AAAA;;;;EAOnG,CAAA,GAAA;AAAA,IAAA,SAAAG,EAAA,MAAA;AAAA;QACAC,EAA6CC,EAAAL,EAAA,KAAA,GAAA,CAAA;AAAA,MAAA,CAAA;AAAA;;;;;;"}
@@ -1,2 +1,2 @@
1
- (function(n,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@vue-interface/activity-indicator"),require("@vue-interface/btn"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@vue-interface/activity-indicator","@vue-interface/btn","vue"],o):(n=typeof globalThis<"u"?globalThis:n||self,o(n.BtnActivity={},n.VueInterfaceActivityIndicator,n.VueInterfaceBtn,n.Vue))})(this,function(n,o,d,i){"use strict";const l=function(t){const s=parseFloat(t||0),e=t&&t.match(/m?s/),c=e?e[0]:!1;let a;switch(c){case"s":a=s*1e3;break;case"ms":default:a=s;break}return a||0},r=function(t,s){const e=(t.ownerDocument||document).defaultView;setTimeout(s,l(e==null?void 0:e.getComputedStyle(t).animationDuration))},y=i.defineComponent({components:{ActivityIndicator:o.ActivityIndicator,Btn:d.Btn},inheritAttrs:!1,props:{active:Boolean,activity:Boolean,block:Boolean,disabled:Boolean,indicator:{type:[Object,String],default:"spinner"},label:{type:String,default:void 0},orientation:{type:String,default:"right"},size:{type:String,default:"md"},tag:{type:String,default:void 0},variant:{type:String,default:"primary"}},emits:["click","hide-activity","show-activity"],data(){return{currentActivity:this.activity}},computed:{classes(){return{disabled:this.disabled,active:this.active,"btn-activity":this.activity,[`btn-activity-${this.orientation.replace("btn-activity-","")}`]:!!this.orientation,[`btn-activity-indicator-${this.indicatorProps.type.replace("btn-activity-indicator-","")}`]:!!this.indicatorProps.type}},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"),r(this.$el,()=>{this.disabled||this.enable(),this.currentActivity=!1,this.$el.classList.remove("btn-activity","btn-hide-activity"),this.$emit("hide-activity")})},showActivity(){this.currentActivity=!0,this.disable(),r(this.$el,()=>{this.$el.classList.add("btn-activity"),this.$emit("show-activity")})},toggle(){this.currentActivity?this.hideActivity():this.showActivity()}}}),m="",v=(t,s)=>{const e=t.__vccOpts||t;for(const[c,a]of s)e[c]=a;return e};function h(t,s,e,c,a,A){const u=i.resolveComponent("ActivityIndicator"),f=i.resolveComponent("Btn");return i.openBlock(),i.createBlock(f,i.mergeProps({active:t.active,block:t.block,disabled:t.disabled,size:t.size,tag:t.tag,variant:t.variant,class:t.classes},Object.assign({},t.$attrs,{onClick:void 0}),{onClick:s[0]||(s[0]=b=>!t.disabled&&t.$emit("click",b,{disable:t.disable,enable:t.enable,toggle:t.toggle,showActivity:t.showActivity,hideActivity:t.hideActivity}))}),{default:i.withCtx(()=>[i.renderSlot(t.$slots,"default",{},()=>[i.createTextVNode(i.toDisplayString(t.label),1)]),i.createVNode(u,i.normalizeProps(i.guardReactiveProps(t.indicatorProps)),null,16)]),_:3},16,["active","block","disabled","size","tag","variant","class"])}const p=v(y,[["render",h]]);n.BtnActivity=p,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
1
+ (function(n,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@vue-interface/activity-indicator"),require("@vue-interface/btn"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@vue-interface/activity-indicator","@vue-interface/btn","vue"],a):(n=typeof globalThis<"u"?globalThis:n||self,a(n.BtnActivity={},n.VueInterfaceActivityIndicator,n.VueInterfaceBtn,n.Vue))})(this,function(n,a,d,i){"use strict";const l=function(t){const s=parseFloat(t||0),e=t&&t.match(/m?s/),c=e?e[0]:!1;let o;switch(c){case"s":o=s*1e3;break;case"ms":default:o=s;break}return o||0},r=function(t,s){const e=(t.ownerDocument||document).defaultView;setTimeout(s,l(e==null?void 0:e.getComputedStyle(t).animationDuration))},y=i.defineComponent({components:{ActivityIndicator:a.ActivityIndicator,Btn:d.Btn},inheritAttrs:!1,props:{active:Boolean,activity:Boolean,block:Boolean,disabled:Boolean,indicator:{type:Object,required:!0},label:{type:String,default:void 0},orientation:{type:String,default:"right"},tag:{type:String,default:void 0}},emits:["click","hide-activity","show-activity"],data(){return{currentActivity:this.activity}},computed:{classes(){return{"btn-activity":this.activity,[`btn-activity-${this.orientation.replace("btn-activity-","")}`]:!!this.orientation,[`btn-activity-indicator-${this.indicatorProps.type.replace("btn-activity-indicator-","")}`]:!!this.indicatorProps.type}},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"),r(this.$el,()=>{this.disabled||this.enable(),this.currentActivity=!1,this.$el.classList.remove("btn-activity","btn-hide-activity"),this.$emit("hide-activity")})},showActivity(){this.currentActivity=!0,this.disable(),r(this.$el,()=>{this.$el.classList.add("btn-activity"),this.$emit("show-activity")})},toggle(){this.currentActivity?this.hideActivity():this.showActivity()}}}),m="",h=(t,s)=>{const e=t.__vccOpts||t;for(const[c,o]of s)e[c]=o;return e};function v(t,s,e,c,o,A){const u=i.resolveComponent("ActivityIndicator"),f=i.resolveComponent("Btn");return i.openBlock(),i.createBlock(f,i.mergeProps({active:t.active,block:t.block,disabled:t.disabled,tag:t.tag,class:t.classes},Object.assign({},t.$attrs,{onClick:void 0}),{onClick:s[0]||(s[0]=b=>!t.disabled&&t.$emit("click",b,{disable:t.disable,enable:t.enable,toggle:t.toggle,showActivity:t.showActivity,hideActivity:t.hideActivity}))}),{default:i.withCtx(()=>[i.renderSlot(t.$slots,"default",{},()=>[i.createTextVNode(i.toDisplayString(t.label),1)]),i.createVNode(u,i.normalizeProps(i.guardReactiveProps(t.indicatorProps)),null,16)]),_:3},16,["active","block","disabled","tag","class"])}const p=h(y,[["render",v]]);n.BtnActivity=p,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
2
2
  //# sourceMappingURL=btn-activity.umd.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"btn-activity.umd.cjs","sources":["../src/BtnActivity.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { ActivityIndicator } from '@vue-interface/activity-indicator';\nimport { Btn } from '@vue-interface/btn';\nimport { defineComponent } from 'vue';\n\nconst convertAnimationDelayToInt = function (delay: any) {\n const num = parseFloat(delay || 0);\n const matches = delay && delay.match(/m?s/);\n const unit = matches ? matches[0] : false;\n\n let milliseconds;\n\n switch (unit) {\n case 's': // seconds\n milliseconds = num * 1000;\n break;\n case 'ms':\n default:\n milliseconds = num;\n break;\n }\n\n return milliseconds || 0;\n};\n\nconst animated = function (el: HTMLElement, callback: Function) {\n const defaultView = (el.ownerDocument || document).defaultView;\n\n setTimeout(\n callback,\n convertAnimationDelayToInt(\n defaultView?.getComputedStyle(el).animationDuration\n )\n );\n};\n\nexport default defineComponent({\n\n components: {\n ActivityIndicator,\n Btn,\n },\n\n inheritAttrs: false,\n\n props: {\n /**\n\t\t * Make the button appear with the active state.\n\t\t */\n active: Boolean,\n\n /**\n\t\t * Show the activity indicator inside the button.\n\t\t */\n activity: Boolean,\n\n /**\n\t\t * Display the button as block width.\n\t\t */\n block: Boolean,\n\n /**\n\t\t * Disable the button.\n\t\t */\n disabled: Boolean,\n\n /**\n\t\t * The type of activity indicator inside the button.\n\t\t */\n indicator: {\n type: [Object, String],\n default: 'spinner',\n },\n\n /**\n\t\t * The button label.\n\t\t */\n label: {\n type: String,\n default: undefined\n },\n\n /**\n\t\t * The orientation of the activity button inside the button.\n\t\t */\n orientation: {\n type: String,\n default: 'right',\n },\n\n /**\n\t\t * The size of the button.\n\t\t */\n size: {\n type: String,\n default: 'md',\n },\n\n /**\n\t\t * The HTML tag.\n\t\t */\n tag: {\n type: String,\n default: undefined\n },\n\n /**\n\t\t * The variant of the button.\n\t\t */\n variant: {\n type: String,\n default: 'primary',\n },\n },\n\n emits: ['click', 'hide-activity', 'show-activity'],\n\n data() {\n return {\n currentActivity: this.activity,\n };\n },\n\n computed: {\n /**\n\t\t * An object of classes to append to the button.\n\t\t */\n classes() {\n return {\n disabled: this.disabled,\n active: this.active,\n 'btn-activity': this.activity,\n [`btn-activity-${this.orientation.replace('btn-activity-', '')}`]: !!this.orientation,\n [`btn-activity-indicator-${this.indicatorProps.type.replace('btn-activity-indicator-', '')}`]: !!this.indicatorProps.type,\n };\n },\n\n indicatorProps() {\n return Object.assign(\n {\n type: 'spinner',\n },\n (typeof this.indicator === 'string'\n ? {\n type: this.indicator,\n }\n : this.indicator) || {}\n );\n },\n },\n\n watch: {\n activity(value: boolean) {\n if(value) {\n this.showActivity();\n } else {\n this.hideActivity();\n }\n },\n },\n\n mounted() {\n if(this.activity) {\n this.showActivity();\n }\n },\n\n methods: {\n /**\n\t\t * Disable the button.\n\t\t */\n disable(): void {\n this.$el.disabled = true;\n this.$el.classList.add('disabled');\n },\n\n /**\n\t\t * Enable the button.\n\t\t */\n enable(): void {\n this.$el.disabled = false;\n this.$el.classList.remove('disabled');\n },\n\n /**\n\t\t * Hide the activity indicator inside the button.\n\t\t */\n hideActivity(): void {\n this.$el.classList.add('btn-hide-activity');\n\n animated(this.$el, () => {\n if(!this.disabled) {\n \tthis.enable();\n }\n\t\t\t\t\n this.currentActivity = false;\n this.$el.classList.remove('btn-activity', 'btn-hide-activity');\n this.$emit('hide-activity');\n });\n },\n\n /**\n\t\t * Show the activity indicator inside the button.\n\t\t */\n showActivity(): void {\n this.currentActivity = true;\n this.disable();\n\n animated(this.$el, () => {\n this.$el.classList.add('btn-activity');\n this.$emit('show-activity');\n });\n },\n\n /**\n\t\t * Show the activity indicator inside the button.\n\t\t */\n toggle(): void {\n if(!this.currentActivity) {\n this.showActivity();\n } else {\n this.hideActivity();\n }\n },\n },\n});\n</script>\n\n<template>\n <Btn\n :active=\"active\"\n :block=\"block\"\n :disabled=\"disabled\"\n :size=\"size\"\n :tag=\"tag\"\n :variant=\"variant\"\n :class=\"classes\"\n v-bind=\"Object.assign({}, $attrs, { onClick: undefined })\"\n @click=\"!disabled && $emit('click', $event, {\n disable,\n enable,\n toggle,\n showActivity,\n hideActivity,\n })\">\n <slot>{{ label }}</slot>\n <ActivityIndicator v-bind=\"indicatorProps\" />\n </Btn>\n</template>\n\n<style>\n@keyframes btn-activity-in {\n\n\t0%,\n\t100% {\n\t\ttransform: scale(1);\n\t}\n\n\t30% {\n\t\ttransform: scale(0.98);\n\t}\n}\n\n@keyframes btn-activity-out {\n\n\t0%,\n\t100% {\n\t\ttransform: scale(1);\n\t}\n\n\t70% {\n\t\ttransform: scale(0.98);\n\t}\n}\n\n.btn-activity-top,\n.btn.btn-activity-top,\n.btn-activity-bottom,\n.btn.btn-activity-bottom,\n.btn-activity-left,\n.btn.btn-activity-left,\n.btn-activity-right,\n.btn.btn-activity-right {\n\tdisplay: inline-flex;\n\tposition: relative;\n\ttransition: all calc(333ms / 2) ease-in;\n}\n\n.btn-activity-top .activity-indicator,\n.btn-activity-bottom .activity-indicator,\n.btn-activity-left .activity-indicator,\n.btn-activity-right .activity-indicator {\n\topacity: 0;\n\tposition: absolute;\n\tvisibility: hidden;\n\ttransition: opacity 333ms ease-in;\n}\n\n.btn-activity-top,\n.btn-activity-bottom {\n\tflex-direction: column;\n\talign-items: center;\n}\n\n.btn-activity-top .activity-indicator,\n.btn-activity-bottom .activity-indicator {\n\tmargin-left: auto;\n\tmargin-right: auto;\n}\n\n.btn-activity-top {\n\tflex-direction: column-reverse;\n}\n\n.btn-activity-top .activity-indicator {\n\tpadding-bottom: 1em;\n}\n\n.btn-activity-bottom .activity-indicator {\n\tpadding-top: 1em;\n}\n\n.btn-activity-left,\n.btn-activity-right {\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.btn-activity-left {\n\tflex-direction: row-reverse;\n}\n\n.btn-activity-left .activity-indicator {\n\tpadding-right: 1em;\n}\n\n.btn-activity-right .activity-indicator {\n\tpadding-left: 1em;\n}\n\n.btn-activity:not(.btn-link) {\n\tanimation: btn-activity-in 333ms;\n}\n\n.btn-hide-activity:not(.btn-link) {\n\tanimation: btn-activity-out 333ms;\n}\n\n.btn-activity.btn-hide-activity .activity-indicator {\n\topacity: 0;\n}\n\n.btn-activity .activity-indicator {\n\topacity: 1;\n\tvisibility: visible;\n\tposition: relative;\n\tfont-size: 0.55em;\n}\n</style>\n"],"names":["convertAnimationDelayToInt","delay","num","matches","unit","milliseconds","animated","el","callback","defaultView","_sfc_main","defineComponent","ActivityIndicator","Btn","value","_resolveComponent","_openBlock","_createBlock","_component_Btn","_mergeProps","_ctx","_cache","$event","_withCtx","_createTextVNode","_toDisplayString"],"mappings":"0bAKA,MAAMA,EAA6B,SAAUC,EAAY,CAC/C,MAAAC,EAAM,WAAWD,GAAS,CAAC,EAC3BE,EAAUF,GAASA,EAAM,MAAM,KAAK,EACpCG,EAAOD,EAAUA,EAAQ,CAAC,EAAI,GAEhC,IAAAE,EAEJ,OAAQD,EAAM,CACd,IAAK,IACDC,EAAeH,EAAM,IACrB,MACJ,IAAK,KACL,QACmBG,EAAAH,EACf,KACJ,CAEA,OAAOG,GAAgB,CAC3B,EAEMC,EAAW,SAAUC,EAAiBC,EAAoB,CACtD,MAAAC,GAAeF,EAAG,eAAiB,UAAU,YAEnD,WACIC,EACAR,EACIS,GAAA,YAAAA,EAAa,iBAAiBF,GAAI,iBACtC,CAAA,CAER,EAEAG,EAAeC,kBAAgB,CAE3B,WAAY,CAAA,kBACRC,EAAA,kBAAA,IACAC,EAAA,GACJ,EAEA,aAAc,GAEd,MAAO,CAIH,OAAQ,QAKR,SAAU,QAKV,MAAO,QAKP,SAAU,QAKV,UAAW,CACP,KAAM,CAAC,OAAQ,MAAM,EACrB,QAAS,SACb,EAKA,MAAO,CACH,KAAM,OACN,QAAS,MACb,EAKA,YAAa,CACT,KAAM,OACN,QAAS,OACb,EAKA,KAAM,CACF,KAAM,OACN,QAAS,IACb,EAKA,IAAK,CACD,KAAM,OACN,QAAS,MACb,EAKA,QAAS,CACL,KAAM,OACN,QAAS,SACb,CACJ,EAEA,MAAO,CAAC,QAAS,gBAAiB,eAAe,EAEjD,MAAO,CACI,MAAA,CACH,gBAAiB,KAAK,QAAA,CAE9B,EAEA,SAAU,CAIN,SAAU,CACC,MAAA,CACH,SAAU,KAAK,SACf,OAAQ,KAAK,OACb,eAAgB,KAAK,SACrB,CAAC,gBAAgB,KAAK,YAAY,Q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A,EAAE,IAAA,QACOA,EAAM,QACpB,MAAKA,EAAA,OAAA,EAAA,OAAA,OAAA,CAAA,EAAoDA,EAAO,OAAA,CAAA,QAAA,MAAA,CAAA,EAAA,CAAA,QAAAC,EAAc,CAAM,IAAAA,EAAA,CAAA,EAAAC,GAAA,CAAAF,EAAA,UAAAA,EAAA,MAAA,QAAAE,EAAA,CAAc,QAAAF,EAAA,QAAA,OAAAA,EAAA,iFAOnG,CAAA,EAAA,CAAA,QAAAG,EAAA,QAAA,IAAA,yCACAC,EAAAA,gBAA6CC,EAAAA,gBAAAL,EAAA,KAAA,EAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"btn-activity.umd.cjs","sources":["../src/BtnActivity.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { ActivityIndicator } from '@vue-interface/activity-indicator';\nimport { Btn } from '@vue-interface/btn';\nimport { defineComponent } from 'vue';\n\nconst convertAnimationDelayToInt = function (delay: any) {\n const num = parseFloat(delay || 0);\n const matches = delay && delay.match(/m?s/);\n const unit = matches ? matches[0] : false;\n\n let milliseconds;\n\n switch (unit) {\n case 's': // seconds\n milliseconds = num * 1000;\n break;\n case 'ms':\n default:\n milliseconds = num;\n break;\n }\n\n return milliseconds || 0;\n};\n\nconst animated = function (el: HTMLElement, callback: Function) {\n const defaultView = (el.ownerDocument || document).defaultView;\n\n setTimeout(\n callback,\n convertAnimationDelayToInt(\n defaultView?.getComputedStyle(el).animationDuration\n )\n );\n};\n\nexport default defineComponent({\n\n components: {\n ActivityIndicator,\n Btn,\n },\n\n inheritAttrs: false,\n\n props: {\n /**\n\t\t * Make the button appear with the active state.\n\t\t */\n active: Boolean,\n\n /**\n\t\t * Show the activity indicator inside the button.\n\t\t */\n activity: Boolean,\n\n /**\n\t\t * Display the button as block width.\n\t\t */\n block: Boolean,\n\n /**\n\t\t * Disable the button.\n\t\t */\n disabled: Boolean,\n\n /**\n\t\t * The type of activity indicator inside the button.\n\t\t */\n indicator: {\n type: Object,\n required: true\n },\n\n /**\n\t\t * The button label.\n\t\t */\n label: {\n type: String,\n default: undefined\n },\n\n /**\n\t\t * The orientation of the activity button inside the button.\n\t\t */\n orientation: {\n type: String,\n default: 'right',\n },\n\n /**\n\t\t * The HTML tag.\n\t\t */\n tag: {\n type: String,\n default: undefined\n },\n },\n\n emits: ['click', 'hide-activity', 'show-activity'],\n\n data() {\n return {\n currentActivity: this.activity,\n };\n },\n\n computed: {\n /**\n\t\t * An object of classes to append to the button.\n\t\t */\n classes() {\n return {\n 'btn-activity': this.activity,\n [`btn-activity-${this.orientation.replace('btn-activity-', '')}`]: !!this.orientation,\n [`btn-activity-indicator-${this.indicatorProps.type.replace('btn-activity-indicator-', '')}`]: !!this.indicatorProps.type,\n };\n },\n\n indicatorProps() {\n return Object.assign(\n {\n type: 'spinner',\n },\n (typeof this.indicator === 'string'\n ? {\n type: this.indicator,\n }\n : this.indicator) || {}\n );\n },\n },\n\n watch: {\n activity(value: boolean) {\n if(value) {\n this.showActivity();\n } else {\n this.hideActivity();\n }\n },\n },\n\n mounted() {\n if(this.activity) {\n this.showActivity();\n }\n },\n\n methods: {\n /**\n\t\t * Disable the button.\n\t\t */\n disable(): void {\n this.$el.disabled = true;\n this.$el.classList.add('disabled');\n },\n\n /**\n\t\t * Enable the button.\n\t\t */\n enable(): void {\n this.$el.disabled = false;\n this.$el.classList.remove('disabled');\n },\n\n /**\n\t\t * Hide the activity indicator inside the button.\n\t\t */\n hideActivity(): void {\n this.$el.classList.add('btn-hide-activity');\n\n animated(this.$el, () => {\n if(!this.disabled) {\n \tthis.enable();\n }\n\t\t\t\t\n this.currentActivity = false;\n this.$el.classList.remove('btn-activity', 'btn-hide-activity');\n this.$emit('hide-activity');\n });\n },\n\n /**\n\t\t * Show the activity indicator inside the button.\n\t\t */\n showActivity(): void {\n this.currentActivity = true;\n this.disable();\n\n animated(this.$el, () => {\n this.$el.classList.add('btn-activity');\n this.$emit('show-activity');\n });\n },\n\n /**\n\t\t * Show the activity indicator inside the button.\n\t\t */\n toggle(): void {\n if(!this.currentActivity) {\n this.showActivity();\n } else {\n this.hideActivity();\n }\n },\n },\n});\n</script>\n\n<template>\n <Btn\n :active=\"active\"\n :block=\"block\"\n :disabled=\"disabled\"\n :tag=\"tag\"\n :class=\"classes\"\n v-bind=\"Object.assign({}, $attrs, { onClick: undefined })\"\n @click=\"!disabled && $emit('click', $event, {\n disable,\n enable,\n toggle,\n showActivity,\n hideActivity,\n })\">\n <slot>{{ label }}</slot>\n <ActivityIndicator v-bind=\"indicatorProps\" />\n </Btn>\n</template>\n\n<style>\n@keyframes btn-activity-in {\n\n\t0%,\n\t100% {\n\t\ttransform: scale(1);\n\t}\n\n\t30% {\n\t\ttransform: scale(0.98);\n\t}\n}\n\n@keyframes btn-activity-out {\n\n\t0%,\n\t100% {\n\t\ttransform: scale(1);\n\t}\n\n\t70% {\n\t\ttransform: scale(0.98);\n\t}\n}\n\n.btn-activity-top,\n.btn.btn-activity-top,\n.btn-activity-bottom,\n.btn.btn-activity-bottom,\n.btn-activity-left,\n.btn.btn-activity-left,\n.btn-activity-right,\n.btn.btn-activity-right {\n\tdisplay: inline-flex;\n\tposition: relative;\n\ttransition: all calc(333ms / 2) ease-in;\n}\n\n.btn-activity-top .activity-indicator,\n.btn-activity-bottom .activity-indicator,\n.btn-activity-left .activity-indicator,\n.btn-activity-right .activity-indicator {\n\topacity: 0;\n\tposition: absolute;\n\tvisibility: hidden;\n\ttransition: opacity 333ms ease-in;\n}\n\n.btn-activity-top,\n.btn-activity-bottom {\n\tflex-direction: column;\n\talign-items: center;\n}\n\n.btn-activity-top .activity-indicator,\n.btn-activity-bottom .activity-indicator {\n\tmargin-left: auto;\n\tmargin-right: auto;\n}\n\n.btn-activity-top {\n\tflex-direction: column-reverse;\n}\n\n.btn-activity-top .activity-indicator {\n\tpadding-bottom: 1em;\n}\n\n.btn-activity-bottom .activity-indicator {\n\tpadding-top: 1em;\n}\n\n.btn-activity-left,\n.btn-activity-right {\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.btn-activity-left {\n\tflex-direction: row-reverse;\n}\n\n.btn-activity-left .activity-indicator {\n\tpadding-right: 1em;\n}\n\n.btn-activity-right .activity-indicator {\n\tpadding-left: 1em;\n}\n\n.btn-activity:not(.btn-link) {\n\tanimation: btn-activity-in 333ms;\n}\n\n.btn-hide-activity:not(.btn-link) {\n\tanimation: btn-activity-out 333ms;\n}\n\n.btn-activity.btn-hide-activity .activity-indicator {\n\topacity: 0;\n}\n\n.btn-activity .activity-indicator {\n\topacity: 1;\n\tvisibility: visible;\n\tposition: relative;\n\tfont-size: 0.55em;\n}\n</style>\n"],"names":["convertAnimationDelayToInt","delay","num","matches","unit","milliseconds","animated","el","callback","defaultView","_sfc_main","defineComponent","ActivityIndicator","Btn","value","_resolveComponent","_openBlock","_createBlock","_component_Btn","_mergeProps","_ctx","_cache","$event","_withCtx","_createTextVNode","_toDisplayString"],"mappings":"0bAKA,MAAMA,EAA6B,SAAUC,EAAY,CAC/C,MAAAC,EAAM,WAAWD,GAAS,CAAC,EAC3BE,EAAUF,GAASA,EAAM,MAAM,KAAK,EACpCG,EAAOD,EAAUA,EAAQ,CAAC,EAAI,GAEhC,IAAAE,EAEJ,OAAQD,EAAM,CACd,IAAK,IACDC,EAAeH,EAAM,IACrB,MACJ,IAAK,KACL,QACmBG,EAAAH,EACf,KACJ,CAEA,OAAOG,GAAgB,CAC3B,EAEMC,EAAW,SAAUC,EAAiBC,EAAoB,CACtD,MAAAC,GAAeF,EAAG,eAAiB,UAAU,YAEnD,WACIC,EACAR,EACIS,GAAA,YAAAA,EAAa,iBAAiBF,GAAI,iBACtC,CAAA,CAER,EAEAG,EAAeC,kBAAgB,CAE3B,WAAY,CAAA,kBACRC,EAAA,kBAAA,IACAC,EAAA,GACJ,EAEA,aAAc,GAEd,MAAO,CAIH,OAAQ,QAKR,SAAU,QAKV,MAAO,QAKP,SAAU,QAKV,UAAW,CACP,KAAM,OACN,SAAU,EACd,EAKA,MAAO,CACH,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AU,IAAI,cAAc,EACrC,KAAK,MAAM,eAAe,CAAA,CAC7B,CACL,EAKA,QAAe,CACP,KAAK,gBAGL,KAAK,aAAa,EAFlB,KAAK,aAAa,CAI1B,CACJ,CACJ,CAAC,sJAIGS,mBAgBM,KAAA,SAdIC,YAAO,EAAAC,cAAAC,EAAAC,EAAAA,WAAA,CACZ,OAAQC,EAAE,OACV,MAAKA,EAAA,MACL,SAAOA,EAAA,SAAA,IACAA,EAAO,IACd,MAAKA,EAAA,OAAA,EAAA,OAAA,OAAA,CAAA,EAAoDA,EAAO,OAAA,CAAA,QAAA,MAAA,CAAA,EAAA,CAAA,QAAAC,EAAc,CAAM,IAAAA,EAAA,CAAA,EAAAC,GAAA,CAAAF,EAAA,UAAAA,EAAA,MAAA,QAAAE,EAAA,CAAc,QAAAF,EAAA,QAAA,OAAAA,EAAA,iFAOnG,CAAA,EAAA,CAAA,QAAAG,EAAA,QAAA,IAAA,yCACAC,EAAAA,gBAA6CC,EAAAA,gBAAAL,EAAA,KAAA,EAAA,CAAA,CAAA,CAAA"}
@@ -1,4 +1,4 @@
1
- declare const _sfc_main: import("vue").DefineComponent<{
1
+ declare const _default: import("vue").DefineComponent<{
2
2
  /**
3
3
  * Make the button appear with the active state.
4
4
  */
@@ -19,15 +19,15 @@ declare const _sfc_main: import("vue").DefineComponent<{
19
19
  * The type of activity indicator inside the button.
20
20
  */
21
21
  indicator: {
22
- type: (StringConstructor | ObjectConstructor)[];
23
- default: string;
22
+ type: ObjectConstructor;
23
+ required: true;
24
24
  };
25
25
  /**
26
26
  * The button label.
27
27
  */
28
28
  label: {
29
29
  type: StringConstructor;
30
- default: undefined;
30
+ default: any;
31
31
  };
32
32
  /**
33
33
  * The orientation of the activity button inside the button.
@@ -36,26 +36,12 @@ declare const _sfc_main: import("vue").DefineComponent<{
36
36
  type: StringConstructor;
37
37
  default: string;
38
38
  };
39
- /**
40
- * The size of the button.
41
- */
42
- size: {
43
- type: StringConstructor;
44
- default: string;
45
- };
46
39
  /**
47
40
  * The HTML tag.
48
41
  */
49
42
  tag: {
50
43
  type: StringConstructor;
51
- default: undefined;
52
- };
53
- /**
54
- * The variant of the button.
55
- */
56
- variant: {
57
- type: StringConstructor;
58
- default: string;
44
+ default: any;
59
45
  };
60
46
  }, unknown, {
61
47
  currentActivity: boolean;
@@ -65,8 +51,6 @@ declare const _sfc_main: import("vue").DefineComponent<{
65
51
  */
66
52
  classes(): {
67
53
  [x: string]: any;
68
- disabled: any;
69
- active: any;
70
54
  'btn-activity': any;
71
55
  };
72
56
  indicatorProps(): any;
@@ -112,15 +96,15 @@ declare const _sfc_main: import("vue").DefineComponent<{
112
96
  * The type of activity indicator inside the button.
113
97
  */
114
98
  indicator: {
115
- type: (StringConstructor | ObjectConstructor)[];
116
- default: string;
99
+ type: ObjectConstructor;
100
+ required: true;
117
101
  };
118
102
  /**
119
103
  * The button label.
120
104
  */
121
105
  label: {
122
106
  type: StringConstructor;
123
- default: undefined;
107
+ default: any;
124
108
  };
125
109
  /**
126
110
  * The orientation of the activity button inside the button.
@@ -129,41 +113,24 @@ declare const _sfc_main: import("vue").DefineComponent<{
129
113
  type: StringConstructor;
130
114
  default: string;
131
115
  };
132
- /**
133
- * The size of the button.
134
- */
135
- size: {
136
- type: StringConstructor;
137
- default: string;
138
- };
139
116
  /**
140
117
  * The HTML tag.
141
118
  */
142
119
  tag: {
143
120
  type: StringConstructor;
144
- default: undefined;
145
- };
146
- /**
147
- * The variant of the button.
148
- */
149
- variant: {
150
- type: StringConstructor;
151
- default: string;
121
+ default: any;
152
122
  };
153
123
  }>> & {
154
- onClick?: ((...args: any[]) => any) | undefined;
155
- "onHide-activity"?: ((...args: any[]) => any) | undefined;
156
- "onShow-activity"?: ((...args: any[]) => any) | undefined;
124
+ onClick?: (...args: any[]) => any;
125
+ "onHide-activity"?: (...args: any[]) => any;
126
+ "onShow-activity"?: (...args: any[]) => any;
157
127
  }, {
158
128
  label: string;
159
- size: string;
160
129
  active: boolean;
161
130
  block: boolean;
162
131
  disabled: boolean;
163
132
  tag: string;
164
- variant: string;
165
133
  activity: boolean;
166
- indicator: string | Record<string, any>;
167
134
  orientation: string;
168
- }>;
169
- export default _sfc_main;
135
+ }, {}>;
136
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue-interface/btn-activity",
3
- "version": "2.0.0-beta.14",
3
+ "version": "2.0.0-beta.16",
4
4
  "description": "A Vue activity button component.",
5
5
  "type": "module",
6
6
  "files": [
@@ -21,7 +21,7 @@
21
21
  "browserslist": "last 2 versions, > 0.5%, ie >= 11",
22
22
  "scripts": {
23
23
  "dev": "vite",
24
- "build": "vite build",
24
+ "build": "vite build && vue-tsc",
25
25
  "preview": "vite preview"
26
26
  },
27
27
  "repository": {
@@ -44,23 +44,31 @@
44
44
  "homepage": "https://github.com/vue-interface/btn-activity",
45
45
  "dependencies": {
46
46
  "@vue-interface/activity-indicator": "^2.0.0-beta.7",
47
- "@vue-interface/btn": "^3.0.0-beta.4"
47
+ "@vue-interface/btn": "^3.0.0-beta.21"
48
48
  },
49
49
  "peerDependencies": {
50
- "vue": "^3.0.0"
50
+ "vue": "^3.3.4"
51
51
  },
52
52
  "devDependencies": {
53
- "@vitejs/plugin-vue": "^4.0.0",
53
+ "@commitlint/config-conventional": "^17.7.0",
54
+ "@semantic-release/changelog": "^6.0.3",
55
+ "@semantic-release/git": "^10.0.1",
56
+ "@semantic-release/npm": "^10.0.5",
57
+ "@vitejs/plugin-vue": "^4.3.2",
54
58
  "@vue-interface/eslint-config": "^1.0.0-beta.0",
55
59
  "autoprefixer": "^10.4.2",
56
60
  "change-case": "^4.1.2",
61
+ "commitlint": "^17.7.1",
62
+ "dotenv": "^16.3.1",
57
63
  "eslint": "^8.25.0",
64
+ "husky": "^8.0.3",
58
65
  "pascalcase": "^2.0.0",
59
66
  "postcss": "^8.4.6",
67
+ "semantic-release": "^21.0.7",
60
68
  "tailwindcss": "^3.0.18",
61
- "typescript": "^4.9.5",
62
- "vite": "^4.0.0",
63
- "vite-plugin-dts": "^1.7.1",
64
- "vue": "^3.2.40"
69
+ "typescript": "^5.2.2",
70
+ "vite": "^4.4.9",
71
+ "vue": "^3.3.4",
72
+ "vue-tsc": "^1.8.8"
65
73
  }
66
74
  }