@policystudio/policy-studio-ui-vue 1.1.90-beta.5 → 1.1.90-beta.51

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 (160) hide show
  1. package/.eslintrc.js +2 -8
  2. package/.github/workflows/deploy-storybook.yml +4 -4
  3. package/.nvmrc +1 -0
  4. package/dist/css/psui_styles_output.css +6639 -0
  5. package/dist/index.d.ts +51 -0
  6. package/dist/index.js +106 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/util/GeneralFunctions.d.ts +3 -0
  9. package/dist/util/GeneralFunctions.js +35 -0
  10. package/dist/util/GeneralFunctions.js.map +1 -0
  11. package/dist/util/directives.d.ts +1 -0
  12. package/dist/util/directives.js +22 -0
  13. package/dist/util/directives.js.map +1 -0
  14. package/dist/util/imageLoader.d.ts +6 -0
  15. package/dist/util/imageLoader.js +52 -0
  16. package/dist/util/imageLoader.js.map +1 -0
  17. package/doc/.nvmrc +1 -0
  18. package/{.storybook → doc/.storybook}/main.ts +8 -2
  19. package/{.storybook → doc/.storybook}/preview.ts +2 -3
  20. package/doc/package-lock.json +22653 -0
  21. package/doc/package.json +71 -0
  22. package/{src → doc}/shims-vue.d.ts +0 -5
  23. package/{src → doc/src}/stories/Accordion.stories.ts +2 -3
  24. package/{src → doc/src}/stories/BadgeWithIcon.stories.ts +1 -1
  25. package/{src → doc/src}/stories/BarChart.stories.ts +1 -1
  26. package/{src → doc/src}/stories/Breadcrumb.stories.ts +1 -1
  27. package/doc/src/stories/Button.stories.ts +130 -0
  28. package/{src → doc/src}/stories/CardInfos.stories.ts +1 -1
  29. package/{src → doc/src}/stories/ChartLegend.stories.ts +1 -1
  30. package/{src → doc/src}/stories/Checkbox.stories.ts +1 -1
  31. package/{src → doc/src}/stories/CheckboxSimple.stories.ts +1 -1
  32. package/{src → doc/src}/stories/Chips.stories.ts +1 -4
  33. package/{src → doc/src}/stories/ClimateZoneBadge.stories.ts +2 -1
  34. package/doc/src/stories/Collapse.stories.ts +46 -0
  35. package/{src → doc/src}/stories/CostEffectBar.stories.ts +2 -1
  36. package/{src → doc/src}/stories/Datatable.stories.ts +5 -2
  37. package/{src → doc/src}/stories/DateCardInfo.stories.ts +1 -1
  38. package/{src → doc/src}/stories/Dialog.stories.ts +2 -2
  39. package/{src → doc/src}/stories/Draggable.stories.ts +3 -2
  40. package/{src → doc/src}/stories/Dropdown.stories.ts +4 -3
  41. package/{src → doc/src}/stories/DropdownList.stories.ts +4 -2
  42. package/{src → doc/src}/stories/HighlightRippleDot.stories.ts +3 -2
  43. package/{src → doc/src}/stories/Icon.stories.ts +3 -1
  44. package/{src → doc/src}/stories/InlineSelector.stories.ts +1 -1
  45. package/{src → doc/src}/stories/Input.stories.ts +7 -4
  46. package/{src → doc/src}/stories/InputSelect.stories.ts +3 -2
  47. package/{src → doc/src}/stories/InputTextArea.stories.ts +1 -1
  48. package/{src → doc/src}/stories/MiniTag.stories.ts +9 -2
  49. package/{src → doc/src}/stories/ProgressBar.stories.ts +3 -2
  50. package/{src → doc/src}/stories/RadioButton.stories.ts +2 -2
  51. package/{src → doc/src}/stories/RadioButtonSimple.stories.ts +1 -1
  52. package/{src → doc/src}/stories/SimpleAlert.stories.ts +3 -2
  53. package/{src → doc/src}/stories/Slider.stories.ts +6 -2
  54. package/{src → doc/src}/stories/Switch.stories.ts +2 -2
  55. package/{src → doc/src}/stories/TabHeader.stories.ts +6 -1
  56. package/{src → doc/src}/stories/TableResults.stories.ts +11 -7
  57. package/{src → doc/src}/stories/TagScope.stories.ts +3 -2
  58. package/{src → doc/src}/stories/TestimonialCard.stories.ts +3 -3
  59. package/{src → doc/src}/stories/Toast.stories.ts +2 -2
  60. package/{src → doc/src}/stories/Toggle.stories.ts +6 -3
  61. package/{src → doc/src}/stories/Tooltip.stories.ts +3 -3
  62. package/doc/tsconfig.json +17 -0
  63. package/package.json +13 -28
  64. package/scripts/gulp.js +11 -0
  65. package/src/assets/scss/base.scss +3 -34
  66. package/src/assets/scss/components/PsAccordion.scss +1 -1
  67. package/src/assets/scss/components/PsChips.scss +9 -3
  68. package/src/assets/scss/components/PsCollapse.scss +71 -0
  69. package/src/assets/scss/components/PsDataTable.scss +1 -1
  70. package/src/assets/scss/components/PsDropdownList.scss +1 -1
  71. package/src/assets/scss/components/PsTableResults.scss +28 -1
  72. package/src/assets/scss/components/PsTooltip.scss +2 -1
  73. package/src/components/accordion/PsAccordionItem.vue +88 -74
  74. package/src/components/badges-and-tags/PsBadgeWithIcon.vue +31 -34
  75. package/src/components/badges-and-tags/PsCardInfos.vue +39 -41
  76. package/src/components/badges-and-tags/PsChartLegend.vue +46 -51
  77. package/src/components/badges-and-tags/PsClimateZoneBadge.vue +13 -19
  78. package/src/components/badges-and-tags/PsCostEffectBar.vue +24 -56
  79. package/src/components/badges-and-tags/PsDateCardInfo.vue +17 -18
  80. package/src/components/badges-and-tags/PsHighlightRippleDot.vue +3 -2
  81. package/src/components/badges-and-tags/PsMiniTag.vue +39 -41
  82. package/src/components/badges-and-tags/PsProgressBar.vue +72 -68
  83. package/src/components/badges-and-tags/PsTagScope.vue +17 -22
  84. package/src/components/badges-and-tags/PsTestimonialCard.vue +19 -26
  85. package/src/components/buttons/PsButton.vue +61 -62
  86. package/src/components/chips/PsChips.vue +112 -101
  87. package/src/components/collapse/PsCollapse.vue +124 -0
  88. package/src/components/controls/PsCheckbox.vue +84 -84
  89. package/src/components/controls/PsCheckboxSimple.vue +95 -95
  90. package/src/components/controls/PsDraggable.vue +53 -55
  91. package/src/components/controls/PsInlineSelector.vue +98 -99
  92. package/src/components/controls/PsRadioButton.vue +65 -58
  93. package/src/components/controls/PsRadioButtonSimple.vue +79 -75
  94. package/src/components/controls/PsSlider.vue +185 -176
  95. package/src/components/controls/PsSwitch.vue +51 -52
  96. package/src/components/controls/PsToggle.vue +52 -50
  97. package/src/components/data-graphics/PsBarChart.vue +18 -21
  98. package/src/components/datatable/PsDataTable.vue +56 -60
  99. package/src/components/datatable/PsDataTableItem.vue +13 -28
  100. package/src/components/forms/PsDropdown.vue +166 -162
  101. package/src/components/forms/PsDropdownList.vue +133 -130
  102. package/src/components/forms/PsInput.vue +154 -153
  103. package/src/components/forms/PsInputSelect.vue +91 -92
  104. package/src/components/forms/PsInputTextArea.vue +70 -71
  105. package/src/components/navigations/PsBreadcrumb.vue +25 -34
  106. package/src/components/notifications/PsDialog.vue +57 -56
  107. package/src/components/notifications/PsSimpleAlert.vue +27 -29
  108. package/src/components/notifications/PsToast.vue +40 -39
  109. package/src/components/table-results/PsTableResults.vue +461 -468
  110. package/src/components/table-results/PsTableResultsBody.vue +66 -67
  111. package/src/components/table-results/PsTableResultsHead.vue +70 -67
  112. package/src/components/table-results/PsTableResultsHeadComparison.vue +67 -64
  113. package/src/components/table-results/PsTableResultsHeadFlexible.vue +94 -67
  114. package/src/components/table-results/PsTableResultsRow.vue +55 -56
  115. package/src/components/tabs/PsTabHeader.vue +106 -100
  116. package/src/components/tooltip/PsDialogTooltip.vue +96 -101
  117. package/src/components/tooltip/PsRichTooltip.vue +41 -45
  118. package/src/components/tooltip/PsTooltip.vue +111 -116
  119. package/src/components/ui/PsDotLoader.vue +1 -5
  120. package/src/components/ui/PsIcon.vue +143 -132
  121. package/src/index.ts +60 -67
  122. package/src/tsconfig.json +12 -0
  123. package/src/types/index.d.ts +6 -0
  124. package/src/util/{GeneralFunctions.ts → GeneralFunctions.js} +12 -3
  125. package/src/util/directives.ts +24 -0
  126. package/src/util/{imageLoader.ts → imageLoader.js} +7 -0
  127. package/tailwind.config.js +1 -1
  128. package/tsconfig.json +18 -13
  129. package/.storybook/eventBus.ts +0 -26
  130. package/babel.config.js +0 -17
  131. package/dist/css/psui_styles.css +0 -4647
  132. package/postcss.config.js +0 -8
  133. package/src/components/playground/PsScrollBar.vue +0 -320
  134. package/src/stories/Button.stories.ts +0 -48
  135. package/src/stories/Button.vue +0 -59
  136. package/src/stories/Header.stories.ts +0 -41
  137. package/src/stories/Header.vue +0 -77
  138. package/src/stories/Playground.stories.ts +0 -16
  139. package/src/stories/button.css +0 -30
  140. package/src/stories/header.css +0 -32
  141. package/webpack.config.js +0 -22
  142. /package/{.storybook → doc/.storybook}/PolicyStudio.ts +0 -0
  143. /package/{.storybook → doc/.storybook}/manager.ts +0 -0
  144. /package/{src → doc/src}/assets/images/multifamily-units.svg +0 -0
  145. /package/{src → doc/src}/assets/images/policy-studio.svg +0 -0
  146. /package/{src → doc/src}/contents/ComparisonData.ts +0 -0
  147. /package/{src → doc/src}/contents/FlexibleData.ts +0 -0
  148. /package/{src → doc/src}/contents/ResultsData.ts +0 -0
  149. /package/{src → doc/src}/stories/Colors.mdx +0 -0
  150. /package/{src → doc/src}/stories/ElevationSystem.mdx +0 -0
  151. /package/{src → doc/src}/stories/Introduction.mdx +0 -0
  152. /package/{src → doc/src}/stories/Typography.mdx +0 -0
  153. /package/{src → doc/src}/stories/assets/code-brackets.svg +0 -0
  154. /package/{src → doc/src}/stories/assets/colors.svg +0 -0
  155. /package/{src → doc/src}/stories/assets/comments.svg +0 -0
  156. /package/{src → doc/src}/stories/assets/direction.svg +0 -0
  157. /package/{src → doc/src}/stories/assets/flow.svg +0 -0
  158. /package/{src → doc/src}/stories/assets/plugin.svg +0 -0
  159. /package/{src → doc/src}/stories/assets/repo.svg +0 -0
  160. /package/{src → doc/src}/stories/assets/stackalt.svg +0 -0
