tecitheme 0.2.6 → 0.2.7
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.
|
@@ -1,35 +1,46 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import
|
|
3
|
-
import Modal from "./Modal.svelte";
|
|
2
|
+
import Modal from './Modal.svelte';
|
|
4
3
|
|
|
5
4
|
export let resellerModal = true;
|
|
6
|
-
export let selection =
|
|
5
|
+
export let selection = 'sel';
|
|
7
6
|
export let allowContinue = false;
|
|
8
|
-
let modal;
|
|
9
7
|
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
text: "",
|
|
13
|
-
modalContent:
|
|
14
|
-
"<h2 class='text-lg leading-6 font-medium text-gray-900'>Reseller Required</h2><div class='mt-2 px-7 py-3'><p class='text-sm text-gray-500'>Thunderhead cannot sell to you directly, you must use the authorized reseller for your region.</p></div><div class='items-center px-4 py-3'><a href='https://www.thunderheadeng.com/pyrosim/pyrosim-licensing/#r{resellerIndex+1}' id='ok-btn' class='px-4 py-2 bg-teci-blue-light text-white text-base font-medium w-full shadow-sm hover:bg-teci-blue-dark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500'>Reseller Contact Information</a></div>",
|
|
15
|
-
};
|
|
8
|
+
let modal;
|
|
9
|
+
let modalData;
|
|
16
10
|
let resellerIndex = -1;
|
|
17
11
|
let resellerArray = [
|
|
18
|
-
[
|
|
19
|
-
[
|
|
20
|
-
[
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
24
|
-
[
|
|
25
|
-
[
|
|
26
|
-
[
|
|
27
|
-
[
|
|
28
|
-
[
|
|
29
|
-
[
|
|
30
|
-
[
|
|
31
|
-
[
|
|
32
|
-
[
|
|
12
|
+
['BE', 'NL', 'LU'],
|
|
13
|
+
['CN', 'HK'],
|
|
14
|
+
['CZ', 'SK'],
|
|
15
|
+
['EG', 'JO', 'LB', 'OM', 'QA', 'SA', 'AE'],
|
|
16
|
+
['FR'],
|
|
17
|
+
['DE', 'CH', 'AT', 'LI'],
|
|
18
|
+
['IN', 'BD', 'LK', 'CM', 'BT', 'MM'],
|
|
19
|
+
['IT', 'HU'],
|
|
20
|
+
['JP'],
|
|
21
|
+
['KR'],
|
|
22
|
+
['PL'],
|
|
23
|
+
['RU', 'AM', 'AZ', 'BY', 'GE', 'KZ', 'KG', 'MD', 'TJ', 'TM', 'UA', 'UZ'],
|
|
24
|
+
['RO'],
|
|
25
|
+
['SG', 'MY', 'ID', 'VN'],
|
|
26
|
+
['ES'],
|
|
27
|
+
];
|
|
28
|
+
let resellerLinks = [
|
|
29
|
+
'belgium-netherlands-and-luxembourg',
|
|
30
|
+
'china-and-hong-kong',
|
|
31
|
+
'czech-republic-and-slovak-republic',
|
|
32
|
+
'egypt-jordan-lebanon-oman-qatar-saudi-arabia-united-arab-emirates',
|
|
33
|
+
'france-and-french-language-customers-in-other-regions',
|
|
34
|
+
'germany-switzerland-austria-and-liechtenstein',
|
|
35
|
+
'india-bangladesh-sri-lanka-nepal-bhutan-myanmar',
|
|
36
|
+
'italy-hungary',
|
|
37
|
+
'japan',
|
|
38
|
+
'korea',
|
|
39
|
+
'poland-ukraine',
|
|
40
|
+
'russia-and-cis',
|
|
41
|
+
'romania',
|
|
42
|
+
'singapore-malaysia-indonesia-and-vietnam',
|
|
43
|
+
'spain',
|
|
33
44
|
];
|
|
34
45
|
|
|
35
46
|
function isReseller() {
|
|
@@ -39,9 +50,9 @@
|
|
|
39
50
|
|
|
40
51
|
function handleSelection() {
|
|
41
52
|
if (resellerModal) {
|
|
42
|
-
if (selection !=
|
|
53
|
+
if (selection != 'sel' && !isReseller()) {
|
|
43
54
|
allowContinue = true;
|
|
44
|
-
} else if (selection !=
|
|
55
|
+
} else if (selection != 'sel' && isReseller()) {
|
|
45
56
|
modal.show();
|
|
46
57
|
allowContinue = false;
|
|
47
58
|
} else {
|
|
@@ -49,9 +60,17 @@
|
|
|
49
60
|
}
|
|
50
61
|
}
|
|
51
62
|
}
|
|
63
|
+
|
|
64
|
+
$:modalData = {
|
|
65
|
+
modalContent: `<h2 class="text-lg leading-6 font-medium text-gray-900">Reseller Required</h2><div class="mt-2 px-7 py-3"><p class="text-sm text-gray-500">Thunderhead cannot sell to you directly, you must use the authorized reseller for your region.</p></div><div class="items-center px-4 py-3"><a href="https://www.thunderheadeng.com/partners#${resellerLinks[resellerIndex]}" id="ok-btn" class="px-4 py-2 bg-teci-blue-light text-white text-base font-medium w-full shadow-sm hover:bg-teci-blue-dark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">Reseller Contact Information</a></div>`,
|
|
66
|
+
};
|
|
52
67
|
</script>
|
|
53
68
|
|
|
54
|
-
<select
|
|
69
|
+
<select
|
|
70
|
+
name="card_country"
|
|
71
|
+
bind:value="{selection}"
|
|
72
|
+
on:change="{handleSelection}"
|
|
73
|
+
>
|
|
55
74
|
<option value="sel">Select Your Country</option>
|
|
56
75
|
<option value="AI">Anguilla</option>
|
|
57
76
|
<option value="AR">Argentina</option>
|
|
@@ -141,4 +160,4 @@
|
|
|
141
160
|
<option value="VN">Viet Nam</option>
|
|
142
161
|
</select>
|
|
143
162
|
|
|
144
|
-
<Modal bind:this={modal} bind:data={modalData} />
|
|
163
|
+
<Modal bind:this="{modal}" bind:data="{modalData}" />
|
package/components/Modal.svelte
CHANGED
|
@@ -3,9 +3,13 @@
|
|
|
3
3
|
/** @typedef {typeof __propDef.slots} ModalSlots */
|
|
4
4
|
export default class Modal extends SvelteComponentTyped<{
|
|
5
5
|
data: any;
|
|
6
|
+
show?: () => void;
|
|
7
|
+
hide?: () => void;
|
|
6
8
|
}, {
|
|
7
9
|
[evt: string]: CustomEvent<any>;
|
|
8
10
|
}, {}> {
|
|
11
|
+
get show(): () => void;
|
|
12
|
+
get hide(): () => void;
|
|
9
13
|
}
|
|
10
14
|
export type ModalProps = typeof __propDef.props;
|
|
11
15
|
export type ModalEvents = typeof __propDef.events;
|
|
@@ -14,6 +18,8 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
14
18
|
declare const __propDef: {
|
|
15
19
|
props: {
|
|
16
20
|
data: any;
|
|
21
|
+
show?: () => void;
|
|
22
|
+
hide?: () => void;
|
|
17
23
|
};
|
|
18
24
|
events: {
|
|
19
25
|
[evt: string]: CustomEvent<any>;
|