@avakhula/ui 0.0.227 → 0.0.228

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.227",
3
+ "version": "0.0.228",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.umd.cjs",
6
6
  "source": "src/index.js",
@@ -12,7 +12,10 @@
12
12
  <button
13
13
  v-tooltip:[tooltipPosition]="tooltipContent"
14
14
  class="sorting-label"
15
- :class="{'sorting-label-active': isOpenToggleTip}"
15
+ :class="{
16
+ 'sorting-label-active': isOpenToggleTip,
17
+ 'no-action': !tooltipContent?.length && !hasToggleTip
18
+ }"
16
19
  type="button"
17
20
  @click="isOpenToggleTip = !isOpenToggleTip"
18
21
  >
@@ -33,20 +33,22 @@ button {
33
33
  transition: background-color .3s;
34
34
  transition: color .3s;
35
35
 
36
- &:hover {
37
- color: $blue-700;
38
- border-color: $blue-300;
39
- cursor: pointer;
40
- background-color: $blue-100;
41
- }
36
+ &:not(.no-action) {
37
+ &:hover {
38
+ color: $blue-700;
39
+ border-color: $blue-300;
40
+ cursor: pointer;
41
+ background-color: $blue-100;
42
+ }
42
43
 
43
- &.sorting-label-active,
44
- &:active {
45
- border-color: transparent;
46
- color: $blue-900;
47
- background-color: $blue-200;
48
- transition: background-color .3s;
49
- transition: color .3s;
44
+ &.sorting-label-active,
45
+ &:active {
46
+ border-color: transparent;
47
+ color: $blue-900;
48
+ background-color: $blue-200;
49
+ transition: background-color .3s;
50
+ transition: color .3s;
51
+ }
50
52
  }
51
53
 
52
54
  &:focus {
@@ -1,244 +1,241 @@
1
1
  <template>
2
- <div class="tree-select-wrapper">
3
- <ib-alert class="tree-select-error" v-if="errorMessage">
4
- {{ errorMessage }}
5
- </ib-alert>
6
-
7
- <div class="tree-select" :class="classList">
8
- <ib-dropdown
9
- :disabled="isLoading"
10
- :is-resizable="isResizable"
11
- :vertical="vertical"
12
- ref="dropdown"
13
- @close="onClose"
14
- @open="isOpen = true"
15
- >
16
- <template v-if="hasTrigger" v-slot:trigger>
17
- <slot v-bind:selected-count="selectedKeys.length" name="trigger"></slot>
18
- </template>
19
-
20
- <template v-else v-slot:trigger="{ isOpened }">
2
+ <ib-alert class="tree-select-error" v-if="errorMessage">
3
+ {{ errorMessage }}
4
+ </ib-alert>
5
+
6
+ <div class="tree-select" :class="classList">
7
+ <ib-dropdown
8
+ :disabled="isLoading"
9
+ :is-resizable="isResizable"
10
+ :vertical="vertical"
11
+ ref="dropdown"
12
+ @close="onClose"
13
+ @open="isOpen = true"
14
+ >
15
+ <template v-if="hasTrigger" v-slot:trigger>
16
+ <slot v-bind:selected-count="selectedKeys.length" name="trigger"></slot>
17
+ </template>
18
+
19
+ <template v-else v-slot:trigger="{ isOpened }">
20
+ <div
21
+ role="combobox"
22
+ tabindex="0"
23
+ class="tree-choice"
24
+ ref="combobox"
25
+ @click.prevent
26
+ @blur="onBlur"
27
+ @keyup.down="comboboxKeyupDown"
28
+ @keyup.up="comboboxKeyupDown"
29
+ :aria-label="ariaLabel"
30
+ :aria-activedescendant="focusedOptionId"
31
+ :class="{
32
+ 'tree-choice-opened': isOpened,
33
+ 'has-clear-button': !showClearButton,
34
+ 'tree-choice-error': errorMessage,
35
+ }"
36
+ >
37
+ <template v-if="htmlOptionTitle">
38
+ <span
39
+ :class="{ placeholder: !selectStatus }"
40
+ v-html="selectStatus || placeholder"
41
+ ></span>
42
+ </template>
43
+ <template v-else>
44
+ <span :class="{ placeholder: !selectStatus }">
45
+ {{ selectStatus || placeholder }}
46
+ </span>
47
+ </template>
48
+ </div>
49
+ <ib-icon-button
50
+ v-if="showClearButton"
51
+ kind="ghost"
52
+ class="button-clear"
53
+ @click.prevent="clearValue"
54
+ :help-text="clearButtonMessage"
55
+ v-show="Object.keys(selected).length"
56
+ >
57
+ <ib-icon name="close-outline"></ib-icon>
58
+ </ib-icon-button>
59
+
60
+ <ib-icon
61
+ :name="isOpened ? 'chevron-up-outline' : 'chevron-down-outline'"
62
+ :classes="'tree-select-caret'"
63
+ />
64
+ </template>
65
+
66
+ <template v-slot:body>
67
+ <div
68
+ class="tree-drop"
69
+ :class="{ 'not-tree-child': !hasTreeChildren }"
70
+ :style="treeDropPos"
71
+ >
21
72
  <div
22
- role="combobox"
23
- tabindex="0"
24
- class="tree-choice"
25
- ref="combobox"
26
- @click.prevent
27
- @blur="onBlur"
28
- @keyup.down="comboboxKeyupDown"
29
- @keyup.up="comboboxKeyupDown"
30
- :aria-label="ariaLabel"
31
- :aria-activedescendant="focusedOptionId"
32
- :class="{
33
- 'tree-choice-opened': isOpened,
34
- 'has-clear-button': !showClearButton,
35
- 'tree-choice-error': errorMessage,
36
- }"
37
- >
38
- <template v-if="htmlOptionTitle">
39
- <span
40
- :class="{ placeholder: !selectStatus }"
41
- v-html="selectStatus || placeholder"
42
- ></span>
43
- </template>
44
- <template v-else>
45
- <span :class="{ placeholder: !selectStatus }">
46
- {{ selectStatus || placeholder }}
47
- </span>
48
- </template>
49
- </div>
50
- <ib-icon-button
51
- v-if="showClearButton"
52
- kind="ghost"
53
- class="button-clear"
54
- @click.prevent="clearValue"
55
- :help-text="clearButtonMessage"
56
- v-show="Object.keys(selected).length"
57
- >
58
- <ib-icon name="close-outline"></ib-icon>
59
- </ib-icon-button>
60
-
61
- <ib-icon
62
- :name="isOpened ? 'chevron-up-outline' : 'chevron-down-outline'"
63
- :classes="'tree-select-caret'"
64
- />
65
- </template>
66
-
67
- <template v-slot:body>
73
+ v-if="isResizable"
74
+ class="ib-dropdown-resizer ib-dropdown-resizer-left"
75
+ @mousedown="startResizing('left')"
76
+ ></div>
68
77
  <div
69
- class="tree-drop"
70
- :class="{ 'not-tree-child': !hasTreeChildren }"
71
- :style="treeDropPos"
78
+ v-if="isResizable"
79
+ class="ib-dropdown-resizer ib-dropdown-resizer-right"
80
+ @mousedown="startResizing('right')"
81
+ ></div>
82
+ <list
83
+ :class="{ 'has-hierarchy': hasHierarchy }"
84
+ v-if="Object.keys(actualBookmarkedOptions).length > 0"
85
+ >
86
+ <select-option
87
+ :key="'bookmark' + option.id"
88
+ v-for="option in actualBookmarkedOptions"
89
+ :option="option"
90
+ :parent-auto-check="false"
91
+ :is-multiple="isMultiple"
92
+ :is-bookmarkable="true"
93
+ :is-bookmarked="true"
94
+ @check="registerCheck"
95
+ @toggle-bookmark="toggleBookmark"
96
+ :uid="uid"
97
+ :only-end-nodes="onlyEndNodes"
98
+ :html-title="htmlOptionTitle"
99
+ :show-input="showInputs"
100
+ ></select-option>
101
+ </list>
102
+
103
+ <ib-input
104
+ class="tree-search"
105
+ v-if="showSearch"
106
+ ref="search"
107
+ :show-icon="true"
108
+ :value="filterString"
109
+ :aria-label="
110
+ searchPlaceholderText
111
+ ? searchPlaceholderText
112
+ : actualStrings.searchPlaceholder"
113
+ :placeholder="
114
+ searchPlaceholderText
115
+ ? searchPlaceholderText
116
+ : actualStrings.searchPlaceholder
117
+ "
118
+ @input="filter($event, actualOptions)"
119
+ @keyup.down="inputKeyupDown"
120
+ ></ib-input>
121
+
122
+ <list
123
+ ref="list"
124
+ role="listbox"
125
+ :class="{ 'tree-select-list': true, 'has-hierarchy': hasHierarchy }"
72
126
  >
73
127
  <div
74
- v-if="isResizable"
75
- class="ib-dropdown-resizer ib-dropdown-resizer-left"
76
- @mousedown="startResizing('left')"
77
- ></div>
128
+ v-if="
129
+ !requiredDependencyNotFilled &&
130
+ !visibleOptionsCount &&
131
+ hasEmptyMessage
132
+ "
133
+ class="tree-select-empty"
134
+ >
135
+ <slot name="emptyMessage"></slot>
136
+ </div>
78
137
  <div
79
- v-if="isResizable"
80
- class="ib-dropdown-resizer ib-dropdown-resizer-right"
81
- @mousedown="startResizing('right')"
82
- ></div>
83
- <list
84
- :class="{ 'has-hierarchy': hasHierarchy }"
85
- v-if="Object.keys(actualBookmarkedOptions).length > 0"
138
+ v-else-if="!requiredDependencyNotFilled && !visibleOptionsCount"
139
+ class="tree-select-default-empty tree-select-empty"
140
+ >
141
+ {{ actualStrings.emptyTitle }}
142
+ </div>
143
+ <div v-show="requiredDependencyNotFilled" class="tree-select-empty">
144
+ {{ actualStrings.requiredDependencyNotFilled }}
145
+ </div>
146
+
147
+ <template
148
+ v-if="!isMultiple && !isRequired && actualOptions.length > 0"
86
149
  >
87
150
  <select-option
88
- :key="'bookmark' + option.id"
89
- v-for="option in actualBookmarkedOptions"
90
- :option="option"
91
- :parent-auto-check="false"
151
+ :option="{
152
+ title: lang('none', 'select'),
153
+ id: null,
154
+ checked: isEmpty,
155
+ }"
156
+ :name="actualName"
157
+ :parent-auto-check="parentAutoCheck"
92
158
  :is-multiple="isMultiple"
