Skip to content

Commit e25458a

Browse files
committed
type
1 parent 6d325d8 commit e25458a

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

build/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<title>Document</title>
8-
<link rel="stylesheet" href="./css/app.css">
8+
<!-- <link rel="stylesheet" href="./css/app.css"> -->
9+
<link rel="stylesheet" href="https://unpkg.com/svelte-mask@0.2.6/build/css/app.css">
910
</head>
1011
<body>
1112
<div id="app"></div>
12-
<script src="./bundle.js"></script>
13+
<!-- <script src="./bundle.js"></script> -->
14+
<script src="https://unpkg.com/svelte-mask@0.2.6/build/bundle.js"></script>
1315
<script>
1416
createMaskInput('app', '+7(999)9999999')
1517
</script>

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "svelte-mask",
33
"private": false,
4-
"version": "0.2.5",
4+
"version": "0.2.7",
55
"type": "module",
66
"main": "index.js",
77
"repository": "https://github.com/Sanshain/svelte-input-mask",
88
"scripts": {
99
"dev": "vite",
10-
"build": "vite build",
10+
"build": "rollup -c",
1111
"preview": "vite preview"
1212
},
1313
"keywords": [

src/PhoneMaskInput.svelte

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
* @param {InputEvent} event
1717
*/
1818
function onInput(event) {
19+
20+
// console.log(event);
21+
1922
2023
const formatHolder = (autoValue) => {
2124
let len = (autoValue || event.target.value).length;
@@ -30,7 +33,6 @@
3033
3134
if (~['insertText', 'insertFromPaste'].indexOf(event.inputType)) {
3235
33-
// console.log(event.inputType);
3436
let autoValue = validate(event.inputType, event);
3537
if (autoValue === false){
3638
event.target.value = value;
@@ -117,14 +119,15 @@
117119
</script>
118120

119121
<div class="container">
120-
<input type="text" on:input={onInput} bind:value>
122+
<input type="tel" on:input={onInput} bind:value>
121123
<div class="placeholder" style={`margin-left: ${holderOffset}px;`}>{holderValue}</div>
122124
<div class="mask" bind:this={shadowElement}>{value}</div>
123125
</div>
124126

125127
<style>
126128
*{
127-
font-family: Arial;
129+
font-family: Arial !important;
130+
font-size: medium !important;
128131
}
129132
.container{
130133
position: relative;
@@ -140,7 +143,7 @@
140143
top: 0.65em;
141144
left: 0.6em;
142145
pointer-events: none;
143-
color: gray;
146+
color: lightgrey;
144147
}
145148
.mask{
146149
visibility: hidden;

vite.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ import { svelte } from '@sveltejs/vite-plugin-svelte'
33

44
// https://vitejs.dev/config/
55
export default defineConfig({
6-
plugins: [svelte()]
6+
plugins: [svelte()],
7+
target: 'iife'
78
})

0 commit comments

Comments
 (0)