2
0
mirror of https://github.com/tenrok/maska.git synced 2026-05-30 15:24:06 +03:00
Commit Graph

74 Commits

Author SHA1 Message Date
Alexander Shabunevich 9b454e996a refactor: move to single package 2024-06-02 16:49:41 +03:00
Alexander Shabunevich 4de44ef888 feat!: separate packages 2024-04-17 19:31:22 +03:00
Alexander Shabunevich 685f477fe1 style: code format 2024-04-14 14:13:15 +03:00
Alexander Shabunevich bdcdecc301 chore: move docs demo app to root folder 2024-04-14 12:54:18 +03:00
Alexander Shabunevich 88d92b2753 fix: change event abort to manual event removing
Because happy-dom can't handle event abortion and test do not passing
2024-04-14 12:54:18 +03:00
Alexander Shabunevich 04bd6b249c fix: correct binding.value check in vue directive 2024-04-14 12:54:18 +03:00
Alexander Shabunevich 9257950422 chore: rename mask-input.ts to input.ts 2024-04-14 12:09:36 +03:00
Alexander Shabunevich f01cacb046 style: code format 2024-04-11 22:13:16 +03:00
Alexander Shabunevich 9943a17fd1 style: code format 2024-04-11 21:37:42 +03:00
Alexander Shabunevich e01e66a7c9 chore: rename directive.js to vue.js 2024-04-11 21:32:15 +03:00
Alexander Shabunevich 7159eb3460 chore: fix lint warnings 2024-04-11 21:30:28 +03:00
Alexander Shabunevich 7273dc73a4 feat: console warning on non-supported input type 2024-04-11 21:22:42 +03:00
Alexander Shabunevich 1e50a2a259 refactor: MaskInput rework
- abort controller for events
- refactor onInput
- remove beforeinputEvent
- new cursor position fix
2024-04-09 21:24:41 +03:00
Alexander Shabunevich 150ee77c48 fix: rework updating value 2024-04-06 11:59:33 +03:00
Alexander Shabunevich 81a748e891 style: code format 2024-04-06 10:17:11 +03:00
Alexander Shabunevich ce1243abcd fix!: change eager mask behavior
Now eager mask take into account a hardcoded symbols
2024-04-06 10:13:31 +03:00
Alexander Shabunevich 00f7caede8 fix: check input value on every update
For better handling value change without directive, like vanilla case
2024-03-30 15:08:44 +03:00
Alexander Shabunevich 816c49c466 style: code formating 2024-03-30 15:07:31 +03:00
Alexander Shabunevich cd1e9f3564 feat!: rework for v3
- new directive format: pass options as value, bound as argument with modifiers
- update and checkValue methods in MaskInput
2024-03-30 12:39:22 +03:00
Ilya Semenov a38e8a2512 Replace "binded" with "bound" 2024-02-13 13:56:56 +07:00
Andre Asselin 222f2df70a Fix #183 Multiple modifier breaks other custom tokens
When a token with multiple:true does not match the next character, we need to determine if it matched any previous characters or not.
If it hasn't matched any characters yet, then we skip the invalid input character and remain on the same token.
If it has matched 1 or more input characters, then we advance to the next token, but stay on the same input character.

The old code had several issues with this.  I replaced it with a simple flag (multipleMatched) that is set to true whenever a token with multiple==true matches an input character, and can then be tested when a token with multiple==true doesn't match an input character.
2024-01-09 18:27:18 -05:00
Ilya Machnev 7ad5792858 Update directive.ts 2023-08-01 10:49:55 +08:00
Ilya Machnev c8998d6bf5 Return if input type equals file
Direcitve doesnt work on inputs with type set to 'file', it throws error when value changes
2023-08-01 10:45:01 +08:00
Alexander Shabunevich f73c21b5fa Revert "allow custom escape character"
This reverts commit e078efd695.
2023-04-21 14:27:47 +03:00
Dan Wilson e078efd695 allow custom escape character 2023-04-18 14:00:50 -06:00
Alexander Shabunevich c12b5c3840 Code format 2023-04-10 22:26:11 +03:00
Dan Wilson f0e638c804 avoid re-rendering input and therefore entering infinite update loop 2023-04-04 16:32:40 -06:00
Alexander Shabunevich 359f446d72 Make directive change async for correct eager mode
Fix #133 where eager mask used with v-model
2023-02-11 16:12:15 +03:00
Alexander Shabunevich df99482c70 Rename needUpdate method to needUpdateOptions 2023-02-11 16:04:57 +03:00
Alexander Shabunevich 056b6fb855 Fix eager mask bug #128 2023-01-29 16:59:24 +03:00
Alexander Shabunevich ea47223566 Fix bug with onMaska detail payload 2023-01-29 16:27:58 +03:00
Alexander Shabunevich e30084d232 Demo of money format simplified 2023-01-23 15:59:52 +03:00
Alexander Shabunevich 80b41d9d29 Demo styles fixes 2023-01-21 12:30:47 +03:00
Alexander Shabunevich f06bbf529a Demo updated: add example with number format 2023-01-21 12:30:36 +03:00
Alexander Shabunevich b97c7c3165 Fix bug with hooks order 2023-01-21 12:29:09 +03:00
Alexander Shabunevich 4300883a93 Code format 2023-01-21 00:25:31 +03:00
Alexander Shabunevich 6135d0a193 Fix setSelectionRange error for inputs of some types 2023-01-12 23:55:43 +03:00
Alexander Shabunevich 95384f90c6 Fix #115 2022-12-30 12:13:30 +03:00
Alexander Shabunevich 3b44a9b4a9 Update masked input on binded value change 2022-12-24 17:49:08 +03:00
Alexander Shabunevich dee541684b Add example with simple money format 2022-12-16 17:56:02 +03:00
Alexander Shabunevich 41fb72b87c Fix of the input event 2022-12-09 22:40:51 +03:00
Alexander Shabunevich 289fc8ff43 Optimize directive work 2022-12-09 13:32:46 +03:00
Alexander Shabunevich 21a088f7d2 Trigger InputEvent for support v-model update 2022-12-09 13:31:17 +03:00
Alexander Shabunevich 32bbbcf3da Parse input opts logic moved from MaskInput 2022-12-09 13:29:41 +03:00
Alexander Shabunevich 547f1711e8 Refactor Mask options
Allow to pass null mask for disable masking
2022-12-09 11:54:20 +03:00
Alexander Shabunevich 57f4f44959 Callback onMaska now can accept array
To make it possible use callback with binded value
2022-12-07 11:41:59 +03:00
Alexander Shabunevich 454dddd4dd Directive could be applied to parent of input element 2022-12-07 11:41:59 +03:00
Alexander Shabunevich bccd75ab09 Delete triple slash directive 2022-12-07 11:41:59 +03:00
Alexander Shabunevich 31c286bb6b New version code prepare 2022-12-04 17:05:23 +03:00
Yury Mamedov 0cf4d7c7b8 #51 Added test,
switched jest env to jsdom,
lint fixed
2021-11-10 01:28:55 +03:00