comand-component-library 4.3.28 → 5.0.0
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/dist/comand-component-library.css +1 -1
- package/dist/comand-component-library.js +9587 -9482
- package/dist/styles/demopage-only.css +12 -2
- package/package.json +47 -46
- package/src/ComponentLibrary.vue +2697 -2688
- package/src/assets/data/component-structure.json +1 -1
- package/src/assets/data/form-elements.json +224 -224
- package/src/assets/data/social-networks-page-by-json.json +43 -43
- package/src/assets/styles/component-library-global-styles.scss +296 -295
- package/src/componentSettingsDataAndControls.vue +1 -18
- package/src/components/CmdAccordion.vue +1 -1
- package/src/components/CmdAddressData.vue +6 -1
- package/src/components/CmdAddressDataItem.vue +6 -1
- package/src/components/CmdBasicForm.vue +2 -2
- package/src/components/CmdBox.vue +1103 -1092
- package/src/components/CmdBoxWrapper.vue +7 -1
- package/src/components/CmdBreadcrumbs.vue +2 -2
- package/src/components/CmdCodeOutput.vue +1 -1
- package/src/components/CmdCookieDisclaimer.vue +480 -480
- package/src/components/CmdFakeSelect.vue +930 -916
- package/src/components/CmdFlexibleScrollContainer.vue +42 -42
- package/src/components/CmdForm.vue +481 -481
- package/src/components/CmdFormElement.vue +1110 -1091
- package/src/components/CmdFormFilters.vue +146 -146
- package/src/components/CmdGoogleMaps.vue +1 -1
- package/src/components/CmdHeadline.vue +21 -4
- package/src/components/CmdIcon.vue +8 -2
- package/src/components/CmdImage.vue +14 -16
- package/src/components/CmdImageZoom.vue +9 -8
- package/src/components/CmdInputGroup.vue +436 -435
- package/src/components/CmdLink.vue +1 -1
- package/src/components/CmdList.vue +1 -1
- package/src/components/CmdListOfRequirements.vue +192 -192
- package/src/components/CmdLoginForm.vue +618 -618
- package/src/components/CmdMailToolFilter.vue +217 -217
- package/src/components/CmdMainNavigation.vue +581 -572
- package/src/components/CmdMultistepFormProgressBar.vue +9 -9
- package/src/components/CmdNewsletterSubscription.vue +199 -199
- package/src/components/CmdPagination.vue +4 -2
- package/src/components/CmdParagraph.vue +10 -4
- package/src/components/CmdProgressBar.vue +72 -72
- package/src/components/CmdSiteHeader.vue +382 -389
- package/src/components/CmdSiteSearch.vue +420 -420
- package/src/components/CmdSiteWrapper.vue +12 -5
- package/src/components/CmdSlideshow.vue +519 -519
- package/src/components/CmdSmartSearch.vue +291 -291
- package/src/components/CmdSystemMessage.vue +3 -2
- package/src/components/CmdTable.vue +401 -401
- package/src/components/CmdTabs.vue +262 -262
- package/src/components/CmdTag.vue +1 -1
- package/src/components/CmdTextImageBlock.vue +8 -2
- package/src/components/CmdThumbnailScroller.vue +0 -7
- package/src/components/CmdToggleDarkMode.vue +13 -11
- package/src/components/CmdTooltip.vue +305 -301
- package/src/components/CmdUploadForm.vue +1299 -1305
- package/src/components/CmdWidthLimitationWrapper.vue +1 -1
- package/src/components/EditComponentWrapper.vue +5 -5
- package/src/index.js +5 -0
- package/src/main.js +4 -3
- package/src/utils/template.js +57 -0
- package/src/assets/styles/template.css +0 -1
|
@@ -1,292 +1,292 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="['cmd-smart-search', {open: showListOfRecommendations, 'open-list-to-top': openListToTop}]">
|
|
3
|
-
<!-- begin CmdFormElement -->
|
|
4
|
-
<CmdFormElement
|
|
5
|
-
element="input"
|
|
6
|
-
type="search"
|
|
7
|
-
v-bind="cmdFormElementOptions"
|
|
8
|
-
v-model="searchTerm"
|
|
9
|
-
@update:modelValue="showRecommendations"
|
|
10
|
-
/>
|
|
11
|
-
<!-- end CmdFormElement -->
|
|
12
|
-
|
|
13
|
-
<!-- begin list-of-recommendations -->
|
|
14
|
-
<ul v-if="showListOfRecommendations" class="list-of-recommendations no-list-items">
|
|
15
|
-
<li v-for="(item, index) in filteredListOfRecommendations" :key="index">
|
|
16
|
-
<!-- begin CmdLink -->
|
|
17
|
-
<CmdLink v-bind="linkItem(item)" @click="optionSelected(item)">
|
|
18
|
-
<!-- begin slot -->
|
|
19
|
-
<slot></slot>
|
|
20
|
-
<!-- end slot -->
|
|
21
|
-
</CmdLink>
|
|
22
|
-
<!-- end CmdLink -->
|
|
23
|
-
</li>
|
|
24
|
-
</ul>
|
|
25
|
-
<!-- end list-of-recommendations -->
|
|
26
|
-
</div>
|
|
27
|
-
</template>
|
|
28
|
-
|
|
29
|
-
<script>
|
|
30
|
-
export default {
|
|
31
|
-
name: "CmdSmartSearch",
|
|
32
|
-
data() {
|
|
33
|
-
return {
|
|
34
|
-
showListOfRecommendations: false,
|
|
35
|
-
searchTerm: "",
|
|
36
|
-
item: {}
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
props: {
|
|
40
|
-
/**
|
|
41
|
-
* set default v-model (must be named modelValue in Vue3)
|
|
42
|
-
*/
|
|
43
|
-
modelValue: {
|
|
44
|
-
type: [Object, String],
|
|
45
|
-
required: false
|
|
46
|
-
},
|
|
47
|
-
/**
|
|
48
|
-
* provide list for recommendations shown below search-field
|
|
49
|
-
*/
|
|
50
|
-
listOfRecommendations: {
|
|
51
|
-
type: Array,
|
|
52
|
-
required: true
|
|
53
|
-
},
|
|
54
|
-
/**
|
|
55
|
-
* define the maximum listed number of recommendations
|
|
56
|
-
*/
|
|
57
|
-
maxNumberOfRecommendations: {
|
|
58
|
-
type: Number,
|
|
59
|
-
default: 5
|
|
60
|
-
},
|
|
61
|
-
/**
|
|
62
|
-
* set if list of recommendations will be filtered by first letter (else by any containing letter)
|
|
63
|
-
*/
|
|
64
|
-
filterByFirstLetter: {
|
|
65
|
-
Boolean,
|
|
66
|
-
default: false
|
|
67
|
-
},
|
|
68
|
-
// todo: replace property by computed-property that handles position of dropdown-list automatically
|
|
69
|
-
openListToTop: {
|
|
70
|
-
type: Boolean,
|
|
71
|
-
default: false
|
|
72
|
-
},
|
|
73
|
-
/**
|
|
74
|
-
* allows user to enter a new term, that is not included in the listOfRecommendations-property
|
|
75
|
-
*/
|
|
76
|
-
allowUserToEnterNewTerm: {
|
|
77
|
-
type: Boolean,
|
|
78
|
-
default: true
|
|
79
|
-
},
|
|
80
|
-
/**
|
|
81
|
-
* set properties for CmdFormElement-component (search-field)
|
|
82
|
-
*/
|
|
83
|
-
cmdFormElement: {
|
|
84
|
-
type: Object,
|
|
85
|
-
required: false
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
computed: {
|
|
89
|
-
cmdFormElementOptions() {
|
|
90
|
-
return {
|
|
91
|
-
labelText: "Search",
|
|
92
|
-
placeholder: "Enter Keyword(s)",
|
|
93
|
-
showSearchButton: false,
|
|
94
|
-
...this.cmdFormElement
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
filteredListOfRecommendations() {
|
|
98
|
-
return this.listOfRecommendations.filter(item => {
|
|
99
|
-
// check if there exists a correct displayValue
|
|
100
|
-
if (!item.displayValue || typeof item.displayValue !== "string") {
|
|
101
|
-
console.error("provided item.displayValue of 'listOfRecommendations' does not exist or does not match type 'string'!")
|
|
102
|
-
return false
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// set comparable string to lowercase
|
|
106
|
-
const lowerCaseSearchTerm = this.searchTerm.toLowerCase()
|
|
107
|
-
const lowerCaseDisplayValue = item.displayValue.toLowerCase()
|
|
108
|
-
|
|
109
|
-
// check if string from listOfRecommendations starsWith or contains the provides string from the searchfield
|
|
110
|
-
return this.filterByFirstLetter ? lowerCaseDisplayValue.startsWith(lowerCaseSearchTerm) : lowerCaseDisplayValue.includes(lowerCaseSearchTerm)
|
|
111
|
-
}).slice(0, this.maxNumberOfRecommendations)
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
methods: {
|
|
115
|
-
showRecommendations() {
|
|
116
|
-
this.item = {} // reset item
|
|
117
|
-
this.showListOfRecommendations = true
|
|
118
|
-
},
|
|
119
|
-
optionSelected(item) {
|
|
120
|
-
this.searchTerm = item.displayValue // set search-field to selected option
|
|
121
|
-
this.showListOfRecommendations = false
|
|
122
|
-
this.emitValue(item)
|
|
123
|
-
},
|
|
124
|
-
linkItem(item) {
|
|
125
|
-
return {
|
|
126
|
-
...item,
|
|
127
|
-
text: item.displayValue
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
emitValue(item) {
|
|
131
|
-
let entryOfRecommendations = null
|
|
132
|
-
|
|
133
|
-
if(typeof item === "string") {
|
|
134
|
-
entryOfRecommendations = this.listOfRecommendations.find((entry) => {
|
|
135
|
-
return entry.displayValue === item
|
|
136
|
-
})
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
const displayValue = typeof item === "string" ? item : item.displayValue
|
|
140
|
-
|
|
141
|
-
if(typeof this.modelValue === "string") {
|
|
142
|
-
this.$emit("update:modelValue", displayValue)
|
|
143
|
-
} else {
|
|
144
|
-
// modelValue is object, check if it exist as entry in listOfRecommendations and emit id and displayValue, if just a string is ented, emit id: 0 and the displayValue
|
|
145
|
-
this.$emit("update:modelValue", {id: entryOfRecommendations ? entryOfRecommendations.id : (typeof item === "string" ? 0 : item.id), displayValue})
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
watch: {
|
|
150
|
-
searchTerm() {
|
|
151
|
-
if(!this.searchTerm.length) {
|
|
152
|
-
this.showListOfRecommendations = false
|
|
153
|
-
}
|
|
154
|
-
if(this.allowUserToEnterNewTerm) {
|
|
155
|
-
this.emitValue(this.searchTerm)
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
modelValue: {
|
|
159
|
-
handler() {
|
|
160
|
-
if(typeof this.modelValue === "string") {
|
|
161
|
-
this.searchTerm = this.modelValue
|
|
162
|
-
} else {
|
|
163
|
-
const idExists = this.listOfRecommendations.find((entry) => {
|
|
164
|
-
return entry.id === this.modelValue?.id
|
|
165
|
-
})
|
|
166
|
-
this.searchTerm = idExists?.displayValue || this.modelValue?.displayValue || ""
|
|
167
|
-
}
|
|
168
|
-
},
|
|
169
|
-
immediate: true
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
</script>
|
|
174
|
-
|
|
175
|
-
<style>
|
|
176
|
-
/* begin cmd-smart-search ---------------------------------------------------------------------------------------- */
|
|
177
|
-
.cmd-smart-search {
|
|
178
|
-
&.open {
|
|
179
|
-
input {
|
|
180
|
-
border-bottom-left-radius: 0;
|
|
181
|
-
border-bottom-right-radius: 0;
|
|
182
|
-
anchor-name: --smart-search;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.list-of-recommendations {
|
|
187
|
-
position: absolute;
|
|
188
|
-
position-anchor: --smart-search;
|
|
189
|
-
top: anchor(bottom);
|
|
190
|
-
left: anchor(left);
|
|
191
|
-
width: 100%;
|
|
192
|
-
z-index: 100;
|
|
193
|
-
max-height: 15rem;
|
|
194
|
-
overflow-y: auto;
|
|
195
|
-
display: flex;
|
|
196
|
-
flex-direction: column;
|
|
197
|
-
border: var(--default-border);
|
|
198
|
-
border-top: 0;
|
|
199
|
-
background: var(--
|
|
200
|
-
border-bottom-left-radius: var(--default-border-radius);
|
|
201
|
-
border-bottom-right-radius: var(--default-border-radius);
|
|
202
|
-
position-try-options: flip-block flip-inline; /* let brwoser handle flipping on overflow */
|
|
203
|
-
position-try: --flip-to-top;
|
|
204
|
-
|
|
205
|
-
/* Fallback rule */
|
|
206
|
-
@position-try --flip-to-top {
|
|
207
|
-
bottom: anchor(top);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
li {
|
|
211
|
-
&:not(:last-child) {
|
|
212
|
-
border-bottom: var(--default-border);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
&:last-child {
|
|
216
|
-
border-bottom-left-radius: inherit;
|
|
217
|
-
border-bottom-right-radius: inherit;
|
|
218
|
-
|
|
219
|
-
a {
|
|
220
|
-
border-bottom-left-radius: inherit;
|
|
221
|
-
border-bottom-right-radius: inherit;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
a {
|
|
226
|
-
display: flex;
|
|
227
|
-
align-items: center;
|
|
228
|
-
padding: var(--default-padding);
|
|
229
|
-
text-decoration: none;
|
|
230
|
-
width: 100%;
|
|
231
|
-
background: var(--
|
|
232
|
-
|
|
233
|
-
span, span[class*="icon-"] {
|
|
234
|
-
text-decoration: none !important;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
&:hover, &:active, &:focus {
|
|
238
|
-
background: var(--hyperlink-color);
|
|
239
|
-
|
|
240
|
-
span, span[class*="icon-"] {
|
|
241
|
-
color: var(--color-
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
&.open-list-to-top {
|
|
249
|
-
&.open {
|
|
250
|
-
input {
|
|
251
|
-
border-top-left-radius: 0;
|
|
252
|
-
border-top-right-radius: 0;
|
|
253
|
-
border-bottom-left-radius: var(--default-border-radius);
|
|
254
|
-
border-bottom-right-radius: var(--default-border-radius);
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
.list-of-recommendations {
|
|
259
|
-
bottom: anchor(bottom);
|
|
260
|
-
border-bottom: 0;
|
|
261
|
-
top: auto;
|
|
262
|
-
bottom: var(--form-input-height);
|
|
263
|
-
border-radius: 0;
|
|
264
|
-
border-top-left-radius: var(--default-border-radius);
|
|
265
|
-
border-top-right-radius: var(--default-border-radius);
|
|
266
|
-
|
|
267
|
-
li {
|
|
268
|
-
&:first-child {
|
|
269
|
-
border-top: var(--default-border);
|
|
270
|
-
border-top-left-radius: inherit;
|
|
271
|
-
border-top-right-radius: inherit;
|
|
272
|
-
|
|
273
|
-
a {
|
|
274
|
-
border-top-left-radius: inherit;
|
|
275
|
-
border-top-right-radius: inherit;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
&:last-child {
|
|
280
|
-
border-bottom: 0;
|
|
281
|
-
border-radius: inherit;
|
|
282
|
-
|
|
283
|
-
a {
|
|
284
|
-
border-radius: 0;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
/* end cmd-smart-search ---------------------------------------------------------------------------------------- */
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="['cmd-smart-search', {open: showListOfRecommendations, 'open-list-to-top': openListToTop}]">
|
|
3
|
+
<!-- begin CmdFormElement -->
|
|
4
|
+
<CmdFormElement
|
|
5
|
+
element="input"
|
|
6
|
+
type="search"
|
|
7
|
+
v-bind="cmdFormElementOptions"
|
|
8
|
+
v-model="searchTerm"
|
|
9
|
+
@update:modelValue="showRecommendations"
|
|
10
|
+
/>
|
|
11
|
+
<!-- end CmdFormElement -->
|
|
12
|
+
|
|
13
|
+
<!-- begin list-of-recommendations -->
|
|
14
|
+
<ul v-if="showListOfRecommendations" class="list-of-recommendations no-list-items">
|
|
15
|
+
<li v-for="(item, index) in filteredListOfRecommendations" :key="index">
|
|
16
|
+
<!-- begin CmdLink -->
|
|
17
|
+
<CmdLink v-bind="linkItem(item)" @click="optionSelected(item)">
|
|
18
|
+
<!-- begin slot -->
|
|
19
|
+
<slot></slot>
|
|
20
|
+
<!-- end slot -->
|
|
21
|
+
</CmdLink>
|
|
22
|
+
<!-- end CmdLink -->
|
|
23
|
+
</li>
|
|
24
|
+
</ul>
|
|
25
|
+
<!-- end list-of-recommendations -->
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script>
|
|
30
|
+
export default {
|
|
31
|
+
name: "CmdSmartSearch",
|
|
32
|
+
data() {
|
|
33
|
+
return {
|
|
34
|
+
showListOfRecommendations: false,
|
|
35
|
+
searchTerm: "",
|
|
36
|
+
item: {}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
props: {
|
|
40
|
+
/**
|
|
41
|
+
* set default v-model (must be named modelValue in Vue3)
|
|
42
|
+
*/
|
|
43
|
+
modelValue: {
|
|
44
|
+
type: [Object, String],
|
|
45
|
+
required: false
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* provide list for recommendations shown below search-field
|
|
49
|
+
*/
|
|
50
|
+
listOfRecommendations: {
|
|
51
|
+
type: Array,
|
|
52
|
+
required: true
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* define the maximum listed number of recommendations
|
|
56
|
+
*/
|
|
57
|
+
maxNumberOfRecommendations: {
|
|
58
|
+
type: Number,
|
|
59
|
+
default: 5
|
|
60
|
+
},
|
|
61
|
+
/**
|
|
62
|
+
* set if list of recommendations will be filtered by first letter (else by any containing letter)
|
|
63
|
+
*/
|
|
64
|
+
filterByFirstLetter: {
|
|
65
|
+
Boolean,
|
|
66
|
+
default: false
|
|
67
|
+
},
|
|
68
|
+
// todo: replace property by computed-property that handles position of dropdown-list automatically
|
|
69
|
+
openListToTop: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: false
|
|
72
|
+
},
|
|
73
|
+
/**
|
|
74
|
+
* allows user to enter a new term, that is not included in the listOfRecommendations-property
|
|
75
|
+
*/
|
|
76
|
+
allowUserToEnterNewTerm: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: true
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* set properties for CmdFormElement-component (search-field)
|
|
82
|
+
*/
|
|
83
|
+
cmdFormElement: {
|
|
84
|
+
type: Object,
|
|
85
|
+
required: false
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
computed: {
|
|
89
|
+
cmdFormElementOptions() {
|
|
90
|
+
return {
|
|
91
|
+
labelText: "Search",
|
|
92
|
+
placeholder: "Enter Keyword(s)",
|
|
93
|
+
showSearchButton: false,
|
|
94
|
+
...this.cmdFormElement
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
filteredListOfRecommendations() {
|
|
98
|
+
return this.listOfRecommendations.filter(item => {
|
|
99
|
+
// check if there exists a correct displayValue
|
|
100
|
+
if (!item.displayValue || typeof item.displayValue !== "string") {
|
|
101
|
+
console.error("provided item.displayValue of 'listOfRecommendations' does not exist or does not match type 'string'!")
|
|
102
|
+
return false
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// set comparable string to lowercase
|
|
106
|
+
const lowerCaseSearchTerm = this.searchTerm.toLowerCase()
|
|
107
|
+
const lowerCaseDisplayValue = item.displayValue.toLowerCase()
|
|
108
|
+
|
|
109
|
+
// check if string from listOfRecommendations starsWith or contains the provides string from the searchfield
|
|
110
|
+
return this.filterByFirstLetter ? lowerCaseDisplayValue.startsWith(lowerCaseSearchTerm) : lowerCaseDisplayValue.includes(lowerCaseSearchTerm)
|
|
111
|
+
}).slice(0, this.maxNumberOfRecommendations)
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
methods: {
|
|
115
|
+
showRecommendations() {
|
|
116
|
+
this.item = {} // reset item
|
|
117
|
+
this.showListOfRecommendations = true
|
|
118
|
+
},
|
|
119
|
+
optionSelected(item) {
|
|
120
|
+
this.searchTerm = item.displayValue // set search-field to selected option
|
|
121
|
+
this.showListOfRecommendations = false
|
|
122
|
+
this.emitValue(item)
|
|
123
|
+
},
|
|
124
|
+
linkItem(item) {
|
|
125
|
+
return {
|
|
126
|
+
...item,
|
|
127
|
+
text: item.displayValue
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
emitValue(item) {
|
|
131
|
+
let entryOfRecommendations = null
|
|
132
|
+
|
|
133
|
+
if(typeof item === "string") {
|
|
134
|
+
entryOfRecommendations = this.listOfRecommendations.find((entry) => {
|
|
135
|
+
return entry.displayValue === item
|
|
136
|
+
})
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const displayValue = typeof item === "string" ? item : item.displayValue
|
|
140
|
+
|
|
141
|
+
if(typeof this.modelValue === "string") {
|
|
142
|
+
this.$emit("update:modelValue", displayValue)
|
|
143
|
+
} else {
|
|
144
|
+
// modelValue is object, check if it exist as entry in listOfRecommendations and emit id and displayValue, if just a string is ented, emit id: 0 and the displayValue
|
|
145
|
+
this.$emit("update:modelValue", {id: entryOfRecommendations ? entryOfRecommendations.id : (typeof item === "string" ? 0 : item.id), displayValue})
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
watch: {
|
|
150
|
+
searchTerm() {
|
|
151
|
+
if(!this.searchTerm.length) {
|
|
152
|
+
this.showListOfRecommendations = false
|
|
153
|
+
}
|
|
154
|
+
if(this.allowUserToEnterNewTerm) {
|
|
155
|
+
this.emitValue(this.searchTerm)
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
modelValue: {
|
|
159
|
+
handler() {
|
|
160
|
+
if(typeof this.modelValue === "string") {
|
|
161
|
+
this.searchTerm = this.modelValue
|
|
162
|
+
} else {
|
|
163
|
+
const idExists = this.listOfRecommendations.find((entry) => {
|
|
164
|
+
return entry.id === this.modelValue?.id
|
|
165
|
+
})
|
|
166
|
+
this.searchTerm = idExists?.displayValue || this.modelValue?.displayValue || ""
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
immediate: true
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
</script>
|
|
174
|
+
|
|
175
|
+
<style>
|
|
176
|
+
/* begin cmd-smart-search ---------------------------------------------------------------------------------------- */
|
|
177
|
+
.cmd-smart-search {
|
|
178
|
+
&.open {
|
|
179
|
+
input {
|
|
180
|
+
border-bottom-left-radius: 0;
|
|
181
|
+
border-bottom-right-radius: 0;
|
|
182
|
+
anchor-name: --smart-search;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.list-of-recommendations {
|
|
187
|
+
position: absolute;
|
|
188
|
+
position-anchor: --smart-search;
|
|
189
|
+
top: anchor(bottom);
|
|
190
|
+
left: anchor(left);
|
|
191
|
+
width: 100%;
|
|
192
|
+
z-index: 100;
|
|
193
|
+
max-height: 15rem;
|
|
194
|
+
overflow-y: auto;
|
|
195
|
+
display: flex;
|
|
196
|
+
flex-direction: column;
|
|
197
|
+
border: var(--default-border);
|
|
198
|
+
border-top: 0;
|
|
199
|
+
background: var(--color-scheme-background-subtle);
|
|
200
|
+
border-bottom-left-radius: var(--default-border-radius);
|
|
201
|
+
border-bottom-right-radius: var(--default-border-radius);
|
|
202
|
+
position-try-options: flip-block flip-inline; /* let brwoser handle flipping on overflow */
|
|
203
|
+
position-try: --flip-to-top;
|
|
204
|
+
|
|
205
|
+
/* Fallback rule */
|
|
206
|
+
@position-try --flip-to-top {
|
|
207
|
+
bottom: anchor(top);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
li {
|
|
211
|
+
&:not(:last-child) {
|
|
212
|
+
border-bottom: var(--default-border);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
&:last-child {
|
|
216
|
+
border-bottom-left-radius: inherit;
|
|
217
|
+
border-bottom-right-radius: inherit;
|
|
218
|
+
|
|
219
|
+
a {
|
|
220
|
+
border-bottom-left-radius: inherit;
|
|
221
|
+
border-bottom-right-radius: inherit;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
a {
|
|
226
|
+
display: flex;
|
|
227
|
+
align-items: center;
|
|
228
|
+
padding: var(--default-padding);
|
|
229
|
+
text-decoration: none;
|
|
230
|
+
width: 100%;
|
|
231
|
+
background: var(--color-scheme-background-subtle);
|
|
232
|
+
|
|
233
|
+
span, span[class*="icon-"] {
|
|
234
|
+
text-decoration: none !important;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
&:hover, &:active, &:focus {
|
|
238
|
+
background: var(--hyperlink-color);
|
|
239
|
+
|
|
240
|
+
span, span[class*="icon-"] {
|
|
241
|
+
color: var(--hyperlink-color-contrast-text);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
&.open-list-to-top {
|
|
249
|
+
&.open {
|
|
250
|
+
input {
|
|
251
|
+
border-top-left-radius: 0;
|
|
252
|
+
border-top-right-radius: 0;
|
|
253
|
+
border-bottom-left-radius: var(--default-border-radius);
|
|
254
|
+
border-bottom-right-radius: var(--default-border-radius);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.list-of-recommendations {
|
|
259
|
+
bottom: anchor(bottom);
|
|
260
|
+
border-bottom: 0;
|
|
261
|
+
top: auto;
|
|
262
|
+
bottom: var(--form-input-height);
|
|
263
|
+
border-radius: 0;
|
|
264
|
+
border-top-left-radius: var(--default-border-radius);
|
|
265
|
+
border-top-right-radius: var(--default-border-radius);
|
|
266
|
+
|
|
267
|
+
li {
|
|
268
|
+
&:first-child {
|
|
269
|
+
border-top: var(--default-border);
|
|
270
|
+
border-top-left-radius: inherit;
|
|
271
|
+
border-top-right-radius: inherit;
|
|
272
|
+
|
|
273
|
+
a {
|
|
274
|
+
border-top-left-radius: inherit;
|
|
275
|
+
border-top-right-radius: inherit;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
&:last-child {
|
|
280
|
+
border-bottom: 0;
|
|
281
|
+
border-radius: inherit;
|
|
282
|
+
|
|
283
|
+
a {
|
|
284
|
+
border-radius: 0;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
/* end cmd-smart-search ---------------------------------------------------------------------------------------- */
|
|
292
292
|
</style>
|
|
@@ -219,8 +219,8 @@ export default {
|
|
|
219
219
|
position: absolute;
|
|
220
220
|
width: auto;
|
|
221
221
|
/* avoids stretching by flex-containers */
|
|
222
|
-
top:
|
|
223
|
-
right:
|
|
222
|
+
top: var(--system-message-padding-top-bottom);
|
|
223
|
+
right: calc(var(--system-message-padding-left-right) / 2);
|
|
224
224
|
text-decoration: none;
|
|
225
225
|
z-index: 10;
|
|
226
226
|
line-height: 1;
|
|
@@ -229,6 +229,7 @@ export default {
|
|
|
229
229
|
|
|
230
230
|
[class*="icon-"] {
|
|
231
231
|
color: var(--default-text-color);
|
|
232
|
+
font-size: var(--icon-size-large);
|
|
232
233
|
}
|
|
233
234
|
|
|
234
235
|
&:hover,
|