@policystudio/policy-studio-ui-vue 1.1.88 → 1.1.90-access.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +1 -0
- package/.eslintrc.js +75 -67
- package/.github/workflows/deploy-storybook.yml +5 -5
- package/.nvmrc +1 -0
- package/dist/css/psui_styles_output.css +6617 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.js +106 -0
- package/dist/index.js.map +1 -0
- package/dist/util/GeneralFunctions.d.ts +3 -0
- package/dist/util/GeneralFunctions.js +35 -0
- package/dist/util/GeneralFunctions.js.map +1 -0
- package/dist/util/directives.d.ts +1 -0
- package/dist/util/directives.js +22 -0
- package/dist/util/directives.js.map +1 -0
- package/dist/util/imageLoader.d.ts +6 -0
- package/dist/util/imageLoader.js +52 -0
- package/dist/util/imageLoader.js.map +1 -0
- package/doc/.nvmrc +1 -0
- package/doc/.storybook/PolicyStudio.ts +11 -0
- package/doc/.storybook/main.ts +27 -0
- package/doc/.storybook/manager.ts +7 -0
- package/{.storybook/preview.js → doc/.storybook/preview.ts} +2 -3
- package/doc/package-lock.json +22653 -0
- package/doc/package.json +71 -0
- package/doc/shims-vue.d.ts +6 -0
- package/{src/stories/Accordion.stories.js → doc/src/stories/Accordion.stories.ts} +4 -5
- package/{src/stories/BadgeWithIcon.stories.js → doc/src/stories/BadgeWithIcon.stories.ts} +2 -2
- package/{src/stories/BarChart.stories.js → doc/src/stories/BarChart.stories.ts} +2 -2
- package/{src/stories/Breadcrumb.stories.js → doc/src/stories/Breadcrumb.stories.ts} +2 -5
- package/{src/stories/Button.stories.js → doc/src/stories/Button.stories.ts} +130 -130
- package/{src/stories/CardInfos.stories.js → doc/src/stories/CardInfos.stories.ts} +2 -3
- package/{src/stories/ChartLegend.stories.js → doc/src/stories/ChartLegend.stories.ts} +2 -3
- package/{src/stories/Checkbox.stories.js → doc/src/stories/Checkbox.stories.ts} +2 -2
- package/{src/stories/CheckboxSimple.stories.js → doc/src/stories/CheckboxSimple.stories.ts} +2 -2
- package/{src/stories/Chips.stories.js → doc/src/stories/Chips.stories.ts} +22 -23
- package/{src/stories/ClimateZoneBadge.stories.js → doc/src/stories/ClimateZoneBadge.stories.ts} +3 -2
- package/doc/src/stories/Collapse.stories.ts +46 -0
- package/{src/stories/CostEffectBar.stories.js → doc/src/stories/CostEffectBar.stories.ts} +3 -2
- package/{src/stories/Datatable.stories.js → doc/src/stories/Datatable.stories.ts} +7 -4
- package/{src/stories/DateCardInfo.stories.js → doc/src/stories/DateCardInfo.stories.ts} +2 -6
- package/{src/stories/Dialog.stories.js → doc/src/stories/Dialog.stories.ts} +2 -2
- package/{src/stories/Draggable.stories.js → doc/src/stories/Draggable.stories.ts} +3 -2
- package/{src/stories/Dropdown.stories.js → doc/src/stories/Dropdown.stories.ts} +4 -3
- package/{src/stories/DropdownList.stories.js → doc/src/stories/DropdownList.stories.ts} +4 -2
- package/{src/stories/ElevationSystem.stories.mdx → doc/src/stories/ElevationSystem.mdx} +1 -1
- package/{src/stories/HighlightRippleDot.stories.js → doc/src/stories/HighlightRippleDot.stories.ts} +3 -2
- package/{src/stories/Icon.stories.js → doc/src/stories/Icon.stories.ts} +3 -1
- package/{src/stories/InlineSelector.stories.js → doc/src/stories/InlineSelector.stories.ts} +2 -2
- package/{src/stories/Input.stories.js → doc/src/stories/Input.stories.ts} +7 -4
- package/{src/stories/InputSelect.stories.js → doc/src/stories/InputSelect.stories.ts} +3 -2
- package/{src/stories/InputTextArea.stories.js → doc/src/stories/InputTextArea.stories.ts} +2 -2
- package/{src/stories/Introduction.stories.mdx → doc/src/stories/Introduction.mdx} +101 -101
- package/{src/stories/MiniTag.stories.js → doc/src/stories/MiniTag.stories.ts} +9 -2
- package/{src/stories/ProgressBar.stories.js → doc/src/stories/ProgressBar.stories.ts} +3 -2
- package/{src/stories/RadioButton.stories.js → doc/src/stories/RadioButton.stories.ts} +2 -2
- package/{src/stories/RadioButtonSimple.stories.js → doc/src/stories/RadioButtonSimple.stories.ts} +2 -2
- package/{src/stories/SimpleAlert.stories.js → doc/src/stories/SimpleAlert.stories.ts} +3 -2
- package/{src/stories/Slider.stories.js → doc/src/stories/Slider.stories.ts} +6 -2
- package/{src/stories/Switch.stories.js → doc/src/stories/Switch.stories.ts} +2 -2
- package/{src/stories/TabHeader.stories.js → doc/src/stories/TabHeader.stories.ts} +6 -1
- package/{src/stories/TableResults.stories.js → doc/src/stories/TableResults.stories.ts} +11 -7
- package/{src/stories/TagScope.stories.js → doc/src/stories/TagScope.stories.ts} +3 -2
- package/{src/stories/TestimonialCard.stories.js → doc/src/stories/TestimonialCard.stories.ts} +3 -3
- package/{src/stories/Toast.stories.js → doc/src/stories/Toast.stories.ts} +2 -2
- package/{src/stories/Toggle.stories.js → doc/src/stories/Toggle.stories.ts} +7 -4
- package/{src/stories/Tooltip.stories.js → doc/src/stories/Tooltip.stories.ts} +6 -6
- package/{src/stories/Typography.stories.mdx → doc/src/stories/Typography.mdx} +107 -105
- package/doc/tsconfig.json +17 -0
- package/package.json +43 -39
- package/scripts/gulp.js +11 -0
- package/scripts/kill-port.sh +12 -0
- package/src/App.vue +30 -0
- package/src/assets/scss/base.scss +3 -30
- package/src/assets/scss/components/PsAccordion.scss +2 -2
- package/src/assets/scss/components/PsButton.scss +7 -1
- package/src/assets/scss/components/PsChips.scss +12 -7
- package/src/assets/scss/components/PsCollapse.scss +71 -0
- package/src/assets/scss/components/PsCostEffectBar.scss +4 -4
- package/src/assets/scss/components/PsDataTable.scss +1 -1
- package/src/assets/scss/components/PsDateCardInfo.scss +4 -5
- package/src/assets/scss/components/PsDialog.scss +7 -0
- package/src/assets/scss/components/PsDropdownList.scss +1 -1
- package/src/assets/scss/components/PsInput.scss +9 -0
- package/src/assets/scss/components/PsProgressBar.scss +4 -4
- package/src/assets/scss/components/PsTabHeader.scss +57 -2
- package/src/assets/scss/components/PsTableResults.scss +53 -22
- package/src/assets/scss/components/PsTestimonialCard.scss +1 -1
- package/src/assets/scss/components/PsTooltip.scss +149 -145
- package/src/components/accordion/PsAccordion.vue +20 -21
- package/src/components/accordion/PsAccordionItem.vue +121 -81
- package/src/components/badges-and-tags/PsBadgeWithIcon.vue +37 -36
- package/src/components/badges-and-tags/PsCardInfos.vue +40 -40
- package/src/components/badges-and-tags/PsChartLegend.vue +50 -41
- package/src/components/badges-and-tags/PsClimateZoneBadge.vue +13 -19
- package/src/components/badges-and-tags/PsCostEffectBar.vue +28 -61
- package/src/components/badges-and-tags/PsDateCardInfo.vue +17 -18
- package/src/components/badges-and-tags/PsHighlightRippleDot.vue +4 -3
- package/src/components/badges-and-tags/PsMiniTag.vue +39 -41
- package/src/components/badges-and-tags/PsProgressBar.vue +72 -68
- package/src/components/badges-and-tags/PsTagScope.vue +17 -22
- package/src/components/badges-and-tags/PsTestimonialCard.vue +25 -30
- package/src/components/buttons/PsButton.vue +90 -98
- package/src/components/chips/PsChips.vue +118 -103
- package/src/components/collapse/PsCollapse.vue +124 -0
- package/src/components/controls/PsCheckbox.vue +86 -83
- package/src/components/controls/PsCheckboxSimple.vue +97 -97
- package/src/components/controls/PsDraggable.vue +100 -99
- package/src/components/controls/PsInlineSelector.vue +111 -113
- package/src/components/controls/PsRadioButton.vue +72 -60
- package/src/components/controls/PsRadioButtonSimple.vue +81 -77
- package/src/components/controls/PsSlider.vue +190 -181
- package/src/components/controls/PsSwitch.vue +63 -54
- package/src/components/controls/PsToggle.vue +62 -57
- package/src/components/data-graphics/PsBarChart.vue +22 -23
- package/src/components/datatable/PsDataTable.vue +70 -65
- package/src/components/datatable/PsDataTableItem.vue +30 -32
- package/src/components/forms/PsDropdown.vue +173 -166
- package/src/components/forms/PsDropdownList.vue +133 -130
- package/src/components/forms/PsInput.vue +163 -146
- package/src/components/forms/PsInputSelect.vue +121 -100
- package/src/components/forms/PsInputTextArea.vue +84 -74
- package/src/components/navigations/PsBreadcrumb.vue +25 -34
- package/src/components/notifications/PsDialog.vue +67 -60
- package/src/components/notifications/PsSimpleAlert.vue +47 -37
- package/src/components/notifications/PsToast.vue +48 -42
- package/src/components/table-results/PsTableResults.vue +534 -506
- package/src/components/table-results/PsTableResultsBody.vue +69 -68
- package/src/components/table-results/PsTableResultsHead.vue +108 -69
- package/src/components/table-results/PsTableResultsHeadComparison.vue +88 -69
- package/src/components/table-results/PsTableResultsHeadFlexible.vue +112 -72
- package/src/components/table-results/PsTableResultsRow.vue +61 -58
- package/src/components/tabs/PsTabHeader.vue +138 -116
- package/src/components/tooltip/PsDialogTooltip.vue +112 -107
- package/src/components/tooltip/PsRichTooltip.vue +46 -43
- package/src/components/tooltip/PsTooltip.vue +126 -122
- package/src/components/ui/PsDotLoader.vue +6 -10
- package/src/components/ui/PsIcon.vue +149 -134
- package/src/index.ts +159 -0
- package/src/tsconfig.json +12 -0
- package/src/types/index.d.ts +6 -0
- package/src/util/GeneralFunctions.js +16 -7
- package/src/util/directives.ts +24 -0
- package/src/util/imageLoader.js +14 -7
- package/tailwind.config.js +12 -3
- package/tsconfig.json +47 -0
- package/.storybook/PolicyStudio.js +0 -10
- package/.storybook/eventBus.js +0 -3
- package/.storybook/main.js +0 -25
- package/.storybook/manager.js +0 -6
- package/babel.config.js +0 -3
- package/backup-package-lock.json +0 -37194
- package/dist/css/psui_styles.css +0 -110890
- package/postcss.config.js +0 -8
- package/src/components/playground/PsScrollBar.vue +0 -248
- package/src/index.js +0 -167
- package/src/stories/Playground.stories.js +0 -16
- /package/{src → doc/src}/assets/images/multifamily-units.svg +0 -0
- /package/{src → doc/src}/assets/images/policy-studio.svg +0 -0
- /package/{src/contents/ComparisonData.js → doc/src/contents/ComparisonData.ts} +0 -0
- /package/{src/contents/FlexibleData.js → doc/src/contents/FlexibleData.ts} +0 -0
- /package/{src/contents/ResultsData.js → doc/src/contents/ResultsData.ts} +0 -0
- /package/{src/stories/Colors.stories.mdx → doc/src/stories/Colors.mdx} +0 -0
- /package/{src → doc/src}/stories/assets/code-brackets.svg +0 -0
- /package/{src → doc/src}/stories/assets/colors.svg +0 -0
- /package/{src → doc/src}/stories/assets/comments.svg +0 -0
- /package/{src → doc/src}/stories/assets/direction.svg +0 -0
- /package/{src → doc/src}/stories/assets/flow.svg +0 -0
- /package/{src → doc/src}/stories/assets/plugin.svg +0 -0
- /package/{src → doc/src}/stories/assets/repo.svg +0 -0
- /package/{src → doc/src}/stories/assets/stackalt.svg +0 -0
|
@@ -1,159 +1,174 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
:style="{ display: display }"
|
|
4
|
+
@click="emit('click', $event)"
|
|
5
|
+
>
|
|
3
6
|
<span
|
|
4
7
|
v-if="getIconType === 'material-icons'"
|
|
5
8
|
class="material-icons-round"
|
|
6
9
|
:class="[getIconClasses]"
|
|
7
|
-
:style="{ fontSize: `${size}px`}"
|
|
10
|
+
:style="{ fontSize: `${size}px` }"
|
|
8
11
|
>
|
|
9
12
|
{{ getIcon }}
|
|
10
13
|
</span>
|
|
11
|
-
<img
|
|
14
|
+
<img
|
|
15
|
+
v-else-if="getIconType === 'url'"
|
|
16
|
+
:src="icon"
|
|
17
|
+
:class="[iconClasses]"
|
|
18
|
+
>
|
|
12
19
|
<inline-svg
|
|
13
20
|
v-else
|
|
14
21
|
:src="icon"
|
|
15
|
-
:width="size"
|
|
16
|
-
:height="size"
|
|
17
|
-
:stroke="getColor"
|
|
22
|
+
:width="width ? width : size"
|
|
23
|
+
:height="height ? height : size"
|
|
24
|
+
:stroke="stroke ? stroke : disableStroke ? null : getColor"
|
|
18
25
|
:fill="getColor"
|
|
19
|
-
|
|
26
|
+
/>
|
|
20
27
|
</div>
|
|
21
28
|
</template>
|
|
22
29
|
|
|
23
|
-
<script>
|
|
24
|
-
import tailwindConfig from '../../../tailwind.config'
|
|
25
|
-
import imageLoader from '../../util/imageLoader'
|
|
26
|
-
export default {
|
|
27
|
-
name: 'AppIcon',
|
|
28
|
-
props: {
|
|
29
|
-
/**
|
|
30
|
-
* 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/.
|
|
31
|
-
*/
|
|
32
|
-
icon: {
|
|
33
|
-
type: String,
|
|
34
|
-
default: 'more_horiz'
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* It sets the type of the icon.
|
|
39
|
-
*/
|
|
40
|
-
type: {
|
|
41
|
-
type: String,
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* It sets the style of the icon.
|
|
46
|
-
*/
|
|
47
|
-
iconClasses: {
|
|
48
|
-
type: String,
|
|
49
|
-
default: null
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* It sets the size of the icon.
|
|
54
|
-
*/
|
|
55
|
-
size: {
|
|
56
|
-
type: [Number, String],
|
|
57
|
-
default: 24
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* It sets fill property of the icon.
|
|
62
|
-
*/
|
|
63
|
-
stroke: {
|
|
64
|
-
type: String,
|
|
65
|
-
default: null
|
|
66
|
-
},
|
|
30
|
+
<script setup>
|
|
31
|
+
import tailwindConfig from '../../../tailwind.config.js'
|
|
32
|
+
import imageLoader from '../../util/imageLoader.js'
|
|
67
33
|
|
|
68
|
-
|
|
69
|
-
* It sets fill property display of the icon.
|
|
70
|
-
*/
|
|
71
|
-
display: {
|
|
72
|
-
type: String,
|
|
73
|
-
default: 'contents'
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* It sets the color of the icon.
|
|
78
|
-
*/
|
|
79
|
-
color: {
|
|
80
|
-
type: String,
|
|
81
|
-
default: null,
|
|
82
|
-
validator: value => {
|
|
83
|
-
return value?.includes('psui-text-') &&
|
|
84
|
-
typeof(tailwindConfig.theme.colors[value.replace('psui-text-', '')]) != 'undefined' ||
|
|
85
|
-
typeof(tailwindConfig.theme.colors[value]) != 'undefined'
|
|
86
|
-
}
|
|
87
|
-
},
|
|
34
|
+
import { ref, computed, watch, onMounted } from 'vue'
|
|
88
35
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* It sets a error when the icon is not available.
|
|
99
|
-
*/
|
|
100
|
-
loaderErrorIcon: {
|
|
101
|
-
type: String,
|
|
102
|
-
default: 'more_horiz'
|
|
103
|
-
}
|
|
36
|
+
const props = defineProps({
|
|
37
|
+
/**
|
|
38
|
+
* 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/.
|
|
39
|
+
*/
|
|
40
|
+
icon: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: 'more_horiz',
|
|
104
43
|
},
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
44
|
+
/**
|
|
45
|
+
* It sets the type of the icon.
|
|
46
|
+
*/
|
|
47
|
+
type: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: '',
|
|
110
50
|
},
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
51
|
+
/**
|
|
52
|
+
* It sets the style of the icon.
|
|
53
|
+
*/
|
|
54
|
+
iconClasses: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: null,
|
|
57
|
+
},
|
|
58
|
+
/**
|
|
59
|
+
* It sets the size of the icon.
|
|
60
|
+
*/
|
|
61
|
+
size: {
|
|
62
|
+
type: [Number, String],
|
|
63
|
+
default: 24,
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* It sets fill property of the icon.
|
|
67
|
+
*/
|
|
68
|
+
stroke: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: null,
|
|
71
|
+
},
|
|
72
|
+
/**
|
|
73
|
+
* It sets fill property display of the icon.
|
|
74
|
+
*/
|
|
75
|
+
display: {
|
|
76
|
+
type: String,
|
|
77
|
+
default: 'contents',
|
|
78
|
+
},
|
|
79
|
+
/**
|
|
80
|
+
* It sets the color of the icon.
|
|
81
|
+
*/
|
|
82
|
+
color: {
|
|
83
|
+
type: String,
|
|
84
|
+
default: null,
|
|
85
|
+
validator: (value) => {
|
|
86
|
+
return (
|
|
87
|
+
(value?.includes('psui-text-') && typeof tailwindConfig.theme.colors[value.replace('psui-text-', '')] != 'undefined') ||
|
|
88
|
+
typeof tailwindConfig.theme.colors[value] != 'undefined'
|
|
89
|
+
)
|
|
131
90
|
},
|
|
132
|
-
getColor() {
|
|
133
|
-
if(this.getIconType === 'material-icons') return this.color
|
|
134
|
-
return tailwindConfig.theme.colors[this.color.replace('psui-text-', '')] || tailwindConfig.theme.colors[this.color]
|
|
135
|
-
}
|
|
136
91
|
},
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
92
|
+
/**
|
|
93
|
+
* It set a animation icon if needed.
|
|
94
|
+
*/
|
|
95
|
+
loaderIcon: {
|
|
96
|
+
type: String,
|
|
97
|
+
default: 'hourglass_top',
|
|
141
98
|
},
|
|
142
|
-
|
|
143
|
-
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* It sets a error when the icon is not available.
|
|
102
|
+
*/
|
|
103
|
+
loaderErrorIcon: {
|
|
104
|
+
type: String,
|
|
105
|
+
default: 'more_horiz',
|
|
144
106
|
},
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
107
|
+
disableStroke: {
|
|
108
|
+
type: Boolean,
|
|
109
|
+
default: false,
|
|
110
|
+
},
|
|
111
|
+
width: {
|
|
112
|
+
type: [Number, String],
|
|
113
|
+
default: null,
|
|
114
|
+
},
|
|
115
|
+
height: {
|
|
116
|
+
type: [Number, String],
|
|
117
|
+
default: null,
|
|
118
|
+
},
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
const finishedImageLoad = ref(false)
|
|
122
|
+
const imageLoadError = ref(false)
|
|
123
|
+
|
|
124
|
+
const emit = defineEmits(['click'])
|
|
125
|
+
|
|
126
|
+
const getIconType = computed(() => {
|
|
127
|
+
if (props.type) return props.type
|
|
128
|
+
if (!props.icon?.includes('/')) return 'material-icons'
|
|
129
|
+
if (!props.icon?.includes('.svg')) return 'url'
|
|
130
|
+
return 'svg'
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
const getIcon = computed(() => {
|
|
134
|
+
if (!props.icon?.includes('/')) return props.icon ? props.icon : props.loaderErrorIcon
|
|
135
|
+
if (!finishedImageLoad.value && !imageLoadError.value && props.loaderIcon) return props.loaderIcon
|
|
136
|
+
if (imageLoadError.value) return props.loaderErrorIcon
|
|
137
|
+
return props.icon ? props.icon : props.loaderErrorIcon
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
const getIconClasses = computed(() => {
|
|
141
|
+
if (props.iconClasses) return props.iconClasses
|
|
142
|
+
return props.color ? `${props.color}` : ''
|
|
143
|
+
})
|
|
144
|
+
|
|
145
|
+
const getColor = computed(() => {
|
|
146
|
+
if (getIconType.value === 'material-icons') return props.color
|
|
147
|
+
return tailwindConfig.theme.colors[props.color.replace('psui-text-', '')] || tailwindConfig.theme.colors[props.color]
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
watch(
|
|
151
|
+
() => props.icon,
|
|
152
|
+
() => {
|
|
153
|
+
loadImage()
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
onMounted(() => {
|
|
158
|
+
if (props.icon?.includes('/')) loadImage()
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
const loadImage = () => {
|
|
162
|
+
if(getIconType.value != 'material-icons') {
|
|
163
|
+
finishedImageLoad.value = false
|
|
164
|
+
imageLoadError.value = false
|
|
165
|
+
imageLoader({ imageUrl: props.icon, returnsBase64: false })
|
|
166
|
+
.then(() => {
|
|
167
|
+
finishedImageLoad.value = true
|
|
168
|
+
})
|
|
169
|
+
.catch(() => {
|
|
170
|
+
imageLoadError.value = true
|
|
171
|
+
})
|
|
157
172
|
}
|
|
158
173
|
}
|
|
159
|
-
</script>
|
|
174
|
+
</script>
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* General Components
|
|
3
|
+
*/
|
|
4
|
+
import { directives } from './util/directives'
|
|
5
|
+
|
|
6
|
+
import PsButton from '../src/components/buttons/PsButton.vue'
|
|
7
|
+
import PsCheckbox from '../src/components/controls/PsCheckbox.vue'
|
|
8
|
+
import PsRadioButton from '../src/components/controls/PsRadioButton.vue'
|
|
9
|
+
import PsSlider from '../src/components/controls/PsSlider.vue'
|
|
10
|
+
import PsSwitch from '../src/components/controls/PsSwitch.vue'
|
|
11
|
+
import PsToggle from '../src/components/controls/PsToggle.vue'
|
|
12
|
+
import PsInput from '../src/components/forms/PsInput.vue'
|
|
13
|
+
import PsDropdown from '../src/components/forms/PsDropdown.vue'
|
|
14
|
+
import PsDropdownList from '../src/components/forms/PsDropdownList.vue'
|
|
15
|
+
import PsInputTextArea from '../src/components/forms/PsInputTextArea.vue'
|
|
16
|
+
import PsInputSelect from '../src/components/forms/PsInputSelect.vue'
|
|
17
|
+
import PsDialog from '../src/components/notifications/PsDialog.vue'
|
|
18
|
+
import PsToast from '../src/components/notifications/PsToast.vue'
|
|
19
|
+
import PsTabHeader from '../src/components/tabs/PsTabHeader.vue'
|
|
20
|
+
import PsAccordion from '../src/components/accordion/PsAccordion.vue'
|
|
21
|
+
import PsAccordionItem from '../src/components/accordion/PsAccordionItem.vue'
|
|
22
|
+
import PsChips from '../src/components/chips/PsChips.vue'
|
|
23
|
+
import PsDataTable from '../src/components/datatable/PsDataTable.vue'
|
|
24
|
+
import PsDataTableItem from '../src/components/datatable/PsDataTableItem.vue'
|
|
25
|
+
import PsTableResults from '../src/components/table-results/PsTableResults.vue'
|
|
26
|
+
import PsTableResultsBody from '../src/components/table-results/PsTableResultsBody.vue'
|
|
27
|
+
import PsTableResultsHead from '../src/components/table-results/PsTableResultsHead.vue'
|
|
28
|
+
import PsTableResultsHeadComparison from '../src/components/table-results/PsTableResultsHeadComparison.vue'
|
|
29
|
+
import PsTableResultsHeadFlexible from '../src/components/table-results/PsTableResultsHeadFlexible.vue'
|
|
30
|
+
import PsTableResultsRow from '../src/components/table-results/PsTableResultsRow.vue'
|
|
31
|
+
import PsIcon from '../src/components/ui/PsIcon.vue'
|
|
32
|
+
import PsDotLoader from '../src/components/ui/PsDotLoader.vue'
|
|
33
|
+
import PsTooltip from '../src/components/tooltip/PsTooltip.vue'
|
|
34
|
+
import PsRichTooltip from '../src/components/tooltip/PsRichTooltip.vue'
|
|
35
|
+
import PsDialogTooltip from '../src/components/tooltip/PsDialogTooltip.vue'
|
|
36
|
+
import PsDraggable from '../src/components/controls/PsDraggable.vue'
|
|
37
|
+
import PsCardInfos from '../src/components/badges-and-tags/PsCardInfos.vue'
|
|
38
|
+
import PsChartLegend from '../src/components/badges-and-tags/PsChartLegend.vue'
|
|
39
|
+
import PsInlineSelector from '../src/components/controls/PsInlineSelector.vue'
|
|
40
|
+
import PsMiniTag from '../src/components/badges-and-tags/PsMiniTag.vue'
|
|
41
|
+
import PsCheckboxSimple from '../src/components/controls/PsCheckboxSimple.vue'
|
|
42
|
+
import PsBadgeWithIcon from '../src/components/badges-and-tags/PsBadgeWithIcon.vue'
|
|
43
|
+
import PsProgressBar from '../src/components/badges-and-tags/PsProgressBar.vue'
|
|
44
|
+
import PsRadioButtonSimple from '../src/components/controls/PsRadioButtonSimple.vue'
|
|
45
|
+
import PsTestimonialCard from '../src/components/badges-and-tags/PsTestimonialCard.vue'
|
|
46
|
+
import PsDateCardInfo from '../src/components/badges-and-tags/PsDateCardInfo.vue'
|
|
47
|
+
import PsTagScope from '../src/components/badges-and-tags/PsTagScope.vue'
|
|
48
|
+
import PsBarChart from '../src/components/data-graphics/PsBarChart.vue'
|
|
49
|
+
import PsSimpleAlert from '../src/components/notifications/PsSimpleAlert.vue'
|
|
50
|
+
import PsBreadcrumb from '../src/components/navigations/PsBreadcrumb.vue'
|
|
51
|
+
import PsCollapse from '../src/components/collapse/PsCollapse.vue'
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
export default {
|
|
55
|
+
install(Vue:any) {
|
|
56
|
+
Vue.component('PsButton', PsButton)
|
|
57
|
+
Vue.component('PsCheckbox', PsCheckbox)
|
|
58
|
+
Vue.component('PsDialog', PsDialog)
|
|
59
|
+
Vue.component('PsToast', PsToast)
|
|
60
|
+
Vue.component('PsTabHeader', PsTabHeader)
|
|
61
|
+
Vue.component('PsRadioButton', PsRadioButton)
|
|
62
|
+
Vue.component('PsSlider', PsSlider)
|
|
63
|
+
Vue.component('PsSwitch', PsSwitch)
|
|
64
|
+
Vue.component('PsInput', PsInput)
|
|
65
|
+
Vue.component('PsToggle', PsToggle)
|
|
66
|
+
Vue.component('PsAccordion', PsAccordion)
|
|
67
|
+
Vue.component('PsAccordionItem', PsAccordionItem)
|
|
68
|
+
Vue.component('PsChips', PsChips)
|
|
69
|
+
Vue.component('PsDataTable', PsDataTable)
|
|
70
|
+
Vue.component('PsDataTableItem', PsDataTableItem)
|
|
71
|
+
Vue.component('PsTableResultsHead', PsTableResultsHead)
|
|
72
|
+
Vue.component('PsTableResultsHeadComparison', PsTableResultsHeadComparison)
|
|
73
|
+
Vue.component('PsTableResults', PsTableResults)
|
|
74
|
+
Vue.component('PsTableResultsRow', PsTableResultsRow)
|
|
75
|
+
Vue.component('PsTableResultsBody', PsTableResultsBody)
|
|
76
|
+
Vue.component('PsTableResultsHeadFlexible',PsTableResultsHeadFlexible)
|
|
77
|
+
Vue.component('PsIcon', PsIcon)
|
|
78
|
+
Vue.component('PsDotLoader', PsDotLoader)
|
|
79
|
+
Vue.component('PsTooltip', PsTooltip)
|
|
80
|
+
Vue.component('PsRichTooltip', PsRichTooltip)
|
|
81
|
+
Vue.component('PsDialogTooltip', PsDialogTooltip)
|
|
82
|
+
Vue.component('PsDraggable', PsDraggable)
|
|
83
|
+
Vue.component('PsCardInfos', PsCardInfos)
|
|
84
|
+
Vue.component('PsChartLegend', PsChartLegend)
|
|
85
|
+
Vue.component('PsInlineSelector', PsInlineSelector)
|
|
86
|
+
Vue.component('PsInputTextArea', PsInputTextArea)
|
|
87
|
+
Vue.component('PsInputSelect', PsInputSelect)
|
|
88
|
+
Vue.component('PsDropdown',PsDropdown)
|
|
89
|
+
Vue.component('PsDropdownList', PsDropdownList)
|
|
90
|
+
Vue.component('PsMiniTag', PsMiniTag)
|
|
91
|
+
Vue.component('PsCheckboxSimple', PsCheckboxSimple)
|
|
92
|
+
Vue.component('PsBadgeWithIcon', PsBadgeWithIcon)
|
|
93
|
+
Vue.component('PsProgressBar', PsProgressBar)
|
|
94
|
+
Vue.component('PsRadioButtonSimple', PsRadioButtonSimple)
|
|
95
|
+
Vue.component('PsTestimonialCard',PsTestimonialCard)
|
|
96
|
+
Vue.component('PsDateCardInfo',PsDateCardInfo)
|
|
97
|
+
Vue.component('PsTagScope',PsTagScope)
|
|
98
|
+
Vue.component('PsBarChart',PsBarChart)
|
|
99
|
+
Vue.component('PsSimpleAlert',PsSimpleAlert)
|
|
100
|
+
Vue.component('PsBreadcrumb', PsBreadcrumb)
|
|
101
|
+
Vue.component('PsCollapse', PsCollapse)
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Initialize directives
|
|
105
|
+
*/
|
|
106
|
+
directives(Vue)
|
|
107
|
+
|
|
108
|
+
},
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export {
|
|
112
|
+
PsButton,
|
|
113
|
+
PsCheckbox,
|
|
114
|
+
PsRadioButton,
|
|
115
|
+
PsSlider,
|
|
116
|
+
PsSwitch,
|
|
117
|
+
PsToggle,
|
|
118
|
+
PsInput,
|
|
119
|
+
PsDialog,
|
|
120
|
+
PsToast,
|
|
121
|
+
PsTabHeader,
|
|
122
|
+
PsAccordion,
|
|
123
|
+
PsAccordionItem,
|
|
124
|
+
PsChips,
|
|
125
|
+
PsDataTable,
|
|
126
|
+
PsDataTableItem,
|
|
127
|
+
PsTableResultsHead,
|
|
128
|
+
PsTableResultsBody,
|
|
129
|
+
PsTableResultsHeadFlexible,
|
|
130
|
+
PsTableResultsHeadComparison,
|
|
131
|
+
PsIcon,
|
|
132
|
+
PsDotLoader,
|
|
133
|
+
PsTooltip,
|
|
134
|
+
PsRichTooltip,
|
|
135
|
+
PsDialogTooltip,
|
|
136
|
+
PsDraggable,
|
|
137
|
+
PsCardInfos,
|
|
138
|
+
PsChartLegend,
|
|
139
|
+
PsInlineSelector,
|
|
140
|
+
PsInputTextArea,
|
|
141
|
+
PsInputSelect,
|
|
142
|
+
PsDropdown,
|
|
143
|
+
PsDropdownList,
|
|
144
|
+
PsMiniTag,
|
|
145
|
+
PsCheckboxSimple,
|
|
146
|
+
PsBadgeWithIcon,
|
|
147
|
+
PsProgressBar,
|
|
148
|
+
PsRadioButtonSimple,
|
|
149
|
+
PsTestimonialCard,
|
|
150
|
+
PsDateCardInfo,
|
|
151
|
+
PsTagScope,
|
|
152
|
+
PsBarChart,
|
|
153
|
+
PsSimpleAlert,
|
|
154
|
+
PsBreadcrumb,
|
|
155
|
+
PsTableResults,
|
|
156
|
+
PsTableResultsRow,
|
|
157
|
+
PsCollapse
|
|
158
|
+
}
|
|
159
|
+
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
export const randomString = (length) => {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
let result = ''
|
|
3
|
+
const characters =
|
|
4
4
|
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
|
|
5
|
-
|
|
6
|
-
for (
|
|
5
|
+
const charactersLength = characters.length
|
|
6
|
+
for (let i = 0; i < length; i++) {
|
|
7
7
|
result += characters.charAt(Math.floor(Math.random() * charactersLength))
|
|
8
8
|
}
|
|
9
9
|
return result
|
|
10
10
|
}
|
|
11
|
-
|
|
12
11
|
export const getParentScrollableEl = (node) => {
|
|
13
12
|
if (node == null) {
|
|
14
13
|
return null
|
|
@@ -22,9 +21,19 @@ export const getParentScrollableEl = (node) => {
|
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
export const getParentVueComponentByName = (comp, name) => {
|
|
25
|
-
if (comp
|
|
24
|
+
if (!comp) return null
|
|
25
|
+
|
|
26
|
+
if (comp?.appContext?.components[name]) {
|
|
27
|
+
return comp.appContext.components[name]
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (comp.$options && comp.$options.name === name) {
|
|
26
31
|
return comp
|
|
27
|
-
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (comp.$parent) {
|
|
28
35
|
return getParentVueComponentByName(comp.$parent, name)
|
|
29
36
|
}
|
|
37
|
+
|
|
38
|
+
return null
|
|
30
39
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
export const directives = (Vue: any) => {
|
|
3
|
+
Vue.directive('click-outside', {
|
|
4
|
+
bind(el: any, binding: any, vnode: any) {
|
|
5
|
+
// Define a function to handle click events outside the element
|
|
6
|
+
const handler = (event: any) => {
|
|
7
|
+
if (binding?.value && !(el === event.target || el.contains(event.target))) {
|
|
8
|
+
// Call the method provided in the directive value
|
|
9
|
+
binding.value(event)
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Store the handler function on the element
|
|
14
|
+
el.__clickOutsideHandler__ = handler
|
|
15
|
+
|
|
16
|
+
// Add a click event listener to the body
|
|
17
|
+
document.body.addEventListener('click', handler)
|
|
18
|
+
},
|
|
19
|
+
unbind(el: any) {
|
|
20
|
+
// Remove the click event listener when the element is unbound
|
|
21
|
+
document.body.removeEventListener('click', el.__clickOutsideHandler__)
|
|
22
|
+
},
|
|
23
|
+
})
|
|
24
|
+
}
|
package/src/util/imageLoader.js
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
export default ({ imageUrl, onProgress = null, returnsBase64 = true }) => {
|
|
2
2
|
return new Promise((resolve, reject) => {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const xhr = new XMLHttpRequest()
|
|
4
|
+
let notifiedNotComputable = false
|
|
5
5
|
|
|
6
6
|
xhr.open('GET', imageUrl, true)
|
|
7
7
|
xhr.responseType = 'arraybuffer'
|
|
8
8
|
|
|
9
9
|
xhr.onprogress = (ev) => {
|
|
10
10
|
if (ev.lengthComputable) {
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
const progress = parseInt((ev.loaded / ev.total) * 100)
|
|
13
|
+
|
|
12
14
|
if(onProgress) onProgress(progress)
|
|
13
15
|
} else {
|
|
14
16
|
if (!notifiedNotComputable) {
|
|
15
17
|
notifiedNotComputable = true
|
|
18
|
+
|
|
16
19
|
if(onProgress) onProgress(-1)
|
|
17
20
|
}
|
|
18
21
|
}
|
|
@@ -20,21 +23,25 @@ export default ({ imageUrl, onProgress = null, returnsBase64 = true }) => {
|
|
|
20
23
|
|
|
21
24
|
xhr.onloadend = () => {
|
|
22
25
|
const contentType = xhr.getResponseHeader('Content-Type')
|
|
26
|
+
|
|
23
27
|
if (!contentType.includes('image')) {
|
|
24
28
|
reject(xhr)
|
|
25
29
|
} else {
|
|
26
30
|
if (!notifiedNotComputable) {
|
|
31
|
+
|
|
27
32
|
if(onProgress) onProgress(100)
|
|
28
33
|
}
|
|
29
34
|
|
|
30
35
|
if(!returnsBase64) {
|
|
36
|
+
|
|
31
37
|
resolve()
|
|
32
38
|
} else {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
const options = {}
|
|
40
|
+
const headers = xhr.getAllResponseHeaders()
|
|
41
|
+
const mime = headers.match(/^Content-Type\\:\s*(.*?)$/mi)
|
|
42
|
+
|
|
36
43
|
if (mime && mime[1]) options.type = mime[1]
|
|
37
|
-
|
|
44
|
+
const blob = new Blob([xhr.response], options)
|
|
38
45
|
resolve(window.URL.createObjectURL(blob))
|
|
39
46
|
}
|
|
40
47
|
}
|
package/tailwind.config.js
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
/** @type {import('tailwindcss').Config} */
|
|
2
|
+
|
|
3
|
+
export default {
|
|
2
4
|
prefix: 'psui-',
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
content: [
|
|
6
|
+
'./index.html',
|
|
7
|
+
'./src/**/*.vue',
|
|
8
|
+
'./src/**/*.js',
|
|
9
|
+
'./src/**/*.ts',
|
|
10
|
+
'./src/**/*.jsx',
|
|
11
|
+
'./src/**/*.tsx',
|
|
12
|
+
],
|
|
13
|
+
darkMode: 'media', // or 'media' or 'class'
|
|
5
14
|
theme: {
|
|
6
15
|
colors: {
|
|
7
16
|
'white': '#ffffff ',
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "esnext",
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"strict": true,
|
|
6
|
+
"strictNullChecks": true,
|
|
7
|
+
"jsx": "preserve",
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"moduleResolution": "node",
|
|
10
|
+
"composite": true,
|
|
11
|
+
"noEmitOnError": false,
|
|
12
|
+
"outDir": "dist",
|
|
13
|
+
"rootDir": "src",
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"skipDefaultLibCheck": true,
|
|
16
|
+
"esModuleInterop": true,
|
|
17
|
+
"allowSyntheticDefaultImports": true,
|
|
18
|
+
"forceConsistentCasingInFileNames": true,
|
|
19
|
+
"useDefineForClassFields": true,
|
|
20
|
+
"sourceMap": true,
|
|
21
|
+
"allowJs": true,
|
|
22
|
+
"baseUrl": "",
|
|
23
|
+
|
|
24
|
+
"types": [
|
|
25
|
+
"webpack-env",
|
|
26
|
+
],
|
|
27
|
+
"lib": [
|
|
28
|
+
"esnext",
|
|
29
|
+
"dom",
|
|
30
|
+
"dom.iterable",
|
|
31
|
+
"scripthost"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"include": [
|
|
35
|
+
"src/**/*.ts",
|
|
36
|
+
"src/**/*.d.ts",
|
|
37
|
+
"src/**/*.vue",
|
|
38
|
+
"tests/**/*.ts",
|
|
39
|
+
"tests/**/*.tsx",
|
|
40
|
+
"src/util/GeneralFunctions.js",
|
|
41
|
+
"src/util/imageLoader.js",
|
|
42
|
+
],
|
|
43
|
+
"exclude": [
|
|
44
|
+
"node_modules",
|
|
45
|
+
"doc"
|
|
46
|
+
]
|
|
47
|
+
}
|