@avakhula/ui 0.0.503 → 0.0.505-alpha-spa.2

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 (160) hide show
  1. package/.babelrc.json +0 -0
  2. package/.eslintrc.cjs +0 -0
  3. package/.nvmrc +0 -0
  4. package/.storybook/main.js +0 -0
  5. package/.storybook/preview-head.html +0 -0
  6. package/.storybook/preview.js +0 -0
  7. package/dist/index.js +16912 -2987
  8. package/dist/index.umd.cjs +168 -22
  9. package/dist/style.css +1 -1
  10. package/package.json +4 -4
  11. package/src/App.vue +13 -128
  12. package/src/assets/scss/mixins/dropdown-list-item.scss +5 -0
  13. package/src/assets/scss/mixins/tooltip-position.scss +0 -0
  14. package/src/assets/scss/variables/colors.json +0 -0
  15. package/src/assets/scss/variables/colors.scss +0 -0
  16. package/src/assets/scss/variables/shadows.json +0 -0
  17. package/src/assets/scss/variables/shadows.scss +0 -0
  18. package/src/components/Accordion/Accordion.scss +0 -0
  19. package/src/components/Accordion/Accordion.stories.js +0 -0
  20. package/src/components/Accordion/Accordion.vue +0 -0
  21. package/src/components/Accordion/Acordion.spec.js +0 -0
  22. package/src/components/Accordion/readme.mdx +0 -0
  23. package/src/components/Alert/Alert.spec.js +0 -0
  24. package/src/components/Alert/Alert.stories.js +0 -0
  25. package/src/components/Alert/Alert.vue +5 -0
  26. package/src/components/Alert/alert.scss +6 -1
  27. package/src/components/Alert/constants.js +0 -0
  28. package/src/components/Alert/readme.mdx +0 -0
  29. package/src/components/Avatar/Avatar.stories.js +5 -1
  30. package/src/components/Avatar/Avatar.vue +25 -2
  31. package/src/components/Avatar/constants.js +6 -0
  32. package/src/components/Badge/Badge.spec.js +0 -0
  33. package/src/components/Badge/Badge.vue +0 -0
  34. package/src/components/Badge/readme.mdx +0 -0
  35. package/src/components/Breadcrumbs/Breadcrumbs.vue +0 -0
  36. package/src/components/Breadcrumbs/breadcrumbs.scss +0 -0
  37. package/src/components/Breadcrumbs/breadcrumbs.stories.js +0 -0
  38. package/src/components/Button/Button.spec.js +0 -0
  39. package/src/components/Button/Button.vue +19 -3
  40. package/src/components/Button/button.scss +4 -0
  41. package/src/components/Button/readme.mdx +0 -0
  42. package/src/components/ButtonGroup/ButtonGroup.stories.js +0 -0
  43. package/src/components/ButtonGroup/readme.mdx +0 -0
  44. package/src/components/Chips/Chips.stories.js +30 -0
  45. package/src/components/Chips/Chips.vue +125 -0
  46. package/src/components/Dropdown/Dropdown.stories.js +0 -0
  47. package/src/components/Dropdown/Dropdown.vue +0 -0
  48. package/src/components/Dropdown/DropdownItem.vue +26 -4
  49. package/src/components/Dropdown/DropdownList.stories.js +0 -0
  50. package/src/components/Dropdown/readme.mdx +0 -0
  51. package/src/components/Form/CharactersCount.vue +10 -7
  52. package/src/components/Form/Checkbox/Checkbox.scss +0 -0
  53. package/src/components/Form/Checkbox/Checkbox.stories.js +0 -0
  54. package/src/components/Form/Checkbox/Checkbox.vue +23 -11
  55. package/src/components/Form/Checkbox/readme.mdx +0 -0
  56. package/src/components/Form/CheckboxGroup/CheckboxGroup.stories.js +0 -0
  57. package/src/components/Form/CheckboxGroup/CheckboxGroup.vue +15 -0
  58. package/src/components/Form/CheckboxGroup/readme.mdx +2 -0
  59. package/src/components/Form/DatePicker/DatePicker.scss +345 -260
  60. package/src/components/Form/DatePicker/DatePicker.stories.js +0 -0
  61. package/src/components/Form/DatePicker/DatePicker.vue +55 -14
  62. package/src/components/Form/DatePicker/readme.mdx +0 -0
  63. package/src/components/Form/FormGroup/FormGroup.vue +3 -3
  64. package/src/components/Form/Input/Input.stories.js +0 -0
  65. package/src/components/Form/Input/Input.vue +6 -2
  66. package/src/components/Form/Input/constants.js +0 -0
  67. package/src/components/Form/Input/input.scss +0 -0
  68. package/src/components/Form/Input/readme.mdx +0 -0
  69. package/src/components/Form/Label/Label.stories.js +0 -0
  70. package/src/components/Form/Label/Label.vue +22 -10
  71. package/src/components/Form/Label/readme.mdx +0 -0
  72. package/src/components/Form/PhoneInput/PhoneInput.stories.js +0 -0
  73. package/src/components/Form/PhoneInput/PhoneInput.vue +21 -12
  74. package/src/components/Form/PhoneInput/phoneInput.scss +4 -5
  75. package/src/components/Form/PhoneInput/readme.mdx +0 -0
  76. package/src/components/Form/Radio/Radio.stories.js +0 -0
  77. package/src/components/Form/Radio/Radio.vue +22 -35
  78. package/src/components/Form/Radio/radio.scss +5 -2
  79. package/src/components/Form/Radio/readme.mdx +0 -0
  80. package/src/components/Form/TextEditor/TextEditor.stories.js +0 -0
  81. package/src/components/Form/TextEditor/TextEditor.vue +67 -15
  82. package/src/components/Form/TextEditor/readme.mdx +0 -0
  83. package/src/components/Form/TextEditor/textEditor.scss +22 -0
  84. package/src/components/Form/Textarea/Textarea.stories.js +0 -0
  85. package/src/components/Form/Textarea/Textarea.vue +19 -2
  86. package/src/components/Form/Textarea/readme.mdx +0 -0
  87. package/src/components/Form/Textarea/textarea.scss +20 -1
  88. package/src/components/Form/Toggle/Toggle.stories.js +0 -0
  89. package/src/components/Form/Toggle/Toggle.vue +0 -0
  90. package/src/components/Form/Toggle/readme.mdx +0 -0
  91. package/src/components/Form/Toggle/toggle.scss +0 -0
  92. package/src/components/IconButton/IconButton.scss +11 -0
  93. package/src/components/IconButton/IconButton.vue +5 -0
  94. package/src/components/IconButton/readme.mdx +0 -0
  95. package/src/components/List.vue +0 -0
  96. package/src/components/Modal/Modal.stories.js +0 -0
  97. package/src/components/Modal/Modal.vue +6 -5
  98. package/src/components/Modal/constants.js +0 -0
  99. package/src/components/Modal/readme.mdx +0 -0
  100. package/src/components/Pagination/LimitSelector.vue +4 -0
  101. package/src/components/Pagination/Pagination.vue +9 -2
  102. package/src/components/Pagination/pagination.scss +0 -0
  103. package/src/components/Panel/Panel.stories.js +0 -0
  104. package/src/components/Panel/Panel.vue +68 -2
  105. package/src/components/Popover/Popover.vue +4 -4
  106. package/src/components/Popover/constants.js +0 -0
  107. package/src/components/Popover/popover.scss +1 -1
  108. package/src/components/Popover/readme.mdx +0 -0
  109. package/src/components/ProgressBar/ProgressBar.vue +0 -0
  110. package/src/components/ProgressBar/constants.js +0 -0
  111. package/src/components/ProgressBar/progressBar.scss +0 -0
  112. package/src/components/ProgressBar/readme.mdx +0 -0
  113. package/src/components/Sorting/Sorting.stories.js +0 -0
  114. package/src/components/Sorting/Sorting.vue +0 -0
  115. package/src/components/Sorting/sorting.scss +0 -0
  116. package/src/components/SplitButton/SplitButton.stories.js +0 -0
  117. package/src/components/SplitButton/SplitButton.vue +31 -7
  118. package/src/components/SplitButton/SplitButtonItem.vue +13 -1
  119. package/src/components/SplitButton/readme.mdx +0 -0
  120. package/src/components/SplitButton/splitButton.scss +0 -0
  121. package/src/components/StatusIndicator/StatusIndicator.stories.js +0 -0
  122. package/src/components/StatusIndicator/StatusIndicator.vue +0 -0
  123. package/src/components/StatusIndicator/constants.js +0 -0
  124. package/src/components/StatusIndicator/icons.js +0 -0
  125. package/src/components/StatusIndicator/readme.mdx +0 -0
  126. package/src/components/Tabs/TabDropdown.vue +0 -0
  127. package/src/components/Tabs/Tabs.stories.js +0 -0
  128. package/src/components/Tabs/Tabs.vue +0 -0
  129. package/src/components/Tabs/tabs.scss +0 -0
  130. package/src/components/TagPill/TagPill.stories.js +0 -0
  131. package/src/components/TagPill/readme.mdx +0 -0
  132. package/src/components/ToggleTip/constants.js +0 -0
  133. package/src/components/ToggleTip/readme.mdx +0 -0
  134. package/src/components/ToggleTip/toggleTip.scss +0 -0
  135. package/src/components/Tooltip/Tooltip.vue +1 -1
  136. package/src/components/Tooltip/readme.mdx +0 -0
  137. package/src/components/TreeSelect/Option.vue +40 -9
  138. package/src/components/TreeSelect/Select.stories.js +0 -0
  139. package/src/components/TreeSelect/Select.vue +77 -29
  140. package/src/components/TreeSelect/TreeSelect.stories.js +0 -0
  141. package/src/components/TreeSelect/mixins/InfinityLoaderMixin.js +40 -0
  142. package/src/components/TreeSelect/scss/option.scss +31 -0
  143. package/src/components/TreeSelect/scss/select.scss +47 -1
  144. package/src/directives/outside/outside.stories.js +0 -0
  145. package/src/directives/outside/readme.mdx +0 -0
  146. package/src/directives/tooltip/TooltipController.js +2 -0
  147. package/src/directives/tooltip/readme.mdx +0 -0
  148. package/src/directives/tooltip/textOverflowTooltip.js +3 -1
  149. package/src/directives/tooltip/tooltip.js +15 -0
  150. package/src/directives/tooltip/tooltip.stories.js +0 -0
  151. package/src/helpers/removeEvents.js +0 -0
  152. package/src/index.js +4 -0
  153. package/src/main.js +0 -0
  154. package/src/mixins/expandAnimation.js +0 -0
  155. package/src/scripts/parseScssVariables.js +0 -0
  156. package/src/stories/link.readme.mdx +0 -0
  157. package/src/stories/variables/colors.stories.js +0 -0
  158. package/src/stories/variables/shadows.stories.js +0 -0
  159. package/static/docks/button.pdf +0 -0
  160. package/static/favicon.ico +0 -0
