@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.
Files changed (170) hide show
  1. package/.eslintignore +1 -0
  2. package/.eslintrc.js +75 -67
  3. package/.github/workflows/deploy-storybook.yml +5 -5
  4. package/.nvmrc +1 -0
  5. package/dist/css/psui_styles_output.css +6617 -0
  6. package/dist/index.d.ts +51 -0
  7. package/dist/index.js +106 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/util/GeneralFunctions.d.ts +3 -0
  10. package/dist/util/GeneralFunctions.js +35 -0
  11. package/dist/util/GeneralFunctions.js.map +1 -0
  12. package/dist/util/directives.d.ts +1 -0
  13. package/dist/util/directives.js +22 -0
  14. package/dist/util/directives.js.map +1 -0
  15. package/dist/util/imageLoader.d.ts +6 -0
  16. package/dist/util/imageLoader.js +52 -0
  17. package/dist/util/imageLoader.js.map +1 -0
  18. package/doc/.nvmrc +1 -0
  19. package/doc/.storybook/PolicyStudio.ts +11 -0
  20. package/doc/.storybook/main.ts +27 -0
  21. package/doc/.storybook/manager.ts +7 -0
  22. package/{.storybook/preview.js → doc/.storybook/preview.ts} +2 -3
  23. package/doc/package-lock.json +22653 -0
  24. package/doc/package.json +71 -0
  25. package/doc/shims-vue.d.ts +6 -0
  26. package/{src/stories/Accordion.stories.js → doc/src/stories/Accordion.stories.ts} +4 -5
  27. package/{src/stories/BadgeWithIcon.stories.js → doc/src/stories/BadgeWithIcon.stories.ts} +2 -2
  28. package/{src/stories/BarChart.stories.js → doc/src/stories/BarChart.stories.ts} +2 -2
  29. package/{src/stories/Breadcrumb.stories.js → doc/src/stories/Breadcrumb.stories.ts} +2 -5
  30. package/{src/stories/Button.stories.js → doc/src/stories/Button.stories.ts} +130 -130
  31. package/{src/stories/CardInfos.stories.js → doc/src/stories/CardInfos.stories.ts} +2 -3
  32. package/{src/stories/ChartLegend.stories.js → doc/src/stories/ChartLegend.stories.ts} +2 -3
  33. package/{src/stories/Checkbox.stories.js → doc/src/stories/Checkbox.stories.ts} +2 -2
  34. package/{src/stories/CheckboxSimple.stories.js → doc/src/stories/CheckboxSimple.stories.ts} +2 -2
  35. package/{src/stories/Chips.stories.js → doc/src/stories/Chips.stories.ts} +22 -23
  36. package/{src/stories/ClimateZoneBadge.stories.js → doc/src/stories/ClimateZoneBadge.stories.ts} +3 -2
  37. package/doc/src/stories/Collapse.stories.ts +46 -0
  38. package/{src/stories/CostEffectBar.stories.js → doc/src/stories/CostEffectBar.stories.ts} +3 -2
  39. package/{src/stories/Datatable.stories.js → doc/src/stories/Datatable.stories.ts} +7 -4
  40. package/{src/stories/DateCardInfo.stories.js → doc/src/stories/DateCardInfo.stories.ts} +2 -6
  41. package/{src/stories/Dialog.stories.js → doc/src/stories/Dialog.stories.ts} +2 -2
  42. package/{src/stories/Draggable.stories.js → doc/src/stories/Draggable.stories.ts} +3 -2
  43. package/{src/stories/Dropdown.stories.js → doc/src/stories/Dropdown.stories.ts} +4 -3
  44. package/{src/stories/DropdownList.stories.js → doc/src/stories/DropdownList.stories.ts} +4 -2
  45. package/{src/stories/ElevationSystem.stories.mdx → doc/src/stories/ElevationSystem.mdx} +1 -1
  46. package/{src/stories/HighlightRippleDot.stories.js → doc/src/stories/HighlightRippleDot.stories.ts} +3 -2
  47. package/{src/stories/Icon.stories.js → doc/src/stories/Icon.stories.ts} +3 -1
  48. package/{src/stories/InlineSelector.stories.js → doc/src/stories/InlineSelector.stories.ts} +2 -2
  49. package/{src/stories/Input.stories.js → doc/src/stories/Input.stories.ts} +7 -4
  50. package/{src/stories/InputSelect.stories.js → doc/src/stories/InputSelect.stories.ts} +3 -2
  51. package/{src/stories/InputTextArea.stories.js → doc/src/stories/InputTextArea.stories.ts} +2 -2
  52. package/{src/stories/Introduction.stories.mdx → doc/src/stories/Introduction.mdx} +101 -101
  53. package/{src/stories/MiniTag.stories.js → doc/src/stories/MiniTag.stories.ts} +9 -2
  54. package/{src/stories/ProgressBar.stories.js → doc/src/stories/ProgressBar.stories.ts} +3 -2
  55. package/{src/stories/RadioButton.stories.js → doc/src/stories/RadioButton.stories.ts} +2 -2
  56. package/{src/stories/RadioButtonSimple.stories.js → doc/src/stories/RadioButtonSimple.stories.ts} +2 -2
  57. package/{src/stories/SimpleAlert.stories.js → doc/src/stories/SimpleAlert.stories.ts} +3 -2
  58. package/{src/stories/Slider.stories.js → doc/src/stories/Slider.stories.ts} +6 -2
  59. package/{src/stories/Switch.stories.js → doc/src/stories/Switch.stories.ts} +2 -2
  60. package/{src/stories/TabHeader.stories.js → doc/src/stories/TabHeader.stories.ts} +6 -1
  61. package/{src/stories/TableResults.stories.js → doc/src/stories/TableResults.stories.ts} +11 -7
  62. package/{src/stories/TagScope.stories.js → doc/src/stories/TagScope.stories.ts} +3 -2
  63. package/{src/stories/TestimonialCard.stories.js → doc/src/stories/TestimonialCard.stories.ts} +3 -3
  64. package/{src/stories/Toast.stories.js → doc/src/stories/Toast.stories.ts} +2 -2
  65. package/{src/stories/Toggle.stories.js → doc/src/stories/Toggle.stories.ts} +7 -4
  66. package/{src/stories/Tooltip.stories.js → doc/src/stories/Tooltip.stories.ts} +6 -6
  67. package/{src/stories/Typography.stories.mdx → doc/src/stories/Typography.mdx} +107 -105
  68. package/doc/tsconfig.json +17 -0
  69. package/package.json +43 -39
  70. package/scripts/gulp.js +11 -0
  71. package/scripts/kill-port.sh +12 -0
  72. package/src/App.vue +30 -0
  73. package/src/assets/scss/base.scss +3 -30
  74. package/src/assets/scss/components/PsAccordion.scss +2 -2
  75. package/src/assets/scss/components/PsButton.scss +7 -1
  76. package/src/assets/scss/components/PsChips.scss +12 -7
  77. package/src/assets/scss/components/PsCollapse.scss +71 -0
  78. package/src/assets/scss/components/PsCostEffectBar.scss +4 -4
  79. package/src/assets/scss/components/PsDataTable.scss +1 -1
  80. package/src/assets/scss/components/PsDateCardInfo.scss +4 -5
  81. package/src/assets/scss/components/PsDialog.scss +7 -0
  82. package/src/assets/scss/components/PsDropdownList.scss +1 -1
  83. package/src/assets/scss/components/PsInput.scss +9 -0
  84. package/src/assets/scss/components/PsProgressBar.scss +4 -4
  85. package/src/assets/scss/components/PsTabHeader.scss +57 -2
  86. package/src/assets/scss/components/PsTableResults.scss +53 -22
  87. package/src/assets/scss/components/PsTestimonialCard.scss +1 -1
  88. package/src/assets/scss/components/PsTooltip.scss +149 -145
  89. package/src/components/accordion/PsAccordion.vue +20 -21
  90. package/src/components/accordion/PsAccordionItem.vue +121 -81
  91. package/src/components/badges-and-tags/PsBadgeWithIcon.vue +37 -36
  92. package/src/components/badges-and-tags/PsCardInfos.vue +40 -40
  93. package/src/components/badges-and-tags/PsChartLegend.vue +50 -41
  94. package/src/components/badges-and-tags/PsClimateZoneBadge.vue +13 -19
  95. package/src/components/badges-and-tags/PsCostEffectBar.vue +28 -61
  96. package/src/components/badges-and-tags/PsDateCardInfo.vue +17 -18
  97. package/src/components/badges-and-tags/PsHighlightRippleDot.vue +4 -3
  98. package/src/components/badges-and-tags/PsMiniTag.vue +39 -41
  99. package/src/components/badges-and-tags/PsProgressBar.vue +72 -68
  100. package/src/components/badges-and-tags/PsTagScope.vue +17 -22
  101. package/src/components/badges-and-tags/PsTestimonialCard.vue +25 -30
  102. package/src/components/buttons/PsButton.vue +90 -98
  103. package/src/components/chips/PsChips.vue +118 -103
  104. package/src/components/collapse/PsCollapse.vue +124 -0
  105. package/src/components/controls/PsCheckbox.vue +86 -83
  106. package/src/components/controls/PsCheckboxSimple.vue +97 -97
  107. package/src/components/controls/PsDraggable.vue +100 -99
  108. package/src/components/controls/PsInlineSelector.vue +111 -113
  109. package/src/components/controls/PsRadioButton.vue +72 -60
  110. package/src/components/controls/PsRadioButtonSimple.vue +81 -77
  111. package/src/components/controls/PsSlider.vue +190 -181
  112. package/src/components/controls/PsSwitch.vue +63 -54
  113. package/src/components/controls/PsToggle.vue +62 -57
  114. package/src/components/data-graphics/PsBarChart.vue +22 -23
  115. package/src/components/datatable/PsDataTable.vue +70 -65
  116. package/src/components/datatable/PsDataTableItem.vue +30 -32
  117. package/src/components/forms/PsDropdown.vue +173 -166
  118. package/src/components/forms/PsDropdownList.vue +133 -130
  119. package/src/components/forms/PsInput.vue +163 -146
  120. package/src/components/forms/PsInputSelect.vue +121 -100
  121. package/src/components/forms/PsInputTextArea.vue +84 -74
  122. package/src/components/navigations/PsBreadcrumb.vue +25 -34
  123. package/src/components/notifications/PsDialog.vue +67 -60
  124. package/src/components/notifications/PsSimpleAlert.vue +47 -37
  125. package/src/components/notifications/PsToast.vue +48 -42
  126. package/src/components/table-results/PsTableResults.vue +534 -506
  127. package/src/components/table-results/PsTableResultsBody.vue +69 -68
  128. package/src/components/table-results/PsTableResultsHead.vue +108 -69
  129. package/src/components/table-results/PsTableResultsHeadComparison.vue +88 -69
  130. package/src/components/table-results/PsTableResultsHeadFlexible.vue +112 -72
  131. package/src/components/table-results/PsTableResultsRow.vue +61 -58
  132. package/src/components/tabs/PsTabHeader.vue +138 -116
  133. package/src/components/tooltip/PsDialogTooltip.vue +112 -107
  134. package/src/components/tooltip/PsRichTooltip.vue +46 -43
  135. package/src/components/tooltip/PsTooltip.vue +126 -122
  136. package/src/components/ui/PsDotLoader.vue +6 -10
  137. package/src/components/ui/PsIcon.vue +149 -134
  138. package/src/index.ts +159 -0
  139. package/src/tsconfig.json +12 -0
  140. package/src/types/index.d.ts +6 -0
  141. package/src/util/GeneralFunctions.js +16 -7
  142. package/src/util/directives.ts +24 -0
  143. package/src/util/imageLoader.js +14 -7
  144. package/tailwind.config.js +12 -3
  145. package/tsconfig.json +47 -0
  146. package/.storybook/PolicyStudio.js +0 -10
  147. package/.storybook/eventBus.js +0 -3
  148. package/.storybook/main.js +0 -25
  149. package/.storybook/manager.js +0 -6
  150. package/babel.config.js +0 -3
  151. package/backup-package-lock.json +0 -37194
  152. package/dist/css/psui_styles.css +0 -110890
  153. package/postcss.config.js +0 -8
  154. package/src/components/playground/PsScrollBar.vue +0 -248
  155. package/src/index.js +0 -167
  156. package/src/stories/Playground.stories.js +0 -16
  157. /package/{src → doc/src}/assets/images/multifamily-units.svg +0 -0
  158. /package/{src → doc/src}/assets/images/policy-studio.svg +0 -0
  159. /package/{src/contents/ComparisonData.js → doc/src/contents/ComparisonData.ts} +0 -0
  160. /package/{src/contents/FlexibleData.js → doc/src/contents/FlexibleData.ts} +0 -0
  161. /package/{src/contents/ResultsData.js → doc/src/contents/ResultsData.ts} +0 -0
  162. /package/{src/stories/Colors.stories.mdx → doc/src/stories/Colors.mdx} +0 -0
  163. /package/{src → doc/src}/stories/assets/code-brackets.svg +0 -0
  164. /package/{src → doc/src}/stories/assets/colors.svg +0 -0
  165. /package/{src → doc/src}/stories/assets/comments.svg +0 -0
  166. /package/{src → doc/src}/stories/assets/direction.svg +0 -0
  167. /package/{src → doc/src}/stories/assets/flow.svg +0 -0
  168. /package/{src → doc/src}/stories/assets/plugin.svg +0 -0
  169. /package/{src → doc/src}/stories/assets/repo.svg +0 -0
  170. /package/{src → doc/src}/stories/assets/stackalt.svg +0 -0
