@policystudio/policy-studio-ui-vue 1.0.20 → 1.0.24
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/.storybook/main.js +9 -1
- package/dist/css/psui_styles.css +15690 -14620
- package/package.json +8 -3
- package/postcss.config.js +2 -0
- package/src/assets/scss/base.scss +10 -3
- package/src/assets/scss/components/PsAccordion.scss +63 -0
- package/src/assets/scss/components/PsButton.scss +145 -0
- package/src/assets/scss/components/PsInput.scss +104 -0
- package/src/components/accordion/PsAccordion.vue +30 -29
- package/src/components/accordion/PsAccordionItem.vue +29 -67
- package/src/components/badges-and-tags/PsCardInfos.vue +38 -0
- package/src/components/badges-and-tags/PsChartLegend.vue +43 -0
- package/src/components/badges-and-tags/PsClimateZoneBadge.vue +18 -0
- package/src/components/badges-and-tags/PsCostEffectBar.vue +114 -0
- package/src/components/badges-and-tags/PsHighlightRippleDot.vue +78 -0
- package/src/components/badges-and-tags/PsMiniTag.vue +46 -0
- package/src/components/badges-and-tags/PsProgressBar.vue +0 -0
- package/src/components/buttons/PsButton.vue +42 -94
- package/src/components/chips/PsChips.vue +10 -20
- package/src/components/controls/PsCheckbox.vue +29 -16
- package/src/components/controls/PsDraggable.vue +171 -25
- package/src/components/controls/PsRadioButton.vue +25 -19
- package/src/components/controls/PsToggle.vue +1 -1
- package/src/components/forms/PsInput.vue +122 -102
- package/src/components/notifications/PsDialog.vue +37 -18
- package/src/components/tabs/PsTabHeader.vue +3 -2
- package/src/components/tooltip/PsRichTooltip.vue +6 -0
- package/src/components/tooltip/PsTooltip.vue +1 -3
- package/src/index.js +15 -9
- package/src/stories/Accordion.stories.js +88 -28
- package/src/stories/Button.stories.js +83 -35
- package/src/stories/CardInfos.stories.js +16 -0
- package/src/stories/ChartLegend.stories.js +16 -0
- package/src/stories/Chips.stories.js +7 -1
- package/src/stories/ClimateZoneBadge.stories.js +24 -0
- package/src/stories/Colors.stories.mdx +1 -1
- package/src/stories/CostEffectBar.stories.js +23 -0
- package/src/stories/Dialog.stories.js +141 -8
- package/src/stories/Draggable.stories.js +4 -6
- package/src/stories/Dropdown.stories.js +3 -5
- package/src/stories/HighlightRippleDot.stories.js +16 -0
- package/src/stories/Input.stories.js +61 -9
- package/src/stories/MiniTag.stories.js +46 -0
- package/src/stories/ProgressBar.stories.js +23 -0
- package/src/stories/RadioButton.stories.js +2 -2
- package/src/stories/Toggle.stories.js +7 -8
- package/src/stories/Tooltip.stories.js +5 -4
- package/src/util/GeneralFunctions.js +6 -7
- package/src/util/imageLoader.js +1 -1
- package/tailwind.config.js +71 -48
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@policystudio/policy-studio-ui-vue",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.24",
|
|
4
4
|
"description": "Policy Studio UI",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "Policy Studio Team",
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"storybook": "start-storybook -p 6006",
|
|
16
16
|
"build-storybook": "build-storybook",
|
|
17
17
|
"build-tailwind": "postcss src/assets/scss/base.scss -o dist/css/psui_styles.css",
|
|
18
|
-
"publish": "npm run lint && npm run build-tailwind && npm publish"
|
|
18
|
+
"publish": "npm run lint && npm run build-tailwind && npm publish",
|
|
19
|
+
"dev": "watch 'npm run build-tailwind' ./src/assets"
|
|
19
20
|
},
|
|
20
21
|
"dependencies": {
|
|
21
22
|
"core-js": "^3.6.5",
|
|
@@ -26,6 +27,7 @@
|
|
|
26
27
|
"@storybook/addon-actions": "^6.4.13",
|
|
27
28
|
"@storybook/addon-essentials": "^6.4.13",
|
|
28
29
|
"@storybook/addon-links": "^6.4.13",
|
|
30
|
+
"@storybook/addon-postcss": "^2.0.0",
|
|
29
31
|
"@storybook/vue": "^6.4.13",
|
|
30
32
|
"@vue/cli-plugin-babel": "~4.5.0",
|
|
31
33
|
"@vue/cli-plugin-eslint": "~4.5.0",
|
|
@@ -38,9 +40,12 @@
|
|
|
38
40
|
"eslint-plugin-vue": "^6.2.2",
|
|
39
41
|
"postcss": "^8.3.11",
|
|
40
42
|
"postcss-cli": "^9.0.2",
|
|
43
|
+
"postcss-import": "^14.0.2",
|
|
44
|
+
"postcss-nested": "^5.0.6",
|
|
41
45
|
"prettier": "^2.2.1",
|
|
42
46
|
"tailwindcss": "^1.9.6",
|
|
43
47
|
"vue-loader": "^15.9.8",
|
|
44
|
-
"vue-template-compiler": "^2.6.11"
|
|
48
|
+
"vue-template-compiler": "^2.6.11",
|
|
49
|
+
"watch": "^1.0.2"
|
|
45
50
|
}
|
|
46
51
|
}
|
package/postcss.config.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
@tailwind base;
|
|
2
|
-
@tailwind components;
|
|
3
|
-
@tailwind utilities;
|
|
4
1
|
@import url('https://fonts.googleapis.com/icon?family=Material+Icons|Material+Icons+Round');
|
|
2
|
+
@import './components/PsAccordion.scss';
|
|
3
|
+
@import './components/PsInput.scss';
|
|
4
|
+
@import './components/PsButton.scss';
|
|
5
|
+
@import "tailwindcss/base";
|
|
6
|
+
@import "tailwindcss/components";
|
|
7
|
+
@import "tailwindcss/utilities";
|
|
5
8
|
|
|
6
9
|
*:focus {
|
|
7
10
|
outline: none;
|
|
@@ -9,4 +12,8 @@
|
|
|
9
12
|
html {
|
|
10
13
|
-webkit-font-smoothing: antialiased;
|
|
11
14
|
-moz-osx-font-smoothing: grayscale;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.transition-default {
|
|
18
|
+
transition: cubic-bezier(.17,.67,.83,.67) 250ms;
|
|
12
19
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
@layer components{
|
|
2
|
+
|
|
3
|
+
.psui-el-accordion {
|
|
4
|
+
|
|
5
|
+
&-item {
|
|
6
|
+
border-bottom: 1px solid #e6ecf2;
|
|
7
|
+
|
|
8
|
+
&-header {
|
|
9
|
+
@apply psui-flex psui-cursor-pointer psui-transition-all psui-justify-between transition-default;
|
|
10
|
+
padding-top: 16px;
|
|
11
|
+
padding-bottom: 16px;
|
|
12
|
+
&:hover {
|
|
13
|
+
@apply psui-text-blue-60;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&-content {
|
|
18
|
+
padding-bottom: 24px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&-icon {
|
|
22
|
+
font-size: 20px;
|
|
23
|
+
width: 20px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&.layout-big {
|
|
29
|
+
.psui-el-accordion-item {
|
|
30
|
+
&-header, &-content {
|
|
31
|
+
padding-left: 16px;
|
|
32
|
+
padding-right: 16px;
|
|
33
|
+
}
|
|
34
|
+
&-title {
|
|
35
|
+
@apply psui-text-h5 psui-font-bold;
|
|
36
|
+
}
|
|
37
|
+
&-icon {
|
|
38
|
+
@apply psui-text-gray-30
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&.layout-medium {
|
|
44
|
+
.psui-el-accordion-item {
|
|
45
|
+
&-title {
|
|
46
|
+
@apply psui-text-small psui-font-bold;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.psui-el-accordion-item {
|
|
52
|
+
&.status-opened, &-header:hover {
|
|
53
|
+
.psui-el-accordion-item-icon {
|
|
54
|
+
@apply psui-text-blue-60;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
|
|
3
|
+
.psui-el-button {
|
|
4
|
+
|
|
5
|
+
@apply psui-font-bold psui-items-center psui-flex psui-content-center psui-rounded-md transition-default;
|
|
6
|
+
|
|
7
|
+
span {
|
|
8
|
+
@apply psui-font-bold;
|
|
9
|
+
line-height: 130%;
|
|
10
|
+
font-family: inherit;
|
|
11
|
+
text-align: right;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&:focus {
|
|
15
|
+
outline: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&.right {
|
|
19
|
+
@apply psui-flex-row-reverse;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&.big {
|
|
23
|
+
@apply psui-flex psui-items-center psui-content-center;
|
|
24
|
+
padding: 9.5px 16px;
|
|
25
|
+
font-size: 16px;
|
|
26
|
+
|
|
27
|
+
&.left i {
|
|
28
|
+
font-size: 24px;
|
|
29
|
+
margin-right: 8px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&.right i {
|
|
33
|
+
font-size: 24px;
|
|
34
|
+
margin-left: 8px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&.medium {
|
|
40
|
+
|
|
41
|
+
@apply psui-flex psui-items-center psui-content-center;
|
|
42
|
+
padding: 7px 16px;
|
|
43
|
+
font-size: 14px;
|
|
44
|
+
|
|
45
|
+
&.left i {
|
|
46
|
+
font-size: 18px;
|
|
47
|
+
margin-right: 4px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&.right i {
|
|
51
|
+
font-size: 18px;
|
|
52
|
+
margin-left: 4px;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&.small {
|
|
57
|
+
|
|
58
|
+
@apply psui-flex psui-items-center psui-content-center;
|
|
59
|
+
padding: 4px 8px;
|
|
60
|
+
font-size: 14px;
|
|
61
|
+
|
|
62
|
+
&.active {
|
|
63
|
+
@apply psui-bg-blue-20 psui-text-blue-60;
|
|
64
|
+
box-shadow: inset 0px 1px 2px rgba(0,0,0,0.05);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&.hover.layout-onlytext {
|
|
68
|
+
@apply psui-text-blue-60 psui-bg-blue-20 !important;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&.left {
|
|
72
|
+
i {
|
|
73
|
+
font-size: 18px;
|
|
74
|
+
margin-right: 4px;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&.right {
|
|
79
|
+
i {
|
|
80
|
+
font-size: 18px;
|
|
81
|
+
margin-left: 4px;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&.layout-solid {
|
|
88
|
+
|
|
89
|
+
@apply psui-bg-blue-60 psui-text-white;
|
|
90
|
+
|
|
91
|
+
&.hover {
|
|
92
|
+
@apply psui-bg-blue-50 psui-text-white;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&.active {
|
|
96
|
+
@apply psui-bg-blue-50 psui-text-white;
|
|
97
|
+
box-shadow: inset 0px 1px 2px rgba(0,0,0,0.15);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&.disabled {
|
|
101
|
+
@apply psui-text-gray-40 psui-bg-gray-20 psui-cursor-default
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&.layout-outline {
|
|
106
|
+
|
|
107
|
+
@apply psui-text-blue-60 psui-border psui-border-blue-50;
|
|
108
|
+
background: transparent;
|
|
109
|
+
|
|
110
|
+
&.hover,
|
|
111
|
+
&.active {
|
|
112
|
+
@apply psui-border psui-border-blue-60
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&.disabled {
|
|
116
|
+
@apply psui-text-gray-40 psui-border-gray-30 psui-cursor-default;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&.layout-ghost {
|
|
121
|
+
|
|
122
|
+
@apply psui-bg-blue-20 psui-text-blue-60;
|
|
123
|
+
&.hover,
|
|
124
|
+
&.active {
|
|
125
|
+
@apply psui-bg-blue-10
|
|
126
|
+
}
|
|
127
|
+
&.disabled {
|
|
128
|
+
@apply psui-text-gray-40 psui-bg-gray-20 psui-cursor-default
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&.layout-onlytext {
|
|
133
|
+
|
|
134
|
+
@apply psui-bg-white psui-text-blue-60;
|
|
135
|
+
|
|
136
|
+
&.disabled {
|
|
137
|
+
@apply psui-text-gray-40 psui-cursor-default
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&.hover {
|
|
141
|
+
@apply psui-text-blue-50
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
@layer components{
|
|
2
|
+
|
|
3
|
+
.psui-el-input {
|
|
4
|
+
|
|
5
|
+
&-prepend {
|
|
6
|
+
@apply psui-pl-2 psui-flex psui-items-center psui-pointer-events-none
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
&-append {
|
|
10
|
+
@apply psui-pr-2 psui-flex psui-items-center
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&-hint {
|
|
14
|
+
@apply psui-text-gray-50 psui-text-xsmall psui-mt-1
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&-wrapper {
|
|
18
|
+
@apply psui-relative psui-w-full psui-border psui-border-gray-30 psui-rounded-md psui-bg-white psui-flex transition-default
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
label {
|
|
22
|
+
@apply psui-font-bold psui-text-gray-80
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
input {
|
|
26
|
+
@apply psui-bg-white psui-text-gray-60 psui-w-full psui-rounded-md
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&.status-error {
|
|
30
|
+
.psui-el-input-wrapper {
|
|
31
|
+
@apply psui-border-red-20
|
|
32
|
+
}
|
|
33
|
+
.psui-el-input-hint {
|
|
34
|
+
@apply psui-text-red-20
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&.status-disabled {
|
|
39
|
+
.psui-el-input-wrapper {
|
|
40
|
+
@apply psui-bg-gray-20 psui-border-gray-20
|
|
41
|
+
}
|
|
42
|
+
input {
|
|
43
|
+
@apply psui-bg-gray-20 psui-text-gray-40
|
|
44
|
+
}
|
|
45
|
+
label {
|
|
46
|
+
@apply psui-text-gray-40
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Layout Default */
|
|
51
|
+
/* ----------------------------------------- */
|
|
52
|
+
|
|
53
|
+
&.layout-default {
|
|
54
|
+
|
|
55
|
+
input {
|
|
56
|
+
@apply psui-text-p;
|
|
57
|
+
padding: 11.5px 16px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&.status-resting {
|
|
61
|
+
.psui-el-input-wrapper.hover {
|
|
62
|
+
@apply psui-border-blue-50
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&.status-active {
|
|
67
|
+
.psui-el-input-wrapper {
|
|
68
|
+
@apply psui-border-blue-60
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
}
|
|
73
|
+
/* ----------------------------------------- Layout Default */
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
/* Layout Mini */
|
|
77
|
+
/* ----------------------------------------- */
|
|
78
|
+
&.layout-mini {
|
|
79
|
+
input {
|
|
80
|
+
@apply psui-text-small;
|
|
81
|
+
padding: 7px 8px;
|
|
82
|
+
}
|
|
83
|
+
&.status-resting {
|
|
84
|
+
.psui-el-input-wrapper.hover {
|
|
85
|
+
@apply psui-border-green-20
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
&.status-active {
|
|
89
|
+
.psui-el-input-wrapper {
|
|
90
|
+
@apply psui-border-green-20;
|
|
91
|
+
input {
|
|
92
|
+
@apply psui-text-green-20;
|
|
93
|
+
&.focus {
|
|
94
|
+
@apply psui-text-gray-60
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/* ----------------------------------------- Layout Mini */
|
|
101
|
+
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
}
|
|
@@ -1,44 +1,45 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
2
|
+
<div class="psui-el-accordion" :class="`layout-${layout}`">
|
|
3
|
+
<slot></slot>
|
|
4
4
|
</div>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script>
|
|
8
|
-
export const
|
|
9
|
-
|
|
8
|
+
export const layouts = ['big', 'medium']
|
|
9
|
+
export const defaultIconsByLayout = {
|
|
10
|
+
big: {
|
|
11
|
+
'iconOpened': 'remove',
|
|
12
|
+
'iconClosed': 'add'
|
|
13
|
+
},
|
|
14
|
+
medium: {
|
|
15
|
+
'iconOpened': 'expand_less',
|
|
16
|
+
'iconClosed': 'expand_more'
|
|
17
|
+
}
|
|
18
|
+
}
|
|
10
19
|
export default {
|
|
11
|
-
name:
|
|
20
|
+
name: 'PsAccordion',
|
|
12
21
|
props: {
|
|
13
|
-
|
|
22
|
+
layout: {
|
|
14
23
|
type: String,
|
|
15
24
|
default: 'medium',
|
|
16
|
-
required: true
|
|
25
|
+
required: true,
|
|
26
|
+
validator: (value) => layouts.indexOf(value) !== -1,
|
|
27
|
+
},
|
|
28
|
+
'iconOpened': {
|
|
29
|
+
type: String,
|
|
30
|
+
},
|
|
31
|
+
'iconClosed': {
|
|
32
|
+
type: String,
|
|
17
33
|
}
|
|
18
34
|
},
|
|
19
|
-
computed:{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
35
|
+
computed: {
|
|
36
|
+
getIcons() {
|
|
37
|
+
return {
|
|
38
|
+
'iconOpened' : this.iconOpened ?? defaultIconsByLayout[this.layout].iconOpened,
|
|
39
|
+
'iconClosed' : this.iconClosed ?? defaultIconsByLayout[this.layout].iconClosed,
|
|
40
|
+
}
|
|
23
41
|
}
|
|
24
42
|
}
|
|
25
|
-
|
|
26
43
|
}
|
|
27
44
|
</script>
|
|
28
|
-
<style
|
|
29
|
-
.medium {
|
|
30
|
-
width: 390px;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.big {
|
|
34
|
-
width: 580px;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.accordion {
|
|
38
|
-
display: flex;
|
|
39
|
-
flex-direction: column;
|
|
40
|
-
border-right:1px solid #e6ecf2;
|
|
41
|
-
border-left:1px solid #e6ecf2;
|
|
42
|
-
border-top:1px solid #e6ecf2;
|
|
43
|
-
}
|
|
44
|
-
</style>
|
|
45
|
+
<style> /* Please, use the file src/assets/scss/components/PsAccordion.scss */</style>
|
|
@@ -1,34 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="
|
|
3
|
-
<div
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class="
|
|
7
|
-
psui-flex psui-cursor-pointer psui-transition-all psui-justify-between
|
|
8
|
-
"
|
|
9
|
-
>
|
|
10
|
-
<div
|
|
11
|
-
v-if="title"
|
|
12
|
-
:class="display ? 'selected' : ''"
|
|
13
|
-
class="psui-font-bold psui-gray04"
|
|
14
|
-
>
|
|
15
|
-
{{ title }}
|
|
16
|
-
</div>
|
|
17
|
-
<span v-if="!display" class="material-icons">{{ iconClass.closed }}</span>
|
|
18
|
-
<span v-else :class="display ? 'selected' : ''" class="material-icons">{{
|
|
19
|
-
iconClass.open
|
|
20
|
-
}}</span>
|
|
2
|
+
<div class="psui-el-accordion-item" :class="`status-${isOpen ? 'opened' : 'closed'}`">
|
|
3
|
+
<div @click="toggle" class="psui-el-accordion-item-header">
|
|
4
|
+
<h2 v-if="title" class="psui-el-accordion-item-title">{{ title }}</h2>
|
|
5
|
+
<i class="psui-el-accordion-item-icon material-icons">{{ getIcon }}</i>
|
|
21
6
|
</div>
|
|
22
|
-
<div v-if="
|
|
7
|
+
<div v-if="isOpen" class="psui-el-accordion-item-content">
|
|
23
8
|
<slot></slot>
|
|
24
9
|
</div>
|
|
25
10
|
</div>
|
|
26
11
|
</template>
|
|
27
12
|
|
|
28
13
|
<script>
|
|
29
|
-
export const iconTypes = ["mathsign", "chevron"]
|
|
30
|
-
export const fontCss = ["medium", "big"]
|
|
31
|
-
|
|
32
14
|
export default {
|
|
33
15
|
name: "PsAccordionItem",
|
|
34
16
|
props: {
|
|
@@ -36,67 +18,47 @@ export default {
|
|
|
36
18
|
type: String,
|
|
37
19
|
required: true,
|
|
38
20
|
},
|
|
39
|
-
|
|
21
|
+
'iconOpened': {
|
|
40
22
|
type: String,
|
|
41
|
-
required: true,
|
|
42
|
-
default: "chevron",
|
|
43
23
|
},
|
|
44
|
-
|
|
24
|
+
'iconClosed': {
|
|
45
25
|
type: String,
|
|
46
|
-
default: "medium",
|
|
47
26
|
},
|
|
27
|
+
opened: {
|
|
28
|
+
type: [Boolean],
|
|
29
|
+
default: false
|
|
30
|
+
}
|
|
48
31
|
},
|
|
49
32
|
data() {
|
|
50
33
|
return {
|
|
51
|
-
|
|
34
|
+
localOpened: null,
|
|
52
35
|
}
|
|
53
36
|
},
|
|
54
37
|
computed: {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return { closed: "add", open: "remove" }
|
|
38
|
+
getIcons() {
|
|
39
|
+
return {
|
|
40
|
+
'iconOpened' : this.iconOpened ?? this.$parent.getIcons.iconOpened,
|
|
41
|
+
'iconClosed' : this.iconClosed ?? this.$parent.getIcons.iconClosed,
|
|
60
42
|
}
|
|
61
|
-
return ''
|
|
62
43
|
},
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return "medium"
|
|
44
|
+
getIcon() {
|
|
45
|
+
return this.isOpen ? this.getIcons.iconOpened : this.getIcons.iconClosed
|
|
66
46
|
},
|
|
47
|
+
isOpen() {
|
|
48
|
+
return this.localOpened !== null ? this.localOpened : this.opened
|
|
49
|
+
}
|
|
67
50
|
},
|
|
68
51
|
methods: {
|
|
69
|
-
|
|
70
|
-
this.
|
|
52
|
+
toggle() {
|
|
53
|
+
if (this.localOpened === null) {
|
|
54
|
+
this.localOpened = !this.opened
|
|
55
|
+
} else {
|
|
56
|
+
this.localOpened = !this.localOpened
|
|
57
|
+
}
|
|
71
58
|
},
|
|
72
|
-
}
|
|
59
|
+
}
|
|
73
60
|
}
|
|
74
61
|
</script>
|
|
75
62
|
|
|
76
|
-
<style
|
|
77
|
-
.container {
|
|
78
|
-
border-bottom: 1px solid #e6ecf2;
|
|
79
|
-
padding: 16px;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
span {
|
|
83
|
-
font-weight: 700;
|
|
84
|
-
color: #e6ecf2;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.selected {
|
|
88
|
-
color: #318fac;
|
|
89
|
-
transition: color 300ms;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.big {
|
|
93
|
-
font-size: 18px;
|
|
94
|
-
line-height: 130%;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.medium {
|
|
98
|
-
font-size: 16px;
|
|
99
|
-
line-height: 130%;
|
|
100
|
-
}
|
|
101
|
-
</style>
|
|
63
|
+
<style> /* Please, use the file src/assets/scss/components/PsAccordion.scss */</style>
|
|
102
64
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="psui-border psui-border-gray-20 psui-rounded-md psui-flex psui-flex-col psui-items-center psui-justify-center psui-px-3 psui-py-2 psui-space-y-2">
|
|
3
|
+
<h5 class="psui-text-xsmall psui-font-bold psui-text-gray-40">
|
|
4
|
+
<span class="psui-text-gray-60">{{ title }} </span>{{ subtitle }}
|
|
5
|
+
</h5>
|
|
6
|
+
<div class="psui-w-full psui-flex psui-justify-center psui-items-center psui-space-x-2 psui-text-p">
|
|
7
|
+
<span class="psui-text-blue-50 material-icons-round">{{ icon }}</span>
|
|
8
|
+
<h5 class="psui-text-gray-80">{{ total }}</h5>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
export default {
|
|
15
|
+
name: 'PsCardInfos',
|
|
16
|
+
props: {
|
|
17
|
+
title: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: 'Total',
|
|
20
|
+
},
|
|
21
|
+
subtitle: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: '',
|
|
24
|
+
},
|
|
25
|
+
icon: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: 'edit',
|
|
28
|
+
},
|
|
29
|
+
total: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: '',
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<style scoped>
|
|
38
|
+
</style>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="psui-flex psui-p-2 psui-rounded">
|
|
3
|
+
<div class="psui-flex psui-flex-shrink-0">
|
|
4
|
+
<div :class="dotClass" class="dot psui-rounded-full" :style="dotColor"></div>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="psui-flex-grow-1">
|
|
7
|
+
<div class="psui-text-xsmall psui-text-gray-50 psui-font-bold psui-mb-1">{{ text }}</div>
|
|
8
|
+
<span v-if="this.total" class="psui-text-p psui-text-gray-80">{{ total }}</span>
|
|
9
|
+
<span class="psui-text-gray-50" v-if="percentage"><span class="psui-text-gray-30" v-if="total && percentage"> | </span>{{ percentage }}%</span>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
export default {
|
|
16
|
+
props: {
|
|
17
|
+
text: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: 'Climate Zone 10',
|
|
20
|
+
},
|
|
21
|
+
total: {
|
|
22
|
+
type: Number,
|
|
23
|
+
default: null,
|
|
24
|
+
},
|
|
25
|
+
percentage: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: false,
|
|
28
|
+
},
|
|
29
|
+
dotColor: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: ''
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<style scoped>
|
|
38
|
+
.dot {
|
|
39
|
+
width: 14px; height: 14px;
|
|
40
|
+
background-color: #43cec2;
|
|
41
|
+
margin-right: 6px;
|
|
42
|
+
}
|
|
43
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button
|
|
3
|
+
class="psui-flex psui-p-3 psui-bg-gray-10 psui-text-gray-50 hover:psui-text-blue-60 hover:psui-bg-blue-20 psui-transition-all psui-duration-300 psui-ease-out psui-shadow-lg psui-rounded"
|
|
4
|
+
>
|
|
5
|
+
<i v-if="icon" class="material-icons psui-text-base"> {{ icon }} </i>
|
|
6
|
+
<p class="psui-text-sm">10</p>
|
|
7
|
+
</button>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
export default {
|
|
12
|
+
props: {
|
|
13
|
+
icon: {
|
|
14
|
+
type: String,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
</script>
|