@a-vision-software/vue-input-components 1.2.10 → 1.2.12

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": "@a-vision-software/vue-input-components",
3
- "version": "1.2.10",
3
+ "version": "1.2.12",
4
4
  "description": "A collection of reusable Vue 3 input components with TypeScript support",
5
5
  "author": "A-Vision Software",
6
6
  "license": "MIT",
@@ -1,109 +1,83 @@
1
1
  <template>
2
- <nav
3
- :class="[
4
- 'navigation',
5
- `navigation--${type}`,
6
- `navigation--${orientation}`,
7
- { 'navigation--large-icons': iconSize === 'large' },
8
- ]"
9
- :style="{
10
- '--navigation-color': color,
11
- '--navigation-hover-color': hoverColor,
12
- '--navigation-active-color': activeColor,
13
- '--navigation-disabled-color': disabledColor,
14
- '--navigation-gap': gap,
15
- '--navigation-padding': padding,
16
- '--navigation-border-radius': borderRadius,
17
- '--navigation-height': height,
18
- '--navigation-width': width,
19
- '--navigation-background-color': backgroundColor,
20
- '--navigation-active-background-color': activeBackgroundColor || 'rgba(0, 0, 0, 0.1)',
21
- '--navigation-bottom-border': showBottomBorder
22
- ? `1px solid ${bottomBorderColor || 'rgba(0, 0, 0, 0.2)'}`
23
- : 'none',
24
- '--navigation-tiles-grid': navigationGrid,
25
- 'max-height': height,
26
- }"
27
- >
2
+ <nav :class="[
3
+ 'navigation',
4
+ `navigation--${type}`,
5
+ `navigation--${orientation}`,
6
+ { 'navigation--large-icons': iconSize === 'large' },
7
+ ]" :style="{
8
+ '--navigation-color': color,
9
+ '--navigation-hover-color': hoverColor,
10
+ '--navigation-active-color': activeColor,
11
+ '--navigation-disabled-color': disabledColor,
12
+ '--navigation-gap': gap,
13
+ '--navigation-padding': padding,
14
+ '--navigation-border-radius': borderRadius,
15
+ '--navigation-height': height,
16
+ '--navigation-width': width,
17
+ '--navigation-background-color': backgroundColor,
18
+ '--navigation-active-background-color': activeBackgroundColor || 'rgba(0, 0, 0, 0.1)',
19
+ '--navigation-bottom-border': showBottomBorder
20
+ ? `1px solid ${bottomBorderColor || 'rgba(0, 0, 0, 0.2)'}`
21
+ : 'none',
22
+ '--navigation-tiles-grid': navigationGrid,
23
+ 'max-height': height,
24
+ }">
28
25
  <template v-if="type === 'tiles'">
29
26
  <div class="navigation__tiles">
30
- <div
31
- v-for="(item, index) in sortedItems"
32
- :key="item.id"
33
- class="navigation__tile"
34
- :class="[
35
- { 'navigation__tile--active': item.id === activeItem },
36
- { 'navigation__tile--disabled': item.disabled },
37
- { 'navigation__tile--right': item.alignment === 'right' },
38
- { 'navigation__tile--open': isDropdownOpen(item.id) },
39
- { 'navigation__tile--spacer': item.id.includes('spacer') },
40
- ]"
41
- :style="{
42
- '--item-alignment': item.alignment || activeItemAlignment,
43
- width: item.width || '150px',
44
- 'min-width': item.width || '150px',
45
- 'max-width': item.width || '150px',
46
- 'grid-column': item.alignment === 'right' ? `${index - items.length}` : `auto`,
47
- }"
48
- @click="(e) => !item.id.includes('spacer') && handleItemClick(item, e)"
49
- >
50
- <div
51
- class="navigation__tile-content"
52
- :class="{
53
- 'navigation__tile-content--icon-only': !item.label,
54
- 'navigation__tile-content--large-icon': iconSize === 'large' && item.icon,
55
- }"
56
- >
27
+ <div v-for="(item, index) in sortedItems" :key="item.id" class="navigation__tile" :class="[
28
+ { 'navigation__tile--active': item.id === activeItem },
29
+ { 'navigation__tile--disabled': item.disabled },
30
+ { 'navigation__tile--right': item.alignment === 'right' },
31
+ { 'navigation__tile--open': isDropdownOpen(item.id) },
32
+ { 'navigation__tile--spacer': item.id.includes('spacer') },
33
+ ]" :style="{
34
+ '--item-alignment': item.alignment || activeItemAlignment,
35
+ width: item.width || '150px',
36
+ 'min-width': item.width || '150px',
37
+ 'max-width': item.width || '150px',
38
+ 'grid-column': item.alignment === 'right' ? `${index - items.length}` : `auto`,
39
+ }" @click="(e) => !item.id.includes('spacer') && handleItemClick(item, e)">
40
+ <div class="navigation__tile-content" :class="{
41
+ 'navigation__tile-content--icon-only': !item.label,
42
+ 'navigation__tile-content--large-icon': iconSize === 'large' && item.icon,
43
+ }">
57
44
  <div v-if="item.icon" class="navigation__icon">
