axitech-widget 0.0.2
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/README.md +203 -0
- package/dist/Modal-fab2abfa.mjs +4 -0
- package/dist/axitech-widget.es.js +7 -0
- package/dist/axitech-widget.iife.js +698 -0
- package/dist/axitech-widget.umd.js +698 -0
- package/dist/index-2839010c.mjs +30306 -0
- package/dist/style.css +1 -0
- package/dist/types/components/base/ActionCard.vue.d.ts +36 -0
- package/dist/types/components/base/Button.vue.d.ts +9 -0
- package/dist/types/components/base/Collapse.vue.d.ts +2 -0
- package/dist/types/components/base/DatePicker.vue.d.ts +70 -0
- package/dist/types/components/base/GoogleAutocomplete.vue.d.ts +23 -0
- package/dist/types/components/base/GoogleMap.vue.d.ts +26 -0
- package/dist/types/components/base/Input.vue.d.ts +43 -0
- package/dist/types/components/base/Modal.vue.d.ts +55 -0
- package/dist/types/components/base/SelectButton.vue.d.ts +56 -0
- package/dist/types/components/base/Spinner.vue.d.ts +34 -0
- package/dist/types/components/base/uploader/ImageUpload.vue.d.ts +23 -0
- package/dist/types/components/base/uploader/Upload.vue.d.ts +4 -0
- package/dist/types/components/claims-widget/ClaimsWidget.ce.vue.d.ts +2 -0
- package/dist/types/components/claims-widget/components/Error.vue.d.ts +2 -0
- package/dist/types/components/claims-widget/components/SkeletonLoader.vue.d.ts +56 -0
- package/dist/types/components/claims-widget/components/StepConfirm.vue.d.ts +6 -0
- package/dist/types/components/claims-widget/components/StepSelector.vue.d.ts +6 -0
- package/dist/types/components/claims-widget/components/accident/Accident.vue.d.ts +8 -0
- package/dist/types/components/claims-widget/components/accident/ImageSection.vue.d.ts +29 -0
- package/dist/types/components/claims-widget/components/accident/MapSection.vue.d.ts +29 -0
- package/dist/types/components/claims-widget/components/accident/NoteSection.vue.d.ts +21 -0
- package/dist/types/components/claims-widget/components/accident/SectionWrapper.vue.d.ts +23 -0
- package/dist/types/components/claims-widget/components/accident/YourVehicle.vue.d.ts +2 -0
- package/dist/types/components/claims-widget/components/fireWater/FireWater.vue.d.ts +6 -0
- package/dist/types/components/claims-widget/components/illustration/Accident.vue.d.ts +2 -0
- package/dist/types/components/claims-widget/components/illustration/Location.vue.d.ts +2 -0
- package/dist/types/components/claims-widget/components/illustration/SubmittedSuccessfully.vue.d.ts +2 -0
- package/dist/types/components/claims-widget/components/illustration/Unsupported.vue.d.ts +2 -0
- package/dist/types/components/claims-widget/components/windscreen/Windscreen.vue.d.ts +6 -0
- package/dist/types/components/claims-widget/components/windscreen/WindscreenLoading.vue.d.ts +2 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/composables/googleMaps.d.ts +11 -0
- package/dist/types/constants/index.d.ts +1 -0
- package/dist/types/index.d.ts +34 -0
- package/dist/types/plugins/firebase.d.ts +2 -0
- package/dist/types/plugins/firebaseCloudStorage.d.ts +16 -0
- package/dist/types/utils/autocomplete.d.ts +2 -0
- package/dist/types/utils/colorHelpers.d.ts +7 -0
- package/dist/types/utils/config.d.ts +131 -0
- package/dist/types/utils/customElementRegister.d.ts +1 -0
- package/dist/types/utils/fontUtils.d.ts +1 -0
- package/dist/types/utils/index.d.ts +141 -0
- package/dist/types/utils/map.d.ts +21 -0
- package/dist/types/utils/request.d.ts +30 -0
- package/dist/types/utils/svgUtils.d.ts +0 -0
- package/dist/types/utils/themeUtils.d.ts +9 -0
- package/package.json +77 -0
- package/src/assets/fonts/Volvo Novum-Italic.eot +0 -0
- package/src/assets/fonts/Volvo Novum-Italic.svg +723 -0
- package/src/assets/fonts/Volvo Novum-Italic.woff +0 -0
- package/src/assets/fonts/Volvo Novum-Italic.woff2 +0 -0
- package/src/assets/fonts/Volvo Novum-Light.eot +0 -0
- package/src/assets/fonts/Volvo Novum-Light.svg +707 -0
- package/src/assets/fonts/Volvo Novum-Light.woff +0 -0
- package/src/assets/fonts/Volvo Novum-Light.woff2 +0 -0
- package/src/assets/fonts/Volvo Novum-LightItalic.eot +0 -0
- package/src/assets/fonts/Volvo Novum-LightItalic.svg +723 -0
- package/src/assets/fonts/Volvo Novum-LightItalic.woff +0 -0
- package/src/assets/fonts/Volvo Novum-LightItalic.woff2 +0 -0
- package/src/assets/fonts/Volvo Novum-Medium.eot +0 -0
- package/src/assets/fonts/Volvo Novum-Medium.svg +706 -0
- package/src/assets/fonts/Volvo Novum-Medium.woff +0 -0
- package/src/assets/fonts/Volvo Novum-Medium.woff2 +0 -0
- package/src/assets/fonts/Volvo Novum-MediumItalic.eot +0 -0
- package/src/assets/fonts/Volvo Novum-MediumItalic.svg +724 -0
- package/src/assets/fonts/Volvo Novum-MediumItalic.woff +0 -0
- package/src/assets/fonts/Volvo Novum-MediumItalic.woff2 +0 -0
- package/src/assets/fonts/Volvo Novum-Regular.eot +0 -0
- package/src/assets/fonts/Volvo Novum-Regular.svg +707 -0
- package/src/assets/fonts/Volvo Novum-Regular.woff +0 -0
- package/src/assets/fonts/Volvo Novum-Regular.woff2 +0 -0
- package/src/assets/fonts/Volvo Novum-SemiLight.eot +0 -0
- package/src/assets/fonts/Volvo Novum-SemiLight.svg +706 -0
- package/src/assets/fonts/Volvo Novum-SemiLight.woff +0 -0
- package/src/assets/fonts/Volvo Novum-SemiLight.woff2 +0 -0
- package/src/assets/fonts/Volvo Novum-SemiLightItalic.eot +0 -0
- package/src/assets/fonts/Volvo Novum-SemiLightItalic.svg +722 -0
- package/src/assets/fonts/Volvo Novum-SemiLightItalic.woff +0 -0
- package/src/assets/fonts/Volvo Novum-SemiLightItalic.woff2 +0 -0
- package/src/assets/styles/collapse.sass +20 -0
- package/src/assets/styles/datepicker.sass +14 -0
- package/src/assets/styles/main.sass +182 -0
- package/src/assets/styles/map.sass +41 -0
- package/src/assets/styles/togglebutton.sass +4 -0
- package/src/components/base/ActionCard.vue +49 -0
- package/src/components/base/Button.vue +16 -0
- package/src/components/base/Collapse.vue +41 -0
- package/src/components/base/DatePicker.vue +94 -0
- package/src/components/base/GoogleAutocomplete.vue +116 -0
- package/src/components/base/GoogleMap.vue +114 -0
- package/src/components/base/Input.vue +44 -0
- package/src/components/base/Modal.vue +117 -0
- package/src/components/base/SelectButton.vue +67 -0
- package/src/components/base/Spinner.vue +39 -0
- package/src/components/base/uploader/ImageUpload.vue +85 -0
- package/src/components/base/uploader/Upload.vue +14 -0
- package/src/components/claims-widget/ClaimsWidget.ce.vue +117 -0
- package/src/components/claims-widget/assets/accident.svg +181 -0
- package/src/components/claims-widget/assets/car.svg +6 -0
- package/src/components/claims-widget/assets/currentlocation.svg +3 -0
- package/src/components/claims-widget/assets/door.svg +3 -0
- package/src/components/claims-widget/assets/location.svg +20 -0
- package/src/components/claims-widget/assets/marker.svg +1 -0
- package/src/components/claims-widget/assets/unsupported.svg +107 -0
- package/src/components/claims-widget/assets/windscreen.svg +3 -0
- package/src/components/claims-widget/assets/zoomin.svg +3 -0
- package/src/components/claims-widget/assets/zoomout.svg +3 -0
- package/src/components/claims-widget/components/Error.vue +21 -0
- package/src/components/claims-widget/components/SkeletonLoader.vue +77 -0
- package/src/components/claims-widget/components/StepConfirm.vue +85 -0
- package/src/components/claims-widget/components/StepSelector.vue +58 -0
- package/src/components/claims-widget/components/accident/Accident.vue +267 -0
- package/src/components/claims-widget/components/accident/ImageSection.vue +82 -0
- package/src/components/claims-widget/components/accident/MapSection.vue +72 -0
- package/src/components/claims-widget/components/accident/NoteSection.vue +83 -0
- package/src/components/claims-widget/components/accident/SectionWrapper.vue +16 -0
- package/src/components/claims-widget/components/accident/YourVehicle.vue +60 -0
- package/src/components/claims-widget/components/fireWater/FireWater.vue +42 -0
- package/src/components/claims-widget/components/illustration/Accident.vue +735 -0
- package/src/components/claims-widget/components/illustration/Location.vue +74 -0
- package/src/components/claims-widget/components/illustration/SubmittedSuccessfully.vue +2270 -0
- package/src/components/claims-widget/components/illustration/Unsupported.vue +393 -0
- package/src/components/claims-widget/components/windscreen/Windscreen.vue +44 -0
- package/src/components/claims-widget/components/windscreen/WindscreenLoading.vue +34 -0
- package/src/components/index.ts +3 -0
- package/src/composables/googleMaps.ts +157 -0
- package/src/constants/index.ts +1 -0
- package/src/index.ts +76 -0
- package/src/plugins/firebase.ts +18 -0
- package/src/plugins/firebaseCloudStorage.ts +88 -0
- package/src/utils/autocomplete.ts +57 -0
- package/src/utils/colorHelpers.ts +96 -0
- package/src/utils/config.ts +140 -0
- package/src/utils/customElementRegister.ts +40 -0
- package/src/utils/fontUtils.ts +24 -0
- package/src/utils/index.ts +5 -0
- package/src/utils/map.ts +212 -0
- package/src/utils/request.ts +76 -0
- package/src/utils/svgUtils.ts +0 -0
- package/src/utils/themeUtils.ts +40 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="google.maps" />
|
|
2
|
+
import { Ref } from 'vue';
|
|
3
|
+
import { ILocationInfo } from 'src/utils/map';
|
|
4
|
+
export declare function useGoogleMaps(componentOrSelector: string | Ref<HTMLElement | undefined> | HTMLElement, onPlaceChanged?: (place: ILocationInfo) => void): {
|
|
5
|
+
map: Ref<google.maps.Map | undefined>;
|
|
6
|
+
marker: Ref<google.maps.Marker | undefined>;
|
|
7
|
+
load: (opts: google.maps.MapOptions) => Promise<void>;
|
|
8
|
+
loadPreview: (opts: google.maps.MapOptions) => Promise<void>;
|
|
9
|
+
getLocation: () => Promise<ILocationInfo>;
|
|
10
|
+
placeChanged: (place: ILocationInfo) => void;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CLAIMS_WIDGET_ID = "axitech-claims-widget";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { Theme } from './utils/themeUtils';
|
|
3
|
+
declare const WidgetTypes: {
|
|
4
|
+
readonly claim: "claim";
|
|
5
|
+
};
|
|
6
|
+
export type WidgetType = keyof typeof WidgetTypes;
|
|
7
|
+
export type IWidgetOptions = {
|
|
8
|
+
clientId: string;
|
|
9
|
+
type?: WidgetType;
|
|
10
|
+
user: {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
email: string;
|
|
14
|
+
phone: string;
|
|
15
|
+
};
|
|
16
|
+
insurance: {
|
|
17
|
+
provider: string;
|
|
18
|
+
policyNumber: string;
|
|
19
|
+
};
|
|
20
|
+
theme?: Theme;
|
|
21
|
+
};
|
|
22
|
+
/** Load widget as vue component to have more control over it */
|
|
23
|
+
export declare function install(app: App, options: IWidgetOptions & {
|
|
24
|
+
apiKey: string;
|
|
25
|
+
}): void;
|
|
26
|
+
/**
|
|
27
|
+
* load will use the apikey and load the client configuration any options you provide here will overwrite the config provided on the admin interface
|
|
28
|
+
* @param options
|
|
29
|
+
*/
|
|
30
|
+
export declare function load(apiKey: string, options: IWidgetOptions): Promise<void>;
|
|
31
|
+
/** Constants of the widget */
|
|
32
|
+
export * from './constants';
|
|
33
|
+
/** Use applyTheme to apply theme changes at runtime if you have not had the chance to change them at initialisation */
|
|
34
|
+
export declare const applyConfig: typeof import("./utils/config").applyPublicConfig;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BasePlugin, PluginOptions } from '@uppy/core';
|
|
2
|
+
import Uppy from '@uppy/core';
|
|
3
|
+
interface StorageOptions extends PluginOptions {
|
|
4
|
+
basePath?: string;
|
|
5
|
+
}
|
|
6
|
+
export default class FirebaseCloudStorage extends BasePlugin<StorageOptions> {
|
|
7
|
+
title: string;
|
|
8
|
+
type: string;
|
|
9
|
+
id: string;
|
|
10
|
+
basePath: string;
|
|
11
|
+
constructor(uppy: Uppy, opts?: StorageOptions);
|
|
12
|
+
uploadFiles(fileIds: string[]): Promise<void>;
|
|
13
|
+
install(): void;
|
|
14
|
+
uninstall(): void;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { IApiPath } from './request';
|
|
2
|
+
import type { InjectionKey } from 'vue';
|
|
3
|
+
import { Theme } from './themeUtils';
|
|
4
|
+
import { ILocationInfo } from './map';
|
|
5
|
+
export declare const getBaseUrl: (path: IApiPath) => string;
|
|
6
|
+
export type WidgetConfig = {
|
|
7
|
+
user: UserConfig;
|
|
8
|
+
insurance: InsuranceConfig;
|
|
9
|
+
theme: Theme;
|
|
10
|
+
displayName: string;
|
|
11
|
+
contact: ContactConfig;
|
|
12
|
+
};
|
|
13
|
+
export type UserConfig = {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
email: string;
|
|
17
|
+
phone: string;
|
|
18
|
+
};
|
|
19
|
+
export type ContactConfig = {
|
|
20
|
+
phone: string;
|
|
21
|
+
email: string;
|
|
22
|
+
};
|
|
23
|
+
export type InsuranceConfig = {
|
|
24
|
+
provider: string;
|
|
25
|
+
policyNumber: string;
|
|
26
|
+
};
|
|
27
|
+
export type CollisionSubmission = {
|
|
28
|
+
notificationTime: string;
|
|
29
|
+
date: string;
|
|
30
|
+
location: ILocationInfo | undefined;
|
|
31
|
+
vehicleImages: string[];
|
|
32
|
+
additionalImages: string[];
|
|
33
|
+
note: string;
|
|
34
|
+
vehicleRoadWorthy: boolean;
|
|
35
|
+
driver: boolean;
|
|
36
|
+
injured: boolean;
|
|
37
|
+
thirdPartiesInvolved: boolean;
|
|
38
|
+
witnessesPresent: boolean;
|
|
39
|
+
user: {
|
|
40
|
+
id: string;
|
|
41
|
+
name: string;
|
|
42
|
+
email: string;
|
|
43
|
+
phone: string;
|
|
44
|
+
};
|
|
45
|
+
insurance: {
|
|
46
|
+
provider: string;
|
|
47
|
+
policyNumber: string;
|
|
48
|
+
};
|
|
49
|
+
incidentType: string;
|
|
50
|
+
};
|
|
51
|
+
declare const defaultConfig: {
|
|
52
|
+
clientId: string;
|
|
53
|
+
user: {
|
|
54
|
+
id: string;
|
|
55
|
+
name: string;
|
|
56
|
+
email: string;
|
|
57
|
+
phone: string;
|
|
58
|
+
};
|
|
59
|
+
apiKey: string;
|
|
60
|
+
insurance: {
|
|
61
|
+
provider: string;
|
|
62
|
+
policyNumber: string;
|
|
63
|
+
};
|
|
64
|
+
theme: {
|
|
65
|
+
primary: string;
|
|
66
|
+
secondary: string;
|
|
67
|
+
positive: string;
|
|
68
|
+
negative: string;
|
|
69
|
+
fontPrimary: string;
|
|
70
|
+
fontSecondary: string;
|
|
71
|
+
};
|
|
72
|
+
contact: {
|
|
73
|
+
phone: string;
|
|
74
|
+
email: string;
|
|
75
|
+
};
|
|
76
|
+
isConfigLoading: boolean;
|
|
77
|
+
error: string;
|
|
78
|
+
name: string;
|
|
79
|
+
allowedDomains: string[];
|
|
80
|
+
correspondenceEmail: string[];
|
|
81
|
+
rootKey: InjectionKey<string>;
|
|
82
|
+
id: string;
|
|
83
|
+
onSubmit: (type: '', body: CollisionSubmission) => void;
|
|
84
|
+
};
|
|
85
|
+
export declare const config: import("vue").Ref<{
|
|
86
|
+
clientId: string;
|
|
87
|
+
user: {
|
|
88
|
+
id: string;
|
|
89
|
+
name: string;
|
|
90
|
+
email: string;
|
|
91
|
+
phone: string;
|
|
92
|
+
};
|
|
93
|
+
apiKey: string;
|
|
94
|
+
insurance: {
|
|
95
|
+
provider: string;
|
|
96
|
+
policyNumber: string;
|
|
97
|
+
};
|
|
98
|
+
theme: {
|
|
99
|
+
primary: string;
|
|
100
|
+
secondary: string;
|
|
101
|
+
positive: string;
|
|
102
|
+
negative: string;
|
|
103
|
+
fontPrimary: string;
|
|
104
|
+
fontSecondary: string;
|
|
105
|
+
};
|
|
106
|
+
contact: {
|
|
107
|
+
phone: string;
|
|
108
|
+
email: string;
|
|
109
|
+
};
|
|
110
|
+
isConfigLoading: boolean;
|
|
111
|
+
error: string;
|
|
112
|
+
name: string;
|
|
113
|
+
allowedDomains: string[];
|
|
114
|
+
correspondenceEmail: string[];
|
|
115
|
+
rootKey: {
|
|
116
|
+
toString: () => string;
|
|
117
|
+
valueOf: () => symbol;
|
|
118
|
+
readonly description: string | undefined;
|
|
119
|
+
[Symbol.toPrimitive]: (hint: string) => symbol;
|
|
120
|
+
readonly [Symbol.toStringTag]: string;
|
|
121
|
+
};
|
|
122
|
+
id: string;
|
|
123
|
+
onSubmit: (type: '', body: CollisionSubmission) => void;
|
|
124
|
+
}>;
|
|
125
|
+
export declare function onConfigChange(callback: (config: typeof defaultConfig) => void): () => void;
|
|
126
|
+
export declare function applyConfig(newConfig: Partial<typeof defaultConfig>): void;
|
|
127
|
+
type RecursivePartial<T> = {
|
|
128
|
+
[P in keyof T]?: T[P] extends (infer U)[] ? RecursivePartial<U>[] : T[P] extends object | undefined ? RecursivePartial<T[P]> : T[P];
|
|
129
|
+
};
|
|
130
|
+
export declare function applyPublicConfig(newConfig: RecursivePartial<WidgetConfig>): void;
|
|
131
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const defineCustomElement: (component: any) => import("vue").VueElementConstructor<{}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function loadFonts(): void;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import * as themeUtils from './themeUtils';
|
|
2
|
+
import * as config from './config';
|
|
3
|
+
declare const utils: {
|
|
4
|
+
applyTheme(theme: themeUtils.Theme, element: HTMLElement): void;
|
|
5
|
+
loadFonts(): void;
|
|
6
|
+
onConfigChange(callback: (config: {
|
|
7
|
+
clientId: string;
|
|
8
|
+
user: {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
email: string;
|
|
12
|
+
phone: string;
|
|
13
|
+
};
|
|
14
|
+
apiKey: string;
|
|
15
|
+
insurance: {
|
|
16
|
+
provider: string;
|
|
17
|
+
policyNumber: string;
|
|
18
|
+
};
|
|
19
|
+
theme: {
|
|
20
|
+
primary: string;
|
|
21
|
+
secondary: string;
|
|
22
|
+
positive: string;
|
|
23
|
+
negative: string;
|
|
24
|
+
fontPrimary: string;
|
|
25
|
+
fontSecondary: string;
|
|
26
|
+
};
|
|
27
|
+
contact: {
|
|
28
|
+
phone: string;
|
|
29
|
+
email: string;
|
|
30
|
+
};
|
|
31
|
+
isConfigLoading: boolean;
|
|
32
|
+
error: string;
|
|
33
|
+
name: string;
|
|
34
|
+
allowedDomains: string[];
|
|
35
|
+
correspondenceEmail: string[];
|
|
36
|
+
rootKey: import("vue").InjectionKey<string>;
|
|
37
|
+
id: string;
|
|
38
|
+
onSubmit: (type: "", body: config.CollisionSubmission) => void;
|
|
39
|
+
}) => void): () => void;
|
|
40
|
+
applyConfig(newConfig: Partial<{
|
|
41
|
+
clientId: string;
|
|
42
|
+
user: {
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
email: string;
|
|
46
|
+
phone: string;
|
|
47
|
+
};
|
|
48
|
+
apiKey: string;
|
|
49
|
+
insurance: {
|
|
50
|
+
provider: string;
|
|
51
|
+
policyNumber: string;
|
|
52
|
+
};
|
|
53
|
+
theme: {
|
|
54
|
+
primary: string;
|
|
55
|
+
secondary: string;
|
|
56
|
+
positive: string;
|
|
57
|
+
negative: string;
|
|
58
|
+
fontPrimary: string;
|
|
59
|
+
fontSecondary: string;
|
|
60
|
+
};
|
|
61
|
+
contact: {
|
|
62
|
+
phone: string;
|
|
63
|
+
email: string;
|
|
64
|
+
};
|
|
65
|
+
isConfigLoading: boolean;
|
|
66
|
+
error: string;
|
|
67
|
+
name: string;
|
|
68
|
+
allowedDomains: string[];
|
|
69
|
+
correspondenceEmail: string[];
|
|
70
|
+
rootKey: import("vue").InjectionKey<string>;
|
|
71
|
+
id: string;
|
|
72
|
+
onSubmit: (type: "", body: config.CollisionSubmission) => void;
|
|
73
|
+
}>): void;
|
|
74
|
+
applyPublicConfig(newConfig: {
|
|
75
|
+
user?: {
|
|
76
|
+
id?: string | undefined;
|
|
77
|
+
name?: string | undefined;
|
|
78
|
+
email?: string | undefined;
|
|
79
|
+
phone?: string | undefined;
|
|
80
|
+
} | undefined;
|
|
81
|
+
insurance?: {
|
|
82
|
+
provider?: string | undefined;
|
|
83
|
+
policyNumber?: string | undefined;
|
|
84
|
+
} | undefined;
|
|
85
|
+
theme?: {
|
|
86
|
+
primary?: string | undefined;
|
|
87
|
+
secondary?: string | undefined;
|
|
88
|
+
positive?: string | undefined;
|
|
89
|
+
negative?: string | undefined;
|
|
90
|
+
fontPrimary?: string | undefined;
|
|
91
|
+
fontSecondary?: string | undefined;
|
|
92
|
+
} | undefined;
|
|
93
|
+
displayName?: string | undefined;
|
|
94
|
+
contact?: {
|
|
95
|
+
phone?: string | undefined;
|
|
96
|
+
email?: string | undefined;
|
|
97
|
+
} | undefined;
|
|
98
|
+
}): void;
|
|
99
|
+
getBaseUrl: (path: "config" | "submission") => string;
|
|
100
|
+
config: import("vue").Ref<{
|
|
101
|
+
clientId: string;
|
|
102
|
+
user: {
|
|
103
|
+
id: string;
|
|
104
|
+
name: string;
|
|
105
|
+
email: string;
|
|
106
|
+
phone: string;
|
|
107
|
+
};
|
|
108
|
+
apiKey: string;
|
|
109
|
+
insurance: {
|
|
110
|
+
provider: string;
|
|
111
|
+
policyNumber: string;
|
|
112
|
+
};
|
|
113
|
+
theme: {
|
|
114
|
+
primary: string;
|
|
115
|
+
secondary: string;
|
|
116
|
+
positive: string;
|
|
117
|
+
negative: string;
|
|
118
|
+
fontPrimary: string;
|
|
119
|
+
fontSecondary: string;
|
|
120
|
+
};
|
|
121
|
+
contact: {
|
|
122
|
+
phone: string;
|
|
123
|
+
email: string;
|
|
124
|
+
};
|
|
125
|
+
isConfigLoading: boolean;
|
|
126
|
+
error: string;
|
|
127
|
+
name: string;
|
|
128
|
+
allowedDomains: string[];
|
|
129
|
+
correspondenceEmail: string[];
|
|
130
|
+
rootKey: {
|
|
131
|
+
toString: () => string;
|
|
132
|
+
valueOf: () => symbol;
|
|
133
|
+
readonly description: string | undefined;
|
|
134
|
+
[Symbol.toPrimitive]: (hint: string) => symbol;
|
|
135
|
+
readonly [Symbol.toStringTag]: string;
|
|
136
|
+
};
|
|
137
|
+
id: string;
|
|
138
|
+
onSubmit: (type: "", body: config.CollisionSubmission) => void;
|
|
139
|
+
}>;
|
|
140
|
+
};
|
|
141
|
+
export default utils;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="google.maps" />
|
|
2
|
+
export declare function getUserBrowser(): string;
|
|
3
|
+
export declare function getLocationByIP(): Promise<any[]>;
|
|
4
|
+
export declare function getPosition(options: PositionOptions): Promise<GeolocationPosition>;
|
|
5
|
+
export declare function getLocationInfo(location: google.maps.LatLng): Promise<ILocationInfo>;
|
|
6
|
+
type AtLeast<T, K extends keyof T> = Partial<T> & Pick<T, K>;
|
|
7
|
+
export interface ILocation {
|
|
8
|
+
latitude: number;
|
|
9
|
+
longitude: number;
|
|
10
|
+
formatted_address: string;
|
|
11
|
+
address_line: string;
|
|
12
|
+
city: string;
|
|
13
|
+
state: string;
|
|
14
|
+
country: string;
|
|
15
|
+
postal_code: string;
|
|
16
|
+
}
|
|
17
|
+
export type ILocationInfo = AtLeast<ILocation, 'latitude' | 'longitude'>;
|
|
18
|
+
export declare function getLocation(defaultZoom?: number, defaultLocation?: ILocationInfo): Promise<[ILocationInfo, number, boolean]>;
|
|
19
|
+
export declare function zoomControl(controlDiv: HTMLDivElement, map: google.maps.Map): void;
|
|
20
|
+
export declare function addYourLocationButton(controlDiv: HTMLDivElement, map: google.maps.Map): void;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Theme } from './themeUtils';
|
|
2
|
+
export declare const ApiPaths: {
|
|
3
|
+
readonly config: "config";
|
|
4
|
+
readonly submission: "submission";
|
|
5
|
+
};
|
|
6
|
+
export type IApiPath = keyof typeof ApiPaths;
|
|
7
|
+
type ApiError = {
|
|
8
|
+
message: string;
|
|
9
|
+
};
|
|
10
|
+
export type ResponseTypeMap = {
|
|
11
|
+
[ApiPaths.config]: {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
theme: Theme;
|
|
15
|
+
correspondenceEmails: string[];
|
|
16
|
+
};
|
|
17
|
+
[ApiPaths.submission]: {
|
|
18
|
+
recieved: true;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare const request: {
|
|
22
|
+
get: typeof get;
|
|
23
|
+
post: typeof post;
|
|
24
|
+
};
|
|
25
|
+
declare function get<Endpoint extends keyof typeof ApiPaths>(endpoint: Endpoint, payload?: {
|
|
26
|
+
params?: string;
|
|
27
|
+
query?: string;
|
|
28
|
+
}): Promise<[ResponseTypeMap[Endpoint], null] | [null, ApiError]>;
|
|
29
|
+
declare function post<Body, Endpoint extends keyof typeof ApiPaths>(endpoint: Endpoint, body?: Body): Promise<[null, ApiError] | [ResponseTypeMap[Endpoint], null]>;
|
|
30
|
+
export {};
|
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "axitech-widget",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"build": "rimraf dist && vue-tsc && vite build",
|
|
6
|
+
"docs:dev": "vitepress dev docs",
|
|
7
|
+
"docs:build": "vitepress build docs",
|
|
8
|
+
"docs:serve": "vitepress serve docs",
|
|
9
|
+
"lint": "eslint --fix-all ./"
|
|
10
|
+
},
|
|
11
|
+
"peerDependencies": {
|
|
12
|
+
"vue": "^3.3.4"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@iconify/vue": "^4.1.1",
|
|
16
|
+
"@tailwindcss/forms": "^0.5.3",
|
|
17
|
+
"@types/google.maps": "^3.53.4",
|
|
18
|
+
"@types/node": "^20.3.0",
|
|
19
|
+
"@typescript-eslint/eslint-plugin": "^5.59.7",
|
|
20
|
+
"@typescript-eslint/parser": "^5.59.7",
|
|
21
|
+
"@vitejs/plugin-vue": "^4.2.3",
|
|
22
|
+
"@vue/eslint-config-typescript": "^11.0.3",
|
|
23
|
+
"autoprefixer": "^10.4.14",
|
|
24
|
+
"eslint": "^8.41.0",
|
|
25
|
+
"eslint-config-prettier": "^8.8.0",
|
|
26
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
27
|
+
"eslint-plugin-vue": "^9.14.1",
|
|
28
|
+
"postcss": "^8.4.21",
|
|
29
|
+
"prettier": "^2.8.8",
|
|
30
|
+
"rimraf": "^4.4.1",
|
|
31
|
+
"sass": "^1.60.0",
|
|
32
|
+
"tailwindcss": "^3.3.1",
|
|
33
|
+
"terser": "^5.18.0",
|
|
34
|
+
"typescript": "^5.1.3",
|
|
35
|
+
"vite": "^4.3.9",
|
|
36
|
+
"vite-plugin-environment": "^1.1.3",
|
|
37
|
+
"vitepress": "1.0.0-alpha.64",
|
|
38
|
+
"vue": "^3.3.4",
|
|
39
|
+
"vue-eslint-parser": "^9.3.0",
|
|
40
|
+
"vue-tsc": "^1.6.5"
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"src",
|
|
44
|
+
"dist"
|
|
45
|
+
],
|
|
46
|
+
"types": "./dist/types/index.d.ts",
|
|
47
|
+
"typings": "./dist/types/index.d.ts",
|
|
48
|
+
"main": "./dist/axitech-widget.es.js",
|
|
49
|
+
"module": "./dist/axitech-widget.es.js",
|
|
50
|
+
"browser": "./dist/axitech-widget.es.js",
|
|
51
|
+
"exports": {
|
|
52
|
+
".": {
|
|
53
|
+
"import": "./dist/axitech-widget.es.js",
|
|
54
|
+
"require": "./dist/axitech-widget.cjs"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"@googlemaps/js-api-loader": "^1.15.2",
|
|
59
|
+
"@uppy/compressor": "^1.0.2",
|
|
60
|
+
"@uppy/core": "^3.2.0",
|
|
61
|
+
"@uppy/dashboard": "^3.4.0",
|
|
62
|
+
"@uppy/drag-drop": "^3.0.2",
|
|
63
|
+
"@uppy/drop-target": "^2.0.1",
|
|
64
|
+
"@uppy/progress-bar": "^3.0.2",
|
|
65
|
+
"@uppy/thumbnail-generator": "^3.0.3",
|
|
66
|
+
"@uppy/utils": "^5.3.0",
|
|
67
|
+
"@uppy/vue": "^1.0.2",
|
|
68
|
+
"@vueuse/core": "^10.1.2",
|
|
69
|
+
"dayjs": "^1.11.8",
|
|
70
|
+
"dotenv": "^16.1.4",
|
|
71
|
+
"firebase": "^9.22.2",
|
|
72
|
+
"flowbite": "^1.6.5",
|
|
73
|
+
"flowbite-vue": "^0.0.12",
|
|
74
|
+
"vue-tailwind-datepicker": "^1.4.4",
|
|
75
|
+
"vue3-google-map": "^0.15.0"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
Binary file
|