@luftborn/custom-elements 2.15.1 → 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.min.js CHANGED
@@ -3534,10 +3534,10 @@ var AddressElement = /** @class */ (function (_super) {
3534
3534
  });
3535
3535
  };
3536
3536
  AddressElement.prototype.initChildInputs = function () {
3537
- this.address = _super.prototype.getChildInput.call(this, '#address');
3538
- this.city = _super.prototype.getChildInput.call(this, '#city');
3539
- this.country = _super.prototype.getChildInput.call(this, '#country');
3540
- this.zip = _super.prototype.getChildInput.call(this, '#zip');
3537
+ this.address = _super.prototype.getChildInput.call(this, '.address');
3538
+ this.city = _super.prototype.getChildInput.call(this, '.city');
3539
+ this.country = _super.prototype.getChildInput.call(this, '.country');
3540
+ this.zip = _super.prototype.getChildInput.call(this, '.zip');
3541
3541
  var addressChaneDebounce = (0, debouncer_1.default)(this.change.bind(this), 400, false);
3542
3542
  this.address.addEventListener('change', function () {
3543
3543
  addressChaneDebounce();
@@ -3656,7 +3656,7 @@ var AddressElement = /** @class */ (function (_super) {
3656
3656
  AddressElement = __decorate([
3657
3657
  (0, custom_element_decorator_1.default)({
3658
3658
  selector: 'address-element',
3659
- template: "\n\t\t\t<div class=\"field-label\">\n\t\t\t</div>\n\t\t\t<div class=\"field-input\">\n\t\t\t\t<div class=\"address-wrapper\">\n\t\t\t\t\t<input class='address-part' id='address' type=\"text\" placeholder='Address'/>\n\t\t\t\t\t<input class='address-part' id='zip' type=\"text\" placeholder='Zip'/>\n\t\t\t\t\t<input class='address-part' id='city' type=\"text\" placeholder='City'/>\n\t\t\t\t\t<input class='address-part' id='country' type=\"text\" placeholder='Country'/>\n\t\t\t\t</div>\n\t\t\t</div>",
3659
+ template: "\n\t\t\t<div class=\"field-label\">\n\t\t\t</div>\n\t\t\t<div class=\"field-input\">\n\t\t\t\t<div class=\"address-wrapper\">\n\t\t\t\t\t<input class='address-part address' id='address' type=\"text\" placeholder='Address'/>\n\t\t\t\t\t<input class='address-part zip' id='zip' type=\"text\" placeholder='Zip'/>\n\t\t\t\t\t<input class='address-part city' id='city' type=\"text\" placeholder='City'/>\n\t\t\t\t\t<input class='address-part country' id='country' type=\"text\" placeholder='Country'/>\n\t\t\t\t</div>\n\t\t\t</div>",
3660
3660
  style: "\n\t\t.address-wrapper{\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: nowrap;\n\t\t}\n\t\tinput.address-part{\n\t\t\tbox-sizing: border-box;\n\t\t\tborder: .1rem solid #27282D;\n\t\t\tborder-radius: .25rem;\n\t\t\tmargin: 0.125rem;\n\t\t\tresize: none;\n\t\t\twidth:33% !important;\n\t\t}\n\t\tinput.address-part::placeholder {\n\t\t\tcolor: rgb(117, 117, 117);\n\t\t}\n\t\t.field-label {\n\t\t\tcolor: #27282d;\n\t\t\tfont-size: .75rem;\n\t\t\tfont-weight: 600;\n\t\t\tword-wrap: break-word;\n\t\t}\n\t\t.field-input {\n\t\t\tfont-size: 0.813rem;\n\t\t\tmin-height: 1.438rem;\n\t\t}\n\t",
3661
3661
  templatePath: './html.html',
3662
3662
  useShadow: true,
@@ -3749,8 +3749,8 @@ var BankFieldElement = /** @class */ (function (_super) {
3749
3749
  this.regNumber.placeholder = Translator_1.default.Translate('BankElement.RegistrationNumber', language);
3750
3750
  };
3751
3751
  BankFieldElement.prototype.initChildInputs = function () {
3752
- this.account = _super.prototype.getChildInput.call(this, '#account-field');
3753
- this.regNumber = _super.prototype.getChildInput.call(this, '#reg-number-field');
3752
+ this.account = _super.prototype.getChildInput.call(this, '.account-field');
3753
+ this.regNumber = _super.prototype.getChildInput.call(this, '.reg-number-field');
3754
3754
  this.account.addEventListener('change', this.change.bind(this));
3755
3755
  this.regNumber.addEventListener('change', this.change.bind(this));
3756
3756
  if (this.required) {
@@ -3790,7 +3790,7 @@ var BankFieldElement = /** @class */ (function (_super) {
3790
3790
  BankFieldElement = __decorate([
3791
3791
  (0, custom_element_decorator_1.default)({
3792
3792
  selector: 'bank-element',
3793
- template: "\n\t\t<div class=\"field-label\">\n\t\t</div>\n\t\t<div class=\"field-input\">\n\t\t\t<div class=\"wrapper\">\n\t\t\t\t<input type=\"text\" id='reg-number-field' placeholder='Bank Account Registration Number'/>\n\t\t\t\t<input type=\"text\" id='account-field' placeholder='Bank Account'/>\n\t\t\t</div>\n\t\t</div>",
3793
+ template: "\n\t\t<div class=\"field-label\">\n\t\t</div>\n\t\t<div class=\"field-input\">\n\t\t\t<div class=\"wrapper\">\n\t\t\t\t<input type=\"text\" class='reg-number-field' id='reg-number-field' placeholder='Bank Account Registration Number'/>\n\t\t\t\t<input type=\"text\" class='account-field' id='account-field' placeholder='Bank Account'/>\n\t\t\t</div>\n\t\t</div>",
3794
3794
  style: "\n\t\t:host{\n\t\t\twidth:100%;\n\t\t}\n\t\t.wrapper{\n\t\t\tdisplay:flex;\n\t\t}\n\t\tinput{\n\t\t\tbox-sizing: border-box;\n\t\t\twidth: 100% !important;\n\t\t\tborder: .1rem solid #27282D;\n\t\t\tborder-radius: .25rem;\n\t\t\tmargin: 0.125rem;\n\t\t\tresize: none;\n\t\t}\n\t\tinput::placeholder {\n\t\t\tcolor: rgb(117, 117, 117);\n\t\t}\n\t\t.field-label {\n\t\t\tcolor: #27282d;\n\t\t\tfont-size: .75rem;\n\t\t\tfont-weight: 600;\n\t\t\tword-wrap: break-word;\n\t\t}\n\t\t.field-input {\n\t\t\tfont-size: 0.813rem;\n\t\t\tmin-height: 1.438rem;\n\t\t}\n\t",
3795
3795
  useShadow: true,
3796
3796
  })
@@ -4041,8 +4041,7 @@ var CheckBoxElement = /** @class */ (function (_super) {
4041
4041
  });
4042
4042
  CheckBoxElement.prototype.connectedCallback = function () {
4043
4043
  _super.prototype.connectedCallback.call(this);
4044
- var firstCheckbox = _super.prototype.getChildElement.call(this, 'input[type="checkbox"]');
4045
- _super.prototype.addLabel.call(this, firstCheckbox);
4044
+ this.addLegend();
4046
4045
  };
4047
4046
  CheckBoxElement.prototype.initChildInputs = function () {
4048
4047
  var _this = this;
@@ -4059,14 +4058,23 @@ var CheckBoxElement = /** @class */ (function (_super) {
4059
4058
  if (!fieldset) {
4060
4059
  fieldset = document.createElement('fieldset');
4061
4060
  wrapper.appendChild(fieldset);
4062
- if (this.label) {
4063
- fieldset.setAttribute('aria-label', this.label);
4064
- }
4065
4061
  this.options.forEach(function (element, index) {
4066
4062
  fieldset.insertAdjacentHTML('beforeend', StringUtil_1.StringUtil.StringFormat(_this.checkboxTemplate, _this.name, element, _this.name + "-" + index));
4067
4063
  });
4068
4064
  }
4069
4065
  };
4066
+ CheckBoxElement.prototype.addLegend = function () {
4067
+ var fieldset = this.shadowRoot.querySelector('fieldset');
4068
+ if (this.label) {
4069
+ fieldset.setAttribute('aria-label', this.label);
4070
+ if (!this.hideLabel) {
4071
+ var legend = document.createElement('legend');
4072
+ legend.textContent = this.label;
4073
+ legend.classList.add('field-label');
4074
+ fieldset.insertAdjacentElement('afterbegin', legend);
4075
+ }
4076
+ }
4077
+ };
4070
4078
  // events
4071
4079
  CheckBoxElement.prototype.change = function ($event) {
4072
4080
  this.touched = true;
@@ -4086,8 +4094,8 @@ var CheckBoxElement = /** @class */ (function (_super) {
4086
4094
  CheckBoxElement = __decorate([
4087
4095
  (0, custom_element_decorator_1.default)({
4088
4096
  selector: 'checkbox-element',
4089
- template: "\n\t\t<div class=\"field-label\">\n\t\t</div>\n\t\t<div class=\"field-input\">\n\t\t\t<div class=\"wrapper\">\n\t\t\t</div>\n\t\t</div>",
4090
- style: "\n\t\t\t:host{\n\t\t\t\twidth:100%;\n\t\t\t}\n\t\t\t.checkbox {\n\t\t\t\twidth: auto;\n\t\t\t\tmargin: auto 0.188rem;\n\t\t\t\tcolor: rgba(72, 72, 72, 0.75);\n\t\t\t\tfont-size: 0.813rem;\n\t\t\t\tmargin-top: 0.25rem;\n\t\t\t}\n\t\t\t.checkbox:first-of-type {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\t\t\tinput[type='checkbox']{\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: auto !important;\n\t\t\t\tborder: .1rem solid #27282D;\n\t\t\t\tborder-radius: .25rem;\n\t\t\t\tmargin: 0.125rem;\n\t\t\t\tresize: none;\n\t\t\t}\n\t\t\tinput[type='checkbox']::placeholder {\n\t\t\t\tcolor: rgb(117, 117, 117);\n\t\t\t}\n\t\t\tfieldset {\n\t\t\t\tborder: none;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\t.field-label {\n\t\t\t\tcolor: #27282d;\n\t\t\t\tfont-size: .75rem;\n\t\t\t\tfont-weight: 600;\n\t\t\t\tword-wrap: break-word;\n\t\t\t}\n\t\t\t.field-input {\n\t\t\t\tfont-size: 0.813rem;\n\t\t\t\tmin-height: 1.438rem;\n\t\t\t}\n\t\t",
4097
+ template: "\n\t\t<div class=\"wrapper\">\n\t\t</div>",
4098
+ style: "\n\t\t\t:host{\n\t\t\t\twidth:100%;\n\t\t\t}\n\t\t\t.checkbox {\n\t\t\t\twidth: auto;\n\t\t\t\tmargin: auto 0.188rem;\n\t\t\t\tcolor: #27282D;\n\t\t\t\tfont-size: 0.813rem;\n\t\t\t\tmargin-top: 0.25rem;\n\t\t\t}\n\t\t\t.checkbox:first-of-type {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\t\t\tinput[type='checkbox']{\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: auto !important;\n\t\t\t\tborder: .1rem solid #27282D;\n\t\t\t\tborder-radius: .25rem;\n\t\t\t\tmargin: 0.125rem;\n\t\t\t\tresize: none;\n\t\t\t}\n\t\t\tinput[type='checkbox']::placeholder {\n\t\t\t\tcolor: rgb(117, 117, 117);\n\t\t\t}\n\t\t\tfieldset {\n\t\t\t\tborder: none;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\t.field-label {\n\t\t\t\tcolor: #27282d;\n\t\t\t\tfont-size: .75rem;\n\t\t\t\tfont-weight: 600;\n\t\t\t\tword-wrap: break-word;\n\t\t\t}\n\t\t\t.field-input {\n\t\t\t\tfont-size: 0.813rem;\n\t\t\t\tmin-height: 1.438rem;\n\t\t\t}\n\t\t",
4091
4099
  useShadow: true,
4092
4100
  })
4093
4101
  ], CheckBoxElement);
@@ -6246,8 +6254,7 @@ var RadioButtonGroupElement = /** @class */ (function (_super) {
6246
6254
  });
6247
6255
  RadioButtonGroupElement.prototype.connectedCallback = function () {
6248
6256
  _super.prototype.connectedCallback.call(this);
6249
- var firstRadioButton = _super.prototype.getChildElement.call(this, 'input[type="radio"]');
6250
- _super.prototype.addLabel.call(this, firstRadioButton);
6257
+ this.addLegend();
6251
6258
  };
6252
6259
  RadioButtonGroupElement.prototype.initChildInputs = function () {
6253
6260
  var _this = this;
@@ -6267,14 +6274,23 @@ var RadioButtonGroupElement = /** @class */ (function (_super) {
6267
6274
  if (!fieldset) {
6268
6275
  fieldset = document.createElement('fieldset');
6269
6276
  wrapper.appendChild(fieldset);
6270
- if (this.label) {
6271
- fieldset.setAttribute('aria-label', this.label);
6272
- }
6273
6277
  this.options.forEach(function (element, index) {
6274
6278
  fieldset.insertAdjacentHTML('beforeend', StringUtil_1.StringUtil.StringFormat(_this.radioButtonTemplate, _this.name, element, _this.name + "-" + index, "" + (_this.required ? 'required' : '')));
6275
6279
  });
6276
6280
  }
6277
6281
  };
6282
+ RadioButtonGroupElement.prototype.addLegend = function () {
6283
+ var fieldset = this.shadowRoot.querySelector('fieldset');
6284
+ if (this.label) {
6285
+ fieldset.setAttribute('aria-label', this.label);
6286
+ if (!this.hideLabel) {
6287
+ var legend = document.createElement('legend');
6288
+ legend.textContent = this.label;
6289
+ legend.classList.add('field-label');
6290
+ fieldset.insertAdjacentElement('afterbegin', legend);
6291
+ }
6292
+ }
6293
+ };
6278
6294
  // events
6279
6295
  RadioButtonGroupElement.prototype.change = function ($event) {
6280
6296
  this.touched = true;
@@ -6287,8 +6303,8 @@ var RadioButtonGroupElement = /** @class */ (function (_super) {
6287
6303
  RadioButtonGroupElement = __decorate([
6288
6304
  (0, custom_element_decorator_1.default)({
6289
6305
  selector: 'radio-group-element',
6290
- template: "\n\t\t<div class=\"field-label\">\n\t\t</div>\n\t\t<div class=\"field-input\">\n\t\t\t<div class=\"wrapper\">\n\t\t\t</div>\n\t\t</div>",
6291
- style: "\n\t\t:host{\n\t\t\twidth:100%;\n\t\t}\n\t\t.radio-button {\n\t\t\twidth: auto;\n\t\t\tmargin: auto 0.188rem;\n\t\t\tcolor: rgba(72, 72, 72, 0.75);\n\t\t\tfont-size: 0.813rem;\n\t\t\tmargin-top: 0.25rem;\n\t\t}\n\t\t.radio-button:first-of-type {\n\t\t\tmargin-top: 0;\n\t\t}\n\t\tinput{\n\t\t\tbox-sizing: border-box;\n\t\t\twidth: auto !important;\n\t\t\tborder: .1rem solid #27282D;\n\t\t\tborder-radius: .25rem;\n\t\t\tmargin: 0.2rem;\n\t\t\tresize: none;\n\t\t}\n\t\tinput::placeholder {\n\t\t\tcolor: rgb(117, 117, 117);\n\t\t}\n\t\tfieldset {\n\t\t\tborder: none;\n\t\t\tpadding: 0;\n\t\t}\n\t\t.field-label {\n\t\t\tcolor: #27282d;\n\t\t\tfont-size: .75rem;\n\t\t\tfont-weight: 600;\n\t\t\tword-wrap: break-word;\n\t\t}\n\t\t.field-input {\n\t\t\tfont-size: 0.813rem;\n\t\t\tmin-height: 1.438rem;\n\t\t}\n\t",
6306
+ template: "\n\t\t<div class=\"wrapper\">\n\t\t</div>",
6307
+ style: "\n\t\t:host{\n\t\t\twidth:100%;\n\t\t}\n\t\t.radio-button {\n\t\t\twidth: auto;\n\t\t\tmargin: auto 0.188rem;\n\t\t\tcolor: #27282D;\n\t\t\tfont-size: 0.813rem;\n\t\t\tmargin-top: 0.25rem;\n\t\t}\n\t\t.radio-button:first-of-type {\n\t\t\tmargin-top: 0;\n\t\t}\n\t\tinput{\n\t\t\tbox-sizing: border-box;\n\t\t\twidth: auto !important;\n\t\t\tborder: .1rem solid #27282D;\n\t\t\tborder-radius: .25rem;\n\t\t\tmargin: 0.2rem;\n\t\t\tresize: none;\n\t\t}\n\t\tinput::placeholder {\n\t\t\tcolor: rgb(117, 117, 117);\n\t\t}\n\t\tfieldset {\n\t\t\tborder: none;\n\t\t\tpadding: 0;\n\t\t}\n\t\t.field-label {\n\t\t\tcolor: #27282d;\n\t\t\tfont-size: .75rem;\n\t\t\tfont-weight: 600;\n\t\t\tword-wrap: break-word;\n\t\t}\n\t\t.field-input {\n\t\t\tfont-size: 0.813rem;\n\t\t\tmin-height: 1.438rem;\n\t\t}\n\t",
6292
6308
  useShadow: true,
6293
6309
  })
6294
6310
  ], RadioButtonGroupElement);
@@ -6373,10 +6389,10 @@ var ResidentIdentificationElement = /** @class */ (function (_super) {
6373
6389
  });
6374
6390
  };
6375
6391
  ResidentIdentificationElement.prototype.initChildInputs = function () {
6376
- this.company = _super.prototype.getChildInput.call(this, '#company');
6377
- this.property = _super.prototype.getChildInput.call(this, '#property');
6378
- this.tenancy = _super.prototype.getChildInput.call(this, '#tenancy');
6379
- this.tenant = _super.prototype.getChildInput.call(this, '#tenant');
6392
+ this.company = _super.prototype.getChildInput.call(this, '.company');
6393
+ this.property = _super.prototype.getChildInput.call(this, '.property');
6394
+ this.tenancy = _super.prototype.getChildInput.call(this, '.tenancy');
6395
+ this.tenant = _super.prototype.getChildInput.call(this, '.tenant');
6380
6396
  this.company.addEventListener('change', this.change.bind(this));
6381
6397
  this.property.addEventListener('change', this.change.bind(this));
6382
6398
  this.tenancy.addEventListener('change', this.change.bind(this));
@@ -6432,7 +6448,7 @@ var ResidentIdentificationElement = /** @class */ (function (_super) {
6432
6448
  ResidentIdentificationElement = __decorate([
6433
6449
  (0, custom_element_decorator_1.default)({
6434
6450
  selector: 'resident-identification-element',
6435
- template: "\n\t\t<div class=\"field-label\">\n\t\t</div>\n\t\t<div class=\"field-input\">\n\t\t\t<div class=\"field-wrapper\">\n\t\t\t\t<input class='field-part' id='company' type=\"text\" placeholder='Company'/>\n\t\t\t\t<input class='field-part' id='property' type=\"text\" placeholder='Property'/>\n\t\t\t\t<input class='field-part' id='tenancy' type=\"text\" placeholder='Tenancy'/>\n\t\t\t\t<input class='field-part' id='tenant' type=\"text\" placeholder='Tenant'/>\n\t\t\t</div>\n\t\t</div>",
6451
+ template: "\n\t\t<div class=\"field-label\">\n\t\t</div>\n\t\t<div class=\"field-input\">\n\t\t\t<div class=\"field-wrapper\">\n\t\t\t\t<input class='field-part company' id='company' type=\"text\" placeholder='Company'/>\n\t\t\t\t<input class='field-part property' id='property' type=\"text\" placeholder='Property'/>\n\t\t\t\t<input class='field-part tenancy' id='tenancy' type=\"text\" placeholder='Tenancy'/>\n\t\t\t\t<input class='field-part tenant' id='tenant' type=\"text\" placeholder='Tenant'/>\n\t\t\t</div>\n\t\t</div>",
6436
6452
  style: "\n\t\t.field-wrapper{\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: nowrap;\n\t\t}\n\t\tinput.field-part{\n\t\t\tbox-sizing: border-box;\n\t\t\tborder: .1rem solid #27282D;\n\t\t\tborder-radius: .25rem;\n\t\t\tmargin: 0.125rem;\n\t\t\tresize: none;\n\t\t\twidth:33% !important;\n\t\t}\n\t\tinput.field-part::placeholder {\n\t\t\tcolor: rgb(117, 117, 117);\n\t\t}\n\t\t.field-label {\n\t\t\tcolor: #27282d;\n\t\t\tfont-size: .75rem;\n\t\t\tfont-weight: 600;\n\t\t\tword-wrap: break-word;\n\t\t}\n\t\t.field-input {\n\t\t\tfont-size: 0.813rem;\n\t\t\tmin-height: 1.438rem;\n\t\t}\n\t",
6437
6453
  templatePath: './html.html',
6438
6454
  useShadow: true,