telpick 1.0.1 → 1.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.
Potentially problematic release.
This version of telpick might be problematic. Click here for more details.
- package/README.es.md +8 -0
- package/README.md +8 -0
- package/package.json +6 -2
- package/src/demo-init.js +34 -0
package/README.es.md
CHANGED
|
@@ -8,6 +8,12 @@ Selector de país y código telefónico multiplataforma con diseño moderno y an
|
|
|
8
8
|
|
|
9
9
|
[English](README.md) | **Español**
|
|
10
10
|
|
|
11
|
+
## Probar la demo
|
|
12
|
+
|
|
13
|
+
Puedes probar la demo interactiva en línea:
|
|
14
|
+
|
|
15
|
+
**[→ Abrir demo (GitHub Pages)](https://julioalmirooficial.github.io/telpick/)**
|
|
16
|
+
|
|
11
17
|
## Características
|
|
12
18
|
|
|
13
19
|
- Diseño moderno con animaciones suaves
|
|
@@ -42,6 +48,8 @@ yarn add telpick
|
|
|
42
48
|
<script src="https://unpkg.com/telpick@latest/dist/telpick.umd.js"></script>
|
|
43
49
|
```
|
|
44
50
|
|
|
51
|
+
**Importar CSS:** Usa `import 'telpick/dist/style.css'` cuando instalas desde npm (el paquete publicado incluye `dist`). Si instalas desde GitHub (ej. `npm install github:julioalmirooficial/telpick`), usa `import 'telpick/src/telpick.css'` porque `dist` no está en el repo.
|
|
52
|
+
|
|
45
53
|
## Uso
|
|
46
54
|
|
|
47
55
|
### React
|
package/README.md
CHANGED
|
@@ -8,6 +8,12 @@ Multi-platform country and phone code selector with a modern design, smooth anim
|
|
|
8
8
|
|
|
9
9
|
**English** | [Español](README.es.md)
|
|
10
10
|
|
|
11
|
+
## Try the demo
|
|
12
|
+
|
|
13
|
+
You can try the interactive demo online:
|
|
14
|
+
|
|
15
|
+
**[→ Open demo (GitHub Pages)](https://julioalmirooficial.github.io/telpick/)**
|
|
16
|
+
|
|
11
17
|
## Features
|
|
12
18
|
|
|
13
19
|
- Modern design with smooth animations
|
|
@@ -42,6 +48,8 @@ yarn add telpick
|
|
|
42
48
|
<script src="https://unpkg.com/telpick@latest/dist/telpick.umd.js"></script>
|
|
43
49
|
```
|
|
44
50
|
|
|
51
|
+
**Importing CSS:** Use `import 'telpick/dist/style.css'` when you install from npm (the published package includes `dist`). If you install from GitHub (e.g. `npm install github:julioalmirooficial/telpick`), use `import 'telpick/src/telpick.css'` instead, because `dist` is not in the repo.
|
|
52
|
+
|
|
45
53
|
## Usage
|
|
46
54
|
|
|
47
55
|
### React
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "telpick",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Multi-platform country and phone code selector with a modern design, smooth animations, and automatic IP detection.",
|
|
5
5
|
"main": "dist/telpick.umd.js",
|
|
6
6
|
"module": "dist/telpick.esm.js",
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"import": "./dist/telpick.vanilla.js",
|
|
24
24
|
"types": "./dist/telpick.d.ts"
|
|
25
25
|
},
|
|
26
|
-
"./style.css": "./dist/style.css"
|
|
26
|
+
"./style.css": "./dist/style.css",
|
|
27
|
+
"./src/telpick.css": "./src/telpick.css"
|
|
27
28
|
},
|
|
28
29
|
"files": [
|
|
29
30
|
"dist",
|
|
@@ -34,6 +35,8 @@
|
|
|
34
35
|
],
|
|
35
36
|
"scripts": {
|
|
36
37
|
"build": "vite build",
|
|
38
|
+
"build:demo": "vite build --config vite.config.demo.js",
|
|
39
|
+
"deploy:demo": "npm run build:demo && gh-pages -d docs",
|
|
37
40
|
"dev": "vite",
|
|
38
41
|
"prepublishOnly": "npm run build",
|
|
39
42
|
"test": "jest"
|
|
@@ -81,6 +84,7 @@
|
|
|
81
84
|
}
|
|
82
85
|
},
|
|
83
86
|
"devDependencies": {
|
|
87
|
+
"gh-pages": "^6.1.1",
|
|
84
88
|
"vite": "^4.0.0",
|
|
85
89
|
"typescript": "^5.0.0",
|
|
86
90
|
"vue": "^3.0.0",
|
package/src/demo-init.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Demo init: carga Telpick y monta el Interactive Demo.
|
|
3
|
+
* Así Telpick está disponible cuando se ejecuta el init (evita race con el script inline).
|
|
4
|
+
*/
|
|
5
|
+
import Telpick from './telpick.js'
|
|
6
|
+
|
|
7
|
+
window.Telpick = Telpick
|
|
8
|
+
|
|
9
|
+
function initDemo() {
|
|
10
|
+
const container = document.getElementById('telpick-container')
|
|
11
|
+
if (!container) return
|
|
12
|
+
|
|
13
|
+
const telpick = new Telpick({
|
|
14
|
+
code: null,
|
|
15
|
+
onChange: (country) => {
|
|
16
|
+
const infoEl = document.getElementById('selected-info')
|
|
17
|
+
if (infoEl) {
|
|
18
|
+
document.getElementById('selected-code').textContent = country.code
|
|
19
|
+
document.getElementById('selected-country').textContent = country.country
|
|
20
|
+
document.getElementById('selected-phone').textContent = country.code
|
|
21
|
+
document.getElementById('selected-iso').textContent = country.country_code
|
|
22
|
+
infoEl.classList.add('active')
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
styleOverrides: {}
|
|
26
|
+
})
|
|
27
|
+
telpick.init(container)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (document.readyState === 'loading') {
|
|
31
|
+
document.addEventListener('DOMContentLoaded', initDemo)
|
|
32
|
+
} else {
|
|
33
|
+
initDemo()
|
|
34
|
+
}
|