58
- <img
59
- v-if="item.icon.startsWith('img:')"
60
- :src="item.icon.substring(4)"
61
- :alt="item.label || 'Icon'"
62
- class="navigation__icon-image"
63
- />
45
+ <img v-if="item.icon.startsWith('img:')" :src="item.icon.substring(4)" :alt="item.label || 'Icon'"
46
+ class="navigation__icon-image" />
64
47
  <font-awesome-icon v-else :icon="item.icon" />
65
48
  </div>
66
- <div v-if="item.label" class="navigation__label">
49
+ <div v-if="item.label" class="navigation__label" :class="{
50
+ 'navigation__label--small': item.labelSize === 'small',
51
+ 'navigation__label--large': item.labelSize === 'large',
52
+ }">
67
53
  <span>{{ item.label }}</span>
68
54
  <div v-if="item.children" class="navigation__dropdown-arrow">
69
55
  <font-awesome-icon icon="chevron-down" />
70
56
  </div>
71
57
  </div>
72
58
  </div>
73
- <div
74
- v-if="item.url && parseInt(height || '0') >= 80 && !item.hideExternalOpen"
75
- class="navigation__external-link"
76
- @click.stop="openUrl(item.url)"
77
- >
59
+ <div v-if="item.url && parseInt(height || '0') >= 80 && !item.hideExternalOpen"
60
+ class="navigation__external-link" @click.stop="openUrl(item.url)">
78
61
  <font-awesome-icon icon="square-up-right" />
79
62
  </div>
80
- <div
81
- v-if="item.children && isDropdownOpen(item.id)"
82
- class="navigation__dropdown-content"
83
- :class="{
84
- 'navigation__dropdown-content--start': item.alignment === 'start',
85
- 'navigation__dropdown-content--end': item.alignment === 'end',
86
- }"
87
- >
88
- <div
89
- v-for="child in item.children"
90
- :key="child.id"
91
- class="navigation__dropdown-item"
92
- :class="{
93
- 'navigation__dropdown-item--disabled': child.disabled,
94
- }"
95
- @click="(e) => handleItemClick(child, e)"
96
- >
63
+ <div v-if="item.children && isDropdownOpen(item.id)" class="navigation__dropdown-content" :class="{
64
+ 'navigation__dropdown-content--start': item.alignment === 'start',
65
+ 'navigation__dropdown-content--end': item.alignment === 'end',
66
+ }">
67
+ <div v-for="child in item.children" :key="child.id" class="navigation__dropdown-item" :class="{
68
+ 'navigation__dropdown-item--disabled': child.disabled,
69
+ }" @click="(e) => handleItemClick(child, e)">
97
70
  <div v-if="child.icon" class="navigation__icon">
98
- <img
99
- v-if="child.icon.startsWith('img:')"
100
- :src="child.icon.substring(4)"
101
- :alt="child.label || 'Icon'"
102
- class="navigation__icon-image"
103
- />
71
+ <img v-if="child.icon.startsWith('img:')" :src="child.icon.substring(4)" :alt="child.label || 'Icon'"
72
+ class="navigation__icon-image" />
104
73
  <font-awesome-icon v-else :icon="child.icon" />
105
74
  </div>
106
- <div v-if="child.label" class="navigation__label">{{ child.label }}</div>
75
+ <div v-if="child.label" class="navigation__label" :class="{
76
+ 'navigation__label--small': child.labelSize === 'small',
77
+ 'navigation__label--large': child.labelSize === 'large',
78
+ }">
79
+ {{ child.label }}
80
+ </div>
107
81
  </div>
108
82
  </div>
109
83
  </div>
@@ -112,79 +86,56 @@
112
86
 
113
87
  <template v-else>
114
88
  <div class="navigation__dropdowns">
