@genesislcap/design-system-configurator 15.58.1 → 15.58.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.
@@ -722,7 +722,7 @@
722
722
  categorization-wrapper .tab-panel-control {
723
723
  margin-top: 10px;
724
724
  }
725
- `;let Z=class extends p.FASTElement{constructor(){super(...arguments),this.mountedTabs=new Set([0]),this.activeTabIndex=0,this.hasAppliedActiveCategory=!1,this.cachedErrorScopes=[]}controlChanged(){var e,t;if(!this.control||this.hasAppliedActiveCategory)return;const{uischema:o}=this.control,a=null===(e=null==o?void 0:o.options)||void 0===e?void 0:e.activeCategory;void 0!==a&&(this.hasAppliedActiveCategory=!0,this.activeTabIndex=function(e,t){return"number"==typeof e&&e>=0&&e<t.length?e:0}(a,null!==(t=null==o?void 0:o.elements)&&void 0!==t?t:[]),this.mountedTabs=new Set([this.activeTabIndex]))}isMounted(e){return this.mountedTabs.has(e)}handleTabChange(e){if(e.target!==e.currentTarget)return;const t=e.target.currentTabIndex;this.activeTabIndex=t,this.mountedTabs.has(t)||(this.mountedTabs=new Set(this.mountedTabs).add(t))}hasCategoryError(e){var t,o,a,r;const i=null===(o=null===(t=this.control)||void 0===t?void 0:t.uischema)||void 0===o?void 0:o.elements;if(!i)return!1;const n=this.getErrorScopes(null===(r=null===(a=this.form)||void 0===a?void 0:a.jsonforms)||void 0===r?void 0:r.core);return 0!==n.length&&W(i[e],n)}getErrorScopes(e){const t=null==e?void 0:e.errors,o=null==e?void 0:e.additionalErrors;return t===this.lastErrors&&o===this.lastAdditionalErrors||(this.lastErrors=t,this.lastAdditionalErrors=o,this.cachedErrorScopes=function(e){var t;const o=new Set;for(const a of e)if("required"===a.keyword&&(null===(t=a.params)||void 0===t?void 0:t.missingProperty)){const e=`#${a.instancePath?a.instancePath.replace(/\//g,"/properties/"):""}/properties/${a.params.missingProperty}`;o.add(e)}else if(a.instancePath){const e=`#${a.instancePath.replace(/\//g,"/properties/")}`;o.add(e)}return Array.from(o)}([...null!=t?t:[],...null!=o?o:[]])),this.cachedErrorScopes}};(0,i.Cg)([p.observable],Z.prototype,"form",void 0),(0,i.Cg)([p.observable],Z.prototype,"control",void 0),(0,i.Cg)([p.observable],Z.prototype,"mountedTabs",void 0),(0,i.Cg)([p.observable],Z.prototype,"activeTabIndex",void 0),Z=(0,i.Cg)([(0,p.customElement)({name:"categorization-wrapper",styles:J,shadowOptions:null,template:p.html`
725
+ `;let Z=class extends p.FASTElement{constructor(){super(...arguments),this.mountedTabs=new Set([0]),this.activeTabIndex=0,this.touchedTabs=new Set,this.hasAppliedActiveCategory=!1,this.cachedErrorScopes=[]}controlChanged(){var e,t;if(!this.control||this.hasAppliedActiveCategory)return;const{uischema:o}=this.control,a=null===(e=null==o?void 0:o.options)||void 0===e?void 0:e.activeCategory;void 0!==a&&(this.hasAppliedActiveCategory=!0,this.activeTabIndex=function(e,t){return"number"==typeof e&&e>=0&&e<t.length?e:0}(a,null!==(t=null==o?void 0:o.elements)&&void 0!==t?t:[]),this.mountedTabs=new Set([this.activeTabIndex]))}connectedCallback(){super.connectedCallback();const e=p.Observable.binding(e=>{var t;return null===(t=e.form)||void 0===t?void 0:t.submitted},{handleChange:()=>{e.observe(this,p.defaultExecutionContext)||(this.touchedTabs=new Set)}});this.submittedObserver=e,e.observe(this,p.defaultExecutionContext)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this.submittedObserver)||void 0===e||e.disconnect(),this.submittedObserver=void 0}markTabTouched(e){this.touchedTabs.has(e)||(this.touchedTabs=new Set(this.touchedTabs).add(e))}isMounted(e){return this.mountedTabs.has(e)}handleTabChange(e){if(e.target!==e.currentTarget)return;const t=e.target.currentTabIndex;this.activeTabIndex=t,this.mountedTabs.has(t)||(this.mountedTabs=new Set(this.mountedTabs).add(t))}hasCategoryError(e){var t,o,a,r,i;if(!(null===(t=this.form)||void 0===t?void 0:t.submitted)&&!this.touchedTabs.has(e))return!1;const n=null===(a=null===(o=this.control)||void 0===o?void 0:o.uischema)||void 0===a?void 0:a.elements;if(!n)return!1;const s=this.getErrorScopes(null===(i=null===(r=this.form)||void 0===r?void 0:r.jsonforms)||void 0===i?void 0:i.core);return 0!==s.length&&W(n[e],s)}getErrorScopes(e){const t=null==e?void 0:e.errors,o=null==e?void 0:e.additionalErrors;return t===this.lastErrors&&o===this.lastAdditionalErrors||(this.lastErrors=t,this.lastAdditionalErrors=o,this.cachedErrorScopes=function(e){var t;const o=new Set;for(const a of e)if("required"===a.keyword&&(null===(t=a.params)||void 0===t?void 0:t.missingProperty)){const e=`#${a.instancePath?a.instancePath.replace(/\//g,"/properties/"):""}/properties/${a.params.missingProperty}`;o.add(e)}else if(a.instancePath){const e=`#${a.instancePath.replace(/\//g,"/properties/")}`;o.add(e)}return Array.from(o)}([...null!=t?t:[],...null!=o?o:[]])),this.cachedErrorScopes}};(0,i.Cg)([p.observable],Z.prototype,"form",void 0),(0,i.Cg)([p.observable],Z.prototype,"control",void 0),(0,i.Cg)([p.observable],Z.prototype,"mountedTabs",void 0),(0,i.Cg)([p.observable],Z.prototype,"activeTabIndex",void 0),(0,i.Cg)([p.observable],Z.prototype,"touchedTabs",void 0),Z=(0,i.Cg)([(0,p.customElement)({name:"categorization-wrapper",styles:J,shadowOptions:null,template:p.html`
726
726
  ${e=>((e="zero")=>p.html`
727
727
  <template>
728
728
  <${e}-tabs appearance="secondary" class="tabs-container" :activeid="${e=>"tab-"+e.activeTabIndex}" @change=${(e,t)=>e.handleTabChange(t.event)}>
@@ -739,7 +739,10 @@
739
739
  </${e}-tab>
740
740
  `,{positioning:!0})}
