tecitheme 0.0.2 → 0.0.3
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/components/CountrySelector.svelte +1 -1
- package/components/TrialForm.svelte +59 -64
- package/components/TrialForm.svelte.d.ts +5 -10
- package/demodata.d.ts +0 -1
- package/demodata.js +0 -1
- package/package.json +13 -12
- package/variables.d.ts +3 -0
- package/variables.js +3 -0
|
@@ -1,67 +1,62 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
message = await submit.json();
|
|
61
|
-
} catch (err) {
|
|
62
|
-
console.log(err);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
1
|
+
<script >import CountrySelector from './CountrySelector.svelte';
|
|
2
|
+
import IconTE from '../Logos/TECi_icon_250.svelte';
|
|
3
|
+
import { onMount } from 'svelte';
|
|
4
|
+
import { scrollTo, validateEmail } from '../utils.js';
|
|
5
|
+
import { variables } from '../variables';
|
|
6
|
+
onMount(() => {
|
|
7
|
+
setTimeout(() => {
|
|
8
|
+
timePassed = true;
|
|
9
|
+
}, 3000);
|
|
10
|
+
});
|
|
11
|
+
let resellerModal = false;
|
|
12
|
+
let country = 'sel';
|
|
13
|
+
let name = '';
|
|
14
|
+
let email = '';
|
|
15
|
+
let product = 0;
|
|
16
|
+
let valid = false;
|
|
17
|
+
let message = '';
|
|
18
|
+
let error = '';
|
|
19
|
+
let answer = '';
|
|
20
|
+
let submitted = false;
|
|
21
|
+
let waiting = false;
|
|
22
|
+
let timePassed = false;
|
|
23
|
+
$: if (country != 'sel' &&
|
|
24
|
+
name != '' &&
|
|
25
|
+
validateEmail(email) &&
|
|
26
|
+
product != 0 &&
|
|
27
|
+
answer == '' &&
|
|
28
|
+
timePassed) {
|
|
29
|
+
valid = true;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
valid = false;
|
|
33
|
+
}
|
|
34
|
+
$: if (submitted == true && message == '') {
|
|
35
|
+
waiting = true;
|
|
36
|
+
scrollTo('trial-request');
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
waiting = false;
|
|
40
|
+
}
|
|
41
|
+
const submitForm = async () => {
|
|
42
|
+
submitted = true;
|
|
43
|
+
error = '';
|
|
44
|
+
try {
|
|
45
|
+
const submit = await fetch(variables.trialEndpoint, {
|
|
46
|
+
method: 'POST',
|
|
47
|
+
body: JSON.stringify({
|
|
48
|
+
name,
|
|
49
|
+
email,
|
|
50
|
+
country,
|
|
51
|
+
product
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
message = await submit.json();
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
console.log(err);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
65
60
|
</script>
|
|
66
61
|
|
|
67
62
|
<form id="trial-request" on:submit|preventDefault={submitForm}>
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} TrialFormProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} TrialFormEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} TrialFormSlots */
|
|
4
|
-
export default class TrialForm extends SvelteComponentTyped<{}, {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> {
|
|
7
|
-
}
|
|
8
|
-
export type TrialFormProps = typeof __propDef.props;
|
|
9
|
-
export type TrialFormEvents = typeof __propDef.events;
|
|
10
|
-
export type TrialFormSlots = typeof __propDef.slots;
|
|
11
1
|
import { SvelteComponentTyped } from "svelte";
|
|
12
2
|
declare const __propDef: {
|
|
13
3
|
props: {};
|
|
@@ -16,4 +6,9 @@ declare const __propDef: {
|
|
|
16
6
|
};
|
|
17
7
|
slots: {};
|
|
18
8
|
};
|
|
9
|
+
export declare type TrialFormProps = typeof __propDef.props;
|
|
10
|
+
export declare type TrialFormEvents = typeof __propDef.events;
|
|
11
|
+
export declare type TrialFormSlots = typeof __propDef.slots;
|
|
12
|
+
export default class TrialForm extends SvelteComponentTyped<TrialFormProps, TrialFormEvents, TrialFormSlots> {
|
|
13
|
+
}
|
|
19
14
|
export {};
|
package/demodata.d.ts
CHANGED
package/demodata.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tecitheme",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"svelte": true,
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@sveltejs/adapter-auto": "next",
|
|
@@ -11,26 +11,26 @@
|
|
|
11
11
|
"@typescript-eslint/eslint-plugin": "^4.31.1",
|
|
12
12
|
"@typescript-eslint/parser": "^4.31.1",
|
|
13
13
|
"autoprefixer": "^10.4.2",
|
|
14
|
-
"dotenv": "^
|
|
14
|
+
"dotenv": "^14.3.0",
|
|
15
15
|
"encoding": "^0.1.13",
|
|
16
16
|
"eslint": "^7.32.0",
|
|
17
17
|
"eslint-config-prettier": "^8.3.0",
|
|
18
|
-
"eslint-plugin-svelte3": "^3.
|
|
18
|
+
"eslint-plugin-svelte3": "^3.4.0",
|
|
19
19
|
"mdsvex": "^0.9.8",
|
|
20
20
|
"postcss": "^8.4.5",
|
|
21
|
-
"prettier": "^2.
|
|
22
|
-
"prettier-plugin-svelte": "^2.
|
|
21
|
+
"prettier": "^2.5.1",
|
|
22
|
+
"prettier-plugin-svelte": "^2.6.0",
|
|
23
23
|
"stream": "^0.0.2",
|
|
24
|
-
"svelte": "^3.
|
|
25
|
-
"svelte-check": "^2.
|
|
24
|
+
"svelte": "^3.46.2",
|
|
25
|
+
"svelte-check": "^2.3.0",
|
|
26
26
|
"svelte-cubed": "^0.2.1",
|
|
27
|
-
"svelte-preprocess": "^4.10.
|
|
28
|
-
"svelte2tsx": "^0.4.
|
|
27
|
+
"svelte-preprocess": "^4.10.2",
|
|
28
|
+
"svelte2tsx": "^0.4.14",
|
|
29
29
|
"tailwindcss": "^3.0.16",
|
|
30
30
|
"three": "^0.136.0",
|
|
31
31
|
"tslib": "^2.3.1",
|
|
32
|
-
"typescript": "^4.
|
|
33
|
-
"vite": "^2.7.
|
|
32
|
+
"typescript": "^4.5.5",
|
|
33
|
+
"vite": "^2.7.13"
|
|
34
34
|
},
|
|
35
35
|
"type": "module",
|
|
36
36
|
"dependencies": {
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"./components/TrialForm.svelte": "./components/TrialForm.svelte",
|
|
51
51
|
"./demodata": "./demodata.js",
|
|
52
52
|
"./req_utils": "./req_utils.js",
|
|
53
|
-
"./utils": "./utils.js"
|
|
53
|
+
"./utils": "./utils.js",
|
|
54
|
+
"./variables": "./variables.js"
|
|
54
55
|
}
|
|
55
56
|
}
|
package/variables.d.ts
ADDED
package/variables.js
ADDED