comand-component-library 3.2.8 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/comand-component-library.css +1 -1
- package/dist/comand-component-library.umd.min.js +1 -1
- package/package.json +2 -2
- package/src/App.vue +43 -19
- package/src/assets/data/fake-select-options-with-icons.json +5 -0
- package/src/assets/data/icon.json +17 -0
- package/src/assets/data/tabs.json +3 -1
- package/src/components/CmdAddressData.vue +2 -2
- package/src/components/CmdBox.vue +1 -1
- package/src/components/CmdFakeSelect.vue +55 -15
- package/src/components/CmdFancyBox.vue +22 -19
- package/src/components/CmdFormFilters.vue +2 -2
- package/src/components/CmdIcon.vue +47 -10
- package/src/components/CmdListOfRequirements.vue +0 -5
- package/src/components/CmdLoginForm.vue +9 -10
- package/src/components/CmdMainNavigation.vue +1 -1
- package/src/components/CmdMultistepFormProgressBar.vue +2 -2
- package/src/components/CmdPager.vue +1 -1
- package/src/components/CmdSiteSearch.vue +1 -1
- package/src/components/CmdTable.vue +2 -2
- package/src/components/CmdTabs.vue +10 -6
- package/src/components/CmdTooltip.vue +1 -1
- package/src/components/CmdUploadForm.vue +2 -3
- package/src/directives/focus.js +1 -1
- package/src/documentation/generated/CmdFakeSelectPropertyDescriptions.json +5 -0
- package/src/documentation/generated/CmdIconPropertyDescriptions.json +32 -0
@@ -1,25 +1,39 @@
|
|
1
1
|
<template>
|
2
|
-
|
3
|
-
<
|
2
|
+
<!-- begin iconify-icon -->
|
3
|
+
<Icon v-if="isIconify" :icon="iconClass" :title="tooltip"></Icon>
|
4
|
+
<!-- end iconify-icon -->
|
5
|
+
|
6
|
+
<!-- being icon from local iconfont -->
|
7
|
+
<span v-else :class="iconClass" :title="tooltip"></span>
|
8
|
+
<!-- end icon from local iconfont -->
|
4
9
|
</template>
|
5
10
|
|
6
11
|
<script>
|
12
|
+
// import components
|
13
|
+
import {Icon} from "@iconify/vue"
|
14
|
+
|
7
15
|
export default {
|
8
16
|
name: "CmdIcon",
|
17
|
+
components: {
|
18
|
+
Icon
|
19
|
+
},
|
9
20
|
props: {
|
10
21
|
/**
|
11
|
-
*
|
12
|
-
* '
|
13
|
-
*
|
22
|
+
* type that defines where the icon is loaded from
|
23
|
+
* 'auto' is for letting the component check (by classname) if the icon should be loaded from the local iconfont (class="icon-'iconname'")
|
24
|
+
* or if the icon should be loaded form iconify-api (class='fontprefix':'iconname') (https://iconify.design/)
|
25
|
+
* 'iconify' forces the component to load an iconfify icon (without api) from a local source (which must be defined)
|
14
26
|
*
|
15
|
-
* @allowedValues: '
|
27
|
+
* @allowedValues: 'auto', 'iconify'
|
16
28
|
*/
|
17
|
-
|
29
|
+
type: {
|
18
30
|
type: String,
|
19
|
-
default:
|
31
|
+
default: "auto"
|
20
32
|
},
|
21
33
|
/**
|
22
|
-
* icon-class for icon
|
34
|
+
* icon-class for icon from local iconfont
|
35
|
+
*
|
36
|
+
* type-property must be set to auto and classname must include icon-'iconname'
|
23
37
|
*/
|
24
38
|
iconClass: {
|
25
39
|
type: String,
|
@@ -34,6 +48,29 @@ export default {
|
|
34
48
|
type: String,
|
35
49
|
required: false
|
36
50
|
}
|
51
|
+
},
|
52
|
+
computed: {
|
53
|
+
isIconify() {
|
54
|
+
if (this.type === "iconify") {
|
55
|
+
return true
|
56
|
+
}
|
57
|
+
|
58
|
+
if (this.type === "auto") {
|
59
|
+
return this.iconClass.includes(":")
|
60
|
+
}
|
61
|
+
return false
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
|
+
</script>
|
66
|
+
|
67
|
+
<style lang="scss">
|
68
|
+
.iconify {
|
69
|
+
font-size: var(--icon-size);
|
70
|
+
vertical-align: text-bottom;
|
71
|
+
|
72
|
+
& + span, span + & {
|
73
|
+
margin-left: calc(var(--default-margin) / 2);
|
37
74
|
}
|
38
75
|
}
|
39
|
-
</
|
76
|
+
</style>
|
@@ -176,7 +176,6 @@ export default {
|
|
176
176
|
}
|
177
177
|
|
178
178
|
span[class*="icon"] {
|
179
|
-
font-size: 1.2rem;
|
180
179
|
color: var(--status-color);
|
181
180
|
}
|
182
181
|
|
@@ -186,10 +185,6 @@ export default {
|
|
186
185
|
justify-content: center;
|
187
186
|
text-align: center;
|
188
187
|
text-decoration: none;
|
189
|
-
|
190
|
-
span[class*="icon"] {
|
191
|
-
font-size: 1.2rem;
|
192
|
-
}
|
193
188
|
}
|
194
189
|
}
|
195
190
|
}
|
@@ -47,7 +47,7 @@
|
|
47
47
|
<template v-if="options.forgotPassword || options.createAccount">
|
48
48
|
<!-- begin link for 'forgot password' -->
|
49
49
|
<a v-if="options.forgotPassword" href="#" @click.prevent="sendLogin = true">
|
50
|
-
<span v-if="options.forgotPassword.icon
|
50
|
+
<span v-if="options.forgotPassword.icon?.show && options.forgotPassword.icon?.iconClass"
|
51
51
|
:class="options.forgotPassword.icon.iconClass"
|
52
52
|
:title="options.forgotPassword.icon.tooltip">
|
53
53
|
</span>
|
@@ -57,7 +57,7 @@
|
|
57
57
|
|
58
58
|
<!-- begin link-type 'href' for 'create account' -->
|
59
59
|
<a v-if="options.createAccount && options.createAccount.linkType === 'href'" :href="options.createAccount.path">
|
60
|
-
<span v-if="options.createAccount.icon
|
60
|
+
<span v-if="options.createAccount.icon?.show && options.createAccount.icon?.iconClass"
|
61
61
|
:class="options.createAccount.icon.iconClass"
|
62
62
|
:title="options.forgotPassword.icon.tooltip">
|
63
63
|
</span>
|
@@ -294,20 +294,20 @@ export default {
|
|
294
294
|
forgotPassword: {
|
295
295
|
icon: {
|
296
296
|
show: true,
|
297
|
-
iconClass: "icon-
|
297
|
+
iconClass: "icon-questionmark-circle",
|
298
298
|
tooltip: ""
|
299
299
|
},
|
300
|
-
text: "Forgot password
|
300
|
+
text: "Forgot password"
|
301
301
|
},
|
302
302
|
createAccount: {
|
303
303
|
linkType: "href",
|
304
304
|
path: "#",
|
305
305
|
icon: {
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
text: "Create new account
|
306
|
+
show: true,
|
307
|
+
iconClass: "icon-register",
|
308
|
+
tooltip: ""
|
309
|
+
},
|
310
|
+
text: "Create new account"
|
311
311
|
},
|
312
312
|
backToLoginForm: {
|
313
313
|
icon: {
|
@@ -428,7 +428,6 @@ export default {
|
|
428
428
|
flex: none;
|
429
429
|
|
430
430
|
span[class*="icon"] {
|
431
|
-
font-size: 1.3rem;
|
432
431
|
text-decoration: none;
|
433
432
|
}
|
434
433
|
}
|
@@ -137,7 +137,7 @@ export default {
|
|
137
137
|
z-index: 1;
|
138
138
|
|
139
139
|
&::before {
|
140
|
-
font-size:
|
140
|
+
font-size: var(--font-size-small);
|
141
141
|
}
|
142
142
|
}
|
143
143
|
}
|
@@ -179,7 +179,6 @@ export default {
|
|
179
179
|
|
180
180
|
&.active {
|
181
181
|
a {
|
182
|
-
font-weight: bold;
|
183
182
|
background: var(--primary-color);
|
184
183
|
|
185
184
|
span, span[class*='icon'] {
|
@@ -207,6 +206,7 @@ export default {
|
|
207
206
|
& + span[class*="icon"] {
|
208
207
|
&:last-child {
|
209
208
|
border-color: var(--border-color);
|
209
|
+
color: var(--pure-white);
|
210
210
|
background: var(--secondary-color);
|
211
211
|
}
|
212
212
|
}
|
@@ -199,7 +199,7 @@ export default {
|
|
199
199
|
min-height: 2rem;
|
200
200
|
|
201
201
|
span[class*="icon"] {
|
202
|
-
font-size:
|
202
|
+
font-size: var(--icon-size-small);
|
203
203
|
}
|
204
204
|
}
|
205
205
|
}
|
@@ -215,7 +215,7 @@ export default {
|
|
215
215
|
th {
|
216
216
|
a[class*='icon-'] {
|
217
217
|
&, &:hover, &:active, &:focus {
|
218
|
-
font-size:
|
218
|
+
font-size: var(--icon-size-small);
|
219
219
|
color: var(--pure-white);
|
220
220
|
}
|
221
221
|
}
|
@@ -2,8 +2,8 @@
|
|
2
2
|
<div class="cmd-tabs">
|
3
3
|
<ul :class="{'stretch-tabs' : stretchTabs}" role="tablist">
|
4
4
|
<li v-for="(tab, index) in tabs" :key="index" role="tab">
|
5
|
-
<a :class="{active : showTab === index}" @click.prevent="setActiveTab(index)" :title="!tab.name ? tab.tooltip :
|
6
|
-
<
|
5
|
+
<a :class="{active : showTab === index}" @click.prevent="setActiveTab(index)" :title="!tab.name ? tab.tooltip : undefined" href="#">
|
6
|
+
<CmdIcon v-if="tab.iconClass" :iconClass="tab.iconClass"></CmdIcon>
|
7
7
|
<span v-if="tab.name">{{ tab.name }}</span>
|
8
8
|
</a>
|
9
9
|
</li>
|
@@ -32,13 +32,17 @@
|
|
32
32
|
</template>
|
33
33
|
|
34
34
|
<script>
|
35
|
+
import {addCollection} from "@iconify/vue"
|
36
|
+
import IconData from '@/assets/data/icon.json'
|
35
37
|
// import components
|
36
38
|
import CmdHeadline from "./CmdHeadline"
|
37
|
-
|
39
|
+
import CmdIcon from "./CmdIcon"
|
40
|
+
addCollection(IconData)
|
38
41
|
export default {
|
39
42
|
name: "CmdTabs",
|
40
43
|
components: {
|
41
|
-
CmdHeadline
|
44
|
+
CmdHeadline,
|
45
|
+
CmdIcon
|
42
46
|
},
|
43
47
|
data() {
|
44
48
|
return {
|
@@ -140,10 +144,10 @@ export default {
|
|
140
144
|
}
|
141
145
|
|
142
146
|
&.active {
|
143
|
-
|
147
|
+
color: var(--pure-white);
|
144
148
|
|
145
149
|
&:hover, &:active, &:focus {
|
146
|
-
|
150
|
+
background: var(--hyperlink-color);
|
147
151
|
}
|
148
152
|
}
|
149
153
|
}
|
@@ -1046,10 +1046,9 @@ export default {
|
|
1046
1046
|
left: 50%;
|
1047
1047
|
transform: translateX(-50%);
|
1048
1048
|
z-index: 1;
|
1049
|
-
font-size: 1.2rem;
|
1050
1049
|
display: table;
|
1051
|
-
top:
|
1052
|
-
padding:
|
1050
|
+
top: .2rem;
|
1051
|
+
padding: .1rem .2rem;
|
1053
1052
|
line-height: 100%;
|
1054
1053
|
background: var(--color-scheme-background-color);
|
1055
1054
|
}
|
package/src/directives/focus.js
CHANGED
@@ -2,7 +2,7 @@ export default {
|
|
2
2
|
// el = real dom-element
|
3
3
|
mounted(el) {
|
4
4
|
// check if element is native input-element
|
5
|
-
if(el.tagName === "INPUT" || el.tagName === "SELECT" || el.tagName === "TEXTAREA") {
|
5
|
+
if(el.tagName === "INPUT" || el.tagName === "SELECT" || el.tagName === "TEXTAREA" || el.tagName === "A") {
|
6
6
|
el.focus()
|
7
7
|
} else {
|
8
8
|
// check if component is used, which contains a native input-element
|
@@ -0,0 +1,32 @@
|
|
1
|
+
{
|
2
|
+
"type": {
|
3
|
+
"comments": [
|
4
|
+
"type that defines where the icon is loaded from",
|
5
|
+
"'auto' is for letting the component check (by classname) if the icon should be loaded from the local iconfont (class=\"icon-'iconname'\")",
|
6
|
+
" or if the icon should be loaded form iconify-api (class='fontprefix':'iconname') (https://iconify.design/)",
|
7
|
+
"'iconify' forces the component to load an iconfify icon (without api) from a local source (which must be defined)"
|
8
|
+
],
|
9
|
+
"annotations": {
|
10
|
+
"allowedValues": [
|
11
|
+
"'auto', 'iconify'"
|
12
|
+
]
|
13
|
+
}
|
14
|
+
},
|
15
|
+
"iconClass": {
|
16
|
+
"comments": [
|
17
|
+
"icon-class for icon from local iconfont",
|
18
|
+
"",
|
19
|
+
"type-property must be set to auto and classname must include icon-'iconname'"
|
20
|
+
]
|
21
|
+
},
|
22
|
+
"tooltip": {
|
23
|
+
"comments": [
|
24
|
+
"tooltip text for icon"
|
25
|
+
],
|
26
|
+
"annotations": {
|
27
|
+
"requiredForAccessibility": [
|
28
|
+
"true"
|
29
|
+
]
|
30
|
+
}
|
31
|
+
}
|
32
|
+
}
|