gd-bs 6.6.3 → 6.6.5
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/components/dropdown/index.js +5 -3
- package/build/components/form/control.js +8 -0
- package/dist/gd-bs-icons.js +1 -1
- package/dist/gd-bs-icons.min.js +1 -1
- package/dist/gd-bs.d.ts +33 -1
- package/dist/gd-bs.js +1 -1
- package/dist/gd-bs.min.js +1 -1
- package/package.json +1 -1
- package/src/components/dropdown/index.ts +4 -2
- package/src/components/dropdown/types.d.ts +7 -1
- package/src/components/form/control.ts +28 -17
- package/src/components/form/controlTypes.d.ts +26 -0
package/package.json
CHANGED
|
@@ -12,6 +12,7 @@ import { HTML, HTMLForm, HTMLNavItem, HTMLSplit } from "./templates";
|
|
|
12
12
|
/**
|
|
13
13
|
* Dropdown Types
|
|
14
14
|
*/
|
|
15
|
+
export const DropdownPlacements = PopoverPlacements;
|
|
15
16
|
export const DropdownTypes = ButtonTypes;
|
|
16
17
|
|
|
17
18
|
// Gets the template
|
|
@@ -253,7 +254,7 @@ class _Dropdown extends Base<IDropdownProps> implements IDropdown {
|
|
|
253
254
|
// Create the props
|
|
254
255
|
let props: IPopoverProps = {
|
|
255
256
|
target: toggle,
|
|
256
|
-
placement: PopoverPlacements.BottomStart,
|
|
257
|
+
placement: typeof (this.props.placement) === "number" ? this.props.placement : PopoverPlacements.BottomStart,
|
|
257
258
|
type: popoverType,
|
|
258
259
|
options: {
|
|
259
260
|
arrow: false,
|
|
@@ -417,7 +418,8 @@ class _Dropdown extends Base<IDropdownProps> implements IDropdown {
|
|
|
417
418
|
className: "m-2",
|
|
418
419
|
el: menu,
|
|
419
420
|
items: cbItems,
|
|
420
|
-
multi: this.props.multi
|
|
421
|
+
multi: this.props.multi,
|
|
422
|
+
onChange: this.props.onChange
|
|
421
423
|
});
|
|
422
424
|
} else {
|
|
423
425
|
let isForm = menu.nodeName == "SELECT";
|
|
@@ -48,7 +48,12 @@ export const Dropdown: (props: IDropdownProps, template?: string) => IDropdown;
|
|
|
48
48
|
|
|
49
49
|
import { IBaseProps } from "../types";
|
|
50
50
|
import { IButtonTypes } from "../button/types";
|
|
51
|
-
import { IPopover, IPopoverProps } from "../popover/types";
|
|
51
|
+
import { IPopover, IPopoverProps, IPopoverPlacements } from "../popover/types";
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Dropdown Placements
|
|
55
|
+
*/
|
|
56
|
+
export const DropdownPlacements: IPopoverPlacements;
|
|
52
57
|
|
|
53
58
|
/**
|
|
54
59
|
* Dropdown Types
|
|
@@ -147,6 +152,7 @@ export interface IDropdownProps extends IBaseProps<IDropdown> {
|
|
|
147
152
|
navFl?: boolean;
|
|
148
153
|
onChange?: (item?: IDropdownItem | Array<IDropdownItem>, ev?: Event) => void;
|
|
149
154
|
onMenuRendering?: (props: IPopoverProps) => IPopoverProps;
|
|
155
|
+
placement?: number;
|
|
150
156
|
required?: boolean;
|
|
151
157
|
title?: string;
|
|
152
158
|
type?: number;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
IFormControl, IFormControlProps, IFormControlPropsCheckbox,
|
|
3
|
-
|
|
2
|
+
IFormControl, IFormControlProps, IFormControlPropsCheckbox,
|
|
3
|
+
IFormControlPropsDropdown, IFormControlPropsDropdownButton, IFormControlPropsDropdownCheckbox,
|
|
4
|
+
IFormControlPropsListBox, IFormControlPropsMultiCheckbox,
|
|
5
|
+
IFormControlPropsMultiDropdown, IFormControlPropsMultiDropdownButton, IFormControlPropsMultiDropdownCheckbox,
|
|
6
|
+
IFormControlPropsMultiListBox, IFormControlPropsMultiSwitch,
|
|
4
7
|
IFormControlPropsRange, IFormControlPropsTextField, IFormControlValidationResult
|
|
5
8
|
} from "./controlTypes";
|
|
6
9
|
import { ICheckboxGroup } from "../checkboxGroup/types";
|
|
@@ -185,9 +188,11 @@ export class FormControl implements IFormControl {
|
|
|
185
188
|
formFl: false,
|
|
186
189
|
id: this._props.id,
|
|
187
190
|
isReadonly: this._props.isReadonly,
|
|
188
|
-
items: (this._props as
|
|
189
|
-
|
|
190
|
-
|
|
191
|
+
items: (this._props as IFormControlPropsDropdownButton).items,
|
|
192
|
+
label: (this.props as IFormControlPropsDropdownButton).placeholder,
|
|
193
|
+
onChange: (this._props as IFormControlPropsDropdownButton).onChange,
|
|
194
|
+
onMenuRendering: (this._props as IFormControlPropsDropdownButton).onMenuRendering,
|
|
195
|
+
placement: (this._props as IFormControlPropsDropdownButton).placement,
|
|
191
196
|
required: this._props.required,
|
|
192
197
|
title: this._props.title,
|
|
193
198
|
value
|
|
@@ -202,9 +207,11 @@ export class FormControl implements IFormControl {
|
|
|
202
207
|
id: this._props.id,
|
|
203
208
|
isCheckbox: true,
|
|
204
209
|
isReadonly: this._props.isReadonly,
|
|
205
|
-
items: (this._props as
|
|
206
|
-
|
|
207
|
-
|
|
210
|
+
items: (this._props as IFormControlPropsDropdownCheckbox).items,
|
|
211
|
+
label: (this.props as IFormControlPropsDropdownCheckbox).placeholder,
|
|
212
|
+
onChange: (this._props as IFormControlPropsDropdownCheckbox).onChange,
|
|
213
|
+
onMenuRendering: (this._props as IFormControlPropsDropdownCheckbox).onMenuRendering,
|
|
214
|
+
placement: (this._props as IFormControlPropsDropdownCheckbox).placement,
|
|
208
215
|
required: this._props.required,
|
|
209
216
|
title: this._props.title,
|
|
210
217
|
value
|
|
@@ -288,10 +295,10 @@ export class FormControl implements IFormControl {
|
|
|
288
295
|
formFl: true,
|
|
289
296
|
id: this._props.id,
|
|
290
297
|
isReadonly: this._props.isReadonly,
|
|
291
|
-
items: (this._props as
|
|
298
|
+
items: (this._props as IFormControlPropsMultiDropdown).items,
|
|
292
299
|
multi: true,
|
|
293
|
-
onChange: (this._props as
|
|
294
|
-
onMenuRendering: (this._props as
|
|
300
|
+
onChange: (this._props as IFormControlPropsMultiDropdown).onChange,
|
|
301
|
+
onMenuRendering: (this._props as IFormControlPropsMultiDropdown).onMenuRendering,
|
|
295
302
|
required: this._props.required,
|
|
296
303
|
title: this._props.title,
|
|
297
304
|
value
|
|
@@ -305,10 +312,12 @@ export class FormControl implements IFormControl {
|
|
|
305
312
|
formFl: false,
|
|
306
313
|
id: this._props.id,
|
|
307
314
|
isReadonly: this._props.isReadonly,
|
|
308
|
-
items: (this._props as
|
|
315
|
+
items: (this._props as IFormControlPropsMultiDropdownButton).items,
|
|
316
|
+
label: (this._props as IFormControlPropsMultiDropdownButton).placeholder,
|
|
309
317
|
multi: true,
|
|
310
|
-
onChange: (this._props as
|
|
311
|
-
onMenuRendering: (this._props as
|
|
318
|
+
onChange: (this._props as IFormControlPropsMultiDropdownButton).onChange,
|
|
319
|
+
onMenuRendering: (this._props as IFormControlPropsMultiDropdownButton).onMenuRendering,
|
|
320
|
+
placement: (this._props as IFormControlPropsMultiDropdownButton).placement,
|
|
312
321
|
required: this._props.required,
|
|
313
322
|
title: this._props.title,
|
|
314
323
|
value
|
|
@@ -323,10 +332,12 @@ export class FormControl implements IFormControl {
|
|
|
323
332
|
id: this._props.id,
|
|
324
333
|
isCheckbox: true,
|
|
325
334
|
isReadonly: this._props.isReadonly,
|
|
326
|
-
items: (this._props as
|
|
335
|
+
items: (this._props as IFormControlPropsMultiDropdownCheckbox).items,
|
|
336
|
+
label: (this._props as IFormControlPropsMultiDropdownCheckbox).placeholder,
|
|
327
337
|
multi: true,
|
|
328
|
-
onChange: (this._props as
|
|
329
|
-
onMenuRendering: (this._props as
|
|
338
|
+
onChange: (this._props as IFormControlPropsMultiDropdownCheckbox).onChange,
|
|
339
|
+
onMenuRendering: (this._props as IFormControlPropsMultiDropdownCheckbox).onMenuRendering,
|
|
340
|
+
placement: (this._props as IFormControlPropsMultiDropdownCheckbox).placement,
|
|
330
341
|
required: this._props.required,
|
|
331
342
|
title: this._props.title,
|
|
332
343
|
value
|
|
@@ -119,6 +119,19 @@ export interface IFormControlPropsDropdown extends IFormControlProps {
|
|
|
119
119
|
onValidate?: (control: IFormControlPropsDropdown, value: IFormControlValidationResult) => boolean | IFormControlValidationResult;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
+
/**
|
|
123
|
+
* Form Control Properties - Dropdown Button
|
|
124
|
+
*/
|
|
125
|
+
export interface IFormControlPropsDropdownButton extends IFormControlPropsDropdown {
|
|
126
|
+
placeholder?: string;
|
|
127
|
+
placement?: number;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Form Control Properties - Dropdown Checkbox
|
|
132
|
+
*/
|
|
133
|
+
export interface IFormControlPropsDropdownCheckbox extends IFormControlPropsDropdownButton { }
|
|
134
|
+
|
|
122
135
|
/**
|
|
123
136
|
* Form Control Properties - List Box
|
|
124
137
|
*/
|
|
@@ -159,6 +172,19 @@ export interface IFormControlPropsMultiDropdown extends IFormControlProps {
|
|
|
159
172
|
onValidate?: (control: IFormControlPropsDropdown, value: IFormControlValidationResult) => boolean | IFormControlValidationResult;
|
|
160
173
|
}
|
|
161
174
|
|
|
175
|
+
/**
|
|
176
|
+
* Form Control Properties - Multiple Dropdown Button
|
|
177
|
+
*/
|
|
178
|
+
export interface IFormControlPropsMultiDropdownButton extends IFormControlPropsMultiDropdown {
|
|
179
|
+
placeholder?: string;
|
|
180
|
+
placement?: number;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Form Control Properties - Multiple Dropdown Checkbox
|
|
185
|
+
*/
|
|
186
|
+
export interface IFormControlPropsMultiDropdownCheckbox extends IFormControlPropsMultiDropdownButton { }
|
|
187
|
+
|
|
162
188
|
/**
|
|
163
189
|
* Form Control Properties - Multiple List Box
|
|
164
190
|
*/
|