@@ -1,10 +1,13 @@
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>
@@ -16,148 +19,156 @@
16
19
  <inline-svg
17
20
  v-else
18
21
  :src="icon"
19
- :width="size"
20
- :height="size"
21
- :stroke="getColor"
22
+ :width="width ? width : size"
23
+ :height="height ? height : size"
24
+ :stroke="stroke ? stroke : disableStroke ? null : getColor"
22
25
  :fill="getColor"
23
26
  />
24
27
  </div>
25
28
  </template>
26
29
 
27
- <script>
28
- import tailwindConfig from '../../../tailwind.config'
29
- import imageLoader from '../../util/imageLoader'
30
- export default {
31
- name: 'AppIcon',
32
- props: {
33
- /**
34
- * 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/.
35
- */
36
- icon: {
37
- type: String,
38
- default: 'more_horiz'
39
- },
30
+ <script setup>
31
+ import tailwindConfig from '../../../tailwind.config.js'
32
+ import imageLoader from '../../util/imageLoader.js'
40
33
 
41
- /**
42
- * It sets the type of the icon.
43
- */
44
- type: {
45
- type: String,
46
- },
34
+ import { ref, computed, watch, onMounted } from 'vue'
47
35
 
48
- /**
49
- * It sets the style of the icon.
50
- */
51
- iconClasses: {
52
- type: String,
53
- default: null
54
- },
55
-
56
- /**
57
- * It sets the size of the icon.
58
- */
59
- size: {
60
- type: [Number, String],
61
- default: 24
62
- },
63
-
64
- /**
65
- * It sets fill property of the icon.
66
- */
67
- stroke: {
68
- type: String,
69
- default: null
70
- },
71
-
72
- /**
73
- * It sets fill property display of the icon.
74
- */
75
- display: {
76
- type: String,
77
- default: 'contents'
78
- },
79
-
80
- /**
81
- * It sets the color of the icon.
82
- */
83
- color: {
84
- type: String,
85
- default: null,
86
- validator: value => {
87
- return value?.includes('psui-text-') &&
88
- typeof(tailwindConfig.theme.colors[value.replace('psui-text-', '')]) != 'undefined' ||
89
- typeof(tailwindConfig.theme.colors[value]) != 'undefined'
90
- }
91
- },
92
-
93
- /**
94
- * It set a animation icon if needed.
95
- */
96
- loaderIcon: {
97
- type: String,
98
- default: 'hourglass_top'
99
- },
100
-
101
- /**
102
- * It sets a error when the icon is not available.
103
- */
104
- loaderErrorIcon: {
105
- type: String,
106
- default: 'more_horiz'
107
- }
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',
108
43
  },
109
- data() {
110
- return {
111
- finishedImageLoad: false,
112
- imageLoadError: false
113
- }
44
+ /**
45
+ * It sets the type of the icon.
46
+ */
47
+ type: {
48
+ type: String,
49
+ default: '',
114
50
  },
115
- computed: {
116
- getIconType() {
117
- if(this.imageLoadError || !this.finishedImageLoad) return 'material-icons'
118
- if(this.type) return this.type
119
- if(!this.icon?.includes('/')) return 'material-icons'
120
- if(!this.icon?.includes('.svg')) return 'url'
121
- return 'svg'
122
- },
123
- getIcon() {
124
- if(!this.icon?.includes('/')) return this.icon ? this.icon : this.loaderErrorIcon
125
- if(!this.finishedImageLoad && !this.imageLoadError && this.loaderIcon) return this.loaderIcon
126
- if(this.imageLoadError) return this.loaderErrorIcon
127
- return this.icon ? this.icon : this.loaderErrorIcon
128
- },
129
- getIconClasses() {
130
- if(this.iconClasses) return this.iconClasses
131
- return `${this.color}`
132
- },
133
- getHeight() {
134
- 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
+ )
135
90
  },
136
- getColor() {
137
- if(this.getIconType === 'material-icons') return this.color
138
- return tailwindConfig.theme.colors[this.color.replace('psui-text-', '')] || tailwindConfig.theme.colors[this.color]
139
- }
140
91
  },
141
- watch: {
142
- 'icon': function() {
143
- this.loadImage()
144
- }
92
+ /**
93
+ * It set a animation icon if needed.
94
+ */
95
+ loaderIcon: {
96
+ type: String,
97
+ default: 'hourglass_top',
98
+ },
99
+
100
+ /**
101
+ * It sets a error when the icon is not available.
102
+ */
103
+ loaderErrorIcon: {
104
+ type: String,
105
+ default: 'more_horiz',
145
106
  },
146
- mounted() {
147
- if(this.icon?.includes('/')) this.loadImage()
107
+ disableStroke: {
108
+ type: Boolean,
109
+ default: false,
148
110
  },
149
- methods: {
150
- loadImage() {
151
- this.finishedImageLoad = false
152
- this.imageLoadError = false
153
- imageLoader({ imageUrl: this.icon, returnsBase64: false })
154
- .then(() => {
155
- this.finishedImageLoad = true
156
- })
157
- .catch(() => {
158
- this.imageLoadError = true
159
- })
160
- }
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
+ })
161
172
  }
162
173
  }
