@avakhula/ui 0.1.13 → 0.1.15

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 (116) hide show
  1. package/.prettierrc.json +0 -0
  2. package/.storybook/intelliboardTheme.js +0 -0
  3. package/.storybook/manager.js +0 -0
  4. package/.storybook/scss-loader.scss +0 -0
  5. package/.storybook/withSource.js +0 -0
  6. package/README.md +0 -0
  7. package/dist/index.js +9028 -7513
  8. package/dist/index.umd.cjs +76 -73
  9. package/dist/style.css +1 -1
  10. package/index.html +0 -0
  11. package/package.json +4 -3
  12. package/src/App.vue +5 -128
  13. package/src/EventEmmiter.js +0 -0
  14. package/src/assets/scss/mixins/dropdown-list-item.scss +13 -1
  15. package/src/assets/scss/mixins.scss +0 -0
  16. package/src/assets/scss/reset.scss +0 -0
  17. package/src/assets/scss/style.scss +0 -0
  18. package/src/assets/scss/typography.scss +0 -0
  19. package/src/components/Alert/Alert.vue +5 -0
  20. package/src/components/Alert/alert.scss +6 -1
  21. package/src/components/Avatar/Avatar.stories.js +5 -1
  22. package/src/components/Avatar/Avatar.vue +25 -2
  23. package/src/components/Avatar/constants.js +6 -0
  24. package/src/components/Badge/Badge.stories.js +0 -0
  25. package/src/components/Breadcrumbs/Breadcrumbs.vue +17 -7
  26. package/src/components/Button/Button.stories.js +0 -0
  27. package/src/components/Button/Button.vue +19 -3
  28. package/src/components/Button/button.scss +5 -0
  29. package/src/components/Button/constants.js +0 -0
  30. package/src/components/ButtonGroup/ButtonGroup.vue +0 -0
  31. package/src/components/Chips/Chips.stories.js +30 -0
  32. package/src/components/Chips/Chips.vue +125 -0
  33. package/src/components/Dropdown/Dropdown.spec.js +0 -0
  34. package/src/components/Dropdown/DropdownDivider.vue +0 -0
  35. package/src/components/Dropdown/DropdownItem.vue +26 -4
  36. package/src/components/Dropdown/DropdownList.vue +0 -0
  37. package/src/components/Dropdown/constants.js +0 -0
  38. package/src/components/Form/CharactersCount.vue +10 -7
  39. package/src/components/Form/Checkbox/Checkbox.vue +25 -11
  40. package/src/components/Form/CheckboxGroup/CheckboxGroup.vue +15 -0
  41. package/src/components/Form/CheckboxGroup/readme.mdx +2 -0
  42. package/src/components/Form/DatePicker/DatePicker.scss +352 -261
  43. package/src/components/Form/DatePicker/DatePicker.vue +72 -17
  44. package/src/components/Form/DatePicker/Icons/chevron-back.js +0 -0
  45. package/src/components/Form/DatePicker/Icons/chevron-forward.js +0 -0
  46. package/src/components/Form/FormGroup/FormGroup.stories.js +0 -0
  47. package/src/components/Form/FormGroup/FormGroup.vue +3 -3
  48. package/src/components/Form/FormGroup/FormGroupSet.stories.js +0 -0
  49. package/src/components/Form/FormGroup/FormGroupSet.vue +0 -0
  50. package/src/components/Form/Input/Input.vue +116 -13
  51. package/src/components/Form/Input/input.scss +61 -2
  52. package/src/components/Form/Label/Label.vue +22 -10
  53. package/src/components/Form/PhoneInput/PhoneInput.vue +26 -12
  54. package/src/components/Form/PhoneInput/phoneInput.scss +38 -6
  55. package/src/components/Form/Radio/Radio.vue +16 -44
  56. package/src/components/Form/Radio/radio.scss +5 -2
  57. package/src/components/Form/TextEditor/TextEditor.vue +117 -22
  58. package/src/components/Form/TextEditor/icons/svg/chevron-down.svg +0 -0
  59. package/src/components/Form/TextEditor/icons/toolbarIcons.js +0 -0
  60. package/src/components/Form/TextEditor/plugins/alphabetList.js +0 -0
  61. package/src/components/Form/TextEditor/textEditor.scss +56 -32
  62. package/src/components/Form/Textarea/Textarea.spec.js +0 -0
  63. package/src/components/Form/Textarea/Textarea.vue +19 -6
  64. package/src/components/Form/Textarea/textarea.scss +30 -2
  65. package/src/components/Icon.vue +0 -0
  66. package/src/components/IconButton/IconButton.scss +11 -0
  67. package/src/components/IconButton/IconButton.stories.js +0 -0
  68. package/src/components/IconButton/IconButton.vue +6 -9
  69. package/src/components/IconButton/constants.js +0 -0
  70. package/src/components/Modal/Modal.vue +42 -9
  71. package/src/components/Pagination/LimitSelector.vue +5 -0
  72. package/src/components/Pagination/Pagination.stories.js +0 -0
  73. package/src/components/Pagination/Pagination.vue +9 -2
  74. package/src/components/Panel/Panel.vue +87 -6
  75. package/src/components/Popover/Popover.stories.js +0 -0
  76. package/src/components/Popover/Popover.vue +47 -19
  77. package/src/components/Popover/popover.scss +27 -7
  78. package/src/components/ProgressBar/ProgressBar.stories.js +0 -0
  79. package/src/components/Sorting/Sorting.vue +24 -26
  80. package/src/components/Sorting/constants.js +0 -0
  81. package/src/components/SplitButton/SplitButton.vue +51 -8
  82. package/src/components/SplitButton/SplitButtonItem.vue +13 -1
  83. package/src/components/SplitButton/constants.js +0 -0
  84. package/src/components/Table/Cells/Cell.vue +0 -0
  85. package/src/components/Table/Cells/CheckboxCell.vue +0 -0
  86. package/src/components/Table/Row.vue +0 -0
  87. package/src/components/Table/Table.stories.js +0 -0
  88. package/src/components/Table/Table.vue +0 -0
  89. package/src/components/Tabs/Tab.vue +4 -0
  90. package/src/components/Tabs/Tabs.vue +5 -0
  91. package/src/components/Tabs/tabs.scss +8 -2
  92. package/src/components/TagPill/TagPill.vue +6 -0
  93. package/src/components/TagPill/constants.js +0 -0
  94. package/src/components/ToggleTip/ToggleTip.stories.js +0 -0
  95. package/src/components/ToggleTip/ToggleTip.vue +0 -0
  96. package/src/components/Tooltip/Tooltip.stories.js +0 -0
  97. package/src/components/Tooltip/Tooltip.vue +1 -1
  98. package/src/components/TreeSelect/Option.vue +48 -16
  99. package/src/components/TreeSelect/Select.vue +101 -39
  100. package/src/components/TreeSelect/mixins/InfinityLoaderMixin.js +40 -0
  101. package/src/components/TreeSelect/scss/option.scss +31 -0
  102. package/src/components/TreeSelect/scss/select.scss +48 -2
  103. package/src/constants/events.js +0 -0
  104. package/src/constants/keyCodes.js +1 -0
  105. package/src/directives/outside/outside.js +0 -0
  106. package/src/directives/tooltip/TooltipController.js +2 -0
  107. package/src/directives/tooltip/textOverflowTooltip.js +3 -1
  108. package/src/directives/tooltip/tooltip.js +15 -0
  109. package/src/helpers/generateUID.js +0 -0
  110. package/src/helpers/getHrefFromID.js +0 -0
  111. package/src/helpers/multiLineOverflows.js +0 -0
  112. package/src/helpers/stripHtml.js +4 -0
  113. package/src/index.js +2 -0
  114. package/src/stories/link.stories.js +0 -0
  115. package/static/Logo.svg +0 -0
  116. package/vite.config.js +0 -0
