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 { createEventDispatcher } from "svelte";
3
- import Modal from "./Modal.svelte";
2
+ import Modal from './Modal.svelte';
4
3
 
5
4
  export let resellerModal = true;
6
- export let selection = "sel";
5
+ export let selection = 'sel';
7
6
  export let allowContinue = false;
8
- let modal;
9
7
 
10
- let modalData = {
11
- title: "",
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
- ["BE", "NL", "LU"],
19
- ["CN", "HK"],
20
- ["CZ", "SK"],
21
- ["EG", "JO", "LB", "OM", "QA", "SA", "AE"],
22
- ["FR"],
23
- ["DE", "CH", "AT", "LI"],
24
- ["IN", "BD", "LK", "CM", "BT", "MM"],
25
- ["IT", "HU"],
26
- ["JP"],
27
- ["KR"],
28
- ["PL"],
29
- ["RU", "AM", "AZ", "BY", "GE", "KZ", "KG", "MD", "TJ", "TM", "UA", "UZ"],
30
- ["RO"],
31
- ["SG", "MY", "ID", "VN"],
32
- ["ES"],
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 != "sel" && !isReseller()) {
53
+ if (selection != 'sel' && !isReseller()) {
43
54
  allowContinue = true;
44
- } else if (selection != "sel" && isReseller()) {
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 name="card_country" bind:value={selection} on:change={handleSelection}>
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}" />
@@ -2,10 +2,10 @@
2
2
  export let data;
3
3
  let shown = false;
4
4
 
5
- function show() {
5
+ export function show() {
6
6
  shown = true;
7
7
  }
8
- function hide() {
8
+ export function hide() {
9
9
  shown = false;
10
10
  }
11
11
  </script>
@@ -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>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tecitheme",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "svelte": true,
5
5
  "devDependencies": {
6
6
  "@jsdevtools/rehype-toc": "^3.0.2",