@saasbase-io/core-elements 1.1.13 → 1.1.14

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/dist/index.js CHANGED
@@ -6010,7 +6010,7 @@ body {
6010
6010
  >
6011
6011
  ${Kv(this.element.properties.text??"")}
6012
6012
  </rtg-field-separator>
6013
- `}};mn([a({type:Object})],exports.SbDividerRenderer.prototype,"element",2);mn([a({attribute:!1})],exports.SbDividerRenderer.prototype,"component",2);exports.SbDividerRenderer=mn([p("sb-divider-renderer")],exports.SbDividerRenderer);var Qv=Object.defineProperty,ty=Object.getOwnPropertyDescriptor,bn=(e,t,o,s)=>{for(var r=s>1?void 0:s?ty(t,o):t,i=e.length-1,n;i>=0;i--)(n=e[i])&&(r=(s?n(t,o,r):n(r))||r);return s&&r&&Qv(t,o,r),r};exports.SbCheckboxRenderer=class extends y{constructor(){super(...arguments),this._handleChange=t=>{if(!this.element.data_key)return;const o=t.target;this.component.handleInputChange(this.element.data_key,o.checked),this.component.handleFocus(this.element.data_key)},this._handleFocus=t=>{this.element.data_key&&this.component.handleFocus(t.detail.dataKey)},this._toggleCheckboxFromLabel=()=>{const t=this.querySelector(`#${this._fieldKey}`);t&&t.click()}}createRenderRoot(){return this}get _fieldKey(){return this.element.data_key||this.element.id}get _checked(){const{data_key:t,properties:o}=this.element;return t?this.component.formData[t]??o.initial_value??!1:o.initial_value||!1}get _errors(){return this.element.data_key?this.component.errors[this.element.data_key]||[]:[]}patchComponentUpdate(){if(!this.component)return;const t=this.component.requestUpdate.bind(this.component);this.component.requestUpdate=(...o)=>{const s=t(...o);return this.requestUpdate(),s}}connectedCallback(){super.connectedCallback(),this.patchComponentUpdate()}_renderLabel(){var s,r,i;const{class:t,style:o}=O("",{},(i=(r=(s=this.component.customizations)==null?void 0:s.byType)==null?void 0:r.labels)==null?void 0:i.checkboxLabel,"",this.component.customizations);return c`
6013
+ `}};mn([a({type:Object})],exports.SbDividerRenderer.prototype,"element",2);mn([a({attribute:!1})],exports.SbDividerRenderer.prototype,"component",2);exports.SbDividerRenderer=mn([p("sb-divider-renderer")],exports.SbDividerRenderer);var Qv=Object.defineProperty,ty=Object.getOwnPropertyDescriptor,bn=(e,t,o,s)=>{for(var r=s>1?void 0:s?ty(t,o):t,i=e.length-1,n;i>=0;i--)(n=e[i])&&(r=(s?n(t,o,r):n(r))||r);return s&&r&&Qv(t,o,r),r};exports.SbCheckboxRenderer=class extends y{constructor(){super(...arguments),this._handleChange=t=>{this.element.data_key&&(this.component.handleInputChange(this.element.data_key,t),this.component.handleFocus(this.element.data_key))},this._handleFocus=()=>{this.element.data_key&&this.component.handleFocus(this.element.data_key)},this._toggleCheckboxFromLabel=()=>{const t=this.querySelector(`#${this._fieldKey}`);t&&t.click()}}createRenderRoot(){return this}get _fieldKey(){return this.element.data_key||this.element.id}get _checked(){const{data_key:t,properties:o}=this.element;return t?this.component.formData[t]??o.initial_value??!1:o.initial_value||!1}get _errors(){return this.element.data_key?this.component.errors[this.element.data_key]||[]:[]}patchComponentUpdate(){if(!this.component)return;const t=this.component.requestUpdate.bind(this.component);this.component.requestUpdate=(...o)=>{const s=t(...o);return this.requestUpdate(),s}}connectedCallback(){super.connectedCallback(),this.patchComponentUpdate()}_renderLabel(){var s,r,i;const{class:t,style:o}=O("",{},(i=(r=(s=this.component.customizations)==null?void 0:s.byType)==null?void 0:r.labels)==null?void 0:i.checkboxLabel,"",this.component.customizations);return c`
6014
6014
  <rtg-field-label
6015
6015
  for=${this._fieldKey}
6016
6016
  class=${t}
@@ -6038,7 +6038,7 @@ body {
6038
6038
  ?checked=${this._checked}
6039
6039
  ?invalid=${this._errors.length>0}
6040
6040
  data-key=${this.element.data_key||""}
6041
- .oncheckedchange=${this._handleChange}
6041
+ .onCheckedChange=${this._handleChange}
6042
6042
  @focus=${this._handleFocus}
6043
6043
  ></rtg-checkbox>
6044
6044
  ${this._renderLabel()}
@@ -6151,7 +6151,7 @@ body {
6151
6151
  class=${V(gf,this.customClass)}
6152
6152
  style=${E(this.customStyle)}
6153
6153
  ></div>
6154
- `}};fn([a({type:String})],exports.LinearLoader.prototype,"customClass",2);fn([a({type:Object})],exports.LinearLoader.prototype,"customStyle",2);exports.LinearLoader=fn([p("linear-loader")],exports.LinearLoader);var uy=Object.defineProperty,hy=Object.getOwnPropertyDescriptor,vn=(e,t,o,s)=>{for(var r=s>1?void 0:s?hy(t,o):t,i=e.length-1,n;i>=0;i--)(n=e[i])&&(r=(s?n(t,o,r):n(r))||r);return s&&r&&uy(t,o,r),r};exports.SbOtpRenderer=class extends y{constructor(){super(...arguments),this._onComplete=t=>{if(!this.element.data_key)return;this.component.handleInputChange(this.element.data_key,t.detail.value);const{event:o}=this.element.properties;o&&this.component.handleEvent(o,this.element)},this._onFocus=t=>{this.element.data_key&&this.component.handleFocus(t.detail.dataKey,this.element.id)},this._onBlur=()=>{this.element.data_key&&this.component.handleBlur(this.element.data_key)}}createRenderRoot(){return this}patchComponentRequestUpdate(){if(!this.component)return;const t=this.component.requestUpdate.bind(this.component);this.component.requestUpdate=(...o)=>{const s=t(...o);return this.requestUpdate(),s}}connectedCallback(){super.connectedCallback(),this.patchComponentRequestUpdate()}_renderOTPContent(){const t=this.element.properties.variant||"digits_only",o=this.element.properties.length||6,s=[];if([...Array(o)].forEach((r,i)=>s.push(c`<rtg-input-otp-slot index=${i}></rtg-input-otp-slot>`)),t==="simple"){const r=Math.ceil(o/2);return c`
6154
+ `}};fn([a({type:String})],exports.LinearLoader.prototype,"customClass",2);fn([a({type:Object})],exports.LinearLoader.prototype,"customStyle",2);exports.LinearLoader=fn([p("linear-loader")],exports.LinearLoader);var uy=Object.defineProperty,hy=Object.getOwnPropertyDescriptor,vn=(e,t,o,s)=>{for(var r=s>1?void 0:s?hy(t,o):t,i=e.length-1,n;i>=0;i--)(n=e[i])&&(r=(s?n(t,o,r):n(r))||r);return s&&r&&uy(t,o,r),r};exports.SbOtpRenderer=class extends y{constructor(){super(...arguments),this._onComplete=t=>{if(!this.element.data_key)return;this.component.handleInputChange(this.element.data_key,t);const{event:o}=this.element.properties;o&&this.component.handleEvent(o,this.element)},this._onFocus=()=>{this.element.data_key&&this.component.handleFocus(this.element.data_key,this.element.id)},this._onBlur=()=>{this.element.data_key&&this.component.handleBlur(this.element.data_key)}}createRenderRoot(){return this}patchComponentRequestUpdate(){if(!this.component)return;const t=this.component.requestUpdate.bind(this.component);this.component.requestUpdate=(...o)=>{const s=t(...o);return this.requestUpdate(),s}}connectedCallback(){super.connectedCallback(),this.patchComponentRequestUpdate()}_renderOTPContent(){const t=this.element.properties.variant||"digits_only",o=this.element.properties.length||6,s=[];if([...Array(o)].forEach((r,i)=>s.push(c`<rtg-input-otp-slot index=${i}></rtg-input-otp-slot>`)),t==="simple"){const r=Math.ceil(o/2);return c`
6155
6155
  <rtg-input-otp-group>${s.slice(0,r)}</rtg-input-otp-group>
6156
6156
  <rtg-input-otp-separator></rtg-input-otp-separator>
6157
6157
  <rtg-input-otp-group>${s.slice(r)}</rtg-input-otp-group>
@@ -6177,9 +6177,9 @@ body {
6177
6177
  data-key=${this.element.data_key||""}
6178
6178
  class=${t}
6179
6179
  style=${E(s)}
6180
- .oncomplete=${this._onComplete}
6181
- .onfocus=${this._onFocus}
6182
- .onblur=${this._onBlur}
6180
+ .onComplete=${this._onComplete}
6181
+ .onFocus=${this._onFocus}
6182
+ .onBlur=${this._onBlur}
6183
6183
  >
6184
6184
  ${this._renderOTPContent()}
6185
6185
  </rtg-input-otp>
@@ -6303,7 +6303,7 @@ body {
6303
6303
  style=${E(s)}
6304
6304
  src=${Zc(i)}
6305
6305
  />
6306
- `}};ks([a({type:Object})],exports.SbLogoRenderer.prototype,"element",2);ks([a({attribute:!1})],exports.SbLogoRenderer.prototype,"component",2);ks([R()],exports.SbLogoRenderer.prototype,"theme",2);exports.SbLogoRenderer=ks([p("sb-logo-renderer")],exports.SbLogoRenderer);var Iy=Object.defineProperty,Py=Object.getOwnPropertyDescriptor,kn=(e,t,o,s)=>{for(var r=s>1?void 0:s?Py(t,o):t,i=e.length-1,n;i>=0;i--)(n=e[i])&&(r=(s?n(t,o,r):n(r))||r);return s&&r&&Iy(t,o,r),r};exports.SbInputRenderer=class extends y{constructor(){super(...arguments),this._onInput=t=>{const o=this.element.data_key;o&&this.component.handleInputChange(o,t.detail.value)},this._onFocus=t=>{this.element.data_key&&this.component.handleFocus(t.detail.dataKey)},this._onBlur=()=>{const t=this.element.data_key;t&&this.component.handleBlur(t)}}createRenderRoot(){return this}get _key(){return this.element.data_key||this.element.id}get _errors(){return this.element.data_key?this.component.errors[this.element.data_key]||[]:[]}get _invalid(){return this._errors.length>0}patchComponentRequestUpdate(){if(!this.component)return;const t=this.component.requestUpdate.bind(this.component);this.component.requestUpdate=(...o)=>{const s=t(...o);return this.requestUpdate(),s}}_initValue(){this.element.data_key&&this.element.properties.initial_value&&this.component.handleInputChange(this.element.data_key,this.element.properties.initial_value)}connectedCallback(){super.connectedCallback(),this.patchComponentRequestUpdate()}updated(t){t.has("element")&&this._initValue()}_renderLabel(){var r,i,n;const{label:t}=this.element.properties;if(!t)return null;const{class:o,style:s}=O("",{},(n=(i=(r=this.component.customizations)==null?void 0:r.byType)==null?void 0:i.inputs)==null?void 0:n.inputLabel,this.element.id,this.component.customizations);return c`
6306
+ `}};ks([a({type:Object})],exports.SbLogoRenderer.prototype,"element",2);ks([a({attribute:!1})],exports.SbLogoRenderer.prototype,"component",2);ks([R()],exports.SbLogoRenderer.prototype,"theme",2);exports.SbLogoRenderer=ks([p("sb-logo-renderer")],exports.SbLogoRenderer);var Iy=Object.defineProperty,Py=Object.getOwnPropertyDescriptor,kn=(e,t,o,s)=>{for(var r=s>1?void 0:s?Py(t,o):t,i=e.length-1,n;i>=0;i--)(n=e[i])&&(r=(s?n(t,o,r):n(r))||r);return s&&r&&Iy(t,o,r),r};exports.SbInputRenderer=class extends y{constructor(){super(...arguments),this._onInput=t=>{const o=this.element.data_key;o&&this.component.handleInputChange(o,t.target.value)},this._onFocus=()=>{this.element.data_key&&this.component.handleFocus(this.element.data_key)},this._onBlur=()=>{const t=this.element.data_key;t&&this.component.handleBlur(t)}}createRenderRoot(){return this}get _key(){return this.element.data_key||this.element.id}get _errors(){return this.element.data_key?this.component.errors[this.element.data_key]||[]:[]}get _invalid(){return this._errors.length>0}patchComponentRequestUpdate(){if(!this.component)return;const t=this.component.requestUpdate.bind(this.component);this.component.requestUpdate=(...o)=>{const s=t(...o);return this.requestUpdate(),s}}_initValue(){this.element.data_key&&this.element.properties.initial_value&&this.component.handleInputChange(this.element.data_key,this.element.properties.initial_value)}connectedCallback(){super.connectedCallback(),this.patchComponentRequestUpdate()}updated(t){t.has("element")&&this._initValue()}_renderLabel(){var r,i,n;const{label:t}=this.element.properties;if(!t)return null;const{class:o,style:s}=O("",{},(n=(i=(r=this.component.customizations)==null?void 0:r.byType)==null?void 0:i.inputs)==null?void 0:n.inputLabel,this.element.id,this.component.customizations);return c`
6307
6307
  <rtg-field-label for=${this._key} class=${o} style=${s}>
6308
6308
  ${t}
6309
6309
  </rtg-field-label>
@@ -6335,9 +6335,9 @@ body {
6335
6335
  data-key=${this.element.data_key||""}
6336
6336
  class=${i}
6337
6337
  style=${n}
6338
- .oninput=${this._onInput}
6339
- .onfocus=${this._onFocus}
6340
- .onblur=${this._onBlur}
6338
+ .onInput=${this._onInput}
6339
+ .onFocus=${this._onFocus}
6340
+ .onBlur=${this._onBlur}
6341
6341
  ></rtg-input>
6342
6342
  ${this._invalid?this._renderError():this._renderHint()}
6343
6343
  </rtg-field>