@avakhula/ui 0.0.194 → 0.0.196

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": "@avakhula/ui",
3
- "version": "0.0.194",
3
+ "version": "0.0.196",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.umd.cjs",
6
6
  "source": "src/index.js",
@@ -76,10 +76,13 @@ $content-bg: $gray-50;
76
76
  .accordion-content {
77
77
  border-radius: 0 0 4px 4px;
78
78
  border: 1px solid $content-border-color;
79
- padding:10px 15px 15px;
80
79
  overflow: hidden;
81
80
  transition: height 0.3s, padding-top 0.3s, padding-bottom 0.3s;
82
81
  background-color: $content-bg;
82
+
83
+ .accordion-content-wrapper {
84
+ padding: 10px 15px 15px;
85
+ }
83
86
  }
84
87
 
85
88
  &.active {
@@ -13,7 +13,9 @@
13
13
  @leave="leave"
14
14
  >
15
15
  <div v-show="isActive" class="accordion-content">
16
- <slot name="content"></slot>
16
+ <div class="accordion-content-wrapper">
17
+ <slot name="content"></slot>
18
+ </div>
17
19
  </div>
18
20
  </Transition>
19
21
  </div>
@@ -1,5 +1,10 @@
1
1
  <template>
2
- <img v-if="src && !userAvatar" :class="classList" :src="src" :alt="name" />
2
+ <img
3
+ v-if="src && !userAvatar"
4
+ :class="classList"
5
+ :src="src"
6
+ :alt="firstName + '' + lastName"
7
+ />
3
8
 
4
9
  <div
5
10
  v-else-if="src && userAvatar"
@@ -10,7 +15,7 @@
10
15
  }"
11
16
  ></div>
12
17
 
13
- <div v-else-if="validateName" class="empty-avatar" :class="classList">
18
+ <div v-else-if="!validateName" class="empty-avatar" :class="classList">
14
19
  <ib-icon name="camera-outline" />
15
20
  </div>
16
21
 
@@ -26,7 +31,11 @@ import { avatarSizes } from "./constants";
26
31
  export default {
27
32
  name: "IbAvatar",
28
33
  props: {
29
- name: {
34
+ firstName: {
35
+ type: String,
36
+ default: "",
37
+ },
38
+ lastName: {
30
39
  type: String,
31
40
  default: "",
32
41
  },
@@ -49,14 +58,13 @@ export default {
49
58
  return classList;
50
59
  },
51
60
  validateName() {
52
- return this.name?.trim().split(" ").length < 2;
61
+ return (
62
+ this.firstName?.trim().length !== 0 &&
63
+ this.lastName?.trim().length !== 0
64
+ );
53
65
  },
54
66
  initials() {
55
- const words = this.name.split(" ");
56
-
57
- return words.length === 1
58
- ? (words[0][0] + words[0][1]).toUpperCase()
59
- : (words[0][0] + words[1][0]).toUpperCase();
67
+ return this.firstName[0].toUpperCase() + this.lastName[0].toUpperCase();
60
68
  },
61
69
  },
62
70
  components: {
@@ -250,9 +250,6 @@ export default {
250
250
  value(newVal) {
251
251
  this.actualValue = newVal;
252
252
  },
253
- modelValue(newVal) {
254
- this.actualValue = newVal;
255
- },
256
253
  disabled(newVal) {
257
254
  this.$globalEvents.$emit(`label:disabled:${this.id}`, newVal);
258
255
  },
@@ -15,6 +15,7 @@ $radio-border: $gray-500;
15
15
  $radio-border-hover: $blue-300;
16
16
  $radio-border-active: $blue-200;
17
17
  $radio-border-disabled: $neutral-500;
18
+ $radio-text-disabled: $neutral-500;
18
19
  $radio-border-error: $red-800;
19
20
  $radio-border-error-hover: $red-800;
20
21
  $radio-bg-error-hover: $red-50;
@@ -148,7 +149,7 @@ $radio-border-filled-disabled: $neutral-500;
148
149
  }
149
150
 
150
151
  .ib-radio-label {
151
- color: $radio-text-disabled;
152
+ border-color: $radio-text-disabled;
152
153
  }
153
154
  }
154
155
 
@@ -93,7 +93,7 @@
93
93
  :is-multiple="isMultiple"
94
94
  :is-bookmarkable="true"
95
95
  :is-bookmarked="true"
96
- @check="onCheck"
96
+ @check="registerCheck"
97
97
  @toggle-bookmark="toggleBookmark"
98
98
  :uid="uid"
99
99
  :only-end-nodes="onlyEndNodes"
@@ -151,7 +151,7 @@
151
151
  :name="actualName"
152
152
  :parent-auto-check="parentAutoCheck"
153
153
  :is-multiple="isMultiple"
154
- @check="onCheck"
154
+ @check="registerCheck"
155
155
  @toggle-bookmark="toggleBookmark"
156
156
  :uid="uid"
157
157
  :only-end-nodes="onlyEndNodes"
@@ -214,7 +214,7 @@
214
214
  :parent-auto-check="parentAutoCheck"
215
215
  :is-multiple="isMultiple"
216
216
  :is-bookmarkable="isBookmarkable"
217
- @check="onCheck"
217
+ @check="registerCheck"
218
218
  @toggle-bookmark="toggleBookmark"
219
219
  :uid="uid"
220
220
  :only-end-nodes="onlyEndNodes"
@@ -765,18 +765,6 @@ export default {
765
765
  checkIfOptionsChecked(options) {
766
766
  return options.every((option) => option.checked);
767
767
  },
768
- onCheck(option, isChecked, isDirectChild) {
769
- this.registerCheck(option, isChecked, isDirectChild);
770
- const values = Object.keys(this.selected);
771
-
772
- if (this.isMultiple) {
773
- this.$emit("update:modelValue", values);
774
- this.$emit("input", values);
775
- } else {
776
- this.$emit("update:modelValue", values[0]);
777
- this.$emit("input", values[0]);
778
- }
779
- },
780
768
  registerCheck(option, isChecked, isDirectChild) {
781
769
  if (isChecked) {
782
770
  option.checked = true;
@@ -785,6 +773,8 @@ export default {
785
773
  !(this.onlyEndNodes && option.children && option.children.length)
786
774
  ) {
787
775
  this.selected[option.id] = option;
776
+ this.$emit("update:modelValue", Object.keys(this.selected));
777
+ this.$emit("input", Object.keys(this.selected));
788
778
  }
789
779
  } else {
790
780
  const selectedOptionKey = Object.keys(this.selected)[0];
@@ -799,6 +789,8 @@ export default {
799
789
  } else {
800
790
  delete this.selected[option.id];
801
791
  option.checked = false;
792
+ this.$emit("update:modelValue", Object.keys(this.selected));
793
+ this.$emit("input", Object.keys(this.selected));
802
794
  }
803
795
 
804
796
  this.toggleDuplicateOptions(this.actualOptions, option.id, isChecked);
@@ -823,9 +815,6 @@ export default {
823
815
  this.traverseTree(this.actualOptions, (option) => {
824
816
  this.registerCheck(option, this.allOptionsIsChecked, false);
825
817
  });
826
-
827
- this.$emit("update:modelValue", Object.keys(this.selected));
828
- this.$emit("input", Object.keys(this.selected));
829
818
  },
830
819
  traverseTree(tree, callback) {
831
820
  tree.forEach((option) => {