93
- :is-bookmarkable="true"
94
- :is-bookmarked="true"
95
159
  @check="registerCheck"
96
160
  @toggle-bookmark="toggleBookmark"
97
161
  :uid="uid"
98
162
  :only-end-nodes="onlyEndNodes"
99
- :html-title="htmlOptionTitle"
100
163
  :show-input="showInputs"
101
164
  ></select-option>
102
- </list>
103
-
104
- <ib-input
105
- class="tree-search"
106
- v-if="showSearch"
107
- ref="search"
108
- :show-icon="true"
109
- :value="filterString"
110
- :aria-label="
111
- searchPlaceholderText
112
- ? searchPlaceholderText
113
- : actualStrings.searchPlaceholder"
114
- :placeholder="
115
- searchPlaceholderText
116
- ? searchPlaceholderText
117
- : actualStrings.searchPlaceholder
118
- "
119
- @input="filter($event, actualOptions)"
120
- @keyup.down="inputKeyupDown"
121
- ></ib-input>
122
-
123
- <list
124
- ref="list"
125
- role="listbox"
126
- :class="{ 'tree-select-list': true, 'has-hierarchy': hasHierarchy }"
127
- >
128
- <div
129
- v-if="
130
- !requiredDependencyNotFilled &&
131
- !visibleOptionsCount &&
132
- hasEmptyMessage
133
- "
134
- class="tree-select-empty"
135
- >
136
- <slot name="emptyMessage"></slot>
137
- </div>
138
- <div
139
- v-else-if="!requiredDependencyNotFilled && !visibleOptionsCount"
140
- class="tree-select-default-empty tree-select-empty"
141
- >
142
- {{ actualStrings.emptyTitle }}
143
- </div>
144
- <div v-show="requiredDependencyNotFilled" class="tree-select-empty">
145
- {{ actualStrings.requiredDependencyNotFilled }}
146
- </div>
165
+ </template>
147
166
 
