gd-bs 6.6.67 → 6.6.69
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/build/bs.js +1 -0
- package/build/components/dropdown/index.js +3 -3
- package/build/icons/svgs/index.d.ts +4100 -0
- package/dist/gd-bs-icons.js +2 -0
- package/dist/gd-bs-icons.js.LICENSE.txt +9771 -0
- package/dist/gd-bs-icons.min.js +1 -0
- package/dist/gd-bs.d.ts +3268 -0
- package/dist/gd-bs.js +2 -0
- package/dist/gd-bs.js.LICENSE.txt +1403 -0
- package/dist/gd-bs.min.js +1 -0
- package/package.json +1 -1
- package/src/components/checkboxGroup/types.d.ts +7 -2
- package/src/components/dropdown/index.ts +3 -3
package/dist/gd-bs.d.ts
ADDED
|
@@ -0,0 +1,3268 @@
|
|
|
1
|
+
// Generated by dts-bundle v0.7.3
|
|
2
|
+
|
|
3
|
+
declare module 'gd-bs' {
|
|
4
|
+
import * as Components from "gd-bs/components/components";
|
|
5
|
+
var tippy: Function;
|
|
6
|
+
|
|
7
|
+
export {
|
|
8
|
+
Components, tippy
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare module 'gd-bs/components/components' {
|
|
13
|
+
export * from "gd-bs/components/accordion/types";
|
|
14
|
+
export * from "gd-bs/components/alert/types";
|
|
15
|
+
export * from "gd-bs/components/badge/types";
|
|
16
|
+
export * from "gd-bs/components/breadcrumb/types";
|
|
17
|
+
export * from "gd-bs/components/button/types";
|
|
18
|
+
export * from "gd-bs/components/buttonGroup/types";
|
|
19
|
+
export * from "gd-bs/components/card/types";
|
|
20
|
+
export * from "gd-bs/components/cardGroup/types";
|
|
21
|
+
export * from "gd-bs/components/carousel/types";
|
|
22
|
+
export * from "gd-bs/components/checkboxGroup/types";
|
|
23
|
+
export * from "gd-bs/components/collapse/types";
|
|
24
|
+
export * from "gd-bs/components/dropdown/types";
|
|
25
|
+
export * from "gd-bs/components/form/controlTypes";
|
|
26
|
+
export * from "gd-bs/components/form/formTypes";
|
|
27
|
+
export * from "gd-bs/components/inputGroup/types";
|
|
28
|
+
export * from "gd-bs/components/jumbotron/types";
|
|
29
|
+
export * from "gd-bs/components/listBox/types";
|
|
30
|
+
export * from "gd-bs/components/listGroup/types";
|
|
31
|
+
export * from "gd-bs/components/modal/types";
|
|
32
|
+
export * from "gd-bs/components/nav/types";
|
|
33
|
+
export * from "gd-bs/components/navbar/types";
|
|
34
|
+
export * from "gd-bs/components/offcanvas/types";
|
|
35
|
+
export * from "gd-bs/components/pagination/types";
|
|
36
|
+
export * from "gd-bs/components/popover/types";
|
|
37
|
+
export * from "gd-bs/components/progress/types";
|
|
38
|
+
export * from "gd-bs/components/progressGroup/types";
|
|
39
|
+
export * from "gd-bs/components/spinner/types";
|
|
40
|
+
export * from "gd-bs/components/table/types";
|
|
41
|
+
export * from "gd-bs/components/toast/types";
|
|
42
|
+
export * from "gd-bs/components/toolbar/types";
|
|
43
|
+
export * from "gd-bs/components/tooltip/types";
|
|
44
|
+
export * from "gd-bs/components/tooltipGroup/types";
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
declare module 'gd-bs/components/accordion/types' {
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* ### Accordion
|
|
51
|
+
*
|
|
52
|
+
* ```ts
|
|
53
|
+
* import { Components } from "gd-sprest-bs";
|
|
54
|
+
*
|
|
55
|
+
* // Create the accordion
|
|
56
|
+
* let el = document.querySelector("#accordion");
|
|
57
|
+
* let accordion = Components.Accordion({
|
|
58
|
+
* autoCollapse: true,
|
|
59
|
+
* el: el,
|
|
60
|
+
* id: "demoAccordion",
|
|
61
|
+
* items: [
|
|
62
|
+
* {
|
|
63
|
+
* header: "Item 1",
|
|
64
|
+
* content: "This is the content for item 1.",
|
|
65
|
+
* showFl: true
|
|
66
|
+
* },
|
|
67
|
+
* {
|
|
68
|
+
* header: "Item 2",
|
|
69
|
+
* content: "This is the content for item 2."
|
|
70
|
+
* },
|
|
71
|
+
* {
|
|
72
|
+
* header: "Item 3",
|
|
73
|
+
* content: "This is the content for item 3."
|
|
74
|
+
* }
|
|
75
|
+
* ]
|
|
76
|
+
* });
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
export const Accordion: (props: IAccordionProps, template?: string, itemTemplate?: string) => IAccordion;
|
|
80
|
+
|
|
81
|
+
import { IBase, IBaseProps } from "gd-bs/components/types";
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Accordion
|
|
85
|
+
*/
|
|
86
|
+
export interface IAccordion extends IBase<IAccordionProps> { }
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Accordion Item
|
|
90
|
+
*/
|
|
91
|
+
export interface IAccordionItem<T = HTMLElement> {
|
|
92
|
+
data?: any;
|
|
93
|
+
className?: string;
|
|
94
|
+
content?: string | T;
|
|
95
|
+
header?: string;
|
|
96
|
+
onClick?: (el?: HTMLElement, item?: IAccordionItem<T>) => void;
|
|
97
|
+
onRender?: (el?: HTMLElement, item?: IAccordionItem<T>) => void;
|
|
98
|
+
onRenderBody?: (el?: HTMLElement, item?: IAccordionItem<T>) => void;
|
|
99
|
+
onRenderHeader?: (el?: HTMLElement, item?: IAccordionItem<T>) => void;
|
|
100
|
+
showFl?: boolean;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Accordion Properties
|
|
105
|
+
*/
|
|
106
|
+
export interface IAccordionProps<T = HTMLElement> extends IBaseProps<IAccordion> {
|
|
107
|
+
autoCollapse?: boolean;
|
|
108
|
+
id?: string;
|
|
109
|
+
items?: Array<IAccordionItem<T>>;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
declare module 'gd-bs/components/alert/types' {
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* ### Alert
|
|
117
|
+
*
|
|
118
|
+
* ```ts
|
|
119
|
+
* import { Components } from "gd-sprest-bs";
|
|
120
|
+
*
|
|
121
|
+
* // Create the alert
|
|
122
|
+
* let el = document.querySelector("#alert");
|
|
123
|
+
* let alert = Components.Alert({
|
|
124
|
+
* el: el,
|
|
125
|
+
* header: "Demo",
|
|
126
|
+
* content: "This is an alert.",
|
|
127
|
+
* isDismissible: true,
|
|
128
|
+
* type: Components.AlertTypes.Success
|
|
129
|
+
* });
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
export const Alert: (props: IAlertProps, template?: string) => IAlert;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Alert Types
|
|
136
|
+
*/
|
|
137
|
+
export const AlertTypes: IAlertTypes;
|
|
138
|
+
|
|
139
|
+
import { IBase, IBaseProps } from "gd-bs/components/types";
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Alert
|
|
143
|
+
*/
|
|
144
|
+
export interface IAlert extends IBase<IAlertProps> {
|
|
145
|
+
/** Closes an alert by removing it from the DOM. */
|
|
146
|
+
close: () => void;
|
|
147
|
+
|
|
148
|
+
/** Updates the alert text. */
|
|
149
|
+
setText: (alertText?: string) => void;
|
|
150
|
+
|
|
151
|
+
/** Updates the alert type. */
|
|
152
|
+
setType: (alertType: number) => void;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Alert Properties
|
|
157
|
+
*/
|
|
158
|
+
export interface IAlertProps<T = HTMLElement> extends IBaseProps<IAlert> {
|
|
159
|
+
content?: string | T;
|
|
160
|
+
data?: any;
|
|
161
|
+
header?: string;
|
|
162
|
+
isDismissible?: boolean;
|
|
163
|
+
onClose?: (props?: IAlertProps) => void;
|
|
164
|
+
type?: number;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Alert Types
|
|
169
|
+
*/
|
|
170
|
+
export type IAlertTypes = {
|
|
171
|
+
Danger: number;
|
|
172
|
+
Dark: number;
|
|
173
|
+
Info: number;
|
|
174
|
+
Light: number;
|
|
175
|
+
Primary: number;
|
|
176
|
+
Secondary: number;
|
|
177
|
+
Success: number;
|
|
178
|
+
Warning: number;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
declare module 'gd-bs/components/badge/types' {
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* ### Badge
|
|
186
|
+
*
|
|
187
|
+
* ```ts
|
|
188
|
+
* import { Components } from "gd-sprest-bs";
|
|
189
|
+
*
|
|
190
|
+
* // Create the badge
|
|
191
|
+
* let el = document.querySelector("#badge");
|
|
192
|
+
* let badge = Components.Badge({
|
|
193
|
+
* el: el,
|
|
194
|
+
* content: "Badge",
|
|
195
|
+
* isPill: true,
|
|
196
|
+
* type: Components.BadgeTypes.Success
|
|
197
|
+
* });
|
|
198
|
+
* ```
|
|
199
|
+
*/
|
|
200
|
+
export const Badge: (props: IBadgeProps, template?: string) => IBadge;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Badge Types
|
|
204
|
+
*/
|
|
205
|
+
export const BadgeTypes: IBadgeTypes;
|
|
206
|
+
|
|
207
|
+
import { IBase, IBaseProps } from 'gd-bs/components/types';
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Badge
|
|
211
|
+
*/
|
|
212
|
+
export interface IBadge extends IBase<IBadgeProps> {
|
|
213
|
+
/** The element. */
|
|
214
|
+
el: HTMLAnchorElement | HTMLSpanElement;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Badge Properties
|
|
219
|
+
*/
|
|
220
|
+
export interface IBadgeProps<T=Element> extends IBaseProps<IBadge> {
|
|
221
|
+
content?: string | T;
|
|
222
|
+
data?: any;
|
|
223
|
+
href?: string;
|
|
224
|
+
isPill?: boolean;
|
|
225
|
+
onClick?: (badge?: IBadgeProps, ev?: Event) => void;
|
|
226
|
+
type?: number;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Badge Types
|
|
231
|
+
*/
|
|
232
|
+
export type IBadgeTypes = {
|
|
233
|
+
Danger: number;
|
|
234
|
+
Dark: number;
|
|
235
|
+
Info: number;
|
|
236
|
+
Light: number;
|
|
237
|
+
Primary: number;
|
|
238
|
+
Secondary: number;
|
|
239
|
+
Success: number;
|
|
240
|
+
Warning: number;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
declare module 'gd-bs/components/breadcrumb/types' {
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* ### Breadcrumb
|
|
248
|
+
*
|
|
249
|
+
* ```ts
|
|
250
|
+
* import { Components } from "gd-sprest-bs";
|
|
251
|
+
*
|
|
252
|
+
* // Create the breadcrumb
|
|
253
|
+
* let el = document.querySelector("#breadcrumb");
|
|
254
|
+
* let breadcrumb = Components.Breadcrumb({
|
|
255
|
+
* el: el,
|
|
256
|
+
* items: [
|
|
257
|
+
* { text: "Root", href: "/" },
|
|
258
|
+
* { text: "Web 1", href: "/web" },
|
|
259
|
+
* { text: "Web 1-1", href: "/web/1", isActive: true }
|
|
260
|
+
* ]
|
|
261
|
+
* });
|
|
262
|
+
* ```
|
|
263
|
+
*/
|
|
264
|
+
export const Breadcrumb: (props: IBreadcrumbProps, template?: string) => IBreadcrumb;
|
|
265
|
+
|
|
266
|
+
import { IBaseProps } from "gd-bs/components/types";
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Breadcrumb
|
|
270
|
+
*/
|
|
271
|
+
export interface IBreadcrumb {
|
|
272
|
+
/** Adds a breadcrumb item. */
|
|
273
|
+
add: (item: IBreadcrumbItem) => void;
|
|
274
|
+
|
|
275
|
+
/** The element. */
|
|
276
|
+
el: HTMLElement;
|
|
277
|
+
|
|
278
|
+
/** Hides the breadcrumb. */
|
|
279
|
+
hide: () => void;
|
|
280
|
+
|
|
281
|
+
/** Removes the last breadcrumb item. */
|
|
282
|
+
remove: () => void;
|
|
283
|
+
|
|
284
|
+
/** Removes a breadcrumb item by it's name property. */
|
|
285
|
+
removeByName: (name: string) => void;
|
|
286
|
+
|
|
287
|
+
/** Sets the breadcrumb items. */
|
|
288
|
+
setItems: (items: IBreadcrumbItem[]) => void;
|
|
289
|
+
|
|
290
|
+
/** Shows the breadcrumb. */
|
|
291
|
+
show: () => void;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Breadcrumb Item
|
|
296
|
+
*/
|
|
297
|
+
export interface IBreadcrumbItem {
|
|
298
|
+
/** Custom class names. */
|
|
299
|
+
className?: string;
|
|
300
|
+
|
|
301
|
+
/** The breadcrumb link */
|
|
302
|
+
href?: string;
|
|
303
|
+
|
|
304
|
+
/** Internal flag set by the component */
|
|
305
|
+
isActive?: boolean;
|
|
306
|
+
|
|
307
|
+
/** A unique name of the */
|
|
308
|
+
name?: string;
|
|
309
|
+
|
|
310
|
+
/** Click event for the link */
|
|
311
|
+
onClick?: (item?: IBreadcrumbItem, ev?: Event) => void;
|
|
312
|
+
|
|
313
|
+
/** The link text */
|
|
314
|
+
text?: string;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Breadcrumb Properties
|
|
319
|
+
*/
|
|
320
|
+
export interface IBreadcrumbProps extends IBaseProps {
|
|
321
|
+
/** The breadcrumb items */
|
|
322
|
+
items?: Array<IBreadcrumbItem>
|
|
323
|
+
|
|
324
|
+
/** Click event for the link */
|
|
325
|
+
onClick?: (item?: IBreadcrumbItem, ev?: Event) => void;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
declare module 'gd-bs/components/button/types' {
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* ### Button
|
|
333
|
+
*
|
|
334
|
+
* ```ts
|
|
335
|
+
* import { Components } from "gd-sprest-bs";
|
|
336
|
+
*
|
|
337
|
+
* // Create the button
|
|
338
|
+
* let el = document.querySelector("#btn");
|
|
339
|
+
* let btn = Components.Button({
|
|
340
|
+
* el: el,
|
|
341
|
+
* type: Components.ButtonTypes.OutlineSuccess,
|
|
342
|
+
* isLarge: true,
|
|
343
|
+
* onClick: function(ev) {
|
|
344
|
+
* alert("The button was clicked.");
|
|
345
|
+
* }
|
|
346
|
+
* });
|
|
347
|
+
* ```
|
|
348
|
+
*/
|
|
349
|
+
export const Button: (props: IButtonProps, template?: string) => IButton;
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Button Types
|
|
353
|
+
*/
|
|
354
|
+
export const ButtonTypes: IButtonTypes;
|
|
355
|
+
|
|
356
|
+
import { IBaseProps } from "gd-bs/components/types";
|
|
357
|
+
import { IBadgeProps } from "gd-bs/components/badge/types";
|
|
358
|
+
import { ISpinnerProps } from "gd-bs/components/spinner/types";
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Button
|
|
362
|
+
*/
|
|
363
|
+
export interface IButton {
|
|
364
|
+
/** The element. */
|
|
365
|
+
el: HTMLAnchorElement | HTMLButtonElement;
|
|
366
|
+
|
|
367
|
+
/** Disables the button. */
|
|
368
|
+
disable: () => void;
|
|
369
|
+
|
|
370
|
+
/** Enables the button. */
|
|
371
|
+
enable: () => void;
|
|
372
|
+
|
|
373
|
+
/** Hides the button. */
|
|
374
|
+
hide: () => void;
|
|
375
|
+
|
|
376
|
+
/** Updates the icon. */
|
|
377
|
+
setIcon: (iconType: Function, iconSize: number, iconClassName?: string) => void;
|
|
378
|
+
|
|
379
|
+
/** Updates the button text. */
|
|
380
|
+
setText: (btnText?: string) => void;
|
|
381
|
+
|
|
382
|
+
/** Updates the button type. */
|
|
383
|
+
setType: (btnType: number) => void;
|
|
384
|
+
|
|
385
|
+
/** Shows the button. */
|
|
386
|
+
show: () => void;
|
|
387
|
+
|
|
388
|
+
/** Toggles push state. Gives the button the appearance that it has been activated. */
|
|
389
|
+
toggle: () => void;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Button Properties
|
|
394
|
+
*/
|
|
395
|
+
export interface IButtonProps extends IBaseProps<IButton> {
|
|
396
|
+
badge?: IBadgeProps;
|
|
397
|
+
controls?: string | Array<string>;
|
|
398
|
+
data?: any;
|
|
399
|
+
description?: string;
|
|
400
|
+
dismiss?: string;
|
|
401
|
+
href?: string;
|
|
402
|
+
iconClassName?: string;
|
|
403
|
+
iconSize?: number;
|
|
404
|
+
iconType?: SVGImageElement | Function;
|
|
405
|
+
id?: string;
|
|
406
|
+
isBlock?: boolean;
|
|
407
|
+
isDisabled?: boolean;
|
|
408
|
+
isExpanded?: boolean;
|
|
409
|
+
isLarge?: boolean;
|
|
410
|
+
isLink?: boolean;
|
|
411
|
+
isSmall?: boolean;
|
|
412
|
+
label?: string;
|
|
413
|
+
onClick?: (button?: IButtonProps, ev?: Event) => void;
|
|
414
|
+
spinnerProps?: ISpinnerProps;
|
|
415
|
+
tabIndex?: number;
|
|
416
|
+
target?: string;
|
|
417
|
+
text?: string;
|
|
418
|
+
title?: string;
|
|
419
|
+
toggle?: string;
|
|
420
|
+
toggleObj?: any;
|
|
421
|
+
trigger?: string;
|
|
422
|
+
type?: number;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Button Types
|
|
427
|
+
*/
|
|
428
|
+
export type IButtonTypes = {
|
|
429
|
+
Danger: number;
|
|
430
|
+
Dark: number;
|
|
431
|
+
Info: number;
|
|
432
|
+
Light: number;
|
|
433
|
+
Link: number;
|
|
434
|
+
Primary: number;
|
|
435
|
+
Secondary: number;
|
|
436
|
+
Success: number;
|
|
437
|
+
Warning: number;
|
|
438
|
+
OutlineDanger: number;
|
|
439
|
+
OutlineDark: number;
|
|
440
|
+
OutlineInfo: number;
|
|
441
|
+
OutlineLight: number;
|
|
442
|
+
OutlineLink: number;
|
|
443
|
+
OutlinePrimary: number;
|
|
444
|
+
OutlineSecondary: number;
|
|
445
|
+
OutlineSuccess: number;
|
|
446
|
+
OutlineWarning: number;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
declare module 'gd-bs/components/buttonGroup/types' {
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* ### Button Group
|
|
454
|
+
*
|
|
455
|
+
* ```ts
|
|
456
|
+
* import { Components } from "gd-sprest-bs";
|
|
457
|
+
*
|
|
458
|
+
* // Create the buttonGroup
|
|
459
|
+
* let el = document.querySelector("#buttonGroup");
|
|
460
|
+
* let buttonGroup = Components.ButtonGroup({
|
|
461
|
+
* el: el,
|
|
462
|
+
* buttonType: $REST.Components.ButtonTypes.Primary,
|
|
463
|
+
* buttons: [
|
|
464
|
+
* { text: "Left", onClick: function() { alert("Left button was clicked."); } },
|
|
465
|
+
* { text: "Middle", onClick: function() { alert("Middle button was clicked."); } },
|
|
466
|
+
* { text: "Right", onClick: function() { alert("Right button was clicked."); } }
|
|
467
|
+
* ]
|
|
468
|
+
* });
|
|
469
|
+
* ```
|
|
470
|
+
*/
|
|
471
|
+
export const ButtonGroup: (props: IButtonGroupProps, template?: string, btnTemplate?: string) => IButtonGroup;
|
|
472
|
+
|
|
473
|
+
import { IBaseProps } from "gd-bs/components/types";
|
|
474
|
+
import { IButton, IButtonProps } from "gd-bs/components/button/types";
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* Button Group
|
|
478
|
+
*/
|
|
479
|
+
export interface IButtonGroup {
|
|
480
|
+
/** The element. */
|
|
481
|
+
el: HTMLElement;
|
|
482
|
+
|
|
483
|
+
/** Adds a button to the group. */
|
|
484
|
+
add: (props: IButtonProps, btnTemplate?: string) => void;
|
|
485
|
+
|
|
486
|
+
/** The buttons. */
|
|
487
|
+
buttons: Array<IButton>;
|
|
488
|
+
|
|
489
|
+
/** Hides the button group. */
|
|
490
|
+
hide: () => void;
|
|
491
|
+
|
|
492
|
+
/** Shows the button group. */
|
|
493
|
+
show: () => void;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* Button Group Properties
|
|
498
|
+
*/
|
|
499
|
+
export interface IButtonGroupProps extends IBaseProps<IButtonGroup> {
|
|
500
|
+
buttons?: Array<IButtonProps>;
|
|
501
|
+
buttonType?: number;
|
|
502
|
+
id?: string;
|
|
503
|
+
isLarge?: boolean;
|
|
504
|
+
isSmall?: boolean;
|
|
505
|
+
isVertical?: boolean;
|
|
506
|
+
label?: string;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
declare module 'gd-bs/components/card/types' {
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* ### Card
|
|
514
|
+
*
|
|
515
|
+
* ```ts
|
|
516
|
+
* import { Components } from "gd-sprest-bs";
|
|
517
|
+
*
|
|
518
|
+
* // Create the card
|
|
519
|
+
* let el = document.querySelector("#card");
|
|
520
|
+
* let card = Components.Card({
|
|
521
|
+
* el: el,
|
|
522
|
+
* body: [
|
|
523
|
+
* {
|
|
524
|
+
* title: "Card Title",
|
|
525
|
+
* text: "This is the card contents.",
|
|
526
|
+
* actions: [
|
|
527
|
+
* {
|
|
528
|
+
* text: "Card Action",
|
|
529
|
+
* buttonType: $REST.Components.ButtonTypes.Primary,
|
|
530
|
+
* onClick: function(action, card) { alert(card.title + " was clicked."); }
|
|
531
|
+
* }
|
|
532
|
+
* ]
|
|
533
|
+
* }
|
|
534
|
+
* ]
|
|
535
|
+
* });
|
|
536
|
+
* ```
|
|
537
|
+
*/
|
|
538
|
+
export const Card: (props: ICardProps, template?: string) => ICard;
|
|
539
|
+
|
|
540
|
+
import { IBaseProps } from "gd-bs/components/types";
|
|
541
|
+
import { INavProps } from "gd-bs/components/nav/types";
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* Card
|
|
545
|
+
*/
|
|
546
|
+
export interface ICard {
|
|
547
|
+
/** The element. */
|
|
548
|
+
el: HTMLElement;
|
|
549
|
+
|
|
550
|
+
/** Hides the card. */
|
|
551
|
+
hide: () => void;
|
|
552
|
+
|
|
553
|
+
/** Shows the card. */
|
|
554
|
+
show: () => void;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* Card Action
|
|
559
|
+
*/
|
|
560
|
+
export interface ICardAction {
|
|
561
|
+
buttonType?: number;
|
|
562
|
+
data?: any;
|
|
563
|
+
onClick?: (action?: ICardAction, card?: ICardBody, ev?: Event) => void;
|
|
564
|
+
href?: string;
|
|
565
|
+
text?: string;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* Card Body
|
|
570
|
+
*/
|
|
571
|
+
export interface ICardBody<T = Element> {
|
|
572
|
+
actions?: Array<ICardAction>;
|
|
573
|
+
className?: string;
|
|
574
|
+
content?: string | T;
|
|
575
|
+
data?: any;
|
|
576
|
+
onClick?: (card?: ICardProps, ev?: Event) => void;
|
|
577
|
+
onRender?: (el?: HTMLElement, card?: ICardBody) => void;
|
|
578
|
+
onRenderTitle?: (el?: HTMLElement, card?: ICardBody) => void;
|
|
579
|
+
subTitle?: string;
|
|
580
|
+
text?: string;
|
|
581
|
+
title?: string | T;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* Card Footer
|
|
586
|
+
*/
|
|
587
|
+
export interface ICardFooter<T = Element> {
|
|
588
|
+
className?: string;
|
|
589
|
+
content?: string | T;
|
|
590
|
+
data?: any;
|
|
591
|
+
onRender?: (el?: HTMLElement, card?: ICardFooter) => void;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
/**
|
|
595
|
+
* Card Header
|
|
596
|
+
*/
|
|
597
|
+
export interface ICardHeader<T = Element> {
|
|
598
|
+
className?: string;
|
|
599
|
+
content?: string | T;
|
|
600
|
+
data?: any;
|
|
601
|
+
onRender?: (el?: HTMLElement, card?: ICardHeader) => void;
|
|
602
|
+
nav?: INavProps;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* Card Properties
|
|
607
|
+
*/
|
|
608
|
+
export interface ICardProps<T = Element> extends IBaseProps<ICard> {
|
|
609
|
+
body?: Array<ICardBody<T>>;
|
|
610
|
+
footer?: ICardFooter<T>;
|
|
611
|
+
header?: ICardHeader<T>;
|
|
612
|
+
imgBottom?: {
|
|
613
|
+
alt?: string;
|
|
614
|
+
src?: string;
|
|
615
|
+
}
|
|
616
|
+
imgTop?: {
|
|
617
|
+
alt?: string;
|
|
618
|
+
src?: string;
|
|
619
|
+
};
|
|
620
|
+
onClick?: (card?: ICardBody, ev?: Event) => void;
|
|
621
|
+
onRender?: (el?: HTMLElement, card?: ICardProps) => void;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
declare module 'gd-bs/components/cardGroup/types' {
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* ### Card Group
|
|
629
|
+
*
|
|
630
|
+
* ```ts
|
|
631
|
+
* import { Components } from "gd-sprest-bs";
|
|
632
|
+
*
|
|
633
|
+
* // Create the cardGroup
|
|
634
|
+
* let el = document.querySelector("#cardGroup");
|
|
635
|
+
* let cardGroup = Components.CardGroup({
|
|
636
|
+
* el: el,
|
|
637
|
+
* cards: [
|
|
638
|
+
* {
|
|
639
|
+
* body: [
|
|
640
|
+
* {
|
|
641
|
+
* title: "Card 1",
|
|
642
|
+
* subTitle: "SubTitle 1",
|
|
643
|
+
* text: "This is the first card."
|
|
644
|
+
* }
|
|
645
|
+
* ]
|
|
646
|
+
* },
|
|
647
|
+
* {
|
|
648
|
+
* body: [
|
|
649
|
+
* {
|
|
650
|
+
* title: "Card 2",
|
|
651
|
+
* subTitle: "SubTitle 2",
|
|
652
|
+
* text: "This is the second card."
|
|
653
|
+
* }
|
|
654
|
+
* ]
|
|
655
|
+
* },
|
|
656
|
+
* {
|
|
657
|
+
* body: [
|
|
658
|
+
* {
|
|
659
|
+
* title: "Card 3",
|
|
660
|
+
* subTitle: "SubTitle 3",
|
|
661
|
+
* text: "This is the third card."
|
|
662
|
+
* }
|
|
663
|
+
* ]
|
|
664
|
+
* }
|
|
665
|
+
* ]
|
|
666
|
+
* });
|
|
667
|
+
* ```
|
|
668
|
+
*/
|
|
669
|
+
export const CardGroup: (props: ICardGroupProps, template?: string, cardTemplate?: string) => ICardGroup;
|
|
670
|
+
|
|
671
|
+
import { IBaseProps } from "gd-bs/components/types";
|
|
672
|
+
import { ICardProps } from "gd-bs/components/card/types";
|
|
673
|
+
|
|
674
|
+
/**
|
|
675
|
+
* Card Group
|
|
676
|
+
*/
|
|
677
|
+
export interface ICardGroup {
|
|
678
|
+
/** The element. */
|
|
679
|
+
el: HTMLElement;
|
|
680
|
+
|
|
681
|
+
/** Hides the card group. */
|
|
682
|
+
hide: () => void;
|
|
683
|
+
|
|
684
|
+
/** Shows the card group. */
|
|
685
|
+
show: () => void;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* Card Group Properties
|
|
690
|
+
*/
|
|
691
|
+
export interface ICardGroupProps extends IBaseProps<ICardGroup> {
|
|
692
|
+
cards?: Array<ICardProps>;
|
|
693
|
+
colSize?: number | string;
|
|
694
|
+
onCardRender?: (el?: HTMLElement, props?: ICardProps) => void;
|
|
695
|
+
onColRender?: (el?: HTMLElement, props?: ICardProps) => void;
|
|
696
|
+
onRender?: (el?: HTMLElement, props?: ICardGroupProps) => void;
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
declare module 'gd-bs/components/carousel/types' {
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* ### Carousel
|
|
704
|
+
*
|
|
705
|
+
* ```ts
|
|
706
|
+
* import { Components } from "gd-sprest-bs";
|
|
707
|
+
*
|
|
708
|
+
* // Create the carousel
|
|
709
|
+
* let el = document.querySelector("#carousel");
|
|
710
|
+
* let carousel = Components.Carousel({
|
|
711
|
+
* el: el,
|
|
712
|
+
* enableControls: true,
|
|
713
|
+
* enableIndicators: true,
|
|
714
|
+
* id: "carouselDemo",
|
|
715
|
+
* items: [
|
|
716
|
+
* {
|
|
717
|
+
* captions: "<h5>First Slide</h5>",
|
|
718
|
+
* imageUrl: "https://via.placeholder.com/400x200",
|
|
719
|
+
* imageAlt: "First Slide",
|
|
720
|
+
* isActive: true
|
|
721
|
+
* },
|
|
722
|
+
* {
|
|
723
|
+
* captions: "<h5>Second Slide</h5>",
|
|
724
|
+
* imageUrl: "https://via.placeholder.com/400x200",
|
|
725
|
+
* imageAlt: "Second Slide"
|
|
726
|
+
* },
|
|
727
|
+
* {
|
|
728
|
+
* captions: "<h5>Third Slide</h5>",
|
|
729
|
+
* imageUrl: "https://via.placeholder.com/400x200",
|
|
730
|
+
* imageAlt: "Third Slide"
|
|
731
|
+
* }
|
|
732
|
+
* ]
|
|
733
|
+
* });
|
|
734
|
+
* ```
|
|
735
|
+
*/
|
|
736
|
+
export const Carousel: (props: ICarouselProps, template?: string, slideTemplate?: string) => ICarousel;
|
|
737
|
+
|
|
738
|
+
import { IBaseProps } from "gd-bs/components/types";
|
|
739
|
+
|
|
740
|
+
/**
|
|
741
|
+
* Carousel
|
|
742
|
+
*/
|
|
743
|
+
export interface ICarousel {
|
|
744
|
+
/**
|
|
745
|
+
* Cycles through the carousel items from left to right.
|
|
746
|
+
*/
|
|
747
|
+
cycle: () => void;
|
|
748
|
+
|
|
749
|
+
/** The element. */
|
|
750
|
+
el: HTMLElement;
|
|
751
|
+
|
|
752
|
+
/** Hides the carousel. */
|
|
753
|
+
hide: () => void;
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* Cycles to the next item.
|
|
757
|
+
*/
|
|
758
|
+
next: () => void;
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* Stops the carousel from cycling through items.
|
|
762
|
+
*/
|
|
763
|
+
pause: () => void;
|
|
764
|
+
|
|
765
|
+
/**
|
|
766
|
+
* Cycles to the previous item.
|
|
767
|
+
*/
|
|
768
|
+
previous: () => void;
|
|
769
|
+
|
|
770
|
+
/** Enables/Disables the dark theme. */
|
|
771
|
+
setTheme: (isDark: boolean) => void;
|
|
772
|
+
|
|
773
|
+
/** Shows the carousel. */
|
|
774
|
+
show: () => void;
|
|
775
|
+
|
|
776
|
+
/** Unpauses the carousel. */
|
|
777
|
+
unpause: () => void;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
/**
|
|
781
|
+
* Carousel Item
|
|
782
|
+
*/
|
|
783
|
+
export interface ICarouselItem<T = HTMLElement> {
|
|
784
|
+
captions?: string;
|
|
785
|
+
className?: string;
|
|
786
|
+
content?: string | T;
|
|
787
|
+
imageAlt?: string;
|
|
788
|
+
imageUrl?: string;
|
|
789
|
+
isActive?: boolean;
|
|
790
|
+
onRendered?: (el?: HTMLElement, props?: ICarouselItem) => void;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
/**
|
|
794
|
+
* Carousel Options
|
|
795
|
+
*/
|
|
796
|
+
export interface ICarouselOptions {
|
|
797
|
+
interval?: number;
|
|
798
|
+
keyboard?: boolean;
|
|
799
|
+
pause?: boolean;
|
|
800
|
+
slide?: number;
|
|
801
|
+
wrap?: boolean;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* Carousel Properties
|
|
806
|
+
*/
|
|
807
|
+
export interface ICarouselProps<T = HTMLElement> extends IBaseProps<ICarousel> {
|
|
808
|
+
enableControls?: boolean;
|
|
809
|
+
enableCrossfade?: boolean;
|
|
810
|
+
enableIndicators?: boolean;
|
|
811
|
+
id?: string;
|
|
812
|
+
isDark?: boolean;
|
|
813
|
+
items?: Array<ICarouselItem<T>>;
|
|
814
|
+
onRendered?: (el?: HTMLElement, props?: ICarouselProps) => void;
|
|
815
|
+
onSlideRendered?: (el?: HTMLElement, props?: ICarouselItem) => void;
|
|
816
|
+
options?: ICarouselOptions;
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
declare module 'gd-bs/components/checkboxGroup/types' {
|
|
821
|
+
|
|
822
|
+
/**
|
|
823
|
+
* ### Checkbox Group
|
|
824
|
+
*
|
|
825
|
+
* ```ts
|
|
826
|
+
* import { Components } from "gd-sprest-bs";
|
|
827
|
+
*
|
|
828
|
+
* // Create the buttonGroup
|
|
829
|
+
* let el = document.querySelector("#cbGroup");
|
|
830
|
+
* let cbGroup = Components.CheckboxGroup({
|
|
831
|
+
* el: el,
|
|
832
|
+
* multi: false,
|
|
833
|
+
* type: Components.CheckboxGroupTypes.Switch,
|
|
834
|
+
* items: [
|
|
835
|
+
* { label: "Option 1" },
|
|
836
|
+
* { label: "Option 2", isSelected: true },
|
|
837
|
+
* { label: "Option 3" }
|
|
838
|
+
* ]
|
|
839
|
+
* });
|
|
840
|
+
* ```
|
|
841
|
+
*/
|
|
842
|
+
export const CheckboxGroup: (props: ICheckboxGroupProps, template?: string, cbTemplate?: string) => ICheckboxGroup;
|
|
843
|
+
|
|
844
|
+
import { IBaseProps } from "gd-bs/components/types";
|
|
845
|
+
|
|
846
|
+
/**
|
|
847
|
+
* Checkbox Group Types
|
|
848
|
+
*/
|
|
849
|
+
export const CheckboxGroupTypes: ICheckboxTypes;
|
|
850
|
+
|
|
851
|
+
/**
|
|
852
|
+
* Checkbox Group
|
|
853
|
+
*/
|
|
854
|
+
export interface ICheckboxGroup {
|
|
855
|
+
/** The checkbox element. */
|
|
856
|
+
el: HTMLElement;
|
|
857
|
+
|
|
858
|
+
/** Gets the values. */
|
|
859
|
+
getValue: () => ICheckboxGroupValue;
|
|
860
|
+
|
|
861
|
+
/** Hides the checkbox group. */
|
|
862
|
+
hide: () => void;
|
|
863
|
+
|
|
864
|
+
/** Sets the checkbox items. */
|
|
865
|
+
setItems: (value: Array<ICheckboxGroupItem>) => void;
|
|
866
|
+
|
|
867
|
+
/** Sets the checkbox value. */
|
|
868
|
+
setValue: (value: string | Array<string>) => void;
|
|
869
|
+
|
|
870
|
+
/** Shows the checkbox group. */
|
|
871
|
+
show: () => void;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
/**
|
|
875
|
+
* Checkbox Group Item
|
|
876
|
+
*/
|
|
877
|
+
export interface ICheckboxGroupItem {
|
|
878
|
+
data?: any;
|
|
879
|
+
isDisabled?: boolean;
|
|
880
|
+
isSelected?: boolean;
|
|
881
|
+
label?: string;
|
|
882
|
+
name?: string;
|
|
883
|
+
onChange?: (selectedItem: ICheckboxGroupItem, ev?: Event) => void;
|
|
884
|
+
title?: string;
|
|
885
|
+
type?: number;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
/**
|
|
889
|
+
* Checkbox Group Properties
|
|
890
|
+
*/
|
|
891
|
+
export interface ICheckboxGroupProps extends IBaseProps<ICheckboxGroup> {
|
|
892
|
+
colSize?: number;
|
|
893
|
+
hideLabel?: boolean;
|
|
894
|
+
isDisabled?: boolean;
|
|
895
|
+
isInline?: boolean;
|
|
896
|
+
isReadonly?: boolean;
|
|
897
|
+
label?: string;
|
|
898
|
+
items?: Array<ICheckboxGroupItem>;
|
|
899
|
+
multi?: boolean;
|
|
900
|
+
onRender?: (el?: HTMLElement, item?: ICheckboxGroupItem) => void;
|
|
901
|
+
onChange?: (selectedItems: ICheckboxGroupItem | ICheckboxGroupItem[], allItems?: ICheckboxGroupItem[], ev?: Event) => void;
|
|
902
|
+
required?: boolean;
|
|
903
|
+
title?: string;
|
|
904
|
+
type?: number;
|
|
905
|
+
value?: any;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
export interface ICheckboxGroupValue {
|
|
909
|
+
selectedItems: ICheckboxGroupItem | Array<ICheckboxGroupItem>;
|
|
910
|
+
allItems: Array<ICheckboxGroupItem>;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
/**
|
|
914
|
+
* Checkbox Group Types
|
|
915
|
+
*/
|
|
916
|
+
export type ICheckboxTypes = {
|
|
917
|
+
Checkbox: number;
|
|
918
|
+
Radio: number;
|
|
919
|
+
Switch: number;
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
declare module 'gd-bs/components/collapse/types' {
|
|
924
|
+
|
|
925
|
+
/**
|
|
926
|
+
* ### Collapse
|
|
927
|
+
*
|
|
928
|
+
* ```ts
|
|
929
|
+
* import { Components } from "gd-sprest-bs";
|
|
930
|
+
*
|
|
931
|
+
* // Create the collapse
|
|
932
|
+
* let el = document.querySelector("#collapse");
|
|
933
|
+
* let collapse = Components.Collapse({
|
|
934
|
+
* el: el,
|
|
935
|
+
* id: "demoCollapse",
|
|
936
|
+
* content: "This is the content to be collapsed.",
|
|
937
|
+
* options: { toggle: true }
|
|
938
|
+
* });
|
|
939
|
+
*
|
|
940
|
+
* // Create the button to toggle the collapse
|
|
941
|
+
* let btn = Components.Button({
|
|
942
|
+
* el: document.querySelector("#btnCollapse"),
|
|
943
|
+
* toggleObj: collapse,
|
|
944
|
+
* text: "Collapse Demo"
|
|
945
|
+
* });
|
|
946
|
+
* ```
|
|
947
|
+
*/
|
|
948
|
+
export const Collapse: (props: ICollapseProps, template?: string) => ICollapse;
|
|
949
|
+
|
|
950
|
+
import { IBaseProps } from "gd-bs/components/types";
|
|
951
|
+
|
|
952
|
+
/**
|
|
953
|
+
* Collapse
|
|
954
|
+
*/
|
|
955
|
+
export interface ICollapse {
|
|
956
|
+
/** The element. */
|
|
957
|
+
el: HTMLElement;
|
|
958
|
+
|
|
959
|
+
/** Hides a collapsible element. */
|
|
960
|
+
hide: () => void;
|
|
961
|
+
|
|
962
|
+
/** True if the collapse is visible. */
|
|
963
|
+
isExpanded: boolean;
|
|
964
|
+
|
|
965
|
+
/** Shows a collapsible element. */
|
|
966
|
+
show: () => void;
|
|
967
|
+
|
|
968
|
+
/** Toggles the collapsible element on invocation. */
|
|
969
|
+
toggle: () => void;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
/**
|
|
973
|
+
* Collapse Options
|
|
974
|
+
*/
|
|
975
|
+
export interface ICollapseOptions {
|
|
976
|
+
toggle?: boolean;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
/**
|
|
980
|
+
* Collapse Properties
|
|
981
|
+
*/
|
|
982
|
+
export interface ICollapseProps<T = HTMLElement> extends IBaseProps<ICollapse> {
|
|
983
|
+
content?: string | T;
|
|
984
|
+
data?: any;
|
|
985
|
+
id?: string;
|
|
986
|
+
isHorizontal?: boolean;
|
|
987
|
+
isMulti?: boolean;
|
|
988
|
+
onRender?: (el?: HTMLElement, props?: ICollapseProps) => void;
|
|
989
|
+
options?: ICollapseOptions;
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
declare module 'gd-bs/components/dropdown/types' {
|
|
994
|
+
|
|
995
|
+
/**
|
|
996
|
+
* ### Dropdown
|
|
997
|
+
*
|
|
998
|
+
* ```ts
|
|
999
|
+
* import { Components } from "gd-sprest-bs";
|
|
1000
|
+
*
|
|
1001
|
+
* // Create the dropdown
|
|
1002
|
+
* let el = document.querySelector("#dropdown");
|
|
1003
|
+
* let dropdown = Components.Dropdown({
|
|
1004
|
+
* el: el,
|
|
1005
|
+
* label: "Select a Choice",
|
|
1006
|
+
* items: [
|
|
1007
|
+
* { text: "Choice 1", value: "1" },
|
|
1008
|
+
* { text: "Choice 2", value: "2" },
|
|
1009
|
+
* { text: "Choice 3", value: "3" },
|
|
1010
|
+
* { text: "Choice 4", value: "4" },
|
|
1011
|
+
* { text: "Choice 5", value: "5" }
|
|
1012
|
+
* ],
|
|
1013
|
+
* onChange: (item, ev) => {
|
|
1014
|
+
* console.log("The selected value is: " + item.text);
|
|
1015
|
+
* }
|
|
1016
|
+
* });
|
|
1017
|
+
* ```
|
|
1018
|
+
*/
|
|
1019
|
+
export const Dropdown: (props: IDropdownProps, template?: string) => IDropdown;
|
|
1020
|
+
|
|
1021
|
+
import { IBaseProps } from "gd-bs/components/types";
|
|
1022
|
+
import { IButtonTypes } from "gd-bs/components/button/types";
|
|
1023
|
+
import { IPopover, IPopoverProps, IPopoverPlacements } from "gd-bs/components/popover/types";
|
|
1024
|
+
|
|
1025
|
+
/**
|
|
1026
|
+
* Dropdown Placements
|
|
1027
|
+
*/
|
|
1028
|
+
export const DropdownPlacements: IPopoverPlacements;
|
|
1029
|
+
|
|
1030
|
+
/**
|
|
1031
|
+
* Dropdown Types
|
|
1032
|
+
*/
|
|
1033
|
+
export const DropdownTypes: IButtonTypes;
|
|
1034
|
+
|
|
1035
|
+
/**
|
|
1036
|
+
* Dropdown
|
|
1037
|
+
*/
|
|
1038
|
+
export interface IDropdown {
|
|
1039
|
+
/** Disables the dropdown. */
|
|
1040
|
+
disable: () => void;
|
|
1041
|
+
|
|
1042
|
+
/** Enables the dropdown. */
|
|
1043
|
+
enable: () => void;
|
|
1044
|
+
|
|
1045
|
+
/** The element. */
|
|
1046
|
+
el: HTMLElement;
|
|
1047
|
+
|
|
1048
|
+
/** Gets the selected dropdown item(s). */
|
|
1049
|
+
getValue: () => IDropdownItem | Array<IDropdownItem>;
|
|
1050
|
+
|
|
1051
|
+
/** Hides the dropdown. */
|
|
1052
|
+
hide: () => void;
|
|
1053
|
+
|
|
1054
|
+
/** True if the dropdown is a multi-select. */
|
|
1055
|
+
isMulti: boolean;
|
|
1056
|
+
|
|
1057
|
+
/** The popover menu. */
|
|
1058
|
+
popover: IPopover;
|
|
1059
|
+
|
|
1060
|
+
/** Updates the dropdown items. */
|
|
1061
|
+
setItems: (items: Array<IDropdownItem>) => void;
|
|
1062
|
+
|
|
1063
|
+
/** Updates the label of the dropdown. */
|
|
1064
|
+
setLabel: (value: string) => void;
|
|
1065
|
+
|
|
1066
|
+
/** Enables/Disables the dark theme. */
|
|
1067
|
+
setTheme: (isDark: boolean) => void;
|
|
1068
|
+
|
|
1069
|
+
/** Updates the dropdown type. */
|
|
1070
|
+
setType: (ddlType: number) => void;
|
|
1071
|
+
|
|
1072
|
+
/** Sets the dropdown value. */
|
|
1073
|
+
setValue: (value?: any | Array<any>) => void;
|
|
1074
|
+
|
|
1075
|
+
/** Shows the dropdown. */
|
|
1076
|
+
show: () => void;
|
|
1077
|
+
|
|
1078
|
+
/** Toggles the dropdown menu of a given navbar or tabbed navigation. */
|
|
1079
|
+
toggle: () => void;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
/**
|
|
1083
|
+
* Dropdown Item
|
|
1084
|
+
*/
|
|
1085
|
+
export interface IDropdownItem {
|
|
1086
|
+
className?: string;
|
|
1087
|
+
data?: any;
|
|
1088
|
+
href?: string;
|
|
1089
|
+
iconClassName?: string;
|
|
1090
|
+
iconSize?: number;
|
|
1091
|
+
iconType?: SVGImageElement | Function;
|
|
1092
|
+
isDisabled?: boolean;
|
|
1093
|
+
isDivider?: boolean;
|
|
1094
|
+
isHeader?: boolean;
|
|
1095
|
+
isSelected?: boolean;
|
|
1096
|
+
onClick?: (item?: IDropdownItem, ev?: Event) => void;
|
|
1097
|
+
onRender?: (el: HTMLElement, item?: IDropdownItem) => void;
|
|
1098
|
+
target?: string;
|
|
1099
|
+
text?: string;
|
|
1100
|
+
title?: string;
|
|
1101
|
+
toggle?: string;
|
|
1102
|
+
value?: string;
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
/**
|
|
1106
|
+
* Dropdown Properties
|
|
1107
|
+
*/
|
|
1108
|
+
export interface IDropdownProps extends IBaseProps<IDropdown> {
|
|
1109
|
+
autoSelect?: boolean;
|
|
1110
|
+
btnClassName?: string;
|
|
1111
|
+
dropLeft?: boolean;
|
|
1112
|
+
dropRight?: boolean;
|
|
1113
|
+
dropUp?: boolean;
|
|
1114
|
+
formFl?: boolean;
|
|
1115
|
+
id?: string;
|
|
1116
|
+
isCheckbox?: boolean;
|
|
1117
|
+
isDark?: boolean;
|
|
1118
|
+
isDatalist?: boolean;
|
|
1119
|
+
isReadonly?: boolean;
|
|
1120
|
+
isSplit?: boolean;
|
|
1121
|
+
items?: Array<IDropdownItem>;
|
|
1122
|
+
label?: string;
|
|
1123
|
+
menuOnly?: boolean;
|
|
1124
|
+
multi?: boolean;
|
|
1125
|
+
navFl?: boolean;
|
|
1126
|
+
onChange?: (item?: IDropdownItem | Array<IDropdownItem>, ev?: Event) => void;
|
|
1127
|
+
onMenuRendering?: (props: IPopoverProps) => IPopoverProps;
|
|
1128
|
+
placement?: number;
|
|
1129
|
+
required?: boolean;
|
|
1130
|
+
title?: string;
|
|
1131
|
+
type?: number;
|
|
1132
|
+
updateLabel?: boolean;
|
|
1133
|
+
value?: any;
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
declare module 'gd-bs/components/form/controlTypes' {
|
|
1138
|
+
|
|
1139
|
+
/**
|
|
1140
|
+
* ### Form Control
|
|
1141
|
+
*/
|
|
1142
|
+
export const FormControl: (props: IFormControlProps) => IFormControl;
|
|
1143
|
+
|
|
1144
|
+
import { IBaseProps } from "gd-bs/components/types";
|
|
1145
|
+
import { ICheckboxGroup, ICheckboxGroupItem } from "gd-bs/components/checkboxGroup/types";
|
|
1146
|
+
import { IDropdown, IDropdownItem } from "gd-bs/components/dropdown/types";
|
|
1147
|
+
import { IInputGroup } from "gd-bs/components/inputGroup/types";
|
|
1148
|
+
import { IListBox } from "gd-bs/components/listBox/types";
|
|
1149
|
+
import { IPopoverProps } from "gd-bs/components/popover/types";
|
|
1150
|
+
|
|
1151
|
+
/**
|
|
1152
|
+
* Custom Controls
|
|
1153
|
+
*/
|
|
1154
|
+
export const CustomControls: {
|
|
1155
|
+
// Gets the event by type
|
|
1156
|
+
getByType(key: number): (props?: IFormControlProps) => void;
|
|
1157
|
+
|
|
1158
|
+
/** Registers a custom form control type. */
|
|
1159
|
+
registerType: (key: number, onRender: (props?: IFormControlProps) => void) => void;
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
/**
|
|
1163
|
+
* Form Control Types
|
|
1164
|
+
*/
|
|
1165
|
+
export const FormControlTypes: IFormControlTypes;
|
|
1166
|
+
|
|
1167
|
+
/**
|
|
1168
|
+
* Form Control
|
|
1169
|
+
*/
|
|
1170
|
+
export interface IFormControl {
|
|
1171
|
+
checkbox: ICheckboxGroup;
|
|
1172
|
+
control: ICheckboxGroup | IDropdown | IInputGroup | IListBox;
|
|
1173
|
+
dropdown: IDropdown;
|
|
1174
|
+
el: HTMLElement;
|
|
1175
|
+
getValue: () => any;
|
|
1176
|
+
hide: () => void;
|
|
1177
|
+
isLoaded: () => PromiseLike<void>;
|
|
1178
|
+
isRendered: boolean;
|
|
1179
|
+
isValid: boolean;
|
|
1180
|
+
label?: HTMLElement;
|
|
1181
|
+
props: IFormControlProps;
|
|
1182
|
+
textbox: IInputGroup;
|
|
1183
|
+
setLabel: (value: string) => void;
|
|
1184
|
+
setControl: (control: any) => void;
|
|
1185
|
+
setValue: (value: any) => void;
|
|
1186
|
+
show: () => void;
|
|
1187
|
+
updateValidation: (elControl: HTMLElement, validation: IFormControlValidationResult) => void;
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
/**
|
|
1191
|
+
* Form Control Properties
|
|
1192
|
+
*/
|
|
1193
|
+
export interface IFormControlProps extends IBaseProps<IFormControl> {
|
|
1194
|
+
controlClassName?: string;
|
|
1195
|
+
data?: any;
|
|
1196
|
+
description?: string;
|
|
1197
|
+
errorMessage?: string;
|
|
1198
|
+
id?: string;
|
|
1199
|
+
isDisabled?: boolean;
|
|
1200
|
+
isReadonly?: boolean;
|
|
1201
|
+
isPlainText?: boolean;
|
|
1202
|
+
label?: string;
|
|
1203
|
+
loadingMessage?: string;
|
|
1204
|
+
name?: string;
|
|
1205
|
+
onControlRendering?: (control: IFormControlProps) => void | PromiseLike<IFormControlProps>;
|
|
1206
|
+
onControlRendered?: (control: IFormControl) => void | PromiseLike<IFormControl>;
|
|
1207
|
+
onGetValue?: (control: IFormControlProps) => any;
|
|
1208
|
+
onValidate?: (control: IFormControlProps, value: IFormControlValidationResult) => boolean | IFormControlValidationResult;
|
|
1209
|
+
required?: boolean;
|
|
1210
|
+
title?: string;
|
|
1211
|
+
type?: number;
|
|
1212
|
+
validationType?: number;
|
|
1213
|
+
value?: any;
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
/**
|
|
1217
|
+
* Form Control Properties - Checkbox
|
|
1218
|
+
*/
|
|
1219
|
+
export interface IFormControlPropsCheckbox extends IFormControlProps {
|
|
1220
|
+
colSize?: number;
|
|
1221
|
+
el?: HTMLInputElement;
|
|
1222
|
+
hideLabel?: boolean;
|
|
1223
|
+
isInline?: boolean;
|
|
1224
|
+
items?: Array<ICheckboxGroupItem>;
|
|
1225
|
+
onChange?: (selectedItem: ICheckboxGroupItem, allItems?: Array<ICheckboxGroupItem>, ev?: Event) => void;
|
|
1226
|
+
onControlRendering?: (control: IFormControlPropsCheckbox) => void | PromiseLike<IFormControlPropsCheckbox>;
|
|
1227
|
+
onGetValue?: (control: IFormControlPropsCheckbox) => any;
|
|
1228
|
+
onValidate?: (control: IFormControlPropsCheckbox, value: IFormControlValidationResult) => boolean | IFormControlValidationResult;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
/**
|
|
1232
|
+
* Form Control Properties - Dropdown
|
|
1233
|
+
*/
|
|
1234
|
+
export interface IFormControlPropsDropdown extends IFormControlProps {
|
|
1235
|
+
items?: Array<IDropdownItem>;
|
|
1236
|
+
onChange?: (item: IDropdownItem, ev?: Event) => void;
|
|
1237
|
+
onControlRendering?: (control: IFormControlPropsDropdown) => void | PromiseLike<IFormControlPropsDropdown>;
|
|
1238
|
+
onGetValue?: (control: IFormControlPropsDropdown) => any;
|
|
1239
|
+
onMenuRendering?: (props: IPopoverProps) => IPopoverProps;
|
|
1240
|
+
onValidate?: (control: IFormControlPropsDropdown, value: IFormControlValidationResult) => boolean | IFormControlValidationResult;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
/**
|
|
1244
|
+
* Form Control Properties - Dropdown Button
|
|
1245
|
+
*/
|
|
1246
|
+
export interface IFormControlPropsDropdownButton extends IFormControlPropsDropdown {
|
|
1247
|
+
placeholder?: string;
|
|
1248
|
+
placement?: number;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
/**
|
|
1252
|
+
* Form Control Properties - Dropdown Checkbox
|
|
1253
|
+
*/
|
|
1254
|
+
export interface IFormControlPropsDropdownCheckbox extends IFormControlPropsDropdownButton { }
|
|
1255
|
+
|
|
1256
|
+
/**
|
|
1257
|
+
* Form Control Properties - List Box
|
|
1258
|
+
*/
|
|
1259
|
+
export interface IFormControlPropsListBox extends IFormControlProps {
|
|
1260
|
+
items?: Array<IDropdownItem>;
|
|
1261
|
+
onChange?: (items: IDropdownItem, ev?: Event) => void;
|
|
1262
|
+
onControlRendering?: (control: IFormControlPropsListBox) => void | PromiseLike<IFormControlPropsListBox>;
|
|
1263
|
+
onGetValue?: (control: IFormControlPropsListBox) => any;
|
|
1264
|
+
onValidate?: (control: IFormControlPropsListBox, value: IFormControlValidationResult) => boolean | IFormControlValidationResult;
|
|
1265
|
+
placeholder?: string;
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
/**
|
|
1269
|
+
* Form Control Properties - Multiple Checkbox
|
|
1270
|
+
*/
|
|
1271
|
+
export interface IFormControlPropsMultiCheckbox extends IFormControlProps {
|
|
1272
|
+
colSize?: number;
|
|
1273
|
+
el?: HTMLInputElement;
|
|
1274
|
+
hideLabel?: boolean;
|
|
1275
|
+
isInline?: boolean;
|
|
1276
|
+
items?: Array<ICheckboxGroupItem>;
|
|
1277
|
+
onChange?: (selectedItems: Array<ICheckboxGroupItem>, allItems?: Array<ICheckboxGroupItem>, ev?: Event) => void;
|
|
1278
|
+
onControlRendering?: (control: IFormControlPropsCheckbox) => void | PromiseLike<IFormControlPropsCheckbox>;
|
|
1279
|
+
onGetValue?: (control: IFormControlPropsCheckbox) => any;
|
|
1280
|
+
onValidate?: (control: IFormControlPropsCheckbox, value: IFormControlValidationResult) => boolean | IFormControlValidationResult;
|
|
1281
|
+
renderRow?: boolean;
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
/**
|
|
1285
|
+
* Form Control Properties - Multiple Dropdown
|
|
1286
|
+
*/
|
|
1287
|
+
export interface IFormControlPropsMultiDropdown extends IFormControlProps {
|
|
1288
|
+
items?: Array<IDropdownItem>;
|
|
1289
|
+
onChange?: (item: Array<IDropdownItem>, ev?: Event) => void;
|
|
1290
|
+
onControlRendering?: (control: IFormControlPropsDropdown) => void | PromiseLike<IFormControlPropsDropdown>;
|
|
1291
|
+
onGetValue?: (control: IFormControlPropsDropdown) => any;
|
|
1292
|
+
onMenuRendering?: (props: IPopoverProps) => IPopoverProps;
|
|
1293
|
+
onValidate?: (control: IFormControlPropsDropdown, value: IFormControlValidationResult) => boolean | IFormControlValidationResult;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
/**
|
|
1297
|
+
* Form Control Properties - Multiple Dropdown Button
|
|
1298
|
+
*/
|
|
1299
|
+
export interface IFormControlPropsMultiDropdownButton extends IFormControlPropsMultiDropdown {
|
|
1300
|
+
placeholder?: string;
|
|
1301
|
+
placement?: number;
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
/**
|
|
1305
|
+
* Form Control Properties - Multiple Dropdown Checkbox
|
|
1306
|
+
*/
|
|
1307
|
+
export interface IFormControlPropsMultiDropdownCheckbox extends IFormControlPropsMultiDropdownButton { }
|
|
1308
|
+
|
|
1309
|
+
/**
|
|
1310
|
+
* Form Control Properties - Multiple List Box
|
|
1311
|
+
*/
|
|
1312
|
+
export interface IFormControlPropsMultiListBox extends IFormControlProps {
|
|
1313
|
+
items?: Array<IDropdownItem>;
|
|
1314
|
+
onChange?: (items: Array<IDropdownItem>, ev?: Event) => void;
|
|
1315
|
+
onControlRendering?: (control: IFormControlPropsListBox) => void | PromiseLike<IFormControlPropsListBox>;
|
|
1316
|
+
onGetValue?: (control: IFormControlPropsListBox) => any;
|
|
1317
|
+
onValidate?: (control: IFormControlPropsListBox, value: IFormControlValidationResult) => boolean | IFormControlValidationResult;
|
|
1318
|
+
placeholder?: string;
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
/**
|
|
1322
|
+
* Form Control Properties - Multiple Switch
|
|
1323
|
+
*/
|
|
1324
|
+
export interface IFormControlPropsMultiSwitch extends IFormControlPropsMultiCheckbox { }
|
|
1325
|
+
|
|
1326
|
+
/**
|
|
1327
|
+
* Form Control Properties - Number Field
|
|
1328
|
+
*/
|
|
1329
|
+
export interface IFormControlPropsNumberField extends IFormControlPropsTextField {
|
|
1330
|
+
max?: number;
|
|
1331
|
+
min?: number;
|
|
1332
|
+
onControlRendering?: (control: IFormControlPropsNumberField) => void | PromiseLike<IFormControlPropsNumberField>;
|
|
1333
|
+
onGetValue?: (control: IFormControlPropsNumberField) => any;
|
|
1334
|
+
onValidate?: (control: IFormControlPropsNumberField, value: IFormControlValidationResult) => boolean | IFormControlValidationResult;
|
|
1335
|
+
step?: number;
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
/**
|
|
1339
|
+
* Form Control Properties - Range
|
|
1340
|
+
*/
|
|
1341
|
+
export interface IFormControlPropsRange extends IFormControlPropsNumberField { }
|
|
1342
|
+
|
|
1343
|
+
/**
|
|
1344
|
+
* Form Control Properties - Switch
|
|
1345
|
+
*/
|
|
1346
|
+
export interface IFormControlPropsSwitch extends IFormControlPropsCheckbox { }
|
|
1347
|
+
|
|
1348
|
+
/**
|
|
1349
|
+
* Form Control Properties - TextField
|
|
1350
|
+
*/
|
|
1351
|
+
export interface IFormControlPropsTextField extends IFormControlProps {
|
|
1352
|
+
appendedLabel?: string;
|
|
1353
|
+
el?: HTMLInputElement;
|
|
1354
|
+
onChange?: (value: string, ev?: Event) => void;
|
|
1355
|
+
onControlRendering?: (control: IFormControlPropsTextField) => void | PromiseLike<IFormControlPropsTextField>;
|
|
1356
|
+
onGetValue?: (control: IFormControlPropsTextField) => any;
|
|
1357
|
+
onValidate?: (control: IFormControlPropsTextField, value: IFormControlValidationResult) => boolean | IFormControlValidationResult;
|
|
1358
|
+
placeholder?: string;
|
|
1359
|
+
prependedLabel?: string;
|
|
1360
|
+
rows?: number;
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
/**
|
|
1364
|
+
* Form Control Types
|
|
1365
|
+
*/
|
|
1366
|
+
export type IFormControlTypes = {
|
|
1367
|
+
Checkbox: number;
|
|
1368
|
+
ColorPicker: number;
|
|
1369
|
+
Email: number;
|
|
1370
|
+
Datalist: number;
|
|
1371
|
+
Dropdown: number;
|
|
1372
|
+
DropdownButton: number;
|
|
1373
|
+
DropdownCheckbox: number;
|
|
1374
|
+
File: number;
|
|
1375
|
+
ListBox: number;
|
|
1376
|
+
MultiCheckbox: number;
|
|
1377
|
+
MultiDropdown: number;
|
|
1378
|
+
MultiDropdownButton: number;
|
|
1379
|
+
MultiDropdownCheckbox: number;
|
|
1380
|
+
MultiListBox: number;
|
|
1381
|
+
MultiRadio: number;
|
|
1382
|
+
MultiSwitch: number;
|
|
1383
|
+
Password: number;
|
|
1384
|
+
Radio: number;
|
|
1385
|
+
Range: number;
|
|
1386
|
+
Readonly: number;
|
|
1387
|
+
Switch: number;
|
|
1388
|
+
TextArea: number;
|
|
1389
|
+
TextField: number;
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
/**
|
|
1393
|
+
* Form Control Validation Result
|
|
1394
|
+
*/
|
|
1395
|
+
export interface IFormControlValidationResult {
|
|
1396
|
+
invalidMessage?: string;
|
|
1397
|
+
isValid?: boolean;
|
|
1398
|
+
validMessage?: string;
|
|
1399
|
+
value?: any;
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
declare module 'gd-bs/components/form/formTypes' {
|
|
1404
|
+
|
|
1405
|
+
/**
|
|
1406
|
+
* ### Form
|
|
1407
|
+
*
|
|
1408
|
+
* ```ts
|
|
1409
|
+
* import { Components } from "gd-sprest-bs";
|
|
1410
|
+
*
|
|
1411
|
+
* // Create the form
|
|
1412
|
+
* let el = document.querySelector("#myForm");
|
|
1413
|
+
* let form = Components.Form({
|
|
1414
|
+
* el: el,
|
|
1415
|
+
* rows: [
|
|
1416
|
+
* {
|
|
1417
|
+
* control: {
|
|
1418
|
+
* label: "First Name:",
|
|
1419
|
+
* name: "FName",
|
|
1420
|
+
* type: Components.FormControlTypes.TextField
|
|
1421
|
+
* }
|
|
1422
|
+
* },
|
|
1423
|
+
* {
|
|
1424
|
+
* control: {
|
|
1425
|
+
* label: "Last Name:",
|
|
1426
|
+
* name: "LName",
|
|
1427
|
+
* type: Components.FormControlTypes.TextField
|
|
1428
|
+
* }
|
|
1429
|
+
* },
|
|
1430
|
+
* {
|
|
1431
|
+
* control: {
|
|
1432
|
+
* label: "Choices:",
|
|
1433
|
+
* name: "Choice",
|
|
1434
|
+
* type: Components.FormControlTypes.Dropdown,
|
|
1435
|
+
* items: [
|
|
1436
|
+
* { text: "Choice 1", value: "1" },
|
|
1437
|
+
* { text: "Choice 2", value: "2" },
|
|
1438
|
+
* { text: "Choice 3", value: "3" },
|
|
1439
|
+
* { text: "Choice 4", value: "4" },
|
|
1440
|
+
* { text: "Choice 5", value: "5" }
|
|
1441
|
+
* ]
|
|
1442
|
+
* }
|
|
1443
|
+
* }
|
|
1444
|
+
* ],
|
|
1445
|
+
* value: {
|
|
1446
|
+
* FName: "Gunjan",
|
|
1447
|
+
* LName: "Datta",
|
|
1448
|
+
* Choice: "3"
|
|
1449
|
+
* }
|
|
1450
|
+
* });
|
|
1451
|
+
* ```
|
|
1452
|
+
*/
|
|
1453
|
+
export const Form: (props: IFormProps) => IForm;
|
|
1454
|
+
|
|
1455
|
+
import { IBaseProps } from "gd-bs/components/types";
|
|
1456
|
+
import { IFormControl, IFormControlProps } from "gd-bs/components/form/controlTypes";
|
|
1457
|
+
|
|
1458
|
+
/**
|
|
1459
|
+
* Form Validation Types
|
|
1460
|
+
*/
|
|
1461
|
+
export const FormValidationTypes: IFormValidationTypes;
|
|
1462
|
+
|
|
1463
|
+
/**
|
|
1464
|
+
* Form
|
|
1465
|
+
*/
|
|
1466
|
+
export interface IForm {
|
|
1467
|
+
/** Appends controls to the form */
|
|
1468
|
+
appendControls: (controls: Array<IFormControlProps>) => void;
|
|
1469
|
+
|
|
1470
|
+
/** Appends rows to the form */
|
|
1471
|
+
appendRows: (rows: Array<IFormRow>) => void;
|
|
1472
|
+
|
|
1473
|
+
/** The form controls */
|
|
1474
|
+
controls: Array<IFormControl>;
|
|
1475
|
+
|
|
1476
|
+
/** The form element */
|
|
1477
|
+
el: HTMLFormElement;
|
|
1478
|
+
|
|
1479
|
+
/** Gets a control by its name */
|
|
1480
|
+
getControl: (name: string) => IFormControl;
|
|
1481
|
+
|
|
1482
|
+
/** Returns the form values */
|
|
1483
|
+
getValues: () => { [key: string]: any };
|
|
1484
|
+
|
|
1485
|
+
/** Hides the form. */
|
|
1486
|
+
hide: () => void;
|
|
1487
|
+
|
|
1488
|
+
/** Inserts a control into the form */
|
|
1489
|
+
insertControl: (idx: number, control: IFormControlProps) => void;
|
|
1490
|
+
|
|
1491
|
+
/** Validates the form */
|
|
1492
|
+
isValid: () => boolean;
|
|
1493
|
+
|
|
1494
|
+
/** Shows the form. */
|
|
1495
|
+
show: () => void;
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
/**
|
|
1499
|
+
* Form Column
|
|
1500
|
+
*/
|
|
1501
|
+
export interface IFormColumn {
|
|
1502
|
+
className?: string;
|
|
1503
|
+
control: IFormControlProps;
|
|
1504
|
+
isAutoSized?: boolean;
|
|
1505
|
+
size?: number;
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
/**
|
|
1509
|
+
* Form Properties
|
|
1510
|
+
*/
|
|
1511
|
+
export interface IFormProps extends IBaseProps<IForm> {
|
|
1512
|
+
controls?: Array<IFormControlProps>;
|
|
1513
|
+
groupClassName?: string;
|
|
1514
|
+
isFloating?: boolean;
|
|
1515
|
+
rowClassName?: string;
|
|
1516
|
+
rows?: Array<IFormRow>;
|
|
1517
|
+
onControlRendering?: (control: IFormControlProps) => void | PromiseLike<IFormControlProps>;
|
|
1518
|
+
onControlRendered?: (control: IFormControl) => void | PromiseLike<IFormControl>;
|
|
1519
|
+
onRendered?: (controls: Array<IFormControl>) => void;
|
|
1520
|
+
validationType?: number;
|
|
1521
|
+
value?: any;
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
/**
|
|
1525
|
+
* Form Row
|
|
1526
|
+
*/
|
|
1527
|
+
export interface IFormRow {
|
|
1528
|
+
className?: string;
|
|
1529
|
+
isAutoSized?: boolean;
|
|
1530
|
+
isCentered?: boolean;
|
|
1531
|
+
isDisabled?: boolean;
|
|
1532
|
+
isReadOnly?: boolean;
|
|
1533
|
+
columns?: Array<IFormColumn>;
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
/**
|
|
1537
|
+
* Form Validation Types
|
|
1538
|
+
*/
|
|
1539
|
+
export type IFormValidationTypes = {
|
|
1540
|
+
Default: number;
|
|
1541
|
+
Tooltip: number;
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
declare module 'gd-bs/components/inputGroup/types' {
|
|
1546
|
+
|
|
1547
|
+
/**
|
|
1548
|
+
* ### Input Group
|
|
1549
|
+
*
|
|
1550
|
+
* ```ts
|
|
1551
|
+
* import { Components } from "gd-sprest-bs";
|
|
1552
|
+
*
|
|
1553
|
+
* // Create the inputGroup
|
|
1554
|
+
* let el = document.querySelector("#inputGroup");
|
|
1555
|
+
* let inputGroup = Components.InputGroup({
|
|
1556
|
+
* el: el,
|
|
1557
|
+
* label: "My Name:",
|
|
1558
|
+
* value: "First Last"
|
|
1559
|
+
* });
|
|
1560
|
+
* ```
|
|
1561
|
+
*/
|
|
1562
|
+
export const InputGroup: (props: IInputGroupProps, template?: string) => IInputGroup;
|
|
1563
|
+
|
|
1564
|
+
/**
|
|
1565
|
+
* Input Group Types
|
|
1566
|
+
*/
|
|
1567
|
+
export const InputGroupTypes: IInputGroupTypes;
|
|
1568
|
+
|
|
1569
|
+
import { IBaseProps } from "gd-bs/components/types";
|
|
1570
|
+
import { IButtonProps } from "gd-bs/components/button/types";
|
|
1571
|
+
|
|
1572
|
+
/** Input Group File Value */
|
|
1573
|
+
export interface IInputGroupFileValue {
|
|
1574
|
+
data: ArrayBuffer;
|
|
1575
|
+
name: string;
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
/**
|
|
1579
|
+
* Input Group
|
|
1580
|
+
*/
|
|
1581
|
+
export interface IInputGroup {
|
|
1582
|
+
/** The input group element. */
|
|
1583
|
+
el: HTMLElement;
|
|
1584
|
+
|
|
1585
|
+
/** Reference to the textbox input/textarea element. */
|
|
1586
|
+
elTextbox: HTMLInputElement | HTMLTextAreaElement;
|
|
1587
|
+
|
|
1588
|
+
/** Method to get the file information. */
|
|
1589
|
+
getFileInfo: () => IInputGroupFileValue;
|
|
1590
|
+
|
|
1591
|
+
/** Method to get the value. */
|
|
1592
|
+
getValue: () => string;
|
|
1593
|
+
|
|
1594
|
+
/** Hides the input group. */
|
|
1595
|
+
hide: () => void;
|
|
1596
|
+
|
|
1597
|
+
/** Method to set the value. */
|
|
1598
|
+
setValue: (value: string) => void;
|
|
1599
|
+
|
|
1600
|
+
/** Shows the input group. */
|
|
1601
|
+
show: () => void;
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
/**
|
|
1605
|
+
* Input Group Properties
|
|
1606
|
+
*/
|
|
1607
|
+
export interface IInputGroupProps extends IBaseProps<IInputGroup> {
|
|
1608
|
+
appendedButtons?: Array<IButtonProps>;
|
|
1609
|
+
appendedLabel?: string;
|
|
1610
|
+
formFl?: boolean;
|
|
1611
|
+
id?: string;
|
|
1612
|
+
isDisabled?: boolean;
|
|
1613
|
+
isLarge?: boolean;
|
|
1614
|
+
isReadonly?: boolean;
|
|
1615
|
+
isSmall?: boolean;
|
|
1616
|
+
label?: string;
|
|
1617
|
+
max?: number;
|
|
1618
|
+
min?: number;
|
|
1619
|
+
onClear?: () => void;
|
|
1620
|
+
onChange?: (value?: string, ev?: Event) => void;
|
|
1621
|
+
placeholder?: string;
|
|
1622
|
+
prependedButtons?: Array<IButtonProps>;
|
|
1623
|
+
prependedLabel?: string;
|
|
1624
|
+
required?: boolean;
|
|
1625
|
+
rows?: number;
|
|
1626
|
+
step?: number;
|
|
1627
|
+
title?: string;
|
|
1628
|
+
type?: number;
|
|
1629
|
+
value?: string;
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
/**
|
|
1633
|
+
* Input Group Types
|
|
1634
|
+
*/
|
|
1635
|
+
export type IInputGroupTypes = {
|
|
1636
|
+
ColorPicker: number;
|
|
1637
|
+
Email: number;
|
|
1638
|
+
File: number;
|
|
1639
|
+
Password: number;
|
|
1640
|
+
Range: number;
|
|
1641
|
+
Search: number;
|
|
1642
|
+
TextArea: number;
|
|
1643
|
+
TextField: number;
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
declare module 'gd-bs/components/jumbotron/types' {
|
|
1648
|
+
|
|
1649
|
+
/**
|
|
1650
|
+
* ### Jumbotron
|
|
1651
|
+
*
|
|
1652
|
+
* ```ts
|
|
1653
|
+
* import { Components } from "gd-sprest-bs";
|
|
1654
|
+
*
|
|
1655
|
+
* // Create the jumbotron
|
|
1656
|
+
* let el = document.querySelector("#jumbotron");
|
|
1657
|
+
* let jumbotron = Components.Jumbotron({
|
|
1658
|
+
* el: el,
|
|
1659
|
+
* title: "My Jumbotron",
|
|
1660
|
+
* lead: "This is a jumbotron"
|
|
1661
|
+
* });
|
|
1662
|
+
* ```
|
|
1663
|
+
*/
|
|
1664
|
+
export const Jumbotron: (props: IJumbotronProps, template?: string) => IJumbotron;
|
|
1665
|
+
export const JumbotronSize: IJumbotronSize;
|
|
1666
|
+
export const JumbotronTypes: IJumbotronTypes;
|
|
1667
|
+
|
|
1668
|
+
import { IBaseProps } from "gd-bs/components/types";
|
|
1669
|
+
|
|
1670
|
+
/**
|
|
1671
|
+
* Jumbotron
|
|
1672
|
+
*/
|
|
1673
|
+
export interface IJumbotron {
|
|
1674
|
+
/** The element. */
|
|
1675
|
+
el: HTMLElement;
|
|
1676
|
+
|
|
1677
|
+
/** Hides the jumbotron. */
|
|
1678
|
+
hide: () => void;
|
|
1679
|
+
|
|
1680
|
+
/** Shows the jumbotron. */
|
|
1681
|
+
show: () => void;
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
/**
|
|
1685
|
+
* Jumbotron Properties
|
|
1686
|
+
*/
|
|
1687
|
+
export interface IJumbotronProps<T = Element> extends IBaseProps<IJumbotron> {
|
|
1688
|
+
content?: string | T;
|
|
1689
|
+
isFluid?: boolean;
|
|
1690
|
+
lead?: string;
|
|
1691
|
+
onRenderContent?: (el?: HTMLElement) => void;
|
|
1692
|
+
size?: number;
|
|
1693
|
+
title?: string;
|
|
1694
|
+
type?: number;
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
/**
|
|
1698
|
+
* Jumbotron Size
|
|
1699
|
+
*/
|
|
1700
|
+
export type IJumbotronSize = {
|
|
1701
|
+
XSmall: number;
|
|
1702
|
+
Small: number;
|
|
1703
|
+
Medium: number;
|
|
1704
|
+
Large: number;
|
|
1705
|
+
XLarge: number;
|
|
1706
|
+
}
|
|
1707
|
+
/**
|
|
1708
|
+
* Jumbotron Types
|
|
1709
|
+
*/
|
|
1710
|
+
export type IJumbotronTypes = {
|
|
1711
|
+
Danger: number;
|
|
1712
|
+
Dark: number;
|
|
1713
|
+
Info: number;
|
|
1714
|
+
Light: number;
|
|
1715
|
+
Primary: number;
|
|
1716
|
+
Secondary: number;
|
|
1717
|
+
Success: number;
|
|
1718
|
+
Warning: number;
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
declare module 'gd-bs/components/listBox/types' {
|
|
1723
|
+
|
|
1724
|
+
/**
|
|
1725
|
+
* List Box
|
|
1726
|
+
*
|
|
1727
|
+
* ```ts
|
|
1728
|
+
* import { Components } from "gd-sprest-bs";
|
|
1729
|
+
*
|
|
1730
|
+
* // Create the list box
|
|
1731
|
+
* let el = document.querySelector("#list-box");
|
|
1732
|
+
* Components.Collapse({
|
|
1733
|
+
* el: el,
|
|
1734
|
+
* label: "Colors",
|
|
1735
|
+
* placeholder: "Search Colors",
|
|
1736
|
+
* items: [
|
|
1737
|
+
* { text: "Red", value: "red" },
|
|
1738
|
+
* { text: "Blue", value: "blue" },
|
|
1739
|
+
* { text: "Green", value: "green" },
|
|
1740
|
+
* { text: "Purple", value: "purple" },
|
|
1741
|
+
* { text: "Brown", value: "brown" },
|
|
1742
|
+
* { text: "Yellow", value: "yellow" },
|
|
1743
|
+
* { text: "Orange", value: "orange" }
|
|
1744
|
+
* ]
|
|
1745
|
+
* });
|
|
1746
|
+
* ```
|
|
1747
|
+
*/
|
|
1748
|
+
export const ListBox: (props: IListBoxProps, template?: string) => IListBox;
|
|
1749
|
+
|
|
1750
|
+
import { IBase, IBaseProps } from "gd-bs/components/types";
|
|
1751
|
+
import { IDropdownItem } from "gd-bs/components/dropdown/types";
|
|
1752
|
+
|
|
1753
|
+
/**
|
|
1754
|
+
* List Box
|
|
1755
|
+
*/
|
|
1756
|
+
export interface IListBox extends IBase<IListBoxProps> {
|
|
1757
|
+
/** The element. */
|
|
1758
|
+
el: HTMLElement;
|
|
1759
|
+
|
|
1760
|
+
/** The selected listbox items. */
|
|
1761
|
+
getValue: () => Array<IDropdownItem>;
|
|
1762
|
+
|
|
1763
|
+
/** Sets the options */
|
|
1764
|
+
setOptions: (items: Array<IDropdownItem>) => void;
|
|
1765
|
+
|
|
1766
|
+
/** Sets the listbox value. */
|
|
1767
|
+
setValue: (value?: string | Array<string> | Array<IDropdownItem>) => void;
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
/**
|
|
1771
|
+
* List Box Properties
|
|
1772
|
+
*/
|
|
1773
|
+
export interface IListBoxProps extends IBaseProps<IListBox> {
|
|
1774
|
+
label?: string;
|
|
1775
|
+
id?: string;
|
|
1776
|
+
isReadonly?: boolean;
|
|
1777
|
+
items: Array<IDropdownItem>;
|
|
1778
|
+
multi?: boolean;
|
|
1779
|
+
onLoadData?: () => Array<IDropdownItem> | PromiseLike<Array<IDropdownItem>>;
|
|
1780
|
+
onChange?: (items: IDropdownItem | Array<IDropdownItem>, ev?: Event) => void;
|
|
1781
|
+
placeholder?: string;
|
|
1782
|
+
required?: boolean;
|
|
1783
|
+
value?: string | Array<string>;
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
declare module 'gd-bs/components/listGroup/types' {
|
|
1788
|
+
|
|
1789
|
+
/**
|
|
1790
|
+
* ### List Group
|
|
1791
|
+
*
|
|
1792
|
+
* ```ts
|
|
1793
|
+
* import { Components } from "gd-sprest-bs";
|
|
1794
|
+
*
|
|
1795
|
+
* // Create the listGroup
|
|
1796
|
+
* let el = document.querySelector("#listGroup");
|
|
1797
|
+
* let listGroup = Components.listGroup({
|
|
1798
|
+
* el: el,
|
|
1799
|
+
* colWidth: 4,
|
|
1800
|
+
* isTabs: true,
|
|
1801
|
+
* items: [
|
|
1802
|
+
* { tabName: "Tab 1", content: "This is the content for tab 1.", isActive: true },
|
|
1803
|
+
* { tabName: "Tab 2", content: "This is the content for tab 2.", badge: { content: "10", type: 4 } },
|
|
1804
|
+
* { tabName: "Tab 3", content: "This is the content for tab 3." },
|
|
1805
|
+
* { tabName: "Tab 4", content: "This is the content for tab 4." },
|
|
1806
|
+
* { tabName: "Tab 5", content: "This is the content for tab 5." }
|
|
1807
|
+
* ]
|
|
1808
|
+
* });
|
|
1809
|
+
* ```
|
|
1810
|
+
*/
|
|
1811
|
+
export const ListGroup: (props: IListGroupProps, template?: string, itemTemplate?: string) => IListGroup;
|
|
1812
|
+
|
|
1813
|
+
/**
|
|
1814
|
+
* List Group Item Types
|
|
1815
|
+
*/
|
|
1816
|
+
export const ListGroupItemTypes: IListGroupItemTypes;
|
|
1817
|
+
|
|
1818
|
+
import { IBaseProps } from "gd-bs/components/types";
|
|
1819
|
+
import { IBadgeProps } from "gd-bs/components/badge/types";
|
|
1820
|
+
|
|
1821
|
+
/**
|
|
1822
|
+
* List Group
|
|
1823
|
+
*/
|
|
1824
|
+
export interface IListGroup {
|
|
1825
|
+
/** The element. */
|
|
1826
|
+
el: HTMLElement;
|
|
1827
|
+
|
|
1828
|
+
/** Hides the list group. */
|
|
1829
|
+
hide: () => void;
|
|
1830
|
+
|
|
1831
|
+
/**
|
|
1832
|
+
* Shows the list group, or specified tab content.
|
|
1833
|
+
* @prop elId - The tab id.
|
|
1834
|
+
*/
|
|
1835
|
+
show: (tabId?: string) => void;
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
/**
|
|
1839
|
+
* List Group Item
|
|
1840
|
+
*/
|
|
1841
|
+
export interface IListGroupItem<T=Element> {
|
|
1842
|
+
badge?: IBadgeProps;
|
|
1843
|
+
className?: string;
|
|
1844
|
+
content?: string | T;
|
|
1845
|
+
data?: any;
|
|
1846
|
+
href?: string;
|
|
1847
|
+
isActive?: boolean;
|
|
1848
|
+
isDisabled?: boolean;
|
|
1849
|
+
onClick?: (el?: HTMLElement, item?: IListGroupItem) => void;
|
|
1850
|
+
onRender?: (el?: HTMLElement, item?: IListGroupItem) => void;
|
|
1851
|
+
onRenderTab?: (el?: HTMLElement, item?: IListGroupItem) => void;
|
|
1852
|
+
tabName?: string;
|
|
1853
|
+
type?: number;
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
/**
|
|
1857
|
+
* List Group Properties
|
|
1858
|
+
*/
|
|
1859
|
+
export interface IListGroupProps<T=Element> extends IBaseProps<IListGroup> {
|
|
1860
|
+
colWidth?: number;
|
|
1861
|
+
fadeTabs?: boolean;
|
|
1862
|
+
isFlush?: boolean;
|
|
1863
|
+
isHorizontal?: boolean;
|
|
1864
|
+
isNumbered?: boolean;
|
|
1865
|
+
isTabs?: boolean;
|
|
1866
|
+
items?: Array<IListGroupItem<T>>;
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
/**
|
|
1870
|
+
* List Group Item Types
|
|
1871
|
+
*/
|
|
1872
|
+
export type IListGroupItemTypes = {
|
|
1873
|
+
Danger: number;
|
|
1874
|
+
Dark: number;
|
|
1875
|
+
Info: number;
|
|
1876
|
+
Light: number;
|
|
1877
|
+
Primary: number;
|
|
1878
|
+
Secondary: number;
|
|
1879
|
+
Success: number;
|
|
1880
|
+
Warning: number;
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
declare module 'gd-bs/components/modal/types' {
|
|
1885
|
+
|
|
1886
|
+
/**
|
|
1887
|
+
* ### Modal
|
|
1888
|
+
*
|
|
1889
|
+
* ```ts
|
|
1890
|
+
* import { Components } from "gd-sprest-bs";
|
|
1891
|
+
*
|
|
1892
|
+
* // Modal elements should be added to the body
|
|
1893
|
+
* var elModal = document.querySelector("#modal-demo");
|
|
1894
|
+
* if(elModal === null) {
|
|
1895
|
+
* elModal = document.createElement("div");
|
|
1896
|
+
* elModal.id = "modal-demo";
|
|
1897
|
+
* document.body.appendChild(elModal);
|
|
1898
|
+
* }
|
|
1899
|
+
*
|
|
1900
|
+
* // Create the modal
|
|
1901
|
+
* let modal = Components.Modal({
|
|
1902
|
+
* el: el,
|
|
1903
|
+
* id: "modalDemo",
|
|
1904
|
+
* title: "Modal Demo",
|
|
1905
|
+
* type: Components.ModalTypes.Small,
|
|
1906
|
+
* body: "This is the body of the modal."
|
|
1907
|
+
* });
|
|
1908
|
+
*
|
|
1909
|
+
* // Create the button
|
|
1910
|
+
* Components.Button({
|
|
1911
|
+
* el: document.querySelector("#modalDemo"),
|
|
1912
|
+
* text: "Show Modal",
|
|
1913
|
+
* toggleObj: modal,
|
|
1914
|
+
* type: Components.ButtonTypes.OutlinePrimary
|
|
1915
|
+
* });
|
|
1916
|
+
* ```
|
|
1917
|
+
*/
|
|
1918
|
+
export const Modal: (props: IModalProps, template?: string) => IModal;
|
|
1919
|
+
|
|
1920
|
+
/**
|
|
1921
|
+
* Modal Types
|
|
1922
|
+
*/
|
|
1923
|
+
export const ModalTypes: IModalTypes;
|
|
1924
|
+
|
|
1925
|
+
import { IBaseProps } from "gd-bs/components/types";
|
|
1926
|
+
|
|
1927
|
+
/**
|
|
1928
|
+
* Modal
|
|
1929
|
+
*/
|
|
1930
|
+
export interface IModal {
|
|
1931
|
+
/** The element. */
|
|
1932
|
+
el: HTMLElement;
|
|
1933
|
+
|
|
1934
|
+
/** Manually hides a modal. */
|
|
1935
|
+
hide: () => void;
|
|
1936
|
+
|
|
1937
|
+
/** Returns true if the modal is visible. */
|
|
1938
|
+
isVisible: boolean;
|
|
1939
|
+
|
|
1940
|
+
/** Updates the auto close flag. */
|
|
1941
|
+
setAutoClose: (value: boolean) => void;
|
|
1942
|
+
|
|
1943
|
+
/** Updates the backdrop flag. */
|
|
1944
|
+
setBackdrop: (value: boolean) => void;
|
|
1945
|
+
|
|
1946
|
+
/** Updates the visibility of the close button. */
|
|
1947
|
+
setCloseButtonVisibility: (showFl: boolean) => void;
|
|
1948
|
+
|
|
1949
|
+
/** Updates the focus flag. */
|
|
1950
|
+
setFocus: (value: boolean) => void;
|
|
1951
|
+
|
|
1952
|
+
/** Updates the center option. */
|
|
1953
|
+
setIsCentered: (value: boolean) => void;
|
|
1954
|
+
|
|
1955
|
+
/** Updates the keyboard flag. */
|
|
1956
|
+
setKeyboard: (value: boolean) => void;
|
|
1957
|
+
|
|
1958
|
+
/** Updates the scrollable option. */
|
|
1959
|
+
setScrollable: (value: boolean) => void;
|
|
1960
|
+
|
|
1961
|
+
/** Updates the title. */
|
|
1962
|
+
setTitle: (title: string) => void;
|
|
1963
|
+
|
|
1964
|
+
/** Updates the type. */
|
|
1965
|
+
setType: (modalType: number) => void;
|
|
1966
|
+
|
|
1967
|
+
/** Manually opens a modal. */
|
|
1968
|
+
show: () => void;
|
|
1969
|
+
|
|
1970
|
+
/** Manually toggles a modal. */
|
|
1971
|
+
toggle: () => void;
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1974
|
+
/**
|
|
1975
|
+
* Modal Options
|
|
1976
|
+
*/
|
|
1977
|
+
export interface IModalOptions {
|
|
1978
|
+
/** True to automatically close the modal when clicking outside of it. */
|
|
1979
|
+
autoClose?: boolean;
|
|
1980
|
+
|
|
1981
|
+
/** True to enable the backdrop when the modal is visible. */
|
|
1982
|
+
backdrop?: boolean;
|
|
1983
|
+
|
|
1984
|
+
/** Sets the centered option */
|
|
1985
|
+
centered?: boolean;
|
|
1986
|
+
|
|
1987
|
+
/** Puts the focus on the modal when initialized. */
|
|
1988
|
+
focus?: boolean;
|
|
1989
|
+
|
|
1990
|
+
/** Closes the modal when escape key is pressed. */
|
|
1991
|
+
keyboard?: boolean;
|
|
1992
|
+
|
|
1993
|
+
/** Makes the body scrollable */
|
|
1994
|
+
scrollable?: boolean;
|
|
1995
|
+
|
|
1996
|
+
/** True to toggle the modal on creation. */
|
|
1997
|
+
visible?: boolean;
|
|
1998
|
+
}
|
|
1999
|
+
|
|
2000
|
+
/**
|
|
2001
|
+
* Modal Properties
|
|
2002
|
+
*/
|
|
2003
|
+
export interface IModalProps<T = HTMLElement> extends IBaseProps<IModal> {
|
|
2004
|
+
body?: string | T;
|
|
2005
|
+
disableFade?: boolean;
|
|
2006
|
+
footer?: string | T;
|
|
2007
|
+
hideCloseButton?: boolean;
|
|
2008
|
+
id?: string;
|
|
2009
|
+
onClose?: (el: HTMLDivElement) => void;
|
|
2010
|
+
onRenderBody?: (el: HTMLDivElement) => void;
|
|
2011
|
+
onRenderHeader?: (el: HTMLDivElement) => void;
|
|
2012
|
+
onRenderFooter?: (el: HTMLDivElement) => void;
|
|
2013
|
+
options?: IModalOptions;
|
|
2014
|
+
title?: string;
|
|
2015
|
+
type?: number;
|
|
2016
|
+
}
|
|
2017
|
+
|
|
2018
|
+
/**
|
|
2019
|
+
* Checkbox Group Types
|
|
2020
|
+
*/
|
|
2021
|
+
export type IModalTypes = {
|
|
2022
|
+
Small: number;
|
|
2023
|
+
Medium: number;
|
|
2024
|
+
Large: number;
|
|
2025
|
+
XLarge: number;
|
|
2026
|
+
Full: number;
|
|
2027
|
+
FullSmall: number;
|
|
2028
|
+
FullMedium: number;
|
|
2029
|
+
FullLarge: number;
|
|
2030
|
+
FullXLarge: number;
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
|
|
2034
|
+
declare module 'gd-bs/components/nav/types' {
|
|
2035
|
+
|
|
2036
|
+
/**
|
|
2037
|
+
* ### Navigation
|
|
2038
|
+
*
|
|
2039
|
+
* ```ts
|
|
2040
|
+
* import { Components } from "gd-sprest-bs";
|
|
2041
|
+
|
|
2042
|
+
* // Create the navigation
|
|
2043
|
+
* let el = document.querySelector("#navigation");
|
|
2044
|
+
* let nav = Components.Nav({
|
|
2045
|
+
* el: el,
|
|
2046
|
+
* isJustified: true,
|
|
2047
|
+
* isPills: true,
|
|
2048
|
+
* isTabs: true,
|
|
2049
|
+
* items: [
|
|
2050
|
+
* { title: "Nav 1", tabContent: "This is the content for tab 1.", isActive: true },
|
|
2051
|
+
* { title: "Nav 2", tabContent: "This is the content for tab 2." },
|
|
2052
|
+
* { title: "Nav 3", tabContent: "This is the content for tab 3." },
|
|
2053
|
+
* { title: "Nav 4", tabContent: "This is the content for tab 4." },
|
|
2054
|
+
* { title: "Nav 5", onRenderTab: function(el) { el.innerHTML = "This is the content for tab 5."; } }
|
|
2055
|
+
* ]
|
|
2056
|
+
* });
|
|
2057
|
+
* ```
|
|
2058
|
+
*/
|
|
2059
|
+
export const Nav: (props: INavProps, template?: string, itemTemplate?: string) => INav;
|
|
2060
|
+
|
|
2061
|
+
import { IBaseProps } from "gd-bs/components/types";
|
|
2062
|
+
|
|
2063
|
+
/**
|
|
2064
|
+
* Navigation
|
|
2065
|
+
*/
|
|
2066
|
+
export interface INav {
|
|
2067
|
+
/** The active tab. */
|
|
2068
|
+
activeTab: INavLink;
|
|
2069
|
+
|
|
2070
|
+
/** The element. */
|
|
2071
|
+
el: HTMLUListElement;
|
|
2072
|
+
|
|
2073
|
+
/** Hides the navigation. */
|
|
2074
|
+
hide: () => void;
|
|
2075
|
+
|
|
2076
|
+
/**
|
|
2077
|
+
* Shows the navigation or selects the given tab and shows its associated pane. Any other tab that was previously selected becomes unselected and its associated pane is hidden.
|
|
2078
|
+
* @prop selector - The query selector.
|
|
2079
|
+
*/
|
|
2080
|
+
show: (selector?: string) => void;
|
|
2081
|
+
|
|
2082
|
+
/**
|
|
2083
|
+
* Shows a tab by it's id or index.
|
|
2084
|
+
*/
|
|
2085
|
+
showTab: (tabId?: string | number) => void;
|
|
2086
|
+
}
|
|
2087
|
+
|
|
2088
|
+
/**
|
|
2089
|
+
* Navigation Properties
|
|
2090
|
+
*/
|
|
2091
|
+
export interface INavProps<T = HTMLElement> extends IBaseProps<INav> {
|
|
2092
|
+
data?: any;
|
|
2093
|
+
enableFill?: boolean;
|
|
2094
|
+
fadeTabs?: boolean;
|
|
2095
|
+
id?: string;
|
|
2096
|
+
items?: Array<INavLinkProps<T>>;
|
|
2097
|
+
isJustified?: boolean;
|
|
2098
|
+
isPills?: boolean;
|
|
2099
|
+
isTabs?: boolean;
|
|
2100
|
+
isUnderline?: boolean;
|
|
2101
|
+
isVertical?: boolean;
|
|
2102
|
+
onClick?: (newTab?: INavLink, prevTab?: INavLink) => void;
|
|
2103
|
+
onLinkRendered?: (el?: HTMLElement, item?: INavLinkProps) => void;
|
|
2104
|
+
onRendered?: (el?: HTMLElement) => void;
|
|
2105
|
+
onTabRendered?: (el?: HTMLElement, item?: INavLinkProps) => void;
|
|
2106
|
+
}
|
|
2107
|
+
|
|
2108
|
+
/**
|
|
2109
|
+
* Navigation Link
|
|
2110
|
+
*/
|
|
2111
|
+
export interface INavLink {
|
|
2112
|
+
elTab: HTMLAnchorElement;
|
|
2113
|
+
elTabContent: HTMLDivElement;
|
|
2114
|
+
isActive: boolean;
|
|
2115
|
+
tabName: string;
|
|
2116
|
+
toggle: (fadeTabs?: boolean) => void;
|
|
2117
|
+
}
|
|
2118
|
+
|
|
2119
|
+
/**
|
|
2120
|
+
* Navigation Link Properties
|
|
2121
|
+
*/
|
|
2122
|
+
export interface INavLinkProps<T = HTMLElement> extends IBaseProps<INavLink> {
|
|
2123
|
+
isActive?: boolean;
|
|
2124
|
+
isDisabled?: boolean;
|
|
2125
|
+
className?: string;
|
|
2126
|
+
data?: any;
|
|
2127
|
+
href?: string;
|
|
2128
|
+
onClick?: (item?: INavLinkProps, ev?: Event) => void;
|
|
2129
|
+
onRender?: (el?: HTMLElement, item?: INavLinkProps) => void;
|
|
2130
|
+
onRenderTab?: (el?: HTMLDivElement, item?: INavLinkProps) => void;
|
|
2131
|
+
tabContent?: string | T;
|
|
2132
|
+
title?: string;
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2135
|
+
|
|
2136
|
+
declare module 'gd-bs/components/navbar/types' {
|
|
2137
|
+
|
|
2138
|
+
/**
|
|
2139
|
+
* ### Navbar
|
|
2140
|
+
*
|
|
2141
|
+
* ```ts
|
|
2142
|
+
* import { Components } from "gd-sprest-bs";
|
|
2143
|
+
*
|
|
2144
|
+
* // Create the navbar
|
|
2145
|
+
* let el = document.querySelector("#navbar");
|
|
2146
|
+
* let navbar = Components.Navbar({
|
|
2147
|
+
* el: el,
|
|
2148
|
+
* brand: "Navbar",
|
|
2149
|
+
* searchBox: {
|
|
2150
|
+
* onChange: (value) => {
|
|
2151
|
+
* // Log the value
|
|
2152
|
+
* console.log("The search value is: " + value);
|
|
2153
|
+
* },
|
|
2154
|
+
* onSearch: (value) => {
|
|
2155
|
+
* // Log the value
|
|
2156
|
+
* console.log("The search value is: " + value);
|
|
2157
|
+
* }
|
|
2158
|
+
* },
|
|
2159
|
+
* items: [
|
|
2160
|
+
* {
|
|
2161
|
+
* text: "Home",
|
|
2162
|
+
* isActive: true
|
|
2163
|
+
* },
|
|
2164
|
+
* {
|
|
2165
|
+
* text: "Link"
|
|
2166
|
+
* },
|
|
2167
|
+
* {
|
|
2168
|
+
* text: "Disabled Link",
|
|
2169
|
+
* isDisabled: true
|
|
2170
|
+
* },
|
|
2171
|
+
* {
|
|
2172
|
+
* text: "Dropdown Link",
|
|
2173
|
+
* items: [
|
|
2174
|
+
* { text: "Link 1" },
|
|
2175
|
+
* { text: "Link 2" },
|
|
2176
|
+
* { text: "Link 3" },
|
|
2177
|
+
* { text: "Link 4" },
|
|
2178
|
+
* { text: "Link 5" }
|
|
2179
|
+
* ]
|
|
2180
|
+
* }
|
|
2181
|
+
* ]
|
|
2182
|
+
* });
|
|
2183
|
+
* ```
|
|
2184
|
+
*/
|
|
2185
|
+
export const Navbar: (props: INavbarProps, template?: string, itemTemplate?: string) => INavbar;
|
|
2186
|
+
|
|
2187
|
+
/**
|
|
2188
|
+
* Navbar Types
|
|
2189
|
+
*/
|
|
2190
|
+
export const NavbarTypes: INavbarTypes;
|
|
2191
|
+
|
|
2192
|
+
import { IBaseProps } from "gd-bs/components/types";
|
|
2193
|
+
import { IDropdownItem } from "gd-bs/components/dropdown/types";
|
|
2194
|
+
import { IPopoverProps } from "gd-bs/components/popover/types";
|
|
2195
|
+
|
|
2196
|
+
/**
|
|
2197
|
+
* Navbar
|
|
2198
|
+
*/
|
|
2199
|
+
export interface INavbar {
|
|
2200
|
+
/** The element. */
|
|
2201
|
+
el: HTMLBaseElement;
|
|
2202
|
+
|
|
2203
|
+
/** Method to get the search box value. */
|
|
2204
|
+
getSearchValue?: () => string;
|
|
2205
|
+
|
|
2206
|
+
/** Hides the nav bar. */
|
|
2207
|
+
hide: () => void;
|
|
2208
|
+
|
|
2209
|
+
/** Updates the navbar type. */
|
|
2210
|
+
setType: (navbarType: number) => void;
|
|
2211
|
+
|
|
2212
|
+
/** Shows the nav bar. */
|
|
2213
|
+
show: () => void;
|
|
2214
|
+
}
|
|
2215
|
+
|
|
2216
|
+
/**
|
|
2217
|
+
* Navbar Item
|
|
2218
|
+
*/
|
|
2219
|
+
export interface INavbarItem {
|
|
2220
|
+
className?: string;
|
|
2221
|
+
classNameItem?: string;
|
|
2222
|
+
data?: any;
|
|
2223
|
+
href?: string;
|
|
2224
|
+
iconClassName?: string;
|
|
2225
|
+
iconSize?: number;
|
|
2226
|
+
iconType?: SVGImageElement | Function;
|
|
2227
|
+
isActive?: boolean;
|
|
2228
|
+
isButton?: boolean;
|
|
2229
|
+
isDisabled?: boolean;
|
|
2230
|
+
items?: Array<IDropdownItem>;
|
|
2231
|
+
onClick?: (item?: INavbarItem, ev?: Event) => void;
|
|
2232
|
+
onMenuRendering?: (props: IPopoverProps) => IPopoverProps;
|
|
2233
|
+
onRender?: (el?: HTMLElement, item?: INavbarItem) => void;
|
|
2234
|
+
target?: string;
|
|
2235
|
+
text?: string;
|
|
2236
|
+
toggle?: string;
|
|
2237
|
+
toggleObj?: any;
|
|
2238
|
+
}
|
|
2239
|
+
|
|
2240
|
+
/**
|
|
2241
|
+
* Navbar Properties
|
|
2242
|
+
*/
|
|
2243
|
+
export interface INavbarProps<T = HTMLElement> extends IBaseProps<INavbar> {
|
|
2244
|
+
brand?: string | T;
|
|
2245
|
+
brandUrl?: string;
|
|
2246
|
+
enableScrolling?: boolean;
|
|
2247
|
+
enableSearch?: boolean;
|
|
2248
|
+
id?: string;
|
|
2249
|
+
items?: Array<INavbarItem>;
|
|
2250
|
+
itemsEnd?: Array<INavbarItem>;
|
|
2251
|
+
onClick?: (item?: INavbarItem, ev?: Event) => void;
|
|
2252
|
+
onClickBrand?: (el?: HTMLElement, ev?: Event) => void;
|
|
2253
|
+
onItemRendered?: (el?: HTMLElement, item?: INavbarItem) => void;
|
|
2254
|
+
onRendered?: (el?: HTMLElement) => void;
|
|
2255
|
+
searchBox?: INavbarSearchBox;
|
|
2256
|
+
type?: number;
|
|
2257
|
+
}
|
|
2258
|
+
|
|
2259
|
+
/**
|
|
2260
|
+
* Navbar Types
|
|
2261
|
+
*/
|
|
2262
|
+
export type INavbarTypes = {
|
|
2263
|
+
Dark: number;
|
|
2264
|
+
Light: number;
|
|
2265
|
+
Primary: number;
|
|
2266
|
+
}
|
|
2267
|
+
|
|
2268
|
+
/**
|
|
2269
|
+
* Navbar Search Box
|
|
2270
|
+
*/
|
|
2271
|
+
export interface INavbarSearchBox {
|
|
2272
|
+
btnType?: number;
|
|
2273
|
+
btnText?: string;
|
|
2274
|
+
hideButton?: boolean;
|
|
2275
|
+
onChange?: (value?: string, ev?: Event) => void;
|
|
2276
|
+
onSearch?: (value?: string, ev?: Event) => void;
|
|
2277
|
+
placeholder?: string;
|
|
2278
|
+
value?: string;
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2282
|
+
declare module 'gd-bs/components/offcanvas/types' {
|
|
2283
|
+
|
|
2284
|
+
/**
|
|
2285
|
+
* Offcanvas
|
|
2286
|
+
*
|
|
2287
|
+
* ```ts
|
|
2288
|
+
* import { Components } from "gd-sprest-bs";
|
|
2289
|
+
*
|
|
2290
|
+
* // Offcanvas elements should be added to the body
|
|
2291
|
+
* var elOffcanvas = document.querySelector("#offcanvas-demo");
|
|
2292
|
+
* if(elOffcanvas === null) {
|
|
2293
|
+
* elOffcanvas = document.createElement("div");
|
|
2294
|
+
* elOffcanvas.id = "offcanvas-demo";
|
|
2295
|
+
* document.body.appendChild(elOffcanvas);
|
|
2296
|
+
* }
|
|
2297
|
+
*
|
|
2298
|
+
* // Create the offcanvas
|
|
2299
|
+
* let el = document.querySelector("#offcanvasDemo");
|
|
2300
|
+
* let offcanvas = Components.Offcanvas({
|
|
2301
|
+
* el: el,
|
|
2302
|
+
* id: "offcanvasDemo",
|
|
2303
|
+
* title: "Offcanvas Demo",
|
|
2304
|
+
* body: "This is the body of the offcanvas.",
|
|
2305
|
+
* type: Components.OffcanvasTypes.End
|
|
2306
|
+
* });
|
|
2307
|
+
*
|
|
2308
|
+
* // Create the button
|
|
2309
|
+
* Components.Button({
|
|
2310
|
+
* el: document.querySelector("#offcanvasDemo"),
|
|
2311
|
+
* text: "Show Offcanvas",
|
|
2312
|
+
* toggleObj: offcanvas
|
|
2313
|
+
* });
|
|
2314
|
+
* ```
|
|
2315
|
+
*/
|
|
2316
|
+
export const Offcanvas: (props: IOffcanvasProps, template?: string) => IOffcanvas;
|
|
2317
|
+
|
|
2318
|
+
/**
|
|
2319
|
+
* Offcanvas Sizes
|
|
2320
|
+
*/
|
|
2321
|
+
export const OffcanvasSize: IOffcanvasSize;
|
|
2322
|
+
|
|
2323
|
+
/**
|
|
2324
|
+
* Offcanvas Types
|
|
2325
|
+
*/
|
|
2326
|
+
export const OffcanvasTypes: IOffcanvasTypes;
|
|
2327
|
+
|
|
2328
|
+
import { IBaseProps } from "gd-bs/components/types";
|
|
2329
|
+
|
|
2330
|
+
/**
|
|
2331
|
+
* Offcanvas
|
|
2332
|
+
*/
|
|
2333
|
+
export interface IOffcanvas {
|
|
2334
|
+
/** The element. */
|
|
2335
|
+
el: HTMLElement;
|
|
2336
|
+
|
|
2337
|
+
/** Hides a collapsible element. */
|
|
2338
|
+
hide: () => void;
|
|
2339
|
+
|
|
2340
|
+
/** Returns true if the modal is visible. */
|
|
2341
|
+
isVisible: boolean;
|
|
2342
|
+
|
|
2343
|
+
/** Updates the auto close flag. */
|
|
2344
|
+
setAutoClose: (value: boolean) => void;
|
|
2345
|
+
|
|
2346
|
+
/** Updates the size. */
|
|
2347
|
+
setSize: (canvasSize: number) => void;
|
|
2348
|
+
|
|
2349
|
+
/** Updates the type. */
|
|
2350
|
+
setType: (canvasType: number) => void;
|
|
2351
|
+
|
|
2352
|
+
/** Shows a collapsible element. */
|
|
2353
|
+
show: () => void;
|
|
2354
|
+
|
|
2355
|
+
/** Toggles the collapsible element on invocation. */
|
|
2356
|
+
toggle: () => void;
|
|
2357
|
+
}
|
|
2358
|
+
|
|
2359
|
+
/**
|
|
2360
|
+
* Offcanvas Properties
|
|
2361
|
+
*/
|
|
2362
|
+
export interface IOffcanvasProps<T = HTMLElement> extends IBaseProps<IOffcanvas> {
|
|
2363
|
+
body?: string | T;
|
|
2364
|
+
data?: any;
|
|
2365
|
+
id?: string;
|
|
2366
|
+
onClose?: (el: HTMLDivElement) => void;
|
|
2367
|
+
onRenderBody?: (el?: HTMLDivElement, props?: IOffcanvasProps) => void;
|
|
2368
|
+
onRenderHeader?: (el?: HTMLDivElement, props?: IOffcanvasProps) => void;
|
|
2369
|
+
options?: IOffcanvasOptions;
|
|
2370
|
+
size?: number;
|
|
2371
|
+
title?: string | T;
|
|
2372
|
+
type?: number;
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
/**
|
|
2376
|
+
* Offcanvas Options
|
|
2377
|
+
*/
|
|
2378
|
+
export interface IOffcanvasOptions {
|
|
2379
|
+
/** True to automatically close the offcanvas when clicking outside of it. */
|
|
2380
|
+
autoClose?: boolean;
|
|
2381
|
+
|
|
2382
|
+
/** True to enable the backdrop when the offcanvas is visible. */
|
|
2383
|
+
backdrop?: boolean;
|
|
2384
|
+
|
|
2385
|
+
/** Puts the focus on the offcanvas when initialized. */
|
|
2386
|
+
focus?: boolean;
|
|
2387
|
+
|
|
2388
|
+
/** Closes the offcanvas when escape key is pressed. */
|
|
2389
|
+
keyboard?: boolean;
|
|
2390
|
+
|
|
2391
|
+
/** True to enable scrolling of the background. */
|
|
2392
|
+
scroll?: boolean;
|
|
2393
|
+
|
|
2394
|
+
/** True to toggle the offcanvas on creation. */
|
|
2395
|
+
visible?: boolean;
|
|
2396
|
+
}
|
|
2397
|
+
|
|
2398
|
+
/**
|
|
2399
|
+
* Offcanvas Size
|
|
2400
|
+
*/
|
|
2401
|
+
export type IOffcanvasSize = {
|
|
2402
|
+
Small: number;
|
|
2403
|
+
Small1: number;
|
|
2404
|
+
Small2: number;
|
|
2405
|
+
Small3: number;
|
|
2406
|
+
Medium: number;
|
|
2407
|
+
Medium1: number;
|
|
2408
|
+
Medium2: number;
|
|
2409
|
+
Medium3: number;
|
|
2410
|
+
Large: number;
|
|
2411
|
+
Large1: number;
|
|
2412
|
+
Large2: number;
|
|
2413
|
+
Large3: number;
|
|
2414
|
+
XLarge: number;
|
|
2415
|
+
XXLarge: number;
|
|
2416
|
+
Full: number;
|
|
2417
|
+
}
|
|
2418
|
+
|
|
2419
|
+
/**
|
|
2420
|
+
* Offcanvas Types
|
|
2421
|
+
*/
|
|
2422
|
+
export type IOffcanvasTypes = {
|
|
2423
|
+
Bottom: number;
|
|
2424
|
+
End: number;
|
|
2425
|
+
Start: number;
|
|
2426
|
+
Top: number;
|
|
2427
|
+
}
|
|
2428
|
+
}
|
|
2429
|
+
|
|
2430
|
+
declare module 'gd-bs/components/pagination/types' {
|
|
2431
|
+
|
|
2432
|
+
/**
|
|
2433
|
+
* ### Pagination
|
|
2434
|
+
*
|
|
2435
|
+
* ```ts
|
|
2436
|
+
* import { Components } from "gd-sprest-bs";
|
|
2437
|
+
*
|
|
2438
|
+
* // Create the pagination
|
|
2439
|
+
* let el = document.querySelector("#pagination");
|
|
2440
|
+
* let pagination = Components.Pagination({
|
|
2441
|
+
* el: el,
|
|
2442
|
+
* numberOfPages: 5,
|
|
2443
|
+
* onClick: (index, ev) => {
|
|
2444
|
+
* // Log the index
|
|
2445
|
+
* console.log("The page number selected is: " + index);
|
|
2446
|
+
* }
|
|
2447
|
+
* });
|
|
2448
|
+
* ```
|
|
2449
|
+
*/
|
|
2450
|
+
export const Pagination: (props: IPaginationProps, template?: string, itemTemplate?: string) => IPagination;
|
|
2451
|
+
|
|
2452
|
+
import { IBaseProps } from "gd-bs/components/types";
|
|
2453
|
+
|
|
2454
|
+
/**
|
|
2455
|
+
* Pagination Alignment
|
|
2456
|
+
*/
|
|
2457
|
+
export const PaginationAlignment: IPaginationAlignment;
|
|
2458
|
+
|
|
2459
|
+
/**
|
|
2460
|
+
* Pagination
|
|
2461
|
+
*/
|
|
2462
|
+
export interface IPagination {
|
|
2463
|
+
/** The element. */
|
|
2464
|
+
el: HTMLBaseElement;
|
|
2465
|
+
|
|
2466
|
+
/** Hides the pagination. */
|
|
2467
|
+
hide: () => void;
|
|
2468
|
+
|
|
2469
|
+
/** Shows the pagination. */
|
|
2470
|
+
show: () => void;
|
|
2471
|
+
}
|
|
2472
|
+
|
|
2473
|
+
/**
|
|
2474
|
+
* Pagination Properties
|
|
2475
|
+
*/
|
|
2476
|
+
export interface IPaginationProps extends IBaseProps<IPagination> {
|
|
2477
|
+
alignment?: number;
|
|
2478
|
+
isLarge?: boolean;
|
|
2479
|
+
isSmall?: boolean;
|
|
2480
|
+
label?: string;
|
|
2481
|
+
numberOfPages?: number;
|
|
2482
|
+
onClick?: (pageNumber?: number, ev?: Event) => void;
|
|
2483
|
+
}
|
|
2484
|
+
|
|
2485
|
+
/**
|
|
2486
|
+
* Pagination Alignment
|
|
2487
|
+
*/
|
|
2488
|
+
export type IPaginationAlignment = {
|
|
2489
|
+
Centered: number;
|
|
2490
|
+
Left: number;
|
|
2491
|
+
Right: number;
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
|
|
2495
|
+
declare module 'gd-bs/components/popover/types' {
|
|
2496
|
+
|
|
2497
|
+
/**
|
|
2498
|
+
* ### Popover
|
|
2499
|
+
*
|
|
2500
|
+
* ```ts
|
|
2501
|
+
* import { Components } from "gd-sprest-bs";
|
|
2502
|
+
*
|
|
2503
|
+
* // Create the popover
|
|
2504
|
+
* let el = document.querySelector("#popover");
|
|
2505
|
+
* let popover = Components.Popover({
|
|
2506
|
+
* el: el,
|
|
2507
|
+
* className: "m-2",
|
|
2508
|
+
* text: "My Popover",
|
|
2509
|
+
* btnProps: {
|
|
2510
|
+
* text: "Popover Demo",
|
|
2511
|
+
* type: Components.ButtonTypes.OutlineDark
|
|
2512
|
+
* },
|
|
2513
|
+
* options: {
|
|
2514
|
+
* content: elContent,
|
|
2515
|
+
* trigger: "focus"
|
|
2516
|
+
* }
|
|
2517
|
+
* });
|
|
2518
|
+
* ```
|
|
2519
|
+
*/
|
|
2520
|
+
export const Popover: (props: IPopoverProps, template?: string) => IPopover;
|
|
2521
|
+
|
|
2522
|
+
/**
|
|
2523
|
+
* Popover Placements
|
|
2524
|
+
*/
|
|
2525
|
+
export const PopoverPlacements: IPopoverPlacements;
|
|
2526
|
+
|
|
2527
|
+
/**
|
|
2528
|
+
* Popover Types
|
|
2529
|
+
*/
|
|
2530
|
+
export const PopoverTypes: IPopoverTypes;
|
|
2531
|
+
|
|
2532
|
+
import { IBaseProps, ITippyProps } from "gd-bs/components/types";
|
|
2533
|
+
import { IButtonProps } from "gd-bs/components/button/types";
|
|
2534
|
+
|
|
2535
|
+
/**
|
|
2536
|
+
* Popover
|
|
2537
|
+
*/
|
|
2538
|
+
export interface IPopover {
|
|
2539
|
+
/** The element. */
|
|
2540
|
+
el: HTMLElement;
|
|
2541
|
+
|
|
2542
|
+
/** The tippy instance. */
|
|
2543
|
+
tippy: any;
|
|
2544
|
+
|
|
2545
|
+
/** Enables the popover. */
|
|
2546
|
+
enable: () => void;
|
|
2547
|
+
|
|
2548
|
+
/** Hides an element’s popover. */
|
|
2549
|
+
hide: () => void;
|
|
2550
|
+
|
|
2551
|
+
/** Toggles an element's popover. */
|
|
2552
|
+
toggle: () => void;
|
|
2553
|
+
|
|
2554
|
+
/** Sets the body element of the popover. */
|
|
2555
|
+
setBody: (content: string | Element) => void;
|
|
2556
|
+
|
|
2557
|
+
/** Sets the tippy content. */
|
|
2558
|
+
setContent: (content: string | Element) => void;
|
|
2559
|
+
|
|
2560
|
+
/** Sets the header element of the popover. */
|
|
2561
|
+
setHeader: (content: string | Element) => void;
|
|
2562
|
+
|
|
2563
|
+
/** Reveals an element’s popover. */
|
|
2564
|
+
show: () => void;
|
|
2565
|
+
}
|
|
2566
|
+
|
|
2567
|
+
/**
|
|
2568
|
+
* Popover Properties
|
|
2569
|
+
*/
|
|
2570
|
+
export interface IPopoverProps extends IBaseProps<IPopover> {
|
|
2571
|
+
btnProps?: IButtonProps;
|
|
2572
|
+
classNameBody?: string;
|
|
2573
|
+
classNameHeader?: string;
|
|
2574
|
+
isDismissible?: boolean;
|
|
2575
|
+
options?: ITippyProps;
|
|
2576
|
+
placement?: number;
|
|
2577
|
+
target?: HTMLElement,
|
|
2578
|
+
title?: string;
|
|
2579
|
+
type?: number;
|
|
2580
|
+
}
|
|
2581
|
+
|
|
2582
|
+
/**
|
|
2583
|
+
* Popover Types
|
|
2584
|
+
*/
|
|
2585
|
+
export type IPopoverTypes = {
|
|
2586
|
+
Danger: number;
|
|
2587
|
+
Dark: number;
|
|
2588
|
+
Info: number;
|
|
2589
|
+
Light: number;
|
|
2590
|
+
LightBorder: number;
|
|
2591
|
+
Material: number;
|
|
2592
|
+
Primary: number;
|
|
2593
|
+
Secondary: number;
|
|
2594
|
+
Success: number;
|
|
2595
|
+
Translucent: number;
|
|
2596
|
+
Warning: number;
|
|
2597
|
+
}
|
|
2598
|
+
|
|
2599
|
+
/**
|
|
2600
|
+
* Popover Placements
|
|
2601
|
+
*/
|
|
2602
|
+
export type IPopoverPlacements = {
|
|
2603
|
+
Auto: number;
|
|
2604
|
+
AutoStart: number;
|
|
2605
|
+
AutoEnd: number;
|
|
2606
|
+
Bottom: number;
|
|
2607
|
+
BottomStart: number;
|
|
2608
|
+
BottomEnd: number;
|
|
2609
|
+
Left: number;
|
|
2610
|
+
LeftStart: number;
|
|
2611
|
+
LeftEnd: number;
|
|
2612
|
+
Right: number;
|
|
2613
|
+
RightStart: number;
|
|
2614
|
+
RightEnd: number;
|
|
2615
|
+
Top: number;
|
|
2616
|
+
TopStart: number;
|
|
2617
|
+
TopEnd: number;
|
|
2618
|
+
}
|
|
2619
|
+
}
|
|
2620
|
+
|
|
2621
|
+
declare module 'gd-bs/components/progress/types' {
|
|
2622
|
+
|
|
2623
|
+
/**
|
|
2624
|
+
* ### Progress
|
|
2625
|
+
*
|
|
2626
|
+
* ```ts
|
|
2627
|
+
* import { Components } from "gd-sprest-bs";
|
|
2628
|
+
*
|
|
2629
|
+
* // Create the progress
|
|
2630
|
+
* let el = document.querySelector("#progress");
|
|
2631
|
+
* let progress = Components.Progress({
|
|
2632
|
+
* el: el,
|
|
2633
|
+
* size: 25,
|
|
2634
|
+
* label: "25%"
|
|
2635
|
+
* });
|
|
2636
|
+
* ```
|
|
2637
|
+
*/
|
|
2638
|
+
export const Progress: (props: IProgressProps, template?: string) => IProgress;
|
|
2639
|
+
|
|
2640
|
+
import { IBaseProps } from "gd-bs/components/types";
|
|
2641
|
+
|
|
2642
|
+
/**
|
|
2643
|
+
* Progress
|
|
2644
|
+
*/
|
|
2645
|
+
export interface IProgress {
|
|
2646
|
+
/** The element. */
|
|
2647
|
+
el: HTMLElement;
|
|
2648
|
+
|
|
2649
|
+
/** Hides the progress. */
|
|
2650
|
+
hide: () => void;
|
|
2651
|
+
|
|
2652
|
+
/** The progress bar element */
|
|
2653
|
+
progressBar: HTMLDivElement;
|
|
2654
|
+
|
|
2655
|
+
/** Shows the progress. */
|
|
2656
|
+
show: () => void;
|
|
2657
|
+
}
|
|
2658
|
+
|
|
2659
|
+
/**
|
|
2660
|
+
* Progress Properties
|
|
2661
|
+
*/
|
|
2662
|
+
export interface IProgressProps extends IBaseProps<IProgress> {
|
|
2663
|
+
isAnimated?: boolean;
|
|
2664
|
+
isStriped?: boolean;
|
|
2665
|
+
label?: string;
|
|
2666
|
+
max?: number;
|
|
2667
|
+
min?: number;
|
|
2668
|
+
size?: number;
|
|
2669
|
+
type?: number;
|
|
2670
|
+
}
|
|
2671
|
+
}
|
|
2672
|
+
|
|
2673
|
+
declare module 'gd-bs/components/progressGroup/types' {
|
|
2674
|
+
|
|
2675
|
+
/**
|
|
2676
|
+
* ### Progress Group
|
|
2677
|
+
*
|
|
2678
|
+
* ```ts
|
|
2679
|
+
* import { Components } from "gd-sprest-bs";
|
|
2680
|
+
*
|
|
2681
|
+
* // Create the progress group
|
|
2682
|
+
* let el = document.querySelector("#progressGroup");
|
|
2683
|
+
* let progressGroup = Components.ProgressGroup({
|
|
2684
|
+
* el: el,
|
|
2685
|
+
* progressbars: [
|
|
2686
|
+
* {
|
|
2687
|
+
* size: 25,
|
|
2688
|
+
* isStriped: true,
|
|
2689
|
+
* label: "25%"
|
|
2690
|
+
* },
|
|
2691
|
+
* {
|
|
2692
|
+
* size: 50,
|
|
2693
|
+
* isAnimated: true,
|
|
2694
|
+
* isStriped: true,
|
|
2695
|
+
* label: "50%"
|
|
2696
|
+
* }
|
|
2697
|
+
* ]
|
|
2698
|
+
* });
|
|
2699
|
+
* ```
|
|
2700
|
+
*/
|
|
2701
|
+
export const ProgressGroup: (props: IProgressGroupProps, template?: string, progressTemplate?: string) => IProgressGroup;
|
|
2702
|
+
|
|
2703
|
+
import { IBaseProps } from "gd-bs/components/types";
|
|
2704
|
+
import { IProgressProps } from "gd-bs/components/progress/types";
|
|
2705
|
+
|
|
2706
|
+
/**
|
|
2707
|
+
* Progress Group
|
|
2708
|
+
*/
|
|
2709
|
+
export interface IProgressGroup {
|
|
2710
|
+
/** The element. */
|
|
2711
|
+
el: HTMLElement;
|
|
2712
|
+
|
|
2713
|
+
/** Hides the progress group. */
|
|
2714
|
+
hide: () => void;
|
|
2715
|
+
|
|
2716
|
+
/** Shows the progress group. */
|
|
2717
|
+
show: () => void;
|
|
2718
|
+
}
|
|
2719
|
+
|
|
2720
|
+
/**
|
|
2721
|
+
* Progress Group Properties
|
|
2722
|
+
*/
|
|
2723
|
+
export interface IProgressGroupProps extends IBaseProps<IProgressGroup> {
|
|
2724
|
+
isMultiple?: boolean;
|
|
2725
|
+
progressbars?: Array<IProgressProps>;
|
|
2726
|
+
}
|
|
2727
|
+
}
|
|
2728
|
+
|
|
2729
|
+
declare module 'gd-bs/components/spinner/types' {
|
|
2730
|
+
|
|
2731
|
+
/**
|
|
2732
|
+
* ### Spinner
|
|
2733
|
+
*
|
|
2734
|
+
* ```ts
|
|
2735
|
+
* import { Components } from "gd-sprest-bs";
|
|
2736
|
+
*
|
|
2737
|
+
* // Create a spinner
|
|
2738
|
+
* let el = document.querySelector("#spinner");
|
|
2739
|
+
* Components.Spinner({
|
|
2740
|
+
* el,
|
|
2741
|
+
* text: "Loading...",
|
|
2742
|
+
* type: Components.SpinnerTypes.Danger
|
|
2743
|
+
* });
|
|
2744
|
+
* ```
|
|
2745
|
+
*/
|
|
2746
|
+
export const Spinner: (props: ISpinnerProps, template?: string) => ISpinner;
|
|
2747
|
+
|
|
2748
|
+
/**
|
|
2749
|
+
* Spinner Types
|
|
2750
|
+
*/
|
|
2751
|
+
export const SpinnerTypes: ISpinnerTypes;
|
|
2752
|
+
|
|
2753
|
+
import { IBaseProps } from "gd-bs/components/types";
|
|
2754
|
+
|
|
2755
|
+
/**
|
|
2756
|
+
* Spinner
|
|
2757
|
+
*/
|
|
2758
|
+
export interface ISpinner {
|
|
2759
|
+
/** The element. */
|
|
2760
|
+
el: HTMLElement;
|
|
2761
|
+
|
|
2762
|
+
/** Hides the spinner. */
|
|
2763
|
+
hide: () => void;
|
|
2764
|
+
|
|
2765
|
+
/** Shows the spinner. */
|
|
2766
|
+
show: () => void;
|
|
2767
|
+
}
|
|
2768
|
+
|
|
2769
|
+
/**
|
|
2770
|
+
* Spinner Properties
|
|
2771
|
+
*/
|
|
2772
|
+
export interface ISpinnerProps extends IBaseProps<ISpinner> {
|
|
2773
|
+
isGrowing?: boolean;
|
|
2774
|
+
isSmall?: boolean;
|
|
2775
|
+
text?: string;
|
|
2776
|
+
type?: number;
|
|
2777
|
+
}
|
|
2778
|
+
|
|
2779
|
+
/**
|
|
2780
|
+
* Spinner Types
|
|
2781
|
+
*/
|
|
2782
|
+
export type ISpinnerTypes = {
|
|
2783
|
+
Danger: number;
|
|
2784
|
+
Dark: number;
|
|
2785
|
+
Info: number;
|
|
2786
|
+
Light: number;
|
|
2787
|
+
Primary: number;
|
|
2788
|
+
Secondary: number;
|
|
2789
|
+
Success: number;
|
|
2790
|
+
Warning: number;
|
|
2791
|
+
}
|
|
2792
|
+
}
|
|
2793
|
+
|
|
2794
|
+
declare module 'gd-bs/components/table/types' {
|
|
2795
|
+
|
|
2796
|
+
/**
|
|
2797
|
+
* ### Table
|
|
2798
|
+
*
|
|
2799
|
+
* ```ts
|
|
2800
|
+
* import { Components } from "gd-sprest-bs";
|
|
2801
|
+
*
|
|
2802
|
+
* // Create the table
|
|
2803
|
+
* let el = document.querySelector("#table");
|
|
2804
|
+
* let table = Components.Table({
|
|
2805
|
+
* el: el,
|
|
2806
|
+
* className: "table-sm is-striped",
|
|
2807
|
+
* columns: [
|
|
2808
|
+
* { name: "a0", title: "Actions", isHidden: true },
|
|
2809
|
+
* { name: "a1", title: "Col 1" },
|
|
2810
|
+
* { name: "a2", title: "Col 2" },
|
|
2811
|
+
* { name: "a3", title: "Col 3" }
|
|
2812
|
+
* ],
|
|
2813
|
+
* rows: [
|
|
2814
|
+
* { a0: "1", a1: "1.1", a2: "1.2", a3: "1.3" },
|
|
2815
|
+
* { a0: "2", a1: "2.1", a2: "2.2", a3: "2.3" },
|
|
2816
|
+
* { a0: "3", a1: "3.1", a2: "3.2", a3: "3.3" },
|
|
2817
|
+
* { a0: "4", a1: "4.1", a2: "4.2", a3: "4.3" },
|
|
2818
|
+
* { a0: "5", a1: "5.1", a2: "5.2", a3: "5.3" },
|
|
2819
|
+
* { a0: "6", a1: "6.1", a2: "6.2", a3: "6.3" },
|
|
2820
|
+
* { a0: "7", a1: "7.1", a2: "7.2", a3: "7.3" },
|
|
2821
|
+
* { a0: "8", a1: "8.1", a2: "8.2", a3: "8.3" },
|
|
2822
|
+
* { a0: "9", a1: "9.1", a2: "9.2", a3: "9.3" }
|
|
2823
|
+
* ]
|
|
2824
|
+
* });
|
|
2825
|
+
* ```
|
|
2826
|
+
*/
|
|
2827
|
+
export const Table: (props: ITableProps, template?: string) => ITable
|
|
2828
|
+
|
|
2829
|
+
import { IBaseProps } from "gd-bs/components/types";
|
|
2830
|
+
|
|
2831
|
+
/**
|
|
2832
|
+
* Table
|
|
2833
|
+
*/
|
|
2834
|
+
export interface ITable {
|
|
2835
|
+
addRows: (rows: Array<any>) => void;
|
|
2836
|
+
|
|
2837
|
+
el: HTMLTableElement;
|
|
2838
|
+
|
|
2839
|
+
/** Hides the table. */
|
|
2840
|
+
hide: () => void;
|
|
2841
|
+
|
|
2842
|
+
/** Shows the table. */
|
|
2843
|
+
show: () => void;
|
|
2844
|
+
}
|
|
2845
|
+
|
|
2846
|
+
/**
|
|
2847
|
+
* Table Properties
|
|
2848
|
+
*/
|
|
2849
|
+
export interface ITableProps extends IBaseProps<ITable> {
|
|
2850
|
+
columns?: Array<ITableColumn>;
|
|
2851
|
+
onClickCell?: (el: HTMLTableDataCellElement, column?: ITableColumn, data?: any, rowIdx?: number) => void;
|
|
2852
|
+
onClickHeader?: (el: HTMLTableHeaderCellElement, column?: ITableColumn) => void;
|
|
2853
|
+
onRenderCell?: (el?: HTMLTableDataCellElement, column?: ITableColumn, data?: any, rowIdx?: number) => void;
|
|
2854
|
+
onRenderHeaderCell?: (el?: HTMLTableDataCellElement, column?: ITableColumn) => void;
|
|
2855
|
+
onRenderHeaderRow?: (el?: HTMLTableRowElement) => void;
|
|
2856
|
+
onRenderRow?: (el?: HTMLTableRowElement, data?: any, rowIdx?: number) => void;
|
|
2857
|
+
rows?: Array<any>;
|
|
2858
|
+
}
|
|
2859
|
+
|
|
2860
|
+
/**
|
|
2861
|
+
* Table Column
|
|
2862
|
+
*/
|
|
2863
|
+
export interface ITableColumn {
|
|
2864
|
+
className?: string;
|
|
2865
|
+
data?: any;
|
|
2866
|
+
isHidden?: boolean;
|
|
2867
|
+
name: string;
|
|
2868
|
+
onClickCell?: (el: HTMLTableDataCellElement, column?: ITableColumn, data?: any, rowIdx?: number) => void;
|
|
2869
|
+
onClickHeader?: (el: HTMLTableHeaderCellElement, column?: ITableColumn) => void;
|
|
2870
|
+
onRenderCell?: (el: HTMLTableDataCellElement, column?: ITableColumn, data?: any, rowIdx?: number) => void;
|
|
2871
|
+
onRenderHeader?: (el?: HTMLTableDataCellElement, column?: ITableColumn) => void;
|
|
2872
|
+
scope?: string;
|
|
2873
|
+
title?: string;
|
|
2874
|
+
}
|
|
2875
|
+
}
|
|
2876
|
+
|
|
2877
|
+
declare module 'gd-bs/components/toast/types' {
|
|
2878
|
+
|
|
2879
|
+
/**
|
|
2880
|
+
* ### Toast
|
|
2881
|
+
*
|
|
2882
|
+
* ```ts
|
|
2883
|
+
* import { Components } from "gd-sprest-bs";
|
|
2884
|
+
*
|
|
2885
|
+
* // Create a toast
|
|
2886
|
+
* let el = document.querySelector("#toast");
|
|
2887
|
+
* Components.Toast({
|
|
2888
|
+
* el,
|
|
2889
|
+
* headerText: "Header",
|
|
2890
|
+
* body: "This is the body of the toast.",
|
|
2891
|
+
* mutedText: "2 seconds ago",
|
|
2892
|
+
* options: { autohide: false }
|
|
2893
|
+
* });
|
|
2894
|
+
* ```
|
|
2895
|
+
*/
|
|
2896
|
+
export const Toast: (props: IToastProps, template?: string) => IToast;
|
|
2897
|
+
|
|
2898
|
+
import { IBaseProps } from "gd-bs/components/types";
|
|
2899
|
+
|
|
2900
|
+
/**
|
|
2901
|
+
* Toast
|
|
2902
|
+
*/
|
|
2903
|
+
export interface IToast {
|
|
2904
|
+
/** The component element. */
|
|
2905
|
+
el: HTMLElement;
|
|
2906
|
+
|
|
2907
|
+
/** Hides the toast. */
|
|
2908
|
+
hide: () => void;
|
|
2909
|
+
|
|
2910
|
+
/** Shows the toast. */
|
|
2911
|
+
show: () => void;
|
|
2912
|
+
}
|
|
2913
|
+
|
|
2914
|
+
/**
|
|
2915
|
+
* Toast Properties
|
|
2916
|
+
*/
|
|
2917
|
+
export interface IToastProps<T = HTMLElement> extends IBaseProps<IToast> {
|
|
2918
|
+
body?: string | T;
|
|
2919
|
+
data?: any;
|
|
2920
|
+
headerImgClass?: string;
|
|
2921
|
+
headerImgSrc?: string;
|
|
2922
|
+
headerText?: string;
|
|
2923
|
+
mutedText?: string;
|
|
2924
|
+
options?: IToastOptions;
|
|
2925
|
+
onClick?: (el?: HTMLElement, data?: any) => void;
|
|
2926
|
+
onRenderBody?: (el?: HTMLElement, data?: any) => void;
|
|
2927
|
+
onRenderHeader?: (el?: HTMLElement, data?: any) => void;
|
|
2928
|
+
}
|
|
2929
|
+
|
|
2930
|
+
/**
|
|
2931
|
+
* Toast Options
|
|
2932
|
+
*/
|
|
2933
|
+
export interface IToastOptions {
|
|
2934
|
+
animation?: boolean;
|
|
2935
|
+
autohide?: boolean;
|
|
2936
|
+
delay?: number;
|
|
2937
|
+
}
|
|
2938
|
+
}
|
|
2939
|
+
|
|
2940
|
+
declare module 'gd-bs/components/toolbar/types' {
|
|
2941
|
+
|
|
2942
|
+
/**
|
|
2943
|
+
* ### Toolbar
|
|
2944
|
+
*
|
|
2945
|
+
* ```ts
|
|
2946
|
+
* import { Components } from "gd-sprest-bs";
|
|
2947
|
+
*
|
|
2948
|
+
* // Create a toolbar
|
|
2949
|
+
* let el = document.querySelector("#toolbar");
|
|
2950
|
+
* Components.Toolbar({
|
|
2951
|
+
* el,
|
|
2952
|
+
* spacing: 3,
|
|
2953
|
+
* items: [
|
|
2954
|
+
* { buttons: [{ text: "Button 1" }] },
|
|
2955
|
+
* { buttons: [{ text: "Button 2" }] },
|
|
2956
|
+
* { buttons: [{ text: "Button 3" }] },
|
|
2957
|
+
* { buttons: [{ text: "Button 4" }] },
|
|
2958
|
+
* { buttons: [{ text: "Button 5" }] }
|
|
2959
|
+
* ]
|
|
2960
|
+
* });
|
|
2961
|
+
* ```
|
|
2962
|
+
*/
|
|
2963
|
+
export const Toolbar: (props: IToolbarProps, template?: string) => IToolbar;
|
|
2964
|
+
|
|
2965
|
+
/**
|
|
2966
|
+
* Toolbar
|
|
2967
|
+
*/
|
|
2968
|
+
export interface IToolbar {
|
|
2969
|
+
/** The element. */
|
|
2970
|
+
el: HTMLElement;
|
|
2971
|
+
|
|
2972
|
+
/** Hides the toolbar. */
|
|
2973
|
+
hide: () => void;
|
|
2974
|
+
|
|
2975
|
+
/** Shows the toolbar. */
|
|
2976
|
+
show: () => void;
|
|
2977
|
+
}
|
|
2978
|
+
|
|
2979
|
+
import { IBaseProps } from "gd-bs/components/types";
|
|
2980
|
+
import { IButtonProps } from "gd-bs/components/button/types";
|
|
2981
|
+
import { IInputGroupProps } from "gd-bs/components/inputGroup/types";
|
|
2982
|
+
|
|
2983
|
+
/**
|
|
2984
|
+
* Toolbar Item
|
|
2985
|
+
*/
|
|
2986
|
+
export interface IToolbarItem {
|
|
2987
|
+
buttons?: Array<IButtonProps>;
|
|
2988
|
+
buttonType?: number;
|
|
2989
|
+
inputGroup?: IInputGroupProps;
|
|
2990
|
+
}
|
|
2991
|
+
|
|
2992
|
+
/**
|
|
2993
|
+
* Toolbar Properties
|
|
2994
|
+
*/
|
|
2995
|
+
export interface IToolbarProps extends IBaseProps<IToolbar> {
|
|
2996
|
+
items?: Array<IToolbarItem>;
|
|
2997
|
+
spacing?: number;
|
|
2998
|
+
}
|
|
2999
|
+
}
|
|
3000
|
+
|
|
3001
|
+
declare module 'gd-bs/components/tooltip/types' {
|
|
3002
|
+
|
|
3003
|
+
/**
|
|
3004
|
+
* ### Tooltip
|
|
3005
|
+
*
|
|
3006
|
+
* ```ts
|
|
3007
|
+
import { Components } from "gd-sprest-bs";
|
|
3008
|
+
|
|
3009
|
+
// Create the tooltip
|
|
3010
|
+
let el = document.querySelector("#tooltip");
|
|
3011
|
+
let tooltip = Components.Tooltip({
|
|
3012
|
+
el: el,
|
|
3013
|
+
content: "This is the tooltip content.",
|
|
3014
|
+
placement: Components.TooltipPlacements.Top,
|
|
3015
|
+
theme: Components.TooltipTypes.LightBorder,
|
|
3016
|
+
btnProps: {
|
|
3017
|
+
text: "Tooltip",
|
|
3018
|
+
type: Components.ButtonTypes.OutlineDark
|
|
3019
|
+
}
|
|
3020
|
+
});
|
|
3021
|
+
```
|
|
3022
|
+
*/
|
|
3023
|
+
export const Tooltip: (props: ITooltipProps, template?: string) => ITooltip;
|
|
3024
|
+
|
|
3025
|
+
/**
|
|
3026
|
+
* Tooltip Placements
|
|
3027
|
+
*/
|
|
3028
|
+
export const TooltipPlacements: ITooltipPlacements;
|
|
3029
|
+
|
|
3030
|
+
/**
|
|
3031
|
+
* Tooltip Types
|
|
3032
|
+
*/
|
|
3033
|
+
export const TooltipTypes: ITooltipTypes;
|
|
3034
|
+
|
|
3035
|
+
import { IBaseProps, ITippyProps } from "gd-bs/components/types";
|
|
3036
|
+
import { IButtonProps, IButton } from "gd-bs/components/button/types";
|
|
3037
|
+
import { IDropdownProps, IDropdown } from "gd-bs/components/dropdown/types";
|
|
3038
|
+
|
|
3039
|
+
/**
|
|
3040
|
+
* Tooltip
|
|
3041
|
+
*/
|
|
3042
|
+
export interface ITooltip {
|
|
3043
|
+
/** Reference to the button. */
|
|
3044
|
+
button?: IButton;
|
|
3045
|
+
|
|
3046
|
+
/** The element. */
|
|
3047
|
+
el: HTMLButtonElement;
|
|
3048
|
+
|
|
3049
|
+
/** Gives an element’s tooltip the ability to be shown. */
|
|
3050
|
+
enable: () => void;
|
|
3051
|
+
|
|
3052
|
+
/** Hides an element’s tooltip. */
|
|
3053
|
+
hide: () => void;
|
|
3054
|
+
|
|
3055
|
+
/** Reference to the dropdown. */
|
|
3056
|
+
ddl?: IDropdown;
|
|
3057
|
+
|
|
3058
|
+
/** The tippy instance. */
|
|
3059
|
+
tippy: any;
|
|
3060
|
+
|
|
3061
|
+
/** Toggles an element's tooltip. */
|
|
3062
|
+
toggle: () => void;
|
|
3063
|
+
|
|
3064
|
+
/** Sets the tippy content. */
|
|
3065
|
+
setContent: (content: string | Element) => void;
|
|
3066
|
+
|
|
3067
|
+
/** Reveals an element’s tooltip. */
|
|
3068
|
+
show: () => void;
|
|
3069
|
+
}
|
|
3070
|
+
|
|
3071
|
+
/**
|
|
3072
|
+
* Tooltip Properties
|
|
3073
|
+
*/
|
|
3074
|
+
export interface ITooltipProps extends IBaseProps<ITooltip> {
|
|
3075
|
+
btnProps?: IButtonProps;
|
|
3076
|
+
ddlProps?: IDropdownProps;
|
|
3077
|
+
content?: string | Element;
|
|
3078
|
+
options?: ITippyProps;
|
|
3079
|
+
placement?: number;
|
|
3080
|
+
target?: HTMLElement;
|
|
3081
|
+
type?: number;
|
|
3082
|
+
}
|
|
3083
|
+
|
|
3084
|
+
/**
|
|
3085
|
+
* Tooltip Types
|
|
3086
|
+
*/
|
|
3087
|
+
export type ITooltipTypes = {
|
|
3088
|
+
Danger: number;
|
|
3089
|
+
Dark: number;
|
|
3090
|
+
Info: number;
|
|
3091
|
+
Light: number;
|
|
3092
|
+
LightBorder: number;
|
|
3093
|
+
Material: number;
|
|
3094
|
+
Primary: number;
|
|
3095
|
+
Secondary: number;
|
|
3096
|
+
Success: number;
|
|
3097
|
+
Translucent: number;
|
|
3098
|
+
Warning: number;
|
|
3099
|
+
}
|
|
3100
|
+
|
|
3101
|
+
/**
|
|
3102
|
+
* Tooltip Placements
|
|
3103
|
+
*/
|
|
3104
|
+
export type ITooltipPlacements = {
|
|
3105
|
+
Auto: number;
|
|
3106
|
+
AutoStart: number;
|
|
3107
|
+
AutoEnd: number;
|
|
3108
|
+
Bottom: number;
|
|
3109
|
+
BottomStart: number;
|
|
3110
|
+
BottomEnd: number;
|
|
3111
|
+
Left: number;
|
|
3112
|
+
LeftStart: number;
|
|
3113
|
+
LeftEnd: number;
|
|
3114
|
+
Right: number;
|
|
3115
|
+
RightStart: number;
|
|
3116
|
+
RightEnd: number;
|
|
3117
|
+
Top: number;
|
|
3118
|
+
TopStart: number;
|
|
3119
|
+
TopEnd: number;
|
|
3120
|
+
}
|
|
3121
|
+
}
|
|
3122
|
+
|
|
3123
|
+
declare module 'gd-bs/components/tooltipGroup/types' {
|
|
3124
|
+
|
|
3125
|
+
/**
|
|
3126
|
+
* ### Tooltip Group
|
|
3127
|
+
*
|
|
3128
|
+
* ```ts
|
|
3129
|
+
* import { Components } from "gd-sprest-bs";
|
|
3130
|
+
*
|
|
3131
|
+
* // Create the group
|
|
3132
|
+
* let el = document.querySelector("#buttonGroup");
|
|
3133
|
+
* let tooltipGroup = Components.TooltipGroup({
|
|
3134
|
+
* el: el,
|
|
3135
|
+
* buttonType: $REST.Components.ButtonTypes.Primary,
|
|
3136
|
+
* buttons: [
|
|
3137
|
+
* { text: "Left", onClick: function() { alert("Left button was clicked."); } },
|
|
3138
|
+
* { text: "Middle", onClick: function() { alert("Middle button was clicked."); } },
|
|
3139
|
+
* { text: "Right", onClick: function() { alert("Right button was clicked."); } }
|
|
3140
|
+
* ]
|
|
3141
|
+
* });
|
|
3142
|
+
* ```
|
|
3143
|
+
*/
|
|
3144
|
+
export const TooltipGroup: (props: ITooltipGroupProps, template?: string, btnTemplate?: string) => ITooltipGroup;
|
|
3145
|
+
|
|
3146
|
+
import { IBaseProps, ITippyProps } from "gd-bs/components/types";
|
|
3147
|
+
import { ITooltip, ITooltipProps } from "gd-bs/components/tooltip/types";
|
|
3148
|
+
|
|
3149
|
+
/**
|
|
3150
|
+
* Tooltip Group
|
|
3151
|
+
*/
|
|
3152
|
+
export interface ITooltipGroup {
|
|
3153
|
+
/** Adds a button to the group. */
|
|
3154
|
+
add: (props: ITooltipProps, btnTemplate?: string) => void;
|
|
3155
|
+
|
|
3156
|
+
/** The element. */
|
|
3157
|
+
el: HTMLElement;
|
|
3158
|
+
|
|
3159
|
+
/** The tooltips. */
|
|
3160
|
+
tooltips: Array<ITooltip>;
|
|
3161
|
+
|
|
3162
|
+
/** Hides the button group. */
|
|
3163
|
+
hide: () => void;
|
|
3164
|
+
|
|
3165
|
+
/** Shows the button group. */
|
|
3166
|
+
show: () => void;
|
|
3167
|
+
}
|
|
3168
|
+
|
|
3169
|
+
/**
|
|
3170
|
+
* Tooltip Group Properties
|
|
3171
|
+
*/
|
|
3172
|
+
export interface ITooltipGroupProps extends IBaseProps<ITooltipGroup> {
|
|
3173
|
+
tooltips?: Array<ITooltipProps>;
|
|
3174
|
+
buttonType?: number;
|
|
3175
|
+
id?: string;
|
|
3176
|
+
isLarge?: boolean;
|
|
3177
|
+
isSmall?: boolean;
|
|
3178
|
+
isVertical?: boolean;
|
|
3179
|
+
label?: string;
|
|
3180
|
+
tooltipOptions?: ITippyProps;
|
|
3181
|
+
tooltipPlacement?: number;
|
|
3182
|
+
tooltipType?: number;
|
|
3183
|
+
}
|
|
3184
|
+
}
|
|
3185
|
+
|
|
3186
|
+
declare module 'gd-bs/components/types' {
|
|
3187
|
+
/**
|
|
3188
|
+
* Base
|
|
3189
|
+
*/
|
|
3190
|
+
export interface IBase<IProps = IBaseProps> {
|
|
3191
|
+
/** Internal method to configure the parent element. */
|
|
3192
|
+
configureParent(): HTMLElement;
|
|
3193
|
+
|
|
3194
|
+
/** The component HTML element */
|
|
3195
|
+
el: HTMLElement;
|
|
3196
|
+
|
|
3197
|
+
/** Hides the component. */
|
|
3198
|
+
hide(): void;
|
|
3199
|
+
|
|
3200
|
+
/** The component properties */
|
|
3201
|
+
props: IProps;
|
|
3202
|
+
|
|
3203
|
+
/** Shows the component. */
|
|
3204
|
+
show(): void;
|
|
3205
|
+
}
|
|
3206
|
+
|
|
3207
|
+
/**
|
|
3208
|
+
* Base Properties
|
|
3209
|
+
*/
|
|
3210
|
+
export interface IBaseProps<IBaseObj = any> {
|
|
3211
|
+
/** Assigns the object to the input parameter. */
|
|
3212
|
+
assignTo?: (obj: IBaseObj) => void;
|
|
3213
|
+
|
|
3214
|
+
/** Custom class names. */
|
|
3215
|
+
className?: string;
|
|
3216
|
+
|
|
3217
|
+
/** The element to render the component to. */
|
|
3218
|
+
el?: HTMLElement;
|
|
3219
|
+
}
|
|
3220
|
+
|
|
3221
|
+
/** Tippy Options */
|
|
3222
|
+
export interface ITippyProps {
|
|
3223
|
+
allowHTML?: boolean;
|
|
3224
|
+
animateFill?: boolean;
|
|
3225
|
+
animation?: string | boolean;
|
|
3226
|
+
appendTo?: HTMLElement;
|
|
3227
|
+
aria?: object;
|
|
3228
|
+
arrow?: boolean | string | SVGElement | DocumentFragment;
|
|
3229
|
+
content?: string | Element;
|
|
3230
|
+
delay?: number | [number | null, number | null];
|
|
3231
|
+
duration?: number | [number | null, number | null];
|
|
3232
|
+
followCursor?: boolean | 'horizontal' | 'vertical' | 'initial';
|
|
3233
|
+
hideOnClick?: boolean | 'toggle';
|
|
3234
|
+
ignoreAttributes?: boolean;
|
|
3235
|
+
inertia?: boolean;
|
|
3236
|
+
inlinePositioning?: boolean;
|
|
3237
|
+
interactive?: boolean;
|
|
3238
|
+
interactiveBorder?: number;
|
|
3239
|
+
interactiveDebounce?: number;
|
|
3240
|
+
maxWidth?: number | string;
|
|
3241
|
+
moveTransition?: string;
|
|
3242
|
+
offset?: number[];
|
|
3243
|
+
onAfterUpdate?: (tippyObj?, props?) => void;
|
|
3244
|
+
onBeforeUpdate?: (tippyObj?, props?) => void;
|
|
3245
|
+
onClickOutside?: (tippyObj?, ev?) => void;
|
|
3246
|
+
onCreate?: (tippyObj?) => void;
|
|
3247
|
+
onDestroy?: (tippyObj?) => void;
|
|
3248
|
+
onHidden?: (tippyObj?) => void;
|
|
3249
|
+
onHide?: (tippyObj?) => void;
|
|
3250
|
+
onMount?: (tippyObj?) => void;
|
|
3251
|
+
onShow?: (tippyObj?) => void;
|
|
3252
|
+
onShown?: (tippyObj?) => void;
|
|
3253
|
+
onTrigger?: (tippyObj?, ev?) => void;
|
|
3254
|
+
onUntrigger?: (tippyObj?, ev?) => void;
|
|
3255
|
+
placement?: string;
|
|
3256
|
+
plugins?: any[];
|
|
3257
|
+
popperOptions?: object;
|
|
3258
|
+
role?: string;
|
|
3259
|
+
showOnCreate?: boolean;
|
|
3260
|
+
sticky?: boolean | 'reference' | 'popper';
|
|
3261
|
+
theme?: string;
|
|
3262
|
+
touch?: boolean | 'hold' | ['hold', number];
|
|
3263
|
+
trigger?: string;
|
|
3264
|
+
triggerTarget?: HTMLElement | HTMLElement[] | null;
|
|
3265
|
+
zIndex?: number;
|
|
3266
|
+
}
|
|
3267
|
+
}
|
|
3268
|
+
|