@policystudio/policy-studio-ui-vue 1.1.90-beta.12 → 1.1.90-beta.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +2 -1
- package/.github/workflows/deploy-storybook.yml +4 -4
- package/.nvmrc +1 -0
- package/dist/css/psui_styles_output.css +6986 -0
- package/package.json +9 -23
- package/src/assets/scss/components/PsDataTable.scss +1 -1
- package/src/components/accordion/PsAccordionItem.vue +75 -75
- package/src/components/badges-and-tags/PsBadgeWithIcon.vue +31 -34
- package/src/components/badges-and-tags/PsCardInfos.vue +40 -41
- package/src/components/badges-and-tags/PsChartLegend.vue +47 -51
- package/src/components/badges-and-tags/PsClimateZoneBadge.vue +14 -19
- package/src/components/badges-and-tags/PsCostEffectBar.vue +24 -56
- package/src/components/badges-and-tags/PsDateCardInfo.vue +17 -18
- package/src/components/badges-and-tags/PsHighlightRippleDot.vue +3 -2
- package/src/components/badges-and-tags/PsMiniTag.vue +39 -41
- package/src/components/badges-and-tags/PsProgressBar.vue +72 -68
- package/src/components/badges-and-tags/PsTagScope.vue +17 -22
- package/src/components/badges-and-tags/PsTestimonialCard.vue +20 -26
- package/src/components/buttons/PsButton.vue +61 -62
- package/src/components/chips/PsChips.vue +98 -101
- package/src/components/controls/PsCheckbox.vue +84 -84
- package/src/components/controls/PsCheckboxSimple.vue +95 -95
- package/src/components/controls/PsDraggable.vue +53 -55
- package/src/components/controls/PsInlineSelector.vue +99 -99
- package/src/components/controls/PsRadioButton.vue +59 -58
- package/src/components/controls/PsRadioButtonSimple.vue +79 -75
- package/src/components/controls/PsSlider.vue +185 -176
- package/src/components/controls/PsSwitch.vue +51 -52
- package/src/components/controls/PsToggle.vue +53 -50
- package/src/components/data-graphics/PsBarChart.vue +19 -21
- package/src/components/datatable/PsDataTable.vue +56 -60
- package/src/components/datatable/PsDataTableItem.vue +14 -28
- package/src/components/forms/PsDropdown.vue +164 -162
- package/src/components/forms/PsDropdownList.vue +132 -129
- package/src/components/forms/PsInput.vue +155 -153
- package/src/components/forms/PsInputSelect.vue +91 -92
- package/src/components/forms/PsInputTextArea.vue +71 -71
- package/src/components/navigations/PsBreadcrumb.vue +26 -34
- package/src/components/notifications/PsDialog.vue +57 -56
- package/src/components/notifications/PsSimpleAlert.vue +28 -29
- package/src/components/notifications/PsToast.vue +40 -39
- package/src/components/table-results/PsTableResults.vue +452 -458
- package/src/components/table-results/PsTableResultsBody.vue +66 -67
- package/src/components/table-results/PsTableResultsHead.vue +62 -56
- package/src/components/table-results/PsTableResultsHeadComparison.vue +62 -56
- package/src/components/table-results/PsTableResultsHeadFlexible.vue +63 -56
- package/src/components/table-results/PsTableResultsRow.vue +55 -56
- package/src/components/tabs/PsTabHeader.vue +106 -100
- package/src/components/tooltip/PsDialogTooltip.vue +96 -101
- package/src/components/tooltip/PsRichTooltip.vue +42 -45
- package/src/components/tooltip/PsTooltip.vue +111 -116
- package/src/components/ui/PsDotLoader.vue +1 -5
- package/src/components/ui/PsIcon.vue +126 -129
- package/src/index.ts +57 -71
- package/src/tsconfig.json +12 -0
- package/src/{shims-vue.d.ts → types/index.d.ts} +0 -5
- package/src/util/{GeneralFunctions.ts → GeneralFunctions.js} +0 -3
- package/src/util/directives.ts +24 -0
- package/src/util/eventBus.js +10 -0
- package/src/util/{imageLoader.ts → imageLoader.js} +7 -8
- package/tailwind.config.js +1 -1
- package/tsconfig.json +15 -17
- package/.storybook/PolicyStudio.ts +0 -11
- package/.storybook/eventBus.ts +0 -26
- package/.storybook/main.ts +0 -21
- package/.storybook/manager.ts +0 -7
- package/.storybook/preview.ts +0 -17
- package/dist/contents/ComparisonData.js +0 -376
- package/dist/contents/ComparisonData.js.map +0 -1
- package/dist/contents/FlexibleData.js +0 -501
- package/dist/contents/FlexibleData.js.map +0 -1
- package/dist/contents/ResultsData.js +0 -530
- package/dist/contents/ResultsData.js.map +0 -1
- package/dist/css/psui_styles.css +0 -4647
- package/dist/index.js +0 -114
- package/dist/index.js.map +0 -1
- package/dist/stories/Accordion.stories.js +0 -56
- package/dist/stories/Accordion.stories.js.map +0 -1
- package/dist/stories/BadgeWithIcon.stories.js +0 -28
- package/dist/stories/BadgeWithIcon.stories.js.map +0 -1
- package/dist/stories/BarChart.stories.js +0 -16
- package/dist/stories/BarChart.stories.js.map +0 -1
- package/dist/stories/Breadcrumb.stories.js +0 -21
- package/dist/stories/Breadcrumb.stories.js.map +0 -1
- package/dist/stories/Button.stories.js +0 -44
- package/dist/stories/Button.stories.js.map +0 -1
- package/dist/stories/CardInfos.stories.js +0 -13
- package/dist/stories/CardInfos.stories.js.map +0 -1
- package/dist/stories/ChartLegend.stories.js +0 -13
- package/dist/stories/ChartLegend.stories.js.map +0 -1
- package/dist/stories/Checkbox.stories.js +0 -44
- package/dist/stories/Checkbox.stories.js.map +0 -1
- package/dist/stories/CheckboxSimple.stories.js +0 -48
- package/dist/stories/CheckboxSimple.stories.js.map +0 -1
- package/dist/stories/Chips.stories.js +0 -27
- package/dist/stories/Chips.stories.js.map +0 -1
- package/dist/stories/ClimateZoneBadge.stories.js +0 -15
- package/dist/stories/ClimateZoneBadge.stories.js.map +0 -1
- package/dist/stories/CostEffectBar.stories.js +0 -21
- package/dist/stories/CostEffectBar.stories.js.map +0 -1
- package/dist/stories/Datatable.stories.js +0 -45
- package/dist/stories/Datatable.stories.js.map +0 -1
- package/dist/stories/DateCardInfo.stories.js +0 -18
- package/dist/stories/DateCardInfo.stories.js.map +0 -1
- package/dist/stories/Dialog.stories.js +0 -127
- package/dist/stories/Dialog.stories.js.map +0 -1
- package/dist/stories/Draggable.stories.js +0 -20
- package/dist/stories/Draggable.stories.js.map +0 -1
- package/dist/stories/Dropdown.stories.js +0 -98
- package/dist/stories/Dropdown.stories.js.map +0 -1
- package/dist/stories/DropdownList.stories.js +0 -208
- package/dist/stories/DropdownList.stories.js.map +0 -1
- package/dist/stories/Header.stories.js +0 -39
- package/dist/stories/Header.stories.js.map +0 -1
- package/dist/stories/HighlightRippleDot.stories.js +0 -13
- package/dist/stories/HighlightRippleDot.stories.js.map +0 -1
- package/dist/stories/Icon.stories.js +0 -19
- package/dist/stories/Icon.stories.js.map +0 -1
- package/dist/stories/InlineSelector.stories.js +0 -16
- package/dist/stories/InlineSelector.stories.js.map +0 -1
- package/dist/stories/Input.stories.js +0 -235
- package/dist/stories/Input.stories.js.map +0 -1
- package/dist/stories/InputSelect.stories.js +0 -28
- package/dist/stories/InputSelect.stories.js.map +0 -1
- package/dist/stories/InputTextArea.stories.js +0 -23
- package/dist/stories/InputTextArea.stories.js.map +0 -1
- package/dist/stories/MiniTag.stories.js +0 -44
- package/dist/stories/MiniTag.stories.js.map +0 -1
- package/dist/stories/Playground.stories.js +0 -14
- package/dist/stories/Playground.stories.js.map +0 -1
- package/dist/stories/ProgressBar.stories.js +0 -21
- package/dist/stories/ProgressBar.stories.js.map +0 -1
- package/dist/stories/RadioButton.stories.js +0 -36
- package/dist/stories/RadioButton.stories.js.map +0 -1
- package/dist/stories/RadioButtonSimple.stories.js +0 -40
- package/dist/stories/RadioButtonSimple.stories.js.map +0 -1
- package/dist/stories/SimpleAlert.stories.js +0 -19
- package/dist/stories/SimpleAlert.stories.js.map +0 -1
- package/dist/stories/Slider.stories.js +0 -70
- package/dist/stories/Slider.stories.js.map +0 -1
- package/dist/stories/Switch.stories.js +0 -35
- package/dist/stories/Switch.stories.js.map +0 -1
- package/dist/stories/TabHeader.stories.js +0 -48
- package/dist/stories/TabHeader.stories.js.map +0 -1
- package/dist/stories/TableResults.stories.js +0 -717
- package/dist/stories/TableResults.stories.js.map +0 -1
- package/dist/stories/TagScope.stories.js +0 -16
- package/dist/stories/TagScope.stories.js.map +0 -1
- package/dist/stories/TestimonialCard.stories.js +0 -24
- package/dist/stories/TestimonialCard.stories.js.map +0 -1
- package/dist/stories/Toast.stories.js +0 -51
- package/dist/stories/Toast.stories.js.map +0 -1
- package/dist/stories/Toggle.stories.js +0 -42
- package/dist/stories/Toggle.stories.js.map +0 -1
- package/dist/stories/Tooltip.stories.js +0 -108
- package/dist/stories/Tooltip.stories.js.map +0 -1
- package/dist/util/GeneralFunctions.js +0 -29
- package/dist/util/GeneralFunctions.js.map +0 -1
- package/dist/util/imageLoader.js +0 -52
- package/dist/util/imageLoader.js.map +0 -1
- package/postcss.config.js +0 -8
- package/src/assets/images/multifamily-units.svg +0 -10
- package/src/assets/images/policy-studio.svg +0 -15
- package/src/components/playground/PsScrollBar.vue +0 -320
- package/src/contents/ComparisonData.ts +0 -378
- package/src/contents/FlexibleData.ts +0 -502
- package/src/contents/ResultsData.ts +0 -531
- package/src/stories/Accordion.stories.ts +0 -59
- package/src/stories/BadgeWithIcon.stories.ts +0 -31
- package/src/stories/BarChart.stories.ts +0 -17
- package/src/stories/Breadcrumb.stories.ts +0 -22
- package/src/stories/Button.stories.ts +0 -48
- package/src/stories/Button.vue +0 -59
- package/src/stories/CardInfos.stories.ts +0 -15
- package/src/stories/ChartLegend.stories.ts +0 -15
- package/src/stories/Checkbox.stories.ts +0 -45
- package/src/stories/CheckboxSimple.stories.ts +0 -49
- package/src/stories/Chips.stories.ts +0 -33
- package/src/stories/ClimateZoneBadge.stories.ts +0 -18
- package/src/stories/Colors.mdx +0 -70
- package/src/stories/CostEffectBar.stories.ts +0 -24
- package/src/stories/Datatable.stories.ts +0 -53
- package/src/stories/DateCardInfo.stories.ts +0 -20
- package/src/stories/Dialog.stories.ts +0 -131
- package/src/stories/Draggable.stories.ts +0 -23
- package/src/stories/Dropdown.stories.ts +0 -100
- package/src/stories/DropdownList.stories.ts +0 -213
- package/src/stories/ElevationSystem.mdx +0 -41
- package/src/stories/Header.stories.ts +0 -42
- package/src/stories/Header.vue +0 -77
- package/src/stories/HighlightRippleDot.stories.ts +0 -16
- package/src/stories/Icon.stories.ts +0 -23
- package/src/stories/InlineSelector.stories.ts +0 -18
- package/src/stories/Input.stories.ts +0 -243
- package/src/stories/InputSelect.stories.ts +0 -31
- package/src/stories/InputTextArea.stories.ts +0 -25
- package/src/stories/Introduction.mdx +0 -211
- package/src/stories/MiniTag.stories.ts +0 -59
- package/src/stories/Playground.stories.ts +0 -16
- package/src/stories/ProgressBar.stories.ts +0 -24
- package/src/stories/RadioButton.stories.ts +0 -40
- package/src/stories/RadioButtonSimple.stories.ts +0 -43
- package/src/stories/SimpleAlert.stories.ts +0 -22
- package/src/stories/Slider.stories.ts +0 -79
- package/src/stories/Switch.stories.ts +0 -39
- package/src/stories/TabHeader.stories.ts +0 -57
- package/src/stories/TableResults.stories.ts +0 -728
- package/src/stories/TagScope.stories.ts +0 -17
- package/src/stories/TestimonialCard.stories.ts +0 -27
- package/src/stories/Toast.stories.ts +0 -52
- package/src/stories/Toggle.stories.ts +0 -48
- package/src/stories/Tooltip.stories.ts +0 -114
- package/src/stories/Typography.mdx +0 -212
- package/src/stories/assets/code-brackets.svg +0 -1
- package/src/stories/assets/colors.svg +0 -1
- package/src/stories/assets/comments.svg +0 -1
- package/src/stories/assets/direction.svg +0 -1
- package/src/stories/assets/flow.svg +0 -1
- package/src/stories/assets/plugin.svg +0 -1
- package/src/stories/assets/repo.svg +0 -1
- package/src/stories/assets/stackalt.svg +0 -1
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- package/webpack.config.js +0 -36
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
class="psui-el-switch"
|
|
4
|
-
:class="[getComponentClass, {
|
|
4
|
+
:class="[getComponentClass, { disabled: disabled }]"
|
|
5
5
|
@click="change()"
|
|
6
6
|
>
|
|
7
7
|
<input
|
|
@@ -15,59 +15,58 @@
|
|
|
15
15
|
</div>
|
|
16
16
|
</template>
|
|
17
17
|
|
|
18
|
-
<script>
|
|
18
|
+
<script setup>
|
|
19
19
|
//FIGMA CONTROLS & SELECTORS https://www.figma.com/file/Tto8hrNlSfuPcwd1pfqogF/%E2%9A%A1%EF%B8%8F-Design-System?node-id=1768%3A64852
|
|
20
|
+
import { defineProps, defineEmits } from 'vue'
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* It sets the value of the switch button.
|
|
32
|
-
*/
|
|
33
|
-
value:{
|
|
34
|
-
type: Boolean,
|
|
35
|
-
},
|
|
36
|
-
backgroundColor: {
|
|
37
|
-
type: String,
|
|
38
|
-
default:'psui-bg-green-20'
|
|
39
|
-
},
|
|
40
|
-
/**
|
|
41
|
-
* It sets disabling mode.
|
|
42
|
-
*/
|
|
43
|
-
disabled:{
|
|
44
|
-
type: Boolean,
|
|
45
|
-
default: false
|
|
46
|
-
},
|
|
47
|
-
/**
|
|
48
|
-
* It sets the size of the switch button. eg: small and big.
|
|
49
|
-
*/
|
|
50
|
-
size:{
|
|
51
|
-
type: String,
|
|
52
|
-
default: 'big',
|
|
53
|
-
validator: (value)=> ['small', 'big'].includes(value)
|
|
54
|
-
}
|
|
22
|
+
const emit = defineEmits('change', 'update:value')
|
|
23
|
+
|
|
24
|
+
const props = defineProps({
|
|
25
|
+
/**
|
|
26
|
+
* It sets the label of the switch button.
|
|
27
|
+
*/
|
|
28
|
+
label: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: '',
|
|
55
31
|
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
getComponentClass(){
|
|
62
|
-
return `size-${this.size}`
|
|
63
|
-
}
|
|
32
|
+
/**
|
|
33
|
+
* It sets the value of the switch button.
|
|
34
|
+
*/
|
|
35
|
+
value: {
|
|
36
|
+
type: Boolean,
|
|
64
37
|
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
38
|
+
backgroundColor: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: 'psui-bg-green-20',
|
|
41
|
+
},
|
|
42
|
+
/**
|
|
43
|
+
* It sets disabling mode.
|
|
44
|
+
*/
|
|
45
|
+
disabled: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: false,
|
|
48
|
+
},
|
|
49
|
+
/**
|
|
50
|
+
* It sets the size of the switch button. eg: small and big.
|
|
51
|
+
*/
|
|
52
|
+
size: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: 'big',
|
|
55
|
+
validator: (value) => ['small', 'big'].includes(value),
|
|
56
|
+
},
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
const getToggleClass = () => {
|
|
60
|
+
if (props.disabled) return 'toggle-false'
|
|
61
|
+
return props.value ? `toggle-true ${props.backgroundColor}` : 'toggle-false psui-bg-gray-40'
|
|
62
|
+
}
|
|
73
63
|
|
|
64
|
+
const getComponentClass = () => {
|
|
65
|
+
return `size-${props.size}`
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const change = () => {
|
|
69
|
+
emit('update:value', !props.value)
|
|
70
|
+
emit('change', !props.value)
|
|
71
|
+
}
|
|
72
|
+
</script>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="psui-el-toggle"
|
|
4
|
-
role="group"
|
|
2
|
+
<div
|
|
3
|
+
class="psui-el-toggle"
|
|
4
|
+
role="group"
|
|
5
5
|
>
|
|
6
|
-
<button
|
|
6
|
+
<button
|
|
7
7
|
type="button"
|
|
8
8
|
v-for="(item, index) in items"
|
|
9
9
|
:key="getKeyValue(item) + index"
|
|
@@ -15,55 +15,58 @@
|
|
|
15
15
|
</div>
|
|
16
16
|
</template>
|
|
17
17
|
|
|
18
|
-
<script>
|
|
18
|
+
<script setup>
|
|
19
19
|
//FIGMA CONTROLS & SELECTORS https://www.figma.com/file/Tto8hrNlSfuPcwd1pfqogF/%E2%9A%A1%EF%B8%8F-Design-System?node-id=1768%3A64852
|
|
20
|
+
import { defineProps, defineEmits } from 'vue'
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
/**
|
|
43
|
-
* It sets the key value of your items if needed.
|
|
44
|
-
*/
|
|
45
|
-
keyValue: {
|
|
46
|
-
type: [String, Function],
|
|
47
|
-
default: 'value'
|
|
48
|
-
}
|
|
22
|
+
const emit = defineEmits(['change', 'update:selected'])
|
|
23
|
+
|
|
24
|
+
const props = defineProps({
|
|
25
|
+
/**
|
|
26
|
+
* It sets the items which will be used to create the toggle tab. See Figma - Controls & Selector for more information.
|
|
27
|
+
*/
|
|
28
|
+
items: {
|
|
29
|
+
type: Array,
|
|
30
|
+
required: true,
|
|
31
|
+
},
|
|
32
|
+
/**
|
|
33
|
+
* It sets the value selected.
|
|
34
|
+
*/
|
|
35
|
+
selected: {},
|
|
36
|
+
/**
|
|
37
|
+
* It sets the key label of your items if needed.
|
|
38
|
+
*/
|
|
39
|
+
keyLabel: {
|
|
40
|
+
type: [String, Function],
|
|
41
|
+
default: 'label',
|
|
49
42
|
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
43
|
+
/**
|
|
44
|
+
* It sets the key value of your items if needed.
|
|
45
|
+
*/
|
|
46
|
+
keyValue: {
|
|
47
|
+
type: [String, Function],
|
|
48
|
+
default: 'value',
|
|
49
|
+
},
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
const selectOption = (item) => {
|
|
53
|
+
emit('update:selected', item)
|
|
54
|
+
emit('change', item)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const getKeyLabel = (item) => {
|
|
58
|
+
if (typeof props.keyLabel == 'function') return props.keyLabel(item)
|
|
59
|
+
if (typeof item === 'object') return item[props.keyLabel]
|
|
60
|
+
return item
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const getKeyValue = (item) => {
|
|
64
|
+
if (typeof props.keyValue == 'function') return props.keyValue(item)
|
|
65
|
+
if (typeof item === 'object') return item[props.keyLabel]
|
|
66
|
+
return item
|
|
66
67
|
}
|
|
67
68
|
</script>
|
|
68
69
|
|
|
69
|
-
<style>
|
|
70
|
+
<style>
|
|
71
|
+
/* Please, use the file src/assets/scss/components/PsToggle.scss */
|
|
72
|
+
</style>
|
|
@@ -1,36 +1,34 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="psui-el-bar-chart">
|
|
3
|
-
<p
|
|
3
|
+
<p
|
|
4
4
|
v-if="showNumber"
|
|
5
5
|
class="psui-el-bar-chart-total"
|
|
6
6
|
>
|
|
7
7
|
{{ total }}
|
|
8
8
|
</p>
|
|
9
9
|
|
|
10
|
-
<div
|
|
10
|
+
<div
|
|
11
11
|
class="psui-el-bar-chart-bar"
|
|
12
|
-
:style="{width: `${fillWidth}%`}"
|
|
12
|
+
:style="{ width: `${fillWidth}%` }"
|
|
13
13
|
/>
|
|
14
14
|
</div>
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
|
-
<script>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
},
|
|
17
|
+
<script setup>
|
|
18
|
+
import { defineProps } from 'vue'
|
|
19
|
+
|
|
20
|
+
defineProps({
|
|
21
|
+
showNumber: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: true,
|
|
24
|
+
},
|
|
25
|
+
total: {
|
|
26
|
+
type: [String, Number],
|
|
27
|
+
default: '5,0',
|
|
28
|
+
},
|
|
29
|
+
fillWidth: {
|
|
30
|
+
type: Number,
|
|
31
|
+
default: 50,
|
|
33
32
|
},
|
|
34
|
-
|
|
35
|
-
}
|
|
33
|
+
})
|
|
36
34
|
</script>
|
|
@@ -37,70 +37,66 @@
|
|
|
37
37
|
</table>
|
|
38
38
|
</template>
|
|
39
39
|
|
|
40
|
-
<script>
|
|
41
|
-
|
|
42
|
-
export const alignment = ['center', 'right', 'left']
|
|
40
|
+
<script setup>
|
|
41
|
+
import { defineProps, computed } from 'vue'
|
|
43
42
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
type: {
|
|
51
|
-
type: String,
|
|
52
|
-
required: true,
|
|
53
|
-
validator: (value) => {
|
|
54
|
-
return ['simple', 'rich'].indexOf(value) !== -1
|
|
55
|
-
},
|
|
43
|
+
const props = defineProps({
|
|
44
|
+
type: {
|
|
45
|
+
type: String,
|
|
46
|
+
required: true,
|
|
47
|
+
validator: (value) => {
|
|
48
|
+
return ['simple', 'rich'].indexOf(value) !== -1
|
|
56
49
|
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
},
|
|
73
|
-
/**
|
|
74
|
-
* It sets the values which will be use to render the footer.
|
|
75
|
-
*/
|
|
76
|
-
footer: {
|
|
77
|
-
type: Array,
|
|
78
|
-
},
|
|
79
|
-
/**
|
|
80
|
-
* It sets the alignment of the whole context.
|
|
81
|
-
*/
|
|
82
|
-
align: {
|
|
83
|
-
type: String,
|
|
84
|
-
default: 'left',
|
|
85
|
-
validator: (value) => {
|
|
86
|
-
return ['center', 'right', 'left'].indexOf(value) !== -1
|
|
87
|
-
}
|
|
50
|
+
},
|
|
51
|
+
/**
|
|
52
|
+
* It sets the values which will be use to render the header.
|
|
53
|
+
*/
|
|
54
|
+
header: {
|
|
55
|
+
type: Array,
|
|
56
|
+
required: true,
|
|
57
|
+
},
|
|
58
|
+
/**
|
|
59
|
+
* It sets the values which will be use to render the body.
|
|
60
|
+
*/
|
|
61
|
+
data: {
|
|
62
|
+
type: Array,
|
|
63
|
+
default() {
|
|
64
|
+
return []
|
|
88
65
|
},
|
|
89
|
-
/**
|
|
90
|
-
* It sets additional styling if needed.
|
|
91
|
-
*/
|
|
92
|
-
cssStyle: {
|
|
93
|
-
type: String,
|
|
94
|
-
default: 'psui-text-gray-60'
|
|
95
|
-
}
|
|
96
66
|
},
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
67
|
+
/**
|
|
68
|
+
* It sets the values which will be use to render the footer.
|
|
69
|
+
*/
|
|
70
|
+
footer: {
|
|
71
|
+
type: Array,
|
|
72
|
+
default: () => [],
|
|
73
|
+
},
|
|
74
|
+
/**
|
|
75
|
+
* It sets the alignment of the whole context.
|
|
76
|
+
*/
|
|
77
|
+
align: {
|
|
78
|
+
type: String,
|
|
79
|
+
default: 'left',
|
|
80
|
+
validator: (value) => {
|
|
81
|
+
return ['center', 'right', 'left'].indexOf(value) !== -1
|
|
102
82
|
},
|
|
103
83
|
},
|
|
104
|
-
|
|
84
|
+
/**
|
|
85
|
+
* It sets additional styling if needed.
|
|
86
|
+
*/
|
|
87
|
+
cssStyle: {
|
|
88
|
+
type: String,
|
|
89
|
+
default: 'psui-text-gray-60',
|
|
90
|
+
},
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
const cssAlign = computed(() => {
|
|
94
|
+
if (props.align === 'right') return `psui-text-right ${props.cssStyle}`
|
|
95
|
+
if (props.align === 'center') return `psui-text-center ${props.cssStyle}`
|
|
96
|
+
return `psui-text-left ${props.cssStyle}`
|
|
97
|
+
})
|
|
105
98
|
</script>
|
|
106
|
-
|
|
99
|
+
|
|
100
|
+
<style>
|
|
101
|
+
/* Please, use the file src/assets/scss/components/PsDataTable.scss */
|
|
102
|
+
</style>
|
|
@@ -15,11 +15,7 @@
|
|
|
15
15
|
</span>
|
|
16
16
|
<div
|
|
17
17
|
class="psui-flex psui-items-center"
|
|
18
|
-
:class="
|
|
19
|
-
el[Object.keys(el)[1]] >= 0
|
|
20
|
-
? 'psui-text-green-70'
|
|
21
|
-
: 'psui-text-red-70'
|
|
22
|
-
"
|
|
18
|
+
:class="el[Object.keys(el)[1]] >= 0 ? 'psui-text-green-70' : 'psui-text-red-70'"
|
|
23
19
|
>
|
|
24
20
|
<i
|
|
25
21
|
v-if="el[Object.keys(el)[1]] >= 0"
|
|
@@ -29,37 +25,27 @@
|
|
|
29
25
|
v-else
|
|
30
26
|
class="material-icons"
|
|
31
27
|
>arrow_downward</i>
|
|
32
|
-
<span>
|
|
33
|
-
{{
|
|
34
|
-
(
|
|
35
|
-
(el[Object.keys(el)[1]] / el[Object.keys(el)[0]]) *
|
|
36
|
-
100
|
|
37
|
-
).toFixed(2)
|
|
38
|
-
}}%
|
|
39
|
-
</span>
|
|
28
|
+
<span> {{ ((el[Object.keys(el)[1]] / el[Object.keys(el)[0]]) * 100).toFixed(2) }}% </span>
|
|
40
29
|
</div>
|
|
41
30
|
</div>
|
|
42
|
-
<span class="psui-text-gray-50">{{
|
|
43
|
-
el[Object.keys(el)[0]].toFixed(6)
|
|
44
|
-
}}</span>
|
|
31
|
+
<span class="psui-text-gray-50">{{ el[Object.keys(el)[0]].toFixed(6) }}</span>
|
|
45
32
|
</td>
|
|
46
33
|
</tr>
|
|
47
34
|
</tbody>
|
|
48
35
|
</template>
|
|
49
36
|
|
|
50
|
-
<script>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
},
|
|
37
|
+
<script setup>
|
|
38
|
+
import { defineProps } from 'vue'
|
|
39
|
+
|
|
40
|
+
defineProps({
|
|
41
|
+
data: {
|
|
42
|
+
type: Array,
|
|
43
|
+
required: true,
|
|
44
|
+
default: () => {
|
|
45
|
+
return []
|
|
60
46
|
},
|
|
61
47
|
},
|
|
62
|
-
}
|
|
48
|
+
})
|
|
63
49
|
</script>
|
|
64
50
|
|
|
65
51
|
<style scoped>
|
|
@@ -67,4 +53,4 @@ export default {
|
|
|
67
53
|
font-size: 15px;
|
|
68
54
|
margin-bottom: 2px;
|
|
69
55
|
}
|
|
70
|
-
</style>
|
|
56
|
+
</style>
|