@policystudio/policy-studio-ui-vue 1.1.90-beta.2 → 1.1.90-beta.21
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/.eslintrc.js +13 -8
- package/.github/workflows/deploy-storybook.yml +4 -4
- package/.nvmrc +1 -0
- package/dist/css/psui_styles_output.css +6986 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.js +104 -0
- package/dist/index.js.map +1 -0
- package/dist/util/GeneralFunctions.d.ts +3 -0
- package/dist/util/GeneralFunctions.js +29 -0
- package/dist/util/GeneralFunctions.js.map +1 -0
- package/dist/util/directives.d.ts +1 -0
- package/dist/util/directives.js +22 -0
- package/dist/util/directives.js.map +1 -0
- package/dist/util/imageLoader.d.ts +6 -0
- package/dist/util/imageLoader.js +52 -0
- package/dist/util/imageLoader.js.map +1 -0
- package/package.json +24 -37
- package/src/App.vue +30 -0
- package/src/assets/scss/components/PsDataTable.scss +1 -1
- package/src/components/accordion/PsAccordionItem.vue +75 -75
- package/src/components/badges-and-tags/PsBadgeWithIcon.vue +31 -33
- package/src/components/badges-and-tags/PsCardInfos.vue +39 -41
- package/src/components/badges-and-tags/PsChartLegend.vue +46 -51
- package/src/components/badges-and-tags/PsClimateZoneBadge.vue +13 -19
- package/src/components/badges-and-tags/PsCostEffectBar.vue +24 -56
- package/src/components/badges-and-tags/PsDateCardInfo.vue +17 -18
- package/src/components/badges-and-tags/PsHighlightRippleDot.vue +3 -2
- package/src/components/badges-and-tags/PsMiniTag.vue +39 -41
- package/src/components/badges-and-tags/PsProgressBar.vue +72 -68
- package/src/components/badges-and-tags/PsTagScope.vue +17 -22
- package/src/components/badges-and-tags/PsTestimonialCard.vue +19 -26
- package/src/components/buttons/PsButton.vue +88 -111
- package/src/components/chips/PsChips.vue +98 -101
- package/src/components/controls/PsCheckbox.vue +84 -84
- package/src/components/controls/PsCheckboxSimple.vue +95 -95
- package/src/components/controls/PsDraggable.vue +53 -55
- package/src/components/controls/PsInlineSelector.vue +98 -99
- package/src/components/controls/PsRadioButton.vue +59 -58
- package/src/components/controls/PsRadioButtonSimple.vue +79 -75
- package/src/components/controls/PsSlider.vue +185 -176
- package/src/components/controls/PsSwitch.vue +51 -52
- package/src/components/controls/PsToggle.vue +52 -50
- package/src/components/data-graphics/PsBarChart.vue +18 -21
- package/src/components/datatable/PsDataTable.vue +56 -60
- package/src/components/datatable/PsDataTableItem.vue +13 -28
- package/src/components/forms/PsDropdown.vue +164 -162
- package/src/components/forms/PsDropdownList.vue +133 -130
- package/src/components/forms/PsInput.vue +154 -153
- package/src/components/forms/PsInputSelect.vue +91 -92
- package/src/components/forms/PsInputTextArea.vue +71 -71
- package/src/components/navigations/PsBreadcrumb.vue +25 -34
- package/src/components/notifications/PsDialog.vue +57 -56
- package/src/components/notifications/PsSimpleAlert.vue +27 -29
- package/src/components/notifications/PsToast.vue +40 -39
- package/src/components/table-results/PsTableResults.vue +449 -458
- package/src/components/table-results/PsTableResultsBody.vue +66 -67
- package/src/components/table-results/PsTableResultsHead.vue +62 -56
- package/src/components/table-results/PsTableResultsHeadComparison.vue +62 -56
- package/src/components/table-results/PsTableResultsHeadFlexible.vue +63 -56
- package/src/components/table-results/PsTableResultsRow.vue +55 -56
- package/src/components/tabs/PsTabHeader.vue +106 -100
- package/src/components/tooltip/PsDialogTooltip.vue +96 -101
- package/src/components/tooltip/PsRichTooltip.vue +41 -45
- package/src/components/tooltip/PsTooltip.vue +111 -116
- package/src/components/ui/PsDotLoader.vue +1 -5
- package/src/components/ui/PsIcon.vue +126 -129
- package/src/index.ts +156 -0
- package/src/tsconfig.json +12 -0
- package/src/types/index.d.ts +6 -0
- package/src/util/GeneralFunctions.js +4 -6
- package/src/util/directives.ts +24 -0
- package/src/util/imageLoader.js +14 -7
- package/tailwind.config.js +1 -1
- package/tsconfig.json +47 -0
- package/.storybook/PolicyStudio.js +0 -10
- package/.storybook/eventBus.js +0 -26
- package/.storybook/main.js +0 -21
- package/.storybook/manager.js +0 -6
- package/.storybook/preview.js +0 -17
- package/babel.config.js +0 -17
- package/dist/css/psui_styles.css +0 -4647
- package/postcss.config.js +0 -8
- package/src/assets/images/multifamily-units.svg +0 -10
- package/src/assets/images/policy-studio.svg +0 -15
- package/src/components/playground/PsScrollBar.vue +0 -320
- package/src/contents/ComparisonData.js +0 -378
- package/src/contents/FlexibleData.js +0 -502
- package/src/contents/ResultsData.js +0 -531
- package/src/index.js +0 -166
- package/src/stories/Accordion.stories.js +0 -59
- package/src/stories/BadgeWithIcon.stories.js +0 -31
- package/src/stories/BarChart.stories.js +0 -17
- package/src/stories/Breadcrumb.stories.js +0 -25
- package/src/stories/Button.stories.js +0 -48
- package/src/stories/Button.vue +0 -59
- package/src/stories/CardInfos.stories.js +0 -16
- package/src/stories/ChartLegend.stories.js +0 -16
- package/src/stories/Checkbox.stories.js +0 -45
- package/src/stories/CheckboxSimple.stories.js +0 -49
- package/src/stories/Chips.stories.js +0 -31
- package/src/stories/ClimateZoneBadge.stories.js +0 -17
- package/src/stories/Colors.mdx +0 -70
- package/src/stories/CostEffectBar.stories.js +0 -23
- package/src/stories/Datatable.stories.js +0 -50
- package/src/stories/DateCardInfo.stories.js +0 -24
- package/src/stories/Dialog.stories.js +0 -131
- package/src/stories/Draggable.stories.js +0 -22
- package/src/stories/Dropdown.stories.js +0 -99
- package/src/stories/DropdownList.stories.js +0 -211
- package/src/stories/ElevationSystem.mdx +0 -41
- package/src/stories/Header.stories.js +0 -41
- package/src/stories/Header.vue +0 -77
- package/src/stories/HighlightRippleDot.stories.js +0 -15
- package/src/stories/Icon.stories.js +0 -21
- package/src/stories/InlineSelector.stories.js +0 -18
- package/src/stories/Input.stories.js +0 -240
- package/src/stories/InputSelect.stories.js +0 -30
- package/src/stories/InputTextArea.stories.js +0 -25
- package/src/stories/Introduction.mdx +0 -211
- package/src/stories/MiniTag.stories.js +0 -52
- package/src/stories/Playground.stories.js +0 -16
- package/src/stories/ProgressBar.stories.js +0 -23
- package/src/stories/RadioButton.stories.js +0 -40
- package/src/stories/RadioButtonSimple.stories.js +0 -43
- package/src/stories/SimpleAlert.stories.js +0 -21
- package/src/stories/Slider.stories.js +0 -75
- package/src/stories/Switch.stories.js +0 -39
- package/src/stories/TabHeader.stories.js +0 -52
- package/src/stories/TableResults.stories.js +0 -724
- package/src/stories/TagScope.stories.js +0 -17
- package/src/stories/TestimonialCard.stories.js +0 -27
- package/src/stories/Toast.stories.js +0 -52
- package/src/stories/Toggle.stories.js +0 -45
- package/src/stories/Tooltip.stories.js +0 -114
- package/src/stories/Typography.mdx +0 -212
- package/src/stories/assets/code-brackets.svg +0 -1
- package/src/stories/assets/colors.svg +0 -1
- package/src/stories/assets/comments.svg +0 -1
- package/src/stories/assets/direction.svg +0 -1
- package/src/stories/assets/flow.svg +0 -1
- package/src/stories/assets/plugin.svg +0 -1
- package/src/stories/assets/repo.svg +0 -1
- package/src/stories/assets/stackalt.svg +0 -1
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- package/webpack.config.js +0 -22
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
<template>
|
|
1
|
+
<template>
|
|
2
2
|
<div
|
|
3
3
|
class="psui-el-progress-bar"
|
|
4
|
-
:style="{width: `${width}px`}"
|
|
5
|
-
:class="{ 'is-breakeven'
|
|
4
|
+
:style="{ width: `${width}px` }"
|
|
5
|
+
:class="{ 'is-breakeven': getIsBreakEven }"
|
|
6
6
|
>
|
|
7
7
|
<div class="psui-el-progress-bar-bg" />
|
|
8
8
|
<div
|
|
9
|
-
class="psui-el-progress-bar-value"
|
|
10
|
-
:class="[getBg, {'rounded-tr-full rounded-br-full': getProgressWidth === '100%'}]"
|
|
9
|
+
class="psui-el-progress-bar-value"
|
|
10
|
+
:class="[getBg, { 'rounded-tr-full rounded-br-full': getProgressWidth === '100%' }]"
|
|
11
11
|
:style="{ width: getProgressWidth }"
|
|
12
12
|
/>
|
|
13
13
|
<div
|
|
@@ -17,69 +17,73 @@
|
|
|
17
17
|
</div>
|
|
18
18
|
</template>
|
|
19
19
|
|
|
20
|
-
<script>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
min: {
|
|
29
|
-
type: Number,
|
|
30
|
-
default: 0
|
|
31
|
-
},
|
|
32
|
-
max: {
|
|
33
|
-
type: Number,
|
|
34
|
-
default: 5
|
|
35
|
-
},
|
|
36
|
-
breakEven: {
|
|
37
|
-
type: Number,
|
|
38
|
-
default: 1
|
|
39
|
-
},
|
|
40
|
-
forceBreakEven: {
|
|
41
|
-
Boolean,
|
|
42
|
-
default: false
|
|
43
|
-
},
|
|
44
|
-
value: {
|
|
45
|
-
type: [String, Number],
|
|
46
|
-
default: null
|
|
47
|
-
},
|
|
48
|
-
positiveBg: {
|
|
49
|
-
type: String,
|
|
50
|
-
default: 'psui-bg-blue-60'
|
|
51
|
-
},
|
|
52
|
-
negativeBg: {
|
|
53
|
-
type: String,
|
|
54
|
-
default: 'psui-bg-red-20'
|
|
55
|
-
}
|
|
20
|
+
<script setup>
|
|
21
|
+
import { computed } from 'vue'
|
|
22
|
+
|
|
23
|
+
const props = defineProps({
|
|
24
|
+
width: {
|
|
25
|
+
type: [String, Number],
|
|
26
|
+
default: 100,
|
|
56
27
|
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
28
|
+
min: {
|
|
29
|
+
type: Number,
|
|
30
|
+
default: 0,
|
|
31
|
+
},
|
|
32
|
+
max: {
|
|
33
|
+
type: Number,
|
|
34
|
+
default: 5,
|
|
35
|
+
},
|
|
36
|
+
breakEven: {
|
|
37
|
+
type: Number,
|
|
38
|
+
default: 1,
|
|
39
|
+
},
|
|
40
|
+
forceBreakEven: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false,
|
|
43
|
+
},
|
|
44
|
+
value: {
|
|
45
|
+
type: [String, Number],
|
|
46
|
+
default: null,
|
|
47
|
+
},
|
|
48
|
+
positiveBg: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: 'psui-bg-blue-60',
|
|
51
|
+
},
|
|
52
|
+
negativeBg: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: 'psui-bg-red-20',
|
|
55
|
+
},
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
const getVolume = computed(() => {
|
|
59
|
+
return props.max - props.min
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
const getProgress = computed(() => {
|
|
63
|
+
if (props.value == 9876543210) return 100
|
|
64
|
+
const progress = (100 / getVolume.value) * props.value
|
|
65
|
+
return progress > 100 ? 100 : progress
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
const getProgressWidth = computed(() => {
|
|
69
|
+
return `${getProgress.value}%`
|
|
70
|
+
})
|
|
83
71
|
|
|
84
|
-
|
|
72
|
+
const getIsBreakEven = computed(() => {
|
|
73
|
+
if (props.forceBreakEven) return true
|
|
74
|
+
return props.value >= props.breakEven ? true : false
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
const getBreakEvenLeft = computed(() => {
|
|
78
|
+
return `${(100 / getVolume.value) * props.breakEven}%`
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
const getBg = computed(() => {
|
|
82
|
+
if (props.forceBreakEven) return props.positiveBg
|
|
83
|
+
return getIsBreakEven.value ? props.positiveBg : props.negativeBg
|
|
84
|
+
})
|
|
85
|
+
</script>
|
|
85
86
|
|
|
87
|
+
<style>
|
|
88
|
+
/* Please, use the file src/assets/scss/components/PsProgressBar.scss */
|
|
89
|
+
</style>
|
|
@@ -1,31 +1,26 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="psui-el-tag-scope"
|
|
2
|
+
<div
|
|
3
|
+
class="psui-el-tag-scope"
|
|
4
4
|
:class="getComponentClass"
|
|
5
5
|
>
|
|
6
6
|
<span class="psui-el-tag-scope-icon">{{ getComponentIcon }}</span>
|
|
7
7
|
</div>
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
|
-
<script>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
included: {
|
|
15
|
-
type: Boolean,
|
|
16
|
-
default: true
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
computed: {
|
|
20
|
-
getComponentClass() {
|
|
21
|
-
return `psui-el-tag-scope-${this.included}`
|
|
22
|
-
},
|
|
23
|
-
getComponentIcon() {
|
|
24
|
-
return this.included ? 'check' : 'remove'
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
}
|
|
28
|
-
</script>
|
|
10
|
+
<script setup>
|
|
11
|
+
import { computed } from 'vue'
|
|
12
|
+
|
|
13
|
+
const props = defineProps({})
|
|
29
14
|
|
|
30
|
-
|
|
15
|
+
const getComponentClass = computed(() => {
|
|
16
|
+
return `psui-el-tag-scope-${props.included}`
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
const getComponentIcon = computed(() => {
|
|
20
|
+
return props.included ? 'check' : 'remove'
|
|
21
|
+
})
|
|
22
|
+
</script>
|
|
31
23
|
|
|
24
|
+
<style>
|
|
25
|
+
/* Please, use the file src/assets/scss/components/PsTagScope.scss */
|
|
26
|
+
</style>
|
|
@@ -19,32 +19,25 @@
|
|
|
19
19
|
</div>
|
|
20
20
|
</template>
|
|
21
21
|
|
|
22
|
-
<script>
|
|
22
|
+
<script setup>
|
|
23
23
|
import PsIcon from '../ui/PsIcon.vue'
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
jurisdiction:{
|
|
44
|
-
type: String,
|
|
45
|
-
default: '',
|
|
46
|
-
},
|
|
47
|
-
}
|
|
48
|
-
}
|
|
25
|
+
defineProps({
|
|
26
|
+
description: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: '',
|
|
29
|
+
},
|
|
30
|
+
user: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: '',
|
|
33
|
+
},
|
|
34
|
+
position: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: '',
|
|
37
|
+
},
|
|
38
|
+
jurisdiction: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: '',
|
|
41
|
+
},
|
|
42
|
+
})
|
|
49
43
|
</script>
|
|
50
|
-
|
|
@@ -1,132 +1,109 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<button
|
|
3
|
-
@click="onClick()"
|
|
3
|
+
@click="onClick()"
|
|
4
4
|
@mouseenter="onMouseEnter"
|
|
5
|
-
@mouseleave="onMouseLeave"
|
|
6
|
-
class="psui-el-button"
|
|
7
|
-
:class="[getComponentClass, {
|
|
5
|
+
@mouseleave="onMouseLeave"
|
|
6
|
+
class="psui-el-button"
|
|
7
|
+
:class="[getComponentClass, { hover: isHover }, { disabled: disabled || loading }]"
|
|
8
8
|
>
|
|
9
|
-
<svg
|
|
10
|
-
v-if="loading"
|
|
9
|
+
<svg
|
|
10
|
+
v-if="loading"
|
|
11
11
|
class="psui-animate-spin psui-mr-3 psui-h-5 psui-w-5 psui-text-black"
|
|
12
12
|
:class="`${iconPosition == 'left' ? 'psui-mr-3' : 'psui-ml-3 psui--mr-1'}`"
|
|
13
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
14
|
-
fill="none"
|
|
15
|
-
viewBox="0 0 24 24"
|
|
13
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
14
|
+
fill="none"
|
|
15
|
+
viewBox="0 0 24 24"
|
|
16
16
|
>
|
|
17
|
-
<circle
|
|
18
|
-
class="psui-opacity-25"
|
|
19
|
-
cx="12"
|
|
20
|
-
cy="12"
|
|
21
|
-
r="10"
|
|
22
|
-
stroke="currentColor"
|
|
23
|
-
stroke-width="4"
|
|
17
|
+
<circle
|
|
18
|
+
class="psui-opacity-25"
|
|
19
|
+
cx="12"
|
|
20
|
+
cy="12"
|
|
21
|
+
r="10"
|
|
22
|
+
stroke="currentColor"
|
|
23
|
+
stroke-width="4"
|
|
24
24
|
/>
|
|
25
|
-
<path
|
|
26
|
-
class="psui-opacity-75"
|
|
27
|
-
fill="currentColor"
|
|
28
|
-
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
25
|
+
<path
|
|
26
|
+
class="psui-opacity-75"
|
|
27
|
+
fill="currentColor"
|
|
28
|
+
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
29
29
|
/>
|
|
30
30
|
</svg>
|
|
31
|
-
<i
|
|
32
|
-
v-else-if="icon"
|
|
33
|
-
:class="iconClass"
|
|
34
|
-
class="material-icons-round"
|
|
31
|
+
<i
|
|
32
|
+
v-else-if="icon"
|
|
33
|
+
:class="iconClass"
|
|
34
|
+
class="material-icons-round"
|
|
35
35
|
>{{ icon }}</i>
|
|
36
36
|
<span v-if="label">{{ label }}</span>
|
|
37
37
|
</button>
|
|
38
38
|
</template>
|
|
39
39
|
|
|
40
|
-
<script>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
icon: {
|
|
61
|
-
type: String,
|
|
62
|
-
},
|
|
63
|
-
/**
|
|
64
|
-
* It sets the position of the icon. eg: left or right.
|
|
65
|
-
*/
|
|
66
|
-
iconPosition:{
|
|
67
|
-
type: String,
|
|
68
|
-
default: 'left',
|
|
69
|
-
validator: (value) => ['left','right'].includes(value)
|
|
70
|
-
},
|
|
71
|
-
/**
|
|
72
|
-
* It sets the size of the icon. eg: small, medium and big.
|
|
73
|
-
*/
|
|
74
|
-
size: {
|
|
75
|
-
type: String,
|
|
76
|
-
default: 'big',
|
|
77
|
-
validator: (value) => ['small','medium','big'].includes(value)
|
|
78
|
-
},
|
|
79
|
-
/**
|
|
80
|
-
* It disable the button. All mouse event are disabled.
|
|
81
|
-
*/
|
|
82
|
-
disabled: {
|
|
83
|
-
type: Boolean,
|
|
84
|
-
default: false
|
|
85
|
-
},
|
|
86
|
-
/**
|
|
87
|
-
* It disable and add a spin icon to the button. All mouse event are disabled.
|
|
88
|
-
*/
|
|
89
|
-
loading: {
|
|
90
|
-
type: Boolean,
|
|
91
|
-
default: false
|
|
92
|
-
},
|
|
93
|
-
/**
|
|
94
|
-
* It set any further css style that might be needed.
|
|
95
|
-
*/
|
|
96
|
-
iconClass:{
|
|
97
|
-
type: String
|
|
98
|
-
}
|
|
40
|
+
<script setup>
|
|
41
|
+
import { computed, ref, } from 'vue'
|
|
42
|
+
|
|
43
|
+
const isHover = ref(false)
|
|
44
|
+
|
|
45
|
+
const emit = defineEmits(['click'])
|
|
46
|
+
|
|
47
|
+
const props = defineProps({
|
|
48
|
+
label: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: '',
|
|
51
|
+
},
|
|
52
|
+
layout: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: 'solid',
|
|
55
|
+
validator: (value) => ['solid', 'outline', 'ghost', 'onlytext', 'caution'].includes(value),
|
|
56
|
+
},
|
|
57
|
+
icon: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: '',
|
|
99
60
|
},
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
61
|
+
iconPosition: {
|
|
62
|
+
type: String,
|
|
63
|
+
default: 'left',
|
|
64
|
+
validator: (value) => ['left', 'right'].includes(value),
|
|
104
65
|
},
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
} else {
|
|
110
|
-
return `layout-${this.layout} size-${this.size}`
|
|
111
|
-
}
|
|
112
|
-
},
|
|
66
|
+
size: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: 'big',
|
|
69
|
+
validator: (value) => ['small', 'medium', 'big'].includes(value),
|
|
113
70
|
},
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
71
|
+
disabled: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: false,
|
|
74
|
+
},
|
|
75
|
+
loading: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: false,
|
|
78
|
+
},
|
|
79
|
+
iconClass: {
|
|
80
|
+
type: String,
|
|
81
|
+
default: '',
|
|
82
|
+
},
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
const getComponentClass = computed(() => {
|
|
86
|
+
if (props.icon) {
|
|
87
|
+
return `layout-${props.layout} size-${props.size} icon-${props.iconPosition}`
|
|
88
|
+
} else {
|
|
89
|
+
return `layout-${props.layout} size-${props.size}`
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
const onClick = () => {
|
|
94
|
+
if (props.disabled) return
|
|
95
|
+
emit('click')
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const onMouseEnter = () => {
|
|
99
|
+
if (!props.disabled) {
|
|
100
|
+
isHover.value = true
|
|
129
101
|
}
|
|
130
102
|
}
|
|
131
|
-
</script>
|
|
132
103
|
|
|
104
|
+
const onMouseLeave = () => {
|
|
105
|
+
if (!props.disabled) {
|
|
106
|
+
isHover.value = false
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
</script>
|