gd-bs 6.0.1 → 6.0.3
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/form/control.js +32 -0
- package/dist/gd-bs-icons.js +1 -1
- package/dist/gd-bs-icons.min.js +1 -1
- package/dist/gd-bs.d.ts +2 -0
- package/dist/gd-bs.js +1 -1
- package/dist/gd-bs.min.js +1 -1
- package/package.json +1 -1
- package/src/components/form/control.ts +34 -0
- package/src/components/form/controlTypes.d.ts +2 -0
package/package.json
CHANGED
|
@@ -512,6 +512,23 @@ export class FormControl implements IFormControl {
|
|
|
512
512
|
}
|
|
513
513
|
}
|
|
514
514
|
|
|
515
|
+
// Hides the control
|
|
516
|
+
hide() {
|
|
517
|
+
// Ensure an element exists
|
|
518
|
+
if (this._el) {
|
|
519
|
+
// See if this is a row
|
|
520
|
+
if (this._el.parentElement && this._el.parentElement.parentElement && this._el.parentElement.parentElement.classList.contains("row")) {
|
|
521
|
+
// Hide the row element
|
|
522
|
+
this._el.parentElement.parentElement.classList.add("d-none");
|
|
523
|
+
}
|
|
524
|
+
// Else, ensure the parent element exists
|
|
525
|
+
else if (this._el.parentElement) {
|
|
526
|
+
// Hide the group element
|
|
527
|
+
this._el.parentElement.classList.add("d-none");
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
|
|
515
532
|
// Is loaded
|
|
516
533
|
isLoaded(): PromiseLike<void> {
|
|
517
534
|
// Return a promise
|
|
@@ -598,6 +615,23 @@ export class FormControl implements IFormControl {
|
|
|
598
615
|
this.control ? this.control.setValue(value) : null;
|
|
599
616
|
}
|
|
600
617
|
|
|
618
|
+
// Shows the control
|
|
619
|
+
show() {
|
|
620
|
+
// Ensure an element exists
|
|
621
|
+
if (this._el) {
|
|
622
|
+
// See if this is a row
|
|
623
|
+
if (this._el.parentElement && this._el.parentElement.parentElement && this._el.parentElement.parentElement.classList.contains("row")) {
|
|
624
|
+
// Show the row element
|
|
625
|
+
this._el.parentElement.parentElement.classList.remove("d-none");
|
|
626
|
+
}
|
|
627
|
+
// Else, ensure the parent element exists
|
|
628
|
+
else if (this._el.parentElement) {
|
|
629
|
+
// Show the group element
|
|
630
|
+
this._el.parentElement.classList.remove("d-none");
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
|
|
601
635
|
// Updates the control validation
|
|
602
636
|
updateValidation(elControl: Element, validation: IFormControlValidationResult) {
|
|
603
637
|
// Get the form control
|
|
@@ -52,6 +52,7 @@ export interface IFormControl {
|
|
|
52
52
|
dropdown: IDropdown;
|
|
53
53
|
el: HTMLElement;
|
|
54
54
|
getValue: () => any;
|
|
55
|
+
hide: () => void;
|
|
55
56
|
isLoaded: () => PromiseLike<void>;
|
|
56
57
|
isRendered: boolean;
|
|
57
58
|
isValid: boolean;
|
|
@@ -61,6 +62,7 @@ export interface IFormControl {
|
|
|
61
62
|
setLabel: (value: string) => void;
|
|
62
63
|
setControl: (control: any) => void;
|
|
63
64
|
setValue: (value: any) => void;
|
|
65
|
+
show: () => void;
|
|
64
66
|
updateValidation: (elControl: Element, validation: IFormControlValidationResult) => void;
|
|
65
67
|
}
|
|
66
68
|
|