mithril-materialized 1.1.4 → 1.1.6
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/dist/dropdown.d.ts +2 -2
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1 -1
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/input-options.d.ts +2 -0
- package/dist/option.d.ts +2 -2
- package/dist/radio.d.ts +3 -3
- package/dist/select.d.ts +2 -2
- package/dist/utils.d.ts +5 -5
- package/package.json +5 -5
package/dist/input-options.d.ts
CHANGED
|
@@ -35,6 +35,8 @@ export interface IInputOptions<T = string> extends Attributes {
|
|
|
35
35
|
onkeypress?: (ev: KeyboardEvent, value?: T) => void;
|
|
36
36
|
/** Key up event */
|
|
37
37
|
onkeyup?: (ev: KeyboardEvent, value?: T) => void;
|
|
38
|
+
/** Invoked when the element looses focus */
|
|
39
|
+
onblur?: (ev: FocusEvent) => void;
|
|
38
40
|
/** Invoked when the value changes. */
|
|
39
41
|
onchange?: (value: T) => void;
|
|
40
42
|
/** Add a a placeholder to the input field. */
|
package/dist/option.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Vnode, FactoryComponent, Attributes, Component } from 'mithril';
|
|
2
2
|
export interface IInputCheckbox extends Attributes {
|
|
3
3
|
/** Optional event handler when a checkbox is clicked */
|
|
4
4
|
onchange?: (checked: boolean) => void;
|
|
@@ -57,4 +57,4 @@ export interface IOptions<T extends string | number> extends Attributes {
|
|
|
57
57
|
disabled?: boolean;
|
|
58
58
|
}
|
|
59
59
|
/** A list of checkboxes */
|
|
60
|
-
export declare const Options: <T extends string | number>() =>
|
|
60
|
+
export declare const Options: <T extends string | number>() => Component<IOptions<T>>;
|
package/dist/radio.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Attributes, Component } from 'mithril';
|
|
2
2
|
import { IInputOption } from './option';
|
|
3
3
|
export interface IRadioButtons<T extends string | number> extends Attributes {
|
|
4
4
|
/** Element ID */
|
|
@@ -32,6 +32,6 @@ export interface IRadioButton<T extends string | number> extends Attributes {
|
|
|
32
32
|
groupId: string;
|
|
33
33
|
disabled?: boolean;
|
|
34
34
|
}
|
|
35
|
-
export declare const RadioButton: <T extends string | number>() =>
|
|
35
|
+
export declare const RadioButton: <T extends string | number>() => Component<IRadioButton<T>>;
|
|
36
36
|
/** Component to show a list of radio buttons, from which you can choose one. */
|
|
37
|
-
export declare const RadioButtons: <T extends string | number>() =>
|
|
37
|
+
export declare const RadioButtons: <T extends string | number>() => Component<IRadioButtons<T>>;
|
package/dist/select.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="materialize-css" />
|
|
2
|
-
import
|
|
2
|
+
import { Attributes, Component } from 'mithril';
|
|
3
3
|
import { IInputOption } from './option';
|
|
4
4
|
export interface ISelectOptions<T extends string | number> extends Attributes, Partial<M.FormSelectOptions> {
|
|
5
5
|
/** Options to select from */
|
|
@@ -44,4 +44,4 @@ export interface ISelectOptions<T extends string | number> extends Attributes, P
|
|
|
44
44
|
showClearButton?: boolean;
|
|
45
45
|
}
|
|
46
46
|
/** Component to select from a list of values in a dropdowns */
|
|
47
|
-
export declare const Select: <T extends string | number>() =>
|
|
47
|
+
export declare const Select: <T extends string | number>() => Component<ISelectOptions<T>>;
|
package/dist/utils.d.ts
CHANGED
|
@@ -25,21 +25,21 @@ export declare const camelToSnake: (cc: string) => string;
|
|
|
25
25
|
/** Convert an object to a string of HTML attributes */
|
|
26
26
|
export declare const toAttributeString: <T extends {
|
|
27
27
|
[key: string]: any;
|
|
28
|
-
}>(x?: T
|
|
28
|
+
}>(x?: T) => "" | T;
|
|
29
29
|
/** Add the disabled attribute when required */
|
|
30
30
|
export declare const disable: ({ disabled }: {
|
|
31
|
-
disabled?: boolean
|
|
31
|
+
disabled?: boolean;
|
|
32
32
|
}) => "" | "[disabled]";
|
|
33
33
|
/** Add the required and aria-required attribute when required */
|
|
34
34
|
export declare const req: ({ required, isMandatory }: {
|
|
35
|
-
required?: boolean
|
|
36
|
-
isMandatory?: boolean
|
|
35
|
+
required?: boolean;
|
|
36
|
+
isMandatory?: boolean;
|
|
37
37
|
}) => "" | "[required][aria-required=true]";
|
|
38
38
|
/** Convert input options to a set of input attributes */
|
|
39
39
|
export declare const toAttrs: <T>(o: IInputOptions<T>) => string;
|
|
40
40
|
/** Check if a string or number is numeric. @see https://stackoverflow.com/a/9716488/319711 */
|
|
41
41
|
export declare const isNumeric: (n: string | number) => boolean;
|
|
42
|
-
export declare const pipe: (...fncs: (
|
|
42
|
+
export declare const pipe: (...fncs: Array<(x: any) => any>) => <T>(x: T) => T;
|
|
43
43
|
/**
|
|
44
44
|
* Pad left, default width 2 with a '0'
|
|
45
45
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mithril-materialized",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "A materialize library for mithril.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"@types/mithril": "^2.2.6",
|
|
43
43
|
"js-yaml": "^4.1.0",
|
|
44
44
|
"microbundle": "^0.15.1",
|
|
45
|
-
"rimraf": "^5.0.
|
|
46
|
-
"tslib": "^2.6.
|
|
47
|
-
"typedoc": "^0.25.
|
|
48
|
-
"typescript": "^5.
|
|
45
|
+
"rimraf": "^5.0.7",
|
|
46
|
+
"tslib": "^2.6.3",
|
|
47
|
+
"typedoc": "^0.25.13",
|
|
48
|
+
"typescript": "^5.4.5"
|
|
49
49
|
}
|
|
50
50
|
}
|