163
- </script>
174
+ </script>
package/src/index.ts CHANGED
@@ -1,56 +1,58 @@
1
1
  /**
2
2
  * General Components
3
3
  */
4
+ import { directives } from './util/directives'
4
5
 
5
- import PsButton from './components/buttons/PsButton.vue'
6
- import PsCheckbox from './components/controls/PsCheckbox.vue'
7
- import PsRadioButton from './components/controls/PsRadioButton.vue'
8
- import PsSlider from './components/controls/PsSlider.vue'
9
- import PsSwitch from './components/controls/PsSwitch.vue'
10
- import PsToggle from './components/controls/PsToggle.vue'
11
- import PsInput from './components/forms/PsInput.vue'
12
- import PsDropdown from './components/forms/PsDropdown.vue'
13
- import PsDropdownList from './components/forms/PsDropdownList.vue'
14
- import PsInputTextArea from './components/forms/PsInputTextArea.vue'
15
- import PsInputSelect from './components/forms/PsInputSelect.vue'
16
- import PsDialog from './components/notifications/PsDialog.vue'
17
- import PsToast from './components/notifications/PsToast.vue'
18
- import PsTabHeader from './components/tabs/PsTabHeader.vue'
19
- import PsAccordion from './components/accordion/PsAccordion.vue'
20
- import PsAccordionItem from './components/accordion/PsAccordionItem.vue'
21
- import PsChips from './components/chips/PsChips.vue'
22
- import PsDataTable from './components/datatable/PsDataTable.vue'
23
- import PsDataTableItem from './components/datatable/PsDataTableItem.vue'
24
- import PsTableResults from './components/table-results/PsTableResults.vue'
25
- import PsTableResultsBody from './components/table-results/PsTableResultsBody.vue'
26
- import PsTableResultsHead from './components/table-results/PsTableResultsHead.vue'
27
- import PsTableResultsHeadComparison from './components/table-results/PsTableResultsHeadComparison.vue'
28
- import PsTableResultsHeadFlexible from './components/table-results/PsTableResultsHeadFlexible.vue'
29
- import PsIcon from './components/ui/PsIcon.vue'
30
- import PsDotLoader from './components/ui/PsDotLoader.vue'
31
- import PsTooltip from './components/tooltip/PsTooltip.vue'
32
- import PsRichTooltip from './components/tooltip/PsRichTooltip.vue'
33
- import PsDialogTooltip from './components/tooltip/PsDialogTooltip.vue'
34
- import PsDraggable from './components/controls/PsDraggable.vue'
35
- import PsCardInfos from './components/badges-and-tags/PsCardInfos.vue'
36
- import PsChartLegend from './components/badges-and-tags/PsChartLegend.vue'
37
- import PsInlineSelector from './components/controls/PsInlineSelector.vue'
38
- import PsScrollBar from './components/playground/PsScrollBar.vue'
39
- import PsMiniTag from './components/badges-and-tags/PsMiniTag.vue'
40
- import PsCheckboxSimple from './components/controls/PsCheckboxSimple.vue'
41
- import PsBadgeWithIcon from './components/badges-and-tags/PsBadgeWithIcon.vue'
42
- import PsProgressBar from './components/badges-and-tags/PsProgressBar.vue'
43
- import PsRadioButtonSimple from './components/controls/PsRadioButtonSimple.vue'
44
- import PsTestimonialCard from './components/badges-and-tags/PsTestimonialCard.vue'
45
- import PsDateCardInfo from './components/badges-and-tags/PsDateCardInfo.vue'
46
- import PsTagScope from './components/badges-and-tags/PsTagScope.vue'
47
- import PsBarChart from './components/data-graphics/PsBarChart.vue'
48
- import PsSimpleAlert from './components/notifications/PsSimpleAlert.vue'
49
- import PsBreadcrumb from './components/navigations/PsBreadcrumb.vue'
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'
50
52
 
