@energie360/ui-library 0.1.17 → 0.1.18
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/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 +70 -0
- package/components/card-highlight/u-card-highlight.vue +41 -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/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 +12 -0
- package/components/progress-avatar/u-progress-avatar.vue +27 -3
- 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/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/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 +32 -0
- package/layout/container/container.scss +18 -0
- package/layout/index.js +2 -0
- package/layout/portal/portal.scss +35 -7
- package/layout/portal/u-portal.vue +33 -4
- package/layout/settings/settings.scss +2 -2
- 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 +7 -3
- package/modules/dialog/u-dialog.vue +6 -1
- 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
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
@use '../../base/abstracts' as a;
|
|
2
|
+
|
|
3
|
+
@mixin collapsed-desktop {
|
|
4
|
+
grid-template-columns: 100%;
|
|
5
|
+
|
|
6
|
+
.search-filter__search {
|
|
7
|
+
display: flex;
|
|
8
|
+
column-gap: var(--e-space-4);
|
|
9
|
+
flex-direction: row-reverse;
|
|
10
|
+
grid-area: auto;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.search-filter__filter-toggle {
|
|
14
|
+
display: block;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.search-filter__filter {
|
|
18
|
+
display: none;
|
|
19
|
+
grid-area: auto;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&.show-filters {
|
|
23
|
+
.search-filter__filter {
|
|
24
|
+
display: grid;
|
|
25
|
+
grid-template-columns: repeat(calc(var(--field-count) - 1), 1fr);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@mixin mobile-filters {
|
|
31
|
+
@include a.bp(m) {
|
|
32
|
+
grid-template-columns: 100%;
|
|
33
|
+
|
|
34
|
+
.search-filter__search {
|
|
35
|
+
display: grid;
|
|
36
|
+
column-gap: var(--e-space-4);
|
|
37
|
+
grid-template-columns: auto min-content;
|
|
38
|
+
grid-area: auto;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.search-filter__filter {
|
|
42
|
+
display: none;
|
|
43
|
+
grid-area: auto;
|
|
44
|
+
grid-template-columns: 1fr;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.search-filter__filter-toggle {
|
|
48
|
+
flex: 0 0 auto;
|
|
49
|
+
display: block;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&.show-filters {
|
|
53
|
+
.search-filter__filter {
|
|
54
|
+
display: grid;
|
|
55
|
+
grid-template-columns: 1fr;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.search-filter {
|
|
62
|
+
--field-count: 1;
|
|
63
|
+
|
|
64
|
+
display: grid;
|
|
65
|
+
grid-template-columns: repeat(var(--field-count), minmax(0, 240px));
|
|
66
|
+
gap: var(--e-space-6) var(--e-space-4);
|
|
67
|
+
|
|
68
|
+
@include a.bp(xl) {
|
|
69
|
+
grid-template-columns: repeat(var(--field-count), 1fr);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.search-filter__search {
|
|
73
|
+
grid-area: 1 / var(--field-count) / 1 / calc(var(--field-count) + 1);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.search-filter__filter {
|
|
77
|
+
display: grid;
|
|
78
|
+
grid-template-columns: repeat(calc(var(--field-count) - 1), minmax(0, #{a.rem(240)}));
|
|
79
|
+
gap: var(--e-space-6) var(--e-space-4);
|
|
80
|
+
grid-area: 1 / 1 / 1 / var(--field-count);
|
|
81
|
+
|
|
82
|
+
@include a.bp(xl) {
|
|
83
|
+
grid-template-columns: repeat(calc(var(--field-count) - 1), 1fr);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.search-filter__filter-toggle {
|
|
88
|
+
display: none;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&.show-filters {
|
|
92
|
+
.search-filter__filter-toggle .icon-button {
|
|
93
|
+
&::before {
|
|
94
|
+
background-color: var(--e-c-primary-01-100);
|
|
95
|
+
border-color: var(--e-c-primary-01-100);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@include mobile-filters;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.search-filter.collapsed-desktop {
|
|
104
|
+
@include collapsed-desktop;
|
|
105
|
+
@include mobile-filters;
|
|
106
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref, useTemplateRef, onMounted } from 'vue'
|
|
3
|
+
import { UIconButton } from '../../elements'
|
|
4
|
+
import { UBadge } from '../../components'
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
activeFilter?: boolean
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
defineProps<Props>()
|
|
11
|
+
|
|
12
|
+
const showFilters = ref(false)
|
|
13
|
+
const filtersEl = useTemplateRef('filters')
|
|
14
|
+
const filterCount = ref(0)
|
|
15
|
+
|
|
16
|
+
onMounted(() => {
|
|
17
|
+
filterCount.value = filtersEl.value.children.length
|
|
18
|
+
})
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<div
|
|
23
|
+
:class="[
|
|
24
|
+
'search-filter',
|
|
25
|
+
{ 'show-filters': showFilters, 'collapsed-desktop': filterCount + 1 >= 4 },
|
|
26
|
+
]"
|
|
27
|
+
:style="{
|
|
28
|
+
'--field-count': filterCount + 1,
|
|
29
|
+
}"
|
|
30
|
+
>
|
|
31
|
+
<div class="search-filter__search">
|
|
32
|
+
<slot name="search" />
|
|
33
|
+
|
|
34
|
+
<div class="search-filter__filter-toggle">
|
|
35
|
+
<UBadge
|
|
36
|
+
dot
|
|
37
|
+
border
|
|
38
|
+
:show="activeFilter && !showFilters"
|
|
39
|
+
color="var(--e-c-secondary-05-500)"
|
|
40
|
+
:top="11"
|
|
41
|
+
:right="11"
|
|
42
|
+
>
|
|
43
|
+
<UIconButton icon="filter" variant="plain" @click="showFilters = !showFilters" />
|
|
44
|
+
</UBadge>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<div ref="filters" class="search-filter__filter">
|
|
49
|
+
<slot name="filters" />
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<style scoped lang="scss" src="./search-filter.scss"></style>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@energie360/ui-library",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"./wizard": "./wizard/index.js",
|
|
16
16
|
"./utility/elements/*": "./dist/elements/*",
|
|
17
17
|
"./utility/layout/*": "./dist/layout/*",
|
|
18
|
+
"./utils/*": "./utils/*",
|
|
18
19
|
"./base/abstracts": "./base/abstracts/index.scss",
|
|
19
20
|
"./styles/form": "./elements/form/form.scss",
|
|
20
21
|
"./styles/form-grid": "./layout/form-grid/form-grid.scss"
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { mediaquery } from '@energie360/design-tokens/design-tokens.json'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export const
|
|
6
|
-
|
|
7
|
-
export const isMedium = () => window.matchMedia(`(max-width: ${mediaquery.breakpoint.m})`)
|
|
8
|
-
|
|
9
|
-
export const isLarge = () => window.matchMedia(`(max-width: ${mediaquery.breakpoint.lg})`)
|
|
10
|
-
|
|
11
|
-
export const isXLarge = () => window.matchMedia(`(max-width: ${mediaquery.breakpoint.xl})`)
|
|
3
|
+
export const isSmall = () => window.matchMedia(`(max-width: ${mediaquery.breakpoint.s})`).matches
|
|
4
|
+
export const isMedium = () => window.matchMedia(`(max-width: ${mediaquery.breakpoint.m})`).matches
|
|
5
|
+
export const isLarge = () => window.matchMedia(`(max-width: ${mediaquery.breakpoint.lg})`).matches
|
|
6
|
+
export const isXLarge = () => window.matchMedia(`(max-width: ${mediaquery.breakpoint.xl})`).matches
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {number} bytes
|
|
4
|
+
* @param decimals
|
|
5
|
+
* @returns {string}
|
|
6
|
+
*/
|
|
7
|
+
export const formatBytes = (bytes, decimals = 2) => {
|
|
8
|
+
if (!+bytes) return '0 Bytes'
|
|
9
|
+
|
|
10
|
+
const k = 1024
|
|
11
|
+
const dm = decimals < 0 ? 0 : decimals
|
|
12
|
+
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
|
|
13
|
+
|
|
14
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k))
|
|
15
|
+
|
|
16
|
+
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`
|
|
17
|
+
}
|
|
@@ -8,6 +8,14 @@ const getLanguage = () => {
|
|
|
8
8
|
return langAttr === '' ? DEFAULT_LANGUAGE : langAttr
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export const getTranslation = (key) => {
|
|
12
|
-
|
|
11
|
+
export const getTranslation = (key, replace) => {
|
|
12
|
+
let translation = translations[getLanguage()][key]
|
|
13
|
+
|
|
14
|
+
if (replace) {
|
|
15
|
+
for (key in replace) {
|
|
16
|
+
translation = translation.replace(key, replace[key])
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return translation
|
|
13
21
|
}
|