comand-component-library 3.2.8 → 3.3.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.
@@ -1,25 +1,39 @@
1
1
  <template>
2
- <span v-if="fontSource === 'iconify'" :title="tooltip"></span>
3
- <span v-if="fontSource === 'local'" :class="iconClass" :title="tooltip"></span>
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
- * font-source where to load the icons from
12
- * 'local' is for using an implemented icon-fonts by using class 'icon-name'
13
- * 'iconify' is for using icons from iconify-dependency (https://iconify.design/)
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: 'dependency', 'local'
27
+ * @allowedValues: 'auto', 'iconify'
16
28
  */
17
- fontSource: {
29
+ type: {
18
30
  type: String,
19
- default: 'local'
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
- </script>
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 && options.forgotPassword.icon.show && options.forgotPassword.icon.iconClass"
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 && options.createAccount.icon.show && options.createAccount.icon.iconClass"
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-help",
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
- show: true,
307
- iconClass: "icon-register",
308
- tooltip: ""
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
  }
@@ -408,7 +408,7 @@ export default {
408
408
  font-weight: bold;
409
409
 
410
410
  &[class*="icon"] {
411
- font-size: 1rem;
411
+ font-size: var(--font-size-small);
412
412
  }
413
413
  }
414
414
  }
@@ -137,7 +137,7 @@ export default {
137
137
  z-index: 1;
138
138
 
139
139
  &::before {
140
- font-size: 1rem;
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
  }
@@ -148,7 +148,7 @@ export default {
148
148
  }
149
149
 
150
150
  > [class*="icon-"] {
151
- font-size: 1rem;
151
+ font-size: var(--icon-size-small);
152
152
  }
153
153
  }
154
154
 
@@ -373,7 +373,7 @@ export default {
373
373
 
374
374
  > a {
375
375
  [class*='icon'] {
376
- font-size: 1rem;
376
+ font-size: var(--icon-size-small);
377
377
  }
378
378
  }
379
379
 
@@ -199,7 +199,7 @@ export default {
199
199
  min-height: 2rem;
200
200
 
201
201
  span[class*="icon"] {
202
- font-size: 1rem;
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: 1rem;
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 : false" href="#">
6
- <span v-if="tab.iconClass" :class="tab.iconClass"></span>
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
- color: var(--pure-white);
147
+ color: var(--pure-white);
144
148
 
145
149
  &:hover, &:active, &:focus {
146
- color: var(--hyperlink-color);
150
+ background: var(--hyperlink-color);
147
151
  }
148
152
  }
149
153
  }
@@ -194,7 +194,7 @@ export default {
194
194
 
195
195
  span[class*="icon"] {
196
196
  padding-left: 1rem;
197
- font-size: 1.2rem;
197
+ font-size: 1.1rem;
198
198
  }
199
199
  }
200
200
  }
@@ -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: 0.2rem;
1052
- padding: 0.1rem 0.2rem;
1050
+ top: .2rem;
1051
+ padding: .1rem .2rem;
1053
1052
  line-height: 100%;
1054
1053
  background: var(--color-scheme-background-color);
1055
1054
  }
@@ -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
@@ -80,5 +80,10 @@
80
80
  "comments": [
81
81
  "path to flag-files (will be combined with flag isoCode to load svg)"
82
82
  ]
83
+ },
84
+ "textPleaseSelect": {
85
+ "comments": [
86
+ "default text if no option is selected (and first option is not used)"
87
+ ]
83
88
  }
84
89
  }
@@ -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
+ }