mithril-materialized 1.4.1 → 2.0.0-beta.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/dist/autocomplete.d.ts +12 -4
- 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/dropdown.d.ts +5 -5
- package/dist/floating-action-button.d.ts +9 -5
- package/dist/icon.d.ts +2 -2
- package/dist/index.css +7968 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.esm.js +4211 -2
- package/dist/index.js +4265 -2
- package/dist/index.umd.js +4269 -2
- package/dist/input-options.d.ts +3 -1
- package/dist/input.d.ts +17 -12
- package/dist/label.d.ts +4 -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.d.ts +129 -5
- package/dist/radio.d.ts +10 -6
- package/dist/search-select.d.ts +2 -2
- package/dist/select.d.ts +5 -5
- package/dist/switch.d.ts +4 -5
- package/dist/tabs.d.ts +18 -5
- package/dist/utils.d.ts +17 -0
- package/package.json +35 -10
- package/sass/components/_badges.scss +59 -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 +251 -0
- package/sass/components/_dropdown.scss +90 -0
- package/sass/components/_global.scss +775 -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 +97 -0
- package/sass/components/_navbar.scss +211 -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 +213 -0
- package/sass/components/_slider.scss +94 -0
- package/sass/components/_table_of_contents.scss +36 -0
- package/sass/components/_tabs.scss +102 -0
- package/sass/components/_tapTarget.scss +105 -0
- package/sass/components/_timepicker.scss +170 -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/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 +361 -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 +41 -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/timeline.d.ts +0 -24
package/dist/autocomplete.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { FactoryComponent } from 'mithril';
|
|
2
|
-
import {
|
|
3
|
-
export interface
|
|
2
|
+
import { InputAttributes } from './input-options';
|
|
3
|
+
export interface AutoCompleteAttributes extends InputAttributes<string> {
|
|
4
|
+
/** The data object defining the autocomplete options */
|
|
5
|
+
data?: Record<string, string | null>;
|
|
6
|
+
/** Limit of how many options are shown. Default: Infinity */
|
|
7
|
+
limit?: number;
|
|
8
|
+
/** Minimum length of input before autocomplete shows. Default: 1 */
|
|
9
|
+
minLength?: number;
|
|
10
|
+
/** Function called when an option is selected */
|
|
11
|
+
onAutocomplete?: (value: string) => void;
|
|
4
12
|
}
|
|
5
|
-
/** Component to auto complete your text input */
|
|
6
|
-
export declare const Autocomplete: FactoryComponent<
|
|
13
|
+
/** Component to auto complete your text input - Pure Mithril implementation */
|
|
14
|
+
export declare const Autocomplete: FactoryComponent<AutoCompleteAttributes>;
|
package/dist/button.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import m, { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
-
export interface
|
|
2
|
+
export interface HtmlAttributes {
|
|
3
3
|
id?: string;
|
|
4
4
|
for?: string;
|
|
5
5
|
placeholder?: string;
|
|
@@ -7,7 +7,7 @@ export interface IHtmlAttributes {
|
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
type?: 'submit' | 'button' | 'text' | 'textarea' | 'number';
|
|
9
9
|
}
|
|
10
|
-
export interface
|
|
10
|
+
export interface ButtonAttributes extends Attributes {
|
|
11
11
|
/** Optional (e.g. in case you only want to use an icon) button label */
|
|
12
12
|
label?: string;
|
|
13
13
|
/** Optional icon material-icons name, @see https://materializecss.com/icons.html */
|
|
@@ -20,7 +20,7 @@ export interface IMaterialButton extends Attributes {
|
|
|
20
20
|
*/
|
|
21
21
|
modalId?: string;
|
|
22
22
|
/** Some additional HTML attributes that can be attached to the button */
|
|
23
|
-
attr?:
|
|
23
|
+
attr?: HtmlAttributes;
|
|
24
24
|
/** Optional text-based tooltip, @see https://materializecss.com/tooltips.html */
|
|
25
25
|
tooltip?: string;
|
|
26
26
|
/** Optional location for the tooltip */
|
|
@@ -31,10 +31,10 @@ export interface IMaterialButton extends Attributes {
|
|
|
31
31
|
*
|
|
32
32
|
* @example FlatButton = ButtonFactory('a.waves-effect.waves-teal.btn-flat');
|
|
33
33
|
*/
|
|
34
|
-
export declare const ButtonFactory: (element: string, defaultClassNames: string, type?: string) => FactoryComponent<
|
|
35
|
-
export declare const Button: m.FactoryComponent<
|
|
36
|
-
export declare const LargeButton: m.FactoryComponent<
|
|
37
|
-
export declare const SmallButton: m.FactoryComponent<
|
|
38
|
-
export declare const FlatButton: m.FactoryComponent<
|
|
39
|
-
export declare const RoundIconButton: m.FactoryComponent<
|
|
40
|
-
export declare const SubmitButton: m.FactoryComponent<
|
|
34
|
+
export declare const ButtonFactory: (element: string, defaultClassNames: string, type?: string) => FactoryComponent<ButtonAttributes>;
|
|
35
|
+
export declare const Button: m.FactoryComponent<ButtonAttributes>;
|
|
36
|
+
export declare const LargeButton: m.FactoryComponent<ButtonAttributes>;
|
|
37
|
+
export declare const SmallButton: m.FactoryComponent<ButtonAttributes>;
|
|
38
|
+
export declare const FlatButton: m.FactoryComponent<ButtonAttributes>;
|
|
39
|
+
export declare const RoundIconButton: m.FactoryComponent<ButtonAttributes>;
|
|
40
|
+
export declare const SubmitButton: m.FactoryComponent<ButtonAttributes>;
|
package/dist/carousel.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
-
export interface
|
|
2
|
+
export interface CarouselItem extends Attributes {
|
|
3
3
|
/** Relative page link, e.g. '#one' */
|
|
4
4
|
href: string;
|
|
5
5
|
/** Image source */
|
|
@@ -7,13 +7,32 @@ export interface ICarouselItem extends Attributes {
|
|
|
7
7
|
/** Alternative name */
|
|
8
8
|
alt?: string;
|
|
9
9
|
}
|
|
10
|
-
export interface
|
|
10
|
+
export interface CarouselOptions {
|
|
11
|
+
/** Duration of carousel item change animation in ms */
|
|
12
|
+
duration?: number;
|
|
13
|
+
/** Zoom scale (perspective distance) */
|
|
14
|
+
dist?: number;
|
|
15
|
+
/** Spacing for center image */
|
|
16
|
+
shift?: number;
|
|
17
|
+
/** Padding between non-center items */
|
|
18
|
+
padding?: number;
|
|
19
|
+
/** Number of visible items in carousel */
|
|
20
|
+
numVisible?: number;
|
|
21
|
+
/** Change to full width styles */
|
|
22
|
+
fullWidth?: boolean;
|
|
23
|
+
/** Toggle indicators */
|
|
24
|
+
indicators?: boolean;
|
|
25
|
+
/** Don't wrap around and cycle through items */
|
|
26
|
+
noWrap?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface CarouselAttributes extends CarouselOptions, Attributes {
|
|
11
29
|
/** The list of images */
|
|
12
|
-
items:
|
|
30
|
+
items: CarouselItem[];
|
|
31
|
+
/** Called when carousel item changes */
|
|
32
|
+
onCycleTo?: (item: CarouselItem, index: number, dragged: boolean) => void;
|
|
13
33
|
}
|
|
14
|
-
export declare const CarouselItem: FactoryComponent<ICarouselItem>;
|
|
15
34
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
35
|
+
* Materialize CSS Carousel component with dynamic positioning
|
|
36
|
+
* Port of the original MaterializeCSS carousel logic
|
|
18
37
|
*/
|
|
19
|
-
export declare const Carousel: FactoryComponent<
|
|
38
|
+
export declare const Carousel: FactoryComponent<CarouselAttributes>;
|
package/dist/chip.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface ChipData {
|
|
|
7
7
|
export interface AutocompleteOption extends ChipData {
|
|
8
8
|
value?: string;
|
|
9
9
|
}
|
|
10
|
-
export interface
|
|
10
|
+
export interface ChipsAttributes {
|
|
11
11
|
id?: string;
|
|
12
12
|
data?: ChipData[];
|
|
13
13
|
placeholder?: string;
|
|
@@ -28,4 +28,4 @@ export interface IChipsOptions {
|
|
|
28
28
|
onChipDelete?: (chip: ChipData) => void;
|
|
29
29
|
onChipSelect?: (chip: ChipData) => void;
|
|
30
30
|
}
|
|
31
|
-
export declare const Chips: m.FactoryComponent<
|
|
31
|
+
export declare const Chips: m.FactoryComponent<ChipsAttributes>;
|
package/dist/code-block.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import './styles/codeblock.css';
|
|
2
1
|
import { FactoryComponent, Attributes } from 'mithril';
|
|
3
|
-
export interface
|
|
2
|
+
export interface CodeBlockAttributes extends Attributes {
|
|
4
3
|
language?: string;
|
|
5
4
|
code: string | string[];
|
|
6
5
|
newRow?: boolean;
|
|
7
6
|
}
|
|
8
7
|
/** A simple code block without syntax high-lighting */
|
|
9
|
-
export declare const CodeBlock: FactoryComponent<
|
|
8
|
+
export declare const CodeBlock: FactoryComponent<CodeBlockAttributes>;
|
package/dist/collapsible.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FactoryComponent, Attributes, Vnode } from 'mithril';
|
|
2
|
-
export interface
|
|
2
|
+
export interface CollapsibleItem extends Attributes {
|
|
3
3
|
/** Header of the collabsible item, may contain HTML or may be a Vnode */
|
|
4
4
|
header?: string | Vnode<any, any>;
|
|
5
5
|
/** Body of the collabsible item, may contain HTML or may be a Vnode */
|
|
@@ -9,13 +9,18 @@ export interface ICollapsibleItem extends Attributes {
|
|
|
9
9
|
/** Add an material icon in front of the header. */
|
|
10
10
|
iconName?: string;
|
|
11
11
|
}
|
|
12
|
-
export interface
|
|
12
|
+
export interface CollapsibleAttributes extends Attributes {
|
|
13
13
|
/** The list of accordeon/collabsible items */
|
|
14
|
-
items:
|
|
14
|
+
items: CollapsibleItem[];
|
|
15
|
+
/** If true, only one item can be expanded at a time (accordion mode) */
|
|
16
|
+
accordion?: boolean;
|
|
15
17
|
}
|
|
16
|
-
export declare const CollapsibleItem: FactoryComponent<
|
|
18
|
+
export declare const CollapsibleItem: FactoryComponent<CollapsibleItem & {
|
|
19
|
+
isActive: boolean;
|
|
20
|
+
onToggle: () => void;
|
|
21
|
+
}>;
|
|
17
22
|
/**
|
|
18
|
-
* Creates a collabsible or accordion
|
|
19
|
-
*
|
|
23
|
+
* Creates a collabsible or accordion component with pure CSS/Mithril implementation.
|
|
24
|
+
* No MaterializeCSS JavaScript dependencies.
|
|
20
25
|
*/
|
|
21
|
-
export declare const Collapsible: FactoryComponent<
|
|
26
|
+
export declare const Collapsible: FactoryComponent<CollapsibleAttributes>;
|
package/dist/collection.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare enum CollectionMode {
|
|
|
4
4
|
LINKS = 1,
|
|
5
5
|
AVATAR = 2
|
|
6
6
|
}
|
|
7
|
-
export interface
|
|
7
|
+
export interface CollectionItem {
|
|
8
8
|
/** If available, will be used as the key, so all items need an id. */
|
|
9
9
|
id?: string | number;
|
|
10
10
|
/** Title of the collection item */
|
|
@@ -22,28 +22,28 @@ export interface ICollectionItem {
|
|
|
22
22
|
/** Add a material icon as secondary content. */
|
|
23
23
|
iconName?: string;
|
|
24
24
|
/** Onclick event handler */
|
|
25
|
-
onclick?: (item:
|
|
25
|
+
onclick?: (item: CollectionItem) => void;
|
|
26
26
|
/** Any other virtual element properties, including attributes and event handlers. */
|
|
27
27
|
[property: string]: any;
|
|
28
28
|
}
|
|
29
|
-
export interface
|
|
29
|
+
export interface CollectionAttributes extends Attributes {
|
|
30
30
|
/** Optional header */
|
|
31
31
|
header?: string;
|
|
32
32
|
/** The list of items */
|
|
33
|
-
items:
|
|
33
|
+
items: CollectionItem[];
|
|
34
34
|
/** Mode of operation */
|
|
35
35
|
mode?: CollectionMode;
|
|
36
36
|
}
|
|
37
|
-
export declare const SecondaryContent: FactoryComponent<
|
|
37
|
+
export declare const SecondaryContent: FactoryComponent<CollectionItem>;
|
|
38
38
|
export declare const ListItem: FactoryComponent<{
|
|
39
|
-
item:
|
|
39
|
+
item: CollectionItem;
|
|
40
40
|
mode: CollectionMode;
|
|
41
41
|
}>;
|
|
42
42
|
export declare const AnchorItem: FactoryComponent<{
|
|
43
|
-
item:
|
|
43
|
+
item: CollectionItem;
|
|
44
44
|
}>;
|
|
45
45
|
/**
|
|
46
46
|
* Creates a Collection of items, optionally containing links, headers, secondary content or avatars.
|
|
47
47
|
* @see https://materializecss.com/collections.html
|
|
48
48
|
*/
|
|
49
|
-
export declare const Collection: FactoryComponent<
|
|
49
|
+
export declare const Collection: FactoryComponent<CollectionAttributes>;
|
package/dist/dropdown.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, Attributes } from 'mithril';
|
|
2
|
-
export interface
|
|
2
|
+
export interface DropdownItem<T extends string | number> {
|
|
3
3
|
/** ID property of the selected item */
|
|
4
4
|
id?: T;
|
|
5
5
|
/** Label to show in the dropdown */
|
|
@@ -11,7 +11,7 @@ export interface IDropdownOption<T extends string | number> {
|
|
|
11
11
|
/** Add a divider */
|
|
12
12
|
divider?: boolean;
|
|
13
13
|
}
|
|
14
|
-
export interface
|
|
14
|
+
export interface DropdownAttributes<T extends string | number> extends Attributes {
|
|
15
15
|
/**
|
|
16
16
|
* Optional id of the dropdown element
|
|
17
17
|
* @default 'dropdown'
|
|
@@ -26,7 +26,7 @@ export interface IDropdownOptions<T extends string | number> extends Partial<M.D
|
|
|
26
26
|
/** If true, disable the selection */
|
|
27
27
|
disabled?: boolean;
|
|
28
28
|
/** Item array to show in the dropdown. If the value is not supplied, uses he name. */
|
|
29
|
-
items:
|
|
29
|
+
items: DropdownItem<T>[];
|
|
30
30
|
/**
|
|
31
31
|
* Selected value or name
|
|
32
32
|
* @deprecated Use initialValue instead
|
|
@@ -41,5 +41,5 @@ export interface IDropdownOptions<T extends string | number> extends Partial<M.D
|
|
|
41
41
|
/** Add a description underneath the input field. */
|
|
42
42
|
helperText?: string;
|
|
43
43
|
}
|
|
44
|
-
/** Dropdown component */
|
|
45
|
-
export declare const Dropdown: <T extends string | number>() => Component<
|
|
44
|
+
/** Pure TypeScript Dropdown component - no Materialize dependencies */
|
|
45
|
+
export declare const Dropdown: <T extends string | number>() => Component<DropdownAttributes<T>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FactoryComponent } from 'mithril';
|
|
2
|
-
export interface
|
|
2
|
+
export interface FloatingActionButtonAttributes {
|
|
3
3
|
/** Optional classes to add to the top element */
|
|
4
4
|
className?: string;
|
|
5
5
|
/** Optional style to add to the top element, e.g. for positioning it inline */
|
|
@@ -24,10 +24,14 @@ export interface IFloatingActionButton extends Partial<M.FloatingActionButtonOpt
|
|
|
24
24
|
/** On click function */
|
|
25
25
|
onClick?: (e: UIEvent) => void;
|
|
26
26
|
}>;
|
|
27
|
+
/** Direction to open the buttons */
|
|
28
|
+
direction?: 'top' | 'bottom' | 'left' | 'right';
|
|
29
|
+
/** Whether to show the toolbar */
|
|
30
|
+
toolbarEnabled?: boolean;
|
|
31
|
+
/** Hover behavior */
|
|
32
|
+
hoverEnabled?: boolean;
|
|
27
33
|
}
|
|
28
34
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* @example FlatButton = ButtonFactory('a.waves-effect.waves-teal.btn-flat');
|
|
35
|
+
* Floating Action Button
|
|
32
36
|
*/
|
|
33
|
-
export declare const FloatingActionButton: FactoryComponent<
|
|
37
|
+
export declare const FloatingActionButton: FactoryComponent<FloatingActionButtonAttributes>;
|
package/dist/icon.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
-
export interface
|
|
2
|
+
export interface MaterialIcon extends Attributes {
|
|
3
3
|
iconName: string;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
@@ -8,4 +8,4 @@ export interface IMaterialIcon extends Attributes {
|
|
|
8
8
|
* @example m(Icon, { className: 'small' }, 'create') renders a small 'create' icon
|
|
9
9
|
* @example m(Icon, { className: 'prefix' }, iconName) renders the icon as a prefix
|
|
10
10
|
*/
|
|
11
|
-
export declare const Icon: FactoryComponent<
|
|
11
|
+
export declare const Icon: FactoryComponent<MaterialIcon>;
|