mithril-materialized 1.0.1 → 1.1.0
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/autocomplete.d.ts +7 -7
- package/dist/button.d.ts +40 -40
- package/dist/carousel.d.ts +18 -18
- package/dist/chip.d.ts +11 -11
- package/dist/code-block.d.ts +9 -9
- package/dist/collapsible.d.ts +22 -22
- package/dist/collection.d.ts +49 -49
- package/dist/dropdown.d.ts +46 -46
- package/dist/floating-action-button.d.ts +34 -34
- package/dist/icon.d.ts +11 -11
- package/dist/index.d.ts +26 -26
- 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 +81 -81
- package/dist/input.d.ts +42 -42
- package/dist/label.d.ts +22 -22
- package/dist/map-editor.d.ts +63 -63
- package/dist/material-box.d.ts +21 -21
- package/dist/modal.d.ts +26 -26
- package/dist/option.d.ts +56 -52
- package/dist/pagination.d.ts +20 -20
- package/dist/parallax.d.ts +13 -13
- package/dist/pickers.d.ts +8 -8
- package/dist/radio.d.ts +37 -37
- package/dist/select.d.ts +47 -45
- package/dist/switch.d.ts +13 -13
- package/dist/tabs.d.ts +45 -45
- package/dist/timeline.d.ts +24 -24
- package/dist/utils.d.ts +70 -70
- package/package.json +8 -8
package/dist/input-options.d.ts
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
import { Attributes } from 'mithril';
|
|
2
|
-
export interface IInputOptions<T = string> extends Attributes {
|
|
3
|
-
/** Optional label. */
|
|
4
|
-
label?: string;
|
|
5
|
-
/** Optional ID. */
|
|
6
|
-
id?: string;
|
|
7
|
-
/** Unique key for use of the element in an array. */
|
|
8
|
-
key?: string | number;
|
|
9
|
-
/** Initial value of the input field. */
|
|
10
|
-
initialValue?: T;
|
|
11
|
-
/**
|
|
12
|
-
* The autocomplete property sets or returns the value of the autocomplete
|
|
13
|
-
* attribute in a text field. When autocomplete is on, the browser automatically
|
|
14
|
-
* complete values based on values that the user has entered before.
|
|
15
|
-
* @default 'on'
|
|
16
|
-
*/
|
|
17
|
-
autocomplete?: 'on' | 'off';
|
|
18
|
-
/**
|
|
19
|
-
* The pattern property sets or returns the value of the pattern attribute of
|
|
20
|
-
* a text field. The pattern attribute specifies a regular expression that the
|
|
21
|
-
* text field's value is checked against.
|
|
22
|
-
*/
|
|
23
|
-
pattern?: RegExp;
|
|
24
|
-
/**
|
|
25
|
-
* The readOnly property sets or returns whether a text field is read-only, or not.
|
|
26
|
-
* A read-only field cannot be modified. However, a user can tab to it, highlight it,
|
|
27
|
-
* and copy the text from it.
|
|
28
|
-
*/
|
|
29
|
-
readOnly?: boolean;
|
|
30
|
-
/** When true, add the autofocus attribute to the input field. */
|
|
31
|
-
autofocus?: (() => boolean) | boolean;
|
|
32
|
-
/** Key down event */
|
|
33
|
-
onkeydown?: (ev: KeyboardEvent, value?: T) => void;
|
|
34
|
-
/** Key press event */
|
|
35
|
-
onkeypress?: (ev: KeyboardEvent, value?: T) => void;
|
|
36
|
-
/** Key up event */
|
|
37
|
-
onkeyup?: (ev: KeyboardEvent, value?: T) => void;
|
|
38
|
-
/** Invoked when the value changes. */
|
|
39
|
-
onchange?: (value: T) => void;
|
|
40
|
-
/** Add a a placeholder to the input field. */
|
|
41
|
-
placeholder?: string;
|
|
42
|
-
/** Add a description underneath the input field. */
|
|
43
|
-
helperText?: string;
|
|
44
|
-
/**
|
|
45
|
-
* When returning true or an empty string, clear the custom validity (= valid).
|
|
46
|
-
* When returning false, set the custom validity message to a default string string.
|
|
47
|
-
* When returning a non-empty string, set the custom validity message to this string.
|
|
48
|
-
*/
|
|
49
|
-
validate?: (v: T, target?: HTMLInputElement) => boolean | string;
|
|
50
|
-
/** Will replace the helperText, if any, when the input is invalid. */
|
|
51
|
-
dataError?: string;
|
|
52
|
-
/** Will replace the helperText, if any, when the input is valid. */
|
|
53
|
-
dataSuccess?: string;
|
|
54
|
-
/** Uses Materialize icons as a prefix or postfix. */
|
|
55
|
-
iconName?: string;
|
|
56
|
-
/** Sets the input field to disabled. */
|
|
57
|
-
disabled?: boolean;
|
|
58
|
-
/** Optional style information. */
|
|
59
|
-
style?: string;
|
|
60
|
-
/** When input type is a number, optionally specify the minimum value. */
|
|
61
|
-
min?: number;
|
|
62
|
-
/** When input type is a number, optionally specify the maximum value. */
|
|
63
|
-
max?: number;
|
|
64
|
-
/** When input type is a text or text area, optionally specify the minimum length. */
|
|
65
|
-
minLength?: number;
|
|
66
|
-
/** When input type is a text or text area, optionally specify the maximum length. */
|
|
67
|
-
maxLength?: number;
|
|
68
|
-
/** Number of rows of a textarea */
|
|
69
|
-
rows?: number;
|
|
70
|
-
/** Number of cols of a textarea */
|
|
71
|
-
cols?: number;
|
|
72
|
-
/** If true, break to a new row */
|
|
73
|
-
newRow?: boolean;
|
|
74
|
-
/**
|
|
75
|
-
* If true, add a mandatory * after the label (if any),
|
|
76
|
-
* and add the required and aria-required attributes to the input element.
|
|
77
|
-
*/
|
|
78
|
-
isMandatory?: boolean;
|
|
79
|
-
/** Add the required and aria-required attributes to the input element */
|
|
80
|
-
required?: boolean;
|
|
81
|
-
}
|
|
1
|
+
import { Attributes } from 'mithril';
|
|
2
|
+
export interface IInputOptions<T = string> extends Attributes {
|
|
3
|
+
/** Optional label. */
|
|
4
|
+
label?: string;
|
|
5
|
+
/** Optional ID. */
|
|
6
|
+
id?: string;
|
|
7
|
+
/** Unique key for use of the element in an array. */
|
|
8
|
+
key?: string | number;
|
|
9
|
+
/** Initial value of the input field. */
|
|
10
|
+
initialValue?: T;
|
|
11
|
+
/**
|
|
12
|
+
* The autocomplete property sets or returns the value of the autocomplete
|
|
13
|
+
* attribute in a text field. When autocomplete is on, the browser automatically
|
|
14
|
+
* complete values based on values that the user has entered before.
|
|
15
|
+
* @default 'on'
|
|
16
|
+
*/
|
|
17
|
+
autocomplete?: 'on' | 'off';
|
|
18
|
+
/**
|
|
19
|
+
* The pattern property sets or returns the value of the pattern attribute of
|
|
20
|
+
* a text field. The pattern attribute specifies a regular expression that the
|
|
21
|
+
* text field's value is checked against.
|
|
22
|
+
*/
|
|
23
|
+
pattern?: RegExp;
|
|
24
|
+
/**
|
|
25
|
+
* The readOnly property sets or returns whether a text field is read-only, or not.
|
|
26
|
+
* A read-only field cannot be modified. However, a user can tab to it, highlight it,
|
|
27
|
+
* and copy the text from it.
|
|
28
|
+
*/
|
|
29
|
+
readOnly?: boolean;
|
|
30
|
+
/** When true, add the autofocus attribute to the input field. */
|
|
31
|
+
autofocus?: (() => boolean) | boolean;
|
|
32
|
+
/** Key down event */
|
|
33
|
+
onkeydown?: (ev: KeyboardEvent, value?: T) => void;
|
|
34
|
+
/** Key press event */
|
|
35
|
+
onkeypress?: (ev: KeyboardEvent, value?: T) => void;
|
|
36
|
+
/** Key up event */
|
|
37
|
+
onkeyup?: (ev: KeyboardEvent, value?: T) => void;
|
|
38
|
+
/** Invoked when the value changes. */
|
|
39
|
+
onchange?: (value: T) => void;
|
|
40
|
+
/** Add a a placeholder to the input field. */
|
|
41
|
+
placeholder?: string;
|
|
42
|
+
/** Add a description underneath the input field. */
|
|
43
|
+
helperText?: string;
|
|
44
|
+
/**
|
|
45
|
+
* When returning true or an empty string, clear the custom validity (= valid).
|
|
46
|
+
* When returning false, set the custom validity message to a default string string.
|
|
47
|
+
* When returning a non-empty string, set the custom validity message to this string.
|
|
48
|
+
*/
|
|
49
|
+
validate?: (v: T, target?: HTMLInputElement) => boolean | string;
|
|
50
|
+
/** Will replace the helperText, if any, when the input is invalid. */
|
|
51
|
+
dataError?: string;
|
|
52
|
+
/** Will replace the helperText, if any, when the input is valid. */
|
|
53
|
+
dataSuccess?: string;
|
|
54
|
+
/** Uses Materialize icons as a prefix or postfix. */
|
|
55
|
+
iconName?: string;
|
|
56
|
+
/** Sets the input field to disabled. */
|
|
57
|
+
disabled?: boolean;
|
|
58
|
+
/** Optional style information. */
|
|
59
|
+
style?: string;
|
|
60
|
+
/** When input type is a number, optionally specify the minimum value. */
|
|
61
|
+
min?: number;
|
|
62
|
+
/** When input type is a number, optionally specify the maximum value. */
|
|
63
|
+
max?: number;
|
|
64
|
+
/** When input type is a text or text area, optionally specify the minimum length. */
|
|
65
|
+
minLength?: number;
|
|
66
|
+
/** When input type is a text or text area, optionally specify the maximum length. */
|
|
67
|
+
maxLength?: number;
|
|
68
|
+
/** Number of rows of a textarea */
|
|
69
|
+
rows?: number;
|
|
70
|
+
/** Number of cols of a textarea */
|
|
71
|
+
cols?: number;
|
|
72
|
+
/** If true, break to a new row */
|
|
73
|
+
newRow?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* If true, add a mandatory * after the label (if any),
|
|
76
|
+
* and add the required and aria-required attributes to the input element.
|
|
77
|
+
*/
|
|
78
|
+
isMandatory?: boolean;
|
|
79
|
+
/** Add the required and aria-required attributes to the input element */
|
|
80
|
+
required?: boolean;
|
|
81
|
+
}
|
package/dist/input.d.ts
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import m, { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
-
import { IInputOptions } from './input-options';
|
|
3
|
-
import './styles/input.css';
|
|
4
|
-
/** Create a TextArea */
|
|
5
|
-
export declare const TextArea: FactoryComponent<IInputOptions<string>>;
|
|
6
|
-
export
|
|
7
|
-
/** Component for entering some text */
|
|
8
|
-
export declare const TextInput: m.FactoryComponent<IInputOptions<string>>;
|
|
9
|
-
/** Component for entering a password */
|
|
10
|
-
export declare const PasswordInput: m.FactoryComponent<IInputOptions<string>>;
|
|
11
|
-
/** Component for entering a number */
|
|
12
|
-
export declare const NumberInput: m.FactoryComponent<IInputOptions<number>>;
|
|
13
|
-
/** Component for entering a URL */
|
|
14
|
-
export declare const UrlInput: m.FactoryComponent<IInputOptions<string>>;
|
|
15
|
-
/** Component for entering a color */
|
|
16
|
-
export declare const ColorInput: m.FactoryComponent<IInputOptions<string>>;
|
|
17
|
-
/** Component for entering a range */
|
|
18
|
-
export declare const RangeInput: m.FactoryComponent<IInputOptions<number>>;
|
|
19
|
-
/** Component for entering an email */
|
|
20
|
-
export declare const EmailInput: m.FactoryComponent<IInputOptions<string>>;
|
|
21
|
-
export interface IFileInputOptions extends Attributes {
|
|
22
|
-
/** Displayed on the button, @default File */
|
|
23
|
-
label?: string;
|
|
24
|
-
/** Current value of the file input, write only */
|
|
25
|
-
initialValue?: string;
|
|
26
|
-
/** Adds a placeholder message */
|
|
27
|
-
placeholder?: string;
|
|
28
|
-
/** If true, upload multiple files */
|
|
29
|
-
multiple?: boolean;
|
|
30
|
-
/** Called when the file input is changed */
|
|
31
|
-
onchange?: (files: FileList) => void;
|
|
32
|
-
/** If true, disable the box */
|
|
33
|
-
disabled?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Accepted file types, e.g. image/png, image/jpeg,
|
|
36
|
-
* any image/*, video/*. audio/*, .pdf, a valid MIME type string, with no extensions, etc.
|
|
37
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers
|
|
38
|
-
*/
|
|
39
|
-
accept?: string | string[];
|
|
40
|
-
}
|
|
41
|
-
/** Component for uploading a file */
|
|
42
|
-
export declare const FileInput: FactoryComponent<IFileInputOptions>;
|
|
1
|
+
import m, { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
+
import { IInputOptions } from './input-options';
|
|
3
|
+
import './styles/input.css';
|
|
4
|
+
/** Create a TextArea */
|
|
5
|
+
export declare const TextArea: FactoryComponent<IInputOptions<string>>;
|
|
6
|
+
export type InputType = 'url' | 'color' | 'text' | 'number' | 'email' | 'range' | 'password';
|
|
7
|
+
/** Component for entering some text */
|
|
8
|
+
export declare const TextInput: m.FactoryComponent<IInputOptions<string>>;
|
|
9
|
+
/** Component for entering a password */
|
|
10
|
+
export declare const PasswordInput: m.FactoryComponent<IInputOptions<string>>;
|
|
11
|
+
/** Component for entering a number */
|
|
12
|
+
export declare const NumberInput: m.FactoryComponent<IInputOptions<number>>;
|
|
13
|
+
/** Component for entering a URL */
|
|
14
|
+
export declare const UrlInput: m.FactoryComponent<IInputOptions<string>>;
|
|
15
|
+
/** Component for entering a color */
|
|
16
|
+
export declare const ColorInput: m.FactoryComponent<IInputOptions<string>>;
|
|
17
|
+
/** Component for entering a range */
|
|
18
|
+
export declare const RangeInput: m.FactoryComponent<IInputOptions<number>>;
|
|
19
|
+
/** Component for entering an email */
|
|
20
|
+
export declare const EmailInput: m.FactoryComponent<IInputOptions<string>>;
|
|
21
|
+
export interface IFileInputOptions extends Attributes {
|
|
22
|
+
/** Displayed on the button, @default File */
|
|
23
|
+
label?: string;
|
|
24
|
+
/** Current value of the file input, write only */
|
|
25
|
+
initialValue?: string;
|
|
26
|
+
/** Adds a placeholder message */
|
|
27
|
+
placeholder?: string;
|
|
28
|
+
/** If true, upload multiple files */
|
|
29
|
+
multiple?: boolean;
|
|
30
|
+
/** Called when the file input is changed */
|
|
31
|
+
onchange?: (files: FileList) => void;
|
|
32
|
+
/** If true, disable the box */
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Accepted file types, e.g. image/png, image/jpeg,
|
|
36
|
+
* any image/*, video/*. audio/*, .pdf, a valid MIME type string, with no extensions, etc.
|
|
37
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers
|
|
38
|
+
*/
|
|
39
|
+
accept?: string | string[];
|
|
40
|
+
}
|
|
41
|
+
/** Component for uploading a file */
|
|
42
|
+
export declare const FileInput: FactoryComponent<IFileInputOptions>;
|
package/dist/label.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { FactoryComponent, Component, Attributes } from 'mithril';
|
|
2
|
-
import './styles/input.css';
|
|
3
|
-
export declare const Mandatory: Component;
|
|
4
|
-
export interface IMaterialLabel extends Attributes {
|
|
5
|
-
/** Optional title/label */
|
|
6
|
-
label?: string;
|
|
7
|
-
/** Optional ID */
|
|
8
|
-
id?: string;
|
|
9
|
-
/** If true, add a mandatory '*' after the label */
|
|
10
|
-
isMandatory?: boolean;
|
|
11
|
-
/** Add the active class to the label */
|
|
12
|
-
isActive?: boolean | string;
|
|
13
|
-
}
|
|
14
|
-
/** Simple label element, used for most components. */
|
|
15
|
-
export declare const Label: FactoryComponent<IMaterialLabel>;
|
|
16
|
-
export interface IHelperTextOptions extends Attributes {
|
|
17
|
-
helperText?: string;
|
|
18
|
-
dataError?: string;
|
|
19
|
-
dataSuccess?: string;
|
|
20
|
-
}
|
|
21
|
-
/** Create a helper text, often used for displaying a small help text. May be replaced by the validation message. */
|
|
22
|
-
export declare const HelperText: FactoryComponent<IHelperTextOptions>;
|
|
1
|
+
import { FactoryComponent, Component, Attributes } from 'mithril';
|
|
2
|
+
import './styles/input.css';
|
|
3
|
+
export declare const Mandatory: Component;
|
|
4
|
+
export interface IMaterialLabel extends Attributes {
|
|
5
|
+
/** Optional title/label */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Optional ID */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** If true, add a mandatory '*' after the label */
|
|
10
|
+
isMandatory?: boolean;
|
|
11
|
+
/** Add the active class to the label */
|
|
12
|
+
isActive?: boolean | string;
|
|
13
|
+
}
|
|
14
|
+
/** Simple label element, used for most components. */
|
|
15
|
+
export declare const Label: FactoryComponent<IMaterialLabel>;
|
|
16
|
+
export interface IHelperTextOptions extends Attributes {
|
|
17
|
+
helperText?: string;
|
|
18
|
+
dataError?: string;
|
|
19
|
+
dataSuccess?: string;
|
|
20
|
+
}
|
|
21
|
+
/** Create a helper text, often used for displaying a small help text. May be replaced by the validation message. */
|
|
22
|
+
export declare const HelperText: FactoryComponent<IHelperTextOptions>;
|
package/dist/map-editor.d.ts
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
-
import './styles/map-editor.css';
|
|
3
|
-
import { ICollectionItem } from './collection';
|
|
4
|
-
export interface IMapEditor extends Attributes {
|
|
5
|
-
/** Optional ID of the element */
|
|
6
|
-
id?: string;
|
|
7
|
-
/** If true, displays a header over the map */
|
|
8
|
-
header?: string;
|
|
9
|
-
/** Instead of a header, use a label */
|
|
10
|
-
label?: string;
|
|
11
|
-
/** Places a required * after the label */
|
|
12
|
-
isMandatory?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Optional value for the key label
|
|
15
|
-
* @default: "Key"
|
|
16
|
-
*/
|
|
17
|
-
labelKey?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Optional value for the value label
|
|
20
|
-
* @default: "Value"
|
|
21
|
-
*/
|
|
22
|
-
labelValue?: string;
|
|
23
|
-
/** If true, the item cannot be edited */
|
|
24
|
-
disabled?: boolean;
|
|
25
|
-
/** Icon for the properties' collection */
|
|
26
|
-
iconName?: string;
|
|
27
|
-
/** Icon for the key editor: if none provided, and the iconName is set, uses 'label' */
|
|
28
|
-
iconNameKey?: string;
|
|
29
|
-
/** If true, do not parse arrays like [1, 2, 3] into number[] or [a, b, c] into a string[] */
|
|
30
|
-
disallowArrays?: boolean;
|
|
31
|
-
/** The actual map of key-value pairs supports numbers, strings, booleans and arrays of strings and numbers. */
|
|
32
|
-
properties: {
|
|
33
|
-
[key: string]: number | string | boolean | Array<string | number>;
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* Called when the properties collection has changed. Not needed if you are performing a direct edit on the
|
|
37
|
-
* properties object, but in case you have created a mapping, this allows you to convert the object back again.
|
|
38
|
-
*/
|
|
39
|
-
onchange?: (properties: {
|
|
40
|
-
[key: string]: number | string | boolean | Array<string | number>;
|
|
41
|
-
}) => void;
|
|
42
|
-
/**
|
|
43
|
-
* In order to create a boolean, you first have to enter a truthy or falsy value.
|
|
44
|
-
* Default 'true' and 'false', but you can add more options.
|
|
45
|
-
*/
|
|
46
|
-
truthy?: string[];
|
|
47
|
-
/**
|
|
48
|
-
* In order to create a boolean, you first have to enter a truthy or falsy value.
|
|
49
|
-
* Default 'true' and 'false', but you can add more options.
|
|
50
|
-
*/
|
|
51
|
-
falsy?: string[];
|
|
52
|
-
/**
|
|
53
|
-
* Optional function to replace the render function of a key-value pair.
|
|
54
|
-
* The ICollectionItems's title may be a Vnode.
|
|
55
|
-
*/
|
|
56
|
-
keyValueConverter?: (key: string, value: number | string | boolean | Array<string | number>) => ICollectionItem;
|
|
57
|
-
/** Optional class to apply to the key column, @default .col.s4 */
|
|
58
|
-
keyClass?: string;
|
|
59
|
-
/** Optional class to apply to the value column, @default .col.s8 */
|
|
60
|
-
valueClass?: string;
|
|
61
|
-
}
|
|
62
|
-
/** A simple viewer and/or editor for a map of key - value pairs */
|
|
63
|
-
export declare const MapEditor: FactoryComponent<IMapEditor>;
|
|
1
|
+
import { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
+
import './styles/map-editor.css';
|
|
3
|
+
import { ICollectionItem } from './collection';
|
|
4
|
+
export interface IMapEditor extends Attributes {
|
|
5
|
+
/** Optional ID of the element */
|
|
6
|
+
id?: string;
|
|
7
|
+
/** If true, displays a header over the map */
|
|
8
|
+
header?: string;
|
|
9
|
+
/** Instead of a header, use a label */
|
|
10
|
+
label?: string;
|
|
11
|
+
/** Places a required * after the label */
|
|
12
|
+
isMandatory?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Optional value for the key label
|
|
15
|
+
* @default: "Key"
|
|
16
|
+
*/
|
|
17
|
+
labelKey?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Optional value for the value label
|
|
20
|
+
* @default: "Value"
|
|
21
|
+
*/
|
|
22
|
+
labelValue?: string;
|
|
23
|
+
/** If true, the item cannot be edited */
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/** Icon for the properties' collection */
|
|
26
|
+
iconName?: string;
|
|
27
|
+
/** Icon for the key editor: if none provided, and the iconName is set, uses 'label' */
|
|
28
|
+
iconNameKey?: string;
|
|
29
|
+
/** If true, do not parse arrays like [1, 2, 3] into number[] or [a, b, c] into a string[] */
|
|
30
|
+
disallowArrays?: boolean;
|
|
31
|
+
/** The actual map of key-value pairs supports numbers, strings, booleans and arrays of strings and numbers. */
|
|
32
|
+
properties: {
|
|
33
|
+
[key: string]: number | string | boolean | Array<string | number>;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Called when the properties collection has changed. Not needed if you are performing a direct edit on the
|
|
37
|
+
* properties object, but in case you have created a mapping, this allows you to convert the object back again.
|
|
38
|
+
*/
|
|
39
|
+
onchange?: (properties: {
|
|
40
|
+
[key: string]: number | string | boolean | Array<string | number>;
|
|
41
|
+
}) => void;
|
|
42
|
+
/**
|
|
43
|
+
* In order to create a boolean, you first have to enter a truthy or falsy value.
|
|
44
|
+
* Default 'true' and 'false', but you can add more options.
|
|
45
|
+
*/
|
|
46
|
+
truthy?: string[];
|
|
47
|
+
/**
|
|
48
|
+
* In order to create a boolean, you first have to enter a truthy or falsy value.
|
|
49
|
+
* Default 'true' and 'false', but you can add more options.
|
|
50
|
+
*/
|
|
51
|
+
falsy?: string[];
|
|
52
|
+
/**
|
|
53
|
+
* Optional function to replace the render function of a key-value pair.
|
|
54
|
+
* The ICollectionItems's title may be a Vnode.
|
|
55
|
+
*/
|
|
56
|
+
keyValueConverter?: (key: string, value: number | string | boolean | Array<string | number>) => ICollectionItem;
|
|
57
|
+
/** Optional class to apply to the key column, @default .col.s4 */
|
|
58
|
+
keyClass?: string;
|
|
59
|
+
/** Optional class to apply to the value column, @default .col.s8 */
|
|
60
|
+
valueClass?: string;
|
|
61
|
+
}
|
|
62
|
+
/** A simple viewer and/or editor for a map of key - value pairs */
|
|
63
|
+
export declare const MapEditor: FactoryComponent<IMapEditor>;
|
package/dist/material-box.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
/// <reference types="materialize-css" />
|
|
2
|
-
import { FactoryComponent, Attributes } from 'mithril';
|
|
3
|
-
export interface IMaterialBox extends Partial<M.MaterialboxOptions>, Attributes {
|
|
4
|
-
/** Source image path */
|
|
5
|
-
src: string;
|
|
6
|
-
/**
|
|
7
|
-
* Width of the image
|
|
8
|
-
* @default undefined
|
|
9
|
-
*/
|
|
10
|
-
width?: number;
|
|
11
|
-
/**
|
|
12
|
-
* Height of the image
|
|
13
|
-
* @default undefined
|
|
14
|
-
*/
|
|
15
|
-
height?: number;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Create an image box, that, when clicked upon, fills the screen.
|
|
19
|
-
* @see https://materializecss.com/media.html
|
|
20
|
-
*/
|
|
21
|
-
export declare const MaterialBox: FactoryComponent<IMaterialBox>;
|
|
1
|
+
/// <reference types="materialize-css" />
|
|
2
|
+
import { FactoryComponent, Attributes } from 'mithril';
|
|
3
|
+
export interface IMaterialBox extends Partial<M.MaterialboxOptions>, Attributes {
|
|
4
|
+
/** Source image path */
|
|
5
|
+
src: string;
|
|
6
|
+
/**
|
|
7
|
+
* Width of the image
|
|
8
|
+
* @default undefined
|
|
9
|
+
*/
|
|
10
|
+
width?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Height of the image
|
|
13
|
+
* @default undefined
|
|
14
|
+
*/
|
|
15
|
+
height?: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create an image box, that, when clicked upon, fills the screen.
|
|
19
|
+
* @see https://materializecss.com/media.html
|
|
20
|
+
*/
|
|
21
|
+
export declare const MaterialBox: FactoryComponent<IMaterialBox>;
|
package/dist/modal.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
/// <reference types="materialize-css" />
|
|
2
|
-
import { FactoryComponent, Vnode, Attributes } from 'mithril';
|
|
3
|
-
export interface IMaterialModal extends Attributes {
|
|
4
|
-
id: string;
|
|
5
|
-
title: string;
|
|
6
|
-
description?: string | Vnode<any, any>;
|
|
7
|
-
/** Set to true when the description contains HTML */
|
|
8
|
-
richContent?: boolean;
|
|
9
|
-
/** Fixate the footer, so you can show more content. */
|
|
10
|
-
fixedFooter?: boolean;
|
|
11
|
-
/** Display on the bottom */
|
|
12
|
-
bottomSheet?: boolean;
|
|
13
|
-
/** Materialize css' modal options */
|
|
14
|
-
options?: Partial<M.ModalOptions>;
|
|
15
|
-
/** Menu buttons, from left to right */
|
|
16
|
-
buttons?: Array<{
|
|
17
|
-
label: string;
|
|
18
|
-
iconName?: string;
|
|
19
|
-
disabled?: boolean;
|
|
20
|
-
onclick?: (e: UIEvent) => void;
|
|
21
|
-
}>;
|
|
22
|
-
/** Get the modal instance, so you can control it programmatically */
|
|
23
|
-
onCreate?: (modal: M.Modal) => void;
|
|
24
|
-
}
|
|
25
|
-
/** Builds a modal panel, which can be triggered using its id */
|
|
26
|
-
export declare const ModalPanel: FactoryComponent<IMaterialModal>;
|
|
1
|
+
/// <reference types="materialize-css" />
|
|
2
|
+
import { FactoryComponent, Vnode, Attributes } from 'mithril';
|
|
3
|
+
export interface IMaterialModal extends Attributes {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
description?: string | Vnode<any, any>;
|
|
7
|
+
/** Set to true when the description contains HTML */
|
|
8
|
+
richContent?: boolean;
|
|
9
|
+
/** Fixate the footer, so you can show more content. */
|
|
10
|
+
fixedFooter?: boolean;
|
|
11
|
+
/** Display on the bottom */
|
|
12
|
+
bottomSheet?: boolean;
|
|
13
|
+
/** Materialize css' modal options */
|
|
14
|
+
options?: Partial<M.ModalOptions>;
|
|
15
|
+
/** Menu buttons, from left to right */
|
|
16
|
+
buttons?: Array<{
|
|
17
|
+
label: string;
|
|
18
|
+
iconName?: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
onclick?: (e: UIEvent) => void;
|
|
21
|
+
}>;
|
|
22
|
+
/** Get the modal instance, so you can control it programmatically */
|
|
23
|
+
onCreate?: (modal: M.Modal) => void;
|
|
24
|
+
}
|
|
25
|
+
/** Builds a modal panel, which can be triggered using its id */
|
|
26
|
+
export declare const ModalPanel: FactoryComponent<IMaterialModal>;
|
package/dist/option.d.ts
CHANGED
|
@@ -1,52 +1,56 @@
|
|
|
1
|
-
import m, { Vnode, FactoryComponent, Attributes, Component } from 'mithril';
|
|
2
|
-
export interface IInputCheckbox extends Attributes {
|
|
3
|
-
/** Optional event handler when a checkbox is clicked */
|
|
4
|
-
onchange?: (checked: boolean) => void;
|
|
5
|
-
/** Label of the checkbox, can be a string or Vnode */
|
|
6
|
-
label?: string | Vnode<any, any>;
|
|
7
|
-
/** If true, the checkbox is checked */
|
|
8
|
-
checked?: boolean;
|
|
9
|
-
/** If true, the checkbox is disabled */
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
}
|
|
12
|
-
/** Component to show a check box */
|
|
13
|
-
export declare const InputCheckbox: FactoryComponent<IInputCheckbox>;
|
|
14
|
-
export interface IInputOption<T extends string | number> {
|
|
15
|
-
/** Option ID */
|
|
16
|
-
id: T;
|
|
17
|
-
/** Displayed label */
|
|
18
|
-
label: string;
|
|
19
|
-
/** Optional title, often used to display a tooltip - will only work when choosing browser-defaults */
|
|
20
|
-
title?: string;
|
|
21
|
-
/** Is the option disabled? */
|
|
22
|
-
disabled?: boolean;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
|
|
48
|
-
/** If true,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
1
|
+
import m, { Vnode, FactoryComponent, Attributes, Component } from 'mithril';
|
|
2
|
+
export interface IInputCheckbox extends Attributes {
|
|
3
|
+
/** Optional event handler when a checkbox is clicked */
|
|
4
|
+
onchange?: (checked: boolean) => void;
|
|
5
|
+
/** Label of the checkbox, can be a string or Vnode */
|
|
6
|
+
label?: string | Vnode<any, any>;
|
|
7
|
+
/** If true, the checkbox is checked */
|
|
8
|
+
checked?: boolean;
|
|
9
|
+
/** If true, the checkbox is disabled */
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** Component to show a check box */
|
|
13
|
+
export declare const InputCheckbox: FactoryComponent<IInputCheckbox>;
|
|
14
|
+
export interface IInputOption<T extends string | number> {
|
|
15
|
+
/** Option ID */
|
|
16
|
+
id: T;
|
|
17
|
+
/** Displayed label */
|
|
18
|
+
label: string;
|
|
19
|
+
/** Optional title, often used to display a tooltip - will only work when choosing browser-defaults */
|
|
20
|
+
title?: string;
|
|
21
|
+
/** Is the option disabled? */
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** Select image */
|
|
24
|
+
img?: string;
|
|
25
|
+
/** Select group label */
|
|
26
|
+
group?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface IOptions<T extends string | number> extends Attributes {
|
|
29
|
+
/** Element ID */
|
|
30
|
+
id?: string;
|
|
31
|
+
/** Optional title or label */
|
|
32
|
+
label?: string;
|
|
33
|
+
/** The options that you have */
|
|
34
|
+
options: IInputOption<T>[];
|
|
35
|
+
/** Event handler that is called when an option is changed */
|
|
36
|
+
onchange?: (checkedId: T[]) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Selected id or ids (in case of multiple options)
|
|
39
|
+
* @deprecated Please use initialValue instead
|
|
40
|
+
*/
|
|
41
|
+
checkedId?: T | T[];
|
|
42
|
+
/** Selected id or ids (in case of multiple options) */
|
|
43
|
+
initialValue?: T | T[];
|
|
44
|
+
/** Optional description */
|
|
45
|
+
description?: string;
|
|
46
|
+
/** Optional CSS that is added to the input checkbox, e.g. if you add col s4, the items will be put inline */
|
|
47
|
+
checkboxClass?: string;
|
|
48
|
+
/** If true, start on a new row */
|
|
49
|
+
newRow?: boolean;
|
|
50
|
+
/** If true, add a mandatory '*' after the label */
|
|
51
|
+
isMandatory?: boolean;
|
|
52
|
+
/** If true, disable the options. */
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
}
|
|
55
|
+
/** A list of checkboxes */
|
|
56
|
+
export declare const Options: <T extends string | number>() => m.Component<IOptions<T>, {}>;
|