@policystudio/policy-studio-ui-vue 1.1.89 → 1.1.90-beta.10
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 +74 -67
- package/.github/workflows/deploy-storybook.yml +1 -1
- package/.storybook/PolicyStudio.ts +11 -0
- package/.storybook/eventBus.ts +26 -0
- package/.storybook/main.ts +21 -0
- package/.storybook/manager.ts +7 -0
- package/dist/css/psui_styles.css +4028 -110346
- package/package.json +50 -34
- package/postcss.config.js +1 -1
- package/scripts/kill-port.sh +12 -0
- package/src/App.vue +30 -0
- package/src/assets/scss/base.scss +27 -23
- package/src/assets/scss/components/PsAccordion.scss +1 -1
- package/src/assets/scss/components/PsChips.scss +3 -3
- package/src/assets/scss/components/PsCostEffectBar.scss +4 -4
- package/src/assets/scss/components/PsProgressBar.scss +4 -4
- package/src/assets/scss/components/PsTabHeader.scss +1 -1
- package/src/assets/scss/components/PsTableResults.scss +2 -63
- package/src/assets/scss/components/PsTestimonialCard.scss +1 -1
- package/src/components/accordion/PsAccordion.vue +20 -21
- package/src/components/accordion/PsAccordionItem.vue +30 -8
- package/src/components/badges-and-tags/PsBadgeWithIcon.vue +8 -4
- package/src/components/badges-and-tags/PsCardInfos.vue +3 -1
- package/src/components/badges-and-tags/PsChartLegend.vue +19 -5
- package/src/components/badges-and-tags/PsCostEffectBar.vue +4 -5
- package/src/components/badges-and-tags/PsHighlightRippleDot.vue +1 -1
- package/src/components/badges-and-tags/PsProgressBar.vue +1 -1
- package/src/components/badges-and-tags/PsTestimonialCard.vue +6 -4
- package/src/components/buttons/PsButton.vue +85 -88
- package/src/components/chips/PsChips.vue +5 -2
- package/src/components/controls/PsCheckbox.vue +5 -2
- package/src/components/controls/PsCheckboxSimple.vue +4 -4
- package/src/components/controls/PsDraggable.vue +70 -67
- package/src/components/controls/PsInlineSelector.vue +13 -14
- package/src/components/controls/PsRadioButton.vue +10 -5
- package/src/components/controls/PsRadioButtonSimple.vue +3 -3
- package/src/components/controls/PsSlider.vue +6 -6
- package/src/components/controls/PsSwitch.vue +13 -3
- package/src/components/controls/PsToggle.vue +14 -11
- package/src/components/data-graphics/PsBarChart.vue +4 -2
- package/src/components/datatable/PsDataTable.vue +14 -5
- package/src/components/datatable/PsDataTableItem.vue +17 -4
- package/src/components/forms/PsDropdown.vue +8 -5
- package/src/components/forms/PsDropdownList.vue +1 -1
- package/src/components/forms/PsInput.vue +30 -14
- package/src/components/forms/PsInputSelect.vue +33 -11
- package/src/components/forms/PsInputTextArea.vue +15 -4
- package/src/components/navigations/PsBreadcrumb.vue +1 -1
- package/src/components/notifications/PsDialog.vue +11 -5
- package/src/components/notifications/PsSimpleAlert.vue +22 -10
- package/src/components/notifications/PsToast.vue +8 -3
- package/src/components/playground/PsScrollBar.vue +122 -50
- package/src/components/table-results/PsTableResults.vue +67 -51
- package/src/components/table-results/PsTableResultsBody.vue +3 -1
- package/src/components/table-results/PsTableResultsHead.vue +27 -8
- package/src/components/table-results/PsTableResultsHeadComparison.vue +24 -8
- package/src/components/table-results/PsTableResultsHeadFlexible.vue +18 -6
- package/src/components/table-results/PsTableResultsRow.vue +6 -2
- package/src/components/tabs/PsTabHeader.vue +19 -16
- package/src/components/tooltip/PsDialogTooltip.vue +18 -8
- package/src/components/tooltip/PsRichTooltip.vue +12 -5
- package/src/components/tooltip/PsTooltip.vue +17 -9
- package/src/components/ui/PsDotLoader.vue +5 -5
- package/src/components/ui/PsIcon.vue +6 -2
- package/src/{index.js → index.ts} +4 -5
- package/src/shims-vue.d.ts +11 -0
- package/src/stories/{Accordion.stories.js → Accordion.stories.ts} +2 -2
- package/src/stories/{BadgeWithIcon.stories.js → BadgeWithIcon.stories.ts} +1 -1
- package/src/stories/{BarChart.stories.js → BarChart.stories.ts} +1 -1
- package/src/stories/{Breadcrumb.stories.js → Breadcrumb.stories.ts} +1 -4
- package/src/stories/Button.stories.ts +48 -0
- package/src/stories/Button.vue +59 -0
- package/src/stories/{CardInfos.stories.js → CardInfos.stories.ts} +1 -2
- package/src/stories/{ChartLegend.stories.js → ChartLegend.stories.ts} +1 -2
- package/src/stories/{Checkbox.stories.js → Checkbox.stories.ts} +1 -1
- package/src/stories/{CheckboxSimple.stories.js → CheckboxSimple.stories.ts} +1 -1
- package/src/stories/{Chips.stories.js → Chips.stories.ts} +24 -22
- package/src/stories/ClimateZoneBadge.stories.ts +28 -0
- package/src/stories/CostEffectBar.stories.ts +26 -0
- package/src/stories/{Datatable.stories.js → Datatable.stories.ts} +5 -2
- package/src/stories/{DateCardInfo.stories.js → DateCardInfo.stories.ts} +1 -5
- package/src/stories/{Dialog.stories.js → Dialog.stories.ts} +1 -1
- package/src/stories/Draggable.stories.ts +32 -0
- package/src/stories/{Dropdown.stories.js → Dropdown.stories.ts} +1 -11
- package/src/stories/{DropdownList.stories.js → DropdownList.stories.ts} +3 -1
- package/src/stories/{ElevationSystem.stories.mdx → ElevationSystem.mdx} +1 -1
- package/src/stories/Header.stories.ts +42 -0
- package/src/stories/Header.vue +77 -0
- package/src/stories/{HighlightRippleDot.stories.js → HighlightRippleDot.stories.ts} +2 -1
- package/src/stories/{Icon.stories.js → Icon.stories.ts} +2 -1
- package/src/stories/{InlineSelector.stories.js → InlineSelector.stories.ts} +1 -1
- package/src/stories/{Input.stories.js → Input.stories.ts} +6 -2
- package/src/stories/{InputSelect.stories.js → InputSelect.stories.ts} +2 -1
- package/src/stories/{InputTextArea.stories.js → InputTextArea.stories.ts} +1 -1
- package/src/stories/{Introduction.stories.mdx → Introduction.mdx} +101 -101
- package/src/stories/{MiniTag.stories.js → MiniTag.stories.ts} +8 -1
- package/src/stories/{Playground.stories.js → Playground.stories.ts} +1 -1
- package/src/stories/{ProgressBar.stories.js → ProgressBar.stories.ts} +2 -1
- package/src/stories/{RadioButton.stories.js → RadioButton.stories.ts} +1 -0
- package/src/stories/{RadioButtonSimple.stories.js → RadioButtonSimple.stories.ts} +1 -1
- package/src/stories/{SimpleAlert.stories.js → SimpleAlert.stories.ts} +2 -1
- package/src/stories/{Slider.stories.js → Slider.stories.ts} +5 -1
- package/src/stories/{Switch.stories.js → Switch.stories.ts} +1 -1
- package/src/stories/{TabHeader.stories.js → TabHeader.stories.ts} +4 -0
- package/src/stories/{TableResults.stories.js → TableResults.stories.ts} +5 -1
- package/src/stories/{TagScope.stories.js → TagScope.stories.ts} +1 -1
- package/src/stories/{TestimonialCard.stories.js → TestimonialCard.stories.ts} +2 -2
- package/src/stories/{Toast.stories.js → Toast.stories.ts} +1 -1
- package/src/stories/{Toggle.stories.js → Toggle.stories.ts} +6 -3
- package/src/stories/{Tooltip.stories.js → Tooltip.stories.ts} +3 -3
- package/src/stories/{Typography.stories.mdx → Typography.mdx} +107 -105
- package/src/stories/button.css +30 -0
- package/src/stories/header.css +32 -0
- package/src/util/{GeneralFunctions.js → GeneralFunctions.ts} +7 -7
- package/src/util/{imageLoader.js → imageLoader.ts} +15 -9
- package/tailwind.config.js +11 -2
- package/tsconfig.json +47 -0
- package/webpack.config.js +36 -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/src/stories/Button.stories.js +0 -130
- package/src/stories/ClimateZoneBadge.stories.js +0 -17
- package/src/stories/CostEffectBar.stories.js +0 -23
- package/src/stories/Draggable.stories.js +0 -22
- /package/.storybook/{preview.js → preview.ts} +0 -0
- /package/src/contents/{ComparisonData.js → ComparisonData.ts} +0 -0
- /package/src/contents/{FlexibleData.js → FlexibleData.ts} +0 -0
- /package/src/contents/{ResultsData.js → ResultsData.ts} +0 -0
- /package/src/stories/{Colors.stories.mdx → Colors.mdx} +0 -0
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
ref="tooltip"
|
|
4
|
-
class=
|
|
4
|
+
class="psui-el-tooltip"
|
|
5
5
|
@mouseenter="open"
|
|
6
6
|
@mouseleave="close"
|
|
7
7
|
>
|
|
8
|
-
<div
|
|
9
|
-
|
|
8
|
+
<div
|
|
9
|
+
ref="tooltiptrigger"
|
|
10
|
+
class="psui-el-tooltip-trigger"
|
|
11
|
+
>
|
|
12
|
+
<slot name="trigger" />
|
|
10
13
|
</div>
|
|
11
14
|
|
|
12
15
|
<div
|
|
13
|
-
class=
|
|
16
|
+
class="psui-el-tooltip-wrapper"
|
|
14
17
|
>
|
|
15
18
|
<div
|
|
16
19
|
role="menu"
|
|
17
20
|
ref="dialog"
|
|
18
|
-
class=
|
|
21
|
+
class="psui-el-tooltip-dialog"
|
|
19
22
|
:class="cssClass"
|
|
20
23
|
>
|
|
21
24
|
<div
|
|
@@ -23,9 +26,14 @@
|
|
|
23
26
|
aria-orientation="vertical"
|
|
24
27
|
:class="getComponentClass"
|
|
25
28
|
>
|
|
26
|
-
<h2 v-if="title">
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
<h2 v-if="title">
|
|
30
|
+
{{ title }}
|
|
31
|
+
</h2>
|
|
32
|
+
<div
|
|
33
|
+
v-else
|
|
34
|
+
class="psui-el-tooltip-content-wrapper"
|
|
35
|
+
>
|
|
36
|
+
<slot name="content" />
|
|
29
37
|
</div>
|
|
30
38
|
</div>
|
|
31
39
|
</div>
|
|
@@ -94,7 +102,7 @@ export default {
|
|
|
94
102
|
mounted() {
|
|
95
103
|
document.addEventListener('resize', this.updatePosition)
|
|
96
104
|
},
|
|
97
|
-
|
|
105
|
+
beforeUnmount() {
|
|
98
106
|
document.removeEventListener('resize', this.updatePosition)
|
|
99
107
|
},
|
|
100
108
|
methods: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="psui-el-dotloader">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
<div class="psui-el-dotloader-wrapper">
|
|
4
|
+
<span />
|
|
5
|
+
<span />
|
|
6
|
+
<span />
|
|
7
|
+
</div>
|
|
8
8
|
</div>
|
|
9
9
|
</template>
|
|
10
10
|
|
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
>
|
|
9
9
|
{{ getIcon }}
|
|
10
10
|
</span>
|
|
11
|
-
<img
|
|
11
|
+
<img
|
|
12
|
+
v-else-if="getIconType === 'url'"
|
|
13
|
+
:src="icon"
|
|
14
|
+
:class="[iconClasses]"
|
|
15
|
+
>
|
|
12
16
|
<inline-svg
|
|
13
17
|
v-else
|
|
14
18
|
:src="icon"
|
|
@@ -16,7 +20,7 @@
|
|
|
16
20
|
:height="size"
|
|
17
21
|
:stroke="getColor"
|
|
18
22
|
:fill="getColor"
|
|
19
|
-
|
|
23
|
+
/>
|
|
20
24
|
</div>
|
|
21
25
|
</template>
|
|
22
26
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
/**
|
|
3
2
|
* General Components
|
|
4
3
|
*/
|
|
@@ -51,7 +50,7 @@ import PsBreadcrumb from './components/navigations/PsBreadcrumb.vue'
|
|
|
51
50
|
|
|
52
51
|
|
|
53
52
|
export default {
|
|
54
|
-
install(Vue) {
|
|
53
|
+
install(Vue:any) {
|
|
55
54
|
Vue.component('PsButton', PsButton)
|
|
56
55
|
Vue.component('PsCheckbox', PsCheckbox)
|
|
57
56
|
Vue.component('PsDialog', PsDialog)
|
|
@@ -100,8 +99,8 @@ export default {
|
|
|
100
99
|
|
|
101
100
|
|
|
102
101
|
Vue.directive('click-outside', {
|
|
103
|
-
bind: function (el, binding, vnode) {
|
|
104
|
-
el.clickOutsideEvent = function (event) {
|
|
102
|
+
bind: function (el:any, binding:any, vnode:any) {
|
|
103
|
+
el.clickOutsideEvent = function (event:any) {
|
|
105
104
|
// here I check that click was outside the el and his children
|
|
106
105
|
if (!(el == event.target || el.contains(event.target))) {
|
|
107
106
|
// and if it did, call method provided in attribute value
|
|
@@ -110,7 +109,7 @@ export default {
|
|
|
110
109
|
}
|
|
111
110
|
document.body.addEventListener('click', el.clickOutsideEvent)
|
|
112
111
|
},
|
|
113
|
-
unbind: function (el) {
|
|
112
|
+
unbind: function (el:any) {
|
|
114
113
|
document.body.removeEventListener('click', el.clickOutsideEvent)
|
|
115
114
|
},
|
|
116
115
|
})
|
|
@@ -8,8 +8,8 @@ export default {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
export const Index = (args, { argTypes }) => ({
|
|
12
|
-
props: Object.keys(argTypes, args),
|
|
11
|
+
export const Index = (args:any, { argTypes }: { argTypes:any }) => ({
|
|
12
|
+
props: Object.keys({argTypes, args}),
|
|
13
13
|
components: { PsAccordion, PsAccordionItem },
|
|
14
14
|
template:
|
|
15
15
|
`
|
|
@@ -11,7 +11,7 @@ const items = [
|
|
|
11
11
|
{ title: '4th level', route: '' },
|
|
12
12
|
]
|
|
13
13
|
|
|
14
|
-
const Template = (args, { argTypes }) => ({
|
|
14
|
+
const Template = (args:any, { argTypes }:{argTypes:any}) => ({
|
|
15
15
|
props: Object.keys(argTypes),
|
|
16
16
|
components: { PsBreadcrumb },
|
|
17
17
|
template: `
|
|
@@ -20,6 +20,3 @@ const Template = (args, { argTypes }) => ({
|
|
|
20
20
|
})
|
|
21
21
|
|
|
22
22
|
export const Default = Template.bind({})
|
|
23
|
-
Default.args = {
|
|
24
|
-
items: items,
|
|
25
|
-
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import MyButton from './Button.vue'
|
|
2
|
+
|
|
3
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Example/Button',
|
|
6
|
+
component: MyButton,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
argTypes: {
|
|
9
|
+
backgroundColor: {
|
|
10
|
+
control: 'color',
|
|
11
|
+
},
|
|
12
|
+
onClick: {},
|
|
13
|
+
size: {
|
|
14
|
+
control: {
|
|
15
|
+
type: 'select',
|
|
16
|
+
},
|
|
17
|
+
options: ['small', 'medium', 'large'],
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
23
|
+
export const Primary = {
|
|
24
|
+
args: {
|
|
25
|
+
primary: true,
|
|
26
|
+
label: 'Button',
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const Secondary = {
|
|
31
|
+
args: {
|
|
32
|
+
label: 'Button',
|
|
33
|
+
},
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const Large = {
|
|
37
|
+
args: {
|
|
38
|
+
size: 'large',
|
|
39
|
+
label: 'Button',
|
|
40
|
+
},
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const Small = {
|
|
44
|
+
args: {
|
|
45
|
+
size: 'small',
|
|
46
|
+
label: 'Button',
|
|
47
|
+
},
|
|
48
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button
|
|
3
|
+
type="button"
|
|
4
|
+
:class="classes"
|
|
5
|
+
@click="onClick"
|
|
6
|
+
:style="style"
|
|
7
|
+
>
|
|
8
|
+
{{ label }}
|
|
9
|
+
</button>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
import './button.css'
|
|
14
|
+
import { reactive, computed } from 'vue'
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
name: 'MyButton',
|
|
18
|
+
|
|
19
|
+
props: {
|
|
20
|
+
label: {
|
|
21
|
+
type: String,
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
primary: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false,
|
|
27
|
+
},
|
|
28
|
+
size: {
|
|
29
|
+
type: String,
|
|
30
|
+
validator: function (value) {
|
|
31
|
+
return ['small', 'medium', 'large'].indexOf(value) !== -1
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
backgroundColor: {
|
|
35
|
+
type: String,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
emits: ['click'],
|
|
40
|
+
|
|
41
|
+
setup(props, { emit }) {
|
|
42
|
+
props = reactive(props)
|
|
43
|
+
return {
|
|
44
|
+
classes: computed(() => ({
|
|
45
|
+
'storybook-button': true,
|
|
46
|
+
'storybook-button--primary': props.primary,
|
|
47
|
+
'storybook-button--secondary': !props.primary,
|
|
48
|
+
[`storybook-button--${props.size || 'medium'}`]: true,
|
|
49
|
+
})),
|
|
50
|
+
style: computed(() => ({
|
|
51
|
+
backgroundColor: props.backgroundColor,
|
|
52
|
+
})),
|
|
53
|
+
onClick() {
|
|
54
|
+
emit('click')
|
|
55
|
+
},
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
}
|
|
59
|
+
</script>
|
|
@@ -6,11 +6,10 @@ export default {
|
|
|
6
6
|
argTypes: {},
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
const Template = (args, { argTypes }) => ({
|
|
9
|
+
const Template = (args:any, { argTypes }:{ argTypes:any }) => ({
|
|
10
10
|
props: Object.keys(argTypes),
|
|
11
11
|
components: { PsCardInfos },
|
|
12
12
|
template: '<PsCardInfos v-bind="$props" />',
|
|
13
13
|
})
|
|
14
14
|
|
|
15
15
|
export const CardInfos = Template.bind({})
|
|
16
|
-
CardInfos.args = {}
|
|
@@ -6,11 +6,10 @@ export default {
|
|
|
6
6
|
argTypes: {},
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
const Template = (args, { argTypes }) => ({
|
|
9
|
+
const Template = (args:any, { argTypes } : { argTypes:any }) => ({
|
|
10
10
|
props: Object.keys(argTypes),
|
|
11
11
|
components: { PsChartLegend },
|
|
12
12
|
template: '<PsChartLegend v-bind="$props" />',
|
|
13
13
|
})
|
|
14
14
|
|
|
15
15
|
export const ChartLegend = Template.bind({})
|
|
16
|
-
ChartLegend.args = {}
|
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
import PsChips from '../components/chips/PsChips.vue'
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import * as HeaderStories from '../stories/Header.stories'
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof PsChips> = {
|
|
7
|
+
component: PsChips
|
|
6
8
|
}
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
export default meta
|
|
11
|
+
|
|
12
|
+
type Story = StoryObj<typeof PsChips>
|
|
13
|
+
|
|
14
|
+
export const Primary: Story = {
|
|
15
|
+
render: (args) => ({
|
|
16
|
+
components: { PsChips },
|
|
17
|
+
setup(){
|
|
18
|
+
return { args }
|
|
19
|
+
},
|
|
20
|
+
template: `<div style="display:flex; gap: 10px;">
|
|
19
21
|
<PsChips v-bind='$props' label="Simple chips with icons" type="button" layout="with-icon" icon="home" @update:checked='isChecked = $event' :checked='isChecked'/>
|
|
20
22
|
<PsChips v-bind='$props' label="Radio chips" type="radio" @update:checked='isChecked = $event' :checked='isChecked'/>
|
|
21
23
|
<PsChips v-bind='$props' label="Checkbox chips" type="checkbox" @update:checked='isCheckedTwo = $event' :checked='isCheckedTwo'/>
|
|
22
24
|
<PsChips v-bind='$props' label="Rich chips" type="button" layout="rich" icon="text_snippet" @update:checked='isChecked = $event' :checked='isChecked'/>
|
|
23
25
|
</div>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
26
|
+
`,
|
|
27
|
+
args:{
|
|
28
|
+
label: 'Simple Chip',
|
|
29
|
+
icon:'',
|
|
30
|
+
...HeaderStories.LoggedIn.args
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
|
|
3
|
+
import PsClimateZoneBadge from '../components/badges-and-tags/PsClimateZoneBadge.vue'
|
|
4
|
+
|
|
5
|
+
import * as HeaderStories from '../stories/Header.stories'
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof PsClimateZoneBadge> = {
|
|
8
|
+
component: PsClimateZoneBadge
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default meta
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof PsClimateZoneBadge>
|
|
14
|
+
|
|
15
|
+
export const Primary: Story = {
|
|
16
|
+
render: (args) => ({
|
|
17
|
+
components: { PsClimateZoneBadge },
|
|
18
|
+
setup(){
|
|
19
|
+
return { args }
|
|
20
|
+
},
|
|
21
|
+
template: '<PsClimateZoneBadge v-bind="$props" />',
|
|
22
|
+
args:{
|
|
23
|
+
icon: 'area_chart',
|
|
24
|
+
...HeaderStories.LoggedIn.args
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
}
|
|
28
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
|
|
3
|
+
import PsCostEffectBar from '../components/badges-and-tags/PsCostEffectBar.vue'
|
|
4
|
+
|
|
5
|
+
import * as HeaderStories from '../stories/Header.stories'
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof PsCostEffectBar> = {
|
|
8
|
+
component: PsCostEffectBar
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default meta
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof PsCostEffectBar>
|
|
14
|
+
|
|
15
|
+
export const Primary: Story = {
|
|
16
|
+
render: (args) => ({
|
|
17
|
+
components: { PsCostEffectBar },
|
|
18
|
+
setup(){
|
|
19
|
+
return { args }
|
|
20
|
+
},
|
|
21
|
+
template: '<PsCostEffectBar v-bind="$props" />',
|
|
22
|
+
args:{
|
|
23
|
+
...HeaderStories.LoggedIn.args
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @ts-ignore
|
|
1
2
|
import PsDataTable, { alignment } from '../components/datatable/PsDataTable.vue'
|
|
2
3
|
import PsDataTableItem from '../components/datatable/PsDataTableItem.vue'
|
|
3
4
|
|
|
@@ -10,7 +11,7 @@ export default {
|
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
const Template = (args, { argTypes }) => ({
|
|
14
|
+
const Template = (args:any, { argTypes }:{ argTypes:any }) => ({
|
|
14
15
|
props: Object.keys(argTypes),
|
|
15
16
|
components: {PsDataTable},
|
|
16
17
|
template: `
|
|
@@ -20,7 +21,7 @@ const Template = (args, { argTypes }) => ({
|
|
|
20
21
|
`
|
|
21
22
|
})
|
|
22
23
|
|
|
23
|
-
const RichTemplate = (args, { argTypes } ) => ({
|
|
24
|
+
const RichTemplate = (args:any, { argTypes }:{ argTypes:any } ) => ({
|
|
24
25
|
props: Object.keys(argTypes),
|
|
25
26
|
components: {PsDataTable, PsDataTableItem},
|
|
26
27
|
template: `
|
|
@@ -34,6 +35,7 @@ const RichTemplate = (args, { argTypes } ) => ({
|
|
|
34
35
|
|
|
35
36
|
|
|
36
37
|
export const Simple = Template.bind({})
|
|
38
|
+
// @ts-ignore
|
|
37
39
|
Simple.args = {
|
|
38
40
|
header: ['year', 'month', 'sale'],
|
|
39
41
|
data: [{ year: '1992', month: '12', sale: '1000.00' }, { year: '1989', month: '02', sale: '1200.00' }],
|
|
@@ -42,6 +44,7 @@ Simple.args = {
|
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
export const Rich = RichTemplate.bind({})
|
|
47
|
+
// @ts-ignore
|
|
45
48
|
Rich.args = {
|
|
46
49
|
header: ['header 1', 'header 2', 'header 3'],
|
|
47
50
|
data:[[ [ 20, -3], [ 20, 2], [ 20, 2] ], { header4: { value: 20, delta: 2}, header5: { value: 20, delta: 2}, header6: { value: 20, delta: 2} }],
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
component: PsDateCardInfo,
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
const Template = (args,{argTypes}) => ({
|
|
8
|
+
const Template = (args:any, {argTypes}:{argTypes:any}) => ({
|
|
9
9
|
props: Object.keys(argTypes),
|
|
10
10
|
components:{PsDateCardInfo},
|
|
11
11
|
template: `
|
|
@@ -18,7 +18,3 @@ export default {
|
|
|
18
18
|
})
|
|
19
19
|
|
|
20
20
|
export const Default = Template.bind({})
|
|
21
|
-
|
|
22
|
-
Default.args = {
|
|
23
|
-
date: '2021/02/23'
|
|
24
|
-
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import PsDraggable from '../components/controls/PsDraggable.vue'
|
|
2
|
+
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
4
|
+
|
|
5
|
+
import * as HeaderStories from '../stories/Header.stories'
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof PsDraggable> = {
|
|
8
|
+
component: PsDraggable
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default meta
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof PsDraggable>
|
|
14
|
+
|
|
15
|
+
export const Primary: Story = {
|
|
16
|
+
render: (args) => ({
|
|
17
|
+
components: { PsDraggable },
|
|
18
|
+
setup(){
|
|
19
|
+
return { args }
|
|
20
|
+
},
|
|
21
|
+
template: `
|
|
22
|
+
<div style='width: 300px; font-family: "Lato", sans-serif; font-size: 12px;'>
|
|
23
|
+
<PsDraggable v-bind='$props'/>
|
|
24
|
+
</div>
|
|
25
|
+
`,
|
|
26
|
+
args:{
|
|
27
|
+
...HeaderStories.LoggedIn.args,
|
|
28
|
+
getColumns: {columnGroups:[{title: 'COST EFFECTIVENESS', columns: [ 'Item 1' , 'Item 2' , 'Item 3', 'Item 4']}, {title: 'PER HOME RESULTS', columns: [ 'Item 1' , 'Item 2' , 'Item 3', 'Item 4']}]},
|
|
29
|
+
module: 'comparison'
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
}
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
component: { PsDropdown, PsDropdownList },
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
const Template = (args, { argTypes }) => ({
|
|
8
|
+
const Template = (args:any, { argTypes }:{ argTypes:any }) => ({
|
|
9
9
|
props: Object.keys(argTypes),
|
|
10
10
|
components: { PsDropdown, PsDropdownList },
|
|
11
11
|
template: `
|
|
@@ -87,13 +87,3 @@ const Template = (args, { argTypes }) => ({
|
|
|
87
87
|
})
|
|
88
88
|
|
|
89
89
|
export const DropdownMenu = Template.bind({})
|
|
90
|
-
DropdownMenu.args = {
|
|
91
|
-
items: [
|
|
92
|
-
'Selectable option 01',
|
|
93
|
-
'Selectable option 02',
|
|
94
|
-
'Selectable option 03',
|
|
95
|
-
'Selectable option 04',
|
|
96
|
-
'Selectable option 05',
|
|
97
|
-
'Selectable option 06',
|
|
98
|
-
],
|
|
99
|
-
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @ts-ignore
|
|
1
2
|
import PsDropdownList, { itemStyle } from '../components/forms/PsDropdownList.vue'
|
|
2
3
|
export default {
|
|
3
4
|
title: 'Components/Dropdown/Dropdown List',
|
|
@@ -17,7 +18,7 @@ export default {
|
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
+
// @ts-ignore
|
|
21
22
|
const Template = (args, { argTypes }) => ({
|
|
22
23
|
props: Object.keys(argTypes),
|
|
23
24
|
components: { PsDropdownList },
|
|
@@ -205,6 +206,7 @@ const studyData = {
|
|
|
205
206
|
}
|
|
206
207
|
|
|
207
208
|
export const DropdownList = Template.bind({})
|
|
209
|
+
// @ts-ignore
|
|
208
210
|
DropdownList.args = {
|
|
209
211
|
items: onlyTextItems,
|
|
210
212
|
study_data: studyData,
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import MyHeader from './Header.vue'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Example/Header',
|
|
5
|
+
component: MyHeader,
|
|
6
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
render: (args) => ({
|
|
10
|
+
// Components used in your story `template` are defined in the `components` object
|
|
11
|
+
components: {
|
|
12
|
+
MyHeader,
|
|
13
|
+
},
|
|
14
|
+
// The story's `args` need to be mapped into the template through the `setup()` method
|
|
15
|
+
setup() {
|
|
16
|
+
// Story args can be spread into the returned object
|
|
17
|
+
return {
|
|
18
|
+
...args,
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
// Then, the spread values can be accessed directly in the template
|
|
22
|
+
template: '<my-header :user="user" />',
|
|
23
|
+
}),
|
|
24
|
+
parameters: {
|
|
25
|
+
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
|
|
26
|
+
layout: 'fullscreen',
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const LoggedIn = {
|
|
31
|
+
args: {
|
|
32
|
+
user: {
|
|
33
|
+
name: 'Jane Doe',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const LoggedOut = {
|
|
39
|
+
args: {
|
|
40
|
+
user: null,
|
|
41
|
+
},
|
|
42
|
+
}
|