fomantic-ui 2.9.4-beta.24 → 2.9.4-beta.26
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/.eslintrc.js +16 -0
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +1 -1
- package/dist/components/accordion.min.css +1 -1
- package/dist/components/accordion.min.js +1 -1
- package/dist/components/ad.css +1 -1
- package/dist/components/ad.min.css +1 -1
- package/dist/components/api.js +1 -1
- package/dist/components/api.min.js +1 -1
- package/dist/components/breadcrumb.css +1 -1
- package/dist/components/breadcrumb.min.css +1 -1
- package/dist/components/button.css +19 -3
- package/dist/components/button.min.css +2 -2
- package/dist/components/calendar.css +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/calendar.min.css +1 -1
- package/dist/components/calendar.min.js +1 -1
- 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 +1 -1
- package/dist/components/checkbox.min.css +1 -1
- package/dist/components/checkbox.min.js +1 -1
- 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 +1 -1
- package/dist/components/dimmer.js +1 -1
- package/dist/components/dimmer.min.css +1 -1
- package/dist/components/dimmer.min.js +1 -1
- package/dist/components/divider.css +1 -1
- package/dist/components/divider.min.css +1 -1
- package/dist/components/dropdown.css +1 -1
- package/dist/components/dropdown.js +5 -3
- package/dist/components/dropdown.min.css +1 -1
- package/dist/components/dropdown.min.js +2 -2
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +1 -1
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +1 -1
- package/dist/components/emoji.css +1 -1
- package/dist/components/emoji.min.css +1 -1
- package/dist/components/feed.css +1 -1
- package/dist/components/feed.min.css +1 -1
- package/dist/components/flag.css +1 -1
- package/dist/components/flag.min.css +1 -1
- package/dist/components/flyout.css +1 -1
- package/dist/components/flyout.js +1 -1
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +1 -1
- package/dist/components/form.css +1 -1
- package/dist/components/form.js +1 -1
- package/dist/components/form.min.css +1 -1
- package/dist/components/form.min.js +1 -1
- package/dist/components/grid.css +1 -1
- package/dist/components/grid.min.css +1 -1
- 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 +1 -1
- package/dist/components/label.min.css +1 -1
- 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 +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +1 -1
- package/dist/components/modal.js +1 -1
- package/dist/components/modal.min.css +1 -1
- package/dist/components/modal.min.js +1 -1
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +1 -1
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +1 -1
- 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 +1 -1
- package/dist/components/popup.min.css +1 -1
- package/dist/components/popup.min.js +1 -1
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +1 -1
- package/dist/components/progress.min.css +1 -1
- package/dist/components/progress.min.js +1 -1
- 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 +1 -1
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +1 -1
- 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 +1 -1
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +1 -1
- 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 +1 -1
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +1 -1
- package/dist/components/sidebar.css +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/sidebar.min.css +1 -1
- package/dist/components/sidebar.min.js +1 -1
- package/dist/components/site.css +1 -1
- package/dist/components/site.js +1 -1
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +1 -1
- package/dist/components/slider.css +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +1 -1
- package/dist/components/state.js +1 -1
- package/dist/components/state.min.js +1 -1
- 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 +1 -1
- package/dist/components/sticky.min.css +1 -1
- package/dist/components/sticky.min.js +1 -1
- package/dist/components/tab.css +1 -1
- package/dist/components/tab.js +1 -1
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +1 -1
- package/dist/components/table.css +1 -1
- package/dist/components/table.min.css +1 -1
- 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 +1 -1
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +1 -1
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +1 -1
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +1 -1
- package/dist/components/visibility.js +1 -1
- package/dist/components/visibility.min.js +1 -1
- package/dist/semantic.css +76 -55
- package/dist/semantic.js +30 -28
- package/dist/semantic.min.css +2 -2
- package/dist/semantic.min.js +2 -2
- package/package.json +3 -3
- package/src/definitions/elements/button.less +25 -3
- package/src/definitions/modules/dropdown.js +4 -2
- package/src/themes/default/elements/button.variables +2 -0
- package/types/fomantic-ui-accordion.d.ts +1 -1
- package/types/fomantic-ui-api.d.ts +1 -1
- package/types/fomantic-ui-calendar.d.ts +4 -4
- package/types/fomantic-ui-dimmer.d.ts +1 -1
- package/types/fomantic-ui-dropdown.d.ts +18 -18
- package/types/fomantic-ui-embed.d.ts +1 -1
- package/types/fomantic-ui-flyout.d.ts +3 -3
- package/types/fomantic-ui-form.d.ts +16 -3
- package/types/fomantic-ui-modal.d.ts +3 -3
- package/types/fomantic-ui-nag.d.ts +3 -3
- package/types/fomantic-ui-popup.d.ts +3 -3
- package/types/fomantic-ui-progress.d.ts +6 -6
- package/types/fomantic-ui-rating.d.ts +1 -1
- package/types/fomantic-ui-search.d.ts +1 -1
- 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 +1 -1
- package/types/fomantic-ui-sticky.d.ts +1 -1
- package/types/fomantic-ui-tab.d.ts +4 -4
- package/types/fomantic-ui-toast.d.ts +1 -1
- package/types/fomantic-ui-transition.d.ts +1 -1
- package/types/fomantic-ui-visibility.d.ts +1 -1
- 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 -187
@@ -33,7 +33,7 @@ declare namespace FomanticUI {
|
|
33
33
|
(behavior: 'get remainingTime'): number;
|
34
34
|
|
35
35
|
(behavior: 'refresh' | 'destroy'): JQuery;
|
36
|
-
<K extends keyof ToastSettings>(behavior: 'setting', name: K, value?: undefined,
|
36
|
+
<K extends keyof ToastSettings>(behavior: 'setting', name: K, value?: undefined,): Partial<Pick<ToastSettings, keyof ToastSettings>>;
|
37
37
|
<K extends keyof ToastSettings>(behavior: 'setting', name: K, value: ToastSettings[K]): JQuery;
|
38
38
|
(behavior: 'setting', value: Partial<Pick<ToastSettings, keyof ToastSettings>>): JQuery;
|
39
39
|
(settings?: Partial<Pick<ToastSettings, keyof ToastSettings>>): JQuery;
|
@@ -144,7 +144,7 @@ declare namespace FomanticUI {
|
|
144
144
|
* Destroys instance and removes all events.
|
145
145
|
*/
|
146
146
|
(behavior: 'destroy'): JQuery;
|
147
|
-
<K extends keyof TransitionSettings>(behavior: 'setting', name: K, value?: undefined,
|
147
|
+
<K extends keyof TransitionSettings>(behavior: 'setting', name: K, value?: undefined,): Partial<Pick<TransitionSettings, keyof TransitionSettings>>;
|
148
148
|
<K extends keyof TransitionSettings>(behavior: 'setting', name: K, value: TransitionSettings[K]): JQuery;
|
149
149
|
(behavior: 'setting', value: Partial<Pick<TransitionSettings, keyof TransitionSettings>>): JQuery;
|
150
150
|
(settings?: Partial<Pick<TransitionSettings, keyof TransitionSettings>>): JQuery;
|
@@ -44,7 +44,7 @@ declare namespace FomanticUI {
|
|
44
44
|
(behavior: 'get screen size'): object;
|
45
45
|
|
46
46
|
(behavior: 'destroy'): JQuery;
|
47
|
-
<K extends keyof VisibilitySettings>(behavior: 'setting', name: K, value?: undefined,
|
47
|
+
<K extends keyof VisibilitySettings>(behavior: 'setting', name: K, value?: undefined,): Partial<Pick<VisibilitySettings, keyof VisibilitySettings>>;
|
48
48
|
<K extends keyof VisibilitySettings>(behavior: 'setting', name: K, value: VisibilitySettings[K]): JQuery;
|
49
49
|
(behavior: 'setting', value: Partial<Pick<VisibilitySettings, keyof VisibilitySettings>>): JQuery;
|
50
50
|
(settings?: Partial<Pick<VisibilitySettings, keyof VisibilitySettings>>): JQuery;
|
package/types/index.d.ts
CHANGED
@@ -30,34 +30,34 @@
|
|
30
30
|
/// <reference path="fomantic-ui-visibility.d.ts" />
|
31
31
|
|
32
32
|
interface JQuery {
|
33
|
-
accordion:
|
34
|
-
api:
|
35
|
-
calendar:
|
36
|
-
checkbox:
|
37
|
-
dimmer:
|
38
|
-
dropdown:
|
39
|
-
embed:
|
40
|
-
flyout:
|
41
|
-
form:
|
42
|
-
modal:
|
43
|
-
nag:
|
44
|
-
popup:
|
45
|
-
progress:
|
46
|
-
rating:
|
47
|
-
search:
|
48
|
-
shape:
|
49
|
-
sidebar:
|
50
|
-
slider:
|
51
|
-
sticky:
|
52
|
-
tab:
|
53
|
-
toast:
|
33
|
+
accordion: FomanticUI.Accordion;
|
34
|
+
api: FomanticUI.API;
|
35
|
+
calendar: FomanticUI.Calendar;
|
36
|
+
checkbox: FomanticUI.Checkbox;
|
37
|
+
dimmer: FomanticUI.Dimmer;
|
38
|
+
dropdown: FomanticUI.Dropdown;
|
39
|
+
embed: FomanticUI.Embed;
|
40
|
+
flyout: FomanticUI.Flyout;
|
41
|
+
form: FomanticUI.Form;
|
42
|
+
modal: FomanticUI.Modal;
|
43
|
+
nag: FomanticUI.Nag;
|
44
|
+
popup: FomanticUI.Popup;
|
45
|
+
progress: FomanticUI.Progress;
|
46
|
+
rating: FomanticUI.Rating;
|
47
|
+
search: FomanticUI.Search;
|
48
|
+
shape: FomanticUI.Shape;
|
49
|
+
sidebar: FomanticUI.Sidebar;
|
50
|
+
slider: FomanticUI.Slider;
|
51
|
+
sticky: FomanticUI.Sticky;
|
52
|
+
tab: FomanticUI.Tab;
|
53
|
+
toast: FomanticUI.Toast;
|
54
54
|
transition: FomanticUI.Transition;
|
55
55
|
visibility: FomanticUI.Visibility;
|
56
56
|
}
|
57
57
|
|
58
58
|
interface JQueryStatic {
|
59
|
-
api:
|
60
|
-
flyout:
|
61
|
-
modal:
|
62
|
-
toast:
|
59
|
+
api: FomanticUI.API;
|
60
|
+
flyout: FomanticUI.Flyout;
|
61
|
+
modal: FomanticUI.Modal;
|
62
|
+
toast: FomanticUI.Toast;
|
63
63
|
}
|
package/types/tests.ts
ADDED
@@ -0,0 +1,188 @@
|
|
1
|
+
/// <reference path="index.d.ts" />
|
2
|
+
|
3
|
+
$().accordion(); // $ExpectType JQuery<HTMLElement>
|
4
|
+
$().api();// $ExpectType JQuery
|
5
|
+
$().calendar(); // $ExpectType JQuery<HTMLElement>
|
6
|
+
$().checkbox(); // $ExpectType JQuery<HTMLElement>
|
7
|
+
$('body').dimmer(); // $ExpectType JQuery<HTMLElement>
|
8
|
+
$().dropdown(); // $ExpectType JQuery<HTMLElement>
|
9
|
+
$().embed(); // $ExpectType JQuery<HTMLElement>
|
10
|
+
$().flyout(); // $ExpectType JQuery<HTMLElement>
|
11
|
+
$().form(); // $ExpectType JQuery<HTMLElement>
|
12
|
+
$().modal(); // $ExpectType JQuery<HTMLElement>
|
13
|
+
$().nag(); // $ExpectType JQuery<HTMLElement>
|
14
|
+
$().popup(); // $ExpectType JQuery<HTMLElement>
|
15
|
+
$().progress(); // $ExpectType JQuery<HTMLElement>
|
16
|
+
$().rating(); // $ExpectType JQuery<HTMLElement>
|
17
|
+
$().search(); // $ExpectType JQuery<HTMLElement>
|
18
|
+
$().shape(); // $ExpectType JQuery<HTMLElement>
|
19
|
+
$().sidebar(); // $ExpectType JQuery<HTMLElement>
|
20
|
+
$().slider(); // $ExpectType JQuery<HTMLElement>
|
21
|
+
$().sticky(); // $ExpectType JQuery<HTMLElement>
|
22
|
+
$().tab(); // $ExpectType JQuery<HTMLElement>
|
23
|
+
$('body').toast(); // $ExpectType JQuery<HTMLElement>
|
24
|
+
$().transition(); // $ExpectType JQuery<HTMLElement>
|
25
|
+
$().visibility(); // $ExpectType JQuery<HTMLElement>
|
26
|
+
|
27
|
+
/* Define API endpoints once globally */
|
28
|
+
$.fn.api.settings.api = {
|
29
|
+
'get followers': '/followers/{id}?results={count}',
|
30
|
+
'create user': '/create',
|
31
|
+
'add user': '/add/{id}',
|
32
|
+
'follow user': '/follow/{id}',
|
33
|
+
search: '/search/?query={value}',
|
34
|
+
};
|
35
|
+
|
36
|
+
$().calendar({
|
37
|
+
today: true,
|
38
|
+
initialDate: null,
|
39
|
+
endCalendar: $(),
|
40
|
+
}); // $ExpectType JQuery<HTMLElement>
|
41
|
+
|
42
|
+
$.flyout('alert', 'hello'); // $ExpectType JQuery<HTMLElement>
|
43
|
+
$.flyout('confirm', 'Are you sure?', function () { /* make eslint happy */ }); // $ExpectType JQuery<HTMLElement>
|
44
|
+
$.flyout('prompt', 'Enter Code', function () { /* make eslint happy */ }); // $ExpectType JQuery<HTMLElement>
|
45
|
+
|
46
|
+
$.fn.flyout.settings.templates.greet = function (username) {
|
47
|
+
return {
|
48
|
+
title: 'Greetings to ' + username + '!',
|
49
|
+
content: '' + username.toUpperCase() + 'is the best!',
|
50
|
+
closeIcon: true,
|
51
|
+
class: 'inverted',
|
52
|
+
classContent: 'centered',
|
53
|
+
};
|
54
|
+
};
|
55
|
+
|
56
|
+
$().form({
|
57
|
+
fields: {
|
58
|
+
field1: {
|
59
|
+
rules: [
|
60
|
+
{
|
61
|
+
type: 'notEmpty',
|
62
|
+
},
|
63
|
+
],
|
64
|
+
},
|
65
|
+
field2: {
|
66
|
+
rules: [
|
67
|
+
{
|
68
|
+
type: 'isExactly[dog]',
|
69
|
+
prompt: '{name} is set to "{value}" that is totally wrong. It should be {ruleValue}',
|
70
|
+
},
|
71
|
+
],
|
72
|
+
},
|
73
|
+
field3: {
|
74
|
+
rules: [
|
75
|
+
{
|
76
|
+
type: 'isExactly[cat]',
|
77
|
+
prompt: function (value) {
|
78
|
+
if (value === 'dog') {
|
79
|
+
return 'I told you to put cat, not dog!';
|
80
|
+
}
|
81
|
+
|
82
|
+
return 'That is not cat';
|
83
|
+
},
|
84
|
+
},
|
85
|
+
],
|
86
|
+
},
|
87
|
+
color: {
|
88
|
+
identifier: 'color',
|
89
|
+
rules: [{
|
90
|
+
type: 'regExp',
|
91
|
+
value: /rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)/i,
|
92
|
+
}],
|
93
|
+
},
|
94
|
+
yearsPracticed: {
|
95
|
+
identifier: 'yearsPracticed',
|
96
|
+
depends: 'isDoctor',
|
97
|
+
rules: [
|
98
|
+
{
|
99
|
+
type: 'notEmpty',
|
100
|
+
prompt: 'Please enter the number of years you have been a doctor',
|
101
|
+
},
|
102
|
+
],
|
103
|
+
},
|
104
|
+
ccEmail: {
|
105
|
+
identifier: 'cc-email',
|
106
|
+
optional: true,
|
107
|
+
rules: [
|
108
|
+
{
|
109
|
+
type: 'email',
|
110
|
+
prompt: 'Please enter a valid second e-mail',
|
111
|
+
},
|
112
|
+
],
|
113
|
+
},
|
114
|
+
},
|
115
|
+
}); // $ExpectType JQuery<HTMLElement>
|
116
|
+
|
117
|
+
$().form({
|
118
|
+
fields: {
|
119
|
+
gender: 'notEmpty',
|
120
|
+
name: 'notEmpty',
|
121
|
+
password: ['minLength[6]', 'notEmpty'],
|
122
|
+
},
|
123
|
+
}); // $ExpectType JQuery<HTMLElement>
|
124
|
+
|
125
|
+
$.fn.form.settings.rules.date = function (dateStr: string) {
|
126
|
+
return dateStr !== '';
|
127
|
+
};
|
128
|
+
|
129
|
+
$.modal('alert', {
|
130
|
+
title: 'Listen to me',
|
131
|
+
content: 'I love Fomantic-UI',
|
132
|
+
handler: function () {
|
133
|
+
$.toast({ message: 'Great!' });
|
134
|
+
},
|
135
|
+
});
|
136
|
+
|
137
|
+
$.fn.modal.settings.templates.greet = function (username: string) {
|
138
|
+
// do something according to modals settings and/or given parameters
|
139
|
+
return {
|
140
|
+
title: 'Greetings to ' + username + '!',
|
141
|
+
content: '' + username.toUpperCase() + 'is the best!',
|
142
|
+
class: 'inverted',
|
143
|
+
classContent: 'centered',
|
144
|
+
dimmerSettings: {
|
145
|
+
variation: 'inverted',
|
146
|
+
},
|
147
|
+
};
|
148
|
+
};
|
149
|
+
|
150
|
+
$.modal('greet', 'mom');
|
151
|
+
|
152
|
+
$().nag({
|
153
|
+
persist: true,
|
154
|
+
}); // $ExpectType JQuery<HTMLElement>
|
155
|
+
|
156
|
+
$().search('display message', 'Hello, world !'); // $ExpectType JQuery<HTMLElement>
|
157
|
+
|
158
|
+
// To change the defaults for all toast at once override the module as follows
|
159
|
+
$.fn.toast.settings.progressUp = true;
|
160
|
+
$.fn.toast.settings.class = 'info';
|
161
|
+
$.fn.toast.settings.showIcon = true;
|
162
|
+
$.fn.toast.settings.className.box = 'toast-box'; // removes shadow
|
163
|
+
$.fn.toast.settings.className.title = 'header'; // smaller font size
|
164
|
+
$.fn.toast.settings.className.icon = 'icon'; // top position again
|
165
|
+
$.fn.toast.settings.transition.closeEasing = 'easeOutBounce';
|
166
|
+
|
167
|
+
// Or apply the old defaults directly to the toast
|
168
|
+
$.toast({
|
169
|
+
title: 'LOOK',
|
170
|
+
message: 'Turned back time to 2.7.0 defaults',
|
171
|
+
showProgress: 'bottom',
|
172
|
+
// make it look like 2.7.0
|
173
|
+
showIcon: true,
|
174
|
+
progressUp: true,
|
175
|
+
class: 'info',
|
176
|
+
className: {
|
177
|
+
box: 'toast-box',
|
178
|
+
title: 'header',
|
179
|
+
icon: 'icon',
|
180
|
+
},
|
181
|
+
transition: {
|
182
|
+
closeEasing: 'easeOutBounce',
|
183
|
+
},
|
184
|
+
});
|
185
|
+
|
186
|
+
$().transition('shake', '200ms');
|
187
|
+
$().transition('horizontal flip', 500, function () { /* make eslint happy */ });
|
188
|
+
$().transition('fade up');
|
package/types/tsconfig.json
CHANGED
@@ -1,187 +0,0 @@
|
|
1
|
-
/// <reference path="index.d.ts" />
|
2
|
-
|
3
|
-
$().accordion(); // $ExpectType JQuery<HTMLElement>
|
4
|
-
$().api();// $ExpectType JQuery
|
5
|
-
$().calendar(); // $ExpectType JQuery<HTMLElement>
|
6
|
-
$().checkbox(); // $ExpectType JQuery<HTMLElement>
|
7
|
-
$('body').dimmer(); // $ExpectType JQuery<HTMLElement>
|
8
|
-
$().dropdown(); // $ExpectType JQuery<HTMLElement>
|
9
|
-
$().embed(); // $ExpectType JQuery<HTMLElement>
|
10
|
-
$().flyout(); // $ExpectType JQuery<HTMLElement>
|
11
|
-
$().form(); // $ExpectType JQuery<HTMLElement>
|
12
|
-
$().modal(); // $ExpectType JQuery<HTMLElement>
|
13
|
-
$().nag(); // $ExpectType JQuery<HTMLElement>
|
14
|
-
$().popup(); // $ExpectType JQuery<HTMLElement>
|
15
|
-
$().progress(); // $ExpectType JQuery<HTMLElement>
|
16
|
-
$().rating(); // $ExpectType JQuery<HTMLElement>
|
17
|
-
$().search(); // $ExpectType JQuery<HTMLElement>
|
18
|
-
$().shape(); // $ExpectType JQuery<HTMLElement>
|
19
|
-
$().sidebar(); // $ExpectType JQuery<HTMLElement>
|
20
|
-
$().slider(); // $ExpectType JQuery<HTMLElement>
|
21
|
-
$().sticky(); // $ExpectType JQuery<HTMLElement>
|
22
|
-
$().tab(); // $ExpectType JQuery<HTMLElement>
|
23
|
-
$('body').toast(); // $ExpectType JQuery<HTMLElement>
|
24
|
-
$().transition(); // $ExpectType JQuery<HTMLElement>
|
25
|
-
$().visibility(); // $ExpectType JQuery<HTMLElement>
|
26
|
-
|
27
|
-
/* Define API endpoints once globally */
|
28
|
-
$.fn.api.settings.api = {
|
29
|
-
'get followers' : '/followers/{id}?results={count}',
|
30
|
-
'create user' : '/create',
|
31
|
-
'add user' : '/add/{id}',
|
32
|
-
'follow user' : '/follow/{id}',
|
33
|
-
'search' : '/search/?query={value}'
|
34
|
-
};
|
35
|
-
|
36
|
-
$().calendar({
|
37
|
-
today: true,
|
38
|
-
initialDate: null,
|
39
|
-
endCalendar: $()
|
40
|
-
}); // $ExpectType JQuery<HTMLElement>
|
41
|
-
|
42
|
-
$.flyout('alert','hello'); // $ExpectType JQuery<HTMLElement>
|
43
|
-
$.flyout('confirm','Are you sure?',function(){}); // $ExpectType JQuery<HTMLElement>
|
44
|
-
$.flyout('prompt','Enter Code', function(){}); // $ExpectType JQuery<HTMLElement>
|
45
|
-
|
46
|
-
$.fn.flyout.settings.templates.greet = function(username) {
|
47
|
-
return {
|
48
|
-
title: 'Greetings to ' + username + '!',
|
49
|
-
content: ''+ username.toUpperCase() + 'is the best!',
|
50
|
-
closeIcon: true,
|
51
|
-
class: 'inverted',
|
52
|
-
classContent: 'centered'
|
53
|
-
}
|
54
|
-
}
|
55
|
-
|
56
|
-
$().form({
|
57
|
-
fields: {
|
58
|
-
field1: {
|
59
|
-
rules: [
|
60
|
-
{
|
61
|
-
type : 'empty'
|
62
|
-
}
|
63
|
-
]
|
64
|
-
},
|
65
|
-
field2: {
|
66
|
-
rules: [
|
67
|
-
{
|
68
|
-
type : 'isExactly[dog]',
|
69
|
-
prompt : '{name} is set to "{value}" that is totally wrong. It should be {ruleValue}'
|
70
|
-
}
|
71
|
-
]
|
72
|
-
},
|
73
|
-
field3: {
|
74
|
-
rules: [
|
75
|
-
{
|
76
|
-
type : 'isExactly[cat]',
|
77
|
-
prompt : function(value) {
|
78
|
-
if(value == 'dog') {
|
79
|
-
return 'I told you to put cat, not dog!';
|
80
|
-
}
|
81
|
-
return 'That is not cat';
|
82
|
-
}
|
83
|
-
}
|
84
|
-
]
|
85
|
-
},
|
86
|
-
color: {
|
87
|
-
identifier: 'color',
|
88
|
-
rules: [{
|
89
|
-
type: 'regExp',
|
90
|
-
value: /rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)/i,
|
91
|
-
}]
|
92
|
-
},
|
93
|
-
yearsPracticed: {
|
94
|
-
identifier : 'yearsPracticed',
|
95
|
-
depends : 'isDoctor',
|
96
|
-
rules : [
|
97
|
-
{
|
98
|
-
type : 'empty',
|
99
|
-
prompt : 'Please enter the number of years you have been a doctor'
|
100
|
-
}
|
101
|
-
]
|
102
|
-
},
|
103
|
-
ccEmail: {
|
104
|
-
identifier : 'cc-email',
|
105
|
-
optional : true,
|
106
|
-
rules: [
|
107
|
-
{
|
108
|
-
type : 'email',
|
109
|
-
prompt : 'Please enter a valid second e-mail'
|
110
|
-
}
|
111
|
-
]
|
112
|
-
}
|
113
|
-
}
|
114
|
-
}); // $ExpectType JQuery<HTMLElement>
|
115
|
-
|
116
|
-
$().form({
|
117
|
-
fields: {
|
118
|
-
gender: 'empty',
|
119
|
-
name: 'empty',
|
120
|
-
password : ['minLength[6]', 'empty']
|
121
|
-
}
|
122
|
-
}); // $ExpectType JQuery<HTMLElement>
|
123
|
-
|
124
|
-
$.fn.form.settings.rules.date = function(str_date: string) {
|
125
|
-
return true;
|
126
|
-
};
|
127
|
-
|
128
|
-
$.modal('alert', {
|
129
|
-
title: 'Listen to me',
|
130
|
-
content: 'I love Fomantic-UI',
|
131
|
-
handler: function() {
|
132
|
-
$.toast({message:'Great!'});
|
133
|
-
}
|
134
|
-
});
|
135
|
-
|
136
|
-
$.fn.modal.settings.templates.greet = function(username: string) {
|
137
|
-
// do something according to modals settings and/or given parameters
|
138
|
-
return {
|
139
|
-
title: 'Greetings to ' + username + '!',
|
140
|
-
content: ''+ username.toUpperCase() + 'is the best!',
|
141
|
-
class: 'inverted',
|
142
|
-
classContent: 'centered',
|
143
|
-
dimmerSettings: {
|
144
|
-
variation: 'inverted'
|
145
|
-
}
|
146
|
-
}
|
147
|
-
}
|
148
|
-
|
149
|
-
$.modal('greet', 'mom');
|
150
|
-
|
151
|
-
$().nag({
|
152
|
-
persist: true
|
153
|
-
}); // $ExpectType JQuery<HTMLElement>
|
154
|
-
|
155
|
-
$().search("display message", "Hello, world !"); // $ExpectType JQuery<HTMLElement>
|
156
|
-
|
157
|
-
// To change the defaults for all toast at once override the module as follows
|
158
|
-
$.fn.toast.settings.progressUp = true;
|
159
|
-
$.fn.toast.settings.class = 'info';
|
160
|
-
$.fn.toast.settings.showIcon = true;
|
161
|
-
$.fn.toast.settings.className.box = 'toast-box'; //removes shadow
|
162
|
-
$.fn.toast.settings.className.title = 'header'; // smaller font size
|
163
|
-
$.fn.toast.settings.className.icon = 'icon'; // top position again
|
164
|
-
$.fn.toast.settings.transition.closeEasing = 'easeOutBounce';
|
165
|
-
|
166
|
-
// Or apply the old defaults directly to the toast
|
167
|
-
$.toast({
|
168
|
-
title: 'LOOK',
|
169
|
-
message: 'Turned back time to 2.7.0 defaults',
|
170
|
-
showProgress: 'bottom',
|
171
|
-
//make it look like 2.7.0
|
172
|
-
showIcon: true,
|
173
|
-
progressUp: true,
|
174
|
-
class: 'info',
|
175
|
-
className: {
|
176
|
-
box:'toast-box',
|
177
|
-
title:'header',
|
178
|
-
icon: 'icon'
|
179
|
-
},
|
180
|
-
transition: {
|
181
|
-
closeEasing: 'easeOutBounce'
|
182
|
-
}
|
183
|
-
});
|
184
|
-
|
185
|
-
$().transition("shake", "200ms");
|
186
|
-
$().transition("horizontal flip", 500, function() { alert('done!'); });
|
187
|
-
$().transition("fade up");
|