@deltablot/malle 2.5.0 → 2.5.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/README.md +9 -1
- package/dist/main.d.ts +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -23,6 +23,10 @@ The created input can be a normal input or a textarea.
|
|
|
23
23
|
|
|
24
24
|
The user provided function will typically POST to an endpoint to get some JSON back.
|
|
25
25
|
|
|
26
|
+
## Demo
|
|
27
|
+
|
|
28
|
+
Live demo: https://deltablot.github.io/malle/
|
|
29
|
+
|
|
26
30
|
## Installation
|
|
27
31
|
|
|
28
32
|
~~~bash
|
|
@@ -54,9 +58,13 @@ const malle = new Malle({
|
|
|
54
58
|
|
|
55
59
|
In this example, when a user clicks on an element with `data-malleable='true'`, the function in the `fun` option will be called. The element will be replaced by a `form` containing the `input` and optionally action buttons (Submit, Cancel).
|
|
56
60
|
|
|
61
|
+
Head to the [Demo](https://deltablot.github.io/malle/) to see more examples.
|
|
62
|
+
|
|
57
63
|
See the [Documentation](./DOCUMENTATION.md) for usage and available options.
|
|
58
64
|
|
|
59
|
-
|
|
65
|
+
## Maintenance status
|
|
66
|
+
|
|
67
|
+
`malle` is currently **MAINTAINED** and used in production environments.
|
|
60
68
|
|
|
61
69
|
## Contributing
|
|
62
70
|
|
package/dist/main.d.ts
CHANGED
|
@@ -42,11 +42,11 @@ export interface Options {
|
|
|
42
42
|
event?: EventType;
|
|
43
43
|
inputType?: InputType;
|
|
44
44
|
focus?: boolean;
|
|
45
|
-
fun(value: string, original: HTMLElement, event: Event, input: HTMLInputElement): Promise<string>;
|
|
45
|
+
fun(value: string, original: HTMLElement, event: Event, input: HTMLInputElement | HTMLSelectElement): Promise<string>;
|
|
46
46
|
listenNow?: boolean;
|
|
47
47
|
listenOn?: string;
|
|
48
48
|
onBlur?: Action;
|
|
49
|
-
onEdit?(original: HTMLElement, event: Event, input: HTMLInputElement): boolean;
|
|
49
|
+
onEdit?(original: HTMLElement, event: Event, input: HTMLInputElement | HTMLSelectElement): boolean;
|
|
50
50
|
onEnter?: Action;
|
|
51
51
|
onEscape?: Action;
|
|
52
52
|
placeholder?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deltablot/malle",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"description": "Make text elements malleable, without dependencies.",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"typings": "dist/main.d.ts",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"dist/*.d.ts"
|
|
15
15
|
],
|
|
16
16
|
"scripts": {
|
|
17
|
-
"build": "tsc",
|
|
17
|
+
"build": "tsc && cp -v dist/main.js demo/malle.js",
|
|
18
18
|
"lint": "eslint src",
|
|
19
19
|
"dev-server": "docker run --rm -it --name malle-dev -p 4813:80 -v $(pwd):/usr/share/nginx/html:ro -d nginx:stable-alpine",
|
|
20
20
|
"pre-commit": "npm run lint && npm run test",
|