@@ -1,159 +1,174 @@
1
1
  <template>
2
- <div :style="{display: display}">
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 v-else-if="getIconType === 'url'" :src="icon" :class="[iconClasses]" />
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
- ></inline-svg>
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
- * It set a animation icon if needed.
91
- */
92
- loaderIcon: {
93
- type: String,
94
- default: 'hourglass_top'
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
- data() {
106
- return {
107
- finishedImageLoad: false,
108
- imageLoadError: false
109
- }
44
+ /**
45
+ * It sets the type of the icon.
46
+ */
47
+ type: {
48
+ type: String,
49
+ default: '',
110
50
  },
111
- computed: {
112
- getIconType() {
113
- if(this.imageLoadError || !this.finishedImageLoad) return 'material-icons'
114
- if(this.type) return this.type
115
- if(!this.icon?.includes('/')) return 'material-icons'
116
- if(!this.icon?.includes('.svg')) return 'url'
117
- return 'svg'
118
- },
119
- getIcon() {
120
- if(!this.icon?.includes('/')) return this.icon ? this.icon : this.loaderErrorIcon
121
- if(!this.finishedImageLoad && !this.imageLoadError && this.loaderIcon) return this.loaderIcon
122
- if(this.imageLoadError) return this.loaderErrorIcon
123
- return this.icon ? this.icon : this.loaderErrorIcon
124
- },
125
- getIconClasses() {
126
- if(this.iconClasses) return this.iconClasses
127
- return `${this.color}`
128
- },
129
- getHeight() {
130
- return this.height
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
- watch: {
138
- 'icon': function() {
139
- this.loadImage()
140
- }
92
+ /**
93
+ * It set a animation icon if needed.
94
+ */
95
+ loaderIcon: {
96
+ type: String,
97
+ default: 'hourglass_top',
141
98
  },
142
- mounted() {
143
- if(this.icon?.includes('/')) this.loadImage()
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
- methods: {
146
- loadImage() {
147
- this.finishedImageLoad = false
148
- this.imageLoadError = false
149
- imageLoader({ imageUrl: this.icon, returnsBase64: false })
150
- .then(() => {
151
- this.finishedImageLoad = true
152
- })
153
- .catch(() => {
154
- this.imageLoadError = true
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
+
@@ -0,0 +1,12 @@
1
+ {
2
+ "compilerOptions": {
3
+ "rootDir": "../",
4
+ "strict": true,
5
+ "outDir": "../dist",
6
+ "resolveJsonModule": true,
7
+ "allowJs": true
8
+ },
9
+ "references": [
10
+ {"path": "../"}
11
+ ]
12
+ }
@@ -0,0 +1,6 @@
1
+ /* eslint-disable */
2
+ declare module '*.vue' {
3
+ import type { DefineComponent } from 'vue'
4
+ const component: DefineComponent<{}, {}, any>
5
+ export default component
6
+ }
@@ -1,14 +1,13 @@
1
1
  export const randomString = (length) => {
2
- var result = ''
3
- var characters =
2
+ let result = ''
3
+ const characters =
4
4
  'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
5
- var charactersLength = characters.length
6
- for (var i = 0; i < length; i++) {
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.$options.name === name) {
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
- } else {
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
+ }
@@ -1,18 +1,21 @@
1
1
  export default ({ imageUrl, onProgress = null, returnsBase64 = true }) => {
2
2
  return new Promise((resolve, reject) => {
3
- var xhr = new XMLHttpRequest()
4
- var notifiedNotComputable = false
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
- let progress = parseInt((ev.loaded / ev.total) * 100)
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
- var options = {}
34
- var headers = xhr.getAllResponseHeaders()
35
- var mime = headers.match(/^Content-Type\\:\s*(.*?)$/mi)
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
- var blob = new Blob([xhr.response], options)
44
+ const blob = new Blob([xhr.response], options)
38
45
  resolve(window.URL.createObjectURL(blob))
39
46
  }
40
47
  }
@@ -1,7 +1,16 @@
1
- module.exports = {
1
+ /** @type {import('tailwindcss').Config} */
2
+
3
+ export default {
2
4
  prefix: 'psui-',
3
- purge: ['./index.html', './src/**/*.vue,js,ts,jsx,tsx}'],
4
- darkMode: false, // or 'media' or 'class'
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
+ }