@@ -1,53 +1,81 @@
1
1
  <template>
2
- <Transition>
3
- <div v-show="isVisible" :class="classes">
4
- <slot></slot>
5
- </div>
6
- </Transition>
2
+ <Teleport to="body" v-if="attachToBody">
3
+ <Transition>
4
+ <div ref="popover" v-show="isVisible" :class="classes">
5
+ <slot></slot>
6
+ </div>
7
+ </Transition>
8
+ </Teleport>
9
+
10
+ <Transition v-else>
11
+ <div ref="popover" v-show="isVisible" :class="classes">
12
+ <slot></slot>
13
+ </div>
14
+ </Transition>
7
15
  </template>
8
16
 
9
17
  <script>
10
- import { popoverPosition } from "./constants";
18
+ import { computePosition, autoPlacement } from '@floating-ui/dom';
11
19
 
12
20
  export default {
13
21
  name: "IbPopover",
14
22
  props: {
15
23
  position: {
16
- type: String,
17
- default: popoverPosition.topCenter,
24
+ type: [String, Array],
25
+ default: 'top',
18
26
  },
19
27
  alwaysVisible: {
20
28
  type: Boolean,
21
29
  default: false,
22
30
  },
31
+ attachToBody: {
32
+ type: Boolean,
33
+ default: false,
34
+ },
23
35
  },
24
36
  data() {
25
37
  return {
26
38
  parentNode: null,
27
39
  isVisible: this.alwaysVisible ? true : false,
40
+ activePosition: null,
28
41
  };
29
42
  },
30
43
  mounted() {
31
44
  this.$nextTick(() => {
32
45
  this.parentNode = this.$el.parentNode;
33
46
 
34
- if (!this.parentNode) return;
35
-
36
- if (getComputedStyle(this.parentNode).position !== "absolute") {
37
- this.parentNode.style.position = "relative";
38
- }
39
-
40
47
  if (!this.alwaysVisible) {
41
- this.parentNode.addEventListener("focus", this.showPopover, true);
42
- this.parentNode.addEventListener("blur", this.hidePopover, true);
43
- this.parentNode.addEventListener("mouseover", this.showPopover, true);
44
- this.parentNode.addEventListener("mouseleave", this.hidePopover, true);
48
+ this.parentNode?.addEventListener("focus", this.showPopover, true);
49
+ this.parentNode?.addEventListener("blur", this.hidePopover, true);
50
+ this.parentNode?.addEventListener("mouseover", this.showPopover);
51
+ this.parentNode?.addEventListener("mouseleave", this.hidePopover);
45
52
  }
46
53
  });
47
54
  },
48
55
  methods: {
49
56
  showPopover() {
57
+ if (this.isVisible) return;
50
58
  this.isVisible = true;
59
+
60
+ computePosition(
61
+ this.parentNode,
62
+ this.$refs.popover,
63
+ {
64
+ middleware: [
65
+ autoPlacement({
66
+ allowedPlacements: this.position,
67
+ })
68
+ ]
69
+ }
70
+ )
71
+ .then(({x, y, placement }) => {
72
+ this.activePosition = placement;
73
+
74
+ Object.assign(this.$refs.popover.style, {
75
+ left: `${x}px`,
76
+ top: `${y}px`,
77
+ });
78
+ });
51
79
  },
52
80
  hidePopover() {
53
81
  this.isVisible = false;
@@ -56,7 +84,7 @@ export default {
56
84
  computed: {
57
85
  classes() {
58
86
  const classList = ["ib-popover"];
59
- classList.push(`ib-${this.position}`);
87
+ classList.push(`ib-${this.activePosition}`);
60
88
 
61
89
  if (this.isVisible) {
62
90
  classList.push("active");
@@ -1,5 +1,4 @@
1
1
  @import "../../assets/scss/typography.scss";
2
- @import "../../assets/scss/mixins/tooltip-position.scss";
3
2
  @import "../../assets/scss/variables/colors.scss";
4
3
  @import "../../assets/scss/variables/shadows.scss";
5
4
 
@@ -16,11 +15,32 @@ $shadow: $ib-shadow-3;
16
15
  color: $textColor;
17
16
  border-radius: 4px;
18
17
  box-shadow: $shadow;
19
- top: auto;
20
- bottom: auto;
21
- left: auto;
22
- right: auto;
23
- @include TooltipPosition;
24
- z-index: 100;
18
+ z-index: 9998;
25
19
  text-align: start;
20
+
21
+ &.ib {
22
+ &-right,
23
+ &-right-start,
24
+ &-right-end {
25
+ margin-left: 7px;
26
+ }
27
+
28
+ &-left,
29
+ &-left-start,
30
+ &-left-end {
31
+ margin-left: -7px;
32
+ }
33
+
34
+ &-top,
35
+ &-top-start,
36
+ &-top-end {
37
+ margin-top: -7px;
38
+ }
39
+
40
+ &-bottom,
41
+ &-bottom-start,
42
+ &-bottom-end {
43
+ margin-bottom: -7px;
44
+ }
45
+ }
26
46
  }
File without changes
@@ -8,33 +8,31 @@
8
8
  }"
9
9
  v-if="view === sortingTypesView.TABLE_VIEW"
10
10
  >
11
- <div>
12
- <button
13
- class="sorting-label"
14
- v-tooltip:[sortingTooltipPosition]="sortingTooltipContent"
15
- :class="{
16
- 'sorting-label-active': isOpenToggleTip && hasToggleTip,
17
- 'has-action': tooltipText?.length || hasToggleTip
18
- }"
19
- type="button"
20
- @click="isOpenToggleTip = !isOpenToggleTip"
21
- >
22
- {{ title }}
23
- </button>
11
+ <button
12
+ class="sorting-label"
13
+ v-tooltip:[sortingTooltipPosition]="sortingTooltipContent"
14
+ :class="{
15
+ 'sorting-label-active': isOpenToggleTip && hasToggleTip,
16
+ 'has-action': tooltipText?.length || hasToggleTip
17
+ }"
18
+ type="button"
19
+ @click="isOpenToggleTip = !isOpenToggleTip"
20
+ >
21
+ {{ title }}
22
+ </button>
24
23
 
25
- <ib-toggle-tip
26
- v-if="hasToggleTip"
27
- position="bottom-center"
28
- :is-open="isOpenToggleTip"
29
- :title="toggleTipTitle"
30
- @close="isOpenToggleTip = false"
31
- >
32
- <slot name="toggleTipBody"></slot>
33
- <template #buttons>
34
- <slot name="toggleTipButtons"></slot>
35
- </template>
36
- </ib-toggle-tip>
37
- </div>
24
+ <ib-toggle-tip
25
+ v-if="hasToggleTip"
26
+ position="bottom-center"
27
+ :is-open="isOpenToggleTip"
28
+ :title="toggleTipTitle"
29
+ @close="isOpenToggleTip = false"
30
+ >
31
+ <slot name="toggleTipBody"></slot>
32
+ <template #buttons>
33
+ <slot name="toggleTipButtons"></slot>
34
+ </template>
35
+ </ib-toggle-tip>
38
36
 
39
37
  <ib-icon-button
40
38
  v-if="!hideSortingButton"
File without changes
@@ -1,16 +1,20 @@
1
1
  <template>
2
2
  <div :class="classes">
3
- <button
4
- :disabled="disabled"
5
- v-if="!isLink"
3
+
4
+ <router-link
5
+ v-if="isRouterLink"
6
6
  class="split-button-main"
7
+ :class="{ disabled }"
8
+ :disabled="disabled"
9
+ :to="mainButtonAttrs.to"
7
10
  v-bind="mainButtonAttrs"
11
+ @click="onClickLink"
8
12
  >
9
13
  {{ content }}
10
- </button>
14
+ </router-link>
11
15
 
12
16
  <a
13
- v-else
17
+ v-else-if="isLink"
14
18
  class="split-button-main"
15
19
  :class="{ disabled }"
16
20
  :disabled="disabled"
@@ -20,7 +24,16 @@
20
24
  {{ content }}
21
25
  </a>
22
26
 
23
- <ib-dropdown-list :disabled="disabled" :closeOnClick="true">
27
+ <button
28
+ v-else
29
+ :disabled="disabled"
30
+ class="split-button-main"
31
+ v-bind="mainButtonAttrs"
32
+ >
33
+ {{ content }}
34
+ </button>
35
+
36
+ <ib-dropdown-list :disabled="disabled" :closeOnClick="true" :vertical="verticalPosition" :horizontal="verticalPosition === 'top' ? 'right' : 'left'">
24
37
  <template #trigger>
25
38
  <button :disabled="disabled" class="split-button-menu-trigger">
26
39
  <ib-icon name="chevron-down-outline" />
@@ -53,6 +66,10 @@ export default {
53
66
  type: String,
54
67
  default: splitButtonKindOptions.common,
55
68
  },
69
+ verticalPosition: {
70
+ type: String,
71
+ default: "bottom",
72
+ },
56
73
  disabled: {
57
74
  type: Boolean,
58
75
  default: false,
@@ -83,7 +100,20 @@ export default {
83
100
  }
84
101
  }
85
102
 
86
- this.setActiveItem();
103
+ this.$nextTick(() => {
104
+ this.setActiveItem();
105
+ });
106
+
107
+ this.listObserver = new MutationObserver((mutationsList) => {
108
+ for (const mutation of mutationsList) {
109
+ if (mutation.type === "attributes" && mutation.attributeName === "disabled") {
110
+ this.mainButtonAttrs.disabled = mutation.target.disabled;
111
+ break;
112
+ }
113
+ }
114
+ });
115
+
116
+ this.listObserver.observe(this.$refs.list, { attributes: true, subtree: true });
87
117
  },
88
118
  data() {
89
119
  return {
@@ -91,7 +121,9 @@ export default {
91
121
  content: "",
92
122
  mainButtonAttrs: {},
93
123
  isLink: false,
124
+ isRouterLink: false,
94
125
  childList: [],
126
+ listObserver: null,
95
127
  };
96
128
  },
97
129
  components: {
@@ -100,14 +132,21 @@ export default {
100
132
  },
101
133
  methods: {
102
134
  setActiveItem() {
103
- this.mainButtonAttrs = this.$slots.default()[this.activeElemIdx].props;
135
+ const attrs = this.$slots.default()[this.activeElemIdx].props;
104
136
 
137
+ this.mainButtonAttrs = attrs;
105
138
  if (this.mainButtonAttrs && "href" in this.mainButtonAttrs) {
106
139
  this.isLink = true;
107
140
  } else {
108
141
  this.isLink = false;
109
142
  }
110
143
 
144
+ if (this.mainButtonAttrs && "to" in this.mainButtonAttrs) {
145
+ this.isRouterLink = true;
146
+ } else {
147
+ this.isRouterLink = false;
148
+ }
149
+
111
150
  this.childList[this.activeElemIdx].classList.add("active");
112
151
  this.content = this.childList[this.activeElemIdx].textContent;
113
152
  },
@@ -131,6 +170,10 @@ export default {
131
170
  this.setActiveItem();
132
171
  },
133
172
  },
173
+ beforeUnmount() {
174
+ this.listObserver.disconnect();
175
+ this.listObserver = null;
176
+ }
134
177
  };
135
178
  </script>
136
179
 
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <component
3
- :is="href.length ? 'a' : 'button'"
3
+ :is="component"
4
4
  v-bind="attrs"
5
5
  class="ib-dropdown-item"
6
6
  >
@@ -15,6 +15,9 @@ export default {
15
15
  type: String,
16
16
  default: "",
17
17
  },
18
+ to: {
19
+ type: [String, Object],
20
+ }
18
21
  },
19
22
  computed: {
20
23
  attrs() {
@@ -23,8 +26,17 @@ export default {
23
26
  attrsList.href = this.href;
24
27
  }
25
28
 
29
+ if (this.to) {
30
+ attrsList.to = this.to;
31
+ }
32
+
26
33
  return attrsList;
27
34
  },
35
+ component() {
36
+ if (this.href.length) return "a";
37
+ if (this.to) return "router-link";
38
+ return "button";
39
+ }
28
40
  },
29
41
  };
30
42
  </script>
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -19,6 +19,10 @@ export default {
19
19
  type: Boolean,
20
20
  default: false,
21
21
  },
22
+ icon: {
23
+ type: String,
24
+ required: false,
25
+ },
22
26
  initialized: {
23
27
  type: Boolean,
24
28
  default: false,
@@ -14,6 +14,8 @@
14
14
  @click="selectTab(tab.id)"
15
15
  target="_self"
16
16
  >
17
+ <ib-icon class="tab-icon" v-if="tab.icon" :name="tab.icon" />
18
+
17
19
  {{ tab.title }}
18
20
  </a>
19
21
  </div>
@@ -32,8 +34,10 @@
32
34
  </div>
33
35
  </template>
34
36
  <script>
37
+ import IbIcon from "../Icon.vue";
35
38
  import IbTabDropdown from "./TabDropdown.vue";
36
39
  import getHrefFromId from "../../helpers/getHrefFromID";
40
+
37
41
  export default {
38
42
  name: "IbTabs",
39
43
  props: {
@@ -108,6 +112,7 @@ export default {
108
112
  },
109
113
  components: {
110
114
  IbTabDropdown,
115
+ IbIcon,
111
116
  },
112
117
  emits: ["changeTab"]
113
118
  };
@@ -23,7 +23,7 @@
23
23
  background-color: $gray-300;
24
24
  z-index: -1;
25
25
  }
26
-
26
+
27
27
  .tab-item {
28
28
  position: relative;
29
29
  margin: 0 15px;
@@ -65,6 +65,12 @@
65
65
  color: $neutral-900;
66
66
  }
67
67
 
68
+ .tab-icon {
69
+ margin-right: 3px;
70
+ color: inherit;
71
+ font-size: 16px;
72
+ }
73
+
68
74
  &::after {
69
75
  content: '';
70
76
  width: 100%;
@@ -154,4 +160,4 @@
154
160
  }
155
161
  }
156
162
  }
