mithril-materialized 1.4.2 → 2.0.0-beta.10
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 +286 -306
- package/dist/advanced.css +1888 -0
- package/dist/autocomplete.d.ts +12 -4
- package/dist/breadcrumb.d.ts +53 -0
- package/dist/button.d.ts +10 -10
- package/dist/carousel.d.ts +26 -7
- package/dist/chip.d.ts +2 -2
- package/dist/code-block.d.ts +2 -3
- package/dist/collapsible.d.ts +12 -7
- package/dist/collection.d.ts +8 -8
- package/dist/components.css +2310 -0
- package/dist/core.css +3402 -0
- package/dist/datepicker.d.ts +66 -0
- package/dist/dropdown.d.ts +5 -5
- package/dist/file-upload.d.ts +34 -0
- package/dist/floating-action-button.d.ts +9 -5
- package/dist/forms.css +2284 -0
- package/dist/icon.d.ts +2 -2
- package/dist/index.css +9284 -2
- package/dist/index.d.ts +13 -3
- package/dist/index.esm.js +6188 -2
- package/dist/index.js +6263 -2
- package/dist/index.min.css +8 -0
- package/dist/index.umd.js +6267 -2
- package/dist/input-options.d.ts +3 -1
- package/dist/input.d.ts +17 -12
- package/dist/label.d.ts +6 -5
- package/dist/material-box.d.ts +22 -4
- package/dist/material-icon.d.ts +14 -0
- package/dist/modal.d.ts +23 -7
- package/dist/option.d.ts +12 -11
- package/dist/pagination.d.ts +5 -9
- package/dist/parallax.d.ts +8 -6
- package/dist/pickers.css +487 -0
- package/dist/pushpin.d.ts +32 -0
- package/dist/radio.d.ts +10 -6
- package/dist/select.d.ts +5 -5
- package/dist/sidenav.d.ts +76 -0
- package/dist/switch.d.ts +4 -5
- package/dist/tabs.d.ts +18 -7
- package/dist/theme-switcher.d.ts +49 -0
- package/dist/timepicker.d.ts +42 -0
- package/dist/toast.d.ts +45 -0
- package/dist/tooltip.d.ts +59 -0
- package/dist/utilities.css +3197 -0
- package/dist/utils.d.ts +17 -0
- package/dist/wizard.d.ts +58 -0
- package/package.json +47 -14
- package/sass/components/_badges.scss +59 -0
- package/sass/components/_breadcrumb.scss +248 -0
- package/sass/components/_buttons.scss +327 -0
- package/sass/components/_cards.scss +197 -0
- package/sass/components/_carousel.scss +92 -0
- package/sass/components/_chips.scss +92 -0
- package/sass/components/_collapsible.scss +94 -0
- package/sass/components/_color-classes.scss +34 -0
- package/sass/components/_color-variables.scss +371 -0
- package/sass/components/_datepicker.scss +282 -0
- package/sass/components/_dropdown.scss +90 -0
- package/sass/components/_file-upload.scss +228 -0
- package/sass/components/_global.scss +777 -0
- package/sass/components/_grid.scss +160 -0
- package/sass/components/_icons-material-design.scss +5 -0
- package/sass/components/_materialbox.scss +43 -0
- package/sass/components/_modal.scss +100 -0
- package/sass/components/_navbar.scss +219 -0
- package/sass/components/_normalize.scss +447 -0
- package/sass/components/_preloader.scss +336 -0
- package/sass/components/_pulse.scss +34 -0
- package/sass/components/_sidenav.scss +370 -0
- package/sass/components/_slider.scss +94 -0
- package/sass/components/_table_of_contents.scss +36 -0
- package/sass/components/_tabs.scss +103 -0
- package/sass/components/_tapTarget.scss +105 -0
- package/sass/components/_theme-switcher.scss +120 -0
- package/sass/components/_theme-variables.scss +205 -0
- package/sass/components/_timepicker.scss +262 -0
- package/sass/components/_toast.scss +61 -0
- package/sass/components/_tooltip.scss +32 -0
- package/sass/components/_transitions.scss +13 -0
- package/sass/components/_typography.scss +61 -0
- package/sass/components/_variables.scss +352 -0
- package/sass/components/_waves.scss +114 -0
- package/sass/components/_wizard.scss +416 -0
- package/sass/components/forms/_checkboxes.scss +203 -0
- package/sass/components/forms/_file-input.scss +50 -0
- package/sass/components/forms/_form-groups.scss +28 -0
- package/sass/components/forms/_forms.scss +24 -0
- package/sass/components/forms/_input-fields.scss +383 -0
- package/sass/components/forms/_radio-buttons.scss +118 -0
- package/sass/components/forms/_range.scss +164 -0
- package/sass/components/forms/_select.scss +193 -0
- package/sass/components/forms/_switches.scss +92 -0
- package/sass/materialize.scss +48 -0
- package/dist/index.css.map +0 -1
- package/dist/index.esm.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.modern.js +0 -2
- package/dist/index.modern.js.map +0 -1
- package/dist/index.umd.js.map +0 -1
- package/dist/map-editor.d.ts +0 -63
- package/dist/pickers.d.ts +0 -6
- package/dist/timeline.d.ts +0 -24
package/dist/input-options.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Attributes } from 'mithril';
|
|
2
|
-
export interface
|
|
2
|
+
export interface InputAttrs<T = string> extends Attributes {
|
|
3
3
|
/** Optional label. */
|
|
4
4
|
label?: string;
|
|
5
5
|
/** Optional ID. */
|
|
@@ -38,6 +38,8 @@ export interface IInputOptions<T = string> extends Attributes {
|
|
|
38
38
|
/** Invoked when the element looses focus */
|
|
39
39
|
onblur?: (ev: FocusEvent) => void;
|
|
40
40
|
/** Invoked when the value changes. */
|
|
41
|
+
oninput?: (value: T) => void;
|
|
42
|
+
/** Invoked when the input looses focus. */
|
|
41
43
|
onchange?: (value: T) => void;
|
|
42
44
|
/** Add a a placeholder to the input field. */
|
|
43
45
|
placeholder?: string;
|
package/dist/input.d.ts
CHANGED
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
import m, { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { InputAttrs } from './input-options';
|
|
3
|
+
/** Character counter component that tracks text length against maxLength */
|
|
4
|
+
export declare const CharacterCounter: FactoryComponent<{
|
|
5
|
+
currentLength: number;
|
|
6
|
+
maxLength: number;
|
|
7
|
+
show: boolean;
|
|
8
|
+
}>;
|
|
4
9
|
/** Create a TextArea */
|
|
5
|
-
export declare const TextArea: FactoryComponent<
|
|
10
|
+
export declare const TextArea: FactoryComponent<InputAttrs<string>>;
|
|
6
11
|
export type InputType = 'url' | 'color' | 'text' | 'number' | 'email' | 'range' | 'password';
|
|
7
12
|
/** Component for entering some text */
|
|
8
|
-
export declare const TextInput: m.FactoryComponent<
|
|
13
|
+
export declare const TextInput: m.FactoryComponent<InputAttrs<string>>;
|
|
9
14
|
/** Component for entering a password */
|
|
10
|
-
export declare const PasswordInput: m.FactoryComponent<
|
|
15
|
+
export declare const PasswordInput: m.FactoryComponent<InputAttrs<string>>;
|
|
11
16
|
/** Component for entering a number */
|
|
12
|
-
export declare const NumberInput: m.FactoryComponent<
|
|
17
|
+
export declare const NumberInput: m.FactoryComponent<InputAttrs<number>>;
|
|
13
18
|
/** Component for entering a URL */
|
|
14
|
-
export declare const UrlInput: m.FactoryComponent<
|
|
19
|
+
export declare const UrlInput: m.FactoryComponent<InputAttrs<string>>;
|
|
15
20
|
/** Component for entering a color */
|
|
16
|
-
export declare const ColorInput: m.FactoryComponent<
|
|
21
|
+
export declare const ColorInput: m.FactoryComponent<InputAttrs<string>>;
|
|
17
22
|
/** Component for entering a range */
|
|
18
|
-
export declare const RangeInput: m.FactoryComponent<
|
|
23
|
+
export declare const RangeInput: m.FactoryComponent<InputAttrs<number>>;
|
|
19
24
|
/** Component for entering an email */
|
|
20
|
-
export declare const EmailInput: m.FactoryComponent<
|
|
21
|
-
export interface
|
|
25
|
+
export declare const EmailInput: m.FactoryComponent<InputAttrs<string>>;
|
|
26
|
+
export interface FileInputAttrs extends Attributes {
|
|
22
27
|
/** Displayed on the button, @default File */
|
|
23
28
|
label?: string;
|
|
24
29
|
/** Current value of the file input, write only */
|
|
@@ -39,4 +44,4 @@ export interface IFileInputOptions extends Attributes {
|
|
|
39
44
|
accept?: string | string[];
|
|
40
45
|
}
|
|
41
46
|
/** Component for uploading a file */
|
|
42
|
-
export declare const FileInput: FactoryComponent<
|
|
47
|
+
export declare const FileInput: FactoryComponent<FileInputAttrs>;
|
package/dist/label.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { FactoryComponent, Component, Attributes } from 'mithril';
|
|
2
|
-
import './styles/input.css';
|
|
3
2
|
export declare const Mandatory: Component;
|
|
4
|
-
export interface
|
|
3
|
+
export interface LabelAttrs extends Attributes {
|
|
5
4
|
/** Optional title/label */
|
|
6
5
|
label?: string;
|
|
7
6
|
/** Optional ID */
|
|
@@ -10,13 +9,15 @@ export interface IMaterialLabel extends Attributes {
|
|
|
10
9
|
isMandatory?: boolean;
|
|
11
10
|
/** Add the active class to the label */
|
|
12
11
|
isActive?: boolean | string;
|
|
12
|
+
/** Determines the initial value of its active state, only used during oncreate */
|
|
13
|
+
initialValue?: boolean;
|
|
13
14
|
}
|
|
14
15
|
/** Simple label element, used for most components. */
|
|
15
|
-
export declare const Label: FactoryComponent<
|
|
16
|
-
export interface
|
|
16
|
+
export declare const Label: FactoryComponent<LabelAttrs>;
|
|
17
|
+
export interface HelperTextOptions extends Attributes {
|
|
17
18
|
helperText?: string;
|
|
18
19
|
dataError?: string;
|
|
19
20
|
dataSuccess?: string;
|
|
20
21
|
}
|
|
21
22
|
/** 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<
|
|
23
|
+
export declare const HelperText: FactoryComponent<HelperTextOptions>;
|
package/dist/material-box.d.ts
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
import { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
-
export interface
|
|
2
|
+
export interface MaterialBoxOptions {
|
|
3
|
+
/** Animation duration in ms */
|
|
4
|
+
inDuration?: number;
|
|
5
|
+
/** Animation duration in ms for closing */
|
|
6
|
+
outDuration?: number;
|
|
7
|
+
/** Callback when materialbox is opened */
|
|
8
|
+
onOpenStart?: () => void;
|
|
9
|
+
/** Callback when materialbox is closed */
|
|
10
|
+
onCloseStart?: () => void;
|
|
11
|
+
/** Callback when materialbox opening animation is complete */
|
|
12
|
+
onOpenEnd?: () => void;
|
|
13
|
+
/** Callback when materialbox closing animation is complete */
|
|
14
|
+
onCloseEnd?: () => void;
|
|
15
|
+
}
|
|
16
|
+
export interface MaterialBoxAttrs extends MaterialBoxOptions, Attributes {
|
|
3
17
|
/** Source image path */
|
|
4
18
|
src: string;
|
|
19
|
+
/** Alt text for the image */
|
|
20
|
+
alt?: string;
|
|
5
21
|
/**
|
|
6
22
|
* Width of the image
|
|
7
23
|
* @default undefined
|
|
@@ -12,9 +28,11 @@ export interface IMaterialBox extends Partial<M.MaterialboxOptions>, Attributes
|
|
|
12
28
|
* @default undefined
|
|
13
29
|
*/
|
|
14
30
|
height?: number;
|
|
31
|
+
/** Caption for the image overlay */
|
|
32
|
+
caption?: string;
|
|
15
33
|
}
|
|
16
34
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
35
|
+
* Pure TypeScript MaterialBox - creates an image lightbox that fills the screen when clicked
|
|
36
|
+
* No MaterializeCSS dependencies
|
|
19
37
|
*/
|
|
20
|
-
export declare const MaterialBox: FactoryComponent<
|
|
38
|
+
export declare const MaterialBox: FactoryComponent<MaterialBoxAttrs>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
+
declare const iconPaths: {
|
|
3
|
+
readonly caret: readonly ["M7 10l5 5 5-5z", "M0 0h24v24H0z"];
|
|
4
|
+
readonly close: readonly ["M18.3 5.71a1 1 0 0 0-1.41 0L12 10.59 7.11 5.7A1 1 0 0 0 5.7 7.11L10.59 12l-4.89 4.89a1 1 0 1 0 1.41 1.41L12 13.41l4.89 4.89a1 1 0 0 0 1.41-1.41L13.41 12l4.89-4.89a1 1 0 0 0 0-1.4z", "M0 0h24v24H0z"];
|
|
5
|
+
};
|
|
6
|
+
type IconName = keyof typeof iconPaths;
|
|
7
|
+
export interface MaterialIconAttrs extends Attributes {
|
|
8
|
+
name: IconName;
|
|
9
|
+
direction?: 'up' | 'down' | 'left' | 'right';
|
|
10
|
+
style?: Record<string, string>;
|
|
11
|
+
onclick?: (e: MouseEvent) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const MaterialIcon: FactoryComponent<MaterialIconAttrs>;
|
|
14
|
+
export {};
|
package/dist/modal.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { FactoryComponent, Vnode, Attributes } from 'mithril';
|
|
2
|
-
export interface
|
|
2
|
+
export interface ModalState {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
id: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ModalAttrs extends Attributes {
|
|
3
7
|
id: string;
|
|
4
8
|
title: string;
|
|
5
9
|
description?: string | Vnode<any, any>;
|
|
@@ -9,17 +13,29 @@ export interface IMaterialModal extends Attributes {
|
|
|
9
13
|
fixedFooter?: boolean;
|
|
10
14
|
/** Display on the bottom */
|
|
11
15
|
bottomSheet?: boolean;
|
|
12
|
-
/** Materialize css' modal options */
|
|
13
|
-
options?: Partial<M.ModalOptions>;
|
|
14
16
|
/** Menu buttons, from left to right */
|
|
15
17
|
buttons?: Array<{
|
|
16
18
|
label: string;
|
|
17
19
|
iconName?: string;
|
|
18
20
|
disabled?: boolean;
|
|
19
21
|
onclick?: (e: UIEvent) => void;
|
|
22
|
+
className?: string;
|
|
20
23
|
}>;
|
|
21
|
-
/**
|
|
22
|
-
|
|
24
|
+
/** Control modal visibility externally */
|
|
25
|
+
isOpen?: boolean;
|
|
26
|
+
/** Called when modal should be opened/closed */
|
|
27
|
+
onToggle?: (open: boolean) => void;
|
|
28
|
+
/** Called when modal is closed */
|
|
29
|
+
onClose?: () => void;
|
|
30
|
+
/** Show close button in top right */
|
|
31
|
+
showCloseButton?: boolean;
|
|
32
|
+
/** Close modal when clicking backdrop */
|
|
33
|
+
closeOnBackdropClick?: boolean;
|
|
34
|
+
/** Close modal when pressing escape key */
|
|
35
|
+
closeOnEsc?: boolean;
|
|
23
36
|
}
|
|
24
|
-
/**
|
|
25
|
-
|
|
37
|
+
/**
|
|
38
|
+
* CSS-only Modal Panel component - no JavaScript dependencies
|
|
39
|
+
* Uses modern CSS techniques for modal functionality
|
|
40
|
+
*/
|
|
41
|
+
export declare const ModalPanel: FactoryComponent<ModalAttrs>;
|
package/dist/option.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vnode, FactoryComponent, Attributes, Component } from 'mithril';
|
|
2
|
-
export interface
|
|
2
|
+
export interface InputCheckboxAttrs extends Attributes {
|
|
3
3
|
/** Optional event handler when a checkbox is clicked */
|
|
4
4
|
onchange?: (checked: boolean) => void;
|
|
5
5
|
/** Label of the checkbox, can be a string or Vnode */
|
|
@@ -8,10 +8,12 @@ export interface IInputCheckbox extends Attributes {
|
|
|
8
8
|
checked?: boolean;
|
|
9
9
|
/** If true, the checkbox is disabled */
|
|
10
10
|
disabled?: boolean;
|
|
11
|
+
/** Optional input id for the checkbox */
|
|
12
|
+
inputId?: string;
|
|
11
13
|
}
|
|
12
14
|
/** Component to show a check box */
|
|
13
|
-
export declare const InputCheckbox: FactoryComponent<
|
|
14
|
-
export interface
|
|
15
|
+
export declare const InputCheckbox: FactoryComponent<InputCheckboxAttrs>;
|
|
16
|
+
export interface InputOption<T extends string | number> {
|
|
15
17
|
/** Option ID */
|
|
16
18
|
id: T;
|
|
17
19
|
/** Displayed label */
|
|
@@ -29,20 +31,15 @@ export interface IInputOption<T extends string | number> {
|
|
|
29
31
|
/** Optional description */
|
|
30
32
|
description?: string;
|
|
31
33
|
}
|
|
32
|
-
export interface
|
|
34
|
+
export interface OptionsAttrs<T extends string | number> extends Attributes {
|
|
33
35
|
/** Element ID */
|
|
34
36
|
id?: string;
|
|
35
37
|
/** Optional title or label */
|
|
36
38
|
label?: string;
|
|
37
39
|
/** The options that you have */
|
|
38
|
-
options:
|
|
40
|
+
options: InputOption<T>[];
|
|
39
41
|
/** Event handler that is called when an option is changed */
|
|
40
42
|
onchange?: (checkedId: T[]) => void;
|
|
41
|
-
/**
|
|
42
|
-
* Selected id or ids (in case of multiple options)
|
|
43
|
-
* @deprecated Please use initialValue instead
|
|
44
|
-
*/
|
|
45
|
-
checkedId?: T | T[];
|
|
46
43
|
/** Selected id or ids (in case of multiple options) */
|
|
47
44
|
initialValue?: T | T[];
|
|
48
45
|
/** Optional description */
|
|
@@ -55,6 +52,10 @@ export interface IOptions<T extends string | number> extends Attributes {
|
|
|
55
52
|
isMandatory?: boolean;
|
|
56
53
|
/** If true, disable the options. */
|
|
57
54
|
disabled?: boolean;
|
|
55
|
+
/** Layout for the options: 'vertical' (default) or 'horizontal' */
|
|
56
|
+
layout?: 'vertical' | 'horizontal';
|
|
57
|
+
/** If true, show select all/none buttons */
|
|
58
|
+
showSelectAll?: boolean;
|
|
58
59
|
}
|
|
59
60
|
/** A list of checkboxes */
|
|
60
|
-
export declare const Options: <T extends string | number>() => Component<
|
|
61
|
+
export declare const Options: <T extends string | number>() => Component<OptionsAttrs<T>>;
|
package/dist/pagination.d.ts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import { FactoryComponent, Attributes
|
|
2
|
-
export interface
|
|
3
|
-
active?: boolean;
|
|
4
|
-
title: number | Vnode<any, any>;
|
|
5
|
-
}
|
|
6
|
-
export interface IPaginationOption extends Attributes {
|
|
1
|
+
import { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
+
export interface PaginationItem extends Attributes {
|
|
7
3
|
href: string;
|
|
8
4
|
disabled?: boolean;
|
|
9
5
|
}
|
|
10
|
-
export interface
|
|
6
|
+
export interface PaginationAttrs extends Attributes {
|
|
11
7
|
/**
|
|
12
8
|
* How many items do we show
|
|
13
9
|
* @default 9 or items.length, whatever is the smallest
|
|
@@ -15,6 +11,6 @@ export interface IPaginationOptions extends Attributes {
|
|
|
15
11
|
size?: number;
|
|
16
12
|
/** The active page index */
|
|
17
13
|
curPage?: number;
|
|
18
|
-
items:
|
|
14
|
+
items: PaginationItem[];
|
|
19
15
|
}
|
|
20
|
-
export declare const Pagination: FactoryComponent<
|
|
16
|
+
export declare const Pagination: FactoryComponent<PaginationAttrs>;
|
package/dist/parallax.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
-
export interface
|
|
2
|
+
export interface ParallaxAttrs extends Attributes {
|
|
3
|
+
/** Enable responsive parallax (disable on mobile for performance) */
|
|
4
|
+
responsiveThreshold?: number;
|
|
3
5
|
/** Image source */
|
|
4
6
|
src: string;
|
|
7
|
+
/** Alt text for the image */
|
|
8
|
+
alt?: string;
|
|
5
9
|
}
|
|
6
10
|
/**
|
|
7
|
-
* Parallax component
|
|
8
|
-
*
|
|
9
|
-
* is moved at a different speed than the foreground content while scrolling.
|
|
10
|
-
* @see https://materializecss.com/parallax.html
|
|
11
|
+
* MaterializeCSS Parallax component with dynamic positioning
|
|
12
|
+
* Port of the original MaterializeCSS parallax logic
|
|
11
13
|
*/
|
|
12
|
-
export declare const Parallax: FactoryComponent<
|
|
14
|
+
export declare const Parallax: FactoryComponent<ParallaxAttrs>;
|