@policystudio/policy-studio-ui-vue 1.1.89 → 1.1.90-access.1
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/.eslintignore +1 -0
- package/.eslintrc.js +75 -67
- package/.github/workflows/deploy-storybook.yml +5 -5
- package/.nvmrc +1 -0
- package/dist/css/psui_styles_output.css +6638 -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/doc/.storybook/PolicyStudio.ts +11 -0
- package/doc/.storybook/main.ts +27 -0
- package/doc/.storybook/manager.ts +7 -0
- package/{.storybook/preview.js → doc/.storybook/preview.ts} +2 -3
- package/doc/package-lock.json +22653 -0
- package/doc/package.json +71 -0
- package/doc/shims-vue.d.ts +6 -0
- package/{src/stories/Accordion.stories.js → doc/src/stories/Accordion.stories.ts} +4 -5
- package/{src/stories/BadgeWithIcon.stories.js → doc/src/stories/BadgeWithIcon.stories.ts} +2 -2
- package/{src/stories/BarChart.stories.js → doc/src/stories/BarChart.stories.ts} +2 -2
- package/{src/stories/Breadcrumb.stories.js → doc/src/stories/Breadcrumb.stories.ts} +2 -5
- package/{src/stories/Button.stories.js → doc/src/stories/Button.stories.ts} +130 -130
- package/{src/stories/CardInfos.stories.js → doc/src/stories/CardInfos.stories.ts} +2 -3
- package/{src/stories/ChartLegend.stories.js → doc/src/stories/ChartLegend.stories.ts} +2 -3
- package/{src/stories/Checkbox.stories.js → doc/src/stories/Checkbox.stories.ts} +2 -2
- package/{src/stories/CheckboxSimple.stories.js → doc/src/stories/CheckboxSimple.stories.ts} +2 -2
- package/{src/stories/Chips.stories.js → doc/src/stories/Chips.stories.ts} +22 -23
- package/{src/stories/ClimateZoneBadge.stories.js → doc/src/stories/ClimateZoneBadge.stories.ts} +3 -2
- package/doc/src/stories/Collapse.stories.ts +46 -0
- package/{src/stories/CostEffectBar.stories.js → doc/src/stories/CostEffectBar.stories.ts} +3 -2
- package/{src/stories/Datatable.stories.js → doc/src/stories/Datatable.stories.ts} +7 -4
- package/{src/stories/DateCardInfo.stories.js → doc/src/stories/DateCardInfo.stories.ts} +2 -6
- package/{src/stories/Dialog.stories.js → doc/src/stories/Dialog.stories.ts} +2 -2
- package/{src/stories/Draggable.stories.js → doc/src/stories/Draggable.stories.ts} +3 -2
- package/{src/stories/Dropdown.stories.js → doc/src/stories/Dropdown.stories.ts} +4 -3
- package/{src/stories/DropdownList.stories.js → doc/src/stories/DropdownList.stories.ts} +4 -2
- package/{src/stories/ElevationSystem.stories.mdx → doc/src/stories/ElevationSystem.mdx} +1 -1
- package/{src/stories/HighlightRippleDot.stories.js → doc/src/stories/HighlightRippleDot.stories.ts} +3 -2
- package/{src/stories/Icon.stories.js → doc/src/stories/Icon.stories.ts} +3 -1
- package/{src/stories/InlineSelector.stories.js → doc/src/stories/InlineSelector.stories.ts} +2 -2
- package/{src/stories/Input.stories.js → doc/src/stories/Input.stories.ts} +7 -4
- package/{src/stories/InputSelect.stories.js → doc/src/stories/InputSelect.stories.ts} +3 -2
- package/{src/stories/InputTextArea.stories.js → doc/src/stories/InputTextArea.stories.ts} +2 -2
- package/{src/stories/Introduction.stories.mdx → doc/src/stories/Introduction.mdx} +101 -101
- package/{src/stories/MiniTag.stories.js → doc/src/stories/MiniTag.stories.ts} +9 -2
- package/{src/stories/ProgressBar.stories.js → doc/src/stories/ProgressBar.stories.ts} +3 -2
- package/{src/stories/RadioButton.stories.js → doc/src/stories/RadioButton.stories.ts} +2 -2
- package/{src/stories/RadioButtonSimple.stories.js → doc/src/stories/RadioButtonSimple.stories.ts} +2 -2
- package/{src/stories/SimpleAlert.stories.js → doc/src/stories/SimpleAlert.stories.ts} +3 -2
- package/{src/stories/Slider.stories.js → doc/src/stories/Slider.stories.ts} +6 -2
- package/{src/stories/Switch.stories.js → doc/src/stories/Switch.stories.ts} +2 -2
- package/{src/stories/TabHeader.stories.js → doc/src/stories/TabHeader.stories.ts} +6 -1
- package/{src/stories/TableResults.stories.js → doc/src/stories/TableResults.stories.ts} +11 -7
- package/{src/stories/TagScope.stories.js → doc/src/stories/TagScope.stories.ts} +3 -2
- package/{src/stories/TestimonialCard.stories.js → doc/src/stories/TestimonialCard.stories.ts} +3 -3
- package/{src/stories/Toast.stories.js → doc/src/stories/Toast.stories.ts} +2 -2
- package/{src/stories/Toggle.stories.js → doc/src/stories/Toggle.stories.ts} +7 -4
- package/{src/stories/Tooltip.stories.js → doc/src/stories/Tooltip.stories.ts} +6 -6
- package/{src/stories/Typography.stories.mdx → doc/src/stories/Typography.mdx} +107 -105
- package/doc/tsconfig.json +17 -0
- package/package.json +43 -39
- package/scripts/gulp.js +11 -0
- package/scripts/kill-port.sh +12 -0
- package/src/App.vue +30 -0
- package/src/assets/scss/base.scss +3 -30
- package/src/assets/scss/components/PsAccordion.scss +12 -2
- package/src/assets/scss/components/PsButton.scss +7 -1
- package/src/assets/scss/components/PsChips.scss +12 -7
- package/src/assets/scss/components/PsCollapse.scss +71 -0
- package/src/assets/scss/components/PsCostEffectBar.scss +4 -4
- package/src/assets/scss/components/PsDataTable.scss +1 -1
- package/src/assets/scss/components/PsDateCardInfo.scss +4 -5
- package/src/assets/scss/components/PsDialog.scss +7 -0
- package/src/assets/scss/components/PsDropdownList.scss +1 -1
- package/src/assets/scss/components/PsInput.scss +10 -0
- package/src/assets/scss/components/PsProgressBar.scss +4 -4
- package/src/assets/scss/components/PsSwitch.scss +10 -0
- package/src/assets/scss/components/PsTabHeader.scss +64 -2
- package/src/assets/scss/components/PsTableResults.scss +51 -82
- package/src/assets/scss/components/PsTestimonialCard.scss +1 -1
- package/src/assets/scss/components/PsTooltip.scss +149 -145
- package/src/components/accordion/PsAccordion.vue +20 -21
- package/src/components/accordion/PsAccordionItem.vue +122 -81
- package/src/components/badges-and-tags/PsBadgeWithIcon.vue +37 -36
- package/src/components/badges-and-tags/PsCardInfos.vue +40 -40
- package/src/components/badges-and-tags/PsChartLegend.vue +50 -41
- package/src/components/badges-and-tags/PsClimateZoneBadge.vue +13 -19
- package/src/components/badges-and-tags/PsCostEffectBar.vue +28 -61
- package/src/components/badges-and-tags/PsDateCardInfo.vue +17 -18
- package/src/components/badges-and-tags/PsHighlightRippleDot.vue +4 -3
- 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 +25 -30
- package/src/components/buttons/PsButton.vue +90 -98
- package/src/components/chips/PsChips.vue +118 -103
- package/src/components/collapse/PsCollapse.vue +124 -0
- package/src/components/controls/PsCheckbox.vue +86 -83
- package/src/components/controls/PsCheckboxSimple.vue +97 -97
- package/src/components/controls/PsDraggable.vue +100 -99
- package/src/components/controls/PsInlineSelector.vue +111 -113
- package/src/components/controls/PsRadioButton.vue +72 -60
- package/src/components/controls/PsRadioButtonSimple.vue +81 -77
- package/src/components/controls/PsSlider.vue +190 -181
- package/src/components/controls/PsSwitch.vue +64 -54
- package/src/components/controls/PsToggle.vue +62 -57
- package/src/components/data-graphics/PsBarChart.vue +22 -23
- package/src/components/datatable/PsDataTable.vue +70 -65
- package/src/components/datatable/PsDataTableItem.vue +30 -32
- package/src/components/forms/PsDropdown.vue +173 -166
- package/src/components/forms/PsDropdownList.vue +133 -130
- package/src/components/forms/PsInput.vue +163 -146
- package/src/components/forms/PsInputSelect.vue +121 -100
- package/src/components/forms/PsInputTextArea.vue +84 -74
- package/src/components/navigations/PsBreadcrumb.vue +25 -34
- package/src/components/notifications/PsDialog.vue +67 -60
- package/src/components/notifications/PsSimpleAlert.vue +47 -37
- package/src/components/notifications/PsToast.vue +48 -42
- package/src/components/table-results/PsTableResults.vue +527 -504
- package/src/components/table-results/PsTableResultsBody.vue +69 -68
- package/src/components/table-results/PsTableResultsHead.vue +108 -69
- package/src/components/table-results/PsTableResultsHeadComparison.vue +88 -69
- package/src/components/table-results/PsTableResultsHeadFlexible.vue +112 -72
- package/src/components/table-results/PsTableResultsRow.vue +61 -58
- package/src/components/tabs/PsTabHeader.vue +138 -116
- package/src/components/tooltip/PsDialogTooltip.vue +112 -107
- package/src/components/tooltip/PsRichTooltip.vue +46 -43
- package/src/components/tooltip/PsTooltip.vue +126 -122
- package/src/components/ui/PsDotLoader.vue +6 -10
- package/src/components/ui/PsIcon.vue +149 -134
- package/src/index.ts +159 -0
- package/src/tsconfig.json +12 -0
- package/src/types/index.d.ts +6 -0
- package/src/util/GeneralFunctions.js +16 -7
- package/src/util/directives.ts +24 -0
- package/src/util/imageLoader.js +14 -7
- package/tailwind.config.js +12 -3
- package/tsconfig.json +47 -0
- package/.storybook/PolicyStudio.js +0 -10
- package/.storybook/eventBus.js +0 -3
- package/.storybook/main.js +0 -25
- package/.storybook/manager.js +0 -6
- package/babel.config.js +0 -3
- package/backup-package-lock.json +0 -37194
- package/dist/css/psui_styles.css +0 -110965
- package/postcss.config.js +0 -8
- package/src/components/playground/PsScrollBar.vue +0 -248
- package/src/index.js +0 -167
- package/src/stories/Playground.stories.js +0 -16
- /package/{src → doc/src}/assets/images/multifamily-units.svg +0 -0
- /package/{src → doc/src}/assets/images/policy-studio.svg +0 -0
- /package/{src/contents/ComparisonData.js → doc/src/contents/ComparisonData.ts} +0 -0
- /package/{src/contents/FlexibleData.js → doc/src/contents/FlexibleData.ts} +0 -0
- /package/{src/contents/ResultsData.js → doc/src/contents/ResultsData.ts} +0 -0
- /package/{src/stories/Colors.stories.mdx → doc/src/stories/Colors.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
|
@@ -1,150 +1,154 @@
|
|
|
1
1
|
@layer components {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
padding: 7px 16px;
|
|
105
|
-
width: fit-content;
|
|
106
|
-
|
|
107
|
-
&:focus {
|
|
108
|
-
outline: none;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
&-color {
|
|
116
|
-
@apply psui-bg-blue-50 psui-py-4 psui-px-6 psui-flex psui-flex-col psui-shadow-elevation-30;
|
|
117
|
-
gap: 8.8px;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
h2 {
|
|
121
|
-
@apply psui-text-white psui-font-bold;
|
|
122
|
-
font-size: 17px;
|
|
123
|
-
line-height: 120%;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.psui-el-tooltip-content-wrapper {
|
|
127
|
-
@apply psui-text-white psui-font-normal psui-flex psui-flex-col;
|
|
128
|
-
gap: 13.6px;
|
|
129
|
-
font-size: 14px;
|
|
130
|
-
line-height: 120%;
|
|
131
|
-
|
|
132
|
-
button {
|
|
133
|
-
@apply psui-rounded-md psui-bg-blue-60 psui-text-white psui-font-bold;
|
|
134
|
-
padding: 7px 16px;
|
|
135
|
-
width: fit-content;
|
|
136
|
-
|
|
137
|
-
&:focus {
|
|
138
|
-
outline: none;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
}
|
|
2
|
+
.psui-el-tooltip {
|
|
3
|
+
.psui-el-tooltip-wrapper {
|
|
4
|
+
@apply psui-relative;
|
|
5
|
+
|
|
6
|
+
.psui-el-tooltip-dialog {
|
|
7
|
+
@apply psui-fixed psui-opacity-0 psui-transition-opacity psui-duration-300 psui-ease-in-out psui-hidden;
|
|
8
|
+
transition-delay: 0.4s;
|
|
9
|
+
z-index: 999;
|
|
10
|
+
|
|
11
|
+
.psui-el-tooltip-content {
|
|
12
|
+
@apply psui-flex psui-flex-col psui-bg-gray-50 psui-text-white;
|
|
13
|
+
padding: 10px 16px 12px 16px;
|
|
14
|
+
border-radius: 4px;
|
|
15
|
+
font-family: Lato, sans-serif;
|
|
16
|
+
font-style: normal;
|
|
17
|
+
|
|
18
|
+
h2 {
|
|
19
|
+
font-size: 12px;
|
|
20
|
+
line-height: 120%;
|
|
21
|
+
font-weight: 700;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.psui-el-tooltip-content-wrapper {
|
|
25
|
+
font-size: 12px;
|
|
26
|
+
line-height: 120%;
|
|
27
|
+
font-weight: 400;
|
|
28
|
+
|
|
29
|
+
h2,
|
|
30
|
+
p {
|
|
31
|
+
font-size: 12px;
|
|
32
|
+
line-height: 120%;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
h2 {
|
|
36
|
+
font-weight: 700;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
p {
|
|
40
|
+
font-weight: 400;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&.layout-gray,
|
|
45
|
+
&.layout-blue,
|
|
46
|
+
&.layout-red,
|
|
47
|
+
&.layout-green {
|
|
48
|
+
@apply psui-shadow-none;
|
|
49
|
+
font-size: 12px;
|
|
50
|
+
line-height: 120%;
|
|
51
|
+
padding: 10px 16px 12px 16px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&.layout-gray {
|
|
55
|
+
@apply psui-bg-gray-30 psui-text-gray-80;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&.layout-blue {
|
|
59
|
+
@apply psui-bg-blue-70 psui-text-white;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&.layout-red {
|
|
63
|
+
@apply psui-bg-red-10 psui-text-red-70;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&.layout-green {
|
|
67
|
+
@apply psui-items-center;
|
|
68
|
+
gap: 4px;
|
|
69
|
+
border-radius: 6px;
|
|
70
|
+
background: linear-gradient(270deg, #5db883 0%, #28b08e 100%);
|
|
71
|
+
|
|
72
|
+
h2,
|
|
73
|
+
.psui-el-tooltip-content-wrapper {
|
|
74
|
+
@apply psui-text-white;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&.layout-white,
|
|
79
|
+
&.layout-dark,
|
|
80
|
+
&.layout-color {
|
|
81
|
+
@apply psui-py-4 psui-px-6 psui-flex psui-flex-col psui-shadow-elevation-30;
|
|
82
|
+
gap: 8.8px;
|
|
83
|
+
|
|
84
|
+
h2 {
|
|
85
|
+
font-size: 17px;
|
|
86
|
+
line-height: 120%;
|
|
87
|
+
font-weight: 700;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.psui-el-tooltip-content-wrapper {
|
|
91
|
+
@apply psui-flex psui-flex-col;
|
|
92
|
+
gap: 13.6px;
|
|
93
|
+
font-size: 14px;
|
|
94
|
+
line-height: 120%;
|
|
95
|
+
font-weight: 400;
|
|
96
|
+
|
|
97
|
+
button {
|
|
98
|
+
@apply psui-rounded-md psui-font-bold;
|
|
99
|
+
padding: 7px 16px;
|
|
100
|
+
width: fit-content;
|
|
101
|
+
|
|
102
|
+
&:focus {
|
|
103
|
+
outline: none;
|
|
146
104
|
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&.layout-white {
|
|
110
|
+
@apply psui-bg-white;
|
|
111
|
+
|
|
112
|
+
h2 {
|
|
113
|
+
@apply psui-text-gray-80;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.psui-el-tooltip-content-wrapper {
|
|
117
|
+
@apply psui-text-gray-50;
|
|
118
|
+
|
|
119
|
+
button {
|
|
120
|
+
@apply psui-bg-blue-20 psui-text-blue-60;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&.layout-dark {
|
|
126
|
+
@apply psui-bg-blue-70;
|
|
127
|
+
|
|
128
|
+
h2,
|
|
129
|
+
.psui-el-tooltip-content-wrapper {
|
|
130
|
+
@apply psui-text-white;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.psui-el-tooltip-content-wrapper button {
|
|
134
|
+
@apply psui-bg-blue-60 psui-text-white;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&.layout-color {
|
|
139
|
+
@apply psui-bg-blue-50;
|
|
140
|
+
|
|
141
|
+
h2,
|
|
142
|
+
.psui-el-tooltip-content-wrapper {
|
|
143
|
+
@apply psui-text-white;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.psui-el-tooltip-content-wrapper button {
|
|
147
|
+
@apply psui-bg-blue-60 psui-text-white;
|
|
147
148
|
}
|
|
149
|
+
}
|
|
148
150
|
}
|
|
151
|
+
}
|
|
149
152
|
}
|
|
150
|
-
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
2
|
+
<div
|
|
3
|
+
class="psui-el-accordion"
|
|
4
|
+
:class="getComponentClass"
|
|
5
|
+
>
|
|
6
|
+
<slot />
|
|
4
7
|
</div>
|
|
5
8
|
</template>
|
|
6
9
|
|
|
7
|
-
<script>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
layout: {
|
|
16
|
-
type: String,
|
|
17
|
-
default: 'medium',
|
|
18
|
-
validator: (value) => ['medium','big'].includes(value),
|
|
19
|
-
},
|
|
10
|
+
<script setup>
|
|
11
|
+
import { computed } from 'vue'
|
|
12
|
+
|
|
13
|
+
const props = defineProps({
|
|
14
|
+
layout:{
|
|
15
|
+
type: String,
|
|
16
|
+
default: 'medium',
|
|
17
|
+
validator: (value) => ['big', 'medium'].includes(value)
|
|
20
18
|
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const getComponentClass = computed(() => {
|
|
22
|
+
return `layout-${props.layout}`
|
|
23
|
+
})
|
|
24
|
+
|
|
27
25
|
</script>
|
|
26
|
+
|
|
28
27
|
<style> /* Please, use the file src/assets/scss/components/PsAccordion.scss */</style>
|
|
@@ -1,11 +1,31 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
class="psui-el-accordion-item"
|
|
4
|
+
:class="{ 'status-opened': isOpen, disabled: disabled }"
|
|
5
|
+
tabindex="0"
|
|
6
|
+
>
|
|
3
7
|
<div class="psui-el-accordion-item-header">
|
|
4
|
-
<slot
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
<slot
|
|
9
|
+
name="custom-header"
|
|
10
|
+
:toggle="toggle"
|
|
11
|
+
:is-open="isOpen"
|
|
12
|
+
>
|
|
13
|
+
<div
|
|
14
|
+
@click="toggle"
|
|
15
|
+
class="psui-el-accordion-item-header-wrapper"
|
|
16
|
+
v-if="!hasCustomHeader"
|
|
17
|
+
>
|
|
18
|
+
<h2
|
|
19
|
+
v-if="title"
|
|
20
|
+
class="psui-el-accordion-item-title"
|
|
21
|
+
>
|
|
22
|
+
{{ title }}
|
|
23
|
+
</h2>
|
|
24
|
+
<slot name="header-additionals" />
|
|
25
|
+
<i
|
|
26
|
+
v-if="!disabled"
|
|
27
|
+
class="psui-el-accordion-item-icon"
|
|
28
|
+
>{{ getIcon }}</i>
|
|
9
29
|
</div>
|
|
10
30
|
</slot>
|
|
11
31
|
</div>
|
|
@@ -16,91 +36,112 @@
|
|
|
16
36
|
@before-leave="start"
|
|
17
37
|
@after-leave="end"
|
|
18
38
|
>
|
|
19
|
-
<div
|
|
20
|
-
|
|
39
|
+
<div
|
|
40
|
+
v-if="isOpen"
|
|
41
|
+
class="psui-el-accordion-item-content"
|
|
42
|
+
>
|
|
43
|
+
<slot />
|
|
21
44
|
</div>
|
|
22
45
|
</transition>
|
|
23
46
|
</div>
|
|
24
47
|
</template>
|
|
25
48
|
|
|
26
|
-
<script>
|
|
27
|
-
import { getParentVueComponentByName } from '../../util/GeneralFunctions'
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
/**
|
|
59
|
-
* It sets the disabled status.
|
|
60
|
-
*/
|
|
61
|
-
disabled: {
|
|
62
|
-
type: Boolean,
|
|
63
|
-
default: false
|
|
64
|
-
}
|
|
49
|
+
<script setup>
|
|
50
|
+
import { getParentVueComponentByName } from '../../util/GeneralFunctions.js'
|
|
51
|
+
import { ref, computed, getCurrentInstance } from 'vue'
|
|
52
|
+
|
|
53
|
+
defineExpose({
|
|
54
|
+
toggle: () => toggle()
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
const localOpened = ref(null)
|
|
58
|
+
|
|
59
|
+
const props = defineProps({
|
|
60
|
+
/**
|
|
61
|
+
* It sets the title of the accordion item.
|
|
62
|
+
*/
|
|
63
|
+
title: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: '',
|
|
66
|
+
},
|
|
67
|
+
/**
|
|
68
|
+
* It sets the status of the accordion item when mounted.
|
|
69
|
+
*/
|
|
70
|
+
opened: {
|
|
71
|
+
type: [Boolean],
|
|
72
|
+
default: false,
|
|
73
|
+
},
|
|
74
|
+
/**
|
|
75
|
+
* It sets the text key to get the svg icon in Google Fonts. Make sure to get the correct description of your icon on https://fonts.google.com/.
|
|
76
|
+
*/
|
|
77
|
+
icon: {
|
|
78
|
+
type: String,
|
|
79
|
+
default: '',
|
|
65
80
|
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
81
|
+
/**
|
|
82
|
+
* It sets if it has a custom header.
|
|
83
|
+
*/
|
|
84
|
+
hasCustomHeader: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
default: false,
|
|
70
87
|
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
getIcon(){
|
|
79
|
-
if(this.getParent._props.layout === 'medium') return 'expand_more'
|
|
80
|
-
if(this.getParent._props.layout === 'big' && this.isOpen === false) return 'add'
|
|
81
|
-
if(this.getParent._props.layout === 'big' && this.isOpen === true) return 'remove'
|
|
82
|
-
return `${this.icon}`
|
|
83
|
-
}
|
|
88
|
+
/**
|
|
89
|
+
* It sets the disabled status.
|
|
90
|
+
*/
|
|
91
|
+
disabled: {
|
|
92
|
+
type: Boolean,
|
|
93
|
+
default: false,
|
|
84
94
|
},
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
const isOpen = computed(() => {
|
|
98
|
+
return localOpened.value !== null ? localOpened.value : props.opened
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
const getParent = computed(() => {
|
|
102
|
+
const instance = getCurrentInstance()
|
|
103
|
+
|
|
104
|
+
if (instance?.parent) {
|
|
105
|
+
return getParentVueComponentByName(instance.parent, 'PsAccordion')
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (instance.proxy && instance.proxy.$parent) {
|
|
109
|
+
return getParentVueComponentByName(instance.proxy.$parent, 'PsAccordion')
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return null
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
const getIcon = computed(() => {
|
|
116
|
+
if (!getParent.value) return
|
|
117
|
+
|
|
118
|
+
const layout = getParent.value._props ? getParent.value._props.layout : getParent?.value?.props.layout.default
|
|
119
|
+
if (layout === 'medium') return 'expand_more'
|
|
120
|
+
if (layout === 'big' && isOpen.value === false) return 'add'
|
|
121
|
+
if (layout === 'big' && isOpen.value === true) return 'remove'
|
|
122
|
+
return `${props.icon}`
|
|
123
|
+
})
|
|
124
|
+
|
|
125
|
+
const toggle = () => {
|
|
126
|
+
if (localOpened.value === null) {
|
|
127
|
+
localOpened.value = !props.opened
|
|
128
|
+
} else {
|
|
129
|
+
localOpened.value = !localOpened.value
|
|
101
130
|
}
|
|
102
131
|
}
|
|
132
|
+
const start = (el) => {
|
|
133
|
+
el.style.height = el.scrollHeight + 'px'
|
|
134
|
+
el.style.padding = el.srcollPaddingBottom + 'px'
|
|
135
|
+
}
|
|
136
|
+
const end = (el) => {
|
|
137
|
+
el.style.height = ''
|
|
138
|
+
el.style.padding = ''
|
|
139
|
+
}
|
|
103
140
|
</script>
|
|
104
141
|
|
|
105
|
-
<style>
|
|
142
|
+
<style>
|
|
143
|
+
/* Please, use the file src/assets/scss/components/PsAccordion.scss */
|
|
144
|
+
</style>
|
|
145
|
+
|
|
146
|
+
|
|
106
147
|
|
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
<div
|
|
3
|
+
class="psui-el-badge-with-icon"
|
|
4
|
+
:class="getComponentClass"
|
|
5
|
+
>
|
|
6
|
+
<i
|
|
7
|
+
v-if="icon"
|
|
5
8
|
:class="iconClass"
|
|
6
9
|
class="psui-el-badge-with-icon-icon"
|
|
7
|
-
>{{icon}}</i>
|
|
8
|
-
<span class="psui-el-badge-with-icon-message">{{message}}</span>
|
|
10
|
+
>{{ icon }}</i>
|
|
11
|
+
<span class="psui-el-badge-with-icon-message">{{ message }}</span>
|
|
9
12
|
</div>
|
|
10
13
|
</template>
|
|
11
14
|
|
|
12
|
-
<script>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
getComponentClass(){
|
|
38
|
-
return `layout-${this.layout}`
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
</script>
|
|
15
|
+
<script setup>
|
|
16
|
+
import { computed } from 'vue'
|
|
17
|
+
|
|
18
|
+
const props = defineProps({
|
|
19
|
+
icon: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: 'info',
|
|
22
|
+
},
|
|
23
|
+
/**
|
|
24
|
+
* It set any further css style that might be needed.
|
|
25
|
+
*/
|
|
26
|
+
iconClass: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: '',
|
|
29
|
+
},
|
|
30
|
+
message: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: 'Lorem ipsum',
|
|
33
|
+
},
|
|
34
|
+
layout: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: 'grey',
|
|
37
|
+
validator: (value) => ['grey', 'blue', 'green', 'yellow'].includes(value),
|
|
38
|
+
},
|
|
39
|
+
})
|
|
43
40
|
|
|
41
|
+
const getComponentClass = computed(() => {
|
|
42
|
+
return `layout-${props.layout}`
|
|
43
|
+
})
|
|
44
|
+
</script>
|