@luftborn/custom-elements 2.15.7 → 2.15.8
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.js +15 -14
- package/demo/index.min.js +14 -13
- package/demo/index.min.js.map +1 -1
- package/dist/elements/CheckBoxElement/CheckBoxElement.js +5 -5
- package/dist/elements/CheckBoxElement/CheckBoxElement.js.map +1 -1
- package/dist/elements/RadioButtonGroup/RadioButtonGroupElement.js +3 -5
- package/dist/elements/RadioButtonGroup/RadioButtonGroupElement.js.map +1 -1
- package/dist/framework/CustomInputElement.js +6 -3
- package/dist/framework/CustomInputElement.js.map +1 -1
- package/package.json +1 -1
- package/src/elements/CheckBoxElement/CheckBoxElement.ts +5 -5
- package/src/elements/RadioButtonGroup/RadioButtonGroupElement.ts +13 -14
- package/src/framework/CustomInputElement.ts +6 -3
package/demo/index.min.js
CHANGED
|
@@ -4059,12 +4059,12 @@ var CheckBoxElement = /** @class */ (function (_super) {
|
|
|
4059
4059
|
fieldset = document.createElement('fieldset');
|
|
4060
4060
|
wrapper.appendChild(fieldset);
|
|
4061
4061
|
}
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4062
|
+
var optionsAlreadyAdded = fieldset.querySelectorAll('input[type="checkbox"]').length;
|
|
4063
|
+
if (!optionsAlreadyAdded) {
|
|
4064
|
+
this.options.forEach(function (element, index) {
|
|
4065
4065
|
fieldset.insertAdjacentHTML('beforeend', StringUtil_1.StringUtil.StringFormat(_this.checkboxTemplate, _this.name, element, _this.name + "-" + index));
|
|
4066
|
-
}
|
|
4067
|
-
}
|
|
4066
|
+
});
|
|
4067
|
+
}
|
|
4068
4068
|
};
|
|
4069
4069
|
CheckBoxElement.prototype.addLegend = function () {
|
|
4070
4070
|
var fieldset = this.shadowRoot.querySelector('fieldset');
|
|
@@ -6279,12 +6279,10 @@ var RadioButtonGroupElement = /** @class */ (function (_super) {
|
|
|
6279
6279
|
fieldset = document.createElement('fieldset');
|
|
6280
6280
|
wrapper.appendChild(fieldset);
|
|
6281
6281
|
}
|
|
6282
|
-
|
|
6282
|
+
var optionsAlreadyAdded = fieldset.querySelectorAll('input[type="radio"]').length;
|
|
6283
|
+
if (!optionsAlreadyAdded) {
|
|
6283
6284
|
this.options.forEach(function (element, index) {
|
|
6284
|
-
|
|
6285
|
-
if (!existingRadio) {
|
|
6286
|
-
fieldset.insertAdjacentHTML('beforeend', StringUtil_1.StringUtil.StringFormat(_this.radioButtonTemplate, _this.name, element, _this.name + "-" + index, "" + (_this.required ? 'required' : '')));
|
|
6287
|
-
}
|
|
6285
|
+
fieldset.insertAdjacentHTML('beforeend', StringUtil_1.StringUtil.StringFormat(_this.radioButtonTemplate, _this.name, element, _this.name + "-" + index, "" + (_this.required ? 'required' : '')));
|
|
6288
6286
|
});
|
|
6289
6287
|
}
|
|
6290
6288
|
};
|
|
@@ -7391,9 +7389,12 @@ var CustomInputElement = /** @class */ (function (_super) {
|
|
|
7391
7389
|
newLabel.setAttribute('for', inputField.id);
|
|
7392
7390
|
newLabel.classList.add('field-label');
|
|
7393
7391
|
newLabel.textContent = this.label + ": ";
|
|
7394
|
-
var
|
|
7395
|
-
if (
|
|
7396
|
-
|
|
7392
|
+
var fieldLabelDiv = this.shadowRoot.querySelector('.field-label');
|
|
7393
|
+
if (fieldLabelDiv) {
|
|
7394
|
+
var existingLabel = fieldLabelDiv.querySelector('label.field-label');
|
|
7395
|
+
if (!existingLabel) {
|
|
7396
|
+
fieldLabelDiv.appendChild(newLabel);
|
|
7397
|
+
}
|
|
7397
7398
|
}
|
|
7398
7399
|
if (this.required) {
|
|
7399
7400
|
newLabel.innerHTML += '<span style="color: #e00040">*</span>';
|