File without changes
File without changes
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,6 +24,15 @@
20
24
  {{ content }}
21
25
  </a>
22
26
 
27
+ <button
28
+ v-else
29
+ :disabled="disabled"
30
+ class="split-button-main"
31
+ v-bind="mainButtonAttrs"
32
+ >
33
+ {{ content }}
34
+ </button>
35
+
23
36
  <ib-dropdown-list :disabled="disabled" :closeOnClick="true">
24
37
  <template #trigger>
25
38
  <button :disabled="disabled" class="split-button-menu-trigger">
@@ -83,7 +96,9 @@ export default {
83
96
  }
84
97
  }
85
98
 
86
- this.setActiveItem();
99
+ this.$nextTick(() => {
100
+ this.setActiveItem();
101
+ });
87
102
  },
88
103
  data() {
89
104
  return {
@@ -91,6 +106,7 @@ export default {
91
106
  content: "",
92
107
  mainButtonAttrs: {},
93
108
  isLink: false,
109
+ isRouterLink: false,
94
110
  childList: [],
95
111
  };
96
112
  },
@@ -100,14 +116,22 @@ export default {
100
116
  },
101
117
  methods: {
102
118
  setActiveItem() {
103
- this.mainButtonAttrs = this.$slots.default()[this.activeElemIdx].props;
119
+ const attrs = this.$slots.default()[this.activeElemIdx].props;
120
+ delete attrs.disabled;
104
121
 
122
+ this.mainButtonAttrs = attrs;
105
123
  if (this.mainButtonAttrs && "href" in this.mainButtonAttrs) {
106
124
  this.isLink = true;
107
125
  } else {
108
126
  this.isLink = false;
109
127
  }
110
128
 
129
+ if (this.mainButtonAttrs && "to" in this.mainButtonAttrs) {
130
+ this.isRouterLink = true;
131
+ } else {
132
+ this.isRouterLink = false;
133
+ }
134
+
111
135
  this.childList[this.activeElemIdx].classList.add("active");
112
136
  this.content = this.childList[this.activeElemIdx].textContent;
113
137
  },
@@ -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
File without changes
File without changes
File without changes
File without changes
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;
File without changes
@@ -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}`)"
@@ -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
 
@@ -168,16 +184,26 @@ export default {
168
184
  type: Boolean,
169
185
  default: false,
170
186
  },
187
+ alphabeticStyle: {
188
+ type: Boolean,
189
+ default: false
190
+ },
171
191
  },
172
192
  mounted() {
173
193
  // eslint-disable-next-line no-prototype-builtins
174
194
  if (this.option.hasOwnProperty("children") && this.option.children) {
175
195
  this.checkParent();
176
196
  }
197
+
198
+ if(this.option.showTooltipByDefault) {
199
+ this.showTooltip = true;
200
+ }
177
201
  },
178
202
  updated() {
179
203
  this.$nextTick(() => {
180
- if (multiLineOverflows(this.$el.querySelector(".option-label"))) {
204
+ if(this.option.showTooltipByDefault) {
205
+ this.showTooltip = true;
206
+ } else if (multiLineOverflows(this.$el.querySelector(".option-label"))) {
181
207
  this.showTooltip = true;
182
208
  }
183
209
  });
@@ -219,6 +245,11 @@ export default {
219
245
  this.check(this.option, value, true, checkChildren);
220
246
  },
221
247
  check(option, checkStatus, isDirectChild, checkChildren) {
248
+ if (!this.isMultiple && this.hasVisibleChildren) {
249
+ this.toggleChildrenVisibility();
250
+ return;
251
+ }
252
+
222
253
  this.$emit("check", option, checkStatus, isDirectChild);
223
254
  if (checkChildren) {
224
255
  option.children &&
File without changes
@@ -10,9 +10,12 @@
10
10
  }"
11
11
  >
12
12
  <ib-dropdown
13
- :disabled="isLoading"
13
+ :disabled="isLoading || disable"
14
14
  :is-resizable="isResizable"
15
15
  :vertical="verticalVal"
16
+ :class="{
17
+ disable: disable
18
+ }"
16
19
  ref="dropdown"
17
20
  @close="onClose"
18
21
  @open="onOpen"
@@ -41,7 +44,7 @@
41
44
  >
42
45
 
43
46
  <template v-if="hasTriggerContent">
44
- <slot v-bind:selected-count="selectedKeys.length" name="triggerContent"></slot>
47
+ <slot v-bind:selected-count="selectedKeys.length" v-bind:is-open="isOpened" name="triggerContent"></slot>
45
48
  </template>
46
49
 
47
50
  <template v-else>
@@ -95,34 +98,17 @@
95
98
  v-if="isResizable"
96
99
  class="ib-dropdown-resizer ib-dropdown-resizer-right"
97
100
  @mousedown="startResizing('right')"
101
+ v-tooltip.rightCenter="lang('resize_list', 'select')"
98
102
  ></div>
99
- <list
100
- :class="{ 'has-hierarchy': hasHierarchy }"
101
- v-if="Object.keys(actualBookmarkedOptions).length > 0"
102
- >
103
- <select-option
104
- :key="'bookmark' + option.id"
105
- v-for="option in actualBookmarkedOptions"
106
- :option="option"
107
- :parent-auto-check="false"
108
- :is-multiple="isMultiple"
109
- :is-bookmarkable="true"
110
- :is-bookmarked="true"
111
- @check="registerCheck"
112
- @toggle-bookmark="toggleBookmark"
113
- :uid="uid"
114
- :only-end-nodes="onlyEndNodes"
115
- :html-title="htmlOptionTitle"
116
- :show-input="showInputs"
117
- ></select-option>
118
- </list>
119
103
 
120
104
  <ib-input
121
105
  class="tree-search"
122
106
  v-if="showSearch"
123
107
  ref="search"
108
+ autocomplete="off"
124
109
  :show-icon="true"
125
110
  :value="filterString"
111
+ :debounce="searchDebounce"
126
112
  :aria-label="
127
113
  searchPlaceholderText
128
114
  ? searchPlaceholderText
@@ -139,7 +125,11 @@
139
125
  <list
140
126
  ref="list"
141
127
  role="listbox"
142
- :class="{ 'tree-select-list': true, 'has-hierarchy': hasHierarchy }"
128
+ :class="{
129
+ 'tree-select-list': true,
130
+ 'has-hierarchy': hasHierarchy,
131
+ 'alphabetic-list': alphabeticStyle,
132
+ }"
143
133
  >
144
134
  <div
145
135
  v-if="
@@ -181,10 +171,30 @@
181
171
  ></select-option>
182
172
  </template>
183
173
 
174
+ <template v-if="Object.keys(actualBookmarkedOptions).length > 0">
175
+ <select-option
176
+ :key="'bookmark' + option.id"
177
+ v-for="option in actualBookmarkedOptions"
178
+ class="bookmarked-option"
179
+ :option="option"
180
+ :parent-auto-check="false"
181
+ :is-multiple="isMultiple"
182
+ :is-bookmarkable="true"
183
+ :is-bookmarked="true"
184
+ @check="registerCheck"
185
+ @toggle-bookmark="toggleBookmark"
186
+ :uid="uid"
187
+ :only-end-nodes="onlyEndNodes"
188
+ :html-title="htmlOptionTitle"
189
+ :show-input="showInputs"
190
+ ></select-option>
191
+ </template>
192
+
184
193
  <template v-if="!requiredDependencyNotFilled">
185
194
  <template
186
195
  v-if="
187
196
  allOptions &&
197
+ !alphabeticStyle &&
188
198
  isMultiple &&
189
199
  visibleOptionsCount &&
190
200
  !requiredDependencyNotFilled
@@ -210,6 +220,7 @@
210
220
  :uid="uid"
211
221
  :only-end-nodes="onlyEndNodes"
212
222
  :show-input="showInputs"
223
+ :alphabetic-style="alphabeticStyle"
213
224
  @check="manageAll"
214
225
  @on-focus="(id) => focusedOptionId = id"
215
226
  ></select-option>
@@ -241,6 +252,7 @@
241
252
  :only-end-nodes="onlyEndNodes"
242
253
  :html-title="htmlOptionTitle"
243
254
  :show-input="showInputs"
255
+ :alphabetic-style="alphabeticStyle"
244
256
  @check="registerCheck"
245
257
  @toggle-bookmark="toggleBookmark"
246
258
  @on-focus="(id) => focusedOptionId = id"
@@ -248,6 +260,8 @@
248
260
  </slot>
249
261
  </template>
250
262
  </template>
263
+
264
+ <div v-if="infiniteLoader" ref="infinityLoader"></div>
251
265
  </list>
252
266
  </div>
253
267
  </template>
@@ -266,6 +280,8 @@ import IbIcon from "../Icon.vue";
266
280
  import IbIconButton from "../IconButton/IconButton.vue";
267
281
  import IbAlert from "../Alert/Alert.vue";
268
282
  import List from "../List.vue";
283
+ import InfinityLoaderMixin from "./mixins/InfinityLoaderMixin";
284
+ import { TooltipDirective as Tooltip } from "../../directives/tooltip/tooltip";
269
285
 
270
286
  function copy(data) {
271
287
  return JSON.parse(JSON.stringify(data));
@@ -274,8 +290,13 @@ function copy(data) {
274
290
  export default {
275
291
  name: "IbTreeSelect",
276
292
  inject: ["LANG_COMPONENTS"],
293
+ mixins: [InfinityLoaderMixin],
277
294
  props: {
278
295
  classList: [String, Array],
296
+ keywordHighlighter: {
297
+ type: Boolean,
298
+ default: true,
299
+ },
279
300
  placeholder: {
280
301
  type: String,
281
302
  default: "",
@@ -315,6 +336,7 @@ export default {
315
336
  },
316
337
  },
317
338
  options: {
339
+ type: [Array, Function],
318
340
  default() {
319
341
  return [];
320
342
  },
@@ -420,6 +442,18 @@ export default {
420
442
  type: Boolean,
421
443
  default: false,
422
444
  },
445
+ disable: {
446
+ type: Boolean,
447
+ default: false
448
+ },
449
+ searchDebounce: {
450
+ type: Number,
451
+ default: 0,
452
+ },
453
+ alphabeticStyle: {
454
+ type: Boolean,
455
+ default: false
456
+ },
423
457
  },
424
458
  emits: [
425
459
  "close",
@@ -429,6 +463,7 @@ export default {
429
463
  "resize",
430
464
  "submit",
431
465
  "clearValue",
466
+ "toggle-bookmarked-option",
432
467
  "update:modelValue",
433
468
  ],
434
469
  watch: {
@@ -462,7 +497,7 @@ export default {
462
497
  },
463
498
  options: {
464
499
  handler(newOptions) {
465
- this.initialOptions = copy(newOptions);
500
+ this.initialOptions = typeof newOptions === "function" ? newOptions : copy(newOptions);
466
501
  },
467
502
  deep: true,
468
503
  },
@@ -522,7 +557,7 @@ export default {
522
557
  const filterString = this.filterString.toLowerCase().trim();
523
558
  this.filterFunc.call(this, options, filterString);
524
559
 
525
- if (filterString) {
560
+ if (filterString && this.keywordHighlighter) {
526
561
  this.marker.mark(filterString);
527
562
  }
528
563
  };
@@ -667,7 +702,7 @@ export default {
667
702
  },
668
703
  filter(filterString, options) {
669
704
  this.filterString = filterString;
670
- this.$emit("search", { search: this.filterString });
705
+ this.$emit("search", this.filterString);
671
706
  this.defaultFilter(options);
672
707
  },
673
708
  setPreparedValues(opt) {
@@ -736,7 +771,6 @@ export default {
736
771
  typeof option.visible === "undefined" ? true : option.visible;
737
772
  option.visible = option.initiallyVisible;
738
773
  option.readonly = option.readonly ? true : false;
739
- option.isDisabled = false;
740
774
 
741
775
  option.checked = this.isMultiple
742
776
  ? this.val !== null &&
@@ -792,7 +826,8 @@ export default {
792
826
  visibleOptionsCount += visibleChildrenCount;
793
827
 
794
828
  if (visibleChildrenCount) {
795
- option.isChildrenVisible = !!filterString || Boolean(Object.keys(this.actualBookmarkedOptions).length);
829
+ // remove?? this is auto open all childs after add or remove to bookmarks
830
+ // option.isChildrenVisible = !!filterString || Boolean(Object.keys(this.actualBookmarkedOptions).length);
796
831
  option.isDisabled = visibleChildrenCount < option.children.length && !this.isBookmarkable;
797
832
  }
798
833
 
@@ -1026,7 +1061,7 @@ export default {
1026
1061
  );
1027
1062
  },
1028
1063
  showSearch() {
1029
- return this.useSearch || this.optionsCount > 10;
1064
+ return this.useSearch || (this.optionsCount > 10 && !this.alphabeticStyle);
1030
1065
  },
1031
1066
  arrayOfOptions() {
1032
1067
  return this.getArrayOptions(this.actualOptions);
@@ -1073,6 +1108,9 @@ export default {
1073
1108
  List,
1074
1109
  "select-option": Option,
1075
1110
  },
1111
+ directives: {
1112
+ Tooltip,
1113
+ },
1076
1114
  beforeUnmount() {
1077
1115
  document.removeEventListener("mousemove", this.onResize);
1078
1116
  document.removeEventListener("mouseup", this.endResizing);
@@ -1081,4 +1119,14 @@ export default {
1081
1119
  </script>
1082
1120
  <style lang="scss">
1083
1121
  @import "./scss/select.scss";
1122
+
1123
+ .bookmarked-option {
1124
+ .tree-select-option-label {
1125
+ padding-left: 15px;
1126
+
1127
+ ion-icon {
1128
+ color: $blue-900;
1129
+ }
1130
+ }
1131
+ }
1084
1132
  </style>
File without changes
@@ -0,0 +1,40 @@
1
+ export default {
2
+ props: {
3
+ infiniteLoader: {
4
+ type: Boolean,
5
+ default: true,
6
+ },
7
+ },
8
+ watch: {
9
+ infiniteLoader(newValue) {
10
+ if (!newValue) {
11
+ infiniteLoaderObserver.disconnect();
12
+ }
13
+ }
14
+ },
15
+ data() {
16
+ return {
17
+ infiniteLoaderObserver: null,
18
+ }
19
+ },
20
+ mounted() {
21
+ if (this.infiniteLoader) {
22
+
23
+ this.infiniteLoaderObserver = new IntersectionObserver((entries) => {
24
+ entries.forEach(entry => {
25
+ if (entry.isIntersecting) {
26
+ this.$emit('loadMoreOptions');
27
+ }
28
+ });
29
+ });
30
+
31
+ this.infiniteLoaderObserver.observe(this.$refs.infinityLoader);
32
+ }
33
+ },
34
+ beforeDestroy() {
35
+ if (this.infiniteLoader) {
36
+ infiniteLoaderObserver?.disconnect();
37
+ }
38
+ },
39
+ emits: ['loadMoreOptions'],
40
+ };
@@ -89,6 +89,14 @@ $option-checked-hover-bg: $blue-50;
89
89
  }
90
90
  }
91
91
 
92
+ &.alphabetic-option {
93
+ max-width: 65px;
94
+ width: 65px;
95
+ &.tree-select-option-checked {
96
+ background-color: white;
97
+ }
98
+ }
99
+
92
100
  .tree-select-option-label {
93
101
  &:hover {
94
102
  background-color: $option-hover-bg;
@@ -110,6 +118,19 @@ $option-checked-hover-bg: $blue-50;
110
118
  }
111
119
  }
112
120
 
121
+ &.has-icon {
122
+ border-top: 1px solid $gray-200;
123
+
124
+ .option-label {
125
+ display: flex;
126
+ align-items: center;
127
+
128
+ ion-icon {
129
+ margin-right: 15px;
130
+ }
131
+ }
132
+ }
133
+
113
134
  .tree-select-option {
114
135
  .toggle-children,
115
136
  .option-label,
@@ -128,6 +149,12 @@ $option-checked-hover-bg: $blue-50;
128
149
  transform: translateX(50px);
129
150
  }
130
151
 
152
+ .bookmarkable-option-content {
153
+ .option-label {
154
+ width: calc(100% - 85px);
155
+ }
156
+ }
157
+
131
158
  .option-label {
132
159
  width: calc(100% - 75px);
133
160
  }
@@ -205,4 +232,8 @@ $option-checked-hover-bg: $blue-50;
205
232
  }
206
233
  }
207
234
  }
235
+
236
+ .disabled {
237
+ color: $neutral-500 !important;
238
+ }
208
239
  }