@awes-io/ui 2.100.0 → 2.100.1
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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.100.1](https://github.com/awes-io/client/compare/@awes-io/ui@2.100.0...@awes-io/ui@2.100.1) (2024-04-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* styles fixes ([baf58ba](https://github.com/awes-io/client/commit/baf58ba2e65709e5faed5203246c07c609c945f8))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [2.100.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.99.0...@awes-io/ui@2.100.0) (2024-04-04)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -2,15 +2,18 @@
|
|
|
2
2
|
<div
|
|
3
3
|
ref="element"
|
|
4
4
|
class="aw-select-fake-input flex max-w-full aw-text-field is-text"
|
|
5
|
-
:class="
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
:class="[
|
|
6
|
+
themeClasses,
|
|
7
|
+
{
|
|
8
|
+
'is-filled': value === 0 || !!value,
|
|
9
|
+
'has-label': !!label,
|
|
10
|
+
'has-error': hasError,
|
|
11
|
+
'is-disabled': isDisabled,
|
|
12
|
+
'has-icon': $slots.icon,
|
|
13
|
+
'has-prefix': prefix,
|
|
14
|
+
'has-postfix': postfix
|
|
15
|
+
}
|
|
16
|
+
]"
|
|
14
17
|
@click="$emit('open')"
|
|
15
18
|
>
|
|
16
19
|
<span
|
|
@@ -95,6 +98,7 @@
|
|
|
95
98
|
</template>
|
|
96
99
|
|
|
97
100
|
<script>
|
|
101
|
+
import { isType } from 'rambdax'
|
|
98
102
|
import TextFieldMixin from '@AwMixins/text-field'
|
|
99
103
|
|
|
100
104
|
export default {
|
|
@@ -123,6 +127,11 @@ export default {
|
|
|
123
127
|
default: ''
|
|
124
128
|
},
|
|
125
129
|
|
|
130
|
+
theme: {
|
|
131
|
+
type: String,
|
|
132
|
+
default: ''
|
|
133
|
+
},
|
|
134
|
+
|
|
126
135
|
clearable: Boolean,
|
|
127
136
|
|
|
128
137
|
caret: Boolean,
|
|
@@ -135,6 +144,14 @@ export default {
|
|
|
135
144
|
return this.size === 'md' ? 'p-3' : 'p-2'
|
|
136
145
|
},
|
|
137
146
|
|
|
147
|
+
themeClasses() {
|
|
148
|
+
return isType('String', this.theme)
|
|
149
|
+
? this.theme
|
|
150
|
+
.split(',')
|
|
151
|
+
.map((modifier) => `aw-text-field--${modifier.trim()}`)
|
|
152
|
+
: []
|
|
153
|
+
},
|
|
154
|
+
|
|
138
155
|
iconCount() {
|
|
139
156
|
return 0 + this.clearable + this.caret
|
|
140
157
|
}
|
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
class="aw-modal-buttons"
|
|
4
|
+
:class="{
|
|
5
|
+
'aw-modal-buttons--desktop': isDesktop,
|
|
6
|
+
'aw-modal-buttons--mobile': !isDesktop
|
|
7
|
+
}"
|
|
8
|
+
>
|
|
3
9
|
<!-- visible buttons -->
|
|
4
10
|
<slot name="buttons" :buttons="groupedButtons.buttons">
|
|
5
11
|
<AwButton
|
|
6
|
-
v-for="({
|
|
12
|
+
v-for="({
|
|
13
|
+
listeners,
|
|
14
|
+
tooltip,
|
|
15
|
+
size,
|
|
16
|
+
cssClass,
|
|
17
|
+
autoWidth,
|
|
18
|
+
...attrs
|
|
19
|
+
},
|
|
20
|
+
i) in groupedButtons.buttons"
|
|
7
21
|
:key="i"
|
|
8
22
|
v-tooltip.prepend="tooltip"
|
|
9
23
|
v-bind="attrs"
|
|
@@ -12,22 +26,38 @@
|
|
|
12
26
|
:class="[
|
|
13
27
|
cssClass,
|
|
14
28
|
{
|
|
15
|
-
'aw-modal-buttons__button--equal':
|
|
29
|
+
'aw-modal-buttons__button--equal':
|
|
30
|
+
!isDesktop && !autoWidth
|
|
16
31
|
}
|
|
17
32
|
]"
|
|
18
33
|
v-on="listeners"
|
|
19
34
|
/>
|
|
20
35
|
</slot>
|
|
21
36
|
|
|
37
|
+
<!-- single non-cta button -->
|
|
38
|
+
<AwButton
|
|
39
|
+
v-if="singleDropdownButton"
|
|
40
|
+
v-bind="singleDropdownButton.attrs"
|
|
41
|
+
v-tooltip.prepend="singleDropdownButton.tooltip"
|
|
42
|
+
v-on="singleDropdownButton.listeners"
|
|
43
|
+
/>
|
|
44
|
+
|
|
22
45
|
<!-- dropdown buttons -->
|
|
23
|
-
<template v-if="groupedButtons.dropdown.length">
|
|
24
|
-
<slot
|
|
46
|
+
<template v-else-if="groupedButtons.dropdown.length">
|
|
47
|
+
<slot
|
|
48
|
+
name="toggler"
|
|
49
|
+
:v-bind="{ togglerProps, isOpened, open, close }"
|
|
50
|
+
>
|
|
25
51
|
<AwButton v-bind="togglerProps" @click="open" />
|
|
26
52
|
</slot>
|
|
27
|
-
<AwDropdown
|
|
53
|
+
<AwDropdown
|
|
54
|
+
:show.sync="isOpened"
|
|
55
|
+
:options="$options.dropdownOptions"
|
|
56
|
+
>
|
|
28
57
|
<slot name="dropdown" :buttons="groupedButtons.dropdown">
|
|
29
58
|
<AwDropdownButton
|
|
30
|
-
v-for="({ listeners, tooltip, ...attrs },
|
|
59
|
+
v-for="({ listeners, tooltip, ...attrs },
|
|
60
|
+
i) in groupedButtons.dropdown"
|
|
31
61
|
:key="i"
|
|
32
62
|
v-tooltip.prepend="tooltip"
|
|
33
63
|
v-bind="attrs"
|
|
@@ -88,7 +118,10 @@ export default {
|
|
|
88
118
|
groupedButtons() {
|
|
89
119
|
return this.items.reduce(
|
|
90
120
|
(acc, item) => {
|
|
91
|
-
const { cta, dropdown, show = true, ...itemProps } = {
|
|
121
|
+
const { cta, dropdown, show = true, ...itemProps } = {
|
|
122
|
+
...this.options,
|
|
123
|
+
...item
|
|
124
|
+
}
|
|
92
125
|
|
|
93
126
|
// rename class prop
|
|
94
127
|
if (itemProps.class) {
|
|
@@ -98,10 +131,20 @@ export default {
|
|
|
98
131
|
|
|
99
132
|
// add button if visible
|
|
100
133
|
if (show !== false) {
|
|
101
|
-
const group = this.isDesktop
|
|
134
|
+
const group = this.isDesktop
|
|
135
|
+
? dropdown
|
|
136
|
+
? 'dropdown'
|
|
137
|
+
: 'buttons'
|
|
138
|
+
: cta
|
|
139
|
+
? 'buttons'
|
|
140
|
+
: 'dropdown'
|
|
102
141
|
|
|
103
142
|
// omit not available colors
|
|
104
|
-
if (
|
|
143
|
+
if (
|
|
144
|
+
group === 'dropdown' &&
|
|
145
|
+
itemProps.color &&
|
|
146
|
+
!DROPDOWN_BUTTON_COLORS.includes(itemProps.color)
|
|
147
|
+
) {
|
|
105
148
|
itemProps.color = undefined
|
|
106
149
|
}
|
|
107
150
|
|
|
@@ -114,12 +157,42 @@ export default {
|
|
|
114
157
|
)
|
|
115
158
|
},
|
|
116
159
|
|
|
160
|
+
singleDropdownButton() {
|
|
161
|
+
const singleButton =
|
|
162
|
+
this.groupedButtons.dropdown.length === 1
|
|
163
|
+
? this.groupedButtons.dropdown[0]
|
|
164
|
+
: null
|
|
165
|
+
|
|
166
|
+
if (
|
|
167
|
+
singleButton &&
|
|
168
|
+
!!singleButton.icon &&
|
|
169
|
+
(singleButton.hideText || !singleButton.text)
|
|
170
|
+
) {
|
|
171
|
+
const {
|
|
172
|
+
listeners,
|
|
173
|
+
tooltip,
|
|
174
|
+
...attrs
|
|
175
|
+
} = this.groupedButtons.dropdown[0]
|
|
176
|
+
|
|
177
|
+
return { listeners, tooltip, attrs }
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return null
|
|
181
|
+
},
|
|
182
|
+
|
|
117
183
|
togglerSize() {
|
|
118
|
-
return path(
|
|
184
|
+
return path(
|
|
185
|
+
[this.groupedButtons.buttons.length - 1, 'size'],
|
|
186
|
+
this.groupedButtons.buttons
|
|
187
|
+
)
|
|
119
188
|
},
|
|
120
189
|
|
|
121
190
|
togglerProps() {
|
|
122
|
-
return {
|
|
191
|
+
return {
|
|
192
|
+
...omit(['cta'], this.options || {}),
|
|
193
|
+
size: this.togglerSize,
|
|
194
|
+
...this.togglerOptions
|
|
195
|
+
}
|
|
123
196
|
}
|
|
124
197
|
},
|
|
125
198
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awes-io/ui",
|
|
3
|
-
"version": "2.100.
|
|
3
|
+
"version": "2.100.1",
|
|
4
4
|
"description": "User Interface (UI) components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui",
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"rollup-plugin-visualizer": "^2.6.0",
|
|
115
115
|
"rollup-plugin-vue": "^5.0.1"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "d3cadf5921e51b1a8f4af71e028928a7f072733c"
|
|
118
118
|
}
|