@policystudio/policy-studio-ui-vue 1.1.90-beta.5 → 1.1.90-beta.50
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 -8
- package/.github/workflows/deploy-storybook.yml +4 -4
- package/.nvmrc +1 -0
- package/dist/css/psui_styles_output.css +6639 -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/{.storybook → doc/.storybook}/main.ts +8 -2
- package/{.storybook → doc/.storybook}/preview.ts +2 -3
- package/doc/package-lock.json +22653 -0
- package/doc/package.json +71 -0
- package/{src → doc}/shims-vue.d.ts +0 -5
- package/{src → doc/src}/stories/Accordion.stories.ts +2 -3
- package/{src → doc/src}/stories/BadgeWithIcon.stories.ts +1 -1
- package/{src → doc/src}/stories/BarChart.stories.ts +1 -1
- package/{src → doc/src}/stories/Breadcrumb.stories.ts +1 -1
- package/doc/src/stories/Button.stories.ts +130 -0
- package/{src → doc/src}/stories/CardInfos.stories.ts +1 -1
- package/{src → doc/src}/stories/ChartLegend.stories.ts +1 -1
- package/{src → doc/src}/stories/Checkbox.stories.ts +1 -1
- package/{src → doc/src}/stories/CheckboxSimple.stories.ts +1 -1
- package/{src → doc/src}/stories/Chips.stories.ts +1 -4
- package/{src → doc/src}/stories/ClimateZoneBadge.stories.ts +2 -1
- package/doc/src/stories/Collapse.stories.ts +46 -0
- package/{src → doc/src}/stories/CostEffectBar.stories.ts +2 -1
- package/{src → doc/src}/stories/Datatable.stories.ts +5 -2
- package/{src → doc/src}/stories/DateCardInfo.stories.ts +1 -1
- package/{src → doc/src}/stories/Dialog.stories.ts +2 -2
- package/{src → doc/src}/stories/Draggable.stories.ts +3 -2
- package/{src → doc/src}/stories/Dropdown.stories.ts +4 -3
- package/{src → doc/src}/stories/DropdownList.stories.ts +4 -2
- package/{src → doc/src}/stories/HighlightRippleDot.stories.ts +3 -2
- package/{src → doc/src}/stories/Icon.stories.ts +3 -1
- package/{src → doc/src}/stories/InlineSelector.stories.ts +1 -1
- package/{src → doc/src}/stories/Input.stories.ts +7 -4
- package/{src → doc/src}/stories/InputSelect.stories.ts +3 -2
- package/{src → doc/src}/stories/InputTextArea.stories.ts +1 -1
- package/{src → doc/src}/stories/MiniTag.stories.ts +9 -2
- package/{src → doc/src}/stories/ProgressBar.stories.ts +3 -2
- package/{src → doc/src}/stories/RadioButton.stories.ts +2 -2
- package/{src → doc/src}/stories/RadioButtonSimple.stories.ts +1 -1
- package/{src → doc/src}/stories/SimpleAlert.stories.ts +3 -2
- package/{src → doc/src}/stories/Slider.stories.ts +6 -2
- package/{src → doc/src}/stories/Switch.stories.ts +2 -2
- package/{src → doc/src}/stories/TabHeader.stories.ts +6 -1
- package/{src → doc/src}/stories/TableResults.stories.ts +11 -7
- package/{src → doc/src}/stories/TagScope.stories.ts +3 -2
- package/{src → doc/src}/stories/TestimonialCard.stories.ts +3 -3
- package/{src → doc/src}/stories/Toast.stories.ts +2 -2
- package/{src → doc/src}/stories/Toggle.stories.ts +6 -3
- package/{src → doc/src}/stories/Tooltip.stories.ts +3 -3
- package/doc/tsconfig.json +17 -0
- package/package.json +13 -28
- package/scripts/gulp.js +11 -0
- package/src/assets/scss/base.scss +3 -34
- package/src/assets/scss/components/PsAccordion.scss +1 -1
- package/src/assets/scss/components/PsChips.scss +9 -3
- package/src/assets/scss/components/PsCollapse.scss +71 -0
- package/src/assets/scss/components/PsDataTable.scss +1 -1
- package/src/assets/scss/components/PsDropdownList.scss +1 -1
- package/src/assets/scss/components/PsTableResults.scss +28 -1
- package/src/assets/scss/components/PsTooltip.scss +2 -1
- package/src/components/accordion/PsAccordionItem.vue +88 -74
- package/src/components/badges-and-tags/PsBadgeWithIcon.vue +31 -34
- package/src/components/badges-and-tags/PsCardInfos.vue +39 -41
- package/src/components/badges-and-tags/PsChartLegend.vue +46 -51
- package/src/components/badges-and-tags/PsClimateZoneBadge.vue +13 -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 +19 -26
- package/src/components/buttons/PsButton.vue +61 -62
- package/src/components/chips/PsChips.vue +112 -101
- package/src/components/collapse/PsCollapse.vue +124 -0
- 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 +98 -99
- package/src/components/controls/PsRadioButton.vue +65 -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 +52 -50
- package/src/components/data-graphics/PsBarChart.vue +18 -21
- package/src/components/datatable/PsDataTable.vue +56 -60
- package/src/components/datatable/PsDataTableItem.vue +13 -28
- package/src/components/forms/PsDropdown.vue +166 -162
- package/src/components/forms/PsDropdownList.vue +133 -130
- package/src/components/forms/PsInput.vue +154 -153
- package/src/components/forms/PsInputSelect.vue +91 -92
- package/src/components/forms/PsInputTextArea.vue +70 -71
- package/src/components/navigations/PsBreadcrumb.vue +25 -34
- package/src/components/notifications/PsDialog.vue +57 -56
- package/src/components/notifications/PsSimpleAlert.vue +27 -29
- package/src/components/notifications/PsToast.vue +40 -39
- package/src/components/table-results/PsTableResults.vue +461 -468
- package/src/components/table-results/PsTableResultsBody.vue +66 -67
- package/src/components/table-results/PsTableResultsHead.vue +70 -67
- package/src/components/table-results/PsTableResultsHeadComparison.vue +67 -64
- package/src/components/table-results/PsTableResultsHeadFlexible.vue +94 -67
- 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 +41 -45
- package/src/components/tooltip/PsTooltip.vue +111 -116
- package/src/components/ui/PsDotLoader.vue +1 -5
- package/src/components/ui/PsIcon.vue +143 -132
- package/src/index.ts +60 -67
- package/src/tsconfig.json +12 -0
- package/src/types/index.d.ts +6 -0
- package/src/util/{GeneralFunctions.ts → GeneralFunctions.js} +12 -3
- package/src/util/directives.ts +24 -0
- package/src/util/{imageLoader.ts → imageLoader.js} +7 -0
- package/tailwind.config.js +1 -1
- package/tsconfig.json +18 -13
- package/.storybook/eventBus.ts +0 -26
- package/babel.config.js +0 -17
- package/dist/css/psui_styles.css +0 -4647
- package/postcss.config.js +0 -8
- package/src/components/playground/PsScrollBar.vue +0 -320
- package/src/stories/Button.stories.ts +0 -48
- package/src/stories/Button.vue +0 -59
- package/src/stories/Header.stories.ts +0 -41
- package/src/stories/Header.vue +0 -77
- package/src/stories/Playground.stories.ts +0 -16
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- package/webpack.config.js +0 -22
- /package/{.storybook → doc/.storybook}/PolicyStudio.ts +0 -0
- /package/{.storybook → doc/.storybook}/manager.ts +0 -0
- /package/{src → doc/src}/assets/images/multifamily-units.svg +0 -0
- /package/{src → doc/src}/assets/images/policy-studio.svg +0 -0
- /package/{src → doc/src}/contents/ComparisonData.ts +0 -0
- /package/{src → doc/src}/contents/FlexibleData.ts +0 -0
- /package/{src → doc/src}/contents/ResultsData.ts +0 -0
- /package/{src → doc/src}/stories/Colors.mdx +0 -0
- /package/{src → doc/src}/stories/ElevationSystem.mdx +0 -0
- /package/{src → doc/src}/stories/Introduction.mdx +0 -0
- /package/{src → doc/src}/stories/Typography.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,16 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
class="psui-el-input-select"
|
|
4
|
-
:class="[getComponentClass, {
|
|
4
|
+
:class="[getComponentClass, { selected: selectedClass }, { disabled: disabled }]"
|
|
5
5
|
>
|
|
6
6
|
<label
|
|
7
7
|
:for="label"
|
|
8
8
|
v-if="label"
|
|
9
9
|
>{{ label }}</label>
|
|
10
10
|
<div class="psui-el-input-select-wrapper">
|
|
11
|
-
<select
|
|
11
|
+
<select
|
|
12
12
|
:name="label"
|
|
13
|
-
:id="label"
|
|
13
|
+
:id="label"
|
|
14
14
|
v-model="childValue"
|
|
15
15
|
>
|
|
16
16
|
<option
|
|
@@ -37,97 +37,96 @@
|
|
|
37
37
|
</div>
|
|
38
38
|
</template>
|
|
39
39
|
|
|
40
|
-
<script>
|
|
40
|
+
<script setup>
|
|
41
|
+
import { ref, computed } from 'vue'
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
items: {
|
|
49
|
-
required: true
|
|
50
|
-
},
|
|
51
|
-
value: {
|
|
52
|
-
default: '',
|
|
53
|
-
required: true
|
|
54
|
-
},
|
|
55
|
-
/**
|
|
56
|
-
* It sets the value label of the select input if needed.
|
|
57
|
-
*/
|
|
58
|
-
label: {
|
|
59
|
-
default: ''
|
|
60
|
-
},
|
|
61
|
-
/**
|
|
62
|
-
* It sets a o optional label below the select input.
|
|
63
|
-
*/
|
|
64
|
-
optionalLabel:{
|
|
65
|
-
default:''
|
|
66
|
-
},
|
|
67
|
-
/**
|
|
68
|
-
* It sets the key label of your items if needed.
|
|
69
|
-
*/
|
|
70
|
-
keyLabel: {
|
|
71
|
-
default: 'label'
|
|
72
|
-
},
|
|
73
|
-
/**
|
|
74
|
-
* It sets the key value of yout items if needed.
|
|
75
|
-
*/
|
|
76
|
-
keyValue: {
|
|
77
|
-
default: 'value'
|
|
78
|
-
},
|
|
79
|
-
/**
|
|
80
|
-
* It disables the select input. All mouse events are disabled.
|
|
81
|
-
*/
|
|
82
|
-
disabled: {
|
|
83
|
-
type: Boolean,
|
|
84
|
-
default: false
|
|
85
|
-
},
|
|
86
|
-
/**
|
|
87
|
-
* It sets the layout of the select input. eg: default and mini.
|
|
88
|
-
*/
|
|
89
|
-
layout:{
|
|
90
|
-
type: String,
|
|
91
|
-
default: 'default',
|
|
92
|
-
validator: (value) => ['default','mini'].includes(value)
|
|
93
|
-
}
|
|
43
|
+
const props = defineProps({
|
|
44
|
+
/**
|
|
45
|
+
* It sets the items which will be rendered within the select input.
|
|
46
|
+
*/
|
|
47
|
+
items: {
|
|
48
|
+
required: true,
|
|
94
49
|
},
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
50
|
+
value: {
|
|
51
|
+
default: '',
|
|
52
|
+
required: true,
|
|
99
53
|
},
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
54
|
+
/**
|
|
55
|
+
* It sets the value label of the select input if needed.
|
|
56
|
+
*/
|
|
57
|
+
label: {
|
|
58
|
+
default: '',
|
|
59
|
+
},
|
|
60
|
+
/**
|
|
61
|
+
* It sets a o optional label below the select input.
|
|
62
|
+
*/
|
|
63
|
+
optionalLabel: {
|
|
64
|
+
default: '',
|
|
65
|
+
},
|
|
66
|
+
/**
|
|
67
|
+
* It sets the key label of your items if needed.
|
|
68
|
+
*/
|
|
69
|
+
keyLabel: {
|
|
70
|
+
default: 'label',
|
|
71
|
+
},
|
|
72
|
+
/**
|
|
73
|
+
* It sets the key value of yout items if needed.
|
|
74
|
+
*/
|
|
75
|
+
keyValue: {
|
|
76
|
+
default: 'value',
|
|
77
|
+
},
|
|
78
|
+
/**
|
|
79
|
+
* It disables the select input. All mouse events are disabled.
|
|
80
|
+
*/
|
|
81
|
+
disabled: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: false,
|
|
84
|
+
},
|
|
85
|
+
/**
|
|
86
|
+
* It sets the layout of the select input. eg: default and mini.
|
|
87
|
+
*/
|
|
88
|
+
layout: {
|
|
89
|
+
type: String,
|
|
90
|
+
default: 'default',
|
|
91
|
+
validator: (value) => ['default', 'mini'].includes(value),
|
|
92
|
+
},
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
const emit = defineEmits('input', 'change')
|
|
96
|
+
|
|
97
|
+
const selectedClass = ref(false)
|
|
98
|
+
|
|
99
|
+
const getComponentClass = computed(() => {
|
|
100
|
+
return `layout-${props.layout}`
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
const childValue = computed({
|
|
104
|
+
get() {
|
|
105
|
+
return props.value
|
|
131
106
|
},
|
|
132
|
-
|
|
107
|
+
set(value) {
|
|
108
|
+
if (isString.value) return emit('input', value)
|
|
109
|
+
const finded = find(props.items, { [props.keyValue]: value })
|
|
110
|
+
emit('input', value)
|
|
111
|
+
emit('change', finded)
|
|
112
|
+
selectedClass.value = true
|
|
113
|
+
},
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
const isString = computed(() => {
|
|
117
|
+
return props.items.length > 0 && typeof props.items[0] === 'string'
|
|
118
|
+
})
|
|
119
|
+
|
|
120
|
+
const getItems = computed(() => {
|
|
121
|
+
if (props.items.length > 0 && typeof props.items[0] === 'string') {
|
|
122
|
+
return props.items.map((item) => {
|
|
123
|
+
return {
|
|
124
|
+
[props.keyLabel]: item,
|
|
125
|
+
[props.keyValue]: item,
|
|
126
|
+
}
|
|
127
|
+
})
|
|
128
|
+
} else {
|
|
129
|
+
return props.items
|
|
130
|
+
}
|
|
131
|
+
})
|
|
133
132
|
</script>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
class="psui-el-input-textarea"
|
|
4
|
-
:class="[{
|
|
4
|
+
:class="[{ disabled: disabled }]"
|
|
5
5
|
>
|
|
6
6
|
<div class="psui-el-input-textarea-wrapper">
|
|
7
7
|
<label
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
:value="value"
|
|
16
16
|
@focus="onInputFocus"
|
|
17
17
|
@blur="onInputBlur"
|
|
18
|
-
@input="
|
|
19
|
-
@change="
|
|
18
|
+
@input="emit('input', $event)"
|
|
19
|
+
@change="emit('change', $event)"
|
|
20
20
|
:rows="rows"
|
|
21
21
|
:placeholder="placeholder"
|
|
22
22
|
:readonly="disabled"
|
|
@@ -31,74 +31,73 @@
|
|
|
31
31
|
</div>
|
|
32
32
|
</template>
|
|
33
33
|
|
|
34
|
-
<script>
|
|
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
|
-
* It disabled the textarea input. All mouse events are disabled.
|
|
86
|
-
*/
|
|
87
|
-
disabled: {
|
|
88
|
-
type: Boolean,
|
|
89
|
-
default: false,
|
|
90
|
-
}
|
|
34
|
+
<script setup>
|
|
35
|
+
|
|
36
|
+
defineProps({
|
|
37
|
+
/**
|
|
38
|
+
* It sets the placeholder of the textarea input.
|
|
39
|
+
*/
|
|
40
|
+
placeholder: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: '',
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* It sets the value selected of the textarea input.
|
|
46
|
+
*/
|
|
47
|
+
value: {
|
|
48
|
+
required: true,
|
|
49
|
+
},
|
|
50
|
+
/**
|
|
51
|
+
* It sets the label of the textarea input.
|
|
52
|
+
*/
|
|
53
|
+
label: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: '',
|
|
56
|
+
},
|
|
57
|
+
/**
|
|
58
|
+
* It sets a optional label if needed.
|
|
59
|
+
*/
|
|
60
|
+
optionalLabel: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: '',
|
|
63
|
+
},
|
|
64
|
+
/**
|
|
65
|
+
* It sets aria-required property. eg: true or false.
|
|
66
|
+
*/
|
|
67
|
+
required: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: true,
|
|
70
|
+
},
|
|
71
|
+
/**
|
|
72
|
+
* It sets the type of autocapitalize. See mdn web-doc for full information. default: sentences.
|
|
73
|
+
*/
|
|
74
|
+
autocapitalize: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: 'sentences',
|
|
77
|
+
},
|
|
78
|
+
/**
|
|
79
|
+
* It sets the size of the textarea input.
|
|
80
|
+
*/
|
|
81
|
+
rows: {
|
|
82
|
+
type: Number,
|
|
83
|
+
default: 5,
|
|
91
84
|
},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
85
|
+
/**
|
|
86
|
+
* It disabled the textarea input. All mouse events are disabled.
|
|
87
|
+
*/
|
|
88
|
+
disabled: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: false,
|
|
91
|
+
},
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
const emit = defineEmits(['focus', 'blur', 'input', 'change'])
|
|
95
|
+
|
|
96
|
+
const onInputFocus = ($event) => {
|
|
97
|
+
emit('focus', $event)
|
|
102
98
|
}
|
|
103
|
-
</script>
|
|
104
99
|
|
|
100
|
+
const onInputBlur = ($event) => {
|
|
101
|
+
emit('blur', $event)
|
|
102
|
+
}
|
|
103
|
+
</script>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<template>
|
|
1
|
+
<template>
|
|
2
2
|
<nav
|
|
3
3
|
v-if="items.length > 0"
|
|
4
4
|
aria-label="breadcrumb"
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
<router-link
|
|
14
14
|
v-if="item.route && !item.isReset"
|
|
15
15
|
:to="item.route"
|
|
16
|
-
@click="onNavigate(item)"
|
|
17
16
|
>
|
|
18
17
|
{{ item.title }}
|
|
19
18
|
</router-link>
|
|
@@ -21,7 +20,7 @@
|
|
|
21
20
|
<span
|
|
22
21
|
v-else-if="item.isReset"
|
|
23
22
|
class="psui-flex psui-items-center psui-cursor-pointer psui-text-blue-60 psui-font-bold"
|
|
24
|
-
@click="
|
|
23
|
+
@click="emit('reset-state', item)"
|
|
25
24
|
>
|
|
26
25
|
<PsIcon
|
|
27
26
|
size="18"
|
|
@@ -32,8 +31,8 @@
|
|
|
32
31
|
{{ item.title }}
|
|
33
32
|
</span>
|
|
34
33
|
|
|
35
|
-
<span
|
|
36
|
-
v-else
|
|
34
|
+
<span
|
|
35
|
+
v-else
|
|
37
36
|
:title="item.title"
|
|
38
37
|
>
|
|
39
38
|
{{ item.title }}
|
|
@@ -43,36 +42,28 @@
|
|
|
43
42
|
</nav>
|
|
44
43
|
</template>
|
|
45
44
|
|
|
46
|
-
<script>
|
|
45
|
+
<script setup>
|
|
47
46
|
import PsIcon from '../ui/PsIcon.vue'
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
type: [Array, Boolean],
|
|
57
|
-
},
|
|
58
|
-
/**
|
|
59
|
-
* It sets the li style.
|
|
60
|
-
*/
|
|
61
|
-
liClass: {
|
|
62
|
-
type: String,
|
|
63
|
-
default: 'psui-text-small psui-text-gray-60'
|
|
64
|
-
}
|
|
47
|
+
|
|
48
|
+
defineProps({
|
|
49
|
+
/**
|
|
50
|
+
* It sets the items which will be rendered.
|
|
51
|
+
*/
|
|
52
|
+
items: {
|
|
53
|
+
type: [Array, Boolean],
|
|
54
|
+
default: () => [],
|
|
65
55
|
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
56
|
+
/**
|
|
57
|
+
* It sets the li style.
|
|
58
|
+
*/
|
|
59
|
+
liClass: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: 'psui-text-small psui-text-gray-60',
|
|
62
|
+
},
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
const emit = defineEmits(['reset-state'])
|
|
75
66
|
|
|
76
|
-
|
|
67
|
+
</script>
|
|
77
68
|
|
|
78
|
-
|
|
69
|
+
<style></style>
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
<div
|
|
3
3
|
class="psui-el-dialog"
|
|
4
4
|
:class="getComponentClass"
|
|
5
|
-
>
|
|
5
|
+
>
|
|
6
6
|
<div class="psui-el-dialog-icon">
|
|
7
7
|
<i class="material-icons-round">{{ icon }}</i>
|
|
8
8
|
</div>
|
|
9
|
-
<div class="psui-el-dialog-wrapper">
|
|
9
|
+
<div class="psui-el-dialog-wrapper">
|
|
10
10
|
<div class="psui-el-dialog-default">
|
|
11
11
|
<slot>
|
|
12
12
|
<p class="psui-el-dialog-message">
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
</div>
|
|
20
20
|
</div>
|
|
21
21
|
<button
|
|
22
|
-
class="psui-el-dialog-close"
|
|
23
|
-
v-if="hasClose"
|
|
22
|
+
class="psui-el-dialog-close"
|
|
23
|
+
v-if="hasClose"
|
|
24
24
|
@click="onClose"
|
|
25
25
|
>
|
|
26
26
|
<i class="material-icons-round">close</i>
|
|
@@ -28,61 +28,62 @@
|
|
|
28
28
|
</div>
|
|
29
29
|
</template>
|
|
30
30
|
|
|
31
|
-
<script>
|
|
31
|
+
<script setup>
|
|
32
32
|
// Figma - 3. Inline Dialog https://www.figma.com/file/Tto8hrNlSfuPcwd1pfqogF/%E2%9A%A1%EF%B8%8F-Design-System?node-id=3694%3A55841
|
|
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
|
-
* 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/.
|
|
67
|
-
*/
|
|
68
|
-
icon: {
|
|
69
|
-
type: String,
|
|
70
|
-
default: 'info'
|
|
71
|
-
}
|
|
33
|
+
|
|
34
|
+
import { computed } from 'vue'
|
|
35
|
+
|
|
36
|
+
const props = defineProps({
|
|
37
|
+
/**
|
|
38
|
+
* It sets the theme of the dialog. eg: informative, success and alert.
|
|
39
|
+
*/
|
|
40
|
+
theme: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: 'informative',
|
|
43
|
+
validator: (value) => ['informative', 'success', 'alert'].includes(value),
|
|
44
|
+
},
|
|
45
|
+
/**
|
|
46
|
+
* It set the which will be displayed when component is rendered.
|
|
47
|
+
*/
|
|
48
|
+
message: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: '',
|
|
51
|
+
},
|
|
52
|
+
/**
|
|
53
|
+
* It sets the direction of the items within the dialog. See Figma Notifications for full information.
|
|
54
|
+
*/
|
|
55
|
+
layout: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: 'horizontal',
|
|
58
|
+
validator: (value) => ['horizontal', 'vertical'].includes(value),
|
|
59
|
+
},
|
|
60
|
+
/**
|
|
61
|
+
* It sets a close button if needed.
|
|
62
|
+
*/
|
|
63
|
+
hasClose: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: true,
|
|
72
66
|
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
67
|
+
/**
|
|
68
|
+
* 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/.
|
|
69
|
+
*/
|
|
70
|
+
icon: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: 'info',
|
|
78
73
|
},
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
const emit = defineEmits(['close'])
|
|
77
|
+
|
|
78
|
+
const getComponentClass = computed(() => {
|
|
79
|
+
return [`layout-${props.layout}`, `theme-${props.theme}`, `close-${props.hasClose ? 'on' : 'off'}`]
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
const onClose = () => {
|
|
83
|
+
emit('close')
|
|
84
84
|
}
|
|
85
85
|
</script>
|
|
86
86
|
|
|
87
|
-
<style>
|
|
88
|
-
|
|
87
|
+
<style>
|
|
88
|
+
/* Please, use the file src/assets/scss/components/PsDialog.scss */
|
|
89
|
+
</style>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div
|
|
3
3
|
class="psui-el-simple-alert"
|
|
4
4
|
v-bind="$attrs"
|
|
5
|
-
@click.stop="
|
|
5
|
+
@click.stop="emit('click')"
|
|
6
6
|
>
|
|
7
7
|
<PsIcon
|
|
8
8
|
:icon="icon"
|
|
@@ -15,41 +15,39 @@
|
|
|
15
15
|
<button
|
|
16
16
|
class="psui-el-simple-alert-button"
|
|
17
17
|
:class="buttonClass"
|
|
18
|
-
@click.stop="
|
|
18
|
+
@click.stop="emit('close')"
|
|
19
19
|
>
|
|
20
20
|
close
|
|
21
21
|
</button>
|
|
22
22
|
</div>
|
|
23
23
|
</template>
|
|
24
24
|
|
|
25
|
-
<script>
|
|
25
|
+
<script setup>
|
|
26
26
|
import PsIcon from '../ui/PsIcon.vue'
|
|
27
27
|
|
|
28
|
+
defineProps({
|
|
29
|
+
message: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: '',
|
|
32
|
+
},
|
|
33
|
+
icon: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: 'info',
|
|
36
|
+
},
|
|
37
|
+
iconClass: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: '',
|
|
40
|
+
},
|
|
41
|
+
buttonClass: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: '',
|
|
44
|
+
},
|
|
45
|
+
iconSize: {
|
|
46
|
+
type: [Number, String],
|
|
47
|
+
default: 24,
|
|
48
|
+
},
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
const emit = defineEmits(['click', 'close'])
|
|
28
52
|
|
|
29
|
-
export default {
|
|
30
|
-
name: 'PsSimpleAlert',
|
|
31
|
-
components: { PsIcon },
|
|
32
|
-
props: {
|
|
33
|
-
message: {
|
|
34
|
-
type: String,
|
|
35
|
-
default: ''
|
|
36
|
-
},
|
|
37
|
-
icon: {
|
|
38
|
-
type: String,
|
|
39
|
-
default: 'info'
|
|
40
|
-
},
|
|
41
|
-
iconClass:{
|
|
42
|
-
type:String,
|
|
43
|
-
default: ''
|
|
44
|
-
},
|
|
45
|
-
buttonClass:{
|
|
46
|
-
type:String,
|
|
47
|
-
default: ''
|
|
48
|
-
},
|
|
49
|
-
iconSize:{
|
|
50
|
-
type: [Number, String],
|
|
51
|
-
default: 24
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
}
|
|
55
53
|
</script>
|