fomantic-ui 2.9.4-beta.8 → 2.9.4-beta.80
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/.all-contributorsrc +20 -1
- package/.eslintrc.js +17 -0
- package/.github/FUNDING.yml +1 -1
- package/.github/workflows/ci.yml +6 -6
- package/.github/workflows/depsreview.yml +14 -0
- package/.github/workflows/nightly.yml +1 -1
- package/.github/workflows/release.yml +1 -1
- package/CONTRIBUTORS.md +2 -0
- package/README.md +2 -12
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +4 -2
- package/dist/components/accordion.min.css +1 -1
- package/dist/components/accordion.min.js +2 -2
- package/dist/components/ad.css +1 -1
- package/dist/components/ad.min.css +1 -1
- package/dist/components/api.js +7 -3
- package/dist/components/api.min.js +2 -2
- package/dist/components/breadcrumb.css +1 -1
- package/dist/components/breadcrumb.min.css +1 -1
- package/dist/components/button.css +21 -3
- package/dist/components/button.min.css +2 -2
- package/dist/components/calendar.css +1 -1
- package/dist/components/calendar.js +15 -3
- package/dist/components/calendar.min.css +1 -1
- package/dist/components/calendar.min.js +3 -3
- package/dist/components/card.css +1 -1
- package/dist/components/card.min.css +1 -1
- package/dist/components/checkbox.css +1 -1
- package/dist/components/checkbox.js +10 -4
- package/dist/components/checkbox.min.css +1 -1
- package/dist/components/checkbox.min.js +3 -3
- package/dist/components/comment.css +1 -1
- package/dist/components/comment.min.css +1 -1
- package/dist/components/container.css +1 -1
- package/dist/components/container.min.css +1 -1
- package/dist/components/dimmer.css +7 -3
- package/dist/components/dimmer.js +4 -2
- package/dist/components/dimmer.min.css +2 -2
- package/dist/components/dimmer.min.js +2 -2
- package/dist/components/divider.css +1 -1
- package/dist/components/divider.min.css +1 -1
- package/dist/components/dropdown.css +46 -38
- package/dist/components/dropdown.js +104 -33
- package/dist/components/dropdown.min.css +2 -2
- package/dist/components/dropdown.min.js +3 -3
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +17 -7
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +3 -3
- package/dist/components/emoji.css +4309 -3713
- package/dist/components/emoji.min.css +2 -2
- package/dist/components/feed.css +12 -1
- package/dist/components/feed.min.css +2 -2
- package/dist/components/flag.css +3 -1
- package/dist/components/flag.min.css +2 -2
- package/dist/components/flyout.css +1 -1
- package/dist/components/flyout.js +4 -2
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +15 -3
- package/dist/components/form.js +66 -23
- package/dist/components/form.min.css +2 -2
- package/dist/components/form.min.js +3 -3
- package/dist/components/grid.css +5 -5
- package/dist/components/grid.min.css +2 -2
- package/dist/components/header.css +1 -1
- package/dist/components/header.min.css +1 -1
- package/dist/components/icon.css +1 -1
- package/dist/components/icon.min.css +1 -1
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +1 -1
- package/dist/components/input.min.css +1 -1
- package/dist/components/item.css +1 -1
- package/dist/components/item.min.css +1 -1
- package/dist/components/label.css +7 -1
- package/dist/components/label.min.css +2 -2
- package/dist/components/list.css +1 -1
- package/dist/components/list.min.css +1 -1
- package/dist/components/loader.css +1 -1
- package/dist/components/loader.min.css +1 -1
- package/dist/components/menu.css +1 -1
- package/dist/components/menu.min.css +1 -1
- package/dist/components/message.css +2 -1
- package/dist/components/message.min.css +2 -2
- package/dist/components/modal.css +1 -1
- package/dist/components/modal.js +7 -3
- package/dist/components/modal.min.css +1 -1
- package/dist/components/modal.min.js +2 -2
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +11 -5
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +3 -3
- package/dist/components/placeholder.css +1 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +1 -1
- package/dist/components/popup.js +10 -4
- package/dist/components/popup.min.css +1 -1
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +15 -6
- package/dist/components/progress.js +4 -2
- package/dist/components/progress.min.css +2 -2
- package/dist/components/progress.min.js +2 -2
- package/dist/components/rail.css +1 -1
- package/dist/components/rail.min.css +1 -1
- package/dist/components/rating.css +1 -1
- package/dist/components/rating.js +4 -2
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +2 -2
- package/dist/components/reset.css +1 -1
- package/dist/components/reset.min.css +1 -1
- package/dist/components/reveal.css +1 -1
- package/dist/components/reveal.min.css +1 -1
- package/dist/components/search.css +1 -1
- package/dist/components/search.js +67 -14
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +3 -3
- package/dist/components/segment.css +1 -1
- package/dist/components/segment.min.css +1 -1
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +7 -5
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +3 -3
- package/dist/components/sidebar.css +1 -1
- package/dist/components/sidebar.js +4 -2
- package/dist/components/sidebar.min.css +1 -1
- package/dist/components/sidebar.min.js +2 -2
- package/dist/components/site.css +14 -6
- package/dist/components/site.js +4 -2
- package/dist/components/site.min.css +2 -2
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.css +1 -1
- package/dist/components/slider.js +4 -2
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +4 -2
- package/dist/components/state.min.js +2 -2
- package/dist/components/statistic.css +1 -1
- package/dist/components/statistic.min.css +1 -1
- package/dist/components/step.css +1 -1
- package/dist/components/step.min.css +1 -1
- package/dist/components/sticky.css +1 -1
- package/dist/components/sticky.js +4 -2
- package/dist/components/sticky.min.css +1 -1
- package/dist/components/sticky.min.js +2 -2
- package/dist/components/tab.css +1 -1
- package/dist/components/tab.js +4 -2
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +2 -2
- package/dist/components/table.css +32 -21
- package/dist/components/table.min.css +2 -2
- package/dist/components/text.css +1 -1
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +1 -1
- package/dist/components/toast.js +7 -3
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +3 -3
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +7 -3
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +4 -2
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +4713 -3857
- package/dist/semantic.js +385 -136
- package/dist/semantic.min.css +3 -3
- package/dist/semantic.min.js +3 -3
- package/dist/themes/basic/assets/fonts/LICENSE.txt +91 -0
- package/dist/themes/default/assets/fonts/LICENSE_Lato.txt +94 -0
- package/dist/themes/default/assets/fonts/LICENSE_icons.txt +165 -0
- package/dist/themes/github/assets/fonts/LICENSE.txt +94 -0
- package/dist/themes/material/assets/fonts/LICENSE.txt +202 -0
- package/package.json +14 -14
- package/src/definitions/behaviors/api.js +6 -2
- package/src/definitions/behaviors/form.js +65 -22
- package/src/definitions/behaviors/state.js +3 -1
- package/src/definitions/behaviors/visibility.js +3 -1
- package/src/definitions/collections/form.less +9 -2
- package/src/definitions/collections/grid.less +4 -4
- package/src/definitions/collections/message.less +1 -0
- package/src/definitions/collections/table.less +69 -54
- package/src/definitions/elements/button.less +27 -3
- package/src/definitions/elements/label.less +5 -0
- package/src/definitions/globals/site.js +3 -1
- package/src/definitions/globals/site.less +17 -12
- package/src/definitions/modules/accordion.js +3 -1
- package/src/definitions/modules/calendar.js +14 -2
- package/src/definitions/modules/checkbox.js +9 -3
- package/src/definitions/modules/dimmer.js +3 -1
- package/src/definitions/modules/dimmer.less +8 -5
- package/src/definitions/modules/dropdown.js +103 -32
- package/src/definitions/modules/dropdown.less +43 -29
- package/src/definitions/modules/embed.js +16 -6
- package/src/definitions/modules/flyout.js +3 -1
- package/src/definitions/modules/modal.js +6 -2
- package/src/definitions/modules/nag.js +10 -4
- package/src/definitions/modules/popup.js +9 -3
- package/src/definitions/modules/progress.js +3 -1
- package/src/definitions/modules/progress.less +17 -5
- package/src/definitions/modules/rating.js +3 -1
- package/src/definitions/modules/search.js +66 -13
- package/src/definitions/modules/search.less +9 -2
- package/src/definitions/modules/shape.js +6 -4
- package/src/definitions/modules/sidebar.js +3 -1
- package/src/definitions/modules/slider.js +3 -1
- package/src/definitions/modules/sticky.js +3 -1
- package/src/definitions/modules/tab.js +3 -1
- package/src/definitions/modules/toast.js +6 -2
- package/src/definitions/modules/transition.js +6 -2
- package/src/definitions/views/feed.less +11 -0
- package/src/themes/basic/assets/fonts/LICENSE.txt +91 -0
- package/src/themes/default/assets/fonts/LICENSE_Lato.txt +94 -0
- package/src/themes/default/assets/fonts/LICENSE_icons.txt +165 -0
- package/src/themes/default/elements/button.variables +3 -0
- package/src/themes/default/elements/emoji.variables +172 -23
- package/src/themes/default/elements/flag.variables +3 -3
- package/src/themes/default/globals/site.variables +3 -0
- package/src/themes/default/globals/variation.variables +3 -0
- package/src/themes/default/modules/dropdown.variables +3 -0
- package/src/themes/default/modules/progress.variables +1 -1
- package/src/themes/default/modules/search.variables +3 -0
- package/src/themes/default/views/feed.variables +3 -0
- package/src/themes/github/assets/fonts/LICENSE.txt +94 -0
- package/src/themes/joypixels/elements/emoji.variables +183 -22
- package/src/themes/material/assets/fonts/LICENSE.txt +202 -0
- package/tasks/admin/components/create.js +4 -4
- package/tasks/admin/components/init.js +2 -2
- package/tasks/admin/components/update.js +3 -3
- package/tasks/admin/distributions/create.js +3 -3
- package/tasks/admin/distributions/init.js +2 -2
- package/tasks/admin/distributions/update.js +4 -4
- package/tasks/build/assets.js +1 -1
- package/tasks/build/css.js +19 -10
- package/tasks/build/javascript.js +12 -5
- package/tasks/check-install.js +1 -1
- package/tasks/config/defaults.js +2 -0
- package/tasks/config/tasks.js +1 -1
- package/tasks/docs/build.js +3 -3
- package/tasks/docs/metadata.js +1 -1
- package/tasks/docs/serve.js +3 -1
- package/tasks/install.js +2 -2
- package/tasks/watch.js +1 -1
- package/types/fomantic-ui-accordion.d.ts +1 -1
- package/types/fomantic-ui-api.d.ts +9 -3
- package/types/fomantic-ui-calendar.d.ts +110 -9
- package/types/fomantic-ui-checkbox.d.ts +14 -4
- package/types/fomantic-ui-dimmer.d.ts +1 -1
- package/types/fomantic-ui-dropdown.d.ts +76 -44
- package/types/fomantic-ui-embed.d.ts +19 -2
- package/types/fomantic-ui-flyout.d.ts +25 -11
- package/types/fomantic-ui-form.d.ts +123 -15
- package/types/fomantic-ui-modal.d.ts +101 -5
- package/types/fomantic-ui-nag.d.ts +4 -4
- package/types/fomantic-ui-popup.d.ts +38 -12
- package/types/fomantic-ui-progress.d.ts +12 -6
- package/types/fomantic-ui-rating.d.ts +1 -1
- package/types/fomantic-ui-search.d.ts +138 -22
- package/types/fomantic-ui-shape.d.ts +2 -2
- package/types/fomantic-ui-sidebar.d.ts +4 -4
- package/types/fomantic-ui-slider.d.ts +2 -2
- package/types/fomantic-ui-sticky.d.ts +1 -1
- package/types/fomantic-ui-tab.d.ts +6 -6
- package/types/fomantic-ui-toast.d.ts +14 -2
- package/types/fomantic-ui-transition.d.ts +41 -7
- package/types/fomantic-ui-visibility.d.ts +3 -3
- package/types/index.d.ts +25 -25
- package/types/tests.ts +188 -0
- package/types/tsconfig.json +1 -1
- package/types/fomantic-ui-tests.ts +0 -25
@@ -6,7 +6,7 @@ declare namespace FomanticUI {
|
|
6
6
|
* Attaches flyout action to given selector.
|
7
7
|
* Default event if none specified is toggle.
|
8
8
|
*/
|
9
|
-
(behavior: 'attach events', selector: JQuery, event
|
9
|
+
(behavior: 'attach events', selector: JQuery, event?: string): JQuery;
|
10
10
|
|
11
11
|
/**
|
12
12
|
* Shows the flyout.
|
@@ -48,8 +48,13 @@ declare namespace FomanticUI {
|
|
48
48
|
*/
|
49
49
|
(behavior: 'get settings'): FlyoutSettings;
|
50
50
|
|
51
|
+
/**
|
52
|
+
* Templates handling
|
53
|
+
*/
|
54
|
+
(behavior: keyof Flyout.TemplatesSettings, ...args: any): Partial<Pick<FlyoutSettings, keyof FlyoutSettings>>;
|
55
|
+
|
51
56
|
(behavior: 'destroy'): JQuery;
|
52
|
-
<K extends keyof FlyoutSettings>(behavior: 'setting', name: K, value?: undefined,
|
57
|
+
<K extends keyof FlyoutSettings>(behavior: 'setting', name: K, value?: undefined,): Partial<Pick<FlyoutSettings, keyof FlyoutSettings>>;
|
53
58
|
<K extends keyof FlyoutSettings>(behavior: 'setting', name: K, value: FlyoutSettings[K]): JQuery;
|
54
59
|
(behavior: 'setting', value: Partial<Pick<FlyoutSettings, keyof FlyoutSettings>>): JQuery;
|
55
60
|
(settings?: Partial<Pick<FlyoutSettings, keyof FlyoutSettings>>): JQuery;
|
@@ -145,43 +150,43 @@ declare namespace FomanticUI {
|
|
145
150
|
* Content of the flyout header.
|
146
151
|
* @default ''
|
147
152
|
*/
|
148
|
-
title:
|
153
|
+
title: string;
|
149
154
|
|
150
155
|
/**
|
151
156
|
* Content of the flyout content.
|
152
157
|
* @default ''
|
153
158
|
*/
|
154
|
-
content:
|
159
|
+
content: string;
|
155
160
|
|
156
161
|
/**
|
157
162
|
* Can hold a string to be added to the flyout class to control its appearance.
|
158
163
|
* @default ''
|
159
164
|
*/
|
160
|
-
class:
|
165
|
+
class: string;
|
161
166
|
|
162
167
|
/**
|
163
168
|
* Can hold a string to be added to the title class to control its appearance.
|
164
169
|
* @default ''
|
165
170
|
*/
|
166
|
-
classTitle:
|
171
|
+
classTitle: string;
|
167
172
|
|
168
173
|
/**
|
169
174
|
* Can hold a string to be added to the content class to control its appearance.
|
170
175
|
* @default ''
|
171
176
|
*/
|
172
|
-
classContent:
|
177
|
+
classContent: string;
|
173
178
|
|
174
179
|
/**
|
175
180
|
* Can hold a string to be added to the actions class to control its appearance.
|
176
181
|
* @default ''
|
177
182
|
*/
|
178
|
-
classActions:
|
183
|
+
classActions: string;
|
179
184
|
|
180
185
|
/**
|
181
186
|
* Can hold a string to be added to the actions class to control its appearance.
|
182
187
|
* @default false
|
183
188
|
*/
|
184
|
-
closeIcon: boolean;
|
189
|
+
closeIcon: boolean | string;
|
185
190
|
|
186
191
|
/**
|
187
192
|
* An array of objects. Each object defines an action with properties `text`, `class`, `icon` and `click`.
|
@@ -261,6 +266,8 @@ declare namespace FomanticUI {
|
|
261
266
|
|
262
267
|
// region Config Template Settings
|
263
268
|
|
269
|
+
templates: Flyout.TemplatesSettings;
|
270
|
+
|
264
271
|
// endregion
|
265
272
|
|
266
273
|
// region Debug Settings
|
@@ -311,6 +318,7 @@ declare namespace FomanticUI {
|
|
311
318
|
type ClassNameSettings = Partial<Pick<Settings.ClassNames, keyof Settings.ClassNames>>;
|
312
319
|
type RegExpSettings = Partial<Pick<Settings.RegExps, keyof Settings.RegExps>>;
|
313
320
|
type ErrorSettings = Partial<Pick<Settings.Errors, keyof Settings.Errors>>;
|
321
|
+
type TemplatesSettings = Partial<Pick<Settings.Templates, keyof Settings.Templates>> & {[key: string]: (...args: any) => Partial<Pick<FlyoutSettings, keyof FlyoutSettings>>};
|
314
322
|
|
315
323
|
namespace Settings {
|
316
324
|
interface Selectors {
|
@@ -364,7 +372,7 @@ declare namespace FomanticUI {
|
|
364
372
|
*/
|
365
373
|
deny: string;
|
366
374
|
}
|
367
|
-
|
375
|
+
|
368
376
|
interface ClassNames {
|
369
377
|
/**
|
370
378
|
* @default 'ui flyout'
|
@@ -481,7 +489,7 @@ declare namespace FomanticUI {
|
|
481
489
|
*/
|
482
490
|
prompt: string;
|
483
491
|
}
|
484
|
-
|
492
|
+
|
485
493
|
interface RegExps {
|
486
494
|
/**
|
487
495
|
* @default /(iPad|iPhone|iPod)/g
|
@@ -520,6 +528,12 @@ declare namespace FomanticUI {
|
|
520
528
|
*/
|
521
529
|
notFound: string;
|
522
530
|
}
|
531
|
+
|
532
|
+
interface Templates {
|
533
|
+
alert(): Partial<Pick<FlyoutSettings, keyof FlyoutSettings>>;
|
534
|
+
confirm(): Partial<Pick<FlyoutSettings, keyof FlyoutSettings>>;
|
535
|
+
prompt(): Partial<Pick<FlyoutSettings, keyof FlyoutSettings>>;
|
536
|
+
}
|
523
537
|
}
|
524
538
|
}
|
525
539
|
}
|
@@ -15,7 +15,12 @@ declare namespace FomanticUI {
|
|
15
15
|
/**
|
16
16
|
* Adds rule to existing rules for field, also aliased as 'add field'.
|
17
17
|
*/
|
18
|
-
(behavior: 'add rule', field: string, rules:
|
18
|
+
(behavior: 'add rule', field: string, rules: string | string[] | FormField[]): void;
|
19
|
+
|
20
|
+
/**
|
21
|
+
* Adds field object to existing fields.
|
22
|
+
*/
|
23
|
+
(behavior: 'add field', name: string, rules: string | string[] | FormRule[]): void;
|
19
24
|
|
20
25
|
/**
|
21
26
|
* Adds fields object to existing fields.
|
@@ -25,13 +30,18 @@ declare namespace FomanticUI {
|
|
25
30
|
/**
|
26
31
|
* Removes specific rule from field leaving other rules.
|
27
32
|
*/
|
28
|
-
(behavior: 'remove rule', field: string, rules
|
33
|
+
(behavior: 'remove rule', field: string, rules?: object[]): void;
|
29
34
|
|
30
35
|
/**
|
31
36
|
* Remove all validation for a field.
|
32
37
|
*/
|
33
38
|
(behavior: 'remove field', field: string): void;
|
34
39
|
|
40
|
+
/**
|
41
|
+
* Remove all validation for an array of fields.
|
42
|
+
*/
|
43
|
+
(behavior: 'remove fields', field: string[]): void;
|
44
|
+
|
35
45
|
/**
|
36
46
|
* Returns 'true'/'false' whether a field passes its validation rules.
|
37
47
|
* If you add 'true' as the second parameter, any failed rule will update the UI.
|
@@ -41,7 +51,7 @@ declare namespace FomanticUI {
|
|
41
51
|
/**
|
42
52
|
* Validates form, updates UI, and calls 'onSuccess' or 'onFailure'.
|
43
53
|
*/
|
44
|
-
(behavior: 'validate form'):
|
54
|
+
(behavior: 'validate form'): boolean;
|
45
55
|
|
46
56
|
/**
|
47
57
|
* Validates field, updates UI, and calls 'onSuccess' or 'onFailure'.
|
@@ -62,7 +72,7 @@ declare namespace FomanticUI {
|
|
62
72
|
* Returns object of element values that match array of identifiers.
|
63
73
|
* If no IDS are passed will return all fields.
|
64
74
|
*/
|
65
|
-
(behavior: 'get values', identifiers?: string[]):
|
75
|
+
(behavior: 'get values', identifiers?: string[]): Record<string, string>;
|
66
76
|
|
67
77
|
/**
|
68
78
|
* Sets value of element with id.
|
@@ -97,23 +107,33 @@ declare namespace FomanticUI {
|
|
97
107
|
/**
|
98
108
|
* Adds a custom user prompt for a given element with identifier.
|
99
109
|
*/
|
100
|
-
(behavior: 'add prompt', identifier: string, errors: object[]): void;
|
110
|
+
(behavior: 'add prompt', identifier: string, errors: string | object[]): void;
|
101
111
|
|
102
112
|
/**
|
103
113
|
* Empty all fields and remove possible errors.
|
104
114
|
*/
|
105
|
-
(behavior: 'clear'):
|
115
|
+
(behavior: 'clear'): JQuery;
|
106
116
|
|
107
117
|
/**
|
108
118
|
* Set all fields to their initial value and remove possible errors.
|
109
119
|
*/
|
110
|
-
(behavior: 'reset'):
|
120
|
+
(behavior: 'reset'): JQuery;
|
111
121
|
|
112
122
|
/**
|
113
123
|
* Set fields actual values as default values.
|
114
124
|
*/
|
115
125
|
(behavior: 'set defaults'): void;
|
116
126
|
|
127
|
+
/**
|
128
|
+
* Returns 'true'/'false' whether a form is dirty.
|
129
|
+
*/
|
130
|
+
(behavior: 'is dirty'): boolean;
|
131
|
+
|
132
|
+
/**
|
133
|
+
* Returns 'true'/'false' whether a form is clean.
|
134
|
+
*/
|
135
|
+
(behavior: 'is clean'): boolean;
|
136
|
+
|
117
137
|
/**
|
118
138
|
* Return elements which have been modified since form state was changed to 'dirty'.
|
119
139
|
*/
|
@@ -122,10 +142,10 @@ declare namespace FomanticUI {
|
|
122
142
|
/**
|
123
143
|
* Set the state of the form to 'clean' and set new values as default.
|
124
144
|
*/
|
125
|
-
(behavior: 'set as clean'):
|
145
|
+
(behavior: 'set as clean'): JQuery;
|
126
146
|
|
127
147
|
/**
|
128
|
-
* Automatically adds the "
|
148
|
+
* Automatically adds the "notEmpty" rule or automatically checks a checkbox for all fields with classname or attribute 'required'.
|
129
149
|
*/
|
130
150
|
(behavior: 'set auto check'): void;
|
131
151
|
|
@@ -138,18 +158,39 @@ declare namespace FomanticUI {
|
|
138
158
|
* Destroys instance and removes all events.
|
139
159
|
*/
|
140
160
|
(behavior: 'destroy'): JQuery;
|
141
|
-
<K extends keyof FormSettings>(behavior: 'setting', name: K, value?: undefined,
|
161
|
+
<K extends keyof FormSettings>(behavior: 'setting', name: K, value?: undefined,): Partial<Pick<FormSettings, keyof FormSettings>>;
|
142
162
|
<K extends keyof FormSettings>(behavior: 'setting', name: K, value: FormSettings[K]): JQuery;
|
143
163
|
(behavior: 'setting', value: Partial<Pick<FormSettings, keyof FormSettings>>): JQuery;
|
144
164
|
(settings?: Partial<Pick<FormSettings, keyof FormSettings>>): JQuery;
|
145
165
|
}
|
146
166
|
|
167
|
+
type FormFields = Record<string, FormField | string[] | string | object>;
|
168
|
+
|
169
|
+
interface FormRule {
|
170
|
+
type: string;
|
171
|
+
prompt?: string | ((value: string) => void);
|
172
|
+
value?: string | RegExp;
|
173
|
+
}
|
174
|
+
|
175
|
+
interface FormField {
|
176
|
+
identifier?: string;
|
177
|
+
depends?: string;
|
178
|
+
optional?: boolean;
|
179
|
+
rules: FormRule[];
|
180
|
+
}
|
181
|
+
|
147
182
|
/**
|
148
183
|
* @see {@link https://fomantic-ui.com/behaviors/form.html#/settings}
|
149
184
|
*/
|
150
185
|
interface FormSettings {
|
151
186
|
// region Form Settings
|
152
187
|
|
188
|
+
/**
|
189
|
+
* Adds keyboard shortcuts for enter and escape keys to submit form and blur fields respectively.
|
190
|
+
* @default false
|
191
|
+
*/
|
192
|
+
fields: false | FormFields;
|
193
|
+
|
153
194
|
/**
|
154
195
|
* Adds keyboard shortcuts for enter and escape keys to submit form and blur fields respectively.
|
155
196
|
* @default true
|
@@ -215,7 +256,7 @@ declare namespace FomanticUI {
|
|
215
256
|
preventLeaving: boolean;
|
216
257
|
|
217
258
|
/**
|
218
|
-
* Whether fields with classname or attribute 'required' should automatically add the "
|
259
|
+
* Whether fields with classname or attribute 'required' should automatically add the "notEmpty" rule or automatically checks checkbox fields.
|
219
260
|
* @default false
|
220
261
|
*/
|
221
262
|
autoCheckRequired: boolean;
|
@@ -232,6 +273,12 @@ declare namespace FomanticUI {
|
|
232
273
|
*/
|
233
274
|
errorLimit: number;
|
234
275
|
|
276
|
+
/**
|
277
|
+
*
|
278
|
+
* @default false
|
279
|
+
*/
|
280
|
+
noNativeValidation: boolean;
|
281
|
+
|
235
282
|
// endregion
|
236
283
|
|
237
284
|
// region Form Prompts
|
@@ -248,6 +295,12 @@ declare namespace FomanticUI {
|
|
248
295
|
|
249
296
|
// endregion
|
250
297
|
|
298
|
+
// region Formatters
|
299
|
+
|
300
|
+
rules: Form.RulesSettings;
|
301
|
+
|
302
|
+
// endregion
|
303
|
+
|
251
304
|
// region Callbacks
|
252
305
|
|
253
306
|
/**
|
@@ -258,17 +311,17 @@ declare namespace FomanticUI {
|
|
258
311
|
/**
|
259
312
|
* Callback on each invalid field.
|
260
313
|
*/
|
261
|
-
onInvalid(this: JQuery): void;
|
314
|
+
onInvalid(this: JQuery, fieldErrors: string | string[]): void;
|
262
315
|
|
263
316
|
/**
|
264
317
|
* Callback if a form is all valid.
|
265
318
|
*/
|
266
|
-
onSuccess(this: JQuery, event: Event, fields:
|
319
|
+
onSuccess(this: JQuery, event: Event, fields: {[key: string]: any}): void;
|
267
320
|
|
268
321
|
/**
|
269
322
|
* Callback if any form field is invalid.
|
270
323
|
*/
|
271
|
-
onFailure(this: JQuery, formErrors:
|
324
|
+
onFailure(this: JQuery, formErrors: {[key: string]: any}, fields: {[key: string]: any}): void;
|
272
325
|
|
273
326
|
/**
|
274
327
|
* Callback if form state is modified to 'dirty'.
|
@@ -349,8 +402,9 @@ declare namespace FomanticUI {
|
|
349
402
|
|
350
403
|
namespace Form {
|
351
404
|
type TextSettings = Partial<Pick<Settings.Texts, keyof Settings.Texts>>;
|
352
|
-
type PromptSettings = Partial<Pick<Settings.Prompts, keyof Settings.Prompts
|
405
|
+
type PromptSettings = Partial<Pick<Settings.Prompts, keyof Settings.Prompts>> & {[key: string]: string | undefined};
|
353
406
|
type FormatterSettings = Partial<Pick<Settings.Formatters, keyof Settings.Formatters>>;
|
407
|
+
type RulesSettings = Partial<Pick<Settings.Rules, keyof Settings.Rules>> & {[key: string]: (value?: any, identifier?: string, module?: any) => boolean};
|
354
408
|
type SelectorSettings = Partial<Pick<Settings.Selectors, keyof Settings.Selectors>>;
|
355
409
|
type MetadataSettings = Partial<Pick<Settings.Metadatas, keyof Settings.Metadatas>>;
|
356
410
|
type ClassNameSettings = Partial<Pick<Settings.ClassNames, keyof Settings.ClassNames>>;
|
@@ -375,11 +429,32 @@ declare namespace FomanticUI {
|
|
375
429
|
}
|
376
430
|
|
377
431
|
interface Prompts {
|
432
|
+
/**
|
433
|
+
* @default '{name} must be in a range from {min} to {max}'
|
434
|
+
*/
|
435
|
+
range: string;
|
436
|
+
|
437
|
+
/**
|
438
|
+
* @default '{name} must have a maximum value of {ruleValue}'
|
439
|
+
*/
|
440
|
+
maxValue: string;
|
441
|
+
|
442
|
+
/**
|
443
|
+
* @default '{name} must have a minimum value of {ruleValue}'
|
444
|
+
*/
|
445
|
+
minValue: string;
|
446
|
+
|
378
447
|
/**
|
379
448
|
* @default '{name} must have a value'
|
449
|
+
* @deprecated Use notEmpty instead
|
380
450
|
*/
|
381
451
|
empty: string;
|
382
452
|
|
453
|
+
/**
|
454
|
+
* @default '{name} must have a value'
|
455
|
+
*/
|
456
|
+
notEmpty: string;
|
457
|
+
|
383
458
|
/**
|
384
459
|
* @default '{name} must be checked'
|
385
460
|
*/
|
@@ -509,6 +584,39 @@ declare namespace FomanticUI {
|
|
509
584
|
year(date: string): string;
|
510
585
|
}
|
511
586
|
|
587
|
+
interface Rules {
|
588
|
+
empty(value: unknown): boolean;
|
589
|
+
notEmpty(value: unknown): boolean;
|
590
|
+
checked(): boolean;
|
591
|
+
email(value: unknown): boolean;
|
592
|
+
url(value: unknown): boolean;
|
593
|
+
regExp(value: unknown, regExp: RegExp): boolean;
|
594
|
+
minValue(value: unknown, range: string): boolean;
|
595
|
+
maxValue(value: unknown, range: string): boolean;
|
596
|
+
integer(value: unknown, range: string): boolean;
|
597
|
+
range(value: unknown, range: string, regExp: RegExp, testLength: boolean): boolean;
|
598
|
+
decimal(value: unknown, range: string): boolean;
|
599
|
+
number(value: unknown, range: string): boolean;
|
600
|
+
is(value: unknown, text: string): boolean;
|
601
|
+
isExactly(value: unknown, text: string): boolean;
|
602
|
+
not(value: unknown, notValue: unknown): boolean;
|
603
|
+
notExactly(value: unknown, notValue: unknown): boolean;
|
604
|
+
contains(value: unknown, text: string): boolean;
|
605
|
+
containsExactly(value: unknown, text: string): boolean;
|
606
|
+
doesntContain(value: unknown, text: string): boolean;
|
607
|
+
doesntContainExactly(value: unknown, text: string): boolean;
|
608
|
+
minLength(value: unknown, minLength: number): boolean;
|
609
|
+
exactLength(value: unknown, requiredLength: number): boolean;
|
610
|
+
maxLength(value: unknown, maxLength: number): boolean;
|
611
|
+
size(value: unknown, range: string): boolean;
|
612
|
+
match(value: unknown, identifier: string, module: unknown): boolean;
|
613
|
+
different(value: unknown, identifier: string, module: unknown): boolean;
|
614
|
+
creditCard(cardNumber: unknown, cardTypes: string): boolean;
|
615
|
+
minCount(value: unknown, minCount: number): boolean;
|
616
|
+
exactCount(value: unknown, exactCount: number): boolean;
|
617
|
+
maxCount(value: unknown, maxCount: number): boolean;
|
618
|
+
}
|
619
|
+
|
512
620
|
interface Selectors {
|
513
621
|
/**
|
514
622
|
* @default 'input[type="checkbox"], input[type="radio"]'
|
@@ -5,12 +5,12 @@ declare namespace FomanticUI {
|
|
5
5
|
/**
|
6
6
|
* Shows the modal.
|
7
7
|
*/
|
8
|
-
(behavior: 'show'): JQuery;
|
8
|
+
(behavior: 'show', callback?: () => void): JQuery;
|
9
9
|
|
10
10
|
/**
|
11
11
|
* Hides the modal.
|
12
12
|
*/
|
13
|
-
(behavior: 'hide'): JQuery;
|
13
|
+
(behavior: 'hide', callback?: () => void): JQuery;
|
14
14
|
|
15
15
|
/**
|
16
16
|
* Toggles the modal.
|
@@ -62,8 +62,13 @@ declare namespace FomanticUI {
|
|
62
62
|
*/
|
63
63
|
(behavior: 'set active'): JQuery;
|
64
64
|
|
65
|
+
/**
|
66
|
+
* Templates handling
|
67
|
+
*/
|
68
|
+
(behavior: keyof Modal.TemplatesSettings, ...args: any): Partial<Pick<ModalSettings, keyof ModalSettings>>;
|
69
|
+
|
65
70
|
(behavior: 'destroy'): JQuery;
|
66
|
-
<K extends keyof ModalSettings>(behavior: 'setting', name: K, value?: undefined,
|
71
|
+
<K extends keyof ModalSettings>(behavior: 'setting', name: K, value?: undefined,): Partial<Pick<ModalSettings, keyof ModalSettings>>;
|
67
72
|
<K extends keyof ModalSettings>(behavior: 'setting', name: K, value: ModalSettings[K]): JQuery;
|
68
73
|
(behavior: 'setting', value: Partial<Pick<ModalSettings, keyof ModalSettings>>): JQuery;
|
69
74
|
(settings?: Partial<Pick<ModalSettings, keyof ModalSettings>>): JQuery;
|
@@ -166,13 +171,13 @@ declare namespace FomanticUI {
|
|
166
171
|
/**
|
167
172
|
* Custom settings to extend UI dimmer.
|
168
173
|
*/
|
169
|
-
dimmerSettings: DimmerSettings
|
174
|
+
dimmerSettings: Partial<Pick<DimmerSettings, keyof DimmerSettings>>;
|
170
175
|
|
171
176
|
/**
|
172
177
|
* Custom settings to extend UI dimmer.
|
173
178
|
* @default 'scale'
|
174
179
|
*/
|
175
|
-
transition: string | TransitionSettings;
|
180
|
+
transition: string | Modal.TransitionSettings;
|
176
181
|
|
177
182
|
/**
|
178
183
|
* Duration of animation.
|
@@ -194,6 +199,62 @@ declare namespace FomanticUI {
|
|
194
199
|
*/
|
195
200
|
scrollbarWidth: number;
|
196
201
|
|
202
|
+
// dynamic content
|
203
|
+
|
204
|
+
/**
|
205
|
+
* Title of dynamicly created modal.
|
206
|
+
* @default ''
|
207
|
+
*/
|
208
|
+
title: string;
|
209
|
+
|
210
|
+
/**
|
211
|
+
* HTML content of dynamicly created modal.
|
212
|
+
* @default ''
|
213
|
+
*/
|
214
|
+
content: string;
|
215
|
+
|
216
|
+
/**
|
217
|
+
* CSS classname(s) of dynamicly created modal.
|
218
|
+
* @default ''
|
219
|
+
*/
|
220
|
+
class: string;
|
221
|
+
|
222
|
+
/**
|
223
|
+
* CSS classname(s) of dynamicly created modal's title.
|
224
|
+
* @default ''
|
225
|
+
*/
|
226
|
+
classTitle: string;
|
227
|
+
|
228
|
+
/**
|
229
|
+
* CSS classname(s) of dynamicly created modal's content.
|
230
|
+
* @default ''
|
231
|
+
*/
|
232
|
+
classContent: string;
|
233
|
+
|
234
|
+
/**
|
235
|
+
* CSS classname(s) of dynamicly created modal's actions.
|
236
|
+
* @default ''
|
237
|
+
*/
|
238
|
+
classActions: string;
|
239
|
+
|
240
|
+
/**
|
241
|
+
* Determine if a close icon shoud be displayed on dynamicly created modal.
|
242
|
+
* @default false
|
243
|
+
*/
|
244
|
+
closeIcon: boolean;
|
245
|
+
|
246
|
+
/**
|
247
|
+
*
|
248
|
+
* @default false
|
249
|
+
*/
|
250
|
+
actions: any;
|
251
|
+
|
252
|
+
/**
|
253
|
+
*
|
254
|
+
* @default true
|
255
|
+
*/
|
256
|
+
preserveHTML: boolean;
|
257
|
+
|
197
258
|
// endregion
|
198
259
|
|
199
260
|
// region Callbacks
|
@@ -250,6 +311,8 @@ declare namespace FomanticUI {
|
|
250
311
|
|
251
312
|
// region Config Template Settings
|
252
313
|
|
314
|
+
templates: Modal.TemplatesSettings;
|
315
|
+
|
253
316
|
// endregion
|
254
317
|
|
255
318
|
// region Debug Settings
|
@@ -296,11 +359,38 @@ declare namespace FomanticUI {
|
|
296
359
|
}
|
297
360
|
|
298
361
|
namespace Modal {
|
362
|
+
type TransitionSettings = Partial<Pick<Settings.Transition, keyof Settings.Transition>>;
|
299
363
|
type SelectorSettings = Partial<Pick<Settings.Selectors, keyof Settings.Selectors>>;
|
300
364
|
type ClassNameSettings = Partial<Pick<Settings.ClassNames, keyof Settings.ClassNames>>;
|
301
365
|
type ErrorSettings = Partial<Pick<Settings.Errors, keyof Settings.Errors>>;
|
366
|
+
type TemplatesSettings = Partial<Pick<Settings.Templates, keyof Settings.Templates>> & {[key: string]: (...args: any) => Partial<Pick<ModalSettings, keyof ModalSettings>>};
|
302
367
|
|
303
368
|
namespace Settings {
|
369
|
+
interface Transition {
|
370
|
+
|
371
|
+
/**
|
372
|
+
* Named animation show event to used.
|
373
|
+
* Must be defined in CSS.
|
374
|
+
*/
|
375
|
+
showMethod: string;
|
376
|
+
|
377
|
+
/**
|
378
|
+
* Duration of the CSS show transition animation
|
379
|
+
*/
|
380
|
+
showDuration: number;
|
381
|
+
|
382
|
+
/**
|
383
|
+
* Named animation hide event to used.
|
384
|
+
* Must be defined in CSS.
|
385
|
+
*/
|
386
|
+
hideMethod: string;
|
387
|
+
|
388
|
+
/**
|
389
|
+
* Duration of the CSS hide transition animation
|
390
|
+
*/
|
391
|
+
hideDuration: number;
|
392
|
+
}
|
393
|
+
|
304
394
|
interface Selectors {
|
305
395
|
/**
|
306
396
|
* @default '> .header'
|
@@ -466,6 +556,12 @@ declare namespace FomanticUI {
|
|
466
556
|
*/
|
467
557
|
notFound: string;
|
468
558
|
}
|
559
|
+
|
560
|
+
interface Templates {
|
561
|
+
alert(): Partial<Pick<ModalSettings, keyof ModalSettings>>;
|
562
|
+
confirm(): Partial<Pick<ModalSettings, keyof ModalSettings>>;
|
563
|
+
prompt(): Partial<Pick<ModalSettings, keyof ModalSettings>>;
|
564
|
+
}
|
469
565
|
}
|
470
566
|
}
|
471
567
|
}
|
@@ -23,10 +23,10 @@ declare namespace FomanticUI {
|
|
23
23
|
(behavior: 'clear'): JQuery;
|
24
24
|
|
25
25
|
(behavior: 'destroy'): JQuery;
|
26
|
-
<K extends keyof NagSettings>(behavior: 'setting', name: K, value?: undefined,
|
26
|
+
<K extends keyof NagSettings>(behavior: 'setting', name: K, value?: undefined,): Partial<Pick<NagSettings, keyof NagSettings>>;
|
27
27
|
<K extends keyof NagSettings>(behavior: 'setting', name: K, value: NagSettings[K]): JQuery;
|
28
28
|
(behavior: 'setting', value: Partial<Pick<NagSettings, keyof NagSettings>>): JQuery;
|
29
|
-
(settings?:
|
29
|
+
(settings?: Partial<Pick<NagSettings, keyof NagSettings>>): JQuery;
|
30
30
|
}
|
31
31
|
|
32
32
|
/**
|
@@ -231,7 +231,7 @@ declare namespace FomanticUI {
|
|
231
231
|
*/
|
232
232
|
close: string;
|
233
233
|
}
|
234
|
-
|
234
|
+
|
235
235
|
interface ClassNames {
|
236
236
|
/**
|
237
237
|
* @default 'bottom'
|
@@ -243,7 +243,7 @@ declare namespace FomanticUI {
|
|
243
243
|
*/
|
244
244
|
fixed: string;
|
245
245
|
}
|
246
|
-
|
246
|
+
|
247
247
|
interface Errors {
|
248
248
|
/**
|
249
249
|
* @default 'Unsupported storage method'
|