@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.
Files changed (26) hide show
  1. package/demo/index.html +2 -3
  2. package/demo/index.js +53 -28
  3. package/demo/index.min.js +52 -27
  4. package/demo/index.min.js.map +1 -1
  5. package/dist/elements/Address/AddressElement.js +5 -5
  6. package/dist/elements/Address/AddressElement.js.map +1 -1
  7. package/dist/elements/BankField/BankFieldElement.js +3 -3
  8. package/dist/elements/BankField/BankFieldElement.js.map +1 -1
  9. package/dist/elements/CheckBoxElement/CheckBoxElement.d.ts +1 -0
  10. package/dist/elements/CheckBoxElement/CheckBoxElement.js +15 -7
  11. package/dist/elements/CheckBoxElement/CheckBoxElement.js.map +1 -1
  12. package/dist/elements/RadioButtonGroup/RadioButtonGroupElement.d.ts +1 -0
  13. package/dist/elements/RadioButtonGroup/RadioButtonGroupElement.js +15 -7
  14. package/dist/elements/RadioButtonGroup/RadioButtonGroupElement.js.map +1 -1
  15. package/dist/elements/ResidentIdentification/ResidentIdentificationElement.js +5 -5
  16. package/dist/elements/ResidentIdentification/ResidentIdentificationElement.js.map +1 -1
  17. package/dist/framework/CustomInputElement.d.ts +1 -0
  18. package/dist/framework/CustomInputElement.js +9 -0
  19. package/dist/framework/CustomInputElement.js.map +1 -1
  20. package/package.json +1 -1
  21. package/src/elements/Address/AddressElement.ts +8 -8
  22. package/src/elements/BankField/BankFieldElement.ts +4 -4
  23. package/src/elements/CheckBoxElement/CheckBoxElement.ts +18 -11
  24. package/src/elements/RadioButtonGroup/RadioButtonGroupElement.ts +18 -11
  25. package/src/elements/ResidentIdentification/ResidentIdentificationElement.ts +8 -8
  26. 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}`;