lituix 0.1.2 → 0.1.4

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.mjs CHANGED
@@ -3306,7 +3306,7 @@ var L2=Object.create;var ms=Object.defineProperty;var nh=Object.getOwnPropertyDe
3306
3306
  padding: 0 38px 0 14px;
3307
3307
  font-size: var(--lui-font-size);
3308
3308
  }
3309
- `],a([Ee({reflect:!0})],pe.prototype,"value",2),a([Ee({attribute:!1})],pe.prototype,"source",2),a([Ee({reflect:!0,attribute:"label-key"})],pe.prototype,"labelKey",2),a([Ee({reflect:!0,attribute:"value-key"})],pe.prototype,"valueKey",2),a([Ee({reflect:!0,attribute:"disabled-key"})],pe.prototype,"disabledKey",2),a([Ee({reflect:!0,attribute:"group-key"})],pe.prototype,"groupKey",2),a([Ee({attribute:!1})],pe.prototype,"renderOption",2),a([Ee({attribute:!1})],pe.prototype,"renderTag",2),a([Ee({type:Boolean,attribute:"virtualized",reflect:!0})],pe.prototype,"virtualized",2),a([Ee({type:Number,attribute:"virtual-threshold"})],pe.prototype,"virtualThreshold",2),a([Ee({reflect:!0})],pe.prototype,"placeholder",2),a([Ee({type:Boolean,reflect:!0})],pe.prototype,"disabled",2),a([Ee({type:Boolean,reflect:!0})],pe.prototype,"noborder",2),a([Ee({type:Boolean,reflect:!0})],pe.prototype,"multiple",2),a([Ee({type:Boolean,reflect:!0})],pe.prototype,"searchable",2),a([Ee({type:Boolean,reflect:!0})],pe.prototype,"clearable",2),a([Ee({reflect:!0,attribute:"search-placeholder"})],pe.prototype,"searchPlaceholder",2),a([Ee({reflect:!0,attribute:"empty-text"})],pe.prototype,"emptyText",2),a([Ee({type:Boolean,reflect:!0})],pe.prototype,"open",2),a([Ee({reflect:!0})],pe.prototype,"placement",2),a([Ee({reflect:!0})],pe.prototype,"size",2),a([Ee({type:Boolean,attribute:"close-on-select"})],pe.prototype,"closeOnSelect",2),a([Ee({reflect:!0,attribute:"multiple-display"})],pe.prototype,"multipleDisplay",2),a([Ee()],pe.prototype,"locale",2),a([Ee({attribute:!1})],pe.prototype,"translations",2),a([Ee({attribute:"max-tag-count",converter:{fromAttribute(e){if(e==null||e==="")return;if(e==="responsive"||e==="auto")return e;let t=Number(e);return Number.isFinite(t)?t:void 0},toAttribute(e){return e==null?null:String(e)}}})],pe.prototype,"maxTagCount",2),a([Ee({attribute:!1})],pe.prototype,"values",2),a([Gs()],pe.prototype,"_displayLabel",2),a([Gs()],pe.prototype,"_currentOptionValue",2),a([Gs()],pe.prototype,"_searchKeyword",2),a([Gs()],pe.prototype,"_responsiveMaxTagCount",2),a([Us('[part~="trigger"]')],pe.prototype,"_triggerNode",2),a([Us('[part="value-wrap"]')],pe.prototype,"_valueWrapNode",2),a([Us('[part~="panel"]')],pe.prototype,"_panelNode",2),a([Us('[part="search-input"]')],pe.prototype,"_searchInputNode",2),pe=a([Rc("lui-select")],pe);var Re=class extends Vf{constructor(){super(...arguments);this.current=1;this.total=0;this.pageSize=10;this.maxVisible=7;this.size="md";this.showSummary=!1;this.showTotal=!1;this.showJumper=!1;this.showSizeChanger=!1;this.showFirstLast=!1;this.hideOnSinglePage=!1;this.simple=!1;this.compact=!1;this.responsive=!1;this.pageSizeOptions=[10,20,50,100];this.selectProps={};this._jumperValue="";this._responsiveMode="normal";this._layoutFrame=0;this._indicatorFrame=0;this._explicitAttrs=new Set;this._onJumperInput=e=>{e.stopPropagation(),this._jumperValue=e.target.value};this._onPageSizeChange=e=>{e.stopPropagation(),this._setPageSize(Number(e.detail?.value))};this._commitJumper=()=>{let e=Number(this._jumperValue);Number.isFinite(e)&&(this._setPage(e,"jumper"),this._jumperValue="")};this._onJumperKeydown=e=>{e.key==="Enter"&&(e.preventDefault(),this._commitJumper())}}willUpdate(e){let t=F(this,"pagination");this._explicitAttrs.size||(this._explicitAttrs=new Set(this.getAttributeNames())),!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("compact")&&typeof t.compact=="boolean"&&this.compact!==t.compact&&(this.compact=t.compact)}updated(e){let t=F(this,"pagination");re(this._sizeSelect,{...t.selectProps??{},...this.selectProps??{}}),this.parentElement&&this.parentElement!==this._observedParent&&(this._observedParent&&this._resizeObserver?.unobserve(this._observedParent),this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement)),(e.has("responsive")||e.has("size")||e.has("showTotal")||e.has("showSummary")||e.has("showJumper")||e.has("showSizeChanger")||e.has("showFirstLast")||e.has("simple")||e.has("compact")||e.has("current")||e.has("total")||e.has("pageSize")||e.has("maxVisible"))&&this._scheduleResponsiveLayout(),this._schedulePageIndicatorLayout()}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._disposeLocaleChange=ke(()=>this.requestUpdate()),this._resizeObserver=new ResizeObserver(()=>this._scheduleResponsiveLayout())}firstUpdated(){this._resizeObserver?.observe(this),this.parentElement&&(this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement)),this._scheduleResponsiveLayout()}disconnectedCallback(){super.disconnectedCallback(),this._disposeLocaleChange?.(),this._resizeObserver?.disconnect(),this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame)}_t(e,t,r){let n=Fe(this,this.locale,this.translations);return ie(oe(n.locale,n.translations),e,t,r)}get _pageSize(){let e=Number(this.pageSize);return Number.isFinite(e)&&e>0?Math.floor(e):10}get _pageCount(){let e=Number(this.total);return Math.max(1,Math.ceil((Number.isFinite(e)?e:0)/this._pageSize))}get _current(){let e=Number(this.current);return Math.min(this._pageCount,Math.max(1,Number.isFinite(e)?Math.floor(e):1))}_scheduleResponsiveLayout(){this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame),this._layoutFrame=requestAnimationFrame(()=>{this._layoutFrame=0,this._updateResponsiveMode(),this._schedulePageIndicatorLayout()})}_schedulePageIndicatorLayout(){this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame),this._indicatorFrame=requestAnimationFrame(()=>{this._indicatorFrame=0,this._updatePageIndicator()})}_updatePageIndicator(){let e=this._pagerNode;if(!e||this._effectiveSimple){e?.style.setProperty("--lui-pagination-indicator-opacity","0");return}let t=e.querySelector(`button.page[data-page="${this._current}"]`);if(!t){e.style.setProperty("--lui-pagination-indicator-opacity","0");return}let r=e.getBoundingClientRect(),n=t.getBoundingClientRect();e.style.setProperty("--lui-pagination-indicator-x",`${n.left-r.left+e.scrollLeft}px`),e.style.setProperty("--lui-pagination-indicator-y",`${n.top-r.top+e.scrollTop}px`),e.style.setProperty("--lui-pagination-indicator-width",`${n.width}px`),e.style.setProperty("--lui-pagination-indicator-height",`${n.height}px`),e.style.setProperty("--lui-pagination-indicator-opacity","1")}_getResponsiveAvailableWidth(){let e=Math.floor(this.clientWidth||this.getBoundingClientRect().width||0);if(e>0)return e;let t=this.parentElement;return t?Math.floor(t.clientWidth||t.getBoundingClientRect().width||0):0}_updateResponsiveMode(){if(!this.responsive){this._responsiveMode!=="normal"&&(this._responsiveMode="normal"),this.dataset.responsiveMode="normal";return}let e=Math.floor(this._getResponsiveAvailableWidth()),t=e>0&&e<360?"simple":e>0&&e<860?"compact":"normal";this.dataset.responsiveMode=t,t!==this._responsiveMode&&(this._responsiveMode=t)}get _effectiveSimple(){return this.simple||this.responsive&&this._responsiveMode==="simple"}get _effectiveMaxVisible(){return this.responsive?this._responsiveMode==="simple"?1:this._responsiveMode==="compact"?Math.min(this.maxVisible||5,5):this.maxVisible:this.maxVisible}get _showAuxiliaryControls(){return!this.responsive||this._responsiveMode==="normal"}get _showCompactSizeChanger(){return!this.responsive||this._responsiveMode==="normal"}get _normalizedPageSizeOptions(){let e=new Set,t=r=>{let n=Number(r);Number.isFinite(n)&&n>0&&e.add(Math.floor(n))};return this.pageSizeOptions.forEach(t),t(this._pageSize),[...e].sort((r,n)=>r-n)}_emitChange(e,t){this.dispatchEvent(new CustomEvent("change",{detail:{page:e,current:e,pageSize:this._pageSize,total:Number.isFinite(Number(this.total))?Number(this.total):0,pageCount:this._pageCount,action:t},bubbles:!0,composed:!0}))}_setPage(e,t){let r=Math.min(this._pageCount,Math.max(1,e));r!==this._current&&(this.current=r,this._emitChange(r,t))}_setPageSize(e){if(!Number.isFinite(e))return;let t=Math.max(1,Math.floor(e));if(t===this.pageSize)return;let r=(this._current-1)*this._pageSize;this.pageSize=t;let n=Math.floor(r/t)+1;this.current=Math.min(Math.max(1,n),Math.max(1,Math.ceil(this.total/t))),this._emitChange(this.current,"page-size")}_buildPages(e=this.maxVisible){let t=this._pageCount,r=this._current,n=Math.max(5,e||7);if(t<=n)return Array.from({length:t},(f,x)=>x+1);let s=[1],d=n-2,h=Math.max(2,r-Math.floor(d/2)),p=h+d-1;p>=t&&(p=t-1,h=p-d+1),h>2&&s.push("ellipsis");for(let f=h;f<=p;f+=1)s.push(f);return p<t-1&&s.push("ellipsis"),s.push(t),s}_renderPager(){let e=this._current,t=this._pageCount,r=this._effectiveSimple,n=this.showFirstLast&&this._showAuxiliaryControls&&!r;return fo`
3309
+ `],a([Ee({reflect:!0})],pe.prototype,"value",2),a([Ee({attribute:!1})],pe.prototype,"source",2),a([Ee({reflect:!0,attribute:"label-key"})],pe.prototype,"labelKey",2),a([Ee({reflect:!0,attribute:"value-key"})],pe.prototype,"valueKey",2),a([Ee({reflect:!0,attribute:"disabled-key"})],pe.prototype,"disabledKey",2),a([Ee({reflect:!0,attribute:"group-key"})],pe.prototype,"groupKey",2),a([Ee({attribute:!1})],pe.prototype,"renderOption",2),a([Ee({attribute:!1})],pe.prototype,"renderTag",2),a([Ee({type:Boolean,attribute:"virtualized",reflect:!0})],pe.prototype,"virtualized",2),a([Ee({type:Number,attribute:"virtual-threshold"})],pe.prototype,"virtualThreshold",2),a([Ee({reflect:!0})],pe.prototype,"placeholder",2),a([Ee({type:Boolean,reflect:!0})],pe.prototype,"disabled",2),a([Ee({type:Boolean,reflect:!0})],pe.prototype,"noborder",2),a([Ee({type:Boolean,reflect:!0})],pe.prototype,"multiple",2),a([Ee({type:Boolean,reflect:!0})],pe.prototype,"searchable",2),a([Ee({type:Boolean,reflect:!0})],pe.prototype,"clearable",2),a([Ee({reflect:!0,attribute:"search-placeholder"})],pe.prototype,"searchPlaceholder",2),a([Ee({reflect:!0,attribute:"empty-text"})],pe.prototype,"emptyText",2),a([Ee({type:Boolean,reflect:!0})],pe.prototype,"open",2),a([Ee({reflect:!0})],pe.prototype,"placement",2),a([Ee({reflect:!0})],pe.prototype,"size",2),a([Ee({type:Boolean,attribute:"close-on-select"})],pe.prototype,"closeOnSelect",2),a([Ee({reflect:!0,attribute:"multiple-display"})],pe.prototype,"multipleDisplay",2),a([Ee()],pe.prototype,"locale",2),a([Ee({attribute:!1})],pe.prototype,"translations",2),a([Ee({attribute:"max-tag-count",converter:{fromAttribute(e){if(e==null||e==="")return;if(e==="responsive"||e==="auto")return e;let t=Number(e);return Number.isFinite(t)?t:void 0},toAttribute(e){return e==null?null:String(e)}}})],pe.prototype,"maxTagCount",2),a([Ee({attribute:!1})],pe.prototype,"values",2),a([Gs()],pe.prototype,"_displayLabel",2),a([Gs()],pe.prototype,"_currentOptionValue",2),a([Gs()],pe.prototype,"_searchKeyword",2),a([Gs()],pe.prototype,"_responsiveMaxTagCount",2),a([Us('[part~="trigger"]')],pe.prototype,"_triggerNode",2),a([Us('[part="value-wrap"]')],pe.prototype,"_valueWrapNode",2),a([Us('[part~="panel"]')],pe.prototype,"_panelNode",2),a([Us('[part="search-input"]')],pe.prototype,"_searchInputNode",2),pe=a([Rc("lui-select")],pe);var Re=class extends Vf{constructor(){super(...arguments);this.current=1;this.total=0;this.pageSize=10;this.maxVisible=7;this.size="md";this.showSummary=!1;this.showTotal=!1;this.showJumper=!1;this.showSizeChanger=!1;this.showFirstLast=!1;this.hideOnSinglePage=!1;this.simple=!1;this.compact=!1;this.responsive=!1;this.pageSizeOptions=[10,20,50,100];this.selectProps={};this._jumperValue="";this._responsiveMode="normal";this._layoutFrame=0;this._indicatorFrame=0;this._indicatorSettled=!1;this._explicitAttrs=new Set;this._onJumperInput=e=>{e.stopPropagation(),this._jumperValue=e.target.value};this._onPageSizeChange=e=>{e.stopPropagation(),this._setPageSize(Number(e.detail?.value))};this._commitJumper=()=>{let e=Number(this._jumperValue);Number.isFinite(e)&&(this._setPage(e,"jumper"),this._jumperValue="")};this._onJumperKeydown=e=>{e.key==="Enter"&&(e.preventDefault(),this._commitJumper())}}willUpdate(e){let t=F(this,"pagination");this._explicitAttrs.size||(this._explicitAttrs=new Set(this.getAttributeNames())),!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("compact")&&typeof t.compact=="boolean"&&this.compact!==t.compact&&(this.compact=t.compact)}updated(e){let t=F(this,"pagination");re(this._sizeSelect,{...t.selectProps??{},...this.selectProps??{}}),this.parentElement&&this.parentElement!==this._observedParent&&(this._observedParent&&this._resizeObserver?.unobserve(this._observedParent),this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement)),(e.has("responsive")||e.has("size")||e.has("showTotal")||e.has("showSummary")||e.has("showJumper")||e.has("showSizeChanger")||e.has("showFirstLast")||e.has("simple")||e.has("compact")||e.has("current")||e.has("total")||e.has("pageSize")||e.has("maxVisible"))&&this._scheduleResponsiveLayout(),this._schedulePageIndicatorLayout()}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._disposeLocaleChange=ke(()=>this.requestUpdate()),this._resizeObserver=new ResizeObserver(()=>this._scheduleResponsiveLayout())}firstUpdated(){this._resizeObserver?.observe(this),this.parentElement&&(this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement)),this._scheduleResponsiveLayout()}disconnectedCallback(){super.disconnectedCallback(),this._disposeLocaleChange?.(),this._resizeObserver?.disconnect(),this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame)}_t(e,t,r){let n=Fe(this,this.locale,this.translations);return ie(oe(n.locale,n.translations),e,t,r)}get _pageSize(){let e=Number(this.pageSize);return Number.isFinite(e)&&e>0?Math.floor(e):10}get _pageCount(){let e=Number(this.total);return Math.max(1,Math.ceil((Number.isFinite(e)?e:0)/this._pageSize))}get _current(){let e=Number(this.current);return Math.min(this._pageCount,Math.max(1,Number.isFinite(e)?Math.floor(e):1))}_scheduleResponsiveLayout(){this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame),this._layoutFrame=requestAnimationFrame(()=>{this._layoutFrame=0,this._updateResponsiveMode(),this._schedulePageIndicatorLayout()})}_schedulePageIndicatorLayout(){this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame),this._indicatorFrame=requestAnimationFrame(()=>{this._indicatorFrame=0,this._updatePageIndicator()})}_updatePageIndicator(){let e=this._pagerNode;if(!e||this._effectiveSimple){e?.style.setProperty("--lui-pagination-indicator-opacity","0"),this._indicatorSettled=!1;return}let t=e.querySelector(`button.page[data-page="${this._current}"]`);if(!t){e.style.setProperty("--lui-pagination-indicator-opacity","0"),this._indicatorSettled=!1;return}let r=e.getBoundingClientRect(),n=t.getBoundingClientRect(),s=!this._indicatorSettled;s&&e.setAttribute("data-indicator-still",""),e.style.setProperty("--lui-pagination-indicator-x",`${n.left-r.left+e.scrollLeft}px`),e.style.setProperty("--lui-pagination-indicator-y",`${n.top-r.top+e.scrollTop}px`),e.style.setProperty("--lui-pagination-indicator-width",`${n.width}px`),e.style.setProperty("--lui-pagination-indicator-height",`${n.height}px`),e.style.setProperty("--lui-pagination-indicator-opacity","1"),s?requestAnimationFrame(()=>{e.removeAttribute("data-indicator-still"),this._indicatorSettled=!0}):this._indicatorSettled=!0}_getResponsiveAvailableWidth(){let e=Math.floor(this.clientWidth||this.getBoundingClientRect().width||0);if(e>0)return e;let t=this.parentElement;return t?Math.floor(t.clientWidth||t.getBoundingClientRect().width||0):0}_updateResponsiveMode(){if(!this.responsive){this._responsiveMode!=="normal"&&(this._responsiveMode="normal"),this.dataset.responsiveMode="normal";return}let e=Math.floor(this._getResponsiveAvailableWidth()),t=e>0&&e<360?"simple":e>0&&e<860?"compact":"normal";this.dataset.responsiveMode=t,t!==this._responsiveMode&&(this._responsiveMode=t,this._indicatorSettled=!1)}get _effectiveSimple(){return this.simple||this.responsive&&this._responsiveMode==="simple"}get _effectiveMaxVisible(){return this.responsive?this._responsiveMode==="simple"?1:this._responsiveMode==="compact"?Math.min(this.maxVisible||5,5):this.maxVisible:this.maxVisible}get _showAuxiliaryControls(){return!this.responsive||this._responsiveMode==="normal"}get _showCompactSizeChanger(){return!this.responsive||this._responsiveMode==="normal"}get _normalizedPageSizeOptions(){let e=new Set,t=r=>{let n=Number(r);Number.isFinite(n)&&n>0&&e.add(Math.floor(n))};return this.pageSizeOptions.forEach(t),t(this._pageSize),[...e].sort((r,n)=>r-n)}_emitChange(e,t){this.dispatchEvent(new CustomEvent("change",{detail:{page:e,current:e,pageSize:this._pageSize,total:Number.isFinite(Number(this.total))?Number(this.total):0,pageCount:this._pageCount,action:t},bubbles:!0,composed:!0}))}_setPage(e,t){let r=Math.min(this._pageCount,Math.max(1,e));r!==this._current&&(this.current=r,this._emitChange(r,t))}_setPageSize(e){if(!Number.isFinite(e))return;let t=Math.max(1,Math.floor(e));if(t===this.pageSize)return;let r=(this._current-1)*this._pageSize;this.pageSize=t;let n=Math.floor(r/t)+1;this.current=Math.min(Math.max(1,n),Math.max(1,Math.ceil(this.total/t))),this._emitChange(this.current,"page-size")}_buildPages(e=this.maxVisible){let t=this._pageCount,r=this._current,n=Math.max(5,e||7);if(t<=n)return Array.from({length:t},(f,x)=>x+1);let s=[1],d=n-2,h=Math.max(2,r-Math.floor(d/2)),p=h+d-1;p>=t&&(p=t-1,h=p-d+1),h>2&&s.push("ellipsis");for(let f=h;f<=p;f+=1)s.push(f);return p<t-1&&s.push("ellipsis"),s.push(t),s}_renderPager(){let e=this._current,t=this._pageCount,r=this._effectiveSimple,n=this.showFirstLast&&this._showAuxiliaryControls&&!r;return fo`
3310
3310
  <div class="pager" part="pager" aria-label=${this._t("pagination.label","Pagination")}>
