@energie360/ui-library 0.1.17 → 0.1.19
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/base/_input-resets.scss +3 -0
- package/components/badge/badge.scss +56 -0
- package/components/badge/u-badge.vue +47 -0
- package/components/card-contact/card-contact.scss +39 -0
- package/components/card-contact/u-card-contact.vue +44 -0
- package/components/card-cta-bar/card-cta-bar.scss +4 -0
- package/components/card-cta-bar/u-card-cta-bar.vue +24 -0
- package/components/card-cta-header/u-card-cta-header.vue +10 -7
- package/components/card-footer/u-card-footer.vue +5 -3
- package/components/card-group/u-card-group.vue +1 -1
- package/components/card-header/card-header.scss +29 -4
- package/components/card-header/u-card-header.vue +22 -3
- package/components/card-highlight/card-highlight.scss +87 -0
- package/components/card-highlight/u-card-highlight.vue +54 -0
- package/components/card-price-list/card-price-list.scss +39 -0
- package/components/card-price-list/u-card-price-list.vue +37 -0
- package/components/card-section/card-section.scss +21 -1
- package/components/card-section/u-card-section.vue +9 -1
- package/components/chip/chip.scss +25 -0
- package/components/chip/u-chip.vue +31 -0
- package/components/data-card/data-card.scss +34 -0
- package/components/data-card/u-data-card.vue +49 -0
- package/components/data-card-group/data-card-group.scss +12 -0
- package/components/data-card-group/u-data-card-group.vue +7 -0
- package/components/download-list/download-list.scss +58 -0
- package/components/download-list/u-download-list.vue +44 -0
- package/components/download-list-item/download-list-item.scss +267 -0
- package/components/download-list-item/u-download-list-item.vue +65 -0
- package/components/file-upload/file-list.scss +68 -0
- package/components/file-upload/file-upload.scss +119 -0
- package/components/file-upload/u-file-list.vue +55 -0
- package/components/file-upload/u-file-upload.vue +220 -0
- package/components/hint/hint.scss +67 -6
- package/components/hint/u-hint.vue +11 -1
- package/components/index.js +16 -0
- package/components/progress-avatar/u-progress-avatar.vue +27 -3
- package/components/rating/rating.scss +76 -0
- package/components/rating/u-rating.vue +79 -0
- package/components/search-group/search-group.scss +59 -0
- package/components/search-group/u-search-group.vue +32 -0
- package/components/skeleton-loader/skeleton-loader.scss +39 -0
- package/components/skeleton-loader/u-skeleton-loader.vue +28 -0
- package/components/table/cell-ctas.scss +1 -7
- package/components/table/cell-icon-text.scss +15 -4
- package/components/table/table-cell.mixins.scss +3 -2
- package/components/table/table-cell.scss +5 -0
- package/components/table/table-heading.scss +7 -0
- package/components/table/u-cell-ctas.vue +15 -6
- package/components/table/u-cell-icon-text.vue +13 -5
- package/components/table/u-table-cell.vue +3 -1
- package/components/table/u-table-heading.vue +2 -1
- package/components/tabs/tabs.scss +10 -1
- package/components/tabs/u-tabs.vue +64 -25
- package/dist/base-style.css +3 -0
- package/dist/base-style.css.map +1 -1
- package/dist/layout/split.css.map +1 -1
- package/elements/button/_button-plain-small-spaceless.scss +10 -0
- package/elements/button/button.scss +32 -0
- package/elements/button/u-button.vue +47 -4
- package/elements/form-field/form-field-base.scss +4 -0
- package/elements/numeric-stepper/u-numeric-stepper.vue +35 -12
- package/elements/select/u-select.vue +6 -6
- package/elements/text-field/text-field.scss +15 -0
- package/elements/text-field/text-field.types.ts +1 -0
- package/elements/text-field/u-text-field.vue +27 -6
- package/elements/toggle-switch/toggle-switch-small.scss +10 -0
- package/elements/toggle-switch/toggle-switch.scss +25 -21
- package/elements/toggle-switch/u-toggle-switch.vue +22 -12
- package/i18n/i18n.ts +40 -0
- package/layout/container/container.scss +18 -0
- package/layout/index.js +4 -1
- package/layout/portal/portal.scss +35 -7
- package/layout/portal/u-portal.vue +33 -4
- package/layout/portal-content-aside/portal-content-aside.scss +35 -0
- package/layout/portal-content-aside/u-portal-content-aside.vue +15 -0
- package/layout/responsive-container/u-responsive-container.vue +35 -0
- package/layout/tile-grid/tile-grid.scss +13 -0
- package/layout/tile-grid/tile-item.scss +31 -0
- package/layout/tile-grid/u-tile-grid.vue +7 -0
- package/layout/tile-grid/u-tile-item.vue +15 -0
- package/modules/content-title/content-title.scss +43 -0
- package/modules/content-title/u-content-title.vue +19 -0
- package/modules/dialog/dialog.scss +11 -3
- package/modules/dialog/u-dialog.vue +8 -2
- package/modules/footer/footer.scss +8 -1
- package/modules/footer/u-footer.vue +1 -1
- package/modules/index.js +2 -0
- package/modules/search-filter/search-filter.scss +106 -0
- package/modules/search-filter/u-search-filter.vue +54 -0
- package/package.json +2 -1
- package/utils/array/intersect.js +7 -0
- package/utils/functions/breakpoint.js +4 -9
- package/utils/functions/format-bytes.js +17 -0
- package/utils/global/mime-types.js +8 -0
- package/utils/translations/translate.js +10 -2
- package/wizard/index.js +1 -0
- package/wizard/wizard-top-bar/u-wizard-top-bar.vue +31 -0
- package/wizard/wizard-top-bar/wizard-top-bar.scss +35 -0
- package/layout/settings/settings.scss +0 -33
- package/layout/settings/u-settings-layout.vue +0 -19
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
@use 'button-plain' as *;
|
|
5
5
|
@use 'button-plain-spaceless' as *;
|
|
6
6
|
@use 'button-plain-small' as *;
|
|
7
|
+
@use 'button-plain-small-spaceless' as *;
|
|
7
8
|
@use 'button-filled-inverted' as *;
|
|
8
9
|
@use 'button-outlined-inverted' as *;
|
|
9
10
|
@use 'button-secondary-outlined' as *;
|
|
@@ -41,6 +42,10 @@
|
|
|
41
42
|
@include button-plain-small;
|
|
42
43
|
}
|
|
43
44
|
|
|
45
|
+
&.plain-small-spaceless {
|
|
46
|
+
@include button-plain-small-spaceless;
|
|
47
|
+
}
|
|
48
|
+
|
|
44
49
|
&.filled-inverted {
|
|
45
50
|
@include button-filled-inverted;
|
|
46
51
|
}
|
|
@@ -70,4 +75,31 @@
|
|
|
70
75
|
--icon-fill-color: transparent;
|
|
71
76
|
}
|
|
72
77
|
}
|
|
78
|
+
|
|
79
|
+
// Modifiers
|
|
80
|
+
&.nowrap {
|
|
81
|
+
white-space: nowrap;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// In some cases we need to force full width of a button.
|
|
85
|
+
// Is mostly the case when the button is wrapped by another element.
|
|
86
|
+
&.full-width {
|
|
87
|
+
width: 100%;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&.hide-label-lg {
|
|
91
|
+
@include a.bp(lg) {
|
|
92
|
+
.button__label {
|
|
93
|
+
@include a.visually-hidden;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&.hide-label-m {
|
|
99
|
+
@include a.bp(m) {
|
|
100
|
+
.button__label {
|
|
101
|
+
@include a.visually-hidden;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
73
105
|
}
|
|
@@ -12,6 +12,10 @@ interface ButtonProps {
|
|
|
12
12
|
target?: string
|
|
13
13
|
variant?: string
|
|
14
14
|
asSpan?: boolean
|
|
15
|
+
nowrap?: boolean
|
|
16
|
+
fullWidth?: boolean
|
|
17
|
+
hideLabelM?: boolean
|
|
18
|
+
hideLabelLg?: boolean
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
const { asSpan = false } = defineProps<ButtonProps>()
|
|
@@ -21,20 +25,59 @@ const buttonTag = computed(() => (asSpan ? 'span' : 'button'))
|
|
|
21
25
|
|
|
22
26
|
<template>
|
|
23
27
|
<template v-if="href">
|
|
24
|
-
<a
|
|
28
|
+
<a
|
|
29
|
+
:class="[
|
|
30
|
+
'button',
|
|
31
|
+
variant,
|
|
32
|
+
{
|
|
33
|
+
nowrap,
|
|
34
|
+
'full-width': fullWidth,
|
|
35
|
+
'hide-label-m': hideLabelM,
|
|
36
|
+
'hide-label-lg': hideLabelLg,
|
|
37
|
+
},
|
|
38
|
+
]"
|
|
39
|
+
:href
|
|
40
|
+
:target
|
|
41
|
+
v-bind="$attrs"
|
|
42
|
+
>
|
|
25
43
|
<UIcon v-if="icon" :name="icon"></UIcon>
|
|
26
|
-
|
|
44
|
+
|
|
45
|
+
<span v-if="hideLabelM || hideLabelLg" class="button__label">
|
|
46
|
+
<slot>{{ label }}</slot>
|
|
47
|
+
</span>
|
|
48
|
+
|
|
49
|
+
<template v-else>
|
|
50
|
+
<slot>{{ label }}</slot>
|
|
51
|
+
</template>
|
|
27
52
|
</a>
|
|
28
53
|
</template>
|
|
29
54
|
|
|
30
55
|
<template v-else>
|
|
31
56
|
<component
|
|
32
57
|
:is="buttonTag"
|
|
33
|
-
:class="[
|
|
58
|
+
:class="[
|
|
59
|
+
'button',
|
|
60
|
+
variant,
|
|
61
|
+
{
|
|
62
|
+
nowrap,
|
|
63
|
+
'full-width': fullWidth,
|
|
64
|
+
'hide-label-m': hideLabelM,
|
|
65
|
+
'hide-label-lg': hideLabelLg,
|
|
66
|
+
loading: loading,
|
|
67
|
+
disabled,
|
|
68
|
+
},
|
|
69
|
+
]"
|
|
34
70
|
:disabled="disabled || null"
|
|
35
71
|
>
|
|
36
72
|
<UIcon v-if="icon" :name="icon" />
|
|
37
|
-
|
|
73
|
+
|
|
74
|
+
<span v-if="hideLabelM || hideLabelLg" class="button__label">
|
|
75
|
+
<slot>{{ label }}</slot>
|
|
76
|
+
</span>
|
|
77
|
+
|
|
78
|
+
<template v-else>
|
|
79
|
+
<slot>{{ label }}</slot>
|
|
80
|
+
</template>
|
|
38
81
|
|
|
39
82
|
<span v-if="loading" class="button__loader">
|
|
40
83
|
<ULoader />
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import UIcon from '../icon/u-icon.vue'
|
|
3
|
-
import { computed, ref, useTemplateRef, useId, nextTick } from 'vue'
|
|
3
|
+
import { computed, ref, useTemplateRef, useId, nextTick, onMounted } from 'vue'
|
|
4
4
|
import { getTranslation } from '../../utils/translations/translate'
|
|
5
5
|
|
|
6
6
|
interface Props {
|
|
@@ -29,6 +29,7 @@ const {
|
|
|
29
29
|
const cId = `numeric-stepper-${useId()}`
|
|
30
30
|
|
|
31
31
|
const model = defineModel<string | number>()
|
|
32
|
+
const emit = defineEmits(['input', 'focus', 'focusout'])
|
|
32
33
|
|
|
33
34
|
const input = useTemplateRef('input')
|
|
34
35
|
|
|
@@ -57,24 +58,24 @@ const onHoverOut = () => {
|
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
const onStepDown = () => {
|
|
60
|
-
|
|
61
|
+
input.value.stepDown()
|
|
62
|
+
model.value = Number(input.value.value)
|
|
63
|
+
|
|
61
64
|
nextTick(() => {
|
|
62
|
-
|
|
65
|
+
onInput()
|
|
63
66
|
})
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
const onStepUp = () => {
|
|
67
|
-
|
|
70
|
+
input.value.stepUp()
|
|
71
|
+
model.value = Number(input.value.value)
|
|
68
72
|
|
|
69
73
|
nextTick(() => {
|
|
70
|
-
|
|
74
|
+
onInput()
|
|
71
75
|
})
|
|
72
76
|
}
|
|
73
77
|
|
|
74
|
-
const
|
|
75
|
-
e.preventDefault()
|
|
76
|
-
e.stopPropagation()
|
|
77
|
-
|
|
78
|
+
const checkMinMax = () => {
|
|
78
79
|
if (min !== '') {
|
|
79
80
|
isMin.value = Number(model.value) <= Number(min)
|
|
80
81
|
}
|
|
@@ -84,16 +85,28 @@ const onInput = (e) => {
|
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
|
|
88
|
+
const onInput = () => {
|
|
89
|
+
checkMinMax()
|
|
90
|
+
|
|
91
|
+
// Is this necessary?
|
|
92
|
+
// If we use v-model this wouldn't be needed.
|
|
93
|
+
emit('input', model.value)
|
|
94
|
+
}
|
|
95
|
+
|
|
87
96
|
const stepButtonUpDisabled = computed(() => disabled || readonly || isMax.value)
|
|
88
97
|
const stepButtonDownDisabled = computed(() => disabled || readonly || isMin.value)
|
|
98
|
+
|
|
99
|
+
onMounted(() => {
|
|
100
|
+
checkMinMax()
|
|
101
|
+
})
|
|
89
102
|
</script>
|
|
90
103
|
|
|
91
104
|
<template>
|
|
92
105
|
<div :class="['numeric-stepper', classes]" @mouseenter="onHover" @mouseleave="onHoverOut">
|
|
93
106
|
<label class="visually-hidden" :for="cId">{{ label }}</label>
|
|
94
107
|
<div class="control">
|
|
95
|
-
<slot name="input"
|
|
96
|
-
|
|
108
|
+
<slot name="input">
|
|
109
|
+
<input
|
|
97
110
|
:id="cId"
|
|
98
111
|
ref="input"
|
|
99
112
|
v-model="model"
|
|
@@ -102,8 +115,12 @@ const stepButtonDownDisabled = computed(() => disabled || readonly || isMin.valu
|
|
|
102
115
|
:min
|
|
103
116
|
:max
|
|
104
117
|
:step
|
|
118
|
+
v-bind="$attrs"
|
|
119
|
+
@focus="$emit('focus', $event)"
|
|
120
|
+
@focusout="$emit('focusout', $event)"
|
|
105
121
|
@input="onInput"
|
|
106
|
-
|
|
122
|
+
/>
|
|
123
|
+
</slot>
|
|
107
124
|
</div>
|
|
108
125
|
|
|
109
126
|
<button
|
|
@@ -128,6 +145,12 @@ const stepButtonDownDisabled = computed(() => disabled || readonly || isMin.valu
|
|
|
128
145
|
<UIcon name="add"></UIcon>
|
|
129
146
|
</button>
|
|
130
147
|
</div>
|
|
148
|
+
|
|
149
|
+
<div class="error-message-container">
|
|
150
|
+
<slot name="error-message">
|
|
151
|
+
{{ errorMessage }}
|
|
152
|
+
</slot>
|
|
153
|
+
</div>
|
|
131
154
|
</template>
|
|
132
155
|
|
|
133
156
|
<style lang="scss" scoped>
|
|
@@ -51,7 +51,7 @@ const onHoverOut = () => {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
const hasHelpText = computed(() => {
|
|
54
|
-
return !!helpText || !!slots.helpText || required
|
|
54
|
+
return !!helpText || !!slots.helpText || !required
|
|
55
55
|
})
|
|
56
56
|
|
|
57
57
|
const needsHelpTextSpacer = computed(() => {
|
|
@@ -70,7 +70,7 @@ const needsHelpTextSpacer = computed(() => {
|
|
|
70
70
|
hover: isHovering,
|
|
71
71
|
'float-label': true,
|
|
72
72
|
'has-error': error,
|
|
73
|
-
'show-help-text':
|
|
73
|
+
'show-help-text': hasHelpText,
|
|
74
74
|
},
|
|
75
75
|
]"
|
|
76
76
|
@mouseenter="onHover"
|
|
@@ -111,10 +111,10 @@ const needsHelpTextSpacer = computed(() => {
|
|
|
111
111
|
</div>
|
|
112
112
|
|
|
113
113
|
<div class="help-text">
|
|
114
|
-
<span class="optional-text"
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
<span class="optional-text">
|
|
115
|
+
{{ getTranslation('optional') }}<span v-if="needsHelpTextSpacer" v-html="spacer"></span>
|
|
116
|
+
</span>
|
|
117
|
+
<slot name="helpText">{{ helpText }}</slot>
|
|
118
118
|
</div>
|
|
119
119
|
|
|
120
120
|
<div class="error-messages-container">
|
|
@@ -28,4 +28,19 @@
|
|
|
28
28
|
color: var(--e-c-secondary-01-700);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
+
|
|
32
|
+
// Type: Search
|
|
33
|
+
.cancel-search {
|
|
34
|
+
display: block;
|
|
35
|
+
border-radius: var(--e-brd-radius-1);
|
|
36
|
+
color: var(--e-c-primary-01-900);
|
|
37
|
+
visibility: hidden;
|
|
38
|
+
pointer-events: none;
|
|
39
|
+
|
|
40
|
+
&.visible {
|
|
41
|
+
visibility: visible;
|
|
42
|
+
pointer-events: auto;
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
31
46
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import UIcon from '../icon/u-icon.vue'
|
|
3
3
|
import { TextFieldTypes } from './text-field.types'
|
|
4
|
-
import { computed, ref, useSlots, useTemplateRef,
|
|
4
|
+
import { computed, ref, useId, useSlots, useTemplateRef, watch } from 'vue'
|
|
5
5
|
import { FormFieldBase } from '../form-field/form-field.types'
|
|
6
6
|
import { getTranslation } from '../../utils/translations/translate'
|
|
7
7
|
|
|
@@ -95,6 +95,10 @@ const passwordA11yText = computed(() => {
|
|
|
95
95
|
return _inputType.value === TextFieldTypes.password ? 'showPassword' : 'hidePassword'
|
|
96
96
|
})
|
|
97
97
|
|
|
98
|
+
const onCancelSearch = () => {
|
|
99
|
+
model.value = ''
|
|
100
|
+
}
|
|
101
|
+
|
|
98
102
|
watch(
|
|
99
103
|
() => type,
|
|
100
104
|
() => {
|
|
@@ -165,16 +169,33 @@ watch(
|
|
|
165
169
|
</button>
|
|
166
170
|
</span>
|
|
167
171
|
|
|
172
|
+
<!-- TYPE: DATE -->
|
|
173
|
+
<span v-if="type === TextFieldTypes.date" class="suffix-icon">
|
|
174
|
+
<UIcon name="calendar" />
|
|
175
|
+
</span>
|
|
176
|
+
|
|
177
|
+
<!-- TYPE: SEARCH -->
|
|
178
|
+
<span v-if="type === TextFieldTypes.search" class="prefix-icon">
|
|
179
|
+
<UIcon name="search" />
|
|
180
|
+
</span>
|
|
181
|
+
|
|
182
|
+
<span v-if="type === TextFieldTypes.search" class="suffix-action">
|
|
183
|
+
<button
|
|
184
|
+
type="button"
|
|
185
|
+
:class="['cancel-search', { visible: hasValue && (isHovering || isFocused) }]"
|
|
186
|
+
tabindex="-1"
|
|
187
|
+
@click="onCancelSearch"
|
|
188
|
+
>
|
|
189
|
+
<span class="visually-hidden">{{ getTranslation('cancelSearch') }}</span>
|
|
190
|
+
<UIcon name="close-circle-filled"></UIcon>
|
|
191
|
+
</button>
|
|
192
|
+
</span>
|
|
193
|
+
|
|
168
194
|
<!-- UNIT -->
|
|
169
195
|
<span v-if="unit" class="suffix-text">
|
|
170
196
|
{{ unit }}
|
|
171
197
|
</span>
|
|
172
198
|
|
|
173
|
-
<!-- DATE -->
|
|
174
|
-
<span v-if="type === TextFieldTypes.date" class="suffix-icon">
|
|
175
|
-
<UIcon name="calendar"></UIcon>
|
|
176
|
-
</span>
|
|
177
|
-
|
|
178
199
|
<!-- ACTION -->
|
|
179
200
|
<span v-if="!!slots.action" class="suffix-action custom-action">
|
|
180
201
|
<slot name="action"></slot>
|
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
align-items: center;
|
|
12
12
|
width: 100%;
|
|
13
13
|
gap: var(--e-space-4);
|
|
14
|
+
|
|
15
|
+
input {
|
|
16
|
+
width: var(--width);
|
|
17
|
+
}
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
.toggle-switch__handle {
|
|
@@ -37,4 +41,10 @@
|
|
|
37
41
|
margin-right: auto;
|
|
38
42
|
}
|
|
39
43
|
}
|
|
44
|
+
|
|
45
|
+
.toggle-switch__additional-label {
|
|
46
|
+
display: inline;
|
|
47
|
+
|
|
48
|
+
@include a.type(200);
|
|
49
|
+
}
|
|
40
50
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use '../../base/abstracts
|
|
1
|
+
@use '../../base/abstracts' as a;
|
|
2
2
|
@use './toggle-switch-small';
|
|
3
3
|
|
|
4
4
|
.toggle-switch {
|
|
@@ -31,6 +31,18 @@
|
|
|
31
31
|
background-color: var(--e-c-mono-200);
|
|
32
32
|
border-radius: calc(var(--height) * 0.5);
|
|
33
33
|
transition: background-color var(--e-trs-duration-faster) var(--e-trs-easing-default);
|
|
34
|
+
|
|
35
|
+
&:hover {
|
|
36
|
+
background-color: var(--e-c-mono-500);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&:active {
|
|
40
|
+
background-color: var(--e-c-mono-700);
|
|
41
|
+
|
|
42
|
+
.toggle-switch__text {
|
|
43
|
+
color: var(--e-c-mono-00);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
34
46
|
}
|
|
35
47
|
|
|
36
48
|
.toggle-switch__handle {
|
|
@@ -71,22 +83,6 @@
|
|
|
71
83
|
}
|
|
72
84
|
}
|
|
73
85
|
|
|
74
|
-
&:hover {
|
|
75
|
-
.toggle-switch__toggle {
|
|
76
|
-
background-color: var(--e-c-mono-500);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
&:active {
|
|
81
|
-
.toggle-switch__toggle {
|
|
82
|
-
background-color: var(--e-c-mono-700);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.toggle-switch__text {
|
|
86
|
-
color: var(--e-c-mono-00);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
86
|
// States
|
|
91
87
|
&.error {
|
|
92
88
|
.toggle-switch__error-text {
|
|
@@ -97,11 +93,19 @@
|
|
|
97
93
|
&.checked {
|
|
98
94
|
.toggle-switch__toggle {
|
|
99
95
|
background-color: var(--e-c-primary-01-900);
|
|
96
|
+
|
|
97
|
+
&:hover {
|
|
98
|
+
background-color: var(--e-c-secondary-01-900);
|
|
99
|
+
}
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
.toggle-switch__handle {
|
|
103
103
|
transform: translateX(calc(var(--width) - var(--handle-size) - var(--inner-padding) * 2));
|
|
104
104
|
color: var(--e-c-primary-01-900);
|
|
105
|
+
|
|
106
|
+
&:hover {
|
|
107
|
+
color: var(--e-c-secondary-01-900);
|
|
108
|
+
}
|
|
105
109
|
}
|
|
106
110
|
|
|
107
111
|
.toggle-switch__text {
|
|
@@ -117,10 +121,6 @@
|
|
|
117
121
|
}
|
|
118
122
|
|
|
119
123
|
&:hover {
|
|
120
|
-
.toggle-switch__toggle {
|
|
121
|
-
background-color: var(--e-c-secondary-01-900);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
124
|
.toggle-switch__handle {
|
|
125
125
|
color: var(--e-c-secondary-01-900);
|
|
126
126
|
}
|
|
@@ -157,3 +157,7 @@
|
|
|
157
157
|
margin-top: var(--e-space-1);
|
|
158
158
|
color: var(--e-c-signal-03-700);
|
|
159
159
|
}
|
|
160
|
+
|
|
161
|
+
.toggle-switch__additional-label {
|
|
162
|
+
display: none;
|
|
163
|
+
}
|
|
@@ -7,9 +7,9 @@ export interface ToggleSwitch {
|
|
|
7
7
|
name: string
|
|
8
8
|
label?: string
|
|
9
9
|
disabled?: boolean
|
|
10
|
-
error
|
|
10
|
+
error?: boolean
|
|
11
11
|
errorMessage?: string
|
|
12
|
-
variant?: '
|
|
12
|
+
variant?: 'big' | 'small'
|
|
13
13
|
labelPosition?: 'left' | 'right'
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -18,7 +18,7 @@ const {
|
|
|
18
18
|
labelPosition = 'right',
|
|
19
19
|
disabled = false,
|
|
20
20
|
errorMessage = '',
|
|
21
|
-
error,
|
|
21
|
+
error = false,
|
|
22
22
|
} = defineProps<ToggleSwitch>()
|
|
23
23
|
|
|
24
24
|
const model = defineModel<boolean>({ default: false })
|
|
@@ -42,8 +42,12 @@ const classes = computed(() => ({
|
|
|
42
42
|
|
|
43
43
|
<template>
|
|
44
44
|
<div :class="['toggle-switch', classes]">
|
|
45
|
-
<
|
|
46
|
-
<
|
|
45
|
+
<div class="toggle-switch__wrapper">
|
|
46
|
+
<label class="toggle-switch__toggle">
|
|
47
|
+
<slot name="input">
|
|
48
|
+
<input v-model="model" type="checkbox" :name :disabled v-bind="$attrs" />
|
|
49
|
+
</slot>
|
|
50
|
+
|
|
47
51
|
<span class="toggle-switch__text yes" :aria-hidden="model ? 'false' : 'true'">
|
|
48
52
|
{{ getTranslation('yes') }}
|
|
49
53
|
</span>
|
|
@@ -53,14 +57,12 @@ const classes = computed(() => ({
|
|
|
53
57
|
<span class="toggle-switch__handle">
|
|
54
58
|
<UIcon :name="model ? checkIcon : uncheckIcon" custom-size />
|
|
55
59
|
</span>
|
|
56
|
-
</
|
|
57
|
-
|
|
58
|
-
<slot name="label">{{ label }}</slot>
|
|
60
|
+
</label>
|
|
59
61
|
|
|
60
|
-
<
|
|
61
|
-
<
|
|
62
|
-
</
|
|
63
|
-
</
|
|
62
|
+
<span class="toggle-switch__additional-label">
|
|
63
|
+
<slot name="label"><span v-html="label"></span></slot>
|
|
64
|
+
</span>
|
|
65
|
+
</div>
|
|
64
66
|
|
|
65
67
|
<div class="toggle-switch__error-text">
|
|
66
68
|
<slot name="error-message">{{ errorMessage }}</slot>
|
|
@@ -69,3 +71,11 @@ const classes = computed(() => ({
|
|
|
69
71
|
</template>
|
|
70
72
|
|
|
71
73
|
<style scoped lang="scss" src="./toggle-switch.scss"></style>
|
|
74
|
+
<style lang="scss">
|
|
75
|
+
@use '../../elements/text-link/text-link' as t;
|
|
76
|
+
.toggle-switch__wrapper {
|
|
77
|
+
a {
|
|
78
|
+
@include t.text-link;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
</style>
|
package/i18n/i18n.ts
CHANGED
|
@@ -13,6 +13,16 @@ const translations = {
|
|
|
13
13
|
cancel: 'Abbrechen',
|
|
14
14
|
openMenu: 'Menu öffnen',
|
|
15
15
|
closeMenu: 'Menu schliessen',
|
|
16
|
+
dragFileHereOr: 'Datei hierher ziehen oder',
|
|
17
|
+
chooseFile: 'Datei wählen',
|
|
18
|
+
maxSizePerFile: 'Max. $SIZE pro Datei',
|
|
19
|
+
incorrectFileFormat: 'Dateiformat ist nicht zugelassen.',
|
|
20
|
+
fileTooLarge: 'Datei zu gross.',
|
|
21
|
+
maxFileCountAllowed: 'Maximal $COUNT Dateien erlaubt.',
|
|
22
|
+
cancelSearch: 'Suche abbrechen',
|
|
23
|
+
download: 'Herunterladen',
|
|
24
|
+
like: 'Gefällt mir',
|
|
25
|
+
dislike: 'Gefällt mir nicht',
|
|
16
26
|
},
|
|
17
27
|
FR: {
|
|
18
28
|
yes: 'Ja',
|
|
@@ -28,6 +38,16 @@ const translations = {
|
|
|
28
38
|
cancel: 'Annuler',
|
|
29
39
|
openMenu: 'Ouvrir le menu',
|
|
30
40
|
closeMenu: 'Fermer le menu',
|
|
41
|
+
dragFileHereOr: 'Faites glisser le fichier ici ou',
|
|
42
|
+
chooseFile: 'Choisir un fichier',
|
|
43
|
+
maxSizePerFile: 'Max. $SIZE par fichier',
|
|
44
|
+
incorrectFileFormat: "Le format de fichier n'est pas autorisé.",
|
|
45
|
+
fileTooLarge: 'Fichier trop volumineux',
|
|
46
|
+
maxFileCountAllowed: 'Maximum de $COUNT fichiers autorisés',
|
|
47
|
+
cancelSearch: 'Annuler la recherche',
|
|
48
|
+
download: 'Télécharger',
|
|
49
|
+
like: "J'aime ça",
|
|
50
|
+
dislike: "je ne l'aime pas",
|
|
31
51
|
},
|
|
32
52
|
IT: {
|
|
33
53
|
yes: 'Ja',
|
|
@@ -43,6 +63,16 @@ const translations = {
|
|
|
43
63
|
cancel: 'cancellare',
|
|
44
64
|
openMenu: 'Apri il menu',
|
|
45
65
|
closeMenu: 'Chiudi menù',
|
|
66
|
+
dragFileHereOr: 'Trascina il file qui o',
|
|
67
|
+
chooseFile: 'scegli il file',
|
|
68
|
+
maxSizePerFile: 'Max. $SIZE per file',
|
|
69
|
+
incorrectFileFormat: 'Formato file non consentito.',
|
|
70
|
+
fileTooLarge: 'File troppo grande',
|
|
71
|
+
maxFileCountAllowed: 'Sono consentiti al massimo $COUNT file',
|
|
72
|
+
cancelSearch: 'annullare la ricerca',
|
|
73
|
+
download: 'scaricamento',
|
|
74
|
+
like: 'Mi piace',
|
|
75
|
+
dislike: 'Non mi piace',
|
|
46
76
|
},
|
|
47
77
|
EN: {
|
|
48
78
|
yes: 'Ja',
|
|
@@ -58,6 +88,16 @@ const translations = {
|
|
|
58
88
|
cancel: 'Cancel',
|
|
59
89
|
openMenu: 'Open menu',
|
|
60
90
|
closeMenu: 'Close menu',
|
|
91
|
+
dragFileHereOr: 'Drag file here or',
|
|
92
|
+
chooseFile: 'Choose file',
|
|
93
|
+
maxSizePerFile: 'Max. $SIZE per file',
|
|
94
|
+
incorrectFileFormat: 'File format is not allowed.',
|
|
95
|
+
fileTooLarge: 'File too large',
|
|
96
|
+
maxFileCountAllowed: 'Maximum $COUNT files allowed',
|
|
97
|
+
cancelSearch: 'Cancel search',
|
|
98
|
+
download: 'Download',
|
|
99
|
+
like: 'I like it',
|
|
100
|
+
dislike: 'I do not like it',
|
|
61
101
|
},
|
|
62
102
|
}
|
|
63
103
|
|
|
@@ -25,6 +25,24 @@
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
@mixin portal-content-container {
|
|
29
|
+
margin: 0 auto;
|
|
30
|
+
max-width: a.rem(1282);
|
|
31
|
+
width: 100%;
|
|
32
|
+
padding-left: var(--e-space-10);
|
|
33
|
+
padding-right: var(--e-space-10);
|
|
34
|
+
|
|
35
|
+
@include a.bp(lg) {
|
|
36
|
+
padding-left: var(--e-space-8);
|
|
37
|
+
padding-right: var(--e-space-8);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@include a.bp(m) {
|
|
41
|
+
padding-left: var(--e-space-5);
|
|
42
|
+
padding-right: var(--e-space-5);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
28
46
|
.container {
|
|
29
47
|
@include grid-container;
|
|
30
48
|
}
|
package/layout/index.js
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
export { default as USettingsLayout } from './settings/u-settings-layout.vue'
|
|
2
1
|
export { default as UPortalLayout } from './portal/u-portal.vue'
|
|
2
|
+
export { default as UTileGrid } from './tile-grid/u-tile-grid.vue'
|
|
3
|
+
export { default as UTileItem } from './tile-grid/u-tile-item.vue'
|
|
4
|
+
export { default as UResponsiveContainer } from './responsive-container/u-responsive-container.vue'
|
|
5
|
+
export { default as UPortalContentAside } from './portal-content-aside/u-portal-content-aside.vue'
|