157
- }
163
+ }
@@ -18,6 +18,10 @@ export default {
18
18
  default: tagPillSTatuses.neutral,
19
19
  validator: (value) => Object.keys(tagPillSTatuses).includes(value),
20
20
  },
21
+ icon: {
22
+ type: String,
23
+ default: "",
24
+ },
21
25
  showIcon: {
22
26
  type: Boolean,
23
27
  default: false,
@@ -31,6 +35,8 @@ export default {
31
35
  return classList;
32
36
  },
33
37
  iconName() {
38
+ if (this.icon) return this.icon;
39
+
34
40
  switch (this.status) {
35
41
  case tagPillSTatuses.success:
36
42
  return "checkmark-outline";
File without changes
File without changes
File without changes
File without changes
@@ -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: 10002;
56
+ z-index: 10051;
57
57
 
58
58
  &.ib-tooltip-large {
59
59
  box-shadow: $ib-shadow-2;
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <li>
3
3
  <div
4
- v-tooltip="showTooltip ? option.title : ''"
4
+ v-tooltip="showTooltip ? (option.isDisabled ? option.disableTooltip : option.title) : ''"
5
5
  class="tree-select-option"
6
6
  tabindex="0"
7
7
  role="option"
@@ -14,7 +14,9 @@
14
14
  active: option.isChildrenVisible,
15
15
  'is-multiple': isMultiple,
16
16
  'is-not-multiple': !isMultiple,
17
+ 'has-icon': option.icon,
17
18
  'tree-select-option-toggle': this.isToggle && this.isMultiple,
19
+ 'alphabetic-option': alphabeticStyle,
18
20
  }"
19
21
  @keydown.self="onKeydown"
20
22
  @focus="$emit('onFocus', `option-${id}`)"
@@ -46,7 +48,7 @@
46
48
  :aria-label="option.title"
47
49
  :name="actualName"
48
50
  :value="option.id"
49
- :id="'input' + id"
51
+ :id="'input' + id + generateUID()"
50
52
  :is-checked="isChecked(option)"
51
53
  :disabled="option.isDisabled"
52
54
  :readonly="option.readonly"
@@ -63,13 +65,21 @@
63
65
  'bookmarkable-option-title ' + (isBookmarked ? 'bookmarked' : '')
64
66
  "
65
67
  >
66
- <span class="option-label" v-if="!hasChildren">
67
- {{ option.title }}
68
- <ib-icon
69
- name="star"
68
+ <div class="bookmarkable-option-content" v-if="!hasChildren">
69
+ <span class="option-label" >
70
+ {{ option.title }}
71
+ </span>
72
+
73
+ <ib-icon-button
70
74
  @click.stop.prevent="$emit('toggle-bookmark', option)"
71
- ></ib-icon>
72
- </span>
75
+ kind="ghost"
76
+ v-tooltip="lang(isBookmarked ? 'unpin' : 'pin_to_top', 'select')"
77
+ >
78
+ <ib-icon
79
+ :name="isBookmarked ? 'star' : 'star-outline'"
80
+ ></ib-icon>
81
+ </ib-icon-button>
82
+ </div>
73
83
 
74
84
  <span class="option-label" v-else>{{ option.title }}</span>
75
85
  </span>
@@ -84,7 +94,13 @@
84
94
  </template>
85
95
 
86
96
  <template v-else>
87
- <span class="option-label">{{ option.title }}</span>
97
+ <span class="option-label">
98
+ <ib-icon
99
+ v-if="option.icon"
100
+ :name="option.icon"
101
+ ></ib-icon>
102
+ {{ option.title }}
103
+ </span>
88
104
  </template>
89
105
  </div>
90
106
 
@@ -118,6 +134,7 @@ import List from "../List.vue";
118
134
  import IbIcon from "../Icon.vue";
119
135
  import IbIconButton from "../IconButton/IconButton.vue";
120
136
  import { TooltipDirective as Tooltip } from "../../directives/tooltip/tooltip";
137
+ import generateUID from "../../helpers/generateUID";
121
138
  import multiLineOverflows from "../../helpers/multiLineOverflows";
122
139
  import {
123
140
  SPACE_KEY_CODE,
@@ -168,16 +185,26 @@ export default {
168
185
  type: Boolean,
169
186
  default: false,
170
187
  },
188
+ alphabeticStyle: {
189
+ type: Boolean,
190
+ default: false
191
+ },
171
192
  },
172
193
  mounted() {
173
194
  // eslint-disable-next-line no-prototype-builtins
174
195
  if (this.option.hasOwnProperty("children") && this.option.children) {
175
196
  this.checkParent();
176
197
  }
198
+
199
+ if(this.option.showTooltipByDefault) {
200
+ this.showTooltip = true;
201
+ }
177
202
  },
178
203
  updated() {
179
204
  this.$nextTick(() => {
180
- if (multiLineOverflows(this.$el.querySelector(".option-label"))) {
205
+ if(this.option.showTooltipByDefault) {
206
+ this.showTooltip = true;
207
+ } else if (multiLineOverflows(this.$el.querySelector(".option-label"))) {
181
208
  this.showTooltip = true;
182
209
  }
183
210
  });
@@ -185,6 +212,7 @@ export default {
185
212
  data() {
186
213
  return {
187
214
  showTooltip: false,
215
+ generateUID,
188
216
  };
189
217
  },
190
218
  methods: {
@@ -219,6 +247,11 @@ export default {
219
247
  this.check(this.option, value, true, checkChildren);
220
248
  },
221
249
  check(option, checkStatus, isDirectChild, checkChildren) {
250
+ if (!this.isMultiple && this.hasVisibleChildren) {
251
+ this.toggleChildrenVisibility();
252
+ return;
253
+ }
254
+
222
255
  this.$emit("check", option, checkStatus, isDirectChild);
223
256
  if (checkChildren) {
224
257
  option.children &&
@@ -271,12 +304,11 @@ export default {
271
304
  },
272
305
  isChecked(option) {
273
306
  if(this.hasChildren) {
274
- if (!this.childrenSelectedCount) {
275
- return false;
276
- } else if (
277
- this.childrenSelectedCount > 0 &&
278
- this.countOfAllChildren > this.childrenSelectedCount
279
- ) {
307
+ if (this.childrenSelectedCount === this.countOfAllChildren) {
308
+ return true;
309
+ }
310
+
311
+ if (this.childrenSelectedCount > 0 && this.countOfAllChildren > this.childrenSelectedCount) {
280
312
  return null; //null will trigger indeterminate stage
281
313
  }
282
314
  }