@policystudio/policy-studio-ui-vue 1.0.19 → 1.0.23
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 +1 -2
- package/.storybook/main.js +10 -2
- package/.storybook/preview.js +1 -1
- package/README.md +8 -0
- package/babel.config.js +3 -0
- package/backup-package-lock.json +37194 -0
- package/dist/css/psui_styles.css +15709 -14658
- package/package.json +32 -21
- package/postcss.config.js +2 -0
- package/src/assets/scss/base.scss +9 -29
- 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 -21
- 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 +43 -75
- package/src/components/chips/PsChips.vue +46 -38
- package/src/components/controls/PsCheckbox.vue +29 -16
- package/src/components/controls/PsDraggable.vue +174 -3
- package/src/components/controls/PsRadioButton.vue +74 -43
- package/src/components/controls/PsSwitch.vue +75 -76
- package/src/components/controls/PsToggle.vue +1 -1
- package/src/components/datatable/PsDataTable.vue +25 -29
- package/src/components/datatable/PsDataTableItem.vue +2 -2
- 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/PsDialogTooltip.vue +79 -0
- package/src/components/tooltip/PsRichTooltip.vue +44 -0
- package/src/components/tooltip/PsTooltip.vue +118 -0
- package/src/components/ui/PsIcon.vue +87 -24
- package/src/index.js +29 -9
- package/src/stories/Accordion.stories.js +88 -28
- package/src/stories/Button.stories.js +86 -38
- package/src/stories/CardInfos.stories.js +16 -0
- package/src/stories/ChartLegend.stories.js +16 -0
- package/src/stories/Checkbox.stories.js +6 -6
- package/src/stories/Chips.stories.js +14 -8
- package/src/stories/ClimateZoneBadge.stories.js +24 -0
- package/src/stories/Colors.stories.mdx +35 -35
- package/src/stories/CostEffectBar.stories.js +23 -0
- package/src/stories/Datatable.stories.js +15 -8
- package/src/stories/Dialog.stories.js +150 -17
- package/src/stories/Draggable.stories.js +22 -0
- package/src/stories/Dropdown.stories.js +8 -10
- package/src/stories/HighlightRippleDot.stories.js +16 -0
- package/src/stories/Input.stories.js +71 -19
- package/src/stories/MiniTag.stories.js +46 -0
- package/src/stories/ProgressBar.stories.js +23 -0
- package/src/stories/RadioButton.stories.js +15 -15
- package/src/stories/Slider.stories.js +9 -9
- package/src/stories/Swith.stories.js +10 -10
- package/src/stories/TabHeader.stories.js +9 -9
- package/src/stories/Toast.stories.js +13 -13
- package/src/stories/Toggle.stories.js +12 -13
- package/src/stories/Tooltip.stories.js +114 -0
- package/src/util/GeneralFunctions.js +11 -12
- package/src/util/imageLoader.js +50 -0
- package/tailwind.config.js +71 -47
- package/src/assets/scss/tailwind.css +0 -70643
- package/src/assets/scss/tailwind.scss +0 -61088
package/package.json
CHANGED
|
@@ -1,40 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@policystudio/policy-studio-ui-vue",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.23",
|
|
4
4
|
"description": "Policy Studio UI",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "Policy Studio Team",
|
|
7
7
|
"url": "https://bitbucket.org/policy-studio/policy-studio-ui-vue",
|
|
8
|
-
"
|
|
9
|
-
"storybook": "start-storybook -p 6006",
|
|
10
|
-
"build-storybook": "build-storybook",
|
|
11
|
-
"build-tailwind": "postcss src/assets/scss/base.scss -o src/assets/scss/tailwind.css && postcss src/assets/scss/base.scss -o dist/css/psui_styles.css",
|
|
12
|
-
"publish": "npm run build-tailwind && npm publish"
|
|
13
|
-
},
|
|
8
|
+
"license": "MIT",
|
|
14
9
|
"keywords": [
|
|
15
10
|
"vue",
|
|
16
11
|
"ui"
|
|
17
12
|
],
|
|
18
|
-
"
|
|
13
|
+
"scripts": {
|
|
14
|
+
"lint": "vue-cli-service lint",
|
|
15
|
+
"storybook": "start-storybook -p 6006",
|
|
16
|
+
"build-storybook": "build-storybook",
|
|
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",
|
|
19
|
+
"dev": "watch 'npm run build-tailwind' ./src/assets"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"core-js": "^3.6.5",
|
|
23
|
+
"vue": "^2.6.11"
|
|
24
|
+
},
|
|
19
25
|
"devDependencies": {
|
|
20
|
-
"@babel/core": "^7.16.
|
|
21
|
-
"@
|
|
22
|
-
"@storybook/addon-
|
|
23
|
-
"@storybook/addon-
|
|
24
|
-
"@storybook/addon-links": "^6.4.12",
|
|
26
|
+
"@babel/core": "^7.16.7",
|
|
27
|
+
"@storybook/addon-actions": "^6.4.13",
|
|
28
|
+
"@storybook/addon-essentials": "^6.4.13",
|
|
29
|
+
"@storybook/addon-links": "^6.4.13",
|
|
25
30
|
"@storybook/addon-postcss": "^2.0.0",
|
|
26
|
-
"@storybook/vue": "^6.4.
|
|
27
|
-
"
|
|
31
|
+
"@storybook/vue": "^6.4.13",
|
|
32
|
+
"@vue/cli-plugin-babel": "~4.5.0",
|
|
33
|
+
"@vue/cli-plugin-eslint": "~4.5.0",
|
|
34
|
+
"@vue/cli-service": "~4.5.0",
|
|
35
|
+
"@vue/eslint-config-prettier": "^6.0.0",
|
|
36
|
+
"babel-eslint": "^10.1.0",
|
|
28
37
|
"babel-loader": "^8.2.3",
|
|
29
|
-
"eslint": "^
|
|
30
|
-
"eslint-plugin-
|
|
31
|
-
"eslint-plugin-vue": "^
|
|
38
|
+
"eslint": "^6.7.2",
|
|
39
|
+
"eslint-plugin-prettier": "^3.3.1",
|
|
40
|
+
"eslint-plugin-vue": "^6.2.2",
|
|
32
41
|
"postcss": "^8.3.11",
|
|
33
42
|
"postcss-cli": "^9.0.2",
|
|
43
|
+
"postcss-import": "^14.0.2",
|
|
44
|
+
"postcss-nested": "^5.0.6",
|
|
45
|
+
"prettier": "^2.2.1",
|
|
34
46
|
"tailwindcss": "^1.9.6",
|
|
35
|
-
"vue": "^2.6.14",
|
|
36
47
|
"vue-loader": "^15.9.8",
|
|
37
|
-
"vue-
|
|
38
|
-
"
|
|
48
|
+
"vue-template-compiler": "^2.6.11",
|
|
49
|
+
"watch": "^1.0.2"
|
|
39
50
|
}
|
|
40
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;
|
|
@@ -10,30 +13,7 @@ html {
|
|
|
10
13
|
-webkit-font-smoothing: antialiased;
|
|
11
14
|
-moz-osx-font-smoothing: grayscale;
|
|
12
15
|
}
|
|
13
|
-
|
|
14
|
-
.toggle-bg:after {
|
|
15
|
-
content: '';
|
|
16
|
-
@apply psui-absolute psui-bg-white psui-border-gray-40 psui-rounded-full psui-h-5 psui-w-5 psui-transition;
|
|
17
|
-
}
|
|
18
|
-
.toggle-bg:after + .ps-switch-small {
|
|
19
|
-
content: '';
|
|
20
|
-
@apply psui-absolute psui-bg-white psui-border-gray-40 psui-rounded-full psui-h-2 psui-w-2 psui-transition;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
input:checked + .toggle-bg:after + .ps-switch-small {
|
|
24
|
-
transform: translateX(100%);
|
|
25
|
-
position: absolute;
|
|
26
|
-
left: 2px;
|
|
27
|
-
@apply border-white;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
input:checked + .toggle-bg:after {
|
|
31
|
-
transform: translateX(100%);
|
|
32
|
-
position: absolute;
|
|
33
|
-
left: 4px;
|
|
34
|
-
@apply border-white;
|
|
35
|
-
}
|
|
36
16
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
17
|
+
.transition-default {
|
|
18
|
+
transition: cubic-bezier(.17,.67,.83,.67) 250ms;
|
|
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,36 +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
|
-
</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: 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>
|