51
53
 
52
54
  export default {
53
- install(Vue) {
55
+ install(Vue:any) {
54
56
  Vue.component('PsButton', PsButton)
55
57
  Vue.component('PsCheckbox', PsCheckbox)
56
58
  Vue.component('PsDialog', PsDialog)
@@ -66,9 +68,10 @@ export default {
66
68
  Vue.component('PsChips', PsChips)
67
69
  Vue.component('PsDataTable', PsDataTable)
68
70
  Vue.component('PsDataTableItem', PsDataTableItem)
69
- Vue.component('PsTableResults', PsTableResults)
70
71
  Vue.component('PsTableResultsHead', PsTableResultsHead)
71
72
  Vue.component('PsTableResultsHeadComparison', PsTableResultsHeadComparison)
73
+ Vue.component('PsTableResults', PsTableResults)
74
+ Vue.component('PsTableResultsRow', PsTableResultsRow)
72
75
  Vue.component('PsTableResultsBody', PsTableResultsBody)
73
76
  Vue.component('PsTableResultsHeadFlexible',PsTableResultsHeadFlexible)
74
77
  Vue.component('PsIcon', PsIcon)
@@ -84,7 +87,6 @@ export default {
84
87
  Vue.component('PsInputSelect', PsInputSelect)
85
88
  Vue.component('PsDropdown',PsDropdown)
86
89
  Vue.component('PsDropdownList', PsDropdownList)
87
- Vue.component('PsScrollBar', PsScrollBar)
88
90
  Vue.component('PsMiniTag', PsMiniTag)
89
91
  Vue.component('PsCheckboxSimple', PsCheckboxSimple)
90
92
  Vue.component('PsBadgeWithIcon', PsBadgeWithIcon)
@@ -96,23 +98,13 @@ export default {
96
98
  Vue.component('PsBarChart',PsBarChart)
97
99
  Vue.component('PsSimpleAlert',PsSimpleAlert)
98
100
  Vue.component('PsBreadcrumb', PsBreadcrumb)
101
+ Vue.component('PsCollapse', PsCollapse)
99
102
 
100
-
101
- Vue.directive('click-outside', {
102
- bind: function (el, binding, vnode) {
103
- el.clickOutsideEvent = function (event) {
104
- // here I check that click was outside the el and his children
105
- if (!(el == event.target || el.contains(event.target))) {
106
- // and if it did, call method provided in attribute value
107
- vnode.context[binding.expression](event)
108
- }
109
- }
110
- document.body.addEventListener('click', el.clickOutsideEvent)
111
- },
112
- unbind: function (el) {
113
- document.body.removeEventListener('click', el.clickOutsideEvent)
114
- },
115
- })
103
+ /**
104
+ * Initialize directives
105
+ */
106
+ directives(Vue)
107
+
116
108
  },
117
109
  }
118
110
 
@@ -132,7 +124,6 @@ export {
132
124
  PsChips,
133
125
  PsDataTable,
134
126
  PsDataTableItem,
135
- PsTableResults,
136
127
  PsTableResultsHead,
137
128
  PsTableResultsBody,
138
129
  PsTableResultsHeadFlexible,
@@ -150,7 +141,6 @@ export {
150
141
  PsInputSelect,
151
142
  PsDropdown,
152
143
  PsDropdownList,
153
- PsScrollBar,
154
144
  PsMiniTag,
155
145
  PsCheckboxSimple,
156
146
  PsBadgeWithIcon,
@@ -161,6 +151,9 @@ export {
161
151
  PsTagScope,
162
152
  PsBarChart,
163
153
  PsSimpleAlert,
164
- PsBreadcrumb
154
+ PsBreadcrumb,
155
+ PsTableResults,
156
+ PsTableResultsRow,
157
+ PsCollapse
165
158
  }
166
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
+ }
@@ -8,7 +8,6 @@ export const randomString = (length) => {
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
+ }
@@ -8,11 +8,14 @@ export default ({ imageUrl, onProgress = null, returnsBase64 = true }) => {
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,19 +23,23 @@ 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
39
  const options = {}
34
40
  const headers = xhr.getAllResponseHeaders()
35
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))
@@ -1,6 +1,6 @@
1
1
  /** @type {import('tailwindcss').Config} */
2
2
 
3
- module.exports = {
3
+ export default {
4
4
  prefix: 'psui-',
5
5
  content: [
6
6
  './index.html',
package/tsconfig.json CHANGED
@@ -3,40 +3,45 @@
3
3
  "target": "esnext",
4
4
  "module": "esnext",
5
5
  "strict": true,
6
+ "strictNullChecks": true,
6
7
  "jsx": "preserve",
8
+ "declaration": true,
7
9
  "moduleResolution": "node",
8
- "allowJs": true,
10
+ "composite": true,
11
+ "noEmitOnError": false,
12
+ "outDir": "dist",
13
+ "rootDir": "src",
9
14
  "skipLibCheck": true,
15
+ "skipDefaultLibCheck": true,
10
16
  "esModuleInterop": true,
11
17
  "allowSyntheticDefaultImports": true,
12
18
  "forceConsistentCasingInFileNames": true,
13
19
  "useDefineForClassFields": true,
14
20
  "sourceMap": true,
15
- "baseUrl": ".",
21
+ "allowJs": true,
22
+ "baseUrl": "",
23
+
16
24
  "types": [
17
- "webpack-env"
25
+ "webpack-env",
18
26
  ],
19
- "paths": {
20
- "@/*": [
21
- "src/*"
22
- ]
23
- },
24
27
  "lib": [
25
28
  "esnext",
26
- "dom",
29
+ "dom",
27
30
  "dom.iterable",
28
31
  "scripthost"
29
32
  ]
30
33
  },
31
34
  "include": [
32
35
  "src/**/*.ts",
33
- "src/**/*.tsx",
36
+ "src/**/*.d.ts",
34
37
  "src/**/*.vue",
35
38
  "tests/**/*.ts",
36
- "tests/**/*.tsx",
37
- ".storybook/*.ts"
39
+ "tests/**/*.tsx",
40
+ "src/util/GeneralFunctions.js",
41
+ "src/util/imageLoader.js",
38
42
  ],
39
43
  "exclude": [
40
- "node_modules"
44
+ "node_modules",
45
+ "doc"
41
46
  ]
42
47
  }