@flyanra/vue-core 0.3.0 → 0.4.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/README.md +176 -176
- package/package.json +137 -128
- package/src/components/basic/fly-button/FlyButton.element.scss +3 -3
- package/src/components/basic/fly-button/FlyButton.mixins.scss +58 -58
- package/src/components/basic/fly-button/FlyButton.types.ts +29 -29
- package/src/components/basic/fly-button/FlyButton.vue +180 -180
- package/src/components/basic/fly-button/index.ts +11 -11
- package/src/components/basic/index.ts +2 -2
- package/src/components/basic/typography/FlyCollapseTitleRenderer.vue +46 -0
- package/src/components/feedback/index.ts +2 -2
- package/src/components/feedback/tooltip/FlyInfoTooltip.vue +48 -0
- package/src/components/feedback/tooltip/FlyTooltip.element.scss +4 -4
- package/src/components/feedback/tooltip/FlyTooltip.types.ts +5 -5
- package/src/components/feedback/tooltip/FlyTooltip.vue +60 -59
- package/src/components/feedback/tooltip/index.ts +6 -6
- package/src/components/form/form.utils.ts +57 -0
- package/src/components/form/index.ts +0 -0
- package/src/components/form/input-renderers/boolean/FlyBoolean.scss +1 -0
- package/src/components/form/input-renderers/boolean/FlyBoolean.types.ts +16 -0
- package/src/components/form/input-renderers/boolean/FlyBoolean.vue +35 -0
- package/src/components/form/input-renderers/date-time/FlyDateTime.scss +1 -0
- package/src/components/form/input-renderers/date-time/FlyDateTime.types.ts +21 -0
- package/src/components/form/input-renderers/date-time/FlyDateTime.vue +85 -0
- package/src/components/form/input-renderers/form-item-renderer/FlyFormItemRenderer.scss +4 -0
- package/src/components/form/input-renderers/form-item-renderer/FlyFormItemRenderer.vue +48 -0
- package/src/components/form/input-renderers/form-schema-renderer/FlyFormSchemaRenderer.types.ts +3 -0
- package/src/components/form/input-renderers/form-schema-renderer/FlyFormSchemaRenderer.utils.ts +246 -0
- package/src/components/form/input-renderers/form-schema-renderer/FlyFormSchemaRenderer.vue +75 -0
- package/src/components/form/input-renderers/form-schema-renderer/UseFormSchemaRenderer.ts +97 -0
- package/src/components/form/input-renderers/form-schema.types.ts +95 -0
- package/src/components/form/input-renderers/input-renderer/FlyInputRenderer.vue +49 -0
- package/src/components/form/input-renderers/input-renderer.types.ts +49 -0
- package/src/components/form/input-renderers/input-renderer.utils.ts +18 -0
- package/src/components/form/input-renderers/number/FlyNumber.scss +1 -0
- package/src/components/form/input-renderers/number/FlyNumber.types.ts +13 -0
- package/src/components/form/input-renderers/number/FlyNumber.utils.ts +6 -0
- package/src/components/form/input-renderers/number/FlyNumber.vue +48 -0
- package/src/components/form/input-renderers/regional-tenant-form-renderer/FlyRegionalTenantFormRenderer.types.ts +15 -0
- package/src/components/form/input-renderers/regional-tenant-form-renderer/FlyRegionalTenantFormRenderer.vue +99 -0
- package/src/components/form/input-renderers/select/FlySelect.scss +9 -0
- package/src/components/form/input-renderers/select/FlySelect.types.ts +25 -0
- package/src/components/form/input-renderers/select/FlySelect.utils.ts +37 -0
- package/src/components/form/input-renderers/select/FlySelect.vue +48 -0
- package/src/components/form/input-renderers/text/FlyText.scss +1 -0
- package/src/components/form/input-renderers/text/FlyText.types.ts +20 -0
- package/src/components/form/input-renderers/text/FlyText.vue +56 -0
- package/src/components/form/input-renderers/value-unit/FlyValueUnit.scss +2 -0
- package/src/components/form/input-renderers/value-unit/FlyValueUnit.types.ts +28 -0
- package/src/components/form/input-renderers/value-unit/FlyValueUnit.vue +101 -0
- package/src/components/form/input-validators.ts +121 -0
- package/src/components/general/fly-icon/FlyIcon.types.ts +12 -12
- package/src/components/general/fly-icon/FlyIcon.vue +24 -24
- package/src/components/general/fly-icon/index.ts +6 -6
- package/src/components/general/index.ts +2 -2
- package/src/components/index.ts +5 -11
- package/src/components/navigation/fly-steps/FlySteps.element.scss +100 -100
- package/src/components/navigation/fly-steps/FlySteps.types.ts +10 -10
- package/src/components/navigation/fly-steps/FlySteps.vue +30 -30
- package/src/components/navigation/fly-steps/index.ts +6 -6
- package/src/components/navigation/index.ts +2 -2
- package/src/components/navigation/menu/fly-mini-sidebar/FlyMiniSidebar.element.scss +2 -2
- package/src/components/navigation/menu/fly-mini-sidebar/FlyMiniSidebar.types.ts +8 -8
- package/src/components/navigation/menu/fly-mini-sidebar/FlyMiniSidebar.vue +46 -46
- package/src/components/navigation/menu/fly-mini-sidebar/FlyMiniSidebarItem.vue +55 -55
- package/src/components/navigation/menu/fly-mini-sidebar/index.ts +6 -6
- package/src/components/navigation/menu/fly-sidebar/FlySidebar.element.scss +9 -9
- package/src/components/navigation/menu/fly-sidebar/FlySidebar.types.ts +36 -36
- package/src/components/navigation/menu/fly-sidebar/FlySidebar.vue +150 -150
- package/src/components/navigation/menu/fly-sidebar/FlySidebarNode.vue +47 -47
- package/src/components/navigation/menu/fly-sidebar/index.ts +12 -12
- package/src/components/navigation/menu/index.ts +5 -5
- package/src/index.ts +1 -1
- package/src/styles/_scss-tokens.scss +76 -76
- package/src/styles/core/animations.scss +40 -40
- package/src/styles/core/index.scss +36 -36
- package/src/styles/core/scrollbar.scss +36 -36
- package/src/styles/core/typography-utils.scss +9 -9
- package/src/styles/element/common.scss +56 -56
- package/src/styles/element/dark.scss +38 -38
- package/src/styles/element/mixins/collapse.scss +61 -61
- package/src/styles/element/mixins/dialog.scss +101 -101
- package/src/styles/element/overrides/alerts.scss +28 -28
- package/src/styles/element/overrides/badge.scss +6 -6
- package/src/styles/element/overrides/cascader.scss +2 -2
- package/src/styles/element/overrides/collapse.scss +2 -2
- package/src/styles/element/overrides/date-time.scss +11 -0
- package/src/styles/element/overrides/dialog.scss +2 -2
- package/src/styles/element/overrides/dropdown.scss +11 -11
- package/src/styles/element/overrides/form.scss +107 -107
- package/src/styles/element/overrides/message.scss +39 -39
- package/src/styles/element/overrides/notification.scss +46 -46
- package/src/styles/element/overrides/segmented.scss +17 -17
- package/src/styles/element/overrides/table.scss +2 -2
- package/src/styles/element/overrides/tag.scss +19 -19
- package/src/styles/index.d.ts +1 -1
- package/src/styles/index.scss +5 -5
- package/src/styles/mixins/shadows.scss +15 -15
- package/src/styles/tokens.scss +84 -83
- package/dist/types/components/AppButton/AppButton.types.d.ts +0 -8
- package/dist/types/components/AppButton/AppButton.vue.d.ts +0 -20
- package/dist/types/components/AppButton/index.d.ts +0 -4
- package/dist/types/components/AppCard/AppCard.types.d.ts +0 -5
- package/dist/types/components/AppCard/AppCard.vue.d.ts +0 -17
- package/dist/types/components/AppCard/index.d.ts +0 -4
- package/dist/types/components/basic/fly-button/FlyButton.types.d.ts +0 -25
- package/dist/types/components/basic/fly-button/FlyButton.vue.d.ts +0 -26
- package/dist/types/components/basic/fly-button/index.d.ts +0 -4
- package/dist/types/components/basic/index.d.ts +0 -2
- package/dist/types/components/feedback/index.d.ts +0 -2
- package/dist/types/components/feedback/tooltip/FlyTooltip.types.d.ts +0 -4
- package/dist/types/components/feedback/tooltip/FlyTooltip.vue.d.ts +0 -16
- package/dist/types/components/feedback/tooltip/index.d.ts +0 -4
- package/dist/types/components/general/fly-icon/FlyIcon.types.d.ts +0 -7
- package/dist/types/components/general/fly-icon/FlyIcon.vue.d.ts +0 -6
- package/dist/types/components/general/fly-icon/index.d.ts +0 -4
- package/dist/types/components/general/index.d.ts +0 -2
- package/dist/types/components/index.d.ts +0 -8
- package/dist/types/components/navigation/fly-steps/FlySteps.types.d.ts +0 -9
- package/dist/types/components/navigation/fly-steps/FlySteps.vue.d.ts +0 -9
- package/dist/types/components/navigation/fly-steps/index.d.ts +0 -4
- package/dist/types/components/navigation/index.d.ts +0 -2
- package/dist/types/components/navigation/menu/fly-mini-sidebar/FlyMiniSidebar.types.d.ts +0 -7
- package/dist/types/components/navigation/menu/fly-mini-sidebar/FlyMiniSidebar.vue.d.ts +0 -8
- package/dist/types/components/navigation/menu/fly-mini-sidebar/FlyMiniSidebarItem.vue.d.ts +0 -7
- package/dist/types/components/navigation/menu/fly-mini-sidebar/index.d.ts +0 -4
- package/dist/types/components/navigation/menu/fly-sidebar/FlySidebar.types.d.ts +0 -29
- package/dist/types/components/navigation/menu/fly-sidebar/FlySidebar.vue.d.ts +0 -8
- package/dist/types/components/navigation/menu/fly-sidebar/FlySidebarNode.vue.d.ts +0 -7
- package/dist/types/components/navigation/menu/fly-sidebar/index.d.ts +0 -4
- package/dist/types/components/navigation/menu/index.d.ts +0 -4
- package/dist/types/index.d.ts +0 -1
- package/dist/types/types/index.d.ts +0 -1
- package/src/components/AppButton/AppButton.element.scss +0 -2
- package/src/components/AppButton/AppButton.types.ts +0 -10
- package/src/components/AppButton/AppButton.vue +0 -65
- package/src/components/AppButton/index.ts +0 -6
- package/src/components/AppCard/AppCard.types.ts +0 -5
- package/src/components/AppCard/AppCard.vue +0 -58
- package/src/components/AppCard/index.ts +0 -6
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
@use '././../../../styles/mixins/shadows.scss' as shadow;
|
|
2
|
-
|
|
3
|
-
$disabledOpacity: 0.5;
|
|
4
|
-
|
|
5
|
-
@mixin fly-button-overrides {
|
|
6
|
-
&.el-button {
|
|
7
|
-
&.aspect-1 {
|
|
8
|
-
aspect-ratio: 1;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
&.active {
|
|
12
|
-
border-color: var(--anra-primary);
|
|
13
|
-
@include shadow.shadow-lg;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
&--primary {
|
|
17
|
-
&:not(.is-link) {
|
|
18
|
-
--el-button-text-color: var(--anra-white);
|
|
19
|
-
--el-button-hover-text-color: var(--anra-white);
|
|
20
|
-
|
|
21
|
-
&.is-plain {
|
|
22
|
-
--el-button-text-color: var(--default-text-color);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
&--success {
|
|
27
|
-
--el-button-text-color: var(--dynamic-dark);
|
|
28
|
-
--el-button-hover-text-color: var(--dynamic-dark);
|
|
29
|
-
|
|
30
|
-
&.is-plain {
|
|
31
|
-
--el-button-text-color: var(--default-text-color);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
&--warning {
|
|
35
|
-
--el-button-text-color: var(--dynamic-dark);
|
|
36
|
-
--el-button-hover-text-color: var(--dynamic-dark);
|
|
37
|
-
|
|
38
|
-
&.is-plain {
|
|
39
|
-
--el-button-text-color: var(--default-text-color);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
@mixin fly-button-overrides-dark {
|
|
46
|
-
&.el-button {
|
|
47
|
-
&--primary {
|
|
48
|
-
&:not(.is-link) {
|
|
49
|
-
--el-button-text-color: var(--anra-black);
|
|
50
|
-
--el-button-hover-text-color: var(--anra-black);
|
|
51
|
-
|
|
52
|
-
&.is-plain {
|
|
53
|
-
--el-button-text-color: var(--default-text-color);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
1
|
+
@use '././../../../styles/mixins/shadows.scss' as shadow;
|
|
2
|
+
|
|
3
|
+
$disabledOpacity: 0.5;
|
|
4
|
+
|
|
5
|
+
@mixin fly-button-overrides {
|
|
6
|
+
&.el-button {
|
|
7
|
+
&.aspect-1 {
|
|
8
|
+
aspect-ratio: 1;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&.active {
|
|
12
|
+
border-color: var(--anra-primary);
|
|
13
|
+
@include shadow.shadow-lg;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&--primary {
|
|
17
|
+
&:not(.is-link) {
|
|
18
|
+
--el-button-text-color: var(--anra-white);
|
|
19
|
+
--el-button-hover-text-color: var(--anra-white);
|
|
20
|
+
|
|
21
|
+
&.is-plain {
|
|
22
|
+
--el-button-text-color: var(--default-text-color);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
&--success {
|
|
27
|
+
--el-button-text-color: var(--dynamic-dark);
|
|
28
|
+
--el-button-hover-text-color: var(--dynamic-dark);
|
|
29
|
+
|
|
30
|
+
&.is-plain {
|
|
31
|
+
--el-button-text-color: var(--default-text-color);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
&--warning {
|
|
35
|
+
--el-button-text-color: var(--dynamic-dark);
|
|
36
|
+
--el-button-hover-text-color: var(--dynamic-dark);
|
|
37
|
+
|
|
38
|
+
&.is-plain {
|
|
39
|
+
--el-button-text-color: var(--default-text-color);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@mixin fly-button-overrides-dark {
|
|
46
|
+
&.el-button {
|
|
47
|
+
&--primary {
|
|
48
|
+
&:not(.is-link) {
|
|
49
|
+
--el-button-text-color: var(--anra-black);
|
|
50
|
+
--el-button-hover-text-color: var(--anra-black);
|
|
51
|
+
|
|
52
|
+
&.is-plain {
|
|
53
|
+
--el-button-text-color: var(--default-text-color);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import type { ButtonType, ElButton, UseTooltipProps } from 'element-plus'
|
|
2
|
-
|
|
3
|
-
import type { T_FlyIconTypes } from '../../general/fly-icon/FlyIcon.types'
|
|
4
|
-
|
|
5
|
-
export type FlyButtonIconPosition = 'left' | 'right'
|
|
6
|
-
|
|
7
|
-
export type FlyButtonSizes = InstanceType<typeof ElButton>['$props']['size']
|
|
8
|
-
export type FlyButtonTypes = ButtonType
|
|
9
|
-
|
|
10
|
-
export type FlyButtonProps = {
|
|
11
|
-
active?: boolean
|
|
12
|
-
appButtonClass?: string
|
|
13
|
-
aspect1?: boolean
|
|
14
|
-
/**
|
|
15
|
-
* Test
|
|
16
|
-
*/
|
|
17
|
-
clipRound?: boolean
|
|
18
|
-
full?: boolean
|
|
19
|
-
icon?: string | object
|
|
20
|
-
iconPosition?: FlyButtonIconPosition
|
|
21
|
-
iconType?: T_FlyIconTypes
|
|
22
|
-
imageUrl?: string
|
|
23
|
-
label?: string
|
|
24
|
-
size?: FlyButtonSizes
|
|
25
|
-
stop?: boolean
|
|
26
|
-
title?: string
|
|
27
|
-
tooltip?: UseTooltipProps
|
|
28
|
-
type?: FlyButtonTypes
|
|
29
|
-
}
|
|
1
|
+
import type { ButtonType, ElButton, UseTooltipProps } from 'element-plus'
|
|
2
|
+
|
|
3
|
+
import type { T_FlyIconTypes } from '../../general/fly-icon/FlyIcon.types'
|
|
4
|
+
|
|
5
|
+
export type FlyButtonIconPosition = 'left' | 'right'
|
|
6
|
+
|
|
7
|
+
export type FlyButtonSizes = InstanceType<typeof ElButton>['$props']['size']
|
|
8
|
+
export type FlyButtonTypes = ButtonType
|
|
9
|
+
|
|
10
|
+
export type FlyButtonProps = {
|
|
11
|
+
active?: boolean
|
|
12
|
+
appButtonClass?: string
|
|
13
|
+
aspect1?: boolean
|
|
14
|
+
/**
|
|
15
|
+
* Test
|
|
16
|
+
*/
|
|
17
|
+
clipRound?: boolean
|
|
18
|
+
full?: boolean
|
|
19
|
+
icon?: string | object
|
|
20
|
+
iconPosition?: FlyButtonIconPosition
|
|
21
|
+
iconType?: T_FlyIconTypes
|
|
22
|
+
imageUrl?: string
|
|
23
|
+
label?: string
|
|
24
|
+
size?: FlyButtonSizes
|
|
25
|
+
stop?: boolean
|
|
26
|
+
title?: string
|
|
27
|
+
tooltip?: UseTooltipProps
|
|
28
|
+
type?: FlyButtonTypes
|
|
29
|
+
}
|
|
@@ -1,180 +1,180 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="fly-button" :class="[{ full }, appButtonClass]">
|
|
3
|
-
<FlyTooltip
|
|
4
|
-
:tooltip="{
|
|
5
|
-
// effect: 'dark',
|
|
6
|
-
content: title,
|
|
7
|
-
placement: tooltip?.placement ?? 'bottom',
|
|
8
|
-
disabled: !!tooltip?.disabled || isEmpty(title)
|
|
9
|
-
}"
|
|
10
|
-
>
|
|
11
|
-
<el-button
|
|
12
|
-
v-bind="additionalButtonBindingValues"
|
|
13
|
-
:class="[{ active, 'aspect-1': aspect1 }]"
|
|
14
|
-
@click="handleClick"
|
|
15
|
-
>
|
|
16
|
-
<FlyIcon
|
|
17
|
-
v-if="icon && resolvedIconPosition === 'left'"
|
|
18
|
-
:type="iconType"
|
|
19
|
-
:icon="icon"
|
|
20
|
-
:class="[{ 'left-icon': slots.default }]"
|
|
21
|
-
/>
|
|
22
|
-
|
|
23
|
-
<slot></slot>
|
|
24
|
-
|
|
25
|
-
<FlyIcon
|
|
26
|
-
v-if="icon && resolvedIconPosition === 'right'"
|
|
27
|
-
:type="iconType"
|
|
28
|
-
:icon="icon"
|
|
29
|
-
:class="[{ 'right-icon': slots.default }]"
|
|
30
|
-
/>
|
|
31
|
-
|
|
32
|
-
<span v-if="imageUrl" class="btn-image" :class="[{ 'clip-round': clipRound }]">
|
|
33
|
-
<img :src="imageUrl" />
|
|
34
|
-
</span>
|
|
35
|
-
</el-button>
|
|
36
|
-
</FlyTooltip>
|
|
37
|
-
</div>
|
|
38
|
-
</template>
|
|
39
|
-
|
|
40
|
-
<script lang="ts" setup>
|
|
41
|
-
import { computed, useAttrs, useSlots } from 'vue'
|
|
42
|
-
|
|
43
|
-
import { ElButton } from 'element-plus'
|
|
44
|
-
|
|
45
|
-
import { isEmpty } from 'lodash'
|
|
46
|
-
|
|
47
|
-
import FlyTooltip from '../../feedback/tooltip/FlyTooltip.vue'
|
|
48
|
-
import FlyIcon from '../../general/fly-icon/FlyIcon.vue'
|
|
49
|
-
|
|
50
|
-
import './FlyButton.element.scss'
|
|
51
|
-
import type { FlyButtonIconPosition, FlyButtonProps } from './FlyButton.types'
|
|
52
|
-
|
|
53
|
-
const attrs = useAttrs()
|
|
54
|
-
const slots = useSlots()
|
|
55
|
-
const emit = defineEmits(['click'])
|
|
56
|
-
|
|
57
|
-
defineOptions({
|
|
58
|
-
inheritAttrs: false
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
const props = withDefaults(defineProps<FlyButtonProps>(), {
|
|
62
|
-
active: false,
|
|
63
|
-
aspect1: false,
|
|
64
|
-
clipRound: false,
|
|
65
|
-
full: false,
|
|
66
|
-
stop: false,
|
|
67
|
-
tooltip: () => ({
|
|
68
|
-
placement: 'bottom',
|
|
69
|
-
disabled: false
|
|
70
|
-
})
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
const additionalButtonBindingValues = computed(() => {
|
|
74
|
-
const { type, size } = props
|
|
75
|
-
|
|
76
|
-
return {
|
|
77
|
-
...attrs,
|
|
78
|
-
size,
|
|
79
|
-
type
|
|
80
|
-
} as object
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
const resolvedIconPosition = computed<FlyButtonIconPosition>(() => props.iconPosition || 'left')
|
|
84
|
-
|
|
85
|
-
function handleClick(e: MouseEvent) {
|
|
86
|
-
/**
|
|
87
|
-
* Stop the event propagation if the stop prop is set to true
|
|
88
|
-
*/
|
|
89
|
-
if (props.stop) {
|
|
90
|
-
e.stopPropagation()
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
emit('click', e)
|
|
94
|
-
}
|
|
95
|
-
</script>
|
|
96
|
-
|
|
97
|
-
<style lang="scss" scoped>
|
|
98
|
-
.fly-button {
|
|
99
|
-
pointer-events: auto;
|
|
100
|
-
|
|
101
|
-
&.full button {
|
|
102
|
-
width: 100%;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
:deep(.el-button) {
|
|
106
|
-
&.active {
|
|
107
|
-
/* 1px ring stile */
|
|
108
|
-
box-shadow: 0 0 0 1px var(--anra-white);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.fly-icon {
|
|
112
|
-
svg {
|
|
113
|
-
width: calc(1em + 2px);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
:deep(.fly-icon.left-icon) {
|
|
119
|
-
padding-inline-end: 0.25rem;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
:deep(.fly-icon.right-icon) {
|
|
123
|
-
padding-inline-start: 0.25rem;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.btn-image {
|
|
127
|
-
display: flex;
|
|
128
|
-
align-items: center;
|
|
129
|
-
justify-content: center;
|
|
130
|
-
position: absolute;
|
|
131
|
-
top: 0;
|
|
132
|
-
left: 0;
|
|
133
|
-
right: 0;
|
|
134
|
-
bottom: 0;
|
|
135
|
-
|
|
136
|
-
&.clip-round {
|
|
137
|
-
-webkit-box-align: stretch;
|
|
138
|
-
align-items: stretch;
|
|
139
|
-
border-radius: 50%;
|
|
140
|
-
box-sizing: content-box;
|
|
141
|
-
display: flex;
|
|
142
|
-
flex-direction: column;
|
|
143
|
-
-webkit-box-pack: center;
|
|
144
|
-
justify-content: center;
|
|
145
|
-
overflow: hidden;
|
|
146
|
-
|
|
147
|
-
img {
|
|
148
|
-
border: 5px solid transparent;
|
|
149
|
-
border-radius: 50%;
|
|
150
|
-
display: flex;
|
|
151
|
-
width: 100%;
|
|
152
|
-
height: 100%;
|
|
153
|
-
flex: 1 1 100%;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
</style>
|
|
159
|
-
|
|
160
|
-
<style lang="scss">
|
|
161
|
-
@use './FlyButton.mixins.scss' as button;
|
|
162
|
-
|
|
163
|
-
.el-button-group {
|
|
164
|
-
display: flex;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
html.dark {
|
|
168
|
-
button.el-button {
|
|
169
|
-
@include button.fly-button-overrides-dark;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
button.el-button {
|
|
174
|
-
position: relative;
|
|
175
|
-
overflow: hidden;
|
|
176
|
-
transition: 0.1s;
|
|
177
|
-
text-wrap: balance;
|
|
178
|
-
@include button.fly-button-overrides;
|
|
179
|
-
}
|
|
180
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="fly-button" :class="[{ full }, appButtonClass]">
|
|
3
|
+
<FlyTooltip
|
|
4
|
+
:tooltip="{
|
|
5
|
+
// effect: 'dark',
|
|
6
|
+
content: title,
|
|
7
|
+
placement: tooltip?.placement ?? 'bottom',
|
|
8
|
+
disabled: !!tooltip?.disabled || isEmpty(title)
|
|
9
|
+
}"
|
|
10
|
+
>
|
|
11
|
+
<el-button
|
|
12
|
+
v-bind="additionalButtonBindingValues"
|
|
13
|
+
:class="[{ active, 'aspect-1': aspect1 }]"
|
|
14
|
+
@click="handleClick"
|
|
15
|
+
>
|
|
16
|
+
<FlyIcon
|
|
17
|
+
v-if="icon && resolvedIconPosition === 'left'"
|
|
18
|
+
:type="iconType"
|
|
19
|
+
:icon="icon"
|
|
20
|
+
:class="[{ 'left-icon': slots.default }]"
|
|
21
|
+
/>
|
|
22
|
+
|
|
23
|
+
<slot></slot>
|
|
24
|
+
|
|
25
|
+
<FlyIcon
|
|
26
|
+
v-if="icon && resolvedIconPosition === 'right'"
|
|
27
|
+
:type="iconType"
|
|
28
|
+
:icon="icon"
|
|
29
|
+
:class="[{ 'right-icon': slots.default }]"
|
|
30
|
+
/>
|
|
31
|
+
|
|
32
|
+
<span v-if="imageUrl" class="btn-image" :class="[{ 'clip-round': clipRound }]">
|
|
33
|
+
<img :src="imageUrl" />
|
|
34
|
+
</span>
|
|
35
|
+
</el-button>
|
|
36
|
+
</FlyTooltip>
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script lang="ts" setup>
|
|
41
|
+
import { computed, useAttrs, useSlots } from 'vue'
|
|
42
|
+
|
|
43
|
+
import { ElButton } from 'element-plus'
|
|
44
|
+
|
|
45
|
+
import { isEmpty } from 'lodash'
|
|
46
|
+
|
|
47
|
+
import FlyTooltip from '../../feedback/tooltip/FlyTooltip.vue'
|
|
48
|
+
import FlyIcon from '../../general/fly-icon/FlyIcon.vue'
|
|
49
|
+
|
|
50
|
+
import './FlyButton.element.scss'
|
|
51
|
+
import type { FlyButtonIconPosition, FlyButtonProps } from './FlyButton.types'
|
|
52
|
+
|
|
53
|
+
const attrs = useAttrs()
|
|
54
|
+
const slots = useSlots()
|
|
55
|
+
const emit = defineEmits(['click'])
|
|
56
|
+
|
|
57
|
+
defineOptions({
|
|
58
|
+
inheritAttrs: false
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
const props = withDefaults(defineProps<FlyButtonProps>(), {
|
|
62
|
+
active: false,
|
|
63
|
+
aspect1: false,
|
|
64
|
+
clipRound: false,
|
|
65
|
+
full: false,
|
|
66
|
+
stop: false,
|
|
67
|
+
tooltip: () => ({
|
|
68
|
+
placement: 'bottom',
|
|
69
|
+
disabled: false
|
|
70
|
+
})
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
const additionalButtonBindingValues = computed(() => {
|
|
74
|
+
const { type, size } = props
|
|
75
|
+
|
|
76
|
+
return {
|
|
77
|
+
...attrs,
|
|
78
|
+
size,
|
|
79
|
+
type
|
|
80
|
+
} as object
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
const resolvedIconPosition = computed<FlyButtonIconPosition>(() => props.iconPosition || 'left')
|
|
84
|
+
|
|
85
|
+
function handleClick(e: MouseEvent) {
|
|
86
|
+
/**
|
|
87
|
+
* Stop the event propagation if the stop prop is set to true
|
|
88
|
+
*/
|
|
89
|
+
if (props.stop) {
|
|
90
|
+
e.stopPropagation()
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
emit('click', e)
|
|
94
|
+
}
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<style lang="scss" scoped>
|
|
98
|
+
.fly-button {
|
|
99
|
+
pointer-events: auto;
|
|
100
|
+
|
|
101
|
+
&.full button {
|
|
102
|
+
width: 100%;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
:deep(.el-button) {
|
|
106
|
+
&.active {
|
|
107
|
+
/* 1px ring stile */
|
|
108
|
+
box-shadow: 0 0 0 1px var(--anra-white);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.fly-icon {
|
|
112
|
+
svg {
|
|
113
|
+
width: calc(1em + 2px);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
:deep(.fly-icon.left-icon) {
|
|
119
|
+
padding-inline-end: 0.25rem;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:deep(.fly-icon.right-icon) {
|
|
123
|
+
padding-inline-start: 0.25rem;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.btn-image {
|
|
127
|
+
display: flex;
|
|
128
|
+
align-items: center;
|
|
129
|
+
justify-content: center;
|
|
130
|
+
position: absolute;
|
|
131
|
+
top: 0;
|
|
132
|
+
left: 0;
|
|
133
|
+
right: 0;
|
|
134
|
+
bottom: 0;
|
|
135
|
+
|
|
136
|
+
&.clip-round {
|
|
137
|
+
-webkit-box-align: stretch;
|
|
138
|
+
align-items: stretch;
|
|
139
|
+
border-radius: 50%;
|
|
140
|
+
box-sizing: content-box;
|
|
141
|
+
display: flex;
|
|
142
|
+
flex-direction: column;
|
|
143
|
+
-webkit-box-pack: center;
|
|
144
|
+
justify-content: center;
|
|
145
|
+
overflow: hidden;
|
|
146
|
+
|
|
147
|
+
img {
|
|
148
|
+
border: 5px solid transparent;
|
|
149
|
+
border-radius: 50%;
|
|
150
|
+
display: flex;
|
|
151
|
+
width: 100%;
|
|
152
|
+
height: 100%;
|
|
153
|
+
flex: 1 1 100%;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
</style>
|
|
159
|
+
|
|
160
|
+
<style lang="scss">
|
|
161
|
+
@use './FlyButton.mixins.scss' as button;
|
|
162
|
+
|
|
163
|
+
.el-button-group {
|
|
164
|
+
display: flex;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
html.dark {
|
|
168
|
+
button.el-button {
|
|
169
|
+
@include button.fly-button-overrides-dark;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
button.el-button {
|
|
174
|
+
position: relative;
|
|
175
|
+
overflow: hidden;
|
|
176
|
+
transition: 0.1s;
|
|
177
|
+
text-wrap: balance;
|
|
178
|
+
@include button.fly-button-overrides;
|
|
179
|
+
}
|
|
180
|
+
</style>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import FlyButton from './FlyButton.vue'
|
|
2
|
-
|
|
3
|
-
export default FlyButton
|
|
4
|
-
export { FlyButton }
|
|
5
|
-
|
|
6
|
-
export type {
|
|
7
|
-
FlyButtonProps,
|
|
8
|
-
FlyButtonSizes,
|
|
9
|
-
FlyButtonIconPosition,
|
|
10
|
-
FlyButtonTypes
|
|
11
|
-
} from './FlyButton.types'
|
|
1
|
+
import FlyButton from './FlyButton.vue'
|
|
2
|
+
|
|
3
|
+
export default FlyButton
|
|
4
|
+
export { FlyButton }
|
|
5
|
+
|
|
6
|
+
export type {
|
|
7
|
+
FlyButtonProps,
|
|
8
|
+
FlyButtonSizes,
|
|
9
|
+
FlyButtonIconPosition,
|
|
10
|
+
FlyButtonTypes
|
|
11
|
+
} from './FlyButton.types'
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as FlyButton } from './fly-button'
|
|
2
|
-
export type * from './fly-button'
|
|
1
|
+
export { default as FlyButton } from './fly-button'
|
|
2
|
+
export type * from './fly-button'
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="fly-collapse-title-renderer">
|
|
3
|
+
<div class="fly-collapse-title-renderer__inner">
|
|
4
|
+
<p class="fly-collapse-title-renderer__title">
|
|
5
|
+
{{ t(title) }}
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<slot></slot>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script lang="ts" setup>
|
|
14
|
+
import { UseLocaleInjector } from '../../../composables/UseLocaleInjector'
|
|
15
|
+
|
|
16
|
+
defineProps<{
|
|
17
|
+
title: string
|
|
18
|
+
}>()
|
|
19
|
+
|
|
20
|
+
const { t } = UseLocaleInjector()
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<style lang="scss" scoped>
|
|
24
|
+
.fly-collapse-title-renderer {
|
|
25
|
+
display: flex;
|
|
26
|
+
gap: 0.25rem;
|
|
27
|
+
align-items: center;
|
|
28
|
+
text-align: left;
|
|
29
|
+
flex-grow: 1;
|
|
30
|
+
|
|
31
|
+
&__inner {
|
|
32
|
+
display: flex;
|
|
33
|
+
padding-left: 0.5rem;
|
|
34
|
+
padding-right: 0.5rem;
|
|
35
|
+
flex-grow: 1;
|
|
36
|
+
align-items: center;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&__title {
|
|
40
|
+
font-size: 0.875rem;
|
|
41
|
+
line-height: 1.25rem;
|
|
42
|
+
font-weight: 500;
|
|
43
|
+
flex-grow: 1;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
</style>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as FlyTooltip } from './tooltip'
|
|
2
|
-
export type * from './tooltip'
|
|
1
|
+
export { default as FlyTooltip } from './tooltip'
|
|
2
|
+
export type * from './tooltip'
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span class="fly-info-tooltip">
|
|
3
|
+
<FlyTooltip
|
|
4
|
+
v-if="content"
|
|
5
|
+
:tooltip="{
|
|
6
|
+
content: DOMPurify.sanitize(content)
|
|
7
|
+
}"
|
|
8
|
+
>
|
|
9
|
+
<slot name="trigger">
|
|
10
|
+
<FlyIcon class="tw-cursor-pointer" :icon="mdiInformationSlabBoxOutline" />
|
|
11
|
+
</slot>
|
|
12
|
+
<template #content>
|
|
13
|
+
<div v-if="html" v-html="DOMPurify.sanitize(content)"></div>
|
|
14
|
+
<slot v-else></slot>
|
|
15
|
+
</template>
|
|
16
|
+
</FlyTooltip>
|
|
17
|
+
</span>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script setup lang="ts">
|
|
21
|
+
import { mdiInformationSlabBoxOutline } from '@mdi/js'
|
|
22
|
+
import DOMPurify from 'dompurify'
|
|
23
|
+
|
|
24
|
+
import FlyIcon from '../../general/fly-icon/FlyIcon.vue'
|
|
25
|
+
|
|
26
|
+
import FlyTooltip from './FlyTooltip.vue'
|
|
27
|
+
|
|
28
|
+
defineProps({
|
|
29
|
+
content: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: ''
|
|
32
|
+
},
|
|
33
|
+
html: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<style lang="scss" scoped>
|
|
41
|
+
.fly-info-tooltip {
|
|
42
|
+
:deep(.app-icon) {
|
|
43
|
+
svg {
|
|
44
|
+
display: inline;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
</style>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use '
|
|
2
|
-
|
|
3
|
-
@use 'element-plus/theme-chalk/src/popper.scss' as *;
|
|
4
|
-
@use 'element-plus/theme-chalk/src/tooltip.scss' as *;
|
|
1
|
+
@use '../../../styles//element/common.scss' as *;
|
|
2
|
+
|
|
3
|
+
@use 'element-plus/theme-chalk/src/popper.scss' as *;
|
|
4
|
+
@use 'element-plus/theme-chalk/src/tooltip.scss' as *;
|