167
+ <template v-if="!requiredDependencyNotFilled">
148
168
  <template
149
- v-if="!isMultiple && !isRequired && actualOptions.length > 0"
169
+ v-if="
170
+ allOptions &&
171
+ isMultiple &&
172
+ visibleOptionsCount &&
173
+ !requiredDependencyNotFilled
174
+ "
150
175
  >
151
176
  <select-option
152
177
  :option="{
153
- title: lang('none', 'select'),
154
- id: null,
155
- checked: isEmpty,
178
+ title: actualStrings.selectAllOptions,
179
+ id: '!all!',
180
+ initiallyVisible: true,
181
+ visible: true,
182
+ isDisabled: visibleOptionsCount < optionsCount,
183
+ checked: allOptionsIsChecked,
184
+ isIndeterminate: Object.keys(selected).length
185
+ ? true
186
+ : false,
156
187
  }"
188
+ :is-toggle="isToggle"
157
189
  :name="actualName"
158
- :parent-auto-check="parentAutoCheck"
190
+ :parent-auto-check="false"
159
191
  :is-multiple="isMultiple"
160
- @check="registerCheck"
161
- @toggle-bookmark="toggleBookmark"
192
+ :is-bookmarkable="false"
162
193
  :uid="uid"
163
194
  :only-end-nodes="onlyEndNodes"
