@simai-studio/ui 5.20261022.1721 → 5.20261022.1814
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 +4 -4
- package/distr/core/contracts/packages/larena.package.json +1 -0
- package/distr/smart/datepicker/js/datepicker.min.js +10 -9
- package/distr/smart/datepicker/smart.manifest.json +13 -3
- package/distr/smart/datepicker/template/default.js +2 -1
- package/distr/smart/field-renderers/js/field-renderers.min.js +4 -4
- package/distr/smart/inputs/js/inputs.min.js +3 -3
- package/distr/smart/inputs/smart.manifest.json +1 -1
- package/package-manifest.json +10 -10
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# @simai-studio/ui
|
|
2
2
|
|
|
3
|
-
SIMAI Framework, release `ui-
|
|
3
|
+
SIMAI Framework, release `ui-f2f3e8f912cf` (commit f2f3e8f912cf618b95b509040465e618208e7322 of [simai/ui](https://github.com/simai/ui)).
|
|
4
4
|
|
|
5
5
|
```html
|
|
6
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@simai-studio/ui@5.20261022.
|
|
7
|
-
<script>window.sfPath = 'https://cdn.jsdelivr.net/npm/@simai-studio/ui@5.20261022.
|
|
8
|
-
<script src="https://cdn.jsdelivr.net/npm/@simai-studio/ui@5.20261022.
|
|
6
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@simai-studio/ui@5.20261022.1814/distr/core/css/core.css">
|
|
7
|
+
<script>window.sfPath = 'https://cdn.jsdelivr.net/npm/@simai-studio/ui@5.20261022.1814/distr/';</script>
|
|
8
|
+
<script src="https://cdn.jsdelivr.net/npm/@simai-studio/ui@5.20261022.1814/distr/core/js/core.js"></script>
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
Components, utilities and Smart Components ship in their minified form (the Loader asks for it); Core in both forms. Documentation: https://ui.simai.io/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{"use strict";var t={"98e26702f55a"(t,e,a){function s(){const t=globalThis.SF=globalThis.SF||{};return t.__deprecationNotes instanceof Map||Object.defineProperty(t,"__deprecationNotes",{value:new Map,configurable:!0}),t.__deprecationNotes}function n({component:t="",kind:e="attribute",attribute:a="",from:n,to:r=null}={}){if(!n)return;const i=[t,e,a,n].join("|"),o=s(),l=o.get(i);if(l)l.count+=1;else if(o.set(i,{component:t,kind:e,attribute:a,from:n,to:r,count:1}),function(){const t=globalThis.document?.documentElement;return"warn"===t?.dataset?.sfDeprecations||!0===globalThis.SF?.deprecations?.warn}()){const s=t?`${t}: `:"",i="value"===e?`${a}="${n}"`:`${e} ${n}`;globalThis.console?.warn?.(`[SIMAI Framework] ${s}${i} is a legacy name${r?`; write ${r}`:""}. See contracts/changes/journal.json.`)}}if(a.d(e,{id:()=>l}),"undefined"!=typeof globalThis){globalThis.SF=globalThis.SF||{};const t=globalThis.SF.deprecations||{};t.list=function(){return[...s().values()].map(t=>({...t}))},t.clear=function(){s().clear()},t.note=n,globalThis.SF.deprecations=t}const r=Object.freeze(["1/2","1","2"]),i=Object.freeze({"1/3":"1/2",3:"2"}),o=new Set;function l(t,e="field",a="1"){const s=String(t??"").trim().toLowerCase();if(r.includes(s))return s;if(Object.hasOwn(i,s)){const t=i[s];n({component:e,kind:"value",attribute:"size",from:s,to:t});const a=`${e}:${s}`;return o.has(a)||"undefined"==typeof console||(o.add(a),console.warn(`[SIMAI Framework] ${e}: size ${s} is retired for form fields; rendering size ${t}.`)),t}return a}},"421676f72963"(t,e,a){a.d(e,{Ec:()=>o,Hw:()=>l});const s="sfPopoverOpen",n=new WeakSet,r=Symbol.for("sf.openSurfaceLayers");function i(){const t=globalThis;return Array.isArray(t[r])||(t[r]=[]),t[r]}function o(t,e){if(!t)return;const a=Boolean(e);if(a===n.has(t))return;const r=i();if(a)n.add(t),r.push(t);else{n.delete(t);const e=r.lastIndexOf(t);e>=0&&r.splice(e,1)}!function(t){const e=globalThis.document?.documentElement;if(!e)return;const a=Math.max(0,Number(e.dataset[s]||0)+t);a?e.dataset[s]=String(a):delete e.dataset[s]}(a?1:-1)}function l(t){const e=i();for(let a=e.length-1;a>=0;a-=1){const s=e[a];if(!1!==s?.isConnected)return s===t}return!0}},b9b65955223a(t,e,a){a.a(t,async(t,e)=>{try{var s=a("fbe0570fcc69"),n=a("98e26702f55a"),r=a("77b2f4107e3b"),i=a("5c1dc214bb5e"),o=a("0d662e4d7d63"),l=a("421676f72963"),u=t([s,r,i,o]);[s,r,i,o]=u.then?(await u)():u;var h=a.n(s),c=a.n(i);const d=/^(\d{4})-(\d{2})-(\d{2})$/,p=18;let g=0;function m(t){return String(t).padStart(2,"0")}function f(t){return`${t.getFullYear()}-${m(t.getMonth()+1)}-${m(t.getDate())}`}function b(t,e="YYYY.MM.DD"){if(!t)return"";const a={YYYY:String(t.getFullYear()),YY:String(t.getFullYear()).slice(-2),MM:m(t.getMonth()+1),DD:m(t.getDate())};return String(e||"YYYY.MM.DD").replace(/YYYY|YY|MM|DD/g,t=>a[t]||t)}const y=1e3,v=9999;function D(t,e,a){if(!Number.isInteger(t)||t<y||t>v)return null;const s=new Date(t,e-1,a);return s.getFullYear()!==t||s.getMonth()!==e-1||s.getDate()!==a?null:s}function k(t){if(!t)return null;const e=String(t).match(d);if(!e)return null;const[,a,s,n]=e;return D(Number(a),Number(s),Number(n))}const S=/YYYY|YY|MM|DD/g,w=new Map;function M(t){const e=String(t||"DD.MM.YYYY");if(w.has(e))return w.get(e);const a=e.match(S)||[],s={YYYY:"(\\d{4})",YY:"(\\d{2})",MM:"(\\d{1,2})",DD:"(\\d{1,2})"},n=e.split(S).map(t=>t?"[\\s./,-]+":"").reduce((t,e,n)=>t+e+(n<a.length?s[a[n]]:""),""),r=3===a.length&&a.includes("MM")&&a.includes("DD")&&(a.includes("YYYY")||a.includes("YY"))?{re:new RegExp(`^${n}$`),tokens:a}:null;return w.set(e,r),r}function $(t,e="DD.MM.YYYY"){if(!t)return null;if(t instanceof Date)return(a=t)instanceof Date&&!Number.isNaN(a.getTime())?new Date(t.getFullYear(),t.getMonth(),t.getDate()):null;var a;const s=String(t).trim();if(d.test(s))return k(s);const n=M(e),r=n?s.match(n.re):null;if(!r)return null;const i={};n.tokens.forEach((t,e)=>{i[t]=Number(r[e+1])});return D(i.YYYY??i.YY+2e3,i.MM,i.DD)}function x(t,e=0){const a=(0,s.toNumber)(t,e);return Number.isFinite(a)?Math.max(0,Math.min(11,a)):e}function P(t,e){return t&&e&&t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function Y(t,e){if(!t||!e)return 0;return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}function A(t,e){const a=new Date(t.getFullYear(),t.getMonth()+e,1),s=new Date(a.getFullYear(),a.getMonth()+1,0).getDate();return a.setDate(Math.min(t.getDate(),s)),a}function V(t,e,a){return!!(t&&e&&a)&&(Y(t,e)>0&&Y(t,a)<0)}function _(t="",e=null){const a=String(t||"").trim();return a||(0,o.pageLocale)(e??globalThis.document?.documentElement??null)}function F(t=""){const e=String(t||"");return e?`${e.charAt(0).toLocaleUpperCase()}${e.slice(1)}`:""}function C(t,e){try{return F(new Intl.DateTimeFormat(e,{month:"long"}).format(new Date(2026,t,1)))}catch{return String(t+1)}}function T(t,e){try{return new Intl.DateTimeFormat(e,{weekday:"long",year:"numeric",month:"long",day:"numeric"}).format(t)}catch{return f(t)}}function E(t,e=1){const a=new Date(2026,0,4);return Array.from({length:7},(s,n)=>{const r=new Date(a);r.setDate(a.getDate()+(e+n)%7);try{return new Intl.DateTimeFormat(t,{weekday:"short"}).format(r)}catch{return String((e+n)%7)}})}const I=["today","yesterday","last-7-days","last-30-days","this-week","this-month","last-month"];function L(t,e){return new Date(t.getFullYear(),t.getMonth(),t.getDate()+e)}function O(t,e,a=1){const s=new Date(e.getFullYear(),e.getMonth(),e.getDate());switch(t){case"today":return[s,s];case"yesterday":return[L(s,-1),L(s,-1)];case"last-7-days":return[L(s,-6),s];case"last-30-days":return[L(s,-29),s];case"this-week":return[L(s,-(s.getDay()-a+7)%7),s];case"this-month":return[new Date(s.getFullYear(),s.getMonth(),1),s];case"last-month":return[new Date(s.getFullYear(),s.getMonth()-1,1),new Date(s.getFullYear(),s.getMonth(),0)];default:return null}}const z={en:{previousMonth:"Previous month",nextMonth:"Next month",previousYears:"Previous years",nextYears:"Next years",chooseMonth:"Choose a month",chooseYear:"Choose a year",presets:"Quick ranges",customRange:"Custom range",preset_today:"Today",preset_yesterday:"Yesterday",preset_last7Days:"Last 7 days",preset_last30Days:"Last 30 days",preset_thisWeek:"This week",preset_thisMonth:"This month",preset_lastMonth:"Last month"},ru:{previousMonth:"Предыдущий месяц",nextMonth:"Следующий месяц",previousYears:"Предыдущие годы",nextYears:"Следующие годы",chooseMonth:"Выберите месяц",chooseYear:"Выберите год",presets:"Быстрый выбор",customRange:"Свой период",preset_today:"Сегодня",preset_yesterday:"Вчера",preset_last7Days:"Последние 7 дней",preset_last30Days:"Последние 30 дней",preset_thisWeek:"Эта неделя",preset_thisMonth:"Этот месяц",preset_lastMonth:"Прошлый месяц"}};class R extends(h()){constructor(){super(),this._input=null,this._documentClickHandler=this.handleDocumentClick.bind(this),this._documentKeydownHandler=this.handleDocumentKeydown.bind(this),this._viewportHandler=this.positionPanel.bind(this),this._focusCalendarOnOpen=!1,this._focusDateAfterRender=!1,this._panelId="sf-datepicker-panel-"+ ++g,this.state={openAbove:!1,yearPageStart:null,activeDate:""},this.refs={input:this.createRef(),datePickerRoot:this.createRef(),datePickerPanel:this.createRef()}}static get props(){return{templateName:{attribute:"template",default:"default"},value:{default:""},date:{default:""},startValue:{attribute:"start-value",default:""},endValue:{attribute:"end-value",default:""},maxDate:{default:""},minDate:{default:""},range:{type:Boolean,default:!1},month:{type:Number,default:null},year:{type:Number,default:null},context:{default:""},weekStart:{type:Number,default:null},locale:{default:""},format:{default:"DD.MM.YYYY"},rootClass:{default:""},closeOnSelect:{type:Boolean,default:!0},input:{type:Boolean,default:!0},open:{type:Boolean,default:!1},portal:{type:Boolean,default:!0},inputType:{attribute:"input-type",default:"bordered"},size:{default:"1"},inputSize:{attribute:"input-size",default:"1"},inputName:{attribute:"input-name",default:""},name:{attribute:"name",default:""},placeholder:{default:""},label:{default:""},ariaLabel:{attribute:"aria-label",default:""},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},iconStart:{type:String,attribute:"icon-start",default:null},leftIcon:{attribute:"left-icon",default:"calendar_today"},inputRootClass:{attribute:"input-root-class",default:""},mask:{type:Boolean,default:!1},maskPattern:{attribute:"mask-pattern",default:""},maskLazy:{attribute:"mask-lazy",default:!1},maskPlaceholderChar:{attribute:"mask-placeholder-char",default:"_"},maskOptions:{attribute:"mask-options",default:""},presets:{default:""},preset:{default:""}}}connectedCallback(){this.upgradeProperty("value"),this.upgradeProperty("presets"),super.connectedCallback()}upgradeProperty(t){if(!Object.prototype.hasOwnProperty.call(this,t))return;const e=this[t];delete this[t],this[t]=e}get componentName(){return"datepicker"}get templateName(){return this.getAttribute("template")||"default"}get selectedDate(){return $(this.date,this.format)}get primaryDate(){const t=this.activePreset;return t?t.to:this.selectedDate||this.startDate}get presets(){return this._presetList??(this.getAttribute("presets")||"")}set presets(t){if(Array.isArray(t))return this._presetList=t,void this.requestComponentUpdate("presets");this._presetList=null,this.setState({presets:t?String(t):""})}get preset(){return this.getAttribute("preset")||""}set preset(t){this.setState({preset:t?String(t):""})}get presetItems(){if(!this.range)return[];const t=Array.isArray(this.presets)?this.presets:String(this.presets).split(/[\s,]+/).filter(Boolean),e=new Date,a=this.setMinDate(),s=this.setMaxDate();return t.map(t=>{const n="string"==typeof t?{id:t,relative:t}:{...t};if(!n?.id)return null;let r=null;if(n.relative)r=O(n.relative,e,this.weekStart);else if(Array.isArray(n.range)){const t=$(n.range[0],this.format),e=$(n.range[1],this.format);t&&e&&(r=Y(t,e)<=0?[t,e]:[e,t])}if(!r)return null;let[i,l]=r;a&&Y(i,a)<0&&(i=a),s&&Y(l,s)>0&&(l=s);const u=Y(i,l)>0,h=n.label||(I.includes(n.id)?(0,o.pageText)(z,(c=n.id,`preset_${String(c).replace(/-([a-z0-9])/g,(t,e)=>e.toUpperCase())}`),this,"sf-datepicker"):n.id);var c;return{id:String(n.id),label:h,relative:n.relative||null,from:i,to:l,disabled:u,pressed:this.preset===String(n.id)}}).filter(Boolean)}get activePreset(){const t=this.preset;if(!t||!this.range)return null;const e=this.presetItems.find(e=>e.id===t);return e&&!e.disabled?e:null}get startDate(){return $(this.startValue,this.format)}get endDate(){return $(this.endValue,this.format)}get date(){return this.hasAttribute("date")?this.getAttribute("date")||"":this.getAttribute("value")||""}setState(t={},e=null){super.setState(t,e);return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"date")&&!t.date&&this.hasAttribute("value")&&this.setAttribute("date",""),this}get value(){return this.range?[this.startValue,this.endValue]:this.date}set value(t){if(Array.isArray(t)){const[e="",a=""]=t;return void this.setState({date:e||"",startValue:e||"",endValue:a||""})}if(t&&"object"==typeof t){const e=t.start||t.startValue||t.date||"",a=t.end||t.endValue||"";return void this.setState({date:t.date||e||"",startValue:e,endValue:a})}this.setState({date:t?String(t):"",startValue:"",endValue:""})}setMaxDate(){return $(this.maxDate,this.format)}setMinDate(){return $(this.minDate,this.format)}get maxDate(){return this.getAttribute("max-date")||""}get minDate(){return this.getAttribute("min-date")||""}set date(t){this.setState({date:t?String(t):""})}get startValue(){const t=this.activePreset;return t?f(t.from):this.getAttribute("start-value")||""}set startValue(t){this.setState({startValue:t?String(t):""})}get endValue(){const t=this.activePreset;return t?f(t.to):this.getAttribute("end-value")||""}set endValue(t){this.setState({endValue:t?String(t):""})}get range(){return this.getBooleanAttr("range",!1)}get input(){return this.getBooleanAttr("input",!0)}get open(){return this.getBooleanAttr("open",!1)}get portal(){return this.getBooleanAttr("portal",!0)}get inputType(){return this.getAttribute("input-type")||"bordered"}get size(){return(0,n.id)(this.getAttribute("size")||this.getAttribute("input-size")||"1","sf-datepicker")}get inputSize(){return this.size}get inputName(){return this.getAttribute("input-name")||this.getAttribute("name")||""}get placeholder(){return this.getAttribute("placeholder")||""}get label(){return this.getAttribute("label")||""}get disabled(){return this.getBooleanAttr("disabled",!1)}get required(){return this.getBooleanAttr("required",!1)}get closeOnSelect(){return this.getBooleanAttr("close-on-select",!0)}get leftIcon(){return this.hasAttribute("icon-start")?this.getAttribute("icon-start"):this.getAttribute("left-icon")||"calendar_today"}get iconStart(){return this.leftIcon}get inputRootClass(){return this.getAttribute("input-root-class")||""}get mask(){return this.getBooleanAttr("mask",!1)}get maskPattern(){return this.getAttribute("mask-pattern")||this.formatToMask(this.format)}get maskLazy(){return!!this.hasAttribute("mask-lazy")&&this.getBooleanAttr("mask-lazy",!1)}get maskPlaceholderChar(){return this.getAttribute("mask-placeholder-char")||"_"}get maskOptions(){return this.getAttribute("mask-options")||""}get year(){const t=this.primaryDate,e=t?t.getFullYear():(new Date).getFullYear();return this.hasAttribute("year")?this.getNumberAttr("year",e):e}set year(t){this.setState({year:null==t||""===t?"":String((0,s.toNumber)(t,(new Date).getFullYear()))})}get month(){const t=this.primaryDate,e=t?t.getMonth():(new Date).getMonth();return this.hasAttribute("month")?x(this.getAttribute("month"),e):e}set month(t){this.setState({month:null==t||""===t?"":String(x(t,(new Date).getMonth()))})}get contextMode(){return this.getEnumAttr("context",["month","year",""],"")}get weekStart(){if(this.hasAttribute("week-start")){const t=this.getNumberAttr("week-start",1);return Number.isInteger(t)&&t>=0&&t<=7?t%7:1}try{const t=new Intl.Locale(this.locale),e="function"==typeof t.getWeekInfo?t.getWeekInfo():t.weekInfo;if(e?.firstDay)return e.firstDay%7}catch{}return 1}get locale(){return _(this.getAttribute("locale"),this)}get format(){return this.getAttribute("format")||"DD.MM.YYYY"}get ariaLabel(){return this.getProp("ariaLabel")||""}get readonly(){return this.range||this.getBooleanAttr("readonly",!1)}get typed(){return!this.readonly&&!this.disabled}get formattedValue(){return b(this.selectedDate,this.format)}get formattedStartValue(){return b(this.startDate,this.format)}get formattedEndValue(){return b(this.endDate,this.format)}get displayValue(){return this.range?this.formattedStartValue&&this.formattedEndValue?`${this.formattedStartValue} - ${this.formattedEndValue}`:this.formattedStartValue||this.formattedEndValue||"":this.formattedValue}get displayDate(){return new Date(this.year,this.month,1)}get isRtl(){return"rtl"===(this.closest("[dir]")?.getAttribute("dir")||document.documentElement?.dir)}get labels(){return t=this,Object.fromEntries(["previousMonth","nextMonth","previousYears","nextYears","chooseMonth","chooseYear","presets","customRange"].map(e=>[e,(0,o.pageText)(z,e,t,"sf-datepicker")]));var t}get weekdays(){return E(this.locale,this.weekStart)}get calendarLabel(){try{return new Intl.DateTimeFormat(this.locale,{month:"long",year:"numeric"}).format(this.displayDate)}catch{return`${this.month+1}.${this.year}`}}get activeDate(){const t=k(this.state.activeDate)||this.primaryDate||this.displayDate,e=this.setMinDate(),a=this.setMaxDate();return e&&Y(t,e)<0?e:a&&Y(t,a)>0?a:t}get normalizedRange(){const t=this.startDate,e=this.endDate;return t&&e?Y(t,e)<=0?{startDate:t,endDate:e}:{startDate:e,endDate:t}:{startDate:t,endDate:e}}get days(){const t=(new Date(this.year,this.month,1).getDay()-this.weekStart+7)%7,e=new Date(this.year,this.month,1-t),{startDate:a,endDate:s}=this.normalizedRange,n=Boolean(this.startValue&&this.endValue),r=this.setMinDate(),i=this.setMaxDate(),o=this.activeDate,l=new Date;return Array.from({length:42}).map((t,u)=>{const h=new Date(e.getFullYear(),e.getMonth(),e.getDate()+u),c=h.getTime(),d=Boolean(r&&c<r.getTime()||i&&c>i.getTime());return{date:h,value:f(h),formattedValue:b(h,this.format),label:T(h,this.locale),day:h.getDate(),today:P(h,l),currentMonth:h.getMonth()===this.month,weekend:[0,6].includes(h.getDay()),disabled:d,selected:this.range?P(h,a)||P(h,s):P(h,this.selectedDate),rangeStart:this.range&&n&&P(h,a),rangeEnd:this.range&&n&&P(h,s),rangeSelected:this.range&&n&&V(h,a,s),tabIndex:!d&&P(h,o)?0:-1}})}get months(){const t=this.setMinDate(),e=this.setMaxDate(),a=t?new Date(t.getFullYear(),t.getMonth(),1):null,s=e?new Date(e.getFullYear(),e.getMonth(),1):null;return Array.from({length:12}).map((t,e)=>{const n=new Date(this.year,e,1).getTime(),r=Boolean(a&&n<a.getTime()||s&&n>s.getTime());return{index:e,label:C(e,this.locale),selected:e===this.month,disabled:r}})}get years(){const t=this.setMinDate(),e=this.setMaxDate(),a=this.yearPageStart;return Array.from({length:p}).map((s,n)=>{const r=a+n;return{year:r,disabled:Boolean(t&&r<t.getFullYear()||e&&r>e.getFullYear()),selected:r===this.year}})}get yearPageStart(){return this.state.yearPageStart??this.getYearPageStart(this.year)}get yearPageEnd(){return this.yearPageStart+p-1}getYearPageStart(t=this.year){const e=(0,s.toNumber)(t,(new Date).getFullYear());return e-e%p}formatToMask=t=>{let e=String(t).replace(/[A-Za-z]/g,"0");return this.range&&(e+=` - ${e}`),e};setContext(t=""){return this.setState({context:t||""}),this}toggleContext(t){const e=this.contextMode===t?"":t,a={context:e};return"year"===e&&(a.yearPageStart=this.getYearPageStart(this.year)),this.setState(a),this}shiftYearPage(t=1){return this.set({yearPageStart:this.yearPageStart+p*t}),this}shiftMonth(t=1){const e=new Date(this.year,this.month+t,1),a=this.setMinDate(),s=this.setMaxDate();return a&&e<new Date(a.getFullYear(),a.getMonth(),1)||s&&e>new Date(s.getFullYear(),s.getMonth(),1)||(this.setState({year:e.getFullYear(),month:e.getMonth(),context:""}),this.set({activeDate:f(e)})),this}setActiveDate(t){const e=k(t);return e&&this.state.activeDate!==t?(this.set({activeDate:f(e)}),this):this}moveActiveDate(t){const e=new Date(this.activeDate);e.setDate(e.getDate()+t);const a=this.setMinDate(),s=this.setMaxDate();return a&&Y(e,a)<0||s&&Y(e,s)>0||(this._focusDateAfterRender=!0,this.setState({year:e.getFullYear(),month:e.getMonth(),context:""}),this.set({activeDate:f(e)})),this}openPanel({focusCalendar:t=!1}={}){return this.disabled?this:(this._focusCalendarOnOpen=t,this.state.activeDate||this.set({activeDate:f(this.activeDate)}),this.open?(this.positionPanel(),this):(this.setState({open:!0}),this))}closePanel({restoreFocus:t=!1}={}){return this.open?(this.setState({open:!1,context:""}),t&&requestAnimationFrame(()=>this._input?.focus?.()),this):this}togglePanel(){return this.open?this.closePanel():this.openPanel()}handleInputChange(t){if(!this.typed)return;"change"===t?.type&&t.stopPropagation();const e=t?.target,a=String(e?.value??"").trim(),s=()=>{const t=e?.querySelector?.("input")||e;t&&"value"in t&&(t.value=this.displayValue)};if(!a){if(!this.date)return;return this.setState({date:"",context:""}),void this.emitChange()}const n=$(a,this.format),r=this.setMinDate(),i=this.setMaxDate(),o=Boolean(n)&&(r&&Y(n,r)<0||i&&Y(n,i)>0);if(!n||o)return void s();const l=f(n);l!==this.date?(this.setState({year:n.getFullYear(),month:n.getMonth(),date:l,context:""}),this.set({activeDate:l}),this.emitChange()):s()}handleInputInput(t){this.typed&&t?.stopPropagation?.()}handleInputClick(t){t?.preventDefault?.(),t?.stopPropagation?.(),this.openPanel()}handleInputKeydown(t){if(this.typed){if("ArrowDown"!==t.key&&"Enter"!==t.key)return;return t.preventDefault(),"Enter"===t.key?void this.handleInputChange(t):void this.openPanel({focusCalendar:!0})}["ArrowDown","Enter"," "].includes(t.key)&&(t.preventDefault(),this.openPanel({focusCalendar:!0}))}handleDayKeydown(t,e){const a=this.isRtl?-1:1,s={ArrowLeft:-a,ArrowRight:a,ArrowUp:-7,ArrowDown:7};if(Object.prototype.hasOwnProperty.call(s,t.key))return t.preventDefault(),void this.moveActiveDate(s[t.key]);if("Home"===t.key||"End"===t.key){t.preventDefault();const a=((e?.date||this.activeDate).getDay()-this.weekStart+7)%7;return void this.moveActiveDate("Home"===t.key?-a:6-a)}if("PageUp"===t.key||"PageDown"===t.key){t.preventDefault();const e="PageUp"===t.key?-1:1;let a=A(this.activeDate,e);const s=this.setMinDate(),n=this.setMaxDate();s&&Y(a,s)<0&&(a=s),n&&Y(a,n)>0&&(a=n),this._focusDateAfterRender=!0,this.setState({year:a.getFullYear(),month:a.getMonth()}),this.set({activeDate:f(a)})}}handlePanelClick(t){t?.stopPropagation?.()}handleDocumentClick(t){if(!this.open)return;const e=t.target;this.contains(e)||this.refs.datePickerPanel.value?.contains?.(e)||this.closePanel()}handleDocumentKeydown(t){this.open&&"Escape"===t.key&&!t.defaultPrevented&&(0,l.Hw)(this)&&(t.preventDefault(),t.stopPropagation(),this.contextMode?this.setContext(""):this.closePanel({restoreFocus:!0}))}syncOverlayListeners(){const t=Boolean(this.input&&this.open);if((0,l.Ec)(this,t),t)return document.addEventListener("click",this._documentClickHandler),void document.addEventListener("keydown",this._documentKeydownHandler,!0);this.removeOverlayListeners()}removeOverlayListeners(){(0,l.Ec)(this,!1),document.removeEventListener("click",this._documentClickHandler),document.removeEventListener("keydown",this._documentKeydownHandler,!0),this.stopPanelPosition(),window.removeEventListener("resize",this._viewportHandler),document.removeEventListener("scroll",this._viewportHandler,!0),window.visualViewport?.removeEventListener("resize",this._viewportHandler),window.visualViewport?.removeEventListener("scroll",this._viewportHandler)}positionPanel(){const t=this.refs.datePickerPanel.value,e=this._input?.closest(".sf-input-field")||this._input||this.querySelector("sf-input");if(this.isConnected&&this.input&&this.portal&&this.open&&t?.isConnected&&e)return this._panelAnchor&&this._panelAnchorPanel===t&&this._panelAnchorTrigger===e?void this._panelAnchor.update():(this.stopPanelPosition(),Object.assign(t.style,{overflowY:"auto",zIndex:"var(--sf-z-index-9)"}),this._panelAnchorPanel=t,this._panelAnchorTrigger=e,void(this._panelAnchor=(globalThis.SF?.Position||c()).anchor(e,t,{side:"block-end",align:"start",onPosition:({side:t})=>{const e="block-start"===t;Boolean(this.state.openAbove)!==e&&this.set({openAbove:e})}})));this.stopPanelPosition()}stopPanelPosition(){this._panelAnchor?.stop(),this._panelAnchor=null,this._panelAnchorPanel=null,this._panelAnchorTrigger=null}selectDate(t){return!t?.date||t.disabled?this:this.range?(this.selectRangeDate(t),this):(this.setState({year:t.date.getFullYear(),month:t.date.getMonth(),date:t.value,context:""}),this.set({activeDate:t.value}),this.emitChange(),this.closeOnSelect&&this.closePanel({restoreFocus:!0}),this)}selectRangeDate(t){if(!this.startValue||this.startValue&&this.endValue)return this.setState({year:t.date.getFullYear(),month:t.date.getMonth(),startValue:t.value,endValue:"",date:t.value,context:"",preset:""}),this.set({activeDate:t.value}),this.emitChange(),this;const e=this.startDate,a={year:t.date.getFullYear(),month:t.date.getMonth(),context:"",preset:""};return e&&Y(t.date,e)<0?(a.startValue=t.value,a.endValue=this.startValue,a.date=t.value):(a.endValue=t.value,a.date=this.startValue),this.setState(a),this.set({activeDate:t.value}),this.emitChange(),this.closeOnSelect&&this.closePanel({restoreFocus:!0}),this}choosePreset(t){if(!t||t.disabled)return this;const e=f(t.from),a=f(t.to);return this.setState({preset:t.id,startValue:e,endValue:a,date:e,year:t.to.getFullYear(),month:t.to.getMonth(),context:""}),this.set({activeDate:a}),this.emitChange(),this.closeOnSelect&&this.closePanel({restoreFocus:!0}),this}chooseCustomRange(){return this.preset&&this.setState({preset:"",startValue:"",endValue:"",date:""}),this._focusDateAfterRender=!0,this.requestComponentUpdate("custom-range"),this}handlePresetKeydown(t){const e={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1};if(!(t.key in e)&&"Home"!==t.key&&"End"!==t.key)return;const a=[...t.currentTarget.querySelectorAll("button:not(:disabled)")];if(!a.length)return;t.preventDefault();const s=a.indexOf(t.target);let n="Home"===t.key?0:"End"===t.key?a.length-1:s+e[t.key];!this.isRtl||"ArrowRight"!==t.key&&"ArrowLeft"!==t.key||(n=s-e[t.key]),n=(n+a.length)%a.length,a.forEach((t,e)=>t.setAttribute("tabindex",e===n?"0":"-1")),a[n].focus()}selectMonth(t){return!t||t.disabled||(this.setState({month:t.index,context:""}),this.set({activeDate:f(new Date(this.year,t.index,1))})),this}selectYear(t){if(!t||t.disabled)return this;const e={year:t.year,context:""},a=this.getClosestEnabledMonth(t.year,this.month);return a!==this.month&&(e.month=a),this.setState(e),this.set({activeDate:f(new Date(t.year,a,1))}),this}getClosestEnabledMonth(t,e){const a=this.setMinDate(),s=this.setMaxDate();return a&&t===a.getFullYear()&&e<a.getMonth()?a.getMonth():s&&t===s.getFullYear()&&e>s.getMonth()?s.getMonth():e}emitChange(){const t=this.startValue&&this.endValue?`${this.startValue}/${this.endValue}`:this.startValue||"",e=this.range?{value:[this.startValue,this.endValue],date:t,startValue:this.startValue,endValue:this.endValue,formattedValue:this.displayValue,formattedStartValue:this.formattedStartValue,formattedEndValue:this.formattedEndValue,isoValue:t,startIsoValue:this.startValue,endIsoValue:this.endValue,range:!0,format:this.format,preset:this.activePreset?this.activePreset.relative?{id:this.activePreset.id,relative:this.activePreset.relative}:{id:this.activePreset.id}:null}:{value:this.date,date:this.date,formattedValue:this.formattedValue,isoValue:this.date,range:!1,format:this.format};this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:e})),this.dispatchEvent(new CustomEvent("sf-datepicker-change",{bubbles:!0,composed:!0,detail:e})),this.emitComponentEvent("change",e)}templateContext(){const t=this.getPropsContext();return this.createTemplateContext({...t,component:this,date:this.date,formattedValue:this.formattedValue,displayValue:this.displayValue,startValue:this.startValue,formattedStartValue:this.formattedStartValue,endValue:this.endValue,formattedEndValue:this.formattedEndValue,range:this.range,format:this.format,selectedDate:this.selectedDate,startDate:this.startDate,endDate:this.endDate,year:this.year,month:this.month,monthLabel:C(this.month,this.locale),calendarLabel:this.calendarLabel,labels:this.labels,weekdays:this.weekdays,panelId:this._panelId,previousIcon:this.isRtl?"chevron_right":"chevron_left",nextIcon:this.isRtl?"chevron_left":"chevron_right",context:this.contextMode,locale:this.locale,days:this.days,presetItems:this.presetItems,months:this.months,years:this.years,yearPageStart:this.yearPageStart,yearPageEnd:this.yearPageEnd,rootClass:this.getRootClass(),rootStyle:this.getRootStyle(),openAbove:Boolean(this.state.openAbove),input:this.input,open:this.open,portal:this.portal,inputType:this.inputType,inputSize:this.inputSize,inputName:this.inputName,placeholder:this.placeholder,label:this.label,ariaLabel:this.ariaLabel,readonly:this.readonly,disabled:this.disabled,required:this.required,leftIcon:this.leftIcon,iconStart:this.leftIcon,inputRootClass:this.inputRootClass,mask:this.mask,maskPattern:this.maskPattern,maskLazy:this.maskLazy,maskPlaceholderChar:this.maskPlaceholderChar,maskOptions:this.maskOptions})}template(){return(0,r.P)(this.templateContext())}afterRender(){this._input=this.refs.input?.value?.querySelector("input")||null,this._input&&(this._input.setAttribute("aria-haspopup","dialog"),this._input.setAttribute("aria-expanded",this.open?"true":"false"),this._input.setAttribute("aria-controls",this._panelId));const t=this.querySelector(".sf-datepicker-month-toggle button"),e=this.querySelector(".sf-datepicker-year-toggle button");t?.setAttribute("aria-expanded","month"===this.contextMode?"true":"false"),e?.setAttribute("aria-expanded","year"===this.contextMode?"true":"false"),this.syncOverlayListeners(),requestAnimationFrame(()=>{if(this.positionPanel(),this._focusCalendarOnOpen||this._focusDateAfterRender){const t=this.querySelector(`.sf-datepicker-day[data-date="${f(this.activeDate)}"]`);t?.focus?.(),this._focusCalendarOnOpen=!1,this._focusDateAfterRender=!1}})}onDisconnected(){this.removeOverlayListeners(),super.onDisconnected()}get data(){return{value:this.value,date:this.date,formattedValue:this.formattedValue,displayValue:this.displayValue,startValue:this.startValue,formattedStartValue:this.formattedStartValue,endValue:this.endValue,formattedEndValue:this.formattedEndValue,range:this.range,format:this.format,year:this.year,month:this.month,context:this.contextMode,maxDate:this.maxDate,minDate:this.minDate,locale:this.locale,input:this.input,open:this.open,portal:this.portal,mask:this.mask,maskPattern:this.maskPattern,maskOptions:this.maskOptions,presets:this.presetItems.map(({id:t,label:e,relative:a,disabled:s})=>({id:t,label:e,relative:a,disabled:s})),preset:this.preset}}}R.define("sf-datepicker"),e()}catch(B){e(B)}})},"77b2f4107e3b"(t,e,a){a.a(t,async(t,s)=>{try{a.d(e,{P:()=>b});var n=a("ddf1cdb42ecc"),r=a("5a8eddcd589d"),i=t([n,r]);[n,r]=i.then?(await i)():i;function o(...t){return t.flat().filter(Boolean).join(" ")}function l(t){return n.html`
|
|
1
|
+
(()=>{"use strict";var t={"98e26702f55a"(t,e,a){function s(){const t=globalThis.SF=globalThis.SF||{};return t.__deprecationNotes instanceof Map||Object.defineProperty(t,"__deprecationNotes",{value:new Map,configurable:!0}),t.__deprecationNotes}function n({component:t="",kind:e="attribute",attribute:a="",from:n,to:r=null}={}){if(!n)return;const i=[t,e,a,n].join("|"),o=s(),l=o.get(i);if(l)l.count+=1;else if(o.set(i,{component:t,kind:e,attribute:a,from:n,to:r,count:1}),function(){const t=globalThis.document?.documentElement;return"warn"===t?.dataset?.sfDeprecations||!0===globalThis.SF?.deprecations?.warn}()){const s=t?`${t}: `:"",i="value"===e?`${a}="${n}"`:`${e} ${n}`;globalThis.console?.warn?.(`[SIMAI Framework] ${s}${i} is a legacy name${r?`; write ${r}`:""}. See contracts/changes/journal.json.`)}}if(a.d(e,{id:()=>l}),"undefined"!=typeof globalThis){globalThis.SF=globalThis.SF||{};const t=globalThis.SF.deprecations||{};t.list=function(){return[...s().values()].map(t=>({...t}))},t.clear=function(){s().clear()},t.note=n,globalThis.SF.deprecations=t}const r=Object.freeze(["1/2","1","2"]),i=Object.freeze({"1/3":"1/2",3:"2"}),o=new Set;function l(t,e="field",a="1"){const s=String(t??"").trim().toLowerCase();if(r.includes(s))return s;if(Object.hasOwn(i,s)){const t=i[s];n({component:e,kind:"value",attribute:"size",from:s,to:t});const a=`${e}:${s}`;return o.has(a)||"undefined"==typeof console||(o.add(a),console.warn(`[SIMAI Framework] ${e}: size ${s} is retired for form fields; rendering size ${t}.`)),t}return a}},"421676f72963"(t,e,a){a.d(e,{Ec:()=>o,Hw:()=>l});const s="sfPopoverOpen",n=new WeakSet,r=Symbol.for("sf.openSurfaceLayers");function i(){const t=globalThis;return Array.isArray(t[r])||(t[r]=[]),t[r]}function o(t,e){if(!t)return;const a=Boolean(e);if(a===n.has(t))return;const r=i();if(a)n.add(t),r.push(t);else{n.delete(t);const e=r.lastIndexOf(t);e>=0&&r.splice(e,1)}!function(t){const e=globalThis.document?.documentElement;if(!e)return;const a=Math.max(0,Number(e.dataset[s]||0)+t);a?e.dataset[s]=String(a):delete e.dataset[s]}(a?1:-1)}function l(t){const e=i();for(let a=e.length-1;a>=0;a-=1){const s=e[a];if(!1!==s?.isConnected)return s===t}return!0}},b9b65955223a(t,e,a){a.a(t,async(t,e)=>{try{var s=a("fbe0570fcc69"),n=a("98e26702f55a"),r=a("77b2f4107e3b"),i=a("5c1dc214bb5e"),o=a("0d662e4d7d63"),l=a("421676f72963"),h=t([s,r,i,o]);[s,r,i,o]=h.then?(await h)():h;var u=a.n(s),d=a.n(i);const c=/^(\d{4})-(\d{2})-(\d{2})$/,p=18;let g=0;function m(t){return String(t).padStart(2,"0")}function f(t){return`${t.getFullYear()}-${m(t.getMonth()+1)}-${m(t.getDate())}`}function b(t,e="YYYY.MM.DD"){if(!t)return"";const a={YYYY:String(t.getFullYear()),YY:String(t.getFullYear()).slice(-2),MM:m(t.getMonth()+1),DD:m(t.getDate())};return String(e||"YYYY.MM.DD").replace(/YYYY|YY|MM|DD/g,t=>a[t]||t)}const y=1e3,v=9999;function D(t,e,a){if(!Number.isInteger(t)||t<y||t>v)return null;const s=new Date(t,e-1,a);return s.getFullYear()!==t||s.getMonth()!==e-1||s.getDate()!==a?null:s}function k(t){if(!t)return null;const e=String(t).match(c);if(!e)return null;const[,a,s,n]=e;return D(Number(a),Number(s),Number(n))}const S=/YYYY|YY|MM|DD/g,M=new Map;function w(t){const e=String(t||"DD.MM.YYYY");if(M.has(e))return M.get(e);const a=e.match(S)||[],s={YYYY:"(\\d{4})",YY:"(\\d{2})",MM:"(\\d{1,2})",DD:"(\\d{1,2})"},n=e.split(S).map(t=>t?"[\\s./,-]+":"").reduce((t,e,n)=>t+e+(n<a.length?s[a[n]]:""),""),r=3===a.length&&a.includes("MM")&&a.includes("DD")&&(a.includes("YYYY")||a.includes("YY"))?{re:new RegExp(`^${n}$`),tokens:a}:null;return M.set(e,r),r}function x(t,e="DD.MM.YYYY"){if(!t)return null;if(t instanceof Date)return(a=t)instanceof Date&&!Number.isNaN(a.getTime())?new Date(t.getFullYear(),t.getMonth(),t.getDate()):null;var a;const s=String(t).trim();if(c.test(s))return k(s);const n=w(e),r=n?s.match(n.re):null;if(!r)return null;const i={};n.tokens.forEach((t,e)=>{i[t]=Number(r[e+1])});return D(i.YYYY??i.YY+2e3,i.MM,i.DD)}function $(t,e=0){const a=(0,s.toNumber)(t,e);return Number.isFinite(a)?Math.max(0,Math.min(11,a)):e}function P(t,e){return t&&e&&t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function Y(t,e){if(!t||!e)return 0;return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}function A(t,e){const a=new Date(t.getFullYear(),t.getMonth()+e,1),s=new Date(a.getFullYear(),a.getMonth()+1,0).getDate();return a.setDate(Math.min(t.getDate(),s)),a}function V(t,e,a){return!!(t&&e&&a)&&(Y(t,e)>0&&Y(t,a)<0)}function _(t="",e=null){const a=String(t||"").trim();return a||(0,o.pageLocale)(e??globalThis.document?.documentElement??null)}function F(t=""){const e=String(t||"");return e?`${e.charAt(0).toLocaleUpperCase()}${e.slice(1)}`:""}function C(t,e){try{return F(new Intl.DateTimeFormat(e,{month:"long"}).format(new Date(2026,t,1)))}catch{return String(t+1)}}function T(t,e){try{return new Intl.DateTimeFormat(e,{weekday:"long",year:"numeric",month:"long",day:"numeric"}).format(t)}catch{return f(t)}}function E(t,e=1){const a=new Date(2026,0,4);return Array.from({length:7},(s,n)=>{const r=new Date(a);r.setDate(a.getDate()+(e+n)%7);try{return new Intl.DateTimeFormat(t,{weekday:"short"}).format(r)}catch{return String((e+n)%7)}})}const I=["today","yesterday","last-7-days","last-30-days","this-week","this-month","last-month"];function O(t,e){return new Date(t.getFullYear(),t.getMonth(),t.getDate()+e)}function L(t,e,a=1){const s=new Date(e.getFullYear(),e.getMonth(),e.getDate());switch(t){case"today":return[s,s];case"yesterday":return[O(s,-1),O(s,-1)];case"last-7-days":return[O(s,-6),s];case"last-30-days":return[O(s,-29),s];case"this-week":return[O(s,-(s.getDay()-a+7)%7),s];case"this-month":return[new Date(s.getFullYear(),s.getMonth(),1),s];case"last-month":return[new Date(s.getFullYear(),s.getMonth()-1,1),new Date(s.getFullYear(),s.getMonth(),0)];default:return null}}const z={en:{previousMonth:"Previous month",nextMonth:"Next month",previousYears:"Previous years",nextYears:"Next years",chooseMonth:"Choose a month",chooseYear:"Choose a year",presets:"Quick ranges",customRange:"Custom range",preset_today:"Today",preset_yesterday:"Yesterday",preset_last7Days:"Last 7 days",preset_last30Days:"Last 30 days",preset_thisWeek:"This week",preset_thisMonth:"This month",preset_lastMonth:"Last month"},ru:{previousMonth:"Предыдущий месяц",nextMonth:"Следующий месяц",previousYears:"Предыдущие годы",nextYears:"Следующие годы",chooseMonth:"Выберите месяц",chooseYear:"Выберите год",presets:"Быстрый выбор",customRange:"Свой период",preset_today:"Сегодня",preset_yesterday:"Вчера",preset_last7Days:"Последние 7 дней",preset_last30Days:"Последние 30 дней",preset_thisWeek:"Эта неделя",preset_thisMonth:"Этот месяц",preset_lastMonth:"Прошлый месяц"}};class R extends(u()){constructor(){super(),this._input=null,this._documentClickHandler=this.handleDocumentClick.bind(this),this._documentKeydownHandler=this.handleDocumentKeydown.bind(this),this._viewportHandler=this.positionPanel.bind(this),this._focusCalendarOnOpen=!1,this._focusDateAfterRender=!1,this._panelId="sf-datepicker-panel-"+ ++g,this.state={openAbove:!1,yearPageStart:null,activeDate:""},this.refs={input:this.createRef(),datePickerRoot:this.createRef(),datePickerPanel:this.createRef()}}static get props(){return{templateName:{attribute:"template",default:"default"},value:{default:""},date:{default:""},startValue:{attribute:"start-value",default:""},endValue:{attribute:"end-value",default:""},maxDate:{default:""},minDate:{default:""},range:{type:Boolean,default:!1},month:{type:Number,default:null},year:{type:Number,default:null},context:{default:""},weekStart:{type:Number,default:null},locale:{default:""},format:{default:"DD.MM.YYYY"},rootClass:{default:""},closeOnSelect:{type:Boolean,default:!0},input:{type:Boolean,default:!0},open:{type:Boolean,default:!1},portal:{type:Boolean,default:!0},inputType:{attribute:"input-type",default:"bordered"},size:{default:"1"},inputSize:{attribute:"input-size",default:"1"},inputName:{attribute:"input-name",default:""},name:{attribute:"name",default:""},placeholder:{default:""},label:{default:""},ariaLabel:{attribute:"aria-label",default:""},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},invalid:{type:Boolean,default:!1},errorMessage:{attribute:"error-message",default:""},iconStart:{type:String,attribute:"icon-start",default:null},leftIcon:{attribute:"left-icon",default:"calendar_today"},inputRootClass:{attribute:"input-root-class",default:""},mask:{type:Boolean,default:!1},maskPattern:{attribute:"mask-pattern",default:""},maskLazy:{attribute:"mask-lazy",default:!1},maskPlaceholderChar:{attribute:"mask-placeholder-char",default:"_"},maskOptions:{attribute:"mask-options",default:""},presets:{default:""},preset:{default:""}}}connectedCallback(){this.upgradeProperty("value"),this.upgradeProperty("presets"),super.connectedCallback()}upgradeProperty(t){if(!Object.prototype.hasOwnProperty.call(this,t))return;const e=this[t];delete this[t],this[t]=e}get componentName(){return"datepicker"}get templateName(){return this.getAttribute("template")||"default"}get selectedDate(){return x(this.date,this.format)}get primaryDate(){const t=this.activePreset;return t?t.to:this.selectedDate||this.startDate}get presets(){return this._presetList??(this.getAttribute("presets")||"")}set presets(t){if(Array.isArray(t))return this._presetList=t,void this.requestComponentUpdate("presets");this._presetList=null,this.setState({presets:t?String(t):""})}get preset(){return this.getAttribute("preset")||""}set preset(t){this.setState({preset:t?String(t):""})}get presetItems(){if(!this.range)return[];const t=Array.isArray(this.presets)?this.presets:String(this.presets).split(/[\s,]+/).filter(Boolean),e=new Date,a=this.setMinDate(),s=this.setMaxDate();return t.map(t=>{const n="string"==typeof t?{id:t,relative:t}:{...t};if(!n?.id)return null;let r=null;if(n.relative)r=L(n.relative,e,this.weekStart);else if(Array.isArray(n.range)){const t=x(n.range[0],this.format),e=x(n.range[1],this.format);t&&e&&(r=Y(t,e)<=0?[t,e]:[e,t])}if(!r)return null;let[i,l]=r;a&&Y(i,a)<0&&(i=a),s&&Y(l,s)>0&&(l=s);const h=Y(i,l)>0,u=n.label||(I.includes(n.id)?(0,o.pageText)(z,(d=n.id,`preset_${String(d).replace(/-([a-z0-9])/g,(t,e)=>e.toUpperCase())}`),this,"sf-datepicker"):n.id);var d;return{id:String(n.id),label:u,relative:n.relative||null,from:i,to:l,disabled:h,pressed:this.preset===String(n.id)}}).filter(Boolean)}get activePreset(){const t=this.preset;if(!t||!this.range)return null;const e=this.presetItems.find(e=>e.id===t);return e&&!e.disabled?e:null}get startDate(){return x(this.startValue,this.format)}get endDate(){return x(this.endValue,this.format)}get date(){return this.hasAttribute("date")?this.getAttribute("date")||"":this.getAttribute("value")||""}setState(t={},e=null){super.setState(t,e);const a=e=>t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,e);return a("date")&&!t.date&&this.hasAttribute("value")&&this.setAttribute("date",""),(a("year")||a("month"))&&(this._gridMoved=!0),this}monthOf(t){const e=x(t,this.format);return e?{year:e.getFullYear(),month:e.getMonth()}:{}}get anchorDate(){const t=this.primaryDate||new Date,e=this.setMinDate(),a=this.setMaxDate();return e&&Y(t,e)<0?e:a&&Y(t,a)>0?a:t}showValueMonth(){this.commitTypedText();if(this.primaryDate){const t=this.anchorDate;this.setState({year:t.getFullYear(),month:t.getMonth(),context:""})}else this._gridMoved&&this.setState({year:"",month:"",context:""});return this._gridMoved=!1,this.set({activeDate:f(this.anchorDate)}),this}commitTypedText(){if(!this.typed||!this._input)return this;const t=String(this._input.value??"").trim();return t&&t!==this.displayValue&&x(t,this.format)?(this.handleInputChange({target:this._input}),this):this}attributeChangedCallback(t,e,a){if(super.attributeChangedCallback(t,e,a),"value"===t&&null!==e&&e!==a&&this.primaryDate){const t=this.primaryDate;this.setState({year:t.getFullYear(),month:t.getMonth()})}}get value(){return this.range?[this.startValue,this.endValue]:this.date}set value(t){if(Array.isArray(t)){const[e="",a=""]=t;return void this.setState({date:e||"",startValue:e||"",endValue:a||"",...this.monthOf(e||a)})}if(t&&"object"==typeof t){const e=t.start||t.startValue||t.date||"",a=t.end||t.endValue||"";return void this.setState({date:t.date||e||"",startValue:e,endValue:a,...this.monthOf(t.date||e||a)})}this.setState({date:t?String(t):"",startValue:"",endValue:"",...this.monthOf(t)})}setMaxDate(){return x(this.maxDate,this.format)}setMinDate(){return x(this.minDate,this.format)}get maxDate(){return this.getAttribute("max-date")||""}get minDate(){return this.getAttribute("min-date")||""}set date(t){this.setState({date:t?String(t):"",...this.monthOf(t)})}get startValue(){const t=this.activePreset;return t?f(t.from):this.getAttribute("start-value")||""}set startValue(t){this.setState({startValue:t?String(t):"",...this.monthOf(t)})}get endValue(){const t=this.activePreset;return t?f(t.to):this.getAttribute("end-value")||""}set endValue(t){this.setState({endValue:t?String(t):""})}get range(){return this.getBooleanAttr("range",!1)}get input(){return this.getBooleanAttr("input",!0)}get open(){return this.getBooleanAttr("open",!1)}get portal(){return this.getBooleanAttr("portal",!0)}get inputType(){return this.getAttribute("input-type")||"bordered"}get size(){return(0,n.id)(this.getAttribute("size")||this.getAttribute("input-size")||"1","sf-datepicker")}get inputSize(){return this.size}get inputName(){return this.getAttribute("input-name")||this.getAttribute("name")||""}get placeholder(){return this.getAttribute("placeholder")||""}get label(){return this.getAttribute("label")||""}get disabled(){return this.getBooleanAttr("disabled",!1)}get required(){return this.getBooleanAttr("required",!1)}get invalid(){return this.getBooleanAttr("invalid",!1)}get errorMessage(){return this.getAttribute("error-message")||""}get closeOnSelect(){return this.getBooleanAttr("close-on-select",!0)}get leftIcon(){return this.hasAttribute("icon-start")?this.getAttribute("icon-start"):this.getAttribute("left-icon")||"calendar_today"}get iconStart(){return this.leftIcon}get inputRootClass(){return this.getAttribute("input-root-class")||""}get mask(){return this.getBooleanAttr("mask",!1)}get maskPattern(){return this.getAttribute("mask-pattern")||this.formatToMask(this.format)}get maskLazy(){return!!this.hasAttribute("mask-lazy")&&this.getBooleanAttr("mask-lazy",!1)}get maskPlaceholderChar(){return this.getAttribute("mask-placeholder-char")||"_"}get maskOptions(){return this.getAttribute("mask-options")||""}get year(){const t=this.anchorDate.getFullYear();return this.hasAttribute("year")?this.getNumberAttr("year",t):t}set year(t){this.setState({year:null==t||""===t?"":String((0,s.toNumber)(t,(new Date).getFullYear()))}),this._gridMoved=!1}get month(){const t=this.anchorDate.getMonth();return this.hasAttribute("month")?$(this.getAttribute("month"),t):t}set month(t){this.setState({month:null==t||""===t?"":String($(t,(new Date).getMonth()))}),this._gridMoved=!1}get contextMode(){return this.getEnumAttr("context",["month","year",""],"")}get weekStart(){if(this.hasAttribute("week-start")){const t=this.getNumberAttr("week-start",1);return Number.isInteger(t)&&t>=0&&t<=7?t%7:1}try{const t=new Intl.Locale(this.locale),e="function"==typeof t.getWeekInfo?t.getWeekInfo():t.weekInfo;if(e?.firstDay)return e.firstDay%7}catch{}return 1}get locale(){return _(this.getAttribute("locale"),this)}get format(){return this.getAttribute("format")||"DD.MM.YYYY"}get ariaLabel(){return this.getProp("ariaLabel")||""}get readonly(){return this.range||this.getBooleanAttr("readonly",!1)}get typed(){return!this.readonly&&!this.disabled}get formattedValue(){return b(this.selectedDate,this.format)}get formattedStartValue(){return b(this.startDate,this.format)}get formattedEndValue(){return b(this.endDate,this.format)}get displayValue(){return this.range?this.formattedStartValue&&this.formattedEndValue?`${this.formattedStartValue} - ${this.formattedEndValue}`:this.formattedStartValue||this.formattedEndValue||"":this.formattedValue}get displayDate(){return new Date(this.year,this.month,1)}get isRtl(){return"rtl"===(this.closest("[dir]")?.getAttribute("dir")||document.documentElement?.dir)}get labels(){return t=this,Object.fromEntries(["previousMonth","nextMonth","previousYears","nextYears","chooseMonth","chooseYear","presets","customRange"].map(e=>[e,(0,o.pageText)(z,e,t,"sf-datepicker")]));var t}get weekdays(){return E(this.locale,this.weekStart)}get calendarLabel(){try{return new Intl.DateTimeFormat(this.locale,{month:"long",year:"numeric"}).format(this.displayDate)}catch{return`${this.month+1}.${this.year}`}}get activeDate(){const t=k(this.state.activeDate)||this.primaryDate||this.displayDate,e=this.setMinDate(),a=this.setMaxDate();return e&&Y(t,e)<0?e:a&&Y(t,a)>0?a:t}get normalizedRange(){const t=this.startDate,e=this.endDate;return t&&e?Y(t,e)<=0?{startDate:t,endDate:e}:{startDate:e,endDate:t}:{startDate:t,endDate:e}}get days(){const t=(new Date(this.year,this.month,1).getDay()-this.weekStart+7)%7,e=new Date(this.year,this.month,1-t),{startDate:a,endDate:s}=this.normalizedRange,n=Boolean(this.startValue&&this.endValue),r=this.setMinDate(),i=this.setMaxDate(),o=this.activeDate,l=new Date;return Array.from({length:42}).map((t,h)=>{const u=new Date(e.getFullYear(),e.getMonth(),e.getDate()+h),d=u.getTime(),c=Boolean(r&&d<r.getTime()||i&&d>i.getTime());return{date:u,value:f(u),formattedValue:b(u,this.format),label:T(u,this.locale),day:u.getDate(),today:P(u,l),currentMonth:u.getMonth()===this.month,weekend:[0,6].includes(u.getDay()),disabled:c,selected:this.range?P(u,a)||P(u,s):P(u,this.selectedDate),rangeStart:this.range&&n&&P(u,a),rangeEnd:this.range&&n&&P(u,s),rangeSelected:this.range&&n&&V(u,a,s),tabIndex:!c&&P(u,o)?0:-1}})}get months(){const t=this.setMinDate(),e=this.setMaxDate(),a=t?new Date(t.getFullYear(),t.getMonth(),1):null,s=e?new Date(e.getFullYear(),e.getMonth(),1):null;return Array.from({length:12}).map((t,e)=>{const n=new Date(this.year,e,1).getTime(),r=Boolean(a&&n<a.getTime()||s&&n>s.getTime());return{index:e,label:C(e,this.locale),selected:e===this.month,disabled:r}})}get years(){const t=this.setMinDate(),e=this.setMaxDate(),a=this.yearPageStart;return Array.from({length:p}).map((s,n)=>{const r=a+n;return{year:r,disabled:Boolean(t&&r<t.getFullYear()||e&&r>e.getFullYear()),selected:r===this.year}})}get yearPageStart(){return this.state.yearPageStart??this.getYearPageStart(this.year)}get yearPageEnd(){return this.yearPageStart+p-1}getYearPageStart(t=this.year){const e=(0,s.toNumber)(t,(new Date).getFullYear());return e-e%p}formatToMask=t=>{let e=String(t).replace(/[A-Za-z]/g,"0");return this.range&&(e+=` - ${e}`),e};setContext(t=""){return this.setState({context:t||""}),this}toggleContext(t){const e=this.contextMode===t?"":t,a={context:e};return"year"===e&&(a.yearPageStart=this.getYearPageStart(this.year)),this.setState(a),this}shiftYearPage(t=1){return this.set({yearPageStart:this.yearPageStart+p*t}),this}shiftMonth(t=1){const e=new Date(this.year,this.month+t,1),a=this.setMinDate(),s=this.setMaxDate();return a&&e<new Date(a.getFullYear(),a.getMonth(),1)||s&&e>new Date(s.getFullYear(),s.getMonth(),1)||(this.setState({year:e.getFullYear(),month:e.getMonth(),context:""}),this.set({activeDate:f(e)})),this}setActiveDate(t){const e=k(t);return e&&this.state.activeDate!==t?(this.set({activeDate:f(e)}),this):this}moveActiveDate(t){const e=new Date(this.activeDate);e.setDate(e.getDate()+t);const a=this.setMinDate(),s=this.setMaxDate();return a&&Y(e,a)<0||s&&Y(e,s)>0||(this._focusDateAfterRender=!0,this.setState({year:e.getFullYear(),month:e.getMonth(),context:""}),this.set({activeDate:f(e)})),this}openPanel({focusCalendar:t=!1}={}){return this.disabled?this:(this._focusCalendarOnOpen=t,this.open?this.state.activeDate||this.set({activeDate:f(this.activeDate)}):this.showValueMonth(),this.open?(this.positionPanel(),this):(this.setState({open:!0}),this))}closePanel({restoreFocus:t=!1}={}){return this.open?(this.setState({open:!1,context:""}),t&&requestAnimationFrame(()=>this._input?.focus?.()),this):this}togglePanel(){return this.open?this.closePanel():this.openPanel()}handleInputChange(t){if(!this.typed)return;"change"===t?.type&&t.stopPropagation();const e=t?.target,a=String(e?.value??"").trim(),s=()=>{const t=e?.querySelector?.("input")||e;t&&"value"in t&&(t.value=this.displayValue)};if(!a){if(!this.date)return;return this.setState({date:"",context:""}),void this.emitChange()}const n=x(a,this.format),r=this.setMinDate(),i=this.setMaxDate(),o=Boolean(n)&&(r&&Y(n,r)<0||i&&Y(n,i)>0);if(!n||o)return void s();const l=f(n);l!==this.date?(this.setState({year:n.getFullYear(),month:n.getMonth(),date:l,context:""}),this.set({activeDate:l}),this.emitChange()):s()}handleInputInput(t){this.typed&&t?.stopPropagation?.()}handleInputClick(t){t?.preventDefault?.(),t?.stopPropagation?.(),this.openPanel()}handleInputKeydown(t){if(this.typed){if("ArrowDown"!==t.key&&"Enter"!==t.key)return;return t.preventDefault(),"Enter"===t.key?void this.handleInputChange(t):void this.openPanel({focusCalendar:!0})}["ArrowDown","Enter"," "].includes(t.key)&&(t.preventDefault(),this.openPanel({focusCalendar:!0}))}handleDayKeydown(t,e){const a=this.isRtl?-1:1,s={ArrowLeft:-a,ArrowRight:a,ArrowUp:-7,ArrowDown:7};if(Object.prototype.hasOwnProperty.call(s,t.key))return t.preventDefault(),void this.moveActiveDate(s[t.key]);if("Home"===t.key||"End"===t.key){t.preventDefault();const a=((e?.date||this.activeDate).getDay()-this.weekStart+7)%7;return void this.moveActiveDate("Home"===t.key?-a:6-a)}if("PageUp"===t.key||"PageDown"===t.key){t.preventDefault();const e="PageUp"===t.key?-1:1;let a=A(this.activeDate,e);const s=this.setMinDate(),n=this.setMaxDate();s&&Y(a,s)<0&&(a=s),n&&Y(a,n)>0&&(a=n),this._focusDateAfterRender=!0,this.setState({year:a.getFullYear(),month:a.getMonth()}),this.set({activeDate:f(a)})}}handlePanelClick(t){t?.stopPropagation?.()}handleDocumentClick(t){if(!this.open)return;const e=t.target;this.contains(e)||this.refs.datePickerPanel.value?.contains?.(e)||this.closePanel()}handleDocumentKeydown(t){this.open&&"Escape"===t.key&&!t.defaultPrevented&&(0,l.Hw)(this)&&(t.preventDefault(),t.stopPropagation(),this.contextMode?this.setContext(""):this.closePanel({restoreFocus:!0}))}syncOverlayListeners(){const t=Boolean(this.input&&this.open);if((0,l.Ec)(this,t),t)return document.addEventListener("click",this._documentClickHandler),void document.addEventListener("keydown",this._documentKeydownHandler,!0);this.removeOverlayListeners()}removeOverlayListeners(){(0,l.Ec)(this,!1),document.removeEventListener("click",this._documentClickHandler),document.removeEventListener("keydown",this._documentKeydownHandler,!0),this.stopPanelPosition(),window.removeEventListener("resize",this._viewportHandler),document.removeEventListener("scroll",this._viewportHandler,!0),window.visualViewport?.removeEventListener("resize",this._viewportHandler),window.visualViewport?.removeEventListener("scroll",this._viewportHandler)}positionPanel(){const t=this.refs.datePickerPanel.value,e=this._input?.closest(".sf-input-field")||this._input||this.querySelector("sf-input");if(this.isConnected&&this.input&&this.portal&&this.open&&t?.isConnected&&e)return this._panelAnchor&&this._panelAnchorPanel===t&&this._panelAnchorTrigger===e?void this._panelAnchor.update():(this.stopPanelPosition(),Object.assign(t.style,{overflowY:"auto",zIndex:"var(--sf-z-index-9)"}),this._panelAnchorPanel=t,this._panelAnchorTrigger=e,void(this._panelAnchor=(globalThis.SF?.Position||d()).anchor(e,t,{side:"block-end",align:"start",onPosition:({side:t})=>{const e="block-start"===t;Boolean(this.state.openAbove)!==e&&this.set({openAbove:e})}})));this.stopPanelPosition()}stopPanelPosition(){this._panelAnchor?.stop(),this._panelAnchor=null,this._panelAnchorPanel=null,this._panelAnchorTrigger=null}selectDate(t){return!t?.date||t.disabled?this:this.range?(this.selectRangeDate(t),this):(this.setState({year:t.date.getFullYear(),month:t.date.getMonth(),date:t.value,context:""}),this.set({activeDate:t.value}),this.emitChange(),this.closeOnSelect&&this.closePanel({restoreFocus:!0}),this)}selectRangeDate(t){if(!this.startValue||this.startValue&&this.endValue)return this.setState({year:t.date.getFullYear(),month:t.date.getMonth(),startValue:t.value,endValue:"",date:t.value,context:"",preset:""}),this.set({activeDate:t.value}),this.emitChange(),this;const e=this.startDate,a={year:t.date.getFullYear(),month:t.date.getMonth(),context:"",preset:""};return e&&Y(t.date,e)<0?(a.startValue=t.value,a.endValue=this.startValue,a.date=t.value):(a.endValue=t.value,a.date=this.startValue),this.setState(a),this.set({activeDate:t.value}),this.emitChange(),this.closeOnSelect&&this.closePanel({restoreFocus:!0}),this}choosePreset(t){if(!t||t.disabled)return this;const e=f(t.from),a=f(t.to);return this.setState({preset:t.id,startValue:e,endValue:a,date:e,year:t.to.getFullYear(),month:t.to.getMonth(),context:""}),this.set({activeDate:a}),this.emitChange(),this.closeOnSelect&&this.closePanel({restoreFocus:!0}),this}chooseCustomRange(){return this.preset&&this.setState({preset:"",startValue:"",endValue:"",date:""}),this._focusDateAfterRender=!0,this.requestComponentUpdate("custom-range"),this}handlePresetKeydown(t){const e={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1};if(!(t.key in e)&&"Home"!==t.key&&"End"!==t.key)return;const a=[...t.currentTarget.querySelectorAll("button:not(:disabled)")];if(!a.length)return;t.preventDefault();const s=a.indexOf(t.target);let n="Home"===t.key?0:"End"===t.key?a.length-1:s+e[t.key];!this.isRtl||"ArrowRight"!==t.key&&"ArrowLeft"!==t.key||(n=s-e[t.key]),n=(n+a.length)%a.length,a.forEach((t,e)=>t.setAttribute("tabindex",e===n?"0":"-1")),a[n].focus()}selectMonth(t){return!t||t.disabled||(this.setState({month:t.index,context:""}),this.set({activeDate:f(new Date(this.year,t.index,1))})),this}selectYear(t){if(!t||t.disabled)return this;const e={year:t.year,context:""},a=this.getClosestEnabledMonth(t.year,this.month);return a!==this.month&&(e.month=a),this.setState(e),this.set({activeDate:f(new Date(t.year,a,1))}),this}getClosestEnabledMonth(t,e){const a=this.setMinDate(),s=this.setMaxDate();return a&&t===a.getFullYear()&&e<a.getMonth()?a.getMonth():s&&t===s.getFullYear()&&e>s.getMonth()?s.getMonth():e}emitChange(){const t=this.startValue&&this.endValue?`${this.startValue}/${this.endValue}`:this.startValue||"",e=this.range?{value:[this.startValue,this.endValue],date:t,startValue:this.startValue,endValue:this.endValue,formattedValue:this.displayValue,formattedStartValue:this.formattedStartValue,formattedEndValue:this.formattedEndValue,isoValue:t,startIsoValue:this.startValue,endIsoValue:this.endValue,range:!0,format:this.format,preset:this.activePreset?this.activePreset.relative?{id:this.activePreset.id,relative:this.activePreset.relative}:{id:this.activePreset.id}:null}:{value:this.date,date:this.date,formattedValue:this.formattedValue,isoValue:this.date,range:!1,format:this.format};this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:e})),this.dispatchEvent(new CustomEvent("sf-datepicker-change",{bubbles:!0,composed:!0,detail:e})),this.emitComponentEvent("change",e)}templateContext(){const t=this.getPropsContext();return this.createTemplateContext({...t,component:this,date:this.date,formattedValue:this.formattedValue,displayValue:this.displayValue,startValue:this.startValue,formattedStartValue:this.formattedStartValue,endValue:this.endValue,formattedEndValue:this.formattedEndValue,range:this.range,format:this.format,selectedDate:this.selectedDate,startDate:this.startDate,endDate:this.endDate,year:this.year,month:this.month,monthLabel:C(this.month,this.locale),calendarLabel:this.calendarLabel,labels:this.labels,weekdays:this.weekdays,panelId:this._panelId,previousIcon:this.isRtl?"chevron_right":"chevron_left",nextIcon:this.isRtl?"chevron_left":"chevron_right",context:this.contextMode,locale:this.locale,days:this.days,presetItems:this.presetItems,months:this.months,years:this.years,yearPageStart:this.yearPageStart,yearPageEnd:this.yearPageEnd,rootClass:this.getRootClass(),rootStyle:this.getRootStyle(),openAbove:Boolean(this.state.openAbove),input:this.input,open:this.open,portal:this.portal,inputType:this.inputType,inputSize:this.inputSize,inputName:this.inputName,placeholder:this.placeholder,label:this.label,ariaLabel:this.ariaLabel,readonly:this.readonly,disabled:this.disabled,required:this.required,invalid:this.invalid,errorMessage:this.errorMessage,leftIcon:this.leftIcon,iconStart:this.leftIcon,inputRootClass:this.inputRootClass,mask:this.mask,maskPattern:this.maskPattern,maskLazy:this.maskLazy,maskPlaceholderChar:this.maskPlaceholderChar,maskOptions:this.maskOptions})}template(){return(0,r.P)(this.templateContext())}afterRender(){this._input=this.refs.input?.value?.querySelector("input")||null,this._input&&(this._input.setAttribute("aria-haspopup","dialog"),this._input.setAttribute("aria-expanded",this.open?"true":"false"),this._input.setAttribute("aria-controls",this._panelId));const t=this.querySelector(".sf-datepicker-month-toggle button"),e=this.querySelector(".sf-datepicker-year-toggle button");t?.setAttribute("aria-expanded","month"===this.contextMode?"true":"false"),e?.setAttribute("aria-expanded","year"===this.contextMode?"true":"false"),this.syncOverlayListeners(),requestAnimationFrame(()=>{if(this.positionPanel(),this._focusCalendarOnOpen||this._focusDateAfterRender){const t=this.querySelector(`.sf-datepicker-day[data-date="${f(this.activeDate)}"]`);t?.focus?.(),this._focusCalendarOnOpen=!1,this._focusDateAfterRender=!1}})}onDisconnected(){this.removeOverlayListeners(),super.onDisconnected()}get data(){return{value:this.value,date:this.date,formattedValue:this.formattedValue,displayValue:this.displayValue,startValue:this.startValue,formattedStartValue:this.formattedStartValue,endValue:this.endValue,formattedEndValue:this.formattedEndValue,range:this.range,format:this.format,year:this.year,month:this.month,context:this.contextMode,maxDate:this.maxDate,minDate:this.minDate,locale:this.locale,input:this.input,open:this.open,portal:this.portal,mask:this.mask,maskPattern:this.maskPattern,maskOptions:this.maskOptions,presets:this.presetItems.map(({id:t,label:e,relative:a,disabled:s})=>({id:t,label:e,relative:a,disabled:s})),preset:this.preset}}}R.define("sf-datepicker"),e()}catch(B){e(B)}})},"77b2f4107e3b"(t,e,a){a.a(t,async(t,s)=>{try{a.d(e,{P:()=>b});var n=a("ddf1cdb42ecc"),r=a("5a8eddcd589d"),i=t([n,r]);[n,r]=i.then?(await i)():i;function o(...t){return t.flat().filter(Boolean).join(" ")}function l(t){return n.html`
|
|
2
2
|
<div class="sf-datepicker-top flex content-main-between items-cross-center">
|
|
3
3
|
<sf-icon-button appearance="link" scheme="on-surface" size="1"
|
|
4
4
|
icon=${t.previousIcon} aria-label=${t.labels.previousYears}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<sf-icon-button appearance="link" scheme="on-surface" size="1"
|
|
10
10
|
icon=${t.nextIcon} aria-label=${t.labels.nextYears}
|
|
11
11
|
@click=${()=>t.component.shiftYearPage(1)}></sf-icon-button>
|
|
12
|
-
</div>`}function
|
|
12
|
+
</div>`}function h(t){return"year"===t.context?l(t):n.html`
|
|
13
13
|
<div class="sf-datepicker-top grid items-cross-center">
|
|
14
14
|
<sf-icon-button appearance="link" scheme="on-surface" size="1"
|
|
15
15
|
icon=${t.previousIcon} aria-label=${t.labels.previousMonth}
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<sf-icon-button appearance="link" scheme="on-surface" size="1"
|
|
28
28
|
icon=${t.nextIcon} aria-label=${t.labels.nextMonth}
|
|
29
29
|
@click=${()=>t.component.shiftMonth(1)}></sf-icon-button>
|
|
30
|
-
</div>`}function
|
|
30
|
+
</div>`}function u(t){return n.html`
|
|
31
31
|
<div class="sf-datepicker-context absolute top-0 bottom-0 inline-start-0 inline-end-0 grid grid-col-3 content-cross-start items-cross-start overflow-auto gap-1/4"
|
|
32
32
|
aria-label=${t.labels.chooseMonth}>
|
|
33
33
|
${t.months.map(e=>n.html`
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
type="button" @click=${()=>t.component.selectMonth(e)}>
|
|
37
37
|
<span class="sf-datepicker-text-date">${e.label}</span>
|
|
38
38
|
</button>`)}
|
|
39
|
-
</div>`}function
|
|
39
|
+
</div>`}function d(t){return n.html`
|
|
40
40
|
<div class="sf-datepicker-context absolute top-0 bottom-0 inline-start-0 inline-end-0 grid grid-col-3 content-cross-start items-cross-start overflow-auto gap-1/4"
|
|
41
41
|
aria-label=${t.labels.chooseYear}>
|
|
42
42
|
${t.years.map(e=>n.html`
|
|
@@ -45,14 +45,15 @@
|
|
|
45
45
|
@click=${()=>t.component.selectYear(e)}>
|
|
46
46
|
<span class="sf-datepicker-text-date">${e.year}</span>
|
|
47
47
|
</button>`)}
|
|
48
|
-
</div>`}function
|
|
48
|
+
</div>`}function c(t){return"month"===t.context?u(t):"year"===t.context?d(t):n.nothing}function p(t){return n.html`
|
|
49
49
|
<sf-input class="sf-datepicker-input" ${(0,r.ref)(t.component.refs.input)}
|
|
50
50
|
appearance=${t.inputType} size=${t.inputSize}
|
|
51
51
|
label=${t.label||n.nothing} name=${t.inputName||n.nothing}
|
|
52
52
|
aria-label=${t.label?n.nothing:t.ariaLabel||n.nothing}
|
|
53
53
|
placeholder=${t.placeholder||n.nothing} icon-start=${t.iconStart||n.nothing}
|
|
54
54
|
root-class=${t.inputRootClass||n.nothing} value=${t.displayValue||""}
|
|
55
|
-
?disabled=${t.disabled} ?required=${t.required} ?
|
|
55
|
+
?disabled=${t.disabled} ?required=${t.required} ?invalid=${t.invalid}
|
|
56
|
+
error-message=${t.errorMessage||n.nothing} ?mask=${t.mask}
|
|
56
57
|
mask-pattern=${t.maskPattern||n.nothing} mask-lazy=${String(t.maskLazy)}
|
|
57
58
|
mask-placeholder-char=${t.maskPlaceholderChar||n.nothing}
|
|
58
59
|
mask-options=${t.maskOptions||n.nothing} ?readonly=${t.readonly}
|
|
@@ -86,12 +87,12 @@
|
|
|
86
87
|
@click=${e=>t.component.handlePanelClick(e)}>
|
|
87
88
|
${m(t)}
|
|
88
89
|
<div class="sf-datepicker-container flex flex-col">
|
|
89
|
-
${
|
|
90
|
+
${h(t)}
|
|
90
91
|
<div class="sf-datepicker-weekdays grid grid-col-7" aria-hidden="true">
|
|
91
92
|
${t.weekdays.map(t=>n.html`<span class="sf-datepicker-weekday">${t}</span>`)}
|
|
92
93
|
</div>
|
|
93
94
|
<div class="sf-datepicker-main relative">
|
|
94
|
-
${
|
|
95
|
+
${c(t)}
|
|
95
96
|
<div class="sf-datepicker-grid grid grid-col-7">
|
|
96
97
|
${t.days.map(e=>g(e,t))}
|
|
97
98
|
</div>
|
|
@@ -102,4 +103,4 @@
|
|
|
102
103
|
${(0,r.ref)(t.component.refs.datePickerRoot)} data-portal=${t.portal?"true":"false"}>
|
|
103
104
|
${p(t)}
|
|
104
105
|
${t.open?f(t):n.nothing}
|
|
105
|
-
</div>`:f(t)}s()}catch(y){s(y)}})},"5a8eddcd589d"(t){t.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit/directives/ref.js"):new Promise(t=>globalThis.addEventListener("sf-runtime-ready",()=>t(globalThis.SF.runtimeModule("lit/directives/ref.js")),{once:!0}))},ddf1cdb42ecc(t){t.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit"):new Promise(t=>globalThis.addEventListener("sf-runtime-ready",()=>t(globalThis.SF.runtimeModule("lit")),{once:!0}))},"0d662e4d7d63"(t){t.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("page-language"):new Promise(t=>globalThis.addEventListener("sf-runtime-ready",()=>t(globalThis.SF.runtimeModule("page-language")),{once:!0}))},"5c1dc214bb5e"(t){t.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("position"):new Promise(t=>globalThis.addEventListener("sf-runtime-ready",()=>t(globalThis.SF.runtimeModule("position")),{once:!0}))},fbe0570fcc69(t){t.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("smart-base"):new Promise(t=>globalThis.addEventListener("sf-runtime-ready",()=>t(globalThis.SF.runtimeModule("smart-base")),{once:!0}))}};const e={};function a(s){const n=e[s];if(void 0!==n)return n.exports;const r=e[s]={exports:{}};return t[s](r,r.exports,a),r.exports}(()=>{const t="function"==typeof Symbol,e=t?Symbol("webpack queues"):"__webpack_queues__",s=t?Symbol("webpack exports"):"__webpack_exports__",n=t?Symbol("webpack error"):"__webpack_error__",r=t=>{t?.d<1&&(t.d=1,t.forEach(t=>t.r--),t.forEach(t=>t.r--?t.r++:t()))};a.a=(t,a,i)=>{let o;i&&((o=[]).d=-1);const l=new Set,
|
|
106
|
+
</div>`:f(t)}s()}catch(y){s(y)}})},"5a8eddcd589d"(t){t.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit/directives/ref.js"):new Promise(t=>globalThis.addEventListener("sf-runtime-ready",()=>t(globalThis.SF.runtimeModule("lit/directives/ref.js")),{once:!0}))},ddf1cdb42ecc(t){t.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit"):new Promise(t=>globalThis.addEventListener("sf-runtime-ready",()=>t(globalThis.SF.runtimeModule("lit")),{once:!0}))},"0d662e4d7d63"(t){t.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("page-language"):new Promise(t=>globalThis.addEventListener("sf-runtime-ready",()=>t(globalThis.SF.runtimeModule("page-language")),{once:!0}))},"5c1dc214bb5e"(t){t.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("position"):new Promise(t=>globalThis.addEventListener("sf-runtime-ready",()=>t(globalThis.SF.runtimeModule("position")),{once:!0}))},fbe0570fcc69(t){t.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("smart-base"):new Promise(t=>globalThis.addEventListener("sf-runtime-ready",()=>t(globalThis.SF.runtimeModule("smart-base")),{once:!0}))}};const e={};function a(s){const n=e[s];if(void 0!==n)return n.exports;const r=e[s]={exports:{}};return t[s](r,r.exports,a),r.exports}(()=>{const t="function"==typeof Symbol,e=t?Symbol("webpack queues"):"__webpack_queues__",s=t?Symbol("webpack exports"):"__webpack_exports__",n=t?Symbol("webpack error"):"__webpack_error__",r=t=>{t?.d<1&&(t.d=1,t.forEach(t=>t.r--),t.forEach(t=>t.r--?t.r++:t()))};a.a=(t,a,i)=>{let o;i&&((o=[]).d=-1);const l=new Set,h=t.exports;let u,d,c;const p=new Promise((t,e)=>{c=e,d=t});p[s]=h,p[e]=t=>(o&&t(o),l.forEach(t),p.catch(t=>{})),t.exports=p;a(t=>{let a;u=(t=>t.map(t=>{if(null!==t&&"object"==typeof t){if(t[e])return t;if(t.then){const a=[];a.d=0,t.then(t=>{i[s]=t,r(a)},t=>{i[n]=t,r(a)});const i={};return i[e]=t=>t(a),i}}const a={};return a[e]=t=>{},a[s]=t,a}))(t);const i=()=>u.map(t=>{if(t[n])throw t[n];return t[s]}),h=new Promise(t=>{a=()=>t(i),a.r=0;const s=t=>t!==o&&!l.has(t)&&(l.add(t),t&&!t.d&&(a.r++,t.push(a)));u.map(t=>t[e](s))});return a.r?h:i()},t=>(t?c(p[n]=t):d(h),r(o))),o?.d<0&&(o.d=0)}})(),a.n=t=>{const e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{if(Array.isArray(e))for(var s=0;s<e.length;){var n=e[s++],r=e[s++];a.o(t,n)?0===r&&s++:0===r?Object.defineProperty(t,n,{enumerable:!0,value:e[s++]}):Object.defineProperty(t,n,{enumerable:!0,get:r})}else for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);a("b9b65955223a")})();
|
|
@@ -191,6 +191,16 @@
|
|
|
191
191
|
"default": false,
|
|
192
192
|
"description": "Mark the field required in its form."
|
|
193
193
|
},
|
|
194
|
+
"invalid": {
|
|
195
|
+
"type": "boolean",
|
|
196
|
+
"default": false,
|
|
197
|
+
"description": "Draw the field invalid: the error border and aria-invalid on the native input. Removing it restores the valid field."
|
|
198
|
+
},
|
|
199
|
+
"error-message": {
|
|
200
|
+
"type": "string",
|
|
201
|
+
"default": "",
|
|
202
|
+
"description": "The message under an invalid field; ignored while the field is valid."
|
|
203
|
+
},
|
|
194
204
|
"icon-start": {
|
|
195
205
|
"type": "string",
|
|
196
206
|
"default": "calendar_today",
|
|
@@ -578,11 +588,11 @@
|
|
|
578
588
|
"source_artifacts": [
|
|
579
589
|
{
|
|
580
590
|
"path": "src/smart/datepicker/index.js",
|
|
581
|
-
"sha256": "
|
|
591
|
+
"sha256": "3d5194c8215b86e834b21cd5ed46925ae18d0aa524c06fbf54cef03113a47085"
|
|
582
592
|
},
|
|
583
593
|
{
|
|
584
594
|
"path": "src/smart/datepicker/js/templates/default.js",
|
|
585
|
-
"sha256": "
|
|
595
|
+
"sha256": "7c9b379eda8911e7e31ce7ed3076121fcb98b5d688d53eeca1af9e2f8bd98492"
|
|
586
596
|
},
|
|
587
597
|
{
|
|
588
598
|
"path": "src/smart/datepicker/rule.js",
|
|
@@ -590,7 +600,7 @@
|
|
|
590
600
|
},
|
|
591
601
|
{
|
|
592
602
|
"path": "src/smart/datepicker/docs/smart-datepicker-guide.md",
|
|
593
|
-
"sha256": "
|
|
603
|
+
"sha256": "6186dd8f081883431b8ce6292ee936dee08afaf7ce7a22ec914f9254fda0eeec"
|
|
594
604
|
}
|
|
595
605
|
],
|
|
596
606
|
"generated_runtime": [
|
|
@@ -84,7 +84,8 @@ function renderDatepickerInput(context) {
|
|
|
84
84
|
aria-label=${context.label ? nothing : (context.ariaLabel || nothing)}
|
|
85
85
|
placeholder=${context.placeholder || nothing} icon-start=${context.iconStart || nothing}
|
|
86
86
|
root-class=${context.inputRootClass || nothing} value=${context.displayValue || ''}
|
|
87
|
-
?disabled=${context.disabled} ?required=${context.required} ?
|
|
87
|
+
?disabled=${context.disabled} ?required=${context.required} ?invalid=${context.invalid}
|
|
88
|
+
error-message=${context.errorMessage || nothing} ?mask=${context.mask}
|
|
88
89
|
mask-pattern=${context.maskPattern || nothing} mask-lazy=${String(context.maskLazy)}
|
|
89
90
|
mask-placeholder-char=${context.maskPlaceholderChar || nothing}
|
|
90
91
|
mask-options=${context.maskOptions || nothing} ?readonly=${context.readonly}
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
label=${e.label||e.key||""}
|
|
170
170
|
@change=${t=>r.setFieldValue(e,t.detail?.value??"")}
|
|
171
171
|
></sf-color>
|
|
172
|
-
`}function A(e,t){return t&&"object"==typeof t&&t.label?X(e)?z(t):{component:{type:"reference-link",props:{line:b,label:String(t.label),icon:x(t.mime),...t.href?{href:String(t.href)}:{}}}}:null}function z(e){const t=String(e.mime??e.mimeType??""),r=Boolean(e.href)&&/^image\//u.test(t);return{component:{type:"file-preview",props:{compact:!0,fileName:String(e.label),mimeType:t,icon:x(t),...e.href?{href:String(e.href)}:{},...r?{imageUrl:String(e.href),kind:"image"}:{kind:"icon"},actions:!1,downloadAction:!1,removeAction:!1}}}}function _(e,t){if(!Array.isArray(t)||!t.length)return null;if("badges"===String(e.variant??""))return q(e,t);const r=e.options||e.filter?.options||e.constraints?.options,a=e=>{const t=Array.isArray(r)?r.find(t=>String(t?.value)===String(e)):null;return String(t?.label??t?.text??e)};return t.map(e=>({component:{type:"tag",props:{line:b,kind:"default",text:a(e)}}}))}function q(e,t){const r=e.options||e.filter?.options||e.constraints?.options;return t.map(t=>{const a=t&&"object"==typeof t?t.value:t,l=Array.isArray(r)?r.find(e=>String(e?.value)===String(a)):null,i=l?(0,n.f)(l):null,o=t&&"object"==typeof t&&void 0!==t.text?String(t.text):String(l?.label??l?.text??a);return{component:{type:"badge",props:{line:b,text:o,appearance:e.badgeAppearance??S,...i?.scheme?{scheme:i.scheme}:{},...i?.rootStyle?{rootStyle:i.rootStyle}:{}}}}})}const O={string:G,date:j,datetime:j,boolean:E,choices:_,file:A,color:k,include:re,choice:P,integer:B,number:B,user:
|
|
172
|
+
`}function A(e,t){return t&&"object"==typeof t&&t.label?X(e)?z(t):{component:{type:"reference-link",props:{line:b,label:String(t.label),icon:x(t.mime),...t.href?{href:String(t.href)}:{}}}}:null}function z(e){const t=String(e.mime??e.mimeType??""),r=Boolean(e.href)&&/^image\//u.test(t);return{component:{type:"file-preview",props:{compact:!0,fileName:String(e.label),mimeType:t,icon:x(t),...e.href?{href:String(e.href)}:{},...r?{imageUrl:String(e.href),kind:"image"}:{kind:"icon"},actions:!1,downloadAction:!1,removeAction:!1}}}}function _(e,t){if(!Array.isArray(t)||!t.length)return null;if("badges"===String(e.variant??""))return q(e,t);const r=e.options||e.filter?.options||e.constraints?.options,a=e=>{const t=Array.isArray(r)?r.find(t=>String(t?.value)===String(e)):null;return String(t?.label??t?.text??e)};return t.map(e=>({component:{type:"tag",props:{line:b,kind:"default",text:a(e)}}}))}function q(e,t){const r=e.options||e.filter?.options||e.constraints?.options;return t.map(t=>{const a=t&&"object"==typeof t?t.value:t,l=Array.isArray(r)?r.find(e=>String(e?.value)===String(a)):null,i=l?(0,n.f)(l):null,o=t&&"object"==typeof t&&void 0!==t.text?String(t.text):String(l?.label??l?.text??a);return{component:{type:"badge",props:{line:b,text:o,appearance:e.badgeAppearance??S,...i?.scheme?{scheme:i.scheme}:{},...i?.rootStyle?{rootStyle:i.rootStyle}:{}}}}})}const O={string:G,date:j,datetime:j,boolean:E,choices:_,file:A,color:k,include:re,choice:P,integer:B,number:B,user:M,record:R,relation:R};function V(e,t){return{yes:e.trueText??e.labels?.true??ve(t,"yes"),no:e.falseText??e.labels?.false??ve(t,"no")}}function E(e,t,r){if("boolean"!=typeof t)return null;const a=V(e,r);return t?a.yes:a.no}function P(e,t){const r=e.options||e.filter?.options||e.constraints?.options;if(!Array.isArray(r))return null;const a=r.find(e=>String(e?.value)===String(t));if(!a)return null;const l=(0,n.f)(a);return{component:{type:"badge",props:{line:b,text:a.label??a.text??String(t),appearance:e.badgeAppearance??S,...l?.scheme?{scheme:l.scheme}:{},...l?.rootStyle?{rootStyle:l.rootStyle}:{}}}}}function j(e,t,r){const a=r?.formatFieldValue?.(e,t);return"string"==typeof a&&""!==a?a:null}function B(e,t,r){const a=e.variant||e.filter?.variant,n=Number(Ae(t));return"scale"===a&&Number.isFinite(n)?n<0||n>100?null:{component:{type:"progress-scale",props:{line:b,value:String(n)}}}:j(e,t,r)}function C(e){return{component:{type:"reference-link",props:{line:b,appearance:"plain",icon:"",label:String(e.label),...e.href?{href:String(e.href)}:{}}}}}function M(e,t){return t&&"object"==typeof t&&t.label?[{component:{type:"avatar",props:{line:b,text:t.avatarText||""}}},t.href?C(t):String(t.label)]:null}function R(e,t){return t&&"object"==typeof t&&t.label?C(t):null}function I(e={},t,r){const a=e.propertyType||e.type||e.dataType,n=O[a];if(!n)return null;const l=n(e,t,r);return l??null}let L="1";const N={record:be,relation:be,user:be,string:ae,text:ne,integer:le,number:le,date:se,datetime:de,boolean:ce,choice:fe,choices:he,file:we,color:T,include:te};function K(e){return`sf_field_${e.key||"value"}`}function U(e,t,r){return a.html`
|
|
173
173
|
<sf-country-code
|
|
174
174
|
size=${L}
|
|
175
175
|
name=${K(e)}
|
|
@@ -268,7 +268,7 @@
|
|
|
268
268
|
?required=${Boolean(e.required)}
|
|
269
269
|
@change=${t=>{const a=t.detail?.value??t.target?.value??null;r.setFieldValue(e,a&&l?`${a}${l}`:a)}}
|
|
270
270
|
></sf-datepicker>
|
|
271
|
-
`}let ue=0;function de(e,t,r){const n=(0,o.AC)(t),l=String(e.label||e.key||""),i=K(e),s="sf-field-datetime-message-"+ ++ue,u=e=>ve(r,e).replace("{label}",l),d=(t,a)=>{if("date"===a&&t.target!==t.currentTarget)return;const l=t.currentTarget?.closest?.(".sf-field-datetime");if(!l)return;const i=l.querySelector("sf-datepicker"),s=l.querySelector("sf-input.sf-field-datetime-time"),u=String("date"===a?t.detail?.value??i?.value??"":i?.value??""),d=String(s?.value??""),c=(0,o.cy)(n,{date:u,time:d}),p=c.error?ve(r,`dateTime_${c.error}`):"",f=l.querySelector(".sf-field-datetime-message");f&&(f.textContent=p,f.hidden=!p),l.toggleAttribute("data-invalid",Boolean(p));const m="timeMissing"===c.error||"timeInvalid"===c.error;if(s?.toggleAttribute("invalid",m),r.setFieldError?.(e,p||null),c.error)return void r.setFieldValue(e,void 0);const g=(0,o.d2)(d);s&&g&&g!==d&&(s.value=g);const h=null===c.value?n.known&&!n.date:c.value===n.raw;r.setFieldValue(e,h?void 0:c.value)};return a.html`
|
|
271
|
+
`}let ue=0;function de(e,t,r){const n=(0,o.AC)(t),l=String(e.label||e.key||""),i=K(e),s="sf-field-datetime-message-"+ ++ue,u=e=>ve(r,e).replace("{label}",l),d=(t,a)=>{if("date"===a&&t.target!==t.currentTarget)return;const l=t.currentTarget?.closest?.(".sf-field-datetime");if(!l)return;const i=l.querySelector("sf-datepicker"),s=l.querySelector("sf-input.sf-field-datetime-time"),u=String("date"===a?t.detail?.value??i?.value??"":i?.value??""),d=String(s?.value??""),c=(0,o.cy)(n,{date:u,time:d}),p=c.error?ve(r,`dateTime_${c.error}`):"",f=l.querySelector(".sf-field-datetime-message");f&&(f.textContent=p,f.hidden=!p),l.toggleAttribute("data-invalid",Boolean(p));const m="timeMissing"===c.error||"timeInvalid"===c.error;if(s?.toggleAttribute("invalid",m),i?.toggleAttribute("invalid","dateMissing"===c.error||"dateInvalid"===c.error),r.setFieldError?.(e,p||null),c.error)return void r.setFieldValue(e,void 0);const g=(0,o.d2)(d);s&&g&&g!==d&&(s.value=g);const h=null===c.value?n.known&&!n.date:c.value===n.raw;r.setFieldValue(e,h?void 0:c.value)};return a.html`
|
|
272
272
|
<div class="sf-field-datetime flex flex-col gap-1/4 min-w-0" role="group" aria-label=${l}
|
|
273
273
|
aria-describedby=${s} data-datetime=${e.key||"value"}>
|
|
274
274
|
<div class="flex flex-nowrap items-cross-center gap-1/3 min-w-0">
|
|
@@ -421,7 +421,7 @@
|
|
|
421
421
|
></sf-file-upload>
|
|
422
422
|
`:a.nothing}
|
|
423
423
|
</div>
|
|
424
|
-
`}const xe=e=>"1/2"===e?.size?"1/2":"1";function ke(e={},t,r,a={}){const n=e.propertyType||e.type||e.dataType;if(!0===e.readonly&&
|
|
424
|
+
`}const xe=e=>"1/2"===e?.size?"1/2":"1";function ke(e={},t,r,a={}){const n=e.propertyType||e.type||e.dataType;if(!0===e.readonly&&Me[n])return Re(e,t,r,a);const l=N[n];if(!l||!r?.setFieldValue)return null;const i=L;L=xe(a);try{return l(e,t,r)}finally{L=i}}let Fe="1";function Te(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)&&"string"==typeof e.text}function Ae(e){return Te(e)?e.value:e}function ze(e,t,r){const a=r?.formatFieldValue?.(e,t);if("string"==typeof a)return a;if(Te(t))return t.text;const n=Ae(t);return null==n?"":String(n)}function _e(e,t,r){const n=ze(e,t,r);return n?a.html`<span class="sf-field-view">${n}</span>`:a.nothing}function qe(e,t,r){if(null==t||""===t)return a.nothing;const n=e.variant||e.filter?.variant,l=Number(Ae(t));if("scale"===n&&Number.isFinite(l)&&l>=0&&l<=100)return a.html`<sf-progress-scale size="1" value=${String(l)}></sf-progress-scale>`;const i=ze(e,t,r);return a.html`<span class="sf-field-view">${e.unit?`${i} ${e.unit}`:i}</span>`}function Oe(e,t,r){const n=ze(e,t,r);return n?a.html`<span class="sf-field-view">${n}</span>`:a.nothing}function Ve(e,t,r){if("boolean"!=typeof t)return a.nothing;const n=V(e,r);return a.html`<span class="sf-field-view">${t?n.yes:n.no}</span>`}function Ee(e,t){const r=e.options||e.filter?.options||e.constraints?.options,l=Array.isArray(r)?r.find(e=>String(e?.value)===String(t)):null;if(!l)return a.nothing;const i=(0,n.f)(l);return a.html`
|
|
425
425
|
<sf-badge
|
|
426
426
|
line=${Fe}
|
|
427
427
|
appearance=${e.badgeAppearance??S}
|
|
@@ -463,4 +463,4 @@
|
|
|
463
463
|
></sf-file-preview>
|
|
464
464
|
`)}
|
|
465
465
|
</span>
|
|
466
|
-
`}const
|
|
466
|
+
`}const Me={string:Q,text:_e,integer:qe,number:qe,date:Oe,datetime:Oe,boolean:Ve,choice:Ee,choices:Pe,user:je,record:Be,relation:Be,file:Ce,color:F,include:ee};function Re(e={},t,r,a={}){const n=e.propertyType||e.type||e.dataType,l=Me[n];if(!l)return null;const i=Fe;Fe=xe(a);try{return l(e,t,r)}finally{Fe=i}}"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.fieldRenderers={...window.SF.fieldRenderers||{},renderCellField:I,renderEditField:ke,renderFilterField:v,renderViewField:Re,FILTER_RENDERERS:y,dateTime:{split:o.AC,compose:o.cy,normalizeTime:o.d2},registry:i.u.map(e=>{return{...e,modes:(t=e.type,(0,i.U)(t,{view:Me,edit:N,cell:O,filter:y}))};var t})},globalThis.document?.dispatchEvent?.(new CustomEvent("sf-field-renderers-ready"))),t()}catch(Ie){t(Ie)}})},fc654eb7fab0(e,t,r){r.d(t,{U:()=>n});const a=Object.freeze([{type:"string",label:{ru:"Строка",en:"String"},variants:[{id:"phone",label:{ru:"Телефон",en:"Phone"}},{id:"password",label:{ru:"Пароль",en:"Password"},writeOnly:!0}],params:["placeholder","required","readonly"]},{type:"text",label:{ru:"Текст",en:"Text"},variants:[],params:["placeholder","required","readonly"]},{type:"integer",label:{ru:"Целое число",en:"Integer"},variants:[],params:["unit","required","readonly"]},{type:"number",label:{ru:"Число",en:"Number"},variants:[{id:"scale",label:{ru:"Шкала 0–100",en:"Scale 0–100"}}],params:["unit","required","readonly"]},{type:"date",label:{ru:"Дата",en:"Date"},variants:[],params:["required","readonly"]},{type:"datetime",label:{ru:"Дата и время",en:"Date and time"},variants:[],params:["required","readonly"]},{type:"boolean",label:{ru:"Да или нет",en:"Yes or no"},variants:[],params:["trueText","falseText","required","readonly"]},{type:"choice",label:{ru:"Одно из списка",en:"One of a list"},variants:[],params:["options","badgeAppearance","required","readonly"]},{type:"choices",label:{ru:"Несколько из списка",en:"Several of a list"},variants:[{id:"badges",label:{ru:"Значками",en:"As badges"}},{id:"checklist",label:{ru:"Флажками",en:"As a checklist"}},{id:"select",label:{ru:"Выпадающим списком",en:"As a dropdown"}}],params:["options","badgeAppearance","required","readonly"]},{type:"user",label:{ru:"Пользователь",en:"User"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"record",label:{ru:"Запись",en:"Record"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"relation",label:{ru:"Связь",en:"Relation"},variants:[],params:["placeholder","searchPlaceholder","required","readonly"]},{type:"file",label:{ru:"Файл",en:"File"},variants:[{id:"image",label:{ru:"Изображение",en:"Image"}},{id:"image-card",label:{ru:"Изображение карточкой",en:"Image card"}},{id:"image-list",label:{ru:"Изображения списком",en:"Image list"}}],params:["accept","multiple","formats","uploadText","uploadSupportingText","uploadHint","readonly"]},{type:"color",label:{ru:"Цвет",en:"Colour"},variants:[],params:["swatches","required","readonly"]},{type:"include",label:{ru:"Код",en:"Code"},variants:[],params:["language","required","readonly"]}]);function n(e,t){return{view:Boolean(t.view?.[e]),edit:Boolean(t.edit?.[e]),cell:t.cell?.[e]?"own":"text",filter:t.filter?.[e]?"own":"text"}}r.d(t,["u",0,a])},"5961360f41f4"(e,t,r){r.d(t,{f:()=>o});const a=Object.freeze(["main","tonal","outline"]),n=Object.freeze(["neutral","primary","secondary","tertiary","info","success","warning","danger","on-surface"]),l=Object.freeze(["1/3","1/2","1"]);Object.freeze(n.flatMap(e=>a.filter(t=>!("on-surface"===e&&"tonal"===t)).flatMap(t=>l.map(r=>Object.freeze({type:t,scheme:e,size:r})))));const i=/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;function o(e={}){const t=e?.scheme??e?.color,r="string"==typeof t?t.trim():"",a=r.toLowerCase();return n.includes(a)?{scheme:a,rootStyle:""}:i.test(r)?{scheme:"neutral",rootStyle:`--sf-badge--background-color: color-mix(in srgb, ${r} 24%, transparent); --sf-badge--color: var(--sf-on-surface)`}:{scheme:"neutral",rootStyle:""}}},ddf1cdb42ecc(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit"):new Promise(e=>globalThis.addEventListener("sf-runtime-ready",()=>e(globalThis.SF.runtimeModule("lit")),{once:!0}))},"0d662e4d7d63"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("page-language"):new Promise(e=>globalThis.addEventListener("sf-runtime-ready",()=>e(globalThis.SF.runtimeModule("page-language")),{once:!0}))}};const t={};function r(a){const n=t[a];if(void 0!==n)return n.exports;const l=t[a]={exports:{}};return e[a](l,l.exports,r),l.exports}(()=>{const e="function"==typeof Symbol,t=e?Symbol("webpack queues"):"__webpack_queues__",a=e?Symbol("webpack exports"):"__webpack_exports__",n=e?Symbol("webpack error"):"__webpack_error__",l=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};r.a=(e,r,i)=>{let o;i&&((o=[]).d=-1);const s=new Set,u=e.exports;let d,c,p;const f=new Promise((e,t)=>{p=t,c=e});f[a]=u,f[t]=e=>(o&&e(o),s.forEach(e),f.catch(e=>{})),e.exports=f;r(e=>{let r;d=(e=>e.map(e=>{if(null!==e&&"object"==typeof e){if(e[t])return e;if(e.then){const r=[];r.d=0,e.then(e=>{i[a]=e,l(r)},e=>{i[n]=e,l(r)});const i={};return i[t]=e=>e(r),i}}const r={};return r[t]=e=>{},r[a]=e,r}))(e);const i=()=>d.map(e=>{if(e[n])throw e[n];return e[a]}),u=new Promise(e=>{r=()=>e(i),r.r=0;const a=e=>e!==o&&!s.has(e)&&(s.add(e),e&&!e.d&&(r.r++,e.push(r)));d.map(e=>e[t](a))});return r.r?u:i()},e=>(e?p(f[n]=e):c(u),l(o))),o?.d<0&&(o.d=0)}})(),r.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{if(Array.isArray(t))for(var a=0;a<t.length;){var n=t[a++],l=t[a++];r.o(e,n)?0===l&&a++:0===l?Object.defineProperty(e,n,{enumerable:!0,value:t[a++]}):Object.defineProperty(e,n,{enumerable:!0,get:l})}else for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);r("e5483002f3ea")})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{"use strict";var t={e138a730fd7c(t,e,n){n.d(e,{U:()=>i,h:()=>s});let a=0;const r=new WeakMap;function s(t,{prefix:e="sf-field",required:n=!1,invalid:s=!1,hint:i="",errorMessage:o=""}={}){const l=function(t,e){if(t&&r.has(t))return r.get(t);const n=(t?.id?String(t.id).trim():"")||`${e}-${++a}`,s={controlId:`${n}-control`,messageId:`${n}-message`};return!t||"object"!=typeof t&&"function"!=typeof t||r.set(t,s),s}(t,e),u=Boolean(s),d=u&&o?o:i;return{...l,required:Boolean(n),invalid:u,message:d,describedBy:d?l.messageId:"",errorMessageId:u&&o?l.messageId:""}}function i(t,e,{prefix:n="sf-field",required:a=!1,invalid:r=!1,messageNode:i=null,labelNode:o=null,errorMessage:l=""}={}){if(!t||!e)return null;const u=s(t,{prefix:n,required:a,invalid:r,hint:i?.textContent?.trim()||"",errorMessage:l});var d,c;return e.id||(e.id=u.controlId),"LABEL"!==t.tagName||t.hasAttribute("for")||t.setAttribute("for",e.id),!o?.textContent?.trim()||e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby")||(o.id||(o.id=`${e.id}-label`),e.setAttribute("aria-labelledby",o.id)),e.required=u.required,t.classList.toggle("error",u.invalid),e.classList.toggle("error",u.invalid),u.invalid?e.setAttribute("aria-invalid","true"):e.removeAttribute("aria-invalid"),i&&(i.id||(i.id=u.messageId),e.setAttribute("aria-describedby",(d=e.getAttribute("aria-describedby"),c=[i.id],[...new Set([...String(d||"").split(/\s+/).filter(Boolean),...c.filter(Boolean)])].join(" ")))),u.errorMessageId&&i?e.setAttribute("aria-errormessage",i.id):e.removeAttribute("aria-errormessage"),u}},"98e26702f55a"(t,e,n){function a(){const t=globalThis.SF=globalThis.SF||{};return t.__deprecationNotes instanceof Map||Object.defineProperty(t,"__deprecationNotes",{value:new Map,configurable:!0}),t.__deprecationNotes}function r({component:t="",kind:e="attribute",attribute:n="",from:r,to:s=null}={}){if(!r)return;const i=[t,e,n,r].join("|"),o=a(),l=o.get(i);if(l)l.count+=1;else if(o.set(i,{component:t,kind:e,attribute:n,from:r,to:s,count:1}),function(){const t=globalThis.document?.documentElement;return"warn"===t?.dataset?.sfDeprecations||!0===globalThis.SF?.deprecations?.warn}()){const a=t?`${t}: `:"",i="value"===e?`${n}="${r}"`:`${e} ${r}`;globalThis.console?.warn?.(`[SIMAI Framework] ${a}${i} is a legacy name${s?`; write ${s}`:""}. See contracts/changes/journal.json.`)}}if(n.d(e,{id:()=>l,vl:()=>u}),"undefined"!=typeof globalThis){globalThis.SF=globalThis.SF||{};const t=globalThis.SF.deprecations||{};t.list=function(){return[...a().values()].map(t=>({...t}))},t.clear=function(){a().clear()},t.note=r,globalThis.SF.deprecations=t}const s=Object.freeze(["1/2","1","2"]),i=Object.freeze({"1/3":"1/2",3:"2"}),o=new Set;function l(t,e="field",n="1"){const a=String(t??"").trim().toLowerCase();if(s.includes(a))return a;if(Object.hasOwn(i,a)){const t=i[a];r({component:e,kind:"value",attribute:"size",from:a,to:t});const n=`${e}:${a}`;return o.has(n)||"undefined"==typeof console||(o.add(n),console.warn(`[SIMAI Framework] ${e}: size ${a} is retired for form fields; rendering size ${t}.`)),t}return n}function u(t,e){if(t?.classList)for(const[n,a]of Object.entries(i)){const a=`${e}--size-${n}`;t.classList.contains(a)&&t.classList.replace(a,`${e}--size-${l(n,e)}`)}}},f8ed4bd5aa8a(t,e,n){n.d(e,{m3:()=>k,Lu:()=>L});class a{lifecycleName(){return this.componentName??this.constructor.componentName}constructor(t){this.props=t,this.id=t?.id,this.params=t?.param,this.attrs=t?.attrs||{},this.template=null,window.dispatchEvent(new CustomEvent(`${this.lifecycleName()}:beforeRender`,{detail:this}))}getUtilityMap(){return this.constructor.utilityMap||null}extractUtilityClasses(t){if(!Array.isArray(t))return[];const e=new Set;return t.forEach(t=>{if("string"!=typeof t)return;const n=t.match(/\(([^)]+)\)/g);n&&n.forEach(t=>{t.slice(1,-1).split(/\s+/).filter(Boolean).forEach(t=>{t.startsWith(".")&&t.length>1&&e.add(t.slice(1))})})}),Array.from(e)}applyLayoutUtilities(t,e){if(!t||!e)return;const n=this.getUtilityMap();if(!n||!n[e])return;this.extractUtilityClasses(n[e]).forEach(e=>t.classList.add(e))}render(){return this.html=this.template,"function"==typeof this.init&&this.init(),this.html&&window.dispatchEvent(new CustomEvent(`${this.lifecycleName()}:render`,{detail:this})),this.html}destroy(){this.destroyInternal?.(),this.props=null,this.id=null,this.params=null,this.template=null,this.html&&(this.html.remove(),this.html=null),window.dispatchEvent(new CustomEvent(`${this.lifecycleName()}:destroy`,{detail:this}))}destroyInternal(){}}const r=function(t,e){if(t&&e)if("undefined"==typeof window||"function"!=typeof window.registerSfComponent){if("undefined"!=typeof window&&window.SF?.Loader?.registerComponent)window.SF.Loader.registerComponent(t,e);else if("undefined"!=typeof window){(window.SF_PENDING_COMPONENTS=window.SF_PENDING_COMPONENTS||[]).push([t,e])}}else window.registerSfComponent(t,e)},s=JSON.parse('{".sf-input":["display/flex (.flex)","flex-direction/column (.flex-col)","flex-wrap/nowrap (.flex-nowrap)","gap/var(--sf-space-1\\\\/4)","justify-content/flex-start (.justify-start)"],".sf-input .sf-input-field":["display/flex (.flex)","flex-direction/row (.flex-row)","flex-wrap/nowrap (.flex-nowrap)","justify-content/flex-start (.justify-start)","align-items/center (.items-center)"],".sf-input .sf-input-label":["display/flex (.flex)","flex-direction/row (.flex-row)","align-items/flex-start (.items-start)"],".sf-input .sf-input-field input":["flex/1 (.flex-1)"],".sf-input .sf-input-field .sf-icon":["display/flex (.flex)","justify-content/flex-start (.justify-start)","align-items/center (.items-center)"],".sf-input .sf-input-text-container":["flex/1 (.flex-1)","display/flex (.flex)","flex-direction/row (.flex-row)","flex-wrap/nowrap (.flex-nowrap)","justify-content/flex-start (.justify-start)","align-items/center (.items-center)"],".sf-input .sf-input-group":["display/flex (.flex)","flex-direction/column (.flex-col)","flex-wrap/nowrap (.flex-nowrap)","justify-content/center (.justify-center)","align-items/flex-start (.items-start)"],".sf-input .sf-input-text-container-alt":["display/flex (.flex)","flex-direction/row (.flex-row)","flex-wrap/nowrap (.flex-nowrap)","justify-content/center (.justify-center)","align-items/center (.items-center)"],".sf-input .sf-icon-alt":["display/flex (.flex)","justify-content/flex-start (.justify-start)","align-items/center (.items-center)"],".sf-input .sf-input-hint-text-wrap":["flex/1 (.flex-1)","display/flex (.flex)","flex-direction/row (.flex-row)","flex-wrap/nowrap (.flex-nowrap)","gap/var(--sf-b0)","justify-content/flex-start (.justify-start)","align-items/center (.items-center)"]}');var i=n("e138a730fd7c"),o=n("98e26702f55a");const l=new WeakMap,u=new WeakSet;let d=null;const c="label.sf-input",p="sfInputBound",f=new Set(["text","email","password","search","tel","url"]),h=new Set(["","none","text","tel","url","email","numeric","decimal","search"]),m=new Set(["bordered","filled","hidden"]);function g(t){if(""===t||null==t)return null;const e=Number(t);return Number.isInteger(e)&&e>=0?e:null}function b(t,e=!1){return null==t||""===t?e:"boolean"==typeof t?t:["1","true","yes","on"].includes(String(t).toLowerCase())}function y(t){return t?.querySelector?.(".sf-input-field input, input")||null}function w(t){return t?.querySelector?.(".sf-input-hint-text-wrap")||null}function x(t){const e=w(t);return{messageNode:e,errorMessage:"error"===e?.dataset.fieldMessage&&e.textContent?.trim()||""}}function S(t){if(!t||"string"!=typeof t)return null;const e=t.trim();if(!e)return null;try{const t=JSON.parse(e);return t&&"object"==typeof t?t:null}catch{return null}}function v(t,e,n){const a={...t},r=n.dataset.maskLazy??e.dataset.maskLazy,s=n.dataset.maskPlaceholderChar??e.dataset.maskPlaceholderChar;return void 0!==r&&""!==r&&(a.lazy=b(r,!0)),void 0!==s&&""!==s&&(a.placeholderChar=String(s)),a}async function $(t,e){const n=function(t,e){if(!b(e.dataset.mask??t.dataset.mask,!1))return null;const n=S(e.dataset.maskOptions),a=S(t.dataset.maskOptions);if(n)return v(n,t,e);if(a)return v(a,t,e);const r=e.dataset.maskPattern??t.dataset.maskPattern;return r?v({mask:String(r)},t,e):null}(t,e);if(!n)return;const a={};t.__sfInputMaskRequest=a;try{const r=await function(){const t=()=>window.SF?.Mask?.create?window.SF.Mask:null,e=t();return e?Promise.resolve(e):d||(d=new Promise(e=>{const n=[[window,"sf-mask-ready"],[window,"sf-loader-ready"],[window,"load"],[document,"DOMContentLoaded"]],a=()=>{const r=t();r&&(n.forEach(([t,e])=>t.removeEventListener(e,a)),d=null,e(r))};n.forEach(([t,e])=>t.addEventListener(e,a))}),d)}();if(t.__sfInputMaskRequest!==a)return;const s=await r.create(e,n);if(!s)return;if("1"!==t.dataset[p]||t.__sfInputMaskRequest!==a||y(t)!==e)return void r.destroy(s);t.__sfInputMask=s}catch(t){console.warn("SF.Input mask init failed",t)}}function k(t){if((0,o.vl)(t,"sf-input"),!t||"1"===t.dataset[p])return;const e=y(t);if(!e)return;const n=()=>{},a=()=>t.classList.add("sf-input--pointer-focus"),r=()=>t.classList.remove("sf-input--pointer-focus");e.addEventListener("input",n),e.addEventListener("pointerdown",a),e.addEventListener("blur",r),t.__sfInputNoopHandler=n,t.__sfInputPointerFocusHandler=a,t.__sfInputBlurHandler=r,t.dataset[p]="1";const s=x(t);(0,i.U)(t,e,{prefix:"sf-input",labelNode:t.querySelector(".sf-input-text"),required:e.required||Boolean(t.querySelector(".sf-input-required")),invalid:t.classList.contains("error")||e.classList.contains("error"),...s}),t.__sfInputReleaseReset=function(t,e){const n=t.ownerDocument;u.has(n)||(n.addEventListener("reset",t=>{const e=t.target;if("FORM"!==e?.tagName)return;const n=Array.from(e.elements);setTimeout(()=>{if(!t.defaultPrevented)for(const t of n)if(t.isConnected&&t.form===e)for(const e of l.get(t)||[])e()},0)},!0),u.add(n));let a=l.get(t);return a||l.set(t,a=new Set),a.add(e),()=>a.delete(e)}(e,()=>{t.__sfInputMask&&(t.__sfInputMask.value=e.value)}),$(t,e)}function L(t){if(!t||"1"!==t.dataset[p])return;delete t.__sfInputMaskRequest;const e=y(t);e&&t.__sfInputNoopHandler&&e.removeEventListener("input",t.__sfInputNoopHandler),e&&t.__sfInputPointerFocusHandler&&e.removeEventListener("pointerdown",t.__sfInputPointerFocusHandler),e&&t.__sfInputBlurHandler&&e.removeEventListener("blur",t.__sfInputBlurHandler),t.__sfInputMask&&window.SF?.Mask?.destroy?.(t.__sfInputMask),t.__sfInputReleaseReset?.(),delete t.__sfInputReleaseReset,delete t.__sfInputMask,delete t.__sfInputNoopHandler,delete t.__sfInputPointerFocusHandler,delete t.__sfInputBlurHandler,t.classList.remove("sf-input--pointer-focus"),delete t.dataset[p]}function _(t=document){t.querySelectorAll(c).forEach(k)}class I extends a{static componentName="Inputs";html=null;constructor(t){super(t);const{size:e="1",type:n="bordered",label:a="",required:r=!1,placeholder:s="",inputType:i="text",autocomplete:l="",inputMode:u="",minLength:d="",maxLength:c="",pattern:p="",hint:y="",value:w="",name:x="",leftIcon:S="",rightText:v="",hintIcon:$="",disabled:k=!1,readonly:L=!1,error:_=!1,invalid:I=!1,errorMessage:E="",mask:C=!1,maskPattern:A="",maskLazy:M="",maskPlaceholderChar:P="",maskOptions:q=""}=this.params||{},O=this.attrs.class||this.attrs.className,j=(0,o.id)(e,"sf-input"),F=function(t,e,n){const a=String(t||n);return e.has(a)?a:n}(n,m,"bordered");this.template=document.createElement("label"),this.id&&(this.template.id=this.id),this.template.classList.add("sf-input",`sf-input--size-${j}`,`sf-input--${F}`),this.template.classList.toggle("error",b(I||_,!1)),this.template.dataset.mask=String(b(C,!1)),this.template.dataset.maskPattern=String(A||""),this.template.dataset.maskLazy=String(M??""),this.template.dataset.maskPlaceholderChar=String(P||""),this.template.dataset.maskOptions=String(q||""),O&&this.template.classList.add(...`${O}`.split(" ").filter(Boolean));const T=document.createElement("span");T.classList.add("sf-input-label");const N=document.createElement("span");if(N.classList.add("sf-input-text"),N.textContent=a,T.append(N),b(r,!0)){const t=document.createElement("span");t.classList.add("sf-input-required"),t.textContent="*",T.append(t)}const z=document.createElement("span");if(z.classList.add("sf-input-field"),S){const t=document.createElement("i");t.classList.add("sf-icon"),t.textContent=String(S),z.append(t)}const B=document.createElement("input");B.type=function(t){const e=String(t||"text").toLowerCase();return f.has(e)?e:"text"}(i),B.placeholder=String(s??""),l&&(B.autocomplete=String(l)),B.inputMode=function(t){const e=String(t||"").toLowerCase();return h.has(e)?e:""}(u);const R=g(d),H=g(c);if(null!==R&&(B.minLength=R),null!==H&&(B.maxLength=H),p&&(B.pattern=String(p)),B.value=String(w??""),B.defaultValue=String(w??""),x&&(B.name=String(x)),B.disabled=b(k,!1),B.readOnly=b(L,!1),B.required=b(r,!0),B.dataset.mask=String(b(C,!1)),B.dataset.maskPattern=String(A||""),B.dataset.maskLazy=String(M??""),B.dataset.maskPlaceholderChar=String(P||""),B.dataset.maskOptions=String(q||""),B.classList.toggle("error",b(I||_,!1)),z.append(B),v){const t=document.createElement("span");t.classList.add("sf-input-right"),t.textContent=String(v),z.append(t)}if($){const t=document.createElement("i");t.classList.add("sf-icon","sf-icon-hint"),t.textContent=String($),z.append(t)}this.template.append(T,z);const U=b(I||_,!1)&&E?E:y;if(U){const t=document.createElement("span");t.classList.add("sf-input-hint-text-wrap"),t.textContent=String(U),t.dataset.fieldMessage=b(I||_,!1)&&E?"error":"hint",this.template.append(t)}this.applyLayoutUtilities(this.template,".sf-input"),this.applyLayoutUtilities(T,".sf-input .sf-input-label"),this.applyLayoutUtilities(z,".sf-input .sf-input-field"),this.applyLayoutUtilities(B,".sf-input .sf-input-field input")}init(){k(this.template)}destroyInternal(){L(this.template)}}I.utilityMap=s,r("Inputs",I),"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.Input=window.SF.Input||{},window.SF.Input.setState=function(t,e={}){const n=t instanceof HTMLElement?t.closest(c)||t:null;if(!n)return!1;const a=y(n);if(!a)return!1;if(Object.prototype.hasOwnProperty.call(e,"disabled")&&(a.disabled=b(e.disabled)),Object.prototype.hasOwnProperty.call(e,"error")){const t=b(e.error);n.classList.toggle("error",t),a.classList.toggle("error",t)}if(Object.prototype.hasOwnProperty.call(e,"invalid")){const t=b(e.invalid);n.classList.toggle("error",t),a.classList.toggle("error",t)}if(Object.prototype.hasOwnProperty.call(e,"errorMessage")){const t=String(e.errorMessage??""),r=t?function(t){const e=w(t);if(e)return e;const n=document.createElement("span");return n.classList.add("sf-input-hint-text-wrap"),t.append(n),n}(n):w(n);if(r){r.textContent=t;const e=n.classList.contains("error")||a.classList.contains("error");r.dataset.fieldMessage=t&&e?"error":"hint"}}return Object.prototype.hasOwnProperty.call(e,"value")&&(a.value=String(e.value??""),a.dispatchEvent(new Event("input",{bubbles:!0}))),(0,i.U)(n,a,{prefix:"sf-input",labelNode:n.querySelector(".sf-input-text"),required:a.required||Boolean(n.querySelector(".sf-input-required")),invalid:n.classList.contains("error")||a.classList.contains("error"),...x(n)}),!0}),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>_()):_();new MutationObserver(t=>{t.forEach(t=>{t.addedNodes.forEach(t=>{t instanceof Element&&(t.matches?.(c)&&k(t),_(t))})})}).observe(document.documentElement,{childList:!0,subtree:!0})},"44b791419862"(t,e,n){n.a(t,async(t,e)=>{try{var a=n("f8ed4bd5aa8a"),r=n("fbe0570fcc69"),s=n("98e26702f55a"),i=n("e602dd4d6e16"),o=t([r,i]);[r,i]=o.then?(await o)():o;var l=n.n(r);const u=new Set(["text","email","password","search","tel","url"]),d=new Set(["","none","text","tel","url","email","numeric","decimal","search"]),c=(new Set(["bordered","filled","hidden"]),(t,e,n)=>e.has(t)?t:n);class p extends(l()){static get props(){return{size:{default:"1"},appearance:{default:"bordered",values:["bordered","filled","hidden"],aliases:["type"]},label:{default:""},required:{type:Boolean,default:!1},placeholder:{default:""},inputType:{default:"text"},autocomplete:{default:""},inputmode:{default:""},minlength:{default:""},maxlength:{default:""},pattern:{default:""},hint:{default:""},value:{default:""},defaultValue:{default:""},name:{default:""},iconStart:{type:String,default:null},textEnd:{type:String,default:null},leftIcon:{default:""},rightText:{default:""},hintIcon:{default:""},rootClass:{default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},invalid:{type:Boolean,default:!1},errorMessage:{default:""},mask:{type:Boolean,default:!1},maskPattern:{default:""},maskLazy:{default:""},maskPlaceholderChar:{default:""},maskOptions:{default:""},ariaLabel:{attribute:"aria-label",default:""}}}constructor(){super(),this._boundRoot=null}get size(){return(0,s.id)(this.getAttribute("size")||"1","sf-input")}get appearance(){return this.getProp("appearance")}get type(){return this.appearance}get label(){return this.getAttribute("label")||""}get required(){return this.getBooleanAttr("required",!1)}get placeholder(){return this.getAttribute("placeholder")||""}get inputType(){return c(this.getAttribute("input-type")||"text",u,"text")}get autocomplete(){return this.getAttribute("autocomplete")||""}get inputmode(){return c(this.getAttribute("inputmode")||"",d,"")}get minlength(){return this.getAttribute("minlength")||""}get maxlength(){return this.getAttribute("maxlength")||""}get pattern(){return this.getAttribute("pattern")||""}get hint(){return this.getAttribute("hint")||""}get value(){const t=this.getInputElement();return t?t.value:this.getAttribute("value")||""}set value(t){const e=this.getInputElement(),n=String(t??"");null==t?this.removeAttribute("value"):this.setAttribute("value",n);const a=this.querySelector(".sf-input")?.__sfInputMask;a?a.value=n:e&&e.value!==n&&(e.value=n)}get defaultValue(){return this.getAttribute("default-value")??this.getAttribute("value")??""}set defaultValue(t){null!=t?this.setAttribute("default-value",String(t)):this.removeAttribute("default-value")}get name(){return this.getAttribute("name")||""}get leftIcon(){return this.getAttribute("icon-start")??this.getAttribute("left-icon")??""}get rightText(){return this.getAttribute("text-end")??this.getAttribute("right-text")??""}get iconStart(){return this.leftIcon}get textEnd(){return this.rightText}get hintIcon(){return this.getAttribute("hint-icon")||""}get disabled(){return this.getBooleanAttr("disabled",!1)}get readonly(){return this.getBooleanAttr("readonly",!1)}get error(){return this.getBooleanAttr("error",!1)}get invalid(){return this.getBooleanAttr("invalid",!1)}get errorMessage(){return this.getAttribute("error-message")||""}get mask(){return this.getBooleanAttr("mask",!1)}get maskPattern(){return this.getAttribute("mask-pattern")||""}get maskLazy(){return this.hasAttribute("mask-lazy")?this.getBooleanAttr("mask-lazy",!0):""}get maskPlaceholderChar(){return this.getAttribute("mask-placeholder-char")||""}get maskOptions(){return this.getAttribute("mask-options")||""}get ariaLabel(){return this.getProp("ariaLabel")||""}templateContext(){const t=this.getPropsContext(),e=this.hasAttribute("value"),n=this.getInputElement();return this.createTemplateContext({...t,leftIcon:t.iconStart??t.leftIcon,rightText:t.textEnd??t.rightText,iconStart:this.iconStart,textEnd:this.textEnd,type:this.type,maskLazy:this.maskLazy,value:e?t.value:n?n.value:this.defaultValue,defaultValue:this.defaultValue,hasControlledValue:e,component:this})}onDisconnected(){this._boundRoot&&((0,a.Lu)(this._boundRoot),this._boundRoot=null)}afterRender(){this._boundRoot&&((0,a.Lu)(this._boundRoot),this._boundRoot=null),this._boundRoot=this.querySelector(".sf-input"),this._boundRoot&&(0,a.m3)(this._boundRoot)}getInputElement(){return this.querySelector(".sf-input-field input, input")}template(){return(0,i.P)(this.templateContext())}get state(){const t=this.querySelector(".sf-input"),e=this.getInputElement();return{value:e?.value||"",disabled:!!e?.disabled,invalid:"true"===e?.getAttribute("aria-invalid"),error:t?.classList?.contains("error")||e?.classList?.contains("error")||!1}}onInput(t,e){return"function"==typeof t&&this.addEventListener("input",t,e),this}onChange(t,e){return"function"==typeof t&&this.addEventListener("change",t,e),this}onKeyUp(t,e){return"function"==typeof t&&this.addEventListener("keyup",t,e),this}onKeyDown(t,e){return"function"==typeof t&&this.addEventListener("keydown",t,e),this}onFocus(t,e){return"function"==typeof t&&this.addEventListener("focusin",t,e),this}onBlur(t,e){return"function"==typeof t&&this.addEventListener("focusout",t,e),this}}p.define("sf-input"),e()}catch(t){e(t)}})},e602dd4d6e16(t,e,n){n.a(t,async(t,a)=>{try{n.d(e,{P:()=>l});var r=n("ddf1cdb42ecc"),s=n("e138a730fd7c"),i=t([r]),o=i.then?(await i)():i;r=o[0];function l(t){const{size:e,appearance:n,type:a,label:i,required:o,placeholder:l,inputType:u,autocomplete:d,inputmode:c,minlength:p,maxlength:f,pattern:h,hint:m,value:g,defaultValue:b,hasControlledValue:y,name:w,leftIcon:x,rightText:S,hintIcon:v,disabled:$,error:k,invalid:L,errorMessage:_,mask:I,rootClass:E,rootStyle:C,readonly:A,maskPattern:M,maskLazy:P,maskPlaceholderChar:q,maskOptions:O,ariaLabel:j}=t,F=""===P?"":String(P),T=y?g:b,N=(0,s.h)(t.component,{prefix:"sf-input",required:o,invalid:L||k,hint:m,errorMessage:_}),z=["sf-input",N.invalid?"error":"",`sf-input--size-${e}`,`sf-input--${n??a}`,E,"flex","flex-col"];if("hidden"===a)return r.html`<input
|
|
1
|
+
(()=>{"use strict";var t={e138a730fd7c(t,e,n){n.d(e,{U:()=>i,h:()=>s});let a=0;const r=new WeakMap;function s(t,{prefix:e="sf-field",required:n=!1,invalid:s=!1,hint:i="",errorMessage:o=""}={}){const l=function(t,e){if(t&&r.has(t))return r.get(t);const n=(t?.id?String(t.id).trim():"")||`${e}-${++a}`,s={controlId:`${n}-control`,messageId:`${n}-message`};return!t||"object"!=typeof t&&"function"!=typeof t||r.set(t,s),s}(t,e),u=Boolean(s),d=u&&o?o:i;return{...l,required:Boolean(n),invalid:u,message:d,describedBy:d?l.messageId:"",errorMessageId:u&&o?l.messageId:""}}function i(t,e,{prefix:n="sf-field",required:a=!1,invalid:r=!1,messageNode:i=null,labelNode:o=null,errorMessage:l=""}={}){if(!t||!e)return null;const u=s(t,{prefix:n,required:a,invalid:r,hint:i?.textContent?.trim()||"",errorMessage:l});var d,c;return e.id||(e.id=u.controlId),"LABEL"!==t.tagName||t.hasAttribute("for")||t.setAttribute("for",e.id),!o?.textContent?.trim()||e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby")||(o.id||(o.id=`${e.id}-label`),e.setAttribute("aria-labelledby",o.id)),e.required=u.required,t.classList.toggle("error",u.invalid),e.classList.toggle("error",u.invalid),u.invalid?e.setAttribute("aria-invalid","true"):e.removeAttribute("aria-invalid"),i&&(i.id||(i.id=u.messageId),e.setAttribute("aria-describedby",(d=e.getAttribute("aria-describedby"),c=[i.id],[...new Set([...String(d||"").split(/\s+/).filter(Boolean),...c.filter(Boolean)])].join(" ")))),u.errorMessageId&&i?e.setAttribute("aria-errormessage",i.id):e.removeAttribute("aria-errormessage"),u}},"98e26702f55a"(t,e,n){function a(){const t=globalThis.SF=globalThis.SF||{};return t.__deprecationNotes instanceof Map||Object.defineProperty(t,"__deprecationNotes",{value:new Map,configurable:!0}),t.__deprecationNotes}function r({component:t="",kind:e="attribute",attribute:n="",from:r,to:s=null}={}){if(!r)return;const i=[t,e,n,r].join("|"),o=a(),l=o.get(i);if(l)l.count+=1;else if(o.set(i,{component:t,kind:e,attribute:n,from:r,to:s,count:1}),function(){const t=globalThis.document?.documentElement;return"warn"===t?.dataset?.sfDeprecations||!0===globalThis.SF?.deprecations?.warn}()){const a=t?`${t}: `:"",i="value"===e?`${n}="${r}"`:`${e} ${r}`;globalThis.console?.warn?.(`[SIMAI Framework] ${a}${i} is a legacy name${s?`; write ${s}`:""}. See contracts/changes/journal.json.`)}}if(n.d(e,{id:()=>l,vl:()=>u}),"undefined"!=typeof globalThis){globalThis.SF=globalThis.SF||{};const t=globalThis.SF.deprecations||{};t.list=function(){return[...a().values()].map(t=>({...t}))},t.clear=function(){a().clear()},t.note=r,globalThis.SF.deprecations=t}const s=Object.freeze(["1/2","1","2"]),i=Object.freeze({"1/3":"1/2",3:"2"}),o=new Set;function l(t,e="field",n="1"){const a=String(t??"").trim().toLowerCase();if(s.includes(a))return a;if(Object.hasOwn(i,a)){const t=i[a];r({component:e,kind:"value",attribute:"size",from:a,to:t});const n=`${e}:${a}`;return o.has(n)||"undefined"==typeof console||(o.add(n),console.warn(`[SIMAI Framework] ${e}: size ${a} is retired for form fields; rendering size ${t}.`)),t}return n}function u(t,e){if(t?.classList)for(const[n,a]of Object.entries(i)){const a=`${e}--size-${n}`;t.classList.contains(a)&&t.classList.replace(a,`${e}--size-${l(n,e)}`)}}},f8ed4bd5aa8a(t,e,n){n.d(e,{m3:()=>k,Lu:()=>L});class a{lifecycleName(){return this.componentName??this.constructor.componentName}constructor(t){this.props=t,this.id=t?.id,this.params=t?.param,this.attrs=t?.attrs||{},this.template=null,window.dispatchEvent(new CustomEvent(`${this.lifecycleName()}:beforeRender`,{detail:this}))}getUtilityMap(){return this.constructor.utilityMap||null}extractUtilityClasses(t){if(!Array.isArray(t))return[];const e=new Set;return t.forEach(t=>{if("string"!=typeof t)return;const n=t.match(/\(([^)]+)\)/g);n&&n.forEach(t=>{t.slice(1,-1).split(/\s+/).filter(Boolean).forEach(t=>{t.startsWith(".")&&t.length>1&&e.add(t.slice(1))})})}),Array.from(e)}applyLayoutUtilities(t,e){if(!t||!e)return;const n=this.getUtilityMap();if(!n||!n[e])return;this.extractUtilityClasses(n[e]).forEach(e=>t.classList.add(e))}render(){return this.html=this.template,"function"==typeof this.init&&this.init(),this.html&&window.dispatchEvent(new CustomEvent(`${this.lifecycleName()}:render`,{detail:this})),this.html}destroy(){this.destroyInternal?.(),this.props=null,this.id=null,this.params=null,this.template=null,this.html&&(this.html.remove(),this.html=null),window.dispatchEvent(new CustomEvent(`${this.lifecycleName()}:destroy`,{detail:this}))}destroyInternal(){}}const r=function(t,e){if(t&&e)if("undefined"==typeof window||"function"!=typeof window.registerSfComponent){if("undefined"!=typeof window&&window.SF?.Loader?.registerComponent)window.SF.Loader.registerComponent(t,e);else if("undefined"!=typeof window){(window.SF_PENDING_COMPONENTS=window.SF_PENDING_COMPONENTS||[]).push([t,e])}}else window.registerSfComponent(t,e)},s=JSON.parse('{".sf-input":["display/flex (.flex)","flex-direction/column (.flex-col)","flex-wrap/nowrap (.flex-nowrap)","gap/var(--sf-space-1\\\\/4)","justify-content/flex-start (.justify-start)"],".sf-input .sf-input-field":["display/flex (.flex)","flex-direction/row (.flex-row)","flex-wrap/nowrap (.flex-nowrap)","justify-content/flex-start (.justify-start)","align-items/center (.items-center)"],".sf-input .sf-input-label":["display/flex (.flex)","flex-direction/row (.flex-row)","align-items/flex-start (.items-start)"],".sf-input .sf-input-field input":["flex/1 (.flex-1)"],".sf-input .sf-input-field .sf-icon":["display/flex (.flex)","justify-content/flex-start (.justify-start)","align-items/center (.items-center)"],".sf-input .sf-input-text-container":["flex/1 (.flex-1)","display/flex (.flex)","flex-direction/row (.flex-row)","flex-wrap/nowrap (.flex-nowrap)","justify-content/flex-start (.justify-start)","align-items/center (.items-center)"],".sf-input .sf-input-group":["display/flex (.flex)","flex-direction/column (.flex-col)","flex-wrap/nowrap (.flex-nowrap)","justify-content/center (.justify-center)","align-items/flex-start (.items-start)"],".sf-input .sf-input-text-container-alt":["display/flex (.flex)","flex-direction/row (.flex-row)","flex-wrap/nowrap (.flex-nowrap)","justify-content/center (.justify-center)","align-items/center (.items-center)"],".sf-input .sf-icon-alt":["display/flex (.flex)","justify-content/flex-start (.justify-start)","align-items/center (.items-center)"],".sf-input .sf-input-hint-text-wrap":["flex/1 (.flex-1)","display/flex (.flex)","flex-direction/row (.flex-row)","flex-wrap/nowrap (.flex-nowrap)","gap/var(--sf-b0)","justify-content/flex-start (.justify-start)","align-items/center (.items-center)"]}');var i=n("e138a730fd7c"),o=n("98e26702f55a");const l=new WeakMap,u=new WeakSet;let d=null;const c="label.sf-input",p="sfInputBound",f=new Set(["text","email","password","search","tel","url"]),h=new Set(["","none","text","tel","url","email","numeric","decimal","search"]),m=new Set(["bordered","filled","hidden"]);function g(t){if(""===t||null==t)return null;const e=Number(t);return Number.isInteger(e)&&e>=0?e:null}function b(t,e=!1){return null==t||""===t?e:"boolean"==typeof t?t:["1","true","yes","on"].includes(String(t).toLowerCase())}function y(t){return t?.querySelector?.(".sf-input-field input, input")||null}function w(t){return t?.querySelector?.(".sf-input-hint-text-wrap")||null}function x(t){const e=w(t);return{messageNode:e,errorMessage:"error"===e?.dataset.fieldMessage&&e.textContent?.trim()||""}}function v(t){if(!t||"string"!=typeof t)return null;const e=t.trim();if(!e)return null;try{const t=JSON.parse(e);return t&&"object"==typeof t?t:null}catch{return null}}function S(t,e,n){const a={...t},r=n.dataset.maskLazy??e.dataset.maskLazy,s=n.dataset.maskPlaceholderChar??e.dataset.maskPlaceholderChar;return void 0!==r&&""!==r&&(a.lazy=b(r,!0)),void 0!==s&&""!==s&&(a.placeholderChar=String(s)),a}async function $(t,e){const n=function(t,e){if(!b(e.dataset.mask??t.dataset.mask,!1))return null;const n=v(e.dataset.maskOptions),a=v(t.dataset.maskOptions);if(n)return S(n,t,e);if(a)return S(a,t,e);const r=e.dataset.maskPattern??t.dataset.maskPattern;return r?S({mask:String(r)},t,e):null}(t,e);if(!n)return;const a={};t.__sfInputMaskRequest=a;try{const r=await function(){const t=()=>window.SF?.Mask?.create?window.SF.Mask:null,e=t();return e?Promise.resolve(e):d||(d=new Promise(e=>{const n=[[window,"sf-mask-ready"],[window,"sf-loader-ready"],[window,"load"],[document,"DOMContentLoaded"]],a=()=>{const r=t();r&&(n.forEach(([t,e])=>t.removeEventListener(e,a)),d=null,e(r))};n.forEach(([t,e])=>t.addEventListener(e,a))}),d)}();if(t.__sfInputMaskRequest!==a)return;const s=await r.create(e,n);if(!s)return;if("1"!==t.dataset[p]||t.__sfInputMaskRequest!==a||y(t)!==e)return void r.destroy(s);t.__sfInputMask=s}catch(t){console.warn("SF.Input mask init failed",t)}}function k(t){if((0,o.vl)(t,"sf-input"),!t||"1"===t.dataset[p])return;const e=y(t);if(!e)return;const n=()=>{},a=()=>t.classList.add("sf-input--pointer-focus"),r=()=>t.classList.remove("sf-input--pointer-focus");e.addEventListener("input",n),e.addEventListener("pointerdown",a),e.addEventListener("blur",r),t.__sfInputNoopHandler=n,t.__sfInputPointerFocusHandler=a,t.__sfInputBlurHandler=r,t.dataset[p]="1";const s=x(t);(0,i.U)(t,e,{prefix:"sf-input",labelNode:t.querySelector(".sf-input-text"),required:e.required||Boolean(t.querySelector(".sf-input-required")),invalid:t.classList.contains("error")||e.classList.contains("error"),...s}),t.__sfInputReleaseReset=function(t,e){const n=t.ownerDocument;u.has(n)||(n.addEventListener("reset",t=>{const e=t.target;if("FORM"!==e?.tagName)return;const n=Array.from(e.elements);setTimeout(()=>{if(!t.defaultPrevented)for(const t of n)if(t.isConnected&&t.form===e)for(const e of l.get(t)||[])e()},0)},!0),u.add(n));let a=l.get(t);return a||l.set(t,a=new Set),a.add(e),()=>a.delete(e)}(e,()=>{t.__sfInputMask&&(t.__sfInputMask.value=e.value)}),$(t,e)}function L(t){if(!t||"1"!==t.dataset[p])return;delete t.__sfInputMaskRequest;const e=y(t);e&&t.__sfInputNoopHandler&&e.removeEventListener("input",t.__sfInputNoopHandler),e&&t.__sfInputPointerFocusHandler&&e.removeEventListener("pointerdown",t.__sfInputPointerFocusHandler),e&&t.__sfInputBlurHandler&&e.removeEventListener("blur",t.__sfInputBlurHandler),t.__sfInputMask&&window.SF?.Mask?.destroy?.(t.__sfInputMask),t.__sfInputReleaseReset?.(),delete t.__sfInputReleaseReset,delete t.__sfInputMask,delete t.__sfInputNoopHandler,delete t.__sfInputPointerFocusHandler,delete t.__sfInputBlurHandler,t.classList.remove("sf-input--pointer-focus"),delete t.dataset[p]}function _(t=document){t.querySelectorAll(c).forEach(k)}class I extends a{static componentName="Inputs";html=null;constructor(t){super(t);const{size:e="1",type:n="bordered",label:a="",required:r=!1,placeholder:s="",inputType:i="text",autocomplete:l="",inputMode:u="",minLength:d="",maxLength:c="",pattern:p="",hint:y="",value:w="",name:x="",leftIcon:v="",rightText:S="",hintIcon:$="",disabled:k=!1,readonly:L=!1,error:_=!1,invalid:I=!1,errorMessage:E="",mask:C=!1,maskPattern:A="",maskLazy:M="",maskPlaceholderChar:P="",maskOptions:q=""}=this.params||{},O=this.attrs.class||this.attrs.className,j=(0,o.id)(e,"sf-input"),F=function(t,e,n){const a=String(t||n);return e.has(a)?a:n}(n,m,"bordered");this.template=document.createElement("label"),this.id&&(this.template.id=this.id),this.template.classList.add("sf-input",`sf-input--size-${j}`,`sf-input--${F}`),this.template.classList.toggle("error",b(I||_,!1)),this.template.dataset.mask=String(b(C,!1)),this.template.dataset.maskPattern=String(A||""),this.template.dataset.maskLazy=String(M??""),this.template.dataset.maskPlaceholderChar=String(P||""),this.template.dataset.maskOptions=String(q||""),O&&this.template.classList.add(...`${O}`.split(" ").filter(Boolean));const T=document.createElement("span");T.classList.add("sf-input-label");const N=document.createElement("span");if(N.classList.add("sf-input-text"),N.textContent=a,T.append(N),b(r,!0)){const t=document.createElement("span");t.classList.add("sf-input-required"),t.textContent="*",T.append(t)}const z=document.createElement("span");if(z.classList.add("sf-input-field"),v){const t=document.createElement("i");t.classList.add("sf-icon"),t.textContent=String(v),z.append(t)}const B=document.createElement("input");B.type=function(t){const e=String(t||"text").toLowerCase();return f.has(e)?e:"text"}(i),B.placeholder=String(s??""),l&&(B.autocomplete=String(l)),B.inputMode=function(t){const e=String(t||"").toLowerCase();return h.has(e)?e:""}(u);const R=g(d),H=g(c);if(null!==R&&(B.minLength=R),null!==H&&(B.maxLength=H),p&&(B.pattern=String(p)),B.value=String(w??""),B.defaultValue=String(w??""),x&&(B.name=String(x)),B.disabled=b(k,!1),B.readOnly=b(L,!1),B.required=b(r,!0),B.dataset.mask=String(b(C,!1)),B.dataset.maskPattern=String(A||""),B.dataset.maskLazy=String(M??""),B.dataset.maskPlaceholderChar=String(P||""),B.dataset.maskOptions=String(q||""),B.classList.toggle("error",b(I||_,!1)),z.append(B),S){const t=document.createElement("span");t.classList.add("sf-input-right"),t.textContent=String(S),z.append(t)}if($){const t=document.createElement("i");t.classList.add("sf-icon","sf-icon-hint"),t.textContent=String($),z.append(t)}this.template.append(T,z);const U=b(I||_,!1)&&E?E:y;if(U){const t=document.createElement("span");t.classList.add("sf-input-hint-text-wrap"),t.textContent=String(U),t.dataset.fieldMessage=b(I||_,!1)&&E?"error":"hint",this.template.append(t)}this.applyLayoutUtilities(this.template,".sf-input"),this.applyLayoutUtilities(T,".sf-input .sf-input-label"),this.applyLayoutUtilities(z,".sf-input .sf-input-field"),this.applyLayoutUtilities(B,".sf-input .sf-input-field input")}init(){k(this.template)}destroyInternal(){L(this.template)}}I.utilityMap=s,r("Inputs",I),"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.Input=window.SF.Input||{},window.SF.Input.setState=function(t,e={}){const n=t instanceof HTMLElement?t.closest(c)||t:null;if(!n)return!1;const a=y(n);if(!a)return!1;if(Object.prototype.hasOwnProperty.call(e,"disabled")&&(a.disabled=b(e.disabled)),Object.prototype.hasOwnProperty.call(e,"error")){const t=b(e.error);n.classList.toggle("error",t),a.classList.toggle("error",t)}if(Object.prototype.hasOwnProperty.call(e,"invalid")){const t=b(e.invalid);n.classList.toggle("error",t),a.classList.toggle("error",t)}if(Object.prototype.hasOwnProperty.call(e,"errorMessage")){const t=String(e.errorMessage??""),r=t?function(t){const e=w(t);if(e)return e;const n=document.createElement("span");return n.classList.add("sf-input-hint-text-wrap"),t.append(n),n}(n):w(n);if(r){r.textContent=t;const e=n.classList.contains("error")||a.classList.contains("error");r.dataset.fieldMessage=t&&e?"error":"hint"}}return Object.prototype.hasOwnProperty.call(e,"value")&&(a.value=String(e.value??""),a.dispatchEvent(new Event("input",{bubbles:!0}))),(0,i.U)(n,a,{prefix:"sf-input",labelNode:n.querySelector(".sf-input-text"),required:a.required||Boolean(n.querySelector(".sf-input-required")),invalid:n.classList.contains("error")||a.classList.contains("error"),...x(n)}),!0}),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>_()):_();new MutationObserver(t=>{t.forEach(t=>{t.addedNodes.forEach(t=>{t instanceof Element&&(t.matches?.(c)&&k(t),_(t))})})}).observe(document.documentElement,{childList:!0,subtree:!0})},"44b791419862"(t,e,n){n.a(t,async(t,e)=>{try{var a=n("f8ed4bd5aa8a"),r=n("fbe0570fcc69"),s=n("98e26702f55a"),i=n("e602dd4d6e16"),o=t([r,i]);[r,i]=o.then?(await o)():o;var l=n.n(r);const u=new Set(["text","email","password","search","tel","url"]),d=new Set(["","none","text","tel","url","email","numeric","decimal","search"]),c=(new Set(["bordered","filled","hidden"]),(t,e,n)=>e.has(t)?t:n);class p extends(l()){static get props(){return{size:{default:"1"},appearance:{default:"bordered",values:["bordered","filled","hidden"],aliases:["type"]},label:{default:""},required:{type:Boolean,default:!1},placeholder:{default:""},inputType:{default:"text"},autocomplete:{default:""},inputmode:{default:""},minlength:{default:""},maxlength:{default:""},pattern:{default:""},hint:{default:""},value:{default:""},defaultValue:{default:""},name:{default:""},iconStart:{type:String,default:null},textEnd:{type:String,default:null},leftIcon:{default:""},rightText:{default:""},hintIcon:{default:""},rootClass:{default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},invalid:{type:Boolean,default:!1},errorMessage:{default:""},mask:{type:Boolean,default:!1},maskPattern:{default:""},maskLazy:{default:""},maskPlaceholderChar:{default:""},maskOptions:{default:""},ariaLabel:{attribute:"aria-label",default:""}}}constructor(){super(),this._boundRoot=null}get size(){return(0,s.id)(this.getAttribute("size")||"1","sf-input")}get appearance(){return this.getProp("appearance")}get type(){return this.appearance}get label(){return this.getAttribute("label")||""}get required(){return this.getBooleanAttr("required",!1)}get placeholder(){return this.getAttribute("placeholder")||""}get inputType(){return c(this.getAttribute("input-type")||"text",u,"text")}get autocomplete(){return this.getAttribute("autocomplete")||""}get inputmode(){return c(this.getAttribute("inputmode")||"",d,"")}get minlength(){return this.getAttribute("minlength")||""}get maxlength(){return this.getAttribute("maxlength")||""}get pattern(){return this.getAttribute("pattern")||""}get hint(){return this.getAttribute("hint")||""}get value(){const t=this.getInputElement();return t?t.value:this.getAttribute("value")||""}set value(t){const e=this.getInputElement(),n=String(t??"");null==t?this.removeAttribute("value"):this.setAttribute("value",n);const a=this.querySelector(".sf-input")?.__sfInputMask;a?a.value=n:e&&e.value!==n&&(e.value=n)}get defaultValue(){return this.getAttribute("default-value")??this.getAttribute("value")??""}set defaultValue(t){null!=t?this.setAttribute("default-value",String(t)):this.removeAttribute("default-value")}get name(){return this.getAttribute("name")||""}get leftIcon(){return this.getAttribute("icon-start")??this.getAttribute("left-icon")??""}get rightText(){return this.getAttribute("text-end")??this.getAttribute("right-text")??""}get iconStart(){return this.leftIcon}get textEnd(){return this.rightText}get hintIcon(){return this.getAttribute("hint-icon")||""}get disabled(){return this.getBooleanAttr("disabled",!1)}get readonly(){return this.getBooleanAttr("readonly",!1)}get error(){return this.getBooleanAttr("error",!1)}get invalid(){return this.getBooleanAttr("invalid",!1)}get errorMessage(){return this.getAttribute("error-message")||""}get mask(){return this.getBooleanAttr("mask",!1)}get maskPattern(){return this.getAttribute("mask-pattern")||""}get maskLazy(){return this.hasAttribute("mask-lazy")?this.getBooleanAttr("mask-lazy",!0):""}get maskPlaceholderChar(){return this.getAttribute("mask-placeholder-char")||""}get maskOptions(){return this.getAttribute("mask-options")||""}get ariaLabel(){return this.getProp("ariaLabel")||""}templateContext(){const t=this.getPropsContext(),e=this.hasAttribute("value"),n=this.getInputElement();return this.createTemplateContext({...t,leftIcon:t.iconStart??t.leftIcon,rightText:t.textEnd??t.rightText,iconStart:this.iconStart,textEnd:this.textEnd,type:this.type,maskLazy:this.maskLazy,value:e?t.value:n?n.value:this.defaultValue,defaultValue:this.defaultValue,hasControlledValue:e,component:this})}onDisconnected(){this._boundRoot&&((0,a.Lu)(this._boundRoot),this._boundRoot=null)}afterRender(){if(this._boundRoot&&((0,a.Lu)(this._boundRoot),this._boundRoot=null),this._boundRoot=this.querySelector(".sf-input"),this._boundRoot){const t=this.invalid||this.error;this._boundRoot.classList.toggle("error",t),this.getInputElement()?.classList.toggle("error",t),(0,a.m3)(this._boundRoot)}}getInputElement(){return this.querySelector(".sf-input-field input, input")}template(){return(0,i.P)(this.templateContext())}get state(){const t=this.querySelector(".sf-input"),e=this.getInputElement();return{value:e?.value||"",disabled:!!e?.disabled,invalid:"true"===e?.getAttribute("aria-invalid"),error:t?.classList?.contains("error")||e?.classList?.contains("error")||!1}}onInput(t,e){return"function"==typeof t&&this.addEventListener("input",t,e),this}onChange(t,e){return"function"==typeof t&&this.addEventListener("change",t,e),this}onKeyUp(t,e){return"function"==typeof t&&this.addEventListener("keyup",t,e),this}onKeyDown(t,e){return"function"==typeof t&&this.addEventListener("keydown",t,e),this}onFocus(t,e){return"function"==typeof t&&this.addEventListener("focusin",t,e),this}onBlur(t,e){return"function"==typeof t&&this.addEventListener("focusout",t,e),this}}p.define("sf-input"),e()}catch(t){e(t)}})},e602dd4d6e16(t,e,n){n.a(t,async(t,a)=>{try{n.d(e,{P:()=>l});var r=n("ddf1cdb42ecc"),s=n("e138a730fd7c"),i=t([r]),o=i.then?(await i)():i;r=o[0];function l(t){const{size:e,appearance:n,type:a,label:i,required:o,placeholder:l,inputType:u,autocomplete:d,inputmode:c,minlength:p,maxlength:f,pattern:h,hint:m,value:g,defaultValue:b,hasControlledValue:y,name:w,leftIcon:x,rightText:v,hintIcon:S,disabled:$,error:k,invalid:L,errorMessage:_,mask:I,rootClass:E,rootStyle:C,readonly:A,maskPattern:M,maskLazy:P,maskPlaceholderChar:q,maskOptions:O,ariaLabel:j}=t,F=""===P?"":String(P),T=y?g:b,N=(0,s.h)(t.component,{prefix:"sf-input",required:o,invalid:L||k,hint:m,errorMessage:_}),z=["sf-input",N.invalid?"error":"",`sf-input--size-${e}`,`sf-input--${n??a}`,E,"flex","flex-col"];if("hidden"===a)return r.html`<input
|
|
2
2
|
style=${C||r.nothing}
|
|
3
3
|
type="hidden"
|
|
4
4
|
.value=${T}
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
<span class="sf-input-text">${i}</span>
|
|
15
15
|
${o?r.html`<span class="sf-input-required">*</span>`:""}
|
|
16
16
|
`:"",R=t.component?.hasSlotContent?.("start")?t.component.getSlotContent("start"):t.component?.hasSlotContent?.("left")?t.component.getSlotContent("left"):x?r.html`<span class="sf-input-left flex"><sf-icon icon="${x}"></sf-icon></span>`:"",H=t.component?.hasSlotContent?.("end")?t.component.getSlotContent("end"):t.component?.hasSlotContent?.("right")?t.component.getSlotContent("right"):r.html`
|
|
17
|
-
${
|
|
18
|
-
${
|
|
17
|
+
${v?r.html`<span class="sf-input-right"><span class="sf-input-text">${v}</span></span>`:""}
|
|
18
|
+
${S?r.html`<span class="sf-input-hint flex"><sf-icon icon="${S}"></sf-icon></span>`:""}
|
|
19
19
|
`,U=t.component?.hasSlotContent?.("hint")?t.component.getSlotContent("hint"):m,V=t.component?.hasSlotContent?.("error")?t.component.getSlotContent("error"):_,D=N.invalid&&V?V:U,W=!B&&j?j:r.nothing;return r.html`
|
|
20
20
|
<label
|
|
21
21
|
class=${z.join(" ")}
|
|
@@ -502,7 +502,7 @@
|
|
|
502
502
|
"source_artifacts": [
|
|
503
503
|
{
|
|
504
504
|
"path": "src/smart/inputs/index.js",
|
|
505
|
-
"sha256": "
|
|
505
|
+
"sha256": "e0dbd768559370ce100847309bec321cc12eaeeb14012833f90bcf0bf233fbf0"
|
|
506
506
|
}
|
|
507
507
|
],
|
|
508
508
|
"generated_runtime": [
|
package/package-manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release": "ui-
|
|
3
|
-
"commit": "
|
|
4
|
-
"version": "5.20261022.
|
|
2
|
+
"release": "ui-f2f3e8f912cf",
|
|
3
|
+
"commit": "f2f3e8f912cf618b95b509040465e618208e7322",
|
|
4
|
+
"version": "5.20261022.1814",
|
|
5
5
|
"files": {
|
|
6
6
|
"distr/component/accordion/css/accordion.min.css": "sha256-Sn5M6q2XskfMvRHwMFgraYLTGk0vOUDCRFJGQfCsZ4Y=",
|
|
7
7
|
"distr/component/accordion/js/accordion.min.js": "sha256-HiHgZKWDDIOVBjMwOgKFlJqGKvZWwN3NeJluAWwE6ck=",
|
|
@@ -703,7 +703,7 @@
|
|
|
703
703
|
"distr/core/contracts/dimension-policy.v1.json": "sha256-Ud/7RxYDdlSLYtluZJG1Fue8cwEJlH4/H6JhYk57UCU=",
|
|
704
704
|
"distr/core/contracts/effect.v1.schema.json": "sha256-caMuAo9wMYDtllF6Ig7qfhj3yZwUAxbstpeNkhQeX1M=",
|
|
705
705
|
"distr/core/contracts/interface-fragment.v1.schema.json": "sha256-DxlgQZnZ7mDs/OZNl2oUa54gXoGX94xhNON9YmYELk8=",
|
|
706
|
-
"distr/core/contracts/packages/larena.package.json": "sha256-
|
|
706
|
+
"distr/core/contracts/packages/larena.package.json": "sha256-zU0fkCV0zbbzM++FC1+HTvtH7NrBpM/muHWIpGJvgJA=",
|
|
707
707
|
"distr/core/contracts/ports/simai.admin-navigation-port/1.0.0/kit/cases/a-collapsed-menu-is-kept.json": "sha256-M7kT1bb+06Rb8FJAgInPIGqF5UDp9/jwOXp4NkxhbgQ=",
|
|
708
708
|
"distr/core/contracts/ports/simai.admin-navigation-port/1.0.0/kit/cases/a-language-not-offered-is-refused.json": "sha256-0LpYSZrISAECvX0RJA+tf6ijgyDnoig/ERSQf4KPIAc=",
|
|
709
709
|
"distr/core/contracts/ports/simai.admin-navigation-port/1.0.0/kit/cases/a-language-says-whether-the-page-reloads.json": "sha256-FbBIlgqQ3C97C2txB7GUqHrw4UXIwm/r7ca7kF6p4Gg=",
|
|
@@ -1654,11 +1654,11 @@
|
|
|
1654
1654
|
"distr/smart/country-code/studio.fixture.json": "sha256-LtXKWPCR8kwTe0RyliHoyf4oZ7naswRla2EPKRIC8tc=",
|
|
1655
1655
|
"distr/smart/country-code/studio.scenario.json": "sha256-hI3m/cRUlMRRJp/omAgLwK7/QjKKGZBth8HKRdotUB8=",
|
|
1656
1656
|
"distr/smart/country-code/template/default.js": "sha256-4ggijmr7AOhWHrlKaa39DW5lM1BosAUyI5Pbl5TLrjM=",
|
|
1657
|
-
"distr/smart/datepicker/js/datepicker.min.js": "sha256-
|
|
1658
|
-
"distr/smart/datepicker/smart.manifest.json": "sha256-
|
|
1657
|
+
"distr/smart/datepicker/js/datepicker.min.js": "sha256-xUZpEoRk47/BQ1TyN+y/g+b8+nRreB6K5yRElDnE+V0=",
|
|
1658
|
+
"distr/smart/datepicker/smart.manifest.json": "sha256-rlAa1YEeQEPYYagYIynWewSwrOVV0f/SpSut54soMzk=",
|
|
1659
1659
|
"distr/smart/datepicker/studio.fixture.json": "sha256-1jZUZwa4puNNd9TFv0yRHQ6zNd3fF0dL9fkutfDzypc=",
|
|
1660
1660
|
"distr/smart/datepicker/studio.scenario.json": "sha256-KouzoXQC719xxOHbt7imlxGmtY0HyFuNJ9ADKrPp9BY=",
|
|
1661
|
-
"distr/smart/datepicker/template/default.js": "sha256-
|
|
1661
|
+
"distr/smart/datepicker/template/default.js": "sha256-fJs3ntqJEefjHOftMHYSH8uYtdaI1T7soa+eL4vZhJI=",
|
|
1662
1662
|
"distr/smart/download-file/js/download-file.min.js": "sha256-dem55XquSxY98NYM/505fwgUJK7XqukuOjaG0PFxXkE=",
|
|
1663
1663
|
"distr/smart/download-file/smart.manifest.json": "sha256-W6qfEuh74JPEXdCqGoOflJbKA1HYkZzIM+V9Aq7A9kA=",
|
|
1664
1664
|
"distr/smart/download-file/studio.fixture.json": "sha256-9QSk1/CNQ3uDL9Sx+E34TJHDqOCtM/tXjOdlHz5h0cY=",
|
|
@@ -1681,7 +1681,7 @@
|
|
|
1681
1681
|
"distr/smart/empty-state/studio.fixture.json": "sha256-kTLJqzVW68pHYwlYbcOKbkAn+jfoR3/c9Txt2VSGwbY=",
|
|
1682
1682
|
"distr/smart/empty-state/studio.scenario.json": "sha256-xGWMssotHcMfkfYkr+GqVOK9uSoMlILYGkGrl7wmYS0=",
|
|
1683
1683
|
"distr/smart/empty-state/template/default.js": "sha256-2JbQ3FtiwpMsdL5pxjFtzpvuKqUFEipx/VjW00jmFuc=",
|
|
1684
|
-
"distr/smart/field-renderers/js/field-renderers.min.js": "sha256-
|
|
1684
|
+
"distr/smart/field-renderers/js/field-renderers.min.js": "sha256-I9JrGgHmsHCtL246cJY0e6U4OZiZ0fLAUUecOb4UeP4=",
|
|
1685
1685
|
"distr/smart/file-preview/js/file-preview.min.js": "sha256-hWHM+WmhSr+MhStsQOYL/XqZOWKc77idX2qQEAvTpa0=",
|
|
1686
1686
|
"distr/smart/file-preview/smart.manifest.json": "sha256-Uxwj2RD8LkP1h627+gHP/+gJ/0ZLlKRjoWVQMM8I3hU=",
|
|
1687
1687
|
"distr/smart/file-preview/studio.fixture.json": "sha256-5d5ekmgTkaQ1+P+DEOjs2HR3QpD+yYeMevh469larXs=",
|
|
@@ -1723,8 +1723,8 @@
|
|
|
1723
1723
|
"distr/smart/inline-editor/studio.fixture.json": "sha256-BSs49D+yRY9vujjTHQTza+3oZ/FZC09yt50l4ZInOT8=",
|
|
1724
1724
|
"distr/smart/inline-editor/studio.scenario.json": "sha256-HomirNpwoWa8CVcWyMrUi3MDzBwPMa6nFJzuFfds5MQ=",
|
|
1725
1725
|
"distr/smart/inputs/css/inputs.min.css": "sha256-rVByHBlmF128EzPJtlxwGpqkj7mQbULYW3cpNddO8AA=",
|
|
1726
|
-
"distr/smart/inputs/js/inputs.min.js": "sha256-
|
|
1727
|
-
"distr/smart/inputs/smart.manifest.json": "sha256-
|
|
1726
|
+
"distr/smart/inputs/js/inputs.min.js": "sha256-YoiRI12WBdwA79Cfcx03YpJ3bYOo02YEXzmFZJ/Iw4I=",
|
|
1727
|
+
"distr/smart/inputs/smart.manifest.json": "sha256-scVV2RO7+ctzlbXdTLlDUPt+znyj6Fj1G653aJUMxvM=",
|
|
1728
1728
|
"distr/smart/inputs/studio.fixture.json": "sha256-P500X6JyuXbYibmFzSMGeuXAzIEWDiYHY2KLoTf3NeA=",
|
|
1729
1729
|
"distr/smart/inputs/studio.scenario.json": "sha256-luBRT3MwnpU5fsFy8DpeKC5/FI8L2+zbSLDq55Wum9E=",
|
|
1730
1730
|
"distr/smart/inputs/template/default.css": "sha256-7+FrD0mDQDNU0sVF9bAx9bX+d2dvjddl9vZtVjRl6/0=",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simai-studio/ui",
|
|
3
|
-
"version": "5.20261022.
|
|
4
|
-
"description": "SIMAI Framework distribution, release ui-
|
|
3
|
+
"version": "5.20261022.1814",
|
|
4
|
+
"description": "SIMAI Framework distribution, release ui-f2f3e8f912cf: Core, the Loader, components, utilities and Smart Components, ready to serve from distr/.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://ui.simai.io/",
|
|
7
7
|
"repository": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"README.md"
|
|
18
18
|
],
|
|
19
19
|
"simai": {
|
|
20
|
-
"release": "ui-
|
|
21
|
-
"commit": "
|
|
20
|
+
"release": "ui-f2f3e8f912cf",
|
|
21
|
+
"commit": "f2f3e8f912cf618b95b509040465e618208e7322"
|
|
22
22
|
}
|
|
23
23
|
}
|