@inriver/inri 1.14.0 → 1.15.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.
- package/.changeset/README.md +8 -0
- package/.changeset/config.json +11 -0
- package/.eslintrc.js +5 -5
- package/azure/pipelines/single-build-release.yml +6 -0
- package/azure/pipelines/templates/deployFramework.yml +50 -0
- package/componentProperties.d.ts +8 -8
- package/configs/base-eslint-config.js +36 -36
- package/configs/base-tailwind-config.js +149 -149
- package/i18n.ts +11 -11
- package/index.ts +29 -29
- package/package.json +7 -2
- package/src/components/CAutoBreadcrumbs.vue +72 -72
- package/src/components/CBtn.vue +98 -98
- package/src/components/CColorPicker.vue +55 -55
- package/src/components/CContextMenu.vue +29 -29
- package/src/components/CDatePicker.vue +51 -51
- package/src/components/CDeleteTileBtn.vue +52 -52
- package/src/components/CDialog.vue +253 -253
- package/src/components/CDialogCloseBtn.vue +9 -9
- package/src/components/CDirtyCheck.vue +68 -68
- package/src/components/CDrawer.vue +44 -44
- package/src/components/CDrawerButton.vue +91 -91
- package/src/components/CExpansionItem.vue +57 -57
- package/src/components/CExpansionItemWithCheckbox.vue +41 -41
- package/src/components/CFileDropzone.vue +114 -114
- package/src/components/CGrid.vue +101 -101
- package/src/components/CHeader.vue +10 -10
- package/src/components/CHeaderLinks.vue +61 -61
- package/src/components/CHeaderMenuLink.vue +51 -51
- package/src/components/CHeaderSearch.vue +142 -142
- package/src/components/CIconBtn.vue +70 -70
- package/src/components/CMenuItem.vue +66 -66
- package/src/components/CPageContainer.vue +11 -11
- package/src/components/CPageError.vue +24 -24
- package/src/components/CPageSpinner.vue +18 -18
- package/src/components/CSearch.vue +45 -45
- package/src/components/CSection.vue +29 -29
- package/src/components/CSectionTitle.vue +8 -8
- package/src/components/CSelect.vue +208 -208
- package/src/components/CSlideEffect.vue +62 -62
- package/src/components/CSpinner.vue +107 -107
- package/src/components/CTableActions.vue +16 -16
- package/src/components/CTileBtn.vue +178 -178
- package/src/components/CTimePicker.vue +42 -42
- package/src/components/CToggleGridView.vue +26 -26
- package/src/components/CToggleSidebarBtn.vue +19 -19
- package/src/components/CTooltip.vue +44 -44
- package/src/components/CTreeNode.vue +39 -39
- package/src/components/cards/CBannerCard.vue +103 -103
- package/src/components/cards/CSmallCard.vue +149 -149
- package/src/components/internal-components/ConfirmDialog.vue +78 -78
- package/src/composables/useDialog.ts +46 -46
- package/src/composables/useDirtyCheck.ts +25 -25
- package/src/composables/useDoubleClickListener.ts +28 -28
- package/src/composables/useSelectable.ts +62 -62
- package/src/composables/useTruncateChips.ts +46 -46
- package/src/i18n/de/index.ts +17 -17
- package/src/i18n/en/index.ts +84 -84
- package/src/i18n/es/index.ts +7 -7
- package/src/i18n/fr/index.ts +7 -7
- package/src/init/initInriFramework.ts +37 -37
- package/src/init/useInriApp.ts +55 -55
- package/src/layouts/CLayoutBlank.vue +7 -7
- package/src/layouts/CLayoutWithBackButton.vue +50 -50
- package/src/layouts/CLayoutWithSidebars.vue +46 -46
- package/src/layouts/layout-fragments/CPageAutoBreadcrumbs.vue +6 -6
- package/src/layouts/layout-fragments/CPageBackButton.vue +18 -18
- package/src/layouts/layout-fragments/CPageBlank.vue +20 -20
- package/src/layouts/layout-fragments/CPageFlexCol.vue +5 -5
- package/src/layouts/layout-fragments/CPageLeftSidebar.vue +5 -5
- package/src/layouts/layout-fragments/CPageMainContent.vue +5 -5
- package/src/layouts/layout-fragments/CPageOuterWrapper.vue +5 -5
- package/src/layouts/layout-fragments/CPageRightSidebar.vue +5 -5
- package/src/layouts/layout-fragments/CPageTitle.vue +34 -34
- package/src/plugins/dialog.ts +45 -45
- package/src/plugins/errors/ErrorFactories.ts +59 -59
- package/src/plugins/errors/Errors.ts +156 -156
- package/src/plugins/errors/Exception.ts +6 -6
- package/src/plugins/errors/globalErrorHandler.ts +21 -21
- package/src/plugins/errors/handleError.ts +34 -34
- package/src/plugins/errors/logger.ts +16 -16
- package/src/plugins/errors/vueErrorHandler.ts +26 -26
- package/src/plugins/globalAppConfig.ts +25 -25
- package/src/plugins/i18n.ts +46 -46
- package/src/plugins/inriIcons.ts +58 -58
- package/src/plugins/inriverQuasarComponentConfigurations.ts +67 -67
- package/src/plugins/library.ts +119 -119
- package/src/plugins/notify.ts +153 -153
- package/src/plugins/quasar-user-options.ts +19 -19
- package/src/plugins/validationRules.ts +292 -292
- package/src/shims-vue.d.ts +6 -6
- package/src/stores/inriStore.ts +54 -54
- package/src/stores/interfaceLanguageStore.ts +27 -27
- package/src/styles/_css-variables.scss +101 -101
- package/src/styles/_reset.scss +67 -67
- package/src/styles/_transitions.scss +9 -9
- package/src/styles/_utils.scss +15 -15
- package/src/styles/components/_breadcrumbs.scss +3 -3
- package/src/styles/components/_checkboxes.scss +17 -17
- package/src/styles/components/_chips.scss +17 -17
- package/src/styles/components/_forms.scss +203 -203
- package/src/styles/components/_menu.scss +12 -12
- package/src/styles/components/_notifications.scss +24 -24
- package/src/styles/components/_q-editor.scss +14 -14
- package/src/styles/components/_radio-buttons.scss +17 -17
- package/src/styles/components/_tables.scss +92 -92
- package/src/styles/components/_tooltips.scss +5 -5
- package/src/styles/components/_tree.scss +86 -86
- package/src/styles/components/_truncated-chips.scss +39 -39
- package/src/styles/main.scss +45 -45
- package/src/styles/quasar.variables.scss +50 -50
- package/src/styles/tailwind/index.css +2 -2
- package/src/typings.d.ts +70 -70
- package/src/utils/colorUtils.ts +73 -73
- package/src/utils/errorUtils.ts +37 -37
- package/src/utils/fileUtils.ts +57 -57
- package/src/utils/helpers.ts +6 -6
- package/src/utils/routeUtils.ts +23 -23
- package/tsconfig.json +34 -34
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="flex flex-1 no-wrap items-center"
|
|
4
|
-
:title="text"
|
|
5
|
-
>
|
|
6
|
-
<span class="truncate flex-1">{{ text }}</span>
|
|
7
|
-
<span
|
|
8
|
-
v-if="showCount"
|
|
9
|
-
class="text-body2 font-bold bg-white rounded-full border border-green ml-1 px-2 h-6 min-w-6 flex items-center justify-center"
|
|
10
|
-
>
|
|
11
|
-
{{ count }}
|
|
12
|
-
</span>
|
|
13
|
-
|
|
14
|
-
<!-- Used for context menus -->
|
|
15
|
-
<slot />
|
|
16
|
-
</div>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<script setup lang="ts">
|
|
20
|
-
import { computed } from 'vue'
|
|
21
|
-
|
|
22
|
-
const props = defineProps({
|
|
23
|
-
text: {
|
|
24
|
-
type: String,
|
|
25
|
-
default: undefined,
|
|
26
|
-
},
|
|
27
|
-
count: {
|
|
28
|
-
type: [String, Number],
|
|
29
|
-
default: undefined,
|
|
30
|
-
},
|
|
31
|
-
hideZeroCount: {
|
|
32
|
-
type: Boolean,
|
|
33
|
-
default: false,
|
|
34
|
-
},
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
// If we want to hide the chip when the count is 0 then hide if null/undefined/0. Else only hide if null/undefined.
|
|
38
|
-
const showCount = computed(() => props.hideZeroCount ? props.count : (props.count !== null && props.count !== undefined))
|
|
39
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="flex flex-1 no-wrap items-center"
|
|
4
|
+
:title="text"
|
|
5
|
+
>
|
|
6
|
+
<span class="truncate flex-1">{{ text }}</span>
|
|
7
|
+
<span
|
|
8
|
+
v-if="showCount"
|
|
9
|
+
class="text-body2 font-bold bg-white rounded-full border border-green ml-1 px-2 h-6 min-w-6 flex items-center justify-center"
|
|
10
|
+
>
|
|
11
|
+
{{ count }}
|
|
12
|
+
</span>
|
|
13
|
+
|
|
14
|
+
<!-- Used for context menus -->
|
|
15
|
+
<slot />
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import { computed } from 'vue'
|
|
21
|
+
|
|
22
|
+
const props = defineProps({
|
|
23
|
+
text: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: undefined,
|
|
26
|
+
},
|
|
27
|
+
count: {
|
|
28
|
+
type: [String, Number],
|
|
29
|
+
default: undefined,
|
|
30
|
+
},
|
|
31
|
+
hideZeroCount: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: false,
|
|
34
|
+
},
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
// If we want to hide the chip when the count is 0 then hide if null/undefined/0. Else only hide if null/undefined.
|
|
38
|
+
const showCount = computed(() => props.hideZeroCount ? props.count : (props.count !== null && props.count !== undefined))
|
|
39
|
+
</script>
|
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
:is="to ? 'router-link' : 'div'"
|
|
4
|
-
:to="to"
|
|
5
|
-
class="block p-5 h-[220px] relative group cursor-pointer no-underline"
|
|
6
|
-
:class="[`bg-${color}`, specialModifierClasses.card]"
|
|
7
|
-
>
|
|
8
|
-
<c-slide-effect :parent-color="color" />
|
|
9
|
-
|
|
10
|
-
<c-context-menu
|
|
11
|
-
class="absolute right-2 top-3"
|
|
12
|
-
:class="specialModifierClasses.contextMenu"
|
|
13
|
-
>
|
|
14
|
-
<c-menu-item>
|
|
15
|
-
menu item
|
|
16
|
-
</c-menu-item>
|
|
17
|
-
</c-context-menu>
|
|
18
|
-
|
|
19
|
-
<div
|
|
20
|
-
class="relative"
|
|
21
|
-
:class="specialModifierClasses.text"
|
|
22
|
-
>
|
|
23
|
-
<div
|
|
24
|
-
class="mt-16 text-grey-darker"
|
|
25
|
-
:class="specialModifierClasses.text"
|
|
26
|
-
>
|
|
27
|
-
{{ title1 }}
|
|
28
|
-
</div>
|
|
29
|
-
<div class="text-h1 leading-none mb-4">
|
|
30
|
-
{{ title2 }}
|
|
31
|
-
</div>
|
|
32
|
-
<div class="line-clamp-2">
|
|
33
|
-
{{ description }}
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
</component>
|
|
37
|
-
</template>
|
|
38
|
-
|
|
39
|
-
<script setup>
|
|
40
|
-
import { computed } from 'vue'
|
|
41
|
-
import { getRelatedColors } from '../../utils/colorUtils'
|
|
42
|
-
|
|
43
|
-
const props = defineProps({
|
|
44
|
-
color: {
|
|
45
|
-
type: String,
|
|
46
|
-
default: 'secondary',
|
|
47
|
-
},
|
|
48
|
-
title1: {
|
|
49
|
-
type: String,
|
|
50
|
-
default: '',
|
|
51
|
-
},
|
|
52
|
-
title2: {
|
|
53
|
-
type: String,
|
|
54
|
-
default: '',
|
|
55
|
-
},
|
|
56
|
-
description: {
|
|
57
|
-
type: String,
|
|
58
|
-
default: '',
|
|
59
|
-
},
|
|
60
|
-
to: {
|
|
61
|
-
type: [String, Object],
|
|
62
|
-
default: undefined,
|
|
63
|
-
},
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
const specialModifierClasses = computed(() => {
|
|
67
|
-
const color = props.color
|
|
68
|
-
const relatedColors = getRelatedColors(color)
|
|
69
|
-
|
|
70
|
-
if (color === 'primary' || color === 'secondary' || color === 'accent') {
|
|
71
|
-
return {
|
|
72
|
-
card: '',
|
|
73
|
-
contextMenu: 'text-' + relatedColors.onAltColor,
|
|
74
|
-
text: 'text-' + relatedColors.onColor,
|
|
75
|
-
}
|
|
76
|
-
} else if (color === 'surface') {
|
|
77
|
-
return {
|
|
78
|
-
card: 'border border-surface-border',
|
|
79
|
-
contextMenu: 'text-' + relatedColors.onColor,
|
|
80
|
-
text: 'text-' + relatedColors.onColor,
|
|
81
|
-
}
|
|
82
|
-
} else if (color === 'white') {
|
|
83
|
-
return {
|
|
84
|
-
card: 'border border-grey',
|
|
85
|
-
contextMenu: 'text-grey-darkest',
|
|
86
|
-
text: 'text-grey-darkest',
|
|
87
|
-
}
|
|
88
|
-
} else if (color === 'black') {
|
|
89
|
-
return {
|
|
90
|
-
card: '',
|
|
91
|
-
contextMenu: 'text-white',
|
|
92
|
-
text: 'text-white',
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// Default for the rest
|
|
97
|
-
return {
|
|
98
|
-
card: '',
|
|
99
|
-
contextMenu: 'text-white',
|
|
100
|
-
text: 'text-grey-darkest',
|
|
101
|
-
}
|
|
102
|
-
})
|
|
103
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="to ? 'router-link' : 'div'"
|
|
4
|
+
:to="to"
|
|
5
|
+
class="block p-5 h-[220px] relative group cursor-pointer no-underline"
|
|
6
|
+
:class="[`bg-${color}`, specialModifierClasses.card]"
|
|
7
|
+
>
|
|
8
|
+
<c-slide-effect :parent-color="color" />
|
|
9
|
+
|
|
10
|
+
<c-context-menu
|
|
11
|
+
class="absolute right-2 top-3"
|
|
12
|
+
:class="specialModifierClasses.contextMenu"
|
|
13
|
+
>
|
|
14
|
+
<c-menu-item>
|
|
15
|
+
menu item
|
|
16
|
+
</c-menu-item>
|
|
17
|
+
</c-context-menu>
|
|
18
|
+
|
|
19
|
+
<div
|
|
20
|
+
class="relative"
|
|
21
|
+
:class="specialModifierClasses.text"
|
|
22
|
+
>
|
|
23
|
+
<div
|
|
24
|
+
class="mt-16 text-grey-darker"
|
|
25
|
+
:class="specialModifierClasses.text"
|
|
26
|
+
>
|
|
27
|
+
{{ title1 }}
|
|
28
|
+
</div>
|
|
29
|
+
<div class="text-h1 leading-none mb-4">
|
|
30
|
+
{{ title2 }}
|
|
31
|
+
</div>
|
|
32
|
+
<div class="line-clamp-2">
|
|
33
|
+
{{ description }}
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</component>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script setup>
|
|
40
|
+
import { computed } from 'vue'
|
|
41
|
+
import { getRelatedColors } from '../../utils/colorUtils'
|
|
42
|
+
|
|
43
|
+
const props = defineProps({
|
|
44
|
+
color: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: 'secondary',
|
|
47
|
+
},
|
|
48
|
+
title1: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: '',
|
|
51
|
+
},
|
|
52
|
+
title2: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: '',
|
|
55
|
+
},
|
|
56
|
+
description: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: '',
|
|
59
|
+
},
|
|
60
|
+
to: {
|
|
61
|
+
type: [String, Object],
|
|
62
|
+
default: undefined,
|
|
63
|
+
},
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
const specialModifierClasses = computed(() => {
|
|
67
|
+
const color = props.color
|
|
68
|
+
const relatedColors = getRelatedColors(color)
|
|
69
|
+
|
|
70
|
+
if (color === 'primary' || color === 'secondary' || color === 'accent') {
|
|
71
|
+
return {
|
|
72
|
+
card: '',
|
|
73
|
+
contextMenu: 'text-' + relatedColors.onAltColor,
|
|
74
|
+
text: 'text-' + relatedColors.onColor,
|
|
75
|
+
}
|
|
76
|
+
} else if (color === 'surface') {
|
|
77
|
+
return {
|
|
78
|
+
card: 'border border-surface-border',
|
|
79
|
+
contextMenu: 'text-' + relatedColors.onColor,
|
|
80
|
+
text: 'text-' + relatedColors.onColor,
|
|
81
|
+
}
|
|
82
|
+
} else if (color === 'white') {
|
|
83
|
+
return {
|
|
84
|
+
card: 'border border-grey',
|
|
85
|
+
contextMenu: 'text-grey-darkest',
|
|
86
|
+
text: 'text-grey-darkest',
|
|
87
|
+
}
|
|
88
|
+
} else if (color === 'black') {
|
|
89
|
+
return {
|
|
90
|
+
card: '',
|
|
91
|
+
contextMenu: 'text-white',
|
|
92
|
+
text: 'text-white',
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Default for the rest
|
|
97
|
+
return {
|
|
98
|
+
card: '',
|
|
99
|
+
contextMenu: 'text-white',
|
|
100
|
+
text: 'text-grey-darkest',
|
|
101
|
+
}
|
|
102
|
+
})
|
|
103
|
+
</script>
|
|
@@ -1,149 +1,149 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
ref="card"
|
|
4
|
-
class="c-small-card"
|
|
5
|
-
@mouseover="isHoveredOver = true"
|
|
6
|
-
@mouseleave="isHoveredOver = false"
|
|
7
|
-
@click="$emit('click', $event)"
|
|
8
|
-
>
|
|
9
|
-
<div
|
|
10
|
-
class="content flex items-center justify-center"
|
|
11
|
-
:class="[
|
|
12
|
-
`bg-${backgroundColor}`,
|
|
13
|
-
selected ? 'is-selected' : ''
|
|
14
|
-
]"
|
|
15
|
-
>
|
|
16
|
-
<img
|
|
17
|
-
v-if="imageSrc"
|
|
18
|
-
:src="imageSrc"
|
|
19
|
-
class="image"
|
|
20
|
-
>
|
|
21
|
-
|
|
22
|
-
<q-icon
|
|
23
|
-
v-else
|
|
24
|
-
:name="icon"
|
|
25
|
-
:style="`font-size: ${iconSize}px`"
|
|
26
|
-
:class="iconClass"
|
|
27
|
-
/>
|
|
28
|
-
|
|
29
|
-
<transition name="fade">
|
|
30
|
-
<c-context-menu
|
|
31
|
-
v-if="$slots['context-menu-items']"
|
|
32
|
-
v-show="isHoveredOver"
|
|
33
|
-
class="absolute right-0 top-0"
|
|
34
|
-
@click.stop
|
|
35
|
-
>
|
|
36
|
-
<slot name="context-menu-items" />
|
|
37
|
-
</c-context-menu>
|
|
38
|
-
</transition>
|
|
39
|
-
</div>
|
|
40
|
-
|
|
41
|
-
<div
|
|
42
|
-
v-if="text"
|
|
43
|
-
class="text mt-8px line-clamp-2 break-words"
|
|
44
|
-
:class="{ 'font-semibold': selected }"
|
|
45
|
-
:title="text"
|
|
46
|
-
>
|
|
47
|
-
{{ text }}
|
|
48
|
-
</div>
|
|
49
|
-
|
|
50
|
-
<div
|
|
51
|
-
v-if="description"
|
|
52
|
-
class="description"
|
|
53
|
-
>
|
|
54
|
-
{{ description }}
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
</template>
|
|
58
|
-
|
|
59
|
-
<script setup lang="ts">
|
|
60
|
-
import { ref } from 'vue'
|
|
61
|
-
import { useDoubleClickListener } from '../../composables/useDoubleClickListener'
|
|
62
|
-
|
|
63
|
-
const emit = defineEmits(['click', 'double-click'])
|
|
64
|
-
const card = ref<HTMLDivElement>()
|
|
65
|
-
|
|
66
|
-
const isHoveredOver = ref(false)
|
|
67
|
-
|
|
68
|
-
useDoubleClickListener(card, () => {
|
|
69
|
-
emit('double-click')
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
defineProps({
|
|
73
|
-
imageSrc: {
|
|
74
|
-
type: String,
|
|
75
|
-
default: undefined,
|
|
76
|
-
},
|
|
77
|
-
text: {
|
|
78
|
-
type: String,
|
|
79
|
-
default: undefined,
|
|
80
|
-
},
|
|
81
|
-
description: {
|
|
82
|
-
type: String,
|
|
83
|
-
default: undefined,
|
|
84
|
-
},
|
|
85
|
-
selected: {
|
|
86
|
-
type: Boolean,
|
|
87
|
-
default: false,
|
|
88
|
-
},
|
|
89
|
-
icon: {
|
|
90
|
-
type: String,
|
|
91
|
-
default: undefined,
|
|
92
|
-
},
|
|
93
|
-
iconClass: {
|
|
94
|
-
type: String,
|
|
95
|
-
default: undefined,
|
|
96
|
-
},
|
|
97
|
-
iconSize: {
|
|
98
|
-
type: [String, Number],
|
|
99
|
-
default: 18,
|
|
100
|
-
},
|
|
101
|
-
backgroundColor: {
|
|
102
|
-
type: String,
|
|
103
|
-
default: 'grey-lighter',
|
|
104
|
-
},
|
|
105
|
-
})
|
|
106
|
-
</script>
|
|
107
|
-
|
|
108
|
-
<style scoped lang="scss">
|
|
109
|
-
.c-small-card {
|
|
110
|
-
width: var(--small-card-image-size);
|
|
111
|
-
min-height: 100px;
|
|
112
|
-
|
|
113
|
-
&:hover {
|
|
114
|
-
cursor: pointer;
|
|
115
|
-
|
|
116
|
-
.content {
|
|
117
|
-
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.content {
|
|
122
|
-
position: relative;
|
|
123
|
-
width: var(--small-card-image-size);
|
|
124
|
-
height: var(--small-card-image-size);
|
|
125
|
-
transition: box-shadow 0.2s ease-in-out;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.image {
|
|
129
|
-
width: var(--small-card-image-size);
|
|
130
|
-
height: var(--small-card-image-size);
|
|
131
|
-
object-fit: cover;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.is-selected {
|
|
136
|
-
outline: 2px solid var(--q-accent);
|
|
137
|
-
outline-offset: -2px;
|
|
138
|
-
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
|
|
139
|
-
|
|
140
|
-
&::before {
|
|
141
|
-
content: "";
|
|
142
|
-
width: 100%;
|
|
143
|
-
height: 100%;
|
|
144
|
-
background: var(--q-accent);
|
|
145
|
-
opacity: 0.1;
|
|
146
|
-
position: absolute;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
ref="card"
|
|
4
|
+
class="c-small-card"
|
|
5
|
+
@mouseover="isHoveredOver = true"
|
|
6
|
+
@mouseleave="isHoveredOver = false"
|
|
7
|
+
@click="$emit('click', $event)"
|
|
8
|
+
>
|
|
9
|
+
<div
|
|
10
|
+
class="content flex items-center justify-center"
|
|
11
|
+
:class="[
|
|
12
|
+
`bg-${backgroundColor}`,
|
|
13
|
+
selected ? 'is-selected' : ''
|
|
14
|
+
]"
|
|
15
|
+
>
|
|
16
|
+
<img
|
|
17
|
+
v-if="imageSrc"
|
|
18
|
+
:src="imageSrc"
|
|
19
|
+
class="image"
|
|
20
|
+
>
|
|
21
|
+
|
|
22
|
+
<q-icon
|
|
23
|
+
v-else
|
|
24
|
+
:name="icon"
|
|
25
|
+
:style="`font-size: ${iconSize}px`"
|
|
26
|
+
:class="iconClass"
|
|
27
|
+
/>
|
|
28
|
+
|
|
29
|
+
<transition name="fade">
|
|
30
|
+
<c-context-menu
|
|
31
|
+
v-if="$slots['context-menu-items']"
|
|
32
|
+
v-show="isHoveredOver"
|
|
33
|
+
class="absolute right-0 top-0"
|
|
34
|
+
@click.stop
|
|
35
|
+
>
|
|
36
|
+
<slot name="context-menu-items" />
|
|
37
|
+
</c-context-menu>
|
|
38
|
+
</transition>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<div
|
|
42
|
+
v-if="text"
|
|
43
|
+
class="text mt-8px line-clamp-2 break-words"
|
|
44
|
+
:class="{ 'font-semibold': selected }"
|
|
45
|
+
:title="text"
|
|
46
|
+
>
|
|
47
|
+
{{ text }}
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<div
|
|
51
|
+
v-if="description"
|
|
52
|
+
class="description"
|
|
53
|
+
>
|
|
54
|
+
{{ description }}
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</template>
|
|
58
|
+
|
|
59
|
+
<script setup lang="ts">
|
|
60
|
+
import { ref } from 'vue'
|
|
61
|
+
import { useDoubleClickListener } from '../../composables/useDoubleClickListener'
|
|
62
|
+
|
|
63
|
+
const emit = defineEmits(['click', 'double-click'])
|
|
64
|
+
const card = ref<HTMLDivElement>()
|
|
65
|
+
|
|
66
|
+
const isHoveredOver = ref(false)
|
|
67
|
+
|
|
68
|
+
useDoubleClickListener(card, () => {
|
|
69
|
+
emit('double-click')
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
defineProps({
|
|
73
|
+
imageSrc: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: undefined,
|
|
76
|
+
},
|
|
77
|
+
text: {
|
|
78
|
+
type: String,
|
|
79
|
+
default: undefined,
|
|
80
|
+
},
|
|
81
|
+
description: {
|
|
82
|
+
type: String,
|
|
83
|
+
default: undefined,
|
|
84
|
+
},
|
|
85
|
+
selected: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
default: false,
|
|
88
|
+
},
|
|
89
|
+
icon: {
|
|
90
|
+
type: String,
|
|
91
|
+
default: undefined,
|
|
92
|
+
},
|
|
93
|
+
iconClass: {
|
|
94
|
+
type: String,
|
|
95
|
+
default: undefined,
|
|
96
|
+
},
|
|
97
|
+
iconSize: {
|
|
98
|
+
type: [String, Number],
|
|
99
|
+
default: 18,
|
|
100
|
+
},
|
|
101
|
+
backgroundColor: {
|
|
102
|
+
type: String,
|
|
103
|
+
default: 'grey-lighter',
|
|
104
|
+
},
|
|
105
|
+
})
|
|
106
|
+
</script>
|
|
107
|
+
|
|
108
|
+
<style scoped lang="scss">
|
|
109
|
+
.c-small-card {
|
|
110
|
+
width: var(--small-card-image-size);
|
|
111
|
+
min-height: 100px;
|
|
112
|
+
|
|
113
|
+
&:hover {
|
|
114
|
+
cursor: pointer;
|
|
115
|
+
|
|
116
|
+
.content {
|
|
117
|
+
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.content {
|
|
122
|
+
position: relative;
|
|
123
|
+
width: var(--small-card-image-size);
|
|
124
|
+
height: var(--small-card-image-size);
|
|
125
|
+
transition: box-shadow 0.2s ease-in-out;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.image {
|
|
129
|
+
width: var(--small-card-image-size);
|
|
130
|
+
height: var(--small-card-image-size);
|
|
131
|
+
object-fit: cover;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.is-selected {
|
|
136
|
+
outline: 2px solid var(--q-accent);
|
|
137
|
+
outline-offset: -2px;
|
|
138
|
+
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
|
|
139
|
+
|
|
140
|
+
&::before {
|
|
141
|
+
content: "";
|
|
142
|
+
width: 100%;
|
|
143
|
+
height: 100%;
|
|
144
|
+
background: var(--q-accent);
|
|
145
|
+
opacity: 0.1;
|
|
146
|
+
position: absolute;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
</style>
|