@policystudio/policy-studio-ui-vue 1.1.90-beta.2 → 1.1.90-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +13 -8
- package/.github/workflows/deploy-storybook.yml +4 -4
- package/.nvmrc +1 -0
- package/dist/css/psui_styles_output.css +6986 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.js +104 -0
- package/dist/index.js.map +1 -0
- package/dist/util/GeneralFunctions.d.ts +3 -0
- package/dist/util/GeneralFunctions.js +29 -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/package.json +24 -37
- package/src/App.vue +30 -0
- package/src/assets/scss/components/PsDataTable.scss +1 -1
- package/src/components/accordion/PsAccordionItem.vue +75 -75
- package/src/components/badges-and-tags/PsBadgeWithIcon.vue +31 -33
- package/src/components/badges-and-tags/PsCardInfos.vue +39 -41
- package/src/components/badges-and-tags/PsChartLegend.vue +46 -51
- package/src/components/badges-and-tags/PsClimateZoneBadge.vue +13 -19
- package/src/components/badges-and-tags/PsCostEffectBar.vue +24 -56
- package/src/components/badges-and-tags/PsDateCardInfo.vue +17 -18
- package/src/components/badges-and-tags/PsHighlightRippleDot.vue +3 -2
- 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 +19 -26
- package/src/components/buttons/PsButton.vue +88 -111
- package/src/components/chips/PsChips.vue +98 -101
- package/src/components/controls/PsCheckbox.vue +84 -84
- package/src/components/controls/PsCheckboxSimple.vue +95 -95
- package/src/components/controls/PsDraggable.vue +53 -55
- package/src/components/controls/PsInlineSelector.vue +98 -99
- package/src/components/controls/PsRadioButton.vue +59 -58
- package/src/components/controls/PsRadioButtonSimple.vue +79 -75
- package/src/components/controls/PsSlider.vue +185 -176
- package/src/components/controls/PsSwitch.vue +51 -52
- package/src/components/controls/PsToggle.vue +52 -50
- package/src/components/data-graphics/PsBarChart.vue +18 -21
- package/src/components/datatable/PsDataTable.vue +56 -60
- package/src/components/datatable/PsDataTableItem.vue +13 -28
- package/src/components/forms/PsDropdown.vue +164 -162
- package/src/components/forms/PsDropdownList.vue +133 -130
- package/src/components/forms/PsInput.vue +154 -153
- package/src/components/forms/PsInputSelect.vue +91 -92
- package/src/components/forms/PsInputTextArea.vue +71 -71
- package/src/components/navigations/PsBreadcrumb.vue +25 -34
- package/src/components/notifications/PsDialog.vue +57 -56
- package/src/components/notifications/PsSimpleAlert.vue +27 -29
- package/src/components/notifications/PsToast.vue +40 -39
- package/src/components/table-results/PsTableResults.vue +449 -458
- package/src/components/table-results/PsTableResultsBody.vue +66 -67
- package/src/components/table-results/PsTableResultsHead.vue +62 -56
- package/src/components/table-results/PsTableResultsHeadComparison.vue +62 -56
- package/src/components/table-results/PsTableResultsHeadFlexible.vue +63 -56
- package/src/components/table-results/PsTableResultsRow.vue +55 -56
- package/src/components/tabs/PsTabHeader.vue +106 -100
- package/src/components/tooltip/PsDialogTooltip.vue +96 -101
- package/src/components/tooltip/PsRichTooltip.vue +41 -45
- package/src/components/tooltip/PsTooltip.vue +111 -116
- package/src/components/ui/PsDotLoader.vue +1 -5
- package/src/components/ui/PsIcon.vue +126 -129
- package/src/index.ts +156 -0
- package/src/tsconfig.json +12 -0
- package/src/types/index.d.ts +6 -0
- package/src/util/GeneralFunctions.js +4 -6
- package/src/util/directives.ts +24 -0
- package/src/util/imageLoader.js +14 -7
- package/tailwind.config.js +1 -1
- package/tsconfig.json +47 -0
- package/.storybook/PolicyStudio.js +0 -10
- package/.storybook/eventBus.js +0 -26
- package/.storybook/main.js +0 -21
- package/.storybook/manager.js +0 -6
- package/.storybook/preview.js +0 -17
- package/babel.config.js +0 -17
- package/dist/css/psui_styles.css +0 -4647
- package/postcss.config.js +0 -8
- package/src/assets/images/multifamily-units.svg +0 -10
- package/src/assets/images/policy-studio.svg +0 -15
- package/src/components/playground/PsScrollBar.vue +0 -320
- package/src/contents/ComparisonData.js +0 -378
- package/src/contents/FlexibleData.js +0 -502
- package/src/contents/ResultsData.js +0 -531
- package/src/index.js +0 -166
- package/src/stories/Accordion.stories.js +0 -59
- package/src/stories/BadgeWithIcon.stories.js +0 -31
- package/src/stories/BarChart.stories.js +0 -17
- package/src/stories/Breadcrumb.stories.js +0 -25
- package/src/stories/Button.stories.js +0 -48
- package/src/stories/Button.vue +0 -59
- package/src/stories/CardInfos.stories.js +0 -16
- package/src/stories/ChartLegend.stories.js +0 -16
- package/src/stories/Checkbox.stories.js +0 -45
- package/src/stories/CheckboxSimple.stories.js +0 -49
- package/src/stories/Chips.stories.js +0 -31
- package/src/stories/ClimateZoneBadge.stories.js +0 -17
- package/src/stories/Colors.mdx +0 -70
- package/src/stories/CostEffectBar.stories.js +0 -23
- package/src/stories/Datatable.stories.js +0 -50
- package/src/stories/DateCardInfo.stories.js +0 -24
- package/src/stories/Dialog.stories.js +0 -131
- package/src/stories/Draggable.stories.js +0 -22
- package/src/stories/Dropdown.stories.js +0 -99
- package/src/stories/DropdownList.stories.js +0 -211
- package/src/stories/ElevationSystem.mdx +0 -41
- package/src/stories/Header.stories.js +0 -41
- package/src/stories/Header.vue +0 -77
- package/src/stories/HighlightRippleDot.stories.js +0 -15
- package/src/stories/Icon.stories.js +0 -21
- package/src/stories/InlineSelector.stories.js +0 -18
- package/src/stories/Input.stories.js +0 -240
- package/src/stories/InputSelect.stories.js +0 -30
- package/src/stories/InputTextArea.stories.js +0 -25
- package/src/stories/Introduction.mdx +0 -211
- package/src/stories/MiniTag.stories.js +0 -52
- package/src/stories/Playground.stories.js +0 -16
- package/src/stories/ProgressBar.stories.js +0 -23
- package/src/stories/RadioButton.stories.js +0 -40
- package/src/stories/RadioButtonSimple.stories.js +0 -43
- package/src/stories/SimpleAlert.stories.js +0 -21
- package/src/stories/Slider.stories.js +0 -75
- package/src/stories/Switch.stories.js +0 -39
- package/src/stories/TabHeader.stories.js +0 -52
- package/src/stories/TableResults.stories.js +0 -724
- package/src/stories/TagScope.stories.js +0 -17
- package/src/stories/TestimonialCard.stories.js +0 -27
- package/src/stories/Toast.stories.js +0 -52
- package/src/stories/Toggle.stories.js +0 -45
- package/src/stories/Tooltip.stories.js +0 -114
- package/src/stories/Typography.mdx +0 -212
- package/src/stories/assets/code-brackets.svg +0 -1
- package/src/stories/assets/colors.svg +0 -1
- package/src/stories/assets/comments.svg +0 -1
- package/src/stories/assets/direction.svg +0 -1
- package/src/stories/assets/flow.svg +0 -1
- package/src/stories/assets/plugin.svg +0 -1
- package/src/stories/assets/repo.svg +0 -1
- package/src/stories/assets/stackalt.svg +0 -1
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- package/webpack.config.js +0 -22
package/src/index.ts
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
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
|
+
|
|
52
|
+
|
|
53
|
+
export default {
|
|
54
|
+
install(Vue:any) {
|
|
55
|
+
Vue.component('PsButton', PsButton)
|
|
56
|
+
Vue.component('PsCheckbox', PsCheckbox)
|
|
57
|
+
Vue.component('PsDialog', PsDialog)
|
|
58
|
+
Vue.component('PsToast', PsToast)
|
|
59
|
+
Vue.component('PsTabHeader', PsTabHeader)
|
|
60
|
+
Vue.component('PsRadioButton', PsRadioButton)
|
|
61
|
+
Vue.component('PsSlider', PsSlider)
|
|
62
|
+
Vue.component('PsSwitch', PsSwitch)
|
|
63
|
+
Vue.component('PsInput', PsInput)
|
|
64
|
+
Vue.component('PsToggle', PsToggle)
|
|
65
|
+
Vue.component('PsAccordion', PsAccordion)
|
|
66
|
+
Vue.component('PsAccordionItem', PsAccordionItem)
|
|
67
|
+
Vue.component('PsChips', PsChips)
|
|
68
|
+
Vue.component('PsDataTable', PsDataTable)
|
|
69
|
+
Vue.component('PsDataTableItem', PsDataTableItem)
|
|
70
|
+
Vue.component('PsTableResultsHead', PsTableResultsHead)
|
|
71
|
+
Vue.component('PsTableResultsHeadComparison', PsTableResultsHeadComparison)
|
|
72
|
+
Vue.component('PsTableResults', PsTableResults)
|
|
73
|
+
Vue.component('PsTableResultsRow', PsTableResultsRow)
|
|
74
|
+
Vue.component('PsTableResultsBody', PsTableResultsBody)
|
|
75
|
+
Vue.component('PsTableResultsHeadFlexible',PsTableResultsHeadFlexible)
|
|
76
|
+
Vue.component('PsIcon', PsIcon)
|
|
77
|
+
Vue.component('PsDotLoader', PsDotLoader)
|
|
78
|
+
Vue.component('PsTooltip', PsTooltip)
|
|
79
|
+
Vue.component('PsRichTooltip', PsRichTooltip)
|
|
80
|
+
Vue.component('PsDialogTooltip', PsDialogTooltip)
|
|
81
|
+
Vue.component('PsDraggable', PsDraggable)
|
|
82
|
+
Vue.component('PsCardInfos', PsCardInfos)
|
|
83
|
+
Vue.component('PsChartLegend', PsChartLegend)
|
|
84
|
+
Vue.component('PsInlineSelector', PsInlineSelector)
|
|
85
|
+
Vue.component('PsInputTextArea', PsInputTextArea)
|
|
86
|
+
Vue.component('PsInputSelect', PsInputSelect)
|
|
87
|
+
Vue.component('PsDropdown',PsDropdown)
|
|
88
|
+
Vue.component('PsDropdownList', PsDropdownList)
|
|
89
|
+
Vue.component('PsMiniTag', PsMiniTag)
|
|
90
|
+
Vue.component('PsCheckboxSimple', PsCheckboxSimple)
|
|
91
|
+
Vue.component('PsBadgeWithIcon', PsBadgeWithIcon)
|
|
92
|
+
Vue.component('PsProgressBar', PsProgressBar)
|
|
93
|
+
Vue.component('PsRadioButtonSimple', PsRadioButtonSimple)
|
|
94
|
+
Vue.component('PsTestimonialCard',PsTestimonialCard)
|
|
95
|
+
Vue.component('PsDateCardInfo',PsDateCardInfo)
|
|
96
|
+
Vue.component('PsTagScope',PsTagScope)
|
|
97
|
+
Vue.component('PsBarChart',PsBarChart)
|
|
98
|
+
Vue.component('PsSimpleAlert',PsSimpleAlert)
|
|
99
|
+
Vue.component('PsBreadcrumb', PsBreadcrumb)
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Initialize directives
|
|
103
|
+
*/
|
|
104
|
+
directives(Vue)
|
|
105
|
+
|
|
106
|
+
},
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export {
|
|
110
|
+
PsButton,
|
|
111
|
+
PsCheckbox,
|
|
112
|
+
PsRadioButton,
|
|
113
|
+
PsSlider,
|
|
114
|
+
PsSwitch,
|
|
115
|
+
PsToggle,
|
|
116
|
+
PsInput,
|
|
117
|
+
PsDialog,
|
|
118
|
+
PsToast,
|
|
119
|
+
PsTabHeader,
|
|
120
|
+
PsAccordion,
|
|
121
|
+
PsAccordionItem,
|
|
122
|
+
PsChips,
|
|
123
|
+
PsDataTable,
|
|
124
|
+
PsDataTableItem,
|
|
125
|
+
PsTableResultsHead,
|
|
126
|
+
PsTableResultsBody,
|
|
127
|
+
PsTableResultsHeadFlexible,
|
|
128
|
+
PsTableResultsHeadComparison,
|
|
129
|
+
PsIcon,
|
|
130
|
+
PsDotLoader,
|
|
131
|
+
PsTooltip,
|
|
132
|
+
PsRichTooltip,
|
|
133
|
+
PsDialogTooltip,
|
|
134
|
+
PsDraggable,
|
|
135
|
+
PsCardInfos,
|
|
136
|
+
PsChartLegend,
|
|
137
|
+
PsInlineSelector,
|
|
138
|
+
PsInputTextArea,
|
|
139
|
+
PsInputSelect,
|
|
140
|
+
PsDropdown,
|
|
141
|
+
PsDropdownList,
|
|
142
|
+
PsMiniTag,
|
|
143
|
+
PsCheckboxSimple,
|
|
144
|
+
PsBadgeWithIcon,
|
|
145
|
+
PsProgressBar,
|
|
146
|
+
PsRadioButtonSimple,
|
|
147
|
+
PsTestimonialCard,
|
|
148
|
+
PsDateCardInfo,
|
|
149
|
+
PsTagScope,
|
|
150
|
+
PsBarChart,
|
|
151
|
+
PsSimpleAlert,
|
|
152
|
+
PsBreadcrumb,
|
|
153
|
+
PsTableResults,
|
|
154
|
+
PsTableResultsRow
|
|
155
|
+
}
|
|
156
|
+
|
|
@@ -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
|
|
@@ -20,7 +19,6 @@ export const getParentScrollableEl = (node) => {
|
|
|
20
19
|
return getParentScrollableEl(node.parentNode)
|
|
21
20
|
}
|
|
22
21
|
}
|
|
23
|
-
|
|
24
22
|
export const getParentVueComponentByName = (comp, name) => {
|
|
25
23
|
if (comp.$options.name === name) {
|
|
26
24
|
return comp
|
|
@@ -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
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": false,
|
|
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
|
+
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { create } from '@storybook/theming';
|
|
2
|
-
import logo from '../src/assets/images/policy-studio.svg';
|
|
3
|
-
|
|
4
|
-
export default create({
|
|
5
|
-
base: 'light',
|
|
6
|
-
brandTitle: 'Policy Studio UI Vue',
|
|
7
|
-
brandUrl: 'https://policystudio.co/',
|
|
8
|
-
brandImage: logo,
|
|
9
|
-
brandTarget: '_blank',
|
|
10
|
-
});
|
package/.storybook/eventBus.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// this was a vue2 syntax
|
|
2
|
-
// import Vue from 'vue';
|
|
3
|
-
// export const eventBus = new Vue();
|
|
4
|
-
|
|
5
|
-
// import { createApp } from 'vue';
|
|
6
|
-
|
|
7
|
-
// export const app = createApp({});
|
|
8
|
-
// const emitter = app.config.globalProperties.$emitter = {};
|
|
9
|
-
|
|
10
|
-
// export const eventBus = {
|
|
11
|
-
// on(event, callback) {
|
|
12
|
-
// if (!emitter[event]) {
|
|
13
|
-
// emitter[event] = [];
|
|
14
|
-
// }
|
|
15
|
-
// emitter[event].push(callback);
|
|
16
|
-
// },
|
|
17
|
-
// emit(event, ...args) {
|
|
18
|
-
// if (emitter[event]) {
|
|
19
|
-
// emitter[event].forEach(callback => {
|
|
20
|
-
// callback(...args);
|
|
21
|
-
// });
|
|
22
|
-
// }
|
|
23
|
-
// },
|
|
24
|
-
// };
|
|
25
|
-
|
|
26
|
-
// app.mount('#app');
|
package/.storybook/main.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/** @type { import('@storybook/vue3-webpack5').StorybookConfig } */
|
|
2
|
-
const config = {
|
|
3
|
-
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
|
|
4
|
-
addons: [
|
|
5
|
-
"@storybook/addon-links",
|
|
6
|
-
"@storybook/addon-essentials",
|
|
7
|
-
"@storybook/addon-interactions",
|
|
8
|
-
],
|
|
9
|
-
framework: {
|
|
10
|
-
name: "@storybook/vue3-webpack5",
|
|
11
|
-
options: {
|
|
12
|
-
builder: {
|
|
13
|
-
useSWC: true,
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
docs: {
|
|
18
|
-
autodocs: "tag",
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
export default config;
|
package/.storybook/manager.js
DELETED
package/.storybook/preview.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Import tailwind css file (bundle) based on environment
|
|
4
|
-
*/
|
|
5
|
-
const cssEnvFolder = (process.env.STORYBOOK_ENV === 'production') ? 'dist' : 'temp'
|
|
6
|
-
require( `../${cssEnvFolder}/css/psui_styles.css`)
|
|
7
|
-
console.warn(`Using tailwind css file(bundle) from: ../${cssEnvFolder}/css/psui_styles.css`)
|
|
8
|
-
|
|
9
|
-
export const parameters = {
|
|
10
|
-
actions: { argTypesRegex: "^on[A-Z].*" },
|
|
11
|
-
controls: {
|
|
12
|
-
matchers: {
|
|
13
|
-
color: /(background|color)$/i,
|
|
14
|
-
date: /Date$/,
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
}
|
package/babel.config.js
DELETED