@policystudio/policy-studio-ui-vue 1.1.90-beta.4 → 1.1.90-beta.41
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 +2 -8
- package/.github/workflows/deploy-storybook.yml +4 -4
- package/.nvmrc +1 -0
- package/dist/css/psui_styles_output.css +6607 -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/{.storybook → doc/.storybook}/main.ts +8 -2
- package/{.storybook → doc/.storybook}/preview.ts +2 -3
- package/doc/package-lock.json +22653 -0
- package/doc/package.json +71 -0
- package/{src → doc}/shims-vue.d.ts +0 -5
- package/{src → doc/src}/stories/Accordion.stories.ts +2 -3
- package/{src → doc/src}/stories/BadgeWithIcon.stories.ts +1 -1
- package/{src → doc/src}/stories/BarChart.stories.ts +1 -1
- package/{src → doc/src}/stories/Breadcrumb.stories.ts +1 -1
- package/doc/src/stories/Button.stories.ts +130 -0
- package/{src → doc/src}/stories/CardInfos.stories.ts +1 -1
- package/{src → doc/src}/stories/ChartLegend.stories.ts +1 -1
- package/{src → doc/src}/stories/Checkbox.stories.ts +1 -1
- package/{src → doc/src}/stories/CheckboxSimple.stories.ts +1 -1
- package/{src → doc/src}/stories/Chips.stories.ts +1 -4
- package/{src → doc/src}/stories/ClimateZoneBadge.stories.ts +2 -1
- package/doc/src/stories/Collapse.stories.ts +46 -0
- package/{src → doc/src}/stories/CostEffectBar.stories.ts +2 -1
- package/{src → doc/src}/stories/Datatable.stories.ts +5 -2
- package/{src → doc/src}/stories/DateCardInfo.stories.ts +1 -1
- package/{src → doc/src}/stories/Dialog.stories.ts +2 -2
- package/{src → doc/src}/stories/Draggable.stories.ts +3 -2
- package/{src → doc/src}/stories/Dropdown.stories.ts +4 -3
- package/{src → doc/src}/stories/DropdownList.stories.ts +4 -2
- package/{src → doc/src}/stories/HighlightRippleDot.stories.ts +3 -2
- package/{src → doc/src}/stories/Icon.stories.ts +3 -1
- package/{src → doc/src}/stories/InlineSelector.stories.ts +1 -1
- package/{src → doc/src}/stories/Input.stories.ts +7 -4
- package/{src → doc/src}/stories/InputSelect.stories.ts +3 -2
- package/{src → doc/src}/stories/InputTextArea.stories.ts +1 -1
- package/{src → doc/src}/stories/MiniTag.stories.ts +9 -2
- package/{src → doc/src}/stories/ProgressBar.stories.ts +3 -2
- package/{src → doc/src}/stories/RadioButton.stories.ts +2 -2
- package/{src → doc/src}/stories/RadioButtonSimple.stories.ts +1 -1
- package/{src → doc/src}/stories/SimpleAlert.stories.ts +3 -2
- package/{src → doc/src}/stories/Slider.stories.ts +6 -2
- package/{src → doc/src}/stories/Switch.stories.ts +2 -2
- package/{src → doc/src}/stories/TabHeader.stories.ts +6 -1
- package/{src → doc/src}/stories/TableResults.stories.ts +11 -7
- package/{src → doc/src}/stories/TagScope.stories.ts +3 -2
- package/{src → doc/src}/stories/TestimonialCard.stories.ts +3 -3
- package/{src → doc/src}/stories/Toast.stories.ts +2 -2
- package/{src → doc/src}/stories/Toggle.stories.ts +6 -3
- package/{src → doc/src}/stories/Tooltip.stories.ts +3 -3
- package/doc/tsconfig.json +17 -0
- package/package.json +13 -28
- package/scripts/gulp.js +11 -0
- package/src/assets/scss/base.scss +3 -34
- package/src/assets/scss/components/PsAccordion.scss +1 -1
- package/src/assets/scss/components/PsCollapse.scss +74 -0
- package/src/assets/scss/components/PsDataTable.scss +1 -1
- package/src/assets/scss/components/PsDropdownList.scss +1 -1
- package/src/assets/scss/components/PsTooltip.scss +2 -1
- package/src/components/accordion/PsAccordionItem.vue +88 -74
- package/src/components/badges-and-tags/PsBadgeWithIcon.vue +31 -34
- 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 +61 -62
- package/src/components/chips/PsChips.vue +98 -101
- package/src/components/collapse/PsCollapse.vue +124 -0
- 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 +65 -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 +166 -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 +70 -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 +461 -468
- package/src/components/table-results/PsTableResultsBody.vue +66 -67
- package/src/components/table-results/PsTableResultsHead.vue +67 -61
- package/src/components/table-results/PsTableResultsHeadComparison.vue +62 -56
- package/src/components/table-results/PsTableResultsHeadFlexible.vue +68 -61
- 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 +128 -129
- package/src/index.ts +60 -67
- package/src/tsconfig.json +12 -0
- package/src/types/index.d.ts +6 -0
- package/src/util/{GeneralFunctions.ts → GeneralFunctions.js} +12 -3
- package/src/util/directives.ts +24 -0
- package/src/util/{imageLoader.ts → imageLoader.js} +7 -0
- package/tailwind.config.js +1 -1
- package/tsconfig.json +18 -13
- package/.storybook/eventBus.ts +0 -26
- package/babel.config.js +0 -17
- package/dist/css/psui_styles.css +0 -4647
- package/postcss.config.js +0 -8
- package/src/components/playground/PsScrollBar.vue +0 -320
- package/src/stories/Button.stories.ts +0 -48
- package/src/stories/Button.vue +0 -59
- package/src/stories/Header.stories.ts +0 -41
- package/src/stories/Header.vue +0 -77
- package/src/stories/Playground.stories.ts +0 -16
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- package/webpack.config.js +0 -22
- /package/{.storybook → doc/.storybook}/PolicyStudio.ts +0 -0
- /package/{.storybook → doc/.storybook}/manager.ts +0 -0
- /package/{src → doc/src}/assets/images/multifamily-units.svg +0 -0
- /package/{src → doc/src}/assets/images/policy-studio.svg +0 -0
- /package/{src → doc/src}/contents/ComparisonData.ts +0 -0
- /package/{src → doc/src}/contents/FlexibleData.ts +0 -0
- /package/{src → doc/src}/contents/ResultsData.ts +0 -0
- /package/{src → doc/src}/stories/Colors.mdx +0 -0
- /package/{src → doc/src}/stories/ElevationSystem.mdx +0 -0
- /package/{src → doc/src}/stories/Introduction.mdx +0 -0
- /package/{src → doc/src}/stories/Typography.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
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 '
|
|
6
|
-
import PsCheckbox from '
|
|
7
|
-
import PsRadioButton from '
|
|
8
|
-
import PsSlider from '
|
|
9
|
-
import PsSwitch from '
|
|
10
|
-
import PsToggle from '
|
|
11
|
-
import PsInput from '
|
|
12
|
-
import PsDropdown from '
|
|
13
|
-
import PsDropdownList from '
|
|
14
|
-
import PsInputTextArea from '
|
|
15
|
-
import PsInputSelect from '
|
|
16
|
-
import PsDialog from '
|
|
17
|
-
import PsToast from '
|
|
18
|
-
import PsTabHeader from '
|
|
19
|
-
import PsAccordion from '
|
|
20
|
-
import PsAccordionItem from '
|
|
21
|
-
import PsChips from '
|
|
22
|
-
import PsDataTable from '
|
|
23
|
-
import PsDataTableItem from '
|
|
24
|
-
import PsTableResults from '
|
|
25
|
-
import PsTableResultsBody from '
|
|
26
|
-
import PsTableResultsHead from '
|
|
27
|
-
import PsTableResultsHeadComparison from '
|
|
28
|
-
import PsTableResultsHeadFlexible from '
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import PsMiniTag from '
|
|
40
|
-
import PsCheckboxSimple from '
|
|
41
|
-
import PsBadgeWithIcon from '
|
|
42
|
-
import PsProgressBar from '
|
|
43
|
-
import PsRadioButtonSimple from '
|
|
44
|
-
import PsTestimonialCard from '
|
|
45
|
-
import PsDateCardInfo from '
|
|
46
|
-
import PsTagScope from '
|
|
47
|
-
import PsBarChart from '
|
|
48
|
-
import PsSimpleAlert from '
|
|
49
|
-
import PsBreadcrumb from '
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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
|
|
|
@@ -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
|
|
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
|
+
}
|
|
@@ -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))
|
package/tailwind.config.js
CHANGED
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
|
-
"
|
|
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
|
-
"
|
|
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/**/*.
|
|
36
|
+
"src/**/*.d.ts",
|
|
34
37
|
"src/**/*.vue",
|
|
35
38
|
"tests/**/*.ts",
|
|
36
|
-
"tests/**/*.tsx",
|
|
37
|
-
".
|
|
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
|
}
|
package/.storybook/eventBus.ts
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/babel.config.js
DELETED