File tree Expand file tree Collapse file tree 4 files changed +15
-9
lines changed
Expand file tree Collapse file tree 4 files changed +15
-9
lines changed Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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" : [
Original file line number Diff line number Diff line change 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 ;
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;
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 ;
140143 top : 0.65em ;
141144 left : 0.6em ;
142145 pointer-events : none ;
143- color : gray ;
146+ color : lightgrey ;
144147 }
145148 .mask {
146149 visibility : hidden ;
Original file line number Diff line number Diff line change @@ -3,5 +3,6 @@ import { svelte } from '@sveltejs/vite-plugin-svelte'
33
44// https://vitejs.dev/config/
55export default defineConfig ( {
6- plugins : [ svelte ( ) ]
6+ plugins : [ svelte ( ) ] ,
7+ target : 'iife'
78} )
You can’t perform that action at this time.
0 commit comments