@radiantabyss/vue-components 1.5.1 → 1.5.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radiantabyss/vue-components",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
4
4
  "author": "radiantabyss.com",
5
5
  "license": "ISC",
6
6
  "eslintConfig": {
@@ -0,0 +1,17 @@
1
+ <script>
2
+ export default {
3
+ name: 'BadgeComponent',
4
+ props: {
5
+ type: {
6
+ type: String,
7
+ required: true,
8
+ }
9
+ },
10
+ }
11
+ </script>
12
+
13
+ <template>
14
+ <div class="badge" :class="`badge--${type}`" :title="__(Str.ucwords(type))">
15
+ <sprite :id="type" />
16
+ </div>
17
+ </template>
@@ -12,8 +12,7 @@ export default {
12
12
 
13
13
  const slot_text = slot_nodes
14
14
  .map(node => node.children)
15
- .join('')
16
- .trim();
15
+ .join('');
17
16
 
18
17
  return slot_text ? __(slot_text) : null; // Return the processed slot text
19
18
  },
@@ -18,6 +18,11 @@ export default {
18
18
  required: false,
19
19
  default: () => { return __('Upload Image'); },
20
20
  },
21
+ allowed_extensions: {
22
+ type: Array,
23
+ required: false,
24
+ default() { return ['jpg', 'jpeg', 'png', 'webp', 'svg']; },
25
+ },
21
26
  },
22
27
  emits: ['update:modelValue'],
23
28
  data() {
@@ -20,10 +20,6 @@ export default {
20
20
  this.value = this.modelValue;
21
21
  },
22
22
 
23
- handleInput() {
24
- this.$emit('update:modelValue', this.$refs.input.value);
25
- },
26
-
27
23
  toggle() {
28
24
  this.show = !this.show;
29
25
  },
@@ -43,7 +39,7 @@ export default {
43
39
  <div class="password">
44
40
  <input :type="show ? 'text' : 'password'"
45
41
  class="input"
46
- name="password"
42
+ ref="input"
47
43
  v-model="value"
48
44
  @input="$emit('update:modelValue', value)"
49
45
  />
@@ -169,7 +169,7 @@ export default {
169
169
  :enable_modal="input.autocomplete_settings.enable_modal || false"
170
170
  :can_create="input.autocomplete_settings.can_create || false"
171
171
  v-model="item[input_name]"
172
- v-if="input.type == 'autocomplete'"
172
+ v-else-if="input.type == 'autocomplete'"
173
173
  />
174
174
  </div>
175
175
 
@@ -15,6 +15,7 @@ export default {
15
15
  emits: ['update:modelValue'],
16
16
  data() {
17
17
  return {
18
+ mounted: false,
18
19
  hour: 0,
19
20
  minute: 0,
20
21
  view: 'none',
@@ -26,6 +27,20 @@ export default {
26
27
  },
27
28
  },
28
29
  methods: {
30
+ mount() {
31
+ let date = new Date();
32
+ let split = this.modelValue.split(':');
33
+ this.hour = isNaN(parseFloat(split[0])) ? date.getHours() : parseFloat(split[0]);
34
+ this.minute = isNaN(parseFloat(split[1])) ? date.getMinutes() : parseFloat(split[1]);
35
+ this.mounted = true;
36
+
37
+ if ( !this.modelValue ) {
38
+ this.watch = false;
39
+ this.$emit('update:modelValue', this.value);
40
+ this.watch = true;
41
+ }
42
+ },
43
+
29
44
  show(view) {
30
45
  this.view = view;
31
46
  },
@@ -35,9 +50,11 @@ export default {
35
50
  },
36
51
 
37
52
  select(component, i) {
53
+ this.watch = false;
38
54
  this[component] = i;
39
55
  this.view = 'time';
40
56
  this.$emit('update:modelValue', this.value);
57
+ this.watch = true;
41
58
  },
42
59
 
43
60
  changeComponent(component, direction) {
@@ -57,12 +74,17 @@ export default {
57
74
  },
58
75
  },
59
76
  mounted() {
60
- let date = new Date();
61
- let split = this.modelValue.split(':');
62
- this.hour = isNaN(parseFloat(split[0])) ? date.getHours() : parseFloat(split[0]);
63
- this.minute = isNaN(parseFloat(split[1])) ? date.getMinutes() : parseFloat(split[1]);
64
- this.$emit('update:modelValue', this.value);
65
- }
77
+ this.mount();
78
+ },
79
+ watch: {
80
+ modelValue() {
81
+ if ( !this.watch ) {
82
+ return;
83
+ }
84
+
85
+ this.mount();
86
+ },
87
+ },
66
88
  }
67
89
  </script>
68
90
 
@@ -0,0 +1,47 @@
1
+ .badge {
2
+ display: inline-flex;
3
+ flex: 0 0 auto;
4
+ justify-content: center;
5
+ align-items: center;
6
+ width: 30px;
7
+ height: 30px;
8
+ border-radius: 30px;
9
+ color: $white;
10
+
11
+ svg {
12
+ position: relative;
13
+ width: 20px;
14
+ height: 20px;
15
+ }
16
+ }
17
+
18
+ .badge--client {
19
+ background: #0983a8;
20
+ }
21
+
22
+ .badge--project {
23
+ background: #8004b9;
24
+
25
+ svg {
26
+ top: -2px;
27
+ }
28
+ }
29
+
30
+ .badge--invoice {
31
+ background: #09a81a;
32
+
33
+ svg {
34
+ width: 18px;
35
+ height: 18px;
36
+ }
37
+ }
38
+
39
+ .badge--small {
40
+ width: 24px;
41
+ height: 24px;
42
+
43
+ svg {
44
+ width: 18px;
45
+ height: 18px;
46
+ }
47
+ }
@@ -29,10 +29,6 @@
29
29
  }
30
30
  }
31
31
 
32
- .tabs--with-buttons & {
33
- flex: 1 1 auto;
34
- }
35
-
36
32
  @include theme() {
37
33
  border-color: $border--dark;
38
34
 
@@ -55,15 +51,14 @@
55
51
  }
56
52
 
57
53
  .tabs__content {
54
+ flex: 0 0 100%;
58
55
  margin-top: 20px;
59
56
  }
60
57
 
61
58
  .tabs__buttons {
62
59
  display: flex;
60
+ flex: 1 1 auto;
61
+ justify-content: flex-end;
63
62
  align-items: center;
64
63
  padding-left: 30px;
65
64
  }
66
-
67
- .tabs__content {
68
- flex: 0 0 100%;
69
- }