memorial-ui-component-library 1.0.0-dev.2184
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 +17 -0
- package/dist/demo.html +1 -0
- package/dist/memorial-ui-component-library.common.js +29204 -0
- package/dist/memorial-ui-component-library.common.js.map +1 -0
- package/dist/memorial-ui-component-library.css +1 -0
- package/dist/memorial-ui-component-library.umd.js +29223 -0
- package/dist/memorial-ui-component-library.umd.js.map +1 -0
- package/dist/memorial-ui-component-library.umd.min.js +15 -0
- package/dist/memorial-ui-component-library.umd.min.js.map +1 -0
- package/dist/report.html +53 -0
- package/package.json +62 -0
- package/src/assets/scss/_transitions.scss +71 -0
- package/src/assets/scss/_variables.module.scss +56 -0
- package/src/assets/scss/main.scss +12 -0
- package/src/assets/scss/scrollbar.scss +33 -0
- package/types/async-validator.d.ts +147 -0
- package/types/autocomplete.d.ts +94 -0
- package/types/button.d.ts +74 -0
- package/types/card.d.ts +27 -0
- package/types/checkbox.d.ts +23 -0
- package/types/component.d.ts +17 -0
- package/types/dialog.d.ts +643 -0
- package/types/divider.d.ts +33 -0
- package/types/form.d.ts +122 -0
- package/types/index.d.ts +4 -0
- package/types/input.d.ts +53 -0
- package/types/loader.d.ts +28 -0
- package/types/memorial-ui.d.ts +41 -0
- package/types/options.d.ts +20 -0
- package/types/popout-menu.d.ts +14 -0
- package/types/radio.d.ts +45 -0
- package/types/rater.d.ts +34 -0
- package/types/select.d.ts +77 -0
package/types/form.d.ts
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { MemorialUIComponent, MemorialUIPluginComponent } from './component';
|
|
2
|
+
import {
|
|
3
|
+
ValidationResult,
|
|
4
|
+
SchemaDescriptor,
|
|
5
|
+
RuleProperty
|
|
6
|
+
} from './async-validator';
|
|
7
|
+
|
|
8
|
+
export type SdValidationTriggerType = 'blur' | 'change' | 'input';
|
|
9
|
+
export type SdValidationTrigger =
|
|
10
|
+
| SdValidationTriggerType
|
|
11
|
+
| SdValidationTriggerType[];
|
|
12
|
+
|
|
13
|
+
export type SdFormValidationState = 'success' | 'error' | 'validating' | '';
|
|
14
|
+
|
|
15
|
+
export declare class SdValidationResult {
|
|
16
|
+
valid: boolean;
|
|
17
|
+
result?: ValidationResult;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Form Item component */
|
|
21
|
+
export declare abstract class SdFormWidget extends MemorialUIComponent {
|
|
22
|
+
/** The parent form if nested within one. */
|
|
23
|
+
form: SdForm | null;
|
|
24
|
+
|
|
25
|
+
/** The the containing form item if nested within one. */
|
|
26
|
+
formItem: SdFormItem | null;
|
|
27
|
+
|
|
28
|
+
/** The widgets name. */
|
|
29
|
+
name: string;
|
|
30
|
+
|
|
31
|
+
/** Computed name attribute, takes into account the FormItem's label if it exists. */
|
|
32
|
+
nameAttr: string;
|
|
33
|
+
|
|
34
|
+
/** The widgets current validation state within the context of its form. */
|
|
35
|
+
validationState: SdFormValidationState;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Broadcasts an event to the parent form.
|
|
39
|
+
* @param {String} type the type of event associated to the triggering action.
|
|
40
|
+
* @param {Any} value the value to emit to the form.
|
|
41
|
+
* @param {Event} event the Event to propagate
|
|
42
|
+
*/
|
|
43
|
+
protected broadcastFormEvent(
|
|
44
|
+
type: SdValidationTrigger,
|
|
45
|
+
value: any,
|
|
46
|
+
event: Event | undefined
|
|
47
|
+
): void;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Form component */
|
|
51
|
+
export declare class SdForm extends MemorialUIPluginComponent {
|
|
52
|
+
/** Object model to bind the form to. */
|
|
53
|
+
model?: { [field: string]: any };
|
|
54
|
+
|
|
55
|
+
/** The form validation rules to apply to the specified model properties. */
|
|
56
|
+
rules?: SchemaDescriptor;
|
|
57
|
+
|
|
58
|
+
/** Collection of form items active within the form. */
|
|
59
|
+
fields: SdFormItem[];
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The event types which should trigger validation.
|
|
63
|
+
* @default ['blur', 'change']
|
|
64
|
+
* */
|
|
65
|
+
triggers: SdValidationTrigger;
|
|
66
|
+
|
|
67
|
+
/** Whether the form is currently being reset. */
|
|
68
|
+
resetting: boolean;
|
|
69
|
+
|
|
70
|
+
/** Reset the form model to its original value and clear all validation errors/messages. */
|
|
71
|
+
reset(): void;
|
|
72
|
+
|
|
73
|
+
/** Clear all form validation errors and messages. */
|
|
74
|
+
clearErrors(...props: string[]): void;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Validates all properties on the form model.
|
|
78
|
+
*/
|
|
79
|
+
validateAsync(): Promise<SdValidationResult>;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Validates a single property on the form model.
|
|
83
|
+
* @property {String} prop the property name of the field to validate.
|
|
84
|
+
*/
|
|
85
|
+
validateItemAsync(prop: string): Promise<SdValidationResult>;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** Form Item component */
|
|
89
|
+
export declare class SdFormItem extends MemorialUIComponent {
|
|
90
|
+
/** The form items display label. */
|
|
91
|
+
label: string;
|
|
92
|
+
|
|
93
|
+
/** The of the associated property name on the forms model in which the form item is bound to. Only needs to be set if the form item needs to be included in validation. */
|
|
94
|
+
prop?: string;
|
|
95
|
+
|
|
96
|
+
/** Whether this item is a required validation field. */
|
|
97
|
+
required?: boolean;
|
|
98
|
+
|
|
99
|
+
/** Extended validation properties to include for the form item. */
|
|
100
|
+
rules?: RuleProperty | RuleProperty[];
|
|
101
|
+
|
|
102
|
+
/** The widgets current validation state within the context of its form. */
|
|
103
|
+
validationState: SdFormValidationState;
|
|
104
|
+
|
|
105
|
+
/** The validation error message if the form item is in an **error** state.*/
|
|
106
|
+
validationMessage: string;
|
|
107
|
+
|
|
108
|
+
/** The initial value of the form items property within the form model.*/
|
|
109
|
+
initialValue?: any;
|
|
110
|
+
|
|
111
|
+
/** All instances of SdFormWidget components within the form item. */
|
|
112
|
+
widgets: SdFormWidget[];
|
|
113
|
+
|
|
114
|
+
/** The parent form. */
|
|
115
|
+
form: SdForm;
|
|
116
|
+
|
|
117
|
+
/** The value of the form items field within the model bound to the form. */
|
|
118
|
+
fieldValue: any;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
declare const plugin: SdForm;
|
|
122
|
+
export default plugin;
|
package/types/index.d.ts
ADDED
package/types/input.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { MemorialUIFormPluginComponent } from './component';
|
|
2
|
+
|
|
3
|
+
export type SdInputType =
|
|
4
|
+
| 'date'
|
|
5
|
+
| 'datetime-local'
|
|
6
|
+
| 'email'
|
|
7
|
+
| 'month'
|
|
8
|
+
| 'number'
|
|
9
|
+
| 'password'
|
|
10
|
+
| 'range'
|
|
11
|
+
| 'search'
|
|
12
|
+
| 'tel'
|
|
13
|
+
| 'phone'
|
|
14
|
+
| 'text'
|
|
15
|
+
| 'time'
|
|
16
|
+
| 'url'
|
|
17
|
+
| 'week'
|
|
18
|
+
| 'textarea'
|
|
19
|
+
| 'image'
|
|
20
|
+
| 'file'
|
|
21
|
+
| 'color'
|
|
22
|
+
| 'hidden';
|
|
23
|
+
|
|
24
|
+
/** Input component */
|
|
25
|
+
export declare class SdInput extends MemorialUIFormPluginComponent {
|
|
26
|
+
/** The inputs value. */
|
|
27
|
+
value?: any;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The type of the input.
|
|
31
|
+
* @default 'text'
|
|
32
|
+
*/
|
|
33
|
+
type: SdInputType;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Whether to display a clear button that will reset the components value.
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
clearable: boolean;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Disables spinkit controls like numeric arrows in the number type and dropdown calendar in date type.
|
|
43
|
+
* Compatible with Chrome/Firefox.
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
disableSpinkit: boolean;
|
|
47
|
+
|
|
48
|
+
/** Resets the components value. */
|
|
49
|
+
clear(): void;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
declare const plugin: SdInput;
|
|
53
|
+
export default plugin;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { MemorialUIPluginComponent } from './component';
|
|
2
|
+
|
|
3
|
+
export type SdLoaderType = 'elipse' | 'circle';
|
|
4
|
+
|
|
5
|
+
/** Loader component */
|
|
6
|
+
export declare class SdLoader extends MemorialUIPluginComponent {
|
|
7
|
+
/**
|
|
8
|
+
* The type of loader.
|
|
9
|
+
* **NOTE:** Currently only supports 'elipse'
|
|
10
|
+
* @default 'elipse'
|
|
11
|
+
*/
|
|
12
|
+
type: SdLoaderType;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The loader's color.
|
|
16
|
+
* @default '#ee3224'
|
|
17
|
+
*/
|
|
18
|
+
color: string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The loader's size.
|
|
22
|
+
* @default '16px'
|
|
23
|
+
*/
|
|
24
|
+
size: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare const plugin: SdLoader;
|
|
28
|
+
export default plugin;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import Vue, { DirectiveOptions } from 'vue';
|
|
2
|
+
import { MemorialLib, MemorialLibComponentOptions } from './options';
|
|
3
|
+
|
|
4
|
+
declare global {
|
|
5
|
+
interface Window {
|
|
6
|
+
$memorial: MemorialLib;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export declare const $memorial: MemorialLib;
|
|
11
|
+
|
|
12
|
+
export declare const Directives: {
|
|
13
|
+
/**
|
|
14
|
+
* Executes a callback whenever the user clicks outside of the element the directive is attached to.
|
|
15
|
+
*/
|
|
16
|
+
ClickOutside: DirectiveOptions;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Install all memorial-ui-component-library components into Vue.
|
|
20
|
+
* Please do not invoke this method directly.
|
|
21
|
+
* Call `Vue.use(MemorialUI)` to install.
|
|
22
|
+
*/
|
|
23
|
+
export function install(
|
|
24
|
+
vue: typeof Vue,
|
|
25
|
+
options?: MemorialLibComponentOptions
|
|
26
|
+
): void;
|
|
27
|
+
|
|
28
|
+
export * from './autocomplete';
|
|
29
|
+
export * from './button';
|
|
30
|
+
export * from './card';
|
|
31
|
+
export * from './checkbox';
|
|
32
|
+
export * from './component';
|
|
33
|
+
export * from './dialog';
|
|
34
|
+
export * from './divider';
|
|
35
|
+
export * from './form';
|
|
36
|
+
export * from './input';
|
|
37
|
+
export * from './loader';
|
|
38
|
+
export * from './popout-menu';
|
|
39
|
+
export * from './radio';
|
|
40
|
+
export * from './rater';
|
|
41
|
+
export * from './select';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface MemorialLibComponentOptions {
|
|
2
|
+
button: SdButtonPluginOptions;
|
|
3
|
+
dialog: SdDialogPluginOptions;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface MemorialLib {
|
|
7
|
+
version: string;
|
|
8
|
+
options: MemorialLibComponentOptions;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface SdButtonPluginOptions {
|
|
12
|
+
size: 'mini' | 'small' | 'medium' | 'large';
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface SdDialogPluginOptions {
|
|
16
|
+
/**
|
|
17
|
+
* Whether to reject or resolve the promise on cancel.
|
|
18
|
+
*/
|
|
19
|
+
rejectOnCancel: boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MemorialUIPluginComponent } from './component';
|
|
2
|
+
|
|
3
|
+
export declare class SdPopoutMenu extends MemorialUIPluginComponent {
|
|
4
|
+
/**
|
|
5
|
+
* Whether the menu is open.
|
|
6
|
+
*/
|
|
7
|
+
open: boolean;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Sets the visibility state of the menu, being either *open* or *closed*.
|
|
11
|
+
* @param state The visibility state of the menu
|
|
12
|
+
*/
|
|
13
|
+
setState(state: 'open' | 'closed'): void;
|
|
14
|
+
}
|
package/types/radio.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import Vue from 'vue';
|
|
2
|
+
import { MemorialUIFormPluginComponent } from './component';
|
|
3
|
+
import { SdFormWidget } from './form';
|
|
4
|
+
|
|
5
|
+
export type SdRadioGroupDirection = 'row' | 'column';
|
|
6
|
+
|
|
7
|
+
/** Radio component */
|
|
8
|
+
export declare class SdRadio extends MemorialUIFormPluginComponent {
|
|
9
|
+
$refs: Vue['$refs'] & {
|
|
10
|
+
radio: HTMLInputElement;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/** The current state value of the component. This value changes in response to what the component is bound to (v-model). */
|
|
14
|
+
state: any;
|
|
15
|
+
|
|
16
|
+
/** The value the radio component represents. */
|
|
17
|
+
value: any;
|
|
18
|
+
|
|
19
|
+
/** Whether the radio component is disabled. */
|
|
20
|
+
disabled: boolean;
|
|
21
|
+
|
|
22
|
+
/** Whether the radio is checked. */
|
|
23
|
+
checked: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Radio Group component */
|
|
27
|
+
export declare class SdRadioGroup extends SdFormWidget {
|
|
28
|
+
/** The selected value from within the radio group. */
|
|
29
|
+
value: any;
|
|
30
|
+
|
|
31
|
+
/** The name of the radio group. */
|
|
32
|
+
name: string;
|
|
33
|
+
|
|
34
|
+
/** Whether the radio group and its containing radio components are disabled. */
|
|
35
|
+
disabled: boolean;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The direction in which the radio group displays its radio components.
|
|
39
|
+
* @default 'column'
|
|
40
|
+
*/
|
|
41
|
+
direction: SdRadioGroupDirection;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
declare const plugin: SdRadio;
|
|
45
|
+
export default plugin;
|
package/types/rater.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { MemorialUIPluginComponent } from './component';
|
|
2
|
+
|
|
3
|
+
export type SdRaterShapeType = 'heart' | 'star' | 'circle';
|
|
4
|
+
|
|
5
|
+
export declare class SdRater extends MemorialUIPluginComponent {
|
|
6
|
+
/**
|
|
7
|
+
* Rater value
|
|
8
|
+
*/
|
|
9
|
+
value: number | null;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Rater Icon Shape
|
|
13
|
+
* @default 'heart'
|
|
14
|
+
*/
|
|
15
|
+
shape: SdRaterShapeType;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Number of shapes in rater
|
|
19
|
+
* @default 5
|
|
20
|
+
*/
|
|
21
|
+
count: number;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Disbled state of the rater
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
disabled: boolean;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Read only state of the rater
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
readonly: boolean;
|
|
34
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import Vue from 'vue';
|
|
2
|
+
import {
|
|
3
|
+
MemorialUIComponent,
|
|
4
|
+
MemorialUIFormPluginComponent
|
|
5
|
+
} from './component';
|
|
6
|
+
|
|
7
|
+
/** Select component */
|
|
8
|
+
export declare class SdSelect extends MemorialUIFormPluginComponent {
|
|
9
|
+
$refs: Vue['$refs'] & {
|
|
10
|
+
select: HTMLSelectElement;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/** The value of the selected option. */
|
|
14
|
+
value: any;
|
|
15
|
+
|
|
16
|
+
/** Whether the select component is disabled. */
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
|
|
19
|
+
/** Whether the components value can be cleared. */
|
|
20
|
+
clearable: boolean;
|
|
21
|
+
|
|
22
|
+
/** Whether to force the component to always use the **native** select menu for both desktop and mobile. */
|
|
23
|
+
native: boolean;
|
|
24
|
+
|
|
25
|
+
/** Whether to force the component to always use the **custom** select menu for both desktop and mobile. */
|
|
26
|
+
custom: boolean;
|
|
27
|
+
|
|
28
|
+
/** Whether the select menu is open. */
|
|
29
|
+
open: boolean;
|
|
30
|
+
|
|
31
|
+
/** Resets the components value. */
|
|
32
|
+
clear(): void;
|
|
33
|
+
|
|
34
|
+
/** Toggles the open state of the select menu. */
|
|
35
|
+
toggleMenu(): void;
|
|
36
|
+
|
|
37
|
+
/** Closes the select menu. */
|
|
38
|
+
close(): void;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* A function which updates the components value and emits an event
|
|
42
|
+
* in order to make the component usable with v-model.
|
|
43
|
+
* This method can be injected into child components.
|
|
44
|
+
* @param value - The updated value.
|
|
45
|
+
* @param type - The types of events to emit (input, change)
|
|
46
|
+
* @returns {void}
|
|
47
|
+
*/
|
|
48
|
+
notifyOfUpdatedValue(value: any, type: Array<'change' | 'input'>): void;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Select option component */
|
|
52
|
+
export declare class SdSelectOption extends MemorialUIComponent {
|
|
53
|
+
/** The options value. */
|
|
54
|
+
value: any;
|
|
55
|
+
|
|
56
|
+
/** The label to display in the select box when this item has been selected. If this is not assigned the string representation of {@link value} is used.*/
|
|
57
|
+
label?: string;
|
|
58
|
+
|
|
59
|
+
/** Whether the option is disabled. */
|
|
60
|
+
disabled: boolean;
|
|
61
|
+
|
|
62
|
+
/** Toggles the open state of the select menu. */
|
|
63
|
+
toggleMenu(): void;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* A function which updates the components value and emits an event
|
|
67
|
+
* in order to make the component usable with v-model.
|
|
68
|
+
* This method can be injected into child components.
|
|
69
|
+
* @param value - The updated value.
|
|
70
|
+
* @param type - The types of events to emit (input, change)
|
|
71
|
+
* @returns {void}
|
|
72
|
+
*/
|
|
73
|
+
notifyOfUpdatedValue(value: any, type: Array<'change' | 'input'>): void;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
declare const plugin: SdSelect;
|
|
77
|
+
export default plugin;
|