@policystudio/policy-studio-ui-vue 1.1.90-beta.5 → 1.1.90-beta.50
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 +2 -8
- package/.github/workflows/deploy-storybook.yml +4 -4
- package/.nvmrc +1 -0
- package/dist/css/psui_styles_output.css +6639 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.js +106 -0
- package/dist/index.js.map +1 -0
- package/dist/util/GeneralFunctions.d.ts +3 -0
- package/dist/util/GeneralFunctions.js +35 -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/doc/.nvmrc +1 -0
- package/{.storybook → doc/.storybook}/main.ts +8 -2
- package/{.storybook → doc/.storybook}/preview.ts +2 -3
- package/doc/package-lock.json +22653 -0
- package/doc/package.json +71 -0
- package/{src → doc}/shims-vue.d.ts +0 -5
- package/{src → doc/src}/stories/Accordion.stories.ts +2 -3
- package/{src → doc/src}/stories/BadgeWithIcon.stories.ts +1 -1
- package/{src → doc/src}/stories/BarChart.stories.ts +1 -1
- package/{src → doc/src}/stories/Breadcrumb.stories.ts +1 -1
- package/doc/src/stories/Button.stories.ts +130 -0
- package/{src → doc/src}/stories/CardInfos.stories.ts +1 -1
- package/{src → doc/src}/stories/ChartLegend.stories.ts +1 -1
- package/{src → doc/src}/stories/Checkbox.stories.ts +1 -1
- package/{src → doc/src}/stories/CheckboxSimple.stories.ts +1 -1
- package/{src → doc/src}/stories/Chips.stories.ts +1 -4
- package/{src → doc/src}/stories/ClimateZoneBadge.stories.ts +2 -1
- package/doc/src/stories/Collapse.stories.ts +46 -0
- package/{src → doc/src}/stories/CostEffectBar.stories.ts +2 -1
- package/{src → doc/src}/stories/Datatable.stories.ts +5 -2
- package/{src → doc/src}/stories/DateCardInfo.stories.ts +1 -1
- package/{src → doc/src}/stories/Dialog.stories.ts +2 -2
- package/{src → doc/src}/stories/Draggable.stories.ts +3 -2
- package/{src → doc/src}/stories/Dropdown.stories.ts +4 -3
- package/{src → doc/src}/stories/DropdownList.stories.ts +4 -2
- package/{src → doc/src}/stories/HighlightRippleDot.stories.ts +3 -2
- package/{src → doc/src}/stories/Icon.stories.ts +3 -1
- package/{src → doc/src}/stories/InlineSelector.stories.ts +1 -1
- package/{src → doc/src}/stories/Input.stories.ts +7 -4
- package/{src → doc/src}/stories/InputSelect.stories.ts +3 -2
- package/{src → doc/src}/stories/InputTextArea.stories.ts +1 -1
- package/{src → doc/src}/stories/MiniTag.stories.ts +9 -2
- package/{src → doc/src}/stories/ProgressBar.stories.ts +3 -2
- package/{src → doc/src}/stories/RadioButton.stories.ts +2 -2
- package/{src → doc/src}/stories/RadioButtonSimple.stories.ts +1 -1
- package/{src → doc/src}/stories/SimpleAlert.stories.ts +3 -2
- package/{src → doc/src}/stories/Slider.stories.ts +6 -2
- package/{src → doc/src}/stories/Switch.stories.ts +2 -2
- package/{src → doc/src}/stories/TabHeader.stories.ts +6 -1
- package/{src → doc/src}/stories/TableResults.stories.ts +11 -7
- package/{src → doc/src}/stories/TagScope.stories.ts +3 -2
- package/{src → doc/src}/stories/TestimonialCard.stories.ts +3 -3
- package/{src → doc/src}/stories/Toast.stories.ts +2 -2
- package/{src → doc/src}/stories/Toggle.stories.ts +6 -3
- package/{src → doc/src}/stories/Tooltip.stories.ts +3 -3
- package/doc/tsconfig.json +17 -0
- package/package.json +13 -28
- package/scripts/gulp.js +11 -0
- package/src/assets/scss/base.scss +3 -34
- package/src/assets/scss/components/PsAccordion.scss +1 -1
- package/src/assets/scss/components/PsChips.scss +9 -3
- package/src/assets/scss/components/PsCollapse.scss +71 -0
- package/src/assets/scss/components/PsDataTable.scss +1 -1
- package/src/assets/scss/components/PsDropdownList.scss +1 -1
- package/src/assets/scss/components/PsTableResults.scss +28 -1
- package/src/assets/scss/components/PsTooltip.scss +2 -1
- package/src/components/accordion/PsAccordionItem.vue +88 -74
- package/src/components/badges-and-tags/PsBadgeWithIcon.vue +31 -34
- 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 +61 -62
- package/src/components/chips/PsChips.vue +112 -101
- package/src/components/collapse/PsCollapse.vue +124 -0
- 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 +65 -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 +166 -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 +70 -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 +461 -468
- package/src/components/table-results/PsTableResultsBody.vue +66 -67
- package/src/components/table-results/PsTableResultsHead.vue +70 -67
- package/src/components/table-results/PsTableResultsHeadComparison.vue +67 -64
- package/src/components/table-results/PsTableResultsHeadFlexible.vue +94 -67
- 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 +143 -132
- package/src/index.ts +60 -67
- package/src/tsconfig.json +12 -0
- package/src/types/index.d.ts +6 -0
- package/src/util/{GeneralFunctions.ts → GeneralFunctions.js} +12 -3
- package/src/util/directives.ts +24 -0
- package/src/util/{imageLoader.ts → imageLoader.js} +7 -0
- package/tailwind.config.js +1 -1
- package/tsconfig.json +18 -13
- package/.storybook/eventBus.ts +0 -26
- package/babel.config.js +0 -17
- package/dist/css/psui_styles.css +0 -4647
- package/postcss.config.js +0 -8
- package/src/components/playground/PsScrollBar.vue +0 -320
- package/src/stories/Button.stories.ts +0 -48
- package/src/stories/Button.vue +0 -59
- package/src/stories/Header.stories.ts +0 -41
- package/src/stories/Header.vue +0 -77
- package/src/stories/Playground.stories.ts +0 -16
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- package/webpack.config.js +0 -22
- /package/{.storybook → doc/.storybook}/PolicyStudio.ts +0 -0
- /package/{.storybook → doc/.storybook}/manager.ts +0 -0
- /package/{src → doc/src}/assets/images/multifamily-units.svg +0 -0
- /package/{src → doc/src}/assets/images/policy-studio.svg +0 -0
- /package/{src → doc/src}/contents/ComparisonData.ts +0 -0
- /package/{src → doc/src}/contents/FlexibleData.ts +0 -0
- /package/{src → doc/src}/contents/ResultsData.ts +0 -0
- /package/{src → doc/src}/stories/Colors.mdx +0 -0
- /package/{src → doc/src}/stories/ElevationSystem.mdx +0 -0
- /package/{src → doc/src}/stories/Introduction.mdx +0 -0
- /package/{src → doc/src}/stories/Typography.mdx +0 -0
- /package/{src → doc/src}/stories/assets/code-brackets.svg +0 -0
- /package/{src → doc/src}/stories/assets/colors.svg +0 -0
- /package/{src → doc/src}/stories/assets/comments.svg +0 -0
- /package/{src → doc/src}/stories/assets/direction.svg +0 -0
- /package/{src → doc/src}/stories/assets/flow.svg +0 -0
- /package/{src → doc/src}/stories/assets/plugin.svg +0 -0
- /package/{src → doc/src}/stories/assets/repo.svg +0 -0
- /package/{src → doc/src}/stories/assets/stackalt.svg +0 -0
|
@@ -9,23 +9,22 @@
|
|
|
9
9
|
</div>
|
|
10
10
|
</template>
|
|
11
11
|
|
|
12
|
-
<script>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
12
|
+
<script setup>
|
|
13
|
+
import { computed } from 'vue'
|
|
14
|
+
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
date: {
|
|
17
|
+
type: [Date, String],
|
|
18
|
+
default: new Date(),
|
|
20
19
|
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
}
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
const getMonthAndDayFromDate = computed(() => {
|
|
23
|
+
const options = { month: 'short', day: '2-digit' }
|
|
24
|
+
return new Date(props.date)?.toLocaleString('default', options).replace('.', '')
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
const getYearFromDate = computed(() => {
|
|
28
|
+
return new Date(props.date)?.toLocaleString('default', { year: 'numeric' })
|
|
29
|
+
})
|
|
31
30
|
</script>
|
|
@@ -1,51 +1,49 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="psui-el-mini-tag"
|
|
4
|
-
:class="getComponentClass"
|
|
5
|
-
@click="
|
|
2
|
+
<div
|
|
3
|
+
class="psui-el-mini-tag"
|
|
4
|
+
:class="getComponentClass"
|
|
5
|
+
@click="emit('click', $event.target)"
|
|
6
6
|
>
|
|
7
7
|
<span>{{ message }}</span>
|
|
8
8
|
</div>
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
|
-
<script>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
default: 'info',
|
|
33
|
-
validator: (value) => typeOptions.indexOf(value) !== -1,
|
|
34
|
-
},
|
|
35
|
-
/**
|
|
36
|
-
* It sets the message that will show up within the minitag when component is rendered.
|
|
37
|
-
*/
|
|
38
|
-
message: {
|
|
39
|
-
type: String,
|
|
40
|
-
},
|
|
11
|
+
<script setup>
|
|
12
|
+
import { computed } from 'vue'
|
|
13
|
+
|
|
14
|
+
const emit = defineEmits(['click'])
|
|
15
|
+
|
|
16
|
+
const props = defineProps({
|
|
17
|
+
layout: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: 'info',
|
|
20
|
+
validator: (value) => [
|
|
21
|
+
'info',
|
|
22
|
+
'success',
|
|
23
|
+
'warning',
|
|
24
|
+
'error',
|
|
25
|
+
'default',
|
|
26
|
+
'solid-info',
|
|
27
|
+
'solid-success',
|
|
28
|
+
'solid-warning',
|
|
29
|
+
'solid-error',
|
|
30
|
+
'solid-default'
|
|
31
|
+
].indexOf(value) !== -1,
|
|
41
32
|
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
33
|
+
/**
|
|
34
|
+
* It sets the message that will show up within the minitag when component is rendered.
|
|
35
|
+
*/
|
|
36
|
+
message: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: '',
|
|
46
39
|
},
|
|
47
|
-
}
|
|
48
|
-
</script>
|
|
40
|
+
})
|
|
49
41
|
|
|
50
|
-
|
|
42
|
+
const getComponentClass = computed(() => {
|
|
43
|
+
return `psui-el-mini-tag-layout-${props.layout}`
|
|
44
|
+
})
|
|
45
|
+
</script>
|
|
51
46
|
|
|
47
|
+
<style>
|
|
48
|
+
/* Please, use the file src/assets/scss/components/PsMiniTag.scss */
|
|
49
|
+
</style>
|
|
@@ -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
|
-
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
|
-
}
|
|
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,13 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<button
|
|
3
|
-
@click="onClick()"
|
|
3
|
+
@click="onClick($event)"
|
|
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
9
|
<svg
|
|
10
|
-
v-if="loading"
|
|
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
13
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -37,74 +37,73 @@
|
|
|
37
37
|
</button>
|
|
38
38
|
</template>
|
|
39
39
|
|
|
40
|
-
<script setup
|
|
41
|
-
import {
|
|
40
|
+
<script setup>
|
|
41
|
+
import { computed, ref, } from 'vue'
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
const isHover = ref(false)
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
const emit = defineEmits(['click'])
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
83
|
-
|
|
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: '',
|
|
60
|
+
},
|
|
61
|
+
iconPosition: {
|
|
62
|
+
type: String,
|
|
63
|
+
default: 'left',
|
|
64
|
+
validator: (value) => ['left', 'right'].includes(value),
|
|
65
|
+
},
|
|
66
|
+
size: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: 'big',
|
|
69
|
+
validator: (value) => ['small', 'medium', 'big'].includes(value),
|
|
70
|
+
},
|
|
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
84
|
|
|
85
|
-
|
|
86
|
-
if(props.icon){
|
|
85
|
+
const getComponentClass = computed(() => {
|
|
86
|
+
if (props.icon) {
|
|
87
87
|
return `layout-${props.layout} size-${props.size} icon-${props.iconPosition}`
|
|
88
88
|
} else {
|
|
89
|
-
return `layout-${props.layout} size-${props.size}`
|
|
89
|
+
return `layout-${props.layout} size-${props.size}`
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
})
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
const onClick = (event) => {
|
|
94
94
|
if (props.disabled) return
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
emit('click', event)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const onMouseEnter = () => {
|
|
99
|
+
if (!props.disabled) {
|
|
99
100
|
isHover.value = true
|
|
100
101
|
}
|
|
101
|
-
|
|
102
|
+
}
|
|
102
103
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
104
|
+
const onMouseLeave = () => {
|
|
105
|
+
if (!props.disabled) {
|
|
106
|
+
isHover.value = false
|
|
107
107
|
}
|
|
108
|
-
|
|
108
|
+
}
|
|
109
109
|
</script>
|
|
110
|
-
|