@luftborn/custom-elements 2.15.0 → 2.15.2
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/demo/index.html +2 -3
- package/demo/index.js +53 -28
- package/demo/index.min.js +52 -27
- package/demo/index.min.js.map +1 -1
- package/dist/elements/Address/AddressElement.js +5 -5
- package/dist/elements/Address/AddressElement.js.map +1 -1
- package/dist/elements/BankField/BankFieldElement.js +3 -3
- package/dist/elements/BankField/BankFieldElement.js.map +1 -1
- package/dist/elements/CheckBoxElement/CheckBoxElement.d.ts +1 -0
- package/dist/elements/CheckBoxElement/CheckBoxElement.js +15 -7
- package/dist/elements/CheckBoxElement/CheckBoxElement.js.map +1 -1
- package/dist/elements/RadioButtonGroup/RadioButtonGroupElement.d.ts +1 -0
- package/dist/elements/RadioButtonGroup/RadioButtonGroupElement.js +15 -7
- package/dist/elements/RadioButtonGroup/RadioButtonGroupElement.js.map +1 -1
- package/dist/elements/ResidentIdentification/ResidentIdentificationElement.js +5 -5
- package/dist/elements/ResidentIdentification/ResidentIdentificationElement.js.map +1 -1
- package/dist/framework/CustomInputElement.d.ts +1 -0
- package/dist/framework/CustomInputElement.js +9 -0
- package/dist/framework/CustomInputElement.js.map +1 -1
- package/package.json +1 -1
- package/src/elements/Address/AddressElement.ts +8 -8
- package/src/elements/BankField/BankFieldElement.ts +4 -4
- package/src/elements/CheckBoxElement/CheckBoxElement.ts +18 -11
- package/src/elements/RadioButtonGroup/RadioButtonGroupElement.ts +18 -11
- package/src/elements/ResidentIdentification/ResidentIdentificationElement.ts +8 -8
- package/src/framework/CustomInputElement.ts +11 -0
|
@@ -36,6 +36,8 @@ export abstract class CustomInputElement extends HTMLElement {
|
|
|
36
36
|
public dateFormat: string;
|
|
37
37
|
public initialValue: any;
|
|
38
38
|
|
|
39
|
+
public hideLabel: boolean = false;
|
|
40
|
+
|
|
39
41
|
constructor() {
|
|
40
42
|
super();
|
|
41
43
|
}
|
|
@@ -136,6 +138,7 @@ export abstract class CustomInputElement extends HTMLElement {
|
|
|
136
138
|
private setAttributes(): void {
|
|
137
139
|
this.setAttribute("custom-input", "");
|
|
138
140
|
this.setAttribute("name", this.name);
|
|
141
|
+
this.hideLabel = this.hasAttribute('hide-label') || this.hasAttribute('hideLabel');
|
|
139
142
|
}
|
|
140
143
|
|
|
141
144
|
private bindDependencies(): void {
|
|
@@ -278,6 +281,14 @@ export abstract class CustomInputElement extends HTMLElement {
|
|
|
278
281
|
}
|
|
279
282
|
|
|
280
283
|
protected addLabel(inputField: HTMLInputElement | HTMLSelectElement): void {
|
|
284
|
+
if (this.hideLabel) {
|
|
285
|
+
const fieldLabel = this.shadowRoot.querySelector('.field-label');
|
|
286
|
+
if (fieldLabel) {
|
|
287
|
+
fieldLabel.remove();
|
|
288
|
+
}
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
|
|
281
292
|
if (this.label) {
|
|
282
293
|
const randomId = Math.random().toString(36).substring(2, 15);
|
|
283
294
|
inputField.id = `text-field-${randomId}`;
|