115
- <div
116
- v-for="item in items"
117
- :key="item.id"
118
- class="navigation__dropdown"
119
- :class="[
120
- { 'navigation__dropdown--active': item.id === activeItem },
121
- { 'navigation__dropdown--disabled': item.disabled },
122
- { 'navigation__dropdown--start': item.alignment === 'start' },
123
- { 'navigation__dropdown--end': item.alignment === 'end' },
124
- { 'navigation__dropdown--open': isDropdownOpen(item.id) },
125
- ]"
126
- :style="{
127
- '--item-alignment': item.alignment || activeItemAlignment,
128
- }"
129
- >
130
- <div
131
- class="navigation__dropdown-header"
132
- :class="{
133
- 'navigation__dropdown-header--icon-only': !item.label,
134
- 'navigation__dropdown-header--large-icon': iconSize === 'large' && item.icon,
135
- }"
136
- @click="(e) => handleItemClick(item, e)"
137
- >
89
+ <div v-for="item in items" :key="item.id" class="navigation__dropdown" :class="[
90
+ { 'navigation__dropdown--active': item.id === activeItem },
91
+ { 'navigation__dropdown--disabled': item.disabled },
92
+ { 'navigation__dropdown--start': item.alignment === 'start' },
93
+ { 'navigation__dropdown--end': item.alignment === 'end' },
94
+ { 'navigation__dropdown--open': isDropdownOpen(item.id) },
95
+ ]" :style="{
96
+ '--item-alignment': item.alignment || activeItemAlignment,
97
+ }">
98
+ <div class="navigation__dropdown-header" :class="{
99
+ 'navigation__dropdown-header--icon-only': !item.label,
100
+ 'navigation__dropdown-header--large-icon': iconSize === 'large' && item.icon,
101
+ }" @click="(e) => handleItemClick(item, e)">
138
102
  <div v-if="item.icon" class="navigation__icon">
139
- <img
140
- v-if="item.icon.startsWith('img:')"
141
- :src="item.icon.substring(4)"
142
- :alt="item.label || 'Icon'"
143
- class="navigation__icon-image"
144
- />
103
+ <img v-if="item.icon.startsWith('img:')" :src="item.icon.substring(4)" :alt="item.label || 'Icon'"
104
+ class="navigation__icon-image" />
145
105
  <font-awesome-icon v-else :icon="item.icon" />
146
106
  </div>
147
- <div v-if="item.label" class="navigation__label">
107
+ <div v-if="item.label" class="navigation__label" :class="{
108
+ 'navigation__label--small': item.labelSize === 'small',
109
+ 'navigation__label--large': item.labelSize === 'large',
110
+ }">
148
111
  <span>{{ item.label }}</span>
149
112
  <div v-if="item.children" class="navigation__dropdown-arrow">
150
113
  <font-awesome-icon icon="chevron-down" />
151
114
  </div>
152
115
  </div>
153
116
  </div>
154
- <div
155
- v-if="item.url && parseInt(height || '0') >= 80 && !item.hideExternalOpen"
156
- class="navigation__external-link"
157
- @click.stop="openUrl(item.url)"
158
- >
117
+ <div v-if="item.url && parseInt(height || '0') >= 80 && !item.hideExternalOpen"
118
+ class="navigation__external-link" @click.stop="openUrl(item.url)">
159
119
  <font-awesome-icon icon="square-up-right" />
160
120
  </div>
161
- <div
162
- v-if="item.children && isDropdownOpen(item.id)"
163
- class="navigation__dropdown-content"
164
- :class="{
165
- 'navigation__dropdown-content--start': item.alignment === 'start',
166
- 'navigation__dropdown-content--end': item.alignment === 'end',
167
- }"
168
- >
169
- <div
170
- v-for="child in item.children"
171
- :key="child.id"
172
- class="navigation__dropdown-item"
173
- :class="{
174
- 'navigation__dropdown-item--disabled': child.disabled,
175
- }"
176
- @click="(e) => handleItemClick(child, e)"
177
- >
121
+ <div v-if="item.children && isDropdownOpen(item.id)" class="navigation__dropdown-content" :class="{
122
+ 'navigation__dropdown-content--start': item.alignment === 'start',
123
+ 'navigation__dropdown-content--end': item.alignment === 'end',
124
+ }">
125
+ <div v-for="child in item.children" :key="child.id" class="navigation__dropdown-item" :class="{
126
+ 'navigation__dropdown-item--disabled': child.disabled,
127
+ }" @click="(e) => handleItemClick(child, e)">
178
128
  <div v-if="child.icon" class="navigation__icon">
