@policystudio/policy-studio-ui-vue 1.0.31 → 1.0.34
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 +36 -35
- package/babel.config.js +1 -1
- package/dist/css/psui_styles.css +26 -8
- package/package.json +2 -1
- package/postcss.config.js +1 -1
- package/src/assets/images/multifamily-units.svg +10 -0
- package/src/assets/scss/components/PsChips.scss +4 -4
- package/src/assets/scss/components/PsDataTable.scss +17 -0
- package/src/assets/scss/components/PsDropdown.scss +6 -4
- package/src/assets/scss/components/PsDropdownList.scss +2 -2
- package/src/assets/scss/components/PsTooltip.scss +0 -1
- package/src/components/accordion/PsAccordionItem.vue +1 -1
- package/src/components/chips/PsChips.vue +10 -10
- package/src/components/controls/PsSwitch.vue +10 -13
- package/src/components/datatable/PsDataTable.vue +3 -1
- package/src/components/datatable/PsDataTableItem.vue +1 -1
- package/src/components/forms/PsDropdown.vue +58 -44
- package/src/components/forms/PsDropdownList.vue +1 -1
- package/src/components/forms/PsInputTextArea.vue +1 -1
- package/src/components/playground/PsScrollBar.vue +236 -3
- package/src/components/tabs/PsTabHeader.vue +13 -5
- package/src/components/tooltip/PsDialogTooltip.vue +11 -11
- package/src/components/tooltip/PsRichTooltip.vue +6 -6
- package/src/components/tooltip/PsTooltip.vue +8 -8
- package/src/components/ui/PsIcon.vue +14 -23
- package/src/stories/Chips.stories.js +6 -31
- package/src/stories/Dropdown.stories.js +73 -29
- package/src/stories/Icon.stories.js +21 -0
- package/src/stories/InlineSelector.stories.js +1 -1
- package/src/stories/Playground.stories.js +1 -1
- package/src/util/imageLoader.js +1 -1
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
v-if="getIconType === 'material-icons'"
|
|
5
5
|
class="material-icons-round"
|
|
6
6
|
:class="[getIconClasses]"
|
|
7
|
+
:style="{ fontSize: `${size}px`}"
|
|
7
8
|
>
|
|
8
9
|
{{ getIcon }}
|
|
9
10
|
</span>
|
|
@@ -11,8 +12,8 @@
|
|
|
11
12
|
<inline-svg
|
|
12
13
|
v-else
|
|
13
14
|
:src="icon"
|
|
14
|
-
:width="
|
|
15
|
-
:height="
|
|
15
|
+
:width="size"
|
|
16
|
+
:height="size"
|
|
16
17
|
:stroke="getColor"
|
|
17
18
|
:fill="getColor"
|
|
18
19
|
></inline-svg>
|
|
@@ -32,38 +33,30 @@ export default {
|
|
|
32
33
|
type: String,
|
|
33
34
|
default: 'more_horiz'
|
|
34
35
|
},
|
|
36
|
+
|
|
35
37
|
/**
|
|
36
38
|
* It sets the type of the icon.
|
|
37
39
|
*/
|
|
38
40
|
type: {
|
|
39
41
|
type: String,
|
|
40
42
|
},
|
|
43
|
+
|
|
41
44
|
/**
|
|
42
45
|
* It sets the style of the icon.
|
|
43
46
|
*/
|
|
44
47
|
iconClasses: {
|
|
45
|
-
type: String
|
|
48
|
+
type: String,
|
|
49
|
+
default: null
|
|
46
50
|
},
|
|
51
|
+
|
|
47
52
|
/**
|
|
48
|
-
* It sets the size of the icon.
|
|
53
|
+
* It sets the size of the icon.
|
|
49
54
|
*/
|
|
50
55
|
size: {
|
|
51
56
|
type: [Number, String],
|
|
52
|
-
},
|
|
53
|
-
/**
|
|
54
|
-
* It sets the width of the icon.
|
|
55
|
-
*/
|
|
56
|
-
width: {
|
|
57
|
-
type: [Number, String],
|
|
58
|
-
default: 24
|
|
59
|
-
},
|
|
60
|
-
/**
|
|
61
|
-
* It sets the height of the icon.
|
|
62
|
-
*/
|
|
63
|
-
height: {
|
|
64
|
-
type: [Number, String],
|
|
65
57
|
default: 24
|
|
66
58
|
},
|
|
59
|
+
|
|
67
60
|
/**
|
|
68
61
|
* It sets fill property of the icon.
|
|
69
62
|
*/
|
|
@@ -71,6 +64,7 @@ export default {
|
|
|
71
64
|
type: String,
|
|
72
65
|
default: null
|
|
73
66
|
},
|
|
67
|
+
|
|
74
68
|
/**
|
|
75
69
|
* It sets the color of the icon.
|
|
76
70
|
*/
|
|
@@ -83,6 +77,7 @@ export default {
|
|
|
83
77
|
typeof(tailwindConfig.theme.colors[value]) != 'undefined'
|
|
84
78
|
}
|
|
85
79
|
},
|
|
80
|
+
|
|
86
81
|
/**
|
|
87
82
|
* It set a animation icon if needed.
|
|
88
83
|
*/
|
|
@@ -90,6 +85,7 @@ export default {
|
|
|
90
85
|
type: String,
|
|
91
86
|
default: 'hourglass_top'
|
|
92
87
|
},
|
|
88
|
+
|
|
93
89
|
/**
|
|
94
90
|
* It sets a error when the icon is not available.
|
|
95
91
|
*/
|
|
@@ -120,14 +116,9 @@ export default {
|
|
|
120
116
|
},
|
|
121
117
|
getIconClasses() {
|
|
122
118
|
if(this.iconClasses) return this.iconClasses
|
|
123
|
-
return `${this.
|
|
124
|
-
},
|
|
125
|
-
getWidth() {
|
|
126
|
-
if(this.size) return this.size
|
|
127
|
-
return this.width
|
|
119
|
+
return `${this.color}`
|
|
128
120
|
},
|
|
129
121
|
getHeight() {
|
|
130
|
-
if(this.size) return this.size
|
|
131
122
|
return this.height
|
|
132
123
|
},
|
|
133
124
|
getColor() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import PsChips from
|
|
1
|
+
import PsChips from '../components/chips/PsChips.vue'
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
title: 'Components/Chips',
|
|
@@ -11,46 +11,21 @@ const Template = (args, { argTypes }) => ({
|
|
|
11
11
|
data: ()=>{
|
|
12
12
|
return{
|
|
13
13
|
isChecked: null,
|
|
14
|
+
isCheckedTwo: null,
|
|
14
15
|
}
|
|
15
16
|
},
|
|
16
17
|
template: `<div style="display:flex; gap: 10px;">
|
|
17
18
|
<PsChips v-bind='$props' type="button" @update:checked='isChecked = $event' :checked='isChecked'/>
|
|
18
19
|
<PsChips v-bind='$props' label="Simple chips with icons" type="button" layout="with-icon" icon="home" @update:checked='isChecked = $event' :checked='isChecked'/>
|
|
19
20
|
<PsChips v-bind='$props' label="Radio chips" type="radio" @update:checked='isChecked = $event' :checked='isChecked'/>
|
|
20
|
-
<PsChips v-bind='$props' label="Checkbox chips" type="checkbox" @update:checked='
|
|
21
|
+
<PsChips v-bind='$props' label="Checkbox chips" type="checkbox" @update:checked='isCheckedTwo = $event' :checked='isCheckedTwo'/>
|
|
21
22
|
<PsChips v-bind='$props' label="Rich chips" type="button" layout="rich" icon="text_snippet" @update:checked='isChecked = $event' :checked='isChecked'/>
|
|
22
23
|
</div>
|
|
23
24
|
`
|
|
24
25
|
})
|
|
25
26
|
|
|
26
|
-
export const
|
|
27
|
-
|
|
27
|
+
export const Default = Template.bind({})
|
|
28
|
+
Default.args = {
|
|
28
29
|
label: 'Simple Chip',
|
|
29
|
-
icon:
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export const SimpleWithIcon = Template.bind({})
|
|
33
|
-
SimpleWithIcon.args = {
|
|
34
|
-
label: 'Simple With Icon',
|
|
35
|
-
icon: 'home',
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export const Radio = Template.bind({})
|
|
39
|
-
Radio.args = {
|
|
40
|
-
label: 'Radio Chip',
|
|
41
|
-
type:'radio'
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export const Checkbox = Template.bind({})
|
|
45
|
-
Checkbox.args = {
|
|
46
|
-
label: 'Checkbox Chip',
|
|
47
|
-
type: 'checkbox'
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export const Rich = Template.bind({})
|
|
51
|
-
Rich.args = {
|
|
52
|
-
label: 'Rich Chip',
|
|
53
|
-
type: 'button',
|
|
54
|
-
icon: 'text_snippet',
|
|
55
|
-
layout: 'rich'
|
|
30
|
+
icon:'',
|
|
56
31
|
}
|
|
@@ -1,55 +1,99 @@
|
|
|
1
1
|
import PsDropdown from '../components/forms/PsDropdown.vue'
|
|
2
2
|
import PsDropdownList from '../components/forms/PsDropdownList.vue'
|
|
3
3
|
export default {
|
|
4
|
-
title: 'Components/Dropdown',
|
|
5
|
-
component: { PsDropdown
|
|
4
|
+
title: 'Components/Dropdown',
|
|
5
|
+
component: { PsDropdown, PsDropdownList },
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
const Template = (args, { argTypes }) => ({
|
|
9
9
|
props: Object.keys(argTypes),
|
|
10
10
|
components: { PsDropdown, PsDropdownList },
|
|
11
11
|
template: `
|
|
12
|
-
<div style='background: #E6ECF2; width:
|
|
12
|
+
<div style='background: #E6ECF2; width:1200px; height: 700px; padding: 20px;' class='psui-flex psui-gap-64 psui-bg-gray-20 '>
|
|
13
13
|
<PsDropdown>
|
|
14
|
-
<template
|
|
14
|
+
<template #dropdownTrigger>
|
|
15
15
|
<i class='psui-icon psui-text-gray-50 psui-cursor-pointer psui-h-2'>more_horiz</i>
|
|
16
16
|
</template>
|
|
17
|
-
<template
|
|
18
|
-
<
|
|
17
|
+
<template #items>
|
|
18
|
+
<div class='psui-pb-5'>
|
|
19
|
+
<p class='psui-uppercase psui-text-gray-40 psui-text-accentSmall' style='padding: 24px 20px 8px 20px;'>divider label</p>
|
|
20
|
+
|
|
19
21
|
<ul>
|
|
20
|
-
<li style='
|
|
21
|
-
<li style='
|
|
22
|
-
<li style='
|
|
23
|
-
|
|
24
|
-
<
|
|
25
|
-
|
|
22
|
+
<li style='padding: 7px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 01</li>
|
|
23
|
+
<li style='padding: 7px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 02</li>
|
|
24
|
+
<li style='padding: 7px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 03</li>
|
|
25
|
+
|
|
26
|
+
<p class='psui-uppercase psui-text-gray-40 psui-text-accentSmall' style='padding: 24px 24px 8px 24px;'>divider label</p>
|
|
27
|
+
|
|
28
|
+
<li style='padding: 7px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 04</li>
|
|
29
|
+
<li style='padding: 7px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 05</li>
|
|
30
|
+
<li style='padding: 7px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 06</li>
|
|
26
31
|
</ul>
|
|
27
|
-
|
|
28
|
-
<ul>
|
|
29
|
-
<li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 01</li>
|
|
30
|
-
<li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 02</li>
|
|
31
|
-
<li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 03</li>
|
|
32
|
-
<li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 04</li>
|
|
33
|
-
<li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 05</li>
|
|
34
|
-
<li style=' padding: 7px 20px;' class='hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer'>Selectable option 06</li>
|
|
35
|
-
</ul>
|
|
36
|
-
|
|
32
|
+
</div>
|
|
37
33
|
</template>
|
|
38
34
|
</PsDropdown>
|
|
35
|
+
|
|
39
36
|
<PsDropdown>
|
|
40
|
-
|
|
41
|
-
<i class='psui-icon psui-text-gray-50 psui-cursor-pointer psui-h-
|
|
37
|
+
<template #dropdownTrigger>
|
|
38
|
+
<i class='psui-icon psui-text-gray-50 psui-cursor-pointer psui-h-2'>more_horiz</i>
|
|
39
|
+
</template>
|
|
40
|
+
<template #items>
|
|
41
|
+
<div class='psui-pb-5'>
|
|
42
|
+
<p class='psui-uppercase psui-text-gray-40 psui-text-accentSmall' style='padding: 24px 24px 8px 24px;'>divider label</p>
|
|
43
|
+
|
|
44
|
+
<ul>
|
|
45
|
+
<li style='padding: 5px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i style='font-size: 22px;' class='psui-icon'>public</i><span>Selectable option 01</span></li>
|
|
46
|
+
<li style='padding: 5px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i style='font-size: 22px;' class='psui-icon'>share</i><span>Selectable option 02</span></li>
|
|
47
|
+
<li style='padding: 5px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i style='font-size: 22px;' class='psui-icon'>person</i><span>Selectable option 03</span></li>
|
|
48
|
+
|
|
49
|
+
<p class='psui-uppercase psui-text-gray-40 psui-text-accentSmall' style='padding: 24px 24px 8px 24px;'>divider label</p>
|
|
50
|
+
|
|
51
|
+
<li style='padding: 5px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i style='font-size: 22px;' class='psui-icon'>settings</i><span>Selectable option 04</span></li>
|
|
52
|
+
<li style='padding: 5px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i style='font-size: 22px;' class='psui-icon'>save</i><span>Selectable option 05</span></li>
|
|
53
|
+
<li style='padding: 5px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i style='font-size: 22px;' class='psui-icon'>equalizer</i><span>Selectable option 06</span></li>
|
|
54
|
+
</ul>
|
|
55
|
+
</div>
|
|
56
|
+
</template>
|
|
57
|
+
</PsDropdown>
|
|
58
|
+
|
|
59
|
+
<PsDropdown>
|
|
60
|
+
<template #dropdownTrigger>
|
|
61
|
+
<i class='psui-icon psui-text-gray-50 psui-cursor-pointer psui-h-auto'>more_horiz</i>
|
|
42
62
|
</template>
|
|
43
|
-
<template
|
|
63
|
+
<template #items>
|
|
44
64
|
<PsDropdownList v-bind='$props'></PsDropdownList>
|
|
45
|
-
|
|
65
|
+
</template>
|
|
46
66
|
</PsDropdown>
|
|
67
|
+
|
|
68
|
+
<PsDropdown>
|
|
69
|
+
<template #dropdownTrigger>
|
|
70
|
+
<i class='psui-icon psui-text-gray-50 psui-cursor-pointer psui-h-auto'>more_horiz</i>
|
|
71
|
+
</template>
|
|
72
|
+
<template #items>
|
|
73
|
+
<div class='psui-my-3'>
|
|
74
|
+
<ul>
|
|
75
|
+
<li style='padding: 5px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i style='font-size: 22px;' class='psui-icon'>public</i><span>Selectable option 01</span></li>
|
|
76
|
+
<li style='padding: 5px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i style='font-size: 22px;' class='psui-icon'>share</i><span>Selectable option 02</span></li>
|
|
77
|
+
<li style='padding: 5px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i style='font-size: 22px;' class='psui-icon'>person</i><span>Selectable option 03</span></li>
|
|
78
|
+
<li style='padding: 5px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i style='font-size: 22px;' class='psui-icon'>settings</i><span>Selectable option 04</span></li>
|
|
79
|
+
<li style='padding: 5px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i style='font-size: 22px;' class='psui-icon'>save</i><span>Selectable option 05</span></li>
|
|
80
|
+
<li style='padding: 5px 20px; font-size:14px' class='hover:psui-bg-blue-10 hover:psui-text-blue-60 psui-text-gray-60 psui-font-bold psui-cursor-pointer psui-flex psui-items-center psui-gap-3'><i style='font-size: 22px;' class='psui-icon'>equalizer</i><span>Selectable option 06</span></li>
|
|
81
|
+
</ul>
|
|
82
|
+
</div>
|
|
83
|
+
</template>
|
|
84
|
+
</PsDropdown>
|
|
47
85
|
</div>
|
|
48
86
|
`,
|
|
49
87
|
})
|
|
50
88
|
|
|
51
|
-
|
|
52
|
-
export const DropdownMenu= Template.bind({})
|
|
89
|
+
export const DropdownMenu = Template.bind({})
|
|
53
90
|
DropdownMenu.args = {
|
|
54
|
-
items: [
|
|
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
|
+
],
|
|
55
99
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import PsIcon from '../components/ui/PsIcon.vue'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Components/Icon',
|
|
5
|
+
component: PsIcon,
|
|
6
|
+
argTypes: {},
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const Template = (args, { argTypes }) => ({
|
|
10
|
+
props: Object.keys(argTypes),
|
|
11
|
+
components: { PsIcon },
|
|
12
|
+
template: `
|
|
13
|
+
<div class='psui-flex'>
|
|
14
|
+
<PsIcon v-bind="$props" type='svg' icon="/images/multifamily-units.svg" />
|
|
15
|
+
<PsIcon v-bind="$props" type='svg' icon="/images/multifamily-units.svg"/>
|
|
16
|
+
</div>
|
|
17
|
+
`,
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
export const IconSimple = Template.bind({})
|
|
21
|
+
IconSimple.args = {}
|
package/src/util/imageLoader.js
CHANGED
|
@@ -19,7 +19,7 @@ export default ({ imageUrl, onProgress = null, returnsBase64 = true }) => {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
xhr.onloadend = () => {
|
|
22
|
-
const contentType = xhr.getResponseHeader(
|
|
22
|
+
const contentType = xhr.getResponseHeader('Content-Type')
|
|
23
23
|
if (!contentType.includes('image')) {
|
|
24
24
|
reject(xhr)
|
|
25
25
|
} else {
|