fomantic-ui 2.9.3-beta.9 → 2.9.4-beta.0
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 +2 -2
- package/.github/FUNDING.yml +1 -1
- package/.github/auto_assign.yml +1 -1
- package/.github/workflows/ci.yml +5 -5
- package/.github/workflows/nightly.yml +1 -1
- package/.github/workflows/release.yml +1 -1
- package/CHANGELOG.md +131 -0
- package/CONTRIBUTORS.md +1 -1
- package/README.md +5 -2
- package/SECURITY.md +2 -1
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +2 -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 +10 -9
- 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 +2 -2
- package/dist/components/button.min.css +2 -2
- package/dist/components/calendar.css +140 -3
- package/dist/components/calendar.js +2 -2
- package/dist/components/calendar.min.css +2 -2
- package/dist/components/calendar.min.js +2 -2
- package/dist/components/card.css +1 -1
- package/dist/components/card.min.css +1 -1
- package/dist/components/checkbox.css +50 -6
- package/dist/components/checkbox.js +5 -3
- package/dist/components/checkbox.min.css +2 -2
- package/dist/components/checkbox.min.js +2 -2
- package/dist/components/comment.css +6 -1
- package/dist/components/comment.min.css +2 -2
- package/dist/components/container.css +62 -1
- package/dist/components/container.min.css +2 -2
- package/dist/components/dimmer.css +3 -3
- package/dist/components/dimmer.js +2 -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 +101 -25
- package/dist/components/dropdown.js +29 -21
- package/dist/components/dropdown.min.css +2 -2
- package/dist/components/dropdown.min.js +2 -2
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +2 -2
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +2 -2
- package/dist/components/emoji.css +697 -249
- package/dist/components/emoji.min.css +2 -2
- package/dist/components/feed.css +486 -5
- package/dist/components/feed.min.css +2 -2
- package/dist/components/flag.css +3 -2
- package/dist/components/flag.min.css +2 -2
- package/dist/components/flyout.css +1 -1
- package/dist/components/flyout.js +2 -33
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +34 -32
- package/dist/components/form.js +72 -31
- package/dist/components/form.min.css +2 -2
- package/dist/components/form.min.js +2 -2
- package/dist/components/grid.css +107 -107
- 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 +62 -62
- package/dist/components/icon.min.css +2 -2
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +3 -27
- package/dist/components/input.min.css +2 -2
- package/dist/components/item.css +6 -1
- package/dist/components/item.min.css +2 -2
- package/dist/components/label.css +21 -2
- package/dist/components/label.min.css +2 -2
- package/dist/components/list.css +13 -13
- package/dist/components/list.min.css +2 -2
- package/dist/components/loader.css +282 -282
- package/dist/components/loader.min.css +2 -2
- package/dist/components/menu.css +13 -7
- package/dist/components/menu.min.css +2 -2
- package/dist/components/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +5 -1
- package/dist/components/modal.js +3 -3
- package/dist/components/modal.min.css +2 -2
- package/dist/components/modal.min.js +2 -2
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +3 -3
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +2 -2
- package/dist/components/placeholder.css +1 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +3 -3
- package/dist/components/popup.js +11 -9
- package/dist/components/popup.min.css +2 -2
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +2 -2
- package/dist/components/progress.min.css +1 -1
- 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 +2 -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 +26 -1
- package/dist/components/search.js +5 -4
- package/dist/components/search.min.css +2 -2
- package/dist/components/search.min.js +2 -2
- package/dist/components/segment.css +159 -33
- package/dist/components/segment.min.css +2 -2
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +2 -2
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +2 -2
- package/dist/components/sidebar.css +1 -1
- package/dist/components/sidebar.js +2 -32
- package/dist/components/sidebar.min.css +1 -1
- package/dist/components/sidebar.min.js +2 -2
- package/dist/components/site.css +1 -1
- package/dist/components/site.js +2 -2
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.css +1 -1
- package/dist/components/slider.js +126 -26
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +2 -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 +2 -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 +6 -4
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +2 -2
- package/dist/components/table.css +65 -1
- 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 +6 -1
- package/dist/components/toast.js +2 -2
- package/dist/components/toast.min.css +2 -2
- package/dist/components/toast.min.js +2 -2
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +3 -3
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +2 -2
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +2822 -954
- package/dist/semantic.js +302 -206
- package/dist/semantic.min.css +2 -2
- package/dist/semantic.min.js +2 -2
- package/package.json +4 -3
- package/scripts/nightly-version.js +2 -2
- package/src/definitions/behaviors/api.js +9 -8
- package/src/definitions/behaviors/form.js +71 -30
- package/src/definitions/behaviors/state.js +1 -1
- package/src/definitions/behaviors/visibility.js +1 -1
- package/src/definitions/collections/form.less +9 -14
- package/src/definitions/collections/grid.less +106 -106
- package/src/definitions/collections/menu.less +29 -22
- package/src/definitions/collections/table.less +66 -0
- package/src/definitions/elements/button.less +1 -1
- package/src/definitions/elements/container.less +63 -0
- package/src/definitions/elements/icon.less +5 -5
- package/src/definitions/elements/input.less +2 -2
- package/src/definitions/elements/label.less +21 -1
- package/src/definitions/elements/list.less +13 -13
- package/src/definitions/elements/loader.less +71 -71
- package/src/definitions/elements/segment.less +110 -13
- package/src/definitions/globals/site.js +1 -1
- package/src/definitions/modules/accordion.js +1 -1
- package/src/definitions/modules/calendar.js +1 -1
- package/src/definitions/modules/calendar.less +40 -11
- package/src/definitions/modules/checkbox.js +4 -2
- package/src/definitions/modules/checkbox.less +61 -5
- package/src/definitions/modules/dimmer.js +1 -1
- package/src/definitions/modules/dimmer.less +2 -2
- package/src/definitions/modules/dropdown.js +28 -20
- package/src/definitions/modules/dropdown.less +124 -21
- package/src/definitions/modules/embed.js +1 -1
- package/src/definitions/modules/flyout.js +1 -32
- package/src/definitions/modules/modal.js +2 -2
- package/src/definitions/modules/modal.less +6 -0
- package/src/definitions/modules/nag.js +2 -2
- package/src/definitions/modules/popup.js +10 -8
- package/src/definitions/modules/popup.less +4 -4
- package/src/definitions/modules/progress.js +1 -1
- package/src/definitions/modules/rating.js +1 -1
- package/src/definitions/modules/search.js +4 -3
- package/src/definitions/modules/search.less +31 -0
- package/src/definitions/modules/shape.js +1 -1
- package/src/definitions/modules/sidebar.js +1 -31
- package/src/definitions/modules/slider.js +125 -25
- package/src/definitions/modules/sticky.js +1 -1
- package/src/definitions/modules/tab.js +5 -3
- package/src/definitions/modules/toast.js +1 -1
- package/src/definitions/modules/toast.less +7 -0
- package/src/definitions/modules/transition.js +2 -2
- package/src/definitions/views/comment.less +7 -0
- package/src/definitions/views/feed.less +238 -32
- package/src/definitions/views/item.less +7 -0
- package/src/theme.less +1 -1
- package/src/themes/amazon/elements/button.variables +5 -1
- package/src/themes/bootstrap3/elements/button.variables +5 -1
- package/src/themes/chubby/elements/header.variables +6 -1
- package/src/themes/default/collections/message.variables +3 -9
- package/src/themes/default/collections/table.variables +11 -8
- package/src/themes/default/elements/button.variables +8 -10
- package/src/themes/default/elements/container.variables +3 -0
- package/src/themes/default/elements/emoji.variables +179 -67
- package/src/themes/default/elements/flag.variables +1 -1
- package/src/themes/default/elements/label.variables +6 -1
- package/src/themes/default/elements/segment.variables +8 -0
- package/src/themes/default/globals/site.variables +362 -341
- package/src/themes/default/globals/variation.variables +24 -1
- package/src/themes/default/modules/calendar.variables +11 -0
- package/src/themes/default/modules/checkbox.variables +12 -0
- package/src/themes/default/modules/dropdown.variables +10 -4
- package/src/themes/default/modules/modal.variables +3 -0
- package/src/themes/default/modules/popup.variables +1 -1
- package/src/themes/default/modules/search.variables +3 -0
- package/src/themes/default/modules/toast.variables +6 -5
- package/src/themes/default/views/card.variables +4 -12
- package/src/themes/default/views/feed.variables +55 -1
- package/src/themes/default/views/item.variables +5 -5
- package/src/themes/flat/collections/form.variables +4 -4
- package/src/themes/flat/globals/site.variables +1 -1
- package/src/themes/github/elements/button.variables +5 -1
- package/src/themes/joypixels/elements/emoji.variables +182 -70
- package/src/themes/material/globals/site.variables +1 -1
- package/src/themes/twitter/elements/button.variables +5 -1
- package/src/themes/twitter/elements/emoji.variables +178 -66
- package/tasks/admin/components/create.js +1 -2
- package/tasks/admin/components/init.js +3 -4
- package/tasks/admin/components/update.js +2 -3
- package/tasks/admin/distributions/create.js +9 -5
- package/tasks/admin/distributions/init.js +3 -4
- package/tasks/admin/distributions/update.js +2 -3
- package/tasks/config/project/install.js +3 -0
- package/tasks/config/tasks.js +1 -8
- package/tasks/config/user.js +1 -1
- package/tasks/docs/build.js +2 -2
- package/tasks/docs/metadata.js +1 -1
- package/tasks/docs/serve.js +1 -1
- package/tasks/install.js +19 -10
- package/tasks/watch.js +1 -2
- package/types/fomantic-ui-accordion.d.ts +244 -0
- package/types/fomantic-ui-api.d.ts +555 -0
- package/types/fomantic-ui-calendar.d.ts +766 -0
- package/types/fomantic-ui-checkbox.d.ts +332 -0
- package/types/fomantic-ui-dimmer.d.ts +408 -0
- package/types/fomantic-ui-dropdown.d.ts +1183 -0
- package/types/fomantic-ui-embed.d.ts +326 -0
- package/types/fomantic-ui-flyout.d.ts +525 -0
- package/types/fomantic-ui-form.d.ts +651 -0
- package/types/fomantic-ui-modal.d.ts +471 -0
- package/types/fomantic-ui-nag.d.ts +270 -0
- package/types/fomantic-ui-popup.d.ts +523 -0
- package/types/fomantic-ui-progress.d.ts +459 -0
- package/types/fomantic-ui-rating.d.ts +187 -0
- package/types/fomantic-ui-search.d.ts +496 -0
- package/types/fomantic-ui-shape.d.ts +274 -0
- package/types/fomantic-ui-sidebar.d.ts +402 -0
- package/types/fomantic-ui-slider.d.ts +316 -0
- package/types/fomantic-ui-sticky.d.ts +215 -0
- package/types/fomantic-ui-tab.d.ts +361 -0
- package/types/fomantic-ui-tests.ts +25 -0
- package/types/fomantic-ui-toast.d.ts +514 -0
- package/types/fomantic-ui-transition.d.ts +355 -0
- package/types/fomantic-ui-visibility.d.ts +355 -0
- package/types/index.d.ts +63 -0
- package/types/tsconfig.json +23 -0
- package/types/tslint.json +1 -0
@@ -0,0 +1,459 @@
|
|
1
|
+
declare namespace FomanticUI {
|
2
|
+
interface Progress {
|
3
|
+
settings: ProgressSettings;
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Sets current percent of progress to value.
|
7
|
+
* If using a total will convert from percent to estimated value.
|
8
|
+
* 'percent' can be array of percent like '[20,30,50]', comma-separated string like '20,30,50' for `.ui.multiple.progress`.
|
9
|
+
*/
|
10
|
+
(behavior: 'set percent', percent: number | [] | string): JQuery;
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Sets progress to specified value.
|
14
|
+
* Will automatically calculate percent from total.
|
15
|
+
* value can be array of values like '[5,3,10]', comma-separated string like '5,3,10' for `.ui.multiple.progress`.
|
16
|
+
*/
|
17
|
+
(behavior: 'set progress', value: number | [] | string): JQuery;
|
18
|
+
|
19
|
+
/**
|
20
|
+
* Increments progress by increment value, if not passed a value will use random amount specified in settings.
|
21
|
+
*/
|
22
|
+
(behavior: 'increment', incrementValue: number): JQuery;
|
23
|
+
|
24
|
+
/**
|
25
|
+
* Decrements progress by decrement value, if not passed a value will use random amount specified in settings.
|
26
|
+
*/
|
27
|
+
(behavior: 'decrement', decrementValue: number): JQuery;
|
28
|
+
|
29
|
+
/**
|
30
|
+
* Immediately updates progress to value, ignoring progress animation interval delays.
|
31
|
+
* 'value' can be array of values like '[5,3,10]', comma-separated string like '5,3,10' for `.ui.multiple.progress`.
|
32
|
+
*/
|
33
|
+
(behavior: 'update progress', value: number | [] | string): JQuery;
|
34
|
+
|
35
|
+
/**
|
36
|
+
* Finishes progress and sets loaded to 100%.
|
37
|
+
* Set 'keepState' to 'true' (default 'false') to stop the active animation only without setting the progress to 100%.
|
38
|
+
*/
|
39
|
+
(behavior: 'complete', keepState: boolean): JQuery;
|
40
|
+
|
41
|
+
/**
|
42
|
+
* Resets progress to zero.
|
43
|
+
*/
|
44
|
+
(behavior: 'reset'): JQuery;
|
45
|
+
|
46
|
+
/**
|
47
|
+
* Set total to a new value.
|
48
|
+
*/
|
49
|
+
(behavior: 'set total', total: number): JQuery;
|
50
|
+
|
51
|
+
/**
|
52
|
+
* Replaces templated string with value, total, percent left and percent.
|
53
|
+
*/
|
54
|
+
(behavior: 'get text', text: string): JQuery;
|
55
|
+
|
56
|
+
/**
|
57
|
+
* Returns normalized value inside acceptable range specified by total.
|
58
|
+
*/
|
59
|
+
(behavior: 'get normalized value', value: number): JQuery;
|
60
|
+
|
61
|
+
/**
|
62
|
+
* Returns percent as last specified.
|
63
|
+
*/
|
64
|
+
(behavior: 'get percent'): number;
|
65
|
+
|
66
|
+
/**
|
67
|
+
* Returns current progress value.
|
68
|
+
*/
|
69
|
+
(behavior: 'get value'): number;
|
70
|
+
|
71
|
+
/**
|
72
|
+
* Returns total.
|
73
|
+
*/
|
74
|
+
(behavior: 'get total'): number;
|
75
|
+
|
76
|
+
/**
|
77
|
+
* Returns whether progress is completed.
|
78
|
+
*/
|
79
|
+
(behavior: 'is complete'): boolean;
|
80
|
+
|
81
|
+
/**
|
82
|
+
* Returns whether progress was a success.
|
83
|
+
*/
|
84
|
+
(behavior: 'is success'): boolean;
|
85
|
+
|
86
|
+
/**
|
87
|
+
* Returns whether progress is in warning state.
|
88
|
+
*/
|
89
|
+
(behavior: 'is warning'): boolean;
|
90
|
+
|
91
|
+
/**
|
92
|
+
* Returns whether progress is in error state.
|
93
|
+
*/
|
94
|
+
(behavior: 'is error'): boolean;
|
95
|
+
|
96
|
+
/**
|
97
|
+
* Returns whether progress is in active state.
|
98
|
+
*/
|
99
|
+
(behavior: 'is active'): boolean;
|
100
|
+
|
101
|
+
/**
|
102
|
+
* Sets progress to active state.
|
103
|
+
*/
|
104
|
+
(behavior: 'set active'): JQuery;
|
105
|
+
|
106
|
+
/**
|
107
|
+
* Sets progress to warning state. Set 'keepState' to 'true' (default 'false') to keep the progressbar state and the current percentage without raising it up to 100%.
|
108
|
+
*/
|
109
|
+
(behavior: 'set warning', text: string, keepState: boolean): JQuery;
|
110
|
+
|
111
|
+
/**
|
112
|
+
* Sets progress to success state. Set 'keepState' to 'true' (default 'false') to keep the progressbar state and the current percentage without raising it up to 100%.
|
113
|
+
*/
|
114
|
+
(behavior: 'set success', text: string, keepState: boolean): JQuery;
|
115
|
+
|
116
|
+
/**
|
117
|
+
* Sets progress to error state. Set 'keepState' to 'true' (default 'false') to keep the progressbar state and the current percentage without raising it up to 100%.
|
118
|
+
*/
|
119
|
+
(behavior: 'set error', text: string, keepState: boolean): JQuery;
|
120
|
+
|
121
|
+
/**
|
122
|
+
* Changes progress animation speed.
|
123
|
+
*/
|
124
|
+
(behavior: 'set duration', value: number): JQuery;
|
125
|
+
|
126
|
+
/**
|
127
|
+
* Sets progress exterior label to text.
|
128
|
+
*/
|
129
|
+
(behavior: 'set label', text: string): JQuery;
|
130
|
+
|
131
|
+
/**
|
132
|
+
* Sets progress bar label to text.
|
133
|
+
*/
|
134
|
+
(behavior: 'set bar label', text: string): JQuery;
|
135
|
+
|
136
|
+
/**
|
137
|
+
* Removes progress to active state.
|
138
|
+
*/
|
139
|
+
(behavior: 'remove active'): JQuery;
|
140
|
+
|
141
|
+
/**
|
142
|
+
* Removes progress to warning state.
|
143
|
+
*/
|
144
|
+
(behavior: 'remove warning'): JQuery;
|
145
|
+
|
146
|
+
/**
|
147
|
+
* Removes progress to success state.
|
148
|
+
*/
|
149
|
+
(behavior: 'remove success'): JQuery;
|
150
|
+
|
151
|
+
/**
|
152
|
+
* Removes progress to error state.
|
153
|
+
*/
|
154
|
+
(behavior: 'remove error'): JQuery;
|
155
|
+
|
156
|
+
/**
|
157
|
+
* Destroys instance and removes all events.
|
158
|
+
*/
|
159
|
+
(behavior: 'destroy'): JQuery;
|
160
|
+
|
161
|
+
<K extends keyof ProgressSettings>(behavior: 'setting', name: K, value?: undefined, ): Partial<Pick<ProgressSettings, keyof ProgressSettings>>;
|
162
|
+
<K extends keyof ProgressSettings>(behavior: 'setting', name: K, value: ProgressSettings[K]): JQuery;
|
163
|
+
(behavior: 'setting', value: Partial<Pick<ProgressSettings, keyof ProgressSettings>>): JQuery;
|
164
|
+
(settings?: Partial<Pick<ProgressSettings, keyof ProgressSettings>>): JQuery;
|
165
|
+
}
|
166
|
+
|
167
|
+
/**
|
168
|
+
* @see {@link https://fomantic-ui.com/modules/progress.html#/settings}
|
169
|
+
*/
|
170
|
+
interface ProgressSettings {
|
171
|
+
// region Progress Settings
|
172
|
+
|
173
|
+
/**
|
174
|
+
* Whether success state should automatically trigger when progress completes.
|
175
|
+
* @default true
|
176
|
+
*/
|
177
|
+
autoSuccess: boolean;
|
178
|
+
|
179
|
+
/**
|
180
|
+
* Whether progress should automatically show activity when incremented.
|
181
|
+
* @default true
|
182
|
+
*/
|
183
|
+
showActivity: boolean;
|
184
|
+
|
185
|
+
/**
|
186
|
+
* When set to 'true', values that calculate to above 100% or below 0% will be adjusted.
|
187
|
+
* When set to 'false', inappropriate values will produce an error.
|
188
|
+
* @default true
|
189
|
+
*/
|
190
|
+
limitValues: boolean;
|
191
|
+
|
192
|
+
/**
|
193
|
+
* Can be set to either to display progress as 'percent' or 'ratio'.
|
194
|
+
* Matches up to corresponding text template with the same name.
|
195
|
+
* @default 'percent'
|
196
|
+
*/
|
197
|
+
label: 'percent' | 'ratio';
|
198
|
+
|
199
|
+
/**
|
200
|
+
* When incrementing without value, sets range for random increment value.
|
201
|
+
* @default {}
|
202
|
+
*/
|
203
|
+
random: object;
|
204
|
+
|
205
|
+
/**
|
206
|
+
* Decimal point precision for calculated progress.
|
207
|
+
* @default 0
|
208
|
+
*/
|
209
|
+
precision: number;
|
210
|
+
|
211
|
+
/**
|
212
|
+
* Setting a total value will make each call to increment get closer to this total (i.e. 1/20, 2/20 etc).
|
213
|
+
* @default false
|
214
|
+
*/
|
215
|
+
total: false | number;
|
216
|
+
|
217
|
+
/**
|
218
|
+
* Sets current value, when total is specified, this is used to calculate a ratio of the total, with percent this should be the overall percent.
|
219
|
+
* @default false
|
220
|
+
*/
|
221
|
+
value: false | number;
|
222
|
+
|
223
|
+
// endregion
|
224
|
+
|
225
|
+
// region Callbacks
|
226
|
+
|
227
|
+
/**
|
228
|
+
* Callback on percentage change.
|
229
|
+
*/
|
230
|
+
onChange(this: JQuery, percent: number, value: number, total: number): void;
|
231
|
+
|
232
|
+
/**
|
233
|
+
* Callback on success state.
|
234
|
+
*/
|
235
|
+
onSuccess(this: JQuery, total: number): void;
|
236
|
+
|
237
|
+
/**
|
238
|
+
* Callback on active state.
|
239
|
+
*/
|
240
|
+
onActive(this: JQuery, value: number, total: number): void;
|
241
|
+
|
242
|
+
/**
|
243
|
+
* Callback on error state.
|
244
|
+
*/
|
245
|
+
onError(this: JQuery, value: number, total: number): void;
|
246
|
+
|
247
|
+
/**
|
248
|
+
* Callback on warning state.
|
249
|
+
*/
|
250
|
+
onWarning(this: JQuery, value: number, total: number): void;
|
251
|
+
|
252
|
+
// endregion
|
253
|
+
|
254
|
+
// region DOM Settings
|
255
|
+
|
256
|
+
/**
|
257
|
+
* DOM Selectors used internally.
|
258
|
+
* Selectors used to find parts of a module.
|
259
|
+
*/
|
260
|
+
selector: Progress.SelectorSettings;
|
261
|
+
|
262
|
+
/**
|
263
|
+
* Class names used to determine element state.
|
264
|
+
*/
|
265
|
+
className: Progress.ClassNameSettings;
|
266
|
+
|
267
|
+
/**
|
268
|
+
*
|
269
|
+
*/
|
270
|
+
text: Progress.TextSettings;
|
271
|
+
|
272
|
+
/**
|
273
|
+
* Regular expressions used by module
|
274
|
+
*/
|
275
|
+
regExp: Progress.RegExpSettings;
|
276
|
+
|
277
|
+
/**
|
278
|
+
* Regular expressions used by module
|
279
|
+
*/
|
280
|
+
metadata: Progress.MetadataSettings;
|
281
|
+
|
282
|
+
// endregion
|
283
|
+
|
284
|
+
// region Debug Settings
|
285
|
+
|
286
|
+
/**
|
287
|
+
* Name used in log statements
|
288
|
+
* @default 'Progress'
|
289
|
+
*/
|
290
|
+
name: string;
|
291
|
+
|
292
|
+
/**
|
293
|
+
* Event namespace. Makes sure module teardown does not effect other events attached to an element.
|
294
|
+
* @default 'progress'
|
295
|
+
*/
|
296
|
+
namespace: string;
|
297
|
+
|
298
|
+
/**
|
299
|
+
* Silences all console output including error messages, regardless of other debug settings.
|
300
|
+
* @default false
|
301
|
+
*/
|
302
|
+
silent: boolean;
|
303
|
+
|
304
|
+
/**
|
305
|
+
* Debug output to console
|
306
|
+
* @default false
|
307
|
+
*/
|
308
|
+
debug: boolean;
|
309
|
+
|
310
|
+
/**
|
311
|
+
* Show console.table output with performance metrics
|
312
|
+
* @default true
|
313
|
+
*/
|
314
|
+
performance: boolean;
|
315
|
+
|
316
|
+
/**
|
317
|
+
* Debug output includes all internal behaviors
|
318
|
+
* @default false
|
319
|
+
*/
|
320
|
+
verbose: boolean;
|
321
|
+
|
322
|
+
error: Progress.ErrorSettings;
|
323
|
+
|
324
|
+
// endregion
|
325
|
+
}
|
326
|
+
|
327
|
+
namespace Progress {
|
328
|
+
type SelectorSettings = Partial<Pick<Settings.Selectors, keyof Settings.Selectors>>;
|
329
|
+
type ClassNameSettings = Partial<Pick<Settings.ClassNames, keyof Settings.ClassNames>>;
|
330
|
+
type TextSettings = Partial<Pick<Settings.Texts, keyof Settings.Texts>>;
|
331
|
+
type RegExpSettings = Partial<Pick<Settings.RegExps, keyof Settings.RegExps>>;
|
332
|
+
type MetadataSettings = Partial<Pick<Settings.Metadatas, keyof Settings.Metadatas>>;
|
333
|
+
type ErrorSettings = Partial<Pick<Settings.Errors, keyof Settings.Errors>>;
|
334
|
+
|
335
|
+
namespace Settings {
|
336
|
+
interface Selectors {
|
337
|
+
/**
|
338
|
+
* @default '> .bar'
|
339
|
+
*/
|
340
|
+
bar: string;
|
341
|
+
|
342
|
+
/**
|
343
|
+
* @default '> .label'
|
344
|
+
*/
|
345
|
+
label: string;
|
346
|
+
|
347
|
+
/**
|
348
|
+
* @default '.bar > .progress'
|
349
|
+
*/
|
350
|
+
progress: string;
|
351
|
+
}
|
352
|
+
|
353
|
+
interface ClassNames {
|
354
|
+
/**
|
355
|
+
* @default 'active'
|
356
|
+
*/
|
357
|
+
active: string;
|
358
|
+
|
359
|
+
/**
|
360
|
+
* @default 'error'
|
361
|
+
*/
|
362
|
+
error: string;
|
363
|
+
|
364
|
+
/**
|
365
|
+
* @default 'success'
|
366
|
+
*/
|
367
|
+
success: string;
|
368
|
+
|
369
|
+
/**
|
370
|
+
* @default 'warning'
|
371
|
+
*/
|
372
|
+
warning: string;
|
373
|
+
}
|
374
|
+
|
375
|
+
interface Texts {
|
376
|
+
/**
|
377
|
+
* @default false
|
378
|
+
*/
|
379
|
+
active: boolean | string;
|
380
|
+
|
381
|
+
/**
|
382
|
+
* @default false
|
383
|
+
*/
|
384
|
+
error: boolean | string;
|
385
|
+
|
386
|
+
/**
|
387
|
+
* @default false
|
388
|
+
*/
|
389
|
+
success: boolean | string;
|
390
|
+
|
391
|
+
/**
|
392
|
+
* @default false
|
393
|
+
*/
|
394
|
+
warning: boolean | string;
|
395
|
+
|
396
|
+
/**
|
397
|
+
* @default '{percent}%''
|
398
|
+
*/
|
399
|
+
percent: string;
|
400
|
+
|
401
|
+
/**
|
402
|
+
* @default '{value} of {total}'
|
403
|
+
*/
|
404
|
+
ratio: string;
|
405
|
+
|
406
|
+
/**
|
407
|
+
* @default []
|
408
|
+
*/
|
409
|
+
bars: string[];
|
410
|
+
}
|
411
|
+
|
412
|
+
interface RegExps {
|
413
|
+
/**
|
414
|
+
* @default /\{\$*[A-z0-9]+\}/g
|
415
|
+
*/
|
416
|
+
variable: RegExp;
|
417
|
+
}
|
418
|
+
|
419
|
+
interface Metadatas {
|
420
|
+
/**
|
421
|
+
* @default 'percent'
|
422
|
+
*/
|
423
|
+
percent: string;
|
424
|
+
|
425
|
+
/**
|
426
|
+
* @default 'total'
|
427
|
+
*/
|
428
|
+
total: string;
|
429
|
+
|
430
|
+
/**
|
431
|
+
* @default 'value'
|
432
|
+
*/
|
433
|
+
value: string;
|
434
|
+
}
|
435
|
+
|
436
|
+
interface Errors {
|
437
|
+
/**
|
438
|
+
* @default 'The method you called is not defined.'
|
439
|
+
*/
|
440
|
+
method: string;
|
441
|
+
|
442
|
+
/**
|
443
|
+
* @default 'Progress value is non numeric'
|
444
|
+
*/
|
445
|
+
nonNumeric: string;
|
446
|
+
|
447
|
+
/**
|
448
|
+
* @default 'Value specified is above 100%'
|
449
|
+
*/
|
450
|
+
tooHigh: string;
|
451
|
+
|
452
|
+
/**
|
453
|
+
* @default 'Value specified is below 0%'
|
454
|
+
*/
|
455
|
+
tooLow: string;
|
456
|
+
}
|
457
|
+
}
|
458
|
+
}
|
459
|
+
}
|
@@ -0,0 +1,187 @@
|
|
1
|
+
declare namespace FomanticUI {
|
2
|
+
interface Rating {
|
3
|
+
settings: RatingSettings;
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Sets rating programmatically.
|
7
|
+
*/
|
8
|
+
(behavior: 'set rating', rating: number): JQuery;
|
9
|
+
|
10
|
+
/**
|
11
|
+
* Gets current rating.
|
12
|
+
*/
|
13
|
+
(behavior: 'get rating'): number;
|
14
|
+
|
15
|
+
/**
|
16
|
+
* Disables interactive rating mode.
|
17
|
+
*/
|
18
|
+
(behavior: 'disable'): JQuery;
|
19
|
+
|
20
|
+
/**
|
21
|
+
* Enables interactive rating mode.
|
22
|
+
*/
|
23
|
+
(behavior: 'enable'): JQuery;
|
24
|
+
|
25
|
+
/**
|
26
|
+
* Clears current rating.
|
27
|
+
*/
|
28
|
+
(behavior: 'clear rating'): JQuery;
|
29
|
+
|
30
|
+
(behavior: 'destroy'): JQuery;
|
31
|
+
<K extends keyof RatingSettings>(behavior: 'setting', name: K, value?: undefined, ): Partial<Pick<RatingSettings, keyof RatingSettings>>;
|
32
|
+
<K extends keyof RatingSettings>(behavior: 'setting', name: K, value: RatingSettings[K]): JQuery;
|
33
|
+
(behavior: 'setting', value: Partial<Pick<RatingSettings, keyof RatingSettings>>): JQuery;
|
34
|
+
(settings?: Partial<Pick<RatingSettings, keyof RatingSettings>>): JQuery;
|
35
|
+
}
|
36
|
+
|
37
|
+
/**
|
38
|
+
* @see {@link https://fomantic-ui.com/modules/rating.html#/settings}
|
39
|
+
*/
|
40
|
+
interface RatingSettings {
|
41
|
+
// region Accordion Settings
|
42
|
+
|
43
|
+
/**
|
44
|
+
* The icon classname.
|
45
|
+
* @default 'star'
|
46
|
+
*/
|
47
|
+
icon: string;
|
48
|
+
|
49
|
+
/**
|
50
|
+
* A number representing the default rating to apply.
|
51
|
+
* @default 0
|
52
|
+
*/
|
53
|
+
initialRating: number;
|
54
|
+
|
55
|
+
/**
|
56
|
+
* The maximum rating value.
|
57
|
+
* @default 4
|
58
|
+
*/
|
59
|
+
maxRating: number;
|
60
|
+
|
61
|
+
/**
|
62
|
+
* Whether callbacks like 'onRate' should fire immediately after initializing with the current value.
|
63
|
+
* @default false
|
64
|
+
*/
|
65
|
+
fireOnInit: boolean;
|
66
|
+
|
67
|
+
/**
|
68
|
+
* By default a rating will be only clearable if there is 1 icon.
|
69
|
+
* Setting to 'true'/'false' will allow or disallow a user to clear their rating.
|
70
|
+
* @default 'auto'
|
71
|
+
*/
|
72
|
+
clearable: 'auto' | boolean;
|
73
|
+
|
74
|
+
/**
|
75
|
+
* Whether to enable user's ability to rate.
|
76
|
+
* @default true
|
77
|
+
*/
|
78
|
+
interactive: boolean;
|
79
|
+
|
80
|
+
// endregion
|
81
|
+
|
82
|
+
// region Callbacks
|
83
|
+
|
84
|
+
/**
|
85
|
+
* Is called after user selects a new rating.
|
86
|
+
*/
|
87
|
+
onRate(this: JQuery, value: number): void;
|
88
|
+
|
89
|
+
// endregion
|
90
|
+
|
91
|
+
// region DOM Settings
|
92
|
+
|
93
|
+
/**
|
94
|
+
* DOM Selectors used internally.
|
95
|
+
* Selectors used to find parts of a module.
|
96
|
+
*/
|
97
|
+
selector: Rating.SelectorSettings;
|
98
|
+
|
99
|
+
/**
|
100
|
+
* Class names used to determine element state.
|
101
|
+
*/
|
102
|
+
className: Rating.ClassNameSettings;
|
103
|
+
|
104
|
+
// endregion
|
105
|
+
|
106
|
+
// region Debug Settings
|
107
|
+
|
108
|
+
/**
|
109
|
+
* Name used in log statements
|
110
|
+
* @default 'Rating'
|
111
|
+
*/
|
112
|
+
name: string;
|
113
|
+
|
114
|
+
/**
|
115
|
+
* Event namespace. Makes sure module teardown does not effect other events attached to an element.
|
116
|
+
* @default 'rating'
|
117
|
+
*/
|
118
|
+
namespace: string;
|
119
|
+
|
120
|
+
/**
|
121
|
+
* Silences all console output including error messages, regardless of other debug settings.
|
122
|
+
* @default false
|
123
|
+
*/
|
124
|
+
silent: boolean;
|
125
|
+
|
126
|
+
/**
|
127
|
+
* Debug output to console
|
128
|
+
* @default false
|
129
|
+
*/
|
130
|
+
debug: boolean;
|
131
|
+
|
132
|
+
/**
|
133
|
+
* Show console.table output with performance metrics
|
134
|
+
* @default true
|
135
|
+
*/
|
136
|
+
performance: boolean;
|
137
|
+
|
138
|
+
/**
|
139
|
+
* Debug output includes all internal behaviors
|
140
|
+
* @default false
|
141
|
+
*/
|
142
|
+
verbose: boolean;
|
143
|
+
|
144
|
+
error: Rating.ErrorSettings;
|
145
|
+
|
146
|
+
// endregion
|
147
|
+
}
|
148
|
+
|
149
|
+
namespace Rating {
|
150
|
+
type SelectorSettings = Partial<Pick<Settings.Selectors, keyof Settings.Selectors>>;
|
151
|
+
type ClassNameSettings = Partial<Pick<Settings.ClassNames, keyof Settings.ClassNames>>;
|
152
|
+
type ErrorSettings = Partial<Pick<Settings.Errors, keyof Settings.Errors>>;
|
153
|
+
|
154
|
+
namespace Settings {
|
155
|
+
interface Selectors {
|
156
|
+
/**
|
157
|
+
* @default '.icon'
|
158
|
+
*/
|
159
|
+
icon: string;
|
160
|
+
}
|
161
|
+
|
162
|
+
interface ClassNames {
|
163
|
+
/**
|
164
|
+
* @default 'active'
|
165
|
+
*/
|
166
|
+
active: string;
|
167
|
+
|
168
|
+
/**
|
169
|
+
* @default 'hover'
|
170
|
+
*/
|
171
|
+
hover: string;
|
172
|
+
|
173
|
+
/**
|
174
|
+
* @default 'loading'
|
175
|
+
*/
|
176
|
+
loading: string;
|
177
|
+
}
|
178
|
+
|
179
|
+
interface Errors {
|
180
|
+
/**
|
181
|
+
* @default 'You called a rating action that was not defined'
|
182
|
+
*/
|
183
|
+
action: string;
|
184
|
+
}
|
185
|
+
}
|
186
|
+
}
|
187
|
+
}
|