179
- <img
180
- v-if="child.icon.startsWith('img:')"
181
- :src="child.icon.substring(4)"
182
- :alt="child.label || 'Icon'"
183
- class="navigation__icon-image"
184
- />
129
+ <img v-if="child.icon.startsWith('img:')" :src="child.icon.substring(4)" :alt="child.label || 'Icon'"
130
+ class="navigation__icon-image" />
185
131
  <font-awesome-icon v-else :icon="child.icon" />
186
132
  </div>
187
- <div v-if="child.label" class="navigation__label">{{ child.label }}</div>
133
+ <div v-if="child.label" class="navigation__label" :class="{
134
+ 'navigation__label--small': child.labelSize === 'small',
135
+ 'navigation__label--large': child.labelSize === 'large',
136
+ }">
137
+ {{ child.label }}
138
+ </div>
188
139
  </div>
189
140
  </div>
190
141
  </div>
@@ -302,11 +253,13 @@ onUnmounted(() => {
302
253
  transition: all 0.2s ease;
303
254
  background: transparent;
304
255
  height: 100%;
256
+ overflow: hidden;
305
257
  }
306
258
 
307
259
  .navigation__tile:hover {
308
260
  border-color: var(--navigation-hover-color);
309
261
  color: var(--navigation-hover-color);
262
+ overflow: visible;
310
263
 
311
264
  .navigation__tile-content {
312
265
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
@@ -315,6 +268,7 @@ onUnmounted(() => {
315
268
  }
316
269
 
317
270
  .navigation__tile--active {
271
+ overflow: visible;
318
272
  border-color: var(--navigation-active-color);
319
273
  color: var(--navigation-active-color);
320
274
  background-color: var(--navigation-active-background-color);
@@ -552,9 +506,32 @@ onUnmounted(() => {
552
506
  .navigation__label {
553
507
  white-space: nowrap;
554
508
  text-align: center;
555
- display: flex;
509
+ display: inline-block;
510
+ overflow: hidden;
511
+ text-overflow: ellipsis;
556
512
  align-items: center;
557
513
  justify-content: center;
514
+ font-size: 1rem;
515
+ max-width: 100%;
516
+
517
+ .navigation__dropdown-arrow {
518
+ display: inline-block;
519
+ }
520
+ }
521
+
522
+ .navigation__tile:hover .navigation__label,
523
+ .navigation__tile--active .navigation__label {
524
+ text-overflow: unset;
525
+ overflow: visible;
526
+ max-width: unset;
527
+ }
528
+
529
+ .navigation__label--small {
530
+ font-size: 0.75rem;
531
+ }
532
+
533
+ .navigation__label--large {
534
+ font-size: 1.35rem;
558
535
  }
559
536
 
560
537
  .navigation__label span {
@@ -8,6 +8,7 @@ export interface NavigationItem {
8
8
  width?: string
9
9
  children?: NavigationItem[]
10
10
  hideExternalOpen?: boolean
11
+ labelSize?: 'small' | 'normal' | 'large'
11
12
  }
12
13
 
13
14
  export interface NavigationProps {
@@ -6,17 +6,9 @@
6
6
 
7
7
  <div class="navigation-test__section">
8
8
  <h2>Tiles Navigation (Default)</h2>
9
- <Navigation
10
- :items="defaultItems"
11
- type="tiles"
12
- orientation="horizontal"
13
- v-model:activeItem="activeDefaultItem"
14
- @item-click="handleDefaultClick"
15
- iconSize="large"
16
- height="90px"
17
- backgroundColor="#fff"
18
- activeBackgroundColor="var(--background-color)"
19
- />
9
+ <Navigation :items="defaultItems" type="tiles" orientation="horizontal" v-model:activeItem="activeDefaultItem"
10
+ @item-click="handleDefaultClick" iconSize="large" height="90px" backgroundColor="#fff"
11
+ activeBackgroundColor="var(--background-color)" />
20
12
  <div v-if="lastClicked.default" class="click-info">
21
13
  Last clicked: {{ lastClicked.default.url || `id:${lastClicked.default.id}` }}
22
14
  </div>
@@ -24,15 +16,8 @@
24
16
 
25
17
  <div class="navigation-test__section">
26
18
  <h2>Tabs Navigation (Mixed Alignment)</h2>
27
- <Navigation
28
- :items="mixedAlignmentItems"
29
- type="tiles"
30
- orientation="horizontal"
31
- v-model:activeItem="activeTabsItem"
32
- @item-click="handleTabsClick"
33
- height="2em"
34
- showBottomBorder
35
- />
19
+ <Navigation :items="mixedAlignmentItems" type="tiles" orientation="horizontal" v-model:activeItem="activeTabsItem"
20
+ @item-click="handleTabsClick" height="2em" showBottomBorder />
36
21
  <div v-if="lastClicked.tabs" class="click-info">
37
22
  Last clicked: {{ lastClicked.tabs.label }}
38
23
  <span v-if="lastClicked.tabs.alignment">({{ lastClicked.tabs.alignment }} aligned)</span>
@@ -41,46 +26,20 @@
41
26
 
42
27
  <div class="navigation-test__section">
43
28
  <h2>Dropdown Navigation (Vertical)</h2>
44
- <Navigation
45
- :items="dropdownItems"
46
- type="dropdowns"
47
- orientation="vertical"
48
- v-model:activeItem="activeDropdownItem"
49
- @item-click="handleDropdownClick"
50
- :showIcons="false"
51
- color="#805ad5"
52
- hoverColor="#6b46c1"
53
- activeColor="#553c9a"
54
- disabledColor="#b794f4"
55
- gap="0.5rem"
56
- padding="0.75rem 1rem"
57
- borderRadius="6px"
58
- />
29
+ <Navigation :items="dropdownItems" type="dropdowns" orientation="vertical" v-model:activeItem="activeDropdownItem"
30
+ @item-click="handleDropdownClick" :showIcons="false" color="#805ad5" hoverColor="#6b46c1" activeColor="#553c9a"
31
+ disabledColor="#b794f4" gap="0.5rem" padding="0.75rem 1rem" borderRadius="6px" />
59
32
  <div v-if="lastClicked.dropdown" class="click-info">
60
33
  Last clicked: {{ lastClicked.dropdown.label }}
61
- <span v-if="lastClicked.dropdown.children"
62
- >(has {{ lastClicked.dropdown.children.length }} children)</span
63
- >
34
+ <span v-if="lastClicked.dropdown.children">(has {{ lastClicked.dropdown.children.length }} children)</span>
64
35
  </div>
65
36
  </div>
66
37
 
67
38
  <div class="navigation-test__section">
68
39
  <h2>Custom Styled Navigation</h2>
69
- <Navigation
70
- :items="customItems"
71
- type="tiles"
72
- orientation="horizontal"
73
- v-model:activeItem="activeCustomItem"
74
- @item-click="handleCustomClick"
75
- :showIcons="false"
76
- color="#4a90e2"
77
- hoverColor="#357abd"
78
- activeColor="#2c5a8c"
79
- disabledColor="#a0c4e8"
80
- gap="1.5rem"
81
- padding="1rem 2rem"
82
- borderRadius="8px"
83
- />
40
+ <Navigation :items="customItems" type="tiles" orientation="horizontal" v-model:activeItem="activeCustomItem"
41
+ @item-click="handleCustomClick" :showIcons="false" color="#4a90e2" hoverColor="#357abd" activeColor="#2c5a8c"
42
+ disabledColor="#a0c4e8" gap="1.5rem" padding="1rem 2rem" borderRadius="8px" />
84
43
  <div v-if="lastClicked.custom" class="click-info">
85
44
  Last clicked: {{ lastClicked.custom.label }}
86
45
  <span v-if="lastClicked.custom.disabled">(disabled)</span>
@@ -120,6 +79,7 @@ const defaultItems: NavigationItem[] = [
120
79
  hideExternalOpen: true,
121
80
  icon: 'gauge-high',
122
81
  width: '200px',
82
+ labelSize: 'large',
123
83
  },
124
84
  {
125
85
  id: 'spacer',
@@ -128,7 +88,7 @@ const defaultItems: NavigationItem[] = [
128
88
  },
129
89
  {
130
90
  id: 'about',
131
- label: 'About',
91
+ label: 'About ahole lot of things',
132
92
  url: 'https://example.com',
133
93
  icon: 'info',
134
94
  alignment: 'right',
@@ -152,6 +112,7 @@ const defaultItems: NavigationItem[] = [
152
112
  icon: 'envelope',
153
113
  width: '150px',
154
114
  alignment: 'right',
115
+ labelSize: 'small',
155
116
  },
156
117
  ]
157
118