svelte-tel-input 0.4.0 → 0.4.1
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/CHANGELOG.md +10 -2
- package/README.md +13 -9
- package/assets/countries.d.ts +2 -0
- package/{src/lib/assets/countries.ts → assets/countries.js} +0 -2
- package/assets/regions.d.ts +2 -0
- package/{src/lib/assets/regions.ts → assets/regions.js} +0 -2
- package/components/Input/SvelteTelInput.svelte +23 -0
- package/components/Input/SvelteTelInput.svelte.d.ts +14 -0
- package/{src/lib/components → components}/Select/CountrySelect.svelte +2 -3
- package/components/Select/CountrySelect.svelte.d.ts +14 -0
- package/{src/lib/components → components}/Select/RegionSelect.svelte +2 -3
- package/components/Select/RegionSelect.svelte.d.ts +14 -0
- package/{src/lib/index.ts → index.d.ts} +0 -0
- package/index.js +2 -0
- package/models/enums/PhoneType.enum.d.ts +4 -0
- package/models/enums/PhoneType.enum.js +5 -0
- package/{src/lib/models/enums/index.ts → models/enums/index.d.ts} +0 -0
- package/models/enums/index.js +1 -0
- package/{src/lib/models/index.ts → models/index.d.ts} +0 -0
- package/models/index.js +1 -0
- package/{src/lib/models/interfaces/Select.interface.ts → models/interfaces/Select.interface.d.ts} +0 -0
- package/models/interfaces/Select.interface.js +1 -0
- package/models/types/DynamicSvelteComponent.type.d.ts +8 -0
- package/{src/lib/models/types/DynamicSvelteComponent.type.ts → models/types/DynamicSvelteComponent.type.js} +1 -13
- package/{src/lib/models/types/Select.type.ts → models/types/Select.type.d.ts} +1 -2
- package/models/types/Select.type.js +1 -0
- package/package.json +159 -160
- package/stores/index.d.ts +11 -0
- package/{src/lib/stores/index.ts → stores/index.js} +6 -10
- package/utils/directives/clickOutsideAction.d.ts +3 -0
- package/utils/directives/clickOutsideAction.js +9 -0
- package/utils/simulator.d.ts +1 -0
- package/utils/simulator.js +5 -0
- package/utils/typeCheck.d.ts +4 -0
- package/utils/typeCheck.js +11 -0
- package/.changeset/config.json +0 -9
- package/.editorconfig +0 -13
- package/.eslintignore +0 -10
- package/.eslintrc.cjs +0 -30
- package/.github/workflows/lint.yml +0 -12
- package/.github/workflows/release.yml +0 -56
- package/.husky/pre-commit +0 -4
- package/.prettierignore +0 -10
- package/.prettierrc.cjs +0 -6
- package/babel.config.cjs +0 -12
- package/docker-compose.yml +0 -16
- package/docs/_index.md +0 -1
- package/jest.config.cjs +0 -21
- package/postcss.config.cjs +0 -21
- package/scripts/changelog-github-custom.cjs +0 -104
- package/scripts/changelog-github-custom.test.ts +0 -136
- package/scripts/changelog-github-custom.ts +0 -127
- package/src/app.css +0 -4
- package/src/app.html +0 -13
- package/src/global.d.ts +0 -1
- package/src/hooks.ts +0 -9
- package/src/lib/components/Input/SvelteTelInput.svelte +0 -29
- package/src/lib/models/enums/PhoneType.enum.ts +0 -4
- package/src/lib/utils/directives/clickOutsideAction.ts +0 -13
- package/src/lib/utils/simulator.ts +0 -5
- package/src/lib/utils/typeCheck.ts +0 -17
- package/src/routes/__layout.svelte +0 -11
- package/src/routes/index.svelte +0 -22
- package/static/favicon.ico +0 -0
- package/static/robots.txt +0 -3
- package/svelte.config.js +0 -28
- package/tailwind.config.cjs +0 -10
- package/tsconfig.json +0 -32
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# svelte-tel-input
|
|
2
2
|
|
|
3
|
+
## 0.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fix: readme fix ([#39](https://github.com/gyurielf/svelte-tel-input/pull/39))
|
|
8
|
+
|
|
3
9
|
## 0.4.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -10,13 +16,15 @@
|
|
|
10
16
|
|
|
11
17
|
- fix: minor ci fix ([#34](https://github.com/gyurielf/svelte-tel-input/pull/34))
|
|
12
18
|
|
|
13
|
-
* fix: fix ci again
|
|
19
|
+
* fix: fix ci again ([#35](https://github.com/gyurielf/svelte-tel-input/pull/35))
|
|
14
20
|
|
|
15
21
|
- fix: last ci fix for today ([#36](https://github.com/gyurielf/svelte-tel-input/pull/36))
|
|
16
22
|
|
|
17
23
|
* fix: ci fixxx ([#33](https://github.com/gyurielf/svelte-tel-input/pull/33))
|
|
18
24
|
|
|
19
|
-
-
|
|
25
|
+
- something 1 ([#37](https://github.com/gyurielf/svelte-tel-input/pull/37))
|
|
26
|
+
|
|
27
|
+
* fix: ci extend 321 ([#32](https://github.com/gyurielf/svelte-tel-input/pull/32))
|
|
20
28
|
|
|
21
29
|
## 0.3.2
|
|
22
30
|
|
package/README.md
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
# Svelte Tel Input
|
|
2
2
|
|
|
3
|
-
Under development
|
|
4
|
-
|
|
5
|
-
## Dependencies
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
$ [libphonenumber-js](https://gitlab.com/catamphetamine/libphonenumber-js)
|
|
9
|
-
```
|
|
3
|
+
<ins>## Under heavy development!</ins>
|
|
10
4
|
|
|
11
5
|
## Installation
|
|
12
6
|
|
|
7
|
+
---
|
|
8
|
+
|
|
13
9
|
Svelte Tel Input is distributed via [npm](https://www.npmjs.com/package/svelte-tel-input).
|
|
14
10
|
|
|
15
11
|
```sh
|
|
16
|
-
|
|
12
|
+
yarn add svelte-tel-input
|
|
13
|
+
|
|
17
14
|
# or
|
|
18
|
-
|
|
15
|
+
|
|
16
|
+
npm install --save svelte-tel-input
|
|
19
17
|
```
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Dependencies
|
|
22
|
+
|
|
23
|
+
[libphonenumber-js](https://gitlab.com/catamphetamine/libphonenumber-js)
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
// Sub-regions:
|
|
16
16
|
// ['north-america', 'south-america', 'central-america', 'carribean',
|
|
17
17
|
// 'eu-union', 'ex-ussr', 'ex-yugos', 'baltic', 'middle-east', 'north-africa']
|
|
18
|
-
|
|
19
18
|
const rawCountries = [
|
|
20
19
|
['Afghanistan', ['asia'], 'af', '93'],
|
|
21
20
|
['Albania', ['europe'], 'al', '355'],
|
|
@@ -601,5 +600,4 @@ const rawCountries = [
|
|
|
601
600
|
['Zambia', ['africa'], 'zm', '260'],
|
|
602
601
|
['Zimbabwe', ['africa'], 'zw', '263']
|
|
603
602
|
];
|
|
604
|
-
|
|
605
603
|
export default rawCountries;
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
// Sub-regions:
|
|
16
16
|
// ['north-america', 'south-america', 'central-america', 'carribean',
|
|
17
17
|
// 'eu-union', 'ex-ussr', 'ex-yugos', 'baltic', 'middle-east', 'north-africa']
|
|
18
|
-
|
|
19
18
|
const rawTerritories = [
|
|
20
19
|
['American Samoa', ['oceania'], 'as', '1684'],
|
|
21
20
|
['Anguilla', ['america', 'carribean'], 'ai', '1264'],
|
|
@@ -42,5 +41,4 @@ const rawTerritories = [
|
|
|
42
41
|
['U.S. Virgin Islands', ['america', 'carribean'], 'vi', '1340'],
|
|
43
42
|
['Wallis and Futuna', ['oceania'], 'wf', '681']
|
|
44
43
|
];
|
|
45
|
-
|
|
46
44
|
export default rawTerritories;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script >import { parsePhoneNumberFromString } from 'libphonenumber-js';
|
|
2
|
+
let telInputNumber;
|
|
3
|
+
// const phoneNumber = parsePhoneNumber(' 8 (800) 555-35-35 ', 'RU');
|
|
4
|
+
// if (phoneNumber) {
|
|
5
|
+
// phoneNumber.country === 'RU';
|
|
6
|
+
// phoneNumber.number === '+78005553535';
|
|
7
|
+
// phoneNumber.isValid() === true;
|
|
8
|
+
// // Note: `.getType()` requires `/max` metadata: see below for an explanation.
|
|
9
|
+
// phoneNumber.getType() === 'TOLL_FREE';
|
|
10
|
+
// }
|
|
11
|
+
// const parse = parsePhoneNumber(telInputNumber);
|
|
12
|
+
const handleInput = (event) => {
|
|
13
|
+
let inputVal = event.target.value;
|
|
14
|
+
console.log(parsePhoneNumberFromString(inputVal));
|
|
15
|
+
};
|
|
16
|
+
$: console.log(telInputNumber);
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<input
|
|
20
|
+
class="px-4 py-1 text-gray-900 rounded-full focus:outline-none"
|
|
21
|
+
type="tel"
|
|
22
|
+
on:input={handleInput}
|
|
23
|
+
/>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {};
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export declare type SvelteTelInputProps = typeof __propDef.props;
|
|
10
|
+
export declare type SvelteTelInputEvents = typeof __propDef.events;
|
|
11
|
+
export declare type SvelteTelInputSlots = typeof __propDef.slots;
|
|
12
|
+
export default class SvelteTelInput extends SvelteComponentTyped<SvelteTelInputProps, SvelteTelInputEvents, SvelteTelInputSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {};
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export declare type CountrySelectProps = typeof __propDef.props;
|
|
10
|
+
export declare type CountrySelectEvents = typeof __propDef.events;
|
|
11
|
+
export declare type CountrySelectSlots = typeof __propDef.slots;
|
|
12
|
+
export default class CountrySelect extends SvelteComponentTyped<CountrySelectProps, CountrySelectEvents, CountrySelectSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {};
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export declare type RegionSelectProps = typeof __propDef.props;
|
|
10
|
+
export declare type RegionSelectEvents = typeof __propDef.events;
|
|
11
|
+
export declare type RegionSelectSlots = typeof __propDef.slots;
|
|
12
|
+
export default class RegionSelect extends SvelteComponentTyped<RegionSelectProps, RegionSelectEvents, RegionSelectSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
File without changes
|
package/index.js
ADDED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PhoneType.enum';
|
|
File without changes
|
package/models/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './enums';
|
package/{src/lib/models/interfaces/Select.interface.ts → models/interfaces/Select.interface.d.ts}
RENAMED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
// TEMPORARY DISABLED
|
|
4
|
-
export type DynamicSvelteComponent = {
|
|
5
|
-
component: typeof SvelteComponentTyped;
|
|
6
|
-
props?: Record<string, any>;
|
|
7
|
-
slot?: any;
|
|
8
|
-
click?: any;
|
|
9
|
-
input?: any;
|
|
10
|
-
};
|
|
11
|
-
|
|
1
|
+
export {};
|
|
12
2
|
// declare const __propDef: {
|
|
13
3
|
// props: {};
|
|
14
4
|
// slots: {};
|
|
@@ -16,11 +6,9 @@ export type DynamicSvelteComponent = {
|
|
|
16
6
|
// [evt: string]: CustomEvent<any>;
|
|
17
7
|
// };
|
|
18
8
|
// };
|
|
19
|
-
|
|
20
9
|
// export declare type DynamicSvelteComponentProps = typeof __propDef.props;
|
|
21
10
|
// export declare type DynamicSvelteComponentEvents = typeof __propDef.events;
|
|
22
11
|
// export declare type DynamicSvelteComponentSlots = typeof __propDef.slots;
|
|
23
|
-
|
|
24
12
|
// export default class DynamicSvelteComponent extends SvelteComponentTyped<
|
|
25
13
|
// DynamicSvelteComponentProps,
|
|
26
14
|
// DynamicSvelteComponentEvents,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,162 +1,161 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
"name": "svelte-tel-input",
|
|
3
|
+
"description": "svelte-tel-input",
|
|
4
|
+
"version": "0.4.1",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/gyurielf/svelte-tel-input.git"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/gyurielf/svelte-tel-input#readme",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"svelte",
|
|
12
|
+
"tel input",
|
|
13
|
+
"phone",
|
|
14
|
+
"phone input",
|
|
15
|
+
"intl",
|
|
16
|
+
"intl tel input"
|
|
17
|
+
],
|
|
18
|
+
"engines": {
|
|
19
|
+
"npm": ">= 7",
|
|
20
|
+
"yarn": "please-use-npm",
|
|
21
|
+
"node": ">= 16"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"libphonenumber-js": "^1.9.44"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@babel/core": "^7.16.10",
|
|
28
|
+
"@babel/preset-env": "^7.16.10",
|
|
29
|
+
"@changesets/cli": "^2.19.0",
|
|
30
|
+
"@changesets/get-github-info": "^0.5.0",
|
|
31
|
+
"@changesets/types": "^4.0.2",
|
|
32
|
+
"@sveltejs/adapter-static": "^1.0.0-next.26",
|
|
33
|
+
"@sveltejs/kit": "^1.0.0-next.234",
|
|
34
|
+
"@testing-library/jest-dom": "^5.16.1",
|
|
35
|
+
"@testing-library/svelte": "^3.0.3",
|
|
36
|
+
"@types/jest": "^27.4.0",
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "^5.10.0",
|
|
38
|
+
"@typescript-eslint/parser": "^5.10.0",
|
|
39
|
+
"autoprefixer": "^10.4.2",
|
|
40
|
+
"babel-jest": "^27.4.6",
|
|
41
|
+
"babel-loader": "^8.2.3",
|
|
42
|
+
"commitizen": "^4.2.4",
|
|
43
|
+
"cssnano": "^5.0.15",
|
|
44
|
+
"dotenv": "^14.2.0",
|
|
45
|
+
"eslint": "^8.7.0",
|
|
46
|
+
"eslint-config-prettier": "^8.3.0",
|
|
47
|
+
"eslint-plugin-jest": "^25.7.0",
|
|
48
|
+
"eslint-plugin-svelte3": "^3.4.0",
|
|
49
|
+
"husky": "^7.0.4",
|
|
50
|
+
"jest": "^27.4.7",
|
|
51
|
+
"jest-matchmedia-mock": "^1.1.0",
|
|
52
|
+
"micromatch": "^4.0.4",
|
|
53
|
+
"postcss": "^8.4.5",
|
|
54
|
+
"postcss-load-config": "^3.1.1",
|
|
55
|
+
"prettier": "^2.5.1",
|
|
56
|
+
"prettier-plugin-svelte": "^2.6.0",
|
|
57
|
+
"standard-changelog": "^2.0.27",
|
|
58
|
+
"standard-version": "^9.3.2",
|
|
59
|
+
"svelte": "^3.46.2",
|
|
60
|
+
"svelte-check": "^2.3.0",
|
|
61
|
+
"svelte-inview": "^2.1.1",
|
|
62
|
+
"svelte-jester": "^2.1.5",
|
|
63
|
+
"svelte-loader": "^3.1.2",
|
|
64
|
+
"svelte-preprocess": "^4.10.2",
|
|
65
|
+
"svelte2tsx": "^0.4.14",
|
|
66
|
+
"tailwindcss": "^3.0.15",
|
|
67
|
+
"ts-jest": "^27.1.3",
|
|
68
|
+
"tsconfig-paths-webpack-plugin": "^3.5.2",
|
|
69
|
+
"tslib": "^2.3.1",
|
|
70
|
+
"typescript": "^4.5.4"
|
|
71
|
+
},
|
|
72
|
+
"standard-version": {
|
|
73
|
+
"skip": {
|
|
74
|
+
"tag": true
|
|
8
75
|
},
|
|
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
|
-
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
},
|
|
96
|
-
"types": [
|
|
97
|
-
{
|
|
98
|
-
"type": "chore",
|
|
99
|
-
"section": "Others (chore)",
|
|
100
|
-
"hidden": false
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
"type": "revert",
|
|
104
|
-
"section": "Reverts",
|
|
105
|
-
"hidden": false
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
"type": "feat",
|
|
109
|
-
"section": "Features",
|
|
110
|
-
"hidden": false
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
"type": "fix",
|
|
114
|
-
"section": "Bug Fixes",
|
|
115
|
-
"hidden": false
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
"type": "improvement",
|
|
119
|
-
"section": "Feature Improvements",
|
|
120
|
-
"hidden": false
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
"type": "docs",
|
|
124
|
-
"section": "Docs",
|
|
125
|
-
"hidden": false
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
"type": "style",
|
|
129
|
-
"section": "Styling",
|
|
130
|
-
"hidden": false
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
"type": "refactor",
|
|
134
|
-
"section": "Code Refactoring",
|
|
135
|
-
"hidden": false
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
"type": "perf",
|
|
139
|
-
"section": "Performance Improvements",
|
|
140
|
-
"hidden": false
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
"type": "test",
|
|
144
|
-
"section": "Tests",
|
|
145
|
-
"hidden": false
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
"type": "build",
|
|
149
|
-
"section": "Build System",
|
|
150
|
-
"hidden": false
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
"type": "ci",
|
|
154
|
-
"section": "CI",
|
|
155
|
-
"hidden": false
|
|
156
|
-
}
|
|
157
|
-
]
|
|
158
|
-
},
|
|
159
|
-
"svelte": ".",
|
|
160
|
-
"type": "module",
|
|
161
|
-
"license": "UNLICENSED"
|
|
162
|
-
}
|
|
76
|
+
"types": [
|
|
77
|
+
{
|
|
78
|
+
"type": "chore",
|
|
79
|
+
"section": "Others (chore)",
|
|
80
|
+
"hidden": false
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"type": "revert",
|
|
84
|
+
"section": "Reverts",
|
|
85
|
+
"hidden": false
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"type": "feat",
|
|
89
|
+
"section": "Features",
|
|
90
|
+
"hidden": false
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"type": "fix",
|
|
94
|
+
"section": "Bug Fixes",
|
|
95
|
+
"hidden": false
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"type": "improvement",
|
|
99
|
+
"section": "Feature Improvements",
|
|
100
|
+
"hidden": false
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"type": "docs",
|
|
104
|
+
"section": "Docs",
|
|
105
|
+
"hidden": false
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"type": "style",
|
|
109
|
+
"section": "Styling",
|
|
110
|
+
"hidden": false
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"type": "refactor",
|
|
114
|
+
"section": "Code Refactoring",
|
|
115
|
+
"hidden": false
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"type": "perf",
|
|
119
|
+
"section": "Performance Improvements",
|
|
120
|
+
"hidden": false
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"type": "test",
|
|
124
|
+
"section": "Tests",
|
|
125
|
+
"hidden": false
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"type": "build",
|
|
129
|
+
"section": "Build System",
|
|
130
|
+
"hidden": false
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"type": "ci",
|
|
134
|
+
"section": "CI",
|
|
135
|
+
"hidden": false
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
"svelte": ".",
|
|
140
|
+
"type": "module",
|
|
141
|
+
"license": "UNLICENSED",
|
|
142
|
+
"exports": {
|
|
143
|
+
"./package.json": "./package.json",
|
|
144
|
+
"./assets/countries": "./assets/countries.js",
|
|
145
|
+
"./assets/regions": "./assets/regions.js",
|
|
146
|
+
"./components/Input/SvelteTelInput.svelte": "./components/Input/SvelteTelInput.svelte",
|
|
147
|
+
"./components/Select/CountrySelect.svelte": "./components/Select/CountrySelect.svelte",
|
|
148
|
+
"./components/Select/RegionSelect.svelte": "./components/Select/RegionSelect.svelte",
|
|
149
|
+
".": "./index.js",
|
|
150
|
+
"./models/enums/PhoneType.enum": "./models/enums/PhoneType.enum.js",
|
|
151
|
+
"./models/enums": "./models/enums/index.js",
|
|
152
|
+
"./models": "./models/index.js",
|
|
153
|
+
"./models/interfaces/Select.interface": "./models/interfaces/Select.interface.js",
|
|
154
|
+
"./models/types/DynamicSvelteComponent.type": "./models/types/DynamicSvelteComponent.type.js",
|
|
155
|
+
"./models/types/Select.type": "./models/types/Select.type.js",
|
|
156
|
+
"./stores": "./stores/index.js",
|
|
157
|
+
"./utils/directives/clickOutsideAction": "./utils/directives/clickOutsideAction.js",
|
|
158
|
+
"./utils/simulator": "./utils/simulator.js",
|
|
159
|
+
"./utils/typeCheck": "./utils/typeCheck.js"
|
|
160
|
+
}
|
|
161
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const booleanStore: (initial: boolean) => {
|
|
2
|
+
isOpen: import("svelte/store").Writable<boolean>;
|
|
3
|
+
open: () => void;
|
|
4
|
+
close: () => void;
|
|
5
|
+
toggle: () => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const statefulSwap: (initialState: boolean | null) => {
|
|
8
|
+
transitionState: import("svelte/store").Writable<boolean | null>;
|
|
9
|
+
transitionTo: (newState: boolean | null) => void;
|
|
10
|
+
onOutro: () => void;
|
|
11
|
+
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { writable } from 'svelte/store';
|
|
2
|
-
|
|
3
2
|
// Modal
|
|
4
|
-
export const booleanStore = (initial
|
|
5
|
-
const isOpen = writable
|
|
3
|
+
export const booleanStore = (initial) => {
|
|
4
|
+
const isOpen = writable(initial);
|
|
6
5
|
const { set, update } = isOpen;
|
|
7
6
|
return {
|
|
8
7
|
isOpen,
|
|
@@ -11,22 +10,19 @@ export const booleanStore = (initial: boolean) => {
|
|
|
11
10
|
toggle: () => update((n) => !n)
|
|
12
11
|
};
|
|
13
12
|
};
|
|
14
|
-
|
|
15
13
|
// StatefulSwap (transition)
|
|
16
|
-
export const statefulSwap = (initialState
|
|
14
|
+
export const statefulSwap = (initialState) => {
|
|
17
15
|
const transitionState = writable(initialState);
|
|
18
16
|
let nextState = initialState;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
const transitionTo = (newState) => {
|
|
18
|
+
if (nextState === newState)
|
|
19
|
+
return;
|
|
22
20
|
nextState = newState;
|
|
23
21
|
transitionState.set(null);
|
|
24
22
|
};
|
|
25
|
-
|
|
26
23
|
const onOutro = () => {
|
|
27
24
|
transitionState.set(nextState);
|
|
28
25
|
};
|
|
29
|
-
|
|
30
26
|
return {
|
|
31
27
|
transitionState,
|
|
32
28
|
transitionTo,
|