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/tabs.d.ts
CHANGED
|
@@ -7,15 +7,13 @@ import { Vnode, FactoryComponent, Attributes } from 'mithril';
|
|
|
7
7
|
* - _top: Opens the linked document in the full body of the window
|
|
8
8
|
*/
|
|
9
9
|
export type AnchorTarget = '_blank' | '_self' | '_parent' | '_top';
|
|
10
|
-
export interface
|
|
10
|
+
export interface TabItem {
|
|
11
11
|
/** Title of the tab */
|
|
12
12
|
title: string;
|
|
13
13
|
/** Vnode to render: may be empty in case of a using the tab as a hyperlink. */
|
|
14
14
|
vnode?: Vnode<any, any>;
|
|
15
15
|
/** ID of the tab element. Default the title in lowercase */
|
|
16
16
|
id?: string;
|
|
17
|
-
/** If the tab should be active */
|
|
18
|
-
active?: boolean;
|
|
19
17
|
/** If the tab should be disabled */
|
|
20
18
|
disabled?: boolean;
|
|
21
19
|
/** CSS class for the tab (li), default `.tab.col.s3` */
|
|
@@ -30,8 +28,18 @@ export interface ITabItem {
|
|
|
30
28
|
/** Only used in combination with a set target to make the tab act as a regular hyperlink. */
|
|
31
29
|
href?: string;
|
|
32
30
|
}
|
|
33
|
-
export interface
|
|
34
|
-
/**
|
|
31
|
+
export interface TabsOptions {
|
|
32
|
+
/** Duration of tab change animation in ms */
|
|
33
|
+
duration?: number;
|
|
34
|
+
/** Called when a tab is shown */
|
|
35
|
+
onShow?: (tab: HTMLElement) => void;
|
|
36
|
+
/** The maximum width at which tabs switch to swipeable mode */
|
|
37
|
+
responsiveThreshold?: number;
|
|
38
|
+
/** Enable swiping between tabs on mobile */
|
|
39
|
+
swipeable?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface TabsAttrs extends TabsOptions, Attributes {
|
|
42
|
+
/** Selected tab id, takes precedence over tab.active property */
|
|
35
43
|
selectedTabId?: string;
|
|
36
44
|
/**
|
|
37
45
|
* Tab width, can be `auto` to use the width of the title,
|
|
@@ -39,6 +47,9 @@ export interface ITabs extends Partial<M.TabsOptions>, Attributes {
|
|
|
39
47
|
*/
|
|
40
48
|
tabWidth?: 'auto' | 'fixed' | 'fill';
|
|
41
49
|
/** List of tab items */
|
|
42
|
-
tabs:
|
|
50
|
+
tabs: TabItem[];
|
|
51
|
+
/** Callback when tab changes */
|
|
52
|
+
onTabChange?: (tabId: string) => void;
|
|
43
53
|
}
|
|
44
|
-
|
|
54
|
+
/** CSS-only Tabs component - no MaterializeCSS dependencies */
|
|
55
|
+
export declare const Tabs: FactoryComponent<TabsAttrs>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { FactoryComponent } from 'mithril';
|
|
2
|
+
export type Theme = 'light' | 'dark' | 'auto';
|
|
3
|
+
export interface ThemeSwitcherAttrs {
|
|
4
|
+
/** Current theme selection */
|
|
5
|
+
theme?: Theme;
|
|
6
|
+
/** Callback when theme changes */
|
|
7
|
+
onThemeChange?: (theme: Theme) => void;
|
|
8
|
+
/** Show labels on the toggle buttons */
|
|
9
|
+
showLabels?: boolean;
|
|
10
|
+
/** Custom class for the container */
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Theme switching utilities and component
|
|
15
|
+
*/
|
|
16
|
+
export declare class ThemeManager {
|
|
17
|
+
private static currentTheme;
|
|
18
|
+
/**
|
|
19
|
+
* Set the theme for the entire application
|
|
20
|
+
*/
|
|
21
|
+
static setTheme(theme: Theme): void;
|
|
22
|
+
/**
|
|
23
|
+
* Get the current theme
|
|
24
|
+
*/
|
|
25
|
+
static getTheme(): Theme;
|
|
26
|
+
/**
|
|
27
|
+
* Get the effective theme (resolves 'auto' to actual theme)
|
|
28
|
+
*/
|
|
29
|
+
static getEffectiveTheme(): 'light' | 'dark';
|
|
30
|
+
/**
|
|
31
|
+
* Initialize theme from localStorage or system preference
|
|
32
|
+
*/
|
|
33
|
+
static initialize(): void;
|
|
34
|
+
/**
|
|
35
|
+
* Toggle between light and dark themes
|
|
36
|
+
*/
|
|
37
|
+
static toggle(): void;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Theme Switcher Component
|
|
41
|
+
* Provides UI controls for changing themes
|
|
42
|
+
*/
|
|
43
|
+
export declare const ThemeSwitcher: FactoryComponent<ThemeSwitcherAttrs>;
|
|
44
|
+
/**
|
|
45
|
+
* Simple theme toggle button (just switches between light/dark)
|
|
46
|
+
*/
|
|
47
|
+
export declare const ThemeToggle: FactoryComponent<{
|
|
48
|
+
className?: string;
|
|
49
|
+
}>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { FactoryComponent } from 'mithril';
|
|
2
|
+
import { InputAttrs } from './input-options';
|
|
3
|
+
export interface TimepickerI18n {
|
|
4
|
+
cancel?: string;
|
|
5
|
+
clear?: string;
|
|
6
|
+
done?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface TimepickerOptions {
|
|
9
|
+
dialRadius?: number;
|
|
10
|
+
outerRadius?: number;
|
|
11
|
+
innerRadius?: number;
|
|
12
|
+
tickRadius?: number;
|
|
13
|
+
duration?: number;
|
|
14
|
+
container?: string | null;
|
|
15
|
+
defaultTime?: string;
|
|
16
|
+
fromNow?: number;
|
|
17
|
+
showClearBtn?: boolean;
|
|
18
|
+
i18n?: TimepickerI18n;
|
|
19
|
+
autoClose?: boolean;
|
|
20
|
+
twelveHour?: boolean;
|
|
21
|
+
vibrate?: boolean;
|
|
22
|
+
onOpen?: () => void;
|
|
23
|
+
onOpenStart?: () => void;
|
|
24
|
+
onOpenEnd?: () => void;
|
|
25
|
+
onCloseStart?: () => void;
|
|
26
|
+
onCloseEnd?: () => void;
|
|
27
|
+
onSelect?: (hour: number, minute: number) => void;
|
|
28
|
+
}
|
|
29
|
+
export interface TimePickerAttrs extends InputAttrs<string>, TimepickerOptions {
|
|
30
|
+
/** Use inline mode (HTML5 time input) instead of modal, default true */
|
|
31
|
+
useModal?: boolean;
|
|
32
|
+
/** Allow format toggle between 12h/24h (for inline mode) */
|
|
33
|
+
allowFormatToggle?: boolean;
|
|
34
|
+
/** Clear button label */
|
|
35
|
+
clearLabel?: string;
|
|
36
|
+
/** Close button label */
|
|
37
|
+
closeLabel?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* TimePicker component based on original Materialize CSS timepicker
|
|
41
|
+
*/
|
|
42
|
+
export declare const TimePicker: FactoryComponent<TimePickerAttrs>;
|
package/dist/toast.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { FactoryComponent } from 'mithril';
|
|
2
|
+
export interface ToastOptions {
|
|
3
|
+
/** HTML content for the toast */
|
|
4
|
+
html?: string;
|
|
5
|
+
/** Display length in milliseconds */
|
|
6
|
+
displayLength?: number;
|
|
7
|
+
/** Animation in duration in milliseconds */
|
|
8
|
+
inDuration?: number;
|
|
9
|
+
/** Animation out duration in milliseconds */
|
|
10
|
+
outDuration?: number;
|
|
11
|
+
/** Additional CSS classes */
|
|
12
|
+
classes?: string;
|
|
13
|
+
/** Callback function called when toast is dismissed */
|
|
14
|
+
completeCallback?: () => void;
|
|
15
|
+
/** Activation percentage for swipe dismissal */
|
|
16
|
+
activationPercent?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare class Toast {
|
|
19
|
+
el: HTMLElement;
|
|
20
|
+
options: Required<ToastOptions>;
|
|
21
|
+
private state;
|
|
22
|
+
private static _toasts;
|
|
23
|
+
private static _container;
|
|
24
|
+
private static _draggedToast;
|
|
25
|
+
private static defaults;
|
|
26
|
+
constructor(options?: ToastOptions);
|
|
27
|
+
static getInstance(el: HTMLElement): Toast | undefined;
|
|
28
|
+
static _createContainer(): void;
|
|
29
|
+
static _removeContainer(): void;
|
|
30
|
+
static _onDragStart: (e: Event) => void;
|
|
31
|
+
static _onDragMove: (e: Event) => void;
|
|
32
|
+
static _onDragEnd: () => void;
|
|
33
|
+
static _xPos(e: Event): number;
|
|
34
|
+
static dismissAll(): void;
|
|
35
|
+
_createToast(): HTMLElement;
|
|
36
|
+
_animateIn(): void;
|
|
37
|
+
_setTimer(): void;
|
|
38
|
+
dismiss(): void;
|
|
39
|
+
}
|
|
40
|
+
export declare const toast: (options: ToastOptions) => Toast;
|
|
41
|
+
export interface ToastComponentAttrs extends ToastOptions {
|
|
42
|
+
/** Whether to show the toast */
|
|
43
|
+
show?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export declare const ToastComponent: FactoryComponent<ToastComponentAttrs>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { FactoryComponent, Attributes } from 'mithril';
|
|
2
|
+
export interface TooltipOptions {
|
|
3
|
+
/** Delay before tooltip appears on hover */
|
|
4
|
+
enterDelay?: number;
|
|
5
|
+
/** Delay before tooltip disappears after hover ends */
|
|
6
|
+
exitDelay?: number;
|
|
7
|
+
/** HTML content for the tooltip */
|
|
8
|
+
html?: string | null;
|
|
9
|
+
/** Margin from element */
|
|
10
|
+
margin?: number;
|
|
11
|
+
/** Animation in duration */
|
|
12
|
+
inDuration?: number;
|
|
13
|
+
/** Animation out duration */
|
|
14
|
+
outDuration?: number;
|
|
15
|
+
/** Position of tooltip */
|
|
16
|
+
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
17
|
+
/** Movement during transition */
|
|
18
|
+
transitionMovement?: number;
|
|
19
|
+
}
|
|
20
|
+
export declare class Tooltip {
|
|
21
|
+
el: HTMLElement;
|
|
22
|
+
tooltipEl: HTMLElement;
|
|
23
|
+
options: Required<TooltipOptions>;
|
|
24
|
+
private state;
|
|
25
|
+
private static defaults;
|
|
26
|
+
private _handleMouseEnterBound;
|
|
27
|
+
private _handleMouseLeaveBound;
|
|
28
|
+
private _handleFocusBound;
|
|
29
|
+
private _handleBlurBound;
|
|
30
|
+
constructor(el: HTMLElement, options?: TooltipOptions);
|
|
31
|
+
static getInstance(el: HTMLElement): Tooltip | undefined;
|
|
32
|
+
destroy(): void;
|
|
33
|
+
_appendTooltipEl(): void;
|
|
34
|
+
_updateTooltipContent(): void;
|
|
35
|
+
_setupEventHandlers(): void;
|
|
36
|
+
_removeEventHandlers(): void;
|
|
37
|
+
open(isManual?: boolean): void;
|
|
38
|
+
close(): void;
|
|
39
|
+
_setExitDelayTimeout(): void;
|
|
40
|
+
_setEnterDelayTimeout(isManual: boolean): void;
|
|
41
|
+
_positionTooltip(): void;
|
|
42
|
+
_repositionWithinScreen(x: number, y: number, width: number, height: number): {
|
|
43
|
+
x: number;
|
|
44
|
+
y: number;
|
|
45
|
+
};
|
|
46
|
+
_animateIn(): void;
|
|
47
|
+
_animateOut(): void;
|
|
48
|
+
_handleMouseEnter(): void;
|
|
49
|
+
_handleMouseLeave(): void;
|
|
50
|
+
_handleFocus(): void;
|
|
51
|
+
_handleBlur(): void;
|
|
52
|
+
_getAttributeOptions(): Partial<TooltipOptions>;
|
|
53
|
+
}
|
|
54
|
+
export interface TooltipComponentAttrs extends Attributes, TooltipOptions {
|
|
55
|
+
/** Element selector or reference to attach tooltip to */
|
|
56
|
+
targetSelector?: string;
|
|
57
|
+
}
|
|
58
|
+
export declare const TooltipComponent: FactoryComponent<TooltipComponentAttrs>;
|
|
59
|
+
export declare const initTooltips: (selector?: string, options?: TooltipOptions) => Tooltip[];
|