zidan-select 2.2.4 → 2.3.1
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/README.md +135 -55
- package/dist/file/plugin-file-core.css +38 -5
- package/dist/file/plugin-file-core.min.css +9 -0
- package/dist/file/plugin-file-theme.css +23 -6
- package/dist/file/plugin-file-theme.min.css +9 -0
- package/dist/file/zidan-file.d.ts +32 -0
- package/dist/file/zidan-file.js +286 -44
- package/dist/file/zidan-file.min.js +11 -0
- package/dist/plugin-core.css +214 -15
- package/dist/plugin-core.min.css +10 -0
- package/dist/plugin-theme.css +36 -6
- package/dist/plugin-theme.min.css +13 -0
- package/dist/select/plugin-select-core.css +22 -3
- package/dist/select/plugin-select-core.min.css +9 -0
- package/dist/select/plugin-select-theme.css +28 -4
- package/dist/select/plugin-select-theme.min.css +9 -0
- package/dist/select/zidan-select.d.ts +33 -0
- package/dist/select/zidan-select.js +377 -32
- package/dist/select/zidan-select.min.js +11 -0
- package/dist/zidan-form.js +696 -109
- package/dist/zidan-form.min.js +14 -0
- package/docs/build.md +20 -13
- package/docs/comparison.md +11 -6
- package/docs/html-and-wordpress.md +893 -0
- package/docs/index.html +21 -3
- package/docs/options.md +101 -20
- package/docs/validation.md +44 -1
- package/package.json +25 -2
- package/plugin-core.css +214 -15
- package/plugin-theme.css +36 -6
- package/zidan-form.d.ts +431 -0
- package/zidan-form.js +696 -109
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* ZidanForm File-only v2.3.1
|
|
3
|
+
* Zero-dependency drag & drop file upload with variants, previews, limits and progress.
|
|
4
|
+
* Pairs with plugin-file-core.css and plugin-file-theme.css.
|
|
5
|
+
*
|
|
6
|
+
* Generated by scripts/build.mjs — edit zidan-form.js instead.
|
|
7
|
+
* https://github.com/akhtar1985/zidan-select
|
|
8
|
+
* MIT License © akhtar1985
|
|
9
|
+
*
|
|
10
|
+
* Classic <script> adds window.ZidanForm plus window.zidanField / initZidanForms.
|
|
11
|
+
*/(function(p,T){"use strict";var l=T(p);typeof window!="undefined"&&(window.ZidanForm=l.ZidanForm,l.ZidanSelect&&(window.ZidanSelect=l.ZidanSelect,window.zidanSelect=l.zidanSelect,window.initZidanSelects=l.initZidanSelects),l.zidanField&&(window.zidanField=l.zidanField),l.initZidanForms&&(window.initZidanForms=l.initZidanForms),l.registerIcon&&(window.registerZidanIcon=l.registerIcon)),typeof module!="undefined"&&module.exports&&(module.exports=l)})(typeof window!="undefined"?window:this,function(p){"use strict";var T="2.3.1";if(p&&p.ZidanForm&&p.ZidanForm.__zidanFormGuard===T)return p.ZidanForm.api;var l=typeof document!="undefined"?document:null,zt=["classic-clean","floating-label","soft-pill","bordered-brutalist","glass-elevated"],H=["auto","none","vanilla","bootstrap","tailwind","bulma","foundation"],W=["default","modern","minimal","dark","glass"],J=["stacked","inline","card","compact","floating","outlined"],Ct=["checkbox","radio","radio-group","file","input","textarea"],at="[data-zidan], [data-zidan-checkbox], [data-zidan-switch], [data-zidan-radio], [data-zidan-radio-group], [data-zidan-file], [data-zidan-input], [data-zidan-textarea], .zidan-field",Q="[data-zidan-select], .zidan-select",wt="[data-zidan-form], .zidan-form",xt=["default","thin","fancy","hover","hidden"],Ft="zidan:",nt=0;function Tt(t){return nt+=1,(t||"zs")+"-"+nt.toString(36)+Math.random().toString(36).slice(2,6)}function Mt(t,e){return!!(t&&t.classList&&t.classList.contains(e))}function st(t,e){return!t||!e||e.split(/\s+/).forEach(function(i){i&&t.classList.add(i)}),t}function v(t,e,i,r){var a=l.createElement(t);return e&&(a.className=e),i&&Object.keys(i).forEach(function(n){var s=i[n];s==null||s===!1||(n==="text"?a.textContent=String(s):a.setAttribute(n,s===!0?"":String(s)))}),r!=null&&(a.textContent=String(r)),a}function $(t){return t==null||t===""?[]:Array.isArray(t)?t.slice():[t]}function tt(t){return!!(t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function")}function Lt(t){if(!t)return!1;var e=t.closest?t.closest("[dir]"):null,i=e?e.getAttribute("dir"):"";if(!i&&l&&l.documentElement&&(i=l.documentElement.getAttribute("dir")||""),i)return String(i).toLowerCase()==="rtl";try{return!!(p.getComputedStyle&&p.getComputedStyle(t).direction==="rtl")}catch{return!1}}function y(t){return!!(t&&typeof t=="object"&&t.nodeType===1)}function kt(t,e){if(t==null||t==="")return e;var i=String(t).toLowerCase();return!(i==="false"||i==="0"||i==="no"||i==="off")}function I(){for(var t={},e=0;e<arguments.length;e++)(function(i){!i||typeof i!="object"||Object.keys(i).forEach(function(r){i[r]!==void 0&&(t[r]=i[r])})})(arguments[e]);return t}function Zt(t){if(!t||!t.getAttribute)return null;var e=t.getAttribute("data-zidan-options");if(!e)return null;try{var i=JSON.parse(e);return i&&typeof i=="object"&&!Array.isArray(i)?i:null}catch(r){return typeof console!="undefined"&&console.warn&&console.warn("[ZidanForm] ignoring invalid data-zidan-options JSON on",t,r),null}}function Ot(t,e,i){return Math.min(i,Math.max(e,t))}function N(t,e){return String(t).replace(/\{(\w+)\}/g,function(i,r){return e&&e[r]!==void 0&&e[r]!==null?String(e[r]):i})}var ot={text:'<path d="M4 7h16M4 12h10M4 17h13"/>',mail:'<rect x="3" y="5" width="18" height="14" rx="2"/><path d="m3 7 9 6 9-6"/>',phone:'<path d="M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1 1 .4 1.9.7 2.8a2 2 0 0 1-.5 2.1L8.1 9.9a16 16 0 0 0 6 6l1.3-1.2a2 2 0 0 1 2.1-.5c.9.3 1.8.6 2.8.7a2 2 0 0 1 1.7 2Z"/>',user:'<circle cx="12" cy="8" r="4"/><path d="M4 21a8 8 0 0 1 16 0"/>',lock:'<rect x="4" y="10" width="16" height="11" rx="2"/><path d="M8 10V7a4 4 0 0 1 8 0v3"/>',search:'<circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/>',calendar:'<rect x="3" y="5" width="18" height="16" rx="2"/><path d="M16 3v4M8 3v4M3 11h18"/>',clock:'<circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/>',link:'<path d="M10 13a5 5 0 0 0 7 0l3-3a5 5 0 0 0-7-7l-1.5 1.5"/><path d="M14 11a5 5 0 0 0-7 0l-3 3a5 5 0 0 0 7 7l1.5-1.5"/>',hash:'<path d="M4 9h16M4 15h16M10 3 8 21M16 3l-2 18"/>',palette:'<path d="M12 3a9 9 0 0 0 0 18h1.5a2.5 2.5 0 0 0 0-5H12a2 2 0 0 1 0-4h4a5 5 0 0 0 0-10Z"/><circle cx="8.5" cy="8.5" r="1"/><circle cx="8" cy="14" r="1"/>',sliders:'<path d="M4 7h16M4 17h16"/><circle cx="9" cy="7" r="2.5"/><circle cx="15" cy="17" r="2.5"/>',file:'<path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/>',upload:'<path d="M12 16V4"/><path d="m7 9 5-5 5 5"/><path d="M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2"/>',eye:'<path d="M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6-10-6-10-6Z"/><circle cx="12" cy="12" r="3"/>',"eye-off":'<path d="m3 3 18 18"/><path d="M10.6 6.2A9.9 9.9 0 0 1 12 6c6.5 0 10 6 10 6a17 17 0 0 1-3.1 3.6"/><path d="M6.4 6.7C3.5 8.4 2 12 2 12s3.5 6 10 6c1.7 0 3.2-.4 4.5-1"/><path d="M9.9 9.9a3 3 0 0 0 4.2 4.2"/>',check:'<path d="m4 12.5 5 5L20 6.5"/>',x:'<path d="M6 6l12 12M18 6 6 18"/>',plus:'<path d="M12 5v14M5 12h14"/>',minus:'<path d="M5 12h14"/>',"chevron-down":'<path d="m6 9 6 6 6-6"/>',"chevron-up":'<path d="m6 15 6-6 6 6"/>',"chevron-left":'<path d="m15 6-6 6 6 6"/>',"chevron-right":'<path d="m9 6 6 6-6 6"/>',alert:'<path d="M12 9v4"/><path d="M12 17h.01"/><path d="M10.3 3.9 2.6 17.4A2 2 0 0 0 4.3 20h15.4a2 2 0 0 0 1.7-2.6L13.7 3.9a2 2 0 0 0-3.4 0Z"/>',info:'<circle cx="12" cy="12" r="9"/><path d="M12 11v5"/><path d="M12 8h.01"/>',globe:'<circle cx="12" cy="12" r="9"/><path d="M3 12h18"/><path d="M12 3a15 15 0 0 1 0 18 15 15 0 0 1 0-18Z"/>',"map-pin":'<path d="M20 10c0 6-8 12-8 12S4 16 4 10a8 8 0 1 1 16 0Z"/><circle cx="12" cy="10" r="3"/>',image:'<rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><path d="m21 15-5-5L5 21"/>',refresh:'<path d="M20 11a8 8 0 0 0-14.9-3.9L3 10"/><path d="M3 5v5h5"/><path d="M4 13a8 8 0 0 0 14.9 3.9L21 14"/><path d="M21 19v-5h-5"/>',trash:'<path d="M4 7h16"/><path d="M9 7V4h6v3"/><path d="M6 7l1 13h10l1-13"/><path d="M10 11v5M14 11v5"/>'},O={};Object.keys(ot).forEach(function(t){O[t]=ot[t]});var Ut="http://www.w3.org/2000/svg",Vt={svg:1,g:1,path:1,circle:1,rect:1,line:1,polyline:1,polygon:1,ellipse:1,title:1,defs:1,clipPath:1,clippath:1,mask:1};function It(t){if(typeof t!="string"||!t.trim())return"";var e;try{if(typeof p.DOMParser=="undefined")return"";e=new p.DOMParser().parseFromString(t,"image/svg+xml")}catch{return""}if(!e||!e.documentElement)return"";var i=e.documentElement;if(String(i.nodeName).toLowerCase()!=="svg"||e.getElementsByTagName("parsererror").length)return"";var r=function(a){Array.prototype.slice.call(a.children||[]).forEach(function(n){var s=String(n.nodeName);if(s!==s.toLowerCase()&&(s=s.toLowerCase()),!Vt[s]){n.parentNode.removeChild(n);return}Array.prototype.slice.call(n.attributes||[]).forEach(function(o){var u=String(o.name).toLowerCase();u.indexOf("on")===0&&n.removeAttribute(o.name),(u==="href"||u==="xlink:href")&&!/^#/.test(o.value)&&n.removeAttribute(o.name),/url\s*\(\s*['"]?\s*(?:https?:|\/\/)/i.test(o.value)&&n.removeAttribute(o.name)}),r(n)})};return r(i),i.outerHTML}function j(t){var e=t;return/^\s*</.test(e)&&!/^\s*<svg/i.test(e)?e='<svg xmlns="'+Ut+'" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">'+e+"</svg>":/^\s*<svg/i.test(e)||(e=""),It(e)}function Nt(t,e){var i="",r="";if(typeof t=="string"&&t?(r=t,/^\s*</.test(t)?i=j(t)||j('<path d="M4 12h16"/>'):O[t]&&(i=j(O[t])||"")):t&&typeof t=="object"&&t.name&&(r=t.name,i=j(O[t.name]||"")),!i)return null;var a=l.createElement("span");e&&(a.className=e),a.setAttribute("data-zs-icon",r||"custom");try{a.innerHTML=i}catch{return null}var n=a.firstChild;return n&&(n.setAttribute("focusable","false"),n.setAttribute("aria-hidden","true"),n.setAttribute("width","18"),n.setAttribute("height","18")),a}var Pt={text:"text",email:"mail",password:"lock",number:"hash",tel:"phone",url:"link",search:"search",date:"calendar",time:"clock","datetime-local":"calendar",month:"calendar",week:"calendar",range:"sliders",color:"palette"};function Jt(t){return Pt[t]||""}function lt(t,e){return typeof ZidanSelect!="undefined"&&(!t||typeof e!="string")?ZidanSelect:(t&&typeof e=="string"&&(O[String(t)]=e),typeof ZidanSelect!="undefined"?ZidanSelect:h)}function C(t,e,i,r,a){if(e&&e[i]!==void 0&&e[i]!==null)return e[i];if(t&&r&&t.getAttribute){var n=t.getAttribute("data-zidan-"+r);if(n!==null&&n!=="")return n}return a}function P(t,e,i,r,a){if(e&&e[i]!==void 0&&e[i]!==null)return!!e[i];if(t&&r&&t.getAttribute){var n=t.getAttribute("data-zidan-"+r);if(n!==null)return kt(n,a)}return a}function Rt(t,e,i,r,a){var n=C(t,e,i,r,a);if(n==null||n==="")return a;var s=parseFloat(n);return isFinite(s)?s:a}function Qt(t,e,i,r,a){var n=C(t,e,i,r,null);return n==null||n===""?a:Array.isArray(n)?n.slice():String(n).split(",").map(function(s){return s.trim()}).filter(Boolean)}var M={required:"This field is required.",email:"Enter a valid email address.",url:"Enter a valid URL.",pattern:"The value does not match the expected format.",min:"Value must be at least {min}.",max:"Value must be at most {max}.",step:"Value must be a multiple of {step}.",minlength:"Use at least {minlength} characters.",maxlength:"Use at most {maxlength} characters.",badInput:"Enter a valid value.",phone:"Enter a valid phone number for {country}.",integer:"Enter a whole number.",date:"Enter a valid date.",weekend:"Weekends are not available \u2014 pick a weekday.",dateDisabled:"This date is not available.",fileType:"This file type is not allowed.",fileSize:"This file is too large.",fileCount:"Too many files.",pending:"Checking\u2026",generic:"Please check this field."};function Dt(t,e){if(!t||!t.validity||t.validity.valid)return"";var i=t.validity,r=e||M,a=String(t.type||"").toLowerCase(),n="",s={min:t.getAttribute("min"),max:t.getAttribute("max"),step:t.getAttribute("step")};return i.valueMissing?n="required":i.typeMismatch?n=a==="email"?"email":a==="url"?"url":"generic":i.patternMismatch?n="pattern":i.rangeUnderflow?n="min":i.rangeOverflow?n="max":i.stepMismatch?n="step":i.tooShort?(n="minlength",s.minlength=t.getAttribute("minlength")):i.tooLong?(n="maxlength",s.maxlength=t.getAttribute("maxlength")):(i.badInput||i.customError)&&(n="badInput"),n?N(r[n]||M[n]||r.generic,s):t.validationMessage||r.generic}var dt=["valueMissing","typeMismatch","patternMismatch","rangeUnderflow","rangeOverflow","stepMismatch","tooShort","tooLong","badInput","fileMissing"];function Bt(t){var e=t&&t.validity;if(!e)return!1;for(var i=0;i<dt.length;i+=1)if(e[dt[i]])return!0;return!1}function et(t,e){for(var i=t;i&&i.nodeType===1;){for(var r=0;r<e.length;r+=1){var a=i.getAttribute(e[r]);if(a)return a}i=i.parentElement}return""}function L(t,e,i){var r=String(t||"").toLowerCase();return e.indexOf(r)===-1?i:r}function $t(t){if(Array.isArray(t))return t.slice();if(typeof t=="string"){var e=t.trim();if(e.charAt(0)==="[")try{var i=JSON.parse(e);if(Array.isArray(i))return i}catch{}else if(e.indexOf(",")!==-1)return e.split(",").map(function(r){return Number(r.trim())}).filter(function(r){return isFinite(r)})}return t}function qt(t,e){var i=e||{},r=i.theme||et(t,["data-zidan-theme","data-zs-theme"]);!r&&l&&(r=l.documentElement.getAttribute("data-zs-theme")||"");var a=i.framework||et(t,["data-zidan-framework","data-zs-framework"]);!a&&l&&(a=l.documentElement.getAttribute("data-zs-framework")||"");var n=i.layout||et(t,["data-zidan-layout","data-zs-layout"]);return{theme:L(r,W,"default"),framework:L(a,H,"none"),layout:n?String(n).toLowerCase():""}}function te(t,e){var i=null;function r(){var a=arguments;clearTimeout(i),i=setTimeout(function(){i=null,t.apply(null,a)},e)}return r.cancel=function(){clearTimeout(i),i=null},r}var Ht=["valid","invalid"],ut=["default","switch","card","button","minimal"],ft=["ios","material","square","labeled","icon"],ct=["stacked","inline","card","button","tile"],R=["dropzone","button","avatar","gallery","compact"],ht=["default","gradient","stepped","minimal"],ee=["always","active","never"],ie=["top","bottom"];function re(t,e){var i="";return Array.prototype.slice.call(t.childNodes).forEach(function(r){r===e||r.nodeType!==3||(i+=r.nodeValue)}),i.replace(/\s+/g," ").trim()}function ae(t,e){return Array.prototype.slice.call(t.childNodes).forEach(function(i){i.nodeType===3&&i.nodeValue.trim()&&e.appendChild(i)}),e}function f(t,e,i){if(!l)throw new Error("ZidanForm requires a DOM environment.");if(!y(t))throw new Error("ZidanForm: target element not found.");this.el=t,this.kind=i,this.opts=e||{},this.opts.messages=Object.assign({},M,this.opts.messages||{}),this.id=t.id||(t.id=Tt("zf")),this.root=null,this.touched=!1,this.validation=null,this.errorMessage=null,this.errorEl=null,this.pending=!1,this._asyncToken=0,this._asyncController=null,this.destroyed=!1,this._listeners=[],this._cleanups=[],this._describedByBefore=[],this.formEl=t.form||(t.closest?t.closest("form"):null);var r=qt(t,this.opts);this.theme=r.theme,this.framework=r.framework,this.layout=this.opts.layout||r.layout}f.prototype.on=function(t,e,i,r){return!t||!t.addEventListener?this:(t.addEventListener(e,i,r),this._listeners.push([t,e,i,r]),this)},f.prototype.emit=function(t,e){if(!this.root)return this;var i=e||{};i.instance=this,i.kind=this.kind;try{this.root.dispatchEvent(new CustomEvent(Ft+t,{detail:i,bubbles:!0}))}catch{}return this},f.prototype.call=function(t,e){var i=this.opts[t];if(typeof i=="function")try{return i(e)}catch(r){this.emit("error",{error:r,callback:t})}},f.prototype._scope=function(t){var e=v("div","zs-field");return e.id=this.id+"-field",e.setAttribute("data-zs-kind",t),e.classList.add("zs-field--"+t),Lt(this.el)&&e.setAttribute("dir","rtl"),this._applyScope(e),this.root=e,e},f.prototype._applyScope=function(t){return t.setAttribute("data-zs-theme",this.theme),t.setAttribute("data-zs-framework",this.framework),this.layout&&t.setAttribute("data-zs-layout",this.layout),t},f.prototype.setTheme=function(t){return this.theme=L(t,W,this.theme),this.root&&this.root.setAttribute("data-zs-theme",this.theme),this},f.prototype.setFramework=function(t){return this.framework=L(t,H,this.framework),this.root&&this.root.setAttribute("data-zs-framework",this.framework),this},f.prototype.setLayout=function(t){return this.layout=L(t,J,this.layout||"stacked"),this.root&&this.root.setAttribute("data-zs-layout",this.layout),this},f.prototype.validationTargets=function(){return[this.el]},f.prototype._customError=function(){return""},f.prototype._messageFor=function(t){var e=Dt(t,this.opts.messages);return e||(t&&t.validationMessage?t.validationMessage:this.opts.messages.generic||M.generic)},f.prototype._nativeError=function(){for(var t=this.validationTargets(),e=0;e<t.length;e+=1){var i=t[e];if(Bt(i))return this._messageFor(i)}return""},f.prototype._asyncSignal=function(){return this._asyncController?this._asyncController.signal:void 0},f.prototype._asyncContext=function(){return{signal:this._asyncSignal(),field:this,instance:this}},f.prototype._setCustomValidity=function(){},f.prototype._abortAsync=function(){if(this._asyncToken+=1,this._asyncController){try{this._asyncController.abort()}catch{}this._asyncController=null}},f.prototype._evaluate=function(){this._abortAsync(),typeof AbortController!="undefined"&&(this._asyncController=new AbortController);var t=this._customError?this._customError():"";if(tt(t))return{pending:t};if(this._asyncController=null,t)return{error:typeof t=="string"?t:this.opts.messages.generic,custom:!0};var e=this._nativeError();return e?{error:e,custom:!1}:{}},f.prototype._applyValidity=function(t,e,i){return this._setCustomValidity(t&&i?t:""),t?(e?this.setError(t):this.setValidation("invalid",!0),this):(this.errorMessage&&this.setError(null),this.validation==="invalid"&&!this._presetValidation&&this.setValidation(null,!0),this)},f.prototype._setPending=function(t){return t=!!t,this.pending=t,this.root&&(this.root.classList.toggle("zs-field--pending",t),t?this.root.setAttribute("data-zs-validation","pending"):this.root.getAttribute("data-zs-validation")==="pending"&&this.root.removeAttribute("data-zs-validation")),this.validationTargets().forEach(function(e){!e||!e.setAttribute||(t?e.setAttribute("aria-busy","true"):e.removeAttribute("aria-busy"))},this),t?(this.errorMessage&&this.setError(null),this._setCustomValidity(this.opts.messages.pending||M.pending)):this._setCustomValidity(""),this},f.prototype._runAsync=function(t){var e=this;if(e.destroyed)return Promise.resolve(!1);var i=e._asyncToken;return e._setPending(!0),Promise.resolve(t).then(function(r){if(e.destroyed||i!==e._asyncToken)return!1;e._asyncController=null,e._setPending(!1);var a="";return r===!1?a=e.opts.messages.generic:typeof r=="string"?a=r:r instanceof Error&&(a=r.message||e.opts.messages.generic),e._applyValidity(a,e.touched||e.opts.alwaysValidate||!!a,!0),!a&&e.opts.showValidState&&e.setValidation("valid"),e.emit("async-validation",{valid:!a,message:a}),!a},function(r){if(e.destroyed||i!==e._asyncToken||r&&r.name==="AbortError")return!1;e._asyncController=null,e._setPending(!1);var a=r&&(r.message||r.error)||e.opts.messages.generic;return typeof a!="string"&&(a=e.opts.messages.generic),e._applyValidity(a,!0,!0),e.emit("async-validation",{valid:!1,message:a,error:r}),!1})},f.prototype.checkAsync=function(){var t=this._evaluate();return t.pending?this._runAsync(t.pending):Promise.resolve(!t.error)},f.prototype._trackDescribedBy=function(t){if(!(!t||!t.getAttribute)){for(var e=0;e<this._describedByBefore.length;e+=1)if(this._describedByBefore[e][0]===t)return;this._describedByBefore.push([t,t.getAttribute("aria-describedby")])}},f.prototype._addDescribedBy=function(t,e){if(!(!t||!t.getAttribute||!e)){this._trackDescribedBy(t);var i=(t.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean);i.indexOf(e)===-1&&i.push(e),t.setAttribute("aria-describedby",i.join(" "))}},f.prototype._syncDescribedBy=function(){if(!(!this.el||!this.el.getAttribute)){var t=this.id+"-error",e=this.root&&this.root.querySelector?this.root.querySelector(".zs-field__hint[id]"):null,i=e?e.id:"",r=this.validationTargets();r.forEach(function(a){if(!(!a||!a.getAttribute)){this._trackDescribedBy(a);var n=(a.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean),s=n.filter(function(o){return o!==t&&o!==i});i&&s.push(i),this.errorMessage&&s.push(t),s.length?a.setAttribute("aria-describedby",s.join(" ")):a.removeAttribute("aria-describedby")}},this)}},f.prototype._renderError=function(){this.root&&(this.errorEl||(this.errorEl=v("p","zs-field__error",{id:this.id+"-error",role:"status","aria-live":"polite"}),this.root.appendChild(this.errorEl)),this.errorEl.textContent=this.errorMessage||"",this.errorEl.hidden=!this.errorMessage,this._syncDescribedBy())},f.prototype.setError=function(t){this.errorMessage=t||null,this.errorMessage?this.validation="invalid":this.validation==="invalid"&&(this.validation=null);var e=!!this.errorMessage||this.validation==="invalid";return this.root&&(this.root.classList.toggle("zs-field--invalid",e),this.root.classList.toggle("zs-field--valid",this.validation==="valid"&&!this.errorMessage),e||this.validation?this.root.setAttribute("data-zs-validation",e?"invalid":this.validation):this.root.removeAttribute("data-zs-validation")),this._renderError(),this.validationTargets().forEach(function(i){!i||!i.setAttribute||(e?i.setAttribute("aria-invalid","true"):this.validation==="valid"?i.setAttribute("aria-invalid","false"):i.removeAttribute("aria-invalid"))},this),this.emit("validation",{state:e?"invalid":this.validation,message:this.errorMessage}),this.call("onValidation",{state:e?"invalid":this.validation,message:this.errorMessage,instance:this}),this},f.prototype.clearError=function(){return this.setError(null)},f.prototype._bindValidity=function(){var t=this;this.validationTargets().forEach(function(i){t.on(i,"invalid",function(){t.touched=!0;var r=t._evaluate();if(r.pending){t._runAsync(r.pending);return}r.error?t.setError(r.error):t.setValidation("invalid")}),t.on(i,"blur",function(){t.touched=!0,t._presetValidation=!1,t._mirrorValidity()}),t.on(i,"input",function(){t._presetValidation=!1,t._mirrorValidity()}),t.on(i,"change",function(){t._presetValidation=!1,t._mirrorValidity()})}),this.on(this.formEl,"reset",function(){p.setTimeout(function(){t.destroyed||(t._abortAsync(),t.touched=!1,t.errorMessage=null,t._setPending(!1),t.errorEl&&(t.errorEl.textContent="",t.errorEl.hidden=!0),t.setValidation(null),t.update())},0)});var e=this.opts.validation||this.el.getAttribute("data-zidan-validation")||this.el.getAttribute("data-zs-validation");(e==="valid"||e==="invalid")&&this.setValidation(e),this._syncDescribedBy()},f.prototype._mirrorValidity=function(){var t=this._evaluate();return t.pending?(this._runAsync(t.pending),this):(this.pending&&this._setPending(!1),this._applyValidity(t.error||"",this.touched||this.opts.alwaysValidate,t.custom),this)},f.prototype.validate=function(){this.touched=!0;var t=this._evaluate();return t.pending?this._runAsync(t.pending):(this.pending&&this._setPending(!1),t.error?(this._applyValidity(t.error,!0,t.custom),!1):(this._applyValidity("",!0,!1),this.opts.showValidState&&this.setValidation("valid"),!0))},f.prototype.setValidation=function(t,e){this.validation=Ht.indexOf(t)===-1?null:t,e||(this._presetValidation=this.validation==="invalid");var i=this.validation==="invalid"||!!this.errorMessage;return this.root&&(this.root.classList.toggle("zs-field--invalid",i),this.root.classList.toggle("zs-field--valid",this.validation==="valid"&&!this.errorMessage),i?this.root.setAttribute("data-zs-validation","invalid"):this.validation?this.root.setAttribute("data-zs-validation",this.validation):this.root.removeAttribute("data-zs-validation")),this.validationTargets().forEach(function(r){!r||!r.setAttribute||(i?r.setAttribute("aria-invalid","true"):this.validation==="valid"?r.setAttribute("aria-invalid","false"):r.removeAttribute("aria-invalid"))},this),this.emit("validation",{state:i?"invalid":this.validation,message:this.errorMessage}),this.call("onValidation",{state:i?"invalid":this.validation,message:this.errorMessage,instance:this}),this},f.prototype.getValidation=function(){return this.validation},f.prototype.isPending=function(){return this.pending},f.prototype.getValue=function(){var t=this.el;return t?this.kind==="file"?this.getFiles?this.getFiles():Array.prototype.slice.call(t.files||[]):t.type==="checkbox"?!!t.checked:t.multiple&&t.options?Array.prototype.filter.call(t.options,function(e){return e.selected}).map(function(e){return e.value}):t.value:null},f.prototype.setValue=function(t){var e=this.el;if(!e)return this;if(this.kind==="file"){var i=t==null?[]:Array.isArray(t)?t:[t];return i.length?(this.addFiles&&this.addFiles(i),this):this.clear?this.clear():this}if(e.type==="checkbox")return this.setChecked?this.setChecked(!!t):(e.checked=!!t,e.dispatchEvent(new Event("change",{bubbles:!0})),this.update());if(e.multiple&&e.options){var r=(Array.isArray(t)?t:[t]).map(String);Array.prototype.forEach.call(e.options,function(a){a.selected=r.indexOf(a.value)!==-1})}else e.value=t==null?"":String(t);return e.dispatchEvent(new Event("change",{bubbles:!0})),this.update()},f.prototype.update=function(){return this._sync&&this._sync(),this._mirrorValidity(),this},f.prototype.refresh=function(){return this.update()},f.prototype.destroy=function(){return this.destroyed?this:(this.destroyed=!0,this._abortAsync(),this._listeners.forEach(function(t){t[0].removeEventListener(t[1],t[2],t[3])}),this._listeners.length=0,this._teardown&&this._teardown(),this._cleanups.forEach(function(t){t()}),this._cleanups.length=0,this.emit("destroy",{}),this.root&&this.root!==this.el&&this.root.parentNode&&this.root.parentNode.removeChild(this.root),this._describedByBefore.forEach(function(t){var e=t[0];!e||!e.getAttribute||(t[1]===null||t[1]===void 0?e.removeAttribute("aria-describedby"):e.setAttribute("aria-describedby",t[1]))}),this._describedByBefore=[],this.el.__zidanField===this&&delete this.el.__zidanField,h._unregister(this),this)};function G(t){return!t&&t!==0?"":t<1024?t+" B":t<1024*1024?(t/1024).toFixed(t<10240?1:0)+" KB":(t/(1024*1024)).toFixed(1)+" MB"}function pt(t){var e=/\.([a-z0-9]+)$/i.exec(String(t||""));return e?"."+e[1].toLowerCase():""}function jt(t,e){return e?String(e).split(",").some(function(i){var r=i.trim().toLowerCase();return r?r.indexOf(".")===0?pt(t.name)===r:r.indexOf("/*")!==-1?String(t.type).toLowerCase().indexOf(r.split("/")[0]+"/")===0:String(t.type).toLowerCase()===r:!1}):!0}function w(t){return[t.name,t.size,t.lastModified||0,t.type||""].join("|")}function Gt(t,e){return t&&typeof t=="string"?t:t&&t.message?t.message:t&&t.status?"Upload failed (HTTP "+t.status+").":e||"Upload failed."}function d(t,e){if(!(this instanceof d))return new d(t,e);if(!/^file$/i.test(t.type))throw new Error('ZidanFileUpload: expected an <input type="file">.');f.call(this,t,e,"file");var i=this,r=t,a=this.opts,n=L(C(r,a,"fileVariant","file-variant",C(r,a,"variant","variant","dropzone")),R,"dropzone"),s=r.parentNode,o=this._scope("file");o.setAttribute("data-zs-file-variant",n),s.insertBefore(o,r);var u=v("label","zs-file-drop zs-file-drop--"+n);u.setAttribute("for",this.id);var _=v("span","zs-file-avatar",{hidden:!0}),E=l.createElement("img");E.alt="",_.appendChild(E);var z=v("span","zs-file-icon",{"aria-hidden":"true"}),c=C(r,a,"uploadIcon","upload-icon",C(r,a,"icon","icon","upload")),D=Nt(c,"zs-file-icon-svg");D&&z.appendChild(D);var X=a.title||r.getAttribute("data-zidan-title")||(n==="avatar"?"Upload an image":n==="gallery"?"Add images":"Choose a file"),S=v("span","zs-file-drop-title",null,X),b=v("span","zs-file-drop-hint",null,a.dropHint||r.getAttribute("data-zidan-drop-hint")||(r.multiple?"or drop files here \u2014 multiple allowed":"or drop it here"));u.appendChild(_),u.appendChild(z),u.appendChild(S),u.appendChild(b),u.appendChild(r),o.appendChild(u);var k=v("ul","zs-file-list");o.appendChild(k);var x=v("div","zs-file-meta-row"),B=v("span","zs-file-status",{role:"status","aria-live":"polite"}),F=v("button","zs-file-clear",{type:"button"});F.textContent=a.clearLabel||"Clear all",F.hidden=!0,x.appendChild(B),x.appendChild(F),o.appendChild(x);var q=a.accept||r.accept;q&&(b.textContent=b.textContent+" \xB7 "+q),this.variant=n,this.drop=u,this.list=k,this.status=B,this.clearBtn=F,this.titleEl=S,this.hintEl=b,this._fallbackTitle=X,this.avatarEl=_,this.avatarImg=E,this.uploadHandler=typeof a.upload=="function"?a.upload:typeof a.uploadHandler=="function"?a.uploadHandler:null,this.uploadUrl=C(r,a,"uploadUrl","upload-url",""),this.uploadField=C(r,a,"uploadField","upload-field","file"),this.withCredentials=P(r,a,"withCredentials","with-credentials",!1),this.uploadHeaders=a.uploadHeaders||a.headers||null,this.simulateUpload=P(r,a,"simulateUpload","simulate-upload",!1),this.simulateDuration=Math.max(120,Rt(r,a,"simulateDuration","simulate-duration",900)),this.autoUpload=P(r,a,"autoUpload","auto-upload",!0),this.showFileMeta=P(r,a,"showFileMeta","show-file-meta",!0),this.showPreview=P(r,a,"showPreview","preview",!0),this.hasUploader=!!(this.uploadHandler||this.uploadUrl||this.simulateUpload),o.setAttribute("data-zs-upload",this.hasUploader?"true":"false"),this._uploads=Object.create(null),this._active=Object.create(null),this._urls=[],this._renderQueued=!1,this.fileError="",this._restoreInput=function(){var m=o.parentNode||s;m.insertBefore(r,o.parentNode?o:null),r.classList.remove("zs-native-input","zs-file-input")},st(r,"zs-native-input"),st(r,"zs-file-input"),this.on(r,"change",function(){var m=i._validate();i._render(),i.emit("change",{files:i.getFiles()}),i.call("onChange",{files:i.getFiles(),instance:i}),m&&i.autoUpload&&i.hasUploader&&i.uploadAll()});var Z=0;["dragenter","dragover"].forEach(function(m){i.on(u,m,function(A){A.preventDefault(),m==="dragenter"&&(Z+=1),u.classList.add("zs-file-drop--over")})}),i.on(u,"dragleave",function(){Z=Math.max(0,Z-1),Z||u.classList.remove("zs-file-drop--over")}),i.on(u,"drop",function(m){if(m.preventDefault(),Z=0,u.classList.remove("zs-file-drop--over"),!(!m.dataTransfer||!m.dataTransfer.files||!m.dataTransfer.files.length)){var A=Array.prototype.slice.call(m.dataTransfer.files);r.multiple||(A=A.slice(0,1)),i.addFiles(A)}}),i.on(F,"click",function(){i.clear()}),i.on(k,"click",function(m){var A=m.target&&m.target.closest?m.target.closest("button"):null;if(!(!A||!k.contains(A))){var Et=A.closest(".zs-file-item"),St=Et?parseInt(Et.getAttribute("data-zs-file-index"),10):-1,K=St>=0?i.getFiles()[St]:null;K&&(m.preventDefault(),m.stopPropagation(),A.classList.contains("zs-file-cancel")?i.cancelUpload(K):A.classList.contains("zs-file-retry")?i.retryUpload(K):A.classList.contains("zs-file-remove")&&i.removeFile(K))}}),this._bindValidity(),this.on(this.formEl,"reset",function(){p.setTimeout(function(){i.destroyed||(i.cancelAll(),i._uploads=Object.create(null),i.fileError="",r.setCustomValidity&&r.setCustomValidity(""),i._render())},0)}),r.__zidanField=this,this._render(),this.emit("init",{}),h._register(this)}d.prototype=Object.create(f.prototype),d.prototype.constructor=d,d.prototype.getFiles=function(){return this.el.files?Array.prototype.slice.call(this.el.files):[]},d.prototype.getUploadState=function(){var t=this;return this.getFiles().map(function(e){var i=t._stateFor(e,!1)||{status:"idle",progress:0,error:"",result:null};return{file:e,name:e.name,size:e.size,status:i.status,progress:i.progress,error:i.error,result:i.result}})},d.prototype._stateFor=function(t,e){var i=w(t),r=this._uploads[i];return!r&&e&&(r=this._uploads[i]={status:"idle",progress:0,error:"",result:null}),r},d.prototype._setFiles=function(t){try{var e=typeof DataTransfer!="undefined"?DataTransfer:p.DataTransfer;if(!e)return!1;var i=new e;return t.forEach(function(r){i.items.add(r)}),this.el.files=i.files,!0}catch{return!1}},d.prototype._applyFiles=function(t,e){if(!this._setFiles(t))return this.emit("error",{error:new Error("This browser cannot assign files programmatically."),action:"setFiles"}),this;if(e)try{this.el.dispatchEvent(new Event("change",{bubbles:!0}))}catch{}else this._validate(),this._render();return this},d.prototype.addFiles=function(t){var e=t&&t.length!==void 0?Array.prototype.slice.call(t):$(t);if(!e.length)return this;var i=this.el.multiple?this.getFiles():[],r=Object.create(null),a=i.concat(e).filter(function(n){var s=w(n);return r[s]?!1:(r[s]=!0,!0)});if(this.el.multiple||(a=a.slice(0,1)),!this._setFiles(a))return this.emit("error",{error:new Error("This browser cannot assign files programmatically."),action:"addFiles"}),this;try{this.el.dispatchEvent(new Event("change",{bubbles:!0}))}catch{}return this},d.prototype.replaceFiles=function(t){return this._applyFiles(t&&t.length!==void 0?Array.prototype.slice.call(t):$(t),!0)},d.prototype.removeFile=function(t){var e=this.getFiles(),i=typeof t=="number"?t:e.indexOf(t);if(i===-1||!e[i])return this;var r=e[i];this.cancelUpload(r),delete this._uploads[w(r)];var a=e.slice();return a.splice(i,1),this._setFiles(a),this._validate(),this._render(),this.emit("change",{files:a}),this.emit("remove",{file:r,index:i}),this.call("onChange",{files:a,instance:this}),this.call("onRemove",{file:r,index:i,instance:this}),this},d.prototype.clear=function(){return this.cancelAll(),this._uploads=Object.create(null),this.fileError="",this.el.value="",this.el.setCustomValidity&&this.el.setCustomValidity(""),this._validate(),this._render(),this.emit("change",{files:[]}),this.emit("clear",{}),this.call("onChange",{files:[],instance:this}),this},d.prototype._limits=function(){var t=this.el,e=this.opts,i=parseInt(e.maxFiles||t.getAttribute("data-zidan-max-files"),10),r=parseInt(e.maxSize||t.getAttribute("data-zidan-max-size"),10);if(!(r>0)){var a=e.maxSizeMB;if((a==null||a==="")&&(a=t.getAttribute("data-zidan-max-size-mb")),a!=null&&a!==""){var n=parseFloat(a);n>0&&(r=Math.round(n*1024*1024))}}return{maxFiles:i>0?i:0,maxSize:r>0?r:0,accept:e.accept||t.accept||""}},d.prototype._setCustomValidity=function(t){this.el&&this.el.setCustomValidity&&this.el.setCustomValidity(t||"")},d.prototype._customError=function(){if(this.fileError)return this.fileError;if(typeof this.opts.validate=="function"){var t=this.opts.validate(this.getFiles(),this,this._asyncContext());if(t===!1)return this.opts.messages.generic;if(typeof t=="string"&&t||tt(t))return t}return""},d.prototype._validate=function(){var t=this.el,e=this.opts.messages,i=this._limits(),r=this.getFiles(),a="";if(i.maxFiles&&r.length>i.maxFiles&&(a=N(e.fileCount,{max:i.maxFiles}),r=r.slice(0,i.maxFiles),this._setFiles(r)),!a&&i.maxSize){for(var n=0;n<r.length;n+=1)if(r[n].size>i.maxSize){a=N(e.fileSize,{name:r[n].name,size:G(r[n].size),limit:G(i.maxSize)});break}}if(!a&&i.accept){for(var s=0;s<r.length;s+=1)if(!jt(r[s],i.accept)){a=N(e.fileType,{name:r[s].name,accept:i.accept});break}}this.fileError=a,t.setCustomValidity&&t.setCustomValidity(this.pending?e.pending||M.pending:a||"");var o=a||this._nativeError();return o?this.setError(o):this.errorMessage&&this.setError(null),this.root.classList.toggle("zs-field--filled",r.length>0),this.drop.classList.toggle("zs-file-drop--invalid",!!o),this._renderStatus(),!o},d.prototype._sync=function(){this._render()},d.prototype._queueRender=function(){var t=this;if(!(this._renderQueued||this.destroyed)){this._renderQueued=!0;var e=function(){t._renderQueued=!1,t.destroyed||t._render()};p.requestAnimationFrame?p.requestAnimationFrame(e):p.setTimeout(e,32)}},d.prototype._renderStatus=function(){var t=this.getFiles(),e=this.getUploadState(),i=t.reduce(function(u,_){return u+_.size},0),r=e.filter(function(u){return u.status==="uploading"}),a=e.filter(function(u){return u.status==="error"}),n=e.filter(function(u){return u.status==="done"}),s="";if(this.fileError)s=this.fileError;else if(t.length)if(s=t.length+(t.length===1?" file selected":" files selected")+" \xB7 "+G(i),r.length){var o=Math.round(r.reduce(function(u,_){return u+_.progress},0)/r.length);s+=" \xB7 Uploading "+o+"%"}else a.length?s+=" \xB7 "+a.length+" failed":n.length===t.length&&this.hasUploader&&(s+=" \xB7 Uploaded");this.status.textContent=s,this.status.classList.toggle("zs-file-status--error",!!this.fileError),this.status.classList.toggle("zs-file-status--success",!this.fileError&&t.length>0&&n.length===t.length&&this.hasUploader)},d.prototype._render=function(){var t=this,e=this.getFiles(),i=this.opts;this.list.textContent="",this._revokeLater(this._urls),this._urls=[],this.list.hidden=e.length===0,this.clearBtn.hidden=e.length===0,this.root.classList.toggle("zs-field--filled",e.length>0),this.drop.classList.toggle("zs-file-drop--has-files",e.length>0);var r=this.showPreview?e.filter(function(n){return/^image\//.test(n.type)})[0]:null;if(r){var a=URL.createObjectURL(r);this._urls.push(a),this.avatarImg.src=a,this.avatarEl.hidden=!1,this.drop.classList.add("zs-file-drop--has-preview"),this.titleEl.textContent=i.replaceTitle||"Change image"}else this.avatarImg.removeAttribute("src"),this.avatarEl.hidden=!0,this.drop.classList.remove("zs-file-drop--has-preview"),this.titleEl.textContent=this._fallbackTitle;e.forEach(function(n,s){var o=t._stateFor(n,!1)||{status:"idle",progress:0,error:"",result:null},u=v("li","zs-file-item");u.setAttribute("data-zs-upload-state",o.status),u.setAttribute("data-zs-file-index",String(s));var _=v("span","zs-file-thumb");if(/^image\//.test(n.type)){var E=URL.createObjectURL(n);t._urls.push(E);var z=l.createElement("img");z.src=E,z.alt="",_.appendChild(z)}else _.textContent=(pt(n.name)||"file").replace(".","").slice(0,4).toUpperCase();var c=v("span","zs-file-info"),D=v("span","zs-file-name",null,n.name);if(c.appendChild(D),t.showFileMeta){var X=G(n.size)+(n.type?" \xB7 "+n.type:"");c.appendChild(v("span","zs-file-size",null,X))}if(t.hasUploader){var S=v("span","zs-file-upload-state");if(o.status==="uploading"){S.textContent=N(i.progressTemplate||"Uploading {percent}%",{percent:o.progress});var b=v("span","zs-file-progress");b.setAttribute("role","progressbar"),b.setAttribute("aria-valuemin","0"),b.setAttribute("aria-valuemax","100"),b.setAttribute("aria-valuenow",String(o.progress)),b.setAttribute("aria-label","Upload progress for "+n.name);var k=v("span","zs-file-progress-bar");k.style.width=o.progress+"%",b.appendChild(k),S.appendChild(b)}else o.status==="done"?S.textContent=i.uploadedLabel||"Uploaded":o.status==="error"?S.textContent=(i.failedLabel||"Upload failed")+(o.error?" \u2014 "+o.error:""):o.status==="canceled"&&(S.textContent=i.canceledLabel||"Upload canceled");S.textContent&&c.appendChild(S)}var x=v("span","zs-file-actions");if(o.status==="uploading"){var B=v("button","zs-file-cancel",{type:"button","aria-label":"Cancel upload of "+n.name});B.textContent=i.cancelLabel||"Cancel",x.appendChild(B)}else if(o.status==="error"||o.status==="canceled"){var F=v("button","zs-file-retry",{type:"button","aria-label":"Retry upload of "+n.name});F.textContent=i.retryLabel||"Retry",x.appendChild(F)}var q=v("button","zs-file-remove",{type:"button","aria-label":"Remove "+n.name});if(q.textContent="\xD7",x.appendChild(q),u.appendChild(_),u.appendChild(c),u.appendChild(x),t.list.appendChild(u),typeof i.renderFile=="function")try{i.renderFile(u,{file:n,index:s,state:o,field:t})}catch(Z){t.emit("error",{error:Z,callback:"renderFile"})}}),this._renderStatus()},d.prototype.setVariant=function(t){var e=L(t,R,this.variant);return e===this.variant?this:(this.variant=e,R.forEach(function(i){this.drop.classList.remove("zs-file-drop--"+i)},this),this.drop.classList.add("zs-file-drop--"+e),this.root.setAttribute("data-zs-file-variant",e),this._render(),this)},d.prototype.setUploader=function(t){return typeof t=="function"?(this.uploadHandler=t,this.uploadUrl=""):(this.uploadHandler=null,this.uploadUrl=t?String(t):""),this.hasUploader=!!(this.uploadHandler||this.uploadUrl||this.simulateUpload),this.root.setAttribute("data-zs-upload",this.hasUploader?"true":"false"),this._render(),this},d.prototype._formData=function(t){var e=new FormData;e.append(this.uploadField,t,t.name);var i=typeof this.opts.uploadData=="function"?this.opts.uploadData(t,this):this.opts.uploadData;return i&&typeof i=="object"&&Object.keys(i).forEach(function(r){var a=i[r];a!=null&&e.append(r,a)}),e},d.prototype.uploadAll=function(){var t=this;if(!this.hasUploader)return this;if(!this._validate())return this;var e=this.validate();return tt(e)?e.then(function(i){return i&&!t.destroyed&&t.getFiles().forEach(function(r){t.uploadFile(r)}),i}):e?(this.getFiles().forEach(function(i){t.uploadFile(i)}),this):this},d.prototype.uploadFile=function(t){var e=this,i=w(t),r=this._stateFor(t,!0);if(r.status==="uploading"||r.status==="done")return this;if(r.status="uploading",r.progress=0,r.error="",r.result=null,this._queueRender(),this.emit("upload-start",{file:t,name:t.name,size:t.size}),this.call("onUploadStart",{file:t,name:t.name,size:t.size,instance:this}),this.uploadHandler){var a=typeof AbortController!="undefined"?new AbortController:null;this._active[i]={type:"handler",abort:function(){a&&a.abort()}};var n={file:t,field:this,formData:this._formData(t),signal:a?a.signal:null,onProgress:function(c){e._setProgress(t,c)},complete:function(c){e._finish(t,c)},fail:function(c){e._fail(t,c)}},s;try{s=this.uploadHandler(t,n)}catch(c){return this._fail(t,c),this}return s&&typeof s.then=="function"?s.then(function(c){e._finish(t,c)},function(c){c&&(c.name==="AbortError"||c.aborted)?e._canceledUpload(t):e._fail(t,c)}):s!==void 0&&this._finish(t,s),this}if(this.uploadUrl){var o=new p.XMLHttpRequest;this._active[i]={type:"xhr",abort:function(){try{o.abort()}catch{}}},o.open("POST",this.uploadUrl,!0),this.withCredentials&&(o.withCredentials=!0);var u=typeof this.uploadHeaders=="function"?this.uploadHeaders(t,this):this.uploadHeaders;return u&&typeof u=="object"&&Object.keys(u).forEach(function(c){o.setRequestHeader(c,u[c])}),o.upload.onprogress=function(c){c.lengthComputable&&e._setProgress(t,Math.min(99,Math.round(c.loaded/c.total*100)))},o.onload=function(){if(o.status>=200&&o.status<300){var c=o.responseText;try{c=JSON.parse(c)}catch{}e._finish(t,c)}else e._fail(t,{status:o.status,message:"Upload failed (HTTP "+o.status+")."})},o.onerror=function(){e._fail(t,{message:"Network error while uploading."})},o.onabort=function(){e._canceledUpload(t)},o.send(this._formData(t)),this}if(this.simulateUpload){var _=Date.now(),E=null,z=function(){if(!(!e._uploads[i]||r.status!=="uploading")){var c=Math.min(99,Math.round((Date.now()-_)/e.simulateDuration*100));e._setProgress(t,c),c>=99?(delete e._active[i],e._finish(t,{simulated:!0})):E=p.setTimeout(z,40)}};return this._active[i]={type:"simulation",abort:function(){E&&p.clearTimeout(E)}},E=p.setTimeout(z,40),this}return r.status="idle",this._queueRender(),this},d.prototype._setProgress=function(t,e){var i=this._stateFor(t,!1);if(!(!i||i.status!=="uploading")){var r=Ot(Math.round(Number(e)||0),0,99);r!==i.progress&&(i.progress=r,this._queueRender(),this.emit("upload-progress",{file:t,progress:r,name:t.name}),this.call("onUploadProgress",{file:t,progress:r,name:t.name,instance:this}))}},d.prototype._finish=function(t,e){var i=this._stateFor(t,!1);!i||i.status!=="uploading"||(delete this._active[w(t)],i.status="done",i.progress=100,i.result=e===void 0?null:e,this._queueRender(),this.emit("upload-success",{file:t,name:t.name,result:i.result}),this.call("onUploadSuccess",{file:t,name:t.name,result:i.result,instance:this}),this.call("onUpload",{file:t,name:t.name,result:i.result,instance:this}))},d.prototype._fail=function(t,e){var i=this._stateFor(t,!1);!i||i.status!=="uploading"||(delete this._active[w(t)],i.status="error",i.error=Gt(e,this.opts.messages.upload||"Upload failed."),this._queueRender(),this.emit("upload-error",{file:t,name:t.name,error:e,message:i.error}),this.call("onUploadError",{file:t,name:t.name,error:e,message:i.error,instance:this}))},d.prototype._canceledUpload=function(t){var e=this._stateFor(t,!1);!e||e.status!=="uploading"||(delete this._active[w(t)],e.status="canceled",e.progress=0,e.error="",this._queueRender(),this.emit("upload-cancel",{file:t,name:t.name}),this.call("onUploadCancel",{file:t,name:t.name,instance:this}))},d.prototype.cancelUpload=function(t){var e=w(t),i=this._active[e];if(i){try{i.abort()}catch{}delete this._active[e]}return this._canceledUpload(t),this},d.prototype.cancelAll=function(){var t=this;return Object.keys(this._active).forEach(function(e){try{t._active[e].abort()}catch{}delete t._active[e]}),this},d.prototype.retryUpload=function(t){var e=this._stateFor(t,!1);return e?(e.status="idle",e.progress=0,e.error="",this.uploadFile(t)):this},d.prototype._revokeLater=function(t){!t||!t.length||p.setTimeout(function(){t.forEach(function(e){try{URL.revokeObjectURL(e)}catch{}})},800)},d.prototype._teardown=function(){this.cancelAll(),this._uploads=Object.create(null),this._revokeLater(this._urls),this._urls=[],this._restoreInput&&this._restoreInput()};function U(t){if(!y(t))return null;var e=String(t.getAttribute("data-zidan")||"").toLowerCase();if(Ct.indexOf(e)!==-1)return e;if(t.hasAttribute("data-zidan-radio-group"))return"radio-group";if(t.hasAttribute("data-zidan-radio"))return"radio";if(t.hasAttribute("data-zidan-checkbox")||t.hasAttribute("data-zidan-switch"))return"checkbox";if(t.hasAttribute("data-zidan-file"))return"file";if(t.hasAttribute("data-zidan-textarea"))return"textarea";if(t.hasAttribute("data-zidan-input"))return"input";var i=String(t.type||"").toLowerCase();if(i==="checkbox")return"checkbox";if(i==="radio")return"radio";if(i==="file")return"file";if(Mt(t,"zidan-field")){if(t.tagName==="FIELDSET")return t.querySelector('input[type="radio"]')?"radio-group":null;if(t.tagName==="TEXTAREA")return"textarea";if(t.tagName!=="INPUT"||i==="radio")return null;if(typeof TEXT_TYPES!="undefined"&&TEXT_TYPES.indexOf(i)!==-1)return"input"}return null}function Y(t,e,i){var r=I(Zt(t),i);if(t.__zidanField&&!r.force)return t.__zidanField;switch(e){case"checkbox":return typeof ZidanCheckbox!="undefined"?new ZidanCheckbox(t,r):null;case"radio":case"radio-group":return typeof ZidanRadioGroup!="undefined"?new ZidanRadioGroup(t,r):null;case"file":return typeof d!="undefined"?new d(t,r):null;case"input":case"textarea":return typeof ZidanTextField!="undefined"?new ZidanTextField(t,r):null;default:return null}}function vt(t,e){var i=[];typeof t=="string"?i=Array.prototype.slice.call(l.querySelectorAll(t)):y(t)?i=[t]:t&&typeof t.length=="number"&&(i=Array.prototype.slice.call(t));var r=[];return i.forEach(function(a){if(!a.__zidanField){var n=U(a)||_t(a);if(n){if(n==="radio"||n==="radio-group"){if(/^INPUT$/i.test(a.tagName)&&(a=a.closest?a.closest("fieldset, [data-zidan-radio-group]"):null,!a))return;n="radio-group"}var s=Y(a,n,e||{});s&&r.push(s)}}}),r.length===1?r[0]:r}function mt(t,e){var i=[];return t.forEach(function(r){if(!(!y(r)||r.__zidanField)){var a=U(r);if(a){if(a==="radio"||a==="radio-group"){if(/^INPUT$/i.test(r.tagName)&&(r=r.closest?r.closest("fieldset, [data-zidan-radio-group]"):null,!r))return;a="radio-group"}var n=Y(r,a,e||{});n&&i.push(n)}}}),i}function V(t,e){var i=t||l;if(!i||!i.querySelectorAll)return[];var r=Array.prototype.slice.call(i.querySelectorAll(at));return y(i)&&i.matches&&i.matches(at)&&r.unshift(i),mt(r,e)}var h={version:T,__zidanFormGuard:T,themes:W,frameworks:H.slice(),fieldLayouts:J,fields:[],_register:function(t){h.fields.indexOf(t)===-1&&h.fields.push(t)},_unregister:function(t){var e=h.fields.indexOf(t);e!==-1&&h.fields.splice(e,1)},get:function(t){var e=typeof t=="string"?l.querySelector(t):t;return y(e)&&e.__zidanField||null},init:function(t,e){return V(t||l,e||{})},field:vt,refresh:function(t){return V(t||l,{}),h.fields.slice().forEach(function(e){e.update()}),h.fields.slice()},destroyAll:function(){return h.fields.slice().forEach(function(t){t.destroy()}),h.fields=[],typeof ZidanSelect!="undefined"&&ZidanSelect.destroyAll&&ZidanSelect.destroyAll(),h},observe:function(t,e){var i=t||l.body;if(!i||!p.MutationObserver)return null;var r=new p.MutationObserver(function(a){a.forEach(function(n){Array.prototype.slice.call(n.addedNodes).forEach(function(s){y(s)&&(U(s)&&Y(s,U(s)==="radio"?"radio-group":U(s),e||{}),s.querySelectorAll&&V(s,e||{}))})}),h.fields.slice().forEach(function(n){n.el.isConnected||n.destroy()}),typeof ZidanSelect!="undefined"&&ZidanSelect.instances.slice().forEach(function(n){n.el.isConnected||n.destroy()})});return r.observe(i,{childList:!0,subtree:!0}),r}};h.api=null,h.registerIcon=lt,h.icons=O,typeof PHONE_COUNTRIES!="undefined"&&(h.phoneCountries=PHONE_COUNTRIES,h.phoneFormats=PHONE_FORMATS.slice(),h.formatPhone=formatPhone,h.detectPhoneCountry=detectPhoneCountry),h.messages=M,h.variants={},typeof ut!="undefined"&&(h.variants.checkbox=ut.slice()),typeof ft!="undefined"&&(h.variants.switch=ft.slice()),typeof ct!="undefined"&&(h.variants.radio=ct.slice()),typeof R!="undefined"&&(h.variants.file=R.slice()),typeof ht!="undefined"&&(h.variants.range=ht.slice()),typeof STEPPER_MODES!="undefined"&&(h.stepperModes=STEPPER_MODES.slice()),h.fieldLayouts=J.slice(),typeof ZidanSelect!="undefined"&&(ZidanSelect.version=T,ZidanSelect.__zidanSelectGuard=T,ZidanSelect.layouts=zt.slice(),ZidanSelect.frameworks=H.slice(),ZidanSelect.scrollbars=xt.slice(),ZidanSelect.defaults=DEFAULTS,ZidanSelect.cacheLimit=50,ZidanSelect.get=function(t){var e=typeof t=="string"?l.querySelector(t):t;return y(e)&&e.__zidanSelect||null},ZidanSelect.instances=[],ZidanSelect.destroyAll=function(){ZidanSelect.instances.slice().forEach(function(t){t.destroy()}),ZidanSelect.instances=[]});function Yt(t,e){var i=[];typeof t=="string"?i=Array.prototype.slice.call(l.querySelectorAll(t)):t&&typeof t.length=="number"&&!y(t)&&t!==p?i=Array.prototype.slice.call(t):y(t)&&(i=[t]);var r=i.map(function(a){var n=new ZidanSelect(a,e||{});return ZidanSelect.instances.push(n),n});return r.length===1?r[0]:r}function it(t,e){return t.filter(function(i){return y(i)&&!i.__zidanSelect}).map(function(i){return ZidanSelect.instances.push(new ZidanSelect(i,e||{})),i.__zidanSelect})}function yt(t,e){var i=t||l;if(!i||!i.querySelectorAll)return[];var r=Array.prototype.slice.call(i.querySelectorAll(Q));return y(i)&&i.matches&&i.matches(Q)&&r.unshift(i),it(r,e)}function rt(t,e){$(t).forEach(function(i){i&&(typeof i=="string"?e(i,null):i.selector&&e(String(i.selector),i.options||null))})}function gt(t,e){rt(t,function(i,r){it(Array.prototype.slice.call(l.querySelectorAll(i)),I(e,r))})}function Xt(t,e){rt(t,function(i,r){var a=I(e,r);Array.prototype.slice.call(l.querySelectorAll(i)).forEach(function(n){if(!(!y(n)||n.__zidanField)){var s=U(n)||_t(n);s&&(s==="radio"&&(s="radio-group"),Y(n,s,a))}})})}function _t(t){return typeof TEXT_TYPES=="undefined"||!y(t)?null:t.tagName==="TEXTAREA"?"textarea":t.tagName!=="INPUT"?null:TEXT_TYPES.indexOf(String(t.type).toLowerCase())!==-1?"input":null}function Kt(t,e){if(typeof ZidanSelect=="undefined")return[];var i=Q+", select",r=Array.prototype.slice.call(t.querySelectorAll(i));return y(t)&&t.matches&&t.matches(i)&&r.unshift(t),it(r,e)}function bt(t,e,i){y(t)&&(Kt(t,e),typeof d!="undefined"&&mt(Array.prototype.slice.call(t.querySelectorAll('input[type="file"]')),i),(typeof ZidanCheckbox!="undefined"||typeof ZidanRadioGroup!="undefined"||typeof d!="undefined"||typeof ZidanTextField!="undefined")&&V(t,i))}function Wt(t,e,i){Array.prototype.slice.call(l.querySelectorAll(wt)).forEach(function(r){bt(r,e,i)}),rt(t,function(r,a){Array.prototype.slice.call(l.querySelectorAll(r)).forEach(function(n){bt(n,I(e,a),I(i,a))})})}function At(){if(l){var t=p.ZIDAN_FORM_CONFIG||p.ZIDAN_SELECT_CONFIG||{};if(t.autoInit!==!1&&!(p.ZidanSelect&&p.ZidanSelect.autoInit===!1)&&l.documentElement.getAttribute("data-zidan-auto-init")!=="false"){var e=typeof ZidanSelect!="undefined",i=typeof ZidanCheckbox!="undefined"||typeof ZidanRadioGroup!="undefined"||typeof d!="undefined"||typeof ZidanTextField!="undefined",r=t.options||{},a=t.fieldOptions||t.fields||{};e&&(t.selector?gt(t.selector,r):gt(t.targets||t.selectors,r)),i&&Xt(t.fieldTargets,a),Wt(t.formTargets,r,a),e&&!t.selector&&yt(l,r),i&&V(l,a)}}}l&&(l.readyState==="loading"?l.addEventListener("DOMContentLoaded",At):setTimeout(At,0));var g={ZidanForm:h,registerIcon:lt};return typeof ZidanSelect!="undefined"&&(g.ZidanSelect=ZidanSelect,g.zidanSelect=Yt,g.initZidanSelects=yt),(typeof ZidanCheckbox!="undefined"||typeof ZidanRadioGroup!="undefined"||typeof d!="undefined"||typeof ZidanTextField!="undefined")&&(g.zidanField=vt,g.initZidanForms=V),typeof ZidanCheckbox!="undefined"&&(g.ZidanCheckbox=ZidanCheckbox),typeof ZidanRadioGroup!="undefined"&&(g.ZidanRadioGroup=ZidanRadioGroup),typeof d!="undefined"&&(g.ZidanFileUpload=d),typeof ZidanTextField!="undefined"&&(g.ZidanTextField=ZidanTextField),typeof formatPhone=="function"&&(g.formatPhone=formatPhone,g.detectPhoneCountry=detectPhoneCountry),h.api=g,g});
|
package/dist/plugin-core.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ZidanForm v2.
|
|
2
|
+
* ZidanForm v2.3.1 — plugin-core.css
|
|
3
3
|
* Structure and mechanics only: layout, positioning, visibility, focus
|
|
4
4
|
* plumbing and accessible native-input handling. No colours, borders colours,
|
|
5
5
|
* shadows or decorative skin — load plugin-theme.css (or your own theme) for
|
|
@@ -301,7 +301,7 @@
|
|
|
301
301
|
flex: 0 0 auto;
|
|
302
302
|
width: 14px;
|
|
303
303
|
height: 14px;
|
|
304
|
-
margin-
|
|
304
|
+
margin-inline-start: auto;
|
|
305
305
|
background-color: currentColor;
|
|
306
306
|
-webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
|
|
307
307
|
mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
|
|
@@ -338,6 +338,25 @@
|
|
|
338
338
|
to { transform: rotate(360deg); }
|
|
339
339
|
}
|
|
340
340
|
|
|
341
|
+
.zs-root .zs-more {
|
|
342
|
+
display: flex;
|
|
343
|
+
align-items: center;
|
|
344
|
+
justify-content: center;
|
|
345
|
+
gap: 8px;
|
|
346
|
+
width: 100%;
|
|
347
|
+
padding: 10px 12px;
|
|
348
|
+
border: 0;
|
|
349
|
+
border-top: 1px solid transparent;
|
|
350
|
+
background: none;
|
|
351
|
+
font: inherit;
|
|
352
|
+
font-size: 0.8125rem;
|
|
353
|
+
cursor: pointer;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.zs-root .zs-more[disabled] {
|
|
357
|
+
cursor: default;
|
|
358
|
+
}
|
|
359
|
+
|
|
341
360
|
@media (max-width: 480px) {
|
|
342
361
|
.zs-root .zs-dropdown {
|
|
343
362
|
max-height: min(280px, 45vh);
|
|
@@ -378,7 +397,7 @@
|
|
|
378
397
|
|
|
379
398
|
.zs-root[data-zs-layout="floating-label"] .zs-label {
|
|
380
399
|
position: absolute;
|
|
381
|
-
|
|
400
|
+
inset-inline-start: calc(var(--zs-padding-x, 12px) + 1px);
|
|
382
401
|
top: 50%;
|
|
383
402
|
margin: 0;
|
|
384
403
|
padding: 0 4px;
|
|
@@ -472,11 +491,37 @@
|
|
|
472
491
|
================================================================== */
|
|
473
492
|
|
|
474
493
|
.zs-field {
|
|
494
|
+
position: relative;
|
|
475
495
|
display: flex;
|
|
476
496
|
flex-direction: column;
|
|
477
497
|
gap: var(--zs-field-gap, 6px);
|
|
478
498
|
}
|
|
479
499
|
|
|
500
|
+
.zs-field--pending::after {
|
|
501
|
+
content: "";
|
|
502
|
+
position: absolute;
|
|
503
|
+
top: 2px;
|
|
504
|
+
inset-inline-end: 0;
|
|
505
|
+
width: 0.85em;
|
|
506
|
+
height: 0.85em;
|
|
507
|
+
border-width: 2px;
|
|
508
|
+
border-style: solid;
|
|
509
|
+
border-color: transparent;
|
|
510
|
+
border-radius: 50%;
|
|
511
|
+
animation: zs-field-spin 0.7s linear infinite;
|
|
512
|
+
pointer-events: none;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
@keyframes zs-field-spin {
|
|
516
|
+
to { transform: rotate(360deg); }
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
@media (prefers-reduced-motion: reduce) {
|
|
520
|
+
.zs-field--pending::after {
|
|
521
|
+
animation-duration: 2s;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
|
|
480
525
|
.zs-field[data-zs-layout="inline"] {
|
|
481
526
|
flex-direction: row;
|
|
482
527
|
align-items: center;
|
|
@@ -491,6 +536,13 @@
|
|
|
491
536
|
letter-spacing: 0.01em;
|
|
492
537
|
}
|
|
493
538
|
|
|
539
|
+
/* The plugin renders its own label and hides the author's original one. Author
|
|
540
|
+
rules such as `.field-label { display:block }` would otherwise beat the
|
|
541
|
+
browser's [hidden] default and show both labels at once. */
|
|
542
|
+
[data-zs-hidden-label] {
|
|
543
|
+
display: none !important;
|
|
544
|
+
}
|
|
545
|
+
|
|
494
546
|
.zs-field__hint {
|
|
495
547
|
margin: 0;
|
|
496
548
|
font-size: 0.75rem;
|
|
@@ -514,7 +566,7 @@
|
|
|
514
566
|
}
|
|
515
567
|
|
|
516
568
|
.zs-counter {
|
|
517
|
-
margin-
|
|
569
|
+
margin-inline-start: auto;
|
|
518
570
|
font-size: 0.75rem;
|
|
519
571
|
font-variant-numeric: tabular-nums;
|
|
520
572
|
white-space: nowrap;
|
|
@@ -629,7 +681,7 @@
|
|
|
629
681
|
content: "";
|
|
630
682
|
position: absolute;
|
|
631
683
|
top: 50%;
|
|
632
|
-
|
|
684
|
+
inset-inline-start: 2px;
|
|
633
685
|
width: calc(var(--zs-switch-height, 22px) - 6px);
|
|
634
686
|
height: calc(var(--zs-switch-height, 22px) - 6px);
|
|
635
687
|
transform: translateY(-50%);
|
|
@@ -656,11 +708,11 @@
|
|
|
656
708
|
}
|
|
657
709
|
|
|
658
710
|
.zs-switch-on {
|
|
659
|
-
|
|
711
|
+
inset-inline-start: 5px;
|
|
660
712
|
}
|
|
661
713
|
|
|
662
714
|
.zs-switch-off {
|
|
663
|
-
|
|
715
|
+
inset-inline-end: 5px;
|
|
664
716
|
}
|
|
665
717
|
|
|
666
718
|
.zs-check--checked .zs-switch-on {
|
|
@@ -680,7 +732,7 @@
|
|
|
680
732
|
.zs-field[data-zs-switch-style="material"] .zs-switch-track::after {
|
|
681
733
|
width: 22px;
|
|
682
734
|
height: 22px;
|
|
683
|
-
|
|
735
|
+
inset-inline-start: -2px;
|
|
684
736
|
border-radius: 50%;
|
|
685
737
|
}
|
|
686
738
|
|
|
@@ -730,6 +782,33 @@
|
|
|
730
782
|
font-size: 0.625rem;
|
|
731
783
|
}
|
|
732
784
|
|
|
785
|
+
/* right-to-left: the knob travels from the inline start towards the inline end */
|
|
786
|
+
[dir="rtl"] .zs-check--checked .zs-switch-track::after {
|
|
787
|
+
transform: translate(calc(-1 * (var(--zs-switch-width, 40px) - var(--zs-switch-height, 22px))), -50%);
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
[dir="rtl"] .zs-field[data-zs-switch-style="material"] .zs-check--checked .zs-switch-track::after {
|
|
791
|
+
transform: translate(-26px, -50%);
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
[dir="rtl"] .zs-field[data-zs-switch-style="labeled"] .zs-check--checked .zs-switch-track::after,
|
|
795
|
+
[dir="rtl"] .zs-field[data-zs-switch-style="icon"] .zs-check--checked .zs-switch-track::after {
|
|
796
|
+
transform: translate(-32px, -50%);
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
.zs-field[dir="rtl"] .zs-check--checked .zs-switch-track::after {
|
|
800
|
+
transform: translate(calc(-1 * (var(--zs-switch-width, 40px) - var(--zs-switch-height, 22px))), -50%);
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
.zs-field[dir="rtl"][data-zs-switch-style="material"] .zs-check--checked .zs-switch-track::after {
|
|
804
|
+
transform: translate(-26px, -50%);
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
.zs-field[dir="rtl"][data-zs-switch-style="labeled"] .zs-check--checked .zs-switch-track::after,
|
|
808
|
+
.zs-field[dir="rtl"][data-zs-switch-style="icon"] .zs-check--checked .zs-switch-track::after {
|
|
809
|
+
transform: translate(-32px, -50%);
|
|
810
|
+
}
|
|
811
|
+
|
|
733
812
|
/* card variant */
|
|
734
813
|
.zs-field[data-zs-variant="card"] .zs-check {
|
|
735
814
|
width: 100%;
|
|
@@ -1013,7 +1092,7 @@
|
|
|
1013
1092
|
}
|
|
1014
1093
|
|
|
1015
1094
|
.zs-file-clear {
|
|
1016
|
-
margin-
|
|
1095
|
+
margin-inline-start: auto;
|
|
1017
1096
|
padding: 2px 8px;
|
|
1018
1097
|
border-width: 1px;
|
|
1019
1098
|
border-style: solid;
|
|
@@ -1036,7 +1115,7 @@
|
|
|
1036
1115
|
gap: 8px;
|
|
1037
1116
|
min-height: 0;
|
|
1038
1117
|
padding: 10px 14px;
|
|
1039
|
-
text-align:
|
|
1118
|
+
text-align: start;
|
|
1040
1119
|
border-style: solid;
|
|
1041
1120
|
}
|
|
1042
1121
|
|
|
@@ -1053,7 +1132,7 @@
|
|
|
1053
1132
|
|
|
1054
1133
|
.zs-field--file .zs-file-drop--button .zs-file-drop-hint,
|
|
1055
1134
|
.zs-field--file .zs-file-drop--compact .zs-file-drop-hint {
|
|
1056
|
-
margin-
|
|
1135
|
+
margin-inline-start: auto;
|
|
1057
1136
|
}
|
|
1058
1137
|
|
|
1059
1138
|
.zs-field--file .zs-file-drop--avatar {
|
|
@@ -1344,8 +1423,8 @@ textarea.zs-input-native {
|
|
|
1344
1423
|
color: inherit;
|
|
1345
1424
|
background: transparent;
|
|
1346
1425
|
border: 0;
|
|
1347
|
-
border-
|
|
1348
|
-
border-
|
|
1426
|
+
border-inline-end-width: 1px;
|
|
1427
|
+
border-inline-end-style: solid;
|
|
1349
1428
|
cursor: pointer;
|
|
1350
1429
|
}
|
|
1351
1430
|
|
|
@@ -1456,6 +1535,7 @@ textarea.zs-input-native {
|
|
|
1456
1535
|
|
|
1457
1536
|
.zs-range-tick {
|
|
1458
1537
|
position: absolute;
|
|
1538
|
+
inset-inline-start: var(--zs-range-tick-pct, 0);
|
|
1459
1539
|
top: 0;
|
|
1460
1540
|
width: 2px;
|
|
1461
1541
|
height: 6px;
|
|
@@ -1479,10 +1559,30 @@ textarea.zs-input-native {
|
|
|
1479
1559
|
font-variant-numeric: tabular-nums;
|
|
1480
1560
|
}
|
|
1481
1561
|
|
|
1562
|
+
/* labeled endpoint ticks already show min and max: keep the row for layout,
|
|
1563
|
+
hide its text so the endpoints are printed once */
|
|
1564
|
+
.zs-range-scale--hidden {
|
|
1565
|
+
visibility: hidden;
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
/* labeled ticks without a scale row need the label height reserved */
|
|
1569
|
+
.zs-range--labels-no-scale {
|
|
1570
|
+
padding-bottom: 18px;
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
/* keep endpoint tick labels inside the track instead of half outside it */
|
|
1574
|
+
.zs-range-tick--labeled.zs-range-tick--start {
|
|
1575
|
+
transform: translateX(0);
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
.zs-range-tick--labeled.zs-range-tick--end {
|
|
1579
|
+
transform: translateX(-100%);
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1482
1582
|
.zs-range-bubble {
|
|
1483
1583
|
position: absolute;
|
|
1484
1584
|
top: 0;
|
|
1485
|
-
|
|
1585
|
+
inset-inline-start: calc(var(--zs-range-pct, 0) * 100%);
|
|
1486
1586
|
min-width: 28px;
|
|
1487
1587
|
padding: 1px 6px;
|
|
1488
1588
|
text-align: center;
|
|
@@ -1495,6 +1595,105 @@ textarea.zs-input-native {
|
|
|
1495
1595
|
pointer-events: none;
|
|
1496
1596
|
}
|
|
1497
1597
|
|
|
1598
|
+
/* bubble and fill options */
|
|
1599
|
+
.zs-range--no-bubble {
|
|
1600
|
+
padding-top: 4px;
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
.zs-range--bubble-active .zs-range-bubble {
|
|
1604
|
+
opacity: 0;
|
|
1605
|
+
visibility: hidden;
|
|
1606
|
+
transition: opacity 140ms ease;
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
.zs-range--bubble-active:hover .zs-range-bubble,
|
|
1610
|
+
.zs-range--bubble-active:focus-within .zs-range-bubble,
|
|
1611
|
+
.zs-field--focused .zs-range--bubble-active .zs-range-bubble {
|
|
1612
|
+
opacity: 1;
|
|
1613
|
+
visibility: visible;
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1616
|
+
.zs-range--bubble-bottom {
|
|
1617
|
+
padding-bottom: 30px;
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
/* labels sit above the bubble, so both need room */
|
|
1621
|
+
.zs-range--bubble-bottom.zs-range--labels-no-scale {
|
|
1622
|
+
padding-bottom: 38px;
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
.zs-range--bubble-bottom .zs-range-bubble {
|
|
1626
|
+
top: auto;
|
|
1627
|
+
bottom: 0;
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
.zs-range--fill-off .zs-input-native::-webkit-slider-runnable-track {
|
|
1631
|
+
background: var(--zs-range-track);
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
.zs-range--fill-off .zs-input-native::-moz-range-progress {
|
|
1635
|
+
background: var(--zs-range-track);
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
[dir="rtl"] .zs-range-tick,
|
|
1639
|
+
[dir="rtl"] .zs-range-tick--labeled {
|
|
1640
|
+
transform: translateX(50%);
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
[dir="rtl"] .zs-range-bubble {
|
|
1644
|
+
transform: translateX(50%);
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
.zs-field[dir="rtl"] .zs-range-tick,
|
|
1648
|
+
.zs-field[dir="rtl"] .zs-range-tick--labeled {
|
|
1649
|
+
transform: translateX(50%);
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1652
|
+
.zs-field[dir="rtl"] .zs-range-bubble {
|
|
1653
|
+
transform: translateX(50%);
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
[dir="rtl"] .zs-range-tick--labeled.zs-range-tick--start {
|
|
1657
|
+
transform: translateX(-100%);
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
[dir="rtl"] .zs-range-tick--labeled.zs-range-tick--end {
|
|
1661
|
+
transform: translateX(0);
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
.zs-field[dir="rtl"] .zs-range-tick--labeled.zs-range-tick--start {
|
|
1665
|
+
transform: translateX(-100%);
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1668
|
+
.zs-field[dir="rtl"] .zs-range-tick--labeled.zs-range-tick--end {
|
|
1669
|
+
transform: translateX(0);
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
/* keep the value bubble inside the track at both ends */
|
|
1673
|
+
.zs-range-bubble--start {
|
|
1674
|
+
transform: translateX(0);
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
.zs-range-bubble--end {
|
|
1678
|
+
transform: translateX(-100%);
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
[dir="rtl"] .zs-range-bubble--start {
|
|
1682
|
+
transform: translateX(-100%);
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
[dir="rtl"] .zs-range-bubble--end {
|
|
1686
|
+
transform: translateX(0);
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
.zs-field[dir="rtl"] .zs-range-bubble--start {
|
|
1690
|
+
transform: translateX(-100%);
|
|
1691
|
+
}
|
|
1692
|
+
|
|
1693
|
+
.zs-field[dir="rtl"] .zs-range-bubble--end {
|
|
1694
|
+
transform: translateX(0);
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1498
1697
|
/* validation state icons */
|
|
1499
1698
|
.zs-input-validation {
|
|
1500
1699
|
display: none;
|
|
@@ -1524,7 +1723,7 @@ textarea.zs-input-native {
|
|
|
1524
1723
|
.zs-field[data-zs-layout="floating"] .zs-field__label,
|
|
1525
1724
|
.zs-field[data-zs-layout="outlined"] .zs-field__label {
|
|
1526
1725
|
position: absolute;
|
|
1527
|
-
|
|
1726
|
+
inset-inline-start: calc(var(--zs-padding-x, 12px) + 2px);
|
|
1528
1727
|
top: 50%;
|
|
1529
1728
|
margin: 0;
|
|
1530
1729
|
padding: 0 4px;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* ZidanForm v2.3.1 — plugin-core.css
|
|
3
|
+
* Structure and mechanics only: layout, positioning, visibility, focus
|
|
4
|
+
* plumbing and accessible native-input handling. No colours, borders colours,
|
|
5
|
+
* shadows or decorative skin — load plugin-theme.css (or your own theme) for
|
|
6
|
+
* appearance.
|
|
7
|
+
*
|
|
8
|
+
* https://github.com/akhtar1985/zidan-select
|
|
9
|
+
* MIT License © akhtar1985
|
|
10
|
+
*/.zs-root,.zs-field,.zs-radio-group{position:relative;display:block;width:100%;box-sizing:border-box;font-family:var(--zs-font-family, inherit);font-size:var(--zs-font-size, .9375rem);line-height:var(--zs-line-height, 1.4);-webkit-tap-highlight-color:transparent}.zs-root *,.zs-root *:before,.zs-root *:after,.zs-field *,.zs-field *:before,.zs-field *:after,.zs-radio-group *,.zs-radio-group *:before,.zs-radio-group *:after{box-sizing:border-box}.zs-root .zs-label{display:block;margin-bottom:6px;font-size:var(--zs-label-size, .8125rem);font-weight:600;letter-spacing:.01em}.zs-control{position:relative;display:flex;align-items:center;flex-wrap:wrap;gap:var(--zs-gap, 6px);width:100%;min-height:var(--zs-height, 44px);padding:var(--zs-padding-y, 5px) var(--zs-padding-x, 12px);border-width:var(--zs-border-width, 1px);border-style:solid;border-radius:var(--zs-radius, 10px);cursor:pointer;transition:border-color .15s ease,box-shadow .15s ease,background-color .15s ease}.zs-root .zs-control.form-control{display:flex;align-items:center;flex-wrap:wrap;gap:var(--zs-gap, 6px);padding:var(--zs-padding-y, 5px) var(--zs-padding-x, 12px);height:auto;min-height:var(--zs-height, 44px)}.zs-root--focus .zs-control,.zs-root--open .zs-control{outline:none}.zs-root--disabled .zs-control,.zs-root--disabled .zs-control:hover{cursor:not-allowed}.zs-root .zs-chips{display:flex;flex-wrap:wrap;align-items:center;gap:var(--zs-gap, 6px);max-width:100%}.zs-root .zs-chips[hidden]{display:none}.zs-root .zs-chip{display:inline-flex;align-items:center;gap:4px;max-width:100%;padding:3px 4px 3px 9px;font-size:.8125rem;font-weight:500;border-width:1px;border-style:solid;border-radius:var(--zs-chip-radius, 8px);transition:background-color .15s ease,border-color .15s ease}.zs-root .zs-chip-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.zs-root .zs-chip-remove{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;padding:0;border:0;border-radius:50%;cursor:pointer;opacity:.6;transition:opacity .15s ease,background-color .15s ease}.zs-root .zs-chip-remove:hover,.zs-root .zs-chip-remove:focus-visible{opacity:1;outline:none}.zs-root .zs-input{flex:1 1 60px;min-width:60px;height:32px;margin:0;padding:0;font:inherit;border:0;border-radius:0;outline:none;box-shadow:none;appearance:none;-webkit-appearance:none}.zs-root .zs-input:focus{outline:none;box-shadow:none}.zs-root .zs-input[readonly],.zs-root--disabled .zs-input{cursor:pointer}.zs-root--disabled .zs-input{cursor:not-allowed}.zs-root .zs-clear,.zs-root .zs-arrow{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto}.zs-root .zs-clear{width:22px;height:22px;padding:0;border:0;border-radius:50%;cursor:pointer;opacity:.75;transition:opacity .15s ease,background-color .15s ease}.zs-root .zs-clear[hidden]{display:none}.zs-root .zs-clear:hover{opacity:1}.zs-root .zs-clear:focus-visible{outline:none}.zs-root .zs-arrow{pointer-events:none;transition:transform .15s ease,color .15s ease}.zs-root--open .zs-arrow{transform:rotate(180deg)}.zs-root--tags .zs-control{padding-top:6px;padding-bottom:6px}.zs-root--tags .zs-input{height:28px}.zs-root .zs-dropdown{position:absolute;z-index:var(--zs-z-index, 1055);top:calc(100% + 6px);left:0;right:0;display:none;max-height:280px;padding:6px;overflow-y:auto;overscroll-behavior:contain;border-width:var(--zs-dropdown-border-width, 1px);border-style:solid;border-radius:var(--zs-dropdown-radius, 12px)}.zs-root--open .zs-dropdown{display:block;animation:zs-dropdown-in .14s ease-out}.zs-root--dropup .zs-dropdown{top:auto;bottom:calc(100% + 6px)}.zs-root--dropup.zs-root--open .zs-dropdown{animation-name:zs-dropdown-in-up}@keyframes zs-dropdown-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes zs-dropdown-in-up{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.zs-root .zs-group{padding:8px 10px 4px;font-size:.6875rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase}.zs-root .zs-option{display:flex;align-items:center;gap:8px;padding:var(--zs-option-padding-y, 9px) var(--zs-option-padding-x, 12px);border-radius:var(--zs-option-radius, 8px);cursor:pointer;transition:background-color 90ms linear,color 90ms linear;scroll-margin:6px}.zs-root .zs-option-label{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.zs-root .zs-option--selected:after{content:"";flex:0 0 auto;width:14px;height:14px;margin-inline-start:auto;background-color:currentColor;-webkit-mask:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;mask:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;opacity:.85}.zs-root .zs-option--disabled{cursor:not-allowed;opacity:.45}.zs-root .zs-option--disabled:after{display:none}.zs-root .zs-state{display:flex;align-items:center;gap:8px;padding:12px;font-size:.875rem}.zs-root .zs-spinner{width:14px;height:14px;border-width:2px;border-style:solid;border-radius:50%;animation:zs-spin .7s linear infinite}@keyframes zs-spin{to{transform:rotate(360deg)}}.zs-root .zs-more{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;padding:10px 12px;border:0;border-top:1px solid transparent;background:none;font:inherit;font-size:.8125rem;cursor:pointer}.zs-root .zs-more[disabled]{cursor:default}@media (max-width: 480px){.zs-root .zs-dropdown{max-height:min(280px,45vh)}}.zs-root .zs-live,.zs-field .zs-sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}.zs-root[data-zs-layout=classic-clean] .zs-control{padding-top:var(--zs-padding-y, 5px);padding-bottom:var(--zs-padding-y, 5px)}.zs-root[data-zs-layout=floating-label] .zs-control{padding-top:16px;padding-bottom:6px;align-items:flex-end}.zs-root[data-zs-layout=floating-label] .zs-label{position:absolute;inset-inline-start:calc(var(--zs-padding-x, 12px) + 1px);top:50%;margin:0;padding:0 4px;transform:translateY(-50%);font-size:var(--zs-font-size, .9375rem);font-weight:500;border-radius:4px;pointer-events:none;transition:transform .15s ease,font-size .15s ease,color .15s ease,top .15s ease}.zs-root[data-zs-layout=floating-label].zs-root--focus .zs-label,.zs-root[data-zs-layout=floating-label].zs-root--open .zs-label,.zs-root[data-zs-layout=floating-label].zs-root--has-value .zs-label{top:10px;transform:translateY(-50%) scale(.86);transform-origin:left center;font-weight:600}.zs-root[data-zs-layout=floating-label] .zs-input{height:28px}.zs-root[data-zs-layout=floating-label].zs-root--multiple .zs-control,.zs-root[data-zs-layout=floating-label].zs-root--tags .zs-control{padding-top:20px}.zs-root[data-zs-layout=soft-pill] .zs-chip-remove{width:20px;height:20px}.zs-root[data-zs-layout=soft-pill] .zs-dropdown{padding:8px}.zs-root[data-zs-layout=soft-pill].zs-root--multiple .zs-input,.zs-root[data-zs-layout=soft-pill].zs-root--tags .zs-input{min-width:90px}.zs-root[data-zs-layout=bordered-brutalist] .zs-control{font-weight:600}.zs-root[data-zs-layout=bordered-brutalist] .zs-chip{font-weight:700;letter-spacing:.01em}.zs-root[data-zs-layout=bordered-brutalist] .zs-dropdown{padding:0}.zs-root[data-zs-layout=bordered-brutalist] .zs-option{border-bottom-width:1px;border-bottom-style:solid;font-weight:500}.zs-root[data-zs-layout=bordered-brutalist] .zs-option:last-child{border-bottom:0}.zs-root[data-zs-layout=bordered-brutalist] .zs-group{border-bottom-width:2px;border-bottom-style:solid;font-weight:800}.zs-root[data-zs-layout=glass-elevated] .zs-control,.zs-root[data-zs-layout=glass-elevated] .zs-dropdown{-webkit-backdrop-filter:blur(14px) saturate(150%);backdrop-filter:blur(14px) saturate(150%)}.zs-root[data-zs-layout=glass-elevated] .zs-dropdown{-webkit-backdrop-filter:blur(18px) saturate(160%);backdrop-filter:blur(18px) saturate(160%)}.zs-root--mount{margin:0}.zs-field{position:relative;display:flex;flex-direction:column;gap:var(--zs-field-gap, 6px)}.zs-field--pending:after{content:"";position:absolute;top:2px;inset-inline-end:0;width:.85em;height:.85em;border-width:2px;border-style:solid;border-color:transparent;border-radius:50%;animation:zs-field-spin .7s linear infinite;pointer-events:none}@keyframes zs-field-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.zs-field--pending:after{animation-duration:2s}}.zs-field[data-zs-layout=inline]{flex-direction:row;align-items:center;flex-wrap:wrap;gap:10px}.zs-field__label{display:block;font-size:var(--zs-label-size, .8125rem);font-weight:600;letter-spacing:.01em}[data-zs-hidden-label]{display:none!important}.zs-field__hint{margin:0;font-size:.75rem}.zs-field__meta{display:flex;align-items:baseline;justify-content:space-between;gap:10px}.zs-field__error{margin:0;font-size:.75rem;line-height:1.35}.zs-field__error[hidden]{display:none}.zs-counter{margin-inline-start:auto;font-size:.75rem;font-variant-numeric:tabular-nums;white-space:nowrap}.zs-native-input{position:absolute;width:1px;height:1px;margin:0;padding:0;border:0;opacity:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.zs-field--inline .zs-check,.zs-field--inline .zs-radio{margin:0}.zs-check{position:relative;display:inline-flex;align-items:center;gap:var(--zs-check-gap, 10px);cursor:pointer;user-select:none}.zs-check--disabled{cursor:not-allowed}.zs-check-box,.zs-switch-track,.zs-radio-dot{position:relative;flex:0 0 auto;display:inline-block;width:var(--zs-check-size, 20px);height:var(--zs-check-size, 20px);border-width:var(--zs-border-width, 1px);border-style:solid;border-radius:var(--zs-check-radius, 6px);transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease}.zs-check-box:after,.zs-check-box:before{content:"";position:absolute;inset:0;opacity:0;transition:opacity .12s ease,transform .12s ease}.zs-check-box:after{-webkit-mask:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 5' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 13px 13px no-repeat;mask:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 5' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 13px 13px no-repeat}.zs-check-box:before{inset:5px 4px;border-radius:1px}.zs-check--checked .zs-check-box:after{opacity:1}.zs-check--indeterminate .zs-check-box:before{opacity:1}.zs-check-label{display:flex;flex-direction:column;gap:2px;min-width:0}.zs-check-label:empty{display:none}.zs-check-desc,.zs-radio-desc{display:block;font-size:.75rem;font-weight:400;line-height:1.35}.zs-switch-track{width:var(--zs-switch-width, 40px);height:var(--zs-switch-height, 22px);border-radius:999px}.zs-switch-track:after{content:"";position:absolute;top:50%;inset-inline-start:2px;width:calc(var(--zs-switch-height, 22px) - 6px);height:calc(var(--zs-switch-height, 22px) - 6px);transform:translateY(-50%);border-radius:50%;transition:transform .16s ease}.zs-check--checked .zs-switch-track:after{transform:translate(calc(var(--zs-switch-width, 40px) - var(--zs-switch-height, 22px)),-50%)}.zs-switch-on,.zs-switch-off{position:absolute;top:50%;transform:translateY(-50%);font-size:.5rem;font-weight:700;letter-spacing:.03em;line-height:1;opacity:0;transition:opacity .12s ease;pointer-events:none}.zs-switch-on{inset-inline-start:5px}.zs-switch-off{inset-inline-end:5px}.zs-check--checked .zs-switch-on{opacity:1}.zs-check:not(.zs-check--checked) .zs-switch-off{opacity:1}.zs-field[data-zs-switch-style=material] .zs-switch-track{width:46px;height:20px}.zs-field[data-zs-switch-style=material] .zs-switch-track:after{width:22px;height:22px;inset-inline-start:-2px;border-radius:50%}.zs-field[data-zs-switch-style=material] .zs-check--checked .zs-switch-track:after{transform:translate(26px,-50%)}.zs-field[data-zs-switch-style=square] .zs-switch-track,.zs-field[data-zs-switch-style=square] .zs-switch-track:after{border-radius:4px}.zs-field[data-zs-switch-style=labeled] .zs-switch-track,.zs-field[data-zs-switch-style=icon] .zs-switch-track{width:var(--zs-switch-width-lg, 56px);height:var(--zs-switch-height-lg, 24px)}.zs-field[data-zs-switch-style=labeled] .zs-switch-track:after,.zs-field[data-zs-switch-style=icon] .zs-switch-track:after{width:18px;height:18px}.zs-field[data-zs-switch-style=labeled] .zs-check--checked .zs-switch-track:after,.zs-field[data-zs-switch-style=icon] .zs-check--checked .zs-switch-track:after{transform:translate(32px,-50%)}.zs-field[data-zs-switch-style=labeled] .zs-switch-on,.zs-field[data-zs-switch-style=labeled] .zs-switch-off{font-size:.5625rem}.zs-field[data-zs-switch-style=icon] .zs-switch-on,.zs-field[data-zs-switch-style=icon] .zs-switch-off{font-size:0}.zs-field[data-zs-switch-style=icon] .zs-switch-on:before{content:"\2713";font-size:.625rem}.zs-field[data-zs-switch-style=icon] .zs-switch-off:before{content:"\2715";font-size:.625rem}[dir=rtl] .zs-check--checked .zs-switch-track:after{transform:translate(calc(-1 * (var(--zs-switch-width, 40px) - var(--zs-switch-height, 22px))),-50%)}[dir=rtl] .zs-field[data-zs-switch-style=material] .zs-check--checked .zs-switch-track:after{transform:translate(-26px,-50%)}[dir=rtl] .zs-field[data-zs-switch-style=labeled] .zs-check--checked .zs-switch-track:after,[dir=rtl] .zs-field[data-zs-switch-style=icon] .zs-check--checked .zs-switch-track:after{transform:translate(-32px,-50%)}.zs-field[dir=rtl] .zs-check--checked .zs-switch-track:after{transform:translate(calc(-1 * (var(--zs-switch-width, 40px) - var(--zs-switch-height, 22px))),-50%)}.zs-field[dir=rtl][data-zs-switch-style=material] .zs-check--checked .zs-switch-track:after{transform:translate(-26px,-50%)}.zs-field[dir=rtl][data-zs-switch-style=labeled] .zs-check--checked .zs-switch-track:after,.zs-field[dir=rtl][data-zs-switch-style=icon] .zs-check--checked .zs-switch-track:after{transform:translate(-32px,-50%)}.zs-field[data-zs-variant=card] .zs-check{width:100%;padding:12px 14px;border-width:var(--zs-border-width, 1px);border-style:solid;border-radius:var(--zs-radius, 10px);transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease}.zs-field[data-zs-variant=card] .zs-check-label{display:flex;flex-direction:column;gap:2px}.zs-field[data-zs-variant=button] .zs-check{padding:8px 12px;border-width:var(--zs-border-width, 1px);border-style:solid;border-radius:var(--zs-radius-pill, 999px);transition:border-color .15s ease,background-color .15s ease}.zs-field[data-zs-variant=minimal] .zs-check{width:100%;padding:4px 0}.zs-field[data-zs-variant=minimal] .zs-check-box{border-width:0;border-radius:4px}.zs-radio-group{display:flex;flex-direction:column;gap:var(--zs-radio-gap, 10px);border:0;margin:0;padding:0;min-width:0}.zs-radio-group>legend{padding:0;margin-bottom:6px;font-size:var(--zs-label-size, .8125rem);font-weight:600}.zs-radio-group[data-zs-variant=inline]{flex-direction:row;flex-wrap:wrap;gap:10px 18px}.zs-radio-group[data-zs-variant=card]{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px}.zs-radio{position:relative;display:inline-flex;align-items:center;gap:var(--zs-check-gap, 10px);cursor:pointer;user-select:none}.zs-radio-dot{width:var(--zs-radio-size, 18px);height:var(--zs-radio-size, 18px);border-radius:50%}.zs-radio-dot:after{content:"";position:absolute;top:50%;left:50%;width:7px;height:7px;border-radius:50%;transform:translate(-50%,-50%) scale(.4);opacity:0;transition:opacity .12s ease,transform .12s ease}.zs-radio--checked .zs-radio-dot:after{opacity:1;transform:translate(-50%,-50%) scale(1)}.zs-radio--disabled{cursor:not-allowed}.zs-radio-group[data-zs-variant=card] .zs-radio{padding:12px;border-width:var(--zs-border-width, 1px);border-style:solid;border-radius:var(--zs-radius, 10px);transition:border-color .15s ease,background-color .15s ease}.zs-radio-group[data-zs-variant=button]{flex-direction:row;flex-wrap:wrap;gap:8px}.zs-radio-group[data-zs-variant=button] .zs-radio{padding:8px 12px;border-width:var(--zs-border-width, 1px);border-style:solid;border-radius:var(--zs-radius-pill, 999px);transition:border-color .15s ease,background-color .15s ease}.zs-radio-group[data-zs-variant=tile]{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:8px}.zs-radio-group[data-zs-variant=tile] .zs-radio{flex-direction:column;align-items:flex-start;gap:6px;padding:12px;border-width:var(--zs-border-width, 1px);border-style:solid;border-radius:var(--zs-radius, 10px);transition:border-color .15s ease,background-color .15s ease}.zs-radio-group[data-zs-variant=tile] .zs-radio-label{display:flex;flex-direction:column;gap:2px}.zs-radio-label{min-width:0}.zs-field--file .zs-file-drop{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:22px 16px;min-height:128px;text-align:center;border-width:1.5px;border-style:dashed;border-radius:var(--zs-radius, 10px);cursor:pointer;transition:border-color .15s ease,background-color .15s ease}.zs-file-icon{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;margin-bottom:4px;border-radius:50%}.zs-file-drop-title{font-weight:600}.zs-file-drop-hint{font-size:.75rem}.zs-file-list{display:flex;flex-direction:column;gap:6px;margin:0;padding:0;list-style:none}.zs-file-list[hidden]{display:none}.zs-file-item{display:flex;align-items:center;gap:10px;padding:8px 10px;border-width:var(--zs-border-width, 1px);border-style:solid;border-radius:var(--zs-radius, 10px)}.zs-file-thumb{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;overflow:hidden;border-radius:8px;font-size:.625rem;font-weight:700;letter-spacing:.02em}.zs-file-thumb img{width:100%;height:100%;object-fit:cover;display:block}.zs-file-info{display:flex;flex-direction:column;min-width:0;flex:1 1 auto}.zs-file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.8125rem;font-weight:600}.zs-file-size{font-size:.6875rem}.zs-file-remove{flex:0 0 auto;width:26px;height:26px;padding:0;border:0;border-radius:50%;font-size:1rem;line-height:1;cursor:pointer;transition:background-color .15s ease}.zs-file-meta-row{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:20px}.zs-file-status{font-size:.75rem}.zs-file-clear{margin-inline-start:auto;padding:2px 8px;border-width:1px;border-style:solid;border-radius:999px;font-size:.6875rem;font-weight:600;cursor:pointer}.zs-file-clear[hidden]{display:none}.zs-field--file .zs-file-drop--button,.zs-field--file .zs-file-drop--compact{flex-direction:row;align-items:center;justify-content:flex-start;gap:8px;min-height:0;padding:10px 14px;text-align:start;border-style:solid}.zs-field--file .zs-file-drop--compact{padding:6px 10px}.zs-field--file .zs-file-drop--button .zs-file-icon,.zs-field--file .zs-file-drop--compact .zs-file-icon{margin:0;width:24px;height:24px}.zs-field--file .zs-file-drop--button .zs-file-drop-hint,.zs-field--file .zs-file-drop--compact .zs-file-drop-hint{margin-inline-start:auto}.zs-field--file .zs-file-drop--avatar{flex:0 0 auto;width:var(--zs-avatar-size, 96px);height:var(--zs-avatar-size, 96px);min-height:0;padding:0;overflow:hidden;border-style:solid;border-radius:50%}.zs-field--file .zs-file-drop--avatar .zs-file-drop-title,.zs-field--file .zs-file-drop--avatar .zs-file-drop-hint{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.zs-field--file .zs-file-drop--avatar .zs-file-icon{margin:0}.zs-file-avatar{position:absolute;inset:0;display:block}.zs-file-avatar[hidden]{display:none}.zs-file-avatar img{width:100%;height:100%;object-fit:cover;display:block}.zs-file-drop--has-preview .zs-file-icon{display:none}.zs-field--file .zs-file-drop--gallery{flex-direction:row;flex-wrap:wrap;justify-content:center;gap:6px;min-height:88px;padding:14px}.zs-field[data-zs-file-variant=gallery] .zs-file-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px}.zs-field[data-zs-file-variant=gallery] .zs-file-item{flex-direction:column;align-items:stretch;gap:6px;padding:6px}.zs-field[data-zs-file-variant=gallery] .zs-file-thumb{width:100%;height:86px;border-radius:6px}.zs-field[data-zs-file-variant=gallery] .zs-file-actions{justify-content:flex-end}.zs-field[data-zs-file-variant=gallery] .zs-file-upload-state{flex-wrap:wrap}.zs-file-upload-state{display:flex;align-items:center;gap:6px;font-size:.6875rem}.zs-file-progress{position:relative;display:inline-block;flex:1 1 58px;height:4px;min-width:44px;overflow:hidden;border-radius:999px}.zs-file-progress-bar{display:block;height:100%;width:0;border-radius:inherit;transition:width .12s linear}.zs-file-actions{flex:0 0 auto;display:inline-flex;align-items:center;gap:4px}.zs-file-cancel,.zs-file-retry{padding:2px 6px;border:0;border-radius:5px;font:inherit;font-size:.6875rem;font-weight:600;cursor:pointer}.zs-input-shell{position:relative;display:flex;align-items:center;gap:6px;width:100%;min-height:var(--zs-height, 44px);padding:0 var(--zs-padding-x, 12px);border-width:var(--zs-border-width, 1px);border-style:solid;border-radius:var(--zs-radius, 10px);transition:border-color .15s ease,box-shadow .15s ease,background-color .15s ease}.zs-input-native{flex:1 1 auto;min-width:0;width:100%;padding:10px 0;font:inherit;color:inherit;background:transparent;border:0;outline:none;box-shadow:none;appearance:none;-webkit-appearance:none}.zs-input-native::placeholder{opacity:1}textarea.zs-input-native{resize:vertical;min-height:92px}.zs-field[data-zs-type=number] .zs-input-native,.zs-field[data-zs-type=range] .zs-input-native,.zs-field[data-zs-type=color] .zs-input-native,.zs-field[data-zs-type=date] .zs-input-native,.zs-field[data-zs-type=time] .zs-input-native,.zs-field[data-zs-type=datetime-local] .zs-input-native,.zs-field[data-zs-type=month] .zs-input-native,.zs-field[data-zs-type=week] .zs-input-native{appearance:auto;-webkit-appearance:auto}.zs-field--custom-picker[data-zs-type=date] .zs-input-native::-webkit-calendar-picker-indicator,.zs-field--custom-picker[data-zs-type=time] .zs-input-native::-webkit-calendar-picker-indicator,.zs-field--custom-picker[data-zs-type=datetime-local] .zs-input-native::-webkit-calendar-picker-indicator,.zs-field--custom-picker[data-zs-type=month] .zs-input-native::-webkit-calendar-picker-indicator,.zs-field--custom-picker[data-zs-type=week] .zs-input-native::-webkit-calendar-picker-indicator{display:none}.zs-field[data-zs-type=color] .zs-input-native{height:34px;padding:0;cursor:pointer}.zs-field[data-zs-type=range] .zs-input-native{padding:0;height:26px;cursor:pointer}.zs-field[data-zs-type=file] .zs-input-native{width:100%}.zs-input-prefix,.zs-input-suffix{flex:0 0 auto;font-size:.8125rem;white-space:nowrap}.zs-input-action{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;padding:0 3px;font-size:.7rem;font-weight:600;border:0;border-radius:6px;cursor:pointer;transition:background-color .15s ease,opacity .15s ease}.zs-input-action[hidden]{display:none}.zs-input-clear{font-size:.95rem;line-height:1}.zs-input-action:focus-visible{outline:none}.zs-input-icon{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:0;background:transparent;color:inherit;line-height:1}.zs-input-icon svg{display:block;width:18px;height:18px}.zs-input-icon--action{cursor:pointer;border-radius:6px;transition:background-color .15s ease,color .15s ease}.zs-input-icon--action:focus-visible{outline:none}.zs-phone-country{flex:0 0 auto;max-width:104px;height:calc(var(--zs-height, 44px) - 10px);padding:0 4px;font:inherit;font-size:.8125rem;color:inherit;background:transparent;border:0;border-inline-end-width:1px;border-inline-end-style:solid;cursor:pointer}.zs-field--phone .zs-input-native{min-width:7ch}.zs-stepper{flex:0 0 auto;display:inline-flex;gap:2px}.zs-stepper--stacked{flex-direction:column;gap:1px}.zs-stepper-btn{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:26px;height:22px;padding:0;border:0;background:transparent;color:inherit;cursor:pointer;transition:background-color .15s ease,color .15s ease}.zs-stepper--stacked .zs-stepper-btn{width:24px;height:15px}.zs-field--stepper-split .zs-stepper-btn{width:30px;height:auto;min-height:calc(var(--zs-height, 44px) - 2px)}.zs-stepper-btn:disabled{opacity:.4;cursor:not-allowed}.zs-stepper-btn:focus-visible{outline:none}.zs-stepper-glyph svg{display:block;width:12px;height:12px}.zs-stepper--stacked .zs-stepper-glyph svg{width:10px;height:10px}.zs-field[data-zs-type=number] .zs-input-native--stepper{appearance:textfield;-webkit-appearance:none}.zs-field[data-zs-type=number] .zs-input-native--stepper::-webkit-outer-spin-button,.zs-field[data-zs-type=number] .zs-input-native--stepper::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.zs-input-shell--range{min-height:0;padding:0;border-width:0;background:transparent;box-shadow:none}.zs-range{position:relative;flex:1 1 auto;min-width:0;padding:20px 0 4px}.zs-range .zs-input-native{width:100%;margin:0;height:6px;border-radius:999px;cursor:pointer}.zs-range-ticks{position:relative;height:6px;margin-top:2px;pointer-events:none}.zs-range-tick{position:absolute;inset-inline-start:var(--zs-range-tick-pct, 0);top:0;width:2px;height:6px;transform:translate(-50%)}.zs-range-tick--labeled{top:8px;width:auto;height:auto;font-size:.625rem;white-space:nowrap;transform:translate(-50%)}.zs-range-scale{display:flex;justify-content:space-between;margin-top:10px;font-size:.6875rem;font-variant-numeric:tabular-nums}.zs-range-scale--hidden{visibility:hidden}.zs-range--labels-no-scale{padding-bottom:18px}.zs-range-tick--labeled.zs-range-tick--start{transform:translate(0)}.zs-range-tick--labeled.zs-range-tick--end{transform:translate(-100%)}.zs-range-bubble{position:absolute;top:0;inset-inline-start:calc(var(--zs-range-pct, 0) * 100%);min-width:28px;padding:1px 6px;text-align:center;border-radius:999px;transform:translate(-50%);font-size:.6875rem;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap;pointer-events:none}.zs-range--no-bubble{padding-top:4px}.zs-range--bubble-active .zs-range-bubble{opacity:0;visibility:hidden;transition:opacity .14s ease}.zs-range--bubble-active:hover .zs-range-bubble,.zs-range--bubble-active:focus-within .zs-range-bubble,.zs-field--focused .zs-range--bubble-active .zs-range-bubble{opacity:1;visibility:visible}.zs-range--bubble-bottom{padding-bottom:30px}.zs-range--bubble-bottom.zs-range--labels-no-scale{padding-bottom:38px}.zs-range--bubble-bottom .zs-range-bubble{top:auto;bottom:0}.zs-range--fill-off .zs-input-native::-webkit-slider-runnable-track{background:var(--zs-range-track)}.zs-range--fill-off .zs-input-native::-moz-range-progress{background:var(--zs-range-track)}[dir=rtl] .zs-range-tick,[dir=rtl] .zs-range-tick--labeled,[dir=rtl] .zs-range-bubble,.zs-field[dir=rtl] .zs-range-tick,.zs-field[dir=rtl] .zs-range-tick--labeled,.zs-field[dir=rtl] .zs-range-bubble{transform:translate(50%)}[dir=rtl] .zs-range-tick--labeled.zs-range-tick--start{transform:translate(-100%)}[dir=rtl] .zs-range-tick--labeled.zs-range-tick--end{transform:translate(0)}.zs-field[dir=rtl] .zs-range-tick--labeled.zs-range-tick--start{transform:translate(-100%)}.zs-field[dir=rtl] .zs-range-tick--labeled.zs-range-tick--end,.zs-range-bubble--start{transform:translate(0)}.zs-range-bubble--end,[dir=rtl] .zs-range-bubble--start{transform:translate(-100%)}[dir=rtl] .zs-range-bubble--end{transform:translate(0)}.zs-field[dir=rtl] .zs-range-bubble--start{transform:translate(-100%)}.zs-field[dir=rtl] .zs-range-bubble--end{transform:translate(0)}.zs-input-validation{display:none;flex:0 0 auto;width:18px;height:18px}.zs-input-validation svg{display:block;width:18px;height:18px}.zs-field[data-zs-validation=valid] .zs-input-validation--valid,.zs-field[data-zs-validation=invalid] .zs-input-validation--invalid{display:inline-flex}.zs-field[data-zs-layout=floating] .zs-input-shell,.zs-field[data-zs-layout=outlined] .zs-input-shell{padding-top:6px;align-items:center}.zs-field[data-zs-layout=floating] .zs-field__label,.zs-field[data-zs-layout=outlined] .zs-field__label{position:absolute;inset-inline-start:calc(var(--zs-padding-x, 12px) + 2px);top:50%;margin:0;padding:0 4px;transform:translateY(-50%);font-size:var(--zs-font-size, .9375rem);font-weight:500;white-space:nowrap;pointer-events:none;transition:transform .14s ease,font-size .14s ease,top .14s ease,color .14s ease}.zs-field[data-zs-layout=floating].zs-field--filled .zs-field__label,.zs-field[data-zs-layout=floating].zs-field--focused .zs-field__label,.zs-field[data-zs-layout=floating].zs-field--adorned .zs-field__label,.zs-field[data-zs-layout=outlined].zs-field--filled .zs-field__label,.zs-field[data-zs-layout=outlined].zs-field--focused .zs-field__label,.zs-field[data-zs-layout=outlined].zs-field--adorned .zs-field__label{top:0;transform:translateY(-50%) scale(.86);transform-origin:left center;font-weight:600}.zs-field[data-zs-layout=floating].zs-field--adorned .zs-input-shell,.zs-field[data-zs-layout=outlined].zs-field--adorned .zs-input-shell{padding-top:10px}.zs-field[data-zs-layout=floating] .zs-input-native,.zs-field[data-zs-layout=outlined] .zs-input-native{padding-top:12px}.zs-field[data-zs-layout=compact] .zs-input-shell,.zs-field[data-zs-layout=compact] .zs-control{min-height:34px}.zs-field[data-zs-layout=card]{padding:14px;border-width:var(--zs-border-width, 1px);border-style:solid;border-radius:var(--zs-radius, 10px)}.zs-form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--zs-grid-min, 230px),1fr));gap:var(--zs-grid-gap, 16px);align-items:start}.zs-form-grid>.zs-full{grid-column:1 / -1}.zs-check input:focus-visible+.zs-check-box,.zs-check input:focus-visible+.zs-switch-track,.zs-radio input:focus-visible+.zs-radio-dot{outline:2px solid transparent;outline-offset:2px}.zs-input-native:focus-visible,.zs-file-input:focus-visible{outline:none}@media (prefers-reduced-motion: reduce){.zs-root,.zs-root *,.zs-root *:before,.zs-root *:after,.zs-field,.zs-field *,.zs-field *:before,.zs-field *:after,.zs-radio-group,.zs-radio-group *{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}.zs-root .zs-spinner{animation-duration:1.2s!important;animation-iteration-count:infinite!important}}
|