athena-ui-js 2.0.0 → 2.0.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/README.md +28 -4
- package/package.json +5 -2
- package/src/athena-ui.js +1 -1
- package/src/libs/config/config.js +1 -1
- package/src/libs/hephaestus/chartGenerator/chartGenerator.js +26 -2
- package/types/athena-ui.d.ts +96 -96
- package/types/chart.d.ts +1 -1
- package/types/classic.d.ts +1 -1
- package/types/components.d.ts +1 -1
- package/types/controls.d.ts +3 -3
- package/types/csv.d.ts +1 -1
- package/types/dialog.d.ts +2 -2
- package/types/dom.d.ts +1 -1
- package/types/feedback.d.ts +1 -1
- package/types/format.d.ts +1 -1
- package/types/forms.d.ts +2 -2
- package/types/i18n.d.ts +1 -1
- package/types/inputs.d.ts +4 -4
- package/types/libs/config/config.d.ts +3 -3
- package/types/libs/config/hooks.d.ts +8 -8
- package/types/libs/core/combobox.d.ts +10 -10
- package/types/libs/core/controls.d.ts +28 -28
- package/types/libs/core/cookies.d.ts +27 -27
- package/types/libs/core/csv.d.ts +12 -12
- package/types/libs/core/dateRange.d.ts +72 -72
- package/types/libs/core/dom.d.ts +65 -65
- package/types/libs/core/elementGenerator.d.ts +30 -30
- package/types/libs/core/errors.d.ts +29 -29
- package/types/libs/core/focus.d.ts +6 -6
- package/types/libs/core/format.d.ts +21 -21
- package/types/libs/core/hungarianControls.d.ts +2 -2
- package/types/libs/core/i18n.d.ts +17 -17
- package/types/libs/core/pagination.d.ts +5 -5
- package/types/libs/core/sanitize.d.ts +6 -6
- package/types/libs/core/tableMath.d.ts +26 -26
- package/types/libs/core/theme.d.ts +39 -39
- package/types/libs/core/validation.d.ts +56 -56
- package/types/libs/hephaestus/LayoutGenerator/basicLayoutGenerator.d.ts +10 -10
- package/types/libs/hephaestus/LayoutGenerator/footerContentGenerator.d.ts +4 -4
- package/types/libs/hephaestus/LayoutGenerator/headerContentGenerator.d.ts +20 -20
- package/types/libs/hephaestus/LayoutGenerator/wrapperContentGenerator.d.ts +1 -1
- package/types/libs/hephaestus/MenuGenerator/basicMenuGenerator.d.ts +14 -14
- package/types/libs/hephaestus/MenuGenerator/menuGenerator.d.ts +65 -65
- package/types/libs/hephaestus/auth/authState.d.ts +26 -26
- package/types/libs/hephaestus/auth/session.d.ts +26 -26
- package/types/libs/hephaestus/chartGenerator/chartGenerator.d.ts +2 -0
- package/types/libs/hephaestus/componentGenerator/componentGenerator.d.ts +222 -222
- package/types/libs/hephaestus/componentGenerator/themePicker.d.ts +24 -24
- package/types/libs/hephaestus/dialogGenerator/dialogGenerator.d.ts +120 -120
- package/types/libs/hephaestus/feedbackGenerator/feedbackGenerator.d.ts +86 -86
- package/types/libs/hephaestus/formGenerator/authForms.d.ts +122 -122
- package/types/libs/hephaestus/formGenerator/changePasswordFormGenerator.d.ts +6 -6
- package/types/libs/hephaestus/formGenerator/formBuilder.d.ts +113 -113
- package/types/libs/hephaestus/formGenerator/formUtils.d.ts +8 -8
- package/types/libs/hephaestus/formGenerator/loginFormGenerator.d.ts +11 -11
- package/types/libs/hephaestus/formGenerator/lostPasswordFormGenerator.d.ts +4 -4
- package/types/libs/hephaestus/formGenerator/registrationFormGenerator.d.ts +7 -7
- package/types/libs/hephaestus/hephaestus.d.ts +3 -3
- package/types/libs/hephaestus/inputGenerator/dropZoneGenerator.d.ts +48 -48
- package/types/libs/hephaestus/inputGenerator/inputGenerator.d.ts +185 -185
- package/types/libs/hephaestus/inputGenerator/richTextGenerator.d.ts +49 -49
- package/types/libs/hephaestus/modalGenerator/modalGenerator.d.ts +2 -2
- package/types/libs/hephaestus/navigationGenerator/navigationGenerator.d.ts +150 -150
- package/types/libs/hephaestus/router/matchRoute.d.ts +12 -12
- package/types/libs/hephaestus/router/router.d.ts +67 -67
- package/types/libs/hephaestus/tableGenerator/tableGenerator.d.ts +120 -120
- package/types/menu.d.ts +1 -1
- package/types/navigation.d.ts +1 -1
- package/types/res/themes/themes.d.ts +7 -7
- package/types/router.d.ts +1 -1
- package/types/sanitize.d.ts +1 -1
- package/types/session.d.ts +3 -3
- package/types/table.d.ts +1 -1
- package/types/testing.d.ts +27 -27
- package/types/theme.d.ts +2 -2
- package/types/validation.d.ts +1 -1
|
@@ -1,185 +1,185 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generates an input with suggestions. `options` is an array of strings / { value, text }, or a function
|
|
3
|
-
* (query) => options | Promise<options> for remote data.
|
|
4
|
-
*
|
|
5
|
-
* @param {object} options
|
|
6
|
-
* @param {string|Element} [options.parent]
|
|
7
|
-
* @param {string} [options.label]
|
|
8
|
-
* @param {Array|Function} options.options
|
|
9
|
-
* @param {number} [options.minChars=1] characters needed before suggestions show
|
|
10
|
-
* @param {boolean} [options.strict=false] only a value chosen from the list is accepted
|
|
11
|
-
* @param {(item: {value, text}) => void} [options.onSelect]
|
|
12
|
-
* @param {(value) => void} [options.onChange]
|
|
13
|
-
* @returns {{element: HTMLElement, input: HTMLInputElement, getValue: Function, setValue: Function}}
|
|
14
|
-
*/
|
|
15
|
-
export function generateAutocomplete(options?: {
|
|
16
|
-
parent?: string | Element;
|
|
17
|
-
label?: string;
|
|
18
|
-
options: any[] | Function;
|
|
19
|
-
minChars?: number;
|
|
20
|
-
strict?: boolean;
|
|
21
|
-
onSelect?: (item: {
|
|
22
|
-
value: any;
|
|
23
|
-
text: any;
|
|
24
|
-
}) => void;
|
|
25
|
-
onChange?: (value: any) => void;
|
|
26
|
-
}): {
|
|
27
|
-
element: HTMLElement;
|
|
28
|
-
input: HTMLInputElement;
|
|
29
|
-
getValue: Function;
|
|
30
|
-
setValue: Function;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* Generates a multiple selection with chips. Same options as generateAutocomplete; getValue returns an array.
|
|
34
|
-
*/
|
|
35
|
-
export function generateMultiSelect(options?: {}): any;
|
|
36
|
-
/**
|
|
37
|
-
* Generates a from / to date picker (the native pickers of the browser). The end date cannot be picked before
|
|
38
|
-
* the start date, and validate() reports a reversed range typed by hand.
|
|
39
|
-
*
|
|
40
|
-
* @param {object} options
|
|
41
|
-
* @param {string|Element} [options.parent]
|
|
42
|
-
* @param {string} [options.label]
|
|
43
|
-
* @param {string} [options.from] initial start, "2026-01-31"
|
|
44
|
-
* @param {string} [options.to] initial end
|
|
45
|
-
* @param {string} [options.min] earliest date
|
|
46
|
-
* @param {string} [options.max] latest date
|
|
47
|
-
* @param {(value: {from: string, to: string}) => void} [options.onChange]
|
|
48
|
-
* @returns {{element: HTMLElement, getValue: () => {from: string, to: string}, setValue: Function, validate: () => string}}
|
|
49
|
-
*/
|
|
50
|
-
export function generateDateRange(options?: {
|
|
51
|
-
parent?: string | Element;
|
|
52
|
-
label?: string;
|
|
53
|
-
from?: string;
|
|
54
|
-
to?: string;
|
|
55
|
-
min?: string;
|
|
56
|
-
max?: string;
|
|
57
|
-
onChange?: (value: {
|
|
58
|
-
from: string;
|
|
59
|
-
to: string;
|
|
60
|
-
}) => void;
|
|
61
|
-
}): {
|
|
62
|
-
element: HTMLElement;
|
|
63
|
-
getValue: () => {
|
|
64
|
-
from: string;
|
|
65
|
-
to: string;
|
|
66
|
-
};
|
|
67
|
-
setValue: Function;
|
|
68
|
-
validate: () => string;
|
|
69
|
-
};
|
|
70
|
-
/**
|
|
71
|
-
* Generates a from / to range with date AND time (datetime-local inputs), and a list of presets: last 15 minutes, hour,
|
|
72
|
-
* 24 hours, 7 days, 30 days, or "Custom". For log filters, charts and reports that need times, not whole days.
|
|
73
|
-
* A preset moves with the clock: getRange() measures it from now when it is called.
|
|
74
|
-
*
|
|
75
|
-
* @param {object} options
|
|
76
|
-
* @param {string|Element} [options.parent]
|
|
77
|
-
* @param {string} [options.label]
|
|
78
|
-
* @param {string} [options.from] initial start, "2026-01-31T08:00"
|
|
79
|
-
* @param {string} [options.to] initial end
|
|
80
|
-
* @param {string} [options.preset] id of the preset to start with ("15m", "1h", "24h", "7d", "30d")
|
|
81
|
-
* @param {{id: string, label?: string, labelKey?: string, minutes: number}[]} [options.presets] your own list
|
|
82
|
-
* @param {boolean} [options.seconds=false]
|
|
83
|
-
* @param {string} [options.min]
|
|
84
|
-
* @param {string} [options.max]
|
|
85
|
-
* @param {(value: {from: string, to: string, preset: string}) => void} [options.onChange]
|
|
86
|
-
* @returns {{element: HTMLElement, getValue: Function, getRange: () => ({from: Date|null, to: Date|null}), setValue: Function, validate: () => string}}
|
|
87
|
-
*/
|
|
88
|
-
export function generateDateTimeRange(options?: {
|
|
89
|
-
parent?: string | Element;
|
|
90
|
-
label?: string;
|
|
91
|
-
from?: string;
|
|
92
|
-
to?: string;
|
|
93
|
-
preset?: string;
|
|
94
|
-
presets?: {
|
|
95
|
-
id: string;
|
|
96
|
-
label?: string;
|
|
97
|
-
labelKey?: string;
|
|
98
|
-
minutes: number;
|
|
99
|
-
}[];
|
|
100
|
-
seconds?: boolean;
|
|
101
|
-
min?: string;
|
|
102
|
-
max?: string;
|
|
103
|
-
onChange?: (value: {
|
|
104
|
-
from: string;
|
|
105
|
-
to: string;
|
|
106
|
-
preset: string;
|
|
107
|
-
}) => void;
|
|
108
|
-
}): {
|
|
109
|
-
element: HTMLElement;
|
|
110
|
-
getValue: Function;
|
|
111
|
-
getRange: () => ({
|
|
112
|
-
from: Date | null;
|
|
113
|
-
to: Date | null;
|
|
114
|
-
});
|
|
115
|
-
setValue: Function;
|
|
116
|
-
validate: () => string;
|
|
117
|
-
};
|
|
118
|
-
/**
|
|
119
|
-
* Generates a drop zone with a file list and upload progress.
|
|
120
|
-
*
|
|
121
|
-
* @param {object} options
|
|
122
|
-
* @param {string|Element} [options.parent]
|
|
123
|
-
* @param {string} [options.accept] ".png,image/*"
|
|
124
|
-
* @param {boolean} [options.multiple=true]
|
|
125
|
-
* @param {number} [options.maxSize] bytes per file
|
|
126
|
-
* @param {string} [options.url] upload endpoint (multipart POST). Without it the files are only collected.
|
|
127
|
-
* @param {string} [options.fieldName="file"] name of the form field the file is sent as
|
|
128
|
-
* @param {Object<string,string>} [options.headers]
|
|
129
|
-
* @param {boolean} [options.autoUpload=true] upload as soon as files are added
|
|
130
|
-
* @param {(files: File[]) => void} [options.onSelect]
|
|
131
|
-
* @param {(file: File, percent: number) => void} [options.onProgress]
|
|
132
|
-
* @param {(file: File, response: string) => void} [options.onComplete]
|
|
133
|
-
* @param {(file: File, error: Error) => void} [options.onError]
|
|
134
|
-
* @returns {{element: HTMLElement, getFiles: () => File[], upload: () => Promise<void>, clear: Function}}
|
|
135
|
-
*/
|
|
136
|
-
export function generateFileUpload(options?: {
|
|
137
|
-
parent?: string | Element;
|
|
138
|
-
accept?: string;
|
|
139
|
-
multiple?: boolean;
|
|
140
|
-
maxSize?: number;
|
|
141
|
-
url?: string;
|
|
142
|
-
fieldName?: string;
|
|
143
|
-
headers?: {
|
|
144
|
-
[x: string]: string;
|
|
145
|
-
};
|
|
146
|
-
autoUpload?: boolean;
|
|
147
|
-
onSelect?: (files: File[]) => void;
|
|
148
|
-
onProgress?: (file: File, percent: number) => void;
|
|
149
|
-
onComplete?: (file: File, response: string) => void;
|
|
150
|
-
onError?: (file: File, error: Error) => void;
|
|
151
|
-
}): {
|
|
152
|
-
element: HTMLElement;
|
|
153
|
-
getFiles: () => File[];
|
|
154
|
-
upload: () => Promise<void>;
|
|
155
|
-
clear: Function;
|
|
156
|
-
};
|
|
157
|
-
/**
|
|
158
|
-
* Generates a multi step form (wizard).
|
|
159
|
-
*
|
|
160
|
-
* @param {object} options
|
|
161
|
-
* @param {string|Element} [options.parent]
|
|
162
|
-
* @param {{id?: string, title: string, content: *, validate?: () => (boolean|string|Promise<boolean|string>)}[]} options.steps
|
|
163
|
-
* content is text, a Node, an array, or a function called once when the step is first shown.
|
|
164
|
-
* `validate` runs before leaving the step forwards: false or an error text blocks it.
|
|
165
|
-
* @param {() => void} [options.onFinish] called when Finish is pressed on the last step
|
|
166
|
-
* @param {(index: number) => void} [options.onChange]
|
|
167
|
-
* @returns {{element: HTMLElement, next: Function, back: Function, goTo: Function, getCurrent: Function}}
|
|
168
|
-
*/
|
|
169
|
-
export function generateStepper(options?: {
|
|
170
|
-
parent?: string | Element;
|
|
171
|
-
steps: {
|
|
172
|
-
id?: string;
|
|
173
|
-
title: string;
|
|
174
|
-
content: any;
|
|
175
|
-
validate?: () => (boolean | string | Promise<boolean | string>);
|
|
176
|
-
}[];
|
|
177
|
-
onFinish?: () => void;
|
|
178
|
-
onChange?: (index: number) => void;
|
|
179
|
-
}): {
|
|
180
|
-
element: HTMLElement;
|
|
181
|
-
next: Function;
|
|
182
|
-
back: Function;
|
|
183
|
-
goTo: Function;
|
|
184
|
-
getCurrent: Function;
|
|
185
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* Generates an input with suggestions. `options` is an array of strings / { value, text }, or a function
|
|
3
|
+
* (query) => options | Promise<options> for remote data.
|
|
4
|
+
*
|
|
5
|
+
* @param {object} options
|
|
6
|
+
* @param {string|Element} [options.parent]
|
|
7
|
+
* @param {string} [options.label]
|
|
8
|
+
* @param {Array|Function} options.options
|
|
9
|
+
* @param {number} [options.minChars=1] characters needed before suggestions show
|
|
10
|
+
* @param {boolean} [options.strict=false] only a value chosen from the list is accepted
|
|
11
|
+
* @param {(item: {value, text}) => void} [options.onSelect]
|
|
12
|
+
* @param {(value) => void} [options.onChange]
|
|
13
|
+
* @returns {{element: HTMLElement, input: HTMLInputElement, getValue: Function, setValue: Function}}
|
|
14
|
+
*/
|
|
15
|
+
export function generateAutocomplete(options?: {
|
|
16
|
+
parent?: string | Element;
|
|
17
|
+
label?: string;
|
|
18
|
+
options: any[] | Function;
|
|
19
|
+
minChars?: number;
|
|
20
|
+
strict?: boolean;
|
|
21
|
+
onSelect?: (item: {
|
|
22
|
+
value: any;
|
|
23
|
+
text: any;
|
|
24
|
+
}) => void;
|
|
25
|
+
onChange?: (value: any) => void;
|
|
26
|
+
}): {
|
|
27
|
+
element: HTMLElement;
|
|
28
|
+
input: HTMLInputElement;
|
|
29
|
+
getValue: Function;
|
|
30
|
+
setValue: Function;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Generates a multiple selection with chips. Same options as generateAutocomplete; getValue returns an array.
|
|
34
|
+
*/
|
|
35
|
+
export function generateMultiSelect(options?: {}): any;
|
|
36
|
+
/**
|
|
37
|
+
* Generates a from / to date picker (the native pickers of the browser). The end date cannot be picked before
|
|
38
|
+
* the start date, and validate() reports a reversed range typed by hand.
|
|
39
|
+
*
|
|
40
|
+
* @param {object} options
|
|
41
|
+
* @param {string|Element} [options.parent]
|
|
42
|
+
* @param {string} [options.label]
|
|
43
|
+
* @param {string} [options.from] initial start, "2026-01-31"
|
|
44
|
+
* @param {string} [options.to] initial end
|
|
45
|
+
* @param {string} [options.min] earliest date
|
|
46
|
+
* @param {string} [options.max] latest date
|
|
47
|
+
* @param {(value: {from: string, to: string}) => void} [options.onChange]
|
|
48
|
+
* @returns {{element: HTMLElement, getValue: () => {from: string, to: string}, setValue: Function, validate: () => string}}
|
|
49
|
+
*/
|
|
50
|
+
export function generateDateRange(options?: {
|
|
51
|
+
parent?: string | Element;
|
|
52
|
+
label?: string;
|
|
53
|
+
from?: string;
|
|
54
|
+
to?: string;
|
|
55
|
+
min?: string;
|
|
56
|
+
max?: string;
|
|
57
|
+
onChange?: (value: {
|
|
58
|
+
from: string;
|
|
59
|
+
to: string;
|
|
60
|
+
}) => void;
|
|
61
|
+
}): {
|
|
62
|
+
element: HTMLElement;
|
|
63
|
+
getValue: () => {
|
|
64
|
+
from: string;
|
|
65
|
+
to: string;
|
|
66
|
+
};
|
|
67
|
+
setValue: Function;
|
|
68
|
+
validate: () => string;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Generates a from / to range with date AND time (datetime-local inputs), and a list of presets: last 15 minutes, hour,
|
|
72
|
+
* 24 hours, 7 days, 30 days, or "Custom". For log filters, charts and reports that need times, not whole days.
|
|
73
|
+
* A preset moves with the clock: getRange() measures it from now when it is called.
|
|
74
|
+
*
|
|
75
|
+
* @param {object} options
|
|
76
|
+
* @param {string|Element} [options.parent]
|
|
77
|
+
* @param {string} [options.label]
|
|
78
|
+
* @param {string} [options.from] initial start, "2026-01-31T08:00"
|
|
79
|
+
* @param {string} [options.to] initial end
|
|
80
|
+
* @param {string} [options.preset] id of the preset to start with ("15m", "1h", "24h", "7d", "30d")
|
|
81
|
+
* @param {{id: string, label?: string, labelKey?: string, minutes: number}[]} [options.presets] your own list
|
|
82
|
+
* @param {boolean} [options.seconds=false]
|
|
83
|
+
* @param {string} [options.min]
|
|
84
|
+
* @param {string} [options.max]
|
|
85
|
+
* @param {(value: {from: string, to: string, preset: string}) => void} [options.onChange]
|
|
86
|
+
* @returns {{element: HTMLElement, getValue: Function, getRange: () => ({from: Date|null, to: Date|null}), setValue: Function, validate: () => string}}
|
|
87
|
+
*/
|
|
88
|
+
export function generateDateTimeRange(options?: {
|
|
89
|
+
parent?: string | Element;
|
|
90
|
+
label?: string;
|
|
91
|
+
from?: string;
|
|
92
|
+
to?: string;
|
|
93
|
+
preset?: string;
|
|
94
|
+
presets?: {
|
|
95
|
+
id: string;
|
|
96
|
+
label?: string;
|
|
97
|
+
labelKey?: string;
|
|
98
|
+
minutes: number;
|
|
99
|
+
}[];
|
|
100
|
+
seconds?: boolean;
|
|
101
|
+
min?: string;
|
|
102
|
+
max?: string;
|
|
103
|
+
onChange?: (value: {
|
|
104
|
+
from: string;
|
|
105
|
+
to: string;
|
|
106
|
+
preset: string;
|
|
107
|
+
}) => void;
|
|
108
|
+
}): {
|
|
109
|
+
element: HTMLElement;
|
|
110
|
+
getValue: Function;
|
|
111
|
+
getRange: () => ({
|
|
112
|
+
from: Date | null;
|
|
113
|
+
to: Date | null;
|
|
114
|
+
});
|
|
115
|
+
setValue: Function;
|
|
116
|
+
validate: () => string;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Generates a drop zone with a file list and upload progress.
|
|
120
|
+
*
|
|
121
|
+
* @param {object} options
|
|
122
|
+
* @param {string|Element} [options.parent]
|
|
123
|
+
* @param {string} [options.accept] ".png,image/*"
|
|
124
|
+
* @param {boolean} [options.multiple=true]
|
|
125
|
+
* @param {number} [options.maxSize] bytes per file
|
|
126
|
+
* @param {string} [options.url] upload endpoint (multipart POST). Without it the files are only collected.
|
|
127
|
+
* @param {string} [options.fieldName="file"] name of the form field the file is sent as
|
|
128
|
+
* @param {Object<string,string>} [options.headers]
|
|
129
|
+
* @param {boolean} [options.autoUpload=true] upload as soon as files are added
|
|
130
|
+
* @param {(files: File[]) => void} [options.onSelect]
|
|
131
|
+
* @param {(file: File, percent: number) => void} [options.onProgress]
|
|
132
|
+
* @param {(file: File, response: string) => void} [options.onComplete]
|
|
133
|
+
* @param {(file: File, error: Error) => void} [options.onError]
|
|
134
|
+
* @returns {{element: HTMLElement, getFiles: () => File[], upload: () => Promise<void>, clear: Function}}
|
|
135
|
+
*/
|
|
136
|
+
export function generateFileUpload(options?: {
|
|
137
|
+
parent?: string | Element;
|
|
138
|
+
accept?: string;
|
|
139
|
+
multiple?: boolean;
|
|
140
|
+
maxSize?: number;
|
|
141
|
+
url?: string;
|
|
142
|
+
fieldName?: string;
|
|
143
|
+
headers?: {
|
|
144
|
+
[x: string]: string;
|
|
145
|
+
};
|
|
146
|
+
autoUpload?: boolean;
|
|
147
|
+
onSelect?: (files: File[]) => void;
|
|
148
|
+
onProgress?: (file: File, percent: number) => void;
|
|
149
|
+
onComplete?: (file: File, response: string) => void;
|
|
150
|
+
onError?: (file: File, error: Error) => void;
|
|
151
|
+
}): {
|
|
152
|
+
element: HTMLElement;
|
|
153
|
+
getFiles: () => File[];
|
|
154
|
+
upload: () => Promise<void>;
|
|
155
|
+
clear: Function;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Generates a multi step form (wizard).
|
|
159
|
+
*
|
|
160
|
+
* @param {object} options
|
|
161
|
+
* @param {string|Element} [options.parent]
|
|
162
|
+
* @param {{id?: string, title: string, content: *, validate?: () => (boolean|string|Promise<boolean|string>)}[]} options.steps
|
|
163
|
+
* content is text, a Node, an array, or a function called once when the step is first shown.
|
|
164
|
+
* `validate` runs before leaving the step forwards: false or an error text blocks it.
|
|
165
|
+
* @param {() => void} [options.onFinish] called when Finish is pressed on the last step
|
|
166
|
+
* @param {(index: number) => void} [options.onChange]
|
|
167
|
+
* @returns {{element: HTMLElement, next: Function, back: Function, goTo: Function, getCurrent: Function}}
|
|
168
|
+
*/
|
|
169
|
+
export function generateStepper(options?: {
|
|
170
|
+
parent?: string | Element;
|
|
171
|
+
steps: {
|
|
172
|
+
id?: string;
|
|
173
|
+
title: string;
|
|
174
|
+
content: any;
|
|
175
|
+
validate?: () => (boolean | string | Promise<boolean | string>);
|
|
176
|
+
}[];
|
|
177
|
+
onFinish?: () => void;
|
|
178
|
+
onChange?: (index: number) => void;
|
|
179
|
+
}): {
|
|
180
|
+
element: HTMLElement;
|
|
181
|
+
next: Function;
|
|
182
|
+
back: Function;
|
|
183
|
+
goTo: Function;
|
|
184
|
+
getCurrent: Function;
|
|
185
|
+
};
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generates a rich text editor. The content is HTML restricted to a safe set of tags (paragraphs, headings,
|
|
3
|
-
* bold / italic / underline / strike, lists, quotes, code, links); everything else, including scripts, styles,
|
|
4
|
-
* event attributes and `javascript:` links, is removed when the content is set, pasted and read.
|
|
5
|
-
*
|
|
6
|
-
* @param {object} options
|
|
7
|
-
* @param {string|Element} [options.parent]
|
|
8
|
-
* @param {string} [options.id]
|
|
9
|
-
* @param {string} [options.label]
|
|
10
|
-
* @param {string} [options.value] initial HTML
|
|
11
|
-
* @param {string} [options.placeholder]
|
|
12
|
-
* @param {string[]} [options.toolbar] button names (bold, italic, underline, strike, h2, h3, quote, ul, ol, link,
|
|
13
|
-
* unlink, clear, undo, redo, source) and "|" separators. `source` switches between the visual editor and
|
|
14
|
-
* the sanitized HTML source.
|
|
15
|
-
* @param {number} [options.minHeight=140] px
|
|
16
|
-
* @param {boolean} [options.disabled]
|
|
17
|
-
* @param {(html: string) => void} [options.onChange]
|
|
18
|
-
* @returns {{element: HTMLElement, editor: HTMLElement, getValue: () => string, setValue: (html: string) => void,
|
|
19
|
-
* getText: () => string, focus: Function}}
|
|
20
|
-
*/
|
|
21
|
-
export function createRichText(options?: {
|
|
22
|
-
parent?: string | Element;
|
|
23
|
-
id?: string;
|
|
24
|
-
label?: string;
|
|
25
|
-
value?: string;
|
|
26
|
-
placeholder?: string;
|
|
27
|
-
toolbar?: string[];
|
|
28
|
-
minHeight?: number;
|
|
29
|
-
disabled?: boolean;
|
|
30
|
-
onChange?: (html: string) => void;
|
|
31
|
-
}): {
|
|
32
|
-
element: HTMLElement;
|
|
33
|
-
editor: HTMLElement;
|
|
34
|
-
getValue: () => string;
|
|
35
|
-
setValue: (html: string) => void;
|
|
36
|
-
getText: () => string;
|
|
37
|
-
focus: Function;
|
|
38
|
-
};
|
|
39
|
-
/** Generates a labelled rich text editor, see createRichText. */
|
|
40
|
-
export function generateRichText(options?: {}): any;
|
|
41
|
-
export function createWysiwyg(options?: {}): {
|
|
42
|
-
element: HTMLElement;
|
|
43
|
-
editor: HTMLElement;
|
|
44
|
-
getValue: () => string;
|
|
45
|
-
setValue: (html: string) => void;
|
|
46
|
-
getText: () => string;
|
|
47
|
-
focus: Function;
|
|
48
|
-
};
|
|
49
|
-
export function generateWysiwyg(options?: {}): any;
|
|
1
|
+
/**
|
|
2
|
+
* Generates a rich text editor. The content is HTML restricted to a safe set of tags (paragraphs, headings,
|
|
3
|
+
* bold / italic / underline / strike, lists, quotes, code, links); everything else, including scripts, styles,
|
|
4
|
+
* event attributes and `javascript:` links, is removed when the content is set, pasted and read.
|
|
5
|
+
*
|
|
6
|
+
* @param {object} options
|
|
7
|
+
* @param {string|Element} [options.parent]
|
|
8
|
+
* @param {string} [options.id]
|
|
9
|
+
* @param {string} [options.label]
|
|
10
|
+
* @param {string} [options.value] initial HTML
|
|
11
|
+
* @param {string} [options.placeholder]
|
|
12
|
+
* @param {string[]} [options.toolbar] button names (bold, italic, underline, strike, h2, h3, quote, ul, ol, link,
|
|
13
|
+
* unlink, clear, undo, redo, source) and "|" separators. `source` switches between the visual editor and
|
|
14
|
+
* the sanitized HTML source.
|
|
15
|
+
* @param {number} [options.minHeight=140] px
|
|
16
|
+
* @param {boolean} [options.disabled]
|
|
17
|
+
* @param {(html: string) => void} [options.onChange]
|
|
18
|
+
* @returns {{element: HTMLElement, editor: HTMLElement, getValue: () => string, setValue: (html: string) => void,
|
|
19
|
+
* getText: () => string, focus: Function}}
|
|
20
|
+
*/
|
|
21
|
+
export function createRichText(options?: {
|
|
22
|
+
parent?: string | Element;
|
|
23
|
+
id?: string;
|
|
24
|
+
label?: string;
|
|
25
|
+
value?: string;
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
toolbar?: string[];
|
|
28
|
+
minHeight?: number;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
onChange?: (html: string) => void;
|
|
31
|
+
}): {
|
|
32
|
+
element: HTMLElement;
|
|
33
|
+
editor: HTMLElement;
|
|
34
|
+
getValue: () => string;
|
|
35
|
+
setValue: (html: string) => void;
|
|
36
|
+
getText: () => string;
|
|
37
|
+
focus: Function;
|
|
38
|
+
};
|
|
39
|
+
/** Generates a labelled rich text editor, see createRichText. */
|
|
40
|
+
export function generateRichText(options?: {}): any;
|
|
41
|
+
export function createWysiwyg(options?: {}): {
|
|
42
|
+
element: HTMLElement;
|
|
43
|
+
editor: HTMLElement;
|
|
44
|
+
getValue: () => string;
|
|
45
|
+
setValue: (html: string) => void;
|
|
46
|
+
getText: () => string;
|
|
47
|
+
focus: Function;
|
|
48
|
+
};
|
|
49
|
+
export function generateWysiwyg(options?: {}): any;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export function openModal(id?: string): void;
|
|
2
|
-
export function closeModal(id?: string): void;
|
|
1
|
+
export function openModal(id?: string): void;
|
|
2
|
+
export function closeModal(id?: string): void;
|