@avakhula/ui 0.1.10 → 0.1.11

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.1.10",
3
+ "version": "0.1.11",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.umd.cjs",
6
6
  "source": "src/index.js",
@@ -27,7 +27,7 @@
27
27
  :aria-labelledby="'accordion' + uuid"
28
28
  >
29
29
  <div class="accordion-content-wrapper">
30
- <slot name="content"></slot>
30
+ <slot></slot>
31
31
  </div>
32
32
  </div>
33
33
  </Transition>
@@ -69,6 +69,8 @@ $checkbox-bg-indeterminate: $blue-800;
69
69
  border-radius: 2px;
70
70
  height: 16px;
71
71
  width: 16px;
72
+ min-height: 16px;
73
+ min-width: 16px;
72
74
  border: 1.25px solid;
73
75
  border-color: $checkbox-border;
74
76
  background-color: $checkbox-bg;
@@ -128,12 +130,13 @@ $checkbox-bg-indeterminate: $blue-800;
128
130
  }
129
131
  }
130
132
 
131
- &.checkbox-disabled {
132
- .checkbox-input {
133
- background-color: $checkbox-bg-filed-disabled;
134
- border-color: $checkbox-border-filed-disabled;
135
- }
136
- }
133
+ // &.checkbox-readonly,
134
+ // &.checkbox-disabled {
135
+ // .checkbox-input {
136
+ // background-color: $checkbox-bg-filed-disabled;
137
+ // border-color: $checkbox-border-filed-disabled;
138
+ // }
139
+ // }
137
140
  }
138
141
 
139
142
  &.ib-checkbox-indeterminate {
@@ -163,6 +166,7 @@ $checkbox-bg-indeterminate: $blue-800;
163
166
  }
164
167
  }
165
168
 
169
+ &.ib-checkbox-readonly,
166
170
  &.ib-checkbox-disabled {
167
171
  cursor: not-allowed;
168
172
 
@@ -196,10 +200,6 @@ $checkbox-bg-indeterminate: $blue-800;
196
200
  }
197
201
  }
198
202
 
199
- .ib-checkbox-label {
200
- color: $checkbox-text-color-disabled;
201
- }
202
-
203
203
  &.ib-checkbox-filled,
204
204
  &.ib-checkbox-indeterminate{
205
205
  .ib-checkbox-input {
@@ -218,6 +218,12 @@ $checkbox-bg-indeterminate: $blue-800;
218
218
  }
219
219
  }
220
220
  }
221
+
222
+ &.ib-checkbox-disabled {
223
+ .ib-checkbox-label {
224
+ color: $checkbox-text-color-disabled;
225
+ }
226
+ }
221
227
  }
222
228
 
