@policystudio/policy-studio-ui-vue 1.0.27 → 1.0.28
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/dist/css/psui_styles.css +4752 -586
- package/package.json +1 -1
- package/src/assets/scss/base.scss +38 -3
- package/src/assets/scss/components/PsButton.scss +114 -120
- package/src/assets/scss/components/PsCardInfos.scss +26 -0
- package/src/assets/scss/components/PsChartLegend.scss +25 -0
- package/src/assets/scss/components/PsCheckbox.scss +96 -0
- package/src/assets/scss/components/PsChips.scss +155 -0
- package/src/assets/scss/components/PsClimateZoneBadge.scss +26 -0
- package/src/assets/scss/components/PsCostEffectBar.scss +31 -0
- package/src/assets/scss/components/PsDataTable.scss +50 -0
- package/src/assets/scss/components/PsDropdown.scss +44 -0
- package/src/assets/scss/components/PsHighlightRippleDot.scss +48 -0
- package/src/assets/scss/components/PsInlineSelector.scss +5 -0
- package/src/assets/scss/components/PsInputSelect.scss +62 -0
- package/src/assets/scss/components/PsInputTextArea.scss +49 -0
- package/src/assets/scss/components/PsProgressBar.scss +24 -0
- package/src/assets/scss/components/PsRadioButton.scss +78 -0
- package/src/assets/scss/components/PsSlider.scss +11 -0
- package/src/assets/scss/components/PsSwitch.scss +66 -0
- package/src/assets/scss/components/PsTabHeader.scss +10 -3
- package/src/assets/scss/components/PsToast.scss +52 -0
- package/src/assets/scss/components/PsToggle.scss +23 -0
- package/src/assets/scss/components/PsTooltip.scss +118 -0
- package/src/components/badges-and-tags/PsCardInfos.vue +14 -7
- package/src/components/badges-and-tags/PsChartLegend.vue +7 -13
- package/src/components/badges-and-tags/PsClimateZoneBadge.vue +15 -6
- package/src/components/badges-and-tags/PsCostEffectBar.Copy.vue +72 -0
- package/src/components/badges-and-tags/PsCostEffectBar.vue +33 -70
- package/src/components/badges-and-tags/PsHighlightRippleDot.vue +3 -69
- package/src/components/badges-and-tags/PsProgressBar.vue +42 -0
- package/src/components/buttons/PsButton.vue +74 -78
- package/src/components/chips/PsChips.vue +46 -87
- package/src/components/controls/PsCheckbox.vue +58 -134
- package/src/components/controls/PsInlineSelector.vue +15 -0
- package/src/components/controls/PsRadioButton.vue +33 -88
- package/src/components/controls/PsSlider.vue +4 -5
- package/src/components/controls/PsSwitch.vue +29 -81
- package/src/components/controls/PsToggle.vue +45 -39
- package/src/components/datatable/PsDataTable.vue +3 -15
- package/src/components/forms/PsDropdown.vue +27 -11
- package/src/components/forms/PsInputSelect.vue +80 -0
- package/src/components/forms/PsInputTextArea.vue +80 -0
- package/src/components/notifications/PsDialog.vue +3 -0
- package/src/components/notifications/PsToast.vue +13 -28
- package/src/components/tabs/PsTabHeader.vue +30 -12
- package/src/components/tooltip/PsDialogTooltip.vue +6 -31
- package/src/components/tooltip/PsRichTooltip.vue +37 -44
- package/src/components/tooltip/PsTooltip.vue +18 -28
- package/src/components/ui/PsIcon.vue +9 -9
- package/src/index.js +9 -0
- package/src/stories/Button.stories.js +102 -112
- package/src/stories/Checkbox.stories.js +34 -37
- package/src/stories/Chips.stories.js +43 -54
- package/src/stories/ClimateZoneBadge.stories.js +0 -7
- package/src/stories/InlineSelector.stories.js +16 -0
- package/src/stories/InputSelect.stories.js +22 -0
- package/src/stories/InputTextArea.stories.js +25 -0
- package/src/stories/RadioButton.stories.js +32 -29
- package/src/stories/Switch.stories.js +33 -0
- package/src/stories/Toast.stories.js +40 -46
- package/src/stories/Tooltip.stories.js +86 -86
- package/tailwind.config.js +7 -1
- package/src/assets/images/check-checkbox-button.svg +0 -1
- package/src/assets/images/radio-checked-button.svg +0 -1
- package/src/stories/Swith.stories.js +0 -38
|
@@ -1,39 +1,45 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="psui-
|
|
3
|
-
<button
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class="
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
this
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div class="psui-el-toggle" role="group">
|
|
3
|
+
<button
|
|
4
|
+
type="button"
|
|
5
|
+
v-for="(item, index) in items"
|
|
6
|
+
:key="index"
|
|
7
|
+
@click="selectOption(item)"
|
|
8
|
+
:class="{ 'status-active': getSelected === item }"
|
|
9
|
+
>
|
|
10
|
+
{{ item }}
|
|
11
|
+
</button>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
//FIGMA CONTROLS & SELECTORS https://www.figma.com/file/Tto8hrNlSfuPcwd1pfqogF/%E2%9A%A1%EF%B8%8F-Design-System?node-id=1768%3A64852
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
name: 'PsToggle',
|
|
20
|
+
props: {
|
|
21
|
+
items: {
|
|
22
|
+
type: Array,
|
|
23
|
+
required: true
|
|
24
|
+
},
|
|
25
|
+
selected: {},
|
|
26
|
+
},
|
|
27
|
+
computed: {
|
|
28
|
+
getSelected() {
|
|
29
|
+
if (this.selected) {
|
|
30
|
+
return this.selected
|
|
31
|
+
} else {
|
|
32
|
+
return false
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
methods: {
|
|
37
|
+
selectOption(item) {
|
|
38
|
+
this.$emit('update:selected', item)
|
|
39
|
+
this.$emit('change', item)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<style> /* Please, use the file src/assets/scss/components/PsToggle.scss */</style>
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<table :class='cssAlign' class=
|
|
2
|
+
<table :class='cssAlign' class="psui-el-table psui-table">
|
|
3
3
|
<thead v-if="header">
|
|
4
4
|
<th
|
|
5
5
|
v-for="head in header"
|
|
6
6
|
:key="head"
|
|
7
|
-
class='psui-bg-gray-10 psui-text-gray-80 psui-capitalize psui-font-bold'
|
|
8
7
|
>
|
|
9
8
|
{{ head }}
|
|
10
9
|
</th>
|
|
@@ -21,7 +20,7 @@
|
|
|
21
20
|
<th
|
|
22
21
|
v-for="ft in footer"
|
|
23
22
|
:key="ft"
|
|
24
|
-
class='psui-bg-gray-10 psui-text-gray-80'
|
|
23
|
+
class='psui-bg-gray-10 psui-text-gray-80 psui-font-normal'
|
|
25
24
|
>
|
|
26
25
|
{{ ft }}
|
|
27
26
|
</th>
|
|
@@ -75,15 +74,4 @@ export default {
|
|
|
75
74
|
},
|
|
76
75
|
}
|
|
77
76
|
</script>
|
|
78
|
-
|
|
79
|
-
<style scoped>
|
|
80
|
-
|
|
81
|
-
.table th,
|
|
82
|
-
.table td,
|
|
83
|
-
.table tr {
|
|
84
|
-
height: 40px;
|
|
85
|
-
border: 1px solid #e6ecf2;
|
|
86
|
-
padding: 11px 16px;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
</style>
|
|
77
|
+
<style> /* Please, use the file src/assets/scss/components/PsDataTable.scss */</style>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<div class="background-temporary">
|
|
2
3
|
<div
|
|
3
|
-
class="psui-
|
|
4
|
+
class="psui-el-dropdown-menu"
|
|
4
5
|
ref="PSDropdown"
|
|
5
6
|
>
|
|
6
7
|
|
|
@@ -12,7 +13,7 @@
|
|
|
12
13
|
v-else
|
|
13
14
|
@click="show && !toggleWhenActive ? '' : toggle()"
|
|
14
15
|
type="button"
|
|
15
|
-
class="psui-
|
|
16
|
+
class="psui-el-dropdown-menu-button"
|
|
16
17
|
:class="[buttonClasses]"
|
|
17
18
|
:id="id"
|
|
18
19
|
aria-haspopup="true"
|
|
@@ -26,19 +27,21 @@
|
|
|
26
27
|
<div
|
|
27
28
|
ref="PSDropdownDialog"
|
|
28
29
|
role="menu"
|
|
29
|
-
class="psui-dropdown-dialog
|
|
30
|
+
class="psui-el-dropdown-menu-dialog"
|
|
30
31
|
aria-orientation="vertical"
|
|
31
32
|
:aria-labelledby="id"
|
|
32
33
|
:class="[dialogClasses]"
|
|
33
34
|
:style="{ minWidth: minWidthDropdown, marginLeft: marginLeft }"
|
|
34
35
|
>
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
|
|
37
|
+
<div class="psui-el-dropdown-menu-dialog-category-divider">
|
|
38
|
+
<h2 class="ts--accent--1" v-if="title">{{ title }}</h2>
|
|
37
39
|
<slot name="items"></slot>
|
|
38
40
|
</div>
|
|
39
41
|
|
|
40
42
|
</div>
|
|
41
43
|
</div>
|
|
44
|
+
</div>
|
|
42
45
|
</template>
|
|
43
46
|
|
|
44
47
|
<script>
|
|
@@ -178,19 +181,32 @@ export default {
|
|
|
178
181
|
|
|
179
182
|
<style>
|
|
180
183
|
|
|
181
|
-
.
|
|
184
|
+
.background-temporary {
|
|
185
|
+
width: 300px;
|
|
186
|
+
height: 200px;
|
|
187
|
+
left: 0;
|
|
188
|
+
top: 8px;
|
|
189
|
+
|
|
190
|
+
background-color: #e6ecf2;
|
|
191
|
+
border: 1.5px dashed #7b61ff;
|
|
192
|
+
display: flex;
|
|
193
|
+
align-items: center;
|
|
194
|
+
justify-content: center;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/* .dropdown-button {
|
|
182
198
|
background-color: transparent;
|
|
183
199
|
padding-top: 2.5px;
|
|
184
200
|
padding-bottom: 2.5px;
|
|
185
201
|
min-height: 27px;
|
|
186
|
-
}
|
|
202
|
+
} */
|
|
187
203
|
|
|
188
|
-
.dropdown-button:focus {
|
|
204
|
+
/* .dropdown-button:focus {
|
|
189
205
|
outline: none;
|
|
190
|
-
}
|
|
206
|
+
} */
|
|
191
207
|
|
|
192
|
-
.psui-dropdown-dialog {
|
|
208
|
+
/* .psui-dropdown-dialog {
|
|
193
209
|
transition: opacity 150ms ease-in-out;
|
|
194
|
-
}
|
|
210
|
+
} */
|
|
195
211
|
|
|
196
212
|
</style>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="psui-el-input-select" :class="[{'disabled':disabled}, {'selected':selectedClass}]">
|
|
3
|
+
<label :for='label' v-if="label" >{{ label }}</label>
|
|
4
|
+
<select
|
|
5
|
+
:name="label"
|
|
6
|
+
:id="label"
|
|
7
|
+
v-model="childValue"
|
|
8
|
+
>
|
|
9
|
+
<option value='' disabled>Select</option>
|
|
10
|
+
<option v-for="item in getItems" :value="item[keyValue]" :key="item[keyValue]">{{ item[keyLabel] }}</option>
|
|
11
|
+
</select>
|
|
12
|
+
<p v-if="optionalLabel && !disabled" class="psui-el-input-helper">{{ optionalLabel }}</p>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
name: 'PsSelectInput',
|
|
20
|
+
props: {
|
|
21
|
+
items: {
|
|
22
|
+
required: true
|
|
23
|
+
},
|
|
24
|
+
value: {
|
|
25
|
+
default: '',
|
|
26
|
+
required: true
|
|
27
|
+
},
|
|
28
|
+
label: {
|
|
29
|
+
default: ''
|
|
30
|
+
},
|
|
31
|
+
optionalLabel:{
|
|
32
|
+
default:''
|
|
33
|
+
},
|
|
34
|
+
keyLabel: {
|
|
35
|
+
default: 'label'
|
|
36
|
+
},
|
|
37
|
+
keyValue: {
|
|
38
|
+
default: 'value'
|
|
39
|
+
},
|
|
40
|
+
disabled: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
data(){
|
|
46
|
+
return {
|
|
47
|
+
selectedClass: false,
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
computed: {
|
|
51
|
+
childValue: {
|
|
52
|
+
get() {
|
|
53
|
+
return this.value
|
|
54
|
+
},
|
|
55
|
+
set(value) {
|
|
56
|
+
if(this.isString) return this.$emit('input', value)
|
|
57
|
+
const finded = find(this.items, { [this.keyValue]: value })
|
|
58
|
+
this.$emit('input', value)
|
|
59
|
+
this.$emit('change', finded)
|
|
60
|
+
this.selectedClass = true
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
isString() {
|
|
64
|
+
return this.items.length > 0 && typeof this.items[0] === 'string'
|
|
65
|
+
},
|
|
66
|
+
getItems() {
|
|
67
|
+
if (this.items.length > 0 && typeof this.items[0] === 'string') {
|
|
68
|
+
return this.items.map((item) => {
|
|
69
|
+
return {
|
|
70
|
+
[this.keyLabel]: item,
|
|
71
|
+
[this.keyValue]: item,
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
} else {
|
|
75
|
+
return this.items
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
}
|
|
80
|
+
</script>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="psui-el-input-textarea" :class="[{'disabled':disabled}]">
|
|
3
|
+
<div class="psui-el-input-textarea-wrapper">
|
|
4
|
+
<label :for="label" v-if="label">{{label}}</label>
|
|
5
|
+
<textarea
|
|
6
|
+
:id="label"
|
|
7
|
+
:autocapitalize="autocapitalize"
|
|
8
|
+
:aria-required="required"
|
|
9
|
+
:value="value"
|
|
10
|
+
@blur="onBlur"
|
|
11
|
+
@focus="onFocus"
|
|
12
|
+
@input="onInput"
|
|
13
|
+
:rows="rows"
|
|
14
|
+
:placeholder="placeholder"
|
|
15
|
+
:readonly='disabled'
|
|
16
|
+
/>
|
|
17
|
+
</div>
|
|
18
|
+
<p class="psui-el-input-textarea-message" v-if="optionalLabel && !disabled">{{optionalLabel}}</p>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script>
|
|
23
|
+
export default {
|
|
24
|
+
name: "PsInputTextArea",
|
|
25
|
+
props: {
|
|
26
|
+
placeholder: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: ''
|
|
29
|
+
},
|
|
30
|
+
value: {
|
|
31
|
+
required: true,
|
|
32
|
+
},
|
|
33
|
+
label: {
|
|
34
|
+
type: String,
|
|
35
|
+
},
|
|
36
|
+
optionalLabel:{
|
|
37
|
+
type: String,
|
|
38
|
+
},
|
|
39
|
+
action: {
|
|
40
|
+
type: Function,
|
|
41
|
+
required: false
|
|
42
|
+
},
|
|
43
|
+
required:{
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default:true
|
|
46
|
+
},
|
|
47
|
+
autocapitalize: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: 'sentences'
|
|
50
|
+
},
|
|
51
|
+
autocomplete: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: true
|
|
54
|
+
},
|
|
55
|
+
rows: {
|
|
56
|
+
type: Number,
|
|
57
|
+
default: 5
|
|
58
|
+
},
|
|
59
|
+
disabled: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: false,
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
methods: {
|
|
65
|
+
makeAction() {
|
|
66
|
+
if(this.action && typeof(this.action) == 'function') this.action()
|
|
67
|
+
},
|
|
68
|
+
onBlur(){
|
|
69
|
+
this.$emit('blur', this.$event)
|
|
70
|
+
},
|
|
71
|
+
onFocus(){
|
|
72
|
+
this.$emit('focus',this.$event)
|
|
73
|
+
},
|
|
74
|
+
onInput(){
|
|
75
|
+
this.$emit('input', this.$event)
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
</script>
|
|
80
|
+
|
|
@@ -1,53 +1,38 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
<div class="psui-
|
|
2
|
+
<div class='psui-el-toast' :class="getComponentClass">
|
|
3
|
+
<i class="material-icons-round psui-el-toast-icon">{{ icon }}</i>
|
|
4
|
+
<p class="psui-el-toast-message">{{ message }}</p>
|
|
5
|
+
<div class="psui-el-toast-actions">
|
|
6
6
|
<slot></slot>
|
|
7
7
|
</div>
|
|
8
8
|
</div>
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
11
|
<script>
|
|
12
|
-
export const typeOptions = ['info', 'success', 'warning', 'error']
|
|
13
|
-
export const fillOptions = ['soft', 'intense']
|
|
14
12
|
export default {
|
|
15
13
|
name: 'PsToast',
|
|
16
14
|
props: {
|
|
17
|
-
|
|
15
|
+
layout: {
|
|
18
16
|
type: String,
|
|
19
17
|
default: 'info',
|
|
20
|
-
validator: (value) =>
|
|
18
|
+
validator: (value) => ['info', 'success', 'warning', 'error'].includes(value)
|
|
21
19
|
},
|
|
22
20
|
fill: {
|
|
23
21
|
type: String,
|
|
24
22
|
default: 'intense',
|
|
25
|
-
validator: (value) =>
|
|
23
|
+
validator: (value) => ['soft', 'intense'].includes(value)
|
|
26
24
|
},
|
|
27
25
|
message: {
|
|
28
26
|
type: String,
|
|
29
|
-
|
|
27
|
+
},
|
|
28
|
+
icon:{
|
|
29
|
+
type: String,
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
computed: {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (this.type === 'success') return 'check_circle'
|
|
36
|
-
return 'warning'
|
|
37
|
-
},
|
|
38
|
-
cssClass() {
|
|
39
|
-
const colors = {
|
|
40
|
-
info: 'blue-60',
|
|
41
|
-
success: 'green-20',
|
|
42
|
-
warning: 'yellow-20',
|
|
43
|
-
error: 'red-20'
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const textColor = this.fill === 'intense' ? 'white': colors[this.type]
|
|
47
|
-
const background = this.fill === 'soft'? `${colors[this.type].split('-', 1)}-10` : colors[this.type]
|
|
48
|
-
|
|
49
|
-
return `psui-font-bold psui-shadow-md psui-rounded-md psui-p-3 psui-h-12 psui-flex psui-bg-${background} psui-text-${textColor}`
|
|
33
|
+
getComponentClass(){
|
|
34
|
+
return `layout-${this.layout} fill-${this.fill}`
|
|
50
35
|
}
|
|
51
|
-
}
|
|
36
|
+
},
|
|
52
37
|
}
|
|
53
38
|
</script>
|
|
@@ -5,22 +5,31 @@
|
|
|
5
5
|
role="group"
|
|
6
6
|
>
|
|
7
7
|
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
<template v-for="item in getItems">
|
|
9
|
+
<slot v-bind:item="item" >
|
|
10
|
+
<button
|
|
11
|
+
:key="item[keyValue]"
|
|
12
|
+
type="button"
|
|
13
|
+
@click="selectTab(item)"
|
|
14
|
+
:class="getButtonClass(item)"
|
|
15
|
+
>
|
|
16
|
+
<PsRichTooltip v-if="item.tooltip" :title="item.tooltip" type="blue">
|
|
17
|
+
<template v-slot:trigger>
|
|
18
|
+
<span>{{ item[keyLabel] }}</span>
|
|
19
|
+
</template>
|
|
20
|
+
</PsRichTooltip>
|
|
21
|
+
<span v-else>{{ item[keyLabel] }}</span>
|
|
22
|
+
</button>
|
|
23
|
+
</slot>
|
|
24
|
+
</template>
|
|
18
25
|
</div>
|
|
19
26
|
</template>
|
|
20
27
|
|
|
21
28
|
<script>
|
|
29
|
+
import PsRichTooltip from '../tooltip/PsRichTooltip.vue'
|
|
22
30
|
export default {
|
|
23
31
|
name: 'PsTabHeader',
|
|
32
|
+
components: { PsRichTooltip },
|
|
24
33
|
props: {
|
|
25
34
|
layout: {
|
|
26
35
|
type: String,
|
|
@@ -82,8 +91,17 @@ export default {
|
|
|
82
91
|
},
|
|
83
92
|
methods: {
|
|
84
93
|
selectTab(item) {
|
|
85
|
-
|
|
86
|
-
|
|
94
|
+
if (item.disabled !== true) {
|
|
95
|
+
this.$emit('update:selected', this.getIsObject ? item : item[this.keyValue] )
|
|
96
|
+
this.$emit('change', this.getIsObject ? item : item[this.keyValue])
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
getButtonClass(item) {
|
|
100
|
+
if (item.disabled) {
|
|
101
|
+
return ['status-disabled']
|
|
102
|
+
} else {
|
|
103
|
+
return { 'status-active': this.getSelected === item[this.keyValue], 'status-enabled' : true }
|
|
104
|
+
}
|
|
87
105
|
}
|
|
88
106
|
}
|
|
89
107
|
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<PsTooltip :cssClass="
|
|
2
|
+
<PsTooltip :layout="layout" :cssClass="cssClass" :title="title">
|
|
3
3
|
<template v-slot:trigger>
|
|
4
|
-
<slot></slot>
|
|
4
|
+
<slot name="trigger"></slot>
|
|
5
5
|
</template>
|
|
6
6
|
<template
|
|
7
|
-
v-slot:
|
|
8
|
-
class="psui-flex psui-fkex-col psui-gap-3 psui-items-start"
|
|
7
|
+
v-slot:content
|
|
9
8
|
>
|
|
10
|
-
<
|
|
9
|
+
<slot name="content"></slot>
|
|
11
10
|
<button
|
|
12
11
|
v-if="buttonText"
|
|
13
|
-
class="psui-py-2 psui-px-4 psui-rounded-md"
|
|
14
|
-
:class="getCssClass.button"
|
|
15
12
|
@click="onClick"
|
|
16
13
|
>
|
|
17
14
|
{{ buttonText }}
|
|
@@ -36,7 +33,7 @@ export default {
|
|
|
36
33
|
buttonText: {
|
|
37
34
|
type: String,
|
|
38
35
|
},
|
|
39
|
-
|
|
36
|
+
layout: {
|
|
40
37
|
type: String,
|
|
41
38
|
default: "white",
|
|
42
39
|
validator: (value) => ["white", "dark", "color"].includes(value),
|
|
@@ -47,33 +44,11 @@ export default {
|
|
|
47
44
|
},
|
|
48
45
|
},
|
|
49
46
|
emits: ["click"],
|
|
50
|
-
computed: {
|
|
51
|
-
getCssClass() {
|
|
52
|
-
|
|
53
|
-
if (this.type === "dark")
|
|
54
|
-
return {
|
|
55
|
-
content: `psui-bg-blue-70 psui-text-white ${this.cssClass}`,
|
|
56
|
-
button: `psui-bg-blue-60 psui-text-white`,
|
|
57
|
-
}
|
|
58
|
-
if (this.type === "color")
|
|
59
|
-
return {
|
|
60
|
-
content: `psui-bg-blue-50 psui-text-white ${this.cssClass}`,
|
|
61
|
-
button: `psui-bg-blue-60 psui-text-white`,
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return { content: `psui-bg-white psui-text-gray-80 ${this.cssClass}`, button: `psui-bg-blue-20 psui-text-blue-60`,}
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
47
|
methods: {
|
|
68
48
|
onClick() {
|
|
69
|
-
this.$emit("click")
|
|
49
|
+
this.$emit("click", this.$event)
|
|
70
50
|
},
|
|
71
51
|
},
|
|
72
52
|
}
|
|
73
53
|
</script>
|
|
74
54
|
|
|
75
|
-
<style scoped>
|
|
76
|
-
button {
|
|
77
|
-
width: fit-content;
|
|
78
|
-
}
|
|
79
|
-
</style>>
|
|
@@ -1,44 +1,37 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<PsTooltip :
|
|
3
|
-
<template v-slot:trigger>
|
|
4
|
-
<slot></slot>
|
|
5
|
-
</template>
|
|
6
|
-
<template v-slot:
|
|
7
|
-
<
|
|
8
|
-
</template>
|
|
9
|
-
</PsTooltip>
|
|
10
|
-
</template>
|
|
11
|
-
|
|
12
|
-
<script>
|
|
13
|
-
import PsTooltip from "../tooltip/PsTooltip.vue"
|
|
14
|
-
|
|
15
|
-
export default {
|
|
16
|
-
name: "PsRichTooltip",
|
|
17
|
-
components: { PsTooltip },
|
|
18
|
-
props: {
|
|
19
|
-
title: {
|
|
20
|
-
type: String,
|
|
21
|
-
default: "",
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
type: String,
|
|
25
|
-
default: "gray",
|
|
26
|
-
validator: (type) => ["gray", "red", "blue"].includes(type),
|
|
27
|
-
},
|
|
28
|
-
text: {
|
|
29
|
-
type: String,
|
|
30
|
-
},
|
|
31
|
-
cssClass: {
|
|
32
|
-
type: String,
|
|
33
|
-
default: "",
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (this.type === "red") return `psui-text-red-70 psui-bg-red-10 `
|
|
39
|
-
if (this.type === "blue") return `psui-bg-blue-70 psui-text-white`
|
|
40
|
-
return `psui-text-gray-80 psui-bg-gray-30 `
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
}
|
|
44
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<PsTooltip :layout="layout" :title="title" :cssClass="cssClass">
|
|
3
|
+
<template v-slot:trigger>
|
|
4
|
+
<slot name="trigger"></slot>
|
|
5
|
+
</template>
|
|
6
|
+
<template v-slot:content>
|
|
7
|
+
<slot name="content"></slot>
|
|
8
|
+
</template>
|
|
9
|
+
</PsTooltip>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
import PsTooltip from "../tooltip/PsTooltip.vue"
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
name: "PsRichTooltip",
|
|
17
|
+
components: { PsTooltip },
|
|
18
|
+
props: {
|
|
19
|
+
title: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: "",
|
|
22
|
+
},
|
|
23
|
+
layout: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: "gray",
|
|
26
|
+
validator: (type) => ["gray", "red", "blue"].includes(type),
|
|
27
|
+
},
|
|
28
|
+
text: {
|
|
29
|
+
type: String,
|
|
30
|
+
},
|
|
31
|
+
cssClass: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
</script>
|