3311
3311
  <span class="page-indicator" part="page-indicator" aria-hidden="true"></span>
3312
3312
  ${n?fo`
@@ -3530,6 +3530,9 @@ var L2=Object.create;var ms=Object.defineProperty;var nh=Object.getOwnPropertyDe
3530
3530
  will-change: transform, width, height;
3531
3531
  z-index: 0;
3532
3532
  }
3533
+ [data-indicator-still] .page-indicator {
3534
+ transition: none;
3535
+ }
3533
3536
  .ellipsis {
3534
3537
  color: var(--lui-color-fg-subtle);
3535
3538
  padding: 0 2px;
@@ -11401,7 +11404,7 @@ var L2=Object.create;var ms=Object.defineProperty;var nh=Object.getOwnPropertyDe
11401
11404
  --lui-form-item-control-height: var(--lui-control-height-lg, 44px);
11402
11405
  --lui-form-item-gap: 6px;
11403
11406
  }
11404
- `],a([Ur()],At.prototype,"label",2),a([Ur({type:Boolean})],At.prototype,"required",2),a([Ur()],At.prototype,"description",2),a([Ur()],At.prototype,"help",2),a([Ur()],At.prototype,"extra",2),a([Ur()],At.prototype,"tooltip",2),a([Ur({attribute:!1})],At.prototype,"errors",2),a([Ur({type:Boolean,reflect:!0})],At.prototype,"invalid",2),a([Ur({type:Boolean,attribute:"hidden-label"})],At.prototype,"hiddenLabel",2),a([Ur({type:Boolean,reflect:!0})],At.prototype,"inline",2),a([Ur({reflect:!0})],At.prototype,"size",2),a([Ur({reflect:!0,attribute:"label-placement"})],At.prototype,"labelPlacement",2),a([Ur({attribute:"label-width"})],At.prototype,"labelWidth",2),At=a([by("lui-form-item")],At);function Rd(i,o){if(!i||!o)return;let e=i;for(let[t,r]of Object.entries(o))r!=null&&(t==="style"&&typeof r=="string"?i.setAttribute("style",r):typeof r=="boolean"?r?i.setAttribute(t,""):i.removeAttribute(t):e[t]=r)}var Ka=new Map;function Ey(i,o){return Ka.set(i,o),()=>{Ka.get(i)===o&&Ka.delete(i)}}function Sy(i){Ka.delete(i)}function Id(i){let o={};for(let e of i)e.type==="group"&&e.fields?Object.assign(o,Id(e.fields)):e.type==="array"?o[e.name]=e.defaultValue!==void 0?e.defaultValue:[]:o[e.name]=e.defaultValue!==void 0?e.defaultValue:e.type==="switch"||e.type==="checkbox"?!1:e.type==="checkbox-group"?[]:e.type==="number"||e.type==="slider"?0:(e.type==="date"||e.type==="time"||e.type==="datetime","");return o}function fl(i,o){return o.split(/[.[\]]/).filter(Boolean).reduce((e,t)=>e?.[t],i)}function $y(i,o){if(!i)return{visible:!0,disabled:!1,required:!1};let e=Array.isArray(i.when)?i.when:[i.when],t=!1;for(let n of e){let s=fl(o,n);if(i.is!==void 0?t=s===i.is:i.isNot!==void 0?t=s!==i.isNot:i.contains!==void 0?t=Array.isArray(s)&&s.includes(i.contains):i.pattern!==void 0?t=new RegExp(i.pattern).test(String(s??"")):t=!!s,t)break}let r=t?i.then??{visible:!0}:i.else??{visible:!1};return{visible:r.visible??!0,disabled:r.disabled??!1,required:r.required??!1}}function Ty(i){let e={...i.validators??{}};i.validator&&(e.onSubmit=e.onSubmit??i.validator);let t=r=>{if(r!=null)return Cy(r)?n=>zy.validate({value:n.value,validationSource:"field"},r)??void 0:r};return e.onChange=t(e.onChange),e.onSubmit=t(e.onSubmit),Object.keys(e).length?e:void 0}function tn(i,o={}){if(i==null)return[];if(typeof i=="string")return i?[i]:[];if(typeof i=="number"||typeof i=="boolean")return[String(i)];if(i instanceof Error)return i.message?[i.message]:[String(i)];if(Array.isArray(i))return Array.from(new Set(i.flatMap(e=>tn(e,o))));if(typeof i=="object"){let e=i,t=[];return typeof e.message=="string"&&e.message&&t.push(e.message),"form"in e&&t.push(...tn(e.form,o)),o.includeFieldErrors&&"fields"in e&&t.push(...tn(e.fields,o)),Array.from(new Set(t))}return[]}function qn(i){return i==null||i===!1?!1:typeof i=="string"?i.length>0:typeof i=="number"||typeof i=="boolean"||i instanceof Error?!0:Array.isArray(i)?i.some(qn):typeof i=="object"?Object.values(i).some(qn):!1}function Ay(i,o){let e=i.successMessage;return typeof e=="function"?e(o):e??"\u63D0\u4EA4\u6210\u529F"}var de,kt=class extends yy{constructor(){super(...arguments);this.schema=null;this.showActions=!0;this.size="md";this.labelPlacement="top";this.labelWidth="120px";this._currentStep=0;this._isStepPending=!1;this._submitErrorMessages=[];this._submitSuccessMessage="";lh(this,de);this._explicitAttrs=new Set;this._collapsedArrayItems=new Set;this._initializedSchema=null}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._ensureControllerInitialized()}submit(){this._ensureControllerInitialized(),this._submitForm()}_dispatchValidate(e){ve(this,de)&&this.dispatchEvent(new CustomEvent("validate",{detail:{valid:e,errors:ve(this,de).api.getAllErrors(),values:this.getValues()},bubbles:!0,composed:!0}))}getValues(){return this._ensureControllerInitialized(),{...ve(this,de)?.api.state.values??{}}}setValues(e,t={}){if(this._ensureControllerInitialized(),!!ve(this,de)){for(let[r,n]of Object.entries(e))ve(this,de).api.setFieldValue(r,n,{dontUpdateMeta:!t.touch});this._emitFormChange("setValues",void 0,void 0,this.getValues())}}getValue(e){return fl(this.getValues(),e)}setValue(e,t,r={}){this._ensureControllerInitialized(),ve(this,de)&&(ve(this,de).api.setFieldValue(e,t,{dontUpdateMeta:!r.touch}),this._emitFormChange("setValue",e,t,this.getValues()))}async validate(){if(this._ensureControllerInitialized(),!ve(this,de)||!this.schema)return!0;this._clearSubmissionFeedback();let e=this.schema.steps?this.schema.steps.flatMap(d=>d.fields):this.schema.fields??[],t=Array.from(new Set(this._collectVisibleFieldNames(e)));this._markFieldsTouched(t);let r=await Promise.all(t.map(d=>ve(this,de).api.validateField(d,"submit"))),n=await ve(this,de).api.validate("submit"),s=!r.some(qn)&&!this._hasFieldErrors(t)&&!qn(n)&&this._getFormErrorMessages(ve(this,de)).length===0;return this._dispatchValidate(s),this.requestUpdate(),s}clearValidate(e){if(this._ensureControllerInitialized(),!ve(this,de)||!this.schema)return;this._clearSubmissionFeedback();let t=this.schema.steps?this.schema.steps.flatMap(n=>n.fields):this.schema.fields??[],r=e?.length?e:Array.from(new Set(this._collectVisibleFieldNames(t)));for(let n of r)ve(this,de).api.setFieldMeta(n,s=>({...s,isValidating:!1,isTouched:!1,isBlurred:!1,isValid:!0,errors:[],errorMap:{},errorSourceMap:{}}));this.requestUpdate()}_clearSubmissionFeedback(){(this._submitErrorMessages.length||this._submitSuccessMessage)&&(this._submitErrorMessages=[],this._submitSuccessMessage="")}async _submitForm(){if(!ve(this,de)||!this.schema)return;if(this._clearSubmissionFeedback(),!await this.validate()){this._scrollToFirstError(),this.requestUpdate();return}await ve(this,de).api.handleSubmit(),this.requestUpdate()}reset(e){this._ensureControllerInitialized(),this._clearSubmissionFeedback(),ve(this,de)?.api.reset(e),this._collapsedArrayItems.clear(),this._emitFormChange("reset",void 0,void 0,ve(this,de)?.api.state.values??{})}_emitFormChange(e,t,r,n=this.getValues()){this.dispatchEvent(new CustomEvent("change",{detail:{reason:e,name:t,value:r,values:n},bubbles:!0,composed:!0}))}_emitFieldChange(e,t,r){let n=this.getValues();this._emitFormChange("field",e.name,t,n)}focusField(e){let r=this._fieldElement(e)?.querySelector("lui-input,lui-textarea,lui-select,lui-input-number,lui-datepicker,lui-color-picker,lui-input-opt,lui-checkbox,lui-switch,lui-radio,button,input,textarea,select");return r?.focus?.(),!!r}scrollToField(e,t={block:"center",behavior:"smooth"}){let r=this._fieldElement(e);return r?.scrollIntoView(t),!!r}_fieldElement(e){return this.renderRoot.querySelector(`[data-field-name="${CSS.escape(e)}"]`)}_findFieldDef(e){let t=e.replace(/\[\d+\]/g,""),r=this.schema?.steps?this.schema.steps.flatMap(s=>s.fields):this.schema?.fields??[],n=s=>{for(let d of s){if(d.name===e||d.name===t||t.endsWith(`.${d.name}`))return d;if(d.fields){let h=n(d.fields);if(h)return h}}};return n(r)}_firstErrorFieldName(){if(!ve(this,de)||!this.schema)return;let e=this.schema.steps?this.schema.steps.flatMap(r=>r.fields):this.schema.fields??[];return Array.from(new Set(this._collectVisibleFieldNames(e))).find(r=>(ve(this,de).api.getFieldMeta(r)?.errors?.length??0)>0)}_scrollToFirstError(){let e=this._firstErrorFieldName();e&&requestAnimationFrame(()=>{this.scrollToField(e),this.focusField(e)})}_effectiveSize(e){return e?.size??this.schema?.size??this.size}_effectiveLabelPlacement(e){return e?.labelPlacement??this.schema?.labelPlacement??this.labelPlacement}_normalizedLabelPlacement(e){let t=this._effectiveLabelPlacement(e);return t==="left"||t==="horizontal"?"left":"top"}_effectiveLabelWidth(e){return pt(e?.labelWidth??this.schema?.labelWidth??this.labelWidth)||"120px"}_effectiveValidateTrigger(e){return e?.validateTrigger??this.schema?.validateTrigger??"change"}_fieldClass(e){return`field ${this._normalizedLabelPlacement(e)}`}_fieldStyle(e){return`--lui-form-label-width:${this._effectiveLabelWidth(e)}`}willUpdate(){this._ensureControllerInitialized();let e=F(this,"form");!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("label-placement")&&typeof e.labelPlacement=="string"&&this.labelPlacement!==e.labelPlacement&&(this.labelPlacement=e.labelPlacement),!this._explicitAttrs.has("label-width")&&(typeof e.labelWidth=="string"||typeof e.labelWidth=="number")&&this.labelWidth!==e.labelWidth&&(this.labelWidth=e.labelWidth),!this._explicitAttrs.has("show-actions")&&typeof e.showActions=="boolean"&&this.showActions!==e.showActions&&(this.showActions=e.showActions)}updated(e){super.updated(e),e.has("schema")&&this.schema&&(this._currentStep=0,this._clearSubmissionFeedback(),this._initializedSchema!==this.schema&&(this._initForm(),this.requestUpdate()))}_initForm(){if(!this.schema)return;let e=this.schema.steps?this.schema.steps.flatMap(n=>n.fields):this.schema.fields??[],t={...Id(e),...this.schema.defaultValues},r={...this.schema.validators??{}};this.schema.validator&&(r.onSubmit=r.onSubmit??this.schema.validator),ch(this,de,new My(this,{defaultValues:t,validators:r,validationLogic:this.schema.validationLogic,onSubmit:async({value:n})=>{this._clearSubmissionFeedback(),this.dispatchEvent(new CustomEvent("submit",{detail:{value:n},bubbles:!0,composed:!0}));try{typeof this.schema.onSubmit=="function"&&await this.schema.onSubmit(n),this._submitSuccessMessage=Ay(this.schema,n)}catch(s){let d=tn(s);throw this._submitErrorMessages=d.length?d:["\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"],this._submitSuccessMessage="",s}},onSubmitInvalid:()=>{this._submitSuccessMessage="",this._dispatchValidate(!1),this._scrollToFirstError()}})),this._initializedSchema=this.schema}_ensureControllerInitialized(){ve(this,de)&&this._initializedSchema===this.schema||this.schema&&this._initForm()}_isGroupInline(e){return e.length>1&&e.every(t=>t.type!=="textarea"&&t.type!=="array"&&t.type!=="slider"&&t.type!=="date"&&t.type!=="time"&&t.type!=="datetime"&&t.type!=="file")}_getFieldCondition(e){let t=ve(this,de)?.api?.state?.values??{},r=$y(e.condition,t);return{visible:!e.hidden&&r.visible,disabled:(this.schema?.disabled??!1)||(e.disabled??!1)||r.disabled,readonly:(this.schema?.readonly??!1)||(e.readonly??!1),required:(e.required??!1)||r.required}}_renderField(e,t,r=!1,n=!1){if(e.type==="group"&&e.fields)return this._renderGroup(e,t,r,n);if(e.type==="array")return this._renderArrayField(e,t,r,n);if(e.type==="button")return this._renderButtonField(e,r);let s=this._getFieldCondition(e);if(!s.visible)return Ae;let d={name:e.name},h={...e,required:s.required},p=Ty(h);return p&&(d.validators=p),t.field(d,f=>{let x=tn(f.state.meta.errors||[],{includeFieldErrors:!0}),y=f.state.meta.isTouched||ve(this,de).api.state.submissionAttempts>0,C=y&&x.length>0,S=fe=>{let $e=f.state.value;this._clearSubmissionFeedback(),f.handleChange(fe),this._effectiveValidateTrigger(h)==="change"&&f.validate?.("change"),this._emitFieldChange(h,fe,$e)},E={field:h,value:f.state.value,errors:x,disabled:s.disabled||r,readonly:s.readonly||n,required:!!h.required,touched:y,invalid:x.length>0,formValues:ve(this,de).api.state.values,fieldApi:f,blur:()=>f.handleBlur(),clearFeedback:()=>this._clearSubmissionFeedback(),handleChange:S,submit:()=>void this._submitForm(),reset:()=>this.reset()},T=this._withProps(h,this._renderControl(h,f,s.disabled||r,s.readonly||n,E)),O=h.hiddenLabel?"":h.label??"",H=G`
11407
+ `],a([Ur()],At.prototype,"label",2),a([Ur({type:Boolean})],At.prototype,"required",2),a([Ur()],At.prototype,"description",2),a([Ur()],At.prototype,"help",2),a([Ur()],At.prototype,"extra",2),a([Ur()],At.prototype,"tooltip",2),a([Ur({attribute:!1})],At.prototype,"errors",2),a([Ur({type:Boolean,reflect:!0})],At.prototype,"invalid",2),a([Ur({type:Boolean,attribute:"hidden-label"})],At.prototype,"hiddenLabel",2),a([Ur({type:Boolean,reflect:!0})],At.prototype,"inline",2),a([Ur({reflect:!0})],At.prototype,"size",2),a([Ur({reflect:!0,attribute:"label-placement"})],At.prototype,"labelPlacement",2),a([Ur({attribute:"label-width"})],At.prototype,"labelWidth",2),At=a([by("lui-form-item")],At);function Rd(i,o){if(!i||!o)return;let e=i;for(let[t,r]of Object.entries(o))r!=null&&(t==="style"&&typeof r=="string"?i.setAttribute("style",r):typeof r=="boolean"?r?i.setAttribute(t,""):i.removeAttribute(t):e[t]=r)}var Ka=new Map;function Ey(i,o){return Ka.set(i,o),()=>{Ka.get(i)===o&&Ka.delete(i)}}function Sy(i){Ka.delete(i)}function Id(i){let o={};for(let e of i)e.type==="group"&&e.fields?Object.assign(o,Id(e.fields)):e.type==="array"?o[e.name]=e.defaultValue!==void 0?e.defaultValue:[]:o[e.name]=e.defaultValue!==void 0?e.defaultValue:e.type==="switch"||e.type==="checkbox"?!1:e.type==="checkbox-group"?[]:e.type==="number"||e.type==="slider"?0:(e.type==="date"||e.type==="time"||e.type==="datetime","");return o}function fl(i,o){return o.split(/[.[\]]/).filter(Boolean).reduce((e,t)=>e?.[t],i)}function $y(i,o){if(!i)return{visible:!0,disabled:!1,required:!1};let e=Array.isArray(i.when)?i.when:[i.when],t=!1;for(let n of e){let s=fl(o,n);if(i.is!==void 0?t=s===i.is:i.isNot!==void 0?t=s!==i.isNot:i.contains!==void 0?t=Array.isArray(s)&&s.includes(i.contains):i.pattern!==void 0?t=new RegExp(i.pattern).test(String(s??"")):t=!!s,t)break}let r=t?i.then??{visible:!0}:i.else??{visible:!1};return{visible:r.visible??!0,disabled:r.disabled??!1,required:r.required??!1}}function Ty(i){let e={...i.validators??{}};i.validator&&(e.onSubmit=e.onSubmit??i.validator);let t=r=>{if(r!=null)return Cy(r)?n=>zy.validate({value:n.value,validationSource:"field"},r)??void 0:r};return e.onChange=t(e.onChange),e.onSubmit=t(e.onSubmit),Object.keys(e).length?e:void 0}function tn(i,o={}){if(i==null)return[];if(typeof i=="string")return i?[i]:[];if(typeof i=="number"||typeof i=="boolean")return[String(i)];if(i instanceof Error)return i.message?[i.message]:[String(i)];if(Array.isArray(i))return Array.from(new Set(i.flatMap(e=>tn(e,o))));if(typeof i=="object"){let e=i,t=[];return typeof e.message=="string"&&e.message&&t.push(e.message),"form"in e&&t.push(...tn(e.form,o)),o.includeFieldErrors&&"fields"in e&&t.push(...tn(e.fields,o)),Array.from(new Set(t))}return[]}function qn(i){return i==null||i===!1?!1:typeof i=="string"?i.length>0:typeof i=="number"||typeof i=="boolean"||i instanceof Error?!0:Array.isArray(i)?i.some(qn):typeof i=="object"?Object.values(i).some(qn):!1}function Ay(i,o){let e=i.successMessage;return typeof e=="function"?e(o):e??"\u63D0\u4EA4\u6210\u529F"}var de,kt=class extends yy{constructor(){super(...arguments);this.schema=null;this.showActions=!0;this.size="md";this.labelPlacement="top";this.labelWidth="120px";this._currentStep=0;this._isStepPending=!1;this._submitErrorMessages=[];this._submitSuccessMessage="";lh(this,de);this._explicitAttrs=new Set;this._collapsedArrayItems=new Set;this._initializedSchema=null}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._ensureControllerInitialized()}submit(){this._ensureControllerInitialized(),this._submitForm()}_dispatchValidate(e){ve(this,de)&&this.dispatchEvent(new CustomEvent("validate",{detail:{valid:e,errors:ve(this,de).api.getAllErrors(),values:this.getValues()},bubbles:!0,composed:!0}))}getValues(){return this._ensureControllerInitialized(),{...ve(this,de)?.api.state.values??{}}}setValues(e,t={}){if(this._ensureControllerInitialized(),!!ve(this,de)){for(let[r,n]of Object.entries(e))ve(this,de).api.setFieldValue(r,n,{dontUpdateMeta:!t.touch});this._emitFormChange("setValues",void 0,void 0,this.getValues())}}getValue(e){return fl(this.getValues(),e)}setValue(e,t,r={}){this._ensureControllerInitialized(),ve(this,de)&&(ve(this,de).api.setFieldValue(e,t,{dontUpdateMeta:!r.touch}),this._emitFormChange("setValue",e,t,this.getValues()))}async validate(){if(this._ensureControllerInitialized(),!ve(this,de)||!this.schema)return!0;this._clearSubmissionFeedback();let e=this.schema.steps?this.schema.steps.flatMap(d=>d.fields):this.schema.fields??[],t=Array.from(new Set(this._collectVisibleFieldNames(e)));this._markFieldsTouched(t);let r=await Promise.all(t.map(d=>ve(this,de).api.validateField(d,"submit"))),n=await ve(this,de).api.validate("submit"),s=!r.some(qn)&&!this._hasFieldErrors(t)&&!qn(n)&&this._getFormErrorMessages(ve(this,de)).length===0;return this._dispatchValidate(s),this.requestUpdate(),s}clearValidate(e){if(this._ensureControllerInitialized(),!ve(this,de)||!this.schema)return;this._clearSubmissionFeedback();let t=this.schema.steps?this.schema.steps.flatMap(n=>n.fields):this.schema.fields??[],r=e?.length?e:Array.from(new Set(this._collectVisibleFieldNames(t)));for(let n of r)ve(this,de).api.setFieldMeta(n,s=>({...s,isValidating:!1,isTouched:!1,isBlurred:!1,isValid:!0,errors:[],errorMap:{},errorSourceMap:{}}));this.requestUpdate()}_clearSubmissionFeedback(){(this._submitErrorMessages.length||this._submitSuccessMessage)&&(this._submitErrorMessages=[],this._submitSuccessMessage="")}async _submitForm(){if(!ve(this,de)||!this.schema)return;if(this._clearSubmissionFeedback(),!await this.validate()){this._scrollToFirstError(),this.requestUpdate();return}await ve(this,de).api.handleSubmit(),this.requestUpdate()}reset(e){this._ensureControllerInitialized(),this._clearSubmissionFeedback(),ve(this,de)?.api.reset(e),this._collapsedArrayItems.clear(),this._emitFormChange("reset",void 0,void 0,ve(this,de)?.api.state.values??{})}_emitFormChange(e,t,r,n=this.getValues()){this.dispatchEvent(new CustomEvent("change",{detail:{reason:e,name:t,value:r,values:n},bubbles:!0,composed:!0}))}_emitFieldChange(e,t,r){let n=this.getValues();this._emitFormChange("field",e.name,t,n)}focusField(e){let r=this._fieldElement(e)?.querySelector("lui-input,lui-textarea,lui-select,lui-input-number,lui-datepicker,lui-color-picker,lui-input-opt,lui-checkbox,lui-switch,lui-radio,button,input,textarea,select");return r?.focus?.(),!!r}scrollToField(e,t={block:"center",behavior:"smooth"}){let r=this._fieldElement(e);return r?.scrollIntoView(t),!!r}_fieldElement(e){return this.renderRoot.querySelector(`[data-field-name="${CSS.escape(e)}"]`)}_findFieldDef(e){let t=e.replace(/\[\d+\]/g,""),r=this.schema?.steps?this.schema.steps.flatMap(s=>s.fields):this.schema?.fields??[],n=s=>{for(let d of s){if(d.name===e||d.name===t||t.endsWith(`.${d.name}`))return d;if(d.fields){let h=n(d.fields);if(h)return h}}};return n(r)}_firstErrorFieldName(){if(!ve(this,de)||!this.schema)return;let e=this.schema.steps?this.schema.steps.flatMap(r=>r.fields):this.schema.fields??[];return Array.from(new Set(this._collectVisibleFieldNames(e))).find(r=>(ve(this,de).api.getFieldMeta(r)?.errors?.length??0)>0)}_scrollToFirstError(){let e=this._firstErrorFieldName();e&&requestAnimationFrame(()=>{this.scrollToField(e),this.focusField(e)})}_effectiveSize(e){return e?.size??this.schema?.size??this.size}_effectiveLabelPlacement(e){return e?.labelPlacement??this.schema?.labelPlacement??this.labelPlacement}_normalizedLabelPlacement(e){let t=this._effectiveLabelPlacement(e);return t==="left"||t==="horizontal"?"left":"top"}_effectiveLabelWidth(e){return pt(e?.labelWidth??this.schema?.labelWidth??this.labelWidth)||"120px"}_effectiveValidateTrigger(e){return e?.validateTrigger??this.schema?.validateTrigger??"change"}_fieldClass(e){return`field ${this._normalizedLabelPlacement(e)}`}_fieldStyle(e){return`--lui-form-label-width:${this._effectiveLabelWidth(e)}`}willUpdate(){this._ensureControllerInitialized();let e=F(this,"form");!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("label-placement")&&typeof e.labelPlacement=="string"&&this.labelPlacement!==e.labelPlacement&&(this.labelPlacement=e.labelPlacement),!this._explicitAttrs.has("label-width")&&(typeof e.labelWidth=="string"||typeof e.labelWidth=="number")&&this.labelWidth!==e.labelWidth&&(this.labelWidth=e.labelWidth),!this._explicitAttrs.has("show-actions")&&typeof e.showActions=="boolean"&&this.showActions!==e.showActions&&(this.showActions=e.showActions)}updated(e){super.updated(e),e.has("schema")&&this.schema&&(this._currentStep=0,this._clearSubmissionFeedback(),this._initializedSchema!==this.schema&&(this._initForm(),this.requestUpdate()))}_initForm(){if(!this.schema)return;let e=this.schema.steps?this.schema.steps.flatMap(n=>n.fields):this.schema.fields??[],t={...Id(e),...this.schema.defaultValues},r={...this.schema.validators??{}};this.schema.validator&&(r.onSubmit=r.onSubmit??this.schema.validator),ch(this,de,new My(this,{defaultValues:t,validators:r,validationLogic:this.schema.validationLogic,onSubmit:async({value:n})=>{this._clearSubmissionFeedback(),this.dispatchEvent(new CustomEvent("submit",{detail:{value:n},bubbles:!0,composed:!0}));try{typeof this.schema.onSubmit=="function"&&await this.schema.onSubmit(n),this._submitSuccessMessage=Ay(this.schema,n)}catch(s){let d=tn(s);throw this._submitErrorMessages=d.length?d:["\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"],this._submitSuccessMessage="",s}},onSubmitInvalid:()=>{this._submitSuccessMessage="",this._dispatchValidate(!1),this._scrollToFirstError()}})),this._initializedSchema=this.schema}_ensureControllerInitialized(){ve(this,de)&&this._initializedSchema===this.schema||this.schema&&this._initForm()}_isGroupInline(e){return e.length>1&&e.every(t=>t.type!=="textarea"&&t.type!=="array"&&t.type!=="slider"&&t.type!=="date"&&t.type!=="time"&&t.type!=="datetime"&&t.type!=="file")}_getFieldCondition(e){let t=ve(this,de)?.api?.state?.values??{},r=$y(e.condition,t);return{visible:!e.hidden&&r.visible,disabled:(this.schema?.disabled??!1)||(e.disabled??!1)||r.disabled,readonly:(this.schema?.readonly??!1)||(e.readonly??!1),required:(e.required??!1)||r.required}}_isFieldRenderable(e){return e.type==="group"||e.type==="array"||e.type==="button"?!0:this._getFieldCondition(e).visible}_renderField(e,t,r=!1,n=!1){if(e.type==="group"&&e.fields)return this._renderGroup(e,t,r,n);if(e.type==="array")return this._renderArrayField(e,t,r,n);if(e.type==="button")return this._renderButtonField(e,r);let s=this._getFieldCondition(e);if(!s.visible)return Ae;let d={name:e.name},h={...e,required:s.required},p=Ty(h);return p&&(d.validators=p),t.field(d,f=>{let x=tn(f.state.meta.errors||[],{includeFieldErrors:!0}),y=f.state.meta.isTouched||ve(this,de).api.state.submissionAttempts>0,C=y&&x.length>0,S=fe=>{let $e=f.state.value;this._clearSubmissionFeedback(),f.handleChange(fe),this._effectiveValidateTrigger(h)==="change"&&f.validate?.("change"),this._emitFieldChange(h,fe,$e)},E={field:h,value:f.state.value,errors:x,disabled:s.disabled||r,readonly:s.readonly||n,required:!!h.required,touched:y,invalid:x.length>0,formValues:ve(this,de).api.state.values,fieldApi:f,blur:()=>f.handleBlur(),clearFeedback:()=>this._clearSubmissionFeedback(),handleChange:S,submit:()=>void this._submitForm(),reset:()=>this.reset()},T=this._withProps(h,this._renderControl(h,f,s.disabled||r,s.readonly||n,E)),O=h.hiddenLabel?"":h.label??"",H=G`
11405
11408
  <lui-form-item
11406
11409
  data-field-name=${h.name}
11407
11410
  .label=${O}
@@ -11649,27 +11652,27 @@ var L2=Object.create;var ms=Object.defineProperty;var nh=Object.getOwnPropertyDe
11649
11652
  type=${e.type}
11650
11653
  @input=${f}
11651
11654
  @blur=${x}
11652
- ></lui-input>`}}_renderFields(e,t){return!!this.schema?.gutter||!!this.schema?.align||!!this.schema?.justify||!!this.schema?.nowrap||e.some(n=>n.span!=null||n.xs!=null||n.sm!=null||n.md!=null||n.lg!=null||n.xl!=null||n.offset!=null||n.order!=null)?G`
11655
+ ></lui-input>`}}_renderFields(e,t){if(!(!!this.schema?.gutter||!!this.schema?.align||!!this.schema?.justify||!!this.schema?.nowrap||e.some(s=>s.span!=null||s.xs!=null||s.sm!=null||s.md!=null||s.lg!=null||s.xl!=null||s.offset!=null||s.order!=null)))return e.map(s=>this._renderField(s,t));let n=e.filter(s=>this._isFieldRenderable(s));return G`
11653
11656
  <lui-row
11654
11657
  .gutter=${this.schema?.gutter??[12,12]}
11655
11658
  .align=${this.schema?.align??"top"}
11656
11659
  .justify=${this.schema?.justify??"start"}
11657
11660
  .nowrap=${this.schema?.nowrap??!1}
11658
11661
  >
11659
- ${e.map(n=>G`<lui-col
11660
- .span=${n.span}
11661
- .xs=${n.xs}
11662
- .sm=${n.sm}
11663
- .md=${n.md}
11664
- .lg=${n.lg}
11665
- .xl=${n.xl}
11666
- .offset=${n.offset}
11667
- .colOrder=${n.order}
11662
+ ${n.map(s=>G`<lui-col
11663
+ .span=${s.span}
11664
+ .xs=${s.xs}
11665
+ .sm=${s.sm}
11666
+ .md=${s.md}
11667
+ .lg=${s.lg}
11668
+ .xl=${s.xl}
11669
+ .offset=${s.offset}
11670
+ .colOrder=${s.order}
11668
11671
  >
11669
- ${this._renderField(n,t)}
11672
+ ${this._renderField(s,t)}
11670
11673
  </lui-col>`)}
11671
11674
  </lui-row>
11672
- `:e.map(n=>this._renderField(n,t))}_renderWizard(e){let t=this.schema.steps,r=t[this._currentStep];if(!r)return Ae;let n=this._currentStep===0,s=this._currentStep===t.length-1,d=e.api.state.isSubmitting||this._isStepPending;return G`
11675
+ `}_renderWizard(e){let t=this.schema.steps,r=t[this._currentStep];if(!r)return Ae;let n=this._currentStep===0,s=this._currentStep===t.length-1,d=e.api.state.isSubmitting||this._isStepPending;return G`
11673
11676
  <div class="wizard-steps">
11674
11677
  ${t.map((h,p)=>G`
11675
11678
  <div