741
741
  ${(0,p.repeat)(e=>e.control.uischema.elements,p.html`
742
- <${e}-tab-panel class="tab-panel-control">
742
+ <${e}-tab-panel
743
+ class="tab-panel-control"
744
+ @focusout=${(e,t)=>(t.parent.markTabTouched(t.index),!0)}
745
+ >
743
746
  ${(0,p.when)((e,t)=>t.parent.isMounted(t.index),p.html`
744
747
  ${(0,p.repeat)(e=>e.options.childElements,p.html`
745
748
  <dispatch-renderer
@@ -883,6 +886,7 @@
883
886
  `,{positioning:!0})}
884
887
  ${(0,p.repeat)(e=>e.control.uischema.elements,p.html`
885
888
  <${e}-tab-panel
889
+ @focusout=${(e,t)=>(t.parent.markTabTouched(t.index),!0)}
886
890
  class="${(e,t)=>{var o,a,r;const i=q(e,null===(r=null===(a=null===(o=t.parent.form)||void 0===o?void 0:o.jsonforms)||void 0===a?void 0:a.core)||void 0===r?void 0:r.data);return(0,h.x)("tab-panel-control",[i,!!i])}}"
887
891
  >
888
892
  ${(0,p.when)((e,t)=>t.parent.isMounted(t.index),p.html`
@@ -5757,4 +5761,4 @@
5757
5761
  </rapid-tabs>
5758
5762
  </template>
5759
5763
  `;let xp=class extends p.FASTElement{};xp=(0,i.Cg)([(0,p.customElement)({name:"design-system-preview",template:yp,styles:rp})],xp),((e,t="zero")=>(0,ce.provideDesignSystem)(e,t,r,a))().register(rd,yc),(0,wc.provideDesignSystem)().register(wc.baseComponents,Sc.rapidGridComponents,Uo)}}]);
5760
- //# sourceMappingURL=15.6c7ebecf1e2de2ab4add3fa2723f7818.js.map
5764
+ //# sourceMappingURL=15.d6c0296e8f90736f4f4e7fc1d512f883.js.map