223
229
  &.ib-has-error {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div role="checkbox" :class="this.$attrs.class" :aria-checked="checked ? true : false">
2
+ <div role="checkbox" class="ib-checkbox-wrapper" :class="this.$attrs.class" :aria-checked="checked ? true : false">
3
3
  <label
4
4
  v-bind="attrs"
5
5
  :for="id"
@@ -12,10 +12,10 @@
12
12
  :name="name"
13
13
  :id="id"
14
14
  :value="value"
15
- :checked="checked"
16
15
  :disabled="disabled"
17
16
  :required="required"
18
- @click="onChange"
17
+ v-model="checked"
18
+ @click.prevent="onChange"
19
19
  />
20
20
  <div class="ib-checkbox-body">
21
21
  <span
@@ -80,6 +80,10 @@ export default {
80
80
  type: Boolean,
81
81
  default: false,
82
82
  },
83
+ readonly: {
84
+ type: Boolean,
85
+ default: false,
86
+ },
83
87
  disabled: {
84
88
  type: Boolean,
85
89
  default: false,
@@ -102,6 +106,7 @@ export default {
102
106
  this.checked = value;
103
107
  },
104
108
  modelValue(value) {
109
+ this.$emit("update:modelValue", this.modelValue);
105
110
  this.checked = value;
106
111
  },
107
112
  },
@@ -112,6 +117,8 @@ export default {
112
117
  },
113
118
  methods: {
114
119
  onChange() {
120
+ if (this.readonly) return;
121
+
115
122
  this.checked = !this.checked;
116
123
  this.$emit("update:modelValue", this.checked);
117
124
  this.$emit("input", this.checked);
@@ -124,6 +131,7 @@ export default {
124
131
  "ib-has-error": this.error,
125
132
  "ib-checkbox-filled": this.checked,
126
133
  "ib-checkbox-disabled": this.disabled,
134
+ "ib-checkbox-readonly": this.readonly,
127
135
  "ib-checkbox-indeterminate": this.indeterminate,
128
136
  };
129
137
  },
@@ -16,16 +16,22 @@
16
16
  &-btn-m {
17
17
  width: 36px;
18
18
  height: 36px;
19
+ min-width: 36px;
20
+ min-height: 36px;
19
21
  }
20
22
 
21
23
  &-btn-s {
22
24
  width: 24px;
23
25
  height: 24px;
26
+ min-width: 24px;
27
+ min-height: 24px;
24
28
  }
25
29
 
26
30
  &-btn-xs {
27
31
  width: 16px;
28
32
  height: 16px;
33
+ min-width: 16px;
34
+ min-height: 16px;
29
35
 
30
36
  .ib-icon {
31
37
  position: absolute;
@@ -119,7 +119,7 @@ $item-hover-bg: $gray-100;
119
119
  }
120
120
  }
121
121
 
122
- .ib-checkbox {
122
+ .ib-checkbox-wrapper {
123
123
  transition: background-color 0.3s;
124
124
 
125
125
  .ib-checkbox-body {
@@ -284,11 +284,14 @@ body.modal-open {
284
284
  @include Ib-H2-medium;
285
285
  color: $modal-title-color;
286
286
  margin-bottom: 15px;
287
+ padding-right: 25px;
287
288
  }
288
289
 
289
- .modal-content.without-title {
290
- padding-right: 25px;
291
- padding-top: 4px;
290
+ .modal-content {
291
+ .without-title {
292
+ padding-right: 25px;
293
+ padding-top: 4px;
294
+ }
292
295
  }
293
296
 
294
297
  .modal-close-icon {
@@ -36,12 +36,23 @@ import IbTabDropdown from "./TabDropdown.vue";
36
36
  import getHrefFromId from "../../helpers/getHrefFromID";
37
37
  export default {
38
38
  name: "IbTabs",
39
+ props: {
40
+ selectedTabId: {
41
+ type: String,
42
+ default: "",
43
+ },
44
+ },
39
45
  data() {
40
46
  return {
41
47
  tabs: [],
42
- selectedTab: "",
48
+ selectedTab: this.selectTabId,
43
49
  };
44
50
  },
51
+ watch: {
52
+ selectedTabId(newId) {
53
+ this.selectTab(newId);
54
+ }
55
+ },
45
56
  created() {
46
57
  const slotItems = [];
47
58
  this.$slots.default().forEach(item => {
@@ -98,6 +109,7 @@ export default {
98
109
  components: {
99
110
  IbTabDropdown,
100
111
  },
112
+ emits: ["changeTab"]
101
113
  };
102
114
  </script>
103
115
  <style lang="scss" scoped>
@@ -12,7 +12,7 @@
12
12
  padding: 0;
13
13
  @include Ib-H4-medium;
14
14
  position: relative;
15
- margin-bottom: 100px;
15
+ margin-bottom: 15px;
16
16
 
17
17
  &::after {
18
18
  content: '';
@@ -53,7 +53,7 @@ export default {
53
53
  padding: 10px;
54
54
  max-width: 240px;
55
55
  box-shadow: $ib-shadow-1;
56
- z-index: 9999;
56
+ z-index: 10002;
57
57
 
58
58
  &.ib-tooltip-large {
59
59
  box-shadow: $ib-shadow-2;
@@ -49,6 +49,7 @@
49
49
  :id="'input' + id"
50
50
  :is-checked="isChecked(option)"
51
51
  :disabled="option.isDisabled"
52
+ :readonly="option.readonly"
52
53
  autocomplete="off"
53
54
  autocorrect="off"
54
55
  autocapitalize="off"
@@ -21,7 +21,7 @@ const testData = [
21
21
  initiallyVisible: true,
22
22
  visible: true,
23
23
  isDisabled: false,
24
- checked: true,
24
+ readonly: true,
25
25
  isChildrenVisible: true,
26
26
  },
27
27
  {
@@ -31,7 +31,6 @@ const testData = [
31
31
  initiallyVisible: true,
32
32
  visible: true,
33
33
  isDisabled: false,
34
- checked: false,
35
34
  isChildrenVisible: true,
36
35
  },
37
36
  {
@@ -41,7 +40,6 @@ const testData = [
41
40
  initiallyVisible: true,
42
41
  visible: true,
43
42
  isDisabled: false,
44
- checked: false,
45
43
  isChildrenVisible: true,
46
44
  },
47
45
  {
@@ -51,12 +49,11 @@ const testData = [
51
49
  initiallyVisible: true,
52
50
  visible: true,
53
51
  isDisabled: false,
54
- checked: false,
55
52
  isChildrenVisible: true,
56
53
  },
57
54
  ];
58
55
 
59
- const a = [{"id":1,"title":"Moodle","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":2,"title":"Canvas","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":true},{"id":3,"title":"Blackboard","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":4,"title":"D2l","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":5,"title":"Google Classroom","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":9,"title":"Zoom","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":11,"title":"Ellucian Banner","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":12,"title":"Ellucian Colleague Banner","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":16,"title":"Ilias","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":17,"title":"Blackboard Collaborate","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":18,"title":"Sakai","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":20,"title":"Moodle Workplace","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":21,"title":"Totara","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":22,"title":"Qwickly","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":24,"title":"Mongoose Cadence","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":27,"title":"Workday Raas","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":28,"title":"Hubspot","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":29,"title":"Open Lms Work","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":30,"title":"Totara 18","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":31,"title":"Blackboard Data","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false}]
56
+ // const a = [{"id":1,"title":"Moodle","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":2,"title":"Canvas","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":true},{"id":3,"title":"Blackboard","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":4,"title":"D2l","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":5,"title":"Google Classroom","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":9,"title":"Zoom","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":11,"title":"Ellucian Banner","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":12,"title":"Ellucian Colleague Banner","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":16,"title":"Ilias","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":17,"title":"Blackboard Collaborate","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":18,"title":"Sakai","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":20,"title":"Moodle Workplace","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":21,"title":"Totara","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":22,"title":"Qwickly","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":24,"title":"Mongoose Cadence","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":27,"title":"Workday Raas","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":28,"title":"Hubspot","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":29,"title":"Open Lms Work","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":30,"title":"Totara 18","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false},{"id":31,"title":"Blackboard Data","initiallyVisible":true,"visible":true,"isDisabled":false,"checked":false}]
60
57
 
61
58
  const testData1 = [
62
59
  {
@@ -66,7 +63,6 @@ const testData1 = [
66
63
  initiallyVisible: true,
67
64
  visible: true,
68
65
  isDisabled: false,
69
- checked: true,
70
66
  isChildrenVisible: true,
71
67
  },
72
68
  {
@@ -76,7 +72,6 @@ const testData1 = [
76
72
  initiallyVisible: true,
77
73
  visible: true,
78
74
  isDisabled: false,
79
- checked: false,
80
75
  isChildrenVisible: true,
81
76
  },
82
77
  {
@@ -86,7 +81,6 @@ const testData1 = [
86
81
  initiallyVisible: true,
87
82
  visible: true,
88
83
  isDisabled: false,
89
- checked: false,
90
84
  isChildrenVisible: true,
91
85
  },
92
86
  {
@@ -106,7 +100,6 @@ const testData1 = [
106
100
  initiallyVisible: true,
107
101
  visible: true,
108
102
  isDisabled: false,
109
- checked: false,
110
103
  isChildrenVisible: true,
111
104
  },
112
105
 
@@ -117,7 +110,6 @@ const testData1 = [
117
110
  initiallyVisible: true,
118
111
  visible: true,
119
112
  isDisabled: false,
120
- checked: false,
121
113
  isChildrenVisible: true,
122
114
  },
123
115
 
@@ -128,7 +120,6 @@ const testData1 = [
128
120
  initiallyVisible: true,
129
121
  visible: true,
130
122
  isDisabled: false,
131
- checked: false,
132
123
  isChildrenVisible: true,
133
124
  },
134
125
 
@@ -149,7 +140,6 @@ const testData1 = [
149
140
  initiallyVisible: true,
150
141
  visible: true,
151
142
  isDisabled: false,
152
- checked: false,
153
143
  isChildrenVisible: true,
154
144
  },
155
145
  {
@@ -159,7 +149,6 @@ const testData1 = [
159
149
  initiallyVisible: true,
160
150
  visible: true,
161
151
  isDisabled: false,
162
- checked: false,
163
152
  isChildrenVisible: true,
164
153
  },
165
154
  {
@@ -169,7 +158,6 @@ const testData1 = [
169
158
  initiallyVisible: true,
170
159
  visible: true,
171
160
  isDisabled: false,
172
- checked: false,
173
161
  isChildrenVisible: true,
174
162
  },
175
163
  ];
@@ -266,7 +254,7 @@ CustomTrigger.args = {
266
254
  placeholder: "Please select",
267
255
  ariaLabel: "Search",
268
256
  clearButtonMessage: "Clear",
269
- options: a,
257
+ // options: a,
270
258
  initialSize: {
271
259
  left: 0,
272
260
  right: 100,
@@ -267,6 +267,10 @@ import IbIconButton from "../IconButton/IconButton.vue";
267
267
  import IbAlert from "../Alert/Alert.vue";
268
268
  import List from "../List.vue";
269
269
 
270
+ function copy(data) {
271
+ return JSON.parse(JSON.stringify(data));
272
+ }
273
+
270
274
  export default {
271
275
  name: "IbTreeSelect",
272
276
  inject: ["LANG_COMPONENTS"],
@@ -435,10 +439,13 @@ export default {
435
439
  this.setPreparedValues(this.actualOptions, false);
436
440
  }
437
441
  },
438
- modelValue(value) {
439
- this.val = value;
440
- this.actualOptions = [];
441
- this.setPreparedValues();
442
+ modelValue: {
443
+ handler(value) {
444
+ this.val = value;
445
+ this.actualOptions = [];
446
+ this.setPreparedValues();
447
+ },
448
+ deep: true,
442
449
  },
443
450
  val(value) {
444
451
  if (
@@ -454,15 +461,21 @@ export default {
454
461
  });
455
462
  }
456
463
  },
457
- options() {
464
+ options: {
465
+ handler(newOptions) {
466
+ this.initialOptions = copy(newOptions);
467
+ },
468
+ deep: true,
469
+ },
470
+ initialOptions(newOptions) {
458
471
  let isOptionsEqual = true;
459
472
 
460
- if (typeof this.options === "function") {
473
+ if (typeof newOptions === "function") {
461
474
  isOptionsEqual = false;
462
475
  } else {
463
476
  const result = [];
464
477
 
465
- const options = this.options;
478
+ const options = newOptions;
466
479
  Array.prototype.forEach.call(options, (option) => {
467
480
  if (option.id !== undefined) result.push(option.id);
468
481
  });
@@ -516,6 +529,7 @@ export default {
516
529
  };
517
530
 
518
531
  return {
532
+ initialOptions: copy(this.options),
519
533
  val: this.modelValue ? this.modelValue : this.value,
520
534
  size: {
521
535
  left: (this.initialSize && this.initialSize.left) || 0,
@@ -658,7 +672,7 @@ export default {
658
672
  this.defaultFilter(options);
659
673
  },
660
674
  setPreparedValues(opt) {
661
- let options = opt || this.options;
675
+ let options = opt || this.initialOptions;
662
676
  if (this.alphabetSort) {
663
677
  options = options.sort((a, b) =>
664
678
  a.title.toLowerCase().localeCompare(b.title.toLowerCase())
@@ -722,6 +736,7 @@ export default {
722
736
  option.initiallyVisible =
723
737
  typeof option.visible === "undefined" ? true : option.visible;
724
738
  option.visible = option.initiallyVisible;
739
+ option.readonly = option.readonly ? true : false;
725
740
  option.isDisabled = false;
726
741
 
727
742
  option.checked = this.isMultiple
@@ -822,7 +837,7 @@ export default {
822
837
  this.$refs.dropdown.close();
823
838
  },
824
839
  checkIfOptionsChecked(options) {
825
- return options.every((option) => option.checked);
840
+ return options.every((option) => option.checked || option.readonly);
826
841
  },
827
842
  registerCheck(option, isChecked, isDirectChild) {
828
843
  if (isChecked) {
@@ -872,6 +887,7 @@ export default {
872
887
  manageAll() {
873
888
  this.allOptionsIsChecked = !this.allOptionsIsChecked;
874
889
  this.traverseTree(this.actualOptions, (option) => {
890
+ if (option.readonly) return;
875
891
  this.registerCheck(option, this.allOptionsIsChecked, false);
876
892
  });
877
893
  },