164
195
  :show-input="showInputs"
196
+ @check="manageAll"
197
+ @on-focus="(id) => focusedOptionId = id"
165
198
  ></select-option>
166
199
  </template>
167
200
 
168
- <template v-if="!requiredDependencyNotFilled">
169
- <template
170
- v-if="
171
- allOptions &&
172
- isMultiple &&
173
- visibleOptionsCount &&
174
- !requiredDependencyNotFilled
175
- "
201
+ <template
202
+ v-for="option in actualOptions"
203
+ :key="name + option.value"
204
+ >
205
+ <slot
206
+ :option="option"
207
+ :name="actualName"
208
+ :parent-auto-check="parentAutoCheck"
209
+ :is-multiple="isMultiple"
210
+ :uid="uid"
211
+ :only-end-nodes="onlyEndNodes"
212
+ :html-title="htmlOptionTitle"
213
+ :show-input="showInputs"
176
214
  >
177
215
  <select-option
178
- :option="{
179
- title: actualStrings.selectAllOptions,
180
- id: '!all!',
181
- initiallyVisible: true,
182
- visible: true,
183
- isDisabled: visibleOptionsCount < optionsCount,
184
- checked: allOptionsIsChecked,
185
- isIndeterminate: Object.keys(selected).length
186
- ? true
187
- : false,
188
- }"
189
- :is-toggle="isToggle"
190
- :name="actualName"
191
- :parent-auto-check="false"
192
- :is-multiple="isMultiple"
193
- :is-bookmarkable="false"
194
- :uid="uid"
195
- :only-end-nodes="onlyEndNodes"
196
- :show-input="showInputs"
197
- @check="manageAll"
198
- @on-focus="(id) => focusedOptionId = id"
199
- ></select-option>
200
- </template>
201
-
202
- <template
203
- v-for="option in actualOptions"
204
- :key="name + option.value"
205
- >
206
- <slot
216
+ v-show="option.visible"
207
217
  :option="option"
218
+ :is-toggle="isToggle"
208
219
  :name="actualName"
209
220
  :parent-auto-check="parentAutoCheck"
210
221
  :is-multiple="isMultiple"
222
+ :is-bookmarkable="isBookmarkable"
211
223
  :uid="uid"
212
224
  :only-end-nodes="onlyEndNodes"
213
225
  :html-title="htmlOptionTitle"
214
226
  :show-input="showInputs"
215
- >
216
- <select-option
217
- v-show="option.visible"
218
- :option="option"
219
- :is-toggle="isToggle"
220
- :name="actualName"
221
- :parent-auto-check="parentAutoCheck"
222
- :is-multiple="isMultiple"
223
- :is-bookmarkable="isBookmarkable"
224
- :uid="uid"
225
- :only-end-nodes="onlyEndNodes"
226
- :html-title="htmlOptionTitle"
227
- :show-input="showInputs"
228
- @check="registerCheck"
229
- @toggle-bookmark="toggleBookmark"
230
- @on-focus="(id) => focusedOptionId = id"
231
- ></select-option>
232
- </slot>
233
- </template>
227
+ @check="registerCheck"
228
+ @toggle-bookmark="toggleBookmark"
229
+ @on-focus="(id) => focusedOptionId = id"
230
+ ></select-option>
231
+ </slot>
234
232
  </template>
235
- </list>
236
- </div>
237
- </template>
238
- </ib-dropdown>
239
- </div>
233
+ </template>
234
+ </list>
235
+ </div>
236
+ </template>
237
+ </ib-dropdown>
240
238
  </div>
241
-
242
239
  </template>
243
240
 
244
241
  <script>